From my previous question (Groups inside structs), after creating typedef structs, I tried to form an interface from 5 different channel signal declarations (the structs).
The struct's form is:
typedef struct {
struct {
logic [1:0] a;
logic [2:0] b;
} in;
struct {
logic [4:0] d;
} out;
} axi_X_ch;
Then I tried the following code:
interface axi_interface ();
//as = axi slave
axi_X_ch as_X;
axi_Y_ch as_Y; //similar to struct axi_X_ch
modport slave ( input as_X.in, as_Y.in,
output as_X.out, as_Y.out);
endinterface
But I get the error
message (ignore the coordinates):
modport slave ( input as_X.in, as_Y.in, output as_X.out, as_Y.out);
|
ncvlog: *E,ILLHIN (demo.sv,177|30): illegal location for a hierarchical name (as_X).
modport slave ( input as_X.in, as_Y.in, output as_X.out, as_Y.out);
|
ncvlog: *E,ILLHIN (demo.sv,177|30): illegal location for a hierarchical name (as_Y).
... (same for the next two output declarations) ...
What am I doing wrong?