3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2026-06-19 23:36:30 +00:00
yosys/tests/proc/proc_latches.ys
2026-06-18 18:00:51 +02:00

32 lines
641 B
Text

# warn
read_verilog <<EOT
module top(input g, rn, d, output reg q);
always @* if (~rn) q <= 0; else if (g) q <= d;
endmodule
EOT
logger -expect warning "Latch inferred for signal" 1
proc
logger -check-expected
design -reset
# info
read_verilog <<EOT
module top(input g, rn, d, output reg q);
always @* if (~rn) q <= 0; else if (g) q <= d;
endmodule
EOT
logger -expect-no-warnings
proc -latches info
logger -check-expected
design -reset
# error
read_verilog <<EOT
module top(input g, rn, d, output reg q);
always @* if (~rn) q <= 0; else if (g) q <= d;
endmodule
EOT
logger -expect error "Latch inferred for signal" 1
proc -latches error