2
从我以前的问题(Groups inside structs),创建typedef结构后,我尝试从5个不同的通道信号声明(结构)形成一个接口。使用复杂结构的Modport故障
结构体的形式是:
typedef struct {
struct {
logic [1:0] a;
logic [2:0] b;
} in;
struct {
logic [4:0] d;
} out;
} axi_X_ch;
然后我尝试下面的代码:
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
但我得到的error
消息(忽略坐标):
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) ...
什么我做错了吗?
对不起,我的例子中有一个错字(我使用'as_X'而不是'axi_X_ch')。我尝试了解决方案,并且得到了'ncvlog:* E,MODPXE(test.sv,177 | 30):端口标识符为'X_IN'的不支持的modport表达式。如果我无法用这些结构来解决这个问题,还有另一种方法来重建我的AXI通道,所以我整合了一个漂亮整洁的接口? – user2692669 2014-10-10 18:54:02
哇,与axi,这意味着10组... ...矫枉过正? – user2692669 2014-10-10 19:08:19
你可以把它们放在数组中 – Ari 2014-10-10 19:13:24