Sequence

i have to write sequences to control the state transitions in fsm (in dut). in driver i have to check state transition possible or not(default i am in idle state).how do i get state name(for that i have to check transition possible or not from current state) from the user?

I think you are taking the wrong approach to your testing. You should use your sequence to generate constrained random stimulus to you DUT without consideration of the DUT’s state machine.

In conjunction with your tests, you should use your simulator’s FSM coverage tool to determine the FSM coverage and whether or not your tests completely covered all of your transitions.

If you can’t cover all of your FSM states/transitions, then you need to determine (a) if the state/transition is possible to achieve, and (b) how to generate the stimulus required to achieve them.