3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-08-29 22:40:12 +00:00

Add FFs and related tests

This commit is contained in:
Lofty 2024-03-01 10:55:54 +01:00 committed by Miodrag Milanovic
parent b4a17cccc3
commit b4e9bb0d85
7 changed files with 187 additions and 0 deletions

View file

@ -33,3 +33,36 @@ module \$lut (A, Y);
end
endgenerate
endmodule
(* techmap_celltype = "$_DFF_[NP]P[01]_" *)
module dff(input D, C, R, output Q);
parameter _TECHMAP_CELLTYPE = "$_DFF_PP1_";
localparam dff_edge = _TECHMAP_CELLTYPE[6*8 +: 8] == "N";
localparam dff_type = _TECHMAP_CELLTYPE[8*8 +: 8] == "1";
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'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
module \$_SDFF_PP0_ (input D, C, R, output Q);
NX_DFF #(.dff_ctxt(1'b0), .dff_edge(1'b0), .dff_init(1'b1), .dff_load(1'b0), .dff_sync(1'b1), .dff_type(1'b0)) _TECHMAP_REPLACE_ (.I(D), .CK(C), .L(1'b0), .R(R), .O(Q));
endmodule
module \$_SDFF_PP1_ (input D, C, R, output Q);
NX_DFF #(.dff_ctxt(1'b0), .dff_edge(1'b0), .dff_init(1'b1), .dff_load(1'b0), .dff_sync(1'b1), .dff_type(1'b1)) _TECHMAP_REPLACE_ (.I(D), .CK(C), .L(1'b0), .R(R), .O(Q));
endmodule
module \$_SDFF_NP0_ (input D, C, R, output Q);
NX_DFF #(.dff_ctxt(1'b0), .dff_edge(1'b1), .dff_init(1'b1), .dff_load(1'b0), .dff_sync(1'b1), .dff_type(1'b0)) _TECHMAP_REPLACE_ (.I(D), .CK(C), .L(1'b0), .R(R), .O(Q));
endmodule
module \$_SDFF_NP1_ (input D, C, R, output Q);
NX_DFF #(.dff_ctxt(1'b0), .dff_edge(1'b1), .dff_init(1'b1), .dff_load(1'b0), .dff_sync(1'b1), .dff_type(1'b1)) _TECHMAP_REPLACE_ (.I(D), .CK(C), .L(1'b0), .R(R), .O(Q));
endmodule