rohd
rohd copied to clipboard
Resolve driver vs. receiver based on usage for certain types of operations
trafficstars
Motivation
For some types of operations, one may wish to use the result of an operation as either a driver or a receiver. A common example would be swizzles or subsets.
For example, these are currently NOT supported:
// swizzle as a receiver
[a, b].swizzle() <= c;
// subset as a receiver
d.slice(3, 2) <= e;
There are other ways to achieve these (e.g. assignSubset, withSet), but there's still some desire to assign these, especially for those coming from SystemVerilog.
Desired solution
Create a way for some implementer of Logic to determine "late" whether it should behave as a driver or a receiver. Upon connection to another signal, it can determine whether it should act as a driver or a receiver. This mechanism can be reused for multiple scenarios, including the examples above.
Alternatives considered
No response
Additional details
No response