Greetings,
Lets imagine some form of advanced switch IP. This IP has all its inputs and outputs in form of one interface (lets say it is something similar to AXI stream). However, each of these interfaces has different bitwidth ranging from 1024 bits to 8 bits.
I would like to have one agent class (sequencer, driver, monitor, scoreboard, etc...) and specify the bitwidth as its parameter somewhere during the construction of the agent. So I can just instantiate the agent and connect in in the environment.
I tried to have BITWIDTH as a parameter, but it leads to parametrized transaction (because transaction resents logic [BITWIDTH-1:0] data[$]). And this approach fails on the finish_item call which attemps illegal casting of parametrized transaction.
I could create transaction class which will have data[1023:0] and use only portion of the allocated memory[7:0], but when we take inco account, that we can have several thousands words inside the transaction, we can end with wasting a large amount of memory. Therefore I would like to avoid this approach if possible.
I would like to ask for pointer how to achieve this and if it is even possible with UVM.
Thank you for any suggestions,
Jan