Error loading the desing (Matlab - TB integration)

In reply to dirkh:

Hello Dirkh,

Thanks for your reply.

As you suggested I restarted from the beginning again. I went from the example which runs in my machine and adapted the testbench to work for my testbench.

I wrote the new makefile and tried to get it running, with no success. I honestly do not know what can be going wrong. My testbench works with my “.do” file.

When I run the makefile I get the following error (the same actually):

Fatal error in Function scrambler_pkg/base_test::end_of_elaboration_phase at tb_classes/base_test.svh line 28

That line corresponds to:


virtual class base_test extends uvm_test;
   env       env_h;
   uvm_sequencer #(sequence_item) sequencer_h;   

   extern function new (string name, uvm_component parent);
   extern function void build_phase(uvm_phase phase); 
   extern function void end_of_elaboration_phase(uvm_phase phase);
endclass

function base_test::new (string name, uvm_component parent);
   super.new(name,parent);
endfunction : new

function void base_test::build_phase(uvm_phase phase);
   virtual scrambler_bfm bfm;
   env_config env_config_h;
   
   if(!uvm_config_db #(virtual scrambler_bfm)::get(this, "","bfm", bfm))
     `uvm_fatal("TEST", "Failed to get the BFM");
   env_config_h = new(.bfm(bfm));
   
   uvm_config_db #(env_config)::set(this, "env_h*", "config", env_config_h);
   env_h = env::type_id::create("env_h",this);
   //sequencer_h = env_h.scrambler_agent_h.sequencer_h;
endfunction : build_phase

function void base_test::end_of_elaboration_phase(uvm_phase phase);
   sequencer_h = env_h.scrambler_agent_h.sequencer_h; // This is the line which is wrong
endfunction : end_of_elaboration_phase

That line fails running the makefile but it does not fails with my testbenches.

I thought of moving the


   sequencer_h = env_h.scrambler_agent_h.sequencer_h; // This is the line which is wrong

from the end_of_elaboration_phase to the build_phase, but then all the testbench crashes. I get the following error:

** Fatal: (SIGSEGV) Bad handle or reference.

Time: 0 ns Iteration: 7 Process: /uvm_pkg::uvm_phase::m_run_phases/#FORK#1847_f7d2ddb File: tb_classes/base_test.svh

Fatal error in Function scrambler_pkg/base_test::build_phase at tb_classes/base_test.svh line 24

I do not understand why it works for my testbench but it does not work with the QMW example.

Thank you,
Antonio