• 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. Simple question about repeated list elements.

Stats

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

Simple question about repeated list elements.

CADcasualty
CADcasualty over 6 years ago

In my simulation scripts I'm doing a lot of waveform plotting using the awvPlotWaveform() function. Say I'm simulating over PVTs and want to plot a lot of waveforms in a separate color per PVT.  I have the color stored in a variable (color_var) so the relevant part of the plot command contains the text:

?color list( color_var color_var color_var color_var color_var color_var color_var color_var color_var color_var color_var color_var ) \

and I have the same thing for the plot_strip etc.. 

I searched and I searched but I couldn't find any way to define a list of repeated elements easily e.g. something like

list( 20*color_var) 

I know the above syntax can't possibly work, but is there anything that does what I want?

(Note: I originally posted this about the strip_number in the awvPlotWaveform function but the forum's automated spam detector rejected my post as offensive because it contained the word strip too many times :-/)

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 6 years ago

    In this case it thought that it was spam because of the repeated text (color_var). So it probably wasn't "strip" that it had an issue with, but the repetition. Since spam often contains repeated text, unfortunately it sometimes gets confused by genuine posts such as the above. Luckily I'm the moderator and I get alerted and so can then approve the post.

    You can use this code:

    procedure(CCFrepeatedList(ntimes element)
      let((result)
        for(i 1 ntimes result=cons(element result))
        result
      )
    )

    Then you can just do:

    CCFrepeatedList(20 color_var)

    to generate the repeated list.

    Regards,

    Andrew.

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

    Sorry for the late reply Andrew - I meant to say thanks for your code. I was able to make it work just fine, although I found myself needing to use the nconc() function in several places where I needed the code.  I originally thought I could use your procedure within a list declaration but, because it actually yields a list itself, I needed to concatenate all the various lists using nconc(). 

    • 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