//routepclb2.bcpl
// Board-specific Route routines for the PC version of the
// Dorado Main Logic Board
// part 2 of 3
// last modified by E. McCreight, July 14, 1981 6:37 PM
//to move the line of holes under the DIP patterns
// all co-ordinates are described with respect to the bottom or
// wiring side of the board. LevelTransform fixes these as necessary.
get "route.defs"
manifest
[
repeatRows = 12
repeatColsPerSide = 3
repeatCols = 2*repeatColsPerSide
fullRepeatColsPerSide = 2
fullRepeatCols = 2*fullRepeatColsPerSide
repeats = repeatRows*repeatCols
fullRepeats = repeatRows*fullRepeatCols
rowOffset = 16
leftColsOffset = 0
rightColsOffset = 246
rowHeight = 42
fullColWidth = 112
patternGrounds = 3*repeats+6*fullRepeats
Sockets16pin = 6*fullRepeats
Sockets24pin = 2*fullRepeats
Sockets50pin = fullRepeats
SocketsSip = 3*fullRepeats
]
static [ boardInterfaceVersion = interfaceVersion ]
let FindIndexFromCoord(x, y, picclass, pPinNo; numargs na) = valof
[
static [ hotIndex = -1; firstUnusedPin = 0 ]
DefaultArgs(lv na, -2, lv na, lv na)
if firstUnusedPin eq 0 then firstUnusedPin = FIFC(-1,-1)
let result = FIFC(x, y, picclass, pPinNo)
if result ls 0 % result gr firstUnusedPin then CallSwat("Illegal index..")
if result eq hotIndex then CallSwat("Hot index computed...")
resultis result
]
and FIFC(x, y, picclass, pPinNo; numargs na) = valof
[
// this is modified from the stitchweld and multiwire format to introduce
// two rows of holes under the IC’s instead of one
manifest
[
firstEPin = 1
firstSocketGround = firstEPin+92+92
firstPatternPin = firstSocketGround+92+92
firstUnusedPin = firstPatternPin+repeatRows*7*(fullRepeatCols*26+
repeatCols*2)
]
if x eq -1 & y eq -1 then resultis firstUnusedPin
DefaultArgs(lv na, -2, lv na, lv na)
unless OffsetLegal(x, 1, 0, 476)&OffsetLegal(y, 1, 0, 524) do resultis 0
if y eq 0 % y eq 524 then // ..connector signal pin
[
let connClass = (x-22) rem 10
if (connClass ne 0) & (connClass ne 4) then resultis 0
let vpin = 2*((x-22)/10)+(connClass/4)
unless OffsetLegal(vpin, 1, 0, 91) do resultis 0
resultis vpin+92*(y/524)+firstEPin
]
if y eq 4 % y eq 520 then // ..connector ground pin
[
let connClass = (x-22) rem 10
if (connClass ne 0) & (connClass ne 4) then resultis 0
let vpin = 2*((x-22)/10)+(connClass/4)
unless OffsetLegal(vpin, 1, 0, 91) do resultis 0
let cgp = vpin+92*(y/520)
@picclass = MustFindNamee("GND", typeIcclass)
@pPinNo = patternGrounds+1+cgp
resultis cgp+firstSocketGround
]
let side = 0
if x ge rightColsOffset then
[
side = 1
x = x-(rightColsOffset-leftColsOffset)
]
let xOffset = x-leftColsOffset
unless OffsetLegal(xOffset, 4, 0, 57) do resultis 0
let xRepeat = repeatColsPerSide*side+(xOffset/fullColWidth)
xOffset = xOffset rem fullColWidth
unless OffsetLegal(xOffset, 4, 0, 27) do resultis 0
let yOffset = y-rowOffset
let yRepeat = yOffset/rowHeight
yOffset = yOffset rem rowHeight
unless OffsetLegal(yRepeat, 1, 0, 11) do
resultis 0
let pinInGroup = 1
let prevGroups = repeatRows*xRepeat+yRepeat
let prevFullGroups = repeatRows*(xRepeat-(xRepeat/repeatColsPerSide))+
(xRepeat rem repeatColsPerSide ne fullRepeatColsPerSide? yRepeat, 0)
switchon yOffset into
[
case 0:
switchon xOffset into
[
case 80: pinInGroup = pinInGroup+2
case 44: pinInGroup = pinInGroup+2
case 4:
@picclass = MustFindNamee("VEE", typeIcclass)
@pPinNo = 2*prevGroups+4*prevFullGroups+
pinInGroup
endcase
case 76: pinInGroup = pinInGroup+3
case 40:
pinInGroup = pinInGroup+3
@picclass = MustFindNamee("GND", typeIcclass)
@pPinNo = 3*prevGroups+6*prevFullGroups+
pinInGroup
endcase
default:
]
endcase
case 8:
case 32:
endcase
case 12:
switchon xOffset into
[
case 76: pinInGroup = pinInGroup+2
case 72: pinInGroup = pinInGroup+1
case 40: pinInGroup = pinInGroup+4
case 0:
@picclass = MustFindNamee("GND", typeIcclass)
@pPinNo = 3*prevGroups+6*prevFullGroups+
pinInGroup
endcase
default:
]
endcase
case 18:
switchon xOffset into
[
case 4:
@picclass = MustFindNamee("VDD", typeIcclass)
@pPinNo = prevGroups+pinInGroup
endcase
case 108:
pinInGroup = pinInGroup+2
@picclass = MustFindNamee("VTT", typeIcclass)
@pPinNo = 3*prevFullGroups+pinInGroup
endcase
default:
]
endcase
case 24:
switchon xOffset into
[
case 0:
pinInGroup = pinInGroup+1
@picclass = MustFindNamee("GND", typeIcclass)
@pPinNo = 3*prevGroups+6*prevFullGroups+
pinInGroup
endcase
case 80: pinInGroup = pinInGroup+2
case 44: pinInGroup = pinInGroup+2
case 4:
pinInGroup = pinInGroup+1
@picclass = MustFindNamee("VEE", typeIcclass)
@pPinNo = 2*prevGroups+4*prevFullGroups+
pinInGroup
endcase
case 76: pinInGroup = pinInGroup+1
case 40:
@picclass = MustFindNamee("VTT", typeIcclass)
@pPinNo = 3*prevFullGroups+pinInGroup
endcase
default:
]
endcase
case 36:
switchon xOffset into
[
case 0:
@picclass = MustFindNamee("VCC", typeIcclass)
@pPinNo = prevGroups+pinInGroup
endcase
case 108: pinInGroup = pinInGroup+6
case 4:
pinInGroup = pinInGroup+2
@picclass = MustFindNamee("GND", typeIcclass)
@pPinNo = 3*prevGroups+6*prevFullGroups+
pinInGroup
endcase
default:
]
endcase
default: resultis 0
]
let colBase = 7*((xRepeat/3)*repeatRows*((fullRepeatCols/2)*26+
(repeatCols/2)*2)+(xRepeat rem 3)*repeatRows*28)
let rowBase = 7*yRepeat*((xRepeat rem 3 eq 2)? 2, 28)
resultis (((side*12)+yRepeat)*7+(selecton yOffset into
[
case 0: 0
case 8: 1
case 12: 2
case 18: 3
case 24: 4
case 32: 5
case 36: 6
]))*57+(x/4)+firstPatternPin
]