• 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. Issue while building a list

Stats

  • Locked Locked
  • Replies 2
  • Subscribers 143
  • Views 5409
  • 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

Issue while building a list

blankman
blankman over 2 years ago

Hello,

I am trying to remove a list of items from another list, using the following code, though I am still seeing ("METAL1" "dummy") in the final list metalsWithoutdummy. Whereas I expect this lpp to be removed. What is the correct syntax to use in this case in order to remove both lpps in dummyMetals from validlist?

Thanks and br,

Brian.

---------------------------------------------------------------

cv=geGetEditCellView()
techFile = techGetTechFile(cv)
validlist=nil
metalsWithoutdummy=nil

allLPPs = foreach(mapcar lp techFile~>lps list(lp~>name lp~>purpose))
allChangeLPPs = list( "METAL1"
                                   "VIA12"
                                   "METAL2"
)

metals = setof(lpp allLPPs member(car(lpp) allChangeLPPs))

dummyMetals = list( list("METAL1" "dummy")
                                   list("METAL2" "dummy")
)

;make new list with metals that are in the palette
foreach( lpp metals
     when(member(lpp allLPPs)
          validlist = cons( lpp validlist )
     )
)

;create a new list from the validlist, that removes the dummy metal layers only
foreach( lpp dummyMetals
     when(member(lpp validlist)
          metalsWithoutdummy = remove( lpp validlist )
     )
)

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 2 years ago

    OK, I was about to answer both your posts in this thread, having thought about them, only to find you'd significantly edited the first and removed the second. There's no notification when you edit or delete a post - better to post an update saying you'd solved it or moved on.

    OK, you could have just done:

    metalsWithoutdummy=setof(lpp metals !member(lpp dummyMetals))

    Anyway, to answer your question why your code doesn't work - a couple of points:

    1. I'm not entirely sure why you are using another loop to create validlist - that appears to be identical to metals - just in reverse - since metals is all the matching layer names from allLPPs, the member in the foreach(lpp metals loop will always return t. You could have just done validlist=metals . This however is not the reason your code doesn't work.
    2. All the final foreach loop is doing is setting metalsWithoutdummy to be validlist with a specific lpp removed. Next time there's a match, it overwrites metalsWithoutdummy, so it's only going to be the full validlist without whichever is last in dummyMetals. If you'd wanted it to work, you should have done this:

    metalsWithoutdummy=validlist
    foreach( lpp dummyMetals
         when(member(lpp metalsWithoutdummy)
              metalsWithoutdummy = remove( lpp metalsWithoutdummy )
         )
    )

    However, this is less efficient than using the setof approach I suggested.

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • blankman
    blankman over 1 year ago in reply to Andrew Beckett

    Thanks very much, Andrew - noted all very helpful and appreciated. Kind regards, Brian.

    • 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