回复 4# ygyg100
这个是我写的 rm4 的symbol的代码哦.
;;; define the symbol of rm4 pcellId=pcDefinePCell(
list(ddGetObj("test_sj") "rm4" "symbol" "schematicSymbol")
;----------------------------------------------------------------
; Formal parameters
;----------------------------------------------------------------
(
(buswidth 6)
(busvalue 0)
)
let(( cv
figH figL
hp ps pl bw lh
pxc plus minus)
cv = pcCellView
;----------------------------------------------------------------
; Various dimensions
;----------------------------------------------------------------
; half pin size
hp=0.025
; pin spacing
ps=0.125
; pin length
pl=0.05
;0.250
; box width
bw=0.3
;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))
figL = dbCreateRect(cv list("pin" "drawing") list(2*pl+bw-hp:-hp 2*pl+bw+hp:hp) )
;----------------------------------------------------------------
; create the Lines
;----------------------------------------------------------------
dbCreateLine(cv list("device" "drawing") list(0:0 pl:0))
dbCreateLine(cv list("device" "drawing") list(pl:0 2*pl:2*pl))
dbCreateLine(cv list("device" "drawing") list(2*pl:2*pl 3*pl:-2*pl))
dbCreateLine(cv list("device" "drawing") list(3*pl:-2*pl 5*pl:2*pl))
dbCreateLine(cv list("device" "drawing") list(5*pl:2*pl 6*pl:-2*pl))
dbCreateLine(cv list("device" "drawing") list(6*pl:-2*pl 7*pl:0))
dbCreateLine(cv list("device" "drawing") list(pl+bw:0 2*pl+bw:0))
;---------------------------------------------------------------
; Then the boxes
;----------------------------------------------------------------
dbCreateRect(cv list("instance" "drawing") list(0:-1*ps 2*pl+bw:ps))
;---------------------------------------------------------------
; creat the nets
;----------------------------------------------------------------
plus=dbMakeNet(cv "plus")
minus=dbMakeNet(cv "minus")
;---------------------------------------------------------------
; creat the terminals
;----------------------------------------------------------------
dbCreateTerm(plus plus~>name "inputOutput")
dbCreateTerm(minus minus~>name "inputOutput")
;---------------------------------------------------------------
; creat the pins
;----------------------------------------------------------------
dbCreatePin(plus figH)
dbCreatePin(minus figL)
;----------------------------------------------------------------
; Put some labels
;----------------------------------------------------------------
label=dbCreateLabel(cv list("annotate" "drawing")
0.4:0.2
"cdsParam(3)" "centerRight" "R0" "stick" lh)
label~>labelType="ILLabel"
label=dbCreateLabel(cv list("annotate" "drawing")
0.4:0.3
"cdsParam(2)" "centerRight" "R0" "stick" lh)
label~>labelType="ILLabel"
label=dbCreateLabel(cv list("annotate" "drawing")
0.4:0.4
"cdsParam(1)" "centerRight" "R0" "stick" lh)
label~>labelType="ILLabel"
)
) ; let
dbSave(pcellId)
dbClose(pcellId)
|