mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-07 01:54:10 +00:00
intel: Use dfflegalize.
This commit is contained in:
parent
a3a90f6377
commit
3209c0762a
|
@ -5,6 +5,7 @@ $(eval $(call add_share_file,share/intel/common,techlibs/intel/common/m9k_bb.v))
|
||||||
$(eval $(call add_share_file,share/intel/common,techlibs/intel/common/altpll_bb.v))
|
$(eval $(call add_share_file,share/intel/common,techlibs/intel/common/altpll_bb.v))
|
||||||
$(eval $(call add_share_file,share/intel/common,techlibs/intel/common/brams_m9k.txt))
|
$(eval $(call add_share_file,share/intel/common,techlibs/intel/common/brams_m9k.txt))
|
||||||
$(eval $(call add_share_file,share/intel/common,techlibs/intel/common/brams_map_m9k.v))
|
$(eval $(call add_share_file,share/intel/common,techlibs/intel/common/brams_map_m9k.v))
|
||||||
|
$(eval $(call add_share_file,share/intel/common,techlibs/intel/common/ff_map.v))
|
||||||
|
|
||||||
# Add the cell models and mappings for the VQM backend
|
# Add the cell models and mappings for the VQM backend
|
||||||
families := max10 arria10gx cyclonev cyclone10lp cycloneiv cycloneive
|
families := max10 arria10gx cyclonev cyclone10lp cycloneiv cycloneive
|
||||||
|
|
11
techlibs/intel/common/ff_map.v
Normal file
11
techlibs/intel/common/ff_map.v
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
// Async Active Low Reset DFF
|
||||||
|
module \$_DFFE_PN0P_ (input D, C, R, E, output Q);
|
||||||
|
parameter _TECHMAP_WIREINIT_Q_ = 1'bx;
|
||||||
|
generate if (_TECHMAP_WIREINIT_Q_ === 1'b1) begin
|
||||||
|
dffeas #(.is_wysiwyg("TRUE"), .power_up("high")) _TECHMAP_REPLACE_ (.d(D), .q(Q), .clk(C), .clrn(R), .prn(1'b1), .ena(E), .asdata(1'b0), .aload(1'b0), .sclr(1'b0), .sload(1'b0));
|
||||||
|
end else begin
|
||||||
|
dffeas #(.is_wysiwyg("TRUE"), .power_up("low")) _TECHMAP_REPLACE_ (.d(D), .q(Q), .clk(C), .clrn(R), .prn(1'b1), .ena(E), .asdata(1'b0), .aload(1'b0), .sclr(1'b0), .sload(1'b0));
|
||||||
|
end
|
||||||
|
endgenerate
|
||||||
|
wire _TECHMAP_REMOVEINIT_Q_ = 1;
|
||||||
|
endmodule
|
|
@ -19,41 +19,6 @@
|
||||||
// > c60k28 (Viacheslav, VT) [at] yandex [dot] com
|
// > c60k28 (Viacheslav, VT) [at] yandex [dot] com
|
||||||
// > Intel FPGA technology mapping. User must first simulate the generated \
|
// > Intel FPGA technology mapping. User must first simulate the generated \
|
||||||
// > netlist before going to test it on board.
|
// > netlist before going to test it on board.
|
||||||
// > Changelog: 1) The missing power_up parameter in the techmap introduces a problem in Quartus mapper. Fixed.
|
|
||||||
|
|
||||||
// Normal mode DFF negedge clk, negedge reset
|
|
||||||
module \$_DFF_N_ (input D, C, output Q);
|
|
||||||
parameter WYSIWYG="TRUE";
|
|
||||||
parameter power_up=1'bx;
|
|
||||||
dffeas #(.is_wysiwyg(WYSIWYG), .power_up(power_up)) _TECHMAP_REPLACE_ (.d(D), .q(Q), .clk(C), .clrn(1'b1), .prn(1'b1), .ena(1'b1), .asdata(1'b0), .aload(1'b0), .sclr(1'b0), .sload(1'b0));
|
|
||||||
endmodule
|
|
||||||
// Normal mode DFF
|
|
||||||
module \$_DFF_P_ (input D, C, output Q);
|
|
||||||
parameter WYSIWYG="TRUE";
|
|
||||||
parameter power_up=1'bx;
|
|
||||||
dffeas #(.is_wysiwyg(WYSIWYG), .power_up(power_up)) _TECHMAP_REPLACE_ (.d(D), .q(Q), .clk(C), .clrn(1'b1), .prn(1'b1), .ena(1'b1), .asdata(1'b0), .aload(1'b0), .sclr(1'b0), .sload(1'b0));
|
|
||||||
endmodule
|
|
||||||
|
|
||||||
// Async Active Low Reset DFF
|
|
||||||
module \$_DFF_PN0_ (input D, C, R, output Q);
|
|
||||||
parameter WYSIWYG="TRUE";
|
|
||||||
parameter power_up=1'bx;
|
|
||||||
dffeas #(.is_wysiwyg(WYSIWYG), .power_up("power_up")) _TECHMAP_REPLACE_ (.d(D), .q(Q), .clk(C), .clrn(R), .prn(1'b1), .ena(1'b1), .asdata(1'b0), .aload(1'b0), .sclr(1'b0), .sload(1'b0));
|
|
||||||
endmodule
|
|
||||||
// Async Active High Reset DFF
|
|
||||||
module \$_DFF_PP0_ (input D, C, R, output Q);
|
|
||||||
parameter WYSIWYG="TRUE";
|
|
||||||
parameter power_up=1'bx;
|
|
||||||
wire R_i = ~ R;
|
|
||||||
dffeas #(.is_wysiwyg(WYSIWYG), .power_up(power_up)) _TECHMAP_REPLACE_ (.d(D), .q(Q), .clk(C), .clrn(R_i), .prn(1'b1), .ena(1'b1), .asdata(1'b0), .aload(1'b0), .sclr(1'b0), .sload(1'b0));
|
|
||||||
endmodule
|
|
||||||
|
|
||||||
module \$_DFFE_PP0P_ (input D, C, E, R, output Q);
|
|
||||||
parameter WYSIWYG="TRUE";
|
|
||||||
parameter power_up=1'bx;
|
|
||||||
wire E_i = ~ E;
|
|
||||||
dffeas #(.is_wysiwyg(WYSIWYG), .power_up(power_up)) _TECHMAP_REPLACE_ (.d(D), .q(Q), .clk(C), .clrn(R), .prn(1'b1), .ena(1'b1), .asdata(1'b0), .aload(1'b0), .sclr(E_i), .sload(1'b0));
|
|
||||||
endmodule
|
|
||||||
|
|
||||||
// Input buffer map
|
// Input buffer map
|
||||||
module \$__inpad (input I, output O);
|
module \$__inpad (input I, output O);
|
||||||
|
|
|
@ -19,41 +19,6 @@
|
||||||
// > c60k28 (Viacheslav, VT) [at] yandex [dot] com
|
// > c60k28 (Viacheslav, VT) [at] yandex [dot] com
|
||||||
// > Intel FPGA technology mapping. User must first simulate the generated \
|
// > Intel FPGA technology mapping. User must first simulate the generated \
|
||||||
// > netlist before going to test it on board.
|
// > netlist before going to test it on board.
|
||||||
// > Changelog: 1) The missing power_up parameter in the techmap introduces a problem in Quartus mapper. Fixed.
|
|
||||||
|
|
||||||
// Normal mode DFF negedge clk, negedge reset
|
|
||||||
module \$_DFF_N_ (input D, C, output Q);
|
|
||||||
parameter WYSIWYG="TRUE";
|
|
||||||
parameter power_up=1'bx;
|
|
||||||
dffeas #(.is_wysiwyg(WYSIWYG), .power_up(power_up)) _TECHMAP_REPLACE_ (.d(D), .q(Q), .clk(C), .clrn(1'b1), .prn(1'b1), .ena(1'b1), .asdata(1'b0), .aload(1'b0), .sclr(1'b0), .sload(1'b0));
|
|
||||||
endmodule
|
|
||||||
// Normal mode DFF
|
|
||||||
module \$_DFF_P_ (input D, C, output Q);
|
|
||||||
parameter WYSIWYG="TRUE";
|
|
||||||
parameter power_up=1'bx;
|
|
||||||
dffeas #(.is_wysiwyg(WYSIWYG), .power_up(power_up)) _TECHMAP_REPLACE_ (.d(D), .q(Q), .clk(C), .clrn(1'b1), .prn(1'b1), .ena(1'b1), .asdata(1'b0), .aload(1'b0), .sclr(1'b0), .sload(1'b0));
|
|
||||||
endmodule
|
|
||||||
|
|
||||||
// Async Active Low Reset DFF
|
|
||||||
module \$_DFF_PN0_ (input D, C, R, output Q);
|
|
||||||
parameter WYSIWYG="TRUE";
|
|
||||||
parameter power_up=1'bx;
|
|
||||||
dffeas #(.is_wysiwyg(WYSIWYG), .power_up("power_up")) _TECHMAP_REPLACE_ (.d(D), .q(Q), .clk(C), .clrn(R), .prn(1'b1), .ena(1'b1), .asdata(1'b0), .aload(1'b0), .sclr(1'b0), .sload(1'b0));
|
|
||||||
endmodule
|
|
||||||
// Async Active High Reset DFF
|
|
||||||
module \$_DFF_PP0_ (input D, C, R, output Q);
|
|
||||||
parameter WYSIWYG="TRUE";
|
|
||||||
parameter power_up=1'bx;
|
|
||||||
wire R_i = ~ R;
|
|
||||||
dffeas #(.is_wysiwyg(WYSIWYG), .power_up(power_up)) _TECHMAP_REPLACE_ (.d(D), .q(Q), .clk(C), .clrn(R_i), .prn(1'b1), .ena(1'b1), .asdata(1'b0), .aload(1'b0), .sclr(1'b0), .sload(1'b0));
|
|
||||||
endmodule
|
|
||||||
|
|
||||||
module \$_DFFE_PP0P_ (input D, C, E, R, output Q);
|
|
||||||
parameter WYSIWYG="TRUE";
|
|
||||||
parameter power_up=1'bx;
|
|
||||||
wire E_i = ~ E;
|
|
||||||
dffeas #(.is_wysiwyg(WYSIWYG), .power_up(power_up)) _TECHMAP_REPLACE_ (.d(D), .q(Q), .clk(C), .clrn(R), .prn(1'b1), .ena(1'b1), .asdata(1'b0), .aload(1'b0), .sclr(E_i), .sload(1'b0));
|
|
||||||
endmodule
|
|
||||||
|
|
||||||
// Input buffer map
|
// Input buffer map
|
||||||
module \$__inpad (input I, output O);
|
module \$__inpad (input I, output O);
|
||||||
|
|
|
@ -19,41 +19,6 @@
|
||||||
// > c60k28 (Viacheslav, VT) [at] yandex [dot] com
|
// > c60k28 (Viacheslav, VT) [at] yandex [dot] com
|
||||||
// > Intel FPGA technology mapping. User must first simulate the generated \
|
// > Intel FPGA technology mapping. User must first simulate the generated \
|
||||||
// > netlist before going to test it on board.
|
// > netlist before going to test it on board.
|
||||||
// > Changelog: 1) The missing power_up parameter in the techmap introduces a problem in Quartus mapper. Fixed.
|
|
||||||
|
|
||||||
// Normal mode DFF negedge clk, negedge reset
|
|
||||||
module \$_DFF_N_ (input D, C, output Q);
|
|
||||||
parameter WYSIWYG="TRUE";
|
|
||||||
parameter power_up=1'bx;
|
|
||||||
dffeas #(.is_wysiwyg(WYSIWYG), .power_up(power_up)) _TECHMAP_REPLACE_ (.d(D), .q(Q), .clk(C), .clrn(1'b1), .prn(1'b1), .ena(1'b1), .asdata(1'b0), .aload(1'b0), .sclr(1'b0), .sload(1'b0));
|
|
||||||
endmodule
|
|
||||||
// Normal mode DFF
|
|
||||||
module \$_DFF_P_ (input D, C, output Q);
|
|
||||||
parameter WYSIWYG="TRUE";
|
|
||||||
parameter power_up=1'bx;
|
|
||||||
dffeas #(.is_wysiwyg(WYSIWYG), .power_up(power_up)) _TECHMAP_REPLACE_ (.d(D), .q(Q), .clk(C), .clrn(1'b1), .prn(1'b1), .ena(1'b1), .asdata(1'b0), .aload(1'b0), .sclr(1'b0), .sload(1'b0));
|
|
||||||
endmodule
|
|
||||||
|
|
||||||
// Async Active Low Reset DFF
|
|
||||||
module \$_DFF_PN0_ (input D, C, R, output Q);
|
|
||||||
parameter WYSIWYG="TRUE";
|
|
||||||
parameter power_up=1'bx;
|
|
||||||
dffeas #(.is_wysiwyg(WYSIWYG), .power_up("power_up")) _TECHMAP_REPLACE_ (.d(D), .q(Q), .clk(C), .clrn(R), .prn(1'b1), .ena(1'b1), .asdata(1'b0), .aload(1'b0), .sclr(1'b0), .sload(1'b0));
|
|
||||||
endmodule
|
|
||||||
// Async Active High Reset DFF
|
|
||||||
module \$_DFF_PP0_ (input D, C, R, output Q);
|
|
||||||
parameter WYSIWYG="TRUE";
|
|
||||||
parameter power_up=1'bx;
|
|
||||||
wire R_i = ~ R;
|
|
||||||
dffeas #(.is_wysiwyg(WYSIWYG), .power_up(power_up)) _TECHMAP_REPLACE_ (.d(D), .q(Q), .clk(C), .clrn(R_i), .prn(1'b1), .ena(1'b1), .asdata(1'b0), .aload(1'b0), .sclr(1'b0), .sload(1'b0));
|
|
||||||
endmodule
|
|
||||||
|
|
||||||
module \$_DFFE_PP0P_ (input D, C, E, R, output Q);
|
|
||||||
parameter WYSIWYG="TRUE";
|
|
||||||
parameter power_up=1'bx;
|
|
||||||
wire E_i = ~ E;
|
|
||||||
dffeas #(.is_wysiwyg(WYSIWYG), .power_up(power_up)) _TECHMAP_REPLACE_ (.d(D), .q(Q), .clk(C), .clrn(R), .prn(1'b1), .ena(1'b1), .asdata(1'b0), .aload(1'b0), .sclr(E_i), .sload(1'b0));
|
|
||||||
endmodule
|
|
||||||
|
|
||||||
// Input buffer map
|
// Input buffer map
|
||||||
module \$__inpad (input I, output O);
|
module \$__inpad (input I, output O);
|
||||||
|
|
|
@ -19,43 +19,6 @@
|
||||||
// > c60k28 (Viacheslav, VT) [at] yandex [dot] com
|
// > c60k28 (Viacheslav, VT) [at] yandex [dot] com
|
||||||
// > Intel FPGA technology mapping. User must first simulate the generated \
|
// > Intel FPGA technology mapping. User must first simulate the generated \
|
||||||
// > netlist before going to test it on board.
|
// > netlist before going to test it on board.
|
||||||
// > Changelog: 1) The missing power_up parameter in the techmap introduces a problem in Quartus mapper. Fixed.
|
|
||||||
// 2) Cyclone V 7-input LUT function was wrong implemented. Removed abc option to map this function \
|
|
||||||
// and added the explanation in this file instead. Such function needs to be implemented.
|
|
||||||
|
|
||||||
// Normal mode DFF negedge clk, negedge reset
|
|
||||||
module \$_DFF_N_ (input D, C, output Q);
|
|
||||||
parameter WYSIWYG="TRUE";
|
|
||||||
parameter power_up=1'bx;
|
|
||||||
dffeas #(.is_wysiwyg(WYSIWYG), .power_up(power_up)) _TECHMAP_REPLACE_ (.d(D), .q(Q), .clk(C), .clrn(1'b1), .prn(1'b1), .ena(1'b1), .asdata(1'b0), .aload(1'b0), .sclr(1'b0), .sload(1'b0));
|
|
||||||
endmodule
|
|
||||||
// Normal mode DFF
|
|
||||||
module \$_DFF_P_ (input D, C, output Q);
|
|
||||||
parameter WYSIWYG="TRUE";
|
|
||||||
parameter power_up=1'bx;
|
|
||||||
dffeas #(.is_wysiwyg(WYSIWYG), .power_up(power_up)) _TECHMAP_REPLACE_ (.d(D), .q(Q), .clk(C), .clrn(1'b1), .prn(1'b1), .ena(1'b1), .asdata(1'b0), .aload(1'b0), .sclr(1'b0), .sload(1'b0));
|
|
||||||
endmodule
|
|
||||||
|
|
||||||
// Async Active Low Reset DFF
|
|
||||||
module \$_DFF_PN0_ (input D, C, R, output Q);
|
|
||||||
parameter WYSIWYG="TRUE";
|
|
||||||
parameter power_up=1'bx;
|
|
||||||
dffeas #(.is_wysiwyg(WYSIWYG), .power_up("power_up")) _TECHMAP_REPLACE_ (.d(D), .q(Q), .clk(C), .clrn(R), .prn(1'b1), .ena(1'b1), .asdata(1'b0), .aload(1'b0), .sclr(1'b0), .sload(1'b0));
|
|
||||||
endmodule
|
|
||||||
// Async Active High Reset DFF
|
|
||||||
module \$_DFF_PP0_ (input D, C, R, output Q);
|
|
||||||
parameter WYSIWYG="TRUE";
|
|
||||||
parameter power_up=1'bx;
|
|
||||||
wire R_i = ~ R;
|
|
||||||
dffeas #(.is_wysiwyg(WYSIWYG), .power_up(power_up)) _TECHMAP_REPLACE_ (.d(D), .q(Q), .clk(C), .clrn(R_i), .prn(1'b1), .ena(1'b1), .asdata(1'b0), .aload(1'b0), .sclr(1'b0), .sload(1'b0));
|
|
||||||
endmodule
|
|
||||||
|
|
||||||
module \$_DFFE_PP0P_ (input D, C, E, R, output Q);
|
|
||||||
parameter WYSIWYG="TRUE";
|
|
||||||
parameter power_up=1'bx;
|
|
||||||
wire E_i = ~ E;
|
|
||||||
dffeas #(.is_wysiwyg(WYSIWYG), .power_up(power_up)) _TECHMAP_REPLACE_ (.d(D), .q(Q), .clk(C), .clrn(R), .prn(1'b1), .ena(1'b1), .asdata(1'b0), .aload(1'b0), .sclr(E_i), .sload(1'b0));
|
|
||||||
endmodule
|
|
||||||
|
|
||||||
// Input buffer map
|
// Input buffer map
|
||||||
module \$__inpad (input I, output O);
|
module \$__inpad (input I, output O);
|
||||||
|
|
|
@ -19,41 +19,6 @@
|
||||||
// > c60k28 (Viacheslav, VT) [at] yandex [dot] com
|
// > c60k28 (Viacheslav, VT) [at] yandex [dot] com
|
||||||
// > Intel FPGA technology mapping. User must first simulate the generated \
|
// > Intel FPGA technology mapping. User must first simulate the generated \
|
||||||
// > netlist before going to test it on board.
|
// > netlist before going to test it on board.
|
||||||
// > Changelog: 1) The missing power_up parameter in the techmap introduces a problem in Quartus mapper. Fixed.
|
|
||||||
|
|
||||||
// Normal mode DFF negedge clk, negedge reset
|
|
||||||
module \$_DFF_N_ (input D, C, output Q);
|
|
||||||
parameter WYSIWYG="TRUE";
|
|
||||||
parameter power_up=1'bx;
|
|
||||||
dffeas #(.is_wysiwyg(WYSIWYG), .power_up(power_up)) _TECHMAP_REPLACE_ (.d(D), .q(Q), .clk(C), .clrn(1'b1), .prn(1'b1), .ena(1'b1), .asdata(1'b0), .aload(1'b0), .sclr(1'b0), .sload(1'b0));
|
|
||||||
endmodule
|
|
||||||
// Normal mode DFF
|
|
||||||
module \$_DFF_P_ (input D, C, output Q);
|
|
||||||
parameter WYSIWYG="TRUE";
|
|
||||||
parameter power_up=1'bx;
|
|
||||||
dffeas #(.is_wysiwyg(WYSIWYG), .power_up(power_up)) _TECHMAP_REPLACE_ (.d(D), .q(Q), .clk(C), .clrn(1'b1), .prn(1'b1), .ena(1'b1), .asdata(1'b0), .aload(1'b0), .sclr(1'b0), .sload(1'b0));
|
|
||||||
endmodule
|
|
||||||
|
|
||||||
// Async Active Low Reset DFF
|
|
||||||
module \$_DFF_PN0_ (input D, C, R, output Q);
|
|
||||||
parameter WYSIWYG="TRUE";
|
|
||||||
parameter power_up=1'bx;
|
|
||||||
dffeas #(.is_wysiwyg(WYSIWYG), .power_up("power_up")) _TECHMAP_REPLACE_ (.d(D), .q(Q), .clk(C), .clrn(R), .prn(1'b1), .ena(1'b1), .asdata(1'b0), .aload(1'b0), .sclr(1'b0), .sload(1'b0));
|
|
||||||
endmodule
|
|
||||||
// Async Active High Reset DFF
|
|
||||||
module \$_DFF_PP0_ (input D, C, R, output Q);
|
|
||||||
parameter WYSIWYG="TRUE";
|
|
||||||
parameter power_up=1'bx;
|
|
||||||
wire R_i = ~ R;
|
|
||||||
dffeas #(.is_wysiwyg(WYSIWYG), .power_up(power_up)) _TECHMAP_REPLACE_ (.d(D), .q(Q), .clk(C), .clrn(R_i), .prn(1'b1), .ena(1'b1), .asdata(1'b0), .aload(1'b0), .sclr(1'b0), .sload(1'b0));
|
|
||||||
endmodule
|
|
||||||
|
|
||||||
module \$_DFFE_PP0P_ (input D, C, E, R, output Q);
|
|
||||||
parameter WYSIWYG="TRUE";
|
|
||||||
parameter power_up=1'bx;
|
|
||||||
wire E_i = ~ E;
|
|
||||||
dffeas #(.is_wysiwyg(WYSIWYG), .power_up(power_up)) _TECHMAP_REPLACE_ (.d(D), .q(Q), .clk(C), .clrn(R), .prn(1'b1), .ena(1'b1), .asdata(1'b0), .aload(1'b0), .sclr(E_i), .sload(1'b0));
|
|
||||||
endmodule
|
|
||||||
|
|
||||||
// Input buffer map
|
// Input buffer map
|
||||||
module \$__inpad (input I, output O);
|
module \$__inpad (input I, output O);
|
||||||
|
|
|
@ -212,6 +212,11 @@ struct SynthIntelPass : public ScriptPass {
|
||||||
run("abc -markgroups -dff -D 1", "(only if -retime)");
|
run("abc -markgroups -dff -D 1", "(only if -retime)");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (check_label("map_ffs")) {
|
||||||
|
run("dfflegalize -cell $_DFFE_PN0P_ 01");
|
||||||
|
run("techmap -map +/intel/common/ff_map.v");
|
||||||
|
}
|
||||||
|
|
||||||
if (check_label("map_luts")) {
|
if (check_label("map_luts")) {
|
||||||
if (family_opt == "arria10gx" || family_opt == "cyclonev")
|
if (family_opt == "arria10gx" || family_opt == "cyclonev")
|
||||||
run("abc -luts 2:2,3,6:5" + string(retime ? " -dff" : ""));
|
run("abc -luts 2:2,3,6:5" + string(retime ? " -dff" : ""));
|
||||||
|
@ -224,7 +229,6 @@ struct SynthIntelPass : public ScriptPass {
|
||||||
if (iopads || help_mode)
|
if (iopads || help_mode)
|
||||||
run("iopadmap -bits -outpad $__outpad I:O -inpad $__inpad O:I", "(if -iopads)");
|
run("iopadmap -bits -outpad $__outpad I:O -inpad $__inpad O:I", "(if -iopads)");
|
||||||
run(stringf("techmap -map +/intel/%s/cells_map.v", family_opt.c_str()));
|
run(stringf("techmap -map +/intel/%s/cells_map.v", family_opt.c_str()));
|
||||||
run("dffinit -highlow -ff dffeas q power_up");
|
|
||||||
run("clean -purge");
|
run("clean -purge");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue