Quellcode durchsuchen

Add date2025/expr2

Youngbin Kim vor 1 Jahr
Ursprung
Commit
3005996549

+ 42 - 38
CMakeLists.txt

@@ -178,47 +178,51 @@ set(CMAKE_EXE_LINKER_FLAGS "${LD_ADDITIONAL_FILES} -T ${LINKER_SCRIPT}")
 project(imc_freeRTOS C ASM)
 add_executable(imc_freeRTOS ${SRC_FILES})
 
-if(IMC_APP_FILES)
-    if(IMC_SPLIT_LOOP)
-        split_loop(IMC_APP_FILES)
-    endif()
-endif()
-
-if(IMC_APP_FILES)
-    if(IMC_INSERT_COMPILER_CHECKPOINTS)
-        if(NOT CMAKE_C_COMPILER MATCHES "clang")
-            message(FATAL_ERROR "compiler must be clang 17 to enable compiler checkpoint insertion")
-        endif()
-        add_compile_definitions(imcUSE_IMC_KERNEL=1)
-        get_target_property(SRC_INCLUDES imc_freeRTOS INCLUDE_DIRECTORIES)
-        foreach(dir ${SRC_INCLUDES})
-            list(APPEND INCLUDE_DIRS "-I${dir}")
-        endforeach()
-        string(REPLACE " " ";" C_FLAGS ${CMAKE_C_FLAGS})
-
-        set(BASIC_OPT_PASSES "loop-simplify,loop-rotate,mem2reg,instcombine,instsimplify,dce,simplifycfg")
-        set(IMC_OPT_PASSES "imc-insert-checkpoints")
-        set(IMC_FLAGS ${IMC_BASE})
-        # set(TARGET_TRIPPLE "--target=armv7em-none-eabi --sysroot=${CMAKE_SYSROOT}")
-
-        foreach(APP_SRC ${IMC_APP_FILES})
-            add_custom_command(
-                OUTPUT ${PROJECT_BINARY_DIR}/${APP_SRC}.s
-                DEPENDS ${APP_SRC}
-                # COMMAND ${CLANG_BIN} --target=armv8m-none-eabi --sysroot=${CMAKE_SYSROOT} -g ${C_FLAGS} -O0 -Xclang -disable-O0-optnone ${INCLUDE_DIRS} -D USE_HAL_DRIVER -D STM32L552xx -c -emit-llvm ${PROJECT_SOURCE_DIR}/${APP_SRC} -o ${PROJECT_BINARY_DIR}/${APP_SRC}.bc
-                COMMAND ${CMAKE_C_COMPILER} -g ${C_FLAGS} -O0 -Xclang -disable-O0-optnone ${INCLUDE_DIRS} -D USE_HAL_DRIVER -D STM32L552xx -c -emit-llvm ${PROJECT_SOURCE_DIR}/${APP_SRC} -o ${PROJECT_BINARY_DIR}/${APP_SRC}.bc
-                COMMAND ${OPT_BIN} -o ${PROJECT_BINARY_DIR}/${APP_SRC}_imc.bc -load-pass-plugin=${LLVM_OPT_PLUGIN} -passes=${BASIC_OPT_PASSES},${IMC_OPT_PASSES} ${PROJECT_BINARY_DIR}/${APP_SRC}.bc
-                COMMAND ${OPT_BIN} ${OPT} -o ${PROJECT_BINARY_DIR}/${APP_SRC}.opt.bc ${PROJECT_BINARY_DIR}/${APP_SRC}_imc.bc
-                COMMAND ${LLC_BIN} ${IMC_FLAGS} ${CPU} ${OPT} -o ${PROJECT_BINARY_DIR}/${APP_SRC}.s ${PROJECT_BINARY_DIR}/${APP_SRC}.opt.bc
-            )
-            list(APPEND APP_OPTS ${PROJECT_BINARY_DIR}/${APP_SRC}.s)
-        endforeach()
-        add_library(imc_apps "${APP_OPTS}")
-    else()
-        if(NOT IMC_SPLIT_LOOP)
+if(IMC_ENABLE_EXTENSION)
+    if(IMC_APP_FILES)
+        if(IMC_INSERT_COMPILER_CHECKPOINTS OR IMC_SPLIT_LOOP)
+            compile_imc_files()
+        else()
             add_library(imc_apps "${IMC_APP_FILES}")
         endif()
     endif()
