Updated 3 min readCadence
Writing Virtuoso PCells in SKILL
How Cadence Virtuoso PCells are written in SKILL: pcDefinePCell, pins, CDF callbacks, PCell Designer, PyCells and regression checks across parameter ranges.
By the SkyCadEda engineering teamHow these notes are written
On this page
A Virtuoso PCell is a layout cell generated by code: you register a SKILL procedure with pcDefinePCell, declare its parameters and defaults, and Virtuoso evaluates the code whenever an instance with a new parameter set is placed. The CDF (Component Description Format) on top of it defines the parameter form designers see, and callbacks keep dependent parameters consistent. Everything else in a PCell library is about making that code safe to run on every parameter combination.
SKILL PCells, PCell Designer, Express PCells and PyCells
The options in a Virtuoso flow are: SKILL PCells; Cadence PCell Designer, a graphical authoring tool inside Virtuoso; Express PCells, a disk cache of evaluated variants that cuts the time to open large designs; and PyCells, the Python format from Ciranova that runs on OpenAccess and is also supported in Synopsys Custom Compiler. PCells in Virtuoso Layout Suite XL are the same PCells: the "XL" names the connectivity-driven layout editor tier, not a PCell type. SkyCadEda builds these generators as part of a broader custom IC automation flow.
A minimal SKILL PCell
The example below draws a poly resistor body with a contact pad and a pin at each end. It is deliberately small: real PDK devices add implant and recognition layers, contact arrays computed from the techfile rules, and dummy options. Layer names are placeholders for whatever your techfile defines.
; res_poly.il -- load once with the library writable
pcDefinePCell(
list(ddGetObj("myLib") "res_poly" "layout")
(
(w float 0.4) ; body width, um
(l float 4.0) ; body length, um
)
let((cv pad netA netB figA figB)
cv = pcCellView
pad = 0.4
; resistor body
dbCreateRect(cv list("poly" "drawing")
list(0:0 l:w))
; terminal pads and pins
figA = dbCreateRect(cv list("metal1" "drawing")
list((-pad):0 0:w))
figB = dbCreateRect(cv list("metal1" "drawing")
list(l:0 (l+pad):w))
netA = dbCreateNet(cv "PLUS")
netB = dbCreateNet(cv "MINUS")
dbCreateTerm(netA "PLUS" "inputOutput")
dbCreateTerm(netB "MINUS" "inputOutput")
dbCreatePin(netA figA "PLUS")
dbCreatePin(netB figB "MINUS")
)
)Two rules catch most first-time PCell authors. The body of pcDefinePCell is stored with the master and re-evaluated later, so any helper procedure it calls must be loadable whenever the library is opened (the usual place is the library's libInit.il). And the code must be deterministic: no reading of environment variables or user files, or two users will get different geometry from the same parameters.
CDF parameters and callbacks
The CDF decides what the designer types into the Add Instance and Edit Properties forms. A callback is a SKILL expression run when a parameter changes; inside it, cdfgData refers to the instance's CDF data. A typical case is keeping a read-only total width in step with finger width and count:
procedure(myResWtotCB()
cdfgData->wtot->value =
cdfgData->w->value * cdfgData->nf->value
)
; registered on the parameter with
; cdfCreateParam(cdfId ?name "nf" ... ?callback "myResWtotCB()")Callbacks only fire from forms. Scripts that set instance parameters directly bypass them, so the PCell code itself must still clamp or reject illegal values instead of trusting the CDF to have done it.
Keep technology data out of the generator
Hard-coded spacings and enclosures are what make PCells painful to port. Read rule values from the technology database (or from one per-process table your library loads) and keep the generator logic generic. When a block moves to a new node, the port is then a table update plus a regression run, not a rewrite of every device. This matters most for IP porting and PDK revisions.
Regression before release
Treat each library release like a software release. A batch script creates a test cellview, places every device at minimum, typical and maximum parameter values (plus the combinations that changed), and then runs DRC and LVS with the project deck in Calibre, Pegasus or PVS. Instances are placed with dbCreateParamInst, which takes the master, a name, an origin, an orientation and a parameter list such as list(list("w" "float" 2.0)). Any DRC result or LVS mismatch on a generated device is a library bug. Keep the test cellviews and the expected results under version control so the next release can be compared against them.
SkyCadEda develops Cadence SKILL automation, PCell libraries, PDK utilities and verification-aware layout generators for semiconductor teams. Our PCell development services page describes how we take on new device libraries and repairs to existing ones.
Frequently asked questions
What is a PCell in Cadence Virtuoso?
A PCell (parameterized cell) is a layout cellview whose geometry is generated by code from parameters such as width, length and finger count. In Virtuoso the code is usually SKILL, registered with pcDefinePCell; each unique parameter set is evaluated into a variant of the PCell master.
What kinds of PCells can Virtuoso use?
SKILL PCells (pcDefinePCell), PCells built graphically with Cadence PCell Designer, and PyCells, the Python-based format that came from Ciranova and runs on OpenAccess. Express PCells is not a separate format: it is a cache of evaluated variants that speeds up opening designs.
What is Cadence PCell Designer?
PCell Designer is a visual PCell authoring environment that runs inside Virtuoso Layout Suite. You build the generator from graphical operations and parameters instead of writing all the SKILL by hand; the result is still a Virtuoso PCell.
What should a production PCell library include?
Parameters with safe defaults and checked ranges, CDF data with callbacks for dependent values, pins and device recognition layers that match the LVS deck, a regression suite that instantiates edge-case parameter sets and runs DRC and LVS in batch, and versioned release notes.
Related reading
- servicePCell Development Services
- serviceCadence SKILL Scripting Services
- noteCadence SKILL Scripting Guide
- notePDK Setup Guide
More engineering notes
Working through a problem like this?
Tell us about your flow: the tools, the PDK, what is failing and when it needs to be clean.