I don't understand why a piece of Verilog code doesn't work, and I don't know how to fix it.
Here's the code. It's accessing a ROM:
module U16(input A12, input A7, input A6, input A5, input A4,
input A3, input A2, input A1, input A0,
inout I_O0, inout I_O1, inout I_O2, inout I_O3, inout I_O4, inout I_O5, inout I_O6, inout I_O7,
input nCE, input A10, input nOE, input A11, input A9, input A8, input nWE);
wire [12:0] A = {A12, A11, A10, A9, A8, A7, A6, A5, A4, A3, A2, A1, A0};
wire [7:0] I_O = {I_O7, I_O6, I_O5, I_O4, I_O3, I_O2, I_O1, I_O0};
rom romimpl(A, nCE, nOE, I_O);
endmodule
When this is run in Modelsim, the data lines (I_O<n>) are all HiZ.
If I change the invocation of romimpl to:
rom romimpl(A, nCE, nOE, {I_O7, I_O6, I_O5, I_O4, I_O3, I_O2, I_O1, I_O0});
it works: the data lines have data on them.
So obviously, the way I'm collecting I_O<n> into a vector is wrong.
What's the right way to do it?
Thank you.