DIRECTORY Atom, CMos, FS, HashTable, IO, LoadsOut, Rope, Route, RouteChannel, SC, SCChanUtil, SCPrivate; LoadsOutImpl: CEDAR PROGRAM IMPORTS Atom, CMos, FS, HashTable, RouteChannel, SCChanUtil, IO EXPORTS LoadsOut = BEGIN NetData: TYPE = REF NetDataRec; NetDataRec: TYPE = RECORD [ metLength: Route.Number _ 0, met2Length: Route.Number _ 0]; ProcessChan: PROC [rowChan: SCPrivate.RowChan, hashTable: HashTable.Table] = { EnterSeg: RouteChannel.EnumSegmentsProc = { net: NetData _ NIL; value: REF _ NIL; found: BOOLEAN _ FALSE; length: INT _ 0; key: ATOM _ Atom.MakeAtom[name]; [found, value] _ HashTable.Fetch[hashTable, key]; net _ IF found THEN NARROW[value] ELSE NEW[NetDataRec _ []]; length _ MAX[ABS[pos1.x-pos2.x], ABS[pos1.y-pos2.y]]; SELECT layer FROM CMos.met => net.metLength _ net.metLength + length; CMos.met2 => net.met2Length _ net.met2Length + length; ENDCASE => NULL; IF NOT found THEN [] _ HashTable.Store[hashTable, key, net]; }; EnumPins: RouteChannel.EnumPinsProc = {}; EnumVias: RouteChannel.EnumViasProc = {}; EnumExits: RouteChannel.EnumExitsProc = {}; EnumIncompletes: RouteChannel.EnumIncompletesProc = {}; IF rowChan.routing = NIL THEN RETURN; [] _ RouteChannel.GetRouting[routingArea: rowChan.routing.routingArea, rect: rowChan.routing.routingRect, properties: NIL, EnumSegments: EnterSeg, EnumPins: EnumPins, EnumVias: EnumVias, EnumExits: EnumExits, EnumIncompletes: EnumIncompletes]; }; EnumerateHashTable: PROC [hashTable: HashTable.Table, outPutFile: Rope.ROPE] = { PutLengthsForNet: HashTable.EachPairAction = { atom: ATOM _ NARROW[key]; net: NetData _ NARROW[value]; IO.PutF[out, " %g : %g : 0 : %g :\n", [atom[atom]], IO.int[net.met2Length], IO.int[net.metLength]]; }; out: IO.STREAM; out _ FS.StreamOpen[outPutFile, $create]; IO.PutF[out, "%g: Standard Cell routing lengths for use by SETAR's CAPLOAD CANDE annotation utility\n\n", [rope[outPutFile]]]; IO.PutF[out, " NET : LENGTH : LENGTH : LENGTH :\n"]; IO.PutF[out, " : IN L_1 : IN L_1A : IN L_2 :\n"]; IO.PutF[out, " ------------------------------------------------------\n\n"]; [] _ HashTable.Pairs[hashTable, PutLengthsForNet]; IF out # NIL THEN IO.Close[out]; }; ProcessRouting: PUBLIC PROC [handle: SC.Handle, outputFile: Rope.ROPE] = { ForEachChan: SCChanUtil.EachRowChanProc = { ProcessChan[rowChan, hashTable]; -- pass in hash table }; hashTable: HashTable.Table _ HashTable.Create[]; [] _ SCChanUtil.EnumerateRowChans[handle: handle, eachRowChan: ForEachChan]; EnumerateHashTable[hashTable, outputFile]; }; END. ΪLoadsOutImpl.mesa Frank Bowers May 23, 1986 11:08:35 am PDT PROC [chan: SCPrivate.MaxChanSr, rowChan: SCPrivate.RowChan] RETURNS [quit: BOOL _ FALSE]; create hash table Enumerate hash table and create Loads file Κσ˜Icodešœ™Kšœ)™)K˜šΟk ˜ K˜K˜Kšœ˜K˜ Kšœ˜K˜ K˜K˜Kšœ ˜ Kšœ˜K˜ Kšœ ˜ —K˜KšΠln œœ˜Kšœ œ'˜?Kšœ ˜Kšœ˜K˜Kšœ œœ ˜šœ œœ˜K˜K˜K˜—šΟn œœ=˜NšŸœ#˜+Kšœœ˜Kšœœœ˜Kšœœœ˜Kšœœ˜Kšœœ˜ K˜1Kš œœœœœœ˜K˜LK˜K˜2Kšœœœœ ˜ K˜K˜K˜—šŸœœœ œ#˜JšŸ œ ˜+Kšœ9œœœ™ZKšœ!Οc˜6K˜—K˜K˜0Kšœ™KšœL˜LKšœ*˜*K™*K˜—K˜Kšœ˜—…— ώ Λ