Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Register Log in

How can I display text on waveforms with Modelsim?

Cesar0182

Member level 4
Joined
Feb 18, 2019
Messages
73
Helped
0
Reputation
0
Reaction score
0
Trophy points
6
Activity points
728
Greetings ... I have a state machine for a project in Vivado 2017.4 and where I need to show or add text in the waveforms when I simulate with Modelsim 14.5
This is a part of the code that I am using.

Code:
SIGNAL l1_spi_rx_sm_sm      : std_logic_vector(7 DOWNTO 0);         -- Current State ( Register )
SIGNAL l1_spi_rx_sm_next    : std_logic_vector(7 DOWNTO 0);         -- Next State ( Combinatorial Bus )

type rx_smtype              is (SM_IDLE,SM_WRITE_TSM,SM_WRITE_TSL,SM_MESSAGE_ACTIVE,SM_WRITE_EOF_TK);
SIGNAL rx_sm_st             : rx_smtype;

-- State Register
process (i_clk,i_rst)
  begin
    if( i_rst = '1' ) then
      l1_spi_rx_sm_sm <= Idle;
        
    elsif rising_edge( i_clk ) then   
      l1_spi_rx_sm_sm <= l1_spi_rx_sm_next;
          
    end if;
end process;
    
-- Next State combinational logic
process (l1_spi_rx_sm_sm,i_frame_done,i_rx_vldchar_tk) 
  begin
    case l1_spi_rx_sm_sm is
            
    when Idle =>   
    -- pragma synthesis_off   
      rx_sm_st <= SM_IDLE; 
    -- pragma synthesis_on     
      if i_rx_vldchar_tk = '1' then
        l1_spi_rx_sm_next   <= Write_Tsm;
      else
        l1_spi_rx_sm_next   <= Idle;
      end if;     
                          
    when Write_Tsm =>     
    -- pragma synthesis_off   
      rx_sm_st <= SM_WRITE_TSM; 
    -- pragma synthesis_on   
      l1_spi_rx_sm_next     <= Write_Tsl;
                      
    when Write_Tsl =>
    -- pragma synthesis_off   
      rx_sm_st <= SM_WRITE_TSL; 
    -- pragma synthesis_on           
      l1_spi_rx_sm_next     <= Message_Active;
                      
    when Message_Active =>
    -- pragma synthesis_off   
      rx_sm_st <= SM_MESSAGE_ACTIVE; 
    -- pragma synthesis_on   
      if i_frame_done = '1' then
        l1_spi_rx_sm_next   <= Write_Eof_Tk;
      else
        l1_spi_rx_sm_next   <= Message_Active;
      end if;
            
    when Write_Eof_Tk =>   
    -- pragma synthesis_off   
      rx_sm_st <= SM_WRITE_EOF_TK; 
    -- pragma synthesis_on   
      l1_spi_rx_sm_next   <= Idle;
            
    when others =>
      l1_spi_rx_sm_next     <= Idle;
    end case;
end process;
I need to show the change of states that occurs with ¨rx_sm_st¨ but this does not appear among the objects of the state machine. Could someone help me with this please?
 

TrickyDicky

Advanced Member level 5
Joined
Jun 7, 2010
Messages
7,001
Helped
2,056
Reputation
4,129
Reaction score
2,006
Trophy points
1,393
Activity points
38,428
What text are you expecting? With an ennumerated type it will show the state name not a binary code when you do an RTL simulation.
If you are doing a netlist simulation then it will show the binary it has been converted to, but you can use TCL commands to encode the state for display.
 

Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top