diff options
author | Clifford Wolf <clifford@clifford.at> | 2018-03-31 13:31:01 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-31 13:31:01 +0200 |
commit | 7ea8833676d8b388a57be2d0c1c7a6b1e450226a (patch) | |
tree | 14569db0d55a8adfb3b47853f88395613b3a8222 /techlibs/coolrunner2/tff_extract.v | |
parent | dd5fab69c135135fa46b6325a39c184a2ddc6156 (diff) | |
parent | 14e49fb05737cfb02217b2aaf14d9f5d9e1859da (diff) | |
download | yosys-7ea8833676d8b388a57be2d0c1c7a6b1e450226a.tar.gz yosys-7ea8833676d8b388a57be2d0c1c7a6b1e450226a.tar.bz2 yosys-7ea8833676d8b388a57be2d0c1c7a6b1e450226a.zip |
Merge pull request #521 from azonenberg/for_clifford
coolrunner2: Improve optimization for TFF/counters
Diffstat (limited to 'techlibs/coolrunner2/tff_extract.v')
-rw-r--r-- | techlibs/coolrunner2/tff_extract.v | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/techlibs/coolrunner2/tff_extract.v b/techlibs/coolrunner2/tff_extract.v new file mode 100644 index 000000000..b4237dd18 --- /dev/null +++ b/techlibs/coolrunner2/tff_extract.v @@ -0,0 +1,41 @@ +module FTCP (C, PRE, CLR, T, Q); + input C, PRE, CLR, T; + output wire Q; + + wire xorout; + + $_XOR_ xorgate ( + .A(T), + .B(Q), + .Y(xorout), + ); + + $_DFFSR_PPP_ dff ( + .C(C), + .D(xorout), + .Q(Q), + .S(PRE), + .R(CLR), + ); +endmodule + +module FTCP_N (C, PRE, CLR, T, Q); + input C, PRE, CLR, T; + output wire Q; + + wire xorout; + + $_XOR_ xorgate ( + .A(T), + .B(Q), + .Y(xorout), + ); + + $_DFFSR_NPP_ dff ( + .C(C), + .D(xorout), + .Q(Q), + .S(PRE), + .R(CLR), + ); +endmodule |