Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,5 @@
]
}
},
"forwardPorts": [
8000, 8080
]
"forwardPorts": [8000, 8080]
}
38 changes: 38 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,41 @@ repos:
- id: check-merge-conflict
args: ["--assume-in-merge"]
exclude: \.adoc$ # sections titles Level 6 "=======" get flagged otherwise
- id: check-json
exclude: ^\.devcontainer/ # Uses JSONC (comments)

- repo: https://github.com/rbubley/mirrors-prettier
rev: v3.3.3
hooks:
- id: prettier
files: \.json$
exclude: schemas/json-schema-draft-07.json

- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.29.4
hooks:
- id: check-jsonschema
alias: check-jsonschema-inst
files: ^arch/inst/.*\.(yaml|yml)$
args: ["--schemafile", "schemas/inst_schema.json"]
- id: check-jsonschema
alias: check-jsonschema-csr
files: ^arch/csr/.*\.(yaml|yml)$
args: ["--schemafile", "schemas/csr_schema.json"]
- id: check-jsonschema
alias: check-jsonschema-ext
files: ^arch/ext/.*\.(yaml|yml)$
args: ["--schemafile", "schemas/ext_schema.json"]
- id: check-jsonschema
alias: check-jsonschema-cert-model
files: ^arch/certificate_model/.*\.(yaml|yml)$
args: ["--schemafile", "schemas/cert_model_schema.json"]
- id: check-jsonschema
alias: check-jsonschema-cert-class
files: ^arch/certificate_class/.*\.(yaml|yml)$
args: ["--schemafile", "schemas/cert_class_schema.json"]
# Commenting because throwing errors and not sure this is complete yet
# - id: check-jsonschema
# alias: check-jsonschema-manual-version
# files: ^arch/manual/.*\.(yaml|yml)$
# args: ["--schemafile", "schemas/manual_version_schema.json"]
11 changes: 3 additions & 8 deletions schemas/arch_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,12 @@

