Schematic pcell for a wire force cell

Guest
Hi,

I picked up the dynamic switch schematic pcell symbol again in order to

see if I could turn it into a wire setting cell. I have two
possibilities: Either the wire is set to "1" or it is set to "0" and
this is depicted by the symbol having either a 1 or a 0 label. When
netlisting, the symbol should be replaced with VDD or VSS respectively
so that I don't need to use so many independent voltage sources
connected to buses.

So far I can't find out how to get this replacement happening. I have
tried to create a schematic for the symbol but I don't get it to switch

to schematic0 when using symbol0 and to schematic1 when using symbol1

Here is the code I have so far:
The cellView is "setting" in library "wk_bjerkem"

(pcDefinePCell
; target cellView
(list (ddGetObj "wk_bjerkem") "setting" "symbol" "schematicSymbol")

; formal parameters
((position "0"))

; code itself
(let (instId master)
(setq viewName
(case position
("0" "symbol0")
("1" "symbol1")
(t "symbol1")))
(setq master (dbOpenCellViewByType "wk_bjerkem" "setting"
viewName))
(setq instId (dbCreateInst pcCellView master "" 0:0 "R0"))

; Copy the instance box - this vanishes during the flatten
(foreach shape car(
exists( lpp master~>lpps lpp~>layerName=="instance" ))~>shapes
(dbCopyFig shape pcCellView))
; flatten the instance, preserving the pins
(dbFlattenInst instId 1 t t)))

--
Svenn
 
On 6 Dec 2005 00:15:52 -0800, svenn.are@bjerkem.de wrote:

Hi,

I picked up the dynamic switch schematic pcell symbol again in order to

see if I could turn it into a wire setting cell. I have two
possibilities: Either the wire is set to "1" or it is set to "0" and
this is depicted by the symbol having either a 1 or a 0 label. When
netlisting, the symbol should be replaced with VDD or VSS respectively
so that I don't need to use so many independent voltage sources
connected to buses.

So far I can't find out how to get this replacement happening. I have
tried to create a schematic for the symbol but I don't get it to switch

to schematic0 when using symbol0 and to schematic1 when using symbol1

Here is the code I have so far:
The cellView is "setting" in library "wk_bjerkem"

(pcDefinePCell
; target cellView
(list (ddGetObj "wk_bjerkem") "setting" "symbol" "schematicSymbol")

; formal parameters
((position "0"))

; code itself
(let (instId master)
(setq viewName
(case position
("0" "symbol0")
("1" "symbol1")
(t "symbol1")))
(setq master (dbOpenCellViewByType "wk_bjerkem" "setting"
viewName))
(setq instId (dbCreateInst pcCellView master "" 0:0 "R0"))

; Copy the instance box - this vanishes during the flatten
(foreach shape car(
exists( lpp master~>lpps lpp~>layerName=="instance" ))~>shapes
(dbCopyFig shape pcCellView))
; flatten the instance, preserving the pins
(dbFlattenInst instId 1 t t)))

Not sure if this is exactly what you want, but you may find the following
useful:

/* busset.il

Author A.D.Beckett
Group Custom IC, Cadence Design Systems Ltd.
Machine SUN
Date Jul 11, 2004
Modified
By

SKILL code for creating the "busset" pcell schematic, symbol,
and the CDF as well.

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

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

*/

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

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

;----------------------------------------------------------------
; Formal parameters
;----------------------------------------------------------------
(
(buswidth 6)
(busvalue 0)
)

;----------------------------------------------------------------
; Code itself
;----------------------------------------------------------------
let(( cv master instId netH netL
busOut driveName driveNet)

cv = pcCellView
;----------------------------------------------------------------
; Convert parameters, and figure out drive net name
;----------------------------------------------------------------
when(buswidth<1 buswidth=1)
for(bit 0 buswidth-1
if(driveName then
driveName=strcat("," driveName)
else
driveName=""
) ; if
driveName=strcat(
if(busvalue<bit>==1 "hi" "lo")
driveName
)
) ; for

;----------------------------------------------------------------
; open master cell view
;----------------------------------------------------------------
master = dbOpenCellViewByType( "basic" "cds_thru" "symbol" nil "r" )
;----------------------------------------------------------------
; create the nets
;----------------------------------------------------------------
netH=dbMakeNet(cv "hi")
netL=dbMakeNet(cv "lo")
busOut=dbMakeNet(cv sprintf(nil "bus<%d:0>" buswidth-1))
driveNet=dbMakeNet(cv driveName)
;----------------------------------------------------------------
; create the terminals
;----------------------------------------------------------------
dbCreateTerm(netH netH~>name "inputOutput")
dbCreateTerm(netL netL~>name "inputOutput")
dbCreateTerm(busOut busOut~>name "inputOutput")
;----------------------------------------------------------------
; create the instance of cds_thru
;----------------------------------------------------------------
instId =
dbCreateInst(
cv master sprintf(nil "thru<%d:0>" buswidth-1)
0:0 "R0"
)
;----------------------------------------------------------------
; Connect it up
;----------------------------------------------------------------
dbCreateConnByName(busOut instId "dst");
dbCreateConnByName(driveNet instId "src");

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

dbClose( master )
t
) ; let
)
dbSave(pcellId)
dbClose(pcellId)

