mirror of
https://github.com/retroSoC/retroSoC.git
synced 2026-11-04 22:32:36 +00:00
- Added build_hp_rtthread.py for building the RT-Thread kernel with RV64 support. - Updated build_hp_smoke.py to target RV64 architecture and modified output filenames. - Modified generate_vexiiriscv.py to reflect RV64 configuration and memory management. - Created hp_tools.py for shared utilities related to RV64 builds. - Enhanced package_hp_boot.py to package RV64 workloads and updated versioning. - Implemented run_hp_sim.py for executing and validating HP workloads with specific markers. - Developed setup_hp_rtthread.py for installing RT-Thread source and environment setup. - Updated GenerateRetroSocHp.scala to generate RV64 application cores. - Enhanced tests for HP boot bundles, platform specifications, and tool utilities to accommodate RV64 changes. - Adjusted test cases to validate new workload types and ensure compatibility with RV64 architecture.
56 lines
1.5 KiB
Python
56 lines
1.5 KiB
Python
#!/usr/bin/env python3
|
|
"""Build the minimal hart-1 smoke payload used by HP RTL simulation."""
|
|
|
|
from __future__ import annotations
|
|
|
|
import argparse
|
|
import subprocess
|
|
from pathlib import Path
|
|
|
|
try:
|
|
from scripts.hp_tools import require_rv64_elf
|
|
except ModuleNotFoundError:
|
|
from hp_tools import require_rv64_elf
|
|
|
|
|
|
def build(args: argparse.Namespace) -> None:
|
|
output = args.output.resolve()
|
|
images = output / "images"
|
|
images.mkdir(parents=True, exist_ok=True)
|
|
elf = output / "hp_smoke.elf"
|
|
compiler = f"{args.cross}gcc"
|
|
objcopy = f"{args.cross}objcopy"
|
|
subprocess.run(
|
|
[
|
|
compiler,
|
|
"-march=rv64imafdc_zicbom_zicsr_zifencei",
|
|
"-mabi=lp64d",
|
|
"-nostdlib",
|
|
"-nostartfiles",
|
|
"-Wl,--build-id=none",
|
|
f"-Wl,-T,{args.linker.resolve()}",
|
|
"-o",
|
|
str(elf),
|
|
str(args.source.resolve()),
|
|
],
|
|
check=True,
|
|
)
|
|
require_rv64_elf(elf)
|
|
subprocess.run(
|
|
[objcopy, "-O", "binary", str(elf), str(images / "hp_smoke.bin")],
|
|
check=True,
|
|
)
|
|
|
|
|
|
def main() -> None:
|
|
parser = argparse.ArgumentParser(description=__doc__)
|
|
parser.add_argument("--source", type=Path, required=True)
|
|
parser.add_argument("--linker", type=Path, required=True)
|
|
parser.add_argument("--output", type=Path, required=True)
|
|
parser.add_argument("--cross", default="riscv64-unknown-elf-")
|
|
build(parser.parse_args())
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|