-- FILE: DPrint.mesa
-- Last edited by Ousterhout, December 13, 1983 11:26 am

-- This file defines the routines used to Crystal to record and print
-- out delay information.

DIRECTORY
    Globals,
    IO;

DPrint: CEDAR DEFINITIONS =
BEGIN
OPEN Globals;

Record: PROC[stage: Stage, list: listType];
listType: TYPE = {any, memory, watched};
    -- This procedure records the delay path given by stage and
    -- its predecessors, if this is one of the longest paths seen so
    -- far.  The list parameter indicates which list of slowest
    -- paths this one should be recorded on.  There are three
    -- lists, one for the worst paths overall, one for the worst paths
    -- to memory nodes, and one for the worst paths to nodes that
    -- the user explicitly requests to watch.
    
PrintStage: PROC[stream: IO.STREAM, stage: Stage];
    -- This procedure prints information about the path leading
    -- up to stage.  The info is printed in stream.

CriticalCmd: CmdProc;
    -- This command procedure processes the "critical" command.
    -- It reads arguments and prints out delay information.  The
    -- command takes any of several arguments.  If a file name
    -- is given, the critical path is written to that file. Otherwise
    -- output is to standard output.  If a number is given, the
    -- number'th slowest path is printed out (otherwise, the slowest
    -- path is printed).  If the number is followed by an "m"
    -- then only memory paths are considered.

Clear: PROC[];
    -- Clear just nulls out all the recorded delay information in
    -- anticipation of a new delay analysis.

Stats: PROC[];
    -- Prints out various statistics gathered during delay recording
    -- and printing.

RecomputeCmd: CmdProc;
    -- Recomputes delays through each of the critical paths, using
    -- the current delay model.
    
DumpCmd: CmdProc;
    -- Dumps all the critical paths to the file contained in the first
    -- argument.

UndumpCmd: CmdProc;
    -- Reads back in dumped critical paths from the file contained
    -- in the first argument.  This is done in a very sloppy fashion:
    -- the nodes and transistors along the critical path have no
    -- relationship to actual nodes and transistors that might have
    -- been read from a .sim file.

NumPaths: ARRAY listType OF INT;
    -- Number of slowest paths to record.  Fewer paths will likely
    -- make Crystal run faster.  There's a separate count for each
    -- type of list.

MaxPaths: INT = 100;
    -- Maximum allowable value for NumPaths.

Threshold: ARRAY listType OF REAL;
    -- These values are exported to save procedure invocation overhead.
    -- Delays less than the threshold values cannot possibly be among
    -- the longest seen so far.

PrintEdgeSpeeds: BOOLEAN;
    -- TRUE means print out edge speeds when printing critical
    -- path information.

END.