• 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. RF Design
  3. Multiple Instances of Vsource with Different File Varia...

Stats

  • Locked Locked
  • Replies 4
  • Subscribers 64
  • Views 7850
  • 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

Multiple Instances of Vsource with Different File Variable

Maverick007
Maverick007 over 2 years ago

Hi,

I need to have over 400 instances of vsource as a pwl in my design with the input to the pwl specified as a csv file. I want to pass the csv file as variable for each instance with variable names like var1, var2, var3 and so on. My question is, is there a way to create multiple instance of vsource at once wherein the file name for instance is automatically incremented as var1, var2 as I keep placing the instances? Going over each instance & typing out the variable name is a lot time consuming. 

Thanks in advance.

  • Cancel
  • ShawnLogan
    ShawnLogan over 2 years ago

    Dear Maverick007,

    I can only suggest a possible idea that came to mind but I cannot verify it (I do not have access to Cadence tools currently). If it is of any interest to consider, suppose you place 400 instances of a pwl vsource that have the same variable name "var1" for the file containing the piecewise linear  parameters, for example, file "var1.csv". This can be done by placing your vsource as <0:399>.

    Then, modify a SKILL script that changes the file variable name of all vsource instances from "var1" to a new text name "varX" that you create using a counter within the loop where X is the count value. Run the script to change all vsource files with the variable name "var1" to "varX." where X will vary from 1 to 400.

    A SKILL script that you might modify, "CCSUpdateCDF.il" is at URL:

    https://support.cadence.com/apex/ArticleAttachmentPortal?id=a1Od0000000nV8REAU&pageName=ArticleContent

    Once again, please don't waste any time if this is not something you think might work as I am unable to verify it will work!

    Shawn

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
  • Maverick007
    Maverick007 over 2 years ago in reply to ShawnLogan

    Hi Shawn,

    Thank you for your reply. This is exactly what I want to do & I think it should work. However, for some reason, I am not able to access the SKILL script at the url you shared. Could you please copy paste the code here so that I can use it?

    Thanks again for your help. Much appreciated!

    Arjun

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • ShawnLogan
    ShawnLogan over 2 years ago in reply to Maverick007

    Dear Maverick007,

    Maverick007 said:
    However, for some reason, I am not able to access the SKILL script at the url you shared. Could you please copy paste the code here so that I can use it?

    I would be happy to include the code...but...

    My understanding is that I am not allowed to include the information contained in their On-line support articles in a Forum post. It specifically states at the bottom the page for that entry "Caution: All content on this site is Cadence Confidential and for Cadence customers only. DO NOT DISTRIBUTE."

    If you are using the tools, I assume you are a Cadence customer and are entitled to get a Cadence account which will give up full access to the On-line support site. If you are not sure of your Host ID or Reference key, please check with the individual who administers your Cadence tools and he or she should have the information you need.

    I apologize!!

    Shawn

    PS - If you are just having trouble with the link I provided, a direct link to the SKILL code to download is:

    support.cadence.com/.../068d0000001oLaxAAE

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 2 years ago in reply to ShawnLogan

    I don't think you need anything as complicated as in the examples on the support site (Shawn is right though, you should be able to get access, even if you're at an academic institution - if that's the case, speak to the contact who coordinates your University access programme).

    You could select all your vsources and then do:

    count=1
    foreach(inst geGetSelSet()
      when(inst~>cellName=="vsource"
        inst~>fileName=lsprintf("var%d" count++)
      )
    )

    Of course, whether that gives you enough control over the order is another matter. In your other post you made it sound as if they all shared the same file; wasn't clear that you wanted 400 different variables.

    This is probably much simpler than writing code to increment the count after each instantiation.

    I just thought of a slightly hack way of doing what you wanted though - to increment the variable name after each placement. If you load the following code:

    ; bit of a hack. Apply this temporarily as the doneProc for the effective CDF
    ; of analogLib/vsource. To reset the counter, set (in CIW):
    ; CCFincrVar.count=1
    procedure(CCFincrVar(@rest _ignore)
      let((cdf count)
        count=CCFincrVar.count || 1
        cdfgForm~>fileName~>value=lsprintf("var%d" count++)
        CCFincrVar.count=count
      )
    )

    and then use Tools→CDF→Edit and leave the CDF layer as "Effective". Pick the lib/cell as analogLib/vsource and then in the Form Done Procedure enter CCFincrVar . OK the form (you may get an error in the CIW - you can ignore that).

    Having done that, if you instantiate the vsource (set the type to PWL and turn on PWL File as Design Var), the first won't have the file name filled in, but each successive click to instantiate will set to var1, var2, var3 etc. 

    Regards,

    Andrew

    • 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