H
Haja
Guest
Hello,
I am facing some problem with parametrized interface in class. Below
is a snippet of the code
interface v_node_intf #(width = 0) ( );
logic [width-1:0] x;
logic [width-1:0] y;
modport vnode_if(input x, output y);
endinterface
class v_node;
v_node_intf.vnode_if #(.width(4)) vn_if;
// Error is pointed in tjhe above line: near ".": syntax error,
unexpected '.', expecting "IDENTIFIER" or '='
.....
......
endclass
If I change it to "virtual v_node_intf.vnode_if #(.width(4)) vn_if"
there is no error. I don't understand this behavior.
Also, is it possible to re-define the interface parameter run-time?
I would appreciate if someone can answer this.
Regards,
Haja
I am facing some problem with parametrized interface in class. Below
is a snippet of the code
interface v_node_intf #(width = 0) ( );
logic [width-1:0] x;
logic [width-1:0] y;
modport vnode_if(input x, output y);
endinterface
class v_node;
v_node_intf.vnode_if #(.width(4)) vn_if;
// Error is pointed in tjhe above line: near ".": syntax error,
unexpected '.', expecting "IDENTIFIER" or '='
.....
......
endclass
If I change it to "virtual v_node_intf.vnode_if #(.width(4)) vn_if"
there is no error. I don't understand this behavior.
Also, is it possible to re-define the interface parameter run-time?
I would appreciate if someone can answer this.
Regards,
Haja