Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: undefined identifier 'sev' #28

Open
geeta-yadav opened this issue Jan 11, 2016 · 0 comments
Open

Error: undefined identifier 'sev' #28

geeta-yadav opened this issue Jan 11, 2016 · 0 comments

Comments

@geeta-yadav
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant