Clean up the Verilog a bit.

This commit is contained in:
David Given
2019-11-25 20:54:13 +01:00
parent 91d6e9aeb9
commit 1e012699af

View File

@@ -57,27 +57,18 @@ begin
countdown <= 0; countdown <= 0;
end end
else else
begin
case (state) case (state)
STATE_IDLE: STATE_IDLE:
begin
state <= STATE_LOAD; state <= STATE_LOAD;
end
STATE_LOAD: STATE_LOAD:
begin
if (dataclocked) if (dataclocked)
begin
case (opcode) case (opcode)
OPCODE_PULSE: OPCODE_PULSE:
begin
state <= STATE_PULSING; state <= STATE_PULSING;
end
OPCODE_INDEX: OPCODE_INDEX:
begin
state <= STATE_INDEXING; state <= STATE_INDEXING;
end
default: default:
begin begin
@@ -85,38 +76,23 @@ begin
state <= STATE_WAITING; state <= STATE_WAITING;
end end
endcase endcase
end
end
STATE_WAITING: STATE_WAITING:
begin
if (sampleclocked) if (sampleclocked)
begin begin
if (countdown == 0) if (countdown == 0)
begin
state <= STATE_LOAD; state <= STATE_LOAD;
end
else else
begin
countdown <= countdown - 1; countdown <= countdown - 1;
end
end end
end
STATE_PULSING: STATE_PULSING:
begin
state <= STATE_LOAD; state <= STATE_LOAD;
end
STATE_INDEXING: STATE_INDEXING:
begin
if (indexed) if (indexed)
begin
state <= STATE_LOAD; state <= STATE_LOAD;
end
end
endcase endcase
end
end end
//`#end` -- edit above this line, do not edit this line //`#end` -- edit above this line, do not edit this line