简体   繁体   中英

Specman e: How to disable coverage of an instances / units?

In my verification environment under sys there is an instance of timer_sve . Under timer_sve I have 2 other instances: timer and ocp_master :

extend sys {
    timer_sve : timer_sve_u is instance;
};

unit timer_sve_u {
    timer       : timer_u is instance;
    ocp_master  : ocp_u is instance;
};

I need to collect coverage only for timer . I've tried this code (and many other variations of it) to disable the coverage of ocp_master :

extend sys {
    timer_sve : timer_sve_u is instance;

    setup() is also { // The code to disable ocp_master's coverage
        global.covers.set_cover_block("ocp_u", FALSE);
    };
};

The code is compiled and run successfully but it continues to collect coverage for ocp_master ... How can I disable collecting ocp_master coverage? Really appreciate your help.

The method set_cover_block(...) doesn't take the unit as an input, but the module (ie file) in which the coverage elements were defined. Try changing it to take the file in which you extend your ocp_u with coverage definitions.

What I also do to disable certain coverage items/groups/etc. is set the when option to FALSE :

extend some_struct {
  cover some_cover using also
    when = FALSE;
};

Some speculation on my part:

Disabling coverage using set_cover_block(...) will probably not instrument the excluded code for coverage (ie completely ignore the coverage definitions) and make the simulation run faster than by disabling it using the when option.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM