• 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 Design
  3. Offset Parameters in Instance Array

Stats

  • Replies 1
  • Subscribers 130
  • Views 119
  • Members are here 0

Offset Parameters in Instance Array

AR202511272845
AR202511272845 3 days ago

Hi,

How can one set different offset values for parameters in an instance array. For example, I want to make a vdc, V1<n:0>, with values on the bus lines equal to 0*offset,1*offset,2*offset,3*offset,...,n*offset.

How would I get this feature without having to instantiate n different sources.

Thanks

  • Cancel
  • Sign in to reply
Parents
  • Andrew Beckett
    Andrew Beckett 2 days ago

    There's no built-in way of doing this - you can't have different parameter values on members of an iterated instance.

    However, I just created a symbol/schematic PCell to achieve the same goal. This code creates a component in a library of your choice (by default called "vdcbus") which has a parameter to control the bus width, and also a DC voltage and an offset per bit.

    /* abCreateVdcbus.il
    
    Author     A.D.Beckett
    Group      Custom IC, Cadence Design Systems Ltd.
    Date       Nov 29, 2025 
    Modified   
    By         
    
    Create a component that has a variable width bus output, and within
    creates an instance of vdc for each bit, which has vdc+n*offset as the
    voltage of that bit.
    
    Usage: abCreateVdcbus("mylib") or abCreateVdcbus("mylib" "vdcoffset")
    
    ***************************************************
    
    SCCS Info: @(#) abCreateVdcbus.il 11/29/25.13:35:32 1.1
    
    */
    
    procedure(abCreateVdcbus(library @optional (cell "vdcbus"))
     let( (pcellId)
        unless(ddGetObj(library)
            error("Couldn't open library %L" library)
        )
    
        ;--------------------------------------------------------------------
        ; First the schematic. Note that the schematic only has the instances
        ; and logical connectivity (nets, terminals, instTerms) - no wires or
        ; pins. Don't really need to be able to probe within the schematic
        ; so make life easier by not constructing all the geometries!
        ;--------------------------------------------------------------------
        pcellId=pcDefinePCell(
            list(ddGetObj(library) cell "schematic" "schematic")
    
            ;----------------------------------------------------------------
            ; Formal parameters
            ;----------------------------------------------------------------
            (
                (buswidth 6)
            )
    
            ;----------------------------------------------------------------
            ; Code itself
            ;----------------------------------------------------------------
            let(( cv master vdcInst bitNet plusNet minusNet)
    
            cv = pcCellView
            ;----------------------------------------------------------------
            ; Convert parameters
            ;----------------------------------------------------------------
            when(buswidth<1 buswidth=1)
    
            ;----------------------------------------------------------------
            ; create the nets and terminals
            ;----------------------------------------------------------------
            minusNet=dbMakeNet(cv "MINUS")
            plusNet=dbMakeNet(cv sprintf(nil "PLUS<%d:0>" buswidth-1))
            dbCreateTerm(minusNet minusNet~>name "inputOutput")
            dbCreateTerm(plusNet plusNet~>name "inputOutput")
    
            ;----------------------------------------------------------------
            ; create the instances of vdc 
            ;----------------------------------------------------------------
            master = dbOpenCellViewByType( "analogLib" "vdc" "symbol" nil "r" )
            for(bit 0 buswidth-1
                vdcInst = 
                    dbCreateInst(
                        cv master sprintf(nil "VDC%d" bit)
                        0:bit*0.8 "R0"
                    )
                ;------------------------------------------------------------
                ; Create the properties on each instance
                ;------------------------------------------------------------
                vdcInst~>vdc=lsprintf("pPar(\"vdc\")+pPar(\"offset\")*%d" bit)
                ;------------------------------------------------------------
                ; Connect it up
                ;------------------------------------------------------------
                bitNet=dbMakeNet(cv lsprintf("PLUS<%d>" bit))
                dbCreateConnByName(minusNet vdcInst "MINUS");
                dbCreateConnByName(bitNet vdcInst "PLUS");
            ) ; for
    
            ;----------------------------------------------------------------
            ; Make the connectivity look up to date - shouldn't really be needed!
            ;----------------------------------------------------------------
            dbSetConnCurrent(cv)
    
            dbClose( master )
            t
            )
        )
        dbSave(pcellId)
        dbClose(pcellId) 
        
        ;--------------------------------------------------------------------
        ; Now the symbol. This reuses the analogLib/vdc/symbol as a template
        ; but changes the PLUS pin to be a bus
        ;--------------------------------------------------------------------
        pcellId=pcDefinePCell(
            list(ddGetObj(library) cell "symbol" "schematicSymbol")
    
            ;----------------------------------------------------------------
            ; Formal parameters
            ;----------------------------------------------------------------
            (
                (buswidth 6)
            )
    
            ;----------------------------------------------------------------
            ; Code itself
            ;----------------------------------------------------------------
            let(( cv template inst plusTerm plusFigs plusNet)
    
            cv = pcCellView
    
            template = dbOpenCellViewByType("analogLib" "vdc" "symbol")
    
            inst=dbCreateInst(cv template "" 0:0 "R0")
            ;----------------------------------------------------------------
            ; shapes on instance layer are not preserved during flatten
            ;----------------------------------------------------------------
            foreach(lpp inst~>master~>lpps
                when(lpp~>layerName=="instance"
                    foreach(shape lpp~>shapes
                        dbCopyFig(shape cv)
                    )
                )
            )
            dbFlattenInst(inst 1 t t nil nil t t)
    
            ;----------------------------------------------------------------
            ; Remove existing PLUS pin and reuse the figures for
            ; a new PLUS<x:0> pin
            ;----------------------------------------------------------------
            plusTerm=dbFindTermByName(cv "PLUS")
            plusFigs=car(plusTerm~>pins)~>figs
            plusNet=plusTerm~>net
            dbDeleteObject(plusTerm)
            dbDeleteObject(plusNet)
            plusNet=dbMakeNet(cv lsprintf("PLUS<%d:0>" buswidth-1))
            plusTerm=dbCreateTerm(plusNet plusNet~>name "inputOutput")
            foreach(fig plusFigs
                dbAddFigToNet(fig plusNet)
            )
            dbCreatePin(plusNet car(plusFigs) "" plusTerm)
    
            ;----------------------------------------------------------------
            ; Correct the cdsTerm label
            ;----------------------------------------------------------------
            foreach(shape cv~>shapes
                when(shape~>objType=="label" && shape~>theLabel=="cdsTerm(\"PLUS\")"
                    shape~>theLabel=lsprintf("cdsTerm(\"%s\")" plusNet~>name)
                )
            )
    
            t
            )
        )
        dbSave(pcellId)
        dbClose(pcellId) 
    
        ;--------------------------------------------------------------------
        ; Now create the CDF
        ;--------------------------------------------------------------------
        let( (cellId cdfId )
            unless( cellId = ddGetObj( library cell )
                error( "Could not get cell %s." cell )
            )
            when( cdfId = cdfGetBaseCellCDF( cellId )
                cdfDeleteCDF( cdfId )
            )
            cdfId  = cdfCreateBaseCellCDF( cellId )
    
            ;;; Parameters
            cdfCreateParam( cdfId
                ?name           "buswidth"
                ?prompt         "Bus Width"
                ?defValue       6
                ?type           "int"
                ?display        "t"
            )
            cdfCreateParam( cdfId
                ?name           "vdc"
                ?prompt         "DC Voltage"
                ?defValue       "0"
                ?type           "string"
                ?parseAsCEL     "yes"
                ?parseAsNumber  "yes"
                ?display        "t"
            )
            cdfCreateParam( cdfId
                ?name           "offset"
                ?prompt         "Offset Per Bit"
                ?defValue       "0"
                ?type           "string"
                ?parseAsCEL     "yes"
                ?parseAsNumber  "yes"
                ?display        "t"
            )
    
            ;;; Simulator Information
            cdfId->simInfo = list( nil )
            cdfId->simInfo->UltraSim = '( nil )
            cdfId->simInfo->auCdl = '( nil )
            cdfId->simInfo->auLvs = '( nil )
            cdfId->simInfo->cdsSpice = '( nil )
            cdfId->simInfo->hspiceD = '( nil )
            cdfId->simInfo->spectre = '( nil )
    
            ;;; Properties
            cdfId->formInitProc            = ""
            cdfId->doneProc                = ""
            cdfId->buttonFieldWidth        = 340
            cdfId->fieldHeight             = 35
            cdfId->fieldWidth              = 350
            cdfId->promptWidth             = 175
            cdfId->paramLabelSet           = "buswidth vdc offset"
            cdfId->paramDisplayMode        = "parameter"
            cdfId->paramEvaluate           = "t nil nil nil nil"
            cdfSaveCDF( cdfId )
        ) 
     )
    )

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • Andrew Beckett
    Andrew Beckett 2 days ago

    There's no built-in way of doing this - you can't have different parameter values on members of an iterated instance.

    However, I just created a symbol/schematic PCell to achieve the same goal. This code creates a component in a library of your choice (by default called "vdcbus") which has a parameter to control the bus width, and also a DC voltage and an offset per bit.

    /* abCreateVdcbus.il
    
    Author     A.D.Beckett
    Group      Custom IC, Cadence Design Systems Ltd.
    Date       Nov 29, 2025 
    Modified   
    By         
    
    Create a component that has a variable width bus output, and within
    creates an instance of vdc for each bit, which has vdc+n*offset as the
    voltage of that bit.
    
    Usage: abCreateVdcbus("mylib") or abCreateVdcbus("mylib" "vdcoffset")
    
    ***************************************************
    
    SCCS Info: @(#) abCreateVdcbus.il 11/29/25.13:35:32 1.1
    
    */
    
    procedure(abCreateVdcbus(library @optional (cell "vdcbus"))
     let( (pcellId)
        unless(ddGetObj(library)
            error("Couldn't open library %L" library)
        )
    
        ;--------------------------------------------------------------------
        ; First the schematic. Note that the schematic only has the instances
        ; and logical connectivity (nets, terminals, instTerms) - no wires or
        ; pins. Don't really need to be able to probe within the schematic
        ; so make life easier by not constructing all the geometries!
        ;--------------------------------------------------------------------
        pcellId=pcDefinePCell(
            list(ddGetObj(library) cell "schematic" "schematic")
    
            ;----------------------------------------------------------------
            ; Formal parameters
            ;----------------------------------------------------------------
            (
                (buswidth 6)
            )
    
            ;----------------------------------------------------------------
            ; Code itself
            ;----------------------------------------------------------------
            let(( cv master vdcInst bitNet plusNet minusNet)
    
            cv = pcCellView
            ;----------------------------------------------------------------
            ; Convert parameters
            ;----------------------------------------------------------------
            when(buswidth<1 buswidth=1)
    
            ;----------------------------------------------------------------
            ; create the nets and terminals
            ;----------------------------------------------------------------
            minusNet=dbMakeNet(cv "MINUS")
            plusNet=dbMakeNet(cv sprintf(nil "PLUS<%d:0>" buswidth-1))
            dbCreateTerm(minusNet minusNet~>name "inputOutput")
            dbCreateTerm(plusNet plusNet~>name "inputOutput")
    
            ;----------------------------------------------------------------
            ; create the instances of vdc 
            ;----------------------------------------------------------------
            master = dbOpenCellViewByType( "analogLib" "vdc" "symbol" nil "r" )
            for(bit 0 buswidth-1
                vdcInst = 
                    dbCreateInst(
                        cv master sprintf(nil "VDC%d" bit)
                        0:bit*0.8 "R0"
                    )
                ;------------------------------------------------------------
                ; Create the properties on each instance
                ;------------------------------------------------------------
                vdcInst~>vdc=lsprintf("pPar(\"vdc\")+pPar(\"offset\")*%d" bit)
                ;------------------------------------------------------------
                ; Connect it up
                ;------------------------------------------------------------
                bitNet=dbMakeNet(cv lsprintf("PLUS<%d>" bit))
                dbCreateConnByName(minusNet vdcInst "MINUS");
                dbCreateConnByName(bitNet vdcInst "PLUS");
            ) ; for
    
            ;----------------------------------------------------------------
            ; Make the connectivity look up to date - shouldn't really be needed!
            ;----------------------------------------------------------------
            dbSetConnCurrent(cv)
    
            dbClose( master )
            t
            )
        )
        dbSave(pcellId)
        dbClose(pcellId) 
        
        ;--------------------------------------------------------------------
        ; Now the symbol. This reuses the analogLib/vdc/symbol as a template
        ; but changes the PLUS pin to be a bus
        ;--------------------------------------------------------------------
        pcellId=pcDefinePCell(
            list(ddGetObj(library) cell "symbol" "schematicSymbol")
    
            ;----------------------------------------------------------------
            ; Formal parameters
            ;----------------------------------------------------------------
            (
                (buswidth 6)
            )
    
            ;----------------------------------------------------------------
            ; Code itself
            ;----------------------------------------------------------------
            let(( cv template inst plusTerm plusFigs plusNet)
    
            cv = pcCellView
    
            template = dbOpenCellViewByType("analogLib" "vdc" "symbol")
    
            inst=dbCreateInst(cv template "" 0:0 "R0")
            ;----------------------------------------------------------------
            ; shapes on instance layer are not preserved during flatten
            ;----------------------------------------------------------------
            foreach(lpp inst~>master~>lpps
                when(lpp~>layerName=="instance"
                    foreach(shape lpp~>shapes
                        dbCopyFig(shape cv)
                    )
                )
            )
            dbFlattenInst(inst 1 t t nil nil t t)
    
            ;----------------------------------------------------------------
            ; Remove existing PLUS pin and reuse the figures for
            ; a new PLUS<x:0> pin
            ;----------------------------------------------------------------
            plusTerm=dbFindTermByName(cv "PLUS")
            plusFigs=car(plusTerm~>pins)~>figs
            plusNet=plusTerm~>net
            dbDeleteObject(plusTerm)
            dbDeleteObject(plusNet)
            plusNet=dbMakeNet(cv lsprintf("PLUS<%d:0>" buswidth-1))
            plusTerm=dbCreateTerm(plusNet plusNet~>name "inputOutput")
            foreach(fig plusFigs
                dbAddFigToNet(fig plusNet)
            )
            dbCreatePin(plusNet car(plusFigs) "" plusTerm)
    
            ;----------------------------------------------------------------
            ; Correct the cdsTerm label
            ;----------------------------------------------------------------
            foreach(shape cv~>shapes
                when(shape~>objType=="label" && shape~>theLabel=="cdsTerm(\"PLUS\")"
                    shape~>theLabel=lsprintf("cdsTerm(\"%s\")" plusNet~>name)
                )
            )
    
            t
            )
        )
        dbSave(pcellId)
        dbClose(pcellId) 
    
        ;--------------------------------------------------------------------
        ; Now create the CDF
        ;--------------------------------------------------------------------
        let( (cellId cdfId )
            unless( cellId = ddGetObj( library cell )
                error( "Could not get cell %s." cell )
            )
            when( cdfId = cdfGetBaseCellCDF( cellId )
                cdfDeleteCDF( cdfId )
            )
            cdfId  = cdfCreateBaseCellCDF( cellId )
    
            ;;; Parameters
            cdfCreateParam( cdfId
                ?name           "buswidth"
                ?prompt         "Bus Width"
                ?defValue       6
                ?type           "int"
                ?display        "t"
            )
            cdfCreateParam( cdfId
                ?name           "vdc"
                ?prompt         "DC Voltage"
                ?defValue       "0"
                ?type           "string"
                ?parseAsCEL     "yes"
                ?parseAsNumber  "yes"
                ?display        "t"
            )
            cdfCreateParam( cdfId
                ?name           "offset"
                ?prompt         "Offset Per Bit"
                ?defValue       "0"
                ?type           "string"
                ?parseAsCEL     "yes"
                ?parseAsNumber  "yes"
                ?display        "t"
            )
    
            ;;; Simulator Information
            cdfId->simInfo = list( nil )
            cdfId->simInfo->UltraSim = '( nil )
            cdfId->simInfo->auCdl = '( nil )
            cdfId->simInfo->auLvs = '( nil )
            cdfId->simInfo->cdsSpice = '( nil )
            cdfId->simInfo->hspiceD = '( nil )
            cdfId->simInfo->spectre = '( nil )
    
            ;;; Properties
            cdfId->formInitProc            = ""
            cdfId->doneProc                = ""
            cdfId->buttonFieldWidth        = 340
            cdfId->fieldHeight             = 35
            cdfId->fieldWidth              = 350
            cdfId->promptWidth             = 175
            cdfId->paramLabelSet           = "buswidth vdc offset"
            cdfId->paramDisplayMode        = "parameter"
            cdfId->paramEvaluate           = "t nil nil nil nil"
            cdfSaveCDF( cdfId )
        ) 
     )
    )

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Children
No Data

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