3
0
Fork 0
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:
Clifford Wolf 2019-06-28 08:30:18 +02:00 committed by GitHub
commit 1c7ce251f3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 128 additions and 17 deletions

12
tests/opt/opt_ff_sat.v Normal file
View 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
View file

@ -0,0 +1,5 @@
read_verilog opt_ff_sat.v
prep -flatten
opt_rmdff -sat
synth
select -assert-count 5 t:$_DFF_P_