-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Attempt #2 at new instruction schema
- Loading branch information
Showing
14 changed files
with
186 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
|
||
$schema: inst_format.json# | ||
kind: instruction format | ||
name: B-type | ||
size: 32 | ||
fields: | ||
- location: 31|7|30-25|11-8 | ||
name: imm | ||
kind: immediate | ||
left_shift: 1 | ||
sign_extend: true | ||
relocations: | ||
- $ref: relocation/R_RISCV_BRANCH.yaml# | ||
- location: 24-20 | ||
name: rs2 | ||
kind: x source register | ||
- location: 19-15 | ||
name: rs1 | ||
kind: x source register | ||
- location: 6-0 | ||
name: opcode | ||
kind: opcode | ||
opcode: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
|
||
$schema: inst_format.json# | ||
kind: instruction format | ||
name: I-type | ||
size: 32 | ||
fields: | ||
- location: 31-20 | ||
name: imm | ||
kind: immediate | ||
sign_extend: true | ||
relocations: | ||
- $ref: relocation/R_RISCV_PCREL_LO12_I.yaml# | ||
- $ref: relocation/R_RISCV_TPREL_LO12_I.yaml# | ||
- $ref: relocation/R_RISCV_TLSDESC_ADD_LO12.yaml# | ||
- $ref: relocation/R_RISCV_LO12_I.yaml# | ||
- location: 19-15 | ||
name: rs1 | ||
kind: x source register | ||
- location: 14-12 | ||
name: funct3 | ||
kind: opcode | ||
- location: 11-7 | ||
name: rd | ||
kind: x destination register | ||
- location: 6-0 | ||
name: opcode | ||
kind: opcode | ||
opcode: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
|
||
|
||
$schema: inst_format.json# | ||
kind: instruction format | ||
name: J-type | ||
size: 32 | ||
fields: | ||
- location: 31|19-12|20|30-21 | ||
name: imm | ||
kind: immediate | ||
left_shift: 1 | ||
sign_extend: true | ||
relocations: | ||
- $ref: relocation/R_RISCV_JAL.yaml# | ||
- location: 11-7 | ||
name: rd | ||
kind: x destination register | ||
- location: 6-0 | ||
name: opcode | ||
kind: opcode | ||
opcode: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
|
||
|
||
$schema: inst_format.json# | ||
kind: instruction format | ||
name: R-type | ||
size: 32 | ||
fields: | ||
- location: 31-25 | ||
name: funct7 | ||
kind: opcode | ||
- location: 24-20 | ||
name: rs2 | ||
kind: x source register | ||
- location: 19-15 | ||
name: rs1 | ||
kind: x source register | ||
- location: 14-12 | ||
name: funct3 | ||
kind: opcode | ||
- location: 11-7 | ||
name: rd | ||
kind: x destination register | ||
- location: 6-0 | ||
name: opcode | ||
kind: opcode | ||
opcode: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
|
||
$schema: inst_format.json# | ||
kind: instruction format | ||
name: U-type | ||
fields: | ||
- location: 31-12 | ||
name: imm | ||
kind: immediate | ||
sign_extend: true | ||
left_shift: 12 | ||
relocations: | ||
- $ref: relocation/R_RISCV_GOT_HI20.yaml# | ||
- $ref: relocation/R_RISCV_TLS_GOT_HI20.yaml# | ||
- $ref: relocation/R_RISCV_TLS_GD_HI20.yaml# | ||
- $ref: relocation/R_RISCV_PCREL_HI20.yaml# | ||
- $ref: relocation/R_RISCV_TPREL_HI20.yaml# | ||
- $ref: relocation/R_RISCV_TLSDESC_HI20.yaml# | ||
- location: 11-7 | ||
name: rd | ||
kind: x destination register | ||
- location: 6-0 | ||
name: opcode | ||
kind: opcode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
$schema: reolaction_schema.json# | ||
kind: relocation | ||
relocation_type: R_RISCV_BRANCH | ||
relocation_description: | | ||
12-bit PC-relative branch offset | ||
calculation: S + A - P # calculation, using symbols defined in ABI doc 8.4.1 | ||
number: 16 # the number of the relocation, encoded in the r_info field | ||
type: static # relocation type (static, dynamic, both) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
$schema: reolaction_schema.json# | ||
kind: relocation | ||
location: 31|19-12|20|30-21 | ||
relocation_type: R_RISCV_JAL | ||
relocation_description: | | ||
20-bit PC-relative jump offset | ||
calculation: S + A - P # calculation, using symbols defined in ABI doc 8.4.1 | ||
number: 17 # the number of the relocation, encoded in the r_info field | ||
type: static # relocation type (static, dynamic, both) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters