3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-10-05 15:34:02 +00:00

fix(parse): #5234 adjust width of rhs according to lhs

This commit is contained in:
rhanqtl 2025-09-04 23:19:11 +08:00 committed by Emil J. Tywoniak
parent c0577890f0
commit 11b829ba70
3 changed files with 32 additions and 1 deletions

View file

@ -0,0 +1,17 @@
read_verilog -sv -formal <<EOF
module counter(input clk, input [2:0] rst, input [0:3] rst_val, output logic is_full);
logic [1:0] ctr;
always @(posedge clk)
if (rst)
ctr <= 0;
else
ctr <= ctr+1;
assign is_full = (ctr == 2'b11);
endmodule
EOF
hierarchy -check -top counter
prep -top counter
fminit -seq rst 0,1,2'b11,2'sb11,rst_val