22
22
ZEPHYR_BINDINGS = ZEPHYR_BASE / "dts/bindings"
23
23
EDT_PICKLE_PATHS = [
24
24
"zephyr/edt.pickle" ,
25
- "hello_world/zephyr/edt.pickle" # for board targets using sysbuild
25
+ "hello_world/zephyr/edt.pickle" , # for board targets using sysbuild
26
26
]
27
27
RUNNERS_YAML_PATHS = [
28
28
"zephyr/runners.yaml" ,
29
- "hello_world/zephyr/runners.yaml" # for board targets using sysbuild
29
+ "hello_world/zephyr/runners.yaml" , # for board targets using sysbuild
30
30
]
31
31
32
32
logger = logging .getLogger (__name__ )
@@ -73,8 +73,7 @@ def get_cached_description(cls, node):
73
73
The cached description for the node's compatible, creating it if needed.
74
74
"""
75
75
return cls ._compat_description_cache .setdefault (
76
- node .matching_compat ,
77
- cls .get_first_sentence (node .description )
76
+ node .matching_compat , cls .get_first_sentence (node .description )
78
77
)
79
78
80
79
@@ -176,9 +175,7 @@ def gather_board_build_info(twister_out_dir):
176
175
if runners_yaml_file :
177
176
with open (runners_yaml_file ) as f :
178
177
runners_yaml = yaml .safe_load (f )
179
- board_runners .setdefault (board_name , {})[board_target ] = (
180
- runners_yaml
181
- )
178
+ board_runners .setdefault (board_name , {})[board_target ] = runners_yaml
182
179
183
180
except Exception as e :
184
181
logger .error (f"Error processing build info file { build_info_file } : { e } " )
@@ -196,12 +193,14 @@ def run_twister_cmake_only(outdir, vendor_filter):
196
193
twister_cmd = [
197
194
sys .executable ,
198
195
f"{ ZEPHYR_BASE } /scripts/twister" ,
199
- "-T" , "samples/hello_world/" ,
196
+ "-T" ,
197
+ "samples/hello_world/" ,
200
198
"-M" ,
201
199
* [arg for path in EDT_PICKLE_PATHS for arg in ('--keep-artifacts' , path )],
202
200
* [arg for path in RUNNERS_YAML_PATHS for arg in ('--keep-artifacts' , path )],
203
201
"--cmake-only" ,
204
- "--outdir" , str (outdir ),
202
+ "--outdir" ,
203
+ str (outdir ),
205
204
]
206
205
207
206
if vendor_filter :
@@ -214,7 +213,7 @@ def run_twister_cmake_only(outdir, vendor_filter):
214
213
'PATH' : os .environ .get ('PATH' , '' ),
215
214
'ZEPHYR_BASE' : str (ZEPHYR_BASE ),
216
215
'HOME' : os .environ .get ('HOME' , '' ),
217
- 'PYTHONPATH' : os .environ .get ('PYTHONPATH' , '' )
216
+ 'PYTHONPATH' : os .environ .get ('PYTHONPATH' , '' ),
218
217
}
219
218
220
219
try :
@@ -247,18 +246,22 @@ def get_catalog(generate_hw_features=False, hw_features_vendor_filter=None):
247
246
if root is not None :
248
247
module_settings [key ].append (Path (module .project ) / root )
249
248
250
- Args = namedtuple ("args" , ["arch_roots" , "board_roots" , "soc_roots" , "board_dir" , "board" ])
249
+ Args = namedtuple (
250
+ "args" , ["arch_roots" , "board_roots" , "soc_roots" , "board_dir" , "board" , "arch" ]
251
+ )
251
252
args_find_boards = Args (
252
253
arch_roots = module_settings ["arch_root" ],
253
254
board_roots = module_settings ["board_root" ],
254
255
soc_roots = module_settings ["soc_root" ],
255
256
board_dir = [],
256
257
board = None ,
258
+ arch = None ,
257
259
)
258
260
259
261
boards = list_boards .find_v2_boards (args_find_boards )
260
262
shields = list_shields .find_shields (args_find_boards )
261
263
systems = list_hardware .find_v2_systems (args_find_boards )
264
+ archs = list_hardware .find_v2_archs (args_find_boards )
262
265
board_catalog = {}
263
266
shield_catalog = {}
264
267
board_devicetrees = {}
@@ -296,7 +299,6 @@ def get_catalog(generate_hw_features=False, hw_features_vendor_filter=None):
296
299
binding_type = "misc"
297
300
is_custom_binding = True
298
301
299
-
300
302
if node .matching_compat is None :
301
303
continue
302
304
@@ -316,9 +318,7 @@ def get_catalog(generate_hw_features=False, hw_features_vendor_filter=None):
316
318
else :
317
319
locations .add ("soc" )
318
320
319
- existing_feature = features .get (binding_type , {}).get (
320
- node .matching_compat
321
- )
321
+ existing_feature = features .get (binding_type , {}).get (node .matching_compat )
322
322
323
323
node_info = {
324
324
"filename" : str (filename ),
@@ -359,13 +359,13 @@ def get_catalog(generate_hw_features=False, hw_features_vendor_filter=None):
359
359
360
360
# Grab all the twister files for this board and use them to figure out all the archs it
361
361
# supports.
362
- archs = set ()
362
+ board_archs = set ()
363
363
pattern = f"{ board .name } *.yaml"
364
364
for twister_file in board .dir .glob (pattern ):
365
365
try :
366
366
with open (twister_file ) as f :
367
367
board_data = yaml .safe_load (f )
368
- archs .add (board_data .get ("arch" ))
368
+ board_archs .add (board_data .get ("arch" ))
369
369
except Exception as e :
370
370
logger .error (f"Error parsing twister file { twister_file } : { e } " )
371
371
@@ -379,7 +379,7 @@ def get_catalog(generate_hw_features=False, hw_features_vendor_filter=None):
379
379
"full_name" : full_name ,
380
380
"doc_page" : doc_page_path ,
381
381
"vendor" : vendor ,
382
- "archs" : list (archs ),
382
+ "archs" : list (board_archs ),
383
383
"socs" : list (socs ),
384
384
"revision_default" : board .revision_default ,
385
385
"supported_features" : supported_features ,
@@ -403,6 +403,14 @@ def get_catalog(generate_hw_features=False, hw_features_vendor_filter=None):
403
403
"commands" : runner .capabilities ().commands ,
404
404
}
405
405
406
+ arch_catalog = {
407
+ arch ['name' ]: {
408
+ "name" : arch ['name' ],
409
+ "full_name" : arch .get ('full_name' , arch ['name' ]),
410
+ }
411
+ for arch in archs ['archs' ]
412
+ }
413
+
406
414
for shield in shields :
407
415
doc_page = guess_doc_page (shield )
408
416
if doc_page and doc_page .is_relative_to (ZEPHYR_BASE ):
@@ -424,5 +432,6 @@ def get_catalog(generate_hw_features=False, hw_features_vendor_filter=None):
424
432
"shields" : shield_catalog ,
425
433
"vendors" : {** vnd_lookup .vnd2vendor , "others" : "Other/Unknown" },
426
434
"socs" : socs_hierarchy ,
435
+ "archs" : arch_catalog ,
427
436
"runners" : available_runners ,
428
437
}
0 commit comments