aboutsummaryrefslogtreecommitdiff
path: root/src/config.h
blob: 17d50aaad08fd50a12779c9e1a5ae2f1b74fe5b2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
// Configurations  ---------------------------------------------------

// To show the computation process:
//#define DEBUG


// ------------------------------------------------
// Number of Agent Ports 
// ------------------------------------------------
// MAX_PORT defines a number of ports of agents.
// Default is 5 and should be 2 or more.

#define MAX_PORT 5



// ------------------------------------------------
// Heaps 
// ------------------------------------------------
// There are three methods for agents and names heaps:
//   - Fixed-size ring buffers (default)
//       The size is specified by an execution option -c
//
//   - Expandable ring buffers
//       Automatically new buffers are inserted when all are run up.
//
//   - Ring buffers whose Initial size and newly inserted size
//     are flexibly changed.
//       The initial size and the expansion magnification are
//       specified by execution options -Xms, -Xmt, respectively.
//
// Choose one among the following three definitions with uncomment.


//#define FIXED_HEAP
//#define EXPANDABLE_HEAP
#define FLEX_EXPANDABLE_HEAP


//
// For the expandable ring buffer, the unit size HOOP_SIZE can be changed.
// We note that HOOP_SIZE must be two to power.
//
#ifdef EXPANDABLE_HEAP
//#define HOOP_SIZE (1 << 12)    // good for small heaps such as fib
#define HOOP_SIZE (1 << 18)      // good for large heaps such as msort-80000
#endif





// ------------------------------------------------
// RuleTable
// ------------------------------------------------
// There are two implementation for the rule table:
//   - Hashed linear table (default)
//   - Simple array table
// To use the hashed one, comment out the following RULETABLE_SIMPLE definition.

//#define RULETABLE_SIMPLE





  
// ------------------------------------------------
// Optimisation
// ------------------------------------------------
// Comment out definitions if not needed.

// 
// Optimisation inspired by Tail Recursion Optimisation  
//
#define OPTIMISE_IMCODE_TRO   

//  
// Optimisation of the intermediate codes
//
//  
//   - Assign registers as little as possible with expecting cache works.
//   - Copy propagation and Dead code elimination for LOAD are performed.
//   - Reg0 is used as a special one that stores results of comparison.
//   - Some combinations are rewritten.
//     For instance, `SUBI src $1 dest' becomes `DEC src dest'.
//
#define OPTIMISE_IMCODE    
  

#ifdef OPTIMISE_IMCODE
// Furthermore optimisations on virtual machine codes:
// the following can work when the OPTIMISE_IMCODE is defined:

//
// Generate virtual machine codes with two-address notation
//
#define OPTIMISE_TWO_ADDRESS

#ifdef OPTIMISE_TWO_ADDRESS
#define OPTIMISE_TWO_ADDRESS_MKAGENT1 // For MKAGENT1
#define OPTIMISE_TWO_ADDRESS_MKAGENT2 // For MKAGENT2
#define OPTIMISE_TWO_ADDRESS_MKAGENT3 // For MKAGENT3
//#define OPTIMISE_TWO_ADDRESS_UNARY // For Unary operator like INC, DEC
#endif  


#endif
// -------------------------------------------------




#define COUNT_INTERACTION  // Count interaction.


  
  
//#define VERBOSE_NODE_USE  // Put memory usage of agents and names.
//#define VERBOSE_HOOP_EXPANSION  // Put messages when hoops are expanded.
//#define VERBOSE_EQSTACK_EXPANSION  // Put messages when Eqstacks are expanded.