C
cristian
Guest
I have done the following declaration as part of my state machine
code:
type states is (b_busy,backoff,base_address,card_present,timer_dat,timer_read,timer_write);
attribute syn_enum_encoding: string;
attribute syn_enum_encoding of states : type is "000 001 011 111 110
101 100";
SIGNAL state, nxt_state : states;
For different reasons I do need to be able to 'read' the value of the
state variables of my enumerated type to do something like this:
oe_rst <= sv(1) and not sv(2) and not sv(3);
int_req <= ((not r_cmd(3) and not r_cmd(2) and r_cmd(1) and sv(1) and
not sv(2) and sv(3)) or (sv(1) and not sv(2) and not sv(3));
start_timer <= ((sv(1) and not sv(2) and not sv(3)) or (sv(1) and not
sv(2) and sv(3)));
where 'sv' is the state variable of the enumerated type defined in the
respective VHDL statement.
I do know that this is not the best way of doing output assignments in
an State Machine. But, I need to follow some directions.
So, in concrete, is there any way to use the value of the state
variables of a declared enumerated type ?
thanks,
cristian
code:
type states is (b_busy,backoff,base_address,card_present,timer_dat,timer_read,timer_write);
attribute syn_enum_encoding: string;
attribute syn_enum_encoding of states : type is "000 001 011 111 110
101 100";
SIGNAL state, nxt_state : states;
For different reasons I do need to be able to 'read' the value of the
state variables of my enumerated type to do something like this:
oe_rst <= sv(1) and not sv(2) and not sv(3);
int_req <= ((not r_cmd(3) and not r_cmd(2) and r_cmd(1) and sv(1) and
not sv(2) and sv(3)) or (sv(1) and not sv(2) and not sv(3));
start_timer <= ((sv(1) and not sv(2) and not sv(3)) or (sv(1) and not
sv(2) and sv(3)));
where 'sv' is the state variable of the enumerated type defined in the
respective VHDL statement.
I do know that this is not the best way of doing output assignments in
an State Machine. But, I need to follow some directions.
So, in concrete, is there any way to use the value of the state
variables of a declared enumerated type ?
thanks,
cristian