//route.defs
// last modified by E. McCreight, July 10, 1979 12:02 AM

external
[
Gets // Common OS procedures
Puts
Endofs
OpenFile
CreateDiskStream
GetCompleteFa
Closes
Resets
CallSwat
SysErr
DefaultArgs
Allocate
Free
MoveBlock
SetBlock
Zero
Noop
FilePos
SetFilePos
TruncateDiskStream
Usc
GetFixed
FixedLeft
InitializeZone
AddToZone

worstErrorLevel // Route statics

GetFile
// Route procedures
AddSpace
WeAre

OnceOnlyInitCode // RouteInit procedures

ADFile // RouteInit statics
ErFile
OutFile
ImplicitFile
CommentsFile
OldWlFile
charTab
Correcting
noroute
boardLocation
nlFileName
wlOldFileName
wlNewFileName
SilZone
StandardMetric
dontCareNet
kf

DefineNamee // RouteSyms procedures and statics
DefineName
MapNamees
FindNameesString
FindNameesName
MustFindNamee
TryFindingNamee
TryFindingName
SetupSpace
objectZone
StComp
Wss
AppendC
ExpandTemplate
GetBit
SetBit
OffsetLegal
Remark
Warning
Serious
Disaster
CallSmartSwat
ParsePin
NormalizeBoardLoc

FileIn // Routea procedures and statics
ReadAllNetLines
CheckUnusedPins
copyComments

MakeOutputFile // Routeb procedures and statics
NLCompFn
AssignNetNumber
currentlevel
headingpresent
zeroPending
ZeroTheTable
outcount
currentFile
baseNetNumber
netCount
PrintNet
PrintPin
PrintBasicPin
Heading

ReadICType // Routec procedures
NewICInst
NewNet
ReadNetName
GetValidChar
char
TryInserting
InsertDeviceIfPossible
GetPatternCoord
FindIcinst
GetPinCoord
BoardPinCoord
Icclass
Npins
FindNet
nitems
DoInSortOrder
Count
AddToList
NameCompareFn
ComputeClusters
NoAddedCaps
ManhattanDistFn
EuclideanDistFn

RouteNet
// RouteNet procedures
RouteNetIfExternal
RouteEarlyNets
ComputeLengths

AssignTWNet // RouteTWNetAssign procedures

OutputBPFiles // RouteBackPanel procedures
doMultiWire
MultiWirePanic

LocateAvailTerms // RouteTerm procedures
FreeTermStorage
AddEclTerminators
doResistances

CorrelateOldAndNew // RouteCorrect procedures and statics
CorrelateRemaining
deletePosFile

PrintNewNet
// RouteCorrectOut procedures
DeleteNets
ReportNewCutPins
ReportRepairedPins

PullComponents // RoutePull procedures

DIP3Wide // RouteIC procedures
DIP4Wide
DIP6Wide
DIP9Wide
SIP
QITPlat
Ecl4GAttributes
Ecl3GAttributes
Ecl2GAttributes
Ecl1GAttributes
ETCAttributes
TECAttributes
EclTermAttributes
F100KAttributes
NullAttributes
Ecl4Gnd
Ecl3Gnd
Ecl2Gnd
Ecl1Gnd
EclConverter
EclTerm
F100K
FTTL
TTL
DynamicRam3Supply
DynamicRam1Supply

SetupBoard // RouteBoard procedures and statics
SetupICclasses
SetupICclass

FindIndexFromCoord // Board’s procedures and statics
FindCoordFromString
DeclareInitialNets
ZeroTablePoint
LevelTransform
maxICs
boardInterfaceVersion
ComputeMWCoords
DescribeHoles
AddDecouplingCaps

Sperge // RouteNeighbor procedures
BinSearch
AddToHeap
PullFromHeap
Sort
FindNearest
OverlapsClaimedArea
ClaimArea
coveredAreas

Route // Router procedures and statics
bestTotalNetLength
forceFirstNodeToEnd
exhaustThresh

heuristicWork // Router1 statics

PutTemplate // PutTemplate procedures
]

manifest
[
interfaceVersion = 1 // between Route and board subroutines

DirPreambleSize=6
empty = 0
infinity = #77777
mark = -1
used = -2
filegone = -1
noError = 0
warning = 1
serious = 2
disaster = 3

doingInput = 1
doingCorrection = 2
doingTraces = 3
doingRouting = 4
doingADFile = 5
doingOutput = 6
]


structure str:
[
length byte
char↑1,35 byte
]

structure string:
[
length byte
char↑1,255 byte
]

structure KF:
// known file
[
next word
fp word 5
input bit
oktocreate bit
unused bit 14
string @string
]

