Skip to content

Error: undefined identifier 'sev' #28

Description

@geeta-yadav

Hi
The compilation of the below test gives "undefined identifier 'sev' error while setting the severity:

import esdl;
import uvm;
import std.stdio;

class ac: uvm_object
{
@rand uint a;
string b;

mixin uvm_object_utils;

this(string name="")
{
super(name);
}
}

class b: uvm_comparer
{
this()
{
super();
sev=UVM_FATAL;
verbosity=UVM_NONE;
show_max=-1;
}
}

class catcher: uvm_report_catcher
{
uint cnt=0;
override action_e do_catch()
{
if(get_severity() == UVM_FATAL && get_id() == "MISCMP")
{
cnt++;
set_severity(UVM_INFO);
return THROW;
}

if(get_severity() == UVM_INFO && get_id() == "MISCMP")
  {
cnt++;
return THROW;
  }
return THROW;

}

}

class test_root: uvm_root
{
mixin uvm_component_utils;
override void initial()
{
ac mya,myb;
b policy;
catcher catch_;
catch_ = new catcher;
uvm_report_cb.add(null, catch_);
mya=new ac;
myb=new ac;
policy=new b;
mya.randomize();
mya.b="bang";
assert(mya.compare(myb, policy)==0);
// policy.verbosity=UVM_HIGH;
// policy.sev=UVM_INFO;
assert(mya.compare(myb, policy)==0); // changes and checks the ver ans sev
if(catch_.cnt != 3)
// `uvm_fatal("TEST",$sformatf("test failed, caught %0d messages",catch_.cnt))
{
uvm_report_server svr;
//svr = uvm_coreservice.get_report_server();
svr.summarize();
if (svr.get_severity_count(UVM_FATAL) +
svr.get_severity_count(UVM_ERROR) == 0)
writeln("** UVM TEST PASSED **\n");
else
writeln("!! UVM TEST FAILED !!\n");
}
}
}

class TestBench: RootEntity
{
uvm_root_entity!(test_root) tb;
}

void main(string[] argv) {
TestBench tb = new TestBench;
tb.multiCore(0, 0);
tb.elaborate("tb", argv);
tb.simulate();
}

Here is the error:

Error: undefined identifier 'sev', did you mean function 'sec'?

Regards
Geeta

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions