From d4759e02aaf88a920ee48849056e7d133a44f282 Mon Sep 17 00:00:00 2001 From: Martin Whitaker Date: Sat, 3 Feb 2024 21:12:05 +0000 Subject: [PATCH] Allow multiple procedural assignents to same part of mixed-mode variables. If we have a variable which is part driven by a continuous assignment, the parts that are not driven by that assignment can be the target of more than one procedural assignment. So we need to only test the cassign mask, not test and set it, when elaborating the procedural assignments. --- elab_lval.cc | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/elab_lval.cc b/elab_lval.cc index d21bb9e35..61ce9973e 100644 --- a/elab_lval.cc +++ b/elab_lval.cc @@ -614,8 +614,7 @@ bool PEIdent::elaborate_lval_net_bit_(Design*des, if ((reg->type()==NetNet::UNRESOLVED_WIRE) && !is_force) { ivl_assert(*this, reg->coerced_to_uwire()); - bool rct = reg->test_and_set_part_driver(loff+lwid-1, loff); - if (rct) { + if (reg->test_part_driven(loff+lwid-1, loff)) { report_mixed_assignment_conflict_("slice"); des->errors += 1; return false; @@ -684,8 +683,7 @@ bool PEIdent::elaborate_lval_net_bit_(Design*des, if ((reg->type()==NetNet::UNRESOLVED_WIRE) && !is_force) { ivl_assert(*this, reg->coerced_to_uwire()); - bool rct = reg->test_and_set_part_driver(loff, loff); - if (rct) { + if (reg->test_part_driven(loff, loff)) { report_mixed_assignment_conflict_("bit select"); des->errors += 1; return false; @@ -771,8 +769,7 @@ bool PEIdent::elaborate_lval_net_part_(Design*des, if ((reg->type()==NetNet::UNRESOLVED_WIRE) && !is_force) { ivl_assert(*this, reg->coerced_to_uwire()); - bool rct = reg->test_and_set_part_driver(msb, lsb); - if (rct) { + if (reg->test_part_driven(msb, lsb)) { report_mixed_assignment_conflict_("part select"); des->errors += 1; return false;