;--------------------------------------------------------------------
; Now the symbol
;--------------------------------------------------------------------
pcellId=pcDefinePCell(
list(ddGetObj(library) cell "symbol" "schematicSymbol")

;----------------------------------------------------------------
; Formal parameters
;----------------------------------------------------------------
(
(buswidth 6)
(busvalue 0)
)

;----------------------------------------------------------------
; Code itself
;----------------------------------------------------------------
let(( cv netH netL
busOut figH figL figBus hp ps pl bw lh
pxc label)

cv = pcCellView

;----------------------------------------------------------------
; Various dimensions
;----------------------------------------------------------------
; half pin size
hp=0.025
; pin spacing
ps=0.125
; pin length
pl=0.250
; box width
bw=1.4375
; label height
lh=0.0625
; param label x coord
pxc=0.5

;----------------------------------------------------------------
; create the shapes - first the pins
;----------------------------------------------------------------
figH = dbCreateRect(cv list("pin" "drawing") list(-hp:-hp hp:hp))
dbCreateLine(cv list("device" "drawing") list(0:0 pl:0))
figL = dbCreateRect(cv list("pin" "drawing") list(-hp:ps-hp hp:ps+hp))
dbCreateLine(cv list("device" "drawing") list(0:ps pl:ps))
figBus = dbCreateRect(cv list("pin" "drawing")
list(2*pl+bw-hp:-hp 2*pl+bw+hp:hp)
) ; dbCreateRect
dbCreateLine(cv list("device" "drawing") list(pl+bw:0 2*pl+bw:0))
;----------------------------------------------------------------
; Then the boxes
;----------------------------------------------------------------
dbCreateRect(cv list("device" "drawing") list(pl:-2*ps pl+bw:ps))
dbCreateRect(cv list("instance" "drawing") list(0:-2*ps 2*pl+bw:ps))

;----------------------------------------------------------------
; create the nets
;----------------------------------------------------------------
netH=dbMakeNet(cv "hi")
netL=dbMakeNet(cv "lo")
busOut=dbMakeNet(cv sprintf(nil "bus<%d:0>" buswidth-1))
;----------------------------------------------------------------
; create the terminals
;----------------------------------------------------------------
dbCreateTerm(netH netH~>name "inputOutput")
dbCreateTerm(netL netL~>name "inputOutput")
dbCreateTerm(busOut busOut~>name "inputOutput")
;----------------------------------------------------------------
; create the pins
;----------------------------------------------------------------
dbCreatePin(netH figH)
dbCreatePin(netL figL)
dbCreatePin(busOut figBus)

;----------------------------------------------------------------
; Put some labels for the pins
;----------------------------------------------------------------
dbCreateLabel(cv list("pin" "drawing") pl+ps/2:0
netH~>name "centerLeft" "R0" "stick" lh)
dbCreateLabel(cv list("pin" "drawing") pl+ps/2:ps
netL~>name "centerLeft" "R0" "stick" lh)
dbCreateLabel(cv list("pin" "drawing") bw+pl-ps/2:0
busOut~>name "centerRight" "R0" "stick" lh)

;----------------------------------------------------------------
; And other symbol labels
;----------------------------------------------------------------
label=dbCreateLabel(cv list("annotate" "drawing7") bw+pl-ps/2:ps*1.5
"cdsName()" "centerRight" "R0" "stick" lh)
label~>labelType="ILLabel"
label=dbCreateLabel(cv list("annotate" "drawing") pxc:0
"cdsParam(1)" "centerLeft" "R0" "stick" lh)
label~>labelType="ILLabel"
label=dbCreateLabel(cv list("annotate" "drawing") pxc:ps
"cdsParam(2)" "centerLeft" "R0" "stick" lh)
label~>labelType="ILLabel"

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 "buswidth"
?prompt "Bus Width"
?defValue 6
?type "int"
?display "t"
)
cdfCreateParam( cdfId
?name "busvalue"
?prompt "Bus Value"
?defValue 0
?type "int"
?display "t"
)

;;; 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 *********************/


Hey, it's even written in C-like syntax because I was illustrating something to
somebody... and wanted them to be able to understand it.

Andrew.
 
Extremely useful, Andrew, extremely useful. Explains a lot about
creating a pcell schematic element. I have found very little discussion
about pcell elements for schematic capture in the documentation. This
one should have been one of the examples.

--
Svenn
 
On 9 Dec 2005 03:42:39 -0800, svenn.are@bjerkem.de wrote:

Extremely useful, Andrew, extremely useful. Explains a lot about
creating a pcell schematic element. I have found very little discussion
about pcell elements for schematic capture in the documentation. This
one should have been one of the examples.
Whilst schematic pcells have been possible in concept for many years, the
trouble was that they wouldn't netlist properly until IC50 - when specific
support for them was added in OSS. That's probably why the documentation is a
bit light on them...

Note, the previous example has to be created in an executable such as msfb or
icfb which supports layout as well as schematic capture (layoutPlus would be OK
too), since pcDefinePCell only exists in layout-enabled executables.

I think I should at the very least put this as a solution on Sourcelink. When I
have a moment, I'll do that...

Regards,

Andrew.
 
When I instansiate the busset, the netlister creates a new subckt
called busset_pcell<number> where the number is a number to make the
subckt unique. I think this is ok for a busset entity.

I modified the busset to a pinset by using a resistor instead of the
cds_thru and then tying the plus pin to the busPin and VDD! or VSS! to
the minus pin of the resistor. Now I get a separate
pinset_pcell<number> for every instance even if I only need two, one
for set to vdd and one for set to VSS. Another problem is that I don't
manage to connect to those global nets. I tried with "VDD!" and "\VDD!
" but they are translated to _net0 by the netlister. Something I do
wrong.

Regarding the netlisting I have problem with the in-house netlister not
recognizing the pcells yet. I have to open a support case with our CAD
people, I think ...

--
Svenn
 

Welcome to EDABoard.com

Sponsor

Back
Top