Parameterised classes

Hi,
I write a parameterized class, and one of the parameters has to be type of queue.

class external_reference_model#(parameter string EXECUTEABLE_PAT
parameter int NUMBER_OF_INPUTS,
parameter int NUMBER_OF_OUTPUTS,
string EXPECTED_OUT_FILES_NAMES[$], //this is my question
parameter type TRANSACTION_TYPE=uvm_object,
parameter bit INPUT_DATA_W,
parameter bit OUTPUT_DATA_W
)extends uvm_component;

how can I do that?

In reply to Yehu:

typedef string qstring_t[$],
parameter type EXPECTED_OUT_FILES_NAMES = string_t;

It seems very unusual to want to parameterize a queue type. You could only push or pop queue types.

And if you meant you wanted to a parameter whose value was a queue type, that does not make sense either since you could not push or pop elements.

In reply to dave_59:

Thanks for your response, I meant that I wanted to get an array of names of unknown size, rather than type of array.

In reply to Yehu:

You can do

parameter qstring_t EXPECTED_OUT_FILES_NAMES = {"one","two","three"};

In reply to dave_59:

Sorry, I probably did not explain clearly enough.
I want to get an array containing file names, I do not know how many names will be, for example:
names_file_array = {“input1.txt”,“input2.txt”};
it’s can be also:
names_file_array = {“input1.txt”,“input2.txt”,“input3.txt”,“input4.txt”};

external_reference_model#(.EXPECTED_OUT_FILES_NAMES(names_file_array)) ext_obj;
^
I dont know how many names it will get

In reply to Yehu:

It seems very unusual to use parameters for this. You cannot override a parameter value with the value form a variable, regardless of the type. You can use another parameter to override parameter.

class external_reference_model#(parameter string EXECUTEABLE_PAT
parameter int NUMBER_OF_INPUTS,
parameter int NUMBER_OF_OUTPUTS,
parameter qstring_t EXPECTED_OUT_FILES_NAMES;
parameter type TRANSACTION_TYPE=uvm_object,
parameter bit INPUT_DATA_W,
parameter bit OUTPUT_DATA_W
)extends uvm_component;
...
endclass

parameter qstring_t names_file_array = {"input1.txt","input2.txt","input3.txt","input4.txt"};
external_reference_model#(.EXPECTED_OUT_FILES_NAMES(names_file_array)) ext_obj;

But I think it would be much easier to use a variable for this and set it with the values you need after constructing it.

In reply to dave_59:

I will try it.
Thank you