Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
Binary file not shown.
Binary file not shown.
85,064 changes: 85,064 additions & 0 deletions tests/benchmarks_specint_stage_a/memh/505_mcf_r.memh

Large diffs are not rendered by default.

180,616 changes: 180,616 additions & 0 deletions tests/benchmarks_specint_stage_a/memh/531_deepsjeng_r.memh

Large diffs are not rendered by default.

33,329 changes: 33,329 additions & 0 deletions tests/benchmarks_specint_stage_a/memh/999_specrand_ir.memh

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"images": [
{
"bench": "999.specrand_ir",
"elf": "/Users/zhoubot/linx-isa/rtl/LinxCore/tests/benchmarks_specint_stage_a/elf/999.specrand_ir/exe/specrand_ir_base.mytest-m64",
"elf_machine": "Linx",
"elf_type": "DYN",
"entry_point": "0x40002b98",
"memh": "/Users/zhoubot/linx-isa/rtl/LinxCore/tests/benchmarks_specint_stage_a/memh/999_specrand_ir.memh"
},
{
"bench": "505.mcf_r",
"elf": "/Users/zhoubot/linx-isa/rtl/LinxCore/tests/benchmarks_specint_stage_a/elf/505.mcf_r/exe/mcf_r_base.mytest-m64",
"elf_machine": "Linx",
"elf_type": "DYN",
"entry_point": "0x40012d94",
"memh": "/Users/zhoubot/linx-isa/rtl/LinxCore/tests/benchmarks_specint_stage_a/memh/505_mcf_r.memh"
},
{
"bench": "531.deepsjeng_r",
"elf": "/Users/zhoubot/linx-isa/rtl/LinxCore/tests/benchmarks_specint_stage_a/elf/531.deepsjeng_r/exe/deepsjeng_r_base.mytest-m64",
"elf_machine": "Linx",
"elf_type": "DYN",
"entry_point": "0x4001d27c",
"memh": "/Users/zhoubot/linx-isa/rtl/LinxCore/tests/benchmarks_specint_stage_a/memh/531_deepsjeng_r.memh"
}
],
"schema_version": "linxcore-specint-stagea-images-v1",
"source_manifest": "/Users/zhoubot/linx-isa/rtl/LinxCore/tests/benchmarks_specint_stage_a/elf/phaseb_image_manifest.json"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# SPECint Stage-A LinxCore Images

| Bench | ELF | MEMH | Entry |
|---|---|---|---|
| `999.specrand_ir` | `/Users/zhoubot/linx-isa/rtl/LinxCore/tests/benchmarks_specint_stage_a/elf/999.specrand_ir/exe/specrand_ir_base.mytest-m64` | `/Users/zhoubot/linx-isa/rtl/LinxCore/tests/benchmarks_specint_stage_a/memh/999_specrand_ir.memh` | `0x40002b98` |
| `505.mcf_r` | `/Users/zhoubot/linx-isa/rtl/LinxCore/tests/benchmarks_specint_stage_a/elf/505.mcf_r/exe/mcf_r_base.mytest-m64` | `/Users/zhoubot/linx-isa/rtl/LinxCore/tests/benchmarks_specint_stage_a/memh/505_mcf_r.memh` | `0x40012d94` |
| `531.deepsjeng_r` | `/Users/zhoubot/linx-isa/rtl/LinxCore/tests/benchmarks_specint_stage_a/elf/531.deepsjeng_r/exe/deepsjeng_r_base.mytest-m64` | `/Users/zhoubot/linx-isa/rtl/LinxCore/tests/benchmarks_specint_stage_a/memh/531_deepsjeng_r.memh` | `0x4001d27c` |
137 changes: 137 additions & 0 deletions tests/test_specint_full_xcheck_nightly.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
#!/usr/bin/env bash
set -euo pipefail

LINXCORE_ROOT="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)"
REPO_ROOT="$(cd -- "${LINXCORE_ROOT}/../.." && pwd)"

SPEC_DIR="${SPEC_DIR:-${REPO_ROOT}/workloads/spec2017/cpu2017v118_x64_gcc12_avx2}"
SPEC_INPUT_SET="${SPEC_INPUT_SET:-test}"
SPEC_NIGHTLY_REPORT_ONLY="${SPEC_NIGHTLY_REPORT_ONLY:-1}"
OUT_ROOT="${SPEC_XCHECK_OUT_ROOT:-${REPO_ROOT}/workloads/generated/spec2017/full_xcheck_nightly}"
POLICY_MANIFEST="${SPEC_POLICY_MANIFEST:-${REPO_ROOT}/docs/bringup/agent_runs/manifest.yaml}"

