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: no property 'type_id' for type 'test.env' #29

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

Error: no property 'type_id' for type 'test.env' #29

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

Comments

@geeta-yadav
Copy link

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);

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;

env e;

this(string name, uvm_component parent)
{
super(name, parent);
}

override void build()
{
cfg c, d;

e = new env ("env", this);
set_config_int("*", "A", 14);
uvm_resource_db!(int).set("*", "B", 98, this);

c = new cfg;
c.z = -122;
set_config_object("*", "C", c, 0);

d = new cfg;
d.z = 88;
uvm_resource_db!(uvm_object).set("*", "D", d, this);

}

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

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