# UVM_FATAL @ 0: reporter [FCTTYP] Factory did not return a component of type 'base_scoreboard#(T)'. A component of type 'my_scoreboard#(T)' was returned instead. Name=scb Parent=my_env contxt=uvm_test_top.env

try to override base_scoreboard#(my_transaction) by my_scoreboard#(my_transaction)
but get the Fatal, pls help me out
logs:

UVM_WARNING @ 0: reporter [TPRGED] Type name ‘base_scoreboard#(T)’ already registered with factory. No string-based lookup support for multiple types with the same type name.

UVM_INFO verilog_src/questa_uvm_pkg-1.2/src/questa_uvm_pkg.sv(277) @ 0: reporter [Questa UVM] QUESTA_UVM-1.2.3

UVM_INFO verilog_src/questa_uvm_pkg-1.2/src/questa_uvm_pkg.sv(278) @ 0: reporter [Questa UVM] questa_uvm::init(+struct)

UVM_INFO @ 0: reporter [RNTST] Running test my_case0…

UVM_FATAL @ 0: reporter [FCTTYP] Factory did not return a component of type ‘base_scoreboard#(T)’. A component of type ‘my_scoreboard#(T)’ was returned instead. Name=scb Parent=my_env contxt=uvm_test_top.env

— UVM Report Summary —

** Report counts by severity

UVM_INFO : 3

UVM_WARNING : 1

UVM_ERROR : 0

UVM_FATAL : 1

** Report counts by id

[FCTTYP] 1

[Questa UVM] 2

[RNTST] 1

[TPRGED] 1

** Note: $finish : /opt/mentor/questasim/linux_x86_64/…/verilog_src/uvm-1.1d/src/base/uvm_report_object.svh(292)

Time: 0 ps Iteration: 7 Region: /uvm_pkg::uvm_phase::m_run_phases

End time: 19:12:45 on Nov 11,2021, Elapsed time: 0:00:05

Errors: 0, Warnings: 0



`ifndef MY_ENV__SV
`define MY_ENV__SV

class my_env extends uvm_env;

   `uvm_component_utils(my_env)
   my_agent   i_agt;
   my_agent   o_agt;
   my_model   mdl;
  // base_scoreboard scb;
   base_scoreboard#(my_transaction) scb;
  // base_scoreboard#(uvm_sequence_item) scb;
   
   uvm_tlm_analysis_fifo #(my_transaction) agt_scb_fifo;
   uvm_tlm_analysis_fifo #(my_transaction) agt_mdl_fifo;
   uvm_tlm_analysis_fifo #(my_transaction) mdl_scb_fifo;
   
   function new(string name = "my_env", uvm_component parent);
      super.new(name, parent);
   endfunction

   virtual function void build_phase(uvm_phase phase);
      super.build_phase(phase);
      i_agt = my_agent::type_id::create("i_agt", this);
      o_agt = my_agent::type_id::create("o_agt", this);
      i_agt.is_active = UVM_ACTIVE;
      o_agt.is_active = UVM_PASSIVE;
      mdl = my_model::type_id::create("mdl", this);
      base_scoreboard#(my_transaction)::type_id::set_type_override(my_scoreboard#(my_transaction)::get_type()); 
    // set_inst_override("scb","base_scoreboard#(my_transaction)","my_scoreboard$#(my_transaction)"); 
  //  factory.set_inst_override_by_type(base_scoreboard#(my_transaction)::get_type(),my_scoreboard#(my_transaction)::get_type(),"*");

      scb = base_scoreboard#(my_transaction)::type_id::create("scb",this); 
     `uvm_info("my_env",scb.get_type_name(),UVM_LOW)
      agt_scb_fifo = new("agt_scb_fifo", this);
      agt_mdl_fifo = new("agt_mdl_fifo", this);
      mdl_scb_fifo = new("mdl_scb_fifo", this);
//uvm_top.print_topology();
   endfunction

   extern virtual function void connect_phase(uvm_phase phase);
   
endclass

function void my_env::connect_phase(uvm_phase phase);
  factory.print();
  uvm_top.print_topology();
  `uvm_info("my_env_c",scb.get_type_name(),UVM_LOW)
   super.connect_phase(phase);
   i_agt.ap.connect(agt_mdl_fifo.analysis_export);
   mdl.port.connect(agt_mdl_fifo.blocking_get_export);
   mdl.ap.connect(mdl_scb_fifo.analysis_export);
  scb.exp_port.connect(mdl_scb_fifo.blocking_get_export);
   o_agt.ap.connect(agt_scb_fifo.analysis_export);
   scb.act_port.connect(agt_scb_fifo.blocking_get_export); 
endfunction

`endif


`ifndef BASE_SCOREBOARD__SV
`define BASE_SCOREBOARD__SV
class base_scoreboard#(type T=uvm_sequence_item) extends uvm_scoreboard;
   T  expect_queue[$];
   uvm_blocking_get_port #(T)  exp_port;
   uvm_blocking_get_port #(T)  act_port;
   `uvm_component_utils(base_scoreboard#(T))

   extern function new(string name, uvm_component parent = null);
   extern virtual function void build_phase(uvm_phase phase);
   extern virtual task main_phase(uvm_phase phase);
endclass 

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

function void base_scoreboard::build_phase(uvm_phase phase);
   super.build_phase(phase);
   exp_port = new("exp_port", this);
   act_port = new("act_port", this);
endfunction 

task base_scoreboard::main_phase(uvm_phase phase);
endtask
`endif



