aboutsummaryrefslogtreecommitdiffstats
path: root/techlibs
diff options
context:
space:
mode:
authorAndrew Zonenberg <azonenberg@drawersteak.com>2016-08-14 00:11:44 -0700
committerAndrew Zonenberg <azonenberg@drawersteak.com>2016-08-14 00:11:44 -0700
commit3b9756c6a3ae1d1f5b6e530d4b50e07710b44987 (patch)
tree12df860d1dfbd5cf039fb5c6251490d9d9437c79 /techlibs
parent2b062c48cb4405f4a1bb6bd49edaf687bbc2cc4e (diff)
downloadyosys-3b9756c6a3ae1d1f5b6e530d4b50e07710b44987.tar.gz
yosys-3b9756c6a3ae1d1f5b6e530d4b50e07710b44987.tar.bz2
yosys-3b9756c6a3ae1d1f5b6e530d4b50e07710b44987.zip
greenpak4: Added GP_DFFxI cells
Diffstat (limited to 'techlibs')
-rw-r--r--techlibs/greenpak4/cells_map.v26
-rw-r--r--techlibs/greenpak4/cells_sim.v42
2 files changed, 68 insertions, 0 deletions
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