~ BEGIN
ROPE: TYPE ~ Rope.ROPE;
Init: PROC ~{
elPQRect: RTBasic.PQRect;
vPQRectList: RTBasic.PQRectList ← LIST [elPQRect];
elT2322: REF ANY;
vArcList: RouteDiGraph.ArcList ← LIST [elT2322];
elPin: Route.Pin;
vPinList: Route.PinList ← LIST [elPin];
elChanPin: RouteChannel.ChanPin;
vChanPinList: RouteChannel.ChanPinList ← LIST [elChanPin];
elInternPin: RouteChannel.InternPin;
vInternPinList: RouteChannel.InternPinList ← LIST [elInternPin];
elROPE: ROPE;
vT2225: LIST OF ROPE ← LIST [elROPE];
type: SafeStorage.Type;
type ← CODE[Route.ResultDataRec];
RefIOPrivate.RegisterTypeProcs[type, " 51688 21688 24843 48577", ReadResultData, WriteResultData];
type ← SafeStorage.GetReferentType[vT2225];
RefIOPrivate.RegisterTypeProcs[type, " 32927 22523 58564 33033", ReadT2225, WriteT2225];
type ← SafeStorage.GetReferentType[vInternPinList];
RefIOPrivate.RegisterTypeProcs[type, " 3892 1107 49791 29566", ReadInternPinList, WriteInternPinList];
type ← CODE[RouteChannel.InternPinRec];
RefIOPrivate.RegisterTypeProcs[type, " 17834 29454 62958 38739", ReadInternPin, WriteInternPin];
type ← CODE[Route.PinRec];
RefIOPrivate.RegisterTypeProcs[type, " 53024 27553 24843 49913", ReadPin, WritePin];
type ← CODE[Route.DesignRulesRec];
RefIOPrivate.RegisterTypeProcs[type, " 49110 26708 24843 45999", ReadDesignRules, WriteDesignRules];
type ← CODE[RoutePrivate.RoutingAreaParmsRec];
RefIOPrivate.RegisterTypeProcs[type, " 61692 58598 41274 43664", ReadRoutingAreaParms, WriteRoutingAreaParms];
type ← CODE[RouteChannel.ChannelDataRec];
RefIOPrivate.RegisterTypeProcs[type, " 25885 43716 62958 46790", ReadChannelData, WriteChannelData];
type ← CODE[RouteChannel.ChanParmsRec];
RefIOPrivate.RegisterTypeProcs[type, " 21645 31952 62958 42550", ReadChanParms, WriteChanParms];
type ← CODE[RouteChannel.RoutingChannelPinsRec];
RefIOPrivate.RegisterTypeProcs[type, " 8310 29774 62958 29215", ReadRoutingChannelPins, WriteRoutingChannelPins];
type ← CODE[RouteChannel.PinPositionRec];
RefIOPrivate.RegisterTypeProcs[type, " 15784 17812 62958 36689", ReadPinPosition, WritePinPosition];
type ← SafeStorage.GetReferentType[vChanPinList];
RefIOPrivate.RegisterTypeProcs[type, " 1859 42197 49687 21052", ReadChanPinList, WriteChanPinList];
type ← CODE[RouteChannel.ChanPinRec];
RefIOPrivate.RegisterTypeProcs[type, " 8391 39453 62958 29296", ReadChanPin, WriteChanPin];
type ← CODE[RouteChannel.SegmentRec];
RefIOPrivate.RegisterTypeProcs[type, " 65055 48011 62958 20424", ReadSegment, WriteSegment];
type ← CODE[RoutePrivate.NetRec];
RefIOPrivate.RegisterTypeProcs[type, " 65525 34657 41274 47497", ReadNet, WriteNet];
type ← SafeStorage.GetReferentType[vPinList];
RefIOPrivate.RegisterTypeProcs[type, " 3797 27719 54562 13336", ReadPinList, WritePinList];
type ← CODE[RouteDiGraph.NodeRec];
RefIOPrivate.RegisterTypeProcs[type, " 50156 63500 53198 15889", ReadNode, WriteNode];
type ← SafeStorage.GetReferentType[vArcList];
RefIOPrivate.RegisterTypeProcs[type, " 2436 54738 32260 56644", ReadArcList, WriteArcList];
type ← CODE[RouteChannel.RoutingChannelTracksRec];
RefIOPrivate.RegisterTypeProcs[type, " 20180 27999 62958 41085", ReadRoutingChannelTracks, WriteRoutingChannelTracks];
type ← CODE[RouteChannel.TrackRec];
RefIOPrivate.RegisterTypeProcs[type, " 2118 62936 62958 23023", ReadTrack, WriteTrack];
type ← CODE[RouteChannel.RoutingChannelSidesRec];
RefIOPrivate.RegisterTypeProcs[type, " 21198 35447 62958 42103", ReadRoutingChannelSides, WriteRoutingChannelSides];
type ← SafeStorage.GetReferentType[vPQRectList];
RefIOPrivate.RegisterTypeProcs[type, " 27157 7959 21062 39753", ReadPQRectList, WritePQRectList];
type ← CODE[RouteDiGraph.GraphRec];
RefIOPrivate.RegisterTypeProcs[type, " 56018 12104 53198 21750", ReadGraph, WriteGraph];
};
ReadResultData: PUBLIC PROC[s: IO.STREAM, eachNameProc: RefIOPrivate.NameToRefProc] RETURNS [ref: REF] ~ {
vResultData: Route.ResultData ← NEW[Route.ResultDataRec];
[] ← IO.SkipWhitespace[s];
IF IO.GetChar[s]#'[ THEN RefIOPrivate.Error[IO.PutFR["Syntax error: '[ expected at %d", IO.int[IO.GetIndex[s]]]];
vResultData.polyLength ← IO.GetInt[s];
vResultData.metalLength ← IO.GetInt[s];
vResultData.metal2Length ← IO.GetInt[s];
vResultData.polyToMetal ← IO.GetInt[s];
vResultData.metalToMetal2 ← IO.GetInt[s];
vResultData.numTrunkTracks ← IO.GetInt[s];
vResultData.numIncompletes ← IO.GetInt[s];
[] ← IO.SkipWhitespace[s];
IF IO.GetChar[s]#'[ THEN RefIOPrivate.Error[IO.PutFR["Syntax error: '[ expected at %d", IO.int[IO.GetIndex[s]]]];
vResultData.routingRect.x1 ← IO.GetInt[s];
vResultData.routingRect.y1 ← IO.GetInt[s];
vResultData.routingRect.x2 ← IO.GetInt[s];
vResultData.routingRect.y2 ← IO.GetInt[s];
[] ← IO.SkipWhitespace[s];
IF IO.GetChar[s]#'] THEN RefIOPrivate.Error[IO.PutFR["Syntax error: '] expected at %d", IO.int[IO.GetIndex[s]]]];
{c: [0..2) ← IO.GetCard[s]-1;vResultData.moreAreaRequired ← VAL[c]};
TRUSTED {vResultData.incompleteNets ← NARROW[eachNameProc[vResultData , @vResultData.incompleteNets]]};
[] ← IO.SkipWhitespace[s];
IF IO.GetChar[s]#'] THEN RefIOPrivate.Error[IO.PutFR["Syntax error: '] expected at %d", IO.int[IO.GetIndex[s]]]];
RETURN[vResultData];
};
WriteResultData: PUBLIC PROC[s: IO.STREAM, ref: REF, eachRefProc: RefIOPrivate.RefToNameProc] ~ {
vResultData: Route.ResultData ← NARROW[ref];
IO.PutChar[s, '[ ];
IO.PutF[s, "%d ", IO.int[vResultData.polyLength]];
IO.PutF[s, "%d ", IO.int[vResultData.metalLength]];
IO.PutF[s, "%d ", IO.int[vResultData.metal2Length]];
IO.PutF[s, "%d ", IO.int[vResultData.polyToMetal]];
IO.PutF[s, "%d ", IO.int[vResultData.metalToMetal2]];
IO.PutF[s, "%d ", IO.int[vResultData.numTrunkTracks]];
IO.PutF[s, "%d ", IO.int[vResultData.numIncompletes]];
IO.PutChar[s, '[ ];
IO.PutF[s, "%d ", IO.int[vResultData.routingRect.x1]];
IO.PutF[s, "%d ", IO.int[vResultData.routingRect.y1]];
IO.PutF[s, "%d ", IO.int[vResultData.routingRect.x2]];
IO.PutF[s, "%d ", IO.int[vResultData.routingRect.y2]];
IO.PutChar[s, '] ];
IO.PutF[s, "%d ", IO.card[ORD[vResultData.moreAreaRequired]+1]];
eachRefProc[vResultData.incompleteNets];
IO.PutChar[s, '] ];
};
ReadT2225: PUBLIC PROC[s: IO.STREAM, eachNameProc: RefIOPrivate.NameToRefProc] RETURNS [ref: REF] ~ {
elROPE: ROPE;
vT2225: LIST OF ROPE ← LIST [elROPE];
[] ← IO.SkipWhitespace[s];
IF IO.GetChar[s]#'[ THEN RefIOPrivate.Error[IO.PutFR["Syntax error: '[ expected at %d", IO.int[IO.GetIndex[s]]]];
TRUSTED {vT2225.first ← NARROW[eachNameProc[vT2225 , @vT2225.first]]};
TRUSTED {vT2225.rest ← NARROW[eachNameProc[vT2225 , @vT2225.rest]]};
[] ← IO.SkipWhitespace[s];
IF IO.GetChar[s]#'] THEN RefIOPrivate.Error[IO.PutFR["Syntax error: '] expected at %d", IO.int[IO.GetIndex[s]]]];
RETURN[vT2225];
};
WriteT2225: PUBLIC PROC[s: IO.STREAM, ref: REF, eachRefProc: RefIOPrivate.RefToNameProc] ~ {
vT2225: LIST OF ROPE ← NARROW[ref];
IO.PutChar[s, '[ ];
eachRefProc[vT2225.first];
eachRefProc[vT2225.rest];
IO.PutChar[s, '] ];
};
ReadInternPinList: PUBLIC PROC[s: IO.STREAM, eachNameProc: RefIOPrivate.NameToRefProc] RETURNS [ref: REF] ~ {
elInternPin: RouteChannel.InternPin;
vInternPinList: RouteChannel.InternPinList ← LIST [elInternPin];
[] ← IO.SkipWhitespace[s];
IF IO.GetChar[s]#'[ THEN RefIOPrivate.Error[IO.PutFR["Syntax error: '[ expected at %d", IO.int[IO.GetIndex[s]]]];
TRUSTED {vInternPinList.first ← NARROW[eachNameProc[vInternPinList , @vInternPinList.first]]};
TRUSTED {vInternPinList.rest ← NARROW[eachNameProc[vInternPinList , @vInternPinList.rest]]};
[] ← IO.SkipWhitespace[s];
IF IO.GetChar[s]#'] THEN RefIOPrivate.Error[IO.PutFR["Syntax error: '] expected at %d", IO.int[IO.GetIndex[s]]]];
RETURN[vInternPinList];
};
WriteInternPinList: PUBLIC PROC[s: IO.STREAM, ref: REF, eachRefProc: RefIOPrivate.RefToNameProc] ~ {
vInternPinList: RouteChannel.InternPinList ← NARROW[ref];
IO.PutChar[s, '[ ];
eachRefProc[vInternPinList.first];
eachRefProc[vInternPinList.rest];
IO.PutChar[s, '] ];
};
ReadInternPin: PUBLIC PROC[s: IO.STREAM, eachNameProc: RefIOPrivate.NameToRefProc] RETURNS [ref: REF] ~ {
vInternPin: RouteChannel.InternPin ← NEW[RouteChannel.InternPinRec];
[] ← IO.SkipWhitespace[s];
IF IO.GetChar[s]#'[ THEN RefIOPrivate.Error[IO.PutFR["Syntax error: '[ expected at %d", IO.int[IO.GetIndex[s]]]];
TRUSTED {vInternPin.name ← NARROW[eachNameProc[vInternPin , @vInternPin.name]]};
{c: [0..5) ← IO.GetCard[s]-1;vInternPin.chanSide ← VAL[c]};
[] ← IO.SkipWhitespace[s];
IF IO.GetChar[s]#'[ THEN RefIOPrivate.Error[IO.PutFR["Syntax error: '[ expected at %d", IO.int[IO.GetIndex[s]]]];
vInternPin.location.p ← IO.GetInt[s];
vInternPin.location.q ← IO.GetInt[s];
[] ← IO.SkipWhitespace[s];
IF IO.GetChar[s]#'] THEN RefIOPrivate.Error[IO.PutFR["Syntax error: '] expected at %d", IO.int[IO.GetIndex[s]]]];
vInternPin.pWidth ← IO.GetInt[s];
{c: [0..3) ← IO.GetCard[s]-1;vInternPin.layer ← VAL[c]};
TRUSTED {vInternPin.pin ← NARROW[eachNameProc[vInternPin , @vInternPin.pin]]};
[] ← IO.SkipWhitespace[s];
IF IO.GetChar[s]#'] THEN RefIOPrivate.Error[IO.PutFR["Syntax error: '] expected at %d", IO.int[IO.GetIndex[s]]]];
RETURN[vInternPin];
};
WriteInternPin: PUBLIC PROC[s: IO.STREAM, ref: REF, eachRefProc: RefIOPrivate.RefToNameProc] ~ {
vInternPin: RouteChannel.InternPin ← NARROW[ref];
IO.PutChar[s, '[ ];
eachRefProc[vInternPin.name];
IO.PutF[s, "%d ", IO.card[ORD[vInternPin.chanSide]+1]];
IO.PutChar[s, '[ ];
IO.PutF[s, "%d ", IO.int[vInternPin.location.p]];
IO.PutF[s, "%d ", IO.int[vInternPin.location.q]];
IO.PutChar[s, '] ];
IO.PutF[s, "%d ", IO.int[vInternPin.pWidth]];
IO.PutF[s, "%d ", IO.card[ORD[vInternPin.layer]+1]];
eachRefProc[vInternPin.pin];
IO.PutChar[s, '] ];
};
ReadPin: PUBLIC PROC[s: IO.STREAM, eachNameProc: RefIOPrivate.NameToRefProc] RETURNS [ref: REF] ~ {
vPin: Route.Pin ← NEW[Route.PinRec];
[] ← IO.SkipWhitespace[s];
IF IO.GetChar[s]#'[ THEN RefIOPrivate.Error[IO.PutFR["Syntax error: '[ expected at %d", IO.int[IO.GetIndex[s]]]];
vPin.min ← IO.GetInt[s];
vPin.max ← IO.GetInt[s];
vPin.depth ← IO.GetInt[s];
vPin.layer ← IO.GetInt[s];
{c: [0..5) ← IO.GetCard[s]-1;vPin.side ← VAL[c]};
[] ← IO.SkipWhitespace[s];
IF IO.GetChar[s]#'] THEN RefIOPrivate.Error[IO.PutFR["Syntax error: '] expected at %d", IO.int[IO.GetIndex[s]]]];
RETURN[vPin];
};
WritePin: PUBLIC PROC[s: IO.STREAM, ref: REF, eachRefProc: RefIOPrivate.RefToNameProc] ~ {
vPin: Route.Pin ← NARROW[ref];
IO.PutChar[s, '[ ];
IO.PutF[s, "%d ", IO.int[vPin.min]];
IO.PutF[s, "%d ", IO.int[vPin.max]];
IO.PutF[s, "%d ", IO.int[vPin.depth]];
IO.PutF[s, "%d ", IO.int[vPin.layer]];
IO.PutF[s, "%d ", IO.card[ORD[vPin.side]+1]];
IO.PutChar[s, '] ];
};
ReadDesignRules: PUBLIC PROC[s: IO.STREAM, eachNameProc: RefIOPrivate.NameToRefProc] RETURNS [ref: REF] ~ {
vDesignRules: Route.DesignRules ← NEW[Route.DesignRulesRec];
[] ← IO.SkipWhitespace[s];
IF IO.GetChar[s]#'[ THEN RefIOPrivate.Error[IO.PutFR["Syntax error: '[ expected at %d", IO.int[IO.GetIndex[s]]]];
vDesignRules.trunkLayer ← IO.GetInt[s];
vDesignRules.branchLayer ← IO.GetInt[s];
{c: [0..2) ← IO.GetCard[s]-1;vDesignRules.trunkDirection ← VAL[c]};
{c: [0..2) ← IO.GetCard[s]-1;vDesignRules.branchDirection ← VAL[c]};
vDesignRules.trunkWidth ← IO.GetInt[s];
vDesignRules.trunkSpacing ← IO.GetInt[s];
vDesignRules.trunkToContact ← IO.GetInt[s];
vDesignRules.trunkToTrunk ← IO.GetInt[s];
vDesignRules.trunkOffset ← IO.GetInt[s];
vDesignRules.branchWidth ← IO.GetInt[s];
vDesignRules.branchSpacing ← IO.GetInt[s];
vDesignRules.branchToContact ← IO.GetInt[s];
vDesignRules.branchToBranch ← IO.GetInt[s];
vDesignRules.branchOffset ← IO.GetInt[s];
vDesignRules.contactSize ← IO.GetInt[s];
vDesignRules.contactToContact ← IO.GetInt[s];
vDesignRules.pinSpacing ← IO.GetInt[s];
vDesignRules.trunkToEdge ← IO.GetInt[s];
[] ← IO.SkipWhitespace[s];
IF IO.GetChar[s]#'] THEN RefIOPrivate.Error[IO.PutFR["Syntax error: '] expected at %d", IO.int[IO.GetIndex[s]]]];
RETURN[vDesignRules];
};
WriteDesignRules: PUBLIC PROC[s: IO.STREAM, ref: REF, eachRefProc: RefIOPrivate.RefToNameProc] ~ {
vDesignRules: Route.DesignRules ← NARROW[ref];
IO.PutChar[s, '[ ];
IO.PutF[s, "%d ", IO.int[vDesignRules.trunkLayer]];
IO.PutF[s, "%d ", IO.int[vDesignRules.branchLayer]];
IO.PutF[s, "%d ", IO.card[ORD[vDesignRules.trunkDirection]+1]];
IO.PutF[s, "%d ", IO.card[ORD[vDesignRules.branchDirection]+1]];
IO.PutF[s, "%d ", IO.int[vDesignRules.trunkWidth]];
IO.PutF[s, "%d ", IO.int[vDesignRules.trunkSpacing]];
IO.PutF[s, "%d ", IO.int[vDesignRules.trunkToContact]];
IO.PutF[s, "%d ", IO.int[vDesignRules.trunkToTrunk]];
IO.PutF[s, "%d ", IO.int[vDesignRules.trunkOffset]];
IO.PutF[s, "%d ", IO.int[vDesignRules.branchWidth]];
IO.PutF[s, "%d ", IO.int[vDesignRules.branchSpacing]];
IO.PutF[s, "%d ", IO.int[vDesignRules.branchToContact]];
IO.PutF[s, "%d ", IO.int[vDesignRules.branchToBranch]];
IO.PutF[s, "%d ", IO.int[vDesignRules.branchOffset]];
IO.PutF[s, "%d ", IO.int[vDesignRules.contactSize]];
IO.PutF[s, "%d ", IO.int[vDesignRules.contactToContact]];
IO.PutF[s, "%d ", IO.int[vDesignRules.pinSpacing]];
IO.PutF[s, "%d ", IO.int[vDesignRules.trunkToEdge]];
IO.PutChar[s, '] ];
};
ReadRoutingAreaParms: PUBLIC PROC[s: IO.STREAM, eachNameProc: RefIOPrivate.NameToRefProc] RETURNS [ref: REF] ~ {
vRoutingAreaParms: RoutePrivate.RoutingAreaParms ← NEW[RoutePrivate.RoutingAreaParmsRec];
[] ← IO.SkipWhitespace[s];
IF IO.GetChar[s]#'[ THEN RefIOPrivate.Error[IO.PutFR["Syntax error: '[ expected at %d", IO.int[IO.GetIndex[s]]]];
{c: [0..3) ← IO.GetCard[s]-1;vRoutingAreaParms.routerUsed ← VAL[c]};
[] ← IO.SkipWhitespace[s];
IF IO.GetChar[s]#'[ THEN RefIOPrivate.Error[IO.PutFR["Syntax error: '[ expected at %d", IO.int[IO.GetIndex[s]]]];
vRoutingAreaParms.routingRect.x1 ← IO.GetInt[s];
vRoutingAreaParms.routingRect.y1 ← IO.GetInt[s];
vRoutingAreaParms.routingRect.x2 ← IO.GetInt[s];
vRoutingAreaParms.routingRect.y2 ← IO.GetInt[s];
[] ← IO.SkipWhitespace[s];
IF IO.GetChar[s]#'] THEN RefIOPrivate.Error[IO.PutFR["Syntax error: '] expected at %d", IO.int[IO.GetIndex[s]]]];
vRoutingAreaParms.widestPin ← IO.GetInt[s];
vRoutingAreaParms.widestTrunk ← IO.GetInt[s];
vRoutingAreaParms.widestBranch ← IO.GetInt[s];
vRoutingAreaParms.numTracksToUse ← IO.GetInt[s];
vRoutingAreaParms.lambda ← IO.GetInt[s];
vRoutingAreaParms.metalLayer ← IO.GetInt[s];
vRoutingAreaParms.metal2Layer ← IO.GetInt[s];
vRoutingAreaParms.polyLayer ← IO.GetInt[s];
TRUSTED {vRoutingAreaParms.viaTable ← NARROW[eachNameProc[vRoutingAreaParms , @vRoutingAreaParms.viaTable]]};
TRUSTED {vRoutingAreaParms.entityTable ← NARROW[eachNameProc[vRoutingAreaParms , @vRoutingAreaParms.entityTable]]};
[] ← IO.SkipWhitespace[s];
IF IO.GetChar[s]#'] THEN RefIOPrivate.Error[IO.PutFR["Syntax error: '] expected at %d", IO.int[IO.GetIndex[s]]]];
RETURN[vRoutingAreaParms];
};
WriteRoutingAreaParms: PUBLIC PROC[s: IO.STREAM, ref: REF, eachRefProc: RefIOPrivate.RefToNameProc] ~ {
vRoutingAreaParms: RoutePrivate.RoutingAreaParms ← NARROW[ref];
IO.PutChar[s, '[ ];
IO.PutF[s, "%d ", IO.card[ORD[vRoutingAreaParms.routerUsed]+1]];
IO.PutChar[s, '[ ];
IO.PutF[s, "%d ", IO.int[vRoutingAreaParms.routingRect.x1]];
IO.PutF[s, "%d ", IO.int[vRoutingAreaParms.routingRect.y1]];
IO.PutF[s, "%d ", IO.int[vRoutingAreaParms.routingRect.x2]];
IO.PutF[s, "%d ", IO.int[vRoutingAreaParms.routingRect.y2]];
IO.PutChar[s, '] ];
IO.PutF[s, "%d ", IO.int[vRoutingAreaParms.widestPin]];
IO.PutF[s, "%d ", IO.int[vRoutingAreaParms.widestTrunk]];
IO.PutF[s, "%d ", IO.int[vRoutingAreaParms.widestBranch]];
IO.PutF[s, "%d ", IO.int[vRoutingAreaParms.numTracksToUse]];
IO.PutF[s, "%d ", IO.int[vRoutingAreaParms.lambda]];
IO.PutF[s, "%d ", IO.int[vRoutingAreaParms.metalLayer]];
IO.PutF[s, "%d ", IO.int[vRoutingAreaParms.metal2Layer]];
IO.PutF[s, "%d ", IO.int[vRoutingAreaParms.polyLayer]];
eachRefProc[vRoutingAreaParms.viaTable];
eachRefProc[vRoutingAreaParms.entityTable];
IO.PutChar[s, '] ];
};
ReadChannelData: PUBLIC PROC[s: IO.STREAM, eachNameProc: RefIOPrivate.NameToRefProc] RETURNS [ref: REF] ~ {
vChannelData: RouteChannel.ChannelData ← NEW[RouteChannel.ChannelDataRec];
[] ← IO.SkipWhitespace[s];
IF IO.GetChar[s]#'[ THEN RefIOPrivate.Error[IO.PutFR["Syntax error: '[ expected at %d", IO.int[IO.GetIndex[s]]]];
TRUSTED {vChannelData.constraints ← NARROW[eachNameProc[vChannelData , @vChannelData.constraints]]};
[] ← IO.SkipWhitespace[s];
IF IO.GetChar[s]#'( THEN RefIOPrivate.Error[IO.PutFR["Syntax error: '( expected at %d", IO.int[IO.GetIndex[s]]]];
FOR i: RouteChannel.ChanSide IN RouteChannel.ChanSide DO
TRUSTED {vChannelData.chanSides[i] ← NARROW[eachNameProc[vChannelData , @vChannelData.chanSides[i]]]};
ENDLOOP;
[] ← IO.SkipWhitespace[s];
IF IO.GetChar[s]#') THEN RefIOPrivate.Error[IO.PutFR["Syntax error: ') expected at %d", IO.int[IO.GetIndex[s]]]];
TRUSTED {vChannelData.chanTracks ← NARROW[eachNameProc[vChannelData , @vChannelData.chanTracks]]};
TRUSTED {vChannelData.chanPins ← NARROW[eachNameProc[vChannelData , @vChannelData.chanPins]]};
TRUSTED {vChannelData.chanParms ← NARROW[eachNameProc[vChannelData , @vChannelData.chanParms]]};
[] ← IO.SkipWhitespace[s];
IF IO.GetChar[s]#'] THEN RefIOPrivate.Error[IO.PutFR["Syntax error: '] expected at %d", IO.int[IO.GetIndex[s]]]];
RETURN[vChannelData];
};
WriteChannelData: PUBLIC PROC[s: IO.STREAM, ref: REF, eachRefProc: RefIOPrivate.RefToNameProc] ~ {
vChannelData: RouteChannel.ChannelData ← NARROW[ref];
IO.PutChar[s, '[ ];
eachRefProc[vChannelData.constraints];
IO.PutChar[s, '( ];
FOR i: RouteChannel.ChanSide IN RouteChannel.ChanSide DO
eachRefProc[vChannelData.chanSides[i]];
ENDLOOP;
IO.PutChar[s, ') ];
eachRefProc[vChannelData.chanTracks];
eachRefProc[vChannelData.chanPins];
eachRefProc[vChannelData.chanParms];
IO.PutChar[s, '] ];
};
ReadChanParms: PUBLIC PROC[s: IO.STREAM, eachNameProc: RefIOPrivate.NameToRefProc] RETURNS [ref: REF] ~ {
vChanParms: RouteChannel.ChanParms ← NEW[RouteChannel.ChanParmsRec];
[] ← IO.SkipWhitespace[s];
IF IO.GetChar[s]#'[ THEN RefIOPrivate.Error[IO.PutFR["Syntax error: '[ expected at %d", IO.int[IO.GetIndex[s]]]];
vChanParms.maxToConvert ← IO.GetInt[s];
vChanParms.emptyTrackLimit ← IO.GetInt[s];
[] ← IO.SkipWhitespace[s];
IF IO.GetChar[s]#'] THEN RefIOPrivate.Error[IO.PutFR["Syntax error: '] expected at %d", IO.int[IO.GetIndex[s]]]];
RETURN[vChanParms];
};
WriteChanParms: PUBLIC PROC[s: IO.STREAM, ref: REF, eachRefProc: RefIOPrivate.RefToNameProc] ~ {
vChanParms: RouteChannel.ChanParms ← NARROW[ref];
IO.PutChar[s, '[ ];
IO.PutF[s, "%d ", IO.int[vChanParms.maxToConvert]];
IO.PutF[s, "%d ", IO.int[vChanParms.emptyTrackLimit]];
IO.PutChar[s, '] ];
};
ReadRoutingChannelPins: PUBLIC PROC[s: IO.STREAM, eachNameProc: RefIOPrivate.NameToRefProc] RETURNS [ref: REF] ~ {
vRoutingChannelPins: RouteChannel.RoutingChannelPins ← NEW[RouteChannel.RoutingChannelPinsRec];
[] ← IO.SkipWhitespace[s];
IF IO.GetChar[s]#'[ THEN RefIOPrivate.Error[IO.PutFR["Syntax error: '[ expected at %d", IO.int[IO.GetIndex[s]]]];
vRoutingChannelPins.cEnd1 ← IO.GetInt[s];
vRoutingChannelPins.cEnd2 ← IO.GetInt[s];
vRoutingChannelPins.count ← IO.GetInt[s];
vRoutingChannelPins.size ← IO.GetInt[s];
[] ← IO.SkipWhitespace[s];
IF IO.GetChar[s]#'( THEN RefIOPrivate.Error[IO.PutFR["Syntax error: '( expected at %d", IO.int[IO.GetIndex[s]]]];
FOR i: RouteChannel.MPinsOnCh IN RouteChannel.MPinsOnCh DO
TRUSTED {vRoutingChannelPins.sides[i] ← NARROW[eachNameProc[vRoutingChannelPins , @vRoutingChannelPins.sides[i]]]};
ENDLOOP;
[] ← IO.SkipWhitespace[s];
IF IO.GetChar[s]#') THEN RefIOPrivate.Error[IO.PutFR["Syntax error: ') expected at %d", IO.int[IO.GetIndex[s]]]];
[] ← IO.SkipWhitespace[s];
IF IO.GetChar[s]#'] THEN RefIOPrivate.Error[IO.PutFR["Syntax error: '] expected at %d", IO.int[IO.GetIndex[s]]]];
RETURN[vRoutingChannelPins];
};
WriteRoutingChannelPins: PUBLIC PROC[s: IO.STREAM, ref: REF, eachRefProc: RefIOPrivate.RefToNameProc] ~ {
vRoutingChannelPins: RouteChannel.RoutingChannelPins ← NARROW[ref];
IO.PutChar[s, '[ ];
IO.PutF[s, "%d ", IO.int[vRoutingChannelPins.cEnd1]];
IO.PutF[s, "%d ", IO.int[vRoutingChannelPins.cEnd2]];
IO.PutF[s, "%d ", IO.int[vRoutingChannelPins.count]];
IO.PutF[s, "%d ", IO.int[vRoutingChannelPins.size]];
IO.PutChar[s, '( ];
FOR i: RouteChannel.MPinsOnCh IN RouteChannel.MPinsOnCh DO
eachRefProc[vRoutingChannelPins.sides[i]];
ENDLOOP;
IO.PutChar[s, ') ];
IO.PutChar[s, '] ];
};
ReadPinPosition: PUBLIC PROC[s: IO.STREAM, eachNameProc: RefIOPrivate.NameToRefProc] RETURNS [ref: REF] ~ {
vPinPosition: RouteChannel.PinPosition ← NEW[RouteChannel.PinPositionRec];
[] ← IO.SkipWhitespace[s];
IF IO.GetChar[s]#'[ THEN RefIOPrivate.Error[IO.PutFR["Syntax error: '[ expected at %d", IO.int[IO.GetIndex[s]]]];
vPinPosition.pinIndex ← IO.GetInt[s];
vPinPosition.pLoc ← IO.GetInt[s];
{c: [0..2) ← IO.GetCard[s]-1;vPinPosition.blocked ← VAL[c]};
[] ← IO.SkipWhitespace[s];
IF IO.GetChar[s]#'( THEN RefIOPrivate.Error[IO.PutFR["Syntax error: '( expected at %d", IO.int[IO.GetIndex[s]]]];
FOR i: RouteChannel.ChanTBSide IN RouteChannel.ChanTBSide DO
TRUSTED {vPinPosition.pins[i] ← NARROW[eachNameProc[vPinPosition , @vPinPosition.pins[i]]]};
ENDLOOP;
[] ← IO.SkipWhitespace[s];
IF IO.GetChar[s]#') THEN RefIOPrivate.Error[IO.PutFR["Syntax error: ') expected at %d", IO.int[IO.GetIndex[s]]]];
TRUSTED {vPinPosition.innerPins ← NARROW[eachNameProc[vPinPosition , @vPinPosition.innerPins]]};
[] ← IO.SkipWhitespace[s];
IF IO.GetChar[s]#'] THEN RefIOPrivate.Error[IO.PutFR["Syntax error: '] expected at %d", IO.int[IO.GetIndex[s]]]];
RETURN[vPinPosition];
};
WritePinPosition: PUBLIC PROC[s: IO.STREAM, ref: REF, eachRefProc: RefIOPrivate.RefToNameProc] ~ {
vPinPosition: RouteChannel.PinPosition ← NARROW[ref];
IO.PutChar[s, '[ ];
IO.PutF[s, "%d ", IO.int[vPinPosition.pinIndex]];
IO.PutF[s, "%d ", IO.int[vPinPosition.pLoc]];
IO.PutF[s, "%d ", IO.card[ORD[vPinPosition.blocked]+1]];
IO.PutChar[s, '( ];
FOR i: RouteChannel.ChanTBSide IN RouteChannel.ChanTBSide DO
eachRefProc[vPinPosition.pins[i]];
ENDLOOP;
IO.PutChar[s, ') ];
eachRefProc[vPinPosition.innerPins];
IO.PutChar[s, '] ];
};
ReadChanPinList: PUBLIC PROC[s: IO.STREAM, eachNameProc: RefIOPrivate.NameToRefProc] RETURNS [ref: REF] ~ {
elChanPin: RouteChannel.ChanPin;
vChanPinList: RouteChannel.ChanPinList ← LIST [elChanPin];
[] ← IO.SkipWhitespace[s];
IF IO.GetChar[s]#'[ THEN RefIOPrivate.Error[IO.PutFR["Syntax error: '[ expected at %d", IO.int[IO.GetIndex[s]]]];
TRUSTED {vChanPinList.first ← NARROW[eachNameProc[vChanPinList , @vChanPinList.first]]};
TRUSTED {vChanPinList.rest ← NARROW[eachNameProc[vChanPinList , @vChanPinList.rest]]};
[] ← IO.SkipWhitespace[s];
IF IO.GetChar[s]#'] THEN RefIOPrivate.Error[IO.PutFR["Syntax error: '] expected at %d", IO.int[IO.GetIndex[s]]]];
RETURN[vChanPinList];
};
WriteChanPinList: PUBLIC PROC[s: IO.STREAM, ref: REF, eachRefProc: RefIOPrivate.RefToNameProc] ~ {
vChanPinList: RouteChannel.ChanPinList ← NARROW[ref];
IO.PutChar[s, '[ ];
eachRefProc[vChanPinList.first];
eachRefProc[vChanPinList.rest];
IO.PutChar[s, '] ];
};
ReadChanPin: PUBLIC PROC[s: IO.STREAM, eachNameProc: RefIOPrivate.NameToRefProc] RETURNS [ref: REF] ~ {
vChanPin: RouteChannel.ChanPin ← NEW[RouteChannel.ChanPinRec];
[] ← IO.SkipWhitespace[s];
IF IO.GetChar[s]#'[ THEN RefIOPrivate.Error[IO.PutFR["Syntax error: '[ expected at %d", IO.int[IO.GetIndex[s]]]];
{c: [0..5) ← IO.GetCard[s]-1;vChanPin.pinSide ← VAL[c]};
vChanPin.qLoc ← IO.GetInt[s];
vChanPin.pWidth ← IO.GetInt[s];
{c: [0..5) ← IO.GetCard[s]-1;vChanPin.kindOfPin ← VAL[c]};
TRUSTED {vChanPin.pinPosition ← NARROW[eachNameProc[vChanPin , @vChanPin.pinPosition]]};
vChanPin.trackConstraint ← IO.GetInt[s];
[] ← IO.SkipWhitespace[s];
IF IO.GetChar[s]#'( THEN RefIOPrivate.Error[IO.PutFR["Syntax error: '( expected at %d", IO.int[IO.GetIndex[s]]]];
FOR i: RouteChannel.ChanLRSide IN RouteChannel.ChanLRSide DO
TRUSTED {vChanPin.conctSeg[i] ← NARROW[eachNameProc[vChanPin , @vChanPin.conctSeg[i]]]};
ENDLOOP;
[] ← IO.SkipWhitespace[s];
IF IO.GetChar[s]#') THEN RefIOPrivate.Error[IO.PutFR["Syntax error: ') expected at %d", IO.int[IO.GetIndex[s]]]];
[] ← IO.SkipWhitespace[s];
IF IO.GetChar[s]#'( THEN RefIOPrivate.Error[IO.PutFR["Syntax error: '( expected at %d", IO.int[IO.GetIndex[s]]]];
FOR i: RouteChannel.ChanLRSide IN RouteChannel.ChanLRSide DO
TRUSTED {vChanPin.altConctSeg[i] ← NARROW[eachNameProc[vChanPin , @vChanPin.altConctSeg[i]]]};
ENDLOOP;
[] ← IO.SkipWhitespace[s];
IF IO.GetChar[s]#') THEN RefIOPrivate.Error[IO.PutFR["Syntax error: ') expected at %d", IO.int[IO.GetIndex[s]]]];
TRUSTED {vChanPin.pin ← NARROW[eachNameProc[vChanPin , @vChanPin.pin]]};
[] ← IO.SkipWhitespace[s];
IF IO.GetChar[s]#'] THEN RefIOPrivate.Error[IO.PutFR["Syntax error: '] expected at %d", IO.int[IO.GetIndex[s]]]];
RETURN[vChanPin];
};
WriteChanPin: PUBLIC PROC[s: IO.STREAM, ref: REF, eachRefProc: RefIOPrivate.RefToNameProc] ~ {
vChanPin: RouteChannel.ChanPin ← NARROW[ref];
IO.PutChar[s, '[ ];
IO.PutF[s, "%d ", IO.card[ORD[vChanPin.pinSide]+1]];
IO.PutF[s, "%d ", IO.int[vChanPin.qLoc]];
IO.PutF[s, "%d ", IO.int[vChanPin.pWidth]];
IO.PutF[s, "%d ", IO.card[ORD[vChanPin.kindOfPin]+1]];
eachRefProc[vChanPin.pinPosition];
IO.PutF[s, "%d ", IO.int[vChanPin.trackConstraint]];
IO.PutChar[s, '( ];
FOR i: RouteChannel.ChanLRSide IN RouteChannel.ChanLRSide DO
eachRefProc[vChanPin.conctSeg[i]];
ENDLOOP;
IO.PutChar[s, ') ];
IO.PutChar[s, '( ];
FOR i: RouteChannel.ChanLRSide IN RouteChannel.ChanLRSide DO
eachRefProc[vChanPin.altConctSeg[i]];
ENDLOOP;
IO.PutChar[s, ') ];
eachRefProc[vChanPin.pin];
IO.PutChar[s, '] ];
};
ReadSegment: PUBLIC PROC[s: IO.STREAM, eachNameProc: RefIOPrivate.NameToRefProc] RETURNS [ref: REF] ~ {
vSegment: RouteChannel.Segment ← NEW[RouteChannel.SegmentRec];
[] ← IO.SkipWhitespace[s];
IF IO.GetChar[s]#'[ THEN RefIOPrivate.Error[IO.PutFR["Syntax error: '[ expected at %d", IO.int[IO.GetIndex[s]]]];
[] ← IO.SkipWhitespace[s];
IF IO.GetChar[s]#'( THEN RefIOPrivate.Error[IO.PutFR["Syntax error: '( expected at %d", IO.int[IO.GetIndex[s]]]];
FOR i: RouteChannel.ChanLRSide IN RouteChannel.ChanLRSide DO
TRUSTED {vSegment.exteriorPins[i] ← NARROW[eachNameProc[vSegment , @vSegment.exteriorPins[i]]]};
ENDLOOP;
[] ← IO.SkipWhitespace[s];
IF IO.GetChar[s]#') THEN RefIOPrivate.Error[IO.PutFR["Syntax error: ') expected at %d", IO.int[IO.GetIndex[s]]]];
TRUSTED {vSegment.interiorPins ← NARROW[eachNameProc[vSegment , @vSegment.interiorPins]]};
{c: [0..3) ← IO.GetCard[s]-1;vSegment.routingLayer ← VAL[c]};
vSegment.qWidth ← IO.GetInt[s];
TRUSTED {vSegment.constraintNode ← NARROW[eachNameProc[vSegment , @vSegment.constraintNode]]};
vSegment.trackNum ← IO.GetInt[s];
vSegment.trackConstraint ← IO.GetInt[s];
vSegment.secTrackConstraint ← IO.GetInt[s];
TRUSTED {vSegment.nextSeg ← NARROW[eachNameProc[vSegment , @vSegment.nextSeg]]};
TRUSTED {vSegment.net ← NARROW[eachNameProc[vSegment , @vSegment.net]]};
vSegment.part ← IO.GetInt[s];
{c: [0..2) ← IO.GetCard[s]-1;vSegment.failed ← VAL[c]};
{c: [0..2) ← IO.GetCard[s]-1;vSegment.exitBreak ← VAL[c]};
[] ← IO.SkipWhitespace[s];
IF IO.GetChar[s]#'] THEN RefIOPrivate.Error[IO.PutFR["Syntax error: '] expected at %d", IO.int[IO.GetIndex[s]]]];
RETURN[vSegment];
};
WriteSegment: PUBLIC PROC[s: IO.STREAM, ref: REF, eachRefProc: RefIOPrivate.RefToNameProc] ~ {
vSegment: RouteChannel.Segment ← NARROW[ref];
IO.PutChar[s, '[ ];
IO.PutChar[s, '( ];
FOR i: RouteChannel.ChanLRSide IN RouteChannel.ChanLRSide DO
eachRefProc[vSegment.exteriorPins[i]];
ENDLOOP;
IO.PutChar[s, ') ];
eachRefProc[vSegment.interiorPins];
IO.PutF[s, "%d ", IO.card[ORD[vSegment.routingLayer]+1]];
IO.PutF[s, "%d ", IO.int[vSegment.qWidth]];
eachRefProc[vSegment.constraintNode];
IO.PutF[s, "%d ", IO.int[vSegment.trackNum]];
IO.PutF[s, "%d ", IO.int[vSegment.trackConstraint]];
IO.PutF[s, "%d ", IO.int[vSegment.secTrackConstraint]];
eachRefProc[vSegment.nextSeg];
eachRefProc[vSegment.net];
IO.PutF[s, "%d ", IO.int[vSegment.part]];
IO.PutF[s, "%d ", IO.card[ORD[vSegment.failed]+1]];
IO.PutF[s, "%d ", IO.card[ORD[vSegment.exitBreak]+1]];
IO.PutChar[s, '] ];
};
ReadNet: PUBLIC PROC[s: IO.STREAM, eachNameProc: RefIOPrivate.NameToRefProc] RETURNS [ref: REF] ~ {
vNet: RoutePrivate.Net ← NEW[RoutePrivate.NetRec];
[] ← IO.SkipWhitespace[s];
IF IO.GetChar[s]#'[ THEN RefIOPrivate.Error[IO.PutFR["Syntax error: '[ expected at %d", IO.int[IO.GetIndex[s]]]];
TRUSTED {vNet.name ← NARROW[eachNameProc[vNet , @vNet.name]]};
vNet.num ← IO.GetInt[s];
vNet.branchWidth ← IO.GetInt[s];
vNet.trunkWidth ← IO.GetInt[s];
TRUSTED {vNet.pinList ← NARROW[eachNameProc[vNet , @vNet.pinList]]};
TRUSTED {vNet.internPinList ← NARROW[eachNameProc[vNet , @vNet.internPinList]]};
TRUSTED {vNet.netData ← NARROW[eachNameProc[vNet , @vNet.netData]]};
{c: [0..2) ← IO.GetCard[s]-1;vNet.mayExit ← VAL[c]};
[] ← IO.SkipWhitespace[s];
IF IO.GetChar[s]#'] THEN RefIOPrivate.Error[IO.PutFR["Syntax error: '] expected at %d", IO.int[IO.GetIndex[s]]]];
RETURN[vNet];
};
WriteNet: PUBLIC PROC[s: IO.STREAM, ref: REF, eachRefProc: RefIOPrivate.RefToNameProc] ~ {
vNet: RoutePrivate.Net ← NARROW[ref];
IO.PutChar[s, '[ ];
eachRefProc[vNet.name];
IO.PutF[s, "%d ", IO.int[vNet.num]];
IO.PutF[s, "%d ", IO.int[vNet.branchWidth]];
IO.PutF[s, "%d ", IO.int[vNet.trunkWidth]];
eachRefProc[vNet.pinList];
eachRefProc[vNet.internPinList];
eachRefProc[vNet.netData];
IO.PutF[s, "%d ", IO.card[ORD[vNet.mayExit]+1]];
IO.PutChar[s, '] ];
};
ReadPinList: PUBLIC PROC[s: IO.STREAM, eachNameProc: RefIOPrivate.NameToRefProc] RETURNS [ref: REF] ~ {
elPin: Route.Pin;
vPinList: Route.PinList ← LIST [elPin];
[] ← IO.SkipWhitespace[s];
IF IO.GetChar[s]#'[ THEN RefIOPrivate.Error[IO.PutFR["Syntax error: '[ expected at %d", IO.int[IO.GetIndex[s]]]];
TRUSTED {vPinList.first ← NARROW[eachNameProc[vPinList , @vPinList.first]]};
TRUSTED {vPinList.rest ← NARROW[eachNameProc[vPinList , @vPinList.rest]]};
[] ← IO.SkipWhitespace[s];
IF IO.GetChar[s]#'] THEN RefIOPrivate.Error[IO.PutFR["Syntax error: '] expected at %d", IO.int[IO.GetIndex[s]]]];
RETURN[vPinList];
};
WritePinList: PUBLIC PROC[s: IO.STREAM, ref: REF, eachRefProc: RefIOPrivate.RefToNameProc] ~ {
vPinList: Route.PinList ← NARROW[ref];
IO.PutChar[s, '[ ];
eachRefProc[vPinList.first];
eachRefProc[vPinList.rest];
IO.PutChar[s, '] ];
};
ReadNode: PUBLIC PROC[s: IO.STREAM, eachNameProc: RefIOPrivate.NameToRefProc] RETURNS [ref: REF] ~ {
vNode: RouteDiGraph.Node ← NEW[RouteDiGraph.NodeRec];
[] ← IO.SkipWhitespace[s];
IF IO.GetChar[s]#'[ THEN RefIOPrivate.Error[IO.PutFR["Syntax error: '[ expected at %d", IO.int[IO.GetIndex[s]]]];
TRUSTED {vNode.nodeInfo ← NARROW[eachNameProc[vNode , @vNode.nodeInfo]]};
vNode.superiorParity ← IO.GetInt[s];
vNode.inferiorParity ← IO.GetInt[s];
TRUSTED {vNode.superiorArcs ← NARROW[eachNameProc[vNode , @vNode.superiorArcs]]};
TRUSTED {vNode.inferiorArcs ← NARROW[eachNameProc[vNode , @vNode.inferiorArcs]]};
[] ← IO.SkipWhitespace[s];
IF IO.GetChar[s]#'] THEN RefIOPrivate.Error[IO.PutFR["Syntax error: '] expected at %d", IO.int[IO.GetIndex[s]]]];
RETURN[vNode];
};
WriteNode: PUBLIC PROC[s: IO.STREAM, ref: REF, eachRefProc: RefIOPrivate.RefToNameProc] ~ {
vNode: RouteDiGraph.Node ← NARROW[ref];
IO.PutChar[s, '[ ];
eachRefProc[vNode.nodeInfo];
IO.PutF[s, "%d ", IO.int[vNode.superiorParity]];
IO.PutF[s, "%d ", IO.int[vNode.inferiorParity]];
eachRefProc[vNode.superiorArcs];
eachRefProc[vNode.inferiorArcs];
IO.PutChar[s, '] ];
};
ReadArcList: PUBLIC PROC[s: IO.STREAM, eachNameProc: RefIOPrivate.NameToRefProc] RETURNS [ref: REF] ~ {
elT2322: REF ANY;
vArcList: RouteDiGraph.ArcList ← LIST [elT2322];
[] ← IO.SkipWhitespace[s];
IF IO.GetChar[s]#'[ THEN RefIOPrivate.Error[IO.PutFR["Syntax error: '[ expected at %d", IO.int[IO.GetIndex[s]]]];
TRUSTED {vArcList.first ← NARROW[eachNameProc[vArcList , @vArcList.first]]};
TRUSTED {vArcList.rest ← NARROW[eachNameProc[vArcList , @vArcList.rest]]};
[] ← IO.SkipWhitespace[s];
IF IO.GetChar[s]#'] THEN RefIOPrivate.Error[IO.PutFR["Syntax error: '] expected at %d", IO.int[IO.GetIndex[s]]]];
RETURN[vArcList];
};
WriteArcList: PUBLIC PROC[s: IO.STREAM, ref: REF, eachRefProc: RefIOPrivate.RefToNameProc] ~ {
vArcList: RouteDiGraph.ArcList ← NARROW[ref];
IO.PutChar[s, '[ ];
eachRefProc[vArcList.first];
eachRefProc[vArcList.rest];
IO.PutChar[s, '] ];
};
ReadRoutingChannelTracks: PUBLIC PROC[s: IO.STREAM, eachNameProc: RefIOPrivate.NameToRefProc] RETURNS [ref: REF] ~ {
vRoutingChannelTracks: RouteChannel.RoutingChannelTracks ← NEW[RouteChannel.RoutingChannelTracksRec];
[] ← IO.SkipWhitespace[s];
IF IO.GetChar[s]#'[ THEN RefIOPrivate.Error[IO.PutFR["Syntax error: '[ expected at %d", IO.int[IO.GetIndex[s]]]];
vRoutingChannelTracks.count ← IO.GetInt[s];
vRoutingChannelTracks.maxCount ← IO.GetInt[s];
vRoutingChannelTracks.size ← IO.GetInt[s];
[] ← IO.SkipWhitespace[s];
IF IO.GetChar[s]#'( THEN RefIOPrivate.Error[IO.PutFR["Syntax error: '( expected at %d", IO.int[IO.GetIndex[s]]]];
FOR i: RouteChannel.MaxTracks IN RouteChannel.MaxTracks DO
TRUSTED {vRoutingChannelTracks.tracks[i] ← NARROW[eachNameProc[vRoutingChannelTracks , @vRoutingChannelTracks.tracks[i]]]};
ENDLOOP;
[] ← IO.SkipWhitespace[s];
IF IO.GetChar[s]#') THEN RefIOPrivate.Error[IO.PutFR["Syntax error: ') expected at %d", IO.int[IO.GetIndex[s]]]];
[] ← IO.SkipWhitespace[s];
IF IO.GetChar[s]#'] THEN RefIOPrivate.Error[IO.PutFR["Syntax error: '] expected at %d", IO.int[IO.GetIndex[s]]]];
RETURN[vRoutingChannelTracks];
};
WriteRoutingChannelTracks: PUBLIC PROC[s: IO.STREAM, ref: REF, eachRefProc: RefIOPrivate.RefToNameProc] ~ {
vRoutingChannelTracks: RouteChannel.RoutingChannelTracks ← NARROW[ref];
IO.PutChar[s, '[ ];
IO.PutF[s, "%d ", IO.int[vRoutingChannelTracks.count]];
IO.PutF[s, "%d ", IO.int[vRoutingChannelTracks.maxCount]];
IO.PutF[s, "%d ", IO.int[vRoutingChannelTracks.size]];
IO.PutChar[s, '( ];
FOR i: RouteChannel.MaxTracks IN RouteChannel.MaxTracks DO
eachRefProc[vRoutingChannelTracks.tracks[i]];
ENDLOOP;
IO.PutChar[s, ') ];
IO.PutChar[s, '] ];
};
ReadTrack: PUBLIC PROC[s: IO.STREAM, eachNameProc: RefIOPrivate.NameToRefProc] RETURNS [ref: REF] ~ {
vTrack: RouteChannel.Track ← NEW[RouteChannel.TrackRec];
[] ← IO.SkipWhitespace[s];
IF IO.GetChar[s]#'[ THEN RefIOPrivate.Error[IO.PutFR["Syntax error: '[ expected at %d", IO.int[IO.GetIndex[s]]]];
vTrack.oldTrackNum ← IO.GetInt[s];
vTrack.trackNum ← IO.GetInt[s];
vTrack.trackPos ← IO.GetInt[s];
vTrack.maxFeatureOnTrack ← IO.GetInt[s];
TRUSTED {vTrack.firstSeg ← NARROW[eachNameProc[vTrack , @vTrack.firstSeg]]};
{c: [0..2) ← IO.GetCard[s]-1;vTrack.blocked ← VAL[c]};
{c: [0..2) ← IO.GetCard[s]-1;vTrack.keep ← VAL[c]};
[] ← IO.SkipWhitespace[s];
IF IO.GetChar[s]#'] THEN RefIOPrivate.Error[IO.PutFR["Syntax error: '] expected at %d", IO.int[IO.GetIndex[s]]]];
RETURN[vTrack];
};
WriteTrack: PUBLIC PROC[s: IO.STREAM, ref: REF, eachRefProc: RefIOPrivate.RefToNameProc] ~ {
vTrack: RouteChannel.Track ← NARROW[ref];
IO.PutChar[s, '[ ];
IO.PutF[s, "%d ", IO.int[vTrack.oldTrackNum]];
IO.PutF[s, "%d ", IO.int[vTrack.trackNum]];
IO.PutF[s, "%d ", IO.int[vTrack.trackPos]];
IO.PutF[s, "%d ", IO.int[vTrack.maxFeatureOnTrack]];
eachRefProc[vTrack.firstSeg];
IO.PutF[s, "%d ", IO.card[ORD[vTrack.blocked]+1]];
IO.PutF[s, "%d ", IO.card[ORD[vTrack.keep]+1]];
IO.PutChar[s, '] ];
};
ReadRoutingChannelSides: PUBLIC PROC[s: IO.STREAM, eachNameProc: RefIOPrivate.NameToRefProc] RETURNS [ref: REF] ~ {
vRoutingChannelSides: RouteChannel.RoutingChannelSides ← NEW[RouteChannel.RoutingChannelSidesRec];
[] ← IO.SkipWhitespace[s];
IF IO.GetChar[s]#'[ THEN RefIOPrivate.Error[IO.PutFR["Syntax error: '[ expected at %d", IO.int[IO.GetIndex[s]]]];
vRoutingChannelSides.routeAreaCoord ← IO.GetInt[s];
{c: [0..5) ← IO.GetCard[s]-1;vRoutingChannelSides.extSide ← VAL[c]};
[] ← IO.SkipWhitespace[s];
IF IO.GetChar[s]#'( THEN RefIOPrivate.Error[IO.PutFR["Syntax error: '( expected at %d", IO.int[IO.GetIndex[s]]]];
FOR i: RoutePrivate.RoutingLayer IN RoutePrivate.RoutingLayer DO
TRUSTED {vRoutingChannelSides.barrierList[i] ← NARROW[eachNameProc[vRoutingChannelSides , @vRoutingChannelSides.barrierList[i]]]};
ENDLOOP;
[] ← IO.SkipWhitespace[s];
IF IO.GetChar[s]#') THEN RefIOPrivate.Error[IO.PutFR["Syntax error: ') expected at %d", IO.int[IO.GetIndex[s]]]];
[] ← IO.SkipWhitespace[s];
IF IO.GetChar[s]#'[ THEN RefIOPrivate.Error[IO.PutFR["Syntax error: '[ expected at %d", IO.int[IO.GetIndex[s]]]];
[] ← IO.SkipWhitespace[s];
IF IO.GetChar[s]#'[ THEN RefIOPrivate.Error[IO.PutFR["Syntax error: '[ expected at %d", IO.int[IO.GetIndex[s]]]];
vRoutingChannelSides.enclosingBarrier.c1.p ← IO.GetInt[s];
vRoutingChannelSides.enclosingBarrier.c1.q ← IO.GetInt[s];
[] ← IO.SkipWhitespace[s];
IF IO.GetChar[s]#'] THEN RefIOPrivate.Error[IO.PutFR["Syntax error: '] expected at %d", IO.int[IO.GetIndex[s]]]];
[] ← IO.SkipWhitespace[s];
IF IO.GetChar[s]#'[ THEN RefIOPrivate.Error[IO.PutFR["Syntax error: '[ expected at %d", IO.int[IO.GetIndex[s]]]];
vRoutingChannelSides.enclosingBarrier.c2.p ← IO.GetInt[s];
vRoutingChannelSides.enclosingBarrier.c2.q ← IO.GetInt[s];
[] ← IO.SkipWhitespace[s];
IF IO.GetChar[s]#'] THEN RefIOPrivate.Error[IO.PutFR["Syntax error: '] expected at %d", IO.int[IO.GetIndex[s]]]];
[] ← IO.SkipWhitespace[s];
IF IO.GetChar[s]#'] THEN RefIOPrivate.Error[IO.PutFR["Syntax error: '] expected at %d", IO.int[IO.GetIndex[s]]]];
[] ← IO.SkipWhitespace[s];
IF IO.GetChar[s]#'] THEN RefIOPrivate.Error[IO.PutFR["Syntax error: '] expected at %d", IO.int[IO.GetIndex[s]]]];
RETURN[vRoutingChannelSides];
};
WriteRoutingChannelSides: PUBLIC PROC[s: IO.STREAM, ref: REF, eachRefProc: RefIOPrivate.RefToNameProc] ~ {
vRoutingChannelSides: RouteChannel.RoutingChannelSides ← NARROW[ref];
IO.PutChar[s, '[ ];
IO.PutF[s, "%d ", IO.int[vRoutingChannelSides.routeAreaCoord]];
IO.PutF[s, "%d ", IO.card[ORD[vRoutingChannelSides.extSide]+1]];
IO.PutChar[s, '( ];
FOR i: RoutePrivate.RoutingLayer IN RoutePrivate.RoutingLayer DO
eachRefProc[vRoutingChannelSides.barrierList[i]];
ENDLOOP;
IO.PutChar[s, ') ];
IO.PutChar[s, '[ ];
IO.PutChar[s, '[ ];
IO.PutF[s, "%d ", IO.int[vRoutingChannelSides.enclosingBarrier.c1.p]];
IO.PutF[s, "%d ", IO.int[vRoutingChannelSides.enclosingBarrier.c1.q]];
IO.PutChar[s, '] ];
IO.PutChar[s, '[ ];
IO.PutF[s, "%d ", IO.int[vRoutingChannelSides.enclosingBarrier.c2.p]];
IO.PutF[s, "%d ", IO.int[vRoutingChannelSides.enclosingBarrier.c2.q]];
IO.PutChar[s, '] ];
IO.PutChar[s, '] ];
IO.PutChar[s, '] ];
};
ReadPQRectList: PUBLIC PROC[s: IO.STREAM, eachNameProc: RefIOPrivate.NameToRefProc] RETURNS [ref: REF] ~ {
elPQRect: RTBasic.PQRect;
vPQRectList: RTBasic.PQRectList ← LIST [elPQRect];
[] ← IO.SkipWhitespace[s];
IF IO.GetChar[s]#'[ THEN RefIOPrivate.Error[IO.PutFR["Syntax error: '[ expected at %d", IO.int[IO.GetIndex[s]]]];
[] ← IO.SkipWhitespace[s];
IF IO.GetChar[s]#'[ THEN RefIOPrivate.Error[IO.PutFR["Syntax error: '[ expected at %d", IO.int[IO.GetIndex[s]]]];
[] ← IO.SkipWhitespace[s];
IF IO.GetChar[s]#'[ THEN RefIOPrivate.Error[IO.PutFR["Syntax error: '[ expected at %d", IO.int[IO.GetIndex[s]]]];
vPQRectList.first.c1.p ← IO.GetInt[s];
vPQRectList.first.c1.q ← IO.GetInt[s];
[] ← IO.SkipWhitespace[s];
IF IO.GetChar[s]#'] THEN RefIOPrivate.Error[IO.PutFR["Syntax error: '] expected at %d", IO.int[IO.GetIndex[s]]]];
[] ← IO.SkipWhitespace[s];
IF IO.GetChar[s]#'[ THEN RefIOPrivate.Error[IO.PutFR["Syntax error: '[ expected at %d", IO.int[IO.GetIndex[s]]]];
vPQRectList.first.c2.p ← IO.GetInt[s];
vPQRectList.first.c2.q ← IO.GetInt[s];
[] ← IO.SkipWhitespace[s];
IF IO.GetChar[s]#'] THEN RefIOPrivate.Error[IO.PutFR["Syntax error: '] expected at %d", IO.int[IO.GetIndex[s]]]];
[] ← IO.SkipWhitespace[s];
IF IO.GetChar[s]#'] THEN RefIOPrivate.Error[IO.PutFR["Syntax error: '] expected at %d", IO.int[IO.GetIndex[s]]]];
TRUSTED {vPQRectList.rest ← NARROW[eachNameProc[vPQRectList , @vPQRectList.rest]]};
[] ← IO.SkipWhitespace[s];
IF IO.GetChar[s]#'] THEN RefIOPrivate.Error[IO.PutFR["Syntax error: '] expected at %d", IO.int[IO.GetIndex[s]]]];
RETURN[vPQRectList];
};
WritePQRectList: PUBLIC PROC[s: IO.STREAM, ref: REF, eachRefProc: RefIOPrivate.RefToNameProc] ~ {
vPQRectList: RTBasic.PQRectList ← NARROW[ref];
IO.PutChar[s, '[ ];
IO.PutChar[s, '[ ];
IO.PutChar[s, '[ ];
IO.PutF[s, "%d ", IO.int[vPQRectList.first.c1.p]];
IO.PutF[s, "%d ", IO.int[vPQRectList.first.c1.q]];
IO.PutChar[s, '] ];
IO.PutChar[s, '[ ];
IO.PutF[s, "%d ", IO.int[vPQRectList.first.c2.p]];
IO.PutF[s, "%d ", IO.int[vPQRectList.first.c2.q]];
IO.PutChar[s, '] ];
IO.PutChar[s, '] ];
eachRefProc[vPQRectList.rest];
IO.PutChar[s, '] ];
};
ReadGraph: PUBLIC PROC[s: IO.STREAM, eachNameProc: RefIOPrivate.NameToRefProc] RETURNS [ref: REF] ~ {
vGraph: RouteDiGraph.Graph ← NEW[RouteDiGraph.GraphRec];
[] ← IO.SkipWhitespace[s];
IF IO.GetChar[s]#'[ THEN RefIOPrivate.Error[IO.PutFR["Syntax error: '[ expected at %d", IO.int[IO.GetIndex[s]]]];
TRUSTED {vGraph.graphInfo ← NARROW[eachNameProc[vGraph , @vGraph.graphInfo]]};
TRUSTED {vGraph.nodeList ← NARROW[eachNameProc[vGraph , @vGraph.nodeList]]};
TRUSTED {vGraph.arcList ← NARROW[eachNameProc[vGraph , @vGraph.arcList]]};
TRUSTED {vGraph.superiorNodes ← NARROW[eachNameProc[vGraph , @vGraph.superiorNodes]]};
TRUSTED {vGraph.inferiorNodes ← NARROW[eachNameProc[vGraph , @vGraph.inferiorNodes]]};
[] ← IO.SkipWhitespace[s];
IF IO.GetChar[s]#'] THEN RefIOPrivate.Error[IO.PutFR["Syntax error: '] expected at %d", IO.int[IO.GetIndex[s]]]];
RETURN[vGraph];
};
WriteGraph: PUBLIC PROC[s: IO.STREAM, ref: REF, eachRefProc: RefIOPrivate.RefToNameProc] ~ {
vGraph: RouteDiGraph.Graph ← NARROW[ref];
IO.PutChar[s, '[ ];
eachRefProc[vGraph.graphInfo];
eachRefProc[vGraph.nodeList];
eachRefProc[vGraph.arcList];
eachRefProc[vGraph.superiorNodes];
eachRefProc[vGraph.inferiorNodes];
IO.PutChar[s, '] ];
};
Init[];
END.