+else()
+    if(IMC_APP_FILES)
+        if(IMC_INSERT_COMPILER_CHECKPOINTS)
+            if(NOT CMAKE_C_COMPILER MATCHES "clang")
+                message(FATAL_ERROR "compiler must be clang 17 to enable compiler checkpoint insertion")
+            endif()
+            add_compile_definitions(imcUSE_IMC_KERNEL=1)
+            get_target_property(SRC_INCLUDES imc_freeRTOS INCLUDE_DIRECTORIES)
+            foreach(dir ${SRC_INCLUDES})
+                list(APPEND INCLUDE_DIRS "-I${dir}")
+            endforeach()
+            string(REPLACE " " ";" C_FLAGS ${CMAKE_C_FLAGS})
+
+            set(BASIC_OPT_PASSES "loop-simplify,loop-rotate,mem2reg,instcombine,instsimplify,dce,simplifycfg")
+            set(IMC_OPT_PASSES "imc-insert-checkpoints")
+            set(IMC_FLAGS ${IMC_BASE})
+            # set(TARGET_TRIPPLE "--target=armv7em-none-eabi --sysroot=${CMAKE_SYSROOT}")
+
+            foreach(APP_SRC ${IMC_APP_FILES})
+                add_custom_command(
+                    OUTPUT ${PROJECT_BINARY_DIR}/${APP_SRC}.s
+                    DEPENDS ${APP_SRC}
+                    # COMMAND ${CLANG_BIN} --target=armv8m-none-eabi --sysroot=${CMAKE_SYSROOT} -g ${C_FLAGS} -O0 -Xclang -disable-O0-optnone ${INCLUDE_DIRS} -D USE_HAL_DRIVER -D STM32L552xx -c -emit-llvm ${PROJECT_SOURCE_DIR}/${APP_SRC} -o ${PROJECT_BINARY_DIR}/${APP_SRC}.bc
+                    COMMAND ${CMAKE_C_COMPILER} -g ${C_FLAGS} -O0 -Xclang -disable-O0-optnone ${INCLUDE_DIRS} -D USE_HAL_DRIVER -D STM32L552xx -c -emit-llvm ${PROJECT_SOURCE_DIR}/${APP_SRC} -o ${PROJECT_BINARY_DIR}/${APP_SRC}.bc
+                    COMMAND ${OPT_BIN} -o ${PROJECT_BINARY_DIR}/${APP_SRC}_imc.bc -load-pass-plugin=${LLVM_OPT_PLUGIN} -passes=${BASIC_OPT_PASSES},${IMC_OPT_PASSES} ${PROJECT_BINARY_DIR}/${APP_SRC}.bc
+                    COMMAND ${OPT_BIN} ${OPT} -o ${PROJECT_BINARY_DIR}/${APP_SRC}.opt.bc ${PROJECT_BINARY_DIR}/${APP_SRC}_imc.bc
+                    COMMAND ${LLC_BIN} ${IMC_FLAGS} ${CPU} ${OPT} -o ${PROJECT_BINARY_DIR}/${APP_SRC}.s ${PROJECT_BINARY_DIR}/${APP_SRC}.opt.bc
+                )
+                list(APPEND APP_OPTS ${PROJECT_BINARY_DIR}/${APP_SRC}.s)
+            endforeach()
+            add_library(imc_apps "${APP_OPTS}")
+        else()
+            if(NOT IMC_SPLIT_LOOP)
+                add_library(imc_apps "${IMC_APP_FILES}")
+            endif()
+        endif()
+    endif()
 endif()
 
 if(IMC_APP_FILES)

