I have a package as follows:
package my_package;
parameter WIDTH = 64;
parameter DEPTH = 256;
// list of include header files such as driver, monitor, etc
endpackage
and a transaction class as follows:
class my_txn;
rand bit [WIDTH-1:0] m_data;
endclass
Now I have imported this package in tb_top and placed the package.sv file before the transaction.sv file when they get compiled in order. So why isn’t the WIDTH parameter being picked up by the transaction class?
I get the following error:
Identifier 'WIDTH' has not been declared yet. If this error is not expected,
please check if you have set `default_nettype to none.