mirror of
https://github.com/retroSoC/retroSoC.git
synced 2026-11-05 06:32:37 +00:00
- Implemented a new TCL script for Tiny R2 feasibility checks, reporting clock properties, path delays, and reset loads. - Created a SystemVerilog module for the Tiny R2 reset tree, managing multiple reset signals for the system and its leaves. - Developed a Python script for capturing and analyzing feasibility metrics, ensuring compliance with reset-load and clock frequency requirements. - Added testbenches for the Tiny R2 reset tree and FIFO, validating reset behavior and timing contracts. - Introduced unit tests for feasibility analysis, ensuring correct handling of clock rates and reset load conditions.
46 lines
1.4 KiB
Python
46 lines
1.4 KiB
Python
"""Directed reset-sequencing test for the management Hazard3 debug path."""
|
|
|
|
from __future__ import annotations
|
|
|
|
import shutil
|
|
import subprocess
|
|
from pathlib import Path
|
|
|
|
import pytest
|
|
|
|
ROOT = Path(__file__).resolve().parents[1]
|
|
|
|
|
|
@pytest.mark.parametrize("stages", [3, 5])
|
|
def test_management_debug_reset_waits_for_the_ahbl_bridge(tmp_path: Path, stages: int) -> 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/ip/core/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",
|
|
f"-Pmgmt_debug_reset_tb.ResetSyncStages={stages}",
|
|
"-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
|