• 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. Accessing certain layer and get its ll and ur coordinat...

Stats

  • Locked Locked
  • Replies 9
  • Subscribers 143
  • Views 16983
  • 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

Accessing certain layer and get its ll and ur coordinates

Inas Mohammed
Inas Mohammed over 9 years ago

Hello,

I have a pattern of transistor has DRC errors for some spacings between successive rows. These errors will be solved if i add rectangles for these layer. so instead of adding the same layer several times in the middle, i thought to add it only once with dimension of this layer in the whole pattern, like the NW layer specially they all share the same NW.

So what i thought about is:

1) Grouping the instances.

2) Accessing the needed layer.

3) Get its ll and ur coordinates.

4)Create rect with this layer and list of gotten points.

5)ungroup them again.

So i need a skill script does this sort of function.

Thanks

Regards, 

  • Cancel
  • Inas Mohammed
    Inas Mohammed over 9 years ago
    I read old threads about this topic specially how to access a layer without flattening and i found:

    lpId = car(setof(lp geGetEditCellView()~>lpps lp~>layerName == "metal1" && lp~>purpose == "drawing"))
    lpId~>shapes~>bBox

    But after getting the layer ID and search for its bBox it gives me nil.

    So please i need your help for a skill script perform the tasks in the first thread without flattening which are:
    1) Grouping the instances.

    2) Accessing the needed layer.

    3) Get its ll and ur coordinates.

    4)Create rect with this layer and list of gotten points.

    5)ungroup them again.

    Thanks in advance
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • RK56
    RK56 over 9 years ago

    Hi Inas Mohammad,

    I believe geGetEditCellView()~>lpp will return shapes's lpp which are used in that cell view alone and not hierarchically. That's why you may be getting nil return. To get hierarchical shape information you can use leSearchHierarchy or dbGetOverlaps

    Instead you may try the following

    1. Try using already available Layer generation script.

    2. Or you can write using rteGeom* functions.

    Thanks

    Ramakrishnan

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

    Actually the ~>lpp attribute on a cellView will list all the layer purpose pairs used in the hierarchy (provided the lower level cellViews are loaded in memory). However, the ~>lpp~>shapes will only give the shapes in the current cellView, as Ramakrishnan said. So you may find some lpp objects have no shapes, because the layer purpose is used in a lower level cellView, but there's nothing in the top level.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • RK56
    RK56 over 9 years ago
    Thanks for the correction.
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Inas Mohammed
    Inas Mohammed over 9 years ago

    ok i tried the leSearchHierarchy for a single transistor and it gives me 2 bBox values for the 2 PP layers used.

    But when i applied this to a pattern of transistor it gives me many bBox values but all are for the 1st transistor in the lower left corner.

    what i want is to get the most ll and most ur PP bBox for the whole boundary to be able to draw a PP rectangle to solve the in between spacing DRC error.

    Can you help me achieving this goal in a pattern shown blow know that i need the size of the PP rectangle changes with changing the pattern size?

    So i need a script the gets the bBox of the PP layer then draw a rectangle of this information a pattern

    Hope you get my point.

    Thanks

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

    Your requirements are a bit imprecise, so I'll provide some code which illustrates the principle. If you have a list of instances and a named layer purpose pair, you can use this code:

    /******************************************************************
    *                                                                 *
    *             CCFfindLayerExtentFromInsts(insts lpp)              *
    *                                                                 *
    * Find the overall bounding box of a specified layer-purpose-pair *
    *                   across a list of instances.                   *
    *                                                                 *
    ******************************************************************/
    procedure(CCFfindLayerExtentFromInsts(insts lpp)
        let((minLLX minLLY maxURX maxURY)
            foreach(inst insts
                ;------------------------------------------------------------
                ; Find the matching layer purpose and get the shapes on that
                ; layer purpose
                ;------------------------------------------------------------
                shapes=car(exists(LP inst~>master~>lpps 
                    LP~>layerName==car(lpp) && LP~>purpose==cadr(lpp)))~>shapes
                ;------------------------------------------------------------
                ; For each shape, transform the bounding box up to the parent
                ; cellView's coordinate system, and pull apart the coordinates,
                ; comparing them against the min/max found so far
                ;------------------------------------------------------------
                foreach(shape shapes
                    destructuringBind(((llx lly) (urx ury)) 
                        dbTransformBBox(shape~>bBox inst~>transform)
                        minLLX=if(minLLX min(minLLX llx) llx)
                        minLLY=if(minLLY min(minLLY lly) lly)
                        maxURX=if(maxURX max(maxURX urx) urx)
                        maxURY=if(maxURY max(maxURY ury) ury)
                    )
                )
            )
            when(minLLX
                list(minLLX:minLLY maxURX:maxURY)
            )
        )
    )
    

    You'd just (say) select the instances (to experiment with) and then do:

    CCFfindLayerExtentFromInsts(geGetSelSet() list("PP" "drawing"))

    This will return the overall bBox of that layer purpose pair in the list of selected instances. You could use this return value to pass to dbCreateRect to create the rectangle in the same region.

    Regards,

    Andrew.

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

    Thanks for your reply.

    I did something like the following part in the whole code for accessing a layer at the corner transistors of the patter & i highlighted the parts i added in red and the whole new procedure i added in yellow. But when i run the code it gives me and invalid point at the dbTransformPoint command line. Would you please tell me why i'm getting this error? when i tried the steps individually in the CIW it worked.

    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) llInst urInst)

    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]
    ;println(dev)
    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)
    )
    )

    when(row==0 && col==0
    llInst=inst
    )
    when(row==nRows-1 && col==nCols-1
    urInst=inst
    )

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

    add_layer(geGetEditCellView() llInst urInst "NW" "drawing")
    add_layer(geGetEditCellView() llInst urInst "PP" "drawing")
    dbSave(geGetEditCellView())
    geAskOverwriteMode(geGetEditCellView())
    )) ; let ; procedure

    procedure(add_layer(cellView llInst urInst Name purp)
    let((lpp ll ur)
    lpp = car(exists(x llInst->master->lpps (x->layerName == layerName && x->purpose == purpose)))
    ll = car(car(lpp->shapes)->bBox)
    ll = dbTransformPoint(ll llInst->transform)
    lpp = car(exists(x urInst->master->lpps (x->layerName == layerName && x->purpose == purpose)))
    ur = cadr(car(lpp->shapes)->bBox)
    ur = dbTransformPoint(ur urInst->transform)
    dbCreateRect(cellView list(layerName purpose) list(ll ur))
    )) ; let ; procedure

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

    I suggest you try:

    trace(add_layer dbTransformPoint)

    to see what arguments are being passed to add_layer and then dbTransformPoint before it fails. Or use the debugger in the IDE... you can look at the variables at the point it errors, or you could put breakpoints beforehand to see what's going on. Maybe llInst and/or urInst are nil?

    Trying to guess what's wrong from badly formatted code with no test data is not particularly efficient.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Inas Mohammed
    Inas Mohammed over 9 years ago
    Thanks
    • 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