Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
14 years ago

VHDL state to entity

Hi,

I have a VHDL design with 8 states. I want to take the state "cur_state" specifically to entity output port.

This is not for debug, but a specific customer requirement.

Please let me know how to do this.

Regards,

freak

22 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    You mean, by default the tool uses one-hot encoding.

    --- Quote End ---

    You can watch the implemented encoding in the state maschine viewer. One state hot is said to be most effective for FPGA implementations. It uses more state variable registers but less LE's for the state machine logic and achieves highest speed.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    You can watch the implemented encoding in the state maschine viewer. One state hot is said to be most effective for FPGA implementations. It uses more state variable registers but less LE's for the state machine logic and achieves highest speed.

    --- Quote End ---

    I think it may be more prudent to say can achieve the highest speed. E.g. if you compare a few 32 bit numbers in your state machine speed will drop considerably and then the encoding doesn't really matter that much any more. I try to pre-register the inputs to a state machine, it keeps the transition equations simple (sometimes even readable), easy to simulate (I tend to separate state machines into a separate file) and achieves highest speed. E.g. in a downcounter I set a registered IsZero flag when count is one and we see a count enable. Instead of 32 bits we then have a single IsZero input to the state machine