Undefined variable issue

I am trying to build a driver

c2c_pkt_driver extends uvm_driver #(c2c_data_transaction)

when i compile this i am getting c2c_data_transaction as undefined variable . What is the reason for this and how can i solve this

In reply to Chethan Mohan:

Because either you forgot to compile the definition of c2c_data_transaction, or you compiled it in scope that is not visible in the scope where you defined c2c_pkt_driver.

In reply to dave_59:

I have compiled in the scope that is vissible to the driver.The error is not only with respect to the driver. I am trying to parameterize the driver , sequencer and the sequence by the type of transaction by using the definitions as

class c2c_pkt_driver extends uvm_driver #(c2c_data_transaction)

typedef uvm_sequencer #(c2c_data_transaction) c2c_data_sequencer

c2c_data_sequencer c2c_data_seqr

class c2c_pkt_sequence extends uvm_sequence #(c2c_data_transaction)

class c2c_data_transaction extends uvm_sequence_item;
`uvm_object_utils(c2c_data_transaction) …

In all the three places ie(driver sequencer and sequence ) error says c2c_data_transaction is undefined variable

I have included `include “c2c_data_transaction.sv” at environment level so that it is vissible for all the components below environment

In reply to Chethan Mohan:

Have you compiled them in a package? And is c2c_data_transaction declared in the package before the references that give you the errors?

In reply to dave_59:

I am using 3 interfaces and things are working fine for 2 interfaces but with this interface i am facing issue

In reply to Chethan Mohan:

Could you please show how you are compiling your code and how it is packaged/organized. The recommended way is to put your agent data in a package.

In reply to Chethan Mohan:

when I am using
include "c2c_data_transaction.sv" in the environment it is showing me errors but when i paste the transaction class code in place of include “c2c_data_transaction.sv” things are working fine. Please suggest me a solution as how to overcome this

In reply to Chethan Mohan:

In reply to Chethan Mohan:
when I am using
include "c2c_data_transaction.sv" in the environment it is showing me errors but when i paste the transaction class code in place of include “c2c_data_transaction.sv” things are working fine. Please suggest me a solution as how to overcome this

If I do not see how your data and code is organized I cannot give you an advice. Mybe the include does not find the transaction data class.

In reply to chr_sue:

Please see http://go.mentor.com/package-import-versus-include