Does there exist an IC that allows on-the-fly routing of signals?
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.
What you're looking for is called a "crossbar chip". Since this is a fairly inefficient way to use silicon resources, the emphasis these days seems to be on using such chips to route very high speed LVDS signals.
In years gone by Lattice Semiconductor has a couple families of configurable devices in their GDX and GDX2 series. From their web site:
Lattice ispGDX2 - 38 Gbps Bandwidth, 800 Mbps SERDES The ispGDX2 family is Lattice's next generation in-system programmable (ISP) high performance digital crosspoint switch for high-speed bus switching and interfacing with bandwidth of up to 38Gbps. This family combines a flexible switching architecture with advanced high speed serial I/O (sysHSI blocks), sysCLOCK PLLs, and sysIO interfaces to meet the needs of today's high-speed systems. A multiplexer based architecture and on chip control logic facilitate the high performance implementation of common switching functions. Devices in the family can operate at 3.3, 2.5 & 1.8V core Voltage.
The later GDX2 family was announced EOL with a last time buy on March 7, 2011 and last shipments on Dec 31, 2014.
These days you can implement a generalized input to output switching function with any number of different low cost FPGAs from the likes of Altera, Lattice, Xilinx and others. FPGA features beyond the simple routing feature often into play because when you get right down to it selectable routing of Inputs to Outputs is rarely just this simple. There is very often the need for clock synchronization, registering, buffering, level conversion, bi-directional signals and specialized gating or control signals. All of these and more can be implemented with FPGAs.