3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-09-01 15:50:42 +00:00

check: Extend testing

This commit is contained in:
Martin Povišer 2024-02-12 12:32:15 +01:00
parent b6112b3551
commit e1e77a7fa9
3 changed files with 69 additions and 1 deletions

17
tests/various/check_2.ys Normal file
View file

@ -0,0 +1,17 @@
# just so slightly adjust the example from check.ys to induce a loop
design -reset
read -vlog2k <<EOF
module top(input clk, input a, input b, output [9:0] x);
wire [9:0] ripple;
reg [9:0] prev_ripple = 9'b0;
always @(posedge clk) prev_ripple <= ripple;
assign ripple = {ripple[8:1], a, ripple[0]} ^ prev_ripple;
assign x = ripple[9] + b;
endmodule
EOF
hierarchy -top top
prep
logger -expect warning "found logic loop in module top:" 1
logger -expect error "Found 1 problems in 'check -assert'" 1
check -assert