• 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. General about skill scripting

Stats

  • Locked Locked
  • Replies 5
  • Subscribers 143
  • Views 14095
  • 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

General about skill scripting

Inas Mohammed
Inas Mohammed over 8 years ago

I'm using an if condition for gate routing positioning. The code runs without error but the gates are not placed. so please can you tell me why is this happening? you can find it highlighted in yellow

procedure(place_devices(cellView devLib devCell Length nfunit wfunit DUM1nf DUM1wf DUM2nf DUM2wf yPitch pattern)
let((params array nRows nCols Type dev name nf wf inst devCounts x y xPitch (x0 0.0) (y0 0.0))

devCounts=makeTable('DEVCOUNT 0)
array = listToVector(foreach(mapcar row reverse(pattern) listToVector(parseString(row " "))))
nRows=length(pattern)
y=y0
for(row 0 nRows-1
x=x0
nCols=length(array[row])
for(col 0 nCols-1
dev=array[row][col]
devCounts[dev]++
name=sprintf(nil "%s.%d" dev devCounts[dev])
Type=cond(
(eq('M getchar(array[row][col] 1)) 'device)
(zerop(row) && (zerop(col) || (col == nCols-1)) 'corner)
(zerop(col) && (zerop(row) || (row == nRows-1)) 'corner)
(zerop(row) || (row == nRows-1) 'topBottom)
(zerop(col) || (col == nCols-1) 'leftRight)
(t 'dummy)
)
caseq(Type
((device dummy)
nf=nfunit
wf=wfunit
)

(corner
nf=DUM1nf
wf=DUM2wf
)

(topBottom
nf=DUM2nf
wf=DUM2wf
)

(leftRight
nf=DUM1nf
wf=DUM1wf
)

(t error("type=%l\n" Type)
)
)

params = list(
list("l" "string" aelSuffixNotation(1u * Length))
list("w" "string" aelSuffixNotation(1u * wf))
list("fingers" "string" sprintf(nil "%d" nf))
if(oddp(row)
then
list("routePolydir" "string" "Bottom")
list("polyContacts" "string" "True")
else
list("routePolydir" "string" "Top")
list("polyContacts" "string" "True")
)
) ; params

when(zerop(col)
; Device is on left edge. Add detached bodytie.
params = xcons(params
list("bodytie_type" "string" "Detached"))
)

when(col == nCols-1
; Device is on right edge. Add detached bodytie.
params = xcons(params
list("bodytie_typeR" "string" "Detached"))
)

inst=dbCreateParamInstByMasterName(cellView devLib devCell "layout" name x:y "R0" 1 params)
xPitch = (nf * Length) + (nf * 0.2)

;; TODO: Replace numbers with space/extension params
;; Or, use rodGetObj and/or M1 geometry of the
;; inst->master cellView to calculate the xPitch
;; of the instantiated device

;; Calculate x coordinate for next device
x = x + xPitch

)
y = y + yPitch
)
dbSave(geGetEditCellView())

)) ; let ; procedure

place_devices(
geGetEditCellView() ; cellView
"tsmcN65" ; devLib
"pch" ; devCell
0.2 ; Length (um)
4 ; nfunit
3.0 ; wfunit (um)
4 ; DUM1nf
3.0 ; DUM1wf (um)
4 ; DUM2nf
3.0 ; DUM2wf (um)
3.78 ; yPitch (um)
list(
"Du Du Du Du Du"
"Du M1 M2 M1 Du"
"Du M2 M1 M2 Du"
"Du Du Du Du Du"
); pattern (rows)
)

Thanks

Regards

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 8 years ago

    Note it's very hard to debug code (which I can't run, because I don't have any of the data) if it is so poorly formatted - there is no indentation in the code which makes it very hard to read.

    When you say "the gates are not placed" - do you mean that the poly isn't routed on the devices? That's what I'd expect from the code you've posted. In the list of parameters, the if(oddp(row)... part will only return the final list in each of the then and else parts, and so you'd never have routePolyDir set at all. This is the kind of thing where printing out the value of params as a debug statement after setting it would have revealed the problem - a basic debugging technique in any language.

    I'd probably write it this way:

    params = list(
      list("l" "string" aelSuffixNotation(1u * Length))
      list("w" "string" aelSuffixNotation(1u * wf))
      list("fingers" "string" sprintf(nil "%d" nf))
      list("routePolydir" "string" if(oddp(row) "Bottom" "Top"))
      list("polyContacts" "string" "True")
    ) ; params

    I've no idea whether there's anything else wrong in the code - I just focused on the highlighted part (since you highlighted it).

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Inas Mohammed
    Inas Mohammed over 8 years ago

    Can you please tell me how can i print out the output in any part in the code to be able to know the issue and debug it?

    Thanks

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 8 years ago

    I'm guessing that if you're asking this, you didn't write the code. I suggest reading the SKILL Language User Guide (it's like a book you might get in a bookshop on a language you're unfamiliar with, and is a great starting point).

    You'd print something either using println(params) - the println function can do a simple unformatted print of a single variable - or using the more powerful C-like printf() function. Or you could use pprint(params) if you want to pretty-print a list of values in a slightly more readable form (println will print it all on a single line).

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Inas Mohammed
    Inas Mohammed over 8 years ago
    i was thinking that you to do something in the IDE like what is called breakpoints or something.
    I know these functions you mentioned but as i'm a beginner i didn't know that this can be used for another purpose like the debugging. i thought only they are used if only intended in the code to display something.

    Anyhow i'm opening all the manuals that i can make use inside cadence plus asking here.

    Again i'm a beginner self learning with skill not a professional like you. So please be patient.
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 8 years ago

    You can of course set breakpoints in the SKILL IDE. Click to the left of the line of code to do this (or use the menus). More can be found in the documentation for the SKILL IDE.

    Regards,

    Andrew.

    • 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