Tuesday, April 13, 2010

PASS and FAIL Messages with Colors...!

How many among you know that you can actually display color messages using Verilog and SystemVerilog?

You can implement a logic in your testbench to have nicely colored display messages at the end of your simulation which will give you a PASS/FAIL messages. I have written a piece of code given below and you can refer the same. I have captured a snapshot of output which you can see at the top.

program clr_display();
class color ;
   task display ();
      $display("*********** TEST CASE PASS ************");

      $display("*********** TEST CASE FAIL ************");

initial begin
   color clr;
   clr = new ();
   clr.display ();

With an above example you can have a display messages with colors. So this way you can have nicely and colored messages on your terminal.

ASIC with Ankit