Skip to content

Commit

Permalink
logger: Changed verbosity level type
Browse files Browse the repository at this point in the history
Signed-off-by: Istvan-Zsolt Szekely <[email protected]>
  • Loading branch information
IstvanZsSzekely committed Nov 4, 2024
1 parent b73cf3c commit 815d7cc
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions library/utilities/logger_pkg.sv
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,18 @@

package logger_pkg;

localparam int ADI_VERBOSITY_NONE = 0; // highest priority, test passed message, randomization state, cannot be disabled
localparam int ADI_VERBOSITY_LOW = 100; // test_program level debugging
localparam int ADI_VERBOSITY_MEDIUM = 200; // driver level debugging
localparam int ADI_VERBOSITY_HIGH = 300; // VIP, regmap, utilities level debugging
typedef enum {
ADI_VERBOSITY_NONE, // highest priority, test passed message, randomization state, cannot be disabled
ADI_VERBOSITY_LOW, // test_program level debugging
ADI_VERBOSITY_MEDIUM, // driver level debugging
ADI_VERBOSITY_HIGH // VIP, regmap, utilities level debugging
} adi_verbosity_t;

int verbosity = ADI_VERBOSITY_HIGH;
adi_verbosity_t verbosity = ADI_VERBOSITY_HIGH;

function void PrintInfo(
input string inStr,
input integer msgVerborisity);
input adi_verbosity_t msgVerborisity);

if (verbosity >= msgVerborisity) begin
$display("[INFO] @ %0t: %s", $time, inStr);
Expand All @@ -65,7 +67,7 @@ package logger_pkg;
$fatal(1, "[FATAL] @ %0t: %s", $time, inStr);
endfunction: PrintFatal

function void setLoggerVerbosity(input int value);
function void setLoggerVerbosity(input adi_verbosity_t value);
verbosity = value;
endfunction: setLoggerVerbosity

Expand All @@ -91,7 +93,7 @@ package logger_pkg;

function void info(
input string message,
input int verbosity);
input adi_verbosity_t verbosity);

`INFO(("[%s] %s", this.get_path(), message), verbosity);
endfunction: info
Expand Down

0 comments on commit 815d7cc

Please sign in to comment.