# Extending from a parameterized uvm class

**URL:** <https://verificationacademy.com/forums/t/extending-from-a-parameterized-uvm-class/38198>\
**Category:** UVM\
**Tags:** UVM, set\_type\_override\_by\_type, uvm-parameterized-class, uvm\_component\_param\_utils\
**Created:** [October 9, 2020, 11:59am UTC](https://verificationacademy.com/forums/t/extending-from-a-parameterized-uvm-class/38198 "2020-10-09T11:59:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sid02101990](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/s/41988e/32.png) [@sid02101990](https://verificationacademy.com/forums/u/sid02101990)\
**Post date:** [October 9, 2020, 11:59am UTC](https://verificationacademy.com/forums/t/extending-from-a-parameterized-uvm-class/38198/1 "2020-10-09T11:59:19Z")

</div>

I have a parameterized base class which extends from uvm\_component:

```verilog
class bc_port_sb#(type T = uvm_sequence_item) extends uvm_component;
  `uvm_component_param_utils(bc_port_sb#(T))
endclass

```

I want to extend from this class with a different parameter:

```verilog
class my_port_sb extends bc_port_sb#(my_pkt);
  `uvm_component_utils(my_port_sb)
endclass

```

I have instantiated this class in my env:

```verilog
class my_env extends uvm_env;
  my_port_sb scoreboard;
  scoreboard = my_port_sb::type_id::create("scoreboard", this);
endclass

```

I have also overriden the type of transaction in my base test:

```verilog
class my_base_test extends uvm_test;
virtual function void build_phase(uvm_phase phase);
  super.build_phase(phase);
  set_type_override_by_type(my_pkt::get_type(),uvm_sequence_item::get_type());
endfunction
endclass

```

But I am still getting a compile error WRT the type of transaction:  
Error-[ICTTFC] Incompatible complex type usage  
Incompatible complex type usage in task or function call.  
class TESTBENCH.my\_env\_pkg::bc\_port\_sb#(class my\_env\_pkg::my\_pkt)', while the type of the formal is ‘class TESTBENCH.my\_env\_pkg::bc\_port\_sb#(class uvm\_pkg::uvm\_sequence\_item)’

Can you please suggest as to what am I missing here?

---

<div class="post-metadata">

**Author:** ![chr\_sue](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/chr_sue/32/1199_2.png) [@chr\_sue](https://verificationacademy.com/forums/u/chr_sue)\
**Post date:** [October 12, 2020, 2:57pm UTC](https://verificationacademy.com/forums/t/extending-from-a-parameterized-uvm-class/38198/2 "2020-10-12T14:57:56Z")

</div>

_In reply to [sid02101990](https://verificationacademy.com/forums/t/extending-from-a-parameterized-uvm-class/38198):_

You are overriding the wrong class. It is not your seq\_item you have to override. It is the scoreboard class which is parameterized. You have to override this one.

---

<div class="post-metadata">

**Author:** ![sid02101990](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/s/41988e/32.png) [@sid02101990](https://verificationacademy.com/forums/u/sid02101990)\
**Post date:** [October 13, 2020, 6:34am UTC](https://verificationacademy.com/forums/t/extending-from-a-parameterized-uvm-class/38198/3 "2020-10-13T06:34:47Z")

</div>

_In reply to [chr\_sue](https://verificationacademy.com/forums/t/extending-from-a-parameterized-uvm-class/38198/2):_

Hi chr\_sue,

Thanks for the reply.

By override the scoreboard class, do you mean:

```verilog
set_type_override_by_type(bc_port_sb#(my_pkt)::get_type(),bc_port_sb#(uvm_sequence_item)::get_type());

```

I did this and got the same error.

---

<div class="post-metadata">

**Author:** ![chr\_sue](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/chr_sue/32/1199_2.png) [@chr\_sue](https://verificationacademy.com/forums/u/chr_sue)\
**Post date:** [October 13, 2020, 6:50am UTC](https://verificationacademy.com/forums/t/extending-from-a-parameterized-uvm-class/38198/4 "2020-10-13T06:50:29Z")

</div>

_In reply to [sid02101990](https://verificationacademy.com/forums/t/extending-from-a-parameterized-uvm-class/38198/3):_

You have to consiuder the actual parameter for your class in the construction and the override.
