3f6106983d4d0fa364690da3103c5638be8f4b67
[ghc-hetmet.git] / utils / prof / cgprof / daVinci.h
1 /* ------------------------------------------------------------------------
2  * $Id: daVinci.h,v 1.1 2000/04/05 10:06:36 simonmar Exp $
3  *                                                                      
4  *      Copyright (C) 1995-2000 University of Oxford
5  *                                                                      
6  * Permission to use, copy, modify, and distribute this software,
7  * and to incorporate it, in whole or in part, into other software,
8  * is hereby granted without fee, provided that
9  *   (1) the above copyright notice and this permission notice appear in
10  *       all copies of the source code, and the above copyright notice
11  *       appear in clearly visible form on all supporting documentation
12  *       and distribution media;
13  *   (2) modified versions of this software be accompanied by a complete
14  *       change history describing author, date, and modifications made;
15  *       and
16  *   (3) any redistribution of the software, in original or modified
17  *       form, be without fee and subject to these same conditions.
18  * --------------------------------------------------------------------- */
19
20 #ifndef _DAVINCI_H_
21 #define _DAVINCI_H_
22 #include "symbol.h"
23 #include "matrix.h"
24 #include "cgprof.h"
25
26 #define PAIRMAX(x,y) (((x)>(y))?(x):(y))
27
28 #define SAFEDIV(x,y) (((y)==0.0)?0.0:((x)/(y)))
29
30 #define DAVINCI_ERROR        0
31 #define DAVINCI_OK           1
32 #define DAVINCI_NODE         2
33 #define DAVINCI_MENU         3
34 #define DAVINCI_ICON         4
35 #define DAVINCI_DOUBLE_CLICK 5
36 #define DAVINCI_QUIT         6
37 #define DAVINCI_TCL          7
38
39 #define TCL_HREL 0
40 #define TCL_COMP 1
41 #define TCL_COMM 2
42 #define TCL_WAIT 3
43 #define TCL_EXIT 4
44
45 #define INCLUDEDIR "@includedir@"
46
47 typedef struct {
48   int    type;
49   char **list;
50   int size;
51 } davinciCmd;
52
53
54 #define CRITICAL_COMP              0
55 #define CRITICAL_COMM              1
56 #define CRITICAL_WAIT              2
57 #define CRITICAL_HREL              3
58 #define CRITICAL_SYNCS             4
59
60 #define CRITTYPE_ABSOLUTE     0
61 #define CRITTYPE_ABSDELTA     100
62 #define CRITTYPE_RELDELTA     200
63 #define CRITTYPE_WEIGHTDELTA  300
64
65 extern void graphToDaVinci(int,Matrix*,Matrix *,int);
66 davinciCmd  parseDaVinciCmd(char*);
67 extern void cmdDaVinci(char*,...);
68 extern void initDaVinci();
69 extern void activateDaVinciMenu(char *);  
70 extern void updateColours(int,Matrix*,Matrix*);
71 extern void tclPieUpdate(object_cost *,int,int);
72 extern void tclPieInit();
73
74
75 extern char* lastDavinciCmd;
76 extern int   NodeviewTime;
77 extern int   NodeviewCompress;
78 extern double TotalComp;
79 extern double TotalComm;
80 extern double TotalCompIdle;
81 extern int    TotalSyncs;
82 extern long int TotalH;
83 extern char  *dateProfiled;
84 extern char  *machineName;
85 extern int    bsp_p;
86 extern double bsp_s,bsp_l,bsp_g;
87 extern int CriticalPath;
88 extern int CriticalType;
89 extern double minNodeSize;
90 extern int bsp_p;
91 extern int PrintLogo;
92 extern int Colour;
93 extern int DeltaNormalise;
94 extern int PieCombine;
95 #endif