• 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. Skill code for Off Grid errors

Stats

  • Locked Locked
  • Replies 22
  • Subscribers 146
  • Views 27606
  • 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

Skill code for Off Grid errors

kashvi
kashvi over 16 years ago

Do you have a skill code to clear the off grid errors on layout?

Thanks,

-Shiva 

 

  • Cancel
  • kbhow
    kbhow over 16 years ago

    Hi Kashvi,

    You can use Turbo Toolbox (TTB) to fix the off grid issues.

    TTB->Change Options->Fix Off Grid

     

    How

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • kashvi
    kashvi over 16 years ago

     Thanks for the info. How!..Actually I have done with the Layout and some of the wires are on offgrid.

    instead of searching each one,  I want to move the layout itself on grid.

    -K 

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • kbhow
    kbhow over 16 years ago

    Hi Kashvi,

    It is the same. You can select all (bindkey: Ctrl-a ) and use the tool to fix grid for you. You not need to fix it one by one.

    Just let me know if you have other concern.

    How

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • kashvi
    kashvi over 16 years ago

     Hi How,

     

    I'm not able to find TTB, I tried to display it with hiDisplayFixedMenu(Toolbox_Menu "left")..

    It says unbound variable

     

    Regds,

    -K 




     

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • kbhow
    kbhow over 16 years ago

    Hi Kashi,

    I believe u doesn't have Turbo Toolbox in your virtuoso. To solve the off grid issue, use the code below.

    ;;---------------------------------------------------------

    ;; Process each selected object and fix the off grid issue

    ;;---------------------------------------------------------

    procedure( howFixOffGrid(@optional (selset geGetSelSet()))

    foreach( obj selset()

    howPutObjOnGrid(obj car(howSnapGetGrids()) cadr(howSnapGetGrids()) 0 0)

    );foreach

    );proc

     

    ;;--------------------------------------

    ;; Get manufacturing grid from techFile

    ;;;-------------------------------------

    procedure( howSnapGetGrids(@optional (cv geGetEditCellView()))

    let(( grids grid (dft list(0.001 0.001)) )

    if( cv then

    grid = techGetMfgGridResolution(techGetTechFile(cv))

    grids = list(grid grid)

    else

    grids = dft

    )

    grids

    );let

    );proc

     

    ;;----------------------------

    ;; Process input obj to grid

    ;;----------------------------

    procedure( howPutObjOnGrid(obj @optional

    (gridX 0.001)

    (gridY 0.001)

    (offsetX 0.0)

    (offsetY 0.0))

    let(( changeFlag newPoints newObj)

    case( obj~>objType

    (("rect")

    when( (newPoints = _howPutObjOnGridGtPts( obj~>bBox gridX gridY offsetX offsetY ))

    obj~>bBox = newPoints

    changeFlag = t

    );when

    )

    (("stdVia")

    when( (newPoints = _howPutObjOnGridGtPts( list(obj~>origin) gridX gridY offsetX offsetY ))

    obj~>origin = car(newPoints)

    changeFlag = t

    );when

    )

    (("pathSeg" )

    when( (newPoints = _howPutObjOnGridGtPts( list(obj~>beginPt obj~>endPt) gridX gridY offsetX offsetY )) newObj = dbCreatePathSeg(obj~>cellView obj~>lpp car(newPoints) cadr(newPoints) obj~>width

    obj~>beginStyle obj~>endStyle)

    newObj~>net = obj~>net

    dbDeleteObject(obj)

    changeFlag = t

    );when

    )

    (("path" "polygon" "layerBlockage")

    when( (newPoints = _howPutObjOnGridGtPts( obj~>points gridX gridY offsetX offsetY ))

    obj~>points = newPoints

    changeFlag = t

    )

    )

    (("inst" "label" "mosaic")

    when( (newPoints = _howPutObjOnGridGtPts( list(obj~>xy) gridX gridY offsetX offsetY ))

    obj~>xy = car(newPoints)

    changeFlag = t

    )

    )

    (("PRBoundary")

    when( (newPoints = _howPutObjOnGridGtPts( obj~>points gridX gridY offsetX offsetY ))

    dbSetBoundaryEdge(obj newPoints)

    changeFlag = t

    )

    )

    );case

    changeFlag

    );let

    );proc

    ;;-------------------

    ;; Get new points

    ;;-------------------

    procedure( _howPutObjOnGridGtPts( pts gridX gridY offsetX offsetY )

    let(( newListOfPts newPt changedFlag )

    foreach( pt pts

    if( (newPt = _howPutObjOnGridGtLoc( pt gridX gridY offsetX offsetY )) then

    newListOfPts = cons(newPt newListOfPts)

    changedFlag = t

    else

    newListOfPts = cons(pt newListOfPts)

    );if

    );foreach

    if( changedFlag then

    newListOfPts = reverse(newListOfPts)

    else

    newListOfPts = nil

    )

    newListOfPts

    );let

    );proc

     

    ;;---------------------

    ;; Get obj new point

    ;; --------------------

    procedure( _howPutObjOnGridGtLoc( pt gridX gridY offsetX offsetY)

    let(( newPt (factor 10000.0) compFactor tempPt )

    ;--------------------------------------------------------------------

    ; Get compare factor with smaller tolerance up to 4 decimal points

    ;-------------------------------------------------------------------

    compFactor = 1 / factor

    if( zerop(offsetX) && zerop(offsetY) then

    newPt = _howPutObjOnGridRoundCor( pt gridX gridY compFactor )

    when( newPt == pt newPt = nil)

    else

    ;---------------------------------

    ; Substract offset before round up

    ;---------------------------------

    tempPt = list(car(pt)-offsetX cadr(pt)-offsetY)

    newPt = _howPutObjOnGridRoundCor( tempPt gridX gridY compFactor )

    newPt = list(car(newPt)+offsetX cadr(newPt)+offsetY)

    when( newPt == pt newPt = nil)

    );if

    newPt

    );let

    );pro

     

    ;;--------------------

    ;; Round coordinate

    ;;--------------------

    procedure( _howPutObjOnGridRoundCor( point gridX gridY compFactor "gfff")

    let( (x y)

    x = round((xCoord(point) + compFactor) / gridX) * gridX

    y = round((yCoord(point) + compFactor) / gridY) * gridY

    list( x y )

    );let

    );proc

     

    How to use:

    1. Copy and load the script in CIW

    2. Select all object in your current cell view

    3. type command in ciw: howFixOffGrid()

     

    How

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • kashvi
    kashvi over 16 years ago

     Hi How,

     

    Thanks for the code!..

    -K 

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Jifeng
    Jifeng over 15 years ago

    Hi, How.

    In using you script, I got the error message as follows:
    *Error* eval: undefined function -selset

    Is there anything wrong in my side? I load the file in CIW and it returns "t".
    Then I select all the shapes in the layout and type howFixOffGrid().

     

    Thanks!
    Jifeng

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • kbhow
    kbhow over 15 years ago

    Hi JiFeng,

    The "selset" is a variable for selected object in cell view or user input. Please make sure u select object at the cell view, then go to CIW to execute the command. It should work.

    How

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Jifeng
    Jifeng over 15 years ago

    Hi, How

    Thanks for the reply.
    I am sure I select the polygons in the layout view, but still got the same error message.

    But I found a similar script in the sourcelink and it works, ^_^.

    Jifeng

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • pmuppala
    pmuppala over 15 years ago
    Hey Jifang and How,

    I  am also getting the same problem even when i am selecting all the objects in the cellview.
    It says:  *Error* eval: undefined function -selset


    Hey Jifang, can u give me the script which u got , i searched in the sourcelink and could not find any luck.

    Any help is highly appreciated.

    Thanks,
    Muppala
    • 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