1#
2# Schema to validate a YAML file describing a Zephyr test platform
3#
4# We load this with pykwalify
5# (http://pykwalify.readthedocs.io/en/unstable/validation-rules.html),
6# a YAML structure validator, to validate the YAML files that describe
7# Zephyr test platforms
8#
9# The original spec comes from Zephyr's twister script
10#
11
12schema;platform-schema:
13  type: map
14  mapping:
15    "variants":
16      type: map
17      matching-rule: "any"
18      mapping:
19        regex;(([a-zA-Z0-9_]+)):
20          include: platform-schema
21    "identifier":
22      type: str
23    "maintainers":
24      type: seq
25      seq:
26        - type: str
27    "name":
28      type: str
29    "type":
30      type: str
31      enum: ["mcu", "qemu", "sim", "unit", "native"]
32    "simulation":
33      type: seq
34      seq:
35        - type: map
36          mapping:
37            "name":
38              type: str
39              required: true
40              enum:
41                [
42                  "qemu",
43                  "simics",
44                  "xt-sim",
45                  "renode",
46                  "nsim",
47                  "mdb-nsim",
48                  "tsim",
49                  "armfvp",
50                  "native",
51                  "custom",
52                ]
53            "exec":
54              type: str
55    "arch":
56      type: str
57      enum:
58        [
59          # architectures
60          "arc",
61          "arm",
62          "arm64",
63          "mips",
64          "nios2",
65          "posix",
66          "riscv",
67          "sparc",
68          "x86",
69          "xtensa",
70
71          # unit testing
72          "unit",
73        ]
74    "vendor":
75      type: str
76    "tier":
77      type: int
78    "toolchain":
79      type: seq
80      seq:
81        - type: str
82    "sysbuild":
83      type: bool
84    "env":
85      type: seq
86      seq:
87        - type: str
88    "ram":
89      type: int
90    "flash":
91      type: int
92    "twister":
93      type: bool
94    "supported":
95      type: seq
96      seq:
97        - type: str
98    "testing":
99      type: map
100      mapping:
101        "timeout_multiplier":
102          type: number
103          required: false
104        "default":
105          type: bool
106        "binaries":
107          type: seq
108          seq:
109            - type: str
110        "only_tags":
111          type: seq
112          seq:
113            - type: str
114        "ignore_tags":
115          type: seq
116          seq:
117            - type: str
118        "renode":
119          type: map
120          mapping:
121            "uart":
122              type: str
123            "resc":
124              type: str
125
126include: platform-schema
127