In reply to dileep254:
HI jatin,
This is my env code created in env.svh
class my_env extends uvm_env;
`uvm_component_utils(my_env)
my_agent agg;
function new(string name,uvm_component parent);
super.new(name,parent);
endfunction
function void build_phase(uvm_phase phase);
agg=agent::type_id::create(“agg”,this);
endfucntion
endclass:env
…
This is my test code created in test.svh
class my_test extends uvm_test;
`uvm_component_utils(agent)
virtual intf intf1();
my_env envy;
my_sequence seq;
//
function new(string name,uvm_component parent);
super.new(name,parent);
endfunction
function void build_phase(uvm_phase phase);
envy=env::type_id::create(“env”,this);
if(!uvm_config_db#(virtual intf)::get(this,“”,intf1,intf1))
begin
`uvm_info(“test”,“config not done”,UVM_LOW)
end
uvm_config_db#(virtual intf)::set(this,“envy.agg.drv”,intf1,intf1);
endfucntion
task run_phase(uvm_phase phase)
phase.raise_objection(this);
begin
#10;
`uvm_info(“kk”,“hello dileep”,UVM_LOW);
seq.start(envy.agg.sequencer);
end
phase.drop_objection(this);
endtask
endclass
…
This is my top module …
module top;
import uvm_pkg::*;
intf intf1();
counter_2 dkk(.A(intf1.A),.B(intf1.B),.Su(intf1.su),.C(intf1.C));
initial
begin
uvm_config_db#(virtual intf)::set(null,“uvm_test_top”,intf1,intf1);
run_test(my_test);
end
endmodule