Hello All.
I have a 1500 pins BGA with a lot of swappable IO pins. All nets are routed from the BGA to outside itself. All destinations are routed close to the BGA.
The swap is long to do (Show element to find the first pin to identify it (from destination) and swap with the closest clines by following it to the BGA pin).
Then I wrote a little skill routine to be able to select the component ((1) on before.jpg) on which pins will be swapped and then both nets(2) and (3) by extracting pin from them. The it swaps them according to after.jpg
My routine does what I want but the "cosmetic" is problematic: I took a part of the renref (semi-auto.il") for the popup menu and the stop routine. I have a lot of difficulties to make it works.... Now on Allegro, after running this command, all others commands have to be finished before calling the next one (error msg: E- Finish current command before starting new command)
What I wish (probably useful for others...): Select the component. Select net 1 select net 2 swap pins. select net 1 select net 2 swap pins and so on until I click "Stop" on the popup menu.
the routine (can probably be enhanced!! sorry for my poor knowledge in Skill ;-): maybe an Oops can be added, a form too, etc.... A lot of things (like variables = nil or something like are there because of many tries to improve it)
----BEGIN---- axlCmdRegister( "swapn" 'Swap_Pin_byNets ?cmdType "Interactive") defun(swapn_stop ()
; Stop the select function ; ######################## axlClearSelSet() axlCancelEnterFun() refdes=nil net1=1 net2=2 num1=nil num2=nil lengthnum=nil lpin1=nil lpin2=nil pin=nil pin1loc=nil pin2loc=nil Finished=t
);defun stop defun(Swap_Pin_byNets () axlCancelEnterFun() Finished=nil refdes=nil net1=nil net2=nil num1=nil num2=nil lengthnum=nil lpin1=nil lpin2=nil pin=nil pin1loc=nil pin2loc=nil
swapn_Popup=axlUIPopupDefine(nil list( list("Stop" 'swapn_stop)))
while(Finished == nil axlUIPopupSet(swapn_Popup) ;-----------------------------Component Selection---------------------------- if(refdes == nil then comp=nil while(comp == nil print("Selectionner le composant dont les pins seront swappees: ") axlSetFindFilter(?enabled '(noall symbols) ?onButtons '(noall symbols)) comp = car(axlGetSelSet(axlSingleSelectPoint())) ) refdes=comp->refdes println(comp->refdes) else println(refdes) );end if comp
;-----------------------------Net1 Selection---------------------------- if(net1 == nil then axlSetFindFilter(?enabled '(noall nets ratsnests) ?onButtons '(noall nets ratsnests)) println("Selectionner la 1ere net (Cline ou ratsnest)") net1 = car(axlGetSelSet(axlSingleSelectPoint())) lpin1 = axlPinsOfNet(net1, 'pins) num1=0 lengthnum=length(lpin1) while(num1 < lengthnum pin=nth(num1 lpin1) sprintf(txt "Num: %n - Item: %s" num1 pin->parent->refdes ) println(txt) if(pin->parent->refdes == refdes then pin1loc = (pin->xy) println(pin1loc) );end if refdes num1=num1+1 );while num1 );end if net1
;-----------------------------Net2 Selection---------------------------- if(net2 == nil then axlSetFindFilter(?enabled '(noall nets) ?onButtons '(noall nets)) println("Selectionner la 2eme net (Cline ou ratsnest)") net2 = car(axlGetSelSet(axlSingleSelectPoint())) lpin2 = axlPinsOfNet(net2, 'pins) num2=0 lengthnum=length(lpin2) while(num2 < lengthnum pin=nth(num2 lpin2) sprintf(txt "Num: %n - Item: %s" num2 pin->parent->refdes ) println(txt) if(pin->parent->refdes == refdes then pin2loc = (pin->xy) println(pin2loc) );end if refdes num2=num2+1 );while num2 );end if net2
;-----------------If 2 Pins Location on Component Then execute swap pins command ------------------------------- if(pin1loc || pin2loc then sprintf(cmdstring "swap pins;pick %n %n;pick %n %n;done" nth(0 pin1loc) nth(1 pin1loc) nth(0 pin2loc) nth(1 pin2loc)) axlShell(cmdstring) net1=nil net2=nil num1=nil num2=nil pin1loc=nil pin2loc=nil lpin1=nil lpin2=nil lengthnum=nil pin=nil cmdstring=nil axlClearSelSet() );end if 2 pinlocs
);while Finished==nil );defun -----END----
Many thanks in advance to those can help! (Informations on what mistakes and bad syntax I did would be welcome!!)
willbi. |