• 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. Unexpected Skill behaviour with disembodied property li...

Stats

  • Locked Locked
  • Replies 3
  • Subscribers 142
  • Views 5305
  • 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

Unexpected Skill behaviour with disembodied property lists

FormerMember
FormerMember over 4 years ago

Hello,

I encountered a strange behaviour with disembodied property lists, which I do not understand. When I load the following script

procedure( proc1()
   let((x)
      x = '( nil ) ; empty disembodied property list
      printf("Value should be '(nil)' and is '%A'\n" x)
      x->prop = 0
      printf("Value should be '(nil 'prop 0)' and is '%A'\n" x)
   )
)

and call the procedure twice with 'proc1() proc1()' in the CIW, I get the following output:

Value should be '(nil)' and is '(nil)'
Value should be '(nil 'prop 0)' and is '(nil prop 0)'
Value should be '(nil)' and is '(nil prop 0)'  <-- x has a wrong value
Value should be '(nil 'prop 0)' and is '(nil prop 0)'

After the first call of 'proc1' the values of 'x' are as expected, but in every subsequent call 'x' still has the same value, even though it is in a local let scope and initialized to '(nil). When I replace "x = '( nil )" with "x = ncons(nil)" in the procedure, it behaves as expected.

Value should be '(nil)' and is '(nil)'
Value should be '(nil 'prop 0)' and is '(nil prop 0)'
Value should be '(nil)' and is '(nil)'
Value should be '(nil 'prop 0)' and is '(nil prop 0)'

Can someone explain this behaviour or what I am doing wrong? I thought a disembodied property list can be initialized as a non-empty list with a single element (usually 'nil')?

Best regards
Paul

  • Cancel
Parents
  • AaronSymko
    AaronSymko over 4 years ago

    When a static list or DPL is used in a function, it is scoped globally. Thus any destructive operation (e.g. x->prop = 0) will apply to the same, global object.  The solution is to use the list() function instead of '().  The list() function will construct a new list every time.  For example:

    procedure( proc1()
       let((x)
          x = list( nil ) ; empty disembodied property list

       ...

      )

    )

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • FormerMember
    FormerMember over 4 years ago in reply to AaronSymko

    Thanks Aaron for the answer. I guessed something like that, but could not reproduce it in the CIW. When I execute the following

    x = '(nil)
    y = '(nil)
    eq(x y) -> nil

    the lists are different objects. Is this behaviour somewhere documented? I could not find it in the Skill manual.

    Best regards
    Paul

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • AaronSymko
    AaronSymko over 4 years ago in reply to FormerMember

    The reason why it works in your experiment is because you have separate invocations of '(nil) and so they are different from each other. When called within a function, they are the same literal list. There are a couple of relevant articles which cover this (both written by Andrew Beckett):

    Why does my SKILL function remember previous local disembodied property lists?

    Copies of disembodied property lists still have links to each other

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • AaronSymko
    AaronSymko over 4 years ago in reply to FormerMember

    The reason why it works in your experiment is because you have separate invocations of '(nil) and so they are different from each other. When called within a function, they are the same literal list. There are a couple of relevant articles which cover this (both written by Andrew Beckett):

    Why does my SKILL function remember previous local disembodied property lists?

    Copies of disembodied property lists still have links to each other

    • 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