Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert structs into additional ports #4021

Open
taktoa opened this issue Jan 25, 2025 · 0 comments
Open

Convert structs into additional ports #4021

taktoa opened this issue Jan 25, 2025 · 0 comments

Comments

@taktoa
Copy link

taktoa commented Jan 25, 2025

Currently if I write SystemVerilog that uses packed struct types for e.g.: a module input, Surelog will compile that to an input with bitwidth equal to the width of the packed struct, and struct field accesses will become part selects of the bitvector.

An alternative, which may often be easier to understand and process, is to compile the struct fields to multiple inputs/outputs. This would happen recursively and terminate at types that are not struct types (non-struct types would be handled the same way structs currently are). It would be an optional and likely non-default mode of elaboration.

Surelog should avoid applying this transformation to any blackboxed modules as well as the top level module, so that the output of compilation can still be connected to other designs that may not have had this transformation applied. It might also be reasonable to optionally automatically generate wrapper modules around any blackboxed modules when this is enabled, so that the wrapper module can be transformed in this way even though the blackboxed one is not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant