From 3b9756c6a3ae1d1f5b6e530d4b50e07710b44987 Mon Sep 17 00:00:00 2001 From: Andrew Zonenberg Date: Sun, 14 Aug 2016 00:11:44 -0700 Subject: [PATCH] greenpak4: Added GP_DFFxI cells --- techlibs/greenpak4/cells_map.v | 26 +++++++++++++++++++++ techlibs/greenpak4/cells_sim.v | 42 ++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+) 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 -- 2.30.2