Fix #1220: Allow uwire arrays as input ports
Uwire arrays were triggering assertion failures because they were kept virtualized (pins array NULL) like reg arrays. However, unlike reg arrays, uwire arrays used as input ports need their nexuses initialized for the target code generation to work properly. Two changes: 1. elab_sig.cc: Devirtualize pins for UNRESOLVED_WIRE (uwire) type, same as regular WIRE type. 2. t-dll-api.cc: Update assertion in ivl_signal_nex to also accept IVL_SIT_UWIRE when pins array is NULL. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
e00e89d8f8
commit
73cd6fa0c7
|
|
@ -1210,7 +1210,8 @@ NetNet* PWire::elaborate_sig(Design*des, NetScope*scope)
|
|||
|
||||
NetNet*sig = new NetNet(scope, name_, wtype, unpacked_dimensions, type);
|
||||
|
||||
if (wtype == NetNet::WIRE) sig->devirtualize_pins();
|
||||
if (wtype == NetNet::WIRE || wtype == NetNet::UNRESOLVED_WIRE)
|
||||
sig->devirtualize_pins();
|
||||
sig->set_line(*this);
|
||||
sig->port_type(port_type_);
|
||||
sig->lexical_pos(lexical_pos_);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,19 @@
|
|||
// Test for GitHub issue #1220
|
||||
// Assertion failed with uwire multi-dimensional input port
|
||||
module sub(input uwire data [1:0]);
|
||||
initial begin
|
||||
#1;
|
||||
if (data[0] === 1'b0 && data[1] === 1'b1)
|
||||
$display("PASSED");
|
||||
else
|
||||
$display("FAILED: data[0]=%0b data[1]=%0b", data[0], data[1]);
|
||||
end
|
||||
endmodule
|
||||
|
||||
module test;
|
||||
wire w [1:0];
|
||||
assign w[0] = 1'b0;
|
||||
assign w[1] = 1'b1;
|
||||
|
||||
sub dut(.data(w));
|
||||
endmodule
|
||||
|
|
@ -229,6 +229,7 @@ br_gh782b normal,-g2009 ivltests gold=br_gh782b.gold
|
|||
br_gh800 normal,-g2009 ivltests
|
||||
br_gh801 normal,-g2012 ivltests
|
||||
br_gh801b normal,-g2012 ivltests
|
||||
br_gh1220 normal,-g2012 ivltests
|
||||
br_gh1222 CE,-g2009 ivltests gold=br_gh1222.gold
|
||||
br_gh1223a normal,-g2009 ivltests
|
||||
br_gh1223b normal,-g2009 ivltests
|
||||
|
|
|
|||
|
|
@ -2496,8 +2496,8 @@ extern "C" ivl_nexus_t ivl_signal_nex(ivl_signal_t net, unsigned word)
|
|||
if (net->pins) {
|
||||
return net->pins[word];
|
||||
} else {
|
||||
// net->pins can be NULL for a virtualized reg array.
|
||||
assert(net->type_ == IVL_SIT_REG);
|
||||
// net->pins can be NULL for a virtualized reg or uwire array.
|
||||
assert(net->type_ == IVL_SIT_REG || net->type_ == IVL_SIT_UWIRE);
|
||||
return NULL;
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in New Issue