• 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 27579
  • 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
Parents
  • 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
Reply
  • 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
Children
No Data

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