mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-23 00:55:32 +00:00
Merge pull request #1046 from bogdanvuk/master
Optimizing DFFs whose initial value prevents their value from changing
This commit is contained in:
commit
1c7ce251f3
5 changed files with 128 additions and 17 deletions
12
tests/opt/opt_ff_sat.v
Normal file
12
tests/opt/opt_ff_sat.v
Normal file
|
@ -0,0 +1,12 @@
|
|||
module top (
|
||||
input clk,
|
||||
output reg [7:0] cnt
|
||||
);
|
||||
initial cnt = 0;
|
||||
always @(posedge clk) begin
|
||||
if (cnt < 20)
|
||||
cnt <= cnt + 1;
|
||||
else
|
||||
cnt <= 0;
|
||||
end
|
||||
endmodule
|
5
tests/opt/opt_ff_sat.ys
Normal file
5
tests/opt/opt_ff_sat.ys
Normal file
|
@ -0,0 +1,5 @@
|
|||
read_verilog opt_ff_sat.v
|
||||
prep -flatten
|
||||
opt_rmdff -sat
|
||||
synth
|
||||
select -assert-count 5 t:$_DFF_P_
|
Loading…
Add table
Add a link
Reference in a new issue