coverify / euvm

Embedded UVM (D Language port of IEEE UVM 1.0)
Apache License 2.0
30 stars 14 forks source link

Error: undefined identifier 'sev' #28

Open geeta-yadav opened 8 years ago

geeta-yadav commented 8 years ago

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_componentutils; override void initial() { ac mya,myb; b policy; catcher catch; catch_ = new catcher; uvm_reportcb.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=UVMINFO; assert(mya.compare(myb, policy)==0); // changes and checks the ver ans sev if(catch.cnt != 3) // `uvmfatal("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