+ 13 - 1
Core/Inc/ImC/imc_extension.h

@@ -13,6 +13,18 @@
     #define imcPRINT_RECOVERY_MESSAGE 0
 #endif
 
-int __imc_get_loop_pass_count();
+#ifndef imcENABLE_STATIC_LOOP_PASS_COUNT
+    #define imcENABLE_STATIC_LOOP_PASS_COUNT 0
+#endif
+
+#ifndef imcLOOP_PASS_COUNT
+    #define imcLOOP_PASS_COUNT 10
+#endif 
+
+#ifndef imcBENCH_REPEAT_COUNT
+    #define imcBENCH_REPEAT_COUNT 1
+#endif
+
+int __imc_get_loop_pass_count(int loop_id);
 
 #endif

+ 6 - 2
Core/Src/ImC/imc_extension.c

@@ -2,7 +2,11 @@
 
 #include "ImC/imc_extension.h"
 
-int __imc_get_loop_pass_count() {
+int __imc_get_loop_pass_count(int loop_id) {
     // printf("__imc_get_loop_pass_count() called\r\n");
-    return 10;
+    #if(imcENABLE_STATIC_LOOP_PASS_COUNT)
+        return imcLOOP_PASS_COUNT;
+    #else
+        return 0;
+    #endif
 }

+ 3 - 1
Core/Src/benchmarks/aes/aes.c

@@ -1,6 +1,7 @@
 #include <string.h> // CBC mode, for memset
 #include <stdio.h>
 #include "benchmarks/aes/aes.h"
+#include "ImC/imc_extension.h"
 
 // The number of columns comprising a state in AES. This is a constant in AES. Value=4
 #define Nb 4
@@ -259,7 +260,8 @@ void AES_CBC_encrypt_buffer(struct AES_ctx *ctx, uint8_t *buf, size_t length)
 }
 
 void vAes() {
-    int IMC_REPEAT = 1000;
+    // int IMC_REPEAT = 1000;
+    int IMC_REPEAT = imcBENCH_REPEAT_COUNT;
     for(int imc=0; imc < IMC_REPEAT; imc++) {
         uint8_t key[] = {0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c};
         uint8_t out[] = {0x76, 0x49, 0xab, 0xac, 0x81, 0x19, 0xb2, 0x46, 0xce, 0xe9, 0x8e, 0x9b, 0x12, 0xe9, 0x19, 0x7d,

+ 4 - 2
Core/Src/benchmarks/basicmath/basicmath.c

@@ -1,6 +1,7 @@
 #include "benchmarks/basicmath/snipmath.h"
 #include "cmsis_os.h"
 #include "ImC/imc_kernel.h"
+#include "ImC/imc_extension.h"
 // #include "imc.h"
 
 #include <stdio.h>
@@ -26,9 +27,10 @@ void vBasicMath()
 
   // while (1)
   // {
-  int IMC_REPEAT = 2;
-  // IMC_REPEAT = 4;
+  // int IMC_REPEAT = 2;
+  int IMC_REPEAT = imcBENCH_REPEAT_COUNT;
   for(int imc_repeat=0; imc_repeat<IMC_REPEAT; imc_repeat++) {
+    sum = 0;
 
     /* Now solve some random equations */
     for (a1 = 1; a1 < 3; a1++)

+ 2 - 1
Core/Src/benchmarks/conv2d/conv2d.c

@@ -14,7 +14,8 @@ static int kernel[KERNEL_SIZE][KERNEL_SIZE] = {
 
 void vConv2d()
 {
-    int IMC_REPEAT = 100;
+    // int IMC_REPEAT = 100;
+    int IMC_REPEAT = imcBENCH_REPEAT_COUNT;
 
     int output[OUTPUT_SIZE * OUTPUT_SIZE];
 

+ 4 - 2
Core/Src/benchmarks/crc/crc_32.c

@@ -5,6 +5,8 @@
 #include <stdio.h>
 #include "crc.h"
 
+#include "ImC/imc_extension.h"
+
 #ifdef __TURBOC__
 #pragma warn - cln
 #endif
@@ -180,8 +182,8 @@ void vCrc()
       register DWORD oldcrc32;
       register int c;
 
-      int IMC_REPEAT = 200;
-      // IMC_REPEAT = 6000;
+      // int IMC_REPEAT = 200;
+      int IMC_REPEAT = imcBENCH_REPEAT_COUNT;
 
       for (int imc_repeat = 0; imc_repeat < IMC_REPEAT; imc_repeat++)
       {

+ 2 - 2
Core/Src/benchmarks/fft/fft.c

@@ -32,8 +32,8 @@ void vFFT()
     MAXSIZE = 128;
     MAXWAVES = 4;
 
-    int IMC_REPEAT = 30;
-    // IMC_REPEAT = 100;
+    // int IMC_REPEAT = 30;
+    int IMC_REPEAT = imcBENCH_REPEAT_COUNT;
 
     // srand(1);
     

+ 2 - 1
Core/Src/benchmarks/matmul/matmul.c

@@ -10,7 +10,8 @@ int B[MAT_SIZE][MAT_SIZE] = {
     [0 ... MAT_SIZE - 1] = {[0 ... MAT_SIZE - 1] = 2}};
 
 void vMatMul() {
-    int IMC_REPEAT = 2000;
+    // int IMC_REPEAT = 2000;
+    int IMC_REPEAT = imcBENCH_REPEAT_COUNT;
     int C[MAT_SIZE * MAT_SIZE] = { 0 };
     for(int imc=0; imc<IMC_REPEAT; imc++) {
 

+ 3 - 2
Core/Src/benchmarks/sha/sha.c

@@ -11,6 +11,7 @@
 #include "sha.h"
 
 #include "cmsis_os.h"
+#include "ImC/imc_extension.h"
 
 extern const char _binary_input_small_asc_start;
 extern const char _binary_input_small_asc_end;
@@ -241,8 +242,8 @@ void sha_print(SHA_INFO *sha_info)
 
 void vSha() {
     SHA_INFO sha_info;
-    int IMC_REPEAT = 3;
-    // IMC_REPEAT = 70;
+    // int IMC_REPEAT = 3;
+    int IMC_REPEAT = imcBENCH_REPEAT_COUNT;
     for(int imc_repeat=0; imc_repeat < IMC_REPEAT; imc_repeat++) {
         memset(&sha_info, 0, sizeof(SHA_INFO));
         sha_stream(&sha_info);

+ 3 - 3
Core/Src/benchmarks/stringsearch/stringsearch_local.c

@@ -17,7 +17,7 @@
 #include <limits.h>
 
 #include "cmsis_os.h"
-
+#include "ImC/imc_extension.h"
 
 /*
 **  Call this with the string to locate to initialize the table
@@ -107,8 +107,8 @@ void vStringSearch()
 
     //   while(1) {
 	  
-	//   int IMC_REPEAT = 2500;
-	  int IMC_REPEAT = 5;
+	//   int IMC_REPEAT = 5;
+	  int IMC_REPEAT = imcBENCH_REPEAT_COUNT;
 	  for(int imc_repeat=0; imc_repeat < IMC_REPEAT; imc_repeat++) {
 
       for (i = 0; find_strings[i]; i++)

+ 0 - 0
imc/exprs/date2025/2_static_evaluation_stable_power/draw_graph_expr_2.ipynb


+ 0 - 0
imc/exprs/date2025/2_static_evaluation_stable_power/draw_graph_expr_2.py


+ 95 - 0
imc/exprs/date2025/2_static_evaluation_stable_power/run_expr_2.py

@@ -0,0 +1,95 @@
+import tempfile
+import time
+import pickle
+import pandas as pd
+
+from imc_utils.pps_e36311a import PPS_E36311A
+from imc_utils.build_config.cortex_m33 import BuildConfigM33
+from imc_utils.build_config.test_env import TestEnv
+from imc_utils.serial_watch import SerialWatcher
+
+WORKSPACE_ROOT = "/home/ybkim/workspace/imc/imc_freertos_app_m33"
+NVM_RESET_BIN = f"{WORKSPACE_ROOT}/imc/utils/nvm_reset.elf"
+OPENOCD_SCRIPT = f"{WORKSPACE_ROOT}/imc_freertos_app_m33.cfg"
+
+def main():
+    pps = PPS_E36311A()
+    config = get_default_build_config()
+
+    benchmarks = [
+        "vBasicMath",
+        "vCrc",
+        "vFFT",
+        "vSha",
+        "vStringSearch",
+        "vMatMul",
+        "vConv2d",
+        "vAes",
+    ]
+    # benchmarks = ["vBasicMath"]
+
+    n_divisions = 5
+
+    for benchmark in benchmarks:
+        all_records = []
+        bench_repeat_count = config.bench_repeat_count_small[benchmark]
+
+        config.bench_name = benchmark
+        config.bench_repeat_count = bench_repeat_count
+
+        step = bench_repeat_count / n_divisions
+        step_int = int(step) if step >= 1 else 1
+        static_loop_pass_counts = list(range(0, bench_repeat_count, step_int))
+        static_loop_pass_counts.append(bench_repeat_count)
+
+        for loop_pass_count in static_loop_pass_counts:
+
+            config.loop_pass_count = loop_pass_count
+
+            pps.set_voltage(3.3, 1)
+            pps.set_current(0.1, 1)
+            pps.output_on(1)
+
+            env = TestEnv(WORKSPACE_ROOT, NVM_RESET_BIN, OPENOCD_SCRIPT)
+
+            with tempfile.TemporaryDirectory() as build_dir:
+                binary = env.build_binary(config, build_dir)
+                env.clear_nvm_and_load_binary(binary, resume=True)
+
+            total_iterations = 1
+            watcher = SerialWatcher(benchmark, total_iterations)
+            records = watcher.run()
+            for record in records:
+                record.update(
+                    {
+                        "loop_pass_count": loop_pass_count,
+                    }
+                )
+                all_records.append(record)
+        df = pd.DataFrame(all_records)
+        print(df)
+        save_records(benchmark, df)
+    pps.output_off(1)
+
+
+def get_default_build_config():
+    config = BuildConfigM33()
+    config.bench_name = "vBasicMath"
+    config.insert_compiler_checkpoints = True
+    config.enable_extension = True
+    config.use_checkpoint_pass_counter = False
+    config.use_checkpoint_voltage_check = True
+    config.bench_infinite_loop = True
+    config.split_loop = True
+    config.enable_static_loop_pass_count = True
+    config.loop_pass_count = 0
+    return config
+
+
+def save_records(bench_name, df):
+    with open(f"output/{bench_name}.pickle", "wb") as f:
+        pickle.dump(df, f)
+
+
+if __name__ == "__main__":
+    main()

+ 37 - 13
imc_extension.cmake

@@ -1,6 +1,9 @@
 set(IMC_BENCH_NAME "vAes" CACHE STRING "")
 set(IMC_BENCH_INFINITE_LOOP 0 CACHE BOOL "")
 set(IMC_PRINT_RECOVERY_MESSAGE 0 CACHE BOOL "")
+set(IMC_ENABLE_STATIC_LOOP_PASS_COUNT 1 CACHE BOOL "")
+set(IMC_LOOP_PASS_COUNT 10 CACHE BOOL "")
+set(IMC_BENCH_REPEAT_COUNT 1 CACHE BOOL "")
 
 set(AVAILABLE_BENCHES "vBasicMath" "vStringSearch" "vFFT" "vSha" "vCrc" "vMatMul" "vConv2d" "adc_demo" "vAes")
 if(NOT IMC_BENCH_NAME IN_LIST AVAILABLE_BENCHES)
@@ -8,6 +11,7 @@ if(NOT IMC_BENCH_NAME IN_LIST AVAILABLE_BENCHES)
 endif()
 
 add_compile_definitions(imcBENCH_NAME=${IMC_BENCH_NAME})
+add_compile_definitions(imcBENCH_REPEAT_COUNT=${IMC_BENCH_REPEAT_COUNT})
 if(IMC_BENCH_INFINITE_LOOP)
     add_compile_definitions(imcBENCH_INFINITE_LOOP=1)
 endif()
@@ -15,6 +19,10 @@ if(IMC_PRINT_RECOVERY_MESSAGE)
     add_compile_definitions(imcPRINT_RECOVERY_MESSAGE=1)
 endif()
 
+list(APPEND SRC_FILES
+    Core/Src/ImC/imc_extension.c
+)
+
 if(IMC_BENCH_NAME MATCHES "vConv2d")
     set(BENCHMARK_SRC_FILES
     )
@@ -131,10 +139,8 @@ foreach(BENCH_SRC ${BENCHMARK_SRC_FILES})
     list(APPEND SRC_FILES ${BENCH_SRC})
 endforeach()
 
-function(split_loop imc_files)
-    list(APPEND IMC_APP_FILES
-        Core/Src/ImC/imc_extension.c
-    )
+function(compile_imc_files)
+    message("compile_imc_files called")
     get_target_property(SRC_INCLUDES imc_freeRTOS INCLUDE_DIRECTORIES)
     foreach(dir ${SRC_INCLUDES})
         list(APPEND INCLUDE_DIRS "-I${dir}")
@@ -142,23 +148,41 @@ function(split_loop imc_files)
     string(REPLACE " " ";" C_FLAGS ${CMAKE_C_FLAGS})
 
     set(BASIC_OPT_PASSES "mem2reg,indvars,instnamer,unify-loop-exits,lcssa,simplifycfg,loop-simplify")
-    set(IMC_OPT_PASSES "imc-loop-opt")
-    set(IMC_FLAGS ${IMC_BASE})
-    set(LOOP_SPLIT_PLUGIN /home/ybkim/workspace/imc/loop_duplication/build/lib/libImcLoopOpt.so)
+    set(IMC_OPT_PASSES "")
+    set(PLUGINS "")
+
+    if(IMC_SPLIT_LOOP)
+        list(APPEND IMC_OPT_PASSES "imc-loop-opt")
+        list(APPEND PLUGINS /home/ybkim/workspace/imc/loop_duplication/build/lib/libImcLoopOpt.so)
+        add_compile_definitions(imcENABLE_STATIC_LOOP_PASS_COUNT=${IMC_ENABLE_STATIC_LOOP_PASS_COUNT})
+        add_compile_definitions(imcLOOP_PASS_COUNT=${IMC_LOOP_PASS_COUNT})
+    endif()
+
+    if(IMC_INSERT_COMPILER_CHECKPOINTS)
+        list(APPEND IMC_OPT_PASSES "imc-insert-checkpoints")
+        list(APPEND PLUGINS /home/ybkim/workspace/imc/loop_duplication/build/lib/libImcInsertCheckpoints.so)
+    endif()
+
+    list(JOIN IMC_OPT_PASSES "," IMC_OPT_PASSES)
+    set(PLUGIN_OPTIONS "")
+    foreach(PLUGIN ${PLUGINS})
+        list(APPEND PLUGIN_OPTIONS -load-pass-plugin=${PLUGIN})
+    endforeach()
 
-    # set(TARGET_TRIPPLE "--target=armv7em-none-eabi --sysroot=${CMAKE_SYSROOT}")
+    set(ADDITIONAL_DEFS
+        "-D imcBENCH_REPEAT_COUNT=${IMC_BENCH_REPEAT_COUNT}"
+    )
 
     foreach(APP_SRC ${IMC_APP_FILES})
         add_custom_command(
             OUTPUT ${PROJECT_BINARY_DIR}/${APP_SRC}.s
             DEPENDS ${APP_SRC}
-            # COMMAND ${CLANG_BIN} --target=armv8m-none-eabi --sysroot=${CMAKE_SYSROOT} -g ${C_FLAGS} -O0 -Xclang -disable-O0-optnone ${INCLUDE_DIRS} -D USE_HAL_DRIVER -D STM32L552xx -c -emit-llvm ${PROJECT_SOURCE_DIR}/${APP_SRC} -o ${PROJECT_BINARY_DIR}/${APP_SRC}.bc
-            COMMAND ${CMAKE_C_COMPILER} -g ${C_FLAGS} -O0 -Xclang -disable-O0-optnone ${INCLUDE_DIRS} -D USE_HAL_DRIVER -D STM32L552xx -c -emit-llvm ${PROJECT_SOURCE_DIR}/${APP_SRC} -o ${PROJECT_BINARY_DIR}/${APP_SRC}.bc
-            COMMAND ${OPT_BIN} -o ${PROJECT_BINARY_DIR}/${APP_SRC}_imc.bc -load-pass-plugin=${LOOP_SPLIT_PLUGIN} -passes=${BASIC_OPT_PASSES},${IMC_OPT_PASSES} ${PROJECT_BINARY_DIR}/${APP_SRC}.bc
+            COMMAND ${CMAKE_C_COMPILER} -g ${C_FLAGS} -O0 -Xclang -disable-O0-optnone ${INCLUDE_DIRS} -D USE_HAL_DRIVER -D STM32L552xx ${ADDITIONAL_DEFS} -c -emit-llvm ${PROJECT_SOURCE_DIR}/${APP_SRC} -o ${PROJECT_BINARY_DIR}/${APP_SRC}.bc
+            COMMAND ${OPT_BIN} -o ${PROJECT_BINARY_DIR}/${APP_SRC}_imc.bc ${PLUGIN_OPTIONS} -passes=${BASIC_OPT_PASSES},${IMC_OPT_PASSES} ${PROJECT_BINARY_DIR}/${APP_SRC}.bc
             COMMAND ${OPT_BIN} ${OPT} -o ${PROJECT_BINARY_DIR}/${APP_SRC}.opt.bc ${PROJECT_BINARY_DIR}/${APP_SRC}_imc.bc
-            COMMAND ${LLC_BIN} ${IMC_FLAGS} ${CPU} ${OPT} -o ${PROJECT_BINARY_DIR}/${APP_SRC}.s ${PROJECT_BINARY_DIR}/${APP_SRC}.opt.bc
+            COMMAND ${LLC_BIN} ${CPU} ${OPT} -o ${PROJECT_BINARY_DIR}/${APP_SRC}.s ${PROJECT_BINARY_DIR}/${APP_SRC}.opt.bc
         )
         list(APPEND APP_OPTS ${PROJECT_BINARY_DIR}/${APP_SRC}.s)
     endforeach()
-    add_library(imc_apps "${APP_OPTS}")
+    add_library(imc_apps OBJECT "${APP_OPTS}")
 endfunction()

+ 4 - 2
setup_build_dir.py

@@ -11,12 +11,14 @@ BUILD_DIR = f"{WORKSPACE_ROOT}/build"
 
 config = BuildConfigM33()
 config.bench_name = "vFFT"
-config.insert_compiler_checkpoints = False
+config.insert_compiler_checkpoints = True
 config.enable_extension = True
 config.use_checkpoint_pass_counter = False
-config.use_checkpoint_voltage_check = False
+config.use_checkpoint_voltage_check = True
 config.bench_infinite_loop = True
 config.split_loop = True
+config.loop_pass_count = 10
+config.bench_repeat_count = config.bench_repeat_count_small[config.bench_name]
 
 env = TestEnv(WORKSPACE_ROOT, NVM_RESET_BIN, OPENOCD_SCRIPT)