blob: e48bf529cd2488c5fe8173800e637d4cfe9f3e7a (
plain)
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
|
#ifndef _HWACHA_H
#define _HWACHA_H
#include "extension.h"
struct ct_state_t
{
void reset();
uint32_t nxpr;
uint32_t nfpr;
uint32_t maxvl;
uint32_t vl;
reg_t vf_pc;
reg_t cause;
reg_t aux;
};
struct ut_state_t
{
void reset();
bool run;
regfile_t<reg_t, 32, true> XPR;
regfile_t<reg_t, 32, false> FPR;
};
class hwacha_t : public extension_t
{
public:
std::vector<insn_desc_t> get_instructions();
const char* name() { return "hwacha"; }
void reset();
ct_state_t* get_ct_state() { return &ct_state; }
ut_state_t* get_ut_state(int idx) { return &ut_state[idx]; }
bool vf_active();
void take_exception(reg_t, reg_t);
void clear_exception() { clear_interrupt(); }
private:
static const int max_uts = 2048;
ct_state_t ct_state;
ut_state_t ut_state[max_uts];
};
REGISTER_EXTENSION(hwacha, []() { return new hwacha_t; })
#endif
|