I have to set the configuration object from the lower component such as driver to assertions module, as I have many assertion checks based on the fields in the configuration object.
And it is working fine. I want the assertion module to be reused.
Is there any other best method to achieve this, considering the reuse-ability of the assertions module ???
I do not see a problem regarding the configuration object when you are re-using the assertion module. Of course you have to follow the name rules you have defined. I see the problem more regading the interface signals/variables. I’d recommend to use the generic interface approach in the assertion module. The code looks like this:
module assertions(interface if);
logic data;
data = if.x;
endmodule
This means you can connect to any interface which has variable x. The name of the interface is not relevant.
In reply to dave_59:
Lets say, I have a variable ‘STATE’ in the configuration object. It is not possible to get the STATE information from interface, so I will be using the config object to check the value of STATE and depending on this value, only a certain set of assertions are checked. Similarly. I have many such checks depending on other variables.
If I reuse the assertion module in another test-bench environment, the config object may not be similar to the one which I have in my present environment. How to minimise this dependency?
In reply to chr_sue:
I’m already using the generic interface signals as you can see the port list of my assertion module, along with that I need the config information to enable/disable some set of assertions.