This commit is contained in:
Kamil Rakoczy 2024-11-28 00:10:04 +01:00 committed by GitHub
commit af64198c2e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 19 additions and 1 deletions

View File

@ -243,7 +243,7 @@ struct SetundefPass : public Pass {
{ {
for (auto *cell : module->selected_cells()) { for (auto *cell : module->selected_cells()) {
for (auto &parameter : cell->parameters) { for (auto &parameter : cell->parameters) {
for (auto bit : parameter.second) { for (auto &bit : parameter.second.bits()) {
if (bit > RTLIL::State::S1) if (bit > RTLIL::State::S1)
bit = worker.next_bit(); bit = worker.next_bit();
} }

10
tests/various/setundef.sv Normal file
View File

@ -0,0 +1,10 @@
module foo #(parameter [1:0] a) (output [1:0] o);
assign o = a;
endmodule
module top(output [1:0] o);
foo #(2'b0x) foo(o);
always_comb begin
assert(o == 2'b00);
end
endmodule

View File

@ -0,0 +1,8 @@
read_verilog -sv setundef.sv
setundef -zero -params
hierarchy -top top
flatten
proc
async2sync
write_json
sat -seq 5 -prove-asserts