Zane Shelley | b9ea93c | 2023-03-10 10:41:41 -0600 | [diff] [blame] | 1 | { |
| 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", |
| 3 | "title": "Chip Data Schema", |
| 4 | "version": 1, |
| 5 | "type": "object", |
| 6 | "required": ["version", "model_ec"], |
| 7 | "additionalProperties": false, |
| 8 | "properties": { |
| 9 | "version": { |
| 10 | "type": "integer", |
| 11 | "minimum": 1, |
| 12 | "maximum": 1 |
| 13 | }, |
| 14 | "model_ec": { |
| 15 | "type": "array", |
| 16 | "minItems": 1, |
| 17 | "uniqueItems": true, |
| 18 | "items": { "$ref": "#/$defs/model_ec" } |
| 19 | }, |
| 20 | "registers": { |
| 21 | "type": "object", |
| 22 | "additionalProperties": false, |
| 23 | "patternProperties": { |
| 24 | "^\\w+$": { "$ref": "#/$defs/register" } |
| 25 | } |
| 26 | }, |
| 27 | "isolation_nodes": { |
| 28 | "type": "object", |
| 29 | "additionalProperties": false, |
| 30 | "patternProperties": { |
| 31 | "^\\w+$": { "$ref": "#/$defs/isolation_node" } |
| 32 | } |
| 33 | }, |
| 34 | "root_nodes": { |
| 35 | "type": "object", |
| 36 | "propertyNames": { "$ref": "#/$defs/attn_type" }, |
| 37 | "patternProperties": { |
| 38 | "": { "$ref": "#/$defs/root_node" } |
| 39 | } |
| 40 | }, |
| 41 | "capture_groups": { |
| 42 | "type": "object", |
| 43 | "additionalProperties": false, |
| 44 | "patternProperties": { |
| 45 | "^\\w+$": { |
| 46 | "type": "array", |
| 47 | "minItems": 1, |
| 48 | "uniqueItems": true, |
| 49 | "items": { "$ref": "#/$defs/capture_register" } |
| 50 | } |
| 51 | } |
| 52 | } |
| 53 | }, |
| 54 | "$defs": { |
| 55 | "name": { |
| 56 | "type": "string", |
| 57 | "pattern": "^\\w+$" |
| 58 | }, |
| 59 | "instance": { |
| 60 | "type": "integer", |
| 61 | "minimum": 0 |
| 62 | }, |
| 63 | "instance_array": { |
| 64 | "type": "array", |
| 65 | "minItems": 1, |
| 66 | "uniqueItems": true, |
| 67 | "items": { "$ref": "#/$defs/instance" } |
| 68 | }, |
| 69 | "instance_map": { |
| 70 | "type": "object", |
| 71 | "additionalProperties": false, |
| 72 | "patternProperties": { |
| 73 | "^[0-9]+$": { "$ref": "#/$defs/instance" } |
| 74 | } |
| 75 | }, |
| 76 | "hex_string": { |
| 77 | "type": "string", |
| 78 | "pattern": "^0x([0-9a-fA-F]{8}){1,2}$" |
| 79 | }, |
| 80 | "model_ec": { |
| 81 | "type": "string", |
| 82 | "enum": [ |
| 83 | "P10_10", |
| 84 | "P10_20", |
| 85 | "EXPLORER_11", |
| 86 | "EXPLORER_20", |
Zane Shelley | 352293d | 2023-04-06 17:38:15 -0500 | [diff] [blame] | 87 | "ODYSSEY_10" |
Zane Shelley | b9ea93c | 2023-03-10 10:41:41 -0600 | [diff] [blame] | 88 | ] |
| 89 | }, |
| 90 | "attn_type": { |
| 91 | "type": "string", |
Zane Shelley | 925c3ed | 2023-04-14 13:42:22 -0500 | [diff] [blame] | 92 | "enum": ["CHIP_CS", "UNIT_CS", "RECOV", "SP_ATTN", "HOST_ATTN"] |
Zane Shelley | b9ea93c | 2023-03-10 10:41:41 -0600 | [diff] [blame] | 93 | }, |
| 94 | "reg_type": { |
| 95 | "type": "string", |
| 96 | "enum": ["SCOM", "IDSCOM"] |
| 97 | }, |
| 98 | "access_type": { |
| 99 | "type": "string", |
| 100 | "enum": ["RO", "WO", "RW"] |
| 101 | }, |
| 102 | "register": { |
| 103 | "type": "object", |
| 104 | "required": ["instances"], |
| 105 | "additionalProperties": false, |
| 106 | "properties": { |
| 107 | "reg_type": { "$ref": "#/$defs/reg_type" }, |
| 108 | "access": { "$ref": "#/$defs/access_type" }, |
| 109 | "instances": { |
| 110 | "type": "object", |
| 111 | "additionalProperties": false, |
| 112 | "patternProperties": { |
| 113 | "^[0-9]+$": { "$ref": "#/$defs/hex_string" } |
| 114 | } |
| 115 | } |
| 116 | } |
| 117 | }, |
| 118 | "isolation_node": { |
| 119 | "type": "object", |
| 120 | "required": ["instances", "rules", "bits"], |
| 121 | "additionalProperties": false, |
| 122 | "properties": { |
| 123 | "reg_type": { "$ref": "#/$defs/reg_type" }, |
| 124 | "instances": { "$ref": "#/$defs/instance_array" }, |
| 125 | "rules": { |
| 126 | "type": "array", |
| 127 | "minItems": 1, |
| 128 | "uniqueItems": true, |
| 129 | "items": { "$ref": "#/$defs/isolation_rule" } |
| 130 | }, |
| 131 | "bits": { |
| 132 | "type": "object", |
| 133 | "additionalProperties": false, |
| 134 | "patternProperties": { |
| 135 | "^[0-9]+(:[0-9]+)?$": { |
| 136 | "$ref": "#/$defs/isolation_bit" |
| 137 | } |
| 138 | } |
| 139 | }, |
Caleb Palmer | 94ea8ed | 2024-07-25 14:26:46 -0500 | [diff] [blame] | 140 | "op_rules": { |
| 141 | "type": "object", |
| 142 | "additionalProperties": false, |
| 143 | "patternProperties": { |
| 144 | "^\\w+$": { |
| 145 | "$ref": "#/$defs/isolation_op_rules" |
| 146 | } |
| 147 | } |
| 148 | }, |
Zane Shelley | b9ea93c | 2023-03-10 10:41:41 -0600 | [diff] [blame] | 149 | "capture_groups": { |
| 150 | "type": "array", |
| 151 | "minItems": 1, |
| 152 | "uniqueItems": true, |
| 153 | "items": { "$ref": "#/$defs/capture_group" } |
| 154 | } |
| 155 | } |
| 156 | }, |
| 157 | "isolation_rule": { |
| 158 | "type": "object", |
| 159 | "required": ["attn_type", "node_inst", "expr"], |
| 160 | "additionalProperties": false, |
| 161 | "properties": { |
| 162 | "attn_type": { |
| 163 | "type": "array", |
| 164 | "minItems": 1, |
| 165 | "uniqueItems": true, |
| 166 | "items": { "$ref": "#/$defs/attn_type" } |
| 167 | }, |
| 168 | "node_inst": { "$ref": "#/$defs/instance_array" }, |
| 169 | "expr": { "$ref": "#/$defs/isolation_rule_expression" } |
| 170 | } |
| 171 | }, |
| 172 | "isolation_rule_expression": { |
| 173 | "type": "object", |
| 174 | "required": ["expr_type"], |
| 175 | "properties": { |
| 176 | "expr_type": { |
| 177 | "type": "string", |
| 178 | "enum": [ |
| 179 | "reg", |
| 180 | "int", |
| 181 | "and", |
| 182 | "or", |
| 183 | "not", |
| 184 | "lshift", |
| 185 | "rshift" |
| 186 | ] |
| 187 | }, |
| 188 | "reg_name": { "$ref": "#/$defs/name" }, |
| 189 | "reg_inst": { "$ref": "#/$defs/instance_map" }, |
| 190 | "int_value": { "$ref": "#/$defs/hex_string" }, |
| 191 | "expr": { "$ref": "#/$defs/isolation_rule_expression" }, |
| 192 | "exprs": { |
| 193 | "type": "array", |
| 194 | "minItems": 2, |
| 195 | "items": { "$ref": "#/$defs/isolation_rule_expression" } |
| 196 | }, |
| 197 | "shift_value": { |
| 198 | "type": "integer", |
| 199 | "minimum": 0 |
| 200 | } |
| 201 | }, |
| 202 | "allOf": [ |
| 203 | { |
| 204 | "if": { "properties": { "expr_type": { "const": "reg" } } }, |
| 205 | "then": { |
| 206 | "required": ["reg_name"], |
| 207 | "not": { |
| 208 | "required": [ |
| 209 | "int_value", |
| 210 | "shift_value", |
| 211 | "expr", |
| 212 | "exprs" |
| 213 | ] |
| 214 | } |
| 215 | } |
| 216 | }, |
| 217 | { |
| 218 | "if": { "properties": { "expr_type": { "const": "int" } } }, |
| 219 | "then": { |
| 220 | "required": ["int_value"], |
| 221 | "not": { |
| 222 | "required": [ |
| 223 | "reg_name", |
| 224 | "reg_inst", |
| 225 | "shift_value", |
| 226 | "expr", |
| 227 | "exprs" |
| 228 | ] |
| 229 | } |
| 230 | } |
| 231 | }, |
| 232 | { |
| 233 | "if": { |
| 234 | "properties": { |
| 235 | "expr_type": { "enum": ["and", "or"] } |
| 236 | } |
| 237 | }, |
| 238 | "then": { |
| 239 | "required": ["exprs"], |
| 240 | "not": { |
| 241 | "required": [ |
| 242 | "reg_name", |
| 243 | "reg_inst", |
| 244 | "int_value", |
| 245 | "shift_value", |
| 246 | "expr" |
| 247 | ] |
| 248 | } |
| 249 | } |
| 250 | }, |
| 251 | { |
| 252 | "if": { "properties": { "expr_type": { "const": "not" } } }, |
| 253 | "then": { |
| 254 | "required": ["expr"], |
| 255 | "not": { |
| 256 | "required": [ |
| 257 | "reg_name", |
| 258 | "reg_inst", |
| 259 | "int_value", |
| 260 | "shift_value", |
| 261 | "exprs" |
| 262 | ] |
| 263 | } |
| 264 | } |
| 265 | }, |
| 266 | { |
| 267 | "if": { |
| 268 | "properties": { |
| 269 | "expr_type": { "enum": ["lshift", "rshift"] } |
| 270 | } |
| 271 | }, |
| 272 | "then": { |
| 273 | "required": ["expr", "shift_value"], |
| 274 | "not": { |
| 275 | "required": [ |
| 276 | "reg_name", |
| 277 | "reg_inst", |
| 278 | "int_value", |
| 279 | "exprs" |
| 280 | ] |
| 281 | } |
| 282 | } |
| 283 | } |
| 284 | ] |
| 285 | }, |
| 286 | "isolation_bit": { |
| 287 | "type": "object", |
| 288 | "required": ["desc"], |
| 289 | "additionalProperties": false, |
| 290 | "properties": { |
| 291 | "desc": { |
| 292 | "type": "string" |
| 293 | }, |
| 294 | "child_node": { |
| 295 | "type": "object", |
| 296 | "required": ["name"], |
| 297 | "additionalProperties": false, |
| 298 | "properties": { |
| 299 | "name": { "$ref": "#/$defs/name" }, |
| 300 | "inst": { "$ref": "#/$defs/instance_map" } |
| 301 | } |
| 302 | }, |
| 303 | "capture_groups": { |
| 304 | "type": "array", |
| 305 | "minItems": 1, |
| 306 | "uniqueItems": true, |
| 307 | "items": { "$ref": "#/$defs/capture_group" } |
| 308 | } |
| 309 | } |
| 310 | }, |
Caleb Palmer | 94ea8ed | 2024-07-25 14:26:46 -0500 | [diff] [blame] | 311 | "isolation_op_rules": { |
| 312 | "type": "object", |
| 313 | "required": ["op_rule", "reg_name"], |
| 314 | "additionalProperties": false, |
| 315 | "properties": { |
| 316 | "op_rule": { |
| 317 | "type": "string", |
| 318 | "enum": [ |
| 319 | "atomic_or", |
| 320 | "atomic_and", |
| 321 | "read_set_write", |
| 322 | "read_clear_write" |
| 323 | ] |
| 324 | }, |
| 325 | "reg_name": { "#ref": "#/$defs/name" } |
| 326 | } |
| 327 | }, |
Zane Shelley | b9ea93c | 2023-03-10 10:41:41 -0600 | [diff] [blame] | 328 | "capture_group": { |
| 329 | "type": "object", |
| 330 | "required": ["group_name", "group_inst"], |
| 331 | "additionalProperties": false, |
| 332 | "properties": { |
| 333 | "group_name": { "$ref": "#/$defs/name" }, |
| 334 | "group_inst": { "$ref": "#/$defs/instance_map" } |
| 335 | } |
| 336 | }, |
| 337 | "root_node": { |
| 338 | "type": "object", |
| 339 | "required": ["name", "inst"], |
| 340 | "additionalProperties": false, |
| 341 | "properties": { |
| 342 | "name": { "$ref": "#/$defs/name" }, |
| 343 | "inst": { "$ref": "#/$defs/instance" } |
| 344 | } |
| 345 | }, |
| 346 | "capture_register": { |
| 347 | "type": "object", |
| 348 | "required": ["reg_name", "reg_inst"], |
| 349 | "additionalProperties": false, |
| 350 | "properties": { |
| 351 | "reg_name": { "$ref": "#/$defs/name" }, |
| 352 | "reg_inst": { "$ref": "#/$defs/instance_map" } |
| 353 | } |
| 354 | } |
| 355 | } |
| 356 | } |