Fix lambda parameter types in queue min and max (#7962)
Signed-off-by: Bartosz Skorowski <bskorowski@internships.antmicro.com>
This commit is contained in:
parent
3924fe9c18
commit
176e333774
|
|
@ -36,6 +36,7 @@ Artur Bieniek
|
|||
AUDIY
|
||||
Aylon Chaim Porat
|
||||
Bartłomiej Chmiel
|
||||
Bartosz Skorowski
|
||||
Benjamin Collier
|
||||
Brian Li
|
||||
Cameron Kirk
|
||||
|
|
|
|||
|
|
@ -932,7 +932,7 @@ public:
|
|||
VlQueue min(T_Func with_func) const {
|
||||
if (m_deque.empty()) return VlQueue{};
|
||||
const auto it = std::min_element(m_deque.cbegin(), m_deque.cend(),
|
||||
[&with_func](const IData& a, const IData& b) {
|
||||
[&with_func](const T_Value& a, const T_Value& b) {
|
||||
return with_func(0, a) < with_func(0, b);
|
||||
});
|
||||
return VlQueue::consV(*it);
|
||||
|
|
@ -946,7 +946,7 @@ public:
|
|||
VlQueue max(T_Func with_func) const {
|
||||
if (m_deque.empty()) return VlQueue{};
|
||||
const auto it = std::max_element(m_deque.cbegin(), m_deque.cend(),
|
||||
[&with_func](const IData& a, const IData& b) {
|
||||
[&with_func](const T_Value& a, const T_Value& b) {
|
||||
return with_func(0, a) < with_func(0, b);
|
||||
});
|
||||
return VlQueue::consV(*it);
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ module t;
|
|||
bit b;
|
||||
string string_q[$];
|
||||
string string_qv[$];
|
||||
string string_qe[$];
|
||||
point_3d points_q[$]; // Same as q and qv, but complex value type
|
||||
point_3d points_qv[$];
|
||||
Cls cls;
|
||||
|
|
@ -180,6 +181,19 @@ module t;
|
|||
qv = qe.max;
|
||||
`checkp(qv, "'{}");
|
||||
|
||||
string_qv = string_q.min;
|
||||
`checks(string_qv[0], "A");
|
||||
string_qv = string_q.min(x) with (int'(x[0]) + 10);
|
||||
`checks(string_qv[0],"A");
|
||||
string_qv = string_q.max;
|
||||
`checks(string_qv[0], "b");
|
||||
string_qv = string_q.max(x) with (int'(x[0]) + 10);
|
||||
`checks(string_qv[0],"b");
|
||||
string_qv = string_qe.min;
|
||||
`checkp(string_qv,"'{}");
|
||||
string_qv = string_qe.max;
|
||||
`checkp(string_qv,"'{}");
|
||||
|
||||
// Reduction methods
|
||||
i = q.sum;
|
||||
`checkh(i, 32'hc);
|
||||
|
|
|
|||
Loading…
Reference in New Issue