Skip to content

Commit

Permalink
add latch mapping, and remove aldff for now
Browse files Browse the repository at this point in the history
  • Loading branch information
mmicko committed Apr 19, 2024
1 parent a1d5677 commit 90a5722
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 8 deletions.
1 change: 1 addition & 0 deletions techlibs/nanoxplore/Makefile.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
14 changes: 7 additions & 7 deletions techlibs/nanoxplore/cells_map.v
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
11 changes: 11 additions & 0 deletions techlibs/nanoxplore/latches_map.v
Original file line number Diff line number Diff line change
@@ -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
3 changes: 2 additions & 1 deletion techlibs/nanoxplore/synth_nanoxplore.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 90a5722

Please sign in to comment.