• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Functional Verification
  3. hash tables in e :

Stats

  • Locked Locked
  • Replies 1
  • Subscribers 64
  • Views 13292
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

hash tables in e :

archive
archive over 17 years ago

Hello everybody, i'm looking for a DB that define hash table in specman. does any such structure exists ? or perhaps i can define one using macro. i.e. definition example : tlb["signal1"] is inout simple_port of uint = "..."; tlb["signal2"] is inout simple_port of uint = "..."; tlb["signal3"] is inout simple_port of uint = "..."; usage example : tlb[signal1]$ = tlb[signal2]$ thanks,


Originally posted in cdnusers.org by zcabeli11
  • Cancel
Parents
  • archive
    archive over 17 years ago

    For general hashing, there is a keyed list type of list that will allow you create a hash table. However, it sounds like you may have a specific requirement to connect ports or drive values to ports, which may require extra levels of indirection.

    unit xyz {
    !cs_buffer: list (key:address) of cs_data;
    write(addr: uint; data:uint) is {
    if(cs_buffer.key_exists(addr) {
    cs_buffer.key(addr).data = data;
    } else {
    var tmpentry: cs_data;
    tmpentry.address = addr;
    tmpentry.data = data;
    cs_buffer.add(tmpentry);
    }
    }
    read(addr:uint):uint is {
    var entry: cs_data = cs_buffer.key(addr);
    return entry;
    }
    }

    //Hash Element
    struct cs_data {
    address: uint;
    data: uint;
    };


    Originally posted in cdnusers.org by artmaj1
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • archive
    archive over 17 years ago

    For general hashing, there is a keyed list type of list that will allow you create a hash table. However, it sounds like you may have a specific requirement to connect ports or drive values to ports, which may require extra levels of indirection.

    unit xyz {
    !cs_buffer: list (key:address) of cs_data;
    write(addr: uint; data:uint) is {
    if(cs_buffer.key_exists(addr) {
    cs_buffer.key(addr).data = data;
    } else {
    var tmpentry: cs_data;
    tmpentry.address = addr;
    tmpentry.data = data;
    cs_buffer.add(tmpentry);
    }
    }
    read(addr:uint):uint is {
    var entry: cs_data = cs_buffer.key(addr);
    return entry;
    }
    }

    //Hash Element
    struct cs_data {
    address: uint;
    data: uint;
    };


    Originally posted in cdnusers.org by artmaj1
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
No Data

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information