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

dagan.H

Go to the documentation of this file.
00001 // dagan.H
00002 //
00003 // 3/19/98 WAH:  Adapted from Chao-ying Fu's original DAG analyzer.
00004 
00005 /*
00006         Copyright (C) 1997 CFU Corporation
00007 
00008         File: my_dag.h
00009         Author: Chao-yinig Fu
00010         Date: Jan. 14 1998
00011 
00012         ^..^
00013         (00)
00014 
00015          $__$
00016         <~00~>
00017          (oo)
00018           ||
00019 
00020         ```````
00021         C ^|^ D
00022          \ O /
00023 */
00024 
00025 #ifndef LEGOAN_DAGAN_HEADER
00026 #define LEGOAN_DAGAN_HEADER
00027 
00028 #include <stdio.h>
00029 #include <string.h>
00030 #include "TinkerKnobs.H"
00031 #include "legoMach.H"
00032 #include "legoDAG.H"
00033 // #include "vcg.h"
00034 // #include "node_table.h"
00035 
00036 /*
00037  * class DAGMeasurements
00038  *
00039  * This class holds the measurements (of various sorts) collected for a
00040  * DAG.
00041  */
00042 class DAGMeasurements
00043 {
00044 public:
00045   DAGMeasurements():_num_of_reganti(0),_length_reganti(0),_num_of_regflow(0),_length_regflow(0),_num_of_regout(0),_length_regout(0),_num_of_mem(0),_length_mem(0),_num_of_cntl(0),_length_cntl(0),_num_of_region(0) {}
00046   ~DAGMeasurements() {}
00047 
00048   void inc_num_of_reganti() {_num_of_reganti++;}
00049   void add_num_of_reganti(int i) {_num_of_reganti+=i;}
00050   void add_length_reganti(int i) {_length_reganti+=i;}
00051   void inc_num_of_regflow() {_num_of_regflow++;}
00052   void add_num_of_regflow(int i) {_num_of_regflow+=i;}
00053   void add_length_regflow(int i) {_length_regflow+=i;}
00054   void inc_num_of_regout() {_num_of_regout++;}
00055   void add_num_of_regout(int i) {_num_of_regout+=i;}
00056   void add_length_regout(int i) {_length_regout+=i;}
00057   void inc_num_of_mem() {_num_of_mem++;}
00058   void add_num_of_mem(int i) {_num_of_mem+=i;}
00059   void add_length_mem(int i) {_length_mem+=i;}
00060   void inc_num_of_cntl() {_num_of_cntl++;}
00061   void add_num_of_cntl(int i) {_num_of_cntl+=i;}
00062   void add_length_cntl(int i) {_length_cntl+=i;}
00063   void add_num_of_region(int i) {_num_of_region+=i;}
00064 
00065   void print(FILE *ifp); 
00066   void print_proc_info(legoProc *proc_ptr,FILE *ifp); 
00067 
00068   void reset()
00069   {
00070     _num_of_reganti=0;
00071     _length_reganti=0;
00072     _num_of_regflow=0;
00073     _length_regflow=0;
00074     _num_of_regout=0;
00075     _length_regout=0;
00076     _num_of_mem=0;
00077     _length_mem=0;
00078     _num_of_cntl=0;
00079     _length_cntl=0;
00080     _num_of_region=0;
00081   } // end reset
00082 
00083 private:
00084   int _num_of_reganti;  // number of register antidependences
00085   int _length_reganti;  // length of register antidependences (total)
00086   int _num_of_regflow;  // number of register flow dependences
00087   int _length_regflow;  // length of register flow dependences (total)
00088   int _num_of_regout;   // number of register output dependences
00089   int _length_regout;   // length of register output dependences (total)
00090   int _num_of_mem;      // number of memory dependences
00091   int _length_mem;      // length of memory dependences (total)
00092   int _num_of_cntl;     // number of control dependences
00093   int _length_cntl;     // length of control dependences (total)
00094   int _num_of_region;   // number of regions in DAG
00095 }; // end class DAGMeasurements
00096 
00097 /*
00098  * class DAGAnalysis
00099  *
00100  * A derived class of dag, this class provides methods for DAG analysis.
00101  */
00102 class DAGAnalysis : public dag
00103 {
00104 public:
00105   DAGAnalysis(int Inp_start, int Inp_end, int Ret_start, int Ret_end, int Fp_ret_start,
00106         int Fp_ret_end):dag(Inp_start, Inp_end, Ret_start, Ret_end,
00107         Fp_ret_start, Fp_ret_end), _region_id(-1),_proc_name(NULL) {}
00108 
00109   DAGAnalysis(machine *m,knobs *k, int Inp_start, int Inp_end, int Ret_start, int Ret_end, int Fp_ret_start,
00110         int Fp_ret_end ):dag(m,k,Inp_start, Inp_end, Ret_start, Ret_end,
00111         Fp_ret_start, Fp_ret_end),_region_id(-1),_proc_name(NULL) {}
00112 
00113   ~DAGAnalysis() { delete[] _proc_name;}
00114 
00115   SetRegionId (int i) {_region_id = i;}
00116   SetProcName (char *i)
00117   {
00118     delete[] _proc_name;
00119     _proc_name = new char [strlen (i) + 1];
00120     strcpy (_proc_name, i);
00121   }
00122 
00123   //    void generate_vcg(VCG *vcg);
00124   void Measure (DAGMeasurements *measure);
00125   BigListElement *FindOp (legoOp* op);
00126 
00127   //    void break_flow_dependence(Node_Table *node_table,double acc_threshold,int hoist_threshold);
00128   //    void break_from_op(legoOp* from_op,legoOp *to_op);
00129 
00130 private:
00131   int _region_id;
00132   char *_proc_name;
00133 }; // end class DAGAnalysis
00134 
00135 #endif //LEGOAN_DAGAN_HEADER

Generated on Mon Jul 21 20:24:08 2003 for TINKER LEGO DOC by doxygen 1.3.2