• 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. Create multiple Instances with multiple variables

Stats

  • Locked Locked
  • Replies 2
  • Subscribers 144
  • Views 11102
  • 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

Create multiple Instances with multiple variables

Daniel Y
Daniel Y over 3 years ago

Hello,

I'm an eng. student so i'm fairly new to the Virtuoso environment.

my question is following: community.cadence.com/.../create-the-multiple-instance-in-parallel

My goal is to simulate image sense using multiple current sources.

To accomplish that in a schematic, I am trying to create multiple instances (using bus notation) with an individual variable for each instance (and later make a symbol to implement in top level circuit).

for example, 3 current sources with 3 different current variables:

instance:  idc<0:2>  ( create  3 current sources using bus notation)

i want the variables to be set in the following manner:

idc<0> DC Current = i_in0

idc<1> DC Current = i_in1

idc<2> DC Current = i_in2

Until now I entered the variables manually, but it's not practical for multiple instances.

is there a way to create said instances with individual variables in Cadence Virtuoso?

I would appreciate your advice,

Thanks

  • Cancel
  • AurelBuche
    AurelBuche over 3 years ago

    Hi Daniel,

    I don't understand what you are trying to achieve...

    If you want to create a bus current source, you probably have specific instances available to do so

    (or you could generate stimulis, maybe this Cadence Support post could help you SKILL: How to generate bit-blasted stimuli and connect them to the bus in schematic)

    If you want to create different sources and merge them as a bus signal I don't really get why you would do that...

    To me it would be more meaningful to make them different signals

    If you really want to generate several current sources as instances following a given pattern and name them as bused instances, you could still create a custom SKILL script to do so but I don't believe you can have a parallelized instance having different parameters (except connectivity)

    Hope this help

    Cheers,

    Aurélien

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • ebecheto
    ebecheto over 3 years ago

    Hi Daniel,

    Bellow is an example function to generate a set of vdc.

    Here is an example step by step

    cv=geGetWindowCellView();=> db:0x16a9c89a ;<= GET the identifier of the current cellView (opened empty shematic before)
    v=dbCreateInstByMasterName(cv "analogLib" "idc" "symbol" nil 0:0 "R0");=> example one
    v=dbCreateInstByMasterName(cv "analogLib" "idc" "symbol" sprintf(nil "idc<%d>" 0) 0+1:0 "R0");=> example two
    
    ;; study cdfgData=(cdfGetInstCDF css())~>parameters~>value
    foreach(mapcar p (cdfGetInstCDF v)~>parameters list(p~>name p~>value))
    ;=> (("noisefile" "") ("FNpairs" 0) ("F1" "") ("N1" "") ("F2" "") ("N2" "") ("F3" "") ("N3" "") ("F4" "") ("N4" "") ("F5" "") ("N5" "") ("F6" "") ("N6" "") ("F7" "") ("N7" "") ("F8" "") ("N8" "") ("F9" "") ("N9" "") ("F10" "") ("N10" "") ("idc" "") ("acm" "") ("acp" "") ("m" "") ("tc1" "") ("tc2" "") ("tnom" "") ("xfm" "") ("pacm" "") ("pacp" "") ("srcType" "dc"))
    param=cdfFindParamByName( cdfGetInstCDF(v) "idc");=> cdf:0x0x24ed2a70 <= GET THE PARAMETER YOU WANT. HERE IT IS "idc"
    param~>value="i_in0" ;#<= affect the value of the variable of the current.
    param~>value=sprintf(nil "i_in%d" 0) ;<= second example to change 0 to your parameter
    
    

    The parameter you want to change is named "idc", i do not know how to acces to it except by using cdfFindParamByName and cdfGetInstCDF functions.

    Although if you understand the code of my function vdcGen, you can change vdc with idc, and it will create a set of idc with one parameter shifted every bits to get a kind of Digital to Analog DAC current source.

    Hope it helps,

    ___________________

    ;; copyleft : ebecheto
    unless(fboundp('a2s) load(itos.il) alias(a2s itos))
    
    ; load("vdcGen.il")
    defun( vdcGen (@optional  (pinName t) (cv t) (N1 4) (N2 8) (bus t)(zero 0)(un 3.3))
    let((XY tmp X0 Y0 dX dY label i v wid Ni2s bug bud)
    when(cv=='t cv=geGetWindowCellView())
    when(pinName=='t pinName="SDC")
    if(bus then bug="<" bud=">" else bug="_" bud="")
    printf("Insert vdc_ %L in %s\n" list(N1 N2) cv~>cellName||"pasDeCellName?")
    if(listp(N2) then N2t=cadr(N2)||1 N2f=car(N2) when(N2t<N2f tmp=N2f N2f=N2t N2t=tmp) else N2f=1 N2t=N2)
    if(listp(N1) then N1t=cadr(N1)||1 N1f=car(N1) when(N1t<N1f tmp=N1f N1f=N1t N1t=tmp) else N1f=1 N1t=N1)
    X0=ceiling(caar(cv~>bBox))+0.375
    Y0=ceiling(cadadr(cv~>bBox))
    XY=list(X0 Y0)
    dX=0.5
    dY=1
    printf("from to loops :%L\n" list(N1f N1t N1f N2t) )
    for(Ni1 N1f N1t
    for(Ni2 N2f N2t
    label=if(N1f!=N1t sprintf(nil "%s_%d%s%d%s" pinName Ni1 bug Ni2 bud) strcat(pinName bug a2s(Ni2) bud))
    printf("label:%s\n" label)
    Ni2s=Ni2; Ni2-1<= choix sur le shift de depart de Ni TODO
    i=0 base="V"
    while(member(baseName=sprintf(nil "%s%d" base i) cv~>instances~>baseName) i++)
    i=0 base="I"
    while(member(baseI=sprintf(nil "%s%d" base i) cv~>instances~>baseName) i++)
    
    dbCreateInstByMasterName(cv "analogLib" "gnd" "symbol" baseI rodSubPoints(XY 0:0.375) "R0")
    v=dbCreateInstByMasterName(cv "analogLib" "vdc" "symbol" baseName rodAddPoints(XY 0:0) "R0")
    param=cdfFindParamByName( cdfGetInstCDF(v) "vdc")
    ;param~>value=sprintf(nil "V%s_%d_%d" pinName Ni1 Ni2)
    varName=if(N1f!=N1t strcat(pinName "_" a2s(Ni1)) pinName)
    param~>value=sprintf(nil "int(%s)&(1<<%d) ? %s:%s" varName Ni2s a2s(zero) a2s(un))
    wid=schCreateWire( cv "draw" "direct" list(XY rodAddPoints(XY 0:0.25)) 0.0625 0.0625 0.0125)
    schCreateWireLabel(cv car(wid) rodAddPoints(XY 0:0.2) label "centerCenter" "R0" "euroStyle" 0.0625 nil)
    XY=rodAddPoints(XY dX:0)
    )
    XY=list(X0 cadr(XY)+dY)
    )))
    
    ;; ; vdcGen("SDC" t 4 8)
    ;; printf("vdcGen(\"FDC\" t 4 8)\n")
    ;; printf("vdcGen(\"SDC\" t 4 8)\n")
    
    printf("vdcGen (@optional  (pinName t) (cv t) (N1 4) (N2 8) (bus t)(zero 0)(un 3.3))\n")
    printf("vdcGen(\"FDC\" t 2 2 nil); <== 4th param ==> _ instead of <> \n")
    printf("vdcGen(\"SDC\" t 3 8);<== array of configs\n")
    printf("vdcGen(\"ZC\" t 1 6 nil 0 3.3);<== single row, Low=0V, High=3.3V\n")
    printf("vdcGen(\"ZC\" t 1 6 nil \"-15\" \"+15\")\n")
    printf("vdcGen(\"ZC\" t 1 '(0 5))\n")
    printf("vdcGen(\"TH\" t 1 '(0 5));<==one row from 0 to 5\n")
    printf("vdcGen(\"TH\" t 1 '(0 5) t 3.3 0);<== \n")
    printf("vdcGen(\"ZC\" t 1 '(0 5) t 3.3 0)\n")
    
    
    ;; study cdfgData=(cdfGetInstCDF css())~>parameters~>value
    
    ;; foreach(mapcar p (cdfGetInstCDF css())~>parameters list(p~>name p~>value))
    ;; ; a=setof(p (cdfGetInstCDF css())~>parameters when(p~>value!="" list(p~>name p~>value)))
    ;; params=foreach(mapcar p (cdfGetInstCDF css())~>parameters when(p~>value!="" list(p~>name p~>value)))
    ;; qpar=setof(p params p)
    ;; assoc("t3" qpar) ;=> ("t3" "T0+RT")

    _________________

    ;; copyleft ebecheto    ; integer to string; not necessary, 
    defun(itos (i) 
    cond(
    (type(i)=='fixnum sprintf(nil "%d" i))
    (type(i)=='flonum sprintf(nil "%g" i))
    (t i)
    ))
    
    ;; itos(2);=> "2"
    ; function a2s exist but not in ocean standalone : all to string :
    ; a2s(2);=>"2"
    

    _________________

    ++Edouard

    • 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