Added GreenPak inverter support
authorAndrew Zonenberg <azonenberg@drawersteak.com>
Sat, 2 Apr 2016 04:18:29 +0000 (21:18 -0700)
committerAndrew Zonenberg <azonenberg@drawersteak.com>
Sat, 2 Apr 2016 04:18:29 +0000 (21:18 -0700)
techlibs/greenpak4/cells_map.v
techlibs/greenpak4/cells_sim.v
techlibs/greenpak4/synth_greenpak4.cc

index ce517d94b1586c70f82d02dcb350209e4d8c4039..1bc0bcda4c6f118c83c37473c921ae906483eae1 100644 (file)
@@ -33,8 +33,13 @@ module \$lut (A, Y);
 
   generate
     if (WIDTH == 1) begin
-      GP_2LUT #(.INIT({2'b00, LUT})) _TECHMAP_REPLACE_ (.OUT(Y),
-       .IN0(A[0]), .IN1(1'b0));
+               if(LUT == 2'b01) begin
+                       GP_INV _TECHMAP_REPLACE_ (.OUT(Y), .IN(A[0]) );
+               end
+               else begin
+                       GP_2LUT #(.INIT({2'b00, LUT})) _TECHMAP_REPLACE_ (.OUT(Y),
+                               .IN0(A[0]), .IN1(1'b0));
+               end
     end else
     if (WIDTH == 2) begin
       GP_2LUT #(.INIT(LUT)) _TECHMAP_REPLACE_ (.OUT(Y),
index 2727d92463b7b22a3c2864f06ab54a79adf4fb16..4ea5769601d7e0141494840f4c801d347721d841 100644 (file)
@@ -40,6 +40,10 @@ module GP_DFFSR(input D, CLK, nSR, output reg Q);
        end
 endmodule
 
+module GP_INV(input IN, output OUT);
+       assign OUT = ~IN;
+endmodule
+
 module GP_2LUT(input IN0, IN1, output OUT);
        parameter [3:0] INIT = 0;
        assign OUT = INIT[{IN1, IN0}];
index 25150ec56a30c06b141431831d4d956683739936..8900d8d782583c25c869dc59d5494aeda63de39d 100644 (file)
@@ -207,8 +207,8 @@ struct SynthGreenPAK4Pass : public Pass {
                if (check_label(active, run_from, run_to, "map_luts"))
                {
                        if (part == "SLG46140V") Pass::call(design, "nlutmap -luts 0,6,8,2");
-                       if (part == "SLG46620V") Pass::call(design, "nlutmap -luts 0,8,16,2");
-                       if (part == "SLG46621V") Pass::call(design, "nlutmap -luts 0,8,16,2");
+                       if (part == "SLG46620V") Pass::call(design, "nlutmap -luts 2,8,16,2");
+                       if (part == "SLG46621V") Pass::call(design, "nlutmap -luts 2,8,16,2");
                        Pass::call(design, "clean");
                }