I'm writing a PS/2 mouse driver and I would like to be able to switch the input signals, CLK and DATA, between a legit PS/2 port and a PS/2-USB bridge.
Into the top module I have both sets of signals defined, and my switch between USB and PS/2:
inout PS2_CLK, PS2_DATA;
inout USB_CLK, USB_DATA;
input SW15;
And these are connected to a mouse transceiver module that has a single pair of inouts for data and clk.
My naïve first attempt was this:
MouseTransceiver mt (
.RESET(RESET),
.CLK(CLK),
.CLK_MOUSE(SW15 ? PS2_CLK : USB_CLK),
.DATA_MOUSE(SW15 ? PS2_DATA : USB_DATA),
...
But this solution gives me multi-driven nets. I don't know how to write what I'm looking for.