Fix delayed assignment malformed LHS assertion (#5904).

This commit is contained in:
Wilson Snyder 2025-03-30 17:38:54 -04:00
parent b49351356e
commit f3684a85b9
3 changed files with 19 additions and 7 deletions

View File

@ -61,6 +61,7 @@ Verilator 5.035 devel
* Fix V3Gate assertion on eliminated circular logic (#5889) (#5898). [Geza Lore]
* Fix process comparisons (#5896).
* Fix ccache with clang (#5899). [Geza Lore]
* Fix delayed assignment malformed LHS assertion (#5904).
Verilator 5.034 2025-02-24

View File

@ -347,8 +347,8 @@ class DelayedVisitor final : public VNVisitor {
arrSelp->bitp(captureVal(scopep, insertp, arrSelp->bitp()->unlinkFrBack(), tmpName));
nodep = arrSelp->fromp();
}
// What remains must be an AstVarRef
UASSERT_OBJ(VN_IS(nodep, VarRef), lhsp, "Malformed LHS in NBA");
// What remains must be an AstVarRef, or some sort of select, we assume can reuse it.
UASSERT_OBJ(nodep->isPure(), lhsp, "Malformed LHS in NBA");
// Now have been converted to use the captured values
return lhsp;
}

View File

@ -6,7 +6,11 @@
module t;
Iface ifc();
rvlab_tests uut (.ifc);
always begin
uut.test_idcode();
end
initial begin
#1;
$write("*-* All Finished *-*\n");
@ -15,12 +19,19 @@ module t;
endmodule
interface Iface;
int tck;
int tdo;
logic tck;
logic tdo;
task tsk(input int data_i, output int data_o);
task tsk(output logic [31:0] data_o, input logic [31:0] data_i);
@(posedge tck);
data_o <= tdo;
data_o[$size(data_i)-1] <= tdo;
endtask
endinterface
module rvlab_tests (
Iface ifc);
task test_idcode();
bit [31:0] idcode_read;
ifc.tsk(idcode_read, '0);
endtask
endmodule