diff --git a/techlibs/nanoxplore/Makefile.inc b/techlibs/nanoxplore/Makefile.inc index f6606639e31..180922a50a7 100644 --- a/techlibs/nanoxplore/Makefile.inc +++ b/techlibs/nanoxplore/Makefile.inc @@ -17,6 +17,7 @@ $(eval $(call add_share_file,share/nanoxplore,techlibs/nanoxplore/cells_wrap_l.v $(eval $(call add_share_file,share/nanoxplore,techlibs/nanoxplore/cells_wrap_m.v)) $(eval $(call add_share_file,share/nanoxplore,techlibs/nanoxplore/cells_wrap_u.v)) $(eval $(call add_share_file,share/nanoxplore,techlibs/nanoxplore/io_map.v)) +$(eval $(call add_share_file,share/nanoxplore,techlibs/nanoxplore/latches_map.v)) $(eval $(call add_share_file,share/nanoxplore,techlibs/nanoxplore/rf_rams_l.txt)) $(eval $(call add_share_file,share/nanoxplore,techlibs/nanoxplore/rf_rams_m.txt)) $(eval $(call add_share_file,share/nanoxplore,techlibs/nanoxplore/rf_rams_u.txt)) diff --git a/techlibs/nanoxplore/cells_map.v b/techlibs/nanoxplore/cells_map.v index 75e7140aae5..e851b86bf08 100644 --- a/techlibs/nanoxplore/cells_map.v +++ b/techlibs/nanoxplore/cells_map.v @@ -43,13 +43,13 @@ module dff(input D, C, R, output Q); NX_DFF #(.dff_ctxt(1'b0), .dff_edge(dff_edge), .dff_init(1'b1), .dff_load(1'b0), .dff_sync(1'b0), .dff_type(dff_type)) _TECHMAP_REPLACE_ (.I(D), .CK(C), .L(1'b0), .R(R), .O(Q)); endmodule -(* techmap_celltype = "$_ALDFF_[NP]P_" *) -module aldff(input D, C, L, AD, output Q); - parameter _TECHMAP_CELLTYPE = "$_ALDFF_PP_"; - localparam dff_edge = _TECHMAP_CELLTYPE[8*8 +: 8] == "N"; - wire _TECHMAP_REMOVEINIT_Q_ = 1'b1; - NX_DFF #(.dff_ctxt(1'b0), .dff_edge(dff_edge), .dff_init(1'b1), .dff_load(1'b1), .dff_sync(1'b0), .dff_type(2)) _TECHMAP_REPLACE_ (.I(D), .CK(C), .L(AD), .R(L), .O(Q)); -endmodule +//(* techmap_celltype = "$_ALDFF_[NP]P_" *) +//module aldff(input D, C, L, AD, output Q); +// parameter _TECHMAP_CELLTYPE = "$_ALDFF_PP_"; +// localparam dff_edge = _TECHMAP_CELLTYPE[8*8 +: 8] == "N"; +// wire _TECHMAP_REMOVEINIT_Q_ = 1'b1; +// NX_DFF #(.dff_ctxt(1'b0), .dff_edge(dff_edge), .dff_init(1'b1), .dff_load(1'b1), .dff_sync(1'b0), .dff_type(2)) _TECHMAP_REPLACE_ (.I(D), .CK(C), .L(AD), .R(L), .O(Q)); +//endmodule module \$_SDFF_PP0_ (input D, C, R, output Q); wire _TECHMAP_REMOVEINIT_Q_ = 1'b1; diff --git a/techlibs/nanoxplore/latches_map.v b/techlibs/nanoxplore/latches_map.v new file mode 100644 index 00000000000..c28f88cf767 --- /dev/null +++ b/techlibs/nanoxplore/latches_map.v @@ -0,0 +1,11 @@ +module \$_DLATCH_N_ (E, D, Q); + wire [1023:0] _TECHMAP_DO_ = "simplemap; opt"; + input E, D; + output Q = !E ? D : Q; +endmodule + +module \$_DLATCH_P_ (E, D, Q); + wire [1023:0] _TECHMAP_DO_ = "simplemap; opt"; + input E, D; + output Q = E ? D : Q; +endmodule diff --git a/techlibs/nanoxplore/synth_nanoxplore.cc b/techlibs/nanoxplore/synth_nanoxplore.cc index 975f78cae4d..edbd67f261c 100644 --- a/techlibs/nanoxplore/synth_nanoxplore.cc +++ b/techlibs/nanoxplore/synth_nanoxplore.cc @@ -294,7 +294,8 @@ struct SynthNanoXplorePass : public ScriptPass if (check_label("map_ffs")) { - run("dfflegalize -cell $_DFF_?P?_ 0 -cell $_ALDFF_?P_ 0 -cell $_SDFF_?P?_ 0"); + run("dfflegalize -cell $_DFF_?P?_ 0 -cell $_SDFF_?P?_ 0 -cell $_DLATCH_?_ x"); //-cell $_ALDFF_?P_ 0 + run("techmap -map +/nanoxplore/latches_map.v"); run("techmap -map +/nanoxplore/cells_map.v"); run("opt_expr -undriven -mux_undef"); run("clean -purge");