accellera-official / uvm-core

Apache License 2.0
56 stars 19 forks source link

Severity of message ID changed via set_severity_id_override() not adjusted internally in uvm_report_handler #16

Closed rolec6 closed 3 months ago

rolec6 commented 3 months ago

It seems that uvm_report_handler's set_severity_id_override() and thus subsequently uvm_report_object's set_report_severity_id_override() does not work as expected if multiple severity adjustments are attempted. Specifically the severity is changed only inside report messages, but not for report handler internals. Thus if code below is run, second override will not work using new severity as cur_severity, resulting in retaining UVM_ERROR severity.

    r.set_report_severity_id_override(UVM_WARNING, "TESTW", UVM_ERROR);
    `uvm_warning ("TESTW", "Test error report. Escalated.")    
    r.set_report_severity_id_override(UVM_ERROR, "TESTW", UVM_WARNING);
    `uvm_warning ("TESTW", "Test error report. Second override.")   

It seems that it cur_severity is set to original value, the second override will start working.

    r.set_report_severity_id_override(UVM_WARNING, "TESTW", UVM_ERROR);
    `uvm_warning ("TESTW", "Test error report. Escalated.")    
    r.set_report_severity_id_override(UVM_WARNING, "TESTW", UVM_WARNING);
    `uvm_warning ("TESTW", "Test error report. Second override.")   

This does not correspond to standard where no such message upgrade/downgrade limitations are mentioned (also name cur_severity implies overridden value not original): _6.3.7 Override configuration set_report_severity_override and set_report_severity_id_override function void set_report_severity_override( uvm_severity cur_severity, uvm_severity new_severity ) function void set_report_severity_id_override( uvm_severity cur_severity, string id, uvm_severity new_severity ) These methods provide the ability to upgrade or downgrade a message in terms of severity given the severity and id. These functions call the underlying report handler set_severity_override or set_severity_idoverride, respectively (see 6.4.6).

mstrickland-mrvl commented 3 months ago

Thanks for submitting this issue.

The UVM WG will open an issue on IEEE 1800.2 to clarify that cur_severity is the original severity when the message is created and not any severity caused by an override

mstrickland-mrvl commented 3 months ago

We opened https://accellera.mantishub.io/view.php?id=8477 on IEEE 1800.2 and will close this issue. Thanks again for the submission.