I want to keep the value in a register for arbitrary amount of clock cycles. Basically I want to do it similar like the treatment of a state machine:
always@ (posedge Clock ) begin
if ( Reset ) CurrentState <= STATE_Initial ;
else CurrentState <= NextState ;
end
always@ ( * ) begin
NextState = CurrentState ;
case ( CurrentState )
STATE_Initial : begin
NextState = STATE_1 ;
end
STATE_1 : begin
NextState = STATE_2 ;
end
endcase
end
My problem is now that I want to proceed in addition to that and similarly with a standard register of 24 bits:
always@ (posedge Clock ) begin
if ( Reset )
CurrentState <= STATE_Initial ;
curReg <= 24'd0;
else
CurrentState <= NextState ;
curReg <= nextReg;
end
always@ ( * ) begin
NextState = CurrentState ;
nextReg = curReg;
case ( CurrentState )
STATE_Initial : begin
NextState = STATE_1 ;
nextReg = 24'd2048;
end
STATE_1 : begin
NextState = STATE_2 ;
nextReg = 24'd211;
end
endcase
end
For me it seems to be treated the same way, but I always receive some errors that the timing constraints are not met. So, why is that a problem?