DFF reset and context must be in sync

This commit is contained in:
Miodrag Milanovic 2024-04-30 13:29:03 +02:00
parent cb45f8b69d
commit dc16bdd85b
2 changed files with 7 additions and 7 deletions

View File

@ -40,7 +40,7 @@ module \$_DFF_xxxx_ (input D, C, R, output Q);
localparam dff_edge = _TECHMAP_CELLTYPE_[3*8 +: 8] == "N"; localparam dff_edge = _TECHMAP_CELLTYPE_[3*8 +: 8] == "N";
localparam dff_type = _TECHMAP_CELLTYPE_[1*8 +: 8] == "1"; localparam dff_type = _TECHMAP_CELLTYPE_[1*8 +: 8] == "1";
wire _TECHMAP_REMOVEINIT_Q_ = 1'b1; wire _TECHMAP_REMOVEINIT_Q_ = 1'b1;
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'b1), .R(R), .O(Q)); NX_DFF #(.dff_ctxt(dff_type), .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'b1), .R(R), .O(Q));
endmodule endmodule
(* techmap_celltype = "$_SDFF_[NP]P[01]_" *) (* techmap_celltype = "$_SDFF_[NP]P[01]_" *)
@ -49,7 +49,7 @@ module \$_SDFF_xxxx_ (input D, C, R, output Q);
localparam dff_edge = _TECHMAP_CELLTYPE_[3*8 +: 8] == "N"; localparam dff_edge = _TECHMAP_CELLTYPE_[3*8 +: 8] == "N";
localparam dff_type = _TECHMAP_CELLTYPE_[1*8 +: 8] == "1"; localparam dff_type = _TECHMAP_CELLTYPE_[1*8 +: 8] == "1";
wire _TECHMAP_REMOVEINIT_Q_ = 1'b1; wire _TECHMAP_REMOVEINIT_Q_ = 1'b1;
NX_DFF #(.dff_ctxt(1'b0), .dff_edge(dff_edge), .dff_init(1'b1), .dff_load(1'b0), .dff_sync(1'b1), .dff_type(dff_type)) _TECHMAP_REPLACE_ (.I(D), .CK(C), .L(1'b1), .R(R), .O(Q)); NX_DFF #(.dff_ctxt(dff_type), .dff_edge(dff_edge), .dff_init(1'b1), .dff_load(1'b0), .dff_sync(1'b1), .dff_type(dff_type)) _TECHMAP_REPLACE_ (.I(D), .CK(C), .L(1'b1), .R(R), .O(Q));
endmodule endmodule
(* techmap_celltype = "$_DFFE_[NP]P[01]P_" *) (* techmap_celltype = "$_DFFE_[NP]P[01]P_" *)
@ -58,7 +58,7 @@ module \$_DFFE_xxxx_ (input D, C, R, E, output Q);
localparam dff_edge = _TECHMAP_CELLTYPE_[4*8 +: 8] == "N"; localparam dff_edge = _TECHMAP_CELLTYPE_[4*8 +: 8] == "N";
localparam dff_type = _TECHMAP_CELLTYPE_[2*8 +: 8] == "1"; localparam dff_type = _TECHMAP_CELLTYPE_[2*8 +: 8] == "1";
wire _TECHMAP_REMOVEINIT_Q_ = 1'b1; 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(dff_type)) _TECHMAP_REPLACE_ (.I(D), .CK(C), .L(E), .R(R), .O(Q)); NX_DFF #(.dff_ctxt(dff_type), .dff_edge(dff_edge), .dff_init(1'b1), .dff_load(1'b1), .dff_sync(1'b0), .dff_type(dff_type)) _TECHMAP_REPLACE_ (.I(D), .CK(C), .L(E), .R(R), .O(Q));
endmodule endmodule
(* techmap_celltype = "$_SDFFE_[NP]P[01]P_" *) (* techmap_celltype = "$_SDFFE_[NP]P[01]P_" *)
@ -67,7 +67,7 @@ module \$_SDFFE_xxxx_ (input D, C, R, E, output Q);
localparam dff_edge = _TECHMAP_CELLTYPE_[4*8 +: 8] == "N"; localparam dff_edge = _TECHMAP_CELLTYPE_[4*8 +: 8] == "N";
localparam dff_type = _TECHMAP_CELLTYPE_[2*8 +: 8] == "1"; localparam dff_type = _TECHMAP_CELLTYPE_[2*8 +: 8] == "1";
wire _TECHMAP_REMOVEINIT_Q_ = 1'b1; 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'b1), .dff_type(dff_type)) _TECHMAP_REPLACE_ (.I(D), .CK(C), .L(E), .R(R), .O(Q)); NX_DFF #(.dff_ctxt(dff_type), .dff_edge(dff_edge), .dff_init(1'b1), .dff_load(1'b1), .dff_sync(1'b1), .dff_type(dff_type)) _TECHMAP_REPLACE_ (.I(D), .CK(C), .L(E), .R(R), .O(Q));
endmodule endmodule
module \$_DFF_P_ (input D, C, output Q); module \$_DFF_P_ (input D, C, output Q);

View File

@ -302,11 +302,11 @@ struct SynthNanoXplorePass : public ScriptPass
if (check_label("map_ffs")) if (check_label("map_ffs"))
{ {
std::string dfflegalize_args = " -cell $_DFF_?_ 0 -cell $_DFF_?P0_ 0 -cell $_SDFF_?P0_ 0"; std::string dfflegalize_args = " -cell $_DFF_?_ 0 -cell $_DFF_?P?_ r -cell $_SDFF_?P?_ r";
if (help_mode) { if (help_mode) {
dfflegalize_args += " [-cell $_DFFE_?P_ 0 -cell $_DFFE_?P0P_ 0 -cell $_SDFFE_?P0P_ 0]"; dfflegalize_args += " [-cell $_DFFE_?P_ 0 -cell $_DFFE_?P?P_ r -cell $_SDFFE_?P?P_ r]";
} else if (!nodffe) { } else if (!nodffe) {
dfflegalize_args += " -cell $_DFFE_?P_ 0 -cell $_DFFE_?P0P_ 0 -cell $_SDFFE_?P0P_ 0"; dfflegalize_args += " -cell $_DFFE_?P_ 0 -cell $_DFFE_?P?P_ r -cell $_SDFFE_?P?P_ r";
} }
dfflegalize_args += " -cell $_DLATCH_?_ x"; dfflegalize_args += " -cell $_DLATCH_?_ x";
run("dfflegalize" + dfflegalize_args,"($_*DFFE_* only if not -nodffe)"); run("dfflegalize" + dfflegalize_args,"($_*DFFE_* only if not -nodffe)");