-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCacheControl.hpp
39 lines (33 loc) · 968 Bytes
/
CacheControl.hpp
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
#pragma once
#include "Bus.hpp"
class CacheControl : public Bus::BusDevice
{
public:
static CacheControl * get_instance();
virtual bool is_address_for_device(unsigned int address) final;
virtual unsigned int get_word(unsigned int address) final;
virtual void set_word(unsigned int address, unsigned int value) final;
union
{
unsigned int raw;
struct
{
unsigned int na0 : 3;
unsigned int scratch_pad_enable1 : 1;
unsigned int na1 : 2;
unsigned int na2 : 1;
unsigned int scratch_pad_enable2 : 1;
unsigned int na3 : 1;
unsigned int crash : 1;
unsigned int na4 : 1;
unsigned int code_cache_enable : 1;
unsigned int na5 : 20;
};
} cache_control_register;
private:
CacheControl() = default;
~CacheControl() = default;
static const unsigned int CACHE_CONTROL_SIZE = 4;
static const unsigned int CACHE_CONTROL_START = 0xFFFE0130;
static const unsigned int CACHE_CONTROL_END = CACHE_CONTROL_START + CACHE_CONTROL_SIZE;
};