2020-04-21 19:54:24 -05:00
|
|
|
`ifdef DFF
|
2020-04-16 12:24:02 -05:00
|
|
|
(* techmap_celltype = "$_DFF_N_ $_DFF_P_" *)
|
|
|
|
module $_DFF_x_(input C, D, output Q);
|
|
|
|
parameter [0:0] _TECHMAP_WIREINIT_Q_ = 1'bx;
|
|
|
|
parameter _TECHMAP_CELLTYPE_ = "";
|
2020-05-14 02:29:45 -05:00
|
|
|
wire D_;
|
2020-04-16 14:08:59 -05:00
|
|
|
generate if (_TECHMAP_CELLTYPE_ == "$_DFF_N_") begin
|
|
|
|
if (_TECHMAP_WIREINIT_Q_ === 1'b0) begin
|
2020-05-13 23:56:06 -05:00
|
|
|
$__DFF_N__$abc9_flop _TECHMAP_REPLACE_ (.C(C), .D(D), .Q(Q), .n1(D_));
|
2020-04-16 14:08:59 -05:00
|
|
|
$_DFF_N_ ff (.C(C), .D(D_), .Q(Q));
|
|
|
|
end
|
|
|
|
else
|
2020-05-14 18:44:35 -05:00
|
|
|
(* abc9_keep *) $_DFF_N_ _TECHMAP_REPLACE_ (.C(C), .D(D), .Q(Q));
|
2020-04-16 12:24:02 -05:00
|
|
|
end
|
|
|
|
else if (_TECHMAP_CELLTYPE_ == "$_DFF_P_") begin
|
2020-04-16 14:08:59 -05:00
|
|
|
if (_TECHMAP_WIREINIT_Q_ === 1'b0) begin
|
2020-05-13 23:56:06 -05:00
|
|
|
$__DFF_P__$abc9_flop _TECHMAP_REPLACE_ (.C(C), .D(D), .Q(Q), .n1(D_));
|
2020-04-16 14:08:59 -05:00
|
|
|
$_DFF_P_ ff (.C(C), .D(D_), .Q(Q));
|
|
|
|
end
|
|
|
|
else
|
2020-05-14 18:44:35 -05:00
|
|
|
(* abc9_keep *) $_DFF_P_ _TECHMAP_REPLACE_ (.C(C), .D(D), .Q(Q));
|
2020-04-16 12:24:02 -05:00
|
|
|
end
|
|
|
|
else if (_TECHMAP_CELLTYPE_ != "")
|
|
|
|
$error("Unrecognised _TECHMAP_CELLTYPE_");
|
|
|
|
endgenerate
|
|
|
|
endmodule
|
2020-04-21 19:54:24 -05:00
|
|
|
`endif
|