mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-23 17:15:33 +00:00
opt_dff: fix infinite loop
This commit is contained in:
parent
7f7ad87b7b
commit
c33748a9f3
2 changed files with 49 additions and 2 deletions
36
tests/opt/bug4979.ys
Normal file
36
tests/opt/bug4979.ys
Normal file
|
@ -0,0 +1,36 @@
|
|||
read_verilog << EOT
|
||||
module a (
|
||||
input b,
|
||||
input h,
|
||||
input i,
|
||||
output reg o
|
||||
);
|
||||
wire c, j, k, e, g;
|
||||
|
||||
reg l, n, d, f;
|
||||
|
||||
always @(posedge b or negedge c) begin
|
||||
if (c) begin
|
||||
o = j > l;
|
||||
l = (l | j) ? k ? h : i ? 0 : n : 0;
|
||||
end
|
||||
end
|
||||
|
||||
always @(h) begin
|
||||
d = k;
|
||||
end
|
||||
|
||||
always @(e or g or f) begin
|
||||
if (e) begin
|
||||
l = 0;
|
||||
end else begin
|
||||
d = g;
|
||||
l = f;
|
||||
end
|
||||
end
|
||||
|
||||
endmodule
|
||||
EOT
|
||||
|
||||
synth -run coarse
|
||||
opt -undriven
|
Loading…
Add table
Add a link
Reference in a new issue