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

Index-based accessors in generated cc_xls_ir_jit_wrapper API for arrayed channels #1985

Open
mikex-oss opened this issue Mar 6, 2025 · 0 comments
Labels
enhancement New feature or request 🧦 sox ux User experience (end-user invoking XLS and its related tools)

Comments

@mikex-oss
Copy link
Collaborator

What's hard to do? (limit 100 words)

If you have channel arrays in DSLX (#704), they are unrolled into totally distinct channels in the XLS IR. cc_xls_ir_jit_wrapper for both proc and block wrapper types will then generate accessors (send/receive, set/get) where the index is embedded in the function name.

If the size of the array is large, this becomes quite tedious since you can't loop over the channel/port in C++.

Current best alternative workaround (limit 100 words)

There may be some preprocessor tricks like BOOST_PP_REPEAT that could help. Or you can type out a few calls manually and hope your IDE code completion kicks in.

Your view of the "best case XLS enhancement" (limit 100 words)

@allight had the following comments:

Yeah to be more specific ir_converter_main generates a xls/ir/xls_ir_interface.proto proto which contains some metadata about the package. It could be augmented to note somewhere that some collection of channels are actually all in an array and in a particular order. If you further augmented codegen_main to do something similar for ports you could then extend the aot generator to make accessors for the port/channel using array index.

This would be a rather tedious (though not espcially difficult) project.

@mikex-oss mikex-oss added enhancement New feature or request ux User experience (end-user invoking XLS and its related tools) 🧦 sox labels Mar 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request 🧦 sox ux User experience (end-user invoking XLS and its related tools)
Projects
Status: No status
Development

No branches or pull requests

1 participant