# Covergroup instance creation using create() method

**URL:** <https://verificationacademy.com/forums/t/covergroup-instance-creation-using-create-method/34263>\
**Category:** Coverage\
**Tags:** covergroup, OVM, Coverage, create-and-new, ovm\_sequence\_item\
**Created:** [March 27, 2018, 9:41pm UTC](https://verificationacademy.com/forums/t/covergroup-instance-creation-using-create-method/34263 "2018-03-27T21:41:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![anshushr](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/a/76d3ee/32.png) [@anshushr](https://verificationacademy.com/forums/u/anshushr)\
**Post date:** [March 27, 2018, 9:41pm UTC](https://verificationacademy.com/forums/t/covergroup-instance-creation-using-create-method/34263/1 "2018-03-27T21:41:22Z")

</div>

Hi,  
If I have class object extending from ovm\_sequence\_item and I also create a covergroup in the same class. Normally the covergroup instance is new’d in the new function of class. However if the class object is created using create() method, how do we create the covergroup instance?  
Ex:

```verilog
class my_trans extends ovm_sequence_item;
int no_one;
int some_one;
covergroup my_trans_c;
coverpoint no_one;
coverpoint some_one;

endgroup

function new();
no_one = 1;
some_one = 0;
my_trans_c = new();
endfunction
endclass

```

When my trans is created using create() method, is the new(0 function automatically called? if not, how do I handle this.  
Any pointer in this regard would be appreciated.  
Thanks,  
Anshu. S

---

<div class="post-metadata">

**Author:** ![dave\_59](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/dave_59/32/4499_2.png) [@dave\_59](https://verificationacademy.com/forums/u/dave_59)\
**Post date:** [March 28, 2018, 2:36am UTC](https://verificationacademy.com/forums/t/covergroup-instance-creation-using-create-method/34263/2 "2018-03-28T02:36:10Z")

</div>

_In reply to [anshushr](https://verificationacademy.com/forums/t/covergroup-instance-creation-using-create-method/34263):_

The UVM factory create() method delegates the call to the constructor new() for you.
