inout ports in verilog

Status
Not open for further replies.

kaelk

Newbie level 2
Joined
Jan 24, 2010
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Visit site
Activity points
1,294
Dear all;

I have the following error with modelsim

Error: module_uart/biDirBuffer.sv(6): An inout port (dat_io) must be a net type.

ad the code for the moule is below


Code Verilog - [expand]
1
2
3
4
5
6
7
8
9
10
module biDirBuffer(
   input  logic       outEn,
   input  logic [7:0] dat_i,
   output logic [7:0] dat_o,
   inout  logic  [7:0] dat_io
);
   
   assign dat_o = dat_io; 
   assign dat_io = outEn ? dat_i : 'Z;
endmodule




I think that I made he correct assignments, if you have any idea please help
Thanks
 
Last edited by a moderator:

Try "inout wire [7:0] dat_io" or just plain "inout [7:0] dat_io" instead. Because, well, an inout port (dat_io) must be a net type. The error message says it all really.
 
Reactions: kaelk

    kaelk

    Points: 2
    Helpful Answer Positive Rating
Try "inout wire [7:0] dat_io" or just plain "inout [7:0] dat_io" instead. Because, well, an inout port (dat_io) must be a net type. The error message says it all really.

thanks mrflibble, I tried it and it works,
yes I understand that the error message says that inout data_io must be a net/wire
but I thin that a logic type can get a Z value ? no?
Thanks
 


Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…