From e9d32a25d2182be8756e6cd76179a83c23ff6dce Mon Sep 17 00:00:00 2001 From: Subhankar Pal Date: Mon, 28 Sep 2020 09:49:33 -0400 Subject: [PATCH] Mirror internal fixes --- README.md | 11 ++++++----- example/app/CMakeLists.txt | 2 +- scripts/generate_model.py | 3 ++- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 6d62737..be7f0db 100644 --- a/README.md +++ b/README.md @@ -86,20 +86,21 @@ At this stage, verify that the results are functionally correct. # generate plugin cd scripts && python generate_model.py ../spec/spec.json # build tracing library -cd tracer +cd ../tracer mkdir build && cd build cmake .. make # build user app -cd ../example/app -mkdir build && cd build -mkdir traces +cd ../../example/app +mkdir -f build && cd build +mkdir -f traces rm -f CMakeCache.txt # run this if previously ran cmake with different MODE MODE=EMU_AUTO_TRACE cmake .. make # trace generation ./workq_mutex # traces are generated in example/app/build/traces -# trace replay +# trace replay using gem5 +cd ../../../scripts MODE=EMU_TRACE APP=workq_mutex ./run-gem5.sh ``` ### Annotating using Manual Tracing diff --git a/example/app/CMakeLists.txt b/example/app/CMakeLists.txt index be3638a..6cdc684 100644 --- a/example/app/CMakeLists.txt +++ b/example/app/CMakeLists.txt @@ -21,7 +21,7 @@ elseif("$ENV{MODE}" STREQUAL "EMU") set(CMAKE_C_COMPILER "gcc") set(CMAKE_CXX_COMPILER "g++") find_library(HETSIM_PRIM hetsim_prim) -elseif(("$ENV{MODE}" STREQUAL "EMU_MANUAL_TRACE") OR ("$ENV{MODE}" STREQUAL "EMU_MANUAL_TRACE")) +elseif(("$ENV{MODE}" STREQUAL "EMU_MANUAL_TRACE") OR ("$ENV{MODE}" STREQUAL "EMU_AUTO_TRACE")) list(APPEND CMAKE_PREFIX_PATH "../../emu/build" "../../tracer/build/runtime/default") set(util_path ../../emu/inc) set(tracer_path ../../tracer/runtime/default) diff --git a/scripts/generate_model.py b/scripts/generate_model.py index 81761c8..aa0d249 100644 --- a/scripts/generate_model.py +++ b/scripts/generate_model.py @@ -663,8 +663,9 @@ def generate(pes): for (auto S : stalls) { if (auto *func = M.getFunction(HetsimRuntime::EmitIncrementStalls)) { - llvm::SmallVector args; + llvm::SmallVector args; args.push_back(llvm::ConstantInt::get(llvm::IntegerType::get(M.getContext(), 32), S.stall_count)); // number of stalls preceding this load + args.push_back(llvm::ConstantInt::get(llvm::IntegerType::get(M.getContext(), 32), 0)); auto *call = llvm::CallInst::Create(llvm::cast(func), args, "", S.instr); } }