• 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. Custom IC SKILL
  3. Assigning key/value pair in disembodied property list

Stats

  • Locked Locked
  • Replies 12
  • Subscribers 148
  • Views 8827
  • 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

Assigning key/value pair in disembodied property list

dNora
dNora over 13 years ago
 Hi,

I'm trying to create key/value pair and add it to the disembodied property list using loop. But it doesn't work as expected.

file2 = infile(f2)
pList = '(nil) ;; initiate disembodied property list       
while(gets(sname2 file2)   
   List2 = parseString(sname2)
   str = nth(0 List2)
   printf("pList->\"%s\"=%s\n" str str)
   pList->"str" = nth(0 List2)
);while
pList
close(file2)

This is output on CIW window:

port:"test_lmap"

pList->"nwel"=nwel

pList->"L71"=L71

pList->"ndif"=ndif

pList->"pwel"=pwel

t

(nil str "pwel")

t

As you can see key name is str not it's value. I tried to assign key as pList->strcat(nth(0 List2)) but I get parser error.

Is there any way to make it work?

Thanks,

Nora
  • Cancel
  • Andrew Beckett
    Andrew Beckett over 6 years ago in reply to zssfred

    Hi Fred,

    Hash tables are good when you have lots of completely variable keys; defstruct is good when you have a small number of fixed keys (it's actually implemented as an array under the hood, with a DPL for any non-predefined keys). So defstruct takes less memory and the lookup is reasonable when you have a small number of keys - less efficient if you use non-predefined keys.

    A lot of it boils down to style though - defstructs are more of a specific object than a hash table which is a more general purpose key-value pair storage mechanism.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • zssfred
    zssfred over 6 years ago in reply to Andrew Beckett

    Andrew,

    I understand.

    Thank you.

    Fred

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
<

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