This commit is contained in:
Carlos Gutierrez
2025-10-05 00:52:44 -04:00
parent 5fa19944cd
commit 851204e058
3 changed files with 20 additions and 24 deletions

View File

@@ -6,24 +6,29 @@ echo "[build_workloads] Compiling all workloads..."
# Compile tinyml_kws # Compile tinyml_kws
echo "[build_workloads] Compiling tinyml_kws..." echo "[build_workloads] Compiling tinyml_kws..."
arm-linux-gnueabihf-gcc -O2 -static -o "$RUN/tinyml_kws" \ gcc -O2 -static -o "$RUN/tinyml_kws" \
"$(dirname "$0")/../workloads/tinyml_kws.c" -lm "$(dirname "$0")/../workloads/tinyml_kws.c" -lm
# Compile sensor_fusion # Compile sensor_fusion
echo "[build_workloads] Compiling sensor_fusion..." echo "[build_workloads] Compiling sensor_fusion..."
arm-linux-gnueabihf-gcc -O2 -static -o "$RUN/sensor_fusion" \ gcc -O2 -static -o "$RUN/sensor_fusion" \
"$(dirname "$0")/../workloads/sensor_fusion.c" -lm "$(dirname "$0")/../workloads/sensor_fusion.c" -lm
# Compile aes_ccm # Compile aes_ccm
echo "[build_workloads] Compiling aes_ccm..." echo "[build_workloads] Compiling aes_ccm..."
arm-linux-gnueabihf-gcc -O2 -static -o "$RUN/aes_ccm" \ gcc -O2 -static -o "$RUN/aes_ccm" \
"$(dirname "$0")/../workloads/aes_ccm.c" "$(dirname "$0")/../workloads/aes_ccm.c"
# Compile attention_kernel # Compile attention_kernel
echo "[build_workloads] Compiling attention_kernel..." echo "[build_workloads] Compiling attention_kernel..."
arm-linux-gnueabihf-gcc -O2 -static -o "$RUN/attention_kernel" \ gcc -O2 -static -o "$RUN/attention_kernel" \
"$(dirname "$0")/../workloads/attention_kernel.c" -lm "$(dirname "$0")/../workloads/attention_kernel.c" -lm
# Compile IoT LLM simulation
echo "[build_workloads] Compiling iot_llm_sim..."
gcc -O2 -static -o "$RUN/iot_llm_sim" \
"$(dirname "$0")/../iot_llm_sim.c"
echo "[build_workloads] All workloads compiled successfully!" echo "[build_workloads] All workloads compiled successfully!"
echo "[build_workloads] Binaries created in $RUN/" echo "[build_workloads] Binaries created in $RUN/"
ls -la "$RUN/" ls -la "$RUN/"

View File

@@ -6,11 +6,11 @@ SRC="$ROOT/gem5src/gem5"
IOT="$ROOT/iot" IOT="$ROOT/iot"
DATA="$ROOT/gem5-data" # persistent (symlink to /mnt/storage/…) DATA="$ROOT/gem5-data" # persistent (symlink to /mnt/storage/…)
RUN="$ROOT/gem5-run" # workloads RUN="$ROOT/gem5-run" # workloads
CFG="/home/carlos/projects/gem5/gem5src/gem5/configs/example/arm/baremetal.py" # Use X86 configuration for IoT LLM simulation
CFG="/home/carlos/projects/gem5/gem5src/gem5/configs/example/gem5_library/x86-ubuntu-run.py"
# --- build target (ARM by default) --- # --- build target (X86 for IoT LLM simulation) ---
# Updated path based on tree.log analysis: ../gem5src/gem5/build/ARM/gem5.opt GEM5_BIN="$ROOT/gem5src/gem5/build/X86/gem5.opt"
GEM5_BIN="$ROOT/gem5src/gem5/build/ARM/gem5.opt"
# --- auto-build if missing (non-interactive: sends newline to accept hooks prompt) --- # --- auto-build if missing (non-interactive: sends newline to accept hooks prompt) ---
if [ ! -x "$GEM5_BIN" ]; then if [ ! -x "$GEM5_BIN" ]; then

View File

@@ -14,29 +14,20 @@ OUTDIR="$OUT_DATA/$TAG"
mkdir -p "$OUTDIR" mkdir -p "$OUTDIR"
echo "[run_one] $TAG mem=$MEM -> $OUTDIR" echo "[run_one] $TAG mem=$MEM -> $OUTDIR"
# Map core types to baremetal.py CPU types # For IoT LLM simulation with x86-ubuntu-run.py
# Map core types to CPU types (simplified for IoT)
if [ "$CORE" = "big" ]; then if [ "$CORE" = "big" ]; then
CPU_TYPE="o3" # Using o3 as closest to O3CPU CPU_TYPE="O3CPU"
elif [ "$CORE" = "little" ]; then elif [ "$CORE" = "little" ]; then
CPU_TYPE="atomic" # Using atomic as closest to TimingSimpleCPU CPU_TYPE="TimingSimpleCPU"
else else
CPU_TYPE="o3" # Default for hybrid CPU_TYPE="O3CPU" # Default for hybrid
fi
# Map DVFS to CPU frequency (simplified)
if [ "$DV" = "high" ]; then
CPU_FREQ="2GHz"
else
CPU_FREQ="1GHz"
fi fi
"$GEM5_BIN" "$CFG" \ "$GEM5_BIN" "$CFG" \
--kernel="$RUN/$W" \ --command="$RUN/$W" \
--workload=ArmBaremetal \
--cpu="$CPU_TYPE" \
--cpu-freq="$CPU_FREQ" \
--mem-type=DDR3_1600_8x8 \
--mem-size="$MEM" \ --mem-size="$MEM" \
--cpu-type="$CPU_TYPE" \
> "$LOG_DATA/${TAG}.stdout.log" \ > "$LOG_DATA/${TAG}.stdout.log" \
2> "$LOG_DATA/${TAG}.stderr.log" 2> "$LOG_DATA/${TAG}.stderr.log"