Altera_Forum
Honored Contributor
9 years agoModule output gives high impedence when connected to the inout port of another module
I have created a module which calls another module within it's body, and the final output of the output module gives me the desired output. But when I connect this output wire to the 'inout' port of another module(bidir_switch) ,the output of the former module(Outer) as well as inout port goes to high impedance. Please find the basic structure of the actual code below(sorry, the actual code is too big). Could you please provide some insight into this problem? I have been trying to debug this problem for almost a week now :-/
module testbench(); reg in1,in2,clk; wire out,d1; Outer O(.in1(in1),.in2(in2),.out.(out),.clk(clk)); bidir_switch BS(.a1(d1),.a2(out),.control(1'b1)); endmodule module bidir_switch(a1,a2,control); inout a1,a2; input control; tranif1(a1,a2,control); endmodule module Outer(in1,in2,out,clk); input in1,in2,clk; output out; inner1 I1(i1.(in1),i2.(in2),o.(out),.clk(clk)); endmodule module inner1(i1,i2,o,clk); input i1,i2,clk; output o; inner2 I2(q1.(out1),q2.(in3),qo.(o),.clk(clk)); endmodule inner2(q1,q2,qo,clk); input q1,q2,clk; output reg qo; always@(posedge clk) begin qo <= q1; end endmodule