feat: enhance SoC topology and user extensions with APB targets and validation scripts

- Added APB target definitions in soc_topology.json for various peripherals.
- Introduced user_extensions.json to define user core and IP targets.
- Updated generate_filelist.py to include SVA paths.
- Refactored ip_apb_wrapper.sv to utilize generated APB interfaces and bridges.
- Simplified user_core_top.sv and user_ip_top.sv by including generated bindings.
- Implemented check_clock_reset_domains.py to validate clock/reset domains and CDC crossings.
- Updated regress.py to include SVA support in simulation commands.
- Added tests for clock/reset domain validation and user extensions generation.
- Enhanced test coverage for topology generation and APB target ownership validation.
This commit is contained in:
maksyuki committed 2026-07-23 16:42:25 +08:00
1 parent d886cd992c
commit 7d90d2ffb4
22 files changed
+1118 -561

No files matched your search

+46
View File
@@ -0,0 +1,46 @@
"""Tests for the root clock/reset and CDC inventory checker."""
from __future__ import annotations
import json
import subprocess
import sys
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
DOMAIN_MAP = ROOT / "rtl/mini/integration/clock_reset_domains.json"
CHECKER = ROOT / "scripts/check_clock_reset_domains.py"
def check(domain_map: Path) -> subprocess.CompletedProcess[str]:
return subprocess.run(
[sys.executable, str(CHECKER), "--map", str(domain_map), "--root", str(ROOT)],
text=True,
capture_output=True,
)
def write_invalid_map(tmp_path: Path, document: dict[str, object]) -> Path:
path = tmp_path / "clock_reset_domains.json"
path.write_text(json.dumps(document), encoding="utf-8")
return path
def test_clock_reset_domain_inventory_matches_the_rcu() -> None:
result = check(DOMAIN_MAP)
assert result.returncode == 0, result.stderr
def test_clock_reset_domain_inventory_rejects_unknown_domain_and_instance(tmp_path: Path) -> None:
document = json.loads(DOMAIN_MAP.read_text(encoding="utf-8"))
document["crossings"][0]["destination"] = "unknown"
result = check(write_invalid_map(tmp_path, document))
assert result.returncode != 0
assert "references an unknown domain" in result.stderr
document = json.loads(DOMAIN_MAP.read_text(encoding="utf-8"))
document["domains"][0]["instance"] = "u_missing_rst_sync"
result = check(write_invalid_map(tmp_path, document))
assert result.returncode != 0
assert "does not declare rst_sync instance" in result.stderr