Vmm learning-vmm_log

Source: Internet
Author: User

The function is similar to the $ display function in OpenGL and is enhanced in vmm. The running information of the entire platform can be seen during simulation and used to debug the simulation platform.

The function is prototype in vmm. SV (class vmm_log;). Its constructor is extern function new (string name, string inst, vmm_log under = NULL). name indicates the name of the class containing vmm_log, inst is the name of the class containing vmm_log. The test/Generator/driver, etc components of vmm contain the implicit vmm_log examples, the verification component does not need to be instantiated again, but is different for transaction, because during verification, transcation is often instantiated many times, in this case, the vmm_log is often required to be individually instantiated when the verification component is compiled. The example is a static function, which can be used all the time for transactions. For example:

class wb_spi_trans extends vmm_data;    static vmm_log log = new("wb_spi_trans","WB_SPI_TRANS");    ...
  function new();
    super.new(this.log);
    ‘vmm_note(this,log,"Create an object");
  endfunction: newendclass : wb_spi_trans

In this way, the information "Normal [note] On wb_spi_trans (wb_spi_trans) at 0 will be output in the example wb_spi_trans.

"Create an object", the parameter name is used to tell you which component outputs information. The parameter inst is used to tell you the layer of this component in the entire verification environment (name for example ). Vmm defines the output information through a parameterized macro, such as the 'vmm _ note above. After expansion:

do    if(log.start_msg(vmm_log::NOTE_TYP)) begin        ‘void(log.text("Create an object"));    log.end_msg();    endwhile(0)

The log. start_msg function outputs "Normal [note] On wb_spi_trans (wb_spi_trans) at 0", log. Test outputs "create an object", and log. end_msg ends the output. Key vmm_log attributes include the information type types_e (Enumeration type: failure_typ/note_typ/debug_typ/report_typ/policy_typ ...), information level (Enumeration type: fatal_sev/error_sev/warning_sev/normal_sev/trace_sev/debug_sev ...), the function determines whether to output information based on the two variables. start_msg determines whether to output information based on the two variables, and determines the component in the output information based on the name and Inst.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.