Main Page | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members

machine.h

Go to the documentation of this file.
00001 // machine.h
00002 //
00003 // 3/4/98 WAH:  Separated from scheduler library; minor tweaking.
00004 
00005 #ifndef _MACHINE_H_HEAD_
00006 #define _MACHINE_H_HEAD_
00007 
00008 #include <new.h>
00009 #include "TinkerKnobs.H"
00010 #include "lego.H"
00011 
00012 
00013 enum TinkerOpType { INT_OP, FP_OP, MEM_OP, BR_OP, PSUEDO_OP };
00014 enum ResourceStatus { FULL = -2, EMPTY = -99, NOT_FULL = -98, RESERVED = -1 };
00015 
00016 #define COPY_OP MEM_OP
00017 
00018 class machine
00019 {
00020 public:
00021 
00022    const int MaxScheduleLength = 8192;
00023 
00024 protected:
00025 
00026    knobs *K;
00027 
00028    int clustering,
00029        Bypass;                  // TRUE if bypass is assumed, FALSE else
00030 
00031    int  allocated,
00032         NumClusters,
00033         ClusterWidth;
00034 
00035    int BusLatency,              // Default value is 1 cycle
00036        NumBuses,                // Default is 3
00037        cluster_width;           // # fus/cluster, valid only when a
00038                                 //    clustered machine is modelled
00039 
00040    int instrsWb,
00041        LastIssueCycle,
00042        LastWritebackCycle;
00043 
00044    int totalSlots,
00045        *issueSlots,
00046        (*RRT)[ MaxScheduleLength ],
00047        (*BusRRT)[ MaxScheduleLength ],
00048        *IssueConfigInfo;
00049 
00050    // sumedh: to hold the pointer to the op for use in the static estimation
00051    legoOp* (*RRTop)[MaxScheduleLength];
00052 
00053    // Output the RRT
00054    void PrintSchedule( int LastCycle );
00055 
00056 public:
00057 
00058    #define NUM_OPTYPES  4
00059 
00060    machine();
00061    machine( knobs * );
00062    ~machine();
00063 
00064    // Set internal values, based on the kbobs file
00065    void SetKnobs( knobs* Knobs );
00066 
00067    // Gets the various knobs settings and displays them in formatted output
00068    ShowParameters( knobs *Knobs );
00069 
00070    // getMaxScheduleLength: return the # cycles the RRT can hold
00071    int GetMaxScheduleLength()                   { return MaxScheduleLength; }
00072    
00073    //HZ:
00074    int GetNumSlots() {return totalSlots;}
00075 
00076    // Set the parms for the base machine
00077    void setIssueConfig();
00078    void setBusLatency( int value )              { BusLatency = value; }
00079 
00080    void setBypassStatus( int flag )             { Bypass = flag; }
00081    int  getBypassStatus()                       { return Bypass; }
00082 
00083    // Get info on indivdual Ops
00084    enum TinkerOpType TinkerOptype( int opcode );
00085    enum TinkerOpType TinkerOptype( legoOp *Op );
00086    int  opLatency( legoOp *Op );
00087    int  opLatency( int opcode );
00088    int  isBranchOp( legoOp *Op );
00089    int  isStoreOp( legoOp *Op );
00090 //   int  isStoreOp(int opCode );
00091    int  isLoadOp( legoOp *Op );
00092 //   int  isLoadOp(int opCode );
00093    int  isRealOp( legoOp *Op );
00094 //   int  isRealOp( int opcode );
00095 
00096    void adjustIssueStatus( legoOp *Op, int cycle, int slot );
00097 
00098    void resetIssueStatus( int cycle );
00099 
00100    // Fix the function below in the *.C file
00101    void resetIssueStatus( int cycle, int cluster );
00102    void showIssueStatus( int cycle );
00103 
00104    // legoOp-based methods of the above
00105    enum ResourceStatus checkWbStatus( legoOp *Op )      { return NOT_FULL; }
00106    void adjustWritebackStatus( legoOp *Op, int cycle );
00107 
00108 
00109    void setWbStatus( int value )        { instrsWb = value; }
00110    int  getWbStatus()                   { return instrsWb; }
00111    void resetWbStatus()                 { instrsWb = 0; }
00112 
00113    // Reset the resource reservation table (RRT)
00114    void resetMachine();
00115 
00116    // Output the RRT
00117    void printSchedule();
00118    void printSchedule( int Cycle );
00119 
00120 
00121    // Return the estimates: (cycle time and op counts)
00122    void estimateSchedule (double *TotalOps, double *TotalCycles, int assumeDP);
00123 
00124    void initialize_lmdes(knobs *Knobs);
00125 
00126 };
00127 
00128 #endif
00129 
00130 // GetSuperBlockWeight: Gets the weights for an Op in a superblock
00131 double GetSuperblockWeight( legoOp *RRTop, machine *m );

Generated on Mon Jul 21 20:27:59 2003 for TINKER LEGO DOC by doxygen 1.3.2