3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-08-25 20:46:04 +00:00

coolrunner2: Add extraction for TFFs

This commit is contained in:
Robert Ou 2018-03-31 02:54:26 -07:00
parent dd5fab69c1
commit 8fe9cdf364
3 changed files with 54 additions and 0 deletions

View file

@ -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