• 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. CDF and PCells

Stats

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

CDF and PCells

DarioETH
DarioETH over 15 years ago

 Hi,

I would like to create a schematic PCell of a capacitor wich realizes the parallel connection of N unit capacitors I previously designed in a different library. The number N has to be defined only in simulation time (trough an ocean script or by ADE through Variables->Edit )

Up to now I managed to get the main PCell Skill code but I am having toubles in passing the variable N. I paste here the code:   

/* dcUnitCapPCell_v2.il

Author D.A. Carnelli
Group Analog And Mixed Signal, ETH Zurich.
Machine SUN
Date Jul 1, 2010
Modified
By

SKILL code for creating the "UnitCap" pcell schematic
and the CDF as well

***************************************************

SCCS Info: %Z% %M% %G%.%U% %I%

*/

let( (library cell pcellId)
library="DC_BBFlt"
cell="FiltCap"
unless(ddGetObj(library)
error("Couldn't open library %L" library)
)

;--------------------------------------------------------------------
; First the schematic
;--------------------------------------------------------------------
pcellId=pcDefinePCell(
                        list(
                             ddGetObj(library)
                             cell
                             "schematic_UnitCap_v2"
                             "schematic"
                             )

;----------------------------------------------------------------
; Formal parameters
;----------------------------------------------------------------
(
(multiplier 1)
)

;----------------------------------------------------------------
; Code itself
;----------------------------------------------------------------
let(( cv )

cv = pcCellView

;----------------------------------------------------------------
; open master cell views
;----------------------------------------------------------------
unitCapMaster = dbOpenCellViewByType( "dc_MMBBF_Aug09" "Cunit" "symbol" nil "r" )

;----------------------------------------------------------------
; create the nets
;----------------------------------------------------------------
netPos=dbMakeNet(cv "pos")
netNeg=dbMakeNet(cv "neg")
netGnd=dbMakeNet(cv "gnd!")    ;How to make this net inherited?

;----------------------------------------------------------------
; create the terminals
;----------------------------------------------------------------
dbCreateTerm(netPos netPos~>name "inputOutput")
dbCreateTerm(netNeg netNeg~>name "inputOutput")

;----------------------------------------------------------------
; create the instances of mimCaps
;----------------------------------------------------------------
unitCapID=nil
for( i 0 multiplier-1
unitCapID = cons(
                    dbCreateInst(
                                     cv
                                      unitCapMaster
                                      sprintf( nil "I%d" i)     
                                    0:i
                                    "R0"
                                    multiplier-1
                    );dbCreateParamInst
                    unitCapID
                    )
);for

;----------------------------------------------------------------
; Connect it up
;----------------------------------------------------------------
for( i 0 multiplier-1
dbCreateConnByName(netPos nth(multiplier-1-i unitCapID) "sw")
dbCreateConnByName(netNeg nth(multiplier-1-i unitCapID) "bot")
dbCreateConnByName(netGnd nth(multiplier-1-i unitCapID) "c0")
dbCreateConnByName(netGnd nth(multiplier-1-i unitCapID) "c1")
dbCreateConnByName(netGnd nth(multiplier-1-i unitCapID) "c2")
dbCreateConnByName(netGnd nth(multiplier-1-i unitCapID) "c3")    
dbCreateConnByName(netGnd nth(multiplier-1-i unitCapID) "c4")
);for

;----------------------------------------------------------------
; Make the connectivity look up to date - not always needed, but
; Assura needs this, for example.
;----------------------------------------------------------------
dbDisablePropTimeStamp()
dbReplaceProp(cv "lastSchematicExtraction" "time" getCurrentTime())

dbClose( unitCapMaster )
t
) ; let
)
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 "multiplier"
     ?prompt "Multiplier"
     ?defValue 1
     ?type "int"
 )

;;; Simulator Information
cdfId->simInfo = list( nil )
cdfId->simInfo->UltraSim = '( nil )
cdfId->simInfo->ams = '( nil )
cdfId->simInfo->auCdl = '( nil )
cdfId->simInfo->auLvs = '( nil )
cdfId->simInfo->cdsSpice = '( nil )
cdfId->simInfo->hspiceD = '( nil )
cdfId->simInfo->hspiceS = '( nil )
cdfId->simInfo->spectre = '( nil )
cdfId->simInfo->spectreS = '( nil )

;;; Properties
cdfId->formInitProc = ""
cdfId->doneProc = ""
cdfId->buttonFieldWidth = 340
cdfId->fieldHeight = 35
cdfId->fieldWidth = 350
cdfId->promptWidth = 175
cdfId->paramLabelSet = "buswidth busvalue"
cdfId->paramDisplayMode = "parameter"
cdfSaveCDF( cdfId )
) ; let
) ; let


/*********************** END OF CODE *********************/

This works when I instantiate the PCell and I pass directly the number

I also tought to replace the CDF definition with this, it should be the correct vay to do that:

  ;;; Parameters
 cdfCreateParam( cdfId
     ?name "multiplier"
     ?prompt "Multiplier"
     ?defValue "string"
     ?type "1"
     ?parseAsNumber "yes"
     ?parseAsCEL "yes"
 )

It doesn't give errors in compilation but it doesn't work either. The default value is taken and the paramerer i pass is ignored.

Please I need help because my project got stuck! 

Thank you.

Dario.

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 15 years ago

    Hi Dario,

    The comments your code look rather familiar ;-)

    Anyway, if you're going to make the CDF parameter a string, you would need to change your pcell code to something like this:

    ;----------------------------------------------------------------
    ; Formal parameters
    ;----------------------------------------------------------------
    (
    (multiplier "1")
    )

    and then inside the code do:

    multiplier=atoi(multiplier)

    or even

    multiplier=round(cdfParseFloatString(multiplier))

    Note this is a very quick answer - I didn't really check it...

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • DarioETH
    DarioETH over 15 years ago

     Hi Andrew,

    That's a modification of one of your examples :-), I already tried also the solution you mentioned but still doesn't work.

    In addition I tried to parse the input using these functions:

    env=aelEnvCreate('f)

    interpMult=aelEnvInterpret(env multiplier)

     multiplier=fix(cdfParseFloatString(interpMult))

    By doing that I can introduce in the CDF field of the instantiated PCell a formula which contains only numbers, but when I put a variable name i.e.: "submasterMult" (defined in the CIW),  it fails because the aelEnvInterpret() function does not recognize "submasterMult" as a global variable.

    Thank you for the quick reply you gave me.

     Regards,

    Dario.

      

     

    • 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