<<>> <> <> <> <<>> DIRECTORY CD, CDCommandOps, CDInstances, CDOps, CDProperties, CDSequencer, CoreCDUser, RefTab, Rope, SoftHdwAssembly, SoftHdwBasics, SoftHdwCompiler, SoftHdwDelayPath, SoftHdwSimulate, TerminalIO; SoftHdwUser: CEDAR PROGRAM IMPORTS CDCommandOps, CDInstances, CDOps, CDProperties, CoreCDUser, RefTab, SoftHdwAssembly, SoftHdwBasics, SoftHdwCompiler, SoftHdwDelayPath, SoftHdwSimulate, TerminalIO = BEGIN SoftHdwHighlight: PROC [command: CDSequencer.Command] = { simulation: SoftHdwSimulate.Simulation _ NARROW[CDProperties.GetDesignProp[command.design, SoftHdwSimulate.designToSimulationKey]]; positionRope: Rope.ROPE _ TerminalIO.RequestRope["position>"]; position: SoftHdwBasics.ArrayPosition _ SoftHdwBasics.RopeToArrayPosition[positionRope]; SoftHdwAssembly.HighlightDesign[command.design, simulation.sizes, LIST[[red, position]]] }; SoftHdwCreateSimulation: PROC [command: CDSequencer.Command] = { simulation: SoftHdwSimulate.Simulation _ NIL; originalSelectedInstances: CD.InstanceList _ CDInstances.OnlySelected[CDOps.InstList[command.design]]; IF originalSelectedInstances=NIL OR originalSelectedInstances.rest#NIL THEN TerminalIO.PutRope["\nMust select only one instance"]; simulation _ SoftHdwSimulate.Create["SoftHdw Simulation", SoftHdwAssembly.Parse[originalSelectedInstances.first.ob]]; simulation.design _ command.design; CDProperties.PutDesignProp[simulation.design, SoftHdwSimulate.designToSimulationKey, simulation]; SoftHdwSimulate.Initialize[simulation]; [] _ SoftHdwDelayPath.TimingAnalyze[simulation]; }; SoftHdwCPRT: PROC [command: CDSequencer.Command] = { CPRTOne: CoreCDUser.EachRootCellTypeProc ~ { FindMax: RefTab.EachPairAction = { pa: SoftHdwCompiler.PrimitiveAssignment _ NARROW[val]; maxx _ MAX[maxx, pa.position.minorArray.x]; maxy _ MAX[maxy, pa.position.minorArray.y]; }; maxx: INT _ 0; maxy: INT _ 0; channelSize: INT _ TerminalIO.RequestInt["channelSize>"]; flat: SoftHdwCompiler.FlatCell _ SoftHdwCompiler.Flatten[root]; logicCritical: SoftHdwDelayPath.DelayNetwork _ SoftHdwDelayPath.TimingAnalyzeFlatCell[flat]; sizes: SoftHdwCompiler.ArrayPosition _ NEW[SoftHdwCompiler.ArrayPositionRec _ [chip: [1,1], minorArray: [80,64], grain: [4,4], orientation: Horizontal,type: Output]]; grainPositions: SoftHdwCompiler.GrainPositions _ SoftHdwCompiler.TimberWolf[flat, sizes, 100]; place: SoftHdwCompiler.Placement _ SoftHdwCompiler.HayBaler[flat, sizes, grainPositions]; channeled: SoftHdwCompiler.Placement _ SoftHdwCompiler.AddChannels[place, channelSize]; route: RefTab.Ref; incompleteNetEnds: SoftHdwCompiler.NetEndList; incomplete: INT; [] _ RefTab.Pairs[channeled.positions, FindMax]; sizes.minorArray.x _ maxx + channelSize + 1; sizes.minorArray.y _ maxy + channelSize + 1; [route, incompleteNetEnds, incomplete] _ SoftHdwCompiler.CreateSurfaceAndRoute[channeled]; SoftHdwCompiler.MarkedPlaceAndRoute[channeled, route, incompleteNetEnds, sizes]; }; [] _ CoreCDUser.EnumerateSelectedCellTypes[command.design, CPRTOne]; }; CDCommandOps.RegisterWithMenu[$SpecialMenu, "Highlight Position", "Given a position, highlight it.", $SoftHdwHighlight, SoftHdwHighlight]; CDCommandOps.RegisterWithMenu[$SpecialMenu, "Create Simulation", "Creates a simulation for the selected cell", $SoftHdwCreateSimulation, SoftHdwCreateSimulation]; CDCommandOps.RegisterWithMenu[$SpecialMenu, "CPRT", "Convert, place, route, and timing analyze selected cells", $SoftHdwCPRT, SoftHdwCPRT]; END.