Forum Discussion

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

Display color in Modelsim

Hello,

Can anyone tell me how to print out colored characters in Modelsim using Systemverilog? :p

1 Reply

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

    Are you talking about showing colored signals on a waveform? Or use $display()-like function to print colored text to the console?

    In case you are asking about signals, you can use `-color` parameter when adding a signal to the wave, for example:

    
    add wave -label "value" -radix unsigned -color orange /dut/value
    add wave -label "valid" -color orange /dut/valid
    

    If you are talking about $display, then I guess it depends on the OS you are using and how you run the ModelSim. For example, on Linux in console mode, you can do something like this:

    
    $display("\033\033[0m");
    

    I run the simulation like this:

    
    $ vsim -c -do ./mysim.do
    

    ... and see a green-colored "[OK]" in terminal (screenshot attached).