Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Provides reuseable decorator and function to handle magma's implicit
coercion of Python values.
For now, I moved the logic from wiring and mux to a shared place to
ensure consistency. There's probably other places to do this, but we
can do this on demand as we enounter incosistencies.
One issue is that
int
coercion can't really happen up front like thissince it is determined by the place it's used (i.e. when it's wired to a
Bits we check it can fit in the bit width). @rsetaluri perhaps we could
use SmartBits for this? (convert it to a smartbits that's automatically
extended to wire to a regular bits, but I think right now our rules
don't allow implicit truncation, but we could define a special SmartBits
subclass that only extends. My one concern would be whether this would
make the error a bit harder to traceback)
Fixes #828