//F U N C T I O N S F O R D1 L O G I C A N D M E M O R Y B O A R D S get "sysdefs.d" get "gob.defs" external [ BoardL BoardM ] let BoardL() be [ GetSVCoords=GetSVCoordsL GetSVindex=GetSVindexL SVoltReq = table [ 336; 144; 144 ; 144; 144 ] NetHasSVolt = NetHasSvoltL LegalBloc = LegalBlocL ChiptoPinPos = ChiptoPinPosT GetEpinCoords = GetEpinCoordsL GetCpinCoords = GetCpinCoordsL GetICcoords = GetICcoordsL AddPotentialTerms = AddPotentialTermsL FindBestTerm = FindBestTermL SetUpTerms = SetUpTermsL GetBoardPins = GetBoardPinsL maxn = 63 //board locations 1-63 maxalph = $l-$a TableZeroString = "*nZero Table At C188: <0> {22,0}*nZero Table At E6: <0> {22,525}*nZero Table At E187: <0> {477,525}*nZero Table At C5: <0> {477,0}" ] and BoardM() be [ GetSVCoords=GetSVCoordsM GetSVindex=GetSVindexM SVoltReq = table [ 336; 0; 0 ; 0; 0 ] NetHasSVolt = NetHasSvoltM LegalBloc = LegalBlocM ChiptoPinPos = ChiptoPinPosT GetEpinCoords = GetEpinCoordsL GetCpinCoords = GetCpinCoordsL GetICcoords = GetICcoordsM AddPotentialTerms = AddPotentialTermsM FindBestTerm = FindBestTermL SetUpTerms = SetUpTermsM GetBoardPins = GetBoardPinsM maxn = 42 //board locations 1-26 maxalph = $l-$a TableZeroString = "*nZero Table At C188: <0> {22,0}*nZero Table At E6: <0> {22,525}*nZero Table At E187: <0> {477,525}*nZero Table At C5: <0> {477,0}" ] and NetHasSvoltL(netname) = valof [(1270)\f1 if StEq("VCC",netname) then resultis $F if StEq("GND",netname) then resultis $G if StEq("VEE",netname) then resultis $M if StEq("VTT",netname) then resultis $T if StEq("VDD",netname) then resultis $D resultis 0l4269\f1 ] and GetSVindexL(SVType,bl,pin)=valof [\f1 let alph = bl rem 26 let num = bl/26 switchon SVType into [l4269\f1 case $G: [l5539\f1 if (num ge 1) & (num le 24) resultis alph*24 + num if (num ge 41) & (num le 52) resultis alph*24+(num -40)*2-1 if (num ge 60) & (num le 63) resultis alph*4 +(num-59)+ 288 resultis 0l6809\f1 ] case $T: case $D: case $F: case $M: [l5539\f1 if (num ge 1) & (num le 24) resultis alph*12 +(num+1)/2 if (num ge 41) & (num le 52) resultis alph*12 + num -40 if (num ge 60) & (num le 63) resultis alph*12+(num-60)*3+2 resultis 0l6809\f1 ] default: resultis 0l5539\f1 ]l4269\f1 ] and GetSVCoordsL(SVType,SVIndex,cv) be [\f1 let alph=(SVIndex-1)/12 let num=((SVIndex-1) rem 12 ) + 41 switchon SVType into [l4269\f1 case $G: test SVIndex le 288 ifso [l5539\f1 alph=(SVIndex-1)/24 num=((SVIndex-1) rem 24)+1 GetICcoordsL(alph,num,16,cv) returnl6809\f1 ] ifnot [l5539\f1 SVIndex=SVIndex-288 alph=(SVIndex-1)/4 num=((SVIndex-1) rem 4) +60 GetICcoordsL(alph,num,24,cv) returnl6809\f1 ] case $T: [l5539\f1 GetICcoordsL(alph,num,1,cv) returnl6809\f1 ]l5539\f1 case $D: [l5539\f1 GetICcoordsL(alph,num,8,cv) cv!0=cv!0 -4 test (alph rem 3) eq 0 ifso cv!0=cv!0 - 4 ifnot cv!1=cv!1 -18 returnl6809\f1 ]l5539\f1 case $F: [l5539\f1 GetICcoordsL(alph,num,8,cv) cv!0=cv!0 -4 if (alph rem 3) ne 0 then cv!1=cv!1 +18 returnl6809\f1 ]l5539\f1 case $M: [l5539\f1 GetICcoordsL(alph,num,8,cv) switchon (alph rem 3) into [l6809\f1 case 0: [l8079\f1 cv!0=cv!0 + 2 cv!1=cv!1 -12 returnl9349\f1 ]l8079\f1 case 1: [l8079\f1 cv!0=cv!0 + 14 cv!1=cv!1 + 12 returnl9349\f1 ]l8079\f1 case 2: [l8079\f1 cv!0=cv!0 - 18 cv!1=cv!1 -12 returnl9349\f1 ]l8079\f1 ]l6809\f1 ]l5539\f1 ]l4269\f1 ] and GetICcoordsL(alph,num,pin,cv) be [\f1 if (num gr 0)&(num le 24) do [l4268\f1 cv!0 = 37 + alph*36 + (alph ge ($d-$a)?4,0) + (alph ge ($g-$a)?27,0) + (alph ge ($j-$a)?4,0) - (pin gr 8?(16-pin),(pin-1))*4 cv!1 = 16 + (pin gr 8?12,0) + (num-1)*18 + (num/2)*6 returnl5538\f1 ] if (41 le num)&(num le 52)&(pin le 8) do [l4268\f1 num = num-40 cv!0 = 37 + alph*36 + (alph ge ($d-$a)?4,0) + (alph ge ($g-$a)?27,0) + (alph ge ($j-$a)?4,0) - (pin-1)*4 cv!1 = 34 + (num-1)*42 returnl5538\f1 ] if (60 le num)&(num le 63) do [l4268\f1 num = num-60 let del = 0 switchon (alph+$a) into [l5538\f1 case $l: del = del+52 case $k: del = del+60 case $i: del = del+52 case $h: del = del+83 case $f: del = del+52 case $e: del = del+60 case $c: del = del+52 case $b: cv!0 = 55 + del - (pin gr 12?(24-pin),(pin-1))*4 cv!1 = 64 + num*126 +(pin gr 12?24,0) returnl6808\f1 ] l5538\f1 ] let v = vec 50; v!0 = 0 //bad board location AppendS("*nBad BoardLoc, Pin: ",v) AppendBL(26*num+alph, v) AppendS(", ",v) AppendN(pin,v) WSS(ErFile,v) cv!0=0 cv!1=0 l4268\f1 ] and AddPotentialTermsL() be //make ic descriptors for all possible terminator //positions which were not predefined by the user [\f1 for i = 41 to 52 do for j = 0 to maxalph do SprayTermL(i,j) l4268\f1 ] and SprayTermL(n,alph) be [\f1 let bl = 26*n + alph let bp = Boardvec!bl test bp eq 0 ifso //assign terminator to position AssignIC(8,termtype,termstp,bl) ifnot if bp>>icdesc.ictype ne termtype then [l4268\f1 let erv = vec 50; erv!0 = 0 AppendS("*nTerminator position ",erv) AppendBL(bl,erv) AppendS(" is defined as a non-terminator",erv) WSS(ErFile,erv)l5538\f1 ] l4268\f1 ] and FindBestTermL(x,y) =valof //assumes terms arrayed at NewItem (by SetUpTerms) [\f1 dts = #77776 //infinity let tptr = 0; let ti = 0 let tp = NewItem [l4268\f1 let ty = tp!1 if ty eq 0 then break let dely = ty gr y? ty-y,y-ty if dely ls dts then for i = 2 to 8 do [l5538\f1 let tx = tp!i if tx eq 0 then loop //already assigned let delx = tx gr x? tx-x,x-tx if (delx + dely) gr dts then loop //have best one so far dts = delx+dely tptr = tp ti = i l6808\f1 ] tp = tp+9 l5538\f1 ] repeat if tptr eq 0 then [ WSS(ErFile,"*nTerminator supply exhausted"); resultis 0 ] termy = tptr!1 termx = tptr!ti tptr!ti = 0 //mark used resultis lv((Boardvec!(tptr!0))>>icdesc.pinptr^ti)l4268\f1 ] and SetUpTermsL() be [\f1 let words = 0 for i = 41 to 52 do for j = 0 to maxalph do [l4268\f1 let bl = (26*i)+j let tp = Boardvec!bl if (tp eq 0)%((tp>>icdesc.ictype)ne termtype) then loop //have a terminator let cv = vec 2 GetICcoords(j,i,1,cv) CheckFit(words+9) let t = NewItem+words t!0 = bl t!1 = cv!1 //terminator y coordinate for k = 2 to 8 do [l5538\f1 test (tp>>icdesc.pinptr^k) eq 0 ifso //terminator unassigned- fill in x coordinate t!k = (cv!0) - ((k-1)*4) ifnot t!k = 0 l6808\f1 ] words = words+9l5538\f1 ] NewItem!words = 0 NewItem!(words+1) = 0l4268\f1 ] \f1 and LegalBlocL(bl) = valof [\f1 let alph = (bl rem 26)+$a; let num = bl/26 if alph gr $l then resultis false //letter always le l if num eq 0 then resultis false if (num gr 24)&(num ls 41) then resultis false if (num gr 52)&(num ls 60) then resultis false if num ge 60 then switchon alph into [l4268\f1 case $b: case $c: case $e: case $f: case $h: case $i: case $k: case $l: resultis true default: resultis falsel5538\f1 ] resultis truel4268\f1 ] and GetEpinCoordsL(pin,cv) be [\f1 if ((pin ls 4)%(pin gr 189)) then ErrN("*nSignal assigned to power or invalid Epin: ",pin) cv!1= 525 let pg = (pin-1) rem 4 if ((pg eq 0)%(pg eq 3)) then ErrN("*nSignal assigned to ground Epin: ",pin) let px = (pin-1)/4 cv!0 = 12 + (px*10) + (pg/2)*5l4268\f1 ] and GetCpinCoordsL(pin,cv) be [\f1 if ((pin ls 4)%(pin gr 189)) then ErrN("*nSignal assigned to power or invalid Cpin: ",pin) cv!1= 0 let pg = (pin-1) rem 4 if ((pg eq 1)%(pg eq 2)) then ErrN("*nSignal assigned to ground Cpin: ",pin) let px = (pin-1)/4 cv!0 = 12 + ((47-px)*10) + ((1-pg/2))*5l4268\f1 ] and GetBoardPinsL(bl) = valof [\f1 let n = bl/26 //num if (n gr 0)&(n le 24) then resultis 16 if (n ge 41)&(n le 53) then resultis 8 if (n ge 60)&(n ls 64) then switchon ((bl rem 26)+ $a) into [l4268\f1 case $b: case $c: case $e: case $f: case $h: case $i: case $k: case $l: resultis 24l5538\f1 ] ErrBL("*nIllegal Board Location: ", bl) resultis 0l4268\f1 ] //F U N C T I O N S F O R D1 M E M O R Y B O A R D and NetHasSvoltM(netname) = valof [\f1 if StEq("GND",netname) then resultis $G resultis 0l4269\f1 ] and GetSVindexM(SVType,bl,pin)=valof [\f1 let alph = bl rem 26 let num = bl/26 if num ls 3 resultis 0 if num gr 24 resultis 0 if alph gr ($j - $a) then resultis 0 resultis alph*27 + numl4269\f1 ] and GetSVCoordsM(SVType,SVIndex,cv) be [\f1 let alph=SVIndex/27 let num=SVIndex rem 27 GetICcoordsM(alph,num,8,cv)l4269\f1 ] and LegalBlocM(bl) = valof [\f1 let alph = bl rem 26; let num = bl/26 if alph gr ($l-$a) then resultis false //letter always le l if (num gr 26)&(num ne 41)&(num ne 42) then resultis false if ((num gr 2)&(num ls 25)) then if alph gr ($j-$a) then resultis false resultis truel4268\f1 ] and GetICcoordsM(alph,num,pin,cv) be [\f1 cv!0 = alph*(((num ls 3)%(num gr 24))?40,48) + 28 - (pin gr 8? 16-pin,pin-1)*4 if (num ge 3)&(num ls 25)&(alph gr ($e-$a)) then cv!0 = cv!0 + 16 if ((num ls 3)%(num gr 24))&(alph gr ($f-$a)) then cv!0 = cv!0 + 8 cv!1 = 7 + (num gr 1? 24,0) + (num gr 2? 18,0) + (num gr 3? 18,0) + (num gr 4? (20*(num-4)),0) +(pin gr 8?12,0) - (num gr 23?2,0) - (num gr 24? 2,0) + (num gr 25? 4,0) if num eq 41 then cv!1 = 25 if num eq 42 then cv!1 = 501 l4268\f1 ] and AddPotentialTermsM() be //make ic descriptors for all possible terminator //positions which were not predefined by the user [\f1 for i = 41 to 42 do for j = 0 to maxalph do SprayTermL(i,j) l4268\f1 ] and SetUpTermsM() be [\f1 let words = 0 for i = 41 to 42 do for j = 0 to maxalph do [l4268\f1 let bl = (26*i)+j let tp = Boardvec!bl if (tp eq 0)%((tp>>icdesc.ictype)ne termtype) then loop //have a terminator let cv = vec 2 GetICcoords(j,i,1,cv) CheckFit(words+9) let t = NewItem+words t!0 = bl t!1 = cv!1 //terminator y coordinate for k = 2 to 8 do [l5538\f1 test (tp>>icdesc.pinptr^k) eq 0 ifso //terminator unassigned- fill in x coordinate t!k = (cv!0) - ((k-1)*4) ifnot t!k = 0 l6808\f1 ] words = words+9l5538\f1 ] NewItem!words = 0 NewItem!(words+1) = 0l4268\f1 ] and GetBoardPinsM(bl) = valof [(635)\f1 let x = bl/26 if (x eq 41)%(x eq 42) then resultis 8 resultis 16l4269\f1 ] \f1