Declaring class inside module

You need to declare this class in a package , and import the package in every module you plan to declare a class variable of that class type. See SystemVerilog Coding Guidelines: Package import versus `include - Verification Horizons