Off-grid problem

T

tarekmh

Guest
Hi,

I have got off-grid errors in my design, the fab stated that I have to
fix them, have anyone got a script to fix the grid automatically?

Thanks
Tarek
 
think about it: it's absolutely possible to have a script snap the shapes on the layout to some
grid, but there is a risk that doing so, it introduces shorts, opens, or creates more drc errors.
it's safer to do it interactively.

if your problem is related to a specific issue, i.e. paths, then a more systematic solution may be
possible.

this script will let you snap the currently selected shapes to a grid.
it binds to the F7 key. so you can interactively verify what it's doing.

note: change the snap grid (0.05) according to your needs
change ceiling for floor if you'd better have shapes shrinked than grown
paths are converted to polygon so that their outline in snapped to grid, not their centerline

procedure( XXsnapToGrid( shapes grid )
let( ( doSnap prop val )

doSnap = lambda( (pt)
if( listp(pt)
mapcar( doSnap pt )
grid*ceiling(abs(pt)/float(grid))*pt/abs(pt)
)
)

foreach( shape shapes
prop = case( shape~>objType
( "path"
shape = leConvertShapeToPolygon( shape )
"points"
)
( "polygon" "points" )
( "rect" "bBox" )
( "inst" "xy" )
( t nil )
) ; case

prop && putprop( shape funcall( doSnap get(shape prop) ) prop )

) ; foreach
) ; let
) ; procedure

hiSetBindKey( "Layout" "<Key>F7" "XXsnapToGrid(geGetSelSet() 0.05)" )

cheers,

stéphane

tarekmh wrote:
Hi,

I have got off-grid errors in my design, the fab stated that I have to
fix them, have anyone got a script to fix the grid automatically?

Thanks
Tarek
 
Short answer - No.

The problem is that (assuming the layout is DRC Clean other than off-grid)
there may not be a proper answer to the grid snapping problem. (snapping to
the
closest grid may introduce a new DRC error in the degenerate case! There may
be
more than one choice of grid to snap to!)


You could arbitrarily snap the vertices to grid points, but this has to be
done with care.

How did they get off grid in the first place?

Did someone draw center-line on the 45 degree angle. ( I have a proposed a
solution for this!)

Did someone place a cell off grid? ( This is trivial to fix)

Did someone do an ill advised join or cut? (this will mess up in degenerate
cases!)

Are the off-grid points real? (i.e. will they disappear after a merge
shapes? )

Do you have a lot or a few? (when thinking hierarchically of course ! )

The solution will depend on your answers to these questions and automation
cannot
guarenteee a correct solution. (but may fix most problems!)


-- Gerry

"tarekmh" <tarek.elesseily@sws.com-dot-eg.no-spam.invalid> wrote in message
news:iZ-dnQk1DcGwcKLfRVn_vQ@giganews.com...
Hi,

I have got off-grid errors in my design, the fab stated that I have to
fix them, have anyone got a script to fix the grid automatically?

Thanks
Tarek
 
tarekmh wrote:
Hi,

I have got off-grid errors in my design, the fab stated that I have to
fix them, have anyone got a script to fix the grid automatically?

Thanks
Tarek
Hi once used this, but it is for schematics. You will have to customise it.

procedure(CmSnapTo( @optional (g 0.0625) (verbose nil) "fg")
let((x y left bottom right top
Fig this_point that_point cv new_points returnVal)

cv=geGetEditCellView() || error("Snap to grid:can not open cellview.")
g = abs(g)
verbose && info("Snapping %L %L to a grid of %L.\n"
cv->cellView->cellName cv->c
ellView->viewName g)

verbose && info("Snap instances:\n")
foreach(inst cv~>instances
x=car(inst~>xy) y=cadr(inst~>xy)
if( x && y then
verbose && info("instance %s of a %s , from %L:%L to "
(inst~>name || ""
) (inst~>cellName || "") x y)
inst->xy=list(x=g*round(x/g) y=g*round(y/g))
verbose && info("%L:%L\n" x y)
else warn("Instance %s %s is of type %s and will be ignored\n"
(inst~>na
me || "") (inst~>cellName || "") inst~>objType)
);fi
);foreach instance

verbose && info("Snap shapes\n")
foreach(shape cv~>shapes
when(shape~>points
new_points = nil
foreach(point shape~>points
x = car(point) y = cadr(point)
this_point = list( g*round(x/g) g*round(y/g))
new_points = cons(this_point new_points)
);foreach
shape->points=reverse(new_points)
);when points
when( shape~>objType == "rect"
left=leftEdge(shape~>bBox)
bottom=bottomEdge(shape~>bBox)
right=rightEdge(shape~>bBox)
top=topEdge(shape~>bBox)
this_point=list(g*round(left/g) g*round(bottom/g))
that_point=list(g*round(right/g) g*round(top/g))
shape->bBox=list(this_point that_point)
);when rect
);foreach shape

verbose && info("Snap terms\n")
foreach(term cv~>terminals
when(term~>pins
foreach(pin term~>pins
Fig=pin~>fig
if(Fig~>xy then
x=car(Fig~>xy)
y=cadr(Fig~>xy)
Fig->xy=list(g*round(x/g) g*round(y/g))
);fi
);foreach
);when pins
);foreach term

);let
);proc
 