"type": "object",
"title": "Unified Architecture Specification",
"required": [
"type",
"extensions",
"csrs",
"instructions"
],
"required": ["type", "extensions", "csrs", "instructions"],
"allOf": [
{
"if": {
"properties": {
"type": { "enum": ["fully configured"]}
"type": { "enum": ["fully configured"] }
}
},
"then": {
Expand Down Expand Up @@ -111,7 +106,7 @@
"profile_releases": {
"type": "object",
"items": {
"type": "string"
"type": "string"
}
},
"manuals": {
Expand Down
14 changes: 3 additions & 11 deletions schemas/config_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,7 @@
"properties": {
"XLEN": {
"type": "integer",
"enum": [
32,
64
],
"enum": [32, 64],
"description": "Base instruction set datapath width (e.g., RV32 or RV64)\n"
},
"NAME": {
Expand All @@ -52,7 +49,7 @@
},
"M_MODE_ENDIANESS": {
"type": "integer",
"enum": [ 0, 1, 2],
"enum": [0, 1, 2],
"description": "Endianess of data in M-mode. Can be one of:\n\n * 0: M-mode data is always little endian\n * 1: M-mode data is always big endian\n * 2: M-mode data can be either little or big endian, depending on the RW CSR field mstatus.MBE\n"
},
"S_MODE_ENDIANESS": {
Expand Down Expand Up @@ -390,8 +387,6 @@
"description": "When true, vstval is written with the casue when a SoftwareCheck exception occurs.\nWhen false, vstval is written with 0"
},



"CONFIG_PTR_ADDRESS": {
"type": "integer",
"minimum": 0,
Expand Down Expand Up @@ -510,10 +505,7 @@
}
},
"type": "object",
"required": [
"params",
"extensions"
],
"required": ["params", "extensions"],
"properties": {
"params": {
"$ref": "#/$defs/params"
Expand Down
24 changes: 17 additions & 7 deletions schemas/csr_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,16 @@
},
"csr_register": {
"type": "object",
"required": ["$schema", "kind", "name", "long_name", "length", "description", "priv_mode", "definedBy"],
"required": [
"$schema",
"kind",
"name",
"long_name",
"length",
"description",
"priv_mode",
"definedBy"
],

"properties": {
"$schema": {
Expand Down Expand Up @@ -202,11 +211,11 @@
"type": "object",
"description": "A full Asciidoc description of the CSR, intended to be used as documentation.",
"properties": {
"$copy" : {
"type": "string",
"format": "uri-reference"
}
},
"$copy": {
"type": "string",
"format": "uri-reference"
}
},
"additionalProperties": false
}
]
Expand All @@ -230,7 +239,8 @@
"default": false,
"description": "Whether or not the CSR is accessible via an indirect address"
},
"virtual_address": true, "$comment": "Conditionally required; see below",
"virtual_address": true,
"$comment": "Conditionally required; see below",
"priv_mode": {
"enum": ["M", "S", "U", "VS"]
},
Expand Down
68 changes: 50 additions & 18 deletions schemas/ext_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,14 @@
},
"ext_data": {
"type": "object",
"required": ["$schema", "kind", "name", "description", "long_name", "versions"],
"required": [
"$schema",
"kind",
"name",
"description",
"long_name",
"versions"
],
"properties": {
"$schema": {
"type": "string",
Expand Down Expand Up @@ -101,24 +108,29 @@
"description": "Extension(s) that conflict with this extension; both cannot be implemented at the same time",
"oneOf": [
{ "$ref": "schema_defs.json#/$defs/extension_requirement" },
{ "type": "array", "items": { "$ref": "schema_defs.json#/$defs/extension_requirement" }}
{
"type": "array",
"items": {
"$ref": "schema_defs.json#/$defs/extension_requirement"
}
}
]
},
"versions": {
"type": "array",
"items": {
"type": "object",
"required": ["version", "state"],
"if": {
"properties": {
"state": {
"const": "ratified"
}
"if": {
"properties": {
"state": {
"const": "ratified"
}
},
"then": {
"required": ["ratification_date"]
},
}
},
"then": {
"required": ["ratification_date"]
},
"properties": {
"version": {
"$ref": "schema_defs.json#/$defs/extension_version"
Expand Down Expand Up @@ -147,10 +159,19 @@
},
"ratification_date": {
"oneOf": [
{"type": "string", "pattern": "^20[0-9][0-9]-(0[1-9]|1[0-2])$", "$comment": "When ratification date is known",
"description": "A specific year and month in YYYY-MM format", "examples": ["2019-01", "2024-12"] },
{"type": "string", "pattern": "^unknown$", "$comment": "When ratification date is unknown" },
{"type": "null", "$comment": "When version isn't ratified" }
{
"type": "string",
"pattern": "^20[0-9][0-9]-(0[1-9]|1[0-2])$",
"$comment": "When ratification date is known",
"description": "A specific year and month in YYYY-MM format",
"examples": ["2019-01", "2024-12"]
},
{
"type": "string",
"pattern": "^unknown$",
"$comment": "When ratification date is unknown"
},
{ "type": "null", "$comment": "When version isn't ratified" }
]
},
"changes": {
Expand All @@ -160,12 +181,23 @@
},
"description": "Changes since last version"
},
"url": { "type": "string", "format": "uri", "description": "Link to ratified document" },
"url": {
"type": "string",
"format": "uri",
"description": "Link to ratified document"
},
"implies": {
"description": "Extension(s) implied by this extension (i.e., any subextensions)",
"oneOf": [
{ "$ref": "schema_defs.json#/$defs/extension_name_and_version" },
{ "type": "array", "items": { "$ref": "schema_defs.json#/$defs/extension_name_and_version" }}
{
"$ref": "schema_defs.json#/$defs/extension_name_and_version"
},
{
"type": "array",
"items": {
"$ref": "schema_defs.json#/$defs/extension_name_and_version"
}
}
]
},
"requires": {
Expand Down
15 changes: 12 additions & 3 deletions schemas/inst_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"description": "Specific value(s) that are not permitted for this field."
}
},
"required": [ "location" ],
"required": ["location"],
"additionalProperties": false
},
"field": {
Expand Down Expand Up @@ -146,7 +146,16 @@
},
"inst_data": {
"type": "object",
"required": ["$schema", "kind", "name", "long_name", "description", "definedBy", "access", "assembly"],
"required": [
"$schema",
"kind",
"name",
"long_name",
"description",
"definedBy",
"access",
"assembly"
],
"additionalProperties": false,
"properties": {
"$schema": {
Expand Down Expand Up @@ -278,5 +287,5 @@
}
},

"$ref": "#/$defs/inst_data"
"$ref": "#/$defs/inst_data"
}
9 changes: 8 additions & 1 deletion schemas/manual_version_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,14 @@
},

"type": "object",
"required": ["manual", "version", "name", "marketing_version", "state", "volumes"],
"required": [
"manual",
"version",
"name",
"marketing_version",
"state",
"volumes"
],
"properties": {
"name": {
"type": "string",
Expand Down
15 changes: 7 additions & 8 deletions schemas/schema_defs.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,12 @@
},
"field_location": {
"oneOf": [
{"type": "number", "description": "Location of a single bit"},
{"type": "string", "pattern": "^[0-9]+-[0-9]+$", "description": "Location range of a multi-bit field"}
{ "type": "number", "description": "Location of a single bit" },
{
"type": "string",
"pattern": "^[0-9]+-[0-9]+$",
"description": "Location range of a multi-bit field"
}
],
"description": "Location of a field in a register"
},
Expand Down Expand Up @@ -58,11 +62,7 @@
"oneOf": [
{
"type": "string",
"enum": [
"mandatory",
"optional",
"prohibited"
]
"enum": ["mandatory", "optional", "prohibited"]
},
{
"type": "object",
Expand Down Expand Up @@ -138,7 +138,6 @@
"additionalProperties": false
}
]

},
"requires_entry": {
"oneOf": [
Expand Down
Loading