Skip to content

Suppression of built in pre/post randomize functions for -Wunused-class-method #1681

@jcurtiss8086

Description

@jcurtiss8086

This is a minor corollary to the rand-var change made for #1678

The built-in pre_randomize()/post_randomize() functions get called automatically during randomization so usually won't have any direct-references in code. Can these two methods be auto-suppressed for -Wunused-class-method? Otherwise, the new warnings are looking good for the first repo I've run through. Thanks!

unused-class-method.sv:4:19: warning: unused class method 'pre_randomize' [-Wunused-class-method]
    function void pre_randomize();
                  ^
unused-class-method.sv:7:19: warning: unused class method 'post_randomize' [-Wunused-class-method]
    function void post_randomize();
                  ^
class C;
    rand bit a;

    function void pre_randomize();
    endfunction

    function void post_randomize();
    endfunction
endclass

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions