Skip to content

Commit 36e285d

Browse files
committed
feat(schema): Add schema for I-x-x subtype
In (#686), a new instruction schema was created for types/subtypes. This commit add the schema for the I-x-x subtype. This commit also add schema for immediate variable and variable type. It is also part of effort in (#655). Signed-off-by: Usman Akinyemi <usmanakinyemi202@gmail.com>
1 parent 3104bb3 commit 36e285d

File tree

4 files changed

+43
-1
lines changed

4 files changed

+43
-1
lines changed

spec/schemas/inst_var_type_schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"type": "string"
1818
},
1919
"type": {
20-
"enum": ["register_reference"]
20+
"enum": ["register_reference", "immediate"]
2121
}
2222
},
2323
"allOf": [
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Copyright (c) 2025 Usman Akinyemi
2+
# SPDX-License-Identifier: BSD-3-Clause-Clear
3+
4+
# yaml-language-server: $schema=../../../schemas/inst_subtype_schema.json
5+
6+
$schema: inst_subtype_schema.json#
7+
kind: instruction_subtype
8+
name: I-x-x
9+
10+
data:
11+
type: { "$ref": "inst_type/I.yaml#" }
12+
subtype: { "$ref": "inst_subtype/I/I-x-x.yaml#" }
13+
opcodes:
14+
$inherits: inst_type/I.yaml#/opcodes
15+
variables:
16+
func11:
17+
$inherits: inst_var/imm.yaml#/data
18+
xs1:
19+
$inherits: inst_var/xs1.yaml#/data
20+
xd:
21+
$inherits: inst_var/xd.yaml#/data

spec/std/isa/inst_var/i-imm12.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Copyright (c) 2025 Usman Akinyemi
2+
# SPDX-License-Identifier: BSD-3-Clause-Clear
3+
4+
# yaml-language-server: $schema=../../schemas/inst_var_schema.json#
5+
6+
$schema: inst_var_schema.json#
7+
kind: instruction_variable
8+
name: imm
9+
10+
data:
11+
$inherits: inst_type/I.yaml#/variables/imm
12+
type: { "$ref": "inst_var_type/imm.yaml#" }

spec/std/isa/inst_var_type/imm.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Copyright (c) 2025 Usman Akinyemi
2+
# SPDX-License-Identifier: BSD-3-Clause-Clear
3+
4+
# yaml-language-server: $schema=../../schemas/inst_var_type_schema.json#
5+
6+
$schema: inst_var_type_schema.json#
7+
kind: instruction_variable_type
8+
name: imm
9+
type: immediate

0 commit comments

Comments
 (0)