You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
override void build()
{
if(!uvm_resource_db!(uvm_bitstream_t).read_by_name(get_full_name(), "A", A, this))
{
uvm_error("NOCONFIG", "A not located in resource pool");
}
writeln("A = %0d", A);
if(!get_config_int("B", B))
{
uvm_error("NOCONFIG", "B not located in resource pool");
}
writeln("B = %0d", B);
if(!uvm_resource_db!(uvm_object).read_by_name(get_full_name(), "C", dummy, this))
{
uvm_error("NOCONFIG", "C not located in resource pool");
}
else
{
if(C!=cast(cfg) dummy)
{
uvm_error("NOCONFIG", "C has incorrect type");
}
else
{
writeln("C = %s", C.convert2string());
}
}
if(!get_config_object("D", dummy, 0))
{
uvm_error("NOCONFIG", "D not located in resource pool");
}
else
{
if(D!=cast(cfg) dummy)
{
uvm_error("NOCONFIG", "D has incorrect type");
}
else
{
writeln("D = %s", D.convert2string());
}
}
if(A == 14 && B == 98 && C.z == -122 && D.z == 88)
{
writeln("** UVM TEST PASSED **");
}
else
{
writeln("** UVM TEST FAIL **");
}
}
}
class test: uvm_component
{
mixin uvm_component_utils;
Compilation of below code is giving type_id error:
import esdl;
import uvm;
import std.stdio;
class test_root: uvm_root
{
mixin uvm_component_utils;
}
class TestBench: RootEntity
{
uvm_root_entity!(test_root) tb;
}
class cfg: uvm_object
{
uint z;
string covert2string()
{
string s;
writeln(s, "{ z = %0d }", z);
return s;
}
}
class env: uvm_component
{
uvm_bitstream_t A;
uint B;
uvm_object dummy;
cfg C,D;
this(string name, uvm_component parent)
{
super(name, parent);
}
override void build()
{
if(!uvm_resource_db!(uvm_bitstream_t).read_by_name(get_full_name(), "A", A, this))
{
uvm_error("NOCONFIG", "A not located in resource pool");
}
writeln("A = %0d", A);
}
}
class test: uvm_component
{
mixin uvm_component_utils;
env e;
this(string name, uvm_component parent)
{
super(name, parent);
}
override void build()
{
cfg c, d;
}
override void report()
{
uvm_resource_pool rp = uvm_resource_pool.get();
rp.dump();
}
}
void main(string[] argv) {
TestBench tb = new TestBench;
tb.multiCore(0, 0);
tb.elaborate("tb", argv);
tb.simulate();
}
Error:
Error: no property 'type_id' for type 'test.env'
Error: template instance uvm.base.uvm_component._uvm__auto_build!(test, env, 0LU, ) error instantiating
Regards
Geeta
The text was updated successfully, but these errors were encountered: