mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-12 20:18:20 +00:00
Fixed bug in GP_COUNTx model
This commit is contained in:
parent
66b256d40e
commit
e5109847c9
|
@ -147,10 +147,11 @@ module GP_COUNT14_ADV(input CLK, input RST, output reg OUT,
|
||||||
|
|
||||||
if(KEEP) begin
|
if(KEEP) begin
|
||||||
end
|
end
|
||||||
else if(UP)
|
else if(UP) begin
|
||||||
count <= count + 1'd1;
|
count <= count + 1'd1;
|
||||||
if(count == 14'h3fff)
|
if(count == 14'h3fff)
|
||||||
count <= COUNT_TO;
|
count <= COUNT_TO;
|
||||||
|
end
|
||||||
else begin
|
else begin
|
||||||
count <= count - 1'd1;
|
count <= count - 1'd1;
|
||||||
|
|
||||||
|
@ -174,10 +175,11 @@ module GP_COUNT14_ADV(input CLK, input RST, output reg OUT,
|
||||||
|
|
||||||
if(KEEP) begin
|
if(KEEP) begin
|
||||||
end
|
end
|
||||||
else if(UP)
|
else if(UP) begin
|
||||||
count <= count + 1'd1;
|
count <= count + 1'd1;
|
||||||
if(count == 14'h3fff)
|
if(count == 14'h3fff)
|
||||||
count <= COUNT_TO;
|
count <= COUNT_TO;
|
||||||
|
end
|
||||||
else begin
|
else begin
|
||||||
count <= count - 1'd1;
|
count <= count - 1'd1;
|
||||||
|
|
||||||
|
@ -218,10 +220,11 @@ module GP_COUNT14_ADV(input CLK, input RST, output reg OUT,
|
||||||
|
|
||||||
if(KEEP) begin
|
if(KEEP) begin
|
||||||
end
|
end
|
||||||
else if(UP)
|
else if(UP) begin
|
||||||
count <= count + 1'd1;
|
count <= count + 1'd1;
|
||||||
if(count == 14'h3fff)
|
if(count == 14'h3fff)
|
||||||
count <= COUNT_TO;
|
count <= COUNT_TO;
|
||||||
|
end
|
||||||
else begin
|
else begin
|
||||||
count <= count - 1'd1;
|
count <= count - 1'd1;
|
||||||
|
|
||||||
|
@ -284,10 +287,11 @@ module GP_COUNT8_ADV(input CLK, input RST, output reg OUT,
|
||||||
//Main counter
|
//Main counter
|
||||||
if(KEEP) begin
|
if(KEEP) begin
|
||||||
end
|
end
|
||||||
else if(UP)
|
else if(UP) begin
|
||||||
count <= count + 1'd1;
|
count <= count + 1'd1;
|
||||||
if(count == 8'hff)
|
if(count == 8'hff)
|
||||||
count <= COUNT_TO;
|
count <= COUNT_TO;
|
||||||
|
end
|
||||||
else begin
|
else begin
|
||||||
count <= count - 1'd1;
|
count <= count - 1'd1;
|
||||||
|
|
||||||
|
@ -312,10 +316,11 @@ module GP_COUNT8_ADV(input CLK, input RST, output reg OUT,
|
||||||
//Main counter
|
//Main counter
|
||||||
if(KEEP) begin
|
if(KEEP) begin
|
||||||
end
|
end
|
||||||
else if(UP)
|
else if(UP) begin
|
||||||
count <= count + 1'd1;
|
count <= count + 1'd1;
|
||||||
if(count == 8'hff)
|
if(count == 8'hff)
|
||||||
count <= COUNT_TO;
|
count <= COUNT_TO;
|
||||||
|
end
|
||||||
else begin
|
else begin
|
||||||
count <= count - 1'd1;
|
count <= count - 1'd1;
|
||||||
|
|
||||||
|
@ -356,17 +361,17 @@ module GP_COUNT8_ADV(input CLK, input RST, output reg OUT,
|
||||||
|
|
||||||
if(KEEP) begin
|
if(KEEP) begin
|
||||||
end
|
end
|
||||||
else if(UP)
|
else if(UP) begin
|
||||||
count <= count + 1'd1;
|
count <= count + 1'd1;
|
||||||
if(count == 8'hff)
|
if(count == 8'hff)
|
||||||
count <= COUNT_TO;
|
count <= COUNT_TO;
|
||||||
|
end
|
||||||
else begin
|
else begin
|
||||||
count <= count - 1'd1;
|
count <= count - 1'd1;
|
||||||
|
|
||||||
if(count == 0)
|
if(count == 0)
|
||||||
count <= COUNT_TO;
|
count <= COUNT_TO;
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue