aboutsummaryrefslogtreecommitdiffstats
path: root/techlibs
diff options
context:
space:
mode:
authorRobert Ou <rqou@robertou.com>2017-06-25 23:56:16 -0700
committerRobert Ou <rqou@robertou.com>2017-06-25 23:58:28 -0700
commitb102c0e2544d3bba8f8982db9dfb4974a0170368 (patch)
tree2c3ffc5b2df4f05b3c5d4a015e5a226506d50ba8 /techlibs
parent36b75dfcb71329e378caa88f5390ef9a8598b674 (diff)
downloadyosys-b102c0e2544d3bba8f8982db9dfb4974a0170368.tar.gz
yosys-b102c0e2544d3bba8f8982db9dfb4974a0170368.tar.bz2
yosys-b102c0e2544d3bba8f8982db9dfb4974a0170368.zip
coolrunner2: Add a few more primitives
These cannot be inferred yet, but add them to cells_sim.v for now
Diffstat (limited to 'techlibs')
-rw-r--r--techlibs/coolrunner2/cells_sim.v110
1 files changed, 110 insertions, 0 deletions
diff --git a/techlibs/coolrunner2/cells_sim.v b/techlibs/coolrunner2/cells_sim.v
index 90eb4eb16..e08ee5f9b 100644
--- a/techlibs/coolrunner2/cells_sim.v
+++ b/techlibs/coolrunner2/cells_sim.v
@@ -134,3 +134,113 @@ module LDCP_N (G, PRE, CLR, D, Q);
Q <= 1;
end
endmodule
+
+module BUFG(I, O);
+ input I;
+ output O;
+
+ assign O = I;
+endmodule
+
+module BUFGSR(I, O);
+ input I;
+ output O;
+
+ assign O = I;
+endmodule
+
+module BUFGTS(I, O);
+ input I;
+ output O;
+
+ assign O = I;
+endmodule
+
+module FDDCP (C, PRE, CLR, D, Q);
+ parameter INIT = 0;
+
+ input C, PRE, CLR, D;
+ output reg Q;
+
+ initial begin
+ Q <= INIT;
+ end
+
+ always @(posedge C, negedge C, posedge PRE, posedge CLR) begin
+ if (CLR == 1)
+ Q <= 0;
+ else if (PRE == 1)
+ Q <= 1;
+ else
+ Q <= D;
+ end
+endmodule
+
+module FTCP (C, PRE, CLR, T, Q);
+ parameter INIT = 0;
+
+ input C, PRE, CLR, T;
+ output wire Q;
+ reg Q_;
+
+ initial begin
+ Q_ <= INIT;
+ end
+
+ always @(posedge C, posedge PRE, posedge CLR) begin
+ if (CLR == 1)
+ Q_ <= 0;
+ else if (PRE == 1)
+ Q_ <= 1;
+ else if (T == 1)
+ Q_ <= ~Q_;
+ end
+
+ assign Q = Q_;
+endmodule
+
+module FTCP_N (C, PRE, CLR, T, Q);
+ parameter INIT = 0;
+
+ input C, PRE, CLR, T;
+ output wire Q;
+ reg Q_;
+
+ initial begin
+ Q_ <= INIT;
+ end
+
+ always @(negedge C, posedge PRE, posedge CLR) begin
+ if (CLR == 1)
+ Q_ <= 0;
+ else if (PRE == 1)
+ Q_ <= 1;
+ else if (T == 1)
+ Q_ <= ~Q_;
+ end
+
+ assign Q = Q_;
+endmodule
+
+module FTDCP (C, PRE, CLR, T, Q);
+ parameter INIT = 0;
+
+ input C, PRE, CLR, T;
+ output wire Q;
+ reg Q_;
+
+ initial begin
+ Q_ <= INIT;
+ end
+
+ always @(posedge C, negedge C, posedge PRE, posedge CLR) begin
+ if (CLR == 1)
+ Q_ <= 0;
+ else if (PRE == 1)
+ Q_ <= 1;
+ else if (T == 1)
+ Q_ <= ~Q_;
+ end
+
+ assign Q = Q_;
+endmodule