"RISING": begin
always @(posedge CLK, posedge RST) begin
- if(KEEP) begin
+ //Resets
+ if(RST) begin
+ if(RESET_VALUE == "ZERO")
+ count <= 0;
+ else
+ count <= COUNT_TO;
+ end
+
+ else if(KEEP) begin
end
else if(UP) begin
count <= count + 1'd1;
count <= COUNT_TO;
end
+ end
+ end
+
+ "FALLING": begin
+ always @(posedge CLK, negedge RST) begin
+
//Resets
- if(RST) begin
+ if(!RST) begin
if(RESET_VALUE == "ZERO")
count <= 0;
else
count <= COUNT_TO;
end
- end
- end
-
- "FALLING": begin
- always @(posedge CLK, negedge RST) begin
-
- if(KEEP) begin
+ else if(KEEP) begin
end
else if(UP) begin
count <= count + 1'd1;
count <= COUNT_TO;
end
- //Resets
- if(!RST) begin
- if(RESET_VALUE == "ZERO")
- count <= 0;
- else
- count <= COUNT_TO;
- end
-
end
end
"RISING": begin
always @(posedge CLK, posedge RST) begin
+ //Resets
+ if(RST) begin
+ if(RESET_VALUE == "ZERO")
+ count <= 0;
+ else
+ count <= COUNT_TO;
+ end
+
//Main counter
- if(KEEP) begin
+ else if(KEEP) begin
end
else if(UP) begin
count <= count + 1'd1;
count <= COUNT_TO;
end
+ end
+ end
+
+ "FALLING": begin
+ always @(posedge CLK, negedge RST) begin
+
//Resets
- if(RST) begin
+ if(!RST) begin
if(RESET_VALUE == "ZERO")
count <= 0;
else
count <= COUNT_TO;
end
- end
- end
-
- "FALLING": begin
- always @(posedge CLK, negedge RST) begin
-
//Main counter
- if(KEEP) begin
+ else if(KEEP) begin
end
else if(UP) begin
count <= count + 1'd1;
count <= COUNT_TO;
end
- //Resets
- if(!RST) begin
- if(RESET_VALUE == "ZERO")
- count <= 0;
- else
- count <= COUNT_TO;
- end
-
end
end