How do you smartest design a VHDL state machine for initializing a chip.
My current design is (in pseudo code):
....
....
case state:
when s0 =>
VHDL_CODE_FOR_WRITING_VALUE_TO_REGISTER
state := s1;
when s1 =>
VHDL_CODE_FOR_WRITING_ANOTHER_VALUE_TO_REGISTER
state := s1;
when s2 =>
DO_SOMETHING_ELSE_TO_FINISH_INIT
....
....
end case;
The code in s0 and s1 only differs by the value that is written to the register.
This made me think that there must be a smarter way (which is still Synthesize able)?
What made me think something can be done more clever, is the phrase "Don't repeat yourself", but I'm not sure this applies to VHDL.