• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Functional Verification
  3. Why it must have virtual interface initialized for an embedded...

Stats

  • Locked Locked
  • Replies 2
  • Subscribers 64
  • Views 1521
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Why it must have virtual interface initialized for an embedded covergroup before connect_phase()?

Jeff000
Jeff000 over 8 years ago

Refer to the code as below, assignment of vif in build_phase() or connet() will result in different behavior. Anyone can explain a bit for this?

Thanks.

class apb_cov extends uvm_component;
virtual apb_master_if vif;

covergroup cg @ (vif.monitor_cb)
option.per_instance = 1;

endgroup // cg

function new(string name="");
super.new();
cg = new();
endfunction // new

function void build_phase(uvm_phase phase);
super.build_phase();
/*
* If assign vif here, it is ok.
* vif = g_if;
*/

endfunction // build_phase

function void connect();
/*
* If assign vif here, it will give runtime error as
* NULL pointer dereference of vif.
* vif = g_if;
*/
endfunction // connect

endclass // apb_cov

  • Cancel
Parents
  • Jeff000
    Jeff000 over 8 years ago
    In fact the build_phase() is executed after new() as well. That's why I'm confused with the distinction about the assignment of vif in build_phase() and connect_phase().

    Moreover, the embedded covergroup can not be instantiated outside the new(), or it will issue an error.
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • Jeff000
    Jeff000 over 8 years ago
    In fact the build_phase() is executed after new() as well. That's why I'm confused with the distinction about the assignment of vif in build_phase() and connect_phase().

    Moreover, the embedded covergroup can not be instantiated outside the new(), or it will issue an error.
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
No Data

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information