SoftHdwUser.mesa
Copyright Ó 1988 by Xerox Corporation. All rights reserved.
Barth, September 6, 1989 12:46:59 pm PDT
DIRECTORY CD, CDCommandOps, CDInstances, CDOps, CDProperties, CDSequencer, CoreCDUser, Process, RefTab, Rope, SoftHdwAssembly, SoftHdwBasics, SoftHdwCompiler, SoftHdwDelayPath, SoftHdwSimulate, TerminalIO;
SoftHdwUser: CEDAR PROGRAM
IMPORTS CDCommandOps, CDInstances, CDOps, CDProperties, CoreCDUser, Process, 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] = {
priority: Process.Priority ← Process.GetPriority[];
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"];
Process.SetPriority[Process.priorityBackground];
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];
Process.SetPriority[priority];
};
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.