-
Notifications
You must be signed in to change notification settings - Fork 0
/
funct.go
73 lines (70 loc) · 1.25 KB
/
funct.go
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
package rvasm
var funct3 = map[string]uint32{
"jalr": 0b000,
"beq": 0b000,
"bne": 0b001,
"blt": 0b100,
"bge": 0b101,
"bltu": 0b110,
"bgeu": 0b111,
"lb": 0b000,
"lh": 0b001,
"lw": 0b010,
"lbu": 0b100,
"lhu": 0b101,
"sb": 0b000,
"sh": 0b001,
"sw": 0b010,
"addi": 0b000,
"slti": 0b010,
"sltiu": 0b011,
"xori": 0b100,
"ori": 0b110,
"andi": 0b111,
"slli": 0b001,
"srli": 0b101,
"srai": 0b101,
"add": 0b000,
"sub": 0b000,
"sll": 0b001,
"slt": 0b010,
"sltu": 0b011,
"xor": 0b100,
"srl": 0b101,
"sra": 0b101,
"or": 0b110,
"and": 0b111,
"csrrw": 0b001,
"csrrs": 0b010,
"csrrc": 0b011,
"csrrwi": 0b101,
"csrrsi": 0b110,
"csrrci": 0b111,
"uret": 0b000,
"sret": 0b000,
"mret": 0b000,
"wfi": 0b000,
}
var funct7 = map[string]uint32{
"slli": 0b0000000,
"srli": 0b0000000,
"srai": 0b0100000,
"add": 0b0000000,
"sub": 0b0100000,
"sll": 0b0000000,
"slt": 0b0000000,
"sltu": 0b0000000,
"xor": 0b0000000,
"srl": 0b0000000,
"sra": 0b0100000,
"or": 0b0000000,
"and": 0b0000000,
"uret": 0b0000000,
"sret": 0b0001000,
"mret": 0b0011000,
"wfi": 0b0001000,
}
var funct12 = map[string]uint32{
"ecall": 0,
"ebreak": 1,
}