Fix Dfg circular driver tracing with partial assignments

This commit is contained in:
Geza Lore 2025-10-09 09:25:39 +01:00
parent 49c51af841
commit e33b24fad2
2 changed files with 14 additions and 1 deletions

View File

@ -187,7 +187,8 @@ class TraceDriver final : public DfgVisitor {
// as a splice cannot be fed into arbitray logic
if (DfgVertexSplice* const splicep = resp->cast<DfgVertexSplice>()) {
DfgVertexVar* const tmpp = createTmp("TraceDriver", splicep);
splicep->replaceWith(tmpp);
// Note: we can't do 'splicep->replaceWith(tmpp)', as other
// variable sinks of the splice might have a defaultp driver.
tmpp->srcp(splicep);
resp = tmpp;
}

View File

@ -249,4 +249,16 @@ module t (
`signal(ARRAY_4, 32);
assign ARRAY_4 = array_4[2];
logic [1:0] packed_0; // UNOPTFLAT
logic packed_0_lsb;
always_comb begin
packed_0[1] = rand_b[1];
packed_0_lsb = packed_0[0];
end
always_comb packed_0[0] = rand_b[0];
assign PACKED_0 = packed_0;
`signal(PACKED_0, 2);
`signal(PACKED_0_LSB, 1);
assign PACKED_0_LSB = packed_0_lsb;
endmodule