-
Notifications
You must be signed in to change notification settings - Fork 0
/
tmp.h
49 lines (49 loc) · 895 Bytes
/
tmp.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
38
39
40
41
42
43
44
45
46
47
48
49
enum Kind {u, j, i, b, s, r, ii, empty};
enum Op
{
EMPTY,
LUI, AUIPC, // u
JAL, // j
JALR, // i
BEQ, BNE, BLT, BGE, BLTU, BGEU, // b
LB, LH, LW, LBU, LHU, //i,加载指令
SB, SH, SW, //s,保存指令
ADDI, SLTI, SLTIU, XORI, ORI, ANDI, SLLI, SRLI, SRAI, // i,立即数运算
ADD, SUB, SLL, SLT, SLTU, XOR, SRL, SRA, OR, AND, // r,运算
ERR
};
struct IFID
{
unsigned code;
unsigned pc;
};
struct IDEX
{
Kind kind;
Op op;
unsigned rs1, rs2, rd, imm;
unsigned rs1_num, rs2_num, rd_num;
unsigned pc;
unsigned codeid;
unsigned guess_status;
};
struct EXMEM
{
Kind kind;
Op op;
unsigned rs1, rs2, rd, imm;
unsigned rs1_num, rs2_num, rd_num;
unsigned pc;
unsigned codeid;
unsigned guess_status;
};
struct MEMWB
{
Kind kind;
Op op;
unsigned rs1, rs2, rd, imm;
unsigned rs1_num, rs2_num, rd_num;
unsigned pc;
unsigned codeid;
unsigned guess_status;
};