feat: complete Palladium Z2 demo for both SA and ICE emulation flows
This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
#!/bin/sh
|
||||
# =============================================================================
|
||||
# compile_sa.sh -- IXCOM compile for Palladium Z2, SA (Simulation Acceleration)
|
||||
#
|
||||
# . ./scripts/env_z2.sh # XE_HOST / XE_BOARDS must be set first
|
||||
# ./scripts/compile_sa.sh
|
||||
#
|
||||
# What IXCOM does here:
|
||||
# -ua unified acceleration compile (design + testbench)
|
||||
# +dut+z2_demo_top the DUT partition that is mapped into the emulator;
|
||||
# everything else (the TB) stays on the host simulator
|
||||
# The compile runs inside ./ixcom_db (AxisWork and the design database land
|
||||
# there) -- run xeDebug from that directory afterwards.
|
||||
#
|
||||
# FIX (2026-10-19): the file lists rtl.f/tb.f contain paths relative to the
|
||||
# PACKAGE ROOT, but vlan resolves them against the compile working directory
|
||||
# (ixcom_db/), which produced:
|
||||
# Error! [FILE_OPEN_ERR] Could not open file (rtl/z2_demo_top.v)
|
||||
# This script therefore generates ABSOLUTE-path file lists for the compile.
|
||||
# It also checks the ixcom exit status / log explicitly, because piping to
|
||||
# tee would otherwise mask a failed compile behind a "finished" message.
|
||||
# =============================================================================
|
||||
set -e
|
||||
cd "$(dirname "$0")/.."
|
||||
ROOT="$PWD"
|
||||
|
||||
: "${XE_HOST:?set XE_HOST first: . ./scripts/env_z2.sh}"
|
||||
: "${XE_BOARDS:?set XE_BOARDS first: . ./scripts/env_z2.sh}"
|
||||
|
||||
mkdir -p ixcom_db
|
||||
|
||||
# Build absolute-path file lists (relative entries are prefixed with $ROOT;
|
||||
# entries that are already absolute, blank lines and comments pass through).
|
||||
for f in rtl tb; do
|
||||
out="ixcom_db/${f}_abs.f"
|
||||
: > "$out"
|
||||
while IFS= read -r line || [ -n "$line" ]; do
|
||||
case "$line" in
|
||||
/*) echo "$line" >> "$out" ;;
|
||||
""|\#*) [ -n "$line" ] && echo "$line" >> "$out" ;;
|
||||
*) echo "$ROOT/$line" >> "$out" ;;
|
||||
esac
|
||||
done < "${f}.f"
|
||||
done
|
||||
|
||||
cd ixcom_db
|
||||
|
||||
set +e
|
||||
ixcom -ua +dut+z2_demo_top \
|
||||
-f ./rtl_abs.f -f ./tb_abs.f \
|
||||
> compile_sa.log 2>&1
|
||||
rc=$?
|
||||
set -e
|
||||
cat compile_sa.log
|
||||
|
||||
if [ "$rc" -ne 0 ] || grep -q "FLOW_FAILED" compile_sa.log; then
|
||||
echo "== IXCOM compile FAILED (rc=$rc) -- see ixcom_db/compile_sa.log =="
|
||||
exit 1
|
||||
fi
|
||||
echo "== IXCOM compile finished OK, log: ixcom_db/compile_sa.log =="
|
||||
@@ -0,0 +1,26 @@
|
||||
#!/bin/sh
|
||||
# =============================================================================
|
||||
# env_z2.sh -- Palladium Z2 SA-mode environment (source this file, don't run it)
|
||||
#
|
||||
# . ./scripts/env_z2.sh
|
||||
#
|
||||
# Fill in the three values marked <...> for your site before first use.
|
||||
# (csh users: the same variables are set with `setenv XE_HOST ...` etc.)
|
||||
# =============================================================================
|
||||
|
||||
# VXE release on the host. On the SCD this is the "red" link target, e.g.
|
||||
# /et3mach/Cadence/red ; on a workstation it is your VXE install path.
|
||||
export VXE_HOME="${VXE_HOME:-<VXE_RELEASE_PATH>}"
|
||||
export PATH="$VXE_HOME/bin:$PATH"
|
||||
|
||||
# SA mode: which emulation host / boards to use (compile AND run).
|
||||
# XE_HOST names the emulation host; xeDebug must run on the SA host.
|
||||
export XE_HOST="${XE_HOST:-<XE_HOST_NAME>}"
|
||||
export XE_BOARDS="${XE_BOARDS:-<BOARDS>}" # e.g. 0-3, per your allocation
|
||||
|
||||
# DBEngine host for xrun-based SA runs. Defaults to the local workstation
|
||||
# (which must be on the InfiniBand network) when left unset.
|
||||
# export DBE_HOST="${DBE_HOST:-<DBENGINE_HOST>}"
|
||||
|
||||
# Optional: tag this job in a shared-emulator environment (no spaces allowed).
|
||||
# export XE_JOBID="z2_demo_$USER"
|
||||
@@ -0,0 +1,23 @@
|
||||
#!/bin/sh
|
||||
# =============================================================================
|
||||
# run_local.sh -- Verify the demo logic WITHOUT Palladium hardware.
|
||||
#
|
||||
# Works with Icarus Verilog (used to validate this package) or, on a Cadence
|
||||
# host, with xrun in pure simulation mode (swap the two lines marked below).
|
||||
# Expected result: 8 "CHECK OK" lines and "TEST PASSED".
|
||||
# =============================================================================
|
||||
set -e
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
mkdir -p sim_local
|
||||
|
||||
# --- Option A: Icarus Verilog -------------------------------------------------
|
||||
iverilog -g2005 -DLOCAL_SIM -o sim_local/z2_demo.vvp -f rtl.f -f tb.f
|
||||
vvp sim_local/z2_demo.vvp | tee sim_local/local_run.log
|
||||
[ -f z2_demo.vcd ] && mv z2_demo.vcd sim_local/z2_demo.vcd
|
||||
|
||||
# --- Option B: Cadence xrun (comment out Option A, uncomment this) ------------
|
||||
# xrun -64bit -define LOCAL_SIM -access +rwc -f rtl.f -f tb.f -logfile sim_local/xrun.log
|
||||
|
||||
grep -q "TEST PASSED" sim_local/local_run.log && echo "== LOCAL RUN: PASS ==" \
|
||||
|| { echo "== LOCAL RUN: FAIL =="; exit 1; }
|
||||
@@ -0,0 +1,38 @@
|
||||
# =============================================================================
|
||||
# run_xedebug.tcl -- Run the demo on Palladium Z2 (SA mode) from xeDebug.
|
||||
#
|
||||
# Launch (ON THE SA HOST, from the ixcom_db directory made by compile_sa.sh):
|
||||
# xeDebug -f run_xedebug.tcl
|
||||
# or start xeDebug interactively and `source run_xedebug.tcl`.
|
||||
#
|
||||
# SA-mode notes:
|
||||
# * xeDebug MUST run on the SA host (not on an arbitrary workstation).
|
||||
# * There is no separate xmsim log in SA mode: simulator output is merged
|
||||
# into xeDebug.log -- grep it for "CHECK" / "TEST PASSED" / *E,*F errors.
|
||||
# * Command spellings (host / xc on -run) follow the Z2 guide and field
|
||||
# practice; confirm with xeDebug `help` on your VXE release if needed.
|
||||
# =============================================================================
|
||||
|
||||
# 1) Connect to the emulation host (same value as $XE_HOST).
|
||||
# Use `host .` instead if xeDebug is already running on that host.
|
||||
host <XE_HOST_NAME>
|
||||
|
||||
# 2) Download the design into the emulator and start it (hot-swap download).
|
||||
xc on -run
|
||||
|
||||
# 3) The testbench (host side) now drives the APB bus, waits for the timer
|
||||
# interrupt, and prints its checks. A successful run ends with:
|
||||
# CHECK OK : ID register = 0x5a320001
|
||||
# ... (8 checks) ...
|
||||
# TEST PASSED (all checks)
|
||||
# Watch xeDebug.log, or in the GUI open the waveform on:
|
||||
# tb_z2_demo.dut.reg_count / gpio_out / irq
|
||||
#
|
||||
# If the run appears stuck, do NOT kill it blindly: first check whether
|
||||
# xc_top.simTime is still advancing and take two gstack samples of the
|
||||
# xmsim main thread (a spinning main thread points to a zero-time loop
|
||||
# in the TB, a blocked one points elsewhere).
|
||||
|
||||
# 4) Optional: keep the host connection warm for the next xeDebug session
|
||||
# (default reuse window is 180 s):
|
||||
# xeset keepHostAliveTimeout 600
|
||||
Reference in New Issue
Block a user