Hitting the following Cross module reference error:
Error-[XMRE] Cross-module reference resolution error
/home/sf10202/Labs.UVM/lab-project-10gEthernetMAC/testbench/verilog/testclass.sv, 32
Error found while trying to resolve cross-module reference.
token ‘tb_top’. Originating program ‘testcase’.
Source info: uvm_config_db::set(this, “env0.agent_rst.drv”, “vi_pkt_tx_if”,
tb_top.pkt_tx_if);
I’m trying to set virtual interface in reset agent’s driver with config_db set call. The actual interface instantiation is in top module tb_top :
packet_tx_interface pkt_tx_if(clk_156m25,reset_156m25_n);
All UVM classes are within testcase.sv:
program testcase();
import uvm_pkg::*;
`include "/home/sf10202/Labs.UVM/lab-project-10gEthernetMAC/testbench/verilog/testclass.sv"
initial begin
run_test();
end
endprogram
And testclass has that configdb set call in build phase:
class test_base extends uvm_test;
`uvm_component_utils(test_base)
env env0;
function new(input string name, input uvm_component parent);
super.new(name,parent);
endfunction
virtual function void build_phase(input uvm_phase phase);
super.build_phase(phase);
env0 = env::type_id::create("env0",this);
//run rst sequence on reset sequencer
uvm_config_db#(uvm_object_wrapper)::set(this, "env0.agent_rst.seqr.reset_phase", "default_sequence" ,reset_sequence::get_type());
//Connect virtual interface pkt_tx to actual interface in reset agent
uvm_config_db#(virtual packet_tx_interface)::set(this, "env0.agent_rst.drv", "vi_pkt_tx_if", tb_top.pkt_tx_if);
Can someone help me fix this ?