After some searching, I cannot seem to find the answer to my question on creating subtypes of enumerated types in VHDL.
If I have a type describing the states of my state machine e.g.
type state_machine is (idle, reset, state1, state2, state3); -- all the way to a further 'n' number of states
I may have two signals using the state type i.e.
signal state_signal0 : state_machine := idle;
signal state_signal1 : state_machine := state1;
However, take the case that the state_signal1 signal only ever uses a subset of the state types e.g. let us say that it is only ever assigned state1 or state2. Is it possible to generate a subtype of the state_machine type.
In my head it would look something like this:
type state_machine is (idle, reset, state1, state2, state3);
subtype state_machine_subset is state_machine(state1, state2);
signal state_signal0 : state_machine := idle;
signal state_signal1 : state_machine_subset := state1;
So far I haven't found a way to achieve something like this because all of the subtype examples are described as finding ranges within integers and assigning them positive or natural etc. Would someone be able to shine a light on this?
A) Is this type of subtype definition possible?
B) If it is possible, is it worth doing? i.e. does it provide any synthesis benefits?
Thanks