Typedef for a parametirized UVM component

I have a parameterized driver. Direct usage make the code verbose.
So, I am trying to make typedefs for these components.

For example, one line of the code appears like this in my agent class:


typedef av_st_mst_driver #(AV_WIDTH) av_st_mst_driver_t;
;

Please note that the parameter AV_WIDTH is within the scope of the agent class where the above line is defined.
However, when I try to put the typedef in a common package, I get an error.
The error is pointing to #(AV_WDITH). Is this because value of AV_WIDTH is being resolved in the packet?
When I put this in the agent class, I see no issue.

Is there a solution to this in case I want to put these typedefs in a common package so that multiple agents can use these typedefs?

In reply to verif_learner:

The key question you do not answer: where is the parameter AV_WIDTH defined?
This parameter has to have a specific value for the typedef when declaring this in your package.

In reply to chr_sue:

In reply to verif_learner:
The key question you do not answer: where is the parameter AV_WIDTH defined?
This parameter has to have a specific value for the typedef when declaring this in your package.

chr_sue,

The parameter is a part of agent class definition. Like below:
class av_st_mst_agent #(AV_WIDTH) extends uvm_agent;

I know that you are going to say that AV_WIDTH has to be within package scope but having a global parameter defeats the purpose of what I am trying to do here.
The agent is parameterized and hence I can fix its value when I create it later.
I have other agents like this and they all have same parameter name – AV_WIDTH

So, if I fix value of AV_DWIDTH in the package scope then I no longer have different values for different agents or 2 different agent instance of the same agent.

Right now, I have put typedef in the class itself but this way I have to repeat typedefines at multiple places

In reply to verif_learner:

The question is not what is legal and can be compiled. The question is what is useful.
To avoid dealing with parameterized classes we can define a typedef for a specific parameter. This is a useful application.
The most often used typedef is for a sequencer like this

typedf uvm_sequencer #(my_seq_item) my_sequencer.

If you have more than 1 sequncer in your environment you have to do this for every seq_item you are using.