-
Notifications
You must be signed in to change notification settings - Fork 77
Description
Motivation
There is now support for assignSubset
of a LogicArray
, which was a natural convenience automation. The idea of partial assignment for a Logic
has been long-requested, but conceptually did not work with the modelling for signals in ROHD. However, with LogicArray
support, there's a new opportunity to cleanly support it with a little automation.
Desired solution
Add a function assignSubset
to Logic
which creates a new bit-blasted LogicArray
to drive that original Logic
, then calls assignSubset
on that new driver array. This gives a clean API and hides the dirty management of blasted drivers from the user.
Alternatives considered
Let users figure out their own automation via swizzle
and or LogicArray
as necessary.
Additional details
Related to #378, but separate
This approach is less efficient for multi-bit drivers since it blasts the whole intermediate into bits. A swizzle approach is more efficient in terms of simulation and will create nicer generated outputs. However, an API definition for varying width subset drivers, as well as a robust implementation, would be substantially more complicated. It would also require a "resolution" time for when to finally compress the signals into one swizzle, which doesn't play well with the rest of the connectivity APIs. Perhaps this could be revisited if #97 is ever supported.