q <= d;
endmodule
-module dffsr
+module dffs
( input d, clk, pre, clr, output reg q );
initial begin
q = 0;
end
- always @( posedge clk, posedge pre, posedge clr )
- if ( clr )
- q <= 1'b0;
- else if ( pre )
+ always @( posedge clk )
+ if ( pre )
q <= 1'b1;
else
q <= d;
endmodule
-module ndffnsnr
+module ndffnr
( input d, clk, pre, clr, output reg q );
initial begin
q = 0;
end
- always @( negedge clk, negedge pre, negedge clr )
+ always @( negedge clk )
if ( !clr )
q <= 1'b0;
- else if ( !pre )
- q <= 1'b1;
else
q <= d;
endmodule
output b,b1,b2,b3
);
-dffsr u_dffsr (
+dffs u_dffs (
.clk (clk ),
.clr (clr),
.pre (pre),
.q (b )
);
-ndffnsnr u_ndffnsnr (
+ndffnr u_ndffnr (
.clk (clk ),
.clr (clr),
.pre (pre),
select -assert-count 1 t:BUFG
select -assert-count 3 t:FDRE
select -assert-count 1 t:FDRE_1
-select -assert-count 4 t:LUT2
-select -assert-count 4 t:LUT3
-select -assert-none t:BUFG t:FDRE t:FDRE_1 t:LUT2 t:LUT3 %% t:* %D
+select -assert-count 5 t:LUT2
+select -assert-none t:BUFG t:FDRE t:FDRE_1 t:LUT2 %% t:* %D
cd top
select -assert-count 1 t:LUT1
select -assert-count 2 t:LUT3
+#Xilinx Vivado synthesizes LDCE cell for this case. Need support it.
select -assert-count 3 t:$_DLATCH_P_
select -assert-none t:LUT1 t:LUT3 t:$_DLATCH_P_ %% t:* %D
equiv_opt -assert -map +/xilinx/cells_sim.v -map +/simcells.v synth_xilinx # 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
+#Xilinx Vivado synthesizes OBUFT cell for this case. Need support it.
select -assert-count 1 t:$_TBUF_
select -assert-none t:$_TBUF_ %% t:* %D