Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
15 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

    Hi kaz,

    This is throwing error. I had already tried this.

    The error is copied below,

    Error-[SEQSTMTASSIGNTYPE] Type mismatch

    ../dut/state_machine.vhd, 33

    SYNTH

    outp_state <= cur_state;

    ^

    The assignment statement target data type does not match the source data

    type. The target data type is 'Anonymous subtype of STD_LOGIC_VECTOR' and

    is declared by 'PACKAGE IEEE.STD_LOGIC_1164'. The source data type is

    'STATE' and is declared by 'ARCHITECTURE SYNTH'.

    "../dut/state_machine.vhd": errors: 1; warnings: 0.

    This occurs because our state variable is user defined and ouptut port is std_logic_vector.

    The state definition is copied below;

    type state is (IDLE, ST1, ST2, ST3, ST4,ST5, ST6, ST7);
    signal cur_state, nxt_state : state;

    Any idea to override this or any convesion function.

    Regards,

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

    add an output port with your favorite name, then

    curr_state_out <= curr_state;

    This should keep your customer happy.