yosys/techlibs/nanoxplore/cells_map.v

73 lines
3.1 KiB
Verilog
Raw Normal View History

2024-03-01 03:43:34 -06:00
`default_nettype none
module \$lut (A, Y);
parameter WIDTH = 0;
parameter LUT = 0;
(* force_downto *)
input [WIDTH-1:0] A;
output Y;
generate
if (WIDTH == 1) begin
2024-03-01 03:44:42 -06:00
localparam [15:0] INIT = {{2{LUT[1:0]}}, {2{LUT[1:0]}}, {2{LUT[1:0]}}, {2{LUT[1:0]}},
{2{LUT[1:0]}}, {2{LUT[1:0]}}, {2{LUT[1:0]}}, {2{LUT[1:0]}}};
2024-03-01 03:43:34 -06:00
NX_LUT #(.lut_table(INIT)) _TECHMAP_REPLACE_ (.O(Y),
2024-03-01 03:44:42 -06:00
.I1(A[0]), .I2(1'b0), .I3(1'b0), .I4(1'b0));
2024-03-01 03:43:34 -06:00
end else
if (WIDTH == 2) begin
2024-03-01 03:44:42 -06:00
localparam [15:0] INIT = {{4{LUT[3:0]}}, {4{LUT[3:0]}}, {4{LUT[3:0]}}, {4{LUT[3:0]}}};
2024-03-01 03:43:34 -06:00
NX_LUT #(.lut_table(INIT)) _TECHMAP_REPLACE_ (.O(Y),
2024-03-01 03:44:42 -06:00
.I1(A[0]), .I2(A[1]), .I3(1'b0), .I4(1'b0), );
2024-03-01 03:43:34 -06:00
end else
if (WIDTH == 3) begin
2024-03-01 03:44:42 -06:00
localparam [15:0] INIT = {{8{LUT[7:0]}}, {8{LUT[7:0]}}};
2024-03-01 03:43:34 -06:00
NX_LUT #(.lut_table(INIT)) _TECHMAP_REPLACE_ (.O(Y),
2024-03-01 03:44:42 -06:00
.I1(A[0]), .I2(A[1]), .I3(A[2]), .I4(1'b0));
2024-03-01 03:43:34 -06:00
end else
if (WIDTH == 4) begin
NX_LUT #(.lut_table(LUT)) _TECHMAP_REPLACE_ (.O(Y),
.I1(A[0]), .I2(A[1]), .I3(A[2]), .I4(A[3]));
end else begin
wire _TECHMAP_FAIL_ = 1;
end
endgenerate
endmodule
2024-03-01 03:55:54 -06:00
(* 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
2024-03-01 03:55:54 -06:00
module \$_SDFF_PP0_ (input D, C, R, output Q);
2024-03-01 08:25:24 -06:00
wire _TECHMAP_REMOVEINIT_Q_ = 1'b1;
2024-03-01 03:55:54 -06:00
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);
2024-03-01 08:25:24 -06:00
wire _TECHMAP_REMOVEINIT_Q_ = 1'b1;
2024-03-01 03:55:54 -06:00
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);
2024-03-01 08:25:24 -06:00
wire _TECHMAP_REMOVEINIT_Q_ = 1'b1;
2024-03-01 03:55:54 -06:00
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);
2024-03-01 08:25:24 -06:00
wire _TECHMAP_REMOVEINIT_Q_ = 1'b1;
2024-03-01 03:55:54 -06:00
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