Files
retroSoC/tests/test_xpi_fast_flash.py
T
maksyuki 795b3a4b1d feat: add fast-flash support for Verilator simulation and XPI model
- Introduced  target in Makefile to run fast-flash HP Linux userspace acceptance tests with a 7200-second simulation time limit.
- Updated documentation to describe the new fast-flash model and its usage in simulations.
- Implemented Verilator-specific XPI core and fast flash model to handle slot-0 read operations with improved performance.
- Added new tests for the XPI fast flash model to verify protocol compliance and error handling.
- Enhanced existing tests to ensure proper integration of fast-flash features in the HP Linux simulation flow.
2026-08-28 11:29:52 +08:00

55 lines
1.7 KiB
Python

"""Directed verification for the Verilator-only XPI fast flash backend."""
from __future__ import annotations
import os
import shutil
import subprocess
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
def test_xpi_fast_flash_model_protocol(tmp_path: Path) -> None:
verilator = shutil.which("verilator")
if verilator is None:
return
output = tmp_path / "xpi_fast_flash_model_tb"
obj_dir = tmp_path / "obj"
ccache_dir = tmp_path / "ccache"
ccache_dir.mkdir()
subprocess.run(
[
verilator,
"--binary",
"--timing",
"-Wno-fatal",
"--top-module",
"xpi_fast_flash_model_tb",
"-I" + str(ROOT / "rtl/managed/clusterip/common/rtl"),
"-I" + str(ROOT / "rtl/ip/storage"),
str(ROOT / "rtl/managed/clusterip/common/rtl/utils/register.sv"),
str(ROOT / "rtl/ip/storage/xpi_pkg.sv"),
str(ROOT / "rtl/mini/dv/verilator/rtl/flash_read_byte_binder.sv"),
str(ROOT / "rtl/mini/dv/verilator/rtl/xpi_fast_flash_model.sv"),
str(ROOT / "tests/rtl/xpi_fast_flash_model_tb.sv"),
str(ROOT / "tests/rtl/xpi_fast_flash_dpi.cpp"),
"-Mdir",
str(obj_dir),
"-o",
str(output),
],
check=True,
text=True,
capture_output=True,
env={
**os.environ,
"CCACHE_DIR": str(ccache_dir),
"CCACHE_TEMPDIR": str(ccache_dir),
},
)
result = subprocess.run([output], check=True, text=True, capture_output=True)
assert "XPI fast flash model test passed" in result.stdout