//RouteResist.bcpl
// Analysis module to produce resistance file
// last modified by McCreight, September 15, 1982 11:09 AM
// to include isPartialNet test to recognize trace-wired nets under all circumstances
get "streams.d"
get "route.defs"
static
[
doResistances=false; conductance; resistanceFile
]
let MakeResistanceFile() be
[
resistanceFile = GetFile(nlFileName, ".resist")
DoInSortOrder(typeIcinst,NameCompareFn,ScanICsNets)
TruncateDiskStream(resistanceFile)
Closes(resistanceFile)
]
and ScanICsNets(icinst) be
[
let icclass = Icclass(icinst)
if icclass>>icclass.isConnector %
icclass>>icclass.isTraceWired then return
let icpkg = (icclass>>icclass.PinOffset eq DIP3Wide? "DIP3",
(icclass>>icclass.PinOffset eq SIP? "SIP", "OddPkg"))
PutTemplate(resistanceFile,
"$S ($S, $D, $S) ",
FindNameesString(icinst),
icpkg, Npins(icinst),
FindNameesString(icinst>>icinst.ictype))
for i=1 to Npins(icinst) do
[
NetResistance(icinst>>icinst.pin↑i)
if i ne Npins(icinst) then Puts(resistanceFile,$,)
]
Puts(resistanceFile, $*n)
]
and NetResistance(pin) be
[
if pin eq empty then
[
Puts(resistanceFile, $$)
return
]
let net = FindNet(pin)
if net eq dontCareNet then
[
Puts(resistanceFile, $?)
return
]
conductance = 0// in milliSiemens, infinity means short
if net>>net.isTraceWired % net>>net.isPartialNet then conductance = infinity
pin = net>>net.pinList
while (conductance ne infinity) & (@pin ne mark) do
[
PinResistance(pin)
pin = @pin
]
test conductance eq infinity
ifso Puts(resistanceFile, $0)
ifnot
[
test conductance eq 0
ifso Puts(resistanceFile, $$)
ifnot PutTemplate(resistanceFile,"$D",1000/conductance)
]
]
and PinResistance(pin) be
[
static [ Term100Ohms = empty]
if Term100Ohms eq empty then
Term100Ohms = MustFindNamee("Term100/8/Term100",typeIctype)
let icinst = nil
FindIcinst(lv icinst, lv pin)
let icclass = Icclass(icinst)
let pinattributes = (icclass>>icclass.PinAttributes)(icinst,pin)
if pinattributes<<pinattributes.isTerminator then
if icinst>>icinst.ictype eq Term100Ohms then
conductance = conductance+10// 100 ohms or 10 mS.
if icclass>>icclass.isConnector then
conductance = conductance+10// added termination at each connector
if icclass>>icclass.isTraceWired then
conductance = infinity
]