jlnagel Posted December 17, 2014 Report Share Posted December 17, 2014 Hello, The learning curve of UVM is pretty steep... Maybe you can help me climb a little bit faster... ;-) I have a working environment instantiating an agent. Now, I am trying to add a configuration class in my environment. I added a class derived from uvm_object, say: class a_config extends uvm_object; int buswidth; extern function int get_buswidth(); endclass In the environment, I try to create this configuration: class my_env extends uvm_env; a_config m_config; // ... endclass; In the build_phase, I try to create it (then I will set it so that the agent in the env can get it): function void my_env::build_phase(uvm_phase phase); // ... if(m_config == null) m_config = a_config::type_id::create("m_config",this); // ... endfunction; The compile complains about type_id being not found in the specified scope. If I define a member function in the a_config class, it can be accessed. Why is the compiler not finding the type_id ? Thank you, Jean-Luc Quote Link to comment Share on other sites More sharing options...
tudor.timi Posted December 17, 2014 Report Share Posted December 17, 2014 You forgot to register your a_config class with the factory: class a_config extends uvm_object; `uvm_object_utils(a_config) int buswidth; extern function int get_buswidth(); endclass The `uvm_object_utils macro declares the type_id field (along with some others). Quote Link to comment Share on other sites More sharing options...
jlnagel Posted December 17, 2014 Author Report Share Posted December 17, 2014 Now you gave me the answer it looks obvious... Thank you for the quick support ! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.