Skip to content

Commit

Permalink
New: Add line number and file calling a display macro
Browse files Browse the repository at this point in the history
  • Loading branch information
dpretet committed Jun 27, 2024
1 parent ef3c7c4 commit 2e92ee9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions svut/svut_h.sv
Original file line number Diff line number Diff line change
Expand Up @@ -54,29 +54,29 @@
/// and information with an appropriate color.

`define MSG(msg) \
$display("\033[0;37m%s (L%0d @ %0t)\033[0m", msg, `__LINE__, $realtime)
$display("\033[0;37m%s (@ %0t) (L%0d %s)\033[0m", msg, $realtime, `__LINE__, `__FILE__)

`define INFO(msg) \
$display("\033[0;34mINFO: %s (L%0d @ %0t)\033[0m", msg, `__LINE__, $realtime)
$display("\033[0;34mINFO: %s (@ %0t) (L%0d %s)\033[0m", msg, $realtime, `__LINE__, `__FILE__)

`define SUCCESS(msg) \
$display("\033[0;32mSUCCESS: %s (L%0d @ %0t)\033[0m", msg, `__LINE__, $realtime)
$display("\033[0;32mSUCCESS: %s (@ %0t) (L%0d %s)\033[0m", msg, $realtime, `__LINE__, `__FILE__)

`define WARNING(msg) \
begin\
$display("\033[1;33mWARNING: %s (L%0d @ %0t)\033[0m", msg, `__LINE__, $realtime);\
$display("\033[1;33mWARNING: %s (@ %0t) (L%0d %s)\033[0m", msg, $realtime, `__LINE__, `__FILE__);\
svut_warning += 1;\
end

`define CRITICAL(msg) \
begin\
$display("\033[1;35mCRITICAL: %s (L%0d @ %0t)\033[0m", msg, `__LINE__, $realtime);\
$display("\033[1;35mCRITICAL: %s (@ %0t) (L%0d %s)\033[0m", msg, $realtime, `__LINE__, `__FILE__);\
svut_critical += 1;\
end

`define ERROR(msg)\
begin\
$display("\033[1;31mERROR: %s (L%0d @ %0t)\033[0m", msg, `__LINE__, $realtime);\
$display("\033[1;31mERROR: %s (@ %0t) (L%0d %s)\033[0m", msg, $realtime, `__LINE__, `__FILE__);\
svut_error += 1;\
end

Expand Down

0 comments on commit 2e92ee9

Please sign in to comment.