In general, a device that connects N inputs to N outputs simultaneously is called a crossbar switch.
As long as all the signals are digital unidirectional signals, such as the signals on a few SPI buses,
- a FPGA can be configured to dynamically route any of N inputs to any of N outputs.
- If N is small enough, you might also be able to do this with some other kind of programmable logic device or multiplexer.
- If a microsecond or so of delay between an input changing and the output changing is tolerable,
a microcontroller or other processor may be the lowest-cost approach.
If the signals are bidirectional, such as the signals on a I2C bus, it becomes more difficult to do such routing -- when the crossbar switch is told to connect pin A to pin B, it needs to somehow recognize and possibly switch directions from millisecond to millisecond, whether it needs to read pin A as input and drive pin B, or read B as input and drive pin A.
The extra logic required to do this can fit easily on a FPGA.
If the signals are analog audio or analog video signals,
- you might be able to use analog mux ICs. Most of them are inherently bidirectional. It's pretty easy to wire up 4 "4:1 analog mux chips" to give complete arbitrary 4 x 4 routing between 4 analog inputs and 4 analog outputs, with 2 digital control lines per output (presumably coming from some processor) to select which input it is connected to.
- video crosspoint switch ICs are available. For example, the "Maxim MAX4360 8x8 low-cost video crosspoint switch" is available for about $20 in ones. (Thanks, Axeman).
- A popular alternative to pure analog crossbar switches is systems that (1) digitize all analog inputs, then (2) run those signals through a digital crossbar switch, then (3) convert back to analog at the outputs.
All available ICs have limits as to the amount of power they can handle and the maximum frequency they can handle.
If you need to switch signals that are beyond those limits
(and assuming that you don't want to develop your own custom IC),
you're forced to use mechanical relays.