structure namee:
[
next word // to next namee with this name; mark of name terminates list
blank bit 12
type bit 4
]

structure name:
[
next word // to next name with this hash; 0 terminates list
mark word // -1, terminates name chain and net’s pinList
nameString:
[
length byte
char↑1,1 byte
]
// name structure immediately followed by first namee
firstNamee @namee
]

manifest
[
// namee types
typeNet = 1
typeIcinst = 2
typeIctype = 3
typeIcclass = 4
typeOldinst = 5
typePgmsymbol = 6
typeNull = 7
]

structure net:
[
next word// to next namee with this name
dontTerminate bit
isSame bit // as a net in the old wirelist
isTraceWired bit // should be partitioned
hasBeenRouted bit
wireEarly bit
hasNetnum bit
blank bit 6
type bit 4
// =typeNet
pinList word
// pointer to first pin of pin list
shortestarc word = netnum word = minSperge word
netlength word = clusterList word
]

structure cluster:
// for cluster numbers > 0
[
next word// to next element of clusterList
number byte
// number of this cluster
index byte
// index in pinList where this cluster starts, 0 => first pin
]

structure oldinst:
[
next word // to next namee with this name
type word // = typeOldinst
ictype word // pointer to ictype or icclass block for this instance
]

structure icinst:
[
next word // to next namee with this name
type word // = typeIcinst
ictype word
// pointer to ictype or icclass block for this IC type
pinattribute word // pointer to list of pinattributes for this icinst
pin↑1,1 word
// links in the pin list
]

structure ictype:
[
next word// to next namee with this name
npins bit 12
type bit 4 // = typeIctype
icclass word
// pointer to icclass block for this IC type
outpins word
// one bit per pin, true if pin ever used in any instance
// as output pin
]

structure permutation:
[
nelements word
element↑1,1 word
]

structure classattributes:
[
isTraceWired bit
isConnector bit
printUsedList bit
blank bit 9
]

manifest
[
isTraceWired = 1 lshift (size classattributes-offset classattributes.isTraceWired-1)
isConnector = 1 lshift (size classattributes-offset classattributes.isConnector-1)
printUsedList = 1 lshift (size classattributes-offset classattributes.printUsedList-1)
]

structure pinattributes:
[
isEcl bit
isTerminator bit
isOutput bit
blank bit 13
]

manifest
[
isEcl = 1 lshift (size pinattributes-offset pinattributes.isEcl-1)
isTerminator = 1 lshift (size pinattributes-offset pinattributes.isTerminator-1)
isOutput = 1 lshift (size pinattributes-offset pinattributes.isOutput-1)
]

structure icclass:
[
next word// to next namee with this name
@classattributes = classattributes @classattributes
type bit 4 // = typeIcclass
PinOffset word
// PinOffset(icinst, pinNo, lv vertOffset, lv horizOffset, lv info)
PinAttributes word // PinInfo(icinst, pinNo) = pinattributes
ImplicitICNets word // ImplicitICNets(icinst) generates
// implicit nets into "implicit.nl"
npins word // # pins, overridden by ictype block
permutation word // points to a vector mapping from sperged
// coordinate order to standard order
spergevec word // points to a vector of sperged pin co-ordinates, one
// word per pin, in standard order
cutPins word
// points to vector containing one bit per pin,
// in standard order; bit true if pin cut from trace
oldCutPins word // as above, referring to old wirelist file
nPotentialPins word
LocatePotentialPin word // LocatePotentialPin(icinst, pinNo, lv x, lv y, lv info, pinName)
]


manifest
[
absolute = 1 // values returned from PinOffset routine
relative = 2
illegal = 3
]

structure info: // information about trace-wired pins
[
unused bit 9
usedForDecoupling bit 1
disconnect bit 1
reconnect bit 1
level bit 4
]

manifest
[
usedForDecoupling = 1 lshift (size info-offset info.usedForDecoupling-1)
Disconnect = 1 lshift (size info-offset info.disconnect-1)
Reconnect = 1 lshift (size info-offset info.reconnect-1)
noDisconnect = 0
noReconnect = 0
TopLevel = 1
BottomLevel = 2
]

structure pinattribute:
[
next word// to next pinattribute for this icinst
pinNo word // attribute with this name applies to this pin
attribute word
value word // value (if any) of this attribute
]

manifest
[
letterMask = 1
upperCaseMask = 2
lowerCaseMask = 4
digitMask = 8
colonMask = 16
breakMask = 32
legalSpecialCharMask = 64
atsignMask = 128
netNameMask = letterMask%digitMask%legalSpecialCharMask%colonMask
]

structure pgmsymbol:
[
next word
valIsPtr bit
staticHasValue bit
unused bit 10
type bit 4
value word
]