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

coolrunner2: Initial mapping of latches

This commit is contained in:
Robert Ou 2017-06-25 20:58:45 -07:00
parent 4af5baab21
commit 36b75dfcb7
4 changed files with 63 additions and 0 deletions

View file

@ -94,3 +94,43 @@ module FDCP_N (C, PRE, CLR, D, Q);
Q <= D;
end
endmodule
module LDCP (G, PRE, CLR, D, Q);
parameter INIT = 0;
input G, PRE, CLR, D;
output reg Q;
initial begin
Q <= INIT;
end
always @* begin
if (CLR == 1)
Q <= 0;
else if (G == 1)
Q <= D;
else if (PRE == 1)
Q <= 1;
end
endmodule
module LDCP_N (G, PRE, CLR, D, Q);
parameter INIT = 0;
input G, PRE, CLR, D;
output reg Q;
initial begin
Q <= INIT;
end
always @* begin
if (CLR == 1)
Q <= 0;
else if (G == 0)
Q <= D;
else if (PRE == 1)
Q <= 1;
end
endmodule