Jump to content

Recommended Posts

Posted

Hi,

 

My question is about controlling the verbosity for one agent when I am using override for it. Let me give more details here. I have base env and base agent class. My environment extends this classes and creates env and agent. I have base test also. From top module  I override the env class. In my test which is extended from base_test If i have to control verbosity for one agent I can write set_report_verbosity methods. But now this case gives me compilation error. As my env is overriden run time but when I have to sent the verbosity for perticular agent I have to give hierarchy path.

 

In my base test I have handle of base env as env. my component base_env is overridden with x_env. x_env is having x_agent. I want to control the verbosity for x_agent for debug purpose. in my start of simulation phase if I write like "env.x_agent" it gives error which is very obivious. Is there any sollution how can i control the vebosity of agent in this case?

 

 

Thanks,

Akshay

Posted

Hi

 

Error will be hierarchy look up failed. Let me give more details with sudo code.

 

my Env class is like

class base_env extends uvm_env ;

 

endclass

 

my base test is like

 

class base_test exntends uvm_test;

 

base_env env ;

 

endclass

 

now my env is

 

class x_env extends base_env ;

x_agent_c x_agent ;

 

endclass

 

in my testbench top module

 

module top

 

intial begin

uvm_top.set_type_override_by_type(base_env::get_type, x_env::get_type)

end

 

endmodule

 

in my test I want to control for verbosity for agent x_agent which is under x_env;

so if i code like below during compilation my env is base_env which is not having x_agent so hierarchy look up will fail.

 

class x_test extends base_test ;

 

function start_of_simulation

  env.x_agent.set_report_verboisty(UVM_FULL);

endfunction

 

endclass

 

So in this case how can i control the verbosity for x_agent from my test case?

I hope my question is clear now and sorry for bad coding here.

 

Thanks,

Akshay

Posted

First, why do a type override of the from your module?  You can do that in your test's build_phase instead.

 

Since you are trying to access a member that is not present in the base_env class, you can't use a base_env class handle to access that member.  You'll have to use a x_env handle.  In this case, you'd have to cast the object like so:

 

class x_test extends base_test ;
 
function start_of_simulation();
  x_env x;
  $cast(x,env);
  x.x_agent.set_report_verboisty(UVM_FULL);
endfunction
 
endclass

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...