In reply to Pradeepkumar:
I show examples of associative arrays in my responses (go through all) in
Obviously, an associative array is a software concept and is not is hardware.
However, it is possible to come close to emulating it in hardware with constraints and speed penalties. A cache is a form of associative arrays, though, in hardware caches, more words are fetched in the contemplation that data from nearby addresses will be requested.
How it’s handled by simulation tool? That is vendor dependent, as 1800 does not address that.
Do a search on associative array implementation, there are lots of responses
A simple approach to get you started would be to create a map class that uses two vectors - one for the key and one for the value. To add an item, you insert a key in one and a value in another. To find a value, you just loop over all the keys. Once you have this working, you can think about using a more complex data structure.
Ben Cohen
http://www.systemverilog.us/ ben@systemverilog.us
For training, consulting, services: contact Home - My cvcblr
- SVA Handbook 4th Edition, 2016 ISBN 978-1518681448
- A Pragmatic Approach to VMM Adoption 2006 ISBN 0-9705394-9-5
- Using PSL/SUGAR for Formal and Dynamic Verification 2nd Edition, 2004, ISBN 0-9705394-6-0
- Real Chip Design and Verification Using Verilog and VHDL, 2002 isbn 978-1539769712
- Component Design by Example ", 2001 ISBN 0-9705394-0-1
- VHDL Coding Styles and Methodologies, 2nd Edition, 1999 ISBN 0-7923-8474-1
- VHDL Answers to Frequently Asked Questions, 2nd Edition ISBN 0-7923-8115