DIRECTORY Rope, Graphics, CDOrient, IPConstants, IPParams, IP, IPToolBox, IPPinNets; IPPinNetsImpl: CEDAR PROGRAM IMPORTS Graphics, CDOrient, IP, IPParams, IPToolBox EXPORTS IPPinNets = BEGIN OPEN TB: IPToolBox, IPPinNets; PaintPinNets: PUBLIC PROC[pNetsOwner: Component, context: Graphics.Context, xOffset, yOffset: REAL _ 0.0, scaleFactor: REAL _ 1.0, showNames: BOOL _ TRUE, size: NAT _ IPParams.PhyPinRectSize, activeStipple: CARDINAL _ IPConstants.Black, nonActiveStipple: CARDINAL _ IPConstants.White] ={ originX, originY, halfDim: REAL; currentPin: PinNet; drawPhyPinProc: PROC[phyPin: PhysicalPin] ={ path: Graphics.Path _ Graphics.NewPath[]; stipple: CARDINAL _ IF phyPin.active THEN activeStipple ELSE nonActiveStipple; coordX, coordY: REAL; [coordX, coordY] _ phyPin.coord; coordX _ (coordX * scaleFactor) + originX; coordY _ (coordY * scaleFactor) + originY; Graphics.Rectangle[path, coordX-halfDim, coordY - halfDim, coordX + halfDim, coordY + halfDim]; Graphics.DrawStroke[context, path]; IF stipple = IPConstants.White THEN Graphics.DrawStroke[self: context, path: path, closed: TRUE] ELSE { Graphics.SetStipple[context, stipple]; Graphics.DrawArea[context, path];}; IF showNames THEN { Graphics.SetCP[context, coordX - halfDim, coordY + (1.25 * halfDim)]; Graphics.DrawRope[context, currentPin.name]}; }; --drawPhyPinProc [[originX, originY]] _ IPToolBox.GetCoOrigin[pNetsOwner]; originX _ xOffset + (originX * scaleFactor); originY _ yOffset + (originY *scaleFactor); halfDim _ (scaleFactor * size)/2.0; FOR l: PinNets _ pNetsOwner.pinNets, l.rest UNTIL l = NIL DO currentPin _ l.first; FOR phyPins: PhysicalPins _ currentPin.physicalPins, phyPins.rest UNTIL phyPins = NIL DO drawPhyPinProc[phyPins.first]; ENDLOOP; ENDLOOP; }; --PaintPinNets OrientPinNets: PUBLIC PROC [pNetsOwner: Component, operation: IP.Orientation] ={ coDimX, coDimY: NAT; [coDimX, coDimY] _ IPToolBox.GetCoDim[pNetsOwner]; FOR l: PinNets _ pNetsOwner.pinNets, l.rest UNTIL l = NIL DO TB.OrientPhysicalPins[l.first.physicalPins, [coDimX, coDimY], operation] ENDLOOP; }; --OrientPinNets MirrorPinNets: PUBLIC PROC[pNetsOwner: Component, mirrorOrient: IP.OrientationTypes] ={ coDimX, coDimY: NAT; [coDimX, coDimY] _ IPToolBox.GetCoDim[pNetsOwner]; FOR l: PinNets _ pNetsOwner.pinNets, l.rest UNTIL l = NIL DO TB.MirrorXPhysicalPins[l.first.physicalPins, [coDimX, coDimY]]; ENDLOOP; IF mirrorOrient = hor THEN { FOR l: PinNets _ pNetsOwner.pinNets, l.rest UNTIL l = NIL DO TB.Rotate90PhysicalPins[l.first.physicalPins, [coDimX, coDimY], 2] ENDLOOP; }; --endIF }; --MirrorPinNets Rotate90PinNets: PUBLIC PROC [pNetsOwner: Component, numberOfRot: INT _ 1] ={ coDimX, coDimY: NAT; [coDimX, coDimY] _ IPToolBox.GetCoDim[pNetsOwner]; FOR l: PinNets _ pNetsOwner.pinNets, l.rest UNTIL l = NIL DO TB.Rotate90PhysicalPins[l.first.physicalPins, [coDimX, coDimY], numberOfRot] ENDLOOP; }; --Rotate90PinNets AddPinNetsToNets: PUBLIC PROC [pinNets: PinNets] = { WHILE pinNets # NIL DO net: Net _ pinNets.first.net; net.pinNets _ CONS[pinNets.first, net.pinNets]; pinNets _ pinNets.rest; ENDLOOP; }; --AddPinNet RemPinNetsFromNets: PUBLIC PROC [pinNets: PinNets] ={ WHILE pinNets # NIL DO RemPinNetFromNet[pinNets.first, pinNets.first.net]; pinNets _ pinNets.rest; ENDLOOP; };--RemPinNetsFromNets RemPinNetFromNet: PROC[pinNet: PinNet, net: Net] ={ lHd, lTl: PinNets; lHd _ lTl _ CONS[NIL, NIL]; FOR l: PinNets _ net.pinNets, l.rest UNTIL l = NIL DO IF l.first = pinNet THEN {lTl.rest _ l.rest; EXIT} ELSE {lTl.rest _ LIST[l.first]; lTl _ lTl.rest}; REPEAT FINISHED => ERROR IP.Error[missingRegistration]; ENDLOOP; net.pinNets _ lHd.rest; }; --RemPinNet EnumPhysicalPins: PUBLIC PROC[pinNets: PinNets, action: EachPhysicalPinAction] ={ WHILE pinNets # NIL DO FOR pS: PhysicalPins _ pinNets.first.physicalPins, pS.rest UNTIL pS = NIL DO IF action[pS.first] THEN RETURN; ENDLOOP; pinNets _ pinNets.rest; ENDLOOP; }; --PhysicalPins END. ”--File: IPPinNetsImpl.mesa Last Edited by: CSChow, January 8, 1985 2:51:04 am PST --Operation on PinNet(s) --Operation on individual PinNet Κ%˜J™J™6J™šΟk ˜ J˜Jšœ ˜ J˜ Jšœ ˜ Jšœ ˜ Jšœ˜J˜ Jšœ ˜ —J˜šœœ˜Jšœœ˜3Jšœ œœœ˜8J˜šΟn œœœEœœœœœ+œ(œ˜ŸJšœœ˜ Jšœ˜šœœ˜,Icode– "Cedar" style˜)K– "Cedar" styleš œ œœœœ˜NJšœœ˜Jšœ ˜ Jšœ*˜*Jšœ*˜*Jšœ_˜_Kšœ#˜#šœ˜Kšœ8œ˜Ašœ˜Kšœ'˜'Kšœ#˜#——šœ ˜ šœ˜KšœE˜EKšœ-˜-——JšœΟc˜—J˜Jšœ9˜9Jšœ-˜-Kšœ+˜+Jšœ#˜#šœ)œœ˜