-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathdata_memory.h
38 lines (28 loc) · 1.55 KB
/
data_memory.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
27
28
29
30
31
32
33
34
35
36
37
#ifndef __KITE_DATA_MEMORY_H__
#define __KITE_DATA_MEMORY_H__
#include <cstdint>
class data_cache_t;
// Memory
class data_memory_t {
public:
data_memory_t(uint64_t *m_ticks, uint64_t m_memory_size,
uint64_t m_code_segment_size, uint64_t m_latency = 0);
~data_memory_t();
void connect(data_cache_t *m_cache); // Connect to the upper-level cache.
void load_block(uint64_t m_addr, uint64_t m_block_size);// Load a memory block.
void run(); // Run the data memory.
void print_state() const; // Print memory state.
private:
void load_mem_state(); // Load initial memory state.
data_cache_t *cache; // Pointer to the upper-level cache
uint64_t *ticks; // Pointer to processor ticks
int64_t *memory; // Memory space
bool *accessed; // Access history map
uint64_t memory_size; // Memory size
uint64_t code_segment_size; // Code segment size
uint64_t num_dwords; // Number of doublewords
uint64_t latency; // Memory latency
uint64_t resp_ticks; // Response ticks
int64_t *req_block; // Requested block data
};
#endif