Jump to content
Sign in to follow this  
smitgovani

Covergroup instance issue - system verilog coverage

Recommended Posts

Hi,

I am trying to take instance of covergroup but unable to take it. Getting compilation instance.

class model extends uvm_component;

`uvm_component_utils(model)

bit [2:0] state;

 covergroup cg_fsm_state;

  c1 : coverpoint state;

endgroup

cg_fsm_state cg_fsm_state_inst;

function new();

cg_fsm_state_inst = new();

endfunctiion 

endclass

 

Using above code, getting compilation error as mentioned below 

Error-[SE] Syntax error
  Following verilog source has syntax error :
      token 'cg_fsm_state' should be a valid type. Please declare it
  virtual if it is an Interface.
  "/vobs/cores/infrastructure/cia_resourcecontrol/aon_mod_verif/sim/models/./aon_mod_fsm_ref_model.sv",
  208: token is ';'
    cg_fsm_state  cg_fsm_state_inst;
 
Regards,
Smit

Share this post


Link to post
Share on other sites

You dot need a reference to the covergroup class. You can omit this line of code:

cg_fsm_state cg_fsm_state_inst;

 

In the constructor you are calling new directly on the coverage class name:

cg_fsm_state = new();

 

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...