You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In low-level logic it is common that words are split into bits and bit regions.
In VHDL this is nicely supported with slice ranges, similar to how Python supports it.
To support this we should add two features to SME.
The first feature is with named fields, and could look like this:
The runtime will then create a struct that implements the interface correctly and allows the aliasing of the bits. The interface can then be used in a Bus definition as well.
To further help with bit fiddling, a number of support methods should be added:
The implementation in C# is simply a shift-n-mask, but the VHDL generator can emit slice expressions if the arguments are constant, and revert to shift-n-mask if the argument values cannot be determined statically.
A more general slice function could also be something like:
In low-level logic it is common that words are split into bits and bit regions.
In VHDL this is nicely supported with slice ranges, similar to how Python supports it.
To support this we should add two features to SME.
The first feature is with named fields, and could look like this:
The runtime will then create a struct that implements the interface correctly and allows the aliasing of the bits. The interface can then be used in a
Bus
definition as well.To further help with bit fiddling, a number of support methods should be added:
The implementation in C# is simply a shift-n-mask, but the VHDL generator can emit slice expressions if the arguments are constant, and revert to shift-n-mask if the argument values cannot be determined statically.
A more general slice function could also be something like:
This will return 64 bit values, but the VHDL vendor tools will usually optimize the unused bits away.
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: