Is there any synthesizable way to pass an interface to a function or a task? My use case is the following: I have a package with several functions (though I could convert them to tasks, if that helps :) ), all of which might be used in a module and might need to access the ports of the module. Now, usually I'd just group all ports in an interface
, add it to the module, and pass the it as virtual
to the function. However, the manual of my synthesis tool mentions that virtual
is not supported.
Am I missing anything? There must be a way to provide ports to tasks for synthesis, similar to VHDL's signal
arguments?
Some example code:
module mymod (
input logic clk,
input logic rst,
input uint16_t adr,
input bit cyc,
input uint32_t dat_m,
input bit stb,
input bit we,
output bit ack,
output uint32_t dat_s
);
always_comb begin
mypack::do_something(a, b, c, adr, cyc, dat_m, stb, we, ack, dat_s);
endmodule
Ideally, the task mypack::do_something
would be able to use the ports as ports, i.e. wait for changes on them, write values to them, etc; basically, the same you'd achieve in VHDL by passing them as signal
arguments (as opposed to variable
or constant
arguments).