• 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. how to make the variables and utilize the coordinates.

Stats

  • Replies 7
  • Subscribers 149
  • Views 785
  • Members are here 0

how to make the variables and utilize the coordinates.

Noobnoob
Noobnoob 1 month ago

Hello, i'm sorry for my english skill.

As a title, i wonder how to make variables and count those.

I'm making Layout Skill that count Channel of MOS by using skill language.

For example,

if two MOS that have w = 5um & l = 5um and two MOS that have w = 3um & l = 5um are placed in top level Layout Cellview.

I want to show that number of each MOS that include channel size in CIW.

CIW :

width = 5um & length = 5um, multi = 2ea

width = 3um & length = 5um, multi = 2ea

Presently, i got coordinate of each channel in top level.

But, i have trouble with utilzing coordinates...

How can i make variables by size and count those....?

below, i made a script by using skill language and wonder how to utilize coordinates.

  • Cancel
  • Sign in to reply
Parents
  • Noobnoob
    Noobnoob 1 month ago

    procedure( ExtractLayerDB(value)
    prog( (run)
    run = 1
    while(run == 1
    if(listp(value) == t then
    value = cadr(value)
    else
    value
    run = 0
    );if
    );while
    return(value)
    );prog
    );procedureS

    procedure( TransBBoxToPoint(bBox)
    prog( (x1y1 x2y2 x1y2 x2y1)

    x1y1 = nthelem(1 bBox)
    x2y2 = nthelem(2 bBox)

    x1 = xCoord(x1y1)
    y1 = yCoord(x1y1)
    x2 = xCoord(x2y2)
    y2 = yCoord(x2y2)

    x1y2 = (x1:y2)
    x2y1 = (x2:y1)

    point = list(x1y1 x1y2 x2y2 x2y1)

    return(point)
    );prog
    );procedure

    procedure( TransPointToBBox(point)
    prog( (x1y1 x2y2 result)
    x1y1 = nthelem(1 point)
    x2y2 = nthelem(3 point)

    result = list(x1y1 x2y2)

    return(result)
    );prog
    );procedure

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Andrew Beckett
    Andrew Beckett 1 month ago in reply to Noobnoob

    OK, your code just finds the gate shapes for N or P devices, but I suspect you want to find the actual PCell instances instead? You could process the polygons to try to compute the width and length (assuming they are rectangular, but you've lost the orientation information). Wouldn't traversing the hierarchy to find the instances of particular cells and then looking at their parameters be easier?

    I guess it depends on what you're aiming to do with the results.

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • Andrew Beckett
    Andrew Beckett 1 month ago in reply to Noobnoob

    OK, your code just finds the gate shapes for N or P devices, but I suspect you want to find the actual PCell instances instead? You could process the polygons to try to compute the width and length (assuming they are rectangular, but you've lost the orientation information). Wouldn't traversing the hierarchy to find the instances of particular cells and then looking at their parameters be easier?

    I guess it depends on what you're aiming to do with the results.

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Children
  • Noobnoob
    Noobnoob 30 days ago in reply to Andrew Beckett

    Thank you for reply!

    I have difficulty in understanding your reply because my English skills are not good and i'm junior for my layout job...(2 years)

    But, I am tring to understanding your reply by using Google Translater...!

    as you think, i just finded the coordinates of gate shapes for N or P devices.

    But, I didn't use PCell.

    Because my company dont use pcell to shink chip size.

    I made a De_cap Cell myself and placed it in layout cell view.

    So, I just want to decide width and length by using x coordinates and y coordinates.

    (width = gap of y coordinates, length = gap of x coordinates)

    Of course, i will continue to develop my skill code with orientation !!

    But it's too hard to use orientation information to me as junior.

    Honestly, I didnt understand your reply " Wouldn't traversing the hierarchy to find the instances of particular cells"... sorry...

    you say, do i need to use "dbGetTrueOverlaps"??

    As a result, as junior, first step, i want to use coordinates of gate to count De_caps by size !!!

    thank you for reading my post!

    could you help me develop skill code to count de_caps by using coordinates??

    - Noobnoob-

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Andrew Beckett
    Andrew Beckett 29 days ago in reply to Noobnoob

    Add these two functions:

    ;------------------------------------------------------------------------
    ; Convert a list of pointLists to a list of W and L
    ; values; W is the height, L is the length.
    ;------------------------------------------------------------------------
    procedure( CCFpointListToWL(cv pointList)
      let((llx lly urx ury (DBUPerUU cv~>DBUPerUU))
        foreach(point pointList
          destructuringBind((x y) point
            llx=if(llx then min(llx x) else x)
            lly=if(lly then min(lly y) else y)
            urx=if(urx then max(urx x) else x)
            ury=if(ury then max(ury y) else y)
          )
        )
        ;--------------------------------------------------------------------
        ; Convert to database units, round and back to microns.
        ; This is because simply subtracting floating point
        ; numbers will give small floating point errors leading
        ; to tiny differences in otherwise identical dimensions.
        ; Converting to integer units will ensure uniformity of
        ; the widths and lengths
        ;--------------------------------------------------------------------
        list(
          round((ury-lly)*DBUPerUU)/DBUPerUU
          round((urx-llx)*DBUPerUU)/DBUPerUU
        )
      )
    )
    
    ;------------------------------------------------------------------------
    ; Count each combination of w and l and then report
    ;------------------------------------------------------------------------
    procedure( CCFcountAndReportWL(wlList)
      let(((wlTable makeTable('wlTable 0)))
        foreach(wl wlList
          wlTable[wl]=wlTable[wl]+1
        )
        foreach(wl wlTable
          destructuringBind((w l) wl
            printf("  width = %gum & length = %gum, multi = %d\n"
              w l wlTable[wl]
            )
          )
        )
        t
      )
    )

    Then use them as follows (at the end of your existing code):

    p_channel_wl=foreach(mapcar pointList p_channel_point CCFpointListToWL(wcv pointList))
    n_channel_wl=foreach(mapcar pointList n_channel_point CCFpointListToWL(wcv pointList))
    
    printf("P Channel\n")
    CCFcountAndReportWL(p_channel_wl)
    printf("N Channel\n")
    CCFcountAndReportWL(n_channel_wl)

    You'll then get output in the CIW something like this:

    P Channel
      width = 20um & length = 0.28um, multi = 44
      width = 1.2um & length = 0.28um, multi = 1
      width = 20um & length = 0.5um, multi = 48
      width = 6.755um & length = 7.2um, multi = 4
      width = 2.8um & length = 0.28um, multi = 1
    N Channel
      width = 1.12um & length = 0.28um, multi = 1
      width = 1.2um & length = 0.28um, multi = 4
      width = 10um & length = 1um, multi = 14
      width = 3um & length = 0.28um, multi = 12

    Regards,

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Noobnoob
    Noobnoob 28 days ago in reply to Andrew Beckett

    Thank you! Andrew!!

    I got a result that i want!!!

    I'll try to analyze your code!!

    -noob-

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • 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.

© 2026 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information