Altera_Forum
Honored Contributor
9 years agoHierarchical reference to custom type
I have a state machine defined with the following lines in one of my source files:
type SM_STATES is (idle, state1, state2, state3, state4); signal current_state : SM_STATES; In my testbench, I want to wait until this state machine has reached a certain state before allowing the test sequence to continue. I've tried various combinations of the following line of code, but can't get it to compile. wait until <<signal .tb_top.u_top.u_state_machine.current_state : SM_STATES>> = state1; I'm pretty sure I could move the type declaration to a package and then instantiate the package in my testbench, but that seems to be more of a workaround than true hierarchical reference. Does anyone know the correct syntax to check using hierarchical reference that the current state is state1? Thanks - Much appreciated!