Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

"Illegal output or inout port connection for "port"

1,654 views
Skip to first unread message

valtih1978

unread,
Feb 27, 2013, 3:39:58 PM2/27/13
to
I see this problem ubiquitous -- nobody can figure out what this
intelligent message means. I also cannot figure out the solutions in the
forums because everybody posts is whole project. I have localized the
error. Where is it?

module CPU (inout
//reg
//wire

[7:0] data_bus);

//assign data_bus = 1 ? 0 : 8'bzzzz_zzzz;

endmodule

module SIMULATE_CPU;

reg [7:0] data_bus;

CPU cpu (data_bus );

reg clk;

always @(posedge clk) begin
data_bus <= 1;
end

endmodule

# ** Error: (vsim-3053) tb.v(15): Illegal output or inout port
connection for "port 'data_bus'".
# Region: /SIMULATE_CPU/cpu

Did Verilog developers introduced wire/reg separation for fun?

Robert Miles

unread,
Feb 28, 2013, 2:19:54 AM2/28/13
to
The Verilog compilers I remember didn't have automatic connections of a
scalar
signal to a multi-bit register. However, that was about 11 years ago.

Wires were for conducting any changes on a signal.

Registers were for letting the output signal change only on the
specified edge
of the clock signal.

valtih1978

unread,
Feb 28, 2013, 5:10:36 AM2/28/13
to
Thanks. This answers my second part of the question. I still want to
understand what is wrong with illegal I/O port 'data_bus'. I have
reduced my demo to

module CPU (output
[7:0] data_bus);

endmodule

module SIMULATE_CPU;

reg [7:0] data_bus;

CPU cpu (data_bus ); // illegal port connection

endmodule


but still getting the error.

valtih1978

unread,
Feb 28, 2013, 8:32:30 AM2/28/13
to
Ok, I have got the answer

http://stackoverflow.com/questions/12394040/having-trouble-with-verilog-inout-wires

The workaround is to have the tri-state port as bus and drive it through
an extra declared reg.

valtih1978

unread,
Feb 28, 2013, 8:50:19 AM2/28/13
to
I mean we are forced to have the tri-state port as wire and declare
extra reg for driving it.
0 new messages