<> <> <> DIRECTORY CD, CDCells, CDDirectory, CDGenerateRemote, Core, CoreCompose, List, Rope, Route, RTBasic, SC, SCChanUtil, SCInitialPlace, SCInstUtil, SCPlaceUtil, SCPrivate, SCRowUtil, SCSmash, SCWidthUtil, SCUtil, TerminalIO; SCImpl: CEDAR PROGRAM IMPORTS CD, CDCells, CDDirectory, CDGenerateRemote, Rope, Route, RTBasic, SC, SCChanUtil, SCInitialPlace, SCInstUtil, SCPlaceUtil, SCPrivate, SCRowUtil, SCSmash, SCWidthUtil, SCUtil, TerminalIO EXPORTS SC SHARES SC = { debug: BOOLEAN _ FALSE; Error: PUBLIC ERROR[errorType: SC.ErrorType _ callingError, explanation: Rope.ROPE _ NIL] = CODE; Signal: PUBLIC SIGNAL[signalType: SC.ErrorType _ callingError, explanation: Rope.ROPE _ NIL] = CODE; CreateDesignRules: PUBLIC PROC [technologyKey: ATOM, horizLayer, vertLayer: SC.Layer, rowDirection: SC.Direction, properties: SC.Properties _ NIL] RETURNS [designRules: SC.DesignRules] = <> BEGIN designRules _ NEW[SC.DesignRulesRec]; designRules.technology _ CD.FetchTechnology[technologyKey]; designRules.rowRules _ Route.CreateDesignRules[technologyKey, horizLayer, vertLayer, rowDirection, properties]; designRules.sideRules _ Route.CreateDesignRules[technologyKey, horizLayer, vertLayer, RTBasic.OtherDirection[rowDirection], properties]; END; CreateHandle: PUBLIC PROC [coreContext: CoreCompose.Context, cellType: Core.CellType, cdDesign, libDesign: CD.Design, designRules: SC.DesignRules, name: Rope.ROPE _ NIL, properties: SC.Properties _ NIL] RETURNS [handle: SC.Handle] = <> BEGIN parms: SCPrivate.Parms _ NARROW[NEW[SCPrivate.ParmsRec], SCPrivate.Parms]; IF designRules = NIL THEN SC.Error[callingError, "No design rules."]; IF coreContext = NIL THEN SC.Error[callingError, "No Core context."]; IF libDesign = NIL THEN SC.Error[callingError, "No ChipNDale design."]; handle _ NEW[SC.HandleRec]; handle.name _ name; handle.rules _ designRules; handle.properties _ properties; handle.coreContext _ coreContext; parms.libDesign _ libDesign; parms.cdDesign _ cdDesign; parms.cdTable _ CDGenerateRemote.GetRemoteTable[libDesign.name]; handle.parms _ parms; <> IF ~SCPrivate.SetUpLayout[handle] THEN RETURN[NIL]; <<>> <> IF ~SCPrivate.GetStructure[handle, cellType] THEN RETURN[NIL]; END; InitialPlace: PUBLIC PROC [handle: SC.Handle] = { <> <<>> layoutData: SCPrivate.LayoutData _ NARROW[handle.layoutData]; SCSmash.RemoveSmash[handle]; SCPlaceUtil.ClrCurPlac[handle, TRUE]; SCChanUtil.InitChanWidths[handle]; SCInitialPlace.PrePlace[handle, TRUE]; SCInitialPlace.RowInit[handle]; SCInitialPlace.PosInit[handle]; [layoutData.lgRows.maxRowWidth, layoutData.lgRows.numMaxRows] _ SCRowUtil.FindMaxRow[handle]; SCWidthUtil.AllChanWidths[handle, areaFom]; SCInstUtil.AsgnChanPos[handle]; IF debug THEN SCPlaceUtil.WriteCurPlace[handle]; [] _ SCUtil.WriteResults["End initial placement\n initial size:", handle, 0]}; PlaceImprove: PUBLIC PROC [handle: SC.Handle, algorithm: ATOM] = { <> SELECT algorithm FROM $simulatedAnealing =>NULL; $pairWiseImprovement =>NULL; $globalRouting => SCPrivate.PosImprove[handle, areaFom]; ENDCASE}; GlobalRoute: PUBLIC PROC [handle: SC.Handle] = { <> <<>> SCSmash.RemoveSmash[handle]; SCSmash.SmashAllNets[handle, TRUE]}; DetailRoute: PUBLIC PROC [handle: SC.Handle] RETURNS [result: SC.Result] = <> <<>> BEGIN parms: SCPrivate.Parms _ NARROW[handle.parms]; result _ SCPrivate.DetailRoute[handle]; IF parms.cdDesign # NIL THEN {application: CD.Instance; IF ~ CDDirectory.Include[parms.cdDesign, result.object, handle.name] THEN TerminalIO.WriteRope[Rope.Cat[" unable to add channel: ", handle.name, " in design"]]; CDCells.SetInterestRect[result.object, result.rect]; [] _ CDCells.RepositionCell[result.object, parms.cdDesign]; [application, ] _ CDCells.IncludeOb[design: parms.cdDesign, cell: NIL, ob: result.object, cellCSystem: originCoords, obCSystem: originCoords]}; END; CreateLayout: PUBLIC PROC [technologyKey: ATOM, horizLayer, vertLayer: SC.Layer, rowDirection: SC.Direction, coreContext: CoreCompose.Context, cellType: Core.CellType, cdDesign, libDesign: CD.Design _ NIL, name: Rope.ROPE _ NIL, properties: SC.Properties _ NIL] RETURNS [object: CD.Object] = { <> <<>> result: SC.Result; designRules: SC.DesignRules _ SC.CreateDesignRules[technologyKey, horizLayer, vertLayer, rowDirection, properties]; handle: SC.Handle _ SC.CreateHandle[coreContext, cellType, cdDesign, libDesign, designRules, name, properties]; SC.InitialPlace[handle]; SC.PlaceImprove[handle, $pairWiseImprovement]; SC.GlobalRoute[handle]; result _ SC.DetailRoute[handle]; RETURN [result.object]; }; }.