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:
parent
dd5fab69c1
commit
8fe9cdf364
3 changed files with 54 additions and 0 deletions
41
techlibs/coolrunner2/tff_extract.v
Normal file
41
techlibs/coolrunner2/tff_extract.v
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue