Files
iverilog/ivtest/ivltests/implicit1.v
T
Stephen Williams cea237b407 Add ivtest to the iverilog source tree
By adding ivtest to the iverilog source tree, it is easier to keep
the regression test synchronized with the source that is being tested.
This should be especially helpful for PRs that add a new feature, and
have a matching ivtest PR with the regression test for that feature.
2022-01-15 10:18:50 -08:00

41 lines
895 B
Verilog

/*
* From PR#379
*/
`define IDLE 2'b00
`define COUNT 2'b01
`define DONE 2'b10
module Counter56 (POR, CLK, VoltageOK, ChargeDone );
input POR;
input CLK;
input VoltageOK;
output ChargeDone;
reg [1:0] CounterState, nextCounterState;
wire [8:0] nextMinuteCounter;
always @(posedge CLK or negedge POR)
if (!POR)
CounterState = 2'b00;
else
CounterState = nextCounterState;
always @(VoltageOK or CounterReset) // CounterReset should make an error
casez (CounterState)
`IDLE: begin
nextCounterState = (VoltageOK) ? `COUNT : `IDLE;
end
`COUNT: begin
nextCounterState = (VoltageOK) ? `COUNT : `IDLE;
end
`DONE: begin
nextCounterState = `DONE;
end
default: begin
nextCounterState = 2'bxx;
end
endcase
endmodule