DIRECTORY Rope, Imager USING [Context, PathProc, SetGray, SetXY, ShowRope, MaskBox, MaskStroke], IPConstants, IPParams, IP, IPToolBox, IPPinNets; IPPinNetsImpl: CEDAR PROGRAM IMPORTS Imager, IP, IPParams, IPToolBox EXPORTS IPPinNets = BEGIN OPEN TB: IPToolBox, IPPinNets; PaintPinNets: PUBLIC PROC[pNetsOwner: Component, context: Imager.Context, xOffset, yOffset: REAL _ 0.0, scaleFactor: REAL _ 1.0, showNames: BOOL _ TRUE, size: INT _ IPParams.PhyPinRectSize, activeStipple: CARDINAL _ IPConstants.Black, nonActiveStipple: CARDINAL _ IPConstants.White] ={ originX, originY, halfDim: REAL; currentPin: PinNet; drawPhyPinProc: PROC[phyPin: PhysicalPin] ={ stipple: CARDINAL _ IF phyPin.active THEN activeStipple ELSE nonActiveStipple; coordX, coordY: REAL; [coordX, coordY] _ phyPin.coord; coordX _ (coordX * scaleFactor) + originX; coordY _ (coordY * scaleFactor) + originY; IF stipple = IPConstants.White THEN { path: Imager.PathProc ~ { moveTo[[coordX - halfDim, coordY - halfDim]]; lineTo[[coordX + halfDim, coordY - halfDim]]; lineTo[[coordX + halfDim, coordY + halfDim]]; lineTo[[coordX - halfDim, coordY + halfDim]]; lineTo[[coordX - halfDim, coordY - halfDim]];}; Imager.MaskStroke[context, path];} ELSE { Imager.SetGray[context, stipple]; Imager.MaskBox[context, [coordX - halfDim, coordY - halfDim, coordX + halfDim, coordY + halfDim]];}; IF showNames THEN { Imager.SetXY[context, [coordX - halfDim, coordY + (1.25 * halfDim)]]; Imager.ShowRope[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: INT; [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: INT; [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: INT; [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 Preas, August 2, 1986 0:09:10 am PDT changed definition for PaintPinNets, OrientPinNets, MirrorPinNets, Rotate90PinNets November 30, 1987 2:55:20 pm PST --Operation on PinNet(s) --Operation on individual PinNet Κ>˜J™™6Icode™$KšœΟn?œ!™s—J™šΟk ˜ J˜JšœžœC˜PJšœ ˜ Jšœ ˜ Jšžœ˜J˜ Jšœ ˜ —J˜šœžœž˜Jšžœ žœ˜'Jšžœ žœžœžœ˜8J˜š œžœžœCžœžœžœžœžœ+žœ(žœ˜Jšœžœ˜ Jšœ˜šœžœ˜,K– "Cedar" styleš œ žœžœžœžœ˜NJšœžœ˜Jšœ ˜ Jšœ*˜*Jšœ*˜*šžœž˜šžœ˜K˜Kšœ/˜/Kšœ/˜/Kšœ/˜/Kšœ/˜/Kšœ1˜1Kšœ"˜"—šžœ˜Kšœ"˜"Kšœd˜d——šžœ ˜ šžœ˜KšœE˜EKšœ+˜+——JšœΟc˜—J˜Jšœ9˜9Jšœ-˜-Kšœ+˜+Jšœ#˜#šžœ)žœžœž˜