<> <> <> <> <> DIRECTORY CD, CDCells, CDPinObjects, MC, MCMInterface, PW, PWPins, Rope; MCMInterfaceImpl: CEDAR PROGRAM IMPORTS CD, CDCells, CDPinObjects, MC, PW, PWPins, Rope EXPORTS MCMInterface = BEGIN OPEN PW; AllButVddAndGnd: MC.SelectPinProc -- [pin: CD.ApplicationPtr] RETURNS [sel: BOOL] -- = { name: Rope.ROPE _ CDPinObjects.GetName[pin]; sel _ NOT (Rope.Match["Vdd", name, FALSE] OR Rope.Match["Gnd", name, FALSE]) }; InputSection: PROC [design: CD.Design] RETURNS [result: ObPtr] = { phBSlice: PW.ObPtr _ PW.Get[design, "phBLatchandDriveSlice"]; drCtlSlice: PW.ObPtr _ PW.Get[design, "DrCtlSlice"]; fillerSlice: PW.ObPtr _ PW.Get[design, "FillerSlice"]; slice: PW.ObPtr; sliceIR: CD.Rect _ CD.InterestRect[phBSlice]; inputName, outputName, drName: Rope.ROPE; index, inputBase, outputBase: INT; NewName: PWPins.RenameProc = { SELECT TRUE FROM Rope.Equal[oldRope, "in"] => newRope_ Rope.Cat[MC.IndexedName[inputName, index-inputBase], ".dataIn"]; Rope.Equal[oldRope, "out"] => newRope _ MC.IndexedName[outputName, index-outputBase]; Rope.Equal[oldRope, "Dr"] => newRope _ drName; ENDCASE => newRope _ oldRope; }; result _ PW.CreateEmptyCell[]; index _ 0; <<>> <> outputName _ "PBus"; drName _ "PSelMBusHi25xAB"; <<>> <> inputBase _ outputBase _ index; inputName _ "MCmd"; THROUGH [0..3] DO slice _ PWPins.RenamePins[design, phBSlice, NewName]; PW.IncludeInCell[design, result, slice, [index*(sliceIR.x2-sliceIR.x1), 0]]; index _ index+1; ENDLOOP; slice _ PWPins.RenamePins[design, drCtlSlice, NewName]; PW.IncludeInCell[design, result, slice, [index*(sliceIR.x2-sliceIR.x1), 0]]; index _ index+1; <> inputBase _ outputBase _ index; inputName _ "MExt"; THROUGH [0..3] DO slice _ PWPins.RenamePins[design, fillerSlice, NewName]; PW.IncludeInCell[design, result, slice, [index*(sliceIR.x2-sliceIR.x1), 0]]; index _ index+1; ENDLOOP; << >> <> inputBase _ index; outputBase _ index-4; inputName _ "MData"; THROUGH [0..20] DO slice _ PWPins.RenamePins[design, phBSlice, NewName]; PW.IncludeInCell[design, result, slice, [index*(sliceIR.x2-sliceIR.x1), 0]]; index _ index+1; ENDLOOP; slice _ PWPins.RenamePins[design, drCtlSlice, NewName]; PW.IncludeInCell[design, result, slice, [index*(sliceIR.x2-sliceIR.x1), 0]]; index _ index+1; <> outputName _ "PBus"; drName _ "PSelMBusLo25xAB"; inputBase _ index-3; outputBase _ index; THROUGH [0..24] DO slice _ PWPins.RenamePins[design, phBSlice, NewName]; PW.IncludeInCell[design, result, slice, [index*(sliceIR.x2-sliceIR.x1), 0]]; index _ index+1; ENDLOOP; slice _ PWPins.RenamePins[design, drCtlSlice, NewName]; PW.IncludeInCell[design, result, slice, [index*(sliceIR.x2-sliceIR.x1), 0]]; index _ index+1; <> <> <> <> <> <> <> <> <> <> <> CDCells.SetInterestRect[result, [0, 0, index*(sliceIR.x2-sliceIR.x1), sliceIR.y2-sliceIR.y1]]; PW.IncludeInDirectory[design, result, "MInterfaceInputSection"]; }; OutputSection: PROC [design: CD.Design] RETURNS [result: ObPtr] = { phASlice: PW.ObPtr _ PW.FlipY[design, PW.Get[design, "phALatchandDriveSlice"]]; drCtlSlice: PW.ObPtr _ PW.FlipY[design, PW.Get[design, "DrCtlSlice"]]; fillerSlice: PW.ObPtr _ PW.FlipY[design, PW.Get[design, "FillerSlice"]]; slice: PW.ObPtr; sliceIR: CD.Rect _ CD.InterestRect[phASlice]; inputName, outputName: Rope.ROPE; index, inputBase, outputBase: INT; NewName: PWPins.RenameProc = { SELECT TRUE FROM Rope.Equal[oldRope, "in"] => newRope _ MC.IndexedName[inputName, index-inputBase]; Rope.Equal[oldRope, "out"] => newRope_ Rope.Cat[MC.IndexedName[outputName, index-outputBase], ".dataOut"]; ENDCASE => newRope _ oldRope; }; result _ PW.CreateEmptyCell[]; index _ 0; inputName _ "PBus"; -- for debugging version <<>> <> outputName _ "MCmd"; inputBase _ outputBase _ index; THROUGH [0..3] DO slice _ PWPins.RenamePins[design, phASlice, NewName]; PW.IncludeInCell[design, result, slice, [index*(sliceIR.x2-sliceIR.x1), 0]]; index _ index+1; ENDLOOP; slice _ PWPins.RenamePins[design, drCtlSlice, NewName]; <> outputName _ "MExt"; inputBase _ outputBase _ index; THROUGH [0..3] DO slice _ PWPins.RenamePins[design, phASlice, NewName]; PW.IncludeInCell[design, result, slice, [index*(sliceIR.x2-sliceIR.x1), 0]]; index _ index+1; ENDLOOP; << >> <> outputName _ "MData"; inputBase _ index-4; outputBase _ index; THROUGH [0..20] DO slice _ PWPins.RenamePins[design, phASlice, NewName]; PW.IncludeInCell[design, result, slice, [index*(sliceIR.x2-sliceIR.x1), 0]]; index _ index+1; ENDLOOP; CDCells.SetInterestRect[result, [0, 0, index*(sliceIR.x2-sliceIR.x1), sliceIR.y2-sliceIR.y1]]; PW.IncludeInDirectory[design, result, "MInterfaceOutputSection"]; }; MBusInterface: PUBLIC PROC [design: CD.Design, ySize: INT] RETURNS [result: ObPtr] = { inSect: PW.ObPtr _ InputSection[design]; ioGlue: PW.ObPtr _ FlipX[design, PW.Get[design, "FeedBackLatchToOutputLatchGlue"]]; outSect: PW.ObPtr _ OutputSection[design]; inSectSize: CD.Position _ PW.Size[inSect]; ioGlueSize: CD.Position _ PW.Size[ioGlue]; outSectSize: CD.Position _ PW.Size[outSect]; result _ PW.CreateEmptyCell[]; CDCells.SetInterestRect[result, [0, 0, inSectSize.x+ioGlueSize.x+outSectSize.x, ySize]]; <> inSect _ AbutY[design, inSect, MC.TopFillerCell[design, inSect, ySize-inSectSize.y, AllButVddAndGnd]]; outSect _ AbutY[design, outSect, MC.TopFillerCell[design, outSect, ySize-outSectSize.y, AllButVddAndGnd]]; <> PW.IncludeInCell[design, result, inSect, [0, 0]]; PW.IncludeInCell[design, result, ioGlue, [inSectSize.x, 0]]; PW.IncludeInCell[design, result, outSect, [inSectSize.x+ioGlueSize.x, 0]]; PW.IncludeInDirectory[design, result, "MInterface"]; }; AlpsToMBusInterfaceGlue: PUBLIC PROC [design: CD.Design, mcCtl: PW.ObPtr] RETURNS[result: PW.ObPtr] = { kludgeSlicephB: PW.ObPtr _ PW.Get[design, "MInterfaceKludgeSlicephB"]; kludgeSliceCycleABZero: PW.ObPtr _ PW.Get[design, "MInterfaceCycleABZero"]; biasSlice: PW.ObPtr _ PW.Get[design, "BiasGenerator"]; fillerSlice: PW.ObPtr _ PW.Get[design, "FillerSlice"]; drCtlSlice: PW.ObPtr _ PW.Get[design, "DrCtlSlice"]; bottom, topFiller, topAlpsConnection: PW.ObPtr; bottomSize: CD.Position; mcCtlSize: CD.Position _ PW.Size[mcCtl]; name, drName: Rope.ROPE; index: INT; NewName: PWPins.RenameProc = { SELECT TRUE FROM Rope.Equal[oldRope, "in"] => newRope _ Rope.Cat[name, ".dataIn"]; Rope.Equal[oldRope, "outxBA"] => newRope _ Rope.Cat[name, "xBA"]; Rope.Equal[oldRope, "NotoutxBA"] => newRope _ Rope.Cat["Not", name, "xBA"]; Rope.Equal[oldRope, "Dr"] => newRope _ drName; ENDCASE => newRope _ oldRope; }; IndexedNewName: PWPins.RenameProc = { SELECT TRUE FROM Rope.Equal[oldRope, "in"] => newRope _ Rope.Cat[MC.IndexedName[name, index], ".dataIn"]; Rope.Equal[oldRope, "outxBA"] => newRope _ MC.IndexedName[Rope.Cat[name, "xBA"], index]; Rope.Equal[oldRope, "NotoutxBA"] => newRope _ MC.IndexedName[Rope.Cat["Not", name, "xBA"], index]; ENDCASE => newRope _ oldRope; }; <> <> name _ ""; drName _ "NotDebug"; bottom _ PWPins.RenamePins[design, drCtlSlice, NewName]; bottom _ AbutX[design, fillerSlice, bottom, biasSlice]; name _ "nMAdCycle"; bottom _ AbutX[design, bottom, PWPins.RenamePins[design, kludgeSliceCycleABZero, NewName]]; name _ "MCmd"; index _ 0; THROUGH [0..3] DO bottom _ AbutX[design, bottom, PWPins.RenamePins[design, kludgeSliceCycleABZero, IndexedNewName]]; index _ index+1; ENDLOOP; name _ "MCSelected"; bottom _ AbutX[design, bottom, PWPins.RenamePins[design, kludgeSliceCycleABZero, NewName]]; name _ "MData"; index _ 2; THROUGH [2..5] DO bottom _ AbutX[design, bottom, PWPins.RenamePins[design, kludgeSliceCycleABZero, IndexedNewName]]; index _ index+1; ENDLOOP; name _ "Reset"; bottom _ AbutX[design, bottom, PWPins.RenamePins[design, kludgeSlicephB, NewName]]; bottomSize _ PW.Size[bottom]; <> result _ PW.CreateEmptyCell[]; CDCells.SetInterestRect[result, [0, 0, bottomSize.x, mcCtlSize.y]]; topFiller _ MC.TopFillerCell[design, bottom, mcCtlSize.y-bottomSize.y, AllButVddAndGnd]; topAlpsConnection _ MC.ConnectRightToBus[design, mcCtl, topFiller]; PW.IncludeInCell[design, result, bottom, [0, 0]]; PW.IncludeInCell[design, result, topFiller, [0, bottomSize.y]]; PW.IncludeInCell[design, result, topAlpsConnection, [0, 0]]; PW.IncludeInDirectory[design, result, "MInterface"]; }; END.