• 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. vr_ad register coverage for multiple instances of the same...

Stats

  • Locked Locked
  • Replies 1
  • Subscribers 67
  • Views 13905
  • 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

vr_ad register coverage for multiple instances of the same kind

Darren Galpin
Darren Galpin over 10 years ago

I have a vr_ad model set up which has lists of registers of the same kind. The automatic coverage gives coverage on a per-kind basis, so I know that one of the registers has been read/written, and that all of the fields have been accessed, although not in which register. Is there an easy way to extend the coverage so you actually have it on a per-register basis and show that each individual register has been read/written? The only way I can see to do this is to cross the direction field and individual register fields with the list index in an extension to create my own coverage, as the per_instance coverage is already used to create the register coverage by kind.

  • Cancel
  • Tudor Timi
    Tudor Timi over 10 years ago

    You can opt out of using the per_instance coverage declared under kind in favor of declaring your own.

    Here's a small example. Please excuse the code formatting, but this forum is really poor when it comes to posting source code. Let's assume you have some register that is instantiated twice:

    reg_def SOME_REG {
    reg_fld some_field : byte : RW : 0;
    };


    extend vr_ad_reg_file_kind : [ SOME_REG_FILE ];
    extend SOME_REG_FILE vr_ad_reg_file {
    some_regs[2] : list of SOME_REG vr_ad_reg;

    keep size == 8;

    add_registers() is also {
    add_with_offset(0x0, some_regs[0]);
    add_with_offset(0x4, some_regs[1]);
    };
    };

    Let's instantiate this register file under sys and perform a write on it:

    extend sys {
    some_reg_file : SOME_REG_FILE vr_ad_reg_file;

    run() is also {
    some_reg_file.update(0x0, { 0x0; 0x0; 0x0; 0x0 }, {});
    };
    };

    At this point, all of the coverage will be clumped up inside a reg_access(kind == SOME_REG) that will sum up the coverage for both instances. We'll need to define our own per_instance "determinant" (not sure if this is the proper term here) while disabling the older one:

    type my_vr_ad_reg_kind_t : [ SOME_REG0, SOME_REG1 ];

    extend SOME_REG vr_ad_reg {
    my_kind : my_vr_ad_reg_kind_t;

    cover reg_access is also {
    item kind using also per_instance = FALSE;
    item my_kind using per_instance;
    };
    };

    In the register file we'll need to assign each instance the appropriate value for "my_kind":

    extend SOME_REG_FILE vr_ad_reg_file {
    keep some_regs[0].my_kind == SOME_REG0;
    keep some_regs[1].my_kind == SOME_REG1;
    };

    If you reload and re-run you'll see a nice covergroup only for the first instance, which has collected a write, whereas the one for the second instance is empty.

    This is just some code to get you started. There are still some issues to sort out. For example, under this per_instance vr_ad will still try to cover all kinds, which is obviously not going to get filled. The range for kind needs to be updated. You can automate a lot of the code required to implement this or you can rely a lot on converting between enums and strings, i.e. " my_kind == appendf("%s%d, kind.as_a(string). <idx>); ".

    Hope it helps!

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel

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