3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-07-30 16:03:17 +00:00

satgen, simlib: Consistent x-propagation for $pmux cells

This updates satgen and simlib to use a `$pmux` model where the output
is fully X when the S input is not all zero or one-hot with no x bits.
This commit is contained in:
Jannis Harder 2022-11-10 16:17:54 +01:00
parent 1e67c3a3c2
commit b982ab4f59
2 changed files with 20 additions and 18 deletions

View file

@ -1331,10 +1331,17 @@ always @* begin
Y = A;
found_active_sel_bit = 0;
for (i = 0; i < S_WIDTH; i = i+1)
if (S[i]) begin
Y = found_active_sel_bit ? 'bx : B >> (WIDTH*i);
found_active_sel_bit = 1;
end
case (S[i])
1'b1: begin
Y = found_active_sel_bit ? 'bx : B >> (WIDTH*i);
found_active_sel_bit = 1;
end
1'b0: ;
1'bx: begin
Y = 'bx;
found_active_sel_bit = 'bx;
end
endcase
end
endmodule