Please, help us to better know about our user community by answering the following short survey: https://forms.gle/wpyrxWi18ox9Z5ae9
BasicConfig.h
Go to the documentation of this file.
1 // The configured options and settings for SystemC developments
2 // Will be used to configure Main_File/include/BaseConfig.h
10 #include <assert.h> /* assert */
11 #include <stdint.h> // The standard 'int' types
12 #include <systemc> // For sc_time
13 // A safety limit for clock cycles
14 #define MAX_CLOCK_CYCLES 10000
15 
16 // Define string for the settings
17 #define MY_COMPANY "vjSoft"
18 #define MY_DOMAIN "https://bitbucket.org/jvegh/scgridsimulation/"
19 
20 // Define settings (.ini) files as a string list
21 #define INI_FILES "Simulator"
22 
23 // List keywords legal in 'Simulator.ini'
24 #undef INI_SIMULATOR_KEYWORDS
25 #define INI_SIMULATOR_KEYWORDS "Version"
26 
27 // Not using clock explicitly makes simulation faster and more simple
28 //#define MUST_USE_CLOCK_SIGNAL
29 
30 // Hardware configuration
31 // The grid points are arranged in a grid topology
32 // Define the topology: !! Placing algoritm must be prepared
33 // Presently only 10x6 grid can be selected!
34 #define GRID_SIZE_X 10
35 #define GRID_SIZE_Y 6
36 // The number of wires for transmitting grid number
37 #define GRID_BUS_WIDTH 6
38 #define GRIDPOINT_MASK_WIDTH (1 << GRID_BUS_WIDTH)
39 #define GRID_ID_TYPE uint32_t
40 // The maximum available number of cores
41 #define MAX_GRIDPOINTS_LIMIT (1 << GRID_BUS_WIDTH)
42 #define MAX_GRIDPOINTS GRID_SIZE_X*GRID_SIZE_Y
43 // The actual number of gridpoints
44 #define NUMBER_OF_GRIDPOINTS MAX_GRIDPOINTS
45 
46 // The gridpoints are organized into clusters
47 #define CLUSTER_BUS_WIDTH 4
48 #define MAX_CLUSTERS_LIMIT (1 << CLUSTER_BUS_WIDTH)-1
49 // The maximum available number of clusters
50 #define CLUSTERS_LIMIT 8
51 
52 #define TOPOLOGY_BUS_WIDTH 4
53 #define MAX_TOPOLOGIES_LIMIT (1 << TOPOLOGY_BUS_WIDTH)-1
54 #define CARD_BUS_WIDTH 4
55 #define MAX_CARDS_LIMIT (1 << CARD_BUS_WIDTH)-1
56 #define RACKS_BUS_WIDTH 4
57 #define MAX_RACKS_LIMIT (1 << RACKS_BUS_WIDTH)-1
58 
59 // The gridpoints typically handle several HTreads
60 // (the HW gets frequently blocked by memory or I/O, or missing condition)
61 #define HTHREAD_BUS_WIDTH 4
62 //#define MAX_HTHREADS 1
63 #define MAX_HTHREADS (1 << HTHREAD_BUS_WIDTH)
64 #define MAX_HTHREADS_LIMIT (MAX_HTHREADS-1)
65 // The maximum available number of HThreads : only prepared, but not really used
66 //#define HTHREADS_LIMIT 1-1
67 //#define USE_HTHREADS
68 
69 #define EXECUTION_TIME sc_core::sc_time(10,SC_NS)
70 // Define memory features
71 // We may have 'register' memory, type 0
72 #define RMEMORY_ADDRESS_WIDTH 4
73 // The maximum size of the simulated memory; must be 2**N
74 #define RMAX_MEMORY_SIZE (1 << RMEMORY_ADDRESS_WIDTH)
75 
76 // We may have 'dynamic' memory, type 1
77 #define DMEMORY_ADDRESS_WIDTH 10
78 // The maximum size of the simulated memory; must be 2**N
79 #define DMAX_MEMORY_SIZE (1 << DMEMORY_ADDRESS_WIDTH)
80 #define DMEMORY_READ_TIME sc_core::sc_time(10,SC_NS)
81 
82 // We may have 'far' memory, type 2
83 #define FMEMORY_ADDRESS_WIDTH 16
84 // The maximum size of the simulated memory; must be 2**N
85 #define FMAX_MEMORY_SIZE (1 << FMEMORY_ADDRESS_WIDTH)
86 #define FMEMORY_READ_TIME sc_core::sc_time(60,SC_NS)
87 
88 // We may have 'buffer' memory, type 3
89 #define BMEMORY_ADDRESS_WIDTH 10
90 // The maximum size of the simulated memory; must be 2**N
91 #define BMAX_MEMORY_SIZE (1 << BMEMORY_ADDRESS_WIDTH)
92 
93 
94 // The word size of the registers and memories
95 #define WORD_SIZE 32
96 
97 #define CORE_DEFAULT_ADDRESS (SC_ADDRESS_TYPE)-1
98 #define MEMORY_DEFAULT_ADDRESS (SC_ADDRESS_TYPE)-1
99 
100 // if true, the prolog will use SystemC module name as reference
101 #define USE_MODULE_NAMES false
102 
103 
104 // Define size of message buffer for inter-gridpoint communication
105 #define MAX_IGPCBUFFER_SIZE 16
106 
107 // Operational characteristics
108 
109 // Resolution of time and clock frequency
110 #define SCTIME_RESOLUTION 10,sc_core::SC_PS
111 // Gates operating time
112 #define SCTIME_GATE sc_time(20,sc_core::SC_PS)
113 // Frequency of the system clock
114 #define SCTIME_CLOCKTIME sc_time(100,sc_core::SC_PS)
115 
116 
117 #define USE_DEBUG_DATA_TYPES
118 
119 #ifdef USE_DEBUG_DATA_TYPES
120 // Use normal C++ variables, to make debugging easier
121  typedef uint8_t SC_HTHREAD_ID_TYPE;
122  typedef uint32_t SC_ADDRESS_TYPE;
123  typedef uint32_t SC_GRIDPOINT_ID_TYPE;
124  typedef uint32_t SC_WORD_TYPE;
125  typedef uint64_t SC_GRIDPOINT_MASK_TYPE;
126  typedef uint64_t SC_HTHREAD_MASK_TYPE;
127 
128 #else
129  typedef sc_dt::sc_uint<HTHREAD_BUS_WIDTH> SC_HTHREAD_ID_TYPE;
130  typedef sc_dt::sc_uint<MEMORY_ADDRESS_WIDTH> SC_ADDRESS_TYPE;
131  typedef sc_dt::sc_uint<CORE_BUS_WIDTH> GRID_BUS_WIDTH;
132  typedef sc_dt::sc_uint<WORD_SIZE> SC_WORD_TYPE;
133  typedef sc_dt::sc_uint<MAX_GRIDPOINTS> SC_GRIDPOINT_MASK_TYPE;
134  typedef sc_dt::sc_uint<MAX_HTHREADS> SC_HTHREAD_MASK_TYPE;
135 #endif //
136 
137 // These defines that the modules shall test perfromance
138 #define MEASURE_DATA_TYPES_USING
139 #define MEASURE_USING_MEMORY_TYPES_USING
140 #define PREPARE_PERFORMACE_PLOT
141 
142 // These defined some internal operation options
143 #define MAKE_PARALLEL_PREFETCH
144 
145 // These defines measures the memory
146 #define MEASURE_NETWORK_TRANSFERS
147 #define MEASURE_DIRECT_TRANSFERS
148 #define MEASURE_PROXY_TRANSFERS
149 #define MEMORY_TRANSFER
150 #define MEMORY_ACCESS_TIME
151 #define MEMORY_TOTAL_ACCESS_TIME
152 
153 
154 #define MEASURE_MEMORY0_TRANSFERS
155 #define MEASURE_MEMORY1_TRANSFERS
156 #define MEASURE_MEMORY2_TRANSFERS
157 #define MEASURE_MEMORY3_TRANSFERS
158 
159 // Define if to make benhmarking time measurements
160 #define MAKE_BENCHMARKING true
161