More xsthammer improvements (using xst 14.5 now)
authorClifford Wolf <clifford@clifford.at>
Thu, 13 Jun 2013 15:23:51 +0000 (17:23 +0200)
committerClifford Wolf <clifford@clifford.at>
Thu, 13 Jun 2013 15:23:51 +0000 (17:23 +0200)
passes/sat/sat.cc
tests/xsthammer/run-check.sh
tests/xsthammer/run-xst.sh
tests/xsthammer/xl_cells.v
tests/xsthammer/xl_cells_tb.v
tests/xsthammer/xl_cells_tb.ys

index e5f678820c7727b2a15721ee89ea09324db920d3..60be79d62c86059f231b7ef48b8bedd302268df8 100644 (file)
@@ -216,7 +216,7 @@ struct SatHelper
 
                int import_cell_counter = 0;
                for (auto &c : module->cells)
-                       if (design->selected(module, c.second) && ct.cell_known(c.second->type)) {
+                       if (design->selected(module, c.second)) {
                                // log("Import cell: %s\n", RTLIL::id2cstr(c.first));
                                if (satgen.importCell(c.second, timestep)) {
                                        for (auto &p : c.second->connections)
index 6a77e236749bc2e5358362cdaa0de05b88a47111..b2d9193aead5b1756de96ea336f865cbaab32ed5 100644 (file)
@@ -9,12 +9,12 @@ job="$1"
 set --
 
 set -e
-mkdir -p check check_temp
-cd check_temp
+mkdir -p check check_temp/$job
+cd check_temp/$job
 
 {
        echo "module ${job}_top(a, b, y_rtl, y_xst);"
-       sed -r '/^(input|output) / !d; /output/ { s/ y;/ y_rtl;/; p; }; s/ y_rtl;/ y_xst;/;' ../rtl/$job.v
+       sed -r '/^(input|output) / !d; /output/ { s/ y;/ y_rtl;/; p; }; s/ y_rtl;/ y_xst;/;' ../../rtl/$job.v
        echo "${job}_rtl rtl_variant (.a(a), .b(b), .y(y_rtl));"
        echo "${job}_xst xst_variant (.a(a), .b(b), .y(y_xst));"
        echo "endmodule"
@@ -22,17 +22,17 @@ cd check_temp
 
 for mode in nomap techmap; do
        {
-               echo "read_verilog -DGLBL ../xst/$job.v"
+               echo "read_verilog -DGLBL ../../xst/$job.v"
                echo "rename $job ${job}_xst"
 
-               echo "read_verilog ../rtl/$job.v"
+               echo "read_verilog ../../rtl/$job.v"
                echo "rename $job ${job}_rtl"
                if [ $mode = techmap ]; then
                        echo "techmap ${job}_rtl"
                fi
 
                echo "read_verilog ${job}_top.v"
-               echo "read_verilog ../xl_cells.v"
+               echo "read_verilog ../../xl_cells.v"
 
                echo "hierarchy -top ${job}_top"
                echo "flatten ${job}_top"
@@ -42,7 +42,7 @@ for mode in nomap techmap; do
                echo "rename ${job}_top ${job}_top_${mode}"
                echo "write_ilang ${job}_top_${mode}.il"
        } > ${job}_top_${mode}.ys
-       ../../../yosys -q ${job}_top_${mode}.ys
+       ../../../../yosys -q ${job}_top_${mode}.ys
 done
 
 {
@@ -52,12 +52,12 @@ done
        echo "sat -verify -show a,b,y_rtl,y_xst -prove y_rtl y_xst ${job}_top_techmap"
 } > ${job}_cmp.ys
 
-if ../../../yosys -l ${job}.log ${job}_cmp.ys; then
-       mv ${job}.log ../check/${job}.log
-       rm -f ../check/${job}.err
+if ../../../../yosys -l ${job}.log ${job}_cmp.ys; then
+       mv ${job}.log ../../check/${job}.log
+       rm -f ../../check/${job}.err
 else
-       mv ${job}.log ../check/${job}.err
-       rm -f ../check/${job}.log
+       mv ${job}.log ../../check/${job}.err
+       rm -f ../../check/${job}.log
        exit 1
 fi
 
index 21670707295782b1d5c5e5c741b9f4e50771664a..b421e29540a8bb4c766a6353fc481ee27b5f4551 100644 (file)
@@ -14,59 +14,16 @@ cd xst_temp/$job
 
 cat > $job.xst <<- EOT
        run
-       -ifn $job.prj
-       -ifmt mixed
-       -ofn $job
-       -ofmt NGC
-       -p xc6vlx75t-2-ff784
-       -top $job
-       -opt_mode Speed
-       -opt_level 1
-       -power NO
-       -iuc NO
-       -keep_hierarchy NO
-       -rtlview Yes
-       -glob_opt AllClockNets
-       -read_cores YES
-       -write_timing_constraints NO
-       -cross_clock_analysis NO
-       -hierarchy_separator /
-       -bus_delimiter <>
-       -case maintain
-       -slice_utilization_ratio 100
-       -bram_utilization_ratio 100
-       -dsp_utilization_ratio 100
+       -ifn $job.prj -ofn $job -p artix7 -top $job
+       -iobuf NO -ram_extract NO -rom_extract NO -use_dsp48 NO
        -fsm_extract YES -fsm_encoding Auto
-       -safe_implementation No
-       -fsm_style lut
-       -ram_extract Yes
-       -ram_style Auto
-       -rom_extract Yes
-       -shreg_extract YES
-       -rom_style Auto
-       -auto_bram_packing NO
-       -resource_sharing YES
-       -async_to_sync NO
-       -use_dsp48 auto
-       -iobuf NO
-       -max_fanout 100000
-       -bufg 32
-       -register_duplication YES
-       -register_balancing No
-       -optimize_primitives NO
-       -use_clock_enable Auto
-       -use_sync_set Auto
-       -use_sync_reset Auto
-       -iob auto
-       -equivalent_register_removal YES
-       -slice_utilization_ratio_maxmargin 5
 EOT
 
 cat > $job.prj <<- EOT
        verilog work "../../rtl/$job.v"
 EOT
 
-. /opt/Xilinx/14.2/ISE_DS/settings64.sh
+. /opt/Xilinx/14.5/ISE_DS/settings64.sh
 
 xst -ifn $job.xst
 netgen -w -ofmt verilog $job.ngc $job
index 6a3fa79962dbf766dff0aeb95c6dae83a449b7ff..775c84d24d7f1cb0222c961d485e039e38b026a0 100644 (file)
@@ -8,6 +8,14 @@ input I;
 output O = !I;
 endmodule
 
+module LUT1(O, I0);
+parameter INIT = 0;
+input I0;
+wire [1:0] lutdata = INIT;
+wire [0:0] idx = { I0 };
+output O = lutdata[idx];
+endmodule
+
 module LUT2(O, I0, I1);
 parameter INIT = 0;
 input I0, I1;
index a7472e4f19c90927c313338cf5e07a46c52a9db1..17e0a2798cdebf512395929a2089dab928ea308a 100644 (file)
@@ -14,6 +14,17 @@ XL_INV XL(.O(XL_O), .I(I));
 output ok = MY_O == XL_O;
 endmodule
 
+module TB_LUT1(ok, I0);
+input I0;
+wire [1:0] MY_O, XL_O;
+genvar i;
+generate for (i=0; i<2; i=i+1) begin:V
+       MY_LUT1 #(.INIT(i)) MY(.O(MY_O[i]), .I0(I0));
+       XL_LUT1 #(.INIT(i)) XL(.O(XL_O[i]), .I0(I0));
+end endgenerate
+output ok = MY_O == XL_O;
+endmodule
+
 module TB_LUT2(ok, I0, I1);
 input I0, I1;
 wire [3:0] MY_O, XL_O;
index 616f1b27848b8ed7d3aafef670c9a4ba8116afe6..536c64a1596b27aa7bb882474b2fdd65f78d009c 100644 (file)
@@ -6,6 +6,7 @@ read_verilog xl_cells_tb.v
 
 rename GND   MY_GND
 rename INV   MY_INV
+rename LUT1  MY_LUT1
 rename LUT2  MY_LUT2
 rename LUT3  MY_LUT3
 rename LUT4  MY_LUT4
@@ -16,20 +17,22 @@ rename MUXF7 MY_MUXF7
 rename VCC   MY_VCC
 rename XORCY MY_XORCY
 
-read_verilog /opt/Xilinx/14.2/ISE_DS/ISE/verilog/src/unisims/GND.v
-read_verilog /opt/Xilinx/14.2/ISE_DS/ISE/verilog/src/unisims/INV.v
-read_verilog /opt/Xilinx/14.2/ISE_DS/ISE/verilog/src/unisims/LUT2.v
-read_verilog /opt/Xilinx/14.2/ISE_DS/ISE/verilog/src/unisims/LUT3.v
-read_verilog /opt/Xilinx/14.2/ISE_DS/ISE/verilog/src/unisims/LUT4.v
-read_verilog /opt/Xilinx/14.2/ISE_DS/ISE/verilog/src/unisims/LUT5.v
-read_verilog /opt/Xilinx/14.2/ISE_DS/ISE/verilog/src/unisims/LUT6.v
-read_verilog /opt/Xilinx/14.2/ISE_DS/ISE/verilog/src/unisims/MUXCY.v
-read_verilog /opt/Xilinx/14.2/ISE_DS/ISE/verilog/src/unisims/MUXF7.v
-read_verilog /opt/Xilinx/14.2/ISE_DS/ISE/verilog/src/unisims/VCC.v
-read_verilog /opt/Xilinx/14.2/ISE_DS/ISE/verilog/src/unisims/XORCY.v
+read_verilog /opt/Xilinx/14.5/ISE_DS/ISE/verilog/src/unisims/GND.v
+read_verilog /opt/Xilinx/14.5/ISE_DS/ISE/verilog/src/unisims/INV.v
+read_verilog /opt/Xilinx/14.5/ISE_DS/ISE/verilog/src/unisims/LUT1.v
+read_verilog /opt/Xilinx/14.5/ISE_DS/ISE/verilog/src/unisims/LUT2.v
+read_verilog /opt/Xilinx/14.5/ISE_DS/ISE/verilog/src/unisims/LUT3.v
+read_verilog /opt/Xilinx/14.5/ISE_DS/ISE/verilog/src/unisims/LUT4.v
+read_verilog /opt/Xilinx/14.5/ISE_DS/ISE/verilog/src/unisims/LUT5.v
+read_verilog /opt/Xilinx/14.5/ISE_DS/ISE/verilog/src/unisims/LUT6.v
+read_verilog /opt/Xilinx/14.5/ISE_DS/ISE/verilog/src/unisims/MUXCY.v
+read_verilog /opt/Xilinx/14.5/ISE_DS/ISE/verilog/src/unisims/MUXF7.v
+read_verilog /opt/Xilinx/14.5/ISE_DS/ISE/verilog/src/unisims/VCC.v
+read_verilog /opt/Xilinx/14.5/ISE_DS/ISE/verilog/src/unisims/XORCY.v
 
 rename GND   XL_GND
 rename INV   XL_INV
+rename LUT1  XL_LUT1
 rename LUT2  XL_LUT2
 rename LUT3  XL_LUT3
 rename LUT4  XL_LUT4
@@ -47,6 +50,7 @@ opt_clean
 
 sat -verify -prove ok 1'b1 TB_GND
 sat -verify -prove ok 1'b1 TB_INV
+sat -verify -prove ok 1'b1 TB_LUT1
 sat -verify -prove ok 1'b1 TB_LUT2
 sat -verify -prove ok 1'b1 TB_LUT3
 sat -verify -prove ok 1'b1 TB_LUT4