if [[ "${SPEC_NIGHTLY_REPORT_ONLY}" != "0" && "${SPEC_NIGHTLY_REPORT_ONLY}" != "1" ]]; then
echo "error: SPEC_NIGHTLY_REPORT_ONLY must be 0 or 1 (got ${SPEC_NIGHTLY_REPORT_ONLY})" >&2
exit 2
fi

mapfile -t BENCHES < <(python3 - "${POLICY_MANIFEST}" <<'PY'
import json
import sys
from pathlib import Path

path = Path(sys.argv[1])
text = path.read_text(encoding="utf-8")
obj = None
try:
obj = json.loads(text)
except json.JSONDecodeError:
try:
import yaml # type: ignore
except ImportError as exc:
raise SystemExit(f"error: failed to parse policy manifest as JSON and PyYAML is unavailable: {path}") from exc
obj = yaml.safe_load(text)
if not isinstance(obj, dict):
raise SystemExit(f"error: invalid policy manifest root: {path}")
policy = obj.get("spec_policy")
if not isinstance(policy, dict):
raise SystemExit(f"error: missing spec_policy in: {path}")
stage_b = policy.get("stage_b_required")
if not isinstance(stage_b, list):
raise SystemExit(f"error: spec_policy.stage_b_required must be list in: {path}")
excluded = policy.get("excluded_benchmarks", [])
excluded_set = set(str(x) for x in excluded) if isinstance(excluded, list) else set()
for bench in stage_b:
b = str(bench)
if b in excluded_set:
continue
print(b)
PY
)

if [[ "${#BENCHES[@]}" -eq 0 ]]; then
echo "error: no stage-b benches resolved from ${POLICY_MANIFEST}" >&2
exit 2
fi

mkdir -p "${OUT_ROOT}"

MATRIX_OUT="${OUT_ROOT}/qemu_matrix"
IMAGES_OUT="${OUT_ROOT}/phaseb_static_images"
SUITE_JSON="${OUT_ROOT}/linxcore_suite_stage_b.json"
XCHECK_OUT="${OUT_ROOT}/xcheck"

build_cmd=(
bash "${REPO_ROOT}/tools/spec2017/build_int_rate_linx.sh"
--spec-dir "${SPEC_DIR}"
--mode phase-c
)
if [[ "${SPEC_BUILD_RUNTIMES:-0}" == "1" ]]; then
build_cmd+=(--build-runtimes)
fi
for bench in "${BENCHES[@]}"; do
build_cmd+=(--bench "${bench}")
done
"${build_cmd[@]}"

matrix_cmd=(
python3 "${REPO_ROOT}/tools/spec2017/run_stage_qemu_matrix.py"
--spec-dir "${SPEC_DIR}"
--stage b
--input-set "${SPEC_INPUT_SET}"
--transports "9p"
--out-dir "${MATRIX_OUT}"
)
if [[ "${SPEC_NIGHTLY_REPORT_ONLY}" == "0" ]]; then
matrix_cmd+=(--strict)
fi
for bench in "${BENCHES[@]}"; do
matrix_cmd+=(--bench "${bench}")
done
"${matrix_cmd[@]}"

phaseb_cmd=(
python3 "${REPO_ROOT}/tools/spec2017/prepare_phaseb_static_images.py"
--spec-dir "${SPEC_DIR}"
--out-dir "${IMAGES_OUT}"
--mode phase-b
)
if [[ -n "${SPEC_PHASEB_OPTIMIZE:-}" ]]; then
phaseb_cmd+=(--optimize "${SPEC_PHASEB_OPTIMIZE}")
fi
for bench in "${BENCHES[@]}"; do
phaseb_cmd+=(--bench "${bench}")
done
"${phaseb_cmd[@]}"

python3 "${REPO_ROOT}/tools/spec2017/gen_linxcore_xcheck_suite.py" \
--image-manifest "${IMAGES_OUT}/phaseb_image_manifest.json" \
--stage b \
--policy-manifest "${POLICY_MANIFEST}" \
--out "${SUITE_JSON}"

xcheck_cmd=(
python3 "${REPO_ROOT}/rtl/LinxCore/tools/trace/run_benchmark_suite_xcheck.py"
--suite "${SUITE_JSON}"
--out-dir "${XCHECK_OUT}"
--mode diagnostic
--max-commits 1000
--continue-on-fail
)
if [[ "${SPEC_NIGHTLY_REPORT_ONLY}" == "1" ]]; then
xcheck_cmd+=(--report-only)
fi
if [[ -n "${SPEC_TB_MAX_CYCLES:-}" ]]; then
xcheck_cmd+=(--tb-max-cycles "${SPEC_TB_MAX_CYCLES}")
fi
if [[ -n "${SPEC_QEMU_MAX_SECONDS:-}" ]]; then
xcheck_cmd+=(--qemu-max-seconds "${SPEC_QEMU_MAX_SECONDS}")
fi
"${xcheck_cmd[@]}"

