mirror of https://github.com/YosysHQ/yosys.git
coolrunner2: Add FFs with clock enable to cells_sim.v
This commit is contained in:
parent
007f29b9c2
commit
1e3ffd57cb
|
@ -244,3 +244,63 @@ module FTDCP (C, PRE, CLR, T, Q);
|
||||||
|
|
||||||
assign Q = Q_;
|
assign Q = Q_;
|
||||||
endmodule
|
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
|
||||||
|
|
Loading…
Reference in New Issue