A
Amal
Guest
How does one define an inout signal in an interface? I wrote the
following for a cpu bus interface and define two mod_ports as follows:
interface cpu_if( input bit reset, input bit clk );
logic [31:0] ad; // Address/Data
bit ale; // Address Latch Enable
modport cpu_mp( inout ad, output ale );
modport per_mp( inout ad, input ale );
endinterface : cpu_if
And connect this to a dut:
cpu_if if( .reset(reset), .clock(clock) );
slave dut( .reset(reset), .clock(clock), .ad(if.ad), .ale(if.ale) );
It compiles OK, but when I load a design that instantiates this
interface, I get the following error!
Illegal output or inout port connection (port 'ad').
How should I deal with bi-directional signals in an interface?
-- Amal
following for a cpu bus interface and define two mod_ports as follows:
interface cpu_if( input bit reset, input bit clk );
logic [31:0] ad; // Address/Data
bit ale; // Address Latch Enable
modport cpu_mp( inout ad, output ale );
modport per_mp( inout ad, input ale );
endinterface : cpu_if
And connect this to a dut:
cpu_if if( .reset(reset), .clock(clock) );
slave dut( .reset(reset), .clock(clock), .ad(if.ad), .ale(if.ale) );
It compiles OK, but when I load a design that instantiates this
interface, I get the following error!
Illegal output or inout port connection (port 'ad').
How should I deal with bi-directional signals in an interface?
-- Amal