SoftHdwDelayPath.mesa
Copyright Ó 1988 by Xerox Corporation. All rights reserved.
Minsky, July 31, 1989 3:20:49 pm PDT
DIRECTORY DABasics, CardTab, PriorityQueue, RefTab, Rope, SoftHdwBasics, SoftHdwCompiler, SoftHdwSimulate;
SoftHdwDelayPath: CEDAR DEFINITIONS = BEGIN
DelayNetwork: TYPE = REF DelayNetworkRec;
DelayNetworkRec: TYPE = RECORD [
Table, indexed by level, of delay events.
levelTable: CardTab.Ref,
Table of delayEvents, indexed by source (ArrayPositions or Primitives)
eventTable: RefTab.Ref,
maxLevel: INT ← 0,
primaryInputs: DelayEvents ← NIL,
allDelayEvents: DelayEvents ← NIL,
worstDelayTable: PriorityQueue.Ref,
maxDelayEvent is the event with the max Delay value. This is the same is the top of the worstDelayTable queue.
maxDelayEvent: DelayEvent ← NIL];
DelayEvents: TYPE = LIST OF DelayEvent;
DelayEvent: TYPE = REF DelayEventRec;
DelayEventRec: TYPE = RECORD [
inputDelayTerms: DelayTerms ← NIL,
outputDelayTerms: DelayTerms ← NIL,
zeroSlackTerm: DelayTerm ← NIL,
minDelay: INT ← 0,
maxDelay: INT ← 0,
slack: INT ← 0,
level: INT ← -1,
levelComputed: BOOLFALSE,
primaryInput: BOOLFALSE,
source: REF ANY];
DelayTerms: TYPE = LIST OF DelayTerm;
DelayTerm: TYPE = REF DelayTermRec;
DelayTermRec: TYPE = RECORD [
inputDelayEvent: DelayEvent,
outputDelayEvent: DelayEvent,
delay: INT ← 1,
blocked: BOOLFALSE,
source: REF ANY];
CreateNetworkForSimulation: PROC [simulation: SoftHdwSimulate.Simulation] RETURNS [network: DelayNetwork];
CreateNetwork: PROC [array: SoftHdwBasics.ArrayBase] RETURNS [network: DelayNetwork];
ResetNetwork: PROC [network: DelayNetwork];
LevelizeDelayNetwork: PROC [network: DelayNetwork];
ComputeDelays: PROC [network: DelayNetwork];
ComputeSlack: PROC [network: DelayNetwork];
BlockDelayTerm: PROC [term: DelayTerm];
UnBlockDelayTerm: PROC [term:DelayTerm];
Procedure creates new network, does timing analysis, and returns the network.
TimingAnalyze: PROC [simulation: SoftHdwSimulate.Simulation] RETURNS [network: DelayNetwork] ;
MakeDelayPositionPath: PROC [event: DelayEvent] RETURNS [SoftHdwBasics.ArrayPositions] ;
... Traces an event back through the zero slack terms, creating a list of the array positions of the events. This path is useful for highlighting the critical path.
Functions to print events out on the terminal window.
EventPrintFn: TYPE = PROC [event: DelayEvent];
TermPrintFn: TYPE = PROC [term: DelayTerm];
TracePath: PROC [event: DelayEvent, eventPrintFn: EventPrintFn, termPrintFn: TermPrintFn];
...Prints out a delay path by traing an event back, following the zero slack pointers, until an event with no input terms is reached.
ReportCriticalPath: PROC [network: DelayNetwork, eventPrintFn: EventPrintFn ← PrintGenericEvent, termPrintFn: TermPrintFn ← PrintGenericTerm];
TimingAnalyzeFlatCell: PROC [flatCell: SoftHdwCompiler.FlatCell] RETURNS [network: DelayNetwork];
PrintEvent: PROC [event: DelayEvent];
...Prints a Delay Event a la SoftHdw Emulator, using ArrayPosition field of event.
PrintTerm: PROC [term: DelayTerm];
PrintGenericEvent: PROC [event: DelayEvent];
... Just prints the delays.
PrintGenericTerm: PROC [term: DelayTerm];
END.