diff options
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/aiger/run-test.sh | 4 | ||||
-rw-r--r-- | tests/aiger/symbols.aag | 9 | ||||
-rw-r--r-- | tests/aiger/symbols.aig | 8 | ||||
-rw-r--r-- | tests/arch/ecp5/bug1459.ys | 25 | ||||
-rw-r--r-- | tests/arch/ecp5/bug1630.il.gz | bin | 0 -> 8527 bytes | |||
-rw-r--r-- | tests/arch/ecp5/bug1630.ys | 2 | ||||
-rw-r--r-- | tests/arch/ice40/bug1626.ys | 217 | ||||
-rw-r--r-- | tests/arch/ice40/bug1644.il.gz | bin | 0 -> 25669 bytes | |||
-rw-r--r-- | tests/arch/ice40/bug1644.ys | 2 | ||||
-rw-r--r-- | tests/arch/ice40/ice40_dsp.ys | 11 | ||||
-rw-r--r-- | tests/arch/xilinx/abc9_dff.ys | 32 | ||||
-rw-r--r-- | tests/arch/xilinx/abc9_map.ys | 91 | ||||
-rw-r--r-- | tests/arch/xilinx/add_sub.ys | 8 | ||||
-rw-r--r-- | tests/arch/xilinx/bug1462.ys (renamed from tests/various/bug1462.ys) | 0 | ||||
-rw-r--r-- | tests/arch/xilinx/counter.ys | 7 | ||||
-rw-r--r-- | tests/arch/xilinx/fsm.ys | 2 | ||||
-rw-r--r-- | tests/arch/xilinx/xilinx_dsp.ys | 11 | ||||
-rw-r--r-- | tests/simple_abc9/abc9.v | 29 | ||||
-rwxr-xr-x | tests/simple_abc9/run-test.sh | 9 | ||||
-rw-r--r-- | tests/techmap/abc9.ys | 52 | ||||
-rw-r--r-- | tests/various/abc9.v | 7 | ||||
-rw-r--r-- | tests/various/abc9.ys | 16 | ||||
-rw-r--r-- | tests/various/autoname.ys | 19 |
23 files changed, 546 insertions, 15 deletions
diff --git a/tests/aiger/run-test.sh b/tests/aiger/run-test.sh index deaf48a3d..8e932b091 100755 --- a/tests/aiger/run-test.sh +++ b/tests/aiger/run-test.sh @@ -33,7 +33,7 @@ design -import gold -as gold design -import gate -as gate miter -equiv -flatten -make_assert -make_outputs gold gate miter sat -verify -prove-asserts -show-ports -seq 16 miter -" +" -l ${aag}.log done for aig in *.aig; do @@ -50,5 +50,5 @@ design -import gold -as gold design -import gate -as gate miter -equiv -flatten -make_assert -make_outputs gold gate miter sat -verify -prove-asserts -show-ports -seq 16 miter -" +" -l ${aig}.log done diff --git a/tests/aiger/symbols.aag b/tests/aiger/symbols.aag new file mode 100644 index 000000000..93f8989f2 --- /dev/null +++ b/tests/aiger/symbols.aag @@ -0,0 +1,9 @@ +aag 2 1 1 1 0 +2 +4 2 1 +4 +i0 d +l0 q +o0 q +c +Generated by Yosys 0.9+932 (git sha1 baba33fb, clang 9.0.0-2 -fPIC -Os) diff --git a/tests/aiger/symbols.aig b/tests/aiger/symbols.aig new file mode 100644 index 000000000..a7922ab46 --- /dev/null +++ b/tests/aiger/symbols.aig @@ -0,0 +1,8 @@ +aig 2 1 1 1 0 +2 1 +4 +i0 d +l0 q +o0 q +c +Generated by Yosys 0.9+932 (git sha1 baba33fb, clang 9.0.0-2 -fPIC -Os) diff --git a/tests/arch/ecp5/bug1459.ys b/tests/arch/ecp5/bug1459.ys new file mode 100644 index 000000000..1142ae0b5 --- /dev/null +++ b/tests/arch/ecp5/bug1459.ys @@ -0,0 +1,25 @@ +read_verilog <<EOT +module register_file( + input wire clk, + input wire write_enable, + input wire [63:0] write_data, + input wire [4:0] write_reg, + input wire [4:0] read1_reg, + output reg [63:0] read1_data, + ); + + reg [63:0] registers[0:31]; + + always @(posedge clk) begin + if (write_enable == 1'b1) begin + registers[write_reg] <= write_data; + end + end + + always @(all) begin + read1_data <= registers[read1_reg]; + end +endmodule +EOT + +synth_ecp5 -abc9 diff --git a/tests/arch/ecp5/bug1630.il.gz b/tests/arch/ecp5/bug1630.il.gz Binary files differnew file mode 100644 index 000000000..37bcf2be2 --- /dev/null +++ b/tests/arch/ecp5/bug1630.il.gz diff --git a/tests/arch/ecp5/bug1630.ys b/tests/arch/ecp5/bug1630.ys new file mode 100644 index 000000000..b419fb9bb --- /dev/null +++ b/tests/arch/ecp5/bug1630.ys @@ -0,0 +1,2 @@ +read_ilang bug1630.il.gz +abc9 -lut +/ecp5/abc9_5g.lut diff --git a/tests/arch/ice40/bug1626.ys b/tests/arch/ice40/bug1626.ys new file mode 100644 index 000000000..27b6fb5e8 --- /dev/null +++ b/tests/arch/ice40/bug1626.ys @@ -0,0 +1,217 @@ +read_ilang <<EOT +# Generated by Yosys 0.9+1706 (git sha1 58ab9f60, clang 6.0.0-1ubuntu2 -fPIC -Os) +autoidx 2815 +attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:9" +attribute \cells_not_processed 1 +attribute \dynports 1 +module \ahb_async_sram_halfwidth + parameter \DEPTH + parameter \W_ADDR + parameter \W_BYTEADDR + parameter \W_DATA + parameter \W_SRAM_ADDR + parameter \W_SRAM_DATA + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:71" + wire $0\addr_lsb[0:0] + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:71" + wire $0\hready_r[0:0] + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:71" + wire $0\long_dphase[0:0] + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:71" + wire width 16 $0\rdata_buf[15:0] + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:71" + wire $0\read_dph[0:0] + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:71" + wire $0\write_dph[0:0] + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:63" + wire width 32 $add$../hdl/mem/ahb_async_sram_halfwidth.v:63$2433_Y + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:62" + wire width 16 $and$../hdl/mem/ahb_async_sram_halfwidth.v:62$2431_Y + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:56" + wire $eq$../hdl/mem/ahb_async_sram_halfwidth.v:56$2424_Y + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:112" + wire $logic_and$../hdl/mem/ahb_async_sram_halfwidth.v:112$2450_Y + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:112" + wire $logic_and$../hdl/mem/ahb_async_sram_halfwidth.v:112$2451_Y + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:112" + wire $logic_and$../hdl/mem/ahb_async_sram_halfwidth.v:112$2452_Y + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:112" + wire $logic_and$../hdl/mem/ahb_async_sram_halfwidth.v:112$2453_Y + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:112" + wire $logic_and$../hdl/mem/ahb_async_sram_halfwidth.v:112$2454_Y + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:112" + wire $logic_and$../hdl/mem/ahb_async_sram_halfwidth.v:112$2455_Y + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:112" + wire $logic_and$../hdl/mem/ahb_async_sram_halfwidth.v:112$2456_Y + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:112" + wire $logic_and$../hdl/mem/ahb_async_sram_halfwidth.v:112$2457_Y + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:112" + wire $logic_and$../hdl/mem/ahb_async_sram_halfwidth.v:112$2458_Y + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:112" + wire $logic_and$../hdl/mem/ahb_async_sram_halfwidth.v:112$2459_Y + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:118" + wire $logic_and$../hdl/mem/ahb_async_sram_halfwidth.v:118$2444_Y + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:133" + wire $logic_and$../hdl/mem/ahb_async_sram_halfwidth.v:133$2449_Y + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:140" + wire $logic_and$../hdl/mem/ahb_async_sram_halfwidth.v:140$2461_Y + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:140" + wire $logic_and$../hdl/mem/ahb_async_sram_halfwidth.v:140$2463_Y + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:58" + wire $logic_and$../hdl/mem/ahb_async_sram_halfwidth.v:58$2425_Y + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:59" + wire $logic_and$../hdl/mem/ahb_async_sram_halfwidth.v:59$2426_Y + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:59" + wire $logic_and$../hdl/mem/ahb_async_sram_halfwidth.v:59$2427_Y + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:59" + wire $logic_and$../hdl/mem/ahb_async_sram_halfwidth.v:59$2429_Y + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:91" + wire $logic_and$../hdl/mem/ahb_async_sram_halfwidth.v:91$2441_Y + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:104" + wire $logic_not$../hdl/mem/ahb_async_sram_halfwidth.v:104$2442_Y + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:118" + wire $logic_not$../hdl/mem/ahb_async_sram_halfwidth.v:118$2443_Y + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:125" + wire $logic_not$../hdl/mem/ahb_async_sram_halfwidth.v:125$2446_Y + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:132" + wire $logic_not$../hdl/mem/ahb_async_sram_halfwidth.v:132$2447_Y + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:59" + wire $logic_not$../hdl/mem/ahb_async_sram_halfwidth.v:59$2428_Y + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:72" + wire $logic_not$../hdl/mem/ahb_async_sram_halfwidth.v:72$2437_Y + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:81" + wire $logic_not$../hdl/mem/ahb_async_sram_halfwidth.v:81$2438_Y + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:83" + wire $logic_not$../hdl/mem/ahb_async_sram_halfwidth.v:83$2439_Y + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:91" + wire $logic_not$../hdl/mem/ahb_async_sram_halfwidth.v:91$2440_Y + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:118" + wire $logic_or$../hdl/mem/ahb_async_sram_halfwidth.v:118$2445_Y + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:132" + wire $logic_or$../hdl/mem/ahb_async_sram_halfwidth.v:132$2448_Y + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:59" + wire $logic_or$../hdl/mem/ahb_async_sram_halfwidth.v:59$2430_Y + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:139" + wire width 2 $not$../hdl/mem/ahb_async_sram_halfwidth.v:139$2460_Y + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:139" + wire width 2 $not$../hdl/mem/ahb_async_sram_halfwidth.v:139$2462_Y + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:54" + wire width 2 $not$../hdl/mem/ahb_async_sram_halfwidth.v:54$2421_Y + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:63" + wire width 16 $shiftx$../hdl/mem/ahb_async_sram_halfwidth.v:63$2434_Y + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:54" + wire width 8 $shl$../hdl/mem/ahb_async_sram_halfwidth.v:54$2419_Y + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:54" + wire width 2 $shl$../hdl/mem/ahb_async_sram_halfwidth.v:54$2420_Y + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:55" + wire width 2 $shl$../hdl/mem/ahb_async_sram_halfwidth.v:55$2422_Y + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:56" + wire width 32 $shl$../hdl/mem/ahb_async_sram_halfwidth.v:56$2423_Y + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:63" + wire width 32 $ternary$../hdl/mem/ahb_async_sram_halfwidth.v:63$2432_Y + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:65" + wire width 16 $ternary$../hdl/mem/ahb_async_sram_halfwidth.v:65$2435_Y + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:50" + wire \addr_lsb + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:24" + wire width 32 \ahbls_haddr + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:28" + wire width 3 \ahbls_hburst + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:30" + wire \ahbls_hmastlock + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:29" + wire width 4 \ahbls_hprot + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:32" + wire width 32 \ahbls_hrdata + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:22" + wire \ahbls_hready + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:21" + wire \ahbls_hready_resp + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:23" + wire \ahbls_hresp + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:27" + wire width 3 \ahbls_hsize + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:26" + wire width 2 \ahbls_htrans + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:31" + wire width 32 \ahbls_hwdata + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:25" + wire \ahbls_hwrite + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:56" + wire \aphase_full_width + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:55" + wire width 2 \bytemask + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:54" + wire width 2 \bytemask_noshift + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:17" + wire \clk + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:46" + wire \hready_r + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:47" + wire \long_dphase + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:64" + wire width 16 \rdata_buf + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:49" + wire \read_dph + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:18" + wire \rst_n + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:34" + wire width 11 \sram_addr + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:39" + wire width 2 \sram_byte_n + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:36" + wire \sram_ce_n + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:35" + wire width 16 \sram_dq + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:38" + wire \sram_oe_n + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:61" + wire width 16 \sram_q + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:62" + wire width 16 \sram_rdata + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:63" + wire width 16 \sram_wdata + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:37" + wire \sram_we_n + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:58" + wire \we_next + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:48" + wire \write_dph + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:71" + process $proc$../hdl/mem/ahb_async_sram_halfwidth.v:71$2436 + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:72" + switch $logic_not$../hdl/mem/ahb_async_sram_halfwidth.v:72$2437_Y + case 1'1 + case + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:78" + switch \ahbls_hready + case 1'1 + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:79" + switch \ahbls_htrans [1] + case 1'1 + case + end + case + attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:91" + switch $logic_and$../hdl/mem/ahb_async_sram_halfwidth.v:91$2441_Y + case 1'1 + case + end + end + end + sync posedge \clk + sync negedge \rst_n + end + connect \ahbls_hresp 1'0 + connect \bytemask_noshift $not$../hdl/mem/ahb_async_sram_halfwidth.v:54$2421_Y + connect \bytemask $shl$../hdl/mem/ahb_async_sram_halfwidth.v:55$2422_Y + connect \aphase_full_width $eq$../hdl/mem/ahb_async_sram_halfwidth.v:56$2424_Y + connect \we_next $logic_or$../hdl/mem/ahb_async_sram_halfwidth.v:59$2430_Y + connect \sram_rdata $and$../hdl/mem/ahb_async_sram_halfwidth.v:62$2431_Y + connect \sram_wdata $shiftx$../hdl/mem/ahb_async_sram_halfwidth.v:63$2434_Y + connect \ahbls_hrdata { \sram_rdata $ternary$../hdl/mem/ahb_async_sram_halfwidth.v:65$2435_Y } + connect \ahbls_hready_resp \hready_r +end +EOT + +synth_ice40 -abc2 -abc9 diff --git a/tests/arch/ice40/bug1644.il.gz b/tests/arch/ice40/bug1644.il.gz Binary files differnew file mode 100644 index 000000000..363c510ef --- /dev/null +++ b/tests/arch/ice40/bug1644.il.gz diff --git a/tests/arch/ice40/bug1644.ys b/tests/arch/ice40/bug1644.ys new file mode 100644 index 000000000..5950f0e3c --- /dev/null +++ b/tests/arch/ice40/bug1644.ys @@ -0,0 +1,2 @@ +read_ilang bug1644.il.gz +synth_ice40 -top top -dsp -json adc_dac_pass_through.json -run :map_bram diff --git a/tests/arch/ice40/ice40_dsp.ys b/tests/arch/ice40/ice40_dsp.ys new file mode 100644 index 000000000..250273859 --- /dev/null +++ b/tests/arch/ice40/ice40_dsp.ys @@ -0,0 +1,11 @@ +read_verilog <<EOT +module top(input [15:0] a, b, output [31:0] o1, o2, o5); +SB_MAC16 m1 (.A(a), .B(16'd1234), .O(o1)); +assign o2 = a * 16'd0; +wire [31:0] o3, o4; +SB_MAC16 m2 (.A(a), .B(b), .O(o3)); +assign o4 = a * b; +SB_MAC16 m3 (.A(a), .B(b), .O(o5)); +endmodule +EOT +ice40_dsp diff --git a/tests/arch/xilinx/abc9_dff.ys b/tests/arch/xilinx/abc9_dff.ys new file mode 100644 index 000000000..b457cefce --- /dev/null +++ b/tests/arch/xilinx/abc9_dff.ys @@ -0,0 +1,32 @@ +read_verilog <<EOT +module top(input C, D, output [7:0] Q); +FDRE fd1(.C(C), .CE(1'b1), .D(D), .R(1'b1), .Q(Q[0])); +FDSE fd2(.C(C), .CE(1'b1), .D(D), .S(1'b1), .Q(Q[1])); +FDCE fd3(.C(C), .CE(1'b1), .D(D), .CLR(1'b1), .Q(Q[2])); +FDPE fd4(.C(C), .CE(1'b1), .D(D), .PRE(1'b1), .Q(Q[3])); +FDRE_1 fd5(.C(C), .CE(1'b1), .D(D), .R(1'b1), .Q(Q[4])); +FDSE_1 fd6(.C(C), .CE(1'b1), .D(D), .S(1'b1), .Q(Q[5])); +FDCE_1 fd7(.C(C), .CE(1'b1), .D(D), .CLR(1'b1), .Q(Q[6])); +FDPE_1 fd8(.C(C), .CE(1'b1), .D(D), .PRE(1'b1), .Q(Q[7])); +endmodule +EOT +equiv_opt -assert -multiclock -map +/xilinx/cells_sim.v synth_xilinx -abc9 -dff -noiopad -noclkbuf +design -load postopt +select -assert-none t:FD* + +design -reset +read_verilog <<EOT +module top(input C, D, output [7:0] Q); +FDRE fd1(.C(C), .CE(1'b0), .D(D), .R(1'b0), .Q(Q[0])); +FDSE fd2(.C(C), .CE(1'b0), .D(D), .S(1'b0), .Q(Q[1])); +FDCE fd3(.C(C), .CE(1'b0), .D(D), .CLR(1'b0), .Q(Q[2])); +FDPE fd4(.C(C), .CE(1'b0), .D(D), .PRE(1'b0), .Q(Q[3])); +FDRE_1 fd5(.C(C), .CE(1'b0), .D(D), .R(1'b0), .Q(Q[4])); +FDSE_1 fd6(.C(C), .CE(1'b0), .D(D), .S(1'b0), .Q(Q[5])); +FDCE_1 fd7(.C(C), .CE(1'b0), .D(D), .CLR(1'b0), .Q(Q[6])); +FDPE_1 fd8(.C(C), .CE(1'b0), .D(D), .PRE(1'b0), .Q(Q[7])); +endmodule +EOT +equiv_opt -assert -multiclock -map +/xilinx/cells_sim.v synth_xilinx -abc9 -dff -noiopad -noclkbuf +design -load postopt +select -assert-none t:FD* diff --git a/tests/arch/xilinx/abc9_map.ys b/tests/arch/xilinx/abc9_map.ys new file mode 100644 index 000000000..4a7b9384a --- /dev/null +++ b/tests/arch/xilinx/abc9_map.ys @@ -0,0 +1,91 @@ +read_verilog <<EOT +module top(input C, CE, D, R, output [1:0] Q); +FDRE #(.INIT(1'b1)) ff1 (.C(C), .CE(CE), .D(D), .R(R), .Q(Q[0])); +FDRE_1 #(.INIT(1'b1)) ff2 (.C(C), .CE(CE), .D(D), .R(R), .Q(Q[1])); +endmodule +EOT +design -save gold + +techmap -map +/xilinx/abc9_map.v -max_iter 1 -D DFF_MODE +techmap -map +/xilinx/abc9_unmap.v +select -assert-count 1 t:FDSE +select -assert-count 1 t:FDSE_1 +techmap -autoproc -map +/xilinx/cells_sim.v +design -stash gate + +design -import gold -as gold +design -import gate -as gate +techmap -autoproc -map +/xilinx/cells_sim.v + +miter -equiv -flatten -make_assert -make_outputs gold gate miter +sat -seq 2 -verify -prove-asserts -show-ports miter + +design -reset +read_verilog <<EOT +module top(input C, CE, D, S, output [1:0] Q); +FDSE #(.INIT(1'b1)) ff1 (.C(C), .CE(CE), .D(D), .S(S), .Q(Q[0])); +FDSE_1 #(.INIT(1'b1)) ff2 (.C(C), .CE(CE), .D(D), .S(S), .Q(Q[1])); +endmodule +EOT +design -save gold + +techmap -map +/xilinx/abc9_map.v -max_iter 1 -D DFF_MODE +techmap -map +/xilinx/abc9_unmap.v +select -assert-count 1 t:FDRE +select -assert-count 1 t:FDRE_1 +techmap -autoproc -map +/xilinx/cells_sim.v +design -stash gate + +design -import gold -as gold +design -import gate -as gate +techmap -autoproc -map +/xilinx/cells_sim.v + +miter -equiv -flatten -make_assert -make_outputs gold gate miter +sat -seq 2 -set-init-zero -verify -prove-asserts -show-ports miter + +design -reset +read_verilog <<EOT +module top(input C, CE, D, PRE, output [1:0] Q); +FDPE #(.INIT(1'b1)) ff1 (.C(C), .CE(CE), .D(D), .PRE(PRE), .Q(Q[0])); +FDPE_1 #(.INIT(1'b1)) ff2 (.C(C), .CE(CE), .D(D), .PRE(PRE), .Q(Q[1])); +endmodule +EOT +design -save gold + +techmap -map +/xilinx/abc9_map.v -max_iter 1 -D DFF_MODE +techmap -map +/xilinx/abc9_unmap.v +select -assert-count 1 t:FDCE +select -assert-count 1 t:FDCE_1 +techmap -autoproc -map +/xilinx/cells_sim.v +design -stash gate + +design -import gold -as gold +design -import gate -as gate +techmap -autoproc -map +/xilinx/cells_sim.v +clk2fflogic + +miter -equiv -flatten -make_assert -make_outputs gold gate miter +sat -seq 2 -set-init-zero -verify -prove-asserts -show-ports miter + +design -reset +read_verilog <<EOT +module top(input C, CE, D, CLR, output [1:0] Q); +FDCE #(.INIT(1'b1)) ff1 (.C(C), .CE(CE), .D(D), .CLR(CLR), .Q(Q[0])); +FDCE_1 #(.INIT(1'b1)) ff2 (.C(C), .CE(CE), .D(D), .CLR(CLR), .Q(Q[1])); +endmodule +EOT +design -save gold + +techmap -map +/xilinx/abc9_map.v -max_iter 1 -D DFF_MODE +techmap -map +/xilinx/abc9_unmap.v +select -assert-count 1 t:FDPE +techmap -autoproc -map +/xilinx/cells_sim.v +design -stash gate + +design -import gold -as gold +design -import gate -as gate +techmap -autoproc -map +/xilinx/cells_sim.v +clk2fflogic + +miter -equiv -flatten -make_assert -make_outputs gold gate miter +sat -seq 2 -set-init-zero -verify -prove-asserts -show-ports miter diff --git a/tests/arch/xilinx/add_sub.ys b/tests/arch/xilinx/add_sub.ys index 313948cc5..70cfe81a3 100644 --- a/tests/arch/xilinx/add_sub.ys +++ b/tests/arch/xilinx/add_sub.ys @@ -4,8 +4,8 @@ proc equiv_opt -assert -map +/xilinx/cells_sim.v synth_xilinx -noiopad # 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 14 t:LUT2 -select -assert-count 6 t:MUXCY -select -assert-count 8 t:XORCY -select -assert-none t:LUT2 t:MUXCY t:XORCY %% t:* %D +stat +select -assert-count 16 t:LUT2 +select -assert-count 2 t:CARRY4 +select -assert-none t:LUT2 t:CARRY4 %% t:* %D diff --git a/tests/various/bug1462.ys b/tests/arch/xilinx/bug1462.ys index 15cab5121..15cab5121 100644 --- a/tests/various/bug1462.ys +++ b/tests/arch/xilinx/bug1462.ys diff --git a/tests/arch/xilinx/counter.ys b/tests/arch/xilinx/counter.ys index 11c29922e..064519ce7 100644 --- a/tests/arch/xilinx/counter.ys +++ b/tests/arch/xilinx/counter.ys @@ -5,10 +5,9 @@ flatten equiv_opt -async2sync -assert -map +/xilinx/cells_sim.v synth_xilinx -noiopad # 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 - +stat select -assert-count 1 t:BUFG select -assert-count 8 t:FDCE select -assert-count 1 t:INV -select -assert-count 7 t:MUXCY -select -assert-count 8 t:XORCY -select -assert-none t:BUFG t:FDCE t:INV t:MUXCY t:XORCY %% t:* %D +select -assert-count 2 t:CARRY4 +select -assert-none t:BUFG t:FDCE t:INV t:CARRY4 %% t:* %D diff --git a/tests/arch/xilinx/fsm.ys b/tests/arch/xilinx/fsm.ys index 3235d5af3..a464fcfdb 100644 --- a/tests/arch/xilinx/fsm.ys +++ b/tests/arch/xilinx/fsm.ys @@ -9,7 +9,7 @@ sat -verify -prove-asserts -show-public -set-at 1 in_reset 1 -seq 20 -prove-skip design -load postopt # load the post-opt design (otherwise equiv_opt loads the pre-opt design) cd fsm # Constrain all select calls below inside the top module - +stat select -assert-count 1 t:BUFG select -assert-count 4 t:FDRE select -assert-count 1 t:FDSE diff --git a/tests/arch/xilinx/xilinx_dsp.ys b/tests/arch/xilinx/xilinx_dsp.ys new file mode 100644 index 000000000..3b9f52930 --- /dev/null +++ b/tests/arch/xilinx/xilinx_dsp.ys @@ -0,0 +1,11 @@ +read_verilog <<EOT +module top(input [24:0] a, input [17:0] b, output [42:0] o1, o2, o5); +DSP48E1 m1 (.A(a), .B(16'd1234), .P(o1)); +assign o2 = a * 16'd0; +wire [42:0] o3, o4; +DSP48E1 m2 (.A(a), .B(b), .P(o3)); +assign o4 = a * b; +DSP48E1 m3 (.A(a), .B(b), .P(o5)); +endmodule +EOT +xilinx_dsp diff --git a/tests/simple_abc9/abc9.v b/tests/simple_abc9/abc9.v index de60619d1..4dc5ad689 100644 --- a/tests/simple_abc9/abc9.v +++ b/tests/simple_abc9/abc9.v @@ -213,7 +213,7 @@ module arbiter (clk, rst, request, acknowledge, grant, grant_valid, grant_encode input rst; endmodule -(* abc_box_id=1 *) +(* abc9_box_id=1, whitebox *) module MUXF8(input I0, I1, S, output O); endmodule @@ -264,3 +264,30 @@ always @* if (en) q <= d; endmodule + +module abc9_test031(input clk1, clk2, d, output reg q1, q2); +always @(posedge clk1) q1 <= d; +always @(negedge clk2) q2 <= q1; +endmodule + +module abc9_test032(input clk, d, r, output reg q); +always @(posedge clk or posedge r) + if (r) q <= 1'b0; + else q <= d; +endmodule + +module abc9_test033(input clk, d, r, output reg q); +always @(negedge clk or posedge r) + if (r) q <= 1'b1; + else q <= d; +endmodule + +module abc9_test034(input clk, d, output reg q1, q2); +always @(posedge clk) q1 <= d; +always @(posedge clk) q2 <= q1; +endmodule + +module abc9_test035(input clk, d, output reg [1:0] q); +always @(posedge clk) q[0] <= d; +always @(negedge clk) q[1] <= q[0]; +endmodule diff --git a/tests/simple_abc9/run-test.sh b/tests/simple_abc9/run-test.sh index 0d4262005..32d7a80ca 100755 --- a/tests/simple_abc9/run-test.sh +++ b/tests/simple_abc9/run-test.sh @@ -20,10 +20,13 @@ fi cp ../simple/*.v . cp ../simple/*.sv . DOLLAR='?' -exec ${MAKE:-make} -f ../tools/autotest.mk $seed *.v EXTRA_FLAGS="-n 300 -p '\ +exec ${MAKE:-make} -f ../tools/autotest.mk $seed *.v *.sv EXTRA_FLAGS="-n 300 -p '\ hierarchy; \ synth -run coarse; \ opt -full; \ - techmap; abc9 -lut 4 -box ../abc.box; \ + techmap; \ + abc9 -lut 4 -box ../abc.box; \ + clean; \ check -assert; \ - select -assert-none t:${DOLLAR}_NOT_ t:${DOLLAR}_AND_ %%'" + select -assert-none t:${DOLLAR}_NOT_ t:${DOLLAR}_AND_ %%; \ + setattr -mod -unset whitebox'" diff --git a/tests/techmap/abc9.ys b/tests/techmap/abc9.ys new file mode 100644 index 000000000..62b5dfef6 --- /dev/null +++ b/tests/techmap/abc9.ys @@ -0,0 +1,52 @@ +read_verilog <<EOT +`define N 256 +module top(input [`N-1:0] a, output o); +wire [`N-2:0] w; +assign w[0] = a[0] & a[1]; +genvar i; +generate for (i = 1; i < `N-1; i++) +assign w[i] = w[i-1] & a[i+1]; +endgenerate +assign o = w[`N-2]; +endmodule +EOT +simplemap +dump +design -save gold + +abc9 -lut 4 + +design -load gold +abc9 -lut 4 -fast + +design -load gold +scratchpad -copy abc9.script.default.area abc9.script +abc9 -lut 4 + +design -load gold +scratchpad -copy abc9.script.default.fast abc9.script +abc9 -lut 4 + +design -load gold +scratchpad -copy abc9.script.flow abc9.script +abc9 -lut 4 + +design -load gold +scratchpad -copy abc9.script.flow2 abc9.script +abc9 -lut 4 + +design -load gold +scratchpad -copy abc9.script.flow3 abc9.script +abc9 -lut 4 + + +design -reset +read_verilog -icells <<EOT +module top(input a, b, output o); +assign o = ~(a & b); +endmodule +EOT +abc9 -lut 4 +clean +select -assert-count 1 t:$lut +select -assert-none t:$lut t:* %D diff --git a/tests/various/abc9.v b/tests/various/abc9.v index 30ebd4e26..f0b3f6837 100644 --- a/tests/various/abc9.v +++ b/tests/various/abc9.v @@ -9,3 +9,10 @@ wire w; unknown u(~i, w); unknown2 u2(w, o); endmodule + +module abc9_test032(input clk, d, r, output reg q); +initial q = 1'b0; +always @(negedge clk or negedge r) + if (!r) q <= 1'b0; + else q <= d; +endmodule diff --git a/tests/various/abc9.ys b/tests/various/abc9.ys index 5c9a4075d..81d0afd1b 100644 --- a/tests/various/abc9.ys +++ b/tests/various/abc9.ys @@ -22,3 +22,19 @@ abc9 -lut 4 select -assert-count 1 t:$lut r:LUT=2'b01 r:WIDTH=1 %i %i select -assert-count 1 t:unknown select -assert-none t:$lut t:unknown %% t: %D + +design -load read +hierarchy -top abc9_test032 +proc +clk2fflogic +design -save gold + +abc9 -lut 4 +check +design -stash gate + +design -import gold -as gold +design -import gate -as gate + +miter -equiv -flatten -make_assert -make_outputs gold gate miter +sat -seq 10 -verify -prove-asserts -show-ports miter diff --git a/tests/various/autoname.ys b/tests/various/autoname.ys new file mode 100644 index 000000000..830962e81 --- /dev/null +++ b/tests/various/autoname.ys @@ -0,0 +1,19 @@ +read_ilang <<EOT +autoidx 2 +module \top + wire output 3 $y + wire input 1 \a + wire input 2 \b + cell $and \b_$and_B + parameter \A_SIGNED 0 + parameter \A_WIDTH 1 + parameter \B_SIGNED 0 + parameter \B_WIDTH 1 + parameter \Y_WIDTH 1 + connect \A \a + connect \B \b + connect \Y $y + end +end +EOT +autoname |