From 47e0a9409e04dd58da4bf54479d3dd352f518bc4 Mon Sep 17 00:00:00 2001 From: Alif Ahmed Date: Sun, 27 Feb 2022 19:28:20 -0500 Subject: [PATCH] Changed pin version from 2.14 to 3.21 --- .gitignore | 4 ++ README.md | 8 --- scripts/download_pin.py | 8 +-- scripts/launcher.py | 2 +- scripts/run_cache_sims.py | 2 +- simulators/drrip/Makefile | 20 +++---- simulators/drrip/cache_pinsim.cpp | 4 +- simulators/lru/Makefile | 20 +++---- simulators/lru/cache_pinsim.cpp | 2 + simulators/opt-ideal/Makefile | 20 +++---- simulators/opt-ideal/cache_pinsim.cpp | 2 + simulators/opt-ideal/timer.h | 86 --------------------------- simulators/opt-ideal/util.h | 2 - simulators/popt-8b/Makefile | 20 +++---- simulators/popt-8b/cache_pinsim.cpp | 2 + simulators/popt-8b/timer.h | 86 --------------------------- simulators/popt-8b/util.h | 2 - 17 files changed, 59 insertions(+), 231 deletions(-) delete mode 100644 simulators/opt-ideal/timer.h delete mode 100644 simulators/popt-8b/timer.h diff --git a/.gitignore b/.gitignore index 259148f..7a19714 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,7 @@ +/pin-* +/input-graphs +/raw_data + # Prerequisites *.d diff --git a/README.md b/README.md index b1ee1fe..4ff0f72 100644 --- a/README.md +++ b/README.md @@ -15,14 +15,6 @@ This repo contains cache simulators for the following cache replacement policies * `applications` : Annotated graph applications designed to work with the simulators * `scripts` : Helper scripts to launch experiments (and plot results) -## Requirements - -The cache simulators are pintools designed to work with Pin-2.14 (Download script provided in `scripts/download_pin.py`) - -The pintools require an older version of g++ (v4.9) - -All the applications and scripts were tested on Debian Stretch with g++-6.3.0 and python (v3.5.3) - ## Usage Instructions The following scripts should be run from the `scripts` directory: diff --git a/scripts/download_pin.py b/scripts/download_pin.py index 4506ae5..b68f316 100644 --- a/scripts/download_pin.py +++ b/scripts/download_pin.py @@ -1,7 +1,7 @@ import os, subprocess -subprocess.call('wget http://software.intel.com/sites/landingpage/pintool/downloads/pin-2.14-71313-gcc.4.4.7-linux.tar.gz', shell=True) -subprocess.call('tar -xvzf pin-2.14-71313-gcc.4.4.7-linux.tar.gz', shell=True) -subprocess.call('rm -rf ../pin-2.14; mv pin-2.14-71313-gcc.4.4.7-linux ../pin-2.14/', shell=True) -subprocess.call('rm pin-2.14-71313-gcc.4.4.7-linux.tar.gz', shell=True) +subprocess.call('wget https://software.intel.com/sites/landingpage/pintool/downloads/pin-3.21-98484-ge7cd811fd-gcc-linux.tar.gz', shell=True) +subprocess.call('tar -xvzf pin-3.21-98484-ge7cd811fd-gcc-linux.tar.gz', shell=True) +subprocess.call('rm -rf ../pin-3.21; mv pin-3.21-98484-ge7cd811fd-gcc-linux ../pin-3.21/', shell=True) +subprocess.call('rm pin-3.21-98484-ge7cd811fd-gcc-linux.tar.gz', shell=True) diff --git a/scripts/launcher.py b/scripts/launcher.py index d514322..c7f2a11 100644 --- a/scripts/launcher.py +++ b/scripts/launcher.py @@ -10,7 +10,7 @@ def fire(appPath, graphPath, app, graph, version, policy): + ' -n 1 -i 1 2> ' + logFile + ' | tee ' + outFile - pinHeader = '../pin-2.14/pin.sh -ifeellucky -t ../simulators/' + policy + '/cache_pinsim.so -- ' + pinHeader = '../pin-3.21/pin -ifeellucky -t ../simulators/' + policy + '/cache_pinsim.so -- ' runCmd = pinHeader + runCmd diff --git a/scripts/run_cache_sims.py b/scripts/run_cache_sims.py index 6ba3e6e..7bb9688 100644 --- a/scripts/run_cache_sims.py +++ b/scripts/run_cache_sims.py @@ -18,7 +18,7 @@ ## Launch simulations apps = ['pr'] simulators = ['lru', 'drrip', 'popt-8b', 'opt-ideal'] -versions = ['baseline', 'baseline', 'popt', 'opt-ideal'] +versions = ['baseline', 'popt', 'opt-ideal'] graphs = ['uk-2002', 'hugebubbles-00020', 'kron25-d4', 'urand25-d4'] for app in apps: diff --git a/simulators/drrip/Makefile b/simulators/drrip/Makefile index c035da9..642779f 100644 --- a/simulators/drrip/Makefile +++ b/simulators/drrip/Makefile @@ -1,10 +1,10 @@ -PIN_HOME=../../pin-2.14/ +PIN_HOME=../../pin-3.21/ -CFLAGS=-DBIGARRAY_MULTIPLIER=1 -Wall -Werror -Wno-unknown-pragmas -g -fno-stack-protector -DTARGET_IA32E -DHOST_IA32E -fPIC -DTARGET_LINUX -I$(PIN_HOME)/source/include/pin -I$(PIN_HOME)/source/include/pin/gen -I$(PIN_HOME)/extras/components/include -I$(PIN_HOME)/extras/xed-intel64/include -I$(PIN_HOME)/source/tools/InstLib +CFLAGS=-DBIGARRAY_MULTIPLIER=1 -Wall -Werror -Wno-unknown-pragmas -DPIN_CRT=1 -fno-stack-protector -fno-exceptions -funwind-tables -fasynchronous-unwind-tables -fno-rtti -DTARGET_IA32E -DHOST_IA32E -fPIC -DTARGET_LINUX -fabi-version=2 -faligned-new -I$(PIN_HOME)/source/include/pin -I$(PIN_HOME)/source/include/pin/gen -isystem $(PIN_HOME)/extras/stlport/include -isystem $(PIN_HOME)/extras/libstdc++/include -isystem $(PIN_HOME)/extras/crt/include -isystem $(PIN_HOME)/extras/crt/include/arch-x86_64 -isystem $(PIN_HOME)/extras/crt/include/kernel/uapi -isystem $(PIN_HOME)/extras/crt/include/kernel/uapi/asm-x86 -I$(PIN_HOME)/extras/components/include -I$(PIN_HOME)/extras/xed-intel64/include/xed -I$(PIN_HOME)/source/tools/Utils -I$(PIN_HOME)/source/tools/InstLib -LFLAGS=-shared -Wl,--hash-style=sysv -Wl,-Bsymbolic -Wl,--version-script=$(PIN_HOME)/source/include/pin/pintool.ver +LFLAGS=-shared -Wl,--hash-style=sysv $(PIN_HOME)/intel64/runtime/pincrt/crtbeginS.o -Wl,-Bsymbolic -Wl,--version-script=$(PIN_HOME)/source/include/pin/pintool.ver -fabi-version=2 -g -PIN_LIB=-L$(PIN_HOME)/intel64/lib -L$(PIN_HOME)/intel64/lib-ext -L$(PIN_HOME)/intel64/runtime/glibc -L$(PIN_HOME)/extras/xed-intel64/lib -lpin -lxed -lpindwarf -ldl +PIN_LIB=-L$(PIN_HOME)/intel64/runtime/pincrt -L$(PIN_HOME)/intel64/lib -L$(PIN_HOME)/intel64/lib-ext -L$(PIN_HOME)/extras/xed-intel64/lib -lpin -lxed $(PIN_HOME)/intel64/runtime/pincrt/crtendS.o -lpin3dwarf -ldl-dynamic -nostdlib -lstlport-dynamic -lm-dynamic -lc-dynamic -lunwind-dynamic ifndef DEBUG OPT_FLAGS=-O2 @@ -13,12 +13,12 @@ OPT_FLAGS=-O0 -g endif all: - g++-4.9 -std=c++11 $(CFLAGS) $(OPT_FLAGS) -c -o l1.o l1.cpp - g++-4.9 -std=c++11 $(CFLAGS) $(OPT_FLAGS) -c -o l2.o l2.cpp - g++-4.9 -std=c++11 $(CFLAGS) $(OPT_FLAGS) -c -o llc.o llc.cpp - g++-4.9 -std=c++11 $(CFLAGS) $(OPT_FLAGS) -c -o cache_backend.o cache_backend.cpp - g++-4.9 -std=c++11 $(CFLAGS) $(OPT_FLAGS) -c -o cache_pinsim.o cache_pinsim.cpp - g++-4.9 -std=c++11 $(LFLAGS) -o cache_pinsim.so cache_pinsim.o cache_backend.o l1.o l2.o llc.o $(PIN_LIB) + g++ -std=c++11 $(CFLAGS) $(OPT_FLAGS) -c -o l1.o l1.cpp + g++ -std=c++11 $(CFLAGS) $(OPT_FLAGS) -c -o l2.o l2.cpp + g++ -std=c++11 $(CFLAGS) $(OPT_FLAGS) -c -o llc.o llc.cpp + g++ -std=c++11 $(CFLAGS) $(OPT_FLAGS) -c -o cache_backend.o cache_backend.cpp + g++ -std=c++11 $(CFLAGS) $(OPT_FLAGS) -c -o cache_pinsim.o cache_pinsim.cpp + g++ -std=c++11 $(LFLAGS) -o cache_pinsim.so cache_pinsim.o cache_backend.o l1.o l2.o llc.o $(PIN_LIB) clean: rm *.o cache_pinsim.so diff --git a/simulators/drrip/cache_pinsim.cpp b/simulators/drrip/cache_pinsim.cpp index 2fbdada..dc0bac6 100755 --- a/simulators/drrip/cache_pinsim.cpp +++ b/simulators/drrip/cache_pinsim.cpp @@ -8,6 +8,8 @@ #include #include +using namespace std; + /* ================================================================== */ // Global variables /* ================================================================== */ @@ -18,7 +20,7 @@ uint64_t numInsns {0}; /* ===================================================================== */ // Command line switches /* ===================================================================== */ -KNOB KnobOutputFile(KNOB_MODE_WRITEONCE, "pintool", +KNOB KnobOutputFile(KNOB_MODE_WRITEONCE, "pintool", "o", "", "specify file name for MyPinTool output"); KNOB KnobCount(KNOB_MODE_WRITEONCE, "pintool", diff --git a/simulators/lru/Makefile b/simulators/lru/Makefile index c035da9..642779f 100644 --- a/simulators/lru/Makefile +++ b/simulators/lru/Makefile @@ -1,10 +1,10 @@ -PIN_HOME=../../pin-2.14/ +PIN_HOME=../../pin-3.21/ -CFLAGS=-DBIGARRAY_MULTIPLIER=1 -Wall -Werror -Wno-unknown-pragmas -g -fno-stack-protector -DTARGET_IA32E -DHOST_IA32E -fPIC -DTARGET_LINUX -I$(PIN_HOME)/source/include/pin -I$(PIN_HOME)/source/include/pin/gen -I$(PIN_HOME)/extras/components/include -I$(PIN_HOME)/extras/xed-intel64/include -I$(PIN_HOME)/source/tools/InstLib +CFLAGS=-DBIGARRAY_MULTIPLIER=1 -Wall -Werror -Wno-unknown-pragmas -DPIN_CRT=1 -fno-stack-protector -fno-exceptions -funwind-tables -fasynchronous-unwind-tables -fno-rtti -DTARGET_IA32E -DHOST_IA32E -fPIC -DTARGET_LINUX -fabi-version=2 -faligned-new -I$(PIN_HOME)/source/include/pin -I$(PIN_HOME)/source/include/pin/gen -isystem $(PIN_HOME)/extras/stlport/include -isystem $(PIN_HOME)/extras/libstdc++/include -isystem $(PIN_HOME)/extras/crt/include -isystem $(PIN_HOME)/extras/crt/include/arch-x86_64 -isystem $(PIN_HOME)/extras/crt/include/kernel/uapi -isystem $(PIN_HOME)/extras/crt/include/kernel/uapi/asm-x86 -I$(PIN_HOME)/extras/components/include -I$(PIN_HOME)/extras/xed-intel64/include/xed -I$(PIN_HOME)/source/tools/Utils -I$(PIN_HOME)/source/tools/InstLib -LFLAGS=-shared -Wl,--hash-style=sysv -Wl,-Bsymbolic -Wl,--version-script=$(PIN_HOME)/source/include/pin/pintool.ver +LFLAGS=-shared -Wl,--hash-style=sysv $(PIN_HOME)/intel64/runtime/pincrt/crtbeginS.o -Wl,-Bsymbolic -Wl,--version-script=$(PIN_HOME)/source/include/pin/pintool.ver -fabi-version=2 -g -PIN_LIB=-L$(PIN_HOME)/intel64/lib -L$(PIN_HOME)/intel64/lib-ext -L$(PIN_HOME)/intel64/runtime/glibc -L$(PIN_HOME)/extras/xed-intel64/lib -lpin -lxed -lpindwarf -ldl +PIN_LIB=-L$(PIN_HOME)/intel64/runtime/pincrt -L$(PIN_HOME)/intel64/lib -L$(PIN_HOME)/intel64/lib-ext -L$(PIN_HOME)/extras/xed-intel64/lib -lpin -lxed $(PIN_HOME)/intel64/runtime/pincrt/crtendS.o -lpin3dwarf -ldl-dynamic -nostdlib -lstlport-dynamic -lm-dynamic -lc-dynamic -lunwind-dynamic ifndef DEBUG OPT_FLAGS=-O2 @@ -13,12 +13,12 @@ OPT_FLAGS=-O0 -g endif all: - g++-4.9 -std=c++11 $(CFLAGS) $(OPT_FLAGS) -c -o l1.o l1.cpp - g++-4.9 -std=c++11 $(CFLAGS) $(OPT_FLAGS) -c -o l2.o l2.cpp - g++-4.9 -std=c++11 $(CFLAGS) $(OPT_FLAGS) -c -o llc.o llc.cpp - g++-4.9 -std=c++11 $(CFLAGS) $(OPT_FLAGS) -c -o cache_backend.o cache_backend.cpp - g++-4.9 -std=c++11 $(CFLAGS) $(OPT_FLAGS) -c -o cache_pinsim.o cache_pinsim.cpp - g++-4.9 -std=c++11 $(LFLAGS) -o cache_pinsim.so cache_pinsim.o cache_backend.o l1.o l2.o llc.o $(PIN_LIB) + g++ -std=c++11 $(CFLAGS) $(OPT_FLAGS) -c -o l1.o l1.cpp + g++ -std=c++11 $(CFLAGS) $(OPT_FLAGS) -c -o l2.o l2.cpp + g++ -std=c++11 $(CFLAGS) $(OPT_FLAGS) -c -o llc.o llc.cpp + g++ -std=c++11 $(CFLAGS) $(OPT_FLAGS) -c -o cache_backend.o cache_backend.cpp + g++ -std=c++11 $(CFLAGS) $(OPT_FLAGS) -c -o cache_pinsim.o cache_pinsim.cpp + g++ -std=c++11 $(LFLAGS) -o cache_pinsim.so cache_pinsim.o cache_backend.o l1.o l2.o llc.o $(PIN_LIB) clean: rm *.o cache_pinsim.so diff --git a/simulators/lru/cache_pinsim.cpp b/simulators/lru/cache_pinsim.cpp index 2fbdada..8ce174b 100755 --- a/simulators/lru/cache_pinsim.cpp +++ b/simulators/lru/cache_pinsim.cpp @@ -8,6 +8,8 @@ #include #include +using namespace std; + /* ================================================================== */ // Global variables /* ================================================================== */ diff --git a/simulators/opt-ideal/Makefile b/simulators/opt-ideal/Makefile index c035da9..642779f 100644 --- a/simulators/opt-ideal/Makefile +++ b/simulators/opt-ideal/Makefile @@ -1,10 +1,10 @@ -PIN_HOME=../../pin-2.14/ +PIN_HOME=../../pin-3.21/ -CFLAGS=-DBIGARRAY_MULTIPLIER=1 -Wall -Werror -Wno-unknown-pragmas -g -fno-stack-protector -DTARGET_IA32E -DHOST_IA32E -fPIC -DTARGET_LINUX -I$(PIN_HOME)/source/include/pin -I$(PIN_HOME)/source/include/pin/gen -I$(PIN_HOME)/extras/components/include -I$(PIN_HOME)/extras/xed-intel64/include -I$(PIN_HOME)/source/tools/InstLib +CFLAGS=-DBIGARRAY_MULTIPLIER=1 -Wall -Werror -Wno-unknown-pragmas -DPIN_CRT=1 -fno-stack-protector -fno-exceptions -funwind-tables -fasynchronous-unwind-tables -fno-rtti -DTARGET_IA32E -DHOST_IA32E -fPIC -DTARGET_LINUX -fabi-version=2 -faligned-new -I$(PIN_HOME)/source/include/pin -I$(PIN_HOME)/source/include/pin/gen -isystem $(PIN_HOME)/extras/stlport/include -isystem $(PIN_HOME)/extras/libstdc++/include -isystem $(PIN_HOME)/extras/crt/include -isystem $(PIN_HOME)/extras/crt/include/arch-x86_64 -isystem $(PIN_HOME)/extras/crt/include/kernel/uapi -isystem $(PIN_HOME)/extras/crt/include/kernel/uapi/asm-x86 -I$(PIN_HOME)/extras/components/include -I$(PIN_HOME)/extras/xed-intel64/include/xed -I$(PIN_HOME)/source/tools/Utils -I$(PIN_HOME)/source/tools/InstLib -LFLAGS=-shared -Wl,--hash-style=sysv -Wl,-Bsymbolic -Wl,--version-script=$(PIN_HOME)/source/include/pin/pintool.ver +LFLAGS=-shared -Wl,--hash-style=sysv $(PIN_HOME)/intel64/runtime/pincrt/crtbeginS.o -Wl,-Bsymbolic -Wl,--version-script=$(PIN_HOME)/source/include/pin/pintool.ver -fabi-version=2 -g -PIN_LIB=-L$(PIN_HOME)/intel64/lib -L$(PIN_HOME)/intel64/lib-ext -L$(PIN_HOME)/intel64/runtime/glibc -L$(PIN_HOME)/extras/xed-intel64/lib -lpin -lxed -lpindwarf -ldl +PIN_LIB=-L$(PIN_HOME)/intel64/runtime/pincrt -L$(PIN_HOME)/intel64/lib -L$(PIN_HOME)/intel64/lib-ext -L$(PIN_HOME)/extras/xed-intel64/lib -lpin -lxed $(PIN_HOME)/intel64/runtime/pincrt/crtendS.o -lpin3dwarf -ldl-dynamic -nostdlib -lstlport-dynamic -lm-dynamic -lc-dynamic -lunwind-dynamic ifndef DEBUG OPT_FLAGS=-O2 @@ -13,12 +13,12 @@ OPT_FLAGS=-O0 -g endif all: - g++-4.9 -std=c++11 $(CFLAGS) $(OPT_FLAGS) -c -o l1.o l1.cpp - g++-4.9 -std=c++11 $(CFLAGS) $(OPT_FLAGS) -c -o l2.o l2.cpp - g++-4.9 -std=c++11 $(CFLAGS) $(OPT_FLAGS) -c -o llc.o llc.cpp - g++-4.9 -std=c++11 $(CFLAGS) $(OPT_FLAGS) -c -o cache_backend.o cache_backend.cpp - g++-4.9 -std=c++11 $(CFLAGS) $(OPT_FLAGS) -c -o cache_pinsim.o cache_pinsim.cpp - g++-4.9 -std=c++11 $(LFLAGS) -o cache_pinsim.so cache_pinsim.o cache_backend.o l1.o l2.o llc.o $(PIN_LIB) + g++ -std=c++11 $(CFLAGS) $(OPT_FLAGS) -c -o l1.o l1.cpp + g++ -std=c++11 $(CFLAGS) $(OPT_FLAGS) -c -o l2.o l2.cpp + g++ -std=c++11 $(CFLAGS) $(OPT_FLAGS) -c -o llc.o llc.cpp + g++ -std=c++11 $(CFLAGS) $(OPT_FLAGS) -c -o cache_backend.o cache_backend.cpp + g++ -std=c++11 $(CFLAGS) $(OPT_FLAGS) -c -o cache_pinsim.o cache_pinsim.cpp + g++ -std=c++11 $(LFLAGS) -o cache_pinsim.so cache_pinsim.o cache_backend.o l1.o l2.o llc.o $(PIN_LIB) clean: rm *.o cache_pinsim.so diff --git a/simulators/opt-ideal/cache_pinsim.cpp b/simulators/opt-ideal/cache_pinsim.cpp index d13d67d..00db441 100755 --- a/simulators/opt-ideal/cache_pinsim.cpp +++ b/simulators/opt-ideal/cache_pinsim.cpp @@ -8,6 +8,8 @@ #include #include +using namespace std; + /* ================================================================== */ // Global variables /* ================================================================== */ diff --git a/simulators/opt-ideal/timer.h b/simulators/opt-ideal/timer.h deleted file mode 100644 index 0c047cd..0000000 --- a/simulators/opt-ideal/timer.h +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) 2015, The Regents of the University of California (Regents) -// See LICENSE.txt for license details - -#ifndef TIMER_H_ -#define TIMER_H_ - -#include -#include -#include - - -/* -GAP Benchmark Suite -Class: Timer -Author: Scott Beamer - -Simple timer that wraps gettimeofday -*/ - -#define COMPILER_BARRIER() asm volatile("" ::: "memory") - -class Timer { - public: - Timer() { elapsed_time = 0.0;} - - void Start() { - //gettimeofday(&start_time_, NULL); - //clock_gettime(CLOCK_MONOTONIC, &start_time_); - COMPILER_BARRIER(); - start_time_ = std::chrono::steady_clock::now(); - COMPILER_BARRIER(); - } - - void Stop() { - #if 0 - //gettimeofday(&elapsed_time_, NULL); - clock_gettime(CLOCK_MONOTONIC, &elapsed_time_); - elapsed_time_.tv_sec -= start_time_.tv_sec; - //elapsed_time_.tv_usec -= start_time_.tv_usec; - elapsed_time_.tv_nsec -= start_time_.tv_nsec; - #endif - COMPILER_BARRIER(); - stop_time_ = std::chrono::steady_clock::now(); - COMPILER_BARRIER(); - auto diff = stop_time_ - start_time_; - elapsed_time += std::chrono::duration(diff).count(); - } - - double Seconds() const { - //return elapsed_time_.tv_sec + elapsed_time_.tv_usec/1e6 + elapsed_time_.tv_nsec/1e9; - //return elapsed_time_.tv_sec + elapsed_time_.tv_nsec/1e9; - return elapsed_time; - } - - double Millisecs() const { - //return 1000*elapsed_time_.tv_sec + elapsed_time_.tv_usec/1000 + elapsed_time_.tv_nsec/1e6; - //return 1000*elapsed_time_.tv_sec + elapsed_time_.tv_nsec/1e6; - return elapsed_time * 1000; - } - - double Microsecs() const { - //return 1e6*elapsed_time_.tv_sec + elapsed_time_.tv_usec + elapsed_time_.tv_nsec/1000; - //return 1e6*elapsed_time_.tv_sec + elapsed_time_.tv_nsec/1000; - return elapsed_time * 1000000; - } - - double Nanosecs() const { - //return 1e9*elapsed_time_.tv_sec + 1e3*elapsed_time_.tv_usec + elapsed_time_.tv_nsec; - //return 1e9*elapsed_time_.tv_sec + elapsed_time_.tv_nsec; - return elapsed_time * 1000000000; - } - - private: - //struct timeval start_time_; - //struct timeval elapsed_time_; - //struct timespec start_time_; - //struct timespec elapsed_time_; - std::chrono::steady_clock::time_point start_time_; - std::chrono::steady_clock::time_point stop_time_; - double elapsed_time; -}; - -// Times op's execution using the timer t -#define TIME_OP(t, op) { t.Start(); (op); t.Stop(); } - -#endif // TIMER_H_ diff --git a/simulators/opt-ideal/util.h b/simulators/opt-ideal/util.h index f31ca56..4566f0d 100644 --- a/simulators/opt-ideal/util.h +++ b/simulators/opt-ideal/util.h @@ -8,8 +8,6 @@ #include #include -#include "timer.h" - /* GAP Benchmark Suite diff --git a/simulators/popt-8b/Makefile b/simulators/popt-8b/Makefile index c035da9..642779f 100644 --- a/simulators/popt-8b/Makefile +++ b/simulators/popt-8b/Makefile @@ -1,10 +1,10 @@ -PIN_HOME=../../pin-2.14/ +PIN_HOME=../../pin-3.21/ -CFLAGS=-DBIGARRAY_MULTIPLIER=1 -Wall -Werror -Wno-unknown-pragmas -g -fno-stack-protector -DTARGET_IA32E -DHOST_IA32E -fPIC -DTARGET_LINUX -I$(PIN_HOME)/source/include/pin -I$(PIN_HOME)/source/include/pin/gen -I$(PIN_HOME)/extras/components/include -I$(PIN_HOME)/extras/xed-intel64/include -I$(PIN_HOME)/source/tools/InstLib +CFLAGS=-DBIGARRAY_MULTIPLIER=1 -Wall -Werror -Wno-unknown-pragmas -DPIN_CRT=1 -fno-stack-protector -fno-exceptions -funwind-tables -fasynchronous-unwind-tables -fno-rtti -DTARGET_IA32E -DHOST_IA32E -fPIC -DTARGET_LINUX -fabi-version=2 -faligned-new -I$(PIN_HOME)/source/include/pin -I$(PIN_HOME)/source/include/pin/gen -isystem $(PIN_HOME)/extras/stlport/include -isystem $(PIN_HOME)/extras/libstdc++/include -isystem $(PIN_HOME)/extras/crt/include -isystem $(PIN_HOME)/extras/crt/include/arch-x86_64 -isystem $(PIN_HOME)/extras/crt/include/kernel/uapi -isystem $(PIN_HOME)/extras/crt/include/kernel/uapi/asm-x86 -I$(PIN_HOME)/extras/components/include -I$(PIN_HOME)/extras/xed-intel64/include/xed -I$(PIN_HOME)/source/tools/Utils -I$(PIN_HOME)/source/tools/InstLib -LFLAGS=-shared -Wl,--hash-style=sysv -Wl,-Bsymbolic -Wl,--version-script=$(PIN_HOME)/source/include/pin/pintool.ver +LFLAGS=-shared -Wl,--hash-style=sysv $(PIN_HOME)/intel64/runtime/pincrt/crtbeginS.o -Wl,-Bsymbolic -Wl,--version-script=$(PIN_HOME)/source/include/pin/pintool.ver -fabi-version=2 -g -PIN_LIB=-L$(PIN_HOME)/intel64/lib -L$(PIN_HOME)/intel64/lib-ext -L$(PIN_HOME)/intel64/runtime/glibc -L$(PIN_HOME)/extras/xed-intel64/lib -lpin -lxed -lpindwarf -ldl +PIN_LIB=-L$(PIN_HOME)/intel64/runtime/pincrt -L$(PIN_HOME)/intel64/lib -L$(PIN_HOME)/intel64/lib-ext -L$(PIN_HOME)/extras/xed-intel64/lib -lpin -lxed $(PIN_HOME)/intel64/runtime/pincrt/crtendS.o -lpin3dwarf -ldl-dynamic -nostdlib -lstlport-dynamic -lm-dynamic -lc-dynamic -lunwind-dynamic ifndef DEBUG OPT_FLAGS=-O2 @@ -13,12 +13,12 @@ OPT_FLAGS=-O0 -g endif all: - g++-4.9 -std=c++11 $(CFLAGS) $(OPT_FLAGS) -c -o l1.o l1.cpp - g++-4.9 -std=c++11 $(CFLAGS) $(OPT_FLAGS) -c -o l2.o l2.cpp - g++-4.9 -std=c++11 $(CFLAGS) $(OPT_FLAGS) -c -o llc.o llc.cpp - g++-4.9 -std=c++11 $(CFLAGS) $(OPT_FLAGS) -c -o cache_backend.o cache_backend.cpp - g++-4.9 -std=c++11 $(CFLAGS) $(OPT_FLAGS) -c -o cache_pinsim.o cache_pinsim.cpp - g++-4.9 -std=c++11 $(LFLAGS) -o cache_pinsim.so cache_pinsim.o cache_backend.o l1.o l2.o llc.o $(PIN_LIB) + g++ -std=c++11 $(CFLAGS) $(OPT_FLAGS) -c -o l1.o l1.cpp + g++ -std=c++11 $(CFLAGS) $(OPT_FLAGS) -c -o l2.o l2.cpp + g++ -std=c++11 $(CFLAGS) $(OPT_FLAGS) -c -o llc.o llc.cpp + g++ -std=c++11 $(CFLAGS) $(OPT_FLAGS) -c -o cache_backend.o cache_backend.cpp + g++ -std=c++11 $(CFLAGS) $(OPT_FLAGS) -c -o cache_pinsim.o cache_pinsim.cpp + g++ -std=c++11 $(LFLAGS) -o cache_pinsim.so cache_pinsim.o cache_backend.o l1.o l2.o llc.o $(PIN_LIB) clean: rm *.o cache_pinsim.so diff --git a/simulators/popt-8b/cache_pinsim.cpp b/simulators/popt-8b/cache_pinsim.cpp index 7b75067..c30f4de 100755 --- a/simulators/popt-8b/cache_pinsim.cpp +++ b/simulators/popt-8b/cache_pinsim.cpp @@ -8,6 +8,8 @@ #include #include +using namespace std; + /* ================================================================== */ // Global variables /* ================================================================== */ diff --git a/simulators/popt-8b/timer.h b/simulators/popt-8b/timer.h deleted file mode 100644 index 0c047cd..0000000 --- a/simulators/popt-8b/timer.h +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) 2015, The Regents of the University of California (Regents) -// See LICENSE.txt for license details - -#ifndef TIMER_H_ -#define TIMER_H_ - -#include -#include -#include - - -/* -GAP Benchmark Suite -Class: Timer -Author: Scott Beamer - -Simple timer that wraps gettimeofday -*/ - -#define COMPILER_BARRIER() asm volatile("" ::: "memory") - -class Timer { - public: - Timer() { elapsed_time = 0.0;} - - void Start() { - //gettimeofday(&start_time_, NULL); - //clock_gettime(CLOCK_MONOTONIC, &start_time_); - COMPILER_BARRIER(); - start_time_ = std::chrono::steady_clock::now(); - COMPILER_BARRIER(); - } - - void Stop() { - #if 0 - //gettimeofday(&elapsed_time_, NULL); - clock_gettime(CLOCK_MONOTONIC, &elapsed_time_); - elapsed_time_.tv_sec -= start_time_.tv_sec; - //elapsed_time_.tv_usec -= start_time_.tv_usec; - elapsed_time_.tv_nsec -= start_time_.tv_nsec; - #endif - COMPILER_BARRIER(); - stop_time_ = std::chrono::steady_clock::now(); - COMPILER_BARRIER(); - auto diff = stop_time_ - start_time_; - elapsed_time += std::chrono::duration(diff).count(); - } - - double Seconds() const { - //return elapsed_time_.tv_sec + elapsed_time_.tv_usec/1e6 + elapsed_time_.tv_nsec/1e9; - //return elapsed_time_.tv_sec + elapsed_time_.tv_nsec/1e9; - return elapsed_time; - } - - double Millisecs() const { - //return 1000*elapsed_time_.tv_sec + elapsed_time_.tv_usec/1000 + elapsed_time_.tv_nsec/1e6; - //return 1000*elapsed_time_.tv_sec + elapsed_time_.tv_nsec/1e6; - return elapsed_time * 1000; - } - - double Microsecs() const { - //return 1e6*elapsed_time_.tv_sec + elapsed_time_.tv_usec + elapsed_time_.tv_nsec/1000; - //return 1e6*elapsed_time_.tv_sec + elapsed_time_.tv_nsec/1000; - return elapsed_time * 1000000; - } - - double Nanosecs() const { - //return 1e9*elapsed_time_.tv_sec + 1e3*elapsed_time_.tv_usec + elapsed_time_.tv_nsec; - //return 1e9*elapsed_time_.tv_sec + elapsed_time_.tv_nsec; - return elapsed_time * 1000000000; - } - - private: - //struct timeval start_time_; - //struct timeval elapsed_time_; - //struct timespec start_time_; - //struct timespec elapsed_time_; - std::chrono::steady_clock::time_point start_time_; - std::chrono::steady_clock::time_point stop_time_; - double elapsed_time; -}; - -// Times op's execution using the timer t -#define TIME_OP(t, op) { t.Start(); (op); t.Stop(); } - -#endif // TIMER_H_ diff --git a/simulators/popt-8b/util.h b/simulators/popt-8b/util.h index f31ca56..4566f0d 100644 --- a/simulators/popt-8b/util.h +++ b/simulators/popt-8b/util.h @@ -8,8 +8,6 @@ #include #include -#include "timer.h" - /* GAP Benchmark Suite