-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 this since 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
- Loading branch information
Showing
7 changed files
with
18 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters