feat: refactor RIB to RIBP: Update tests and scripts to reflect RIBP interface changes

- Updated test cases in , , , , , , , and  to replace references from RIB to RIBP.
- Modified file names and paths in tests to align with the new RIBP naming conventions.
- Ensured that all assertions and checks in the tests are consistent with the updated RIBP interfaces and functionality.
- Added a new test for migrating user core RIBP interfaces in .
This commit is contained in:
maksyuki committed 2026-08-04 10:56:36 +08:00
1 parent bef5881149
commit 1b4b53c650
139 files changed
+3363 -3217

No files matched your search

+24
View File
@@ -97,6 +97,28 @@ def migrate_user_gpio_interfaces(root: Path) -> list[Path]:
return migrated
def migrate_user_core_ribp_interfaces(root: Path) -> list[Path]:
"""Migrate isolated user-core sources from the retired RIB spelling."""
migrated: list[Path] = []
for source in sorted(
path for path in root.rglob("*") if path.is_file() and path.suffix in {".sv", ".fl"}
):
content = source.read_text(encoding="utf-8")
updated = content.replace("rib_if", "ribp_if")
updated = re.sub(
r"\bribp_if\.(master|slave)\s+rib\b", r"ribp_if.\1 ribp", updated
)
updated = re.sub(r"\brib\.", "ribp.", updated)
updated = re.sub(r"\.rib(\s*\()", r".ribp\1", updated)
updated = re.sub(r"\bahbl2rib\b", "ahbl2ribp", updated)
updated = re.sub(r"\brib\b", "ribp", updated)
if updated == content:
continue
source.write_text(updated, encoding="utf-8")
migrated.append(source)
return migrated
def remove_legacy_picorv32_entry(filelist: Path, management_core_dir: Path) -> None:
"""Remove the PicoRV32 line emitted by the legacy user-core generator."""
excluded = {
@@ -175,6 +197,8 @@ def generate(args: argparse.Namespace) -> None:
run(workspace, log, mpw / "core.py", args.simu)
run(workspace, log, mpw / "info.py", "CORE")
shutil.copytree(shared / "core", candidate / "core")
migrated_core_ribp = migrate_user_core_ribp_interfaces(candidate / "core")
log.write(f"migrated user-core RIBP interfaces: {len(migrated_core_ribp)}\n")
info = shared / "user_design_info.h"
if info.is_file():
shutil.copy2(info, candidate / info.name)
+1 -1
View File
@@ -20,7 +20,7 @@ REQUIRED_FIELDS = {
"checksum",
"cycles",
"mgmt_wait",
"rib_wait",
"ribp_wait",
"sdram_wait",
"psram_wait",
"flash_wait",
+10 -1
View File
@@ -15,7 +15,12 @@ sys.path.insert(0, str(ROOT))
from scripts.check_c_warnings import self_owned_warnings # noqa: E402
RTL_LINT_VALUES = ("SIMU=VERILATOR", "HAVE_SVA=YES", "rtl-lint", "check-rtl-lint")
RTL_LINT_VALUES = ("SIMU=VERILATOR", "HAVE_SVA=YES", "rtl-lint")
RTL_LINT_OBSERVATION_VALUES = (
"SIMU=VERILATOR",
"HAVE_SVA=YES",
"check-rtl-lint",
)
OBSERVATION_TARGETS = ("check-warnings", "check-metrics")
@@ -200,6 +205,10 @@ def main() -> int:
print("\n".join(warnings), flush=True)
return 1
for profile in profiles:
command = ["make", f"CONFIG={profile}", *RTL_LINT_OBSERVATION_VALUES]
print("+ " + " ".join(command), flush=True)
if not args.dry_run:
run_observation(command, args.root, environment)
for target in OBSERVATION_TARGETS:
command = ["make", f"CONFIG={profile}", target]
print("+ " + " ".join(command), flush=True)