Just came across this issue and after doing a little reading, it seems that this isn't allowed in System Verilog, but it seems a little obtuse and I wonder if I am missing some easy workaround.
I have an interface that was defined as if_datapath. The interface does have some modports called sink, source and monitor and I am able to use the interface on modules without issue.
However, if I define a the interface within a module as nither sink, source or monitor:
if_datapath #(.EW(5),.DW(256),.SW(64),.QW(32)) dp_buf_0 (.clk(clk), .reset(reset));
I can use this to route my interface through hierarchy. But if instead of using it for routing, I write the following:
always @ (posedge clk)
begin
dp_buf_0 <= dp_in; // Where dp_in is the same kind of
//interface as dp_buf_0
end
I get an error that says:
An instance name is not a legal lvalue [7.1(IEEE)].
So if I want to register my entire interface, I need to break out the individual parts? Tell me I am missing something here.