Hi
I want to create an array of driver. The following are the codes. vsim shows Fatal error while running the simulation: Fatal: (SIGSEGV) Bad handle or reference. The Fatal error is pointing to the code with bold character.
class efm_env extends uvm_env;
.....
abc_drv abc_drv_ch[16];
.....
function new(string name="", uvm_component parent=null);
super.new(name, parent);
endfunction
function void build_phase(uvm_phase phase);
super.build_phase(phase);
for (int i=0; i<16; i++) begin
abc_drv_ch[i].cfg(i);
abc_drv_ch[i] = abc_drv::type_id::create($sformatf("abc_drv_ch_%2d", i), this);
end
endfunction
.....
endclass
class abc_drv extends uvm_component;
.....
bit [3:0] chid;
virtual abc_if v_abc_if;
function new (string name, uvm_component parent);
super.new(name, parent);
endfunction
function void build_phase(uvm_phase phase);
super.build_phase(phase);
if (!uvm_config_db #(virtual abc_if )::get(
this, "", $sformatf("drv_ch_%2d", chid), v_abc_if))
`uvm_error("CONFIGURATION", $sformatf("Could not get virtual interface v_abc_if[%2d]", chid));
endfunction
function void cfg (bit [3:0] ch=0);
**chid = ch;** <---Fatal: (SIGSEGV) Bad handle or reference
endfunction
.....
endclass
Thank you for your help.
John