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
74
75
|
//## 2.3 Immediate Encoding Variants
//### Figure 2.3
//RISC-V base instruction formats showing immediate variants.
[wavedrom, ,svg]
....
{reg: [
{bits: 7, name: 'opcode'},
{bits: 5, name: 'rd'},
{bits: 3, name: 'func3'},
{bits: 5, name: 'rs1'},
{bits: 5, name: 'rs2'},
{bits: 7, name: 'funct7'}
], config: {label: {right: 'R-Type'}}}
....
[wavedrom, ,svg]
....
{reg: [
{bits: 7, name: 'opcode'},
{bits: 5, name: 'rd'},
{bits: 3, name: 'func3'},
{bits: 5, name: 'rs1'},
{bits: 12, name: 'imm[11:0]', type: 3},
], config: {label: {right: 'I-Type'}}}
....
[wavedrom, ,svg]
....
{reg: [
{bits: 7, name: 'opcode'},
{bits: 5, name: 'imm[4:0]', type: 3},
{bits: 3, name: 'func3'},
{bits: 5, name: 'rs1'},
{bits: 5, name: 'rs2'},
{bits: 7, name: 'imm[11:5]', type: 3}
], config: {label: {right: 'S-Type'}}}
....
[wavedrom, ,svg]
....
{reg: [
{bits: 7, name: 'opcode'},
{bits: 1, name: '[11]', type: 3},
{bits: 4, name: 'imm[4:1]', type: 3},
{bits: 3, name: 'func3'},
{bits: 5, name: 'rs1'},
{bits: 5, name: 'rs2'},
{bits: 6, name: 'imm[10:5]', type: 3},
{bits: 1, name: '[12]', type: 3}
], config: {label: {right: 'B-Type'}}}
....
[wavedrom, ,svg]
....
{reg: [
{bits: 7, name: 'opcode'},
{bits: 5, name: 'rd'},
{bits: 20, name: 'imm[31:12]', type: 3}
], config: {label: {right: 'U-Type'}}}
....
[wavedrom, ,svg]
....
{reg: [
{bits: 7, name: 'opcode'},
{bits: 5, name: 'rd'},
{bits: 8, name: 'imm[19:12]', type: 3},
{bits: 1, name: '[11]', type: 3},
{bits: 10, name: 'imm[10:1]', type: 3},
{bits: 1, name: '[20]', type: 3}
], config: {label: {right: 'J-Type'}}}
....
|