echo "spec nightly xcheck: completed"
echo "report_only=${SPEC_NIGHTLY_REPORT_ONLY}"
echo "qemu_matrix=${MATRIX_OUT}/qemu_matrix_summary.json"
echo "phaseb_manifest=${IMAGES_OUT}/phaseb_image_manifest.json"
echo "suite_json=${SUITE_JSON}"
echo "xcheck_summary=${XCHECK_OUT}/summary.json"
91 changes: 91 additions & 0 deletions tests/test_specint_stage_a_xcheck.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
#!/usr/bin/env bash
set -euo pipefail

LINXCORE_ROOT="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)"
REPO_ROOT="$(cd -- "${LINXCORE_ROOT}/../.." && pwd)"

SPEC_DIR="${SPEC_DIR:-${REPO_ROOT}/workloads/spec2017/cpu2017v118_x64_gcc12_avx2}"
SPEC_INPUT_SET="${SPEC_INPUT_SET:-test}"
OUT_ROOT="${SPEC_XCHECK_OUT_ROOT:-${REPO_ROOT}/workloads/generated/spec2017/stage_a_xcheck}"
POLICY_MANIFEST="${SPEC_POLICY_MANIFEST:-${REPO_ROOT}/docs/bringup/agent_runs/manifest.yaml}"

BENCHES=(
"999.specrand_ir"
"505.mcf_r"
"531.deepsjeng_r"
)

mkdir -p "${OUT_ROOT}"

MATRIX_OUT="${OUT_ROOT}/qemu_matrix"
IMAGES_OUT="${OUT_ROOT}/phaseb_static_images"
SUITE_JSON="${OUT_ROOT}/linxcore_suite_stage_a.json"
XCHECK_OUT="${OUT_ROOT}/xcheck"

build_cmd=(
bash "${REPO_ROOT}/tools/spec2017/build_int_rate_linx.sh"
--spec-dir "${SPEC_DIR}"
--mode phase-c
)
if [[ "${SPEC_BUILD_RUNTIMES:-0}" == "1" ]]; then
build_cmd+=(--build-runtimes)
fi
for bench in "${BENCHES[@]}"; do
build_cmd+=(--bench "${bench}")
done
"${build_cmd[@]}"

matrix_cmd=(
python3 "${REPO_ROOT}/tools/spec2017/run_stage_qemu_matrix.py"
--spec-dir "${SPEC_DIR}"
--stage a
--input-set "${SPEC_INPUT_SET}"
--transports "9p,initramfs"
--strict
--out-dir "${MATRIX_OUT}"
)
for bench in "${BENCHES[@]}"; do
matrix_cmd+=(--bench "${bench}")
done
"${matrix_cmd[@]}"

phaseb_cmd=(
python3 "${REPO_ROOT}/tools/spec2017/prepare_phaseb_static_images.py"
--spec-dir "${SPEC_DIR}"
--out-dir "${IMAGES_OUT}"
--mode phase-b
)
if [[ -n "${SPEC_PHASEB_OPTIMIZE:-}" ]]; then
phaseb_cmd+=(--optimize "${SPEC_PHASEB_OPTIMIZE}")
fi
for bench in "${BENCHES[@]}"; do
phaseb_cmd+=(--bench "${bench}")
done
"${phaseb_cmd[@]}"

python3 "${REPO_ROOT}/tools/spec2017/gen_linxcore_xcheck_suite.py" \
--image-manifest "${IMAGES_OUT}/phaseb_image_manifest.json" \
--stage a \
--policy-manifest "${POLICY_MANIFEST}" \
--out "${SUITE_JSON}"

xcheck_cmd=(
python3 "${REPO_ROOT}/rtl/LinxCore/tools/trace/run_benchmark_suite_xcheck.py"
--suite "${SUITE_JSON}"
--out-dir "${XCHECK_OUT}"
--mode failfast
--max-commits 1000
)
if [[ -n "${SPEC_TB_MAX_CYCLES:-}" ]]; then
xcheck_cmd+=(--tb-max-cycles "${SPEC_TB_MAX_CYCLES}")
fi
if [[ -n "${SPEC_QEMU_MAX_SECONDS:-}" ]]; then
xcheck_cmd+=(--qemu-max-seconds "${SPEC_QEMU_MAX_SECONDS}")
fi
"${xcheck_cmd[@]}"

echo "spec stage-a xcheck: ok"
echo "qemu_matrix=${MATRIX_OUT}/qemu_matrix_summary.json"
echo "phaseb_manifest=${IMAGES_OUT}/phaseb_image_manifest.json"
echo "suite_json=${SUITE_JSON}"
echo "xcheck_summary=${XCHECK_OUT}/summary.json"
Loading