MonoConnect.connect executes a mono-directional connection element-wise.
Note that this isn't commutative. There is an explicit source and sink
already determined before this function is called.
The connect operation will recurse down the left Data (with the right Data).
An exception will be thrown if a movement through the left cannot be matched
in the right. The right side is allowed to have extra Record fields.
Vecs must still be exactly the same size.
See elemConnect for details on how the root connections are issued.
Note that a valid sink must be writable so, one of these must hold:
- Is an internal writable node (Reg or Wire)
- Is an output of the current module
- Is an input of a submodule of the current module
Note that a valid source must be readable so, one of these must hold:
- Is an internal readable node (Reg, Wire, Op)
- Is a literal
- Is a port of the current module or submodule of the current module
This function is what recursively tries to connect a sink and source together
There is some cleverness in the use of internal try-catch to catch exceptions
during the recursive decent and then rethrow them with extra information added.
This gives the user a 'path' to where in the connections things went wrong.