//routeaux.bcpl
// Auxiliary function module - functions occasionally performed at
// initialization time.
// last modified by E. McCreight, July 18, 1978 12:47 PM
get "streams.d"
get "route.defs"
external
[
PrintTWPins
MakeBuzzLists
]
static [ file; OffsetRtn ]
let PrintTWPins() be
[
file = OpenFile("TWPins.tx", ksTypeWriteOnly, charItem,0,0,0,SilZone)
PutTemplate(file, "T r a c e - W i r e d P i n s : $S*n*n",
ZeroTablePoint(0))
let currentlevel = 1
let levelname = nil
while LevelTransform(currentlevel, 0, 0, 0, 0, lv levelname) do
[
PutTemplate(file, "$S", levelname)
for i=1 to 22-levelname>>str.length do PutTemplate(file, " ")
currentlevel = currentlevel+1
]
MapNamees(typeIcclass, PrintTWNet)
TruncateDiskStream(file)
Wss(file,"*n")
Closes(file)
]
and PrintTWNet(icclass) be
[
unless icclass>>icclass.isTraceWired do return
Wss(file, "*n*nBy pin number:")
let npins = Npins(icclass)
let perm = Allocate(SilZone, npins+1)
perm>>permutation.nelements = npins
for pin = 1 to npins do perm>>permutation.element↑pin = pin
PrintTWPinsInOrder(icclass, perm)
Wss(file, "*nBy location:")
OffsetRtn = icclass>>icclass.PinOffset
Sort(perm, CompareXY)
PrintTWPinsInOrder(icclass, perm)
Free(SilZone, perm)
]
and PrintTWPinsInOrder(icclass, perm) be
[
for i=1 to perm>>permutation.nelements do
[
outcount = 0
currentlevel = 1
while LevelTransform(currentlevel) do
[
PrintPin(icclass, perm>>permutation.element↑i, file)
currentlevel = currentlevel+1
]
]
]
and CompareXY(pin1, pin2) = valof
[
let x1,y1,x2,y2 = nil,nil,nil,nil
OffsetRtn(empty, pin1, lv x1, lv y1)
OffsetRtn(empty, pin2, lv x2, lv y2)
if x1 ne x2 then resultis x1-x2
resultis y1-y2
]
and MakeBuzzLists() be
[
MakeBuzzList("OpenPins.wl", true)
MakeBuzzList("ShortedPins.wl", false)
]
and MakeBuzzList(fileName, useOpenPins) be
[
file = OpenFile(fileName, ksTypeWriteOnly, charItem,
0,0,0,SilZone)
currentFile = file
PutTemplate(file, "$S*n@", ZeroTablePoint(0))
currentlevel = BottomLevel
headingpresent = false
zeroPending = true
baseNetNumber = 1
for x=0 to 599 do for y=0 to 599 do
if FindIndexFromCoord(x,y) ne 0 then
[
let TWclass, TWpin = empty, 0
FindIndexFromCoord(x, y, lv TWclass, lv TWpin)
test useOpenPins
ifso
[
if TWclass ne empty then loop
AddAPin("Open", "xy", x, y)
]
ifnot
[
if TWclass eq empty then loop
let str = vec 20
AddAPin("Shorted", ExpandTemplate(str, "$S$D",
FindNameesString(TWclass), TWpin), x, y)
]
]
PutTemplate(file, "*n")
TruncateDiskStream(file)
Closes(file)
]
and AddAPin(heading, pinstring, x, y) be
[
static [ addLastPinLen ]
Heading(heading)
PrintBasicPin(pinstring, x, y, file)
]