diff --git a/techlibs/greenpak4/cells_map.v b/techlibs/greenpak4/cells_map.v index b7d750ae0..36d2d0310 100644 --- a/techlibs/greenpak4/cells_map.v +++ b/techlibs/greenpak4/cells_map.v @@ -24,6 +24,32 @@ module GP_DFFR(input D, CLK, nRST, output reg Q); ); endmodule +module GP_DFFSI(input D, CLK, nSET, output reg Q); + parameter [0:0] INIT = 1'bx; + GP_DFFSRI #( + .INIT(INIT), + .SRMODE(1'b1), + ) _TECHMAP_REPLACE_ ( + .D(D), + .CLK(CLK), + .nSR(nSET), + .Q(Q) + ); +endmodule + +module GP_DFFRI(input D, CLK, nRST, output reg Q); + parameter [0:0] INIT = 1'bx; + GP_DFFSRI #( + .INIT(INIT), + .SRMODE(1'b0), + ) _TECHMAP_REPLACE_ ( + .D(D), + .CLK(CLK), + .nSR(nRST), + .Q(Q) + ); +endmodule + module GP_OBUFT(input IN, input OE, output OUT); GP_IOBUF _TECHMAP_REPLACE_ ( .IN(IN), diff --git a/techlibs/greenpak4/cells_sim.v b/techlibs/greenpak4/cells_sim.v index ceec28696..e99c0c827 100644 --- a/techlibs/greenpak4/cells_sim.v +++ b/techlibs/greenpak4/cells_sim.v @@ -165,6 +165,14 @@ module GP_DFF(input D, CLK, output reg Q); end endmodule +module GP_DFFI(input D, CLK, output reg Q); + parameter [0:0] INIT = 1'bx; + initial Q = INIT; + always @(posedge CLK) begin + Q <= ~D; + end +endmodule + module GP_DFFR(input D, CLK, nRST, output reg Q); parameter [0:0] INIT = 1'bx; initial Q = INIT; @@ -176,6 +184,17 @@ module GP_DFFR(input D, CLK, nRST, output reg Q); end endmodule +module GP_DFFRI(input D, CLK, nRST, output reg Q); + parameter [0:0] INIT = 1'bx; + initial Q = INIT; + always @(posedge CLK, negedge nRST) begin + if (!nRST) + Q <= 1'b1; + else + Q <= ~D; + end +endmodule + module GP_DFFS(input D, CLK, nSET, output reg Q); parameter [0:0] INIT = 1'bx; initial Q = INIT; @@ -187,6 +206,17 @@ module GP_DFFS(input D, CLK, nSET, output reg Q); end endmodule +module GP_DFFSI(input D, CLK, nSET, output reg Q); + parameter [0:0] INIT = 1'bx; + initial Q = INIT; + always @(posedge CLK, negedge nSET) begin + if (!nSET) + Q <= 1'b0; + else + Q <= ~D; + end +endmodule + module GP_DFFSR(input D, CLK, nSR, output reg Q); parameter [0:0] INIT = 1'bx; parameter [0:0] SRMODE = 1'bx; @@ -199,6 +229,18 @@ module GP_DFFSR(input D, CLK, nSR, output reg Q); end endmodule +module GP_DFFSRI(input D, CLK, nSR, output reg Q); + parameter [0:0] INIT = 1'bx; + parameter [0:0] SRMODE = 1'bx; + initial Q = INIT; + always @(posedge CLK, negedge nSR) begin + if (!nSR) + Q <= ~SRMODE; + else + Q <= ~D; + end +endmodule + module GP_IBUF(input IN, output OUT); assign OUT = IN; endmodule