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
Support associative arrays #544
Comments
Original Redmine Comment Unfortunately not high priority for my usage, and requires moderate work as it's a dynamic construct. Perhaps you or someone else will be interested in implementing it. |
Original Redmine Comment Could you explain a little bit what needs to be done for this? I am assuming backend implementation would use an existing map, e.g. STL map? |
Original Redmine Comment It's not too hard, just a lot of effort on details. First there's the parsing, and creating related Ast node types which is pretty easy. The big thing is all present internal analysis assumes the entire state of the model is available for static analysis, that will have to be bypassed. (Not allowing <= assignments would simplify.) Then the actual implementation which can yes be a map, though the key type needs to allow arbitrary width numbers. This needs to be implemented (as most things are) in both verilator for static analysis and in the runtime. Finally there's how to waveform trace something like this. If you only have a few, you can easily make a dpi function to do your lookup or faster something like this instead (untested): Note that using `systemc stuff disables some optimizations.
|
Original Redmine Comment Fixed lookup line to "mem_data[",y,"]". |
Original Redmine Comment Another example from behavioral AXI slave model:
|
Original Redmine Comment Looks like a useful feature. Have anybody made any progress in making associative arrays work? |
Original Redmine Comment Patches still wanted/welcome. |
Original Redmine Comment Associative array support for general types, excluding [*] and pattern assignment, is in git for eventual 4.024 release. |
Original Redmine Comment In 4.024. For additional support related to this please file new bug. |
Author Name: Alex Solomatnikov
Original Redmine Issue: 544 from https://www.veripool.org
Obviously not synthesizable but useful for testbenches and behavioral models.
Example:
The text was updated successfully, but these errors were encountered: