3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2026-07-10 09:16:15 +00:00
yosys/tests/arch/fabulous/complexflop.ys
Leo Moser e87d8e162e fabulous: update tests for new options
Signed-off-by: Leo Moser <leomoser99@gmail.com>
2026-07-01 13:38:44 +02:00

37 lines
1.2 KiB
Text

read_verilog <<EOT
module top ( input d0, d1, d2, d3, ce, sr, clk, output reg q0, q1, q2, q3 );
always @(posedge clk)
begin
if (sr) begin
q0 <= 1'b0;
q1 <= 1'b1;
end else begin
q0 <= d0;
q1 <= d1;
end
if (ce) begin
if (sr) begin
q2 <= 1'b0;
q3 <= 1'b1;
end else begin
q2 <= d2;
q3 <= d3;
end
end
end
endmodule
EOT
hierarchy -top top
proc
flatten
equiv_opt -assert -map prims.v synth_fabulous -noiopad -ff $_DFF_P_ x -ff $_DFFE_PP_ x -ff $_SDFF_PP?_ x -ff $_SDFFCE_PP?P_ x -ff $_DLATCH_?_ x -extra-plib prims.v -cells-map cells_map.v -extra-map arith_map.v -extra-map ff_map.v -extra-map latches_map.v # equivalency check
design -load postopt # load the post-opt design (otherwise equiv_opt loads the pre-opt design)
cd top # Constrain all select calls below inside the top module
select -assert-count 1 t:LUTFF_SR
select -assert-count 1 t:LUTFF_SS
select -assert-count 1 t:LUTFF_ESR
select -assert-count 1 t:LUTFF_ESS
select -assert-none t:LUTFF_SR t:LUTFF_SS t:LUTFF_ESR t:LUTFF_ESS %% t:* %D