UVM

Hello,

I have this error but i don’t know where i have the problem :
test_spi_2_ahb [CLDEXT] Cannot set ‘test_spi_2_ahb’ as a child of ‘uvm_test_top’, which already has a child by that name*__*

this is my code :

class e_test extends uvm_test ; 
  `uvm_component_utils(e_test) 
  spi2ahb_test test_spi_2_ahb ; 
  //=======================================================
  // function new 
  //=======================================================

  function new (input string name, uvm_component parent = null) ; 
    super.new (name,parent) ; 
  endfunction : new 

  //=======================================================
  // build_phase  : Création de la classe spi2ahb 
  //=======================================================
  virtual function void build_phase(uvm_phase phase);
		super.build_phase(phase);
		test_spi_2_ahb = spi2ahb_test::type_id::create("test_spi_2_ahb",this);
    endfunction : build_phase 

endclass : e_test

class test extends uve_test;
        `uvm_component_utils(test)
        spi2ahb_test test_spi_2_ahb ;
        function new ( input string name, input uvm_component parent = null ) ;
            super . new ( name, parent ) ;
        endfunction

        virtual function void build_phase(uvm_phase phase);
            super.build_phase(phase);
            test_spi_2_ahb = spi2ahb_test::type_id::create("test_spi_2_ahb",this);
        //     u_test = uve_test::type_id::create("u_test",this);
        endfunction

        // Main test sequence
        virtual task main_phase ( uvm_phase phase ) ;

            logic [`DIVE_SPI_DATA_WIDTH - 1 : 0] data;
            logic [`DIVE_SPI_DATA_WIDTH - 1 : 0] rdata[];
            logic [`DIVE_SPI_DATA_WIDTH - 1 : 0] wdata[];
            integer                              def_nb_data_access;
            integer                              def_start_addr;

            byte shift = $clog2(`DIVE_SPI_DATA_WIDTH/8);
            
       
            //------------------------------------------------------
            phase . raise_objection ( .obj ( this ) ) ;
            //------------------------------------------------------

            def_start_addr     =  0;
            def_nb_data_access =  1; //TODO_RNK return to 20

            
            test_spi_2_ahb.spi_write_reg_spi_mode(TB_CICR__ADDRESS    , QUAD);
            
         
            test_spi_2_ahb.spi_checksum_compare();
end class

spi_checksum_compare(),spi_write_reg_spi_mode : are methods declared on class spi2ahb_test

In reply to uvm_share:

Your class test has duplicated the test_spi_2_ahb variable and construction of the spi2ahb_test object. There is no need to do that since it is being done the e_test base class.