Scan concat arguments with test_width.
Even though we cannot immediately give a width for a concatenation that has a repeat expression (the expression must be evaluated first) we still must scan the test_width of the arguments so that they can resolve their types.
This commit is contained in:
parent
04377151bc
commit
7c50c9aedf
20
elab_expr.cc
20
elab_expr.cc
|
|
@ -1359,12 +1359,26 @@ unsigned PEConcat::test_width(Design*des, NetScope*scope,
|
||||||
{
|
{
|
||||||
expr_type_ = IVL_VT_LOGIC;
|
expr_type_ = IVL_VT_LOGIC;
|
||||||
|
|
||||||
if (debug_elaborate)
|
unsigned count_width = 0;
|
||||||
cerr << get_fileline() << ": debug: CONCAT MISSING TEST_WIDTH!" << endl;
|
for (unsigned idx = 0 ; idx < parms_.count() ; idx += 1)
|
||||||
|
count_width += parms_[idx]->test_width(des, scope, 0, 0, expr_type__, unsized_flag);
|
||||||
|
|
||||||
|
if (repeat_) {
|
||||||
|
// The repeat expression is self-determined and its own type.
|
||||||
|
ivl_variable_type_t tmp_type = IVL_VT_NO_TYPE;
|
||||||
|
bool tmp_flag = false;
|
||||||
|
repeat_->test_width(des, scope, 0, 0, tmp_type, tmp_flag);
|
||||||
|
|
||||||
|
count_width = 0;
|
||||||
|
if (debug_elaborate)
|
||||||
|
cerr << get_fileline() << ": debug: "
|
||||||
|
<< "CONCAT MISSING TEST_WIDTH WHEN REPEAT IS PRESENT!"
|
||||||
|
<< endl;
|
||||||
|
}
|
||||||
|
|
||||||
expr_type__ = expr_type_;
|
expr_type__ = expr_type_;
|
||||||
unsized_flag = false;
|
unsized_flag = false;
|
||||||
return 0;
|
return count_width;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Keep track of the concatenation/repeat depth.
|
// Keep track of the concatenation/repeat depth.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue