Hi, guys,
I am using questasim 10.6c to test the example from chapter 10 of “UVM Primer”. I got compilation error:_*** Error: D:\Document\questa_prj\tinlyalu_oop\coverage.svh(23): Invalid type ‘operation_t’. Please check the type of the variable ‘op_set’.
** Error: D:\Document\questa_prj\tinlyalu_oop\coverage.svh(27): (vlog-2730) Undefined variable: ‘op_set’.**_*when I compiler the sv header file which has class definition. All of the header files have the similar problem. The enum data type “opeartion_t” is defined in a separate package file and the package file also includes those four header files.
So could anyone kindly tell me why the data type is not visible in the class? Thank you so much.
The package file is:
package tinyalu_pkg;
typedef enum bit[2:0] {no_op = 3'b000,
add_op = 3'b001,
and_op = 3'b010,
xor_op = 3'b011,
mul_op = 3'b100,
rst_op = 3'b111} operation_t;
`include "coverage.svh"
`include "tester.svh"
`include "scoreboard.svh"
`include "testbench.svh"
endpackage : tinyalu_pkg
and one of the header file is:
class coverage;
virtual tinyalu_bfm bfm;
byte unsigned A;
byte unsigned B;
operation_t op_set;
covergroup op_cov;
coverpoint op_set {
bins single_cycle[] = {[add_op : xor_op], rst_op,no_op};
bins multi_cycle = {mul_op};
bins opn_rst[] = ([add_op:mul_op] => rst_op);
bins rst_opn[] = (rst_op => [add_op:mul_op]);
bins sngl_mul[] = ([add_op:xor_op],no_op => mul_op);
bins mul_sngl[] = (mul_op => [add_op:xor_op], no_op);
bins twoops[] = ([add_op:mul_op] [* 2]);
bins manymult = (mul_op [* 3:5]);
}
endgroup
/* other code*/
endclass