I have a bounding box of the parallel area between to layers of metal, and i want to create a skill method to fill that area with as many vias as possible.
this is my first attempt to write a skill program, but it seems like a basic operation every skill programmer probably implemented, so before i sit down to wrestle with it i was wondering maybe someone already have an implementation of it to share ?
Thanks for your time.
I managed to come up with this solution :
procedure(fillVias(cid bbox viaName)let(() tf = techGetTechFile(cid) viaDef = techFindViaDefByName( tf viaName) viaWidth = 2*car(nth(5 viaDef->params)) + car(nth(6 viaDef->params)) boxWidth = car(cadr(bbox)) - car(car(bbox)) boxHeight = cadr(cadr(bbox)) - cadr(car(bbox)) viasPerRow = int(boxWidth/viaWidth) viasPerColumn = int(boxHeight/viaWidth) spacex = (boxWidth- viaWidth*viasPerRow)/(viasPerRow + 1) spacey = (boxHeight- viaWidth*viasPerColumn)/(viasPerColumn + 1) x = car(car(bbox)) y = cadr(car(bbox)) for( i 0 viasPerRow-1 for( j 0 viasPerColumn-1 point = x+ (i+0.5)*viaWidth+ (i+1)*spacex :y+ (j+0.5)*viaWidth+ (j+1)*spacey dbCreateVia(cvId viaDef point "R0") ) )))
It work fine for my needs, assuming the via width = via height
and from looking at the viaDef object (viaDef->??) it seems that car(nth(6 viaDef->params)) gives the inner square width and
car(nth(5 viaDef->params)) gives the margin.
In reply to TauStudent:
Hi TauStudentActually there is no need to write a skillscript because Virtuoso already has this function:IC61 : Use "autoVia" functionIC51 : Use "autoCont" function from toolboxBest regardsQuek