`ifndef MY_SCOREBOARD__SV
`define MY_SCOREBOARD__SV
class my_scoreboard#(type T = my_transaction) extends base_scoreboard;
   T  expect_queue[$];
 // T test;
   `uvm_component_utils(my_scoreboard#(T))

   extern function new(string name, uvm_component parent = null);
   extern virtual function void build_phase(uvm_phase phase);
   extern virtual task main_phase(uvm_phase phase);
endclass 

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

 function void my_scoreboard::build_phase(uvm_phase phase);
   super.build_phase(phase);
  //`uvm_info("my_scb",T::get_type(),UVM_LOW)
endfunction 

task my_scoreboard::main_phase(uvm_phase phase);
endtask
`endif

In reply to designer007:

The issue is with declaration of class my_scoreboard .

Try changing it to ::


 class my_scoreboard#(type T = my_transaction) extends base_scoreboard #( T ) ;

In reply to designer007:

You need to register your scoreboards with the factory using the param_utils() macros.

In reply to cgales:

The issue would still exist however on using macro `uvm_component_param_utils for class base_scoreboard and my_scoreboard

The UVM_FATAL Message now would be ::


UVM_FATAL @ 0: reporter [FCTTYP] Factory did not return a component of type '<unknown>'. A component of type 'uvm_scoreboard' was returned instead. Name=scb Parent=my_env contxt=uvm_test_top

Changing the declaration of class my_scoreboard to ::


class my_scoreboard#(type T = my_transaction) extends base_scoreboard #( T );

The Type Override is Successful !!

In reply to cgales:

uvm_component_param_utils(base_scoreboard#(T)) uvm_component_param_utils(my_scoreboard#(T))

chang the code with param_utils


 

`ifndef MY_SCOREBOARD__SV
`define MY_SCOREBOARD__SV

class my_scoreboard#(type T = my_transaction) extends base_scoreboard;
   T  expect_queue[$];
 // T test;
   //`uvm_component_utils(my_scoreboard#(T))
   `uvm_component_param_utils(my_scoreboard#(T))

   extern function new(string name, uvm_component parent = null);
   extern virtual function void build_phase(uvm_phase phase);
   extern virtual task main_phase(uvm_phase phase);
endclass 

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

 function void my_scoreboard::build_phase(uvm_phase phase);
   super.build_phase(phase);
  //`uvm_info("my_scb",T::get_type(),UVM_LOW)
endfunction 

task my_scoreboard::main_phase(uvm_phase phase);
endtask
`endif


log:

UVM_INFO verilog_src/questa_uvm_pkg-1.2/src/questa_uvm_pkg.sv(277) @ 0: reporter [Questa UVM] QUESTA_UVM-1.2.3

UVM_INFO verilog_src/questa_uvm_pkg-1.2/src/questa_uvm_pkg.sv(278) @ 0: reporter [Questa UVM] questa_uvm::init(+struct)

UVM_INFO @ 0: reporter [RNTST] Running test my_case0…

UVM_FATAL @ 0: reporter [FCTTYP] Factory did not return a component of type ‘’. A component of type ‘uvm_scoreboard’ was returned instead. Name=scb Parent=my_env contxt=uvm_test_top.env

— UVM Report Summary —

** Report counts by severity

UVM_INFO : 3

UVM_WARNING : 0

UVM_ERROR : 0

UVM_FATAL : 1

** Report counts by id

[FCTTYP] 1

[Questa UVM] 2

[RNTST] 1

** Note: $finish : /opt/mentor/questasim/linux_x86_64/…/verilog_src/uvm-1.1d/src/base/uvm_report_object.svh(292)

Time: 0 ps Iteration: 7 Region: /uvm_pkg::uvm_phase::m_run_phases

End time: 19:59:20 on Nov 11,2021, Elapsed time: 0:00:03

Errors: 0, Warnings: 0

In reply to ABD_91:

yes , make above change
no Fatal occures


`ifndef MY_SCOREBOARD__SV
`define MY_SCOREBOARD__SV
class my_scoreboard#(type T = my_transaction) extends base_scoreboard#(T);
//class my_scoreboard#(type T = my_transaction) extends base_scoreboard;
   T  expect_queue[$];
   //`uvm_component_utils(my_scoreboard#(T))
   `uvm_component_param_utils(my_scoreboard#(T))

   extern function new(string name, uvm_component parent = null);
   extern virtual function void build_phase(uvm_phase phase);
   extern virtual task main_phase(uvm_phase phase);
endclass 

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

 function void my_scoreboard::build_phase(uvm_phase phase);
   super.build_phase(phase);
  //`uvm_info("my_scb",T::get_type(),UVM_LOW)
endfunction 

task my_scoreboard::main_phase(uvm_phase phase);
endtask
`endif

but when factory.print(); and uvm_top.print_topology();
Type Overrides unknown
and scb type uvm_scoreboard
how do i know override success

log:

Factory Configuration (*)

No instance overrides are registered with this factory

Type Overrides:

Requested Type Override Type

-------------- -------------

All types registered with the factory: 50 total

(types without type names will not be printed)

Type Name

---------

base_test

case0_sequence

my_agent

my_case0

my_driver

my_env

my_model

my_monitor

my_sequencer

my_transaction

questa_uvm_recorder

(*) Types with no associated type name will be printed as

UVM_INFO @ 0: reporter [UVMTOP] UVM testbench topology:

------------------------------------------------------------------

Name Type Size Value

------------------------------------------------------------------

uvm_test_top my_case0 - @467

env my_env - @480

scb uvm_scoreboard - @512

act_port uvm_blocking_get_port - @856

exp_port uvm_blocking_get_port - @848

------------------------------------------------------------------

In reply to designer007:

factory.print would show what Overrides ( if any ) have been registered in Factory .

Whether the Registered Override is Valid or not is not shown .

It’s only when you call create on the original_type that you would know whether the override registered was valid .

In reply to ABD_91:

how could I know whether valid when create original_type except call a virtual function to print some info.