• 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. How to pass parameter to "number of pair of points, time...

Stats

  • Replies 2
  • Subscribers 150
  • Views 588
  • Members are here 0

How to pass parameter to "number of pair of points, time, voltage" parameters of cell "vpwl" inside a pcell?

Yuto Lau
Yuto Lau 1 month ago

Hi everyone,

I would like to add some features on Andrew's bussetp.il script, (the script is in this link: https://support.cadence.com/apex/ArticleAttachmentPortal?id=a1Od0000000nX1lEAE&pageName=ArticleContent.).

(previous post: https://community.cadence.com/cadence_technology_forums/f/custom-ic-skill/65168/how-to-pass-parameters-to-sub-cells-parameter-in-pcell),

I want to add cell "vpwl" from analogLib into pcell "bussetp". Besides defining "vhi" and "vlo" as parameter "vdc" of "vpwl" as in previous post (https://community.cadence.com/cadence_technology_forums/f/custom-ic-skill/65168/how-to-pass-parameters-to-sub-cells-parameter-in-pcell), 

I try to pass parameter to "number of pairs of points", "time X" and "Voltage X" (X is determined by value of "number of pair"). With this feature, I can define the control signal waveform in transient sim, like power on sequence.

However, I encounter two issues as below

1) For cell "pwl" , the value of "Time" and "Voltage" are combined as a vector, passing to parameter "wave". How can I realize such combination?  

2)  As number of "Time" and "Voltage" pair is unknow until "number of pairs of points" is defined, how should I define pcell CDF so that it can adjust the number of inputs?

Could you please give me any idea or point me to some useful material?

Thanks and regards,

Yutao

  • Cancel
  • Sign in to reply
  • Yuto Lau
    Yuto Lau 1 month ago

    Hi everyone,

    My above question maybe unclear.

    Let me make the question into small section and in detail.

    In below script, I would like to dynamically assign pcell parameter (time1, time2...) to instance field (t1, t2,...), based on value of "tvpairs".

    However, concat("t" i) return a string instead of variable.

    Do you know any way to convert a string to field name? Or any way to edit instance field in an iteration loop?


    vpwlMaster = dbOpenCellViewByType("analogLib" "vpwl" "symbol" nil "r")
    ;----------------------------------------------------------------
    ;Create vdc instances for hi and lo
    ;----------------------------------------------------------------
    vhiInst = dbCreateInst(cv vpwlMaster "VHI_SRC" -1:0 "R0")
    vloInst = dbCreateInst(cv vpwlMaster "VLO_SRC" -1:-0.5 "R0")

    ;; Set number of time-voltage pairs
    vhiInst->tvpairs = pairs
    vloInst->tvpairs = pairs

    ;; Dynamically assign t1..tN and v1..vN
    for(i 1 pairs
    vhiInst->concat("t" i) = sprintf(nil "pPar(\"time%d\")" i)
    vhiInst->concat("v" i) = sprintf(nil "pPar(\"vh%d\")" i)
    vloInst->concat("t" i) = sprintf(nil "pPar(\"t%d\")" i)
    vloInst->concat("v" i) = sprintf(nil "pPar(\"vl%d\")" i)
    );for

    Thanks and regards,

    Yutao

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • henker
    henker 1 month ago in reply to Yuto Lau


    You would use dbCreateProp to set properties on the instance:
    dbCreateProp(inst propName propType propValue)

    e.g.
    ;; Set number of time-voltage pairs
    dbCreateProp(vhiInst "tvpairs" "int" pairs)
    dbCreateProp(vloInst "tvpairs" "int" pairs)

    or

    ;; Dynamically assign t1..tN and v1..vN
    for(i 1 pairs
      dbCreateProp(vhiInst sprintf(nil "t%L" i) "string" <time as string, e.g. from pcell formal parameters t[i]>)
      dbCreateProp(vloInst sprintf(nil "v%L" i) "string" <voltage as string, e.g. calculated per time point and bit>)
      ...

    To convert a string to a symbol use 'stringToSymbol'

    Regards,

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • 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