I'm trying to create a function inside an interface, like this:
.... code ....
task get(output int msg);
msg = msg_buffer;
task set(input int msg);
msg_buffer = msg;
So basically the method calling the interface will be able to write a single value to a bus (set) or read it (get).
But in this case, the value to be read/written is fixed to be an integer. What I need is to be able to use any type, determined at compile time.
So far I've found out I can pass a parameter to the interface to set the size of the signals inside. But not their type. In my interface I want to be able to even set enum and struct types.
Any ideas on how to do this?
Maybe an interface is not the right choice, but what else could I use? I don't have much experience on SV so any help would be appreciated.
Thanks and regards.