How to snap instances and shapes from grid 0.1 to 0.0625

Y

yudi

Guest
Hi,

I would like to have a skill which will snap all the Composer
Schematics objects without override one the others, from grid of 0.1 to
grid of 0.0625 (metric to inches system...).

Its is not simple as it is, as if you move the objects like in the
following script you can override and make shorts between exsist nets,
or lose the instance pin connectivity ...

The main idea to to re-route all the conectivties, but without lose the
topology..., also the junctions should remain as it was before (solded
dots)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Program to snap Composer inst and wires to grid
; Operates on selected items in current schematic,
; does entire schematic if nothing selected.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
procedure( BAD_gridFix()
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
let((cv count Set Settemp grid newpoints pointi shapeCoords)
;
; Open currently edited cellview
cv = geGetEditCellView(getCurrentWindow())

if(geGetObjectSelectedSet() != nil then
println("selected")
Settemp = geGetObjectSelectedSet()
Set = nil
foreach( item Settemp Set=append(Set list(car(item))) )
else
Set = append(cv~>instances cv~>shapes)
println("nothing selected - operating on entire cellview")
)

; Get the current snap spacing
grid = schGetEnv("schSnapSpacing")

count = 0

; Loop through and find all the items off grid
foreach( shape Set
; For instances
shapeCoords = shape~>xy
when( shapeCoords
when( (int(xCoord(shapeCoords)/grid) !=
xCoord(shapeCoords)/grid ) ||
(int(yCoord(shapeCoords)/grid) !=
yCoord(shapeCoords)/grid )
count = count + 1
shape~>xy =
int(xCoord(shapeCoords)/grid+0.0625)*grid:int(yCoord(shapeCoords)/grid+0.0625)*grid
)
)

; For wires
when( shape~>points
newpoints=nil
for(i 1 shape~>nPoints
pointi = nth(i-1 shape~>points)
if( (int(xCoord(pointi)/grid) != xCoord(pointi)/grid )
||
(int(yCoord(pointi)/grid) != yCoord(pointi)/grid )
then
count = count + 1
newpoints =
cons(int(xCoord(pointi)/grid+0.0625)*grid:int(yCoord(pointi)/grid+0.0625)*grid
newpoints)
else
newpoints = cons(nth(i-1 shape~>points) newpoints)
)
);foreach
shape~>points = newpoints
)
); foreach

; Print a report
when( count>0
printf("... INFO: %d Offgrid items moved\n" count )
)
)
)
 
Hi Yudi,

I recommend you should send your post to news:comp.cad.cadence. The
things you mention below belong to back end design, SKILL language of
Cadence so far I can see.
The newsgroup above is the right audience you are looking for. This
newsgroup is related to hardware description language Verilog for front
end design.

Utku.

yudi schrieb:

Hi,

I would like to have a skill which will snap all the Composer
Schematics objects without override one the others, from grid of 0.1 to
grid of 0.0625 (metric to inches system...).

Its is not simple as it is, as if you move the objects like in the
following script you can override and make shorts between exsist nets,
or lose the instance pin connectivity ...

The main idea to to re-route all the conectivties, but without lose the
topology..., also the junctions should remain as it was before (solded
dots)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Program to snap Composer inst and wires to grid
; Operates on selected items in current schematic,
; does entire schematic if nothing selected.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
procedure( BAD_gridFix()
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
let((cv count Set Settemp grid newpoints pointi shapeCoords)
;
; Open currently edited cellview
cv = geGetEditCellView(getCurrentWindow())

if(geGetObjectSelectedSet() != nil then
println("selected")
Settemp = geGetObjectSelectedSet()
Set = nil
foreach( item Settemp Set=append(Set list(car(item))) )
else
Set = append(cv~>instances cv~>shapes)
println("nothing selected - operating on entire cellview")
)

; Get the current snap spacing
grid = schGetEnv("schSnapSpacing")

count = 0

; Loop through and find all the items off grid
foreach( shape Set
; For instances
shapeCoords = shape~>xy
when( shapeCoords
when( (int(xCoord(shapeCoords)/grid) !=
xCoord(shapeCoords)/grid ) ||
(int(yCoord(shapeCoords)/grid) !=
yCoord(shapeCoords)/grid )
count = count + 1
shape~>xy =
int(xCoord(shapeCoords)/grid+0.0625)*grid:int(yCoord(shapeCoords)/grid+0.0625)*grid
)
)

; For wires
when( shape~>points
newpoints=nil
for(i 1 shape~>nPoints
pointi = nth(i-1 shape~>points)
if( (int(xCoord(pointi)/grid) != xCoord(pointi)/grid )
||
(int(yCoord(pointi)/grid) != yCoord(pointi)/grid )
then
count = count + 1
newpoints =
cons(int(xCoord(pointi)/grid+0.0625)*grid:int(yCoord(pointi)/grid+0.0625)*grid
newpoints)
else
newpoints = cons(nth(i-1 shape~>points) newpoints)
)
);foreach
shape~>points = newpoints
)
); foreach

; Print a report
when( count>0
printf("... INFO: %d Offgrid items moved\n" count )
)
)
)
 

Welcome to EDABoard.com

Sponsor

Back
Top