-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhardware_discovery.py
More file actions
82 lines (61 loc) · 2.89 KB
/
hardware_discovery.py
File metadata and controls
82 lines (61 loc) · 2.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
"""Hardware Discovery — Explore the NEXUS hardware catalog.
Lists all supported platforms, boards, and architectural details from the
NEXUS hardware configuration package. No hardware required.
Run:
cd /tmp/nexus-runtime && python examples/hardware_discovery.py
"""
import sys
import os
# Ensure hardware package is importable
sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
from hardware import (
list_platforms,
list_boards,
list_all_boards,
get_platform_display,
total_board_count,
)
def main() -> None:
print("=" * 60)
print(" NEXUS Hardware Catalog Discovery")
print("=" * 60)
# ── Summary ─────────────────────────────────────────────────────
platforms = list_platforms()
total = total_board_count()
print(f"\n Total platforms: {len(platforms)}")
print(f" Total boards: {total}")
print()
# ── Per-platform details ────────────────────────────────────────
print("-" * 60)
print(f" {'Platform':<18s} {'Display Name':<32s} {'Boards':>6s}")
print("-" * 60)
for platform in platforms:
boards = list_boards(platform)
display = get_platform_display(platform)
print(f" {platform:<18s} {display:<32s} {len(boards):>6d}")
# ── Full board listing ──────────────────────────────────────────
all_boards = list_all_boards()
print("\n" + "=" * 60)
print(" Full Board Listing by Platform")
print("=" * 60)
for platform, boards in all_boards.items():
display = get_platform_display(platform)
print(f"\n [{platform}] {display}")
for board in boards:
print(f" - {board}")
# ── Platform family categories ──────────────────────────────────
print("\n" + "=" * 60)
print(" Platform Categories")
print("=" * 60)
mcu_platforms = ["arduino", "esp32", "esp8266", "stm32", "nrf52", "teensy", "imx_rt", "rp2040"]
gpu_platforms = ["jetson_nano"]
sbc_platforms = ["raspberry_pi", "beaglebone"]
mcu_boards = sum(len(list_boards(p)) for p in mcu_platforms if p in all_boards)
gpu_boards = sum(len(list_boards(p)) for p in gpu_platforms if p in all_boards)
sbc_boards = sum(len(list_boards(p)) for p in sbc_platforms if p in all_boards)
print(f"\n Microcontrollers: {mcu_boards:>3d} boards ({', '.join(mcu_platforms[:4])}, ...)")
print(f" Edge GPUs: {gpu_boards:>3d} boards ({', '.join(gpu_platforms)})")
print(f" Single-Board PCs: {sbc_boards:>3d} boards ({', '.join(sbc_platforms)})")
print(f"\nDone.")
if __name__ == "__main__":
main()