tests: add testcase for abc9 -dff preserving flop names
authorEddie Hung <eddie@fpgeh.com>
Mon, 25 May 2020 14:18:21 +0000 (07:18 -0700)
committerEddie Hung <eddie@fpgeh.com>
Mon, 25 May 2020 15:43:33 +0000 (08:43 -0700)
tests/arch/xilinx/abc9_dff.ys

index fd343969beb733d41c1c1f9889f5020af221b0a0..c549e1fdc5217eadce2be64cf5424fd6c946768d 100644 (file)
@@ -82,4 +82,38 @@ select -assert-count 1 t:FDPE
 select -assert-count 2 t:INV
 select -assert-count 0 t:FD* t:INV %% t:* %D
 
+
+design -reset
+read_verilog <<EOT
+module top(input clk, input d, output q);
+reg r;
+always @(posedge clk) begin
+r <= d;
+end
+assign q = ~r;
+endmodule
+EOT
+proc
+equiv_opt -assert -multiclock -map +/xilinx/cells_sim.v synth_xilinx -abc9 -dff -noiopad -noclkbuf
+design -load postopt
+select -assert-count 1 t:FDRE %co w:r %i
+
+
+design -reset
+read_verilog <<EOT
+module top(input clk, input a, b, output reg q1, output q2);
+reg r;
+always @(posedge clk) begin
+    q1 <= a | b;
+    r <= ~(~a & ~b);
+end
+assign q2 = r;
+endmodule
+EOT
+proc
+equiv_opt -assert -multiclock -map +/xilinx/cells_sim.v synth_xilinx -abc9 -dff -noiopad -noclkbuf
+design -load postopt
+select -assert-count 1 t:FDRE %co %a w:r %i
+
+
 logger -expect-no-warnings