Product Documentation
Virtuoso Parameterized Cell SKILL Reference
Product Version IC23.1, August 2023

pcDefinePPCell

pcDefinePPCell(
l_cellIdentifier
l_overrideCodeParams
l_defaultCodeParams
ls_formalArgs
body_of_code
) 
=> d_cellViewId / nil

Description

Creates a parameterized Pcell master cellview (P2cell) that enables you to pass the SKILL definition for a Pcell, including a list of its arguments, similar to the pcDefinePCell function. This function also accepts a code argument declaration list and a code argument override list, where the code parameter can be used in the Pcell code body to create multiple Pcell super masters from a single Pcell code. Within pcDefinePPCell, the override code parameter is always a simple variable, which receives the input provided by the caller of pcDefinePPCell. This will always be the use model of P2cell because there is always a driver function that calls it. The function should not be used as a top-level function (not inside a procedure) because that will lose the purpose of the new parameterization feature.

Arguments

l_cellIdentifier

A list that contains the library database ID, cell name, view name, and view type. View type is optional and defaults to maskLayout.
Valid view type values: maskLayout, schematic, schematicSymbol

l_overrideCodeParams

A SKILL list in the DPL format. Each parameter within the DPL is represented by a pair of s_codeParamName and g_codeParamValue. Only the value can be a SKILL expression.

Syntax:

list( nil S_codeParamName g_codeParamValue ... )

Example:

list( nil 'param1 "value1" 'param2 t 'param3 width*3 )

  • S_codeParamName: A symbol or a string of the name of code parameter. It needs to match a declared code parameter name. A warning is issued for a mismatched name and the default value is used instead.
  • g_codeParamValue: A SKILL expression that evaluates the given value to obtain the value of each code parameter. Within the pcDefinePPCell function, the override code argument is always a simple variable that receives the input provided by the caller of pcDefinePPCell.
The caller of pcDefinePPCell can construct the value of a code parameter using any method as long as the format of the result specified by the override code parameter is in the DPL format. This helps you to assign and update the values. It is expected this will be modified later to generate multiple Pcell super masters from one P2cell definition.

l_defaultCodeParams

A list that contains one or many code parameter specification. Each code parameter specification is defined in the following format:

(S_codeParamName [S_codeParamType] g_codeParamValue)

  • S_codeParamName: A symbol or a string of the name of code parameter. It needs to match a declared code parameter name. A warning is issued for a mismatched name and the default value is used instead.
  • S_codeParamType: A string or a symbol defining the value type of the code parameter.
Valid values: Boolean, int, float, string, and ilList. It is optional to include the code parameter type except for Boolean. For Boolean code parameter, you must specify the data type to avoid ambiguity against the ilList type.
  • g_codeParamValue: A SKILL expression that evaluates the given value to obtain the value of each code parameter. Within the pcDefinePPCell function, the override code argument is always a simple variable that receives the input provided by the caller of pcDefinePPCell.
The caller of pcDefinePPCell can construct the value of a code parameter using any method as long as the format of the result specified by the override code parameter is in the DPL format. This helps you to assign and update the values. It is expected this will be modified later to generate multiple Pcell super masters from one P2cell definition.

The declared code parameter is in a simple list format. This format is consistent with the declaration of Pcell parameters used by pcDefinePCell.

This declaration cannot contain another SKILL expression inside it.

Like the override code parameter, the entire declaration itself can be defined outside pcDefinePPCell, but it hides the declaration from the Pcell code and is therefore not recommended.

ls_formalArgs

A list of parameters defining a Pcell parameter set. There are the following two ways to define the Pcell parameter set.

  • Define a Pcell parameter through an explicit list of parameters, same style as the pcDefinePCell function.
  • Call a user-defined function, which returns a Pcell parameter set. When P2cell parser detects the Pcell parameters by calling a user-defined function, Parser executes the user function and pass the newly created super master ID as its argument.

body_of_code

SKILL code for creating geometries and pins. You must provide code here. Enclose the code in a let or prog statement. If you use variables in the code, define them at the beginning of the let or prog statement. Using let gives faster performance than prog; prog allows multiple exits while let exits only at its end. Optionally, from within this code, you can call SKILL functions, application functions, and your own user-defined functions.

Calls to functions from within the body_of_code section are part of the Pcell, but the functions themselves are not part of the Pcell. These functions must be available each time the Pcell is evaluated. If a called function is not available when a Pcell is evaluated, the Pcell fails.

If you want the system to automatically load functions when it opens your library, include the functions in your libInit.il file. Do not load a file from within a Pcell.

You can access the name and value of any code parameter using pcGetCodeParamNames and pcGetCodeParamValue functions.

Value Returned

d_cellViewId

The cellview ID of the parameterized super master if the Pcell is successfully compiled.

nil

If the parameterized super master cellview is not created.

Examples

procedure( createPmos(xVal)
    let((libName cellName ppcDef overrideCodeParams )
     ; Setup library and cell name, and the override code parameter 
; values
libName = "PcellDemo"
cellName = "pmos"
overrideCodeParams = list( nil
'layerName "Via2" 'rectWidth 3*xVal 'createGate t)
     ; Calls myMakeMos to create one Pcell super master
myMakeMos( libName cellName "layout" "maskLayout"
overrideCodeParams)
  ; Update the cell name and one of the override code parameter value
cellName = "pmos_ng"
overrideCodeParams->createGate = nil
  ; Calls myMakeMos to create another Pcell super master
myMakeMos( libName cellName "layout" "maskLayout"
overrideCodeParams)
)
)
procedure( myMakeMos(libName cellName viewName viewType @optional
     (overrideCPs nil))
let((smId)
; Use pcDefinePPCell to create a Pcell that accepts code parameters
smId = pcDefinePPCell(
; Define super master's identification
list(ddGetObj(libName) cellName viewName viewType )
   ; Define variable to accept override code parameters 
overrideCPs
     ; Define code parameters
( ( layerName string "Metal")
( rectWidth float 1.0 )
( createGate boolean nil )
)
   ; Define Pcell parameters
( (dd1 "none" )
(sd1 "none" )
(w 5.0)
(l 1.0)
(fingers 1 )
)
   ; Define Pcell code
let( (cv rect rectW createGate)
cv = pcCellView
sd1 = cv~>parameters~>sd1
dd1 = cv~>parameters~>dd1
w = aelNumber(cv~>parameters~>w)
l = aelNumber(cv~>parameters~>l)
fingers = cv~>parameters~>fingers

; Leverage code parameter to create different
; contents for a Pcell super master
createGate = pcGetCodeParamValue(cv "createGate")
when( createGate
layerName = pcGetCodeParamValue(cv "layerName")
rectW = pcGetCodeParamValue(cv "rectWidth")
rect = dbCreateRect(cv
list(layerName "drawing")
list( 2:2 3:2+round(rectW))))
)
)
smId
)
)

This example develops multiple Pcell super masters by using the P2cell method.

Related Topics

Safety Rules for Creating SKILL Pcells

pcGetCodeParamNames

pcGetCodeParamValue


Return to top
 ⠀
X