From 851204e058ce4f515a526ca9d26b91c65dcf722c Mon Sep 17 00:00:00 2001 From: Carlos Gutierrez Date: Sun, 5 Oct 2025 00:52:44 -0400 Subject: [PATCH] updating --- scripts/build_workloads.sh | 13 +++++++++---- scripts/env.sh | 8 ++++---- scripts/run_one.sh | 23 +++++++---------------- 3 files changed, 20 insertions(+), 24 deletions(-) diff --git a/scripts/build_workloads.sh b/scripts/build_workloads.sh index 3ee3941..1b2bcdf 100755 --- a/scripts/build_workloads.sh +++ b/scripts/build_workloads.sh @@ -6,24 +6,29 @@ echo "[build_workloads] Compiling all workloads..." # Compile 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 # Compile 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 # Compile 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" # Compile 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 +# 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] Binaries created in $RUN/" ls -la "$RUN/" diff --git a/scripts/env.sh b/scripts/env.sh index 590a760..11f82c3 100755 --- a/scripts/env.sh +++ b/scripts/env.sh @@ -6,11 +6,11 @@ SRC="$ROOT/gem5src/gem5" IOT="$ROOT/iot" DATA="$ROOT/gem5-data" # persistent (symlink to /mnt/storage/…) 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) --- -# Updated path based on tree.log analysis: ../gem5src/gem5/build/ARM/gem5.opt -GEM5_BIN="$ROOT/gem5src/gem5/build/ARM/gem5.opt" +# --- build target (X86 for IoT LLM simulation) --- +GEM5_BIN="$ROOT/gem5src/gem5/build/X86/gem5.opt" # --- auto-build if missing (non-interactive: sends newline to accept hooks prompt) --- if [ ! -x "$GEM5_BIN" ]; then diff --git a/scripts/run_one.sh b/scripts/run_one.sh index 6399ec6..a50b4fc 100755 --- a/scripts/run_one.sh +++ b/scripts/run_one.sh @@ -14,29 +14,20 @@ OUTDIR="$OUT_DATA/$TAG" mkdir -p "$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 - CPU_TYPE="o3" # Using o3 as closest to O3CPU + CPU_TYPE="O3CPU" elif [ "$CORE" = "little" ]; then - CPU_TYPE="atomic" # Using atomic as closest to TimingSimpleCPU + CPU_TYPE="TimingSimpleCPU" else - CPU_TYPE="o3" # Default for hybrid -fi - -# Map DVFS to CPU frequency (simplified) -if [ "$DV" = "high" ]; then - CPU_FREQ="2GHz" -else - CPU_FREQ="1GHz" + CPU_TYPE="O3CPU" # Default for hybrid fi "$GEM5_BIN" "$CFG" \ - --kernel="$RUN/$W" \ - --workload=ArmBaremetal \ - --cpu="$CPU_TYPE" \ - --cpu-freq="$CPU_FREQ" \ - --mem-type=DDR3_1600_8x8 \ + --command="$RUN/$W" \ --mem-size="$MEM" \ + --cpu-type="$CPU_TYPE" \ > "$LOG_DATA/${TAG}.stdout.log" \ 2> "$LOG_DATA/${TAG}.stderr.log"