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.