diff options
author | Clifford Wolf <clifford@clifford.at> | 2017-08-14 21:45:29 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-14 21:45:29 +0200 |
commit | 237b482b92a261481bb25b0dd4d6ebdf0420d774 (patch) | |
tree | b6b617bacfa371010fce3d790a76229043243abb /techlibs/coolrunner2 | |
parent | 007f29b9c221ab1a8931de863517d6990218970d (diff) | |
parent | 78fd24f40f1e2be64e8ea8116a8a2277cb3a9baf (diff) | |
download | yosys-237b482b92a261481bb25b0dd4d6ebdf0420d774.tar.gz yosys-237b482b92a261481bb25b0dd4d6ebdf0420d774.tar.bz2 yosys-237b482b92a261481bb25b0dd4d6ebdf0420d774.zip |
Merge pull request #384 from azonenberg/crtechlib
CoolRunner-II technology library improvements
Diffstat (limited to 'techlibs/coolrunner2')
-rw-r--r-- | techlibs/coolrunner2/cells_sim.v | 68 |
1 files changed, 66 insertions, 2 deletions
diff --git a/techlibs/coolrunner2/cells_sim.v b/techlibs/coolrunner2/cells_sim.v index e08ee5f9b..562fb1efd 100644 --- a/techlibs/coolrunner2/cells_sim.v +++ b/techlibs/coolrunner2/cells_sim.v @@ -143,17 +143,21 @@ module BUFG(I, O); endmodule module BUFGSR(I, O); + parameter INVERT = 0; + input I; output O; - assign O = I; + assign O = INVERT ? ~I : I; endmodule module BUFGTS(I, O); + parameter INVERT = 0; + input I; output O; - assign O = I; + assign O = INVERT ? ~I : I; endmodule module FDDCP (C, PRE, CLR, D, Q); @@ -244,3 +248,63 @@ module FTDCP (C, PRE, CLR, T, Q); assign Q = Q_; endmodule + +module FDCPE (C, PRE, CLR, D, Q, CE); + parameter INIT = 0; + + input C, PRE, CLR, D, CE; + output 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 (CE == 1) + Q <= D; + end +endmodule + +module FDCPE_N (C, PRE, CLR, D, Q, CE); + parameter INIT = 0; + + input C, PRE, CLR, D, CE; + output 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 (CE == 1) + Q <= D; + end +endmodule + +module FDDCPE (C, PRE, CLR, D, Q, CE); + parameter INIT = 0; + + input C, PRE, CLR, D, CE; + 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 if (CE == 1) + Q <= D; + end +endmodule |