yosys/tests/various/synth_latch_warning.ys

32 lines
640 B
Plaintext
Raw Normal View History

2026-06-17 11:27:43 +02:00
read_verilog <<EOT
module top(input d, en, output reg q);
always @* if (en) q = d;
endmodule
EOT
2026-06-17 17:36:32 +02:00
design -save read
logger -expect warning "Latch inferred for signal" 1
synth_ice40 -latches warn
2026-06-17 11:27:43 +02:00
logger -check-expected
2026-06-17 17:36:32 +02:00
select -assert-count 1 t:SB_LUT4
design -load read
2026-06-18 18:00:51 +02:00
synth_ice40 -latches info
2026-06-17 17:36:32 +02:00
select -assert-count 1 t:SB_LUT4
2026-07-14 10:39:38 +02:00
# always_latch
design -reset
read_verilog -sv <<EOT
module top(input d, en, output reg q);
always_latch if (en) q = d;
endmodule
EOT
logger -expect-no-warnings
synth_ice40
logger -check-expected
select -assert-count 1 t:SB_LUT4
2026-06-17 17:36:32 +02:00
design -load read
2026-07-14 10:39:38 +02:00
logger -expect error "Latch inferred for signal" 1
2026-06-17 17:36:32 +02:00
synth_ice40