mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-24 01:25:33 +00:00
Merge branch 'master' into map_cells_before_map_luts
This commit is contained in:
commit
a3371e118b
47 changed files with 443 additions and 189 deletions
|
@ -85,7 +85,7 @@ module cyclonev_lcell_comb
|
|||
begin
|
||||
upper_lut_value = lut4(mask[31:16], dataa, datab, datac, datad);
|
||||
lower_lut_value = lut4(mask[15:0], dataa, datab, datac, datad);
|
||||
lut5 = (datae) ? upper_mask_value : lower_mask_value;
|
||||
lut5 = (datae) ? upper_lut_value : lower_lut_value;
|
||||
end
|
||||
endfunction // lut5
|
||||
|
||||
|
@ -95,15 +95,16 @@ module cyclonev_lcell_comb
|
|||
input dataa, datab, datac, datad, datae, dataf;
|
||||
reg upper_lut_value;
|
||||
reg lower_lut_value;
|
||||
reg out_0, out_1, out_2, out_3;
|
||||
begin
|
||||
upper_lut_value = lut5(mask[63:32], dataa, datab, datac, datad, datae);
|
||||
lower_lut_value = lut5(mask[31:0], dataa, datab, datac, datad, datae);
|
||||
lut6 = (dataf) ? upper_mask_value : lower_mask_value;
|
||||
lut6 = (dataf) ? upper_lut_value : lower_lut_value;
|
||||
end
|
||||
endfunction // lut6
|
||||
|
||||
assign {mask_a, mask_b, mask_c, mask_d} = {lut_mask[15:0], lut_mask[31:16], lut_mask[47:32], lut_mask[63:48]};
|
||||
|
||||
`ifdef ADVANCED_ALM
|
||||
always @(*) begin
|
||||
if(extended_lut == "on")
|
||||
shared_lut_alm = datag;
|
||||
|
@ -115,6 +116,11 @@ module cyclonev_lcell_comb
|
|||
out_2 = lut4(mask_c, dataa, datab, datac, datad);
|
||||
out_3 = lut4(mask_d, dataa, datab, shared_lut_alm, datad);
|
||||
end
|
||||
`else
|
||||
`ifdef DEBUG
|
||||
initial $display("Advanced ALM lut combine is not implemented yet");
|
||||
`endif
|
||||
`endif
|
||||
endmodule // cyclonev_lcell_comb
|
||||
|
||||
|
||||
|
|
|
@ -30,10 +30,15 @@ module GND(output G);
|
|||
endmodule
|
||||
|
||||
module IBUF(output O, input I);
|
||||
parameter IOSTANDARD = "default";
|
||||
parameter IBUF_LOW_PWR = 0;
|
||||
assign O = I;
|
||||
endmodule
|
||||
|
||||
module OBUF(output O, input I);
|
||||
parameter IOSTANDARD = "default";
|
||||
parameter DRIVE = 12;
|
||||
parameter SLEW = "SLOW";
|
||||
assign O = I;
|
||||
endmodule
|
||||
|
||||
|
@ -41,6 +46,42 @@ module BUFG(output O, input I);
|
|||
assign O = I;
|
||||
endmodule
|
||||
|
||||
module BUFGCTRL(
|
||||
output O,
|
||||
input I0, input I1,
|
||||
input S0, input S1,
|
||||
input CE0, input CE1,
|
||||
input IGNORE0, input IGNORE1);
|
||||
|
||||
parameter [0:0] INIT_OUT = 1'b0;
|
||||
parameter PRESELECT_I0 = "FALSE";
|
||||
parameter PRESELECT_I1 = "FALSE";
|
||||
parameter [0:0] IS_CE0_INVERTED = 1'b0;
|
||||
parameter [0:0] IS_CE1_INVERTED = 1'b0;
|
||||
parameter [0:0] IS_S0_INVERTED = 1'b0;
|
||||
parameter [0:0] IS_S1_INVERTED = 1'b0;
|
||||
parameter [0:0] IS_IGNORE0_INVERTED = 1'b0;
|
||||
parameter [0:0] IS_IGNORE1_INVERTED = 1'b0;
|
||||
|
||||
wire I0_internal = ((CE0 ^ IS_CE0_INVERTED) ? I0 : INIT_OUT);
|
||||
wire I1_internal = ((CE1 ^ IS_CE1_INVERTED) ? I1 : INIT_OUT);
|
||||
wire S0_true = (S0 ^ IS_S0_INVERTED);
|
||||
wire S1_true = (S1 ^ IS_S1_INVERTED);
|
||||
|
||||
assign O = S0_true ? I0_internal : (S1_true ? I1_internal : INIT_OUT);
|
||||
|
||||
endmodule
|
||||
|
||||
module BUFHCE(output O, input I, input CE);
|
||||
|
||||
parameter [0:0] INIT_OUT = 1'b0;
|
||||
parameter CE_TYPE = "SYNC";
|
||||
parameter [0:0] IS_CE_INVERTED = 1'b0;
|
||||
|
||||
assign O = ((CE ^ IS_CE_INVERTED) ? I : INIT_OUT);
|
||||
|
||||
endmodule
|
||||
|
||||
// module OBUFT(output O, input I, T);
|
||||
// assign O = T ? 1'bz : I;
|
||||
// endmodule
|
||||
|
@ -98,6 +139,22 @@ module LUT6(output O, input I0, I1, I2, I3, I4, I5);
|
|||
assign O = I0 ? s1[1] : s1[0];
|
||||
endmodule
|
||||
|
||||
module LUT6_2(output O6, output O5, input I0, I1, I2, I3, I4, I5);
|
||||
parameter [63:0] INIT = 0;
|
||||
wire [31: 0] s5 = I5 ? INIT[63:32] : INIT[31: 0];
|
||||
wire [15: 0] s4 = I4 ? s5[31:16] : s5[15: 0];
|
||||
wire [ 7: 0] s3 = I3 ? s4[15: 8] : s4[ 7: 0];
|
||||
wire [ 3: 0] s2 = I2 ? s3[ 7: 4] : s3[ 3: 0];
|
||||
wire [ 1: 0] s1 = I1 ? s2[ 3: 2] : s2[ 1: 0];
|
||||
assign O6 = I0 ? s1[1] : s1[0];
|
||||
|
||||
wire [15: 0] s5_4 = I4 ? INIT[31:16] : INIT[15: 0];
|
||||
wire [ 7: 0] s5_3 = I3 ? s5_4[15: 8] : s5_4[ 7: 0];
|
||||
wire [ 3: 0] s5_2 = I2 ? s5_3[ 7: 4] : s5_3[ 3: 0];
|
||||
wire [ 1: 0] s5_1 = I1 ? s5_2[ 3: 2] : s5_2[ 1: 0];
|
||||
assign O5 = I0 ? s5_1[1] : s5_1[0];
|
||||
endmodule
|
||||
|
||||
module MUXCY(output O, input CI, DI, S);
|
||||
assign O = S ? CI : DI;
|
||||
endmodule
|
||||
|
|
|
@ -28,12 +28,12 @@ function xtract_cell_decl()
|
|||
# xtract_cell_decl BUFG
|
||||
xtract_cell_decl BUFGCE
|
||||
xtract_cell_decl BUFGCE_1
|
||||
xtract_cell_decl BUFGCTRL
|
||||
#xtract_cell_decl BUFGCTRL
|
||||
xtract_cell_decl BUFGMUX
|
||||
xtract_cell_decl BUFGMUX_1
|
||||
xtract_cell_decl BUFGMUX_CTRL
|
||||
xtract_cell_decl BUFH
|
||||
xtract_cell_decl BUFHCE
|
||||
#xtract_cell_decl BUFHCE
|
||||
xtract_cell_decl BUFIO
|
||||
xtract_cell_decl BUFMR
|
||||
xtract_cell_decl BUFMRCE
|
||||
|
@ -92,7 +92,7 @@ function xtract_cell_decl()
|
|||
# xtract_cell_decl LUT4
|
||||
# xtract_cell_decl LUT5
|
||||
# xtract_cell_decl LUT6
|
||||
xtract_cell_decl LUT6_2
|
||||
#xtract_cell_decl LUT6_2
|
||||
xtract_cell_decl MMCME2_ADV
|
||||
xtract_cell_decl MMCME2_BASE
|
||||
# xtract_cell_decl MUXF7
|
||||
|
|
|
@ -30,29 +30,6 @@ module BUFGCE_1 (...);
|
|||
input CE, I;
|
||||
endmodule
|
||||
|
||||
module BUFGCTRL (...);
|
||||
output O;
|
||||
input CE0;
|
||||
input CE1;
|
||||
input I0;
|
||||
input I1;
|
||||
input IGNORE0;
|
||||
input IGNORE1;
|
||||
input S0;
|
||||
input S1;
|
||||
parameter integer INIT_OUT = 0;
|
||||
parameter PRESELECT_I0 = "FALSE";
|
||||
parameter PRESELECT_I1 = "FALSE";
|
||||
parameter [0:0] IS_CE0_INVERTED = 1'b0;
|
||||
parameter [0:0] IS_CE1_INVERTED = 1'b0;
|
||||
parameter [0:0] IS_I0_INVERTED = 1'b0;
|
||||
parameter [0:0] IS_I1_INVERTED = 1'b0;
|
||||
parameter [0:0] IS_IGNORE0_INVERTED = 1'b0;
|
||||
parameter [0:0] IS_IGNORE1_INVERTED = 1'b0;
|
||||
parameter [0:0] IS_S0_INVERTED = 1'b0;
|
||||
parameter [0:0] IS_S1_INVERTED = 1'b0;
|
||||
endmodule
|
||||
|
||||
module BUFGMUX (...);
|
||||
parameter CLK_SEL_TYPE = "SYNC";
|
||||
output O;
|
||||
|
@ -77,15 +54,6 @@ module BUFH (...);
|
|||
input I;
|
||||
endmodule
|
||||
|
||||
module BUFHCE (...);
|
||||
parameter CE_TYPE = "SYNC";
|
||||
parameter integer INIT_OUT = 0;
|
||||
parameter [0:0] IS_CE_INVERTED = 1'b0;
|
||||
output O;
|
||||
input CE;
|
||||
input I;
|
||||
endmodule
|
||||
|
||||
module BUFIO (...);
|
||||
output O;
|
||||
input I;
|
||||
|
@ -2420,12 +2388,6 @@ module LDPE (...);
|
|||
input D, G, GE, PRE;
|
||||
endmodule
|
||||
|
||||
module LUT6_2 (...);
|
||||
parameter [63:0] INIT = 64'h0000000000000000;
|
||||
input I0, I1, I2, I3, I4, I5;
|
||||
output O5, O6;
|
||||
endmodule
|
||||
|
||||
module MMCME2_ADV (...);
|
||||
parameter BANDWIDTH = "OPTIMIZED";
|
||||
parameter real CLKFBOUT_MULT_F = 5.000;
|
||||
|
|
|
@ -28,14 +28,14 @@ module \$_DFF_P_ (input D, C, output Q); FDRE #(.INIT(|0)) _TECHMAP_REPL
|
|||
module \$_DFFE_NP_ (input D, C, E, output Q); FDRE_1 #(.INIT(|0)) _TECHMAP_REPLACE_ (.D(D), .Q(Q), .C(C), .CE(E), .R(1'b0)); endmodule
|
||||
module \$_DFFE_PP_ (input D, C, E, output Q); FDRE #(.INIT(|0)) _TECHMAP_REPLACE_ (.D(D), .Q(Q), .C(C), .CE(E), .R(1'b0)); endmodule
|
||||
|
||||
module \$_DFF_NN0_ (input D, C, R, output Q); FDCE_1 #(.INIT(|0)) _TECHMAP_REPLACE_ (.D(D), .Q(Q), .C(C), .CE(1'b1), .CLR(!R)); endmodule
|
||||
module \$_DFF_NN0_ (input D, C, R, output Q); \$_DFF_NP0_ _TECHMAP_REPLACE_ (.D(D), .Q(Q), .C(C), .R(~R)); endmodule
|
||||
module \$_DFF_NP0_ (input D, C, R, output Q); FDCE_1 #(.INIT(|0)) _TECHMAP_REPLACE_ (.D(D), .Q(Q), .C(C), .CE(1'b1), .CLR( R)); endmodule
|
||||
module \$_DFF_PN0_ (input D, C, R, output Q); FDCE #(.INIT(|0)) _TECHMAP_REPLACE_ (.D(D), .Q(Q), .C(C), .CE(1'b1), .CLR(!R)); endmodule
|
||||
module \$_DFF_PN0_ (input D, C, R, output Q); \$_DFF_PP0_ _TECHMAP_REPLACE_ (.D(D), .Q(Q), .C(C), .R(~R)); endmodule
|
||||
module \$_DFF_PP0_ (input D, C, R, output Q); FDCE #(.INIT(|0)) _TECHMAP_REPLACE_ (.D(D), .Q(Q), .C(C), .CE(1'b1), .CLR( R)); endmodule
|
||||
|
||||
module \$_DFF_NN1_ (input D, C, R, output Q); FDPE_1 #(.INIT(|0)) _TECHMAP_REPLACE_ (.D(D), .Q(Q), .C(C), .CE(1'b1), .PRE(!R)); endmodule
|
||||
module \$_DFF_NN1_ (input D, C, R, output Q); \$_DFF_NP1 _TECHMAP_REPLACE_ (.D(D), .Q(Q), .C(C), .R(~R)); endmodule
|
||||
module \$_DFF_NP1_ (input D, C, R, output Q); FDPE_1 #(.INIT(|0)) _TECHMAP_REPLACE_ (.D(D), .Q(Q), .C(C), .CE(1'b1), .PRE( R)); endmodule
|
||||
module \$_DFF_PN1_ (input D, C, R, output Q); FDPE #(.INIT(|0)) _TECHMAP_REPLACE_ (.D(D), .Q(Q), .C(C), .CE(1'b1), .PRE(!R)); endmodule
|
||||
module \$_DFF_PN1_ (input D, C, R, output Q); \$_DFF_PP1 _TECHMAP_REPLACE_ (.D(D), .Q(Q), .C(C), .R(~R)); endmodule
|
||||
module \$_DFF_PP1_ (input D, C, R, output Q); FDPE #(.INIT(|0)) _TECHMAP_REPLACE_ (.D(D), .Q(Q), .C(C), .CE(1'b1), .PRE( R)); endmodule
|
||||
|
||||
`endif
|
||||
|
|
|
@ -110,20 +110,20 @@ struct SynthXilinxPass : public Pass
|
|||
log(" dffsr2dff\n");
|
||||
log(" dff2dffe\n");
|
||||
log(" opt -full\n");
|
||||
log(" techmap -map +/techmap.v -map +/xilinx/arith_map.v -map +/xilinx/ff_map.v\n");
|
||||
log(" techmap -map +/techmap.v -map +/xilinx/arith_map.v\n");
|
||||
log(" opt -fast\n");
|
||||
log("\n");
|
||||
log(" map_cells:\n");
|
||||
log(" techmap -map +/xilinx/cells_map.v\n");
|
||||
log(" dffinit -ff FDRE Q INIT -ff FDCE Q INIT -ff FDPE Q INIT -ff FDSE Q INIT \\\n");
|
||||
log(" -ff FDRE_1 Q INIT -ff FDCE_1 Q INIT -ff FDPE_1 Q INIT -ff FDSE_1 Q INIT\n");
|
||||
log(" clean\n");
|
||||
log("\n");
|
||||
log(" map_luts:\n");
|
||||
log(" abc -luts 2:2,3,6:5,10,20 [-dff] (without '-vpr' only!)\n");
|
||||
log(" abc -lut 5 [-dff] (with '-vpr' only!)\n");
|
||||
log(" techmap -map +/techmap.v -map +/xilinx/ff_map.v t:$_DFF_?N?\n");
|
||||
log(" abc -luts 2:2,3,6:5,10,20 [-dff]\n");
|
||||
log(" clean\n");
|
||||
log(" techmap -map +/xilinx/lut_map.v\n");
|
||||
log(" techmap -map +/xilinx/lut_map.v -map +/xilinx/ff_map.v");
|
||||
log(" dffinit -ff FDRE Q INIT -ff FDCE Q INIT -ff FDPE Q INIT -ff FDSE Q INIT \\\n");
|
||||
log(" -ff FDRE_1 Q INIT -ff FDCE_1 Q INIT -ff FDPE_1 Q INIT -ff FDSE_1 Q INIT\n");
|
||||
log("\n");
|
||||
log(" check:\n");
|
||||
log(" hierarchy -check\n");
|
||||
|
@ -257,9 +257,9 @@ struct SynthXilinxPass : public Pass
|
|||
Pass::call(design, "opt -full");
|
||||
|
||||
if (vpr) {
|
||||
Pass::call(design, "techmap -map +/techmap.v -map +/xilinx/arith_map.v -map +/xilinx/ff_map.v -D _EXPLICIT_CARRY");
|
||||
Pass::call(design, "techmap -map +/techmap.v -map +/xilinx/arith_map.v -D _EXPLICIT_CARRY");
|
||||
} else {
|
||||
Pass::call(design, "techmap -map +/techmap.v -map +/xilinx/arith_map.v -map +/xilinx/ff_map.v");
|
||||
Pass::call(design, "techmap -map +/techmap.v -map +/xilinx/arith_map.v");
|
||||
}
|
||||
|
||||
Pass::call(design, "hierarchy -check");
|
||||
|
@ -269,16 +269,17 @@ struct SynthXilinxPass : public Pass
|
|||
if (check_label(active, run_from, run_to, "map_cells"))
|
||||
{
|
||||
Pass::call(design, "techmap -map +/xilinx/cells_map.v");
|
||||
Pass::call(design, "dffinit -ff FDRE Q INIT -ff FDCE Q INIT -ff FDPE Q INIT -ff FDSE Q INIT "
|
||||
"-ff FDRE_1 Q INIT -ff FDCE_1 Q INIT -ff FDPE_1 Q INIT -ff FDSE_1 Q INIT");
|
||||
Pass::call(design, "clean");
|
||||
}
|
||||
|
||||
if (check_label(active, run_from, run_to, "map_luts"))
|
||||
{
|
||||
Pass::call(design, "techmap -map +/techmap.v -map +/xilinx/ff_map.v t:$_DFF_?N?");
|
||||
Pass::call(design, "abc -luts 2:2,3,6:5,10,20" + string(retime ? " -dff" : ""));
|
||||
Pass::call(design, "clean");
|
||||
Pass::call(design, "techmap -map +/xilinx/lut_map.v");
|
||||
Pass::call(design, "techmap -map +/xilinx/lut_map.v -map +/xilinx/ff_map.v");
|
||||
Pass::call(design, "dffinit -ff FDRE Q INIT -ff FDCE Q INIT -ff FDPE Q INIT -ff FDSE Q INIT "
|
||||
"-ff FDRE_1 Q INIT -ff FDCE_1 Q INIT -ff FDPE_1 Q INIT -ff FDSE_1 Q INIT");
|
||||
}
|
||||
|
||||
if (check_label(active, run_from, run_to, "check"))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue