Home Methodologies VMM VMM log
Main Menu
Home
System Verilog
Verilog
Methodologies
    - OVM Tutorial
    - OVM Example
    - UVM
    - VMM
        -- VMM log
        -- VMM Data
        -- VMM channel
        -- VMM Xactor
        -- VMM notify
        -- VMM Atomic Gen
        -- VMM env
        -- VMM Callbacks
    - VMM RAL
    - VMM Example
    - AVM Tutorial
Open Vera
Digital Concepts
Verification Basics
Protocols
Scripting
Articles
Videos
Interview Questions
Computer Architechture
C and C++
Blog/Article
AsicGuru Blog
Tags Cloud
Ads
Usefull Sites
Know Your IP/Location
Local Information India
Buy Car/Inverter Batteries
Real Estate India
Sports Accessories India
VMM log Class
Share This Articale:

VMM_LOG :

VMM log is a messaging utility class which is used to issue different kind of messages with different severity which can be contorolled fron the command line or from you testcases. generateor etc.

Advantages of using vmm_log class :

  1. Consistancy - Provides a consistent format print format across the testbench so filtering or post processing of the messages becomes easier

  2. More control - Each message issued have a serverity attached with it. So you can control which serverity level should be printed i.e In normal simulation the messages with note and above serverity are printed and in debug we can print the messages with trace and debug serverity.

  3. Runtime control - Messages can be controlled on the run time. 
  4. Severity change - We can change the message severity like we can change all warning severity messages to error serverity to force the owner to fix all the warnings coming out of testbench for cleanup.

Message Severity

Individual messages are categorized into different severities. The fatal have the higher severity and the verbose have the lower severity. By default all the messages with note serverity and above will be displayed and lower than note severity will be masked (trace, debug, verbose). If we want to see the message with lower serverity we need to enable them either from command line with argument or from the testbench.

To change the serverity from the command line you need to add following switch to your simulation command :

+vmm_log_default=DEBUG

Something like :

vsim -c vmm_log_example -sv_lib fli -do "run -all" +vmm_log_default=DEBUG

 

  1. FATAL_SEV  : An error which causes a program to abort. 
  2. ERROR_SEV  : Simulation aborts after a certain number of errors are observed.
  3. WARNING_SEV: Simulation can proceed and still produce useful result.
  4. NORMAL_SEV : This message indicates the state of simulation.
  5. TRACE_SEV  : This message identifies high-level internal information that is not normally issued.
  6. DEBUG_SEV  : This message identifies medium-level internal information that is not normally issued.
  7. VERBOSE_SEV: This message identifies low-level internal information that is not normally issued.

Vmm Log Macros :

We can use the following predefined macros to select the message severity.

  1. `vmm_fatal(vmm_log log, string msg);
  2. `vmm_error(vmm_log log, string msg);
  3. `vmm_warning(vmm_log log, string msg);
  4. `vmm_note(vmm_log log, string msg);
  5. `vmm_trace(vmm_log log, string msg);
  6. `vmm_debug(vmm_log log, string msg);
  7. `vmm_verbose(vmm_log log, string msg);
// vmm log example
`include "vmm.sv"
program vmm_log_example;

    // create vmm log object
    vmm_log log;

    initial begin
        log = new("vmm_log_example", null);

        // by default the messages which are issued with
        // trace and debug severity will not be visible
        // unless you enable them from the command line
        `vmm_trace(log, "Issued with vmm_trace");
        `vmm_debug(log, "Issued with vmm_debug");
        `vmm_verbose(log, "Issued with vmm_verbose");

        // all messages will note and above serverity will
        // be displayed
        `vmm_note(log, "Issued with vmm_note");
        `vmm_warning(log, "Issued with vmm_warning");
        `vmm_error(log, "Issued with vmm_error");

        // fatal severity will stop the simulation
        `vmm_fatal(log, "Issued with vmm_fatal");
    end


endprogram : vmm_log_example

// Output example : 
# Normal[NOTE] on vmm_log_example() at                    0:
#     Issued with vmm_note
# WARNING[FAILURE] on vmm_log_example() at                    0:
#     Issued with vmm_warning
# !ERROR![FAILURE] on vmm_log_example() at                    0:
#     Issued with vmm_error
# *FATAL*[FAILURE] on vmm_log_example() at                    0:
#     Issued with vmm_fatal

// Output example with +vmm_log_default=DEBUG
# Trace[DEBUG] on vmm_log_example() at                    0:
#     Issued with vmm_trace
# Debug[DEBUG] on vmm_log_example() at                    0:
#     Issued with vmm_debug
# Normal[NOTE] on vmm_log_example() at                    0:
#     Issued with vmm_note
# WARNING[FAILURE] on vmm_log_example() at                    0:
#     Issued with vmm_warning
# !ERROR![FAILURE] on vmm_log_example() at                    0:
#     Issued with vmm_error
# *FATAL*[FAILURE] on vmm_log_example() at                    0:
#     Issued with vmm_fatal



Keywords : vmm_log  

This Articles is written/submitted by puneet (Puneet Aggarwal). You can also contribute to Asicguru.com. Click here to start


Next >> VMM Data

 
Login/Register
Register
Sign In
Login with :-
gmail-yahoo-twitter-facebook
| | |  
  •  
  • Bookmark
    ADS