Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
20703 Discussions

Display color in Modelsim

Altera_Forum
Honored Contributor II
3,176 Views

Hello, 

 

Can anyone tell me how to print out colored characters in Modelsim using Systemverilog? :p
0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
1,937 Views

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).
0 Kudos
Reply