-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsystem.h
26 lines (22 loc) · 960 Bytes
/
system.h
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
#ifndef __SYSTEM_H
#define __SYSTEM_H
#include "cache.h"
#include "memory.h"
class System {
private:
Cache* caches; // Array of caches, one for each core
Memory* shared_mem; // Main memory, shared by all cores
bus_t bus;
unsigned int bus_width; // Width of system bus; amount of data that can be transferred per usage of bus
unsigned int num_caches; // Number of caches/cores
protocol_t protocol; // Cache coherence protocol. See the definition for protocol_t.
pthread_mutex_t bus_mutex;
counter_t invalidations;
counter_t data_bus_transactions;
public:
void init(unsigned int _num_caches, protocol_t _protocol, Cache::config_t cache_config, unsigned int mem_size, unsigned int _bus_width);
uint8_t access(unsigned int core, addr_t physical_addr, access_t access_type, uint8_t data);
void print_stats();
~System();
};
#endif