Hi,

Unfortunately this is not my layout I didn't began working on it but I
think that the one made it have used a wrong grid so the whole layout
was made wrong from the begining. The layout is flat it has no
hierarchical cells.






G Vandevalkwrote:
Short answer - No.

The problem is that (assuming the layout is DRC Clean other than
off-grid)
there may not be a proper answer to the grid snapping problem.
(snapping to
the
closest grid may introduce a new DRC error in the degenerate case!
There may
be
more than one choice of grid to snap to!)


You could arbitrarily snap the vertices to grid points, but this has
to be
done with care.

How did they get off grid in the first place?

Did someone draw center-line on the 45 degree angle. ( I have a
proposed a
solution for this!)

Did someone place a cell off grid? ( This is trivial to fix)

Did someone do an ill advised join or cut? (this will mess up in
degenerate
cases!)

Are the off-grid points real? (i.e. will they disappear after a
merge
shapes? )

Do you have a lot or a few? (when thinking hierarchically of course
! )

The solution will depend on your answers to these questions and
automation
cannot
guarenteee a correct solution. (but may fix most problems!)


-- Gerry

"tarekmh" <tarek.elesseily@sws.com-dot-eg.no-spam.invalid
wrote in message
news:iZ-dnQk1DcGwcKLfRVn_vQ@giganews.com...
Hi,

I have got off-grid errors in my design, the fab stated that I have
to
fix them, have anyone got a script to fix the grid automatically?

Thanks
Tarek
 
It is your layout now, otherwise the Fab cannot ask you to fix them!

1) Are the off-grids on all the cells (i.e. a placement off-grid error)

Or

2) Do you have 45 degree centerlines

Or

3) Was the grid wrong in a particular layout? (if so, how)

If 1, just write skill to move placements.

If 2 (and a manageable number) just add polygons overtop to remove off grids
after merge.
(if the spacing will allow!)

If 3, you could be in trouble ... One choice would be to go the compactor
route where required.
(i.e. get Cadence or bolt-in compactor and run the layout through it!)

Automatic skill translation routines can be written, (I have written many)
but they require a lot
of hand-holding.

-- Good luck -- G

"tarekmh" <tarek.elesseily@sws.com-dot-eg.no-spam.invalid> wrote in message
news:kr6dncC6BunRoMffRVn_vA@giganews.com...
Hi,

Unfortunately this is not my layout I didn't began working on it but I
think that the one made it have used a wrong grid so the whole layout
was made wrong from the begining. The layout is flat it has no
hierarchical cells.






G Vandevalkwrote:
Short answer - No.

The problem is that (assuming the layout is DRC Clean other than
off-grid)
there may not be a proper answer to the grid snapping problem.
(snapping to
the
closest grid may introduce a new DRC error in the degenerate case!
There may
be
more than one choice of grid to snap to!)


You could arbitrarily snap the vertices to grid points, but this has
to be
done with care.

How did they get off grid in the first place?

Did someone draw center-line on the 45 degree angle. ( I have a
proposed a
solution for this!)

Did someone place a cell off grid? ( This is trivial to fix)

Did someone do an ill advised join or cut? (this will mess up in
degenerate
cases!)

Are the off-grid points real? (i.e. will they disappear after a
merge
shapes? )

Do you have a lot or a few? (when thinking hierarchically of course
! )

The solution will depend on your answers to these questions and
automation
cannot
guarenteee a correct solution. (but may fix most problems!)


-- Gerry

"tarekmh" <tarek.elesseily@sws.com-dot-eg.no-spam.invalid
wrote in message
news:iZ-dnQk1DcGwcKLfRVn_vQ@giganews.com...
Hi,

I have got off-grid errors in my design, the fab stated that I have
to
fix them, have anyone got a script to fix the grid automatically?

Thanks
Tarek
[/QUOTE]
 

Welcome to EDABoard.com

Sponsor

Back
Top