Files
retroSoC/tests/test_mgmt_debug.py
T
maksyuki 6cff6102a4 feat: add management debug reset and JTAG integration for Hazard3
- Implemented  module to handle debug reset requests, ensuring proper synchronization with the AHB-Lite bridge.
- Created  to integrate JTAG-DTM and Debug Module, facilitating abstract command exposure.
- Updated  and  modules to include JTAG interface signals.
- Enhanced the development environment with scripts for running debug sessions using OpenOCD and GDB.
- Added tests for management debug reset functionality and JTAG integration, ensuring correct behavior under various scenarios.
- Updated SDC generation to include JTAG clock domain and port requirements.
- Modified various scripts to support new debug features and ensure compatibility with the Hazard3 architecture.
2026-08-05 22:30:11 +08:00

43 lines
1.2 KiB
Python

"""Directed reset-sequencing test for the management Hazard3 debug path."""
from __future__ import annotations
import shutil
import subprocess
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
def test_management_debug_reset_waits_for_the_ahbl_bridge(tmp_path: Path) -> None:
iverilog = shutil.which("iverilog")
vvp = shutil.which("vvp")
if iverilog is None or vvp is None:
return
simulation = tmp_path / "mgmt_debug_reset_tb"
sources = (
ROOT / "rtl/managed/clusterip/common/rtl/utils/register.sv",
ROOT / "rtl/managed/clusterip/common/rtl/clkrst/rst_sync.sv",
ROOT / "rtl/mini/top/mgmt_debug_reset.sv",
ROOT / "tests/rtl/mgmt_debug_reset_tb.sv",
)
subprocess.run(
[
iverilog,
"-g2012",
"-DSV_ASSRT_DISABLE",
f"-I{ROOT / 'rtl/managed/clusterip/common/rtl'}",
"-s",
"mgmt_debug_reset_tb",
"-o",
str(simulation),
*(str(source) for source in sources),
],
check=True,
)
result = subprocess.run([vvp, str(simulation)], text=True, capture_output=True, check=True)
assert "management debug reset test passed" in result.stdout