Improve error messages for mixed procedural/continuous assignments.

We have already eliminated procedural assignments to uwires, so if
we find a l-value of type UNRESOLVED_WIRE, it must be a variable
that has a continuous assignment. Report it as such.
This commit is contained in:
Martin Whitaker 2024-02-02 23:26:22 +00:00
parent 11fc90faf7
commit 42c5174c8d
1 changed files with 8 additions and 5 deletions

View File

@ -332,9 +332,10 @@ NetAssign_*PEIdent::elaborate_lval_var_(Design *des, NetScope *scope,
ivl_assert(*this, use_sel == index_component_t::SEL_NONE); ivl_assert(*this, use_sel == index_component_t::SEL_NONE);
if (reg->type()==NetNet::UNRESOLVED_WIRE && !is_force) { if (reg->type()==NetNet::UNRESOLVED_WIRE && !is_force) {
cerr << get_fileline() << ": error: " ivl_assert(*this, reg->coerced_to_uwire());
<< path_ << " Unable to assign to unresolved wires." cerr << get_fileline() << ": error: Cannot perform "
<< endl; "procedural assignment to '" << reg->name()
<< "' because it is also continuously assigned." << endl;
des->errors += 1; des->errors += 1;
return 0; return 0;
} }
@ -466,8 +467,10 @@ NetAssign_* PEIdent::elaborate_lval_net_word_(Design*des,
} }
if ((reg->type()==NetNet::UNRESOLVED_WIRE) && !is_force) { if ((reg->type()==NetNet::UNRESOLVED_WIRE) && !is_force) {
cerr << get_fileline() << ": error: " ivl_assert(*this, reg->coerced_to_uwire());
<< "Unable to assign words of unresolved wire array." << endl; cerr << get_fileline() << ": error: Cannot perform "
"procedural assignment to word in array '" << reg->name()
<< "' because it is also continuously assigned." << endl;
des->errors += 1; des->errors += 1;
return 0; return 0;
} }