├── libopencl └── CMakeLists.txt ├── version.in ├── version ├── src ├── cuda-sim │ ├── decuda_pred_table │ │ └── decuda_pred_table.h │ ├── cuda_device_printf.h │ ├── cuda_device_runtime.h │ ├── ptx_loader.h │ └── opcodes.h ├── accelwattch │ ├── cacti │ │ ├── cacti.i │ │ ├── makefile │ │ ├── cacti.mk │ │ ├── io.h │ │ └── area.cc │ ├── gpgpu_sim.verify │ ├── makefile │ ├── mcpatXeonCore.mk │ ├── CMakeLists.txt │ ├── version.h │ ├── globalvar.h │ └── mcpat.mk ├── statwrapper.h ├── CMakeLists.txt ├── gpgpu-sim │ ├── hashing.h │ ├── CMakeLists.txt │ ├── traffic_breakdown.h │ ├── traffic_breakdown.cc │ ├── visualizer.h │ ├── gpu-misc.h │ ├── gpu-misc.cc │ ├── stats.h │ └── stack.h ├── intersim2 │ ├── power │ │ ├── techfile.txt │ │ ├── switch_monitor.hpp │ │ └── buffer_monitor.hpp │ ├── config.y │ ├── config.l │ ├── rng_wrapper.cpp │ ├── misc_utils.hpp │ ├── rng_double_wrapper.cpp │ ├── examples │ │ ├── torus88 │ │ ├── cmeshconfig │ │ ├── singleconfig │ │ ├── mesh88_lat │ │ ├── fattree_config │ │ └── dragonflyconfig │ ├── booksim.hpp │ ├── allocators │ │ ├── pim.hpp │ │ ├── loa.hpp │ │ ├── islip.hpp │ │ ├── selalloc.hpp │ │ ├── maxsize.hpp │ │ ├── wavefront.hpp │ │ ├── separable_output_first.hpp │ │ ├── separable_input_first.hpp │ │ └── separable.hpp │ ├── misc_utils.cpp │ ├── timed_module.hpp │ ├── intersim_config.hpp │ ├── booksim_config.hpp │ ├── credit.hpp │ ├── globals.hpp │ ├── packet_reply_info.hpp │ ├── networks │ │ ├── fly.hpp │ │ ├── kncube.hpp │ │ └── qtree.hpp │ ├── packet_reply_info.cpp │ ├── routefunc.hpp │ ├── arbiters │ │ ├── prio_arb.hpp │ │ ├── matrix_arb.hpp │ │ └── tree_arb.hpp │ ├── module.hpp │ ├── random_utils.hpp │ ├── credit.cpp │ ├── outputset.hpp │ └── injection.hpp ├── statwrapper.cc ├── trace_streams.tup ├── tr1_hash_map.h └── trace.cc ├── doc ├── checkpoint.png └── doxygen │ └── Makefile ├── bitbucket-pipelines.yml ├── gpgpusim_install.cmake ├── linux-so-version.txt ├── debug_tools └── WatchYourStep │ └── ptxjitplus │ ├── launchkernels │ ├── readme.txt │ ├── inc │ ├── GL │ │ └── freeglut.h │ ├── dynlink │ │ ├── cuda_drvapi_dynlink.h │ │ └── cuda_drvapi_dynlink_gl.h │ ├── rendercheck_d3d9.h │ ├── rendercheck_d3d10.h │ ├── rendercheck_d3d11.h │ ├── helper_functions.h │ ├── multithreading.h │ ├── timer.h │ └── cub │ │ └── util_namespace.cuh │ └── ptxjitplus.h ├── aerialvision ├── README ├── parser.out └── parsetab.py ├── format-code.sh ├── short-tests.sh ├── new ├── short-tests-cmake.sh ├── gpgpusim_gen_build_string.cmake ├── .github └── workflows │ └── accelsim.yml ├── short-tests-accelsim.sh ├── .travis.yml ├── libcuda ├── CMakeLists.txt └── cuobjdump.h ├── configs ├── deprecated-cfgs │ ├── GTX480 │ │ └── config_fermi_islip.icnt │ ├── QuadroFX5800 │ │ └── config_quadro_islip.icnt │ ├── QuadroFX5600 │ │ └── icnt_config_islip.icnt │ ├── SM6_GTX1080 │ │ └── config_fermi_islip.icnt │ ├── SM6_P100 │ │ └── config_fermi_islip.icnt │ ├── SM6_TITANX │ │ └── config_fermi_islip.icnt │ ├── SM7_TITANV │ │ └── config_fermi_islip.icnt │ ├── TeslaC2050 │ │ └── config_fermi_islip.icnt │ └── GeForceGTX750Ti │ │ └── config_fermi_islip.icnt └── tested-cfgs │ ├── SM2_GTX480 │ └── config_fermi_islip.icnt │ ├── SM6_TITANX │ └── config_pascal_islip.icnt │ ├── SM75_RTX2060 │ └── config_turing_islip.icnt │ ├── SM75_RTX2060_S │ └── config_turing_islip.icnt │ ├── SM3_KEPLER_TITAN │ └── config_kepler_islip.icnt │ ├── SM7_GV100 │ └── config_volta_islip.icnt │ ├── SM7_QV100 │ └── config_volta_islip.icnt │ ├── SM7_TITANV │ └── config_volta_islip.icnt │ └── SM86_RTX3070 │ └── config_ampere_islip.icnt ├── .gitignore ├── scripts └── gen_ptxinfo ├── gpgpusim_gen_setup_environment.cmake └── gpgpusim_unset_cuda.cmake /libopencl/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /version.in: -------------------------------------------------------------------------------- 1 | const char *g_gpgpusim_build_string="@GPGPUSIM_BUILD_STRING@"; -------------------------------------------------------------------------------- /version: -------------------------------------------------------------------------------- 1 | const char *g_gpgpusim_version_string = "GPGPU-Sim Simulator Version 4.2.0 "; 2 | -------------------------------------------------------------------------------- /src/cuda-sim/decuda_pred_table/decuda_pred_table.h: -------------------------------------------------------------------------------- 1 | bool pred_lookup(int condition, int flags); 2 | -------------------------------------------------------------------------------- /doc/checkpoint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gpgpu-sim/gpgpu-sim_distribution/HEAD/doc/checkpoint.png -------------------------------------------------------------------------------- /bitbucket-pipelines.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gpgpu-sim/gpgpu-sim_distribution/HEAD/bitbucket-pipelines.yml -------------------------------------------------------------------------------- /gpgpusim_install.cmake: -------------------------------------------------------------------------------- 1 | # TODO Create the build/gcc-X.X/cuda-XXXX/release folder and put so to it 2 | # TODO Also create symlinks to the libcudart.so -------------------------------------------------------------------------------- /doc/doxygen/Makefile: -------------------------------------------------------------------------------- 1 | all: docs 2 | 3 | docs: 4 | DOXYGEN_STRIP_PATH=`readlink -f ../../..` doxygen gpgpu-sim.doxygen 5 | 6 | clean: 7 | rm -rf latex html 8 | -------------------------------------------------------------------------------- /src/accelwattch/cacti/cacti.i: -------------------------------------------------------------------------------- 1 | %module cacti 2 | %{ 3 | /* Includes the header in the wrapper code */ 4 | #include "cacti_interface.h" 5 | %} 6 | 7 | /* Parse the header file to generate wrappers */ 8 | %include "cacti_interface.h" -------------------------------------------------------------------------------- /linux-so-version.txt: -------------------------------------------------------------------------------- 1 | libcudart.so.9.0{ 2 | }; 3 | libcudart.so.9.1{ 4 | }; 5 | libcudart.so.9.2{ 6 | }; 7 | libcudart.so.10.0{ 8 | }; 9 | libcudart.so.10.1{ 10 | }; 11 | libcudart.so.11.0{ 12 | }; 13 | libcuda.so.1{ 14 | }; 15 | -------------------------------------------------------------------------------- /src/accelwattch/gpgpu_sim.verify: -------------------------------------------------------------------------------- 1 | /********************** GPGPU-Sim Verification File **********************/ 2 | This file ensures that the GPGPU-Sim version of McPAT is included. 3 | /*************************************************************************/ 4 | -------------------------------------------------------------------------------- /debug_tools/WatchYourStep/ptxjitplus/launchkernels: -------------------------------------------------------------------------------- 1 | #Launches kernels from $1 to $2 2 | #Note must source this script 3 | export PTX_SIM_DEBUG=0; 4 | for num in $(eval echo {$1..$2}); do export WYS_LAUNCH_NUM=$num; echo Launching kernel $num...; ./ptxjitplus; done 5 | -------------------------------------------------------------------------------- /src/statwrapper.h: -------------------------------------------------------------------------------- 1 | #ifndef STAT_WRAPER_H 2 | #define STAT_WRAPER_H 3 | 4 | class Stats* StatCreate(const char* name, double bin_size, int num_bins); 5 | void StatClear(void* st); 6 | void StatAddSample(void* st, int val); 7 | double StatAverage(void* st); 8 | double StatMax(void* st); 9 | double StatMin(void* st); 10 | void StatDisp(void* st); 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /debug_tools/WatchYourStep/ptxjitplus/readme.txt: -------------------------------------------------------------------------------- 1 | Sample: ptxjit 2 | Minimum spec: SM 2.0 3 | 4 | This sample uses the Driver API to just-in-time compile (JIT) a Kernel from PTX code. Additionally, this sample demonstrates the seamless interoperability capability of the CUDA Runtime and CUDA Driver API calls. For CUDA 5.5, this sample shows how to use cuLink* functions to link PTX assembly using the CUDA driver at runtime. 5 | 6 | Key concepts: 7 | CUDA Driver API 8 | -------------------------------------------------------------------------------- /aerialvision/README: -------------------------------------------------------------------------------- 1 | See http://gpgpu-sim.org/manual/index.php5/AerialVision_Manual for usage instructions. 2 | 3 | To be able to use Aerial Vision, you only need to install its dependencies: 4 | * python-pmw 5 | * python-ply 6 | * python-numpy 7 | * libpng12-dev 8 | * python-matplotlib 9 | 10 | For an Ubuntu system, this could be done by running the following command: 11 | sudo apt-get install python-pmw python-ply python-numpy libpng12-dev python-matplotlib 12 | 13 | For other systems, you need to use your respective package manager to install 14 | the dependencies 15 | -------------------------------------------------------------------------------- /src/accelwattch/cacti/makefile: -------------------------------------------------------------------------------- 1 | TAR = cacti 2 | 3 | .PHONY: dbg opt depend clean clean_dbg clean_opt 4 | 5 | all: opt 6 | 7 | dbg: $(TAR).mk obj_dbg 8 | @$(MAKE) TAG=dbg -C . -f $(TAR).mk 9 | 10 | opt: $(TAR).mk obj_opt 11 | @$(MAKE) TAG=opt -C . -f $(TAR).mk 12 | 13 | obj_dbg: 14 | mkdir $@ 15 | 16 | obj_opt: 17 | mkdir $@ 18 | 19 | depend: 20 | @$(MAKE) TAG=opt -C . -f $(TAR).mk depend 21 | 22 | clean: clean_dbg clean_opt 23 | 24 | clean_dbg: obj_dbg 25 | @$(MAKE) TAG=dbg -C . -f $(TAR).mk clean 26 | rm -rf $< 27 | 28 | clean_opt: obj_opt 29 | @$(MAKE) TAG=opt -C . -f $(TAR).mk clean 30 | rm -rf $< 31 | 32 | 33 | -------------------------------------------------------------------------------- /format-code.sh: -------------------------------------------------------------------------------- 1 | # This bash script formats GPGPU-Sim using clang-format 2 | THIS_DIR="$( cd "$( dirname "$BASH_SOURCE" )" && pwd )" 3 | echo "Running clang-format on $THIS_DIR" 4 | clang-format -i ${THIS_DIR}/libcuda/*.h 5 | clang-format -i ${THIS_DIR}/libcuda/*.cc 6 | clang-format -i ${THIS_DIR}/src/*.h 7 | clang-format -i ${THIS_DIR}/src/*.cc 8 | clang-format -i ${THIS_DIR}/src/gpgpu-sim/*.h 9 | clang-format -i ${THIS_DIR}/src/gpgpu-sim/*.cc 10 | clang-format -i ${THIS_DIR}/src/cuda-sim/*.h 11 | clang-format -i ${THIS_DIR}/src/cuda-sim/*.cc 12 | clang-format -i ${THIS_DIR}/src/accelwattch/*.h 13 | clang-format -i ${THIS_DIR}/src/accelwattch/*.cc -------------------------------------------------------------------------------- /src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # gpgpusim_entrypoint objects 2 | add_library(gpgpusim_entrypoint OBJECT 3 | abstract_hardware_model.cc 4 | debug.cc 5 | gpgpusim_entrypoint.cc 6 | option_parser.cc 7 | statwrapper.cc 8 | stream_manager.cc 9 | trace.cc) 10 | 11 | # Add current folder and CUDA include to include path 12 | target_include_directories(gpgpusim_entrypoint PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) 13 | target_include_directories(gpgpusim_entrypoint PUBLIC ${CUDAToolkit_INCLUDE_DIRS}) 14 | 15 | # Add subdir 16 | add_subdirectory(accelwattch) 17 | add_subdirectory(cuda-sim) 18 | add_subdirectory(gpgpu-sim) 19 | add_subdirectory(intersim2) -------------------------------------------------------------------------------- /src/accelwattch/makefile: -------------------------------------------------------------------------------- 1 | TAR = mcpat 2 | 3 | .PHONY: dbg opt depend clean clean_dbg clean_opt 4 | 5 | all: opt 6 | 7 | dbg: $(TAR).mk obj_dbg 8 | @$(MAKE) TAG=dbg -C . -f $(TAR).mk 9 | 10 | opt: $(TAR).mk obj_opt 11 | @$(MAKE) TAG=opt -C . -f $(TAR).mk 12 | 13 | obj_dbg: 14 | mkdir -p $@ 15 | 16 | obj_opt: 17 | mkdir -p $@ 18 | 19 | depend: 20 | @$(MAKE) TAG=opt -C . -f $(TAR).mk depend 21 | 22 | clean: clean_dbg clean_opt clean_cacti 23 | 24 | clean_dbg: obj_dbg 25 | @$(MAKE) TAG=dbg -C . -f $(TAR).mk clean 26 | rm -rf $< 27 | 28 | clean_opt: obj_opt 29 | @$(MAKE) TAG=opt -C . -f $(TAR).mk clean 30 | rm -rf $< 31 | 32 | clean_cacti: cacti 33 | rm -rf cacti/obj_opt 34 | 35 | 36 | -------------------------------------------------------------------------------- /src/gpgpu-sim/hashing.h: -------------------------------------------------------------------------------- 1 | // author: Mahmoud Khairy, (Purdue Univ) 2 | // email: abdallm@purdue.edu 3 | 4 | #include 5 | #include 6 | #include 7 | #include "../option_parser.h" 8 | 9 | #ifndef HASHING_H 10 | #define HASHING_H 11 | 12 | #include "../abstract_hardware_model.h" 13 | #include "gpu-cache.h" 14 | 15 | unsigned ipoly_hash_function(new_addr_type higher_bits, unsigned index, 16 | unsigned bank_set_num); 17 | 18 | unsigned bitwise_hash_function(new_addr_type higher_bits, unsigned index, 19 | unsigned bank_set_num); 20 | 21 | unsigned PAE_hash_function(new_addr_type higher_bits, unsigned index, 22 | unsigned bank_set_num); 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /debug_tools/WatchYourStep/ptxjitplus/inc/GL/freeglut.h: -------------------------------------------------------------------------------- 1 | #ifndef __FREEGLUT_H__ 2 | #define __FREEGLUT_H__ 3 | 4 | /* 5 | * freeglut.h 6 | * 7 | * The freeglut library include file 8 | * 9 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 10 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 11 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 12 | * PAWEL W. OLSZTA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 13 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 14 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | */ 16 | 17 | #include "freeglut_std.h" 18 | #include "freeglut_ext.h" 19 | 20 | /*** END OF FILE ***/ 21 | 22 | #endif /* __FREEGLUT_H__ */ 23 | -------------------------------------------------------------------------------- /src/intersim2/power/techfile.txt: -------------------------------------------------------------------------------- 1 | // 2007 ITRS predictions for a 32nm high-performance library 2 | H_INVD2 = 8;//int 3 | W_INVD2 = 3;//int 4 | H_DFQD1 = 8;//int 5 | W_DFQD1 = 16;//int 6 | H_ND2D1 = 8;//int 7 | W_ND2D1 = 3;//int 8 | H_SRAM = 8;//int 9 | W_SRAM = 6;//int 10 | Vdd = 0.9;//float 11 | R = 606.321;//float 12 | IoffSRAM = 0.00000032;//float 13 | // 70 C 14 | IoffP = 0.00000102;//float 15 | IoffN = 0.00000102;//float 16 | Cg_pwr = 0.000000000000000534;//float 17 | Cd_pwr = 0.000000000000000267;//float 18 | Cgdl = 0.0000000000000001068;//float 19 | Cg = 0.000000000000000534;//float 20 | Cd = 0.000000000000000267;//float 21 | LAMBDA = 0.016;//float 22 | MetalPitch = 0.000080;//float 23 | Rw = 0.720044;//float 24 | Cw_gnd = 0.000000000000267339;//float 25 | Cw_cpl = 0.000000000000267339;//float 26 | wire_length = 2.0;//float -------------------------------------------------------------------------------- /debug_tools/WatchYourStep/ptxjitplus/inc/dynlink/cuda_drvapi_dynlink.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 1993-2013 NVIDIA Corporation. All rights reserved. 3 | * 4 | * Please refer to the NVIDIA end user license agreement (EULA) associated 5 | * with this source code for terms and conditions that govern your use of 6 | * this software. Any use, reproduction, disclosure, or distribution of 7 | * this software and related documentation outside the terms of the EULA 8 | * is strictly prohibited. 9 | * 10 | */ 11 | 12 | #ifndef __cuda_drvapi_dynlink_h__ 13 | #define __cuda_drvapi_dynlink_h__ 14 | 15 | #include "cuda_drvapi_dynlink_cuda.h" 16 | 17 | #if defined(CUDA_INIT_D3D9)||defined(CUDA_INIT_D3D10)||defined(CUDA_INIT_D3D11) 18 | #include "cuda_drvapi_dynlink_d3d.h" 19 | #endif 20 | 21 | #ifdef CUDA_INIT_OPENGL 22 | #include "cuda_drvapi_dynlink_gl.h" 23 | #endif 24 | 25 | #endif //__cuda_drvapi_dynlink_h__ 26 | -------------------------------------------------------------------------------- /short-tests.sh: -------------------------------------------------------------------------------- 1 | if [ ! -n "$CUDA_INSTALL_PATH" ]; then 2 | echo "ERROR ** Install CUDA Toolkit and set CUDA_INSTALL_PATH."; 3 | exit 1; 4 | fi 5 | 6 | if [ ! -n "$CONFIG" ]; then 7 | echo "ERROR ** set the CONFIG env variable to one of those found in ./accel-sim-framework/util/job_launching/configs/define-standard-cfgs.yml"; 8 | exit 1; 9 | fi 10 | 11 | if [ ! -n "$GPUAPPS_ROOT" ]; then 12 | echo "ERROR ** GPUAPPS_ROOT to a location where the apps have been compiled"; 13 | exit 1; 14 | fi 15 | 16 | git config --system --add safe.directory '*' 17 | 18 | export PATH=$CUDA_INSTALL_PATH/bin:$PATH 19 | source ./setup_environment 20 | make -j 21 | 22 | git clone https://github.com/accel-sim/accel-sim-framework.git 23 | ./accel-sim-framework/util/job_launching/run_simulations.py -C $CONFIG -B rodinia_2.0-ft -N regress -l local 24 | ./accel-sim-framework/util/job_launching/monitor_func_test.py -v -N regress -j procman 25 | -------------------------------------------------------------------------------- /src/intersim2/config.y: -------------------------------------------------------------------------------- 1 | %{ 2 | 3 | int yylex(void); 4 | void yyerror(char * msg); 5 | void config_assign_string( char const * field, char const * value ); 6 | void config_assign_int( char const * field, int value ); 7 | void config_assign_float( char const * field, double value ); 8 | 9 | #ifdef _WIN32 10 | #pragma warning ( disable : 4102 ) 11 | #pragma warning ( disable : 4244 ) 12 | #endif 13 | 14 | %} 15 | 16 | %union { 17 | char *name; 18 | int num; 19 | double fnum; 20 | } 21 | 22 | %token STR 23 | %token NUM 24 | %token FNUM 25 | 26 | %% 27 | 28 | commands : commands command 29 | | command 30 | ; 31 | 32 | command : STR '=' STR ';' { config_assign_string( $1, $3 ); free( $1 ); free( $3 ); } 33 | | STR '=' NUM ';' { config_assign_int( $1, $3 ); free( $1 ); } 34 | | STR '=' FNUM ';' { config_assign_float( $1, $3 ); free( $1 ); } 35 | ; 36 | 37 | %% 38 | -------------------------------------------------------------------------------- /new: -------------------------------------------------------------------------------- 1 | sudo docker run --dns 206.87.227.99 --privileged -v `pwd`:/home/runner/gpgpu-sim_distribution:rw tgrogers/gpgpu-sim_regress:volta_update /bin/bash -c "./start_torque.sh; chown -R runner /home/runner/gpgpu-sim_distribution; su - runner -c 'export CUDA_INSTALL_PATH=/usr/local/cuda-4.2/ && export PTXAS_CUDA_INSTALL_PATH=/usr/local/cuda-4.2/ && make clean -C /home/runner/gpgpu-sim_distribution && source /home/runner/gpgpu-sim_distribution/setup_environment && make -j -C /home/runner/gpgpu-sim_distribution && cd /home/runner/gpgpu-sim_simulations/ && git pull && /home/runner/gpgpu-sim_simulations/util/job_launching/run_simulations.py -C GTX480 -B rodinia_2.0-ft -N regress && /home/runner/gpgpu-sim_simulations/util/job_launching/monitor_func_test.py -v -N regress'" 2 | # - services: docker 3 | # env: 4 | # - CONFIG=GTX480 5 | # - CUDA_INSTALL_PATH=/usr/local/cuda-4.2/ 6 | # - PTXAS_CUDA_INSTALL_PATH=/usr/local/cuda-4.2/ 7 | 8 | -------------------------------------------------------------------------------- /short-tests-cmake.sh: -------------------------------------------------------------------------------- 1 | if [ ! -n "$CUDA_INSTALL_PATH" ]; then 2 | echo "ERROR ** Install CUDA Toolkit and set CUDA_INSTALL_PATH."; 3 | exit 1; 4 | fi 5 | 6 | if [ ! -n "$CONFIG" ]; then 7 | echo "ERROR ** set the CONFIG env variable to one of those found in ./accel-sim-framework/util/job_launching/configs/define-standard-cfgs.yml"; 8 | exit 1; 9 | fi 10 | 11 | if [ ! -n "$GPUAPPS_ROOT" ]; then 12 | echo "ERROR ** GPUAPPS_ROOT to a location where the apps have been compiled"; 13 | exit 1; 14 | fi 15 | 16 | git config --system --add safe.directory '*' 17 | 18 | export PATH=$CUDA_INSTALL_PATH/bin:$PATH 19 | 20 | cmake -B build 21 | cmake --build build -j 22 | cmake --install build 23 | source setup 24 | 25 | git clone https://github.com/accel-sim/accel-sim-framework.git 26 | ./accel-sim-framework/util/job_launching/run_simulations.py -C $CONFIG -B rodinia_2.0-ft -N regress -l local 27 | ./accel-sim-framework/util/job_launching/monitor_func_test.py -v -N regress -j procman 28 | -------------------------------------------------------------------------------- /gpgpusim_gen_build_string.cmake: -------------------------------------------------------------------------------- 1 | # Get hash 2 | execute_process( 3 | COMMAND git log -1 --format=%h 4 | WORKING_DIRECTORY ${INPUT_DIR} 5 | OUTPUT_VARIABLE GPGPUSIM_GIT_HASH 6 | OUTPUT_STRIP_TRAILING_WHITESPACE 7 | ) 8 | 9 | # Get diff 10 | execute_process( 11 | COMMAND git diff --numstat 12 | COMMAND wc 13 | COMMAND sed -re "s/^\\s+([0-9]+).*/\\1./" 14 | WORKING_DIRECTORY ${INPUT_DIR} 15 | OUTPUT_VARIABLE GPGPUSIM_GIT_DIFF 16 | OUTPUT_STRIP_TRAILING_WHITESPACE 17 | ) 18 | execute_process( 19 | COMMAND git diff --numstat --staged 20 | COMMAND wc 21 | COMMAND sed -re "s/^\\s+([0-9]+).*/\\1./" 22 | WORKING_DIRECTORY ${INPUT_DIR} 23 | OUTPUT_VARIABLE GPGPUSIM_GIT_DIFF_STAGED 24 | OUTPUT_STRIP_TRAILING_WHITESPACE 25 | ) 26 | set(GPGPUSIM_BUILD_STRING "gpgpu-sim_git-commit-${GPGPUSIM_GIT_HASH}_modified_${GPGPUSIM_GIT_DIFF}${GPGPUSIM_GIT_DIFF_STAGED}") 27 | configure_file(${INPUT_DIR}/version.in ${OUTPUT_DIR}/detailed_version) 28 | -------------------------------------------------------------------------------- /aerialvision/parser.out: -------------------------------------------------------------------------------- 1 | Created by PLY version 3.11 (http://www.dabeaz.com/ply) 2 | 3 | Grammar 4 | 5 | Rule 0 S' -> sentence 6 | Rule 1 sentence -> WORD NUMBERSEQUENCE 7 | 8 | Terminals, with rules where they appear 9 | 10 | NUMBERSEQUENCE : 1 11 | WORD : 1 12 | error : 13 | 14 | Nonterminals, with rules where they appear 15 | 16 | sentence : 0 17 | 18 | Parsing method: LALR 19 | 20 | state 0 21 | 22 | (0) S' -> . sentence 23 | (1) sentence -> . WORD NUMBERSEQUENCE 24 | 25 | WORD shift and go to state 2 26 | 27 | sentence shift and go to state 1 28 | 29 | state 1 30 | 31 | (0) S' -> sentence . 32 | 33 | 34 | 35 | state 2 36 | 37 | (1) sentence -> WORD . NUMBERSEQUENCE 38 | 39 | NUMBERSEQUENCE shift and go to state 3 40 | 41 | 42 | state 3 43 | 44 | (1) sentence -> WORD NUMBERSEQUENCE . 45 | 46 | $end reduce using rule 1 (sentence -> WORD NUMBERSEQUENCE .) 47 | 48 | -------------------------------------------------------------------------------- /aerialvision/parsetab.py: -------------------------------------------------------------------------------- 1 | 2 | # parsetab.py 3 | # This file is automatically generated. Do not edit. 4 | # pylint: disable=W,C,R 5 | _tabversion = '3.10' 6 | 7 | _lr_method = 'LALR' 8 | 9 | _lr_signature = 'NUMBERSEQUENCE WORDsentence : WORD NUMBERSEQUENCE' 10 | 11 | _lr_action_items = {'WORD':([0,],[2,]),'$end':([1,3,],[0,-1,]),'NUMBERSEQUENCE':([2,],[3,]),} 12 | 13 | _lr_action = {} 14 | for _k, _v in _lr_action_items.items(): 15 | for _x,_y in zip(_v[0],_v[1]): 16 | if not _x in _lr_action: _lr_action[_x] = {} 17 | _lr_action[_x][_k] = _y 18 | del _lr_action_items 19 | 20 | _lr_goto_items = {'sentence':([0,],[1,]),} 21 | 22 | _lr_goto = {} 23 | for _k, _v in _lr_goto_items.items(): 24 | for _x, _y in zip(_v[0], _v[1]): 25 | if not _x in _lr_goto: _lr_goto[_x] = {} 26 | _lr_goto[_x][_k] = _y 27 | del _lr_goto_items 28 | _lr_productions = [ 29 | ("S' -> sentence","S'",1,None,None,None), 30 | ('sentence -> WORD NUMBERSEQUENCE','sentence',2,'p_sentence','lexyacc.py',220), 31 | ] 32 | -------------------------------------------------------------------------------- /.github/workflows/accelsim.yml: -------------------------------------------------------------------------------- 1 | # Test backend changes with Accel-Sim 2 | 3 | name: Short-Tests-AccelSim 4 | 5 | # Controls when the workflow will run 6 | on: 7 | push: 8 | branches-ignore: 9 | - "gh-readonly-queue**" 10 | merge_group: 11 | pull_request: 12 | 13 | # Allows you to run this workflow manually from the Actions tab 14 | workflow_dispatch: 15 | 16 | # By default regress against accel-sim's dev branch 17 | env: 18 | ACCELSIM_BRANCH: dev 19 | 20 | # A workflow run is made up of one or more jobs that can run sequentially or in parallel 21 | jobs: 22 | build-QV100: 23 | runs-on: ubuntu-latest 24 | container: 25 | image: tgrogers/accel-sim_regress:Ubuntu-22.04-cuda-11.7 26 | 27 | # Steps represent a sequence of tasks that will be executed as part of the job 28 | steps: 29 | # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it 30 | - uses: actions/checkout@v4 31 | - name: Run Simulation 32 | run: /bin/bash $GITHUB_WORKSPACE/short-tests-accelsim.sh 33 | 34 | -------------------------------------------------------------------------------- /src/gpgpu-sim/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Exclude power_interface.cc if no power model 2 | list(APPEND gpgpusim_SRC addrdec.cc 3 | dram.cc 4 | dram_sched.cc 5 | gpu-cache.cc 6 | gpu-misc.cc 7 | gpu-sim.cc 8 | hashing.cc 9 | histogram.cc 10 | icnt_wrapper.cc 11 | l2cache.cc 12 | local_interconnect.cc 13 | mem_fetch.cc 14 | mem_latency_stat.cc 15 | power_interface.cc 16 | power_stat.cc 17 | scoreboard.cc 18 | shader.cc 19 | stack.cc 20 | stat-tool.cc 21 | traffic_breakdown.cc 22 | visualizer.cc) 23 | if(NOT GPGPUSIM_USE_POWER_MODEL) 24 | list(REMOVE_ITEM ${gpgpusim_SRC} power_interface.cc) 25 | endif() 26 | 27 | # Create libgpgpusim.a 28 | add_library(gpgpusim STATIC ${gpgpusim_SRC}) 29 | target_include_directories(gpgpusim PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) 30 | target_include_directories(gpgpusim PUBLIC ${CUDAToolkit_INCLUDE_DIRS}) 31 | 32 | if(GPGPUSIM_USE_POWER_MODEL) 33 | target_compile_definitions(gpgpusim PRIVATE GPGPUSIM_POWER_MODEL) 34 | target_include_directories(gpgpusim PRIVATE ${GPGPUSIM_POWER_MODEL}) 35 | endif() 36 | 37 | -------------------------------------------------------------------------------- /src/gpgpu-sim/traffic_breakdown.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | // Breakdown traffic through the network according to category 8 | class traffic_breakdown { 9 | public: 10 | traffic_breakdown(const std::string& network_name) 11 | : m_network_name(network_name) {} 12 | 13 | // print the stats 14 | void print(FILE* fout); 15 | 16 | // record the amount and type of traffic introduced by this mem_fetch object 17 | void record_traffic(class mem_fetch* mf, unsigned int size); 18 | 19 | protected: 20 | std::string m_network_name; 21 | 22 | /// helper functions to identify the type of traffic sent 23 | std::string classify_memfetch(class mem_fetch* mf); 24 | 25 | /// helper functions to identify the size of traffic sent 26 | unsigned int packet_size(class mem_fetch* mf); 27 | 28 | typedef std::string 29 | mf_packet_type; // use string so that it remains extensible 30 | typedef unsigned int mf_packet_size; 31 | typedef std::map traffic_class_t; 32 | typedef std::map traffic_stat_t; 33 | 34 | traffic_stat_t m_stats; 35 | }; 36 | -------------------------------------------------------------------------------- /debug_tools/WatchYourStep/ptxjitplus/inc/rendercheck_d3d9.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1993-2013 NVIDIA Corporation. All rights reserved. 3 | * 4 | * Please refer to the NVIDIA end user license agreement (EULA) associated 5 | * with this source code for terms and conditions that govern your use of 6 | * this software. Any use, reproduction, disclosure, or distribution of 7 | * this software and related documentation outside the terms of the EULA 8 | * is strictly prohibited. 9 | * 10 | */ 11 | 12 | #pragma once 13 | 14 | #ifndef _RENDERCHECK_D3D9_H_ 15 | #define _RENDERCHECK_D3D9_H_ 16 | 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | 23 | class CheckRenderD3D9 24 | { 25 | public: 26 | 27 | CheckRenderD3D9() {} 28 | 29 | static HRESULT BackbufferToPPM(IDirect3DDevice9 *pDevice, const char *zFileName); 30 | static HRESULT SurfaceToPPM(IDirect3DDevice9 *pDevice, IDirect3DSurface9 *pSurface, const char *zFileName); 31 | 32 | static bool PPMvsPPM(const char *src_file, const char *ref_file, const char *exec_path, 33 | const float epsilon, const float threshold = 0.0f); 34 | }; 35 | 36 | #endif -------------------------------------------------------------------------------- /src/intersim2/config.l: -------------------------------------------------------------------------------- 1 | %{ 2 | 3 | #include "y.tab.h" 4 | 5 | static unsigned int lineno = 1; 6 | 7 | void config_error(char * msg, int lineno); 8 | void yyerror(char * msg); 9 | 10 | extern int config_input(char *, int); 11 | #undef YY_INPUT 12 | #define YY_INPUT(b, r, ms) (r = config_input(b, ms)) 13 | 14 | %} 15 | 16 | Digit [0-9] 17 | Exponent [eE][+-]?{Digit}+ 18 | DblConst ({Digit}*\.)?{Digit}+{Exponent}? 19 | StrConst [A-Za-z_\-/\.][A-Za-z0-9_\-/\.\+(\{\,)\}]* 20 | 21 | %% 22 | 23 | /* Ignore comments and all spaces */ 24 | 25 | \/\/[^\n]* ; 26 | [ \t\r]* ; 27 | 28 | \n { lineno++; } 29 | 30 | /* Commands */ 31 | 32 | \{[A-Za-z0-9_\-\.(\{\,)\}]+(\,[A-Za-z0-9_\-\.(\{\,)\}]+)*\} { yylval.name = strdup( yytext ); return STR; } 33 | 34 | -?[0-9]+ { yylval.num = atoi( yytext ); return NUM; } 35 | 36 | -?[0-9]*\.[0-9]+ { yylval.fnum = atof( yytext ); return FNUM; } 37 | 38 | -?{DblConst} { yylval.fnum = atof( yytext ); return FNUM;} 39 | 40 | {StrConst} { yylval.name = strdup( yytext ); return STR; } 41 | 42 | . { return yytext[0]; } 43 | 44 | %% 45 | 46 | void yyerror( char * msg ) 47 | { 48 | config_error( msg, lineno ); 49 | } 50 | 51 | int yywrap() 52 | { 53 | return 1; 54 | } 55 | -------------------------------------------------------------------------------- /debug_tools/WatchYourStep/ptxjitplus/inc/rendercheck_d3d10.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1993-2013 NVIDIA Corporation. All rights reserved. 3 | * 4 | * Please refer to the NVIDIA end user license agreement (EULA) associated 5 | * with this source code for terms and conditions that govern your use of 6 | * this software. Any use, reproduction, disclosure, or distribution of 7 | * this software and related documentation outside the terms of the EULA 8 | * is strictly prohibited. 9 | * 10 | */ 11 | 12 | #pragma once 13 | 14 | #ifndef _RENDERCHECK_D3D10_H_ 15 | #define _RENDERCHECK_D3D10_H_ 16 | 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | 24 | class CheckRenderD3D10 25 | { 26 | public: 27 | 28 | CheckRenderD3D10() {} 29 | 30 | static HRESULT ActiveRenderTargetToPPM(ID3D10Device *pDevice, const char *zFileName); 31 | static HRESULT ResourceToPPM(ID3D10Device *pDevice, ID3D10Resource *pResource, const char *zFileName); 32 | 33 | static bool PPMvsPPM(const char *src_file, const char *ref_file, const char *exec_path, 34 | const float epsilon, const float threshold = 0.0f); 35 | }; 36 | 37 | #endif -------------------------------------------------------------------------------- /debug_tools/WatchYourStep/ptxjitplus/inc/rendercheck_d3d11.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1993-2013 NVIDIA Corporation. All rights reserved. 3 | * 4 | * Please refer to the NVIDIA end user license agreement (EULA) associated 5 | * with this source code for terms and conditions that govern your use of 6 | * this software. Any use, reproduction, disclosure, or distribution of 7 | * this software and related documentation outside the terms of the EULA 8 | * is strictly prohibited. 9 | * 10 | */ 11 | 12 | #pragma once 13 | 14 | #ifndef _RENDERCHECK_D3D11_H_ 15 | #define _RENDERCHECK_D3D11_H_ 16 | 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | 24 | class CheckRenderD3D11 25 | { 26 | public: 27 | 28 | CheckRenderD3D11() {} 29 | 30 | static HRESULT ActiveRenderTargetToPPM(ID3D11Device *pDevice, const char *zFileName); 31 | static HRESULT ResourceToPPM(ID3D11Device *pDevice, ID3D11Resource *pResource, const char *zFileName); 32 | 33 | static bool PPMvsPPM(const char *src_file, const char *ref_file, const char *exec_path, 34 | const float epsilon, const float threshold = 0.0f); 35 | }; 36 | 37 | #endif -------------------------------------------------------------------------------- /short-tests-accelsim.sh: -------------------------------------------------------------------------------- 1 | if [ ! -n "$CUDA_INSTALL_PATH" ]; then 2 | echo "ERROR ** Install CUDA Toolkit and set CUDA_INSTALL_PATH."; 3 | exit 1; 4 | fi 5 | 6 | if [ ! -n "$ACCELSIM_BRANCH" ]; then 7 | echo "ERROR ** set the ACCELSIM_BRANCH env variable"; 8 | exit 1; 9 | fi 10 | 11 | if [ ! -n "$GPUAPPS_ROOT" ]; then 12 | echo "ERROR ** GPUAPPS_ROOT to a location where the apps have been compiled"; 13 | exit 1; 14 | fi 15 | 16 | git config --system --add safe.directory '*' 17 | 18 | export PATH=$CUDA_INSTALL_PATH/bin:$PATH 19 | source ./setup_environment 20 | make -j 21 | 22 | git clone https://github.com/accel-sim/accel-sim-framework.git 23 | 24 | # Build accel-sim 25 | cd accel-sim-framework 26 | git checkout $ACCELSIM_BRANCH 27 | source ./gpu-simulator/setup_environment.sh 28 | make -j -C ./gpu-simulator 29 | 30 | # Get rodinia traces 31 | rm -rf ./hw_run/rodinia_2.0-ft 32 | wget https://engineering.purdue.edu/tgrogers/accel-sim/traces/tesla-v100/latest/rodinia_2.0-ft.tgz 33 | mkdir -p ./hw_run 34 | tar -xzvf rodinia_2.0-ft.tgz -C ./hw_run 35 | rm rodinia_2.0-ft.tgz 36 | 37 | # Run rodinia traces 38 | ./util/job_launching/run_simulations.py -C QV100-SASS -B rodinia_2.0-ft -T ./hw_run/rodinia_2.0-ft/9.1 -N myTest 39 | ./util/job_launching/monitor_func_test.py -v -N myTest 40 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: required 2 | 3 | before_install: 4 | - docker pull tgrogers/gpgpu-sim_regress:volta_update 5 | 6 | language: cpp 7 | 8 | 9 | matrix: 10 | include: 11 | - services: docker 12 | env: 13 | - CONFIG=GTX480 14 | - CUDA_INSTALL_PATH=/usr/local/cuda-4.2/ 15 | - PTXAS_CUDA_INSTALL_PATH=/usr/local/cuda-4.2/ 16 | - GPUAPPS_ROOT=/home/runner/gpgpu-sim_simulations/benchmarks 17 | - services: docker 18 | env: 19 | - CONFIG=TITANV 20 | - CUDA_INSTALL_PATH=/usr/local/cuda-9.1/ 21 | - PTXAS_CUDA_INSTALL_PATH=/usr/local/cuda-9.1/ 22 | - GPUAPPS_ROOT=/home/runner/gpgpu-sim_simulations/benchmarks 23 | - services: docker 24 | env: 25 | - CONFIG=TITANV-LOCALXBAR 26 | - CUDA_INSTALL_PATH=/usr/local/cuda-9.1/ 27 | - PTXAS_CUDA_INSTALL_PATH=/usr/local/cuda-9.1/ 28 | - GPUAPPS_ROOT=/home/runner/gpgpu-sim_simulations/benchmarks 29 | 30 | script: 31 | - > 32 | docker run 33 | --env CONFIG=$CONFIG 34 | --env PTXAS_CUDA_INSTALL_PATH=$PTXAS_CUDA_INSTALL_PATH 35 | --env CUDA_INSTALL_PATH=$CUDA_INSTALL_PATH 36 | --env GPUAPPS_ROOT=$GPUAPPS_ROOT 37 | -v `pwd`:/gpgpu-sim:rw tgrogers/gpgpu-sim_regress:volta_update 38 | /bin/bash travis.sh 39 | -------------------------------------------------------------------------------- /src/statwrapper.cc: -------------------------------------------------------------------------------- 1 | // a Wraper function for stats class 2 | #include 3 | #include "intersim2/stats.hpp" 4 | 5 | Stats *StatCreate(const char *name, double bin_size, int num_bins) { 6 | Stats *newstat = new Stats(NULL, name, bin_size, num_bins); 7 | newstat->Clear(); 8 | return newstat; 9 | } 10 | 11 | void StatClear(void *st) { ((Stats *)st)->Clear(); } 12 | 13 | void StatAddSample(void *st, int val) { ((Stats *)st)->AddSample(val); } 14 | 15 | double StatAverage(void *st) { return ((Stats *)st)->Average(); } 16 | 17 | double StatMax(void *st) { return ((Stats *)st)->Max(); } 18 | 19 | double StatMin(void *st) { return ((Stats *)st)->Min(); } 20 | 21 | void StatDisp(void *st) { 22 | printf("Stats for "); 23 | ((Stats *)st)->DisplayHierarchy(); 24 | // if (((Stats *)st)->NeverUsed()) { 25 | // printf (" was never updated!\n"); 26 | // } else { 27 | printf("Min %f Max %f Average %f \n", ((Stats *)st)->Min(), 28 | ((Stats *)st)->Max(), StatAverage(st)); 29 | ((Stats *)st)->Display(); 30 | // } 31 | } 32 | 33 | #if 0 34 | int main () 35 | { 36 | void * mytest = StatCreate("Test",1,5); 37 | StatAddSample(mytest,4); 38 | StatAddSample(mytest,4);StatAddSample(mytest,4); 39 | StatAddSample(mytest,2); 40 | StatDisp(mytest); 41 | } 42 | #endif 43 | -------------------------------------------------------------------------------- /libcuda/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Specify Flex and Bison target 2 | BISON_TARGET(cuobjdump_parser cuobjdump.y ${CMAKE_CURRENT_BINARY_DIR}/cuobjdump_parser.c 3 | COMPILE_FLAGS "-t -d -v --report=all -p cuobjdump_ --file-prefix=${CMAKE_CURRENT_BINARY_DIR}/cuobjdump") 4 | FLEX_TARGET(cuobjdump_lexer cuobjdump.l ${CMAKE_CURRENT_BINARY_DIR}/cuobjdump_lexer.c 5 | COMPILE_FLAGS "-B -P cuobjdump_") 6 | ADD_FLEX_BISON_DEPENDENCY(cuobjdump_lexer cuobjdump_parser) 7 | 8 | # Set generated source files to CXX 9 | set_source_files_properties(${BISON_cuobjdump_parser_OUTPUT_SOURCE} 10 | ${FLEX_cuobjdump_lexer_OUTPUTS} 11 | PROPERTIES LANGUAGE CXX) 12 | 13 | # Create libcuda.a with all source files 14 | add_library(cuda STATIC 15 | cuda_runtime_api.cc 16 | ${BISON_cuobjdump_parser_OUTPUT_SOURCE} ${FLEX_cuobjdump_lexer_OUTPUTS}) 17 | 18 | # Add current dir to include path 19 | # Also add flex/bison generated header files 20 | target_include_directories(cuda PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) 21 | 22 | # Add cuda include path for own reference 23 | target_include_directories(cuda PRIVATE ${CUDAToolkit_INCLUDE_DIRS}) 24 | 25 | # Add project build dir to include path 26 | target_include_directories(cuda PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) 27 | -------------------------------------------------------------------------------- /debug_tools/WatchYourStep/ptxjitplus/inc/helper_functions.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 1993-2013 NVIDIA Corporation. All rights reserved. 3 | * 4 | * Please refer to the NVIDIA end user license agreement (EULA) associated 5 | * with this source code for terms and conditions that govern your use of 6 | * this software. Any use, reproduction, disclosure, or distribution of 7 | * this software and related documentation outside the terms of the EULA 8 | * is strictly prohibited. 9 | * 10 | */ 11 | 12 | // These are helper functions for the SDK samples (string parsing, timers, image helpers, etc) 13 | #ifndef HELPER_FUNCTIONS_H 14 | #define HELPER_FUNCTIONS_H 15 | 16 | #ifdef WIN32 17 | #pragma warning(disable:4996) 18 | #endif 19 | 20 | // includes, project 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | #include 29 | #include 30 | #include 31 | #include 32 | 33 | // includes, timer, string parsing, image helpers 34 | #include // helper functions for timers 35 | #include // helper functions for string parsing 36 | #include // helper functions for image compare, dump, data comparisons 37 | 38 | #ifndef EXIT_WAIVED 39 | #define EXIT_WAIVED 2 40 | #endif 41 | 42 | #endif // HELPER_FUNCTIONS_H 43 | -------------------------------------------------------------------------------- /configs/deprecated-cfgs/GTX480/config_fermi_islip.icnt: -------------------------------------------------------------------------------- 1 | //21*1 fly with 32 flits per packet under gpgpusim injection mode 2 | use_map = 0; 3 | flit_size = 32; 4 | 5 | // currently we do not use this, see subnets below 6 | network_count = 2; 7 | 8 | // Topology 9 | topology = fly; 10 | k = 27; 11 | n = 1; 12 | 13 | // Routing 14 | 15 | routing_function = dest_tag; 16 | 17 | // Flow control 18 | 19 | num_vcs = 1; 20 | vc_buf_size = 8; 21 | 22 | wait_for_tail_credit = 0; 23 | 24 | // Router architecture 25 | 26 | vc_allocator = islip; //separable_input_first; 27 | sw_allocator = islip; //separable_input_first; 28 | alloc_iters = 1; 29 | 30 | credit_delay = 0; 31 | routing_delay = 0; 32 | vc_alloc_delay = 1; 33 | sw_alloc_delay = 1; 34 | 35 | input_speedup = 2; 36 | output_speedup = 1; 37 | internal_speedup = 1.0; 38 | 39 | // Traffic, GPGPU-Sim does not use this 40 | 41 | traffic = uniform; 42 | packet_size ={{1,2,3,4},{10,20}}; 43 | packet_size_rate={{1,1,1,1},{2,1}}; 44 | 45 | // Simulation - Don't change 46 | 47 | sim_type = gpgpusim; 48 | //sim_type = latency; 49 | injection_rate = 0.1; 50 | 51 | subnets = 2; 52 | 53 | // Always use read and write no matter following line 54 | //use_read_write = 1; 55 | 56 | 57 | read_request_subnet = 0; 58 | read_reply_subnet = 1; 59 | write_request_subnet = 0; 60 | write_reply_subnet = 1; 61 | 62 | read_request_begin_vc = 0; 63 | read_request_end_vc = 0; 64 | write_request_begin_vc = 0; 65 | write_request_end_vc = 0; 66 | read_reply_begin_vc = 0; 67 | read_reply_end_vc = 0; 68 | write_reply_begin_vc = 0; 69 | write_reply_end_vc = 0; 70 | 71 | -------------------------------------------------------------------------------- /configs/deprecated-cfgs/QuadroFX5800/config_quadro_islip.icnt: -------------------------------------------------------------------------------- 1 | //18*1 fly with 32 flits per packet under gpgpusim injection mode 2 | use_map = 0; 3 | flit_size = 32; 4 | 5 | // currently we donot use this, see subnets below 6 | network_count = 2; 7 | 8 | // Topology 9 | topology = fly; 10 | k = 18; 11 | n = 1; 12 | 13 | // Routing 14 | 15 | routing_function = dest_tag; 16 | 17 | // Flow control 18 | 19 | num_vcs = 1; 20 | vc_buf_size = 8; 21 | 22 | wait_for_tail_credit = 0; 23 | 24 | // Router architecture 25 | 26 | vc_allocator = islip; //separable_input_first; 27 | sw_allocator = islip; //separable_input_first; 28 | alloc_iters = 1; 29 | 30 | credit_delay = 0; 31 | routing_delay = 0; 32 | vc_alloc_delay = 1; 33 | sw_alloc_delay = 1; 34 | 35 | input_speedup = 2; 36 | output_speedup = 1; 37 | internal_speedup = 1.0; 38 | 39 | // Traffic, GPGPU-Sim does not use this 40 | traffic = uniform; 41 | packet_size ={{1,2,3,4},{10,20}}; 42 | packet_size_rate={{1,1,1,1},{2,1}}; 43 | 44 | // Simulation - Don't change 45 | sim_type = gpgpusim; 46 | //sim_type = latency; 47 | injection_rate = 0.1; 48 | 49 | 50 | subnets = 2; 51 | 52 | // Always use read and write no matter following line 53 | //use_read_write = 1; 54 | 55 | 56 | read_request_subnet = 0; 57 | read_reply_subnet = 1; 58 | write_request_subnet = 0; 59 | write_reply_subnet = 1; 60 | 61 | read_request_begin_vc = 0; 62 | read_request_end_vc = 0; 63 | write_request_begin_vc = 0; 64 | write_request_end_vc = 0; 65 | read_reply_begin_vc = 0; 66 | read_reply_end_vc = 0; 67 | write_reply_begin_vc = 0; 68 | write_reply_end_vc = 0; 69 | 70 | -------------------------------------------------------------------------------- /configs/tested-cfgs/SM2_GTX480/config_fermi_islip.icnt: -------------------------------------------------------------------------------- 1 | //21*1 fly with 32 flits per packet under gpgpusim injection mode 2 | use_map = 0; 3 | flit_size = 40; 4 | 5 | // currently we do not use this, see subnets below 6 | network_count = 2; 7 | 8 | // Topology 9 | topology = fly; 10 | k = 27; 11 | n = 1; 12 | 13 | // Routing 14 | 15 | routing_function = dest_tag; 16 | 17 | // Flow control 18 | 19 | num_vcs = 1; 20 | vc_buf_size = 64; 21 | 22 | wait_for_tail_credit = 0; 23 | 24 | // Router architecture 25 | 26 | vc_allocator = islip; //separable_input_first; 27 | sw_allocator = islip; //separable_input_first; 28 | alloc_iters = 1; 29 | 30 | credit_delay = 0; 31 | routing_delay = 0; 32 | vc_alloc_delay = 1; 33 | sw_alloc_delay = 1; 34 | 35 | input_speedup = 1; 36 | output_speedup = 1; 37 | internal_speedup = 2.0; 38 | 39 | // Traffic, GPGPU-Sim does not use this 40 | 41 | traffic = uniform; 42 | packet_size ={{1,2,3,4},{10,20}}; 43 | packet_size_rate={{1,1,1,1},{2,1}}; 44 | 45 | // Simulation - Don't change 46 | 47 | sim_type = gpgpusim; 48 | //sim_type = latency; 49 | injection_rate = 0.1; 50 | 51 | subnets = 2; 52 | 53 | // Always use read and write no matter following line 54 | //use_read_write = 1; 55 | 56 | 57 | read_request_subnet = 0; 58 | read_reply_subnet = 1; 59 | write_request_subnet = 0; 60 | write_reply_subnet = 1; 61 | 62 | read_request_begin_vc = 0; 63 | read_request_end_vc = 0; 64 | write_request_begin_vc = 0; 65 | write_request_end_vc = 0; 66 | read_reply_begin_vc = 0; 67 | read_reply_end_vc = 0; 68 | write_reply_begin_vc = 0; 69 | write_reply_end_vc = 0; 70 | 71 | -------------------------------------------------------------------------------- /configs/deprecated-cfgs/QuadroFX5600/icnt_config_islip.icnt: -------------------------------------------------------------------------------- 1 | //14*1 fly with 32 flits per packet under gpgpusim injection mode 2 | use_map = 0; 3 | flit_size = 32; 4 | 5 | // currently we donot use this, see subnets below 6 | network_count = 2; 7 | 8 | // Topology 9 | topology = fly; 10 | k = 14; 11 | n = 1; 12 | 13 | // Routing 14 | 15 | routing_function = dest_tag; 16 | 17 | // Flow control 18 | 19 | num_vcs = 1; 20 | vc_buf_size = 8; 21 | 22 | wait_for_tail_credit = 0; 23 | 24 | // Router architecture 25 | 26 | vc_allocator = islip; //separable_input_first; 27 | sw_allocator = islip; //separable_input_first; 28 | alloc_iters = 1; 29 | 30 | credit_delay = 0; 31 | routing_delay = 0; 32 | vc_alloc_delay = 1; 33 | sw_alloc_delay = 1; 34 | 35 | input_speedup = 2; 36 | output_speedup = 1; 37 | internal_speedup = 1.0; 38 | 39 | // Traffic, GPGPU-Sim does not use this 40 | 41 | traffic = uniform; 42 | packet_size ={{1,2,3,4},{10,20}}; 43 | packet_size_rate={{1,1,1,1},{2,1}}; 44 | 45 | // Simulation - Don't change 46 | 47 | sim_type = gpgpusim; 48 | //sim_type = latency; 49 | injection_rate = 0.1; 50 | 51 | subnets = 2; 52 | 53 | // Always use read and write no matter following line 54 | //use_read_write = 1; 55 | 56 | 57 | read_request_subnet = 0; 58 | read_reply_subnet = 1; 59 | write_request_subnet = 0; 60 | write_reply_subnet = 1; 61 | 62 | read_request_begin_vc = 0; 63 | read_request_end_vc = 0; 64 | write_request_begin_vc = 0; 65 | write_request_end_vc = 0; 66 | read_reply_begin_vc = 0; 67 | read_reply_end_vc = 0; 68 | write_reply_begin_vc = 0; 69 | write_reply_end_vc = 0; 70 | 71 | -------------------------------------------------------------------------------- /configs/deprecated-cfgs/SM6_GTX1080/config_fermi_islip.icnt: -------------------------------------------------------------------------------- 1 | //21*1 fly with 32 flits per packet under gpgpusim injection mode 2 | use_map = 0; 3 | flit_size = 32; 4 | 5 | // currently we do not use this, see subnets below 6 | network_count = 2; 7 | 8 | // Topology 9 | topology = fly; 10 | k = 50; 11 | n = 1; 12 | 13 | // Routing 14 | 15 | routing_function = dest_tag; 16 | 17 | // Flow control 18 | 19 | num_vcs = 1; 20 | vc_buf_size = 8; 21 | 22 | wait_for_tail_credit = 0; 23 | 24 | // Router architecture 25 | 26 | vc_allocator = islip; //separable_input_first; 27 | sw_allocator = islip; //separable_input_first; 28 | alloc_iters = 1; 29 | 30 | credit_delay = 0; 31 | routing_delay = 0; 32 | vc_alloc_delay = 1; 33 | sw_alloc_delay = 1; 34 | 35 | input_speedup = 2; 36 | output_speedup = 1; 37 | internal_speedup = 1.0; 38 | 39 | // Traffic, GPGPU-Sim does not use this 40 | 41 | traffic = uniform; 42 | packet_size ={{1,2,3,4},{10,20}}; 43 | packet_size_rate={{1,1,1,1},{2,1}}; 44 | 45 | // Simulation - Don't change 46 | 47 | sim_type = gpgpusim; 48 | //sim_type = latency; 49 | injection_rate = 0.1; 50 | 51 | subnets = 2; 52 | 53 | // Always use read and write no matter following line 54 | //use_read_write = 1; 55 | 56 | 57 | read_request_subnet = 0; 58 | read_reply_subnet = 1; 59 | write_request_subnet = 0; 60 | write_reply_subnet = 1; 61 | 62 | read_request_begin_vc = 0; 63 | read_request_end_vc = 0; 64 | write_request_begin_vc = 0; 65 | write_request_end_vc = 0; 66 | read_reply_begin_vc = 0; 67 | read_reply_end_vc = 0; 68 | write_reply_begin_vc = 0; 69 | write_reply_end_vc = 0; 70 | 71 | -------------------------------------------------------------------------------- /configs/deprecated-cfgs/SM6_P100/config_fermi_islip.icnt: -------------------------------------------------------------------------------- 1 | //21*1 fly with 32 flits per packet under gpgpusim injection mode 2 | use_map = 0; 3 | flit_size = 32; 4 | 5 | // currently we do not use this, see subnets below 6 | network_count = 2; 7 | 8 | // Topology 9 | topology = fly; 10 | k = 60; 11 | n = 1; 12 | 13 | // Routing 14 | 15 | routing_function = dest_tag; 16 | 17 | // Flow control 18 | 19 | num_vcs = 1; 20 | vc_buf_size = 8; 21 | 22 | wait_for_tail_credit = 0; 23 | 24 | // Router architecture 25 | 26 | vc_allocator = islip; //separable_input_first; 27 | sw_allocator = islip; //separable_input_first; 28 | alloc_iters = 1; 29 | 30 | credit_delay = 0; 31 | routing_delay = 0; 32 | vc_alloc_delay = 1; 33 | sw_alloc_delay = 1; 34 | 35 | input_speedup = 2; 36 | output_speedup = 1; 37 | internal_speedup = 1.0; 38 | 39 | // Traffic, GPGPU-Sim does not use this 40 | 41 | traffic = uniform; 42 | packet_size ={{1,2,3,4},{10,20}}; 43 | packet_size_rate={{1,1,1,1},{2,1}}; 44 | 45 | // Simulation - Don't change 46 | 47 | sim_type = gpgpusim; 48 | //sim_type = latency; 49 | injection_rate = 0.1; 50 | 51 | subnets = 2; 52 | 53 | // Always use read and write no matter following line 54 | //use_read_write = 1; 55 | 56 | 57 | read_request_subnet = 0; 58 | read_reply_subnet = 1; 59 | write_request_subnet = 0; 60 | write_reply_subnet = 1; 61 | 62 | read_request_begin_vc = 0; 63 | read_request_end_vc = 0; 64 | write_request_begin_vc = 0; 65 | write_request_end_vc = 0; 66 | read_reply_begin_vc = 0; 67 | read_reply_end_vc = 0; 68 | write_reply_begin_vc = 0; 69 | write_reply_end_vc = 0; 70 | 71 | -------------------------------------------------------------------------------- /configs/deprecated-cfgs/SM6_TITANX/config_fermi_islip.icnt: -------------------------------------------------------------------------------- 1 | //21*1 fly with 32 flits per packet under gpgpusim injection mode 2 | use_map = 0; 3 | flit_size = 32; 4 | 5 | // currently we do not use this, see subnets below 6 | network_count = 2; 7 | 8 | // Topology 9 | topology = fly; 10 | k = 52; 11 | n = 1; 12 | 13 | // Routing 14 | 15 | routing_function = dest_tag; 16 | 17 | // Flow control 18 | 19 | num_vcs = 1; 20 | vc_buf_size = 8; 21 | 22 | wait_for_tail_credit = 0; 23 | 24 | // Router architecture 25 | 26 | vc_allocator = islip; //separable_input_first; 27 | sw_allocator = islip; //separable_input_first; 28 | alloc_iters = 1; 29 | 30 | credit_delay = 0; 31 | routing_delay = 0; 32 | vc_alloc_delay = 1; 33 | sw_alloc_delay = 1; 34 | 35 | input_speedup = 2; 36 | output_speedup = 1; 37 | internal_speedup = 1.0; 38 | 39 | // Traffic, GPGPU-Sim does not use this 40 | 41 | traffic = uniform; 42 | packet_size ={{1,2,3,4},{10,20}}; 43 | packet_size_rate={{1,1,1,1},{2,1}}; 44 | 45 | // Simulation - Don't change 46 | 47 | sim_type = gpgpusim; 48 | //sim_type = latency; 49 | injection_rate = 0.1; 50 | 51 | subnets = 2; 52 | 53 | // Always use read and write no matter following line 54 | //use_read_write = 1; 55 | 56 | 57 | read_request_subnet = 0; 58 | read_reply_subnet = 1; 59 | write_request_subnet = 0; 60 | write_reply_subnet = 1; 61 | 62 | read_request_begin_vc = 0; 63 | read_request_end_vc = 0; 64 | write_request_begin_vc = 0; 65 | write_request_end_vc = 0; 66 | read_reply_begin_vc = 0; 67 | read_reply_end_vc = 0; 68 | write_reply_begin_vc = 0; 69 | write_reply_end_vc = 0; 70 | 71 | -------------------------------------------------------------------------------- /configs/deprecated-cfgs/SM7_TITANV/config_fermi_islip.icnt: -------------------------------------------------------------------------------- 1 | //21*1 fly with 32 flits per packet under gpgpusim injection mode 2 | use_map = 0; 3 | flit_size = 32; 4 | 5 | // currently we do not use this, see subnets below 6 | network_count = 2; 7 | 8 | // Topology 9 | topology = fly; 10 | k = 64; 11 | n = 1; 12 | 13 | // Routing 14 | 15 | routing_function = dest_tag; 16 | 17 | // Flow control 18 | 19 | num_vcs = 1; 20 | vc_buf_size = 8; 21 | 22 | wait_for_tail_credit = 0; 23 | 24 | // Router architecture 25 | 26 | vc_allocator = islip; //separable_input_first; 27 | sw_allocator = islip; //separable_input_first; 28 | alloc_iters = 1; 29 | 30 | credit_delay = 0; 31 | routing_delay = 0; 32 | vc_alloc_delay = 1; 33 | sw_alloc_delay = 1; 34 | 35 | input_speedup = 2; 36 | output_speedup = 1; 37 | internal_speedup = 1.0; 38 | 39 | // Traffic, GPGPU-Sim does not use this 40 | 41 | traffic = uniform; 42 | packet_size ={{1,2,3,4},{10,20}}; 43 | packet_size_rate={{1,1,1,1},{2,1}}; 44 | 45 | // Simulation - Don't change 46 | 47 | sim_type = gpgpusim; 48 | //sim_type = latency; 49 | injection_rate = 0.1; 50 | 51 | subnets = 2; 52 | 53 | // Always use read and write no matter following line 54 | //use_read_write = 1; 55 | 56 | 57 | read_request_subnet = 0; 58 | read_reply_subnet = 1; 59 | write_request_subnet = 0; 60 | write_reply_subnet = 1; 61 | 62 | read_request_begin_vc = 0; 63 | read_request_end_vc = 0; 64 | write_request_begin_vc = 0; 65 | write_request_end_vc = 0; 66 | read_reply_begin_vc = 0; 67 | read_reply_end_vc = 0; 68 | write_reply_begin_vc = 0; 69 | write_reply_end_vc = 0; 70 | 71 | -------------------------------------------------------------------------------- /configs/deprecated-cfgs/TeslaC2050/config_fermi_islip.icnt: -------------------------------------------------------------------------------- 1 | //20*1 fly with 32 flits per packet under gpgpusim injection mode 2 | use_map = 0; 3 | flit_size = 32; 4 | 5 | // currently we donot use this, see subnets below 6 | network_count = 2; 7 | 8 | // Topology 9 | topology = fly; 10 | k = 26; 11 | n = 1; 12 | 13 | // Routing 14 | 15 | routing_function = dest_tag; 16 | 17 | // Flow control 18 | 19 | num_vcs = 1; 20 | vc_buf_size = 8; 21 | 22 | wait_for_tail_credit = 0; 23 | 24 | // Router architecture 25 | 26 | vc_allocator = islip; //separable_input_first; 27 | sw_allocator = islip; //separable_input_first; 28 | alloc_iters = 1; 29 | 30 | credit_delay = 0; 31 | routing_delay = 0; 32 | vc_alloc_delay = 1; 33 | sw_alloc_delay = 1; 34 | 35 | input_speedup = 2; 36 | output_speedup = 1; 37 | internal_speedup = 1.0; 38 | 39 | // Traffic, GPGPU-Sim does not use this 40 | 41 | traffic = uniform; 42 | packet_size ={{1,2,3,4},{10,20}}; 43 | packet_size_rate={{1,1,1,1},{2,1}}; 44 | 45 | // Simulation - Don't change 46 | 47 | sim_type = gpgpusim; 48 | //sim_type = latency; 49 | injection_rate = 0.1; 50 | 51 | 52 | subnets = 2; 53 | 54 | // Always use read and write no matter following line 55 | //use_read_write = 1; 56 | 57 | 58 | read_request_subnet = 0; 59 | read_reply_subnet = 1; 60 | write_request_subnet = 0; 61 | write_reply_subnet = 1; 62 | 63 | read_request_begin_vc = 0; 64 | read_request_end_vc = 0; 65 | write_request_begin_vc = 0; 66 | write_request_end_vc = 0; 67 | read_reply_begin_vc = 0; 68 | read_reply_end_vc = 0; 69 | write_reply_begin_vc = 0; 70 | write_reply_end_vc = 0; 71 | -------------------------------------------------------------------------------- /configs/deprecated-cfgs/GeForceGTX750Ti/config_fermi_islip.icnt: -------------------------------------------------------------------------------- 1 | //21*1 fly with 32 flits per packet under gpgpusim injection mode 2 | use_map = 0; 3 | flit_size = 32; 4 | 5 | // currently we do not use this, see subnets below 6 | network_count = 2; 7 | 8 | // Topology 9 | topology = fly; 10 | k = 7; 11 | n = 1; 12 | 13 | // Routing 14 | 15 | routing_function = dest_tag; 16 | 17 | // Flow control 18 | 19 | num_vcs = 1; 20 | vc_buf_size = 8; 21 | 22 | wait_for_tail_credit = 0; 23 | 24 | // Router architecture 25 | 26 | vc_allocator = islip; //separable_input_first; 27 | sw_allocator = islip; //separable_input_first; 28 | alloc_iters = 1; 29 | 30 | credit_delay = 0; 31 | routing_delay = 0; 32 | vc_alloc_delay = 1; 33 | sw_alloc_delay = 1; 34 | 35 | input_speedup = 2; 36 | output_speedup = 1; 37 | internal_speedup = 1.0; 38 | 39 | // Traffic, GPGPU-Sim does not use this 40 | 41 | traffic = uniform; 42 | packet_size ={{1,2,3,4},{10,20}}; 43 | packet_size_rate={{1,1,1,1},{2,1}}; 44 | 45 | // Simulation - Don't change 46 | 47 | sim_type = gpgpusim; 48 | //sim_type = latency; 49 | injection_rate = 0.1; 50 | 51 | subnets = 2; 52 | 53 | // Always use read and write no matter following line 54 | //use_read_write = 1; 55 | 56 | 57 | read_request_subnet = 0; 58 | read_reply_subnet = 1; 59 | write_request_subnet = 0; 60 | write_reply_subnet = 1; 61 | 62 | read_request_begin_vc = 0; 63 | read_request_end_vc = 0; 64 | write_request_begin_vc = 0; 65 | write_request_end_vc = 0; 66 | read_reply_begin_vc = 0; 67 | read_reply_end_vc = 0; 68 | write_reply_begin_vc = 0; 69 | write_reply_end_vc = 0; 70 | 71 | -------------------------------------------------------------------------------- /debug_tools/WatchYourStep/ptxjitplus/inc/multithreading.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1993-2013 NVIDIA Corporation. All rights reserved. 3 | * 4 | * Please refer to the NVIDIA end user license agreement (EULA) associated 5 | * with this source code for terms and conditions that govern your use of 6 | * this software. Any use, reproduction, disclosure, or distribution of 7 | * this software and related documentation outside the terms of the EULA 8 | * is strictly prohibited. 9 | * 10 | */ 11 | 12 | #ifndef MULTITHREADING_H 13 | #define MULTITHREADING_H 14 | 15 | 16 | //Simple portable thread library. 17 | 18 | //Windows threads. 19 | #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64) 20 | #include 21 | 22 | typedef HANDLE CUTThread; 23 | typedef unsigned(WINAPI *CUT_THREADROUTINE)(void *); 24 | 25 | #define CUT_THREADPROC unsigned WINAPI 26 | #define CUT_THREADEND return 0 27 | 28 | #else 29 | //POSIX threads. 30 | #include 31 | 32 | typedef pthread_t CUTThread; 33 | typedef void *(*CUT_THREADROUTINE)(void *); 34 | 35 | #define CUT_THREADPROC void 36 | #define CUT_THREADEND 37 | #endif 38 | 39 | 40 | #ifdef __cplusplus 41 | extern "C" { 42 | #endif 43 | 44 | //Create thread. 45 | CUTThread cutStartThread(CUT_THREADROUTINE, void *data); 46 | 47 | //Wait for thread to finish. 48 | void cutEndThread(CUTThread thread); 49 | 50 | //Destroy thread. 51 | void cutDestroyThread(CUTThread thread); 52 | 53 | //Wait for multiple threads. 54 | void cutWaitForThreads(const CUTThread *threads, int num); 55 | 56 | #ifdef __cplusplus 57 | } //extern "C" 58 | #endif 59 | 60 | #endif //MULTITHREADING_H 61 | -------------------------------------------------------------------------------- /src/intersim2/rng_wrapper.cpp: -------------------------------------------------------------------------------- 1 | // $Id: rng_wrapper.cpp 5188 2012-08-30 00:31:31Z dub $ 2 | 3 | /* 4 | Copyright (c) 2007-2012, Trustees of The Leland Stanford Junior University 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | Redistributions in binary form must reproduce the above copyright notice, this 13 | list of conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 20 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #define main rng_main 29 | #include "rng.c" 30 | 31 | long ran_next( ) 32 | { 33 | return ran_arr_next( ); 34 | } 35 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | *.swp 3 | *.swo 4 | 5 | src/intersim2/lex.yy.c 6 | src/intersim2/y.tab.c 7 | src/intersim2/y.tab.h 8 | 9 | libcuda/cuobjdump_lexer.c 10 | libcuda/cuobjdump_parser.c 11 | libcuda/cuobjdump_parser.h 12 | libcuda/cuobjdump_parser.output 13 | 14 | lib/* 15 | doc/doxygen/html 16 | 17 | cuobjdump_to_ptxplus/elf_lexer.cc 18 | cuobjdump_to_ptxplus/elf_parser.cc 19 | cuobjdump_to_ptxplus/elf_parser.hh 20 | cuobjdump_to_ptxplus/elf_parser.output 21 | cuobjdump_to_ptxplus/header_lexer.cc 22 | cuobjdump_to_ptxplus/header_parser.cc 23 | cuobjdump_to_ptxplus/header_parser.hh 24 | cuobjdump_to_ptxplus/header_parser.output 25 | cuobjdump_to_ptxplus/lex.ptx_.c 26 | cuobjdump_to_ptxplus/ptx.output 27 | cuobjdump_to_ptxplus/ptx.tab.c 28 | cuobjdump_to_ptxplus/ptx.tab.h 29 | cuobjdump_to_ptxplus/sass_lexer.cc 30 | cuobjdump_to_ptxplus/sass_parser.cc 31 | cuobjdump_to_ptxplus/sass_parser.hh 32 | cuobjdump_to_ptxplus/sass_parser.output 33 | 34 | build/* 35 | tags 36 | *.swp 37 | *~ 38 | cscope* 39 | tags 40 | regression.sh 41 | 42 | #gcov 43 | *.gcov 44 | *.gcda 45 | *.gcno 46 | 47 | #debug_tools 48 | debug_tools/WatchYourStep/data/* 49 | debug_tools/WatchYourStep/ptxjitplus/bin/* 50 | *log 51 | *.o 52 | debug_tools/WatchYourStep/ptxjitplus/config* 53 | debug_tools/WatchYourStep/ptxjitplus/*.xml 54 | debug_tools/WatchYourStep/ptxjitplus/*.icnt 55 | debug_tools/WatchYourStep/ptxjitplus/gpgpu* 56 | debug_tools/WatchYourStep/ptxjitplus/*.old 57 | debug_tools/WatchYourStep/ptxjitplus/ptxjitplus 58 | debug_tools/WatchYourStep/ptxjitplus/*.ptx 59 | 60 | # Accel-sim packages used for regressions 61 | accel-sim-framework/ 62 | gpu-app-collection/ 63 | 64 | setup 65 | -------------------------------------------------------------------------------- /src/intersim2/misc_utils.hpp: -------------------------------------------------------------------------------- 1 | // $Id: misc_utils.hpp 5188 2012-08-30 00:31:31Z dub $ 2 | 3 | /* 4 | Copyright (c) 2007-2012, Trustees of The Leland Stanford Junior University 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | Redistributions in binary form must reproduce the above copyright notice, this 13 | list of conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 20 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef _MISC_UTILS_HPP_ 29 | #define _MISC_UTILS_HPP_ 30 | 31 | int log_two( int x ); 32 | int powi( int x, int y ); 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /src/intersim2/rng_double_wrapper.cpp: -------------------------------------------------------------------------------- 1 | // $Id: rng_double_wrapper.cpp 5188 2012-08-30 00:31:31Z dub $ 2 | 3 | /* 4 | Copyright (c) 2007-2012, Trustees of The Leland Stanford Junior University 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | Redistributions in binary form must reproduce the above copyright notice, this 13 | list of conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 20 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #define main rng_double_main 29 | #include "rng-double.c" 30 | 31 | double ranf_next( ) 32 | { 33 | return ranf_arr_next( ); 34 | } 35 | -------------------------------------------------------------------------------- /configs/tested-cfgs/SM6_TITANX/config_pascal_islip.icnt: -------------------------------------------------------------------------------- 1 | //21*1 fly with 32 flits per packet under gpgpusim injection mode 2 | use_map = 0; 3 | flit_size = 40; 4 | 5 | // currently we do not use this, see subnets below 6 | network_count = 2; 7 | 8 | // Topology 9 | topology = fly; 10 | k = 52; 11 | n = 1; 12 | 13 | // Routing 14 | 15 | routing_function = dest_tag; 16 | 17 | // Flow control 18 | 19 | num_vcs = 1; 20 | vc_buf_size = 64; 21 | input_buffer_size = 256; 22 | ejection_buffer_size = 64; 23 | boundary_buffer_size = 64; 24 | 25 | wait_for_tail_credit = 0; 26 | 27 | // Router architecture 28 | 29 | vc_allocator = islip; //separable_input_first; 30 | sw_allocator = islip; //separable_input_first; 31 | alloc_iters = 1; 32 | 33 | credit_delay = 0; 34 | routing_delay = 0; 35 | vc_alloc_delay = 1; 36 | sw_alloc_delay = 1; 37 | 38 | input_speedup = 1; 39 | output_speedup = 1; 40 | internal_speedup = 2.0; 41 | 42 | // Traffic, GPGPU-Sim does not use this 43 | 44 | traffic = uniform; 45 | packet_size ={{1,2,3,4},{10,20}}; 46 | packet_size_rate={{1,1,1,1},{2,1}}; 47 | 48 | // Simulation - Don't change 49 | 50 | sim_type = gpgpusim; 51 | //sim_type = latency; 52 | injection_rate = 0.1; 53 | 54 | subnets = 2; 55 | 56 | // Always use read and write no matter following line 57 | //use_read_write = 1; 58 | 59 | 60 | read_request_subnet = 0; 61 | read_reply_subnet = 1; 62 | write_request_subnet = 0; 63 | write_reply_subnet = 1; 64 | 65 | read_request_begin_vc = 0; 66 | read_request_end_vc = 0; 67 | write_request_begin_vc = 0; 68 | write_request_end_vc = 0; 69 | read_reply_begin_vc = 0; 70 | read_reply_end_vc = 0; 71 | write_reply_begin_vc = 0; 72 | write_reply_end_vc = 0; 73 | 74 | -------------------------------------------------------------------------------- /configs/tested-cfgs/SM75_RTX2060/config_turing_islip.icnt: -------------------------------------------------------------------------------- 1 | //52*1 fly with 32 flits per packet under gpgpusim injection mode 2 | use_map = 0; 3 | flit_size = 40; 4 | 5 | // currently we do not use this, see subnets below 6 | network_count = 2; 7 | 8 | // Topology 9 | topology = fly; 10 | k = 52; 11 | n = 1; 12 | 13 | // Routing 14 | 15 | routing_function = dest_tag; 16 | 17 | // Flow control 18 | 19 | num_vcs = 1; 20 | vc_buf_size = 64; 21 | input_buffer_size = 256; 22 | ejection_buffer_size = 64; 23 | boundary_buffer_size = 64; 24 | 25 | wait_for_tail_credit = 0; 26 | 27 | // Router architecture 28 | 29 | vc_allocator = islip; //separable_input_first; 30 | sw_allocator = islip; //separable_input_first; 31 | alloc_iters = 1; 32 | 33 | credit_delay = 0; 34 | routing_delay = 0; 35 | vc_alloc_delay = 1; 36 | sw_alloc_delay = 1; 37 | 38 | input_speedup = 1; 39 | output_speedup = 1; 40 | internal_speedup = 2.0; 41 | 42 | // Traffic, GPGPU-Sim does not use this 43 | 44 | traffic = uniform; 45 | packet_size ={{1,2,3,4},{10,20}}; 46 | packet_size_rate={{1,1,1,1},{2,1}}; 47 | 48 | // Simulation - Don't change 49 | 50 | sim_type = gpgpusim; 51 | //sim_type = latency; 52 | injection_rate = 0.1; 53 | 54 | subnets = 2; 55 | 56 | // Always use read and write no matter following line 57 | //use_read_write = 1; 58 | 59 | 60 | read_request_subnet = 0; 61 | read_reply_subnet = 1; 62 | write_request_subnet = 0; 63 | write_reply_subnet = 1; 64 | 65 | read_request_begin_vc = 0; 66 | read_request_end_vc = 0; 67 | write_request_begin_vc = 0; 68 | write_request_end_vc = 0; 69 | read_reply_begin_vc = 0; 70 | read_reply_end_vc = 0; 71 | write_reply_begin_vc = 0; 72 | write_reply_end_vc = 0; 73 | 74 | -------------------------------------------------------------------------------- /configs/tested-cfgs/SM75_RTX2060_S/config_turing_islip.icnt: -------------------------------------------------------------------------------- 1 | //52*1 fly with 32 flits per packet under gpgpusim injection mode 2 | use_map = 0; 3 | flit_size = 40; 4 | 5 | // currently we do not use this, see subnets below 6 | network_count = 2; 7 | 8 | // Topology 9 | topology = fly; 10 | k = 52; 11 | n = 1; 12 | 13 | // Routing 14 | 15 | routing_function = dest_tag; 16 | 17 | // Flow control 18 | 19 | num_vcs = 1; 20 | vc_buf_size = 64; 21 | input_buffer_size = 256; 22 | ejection_buffer_size = 64; 23 | boundary_buffer_size = 64; 24 | 25 | wait_for_tail_credit = 0; 26 | 27 | // Router architecture 28 | 29 | vc_allocator = islip; //separable_input_first; 30 | sw_allocator = islip; //separable_input_first; 31 | alloc_iters = 1; 32 | 33 | credit_delay = 0; 34 | routing_delay = 0; 35 | vc_alloc_delay = 1; 36 | sw_alloc_delay = 1; 37 | 38 | input_speedup = 1; 39 | output_speedup = 1; 40 | internal_speedup = 2.0; 41 | 42 | // Traffic, GPGPU-Sim does not use this 43 | 44 | traffic = uniform; 45 | packet_size ={{1,2,3,4},{10,20}}; 46 | packet_size_rate={{1,1,1,1},{2,1}}; 47 | 48 | // Simulation - Don't change 49 | 50 | sim_type = gpgpusim; 51 | //sim_type = latency; 52 | injection_rate = 0.1; 53 | 54 | subnets = 2; 55 | 56 | // Always use read and write no matter following line 57 | //use_read_write = 1; 58 | 59 | 60 | read_request_subnet = 0; 61 | read_reply_subnet = 1; 62 | write_request_subnet = 0; 63 | write_reply_subnet = 1; 64 | 65 | read_request_begin_vc = 0; 66 | read_request_end_vc = 0; 67 | write_request_begin_vc = 0; 68 | write_request_end_vc = 0; 69 | read_reply_begin_vc = 0; 70 | read_reply_end_vc = 0; 71 | write_reply_begin_vc = 0; 72 | write_reply_end_vc = 0; 73 | 74 | -------------------------------------------------------------------------------- /configs/tested-cfgs/SM3_KEPLER_TITAN/config_kepler_islip.icnt: -------------------------------------------------------------------------------- 1 | //21*1 fly with 32 flits per packet under gpgpusim injection mode 2 | use_map = 0; 3 | flit_size = 40; 4 | 5 | // currently we do not use this, see subnets below 6 | network_count = 2; 7 | 8 | // Topology 9 | topology = fly; 10 | k = 38; 11 | n = 1; 12 | 13 | // Routing 14 | 15 | routing_function = dest_tag; 16 | 17 | // Flow control 18 | 19 | num_vcs = 1; 20 | vc_buf_size = 64; 21 | input_buffer_size = 256; 22 | ejection_buffer_size = 64; 23 | boundary_buffer_size = 64; 24 | 25 | wait_for_tail_credit = 0; 26 | 27 | // Router architecture 28 | 29 | vc_allocator = islip; //separable_input_first; 30 | sw_allocator = islip; //separable_input_first; 31 | alloc_iters = 1; 32 | 33 | credit_delay = 0; 34 | routing_delay = 0; 35 | vc_alloc_delay = 1; 36 | sw_alloc_delay = 1; 37 | 38 | input_speedup = 1; 39 | output_speedup = 1; 40 | internal_speedup = 2.0; 41 | 42 | // Traffic, GPGPU-Sim does not use this 43 | 44 | traffic = uniform; 45 | packet_size ={{1,2,3,4},{10,20}}; 46 | packet_size_rate={{1,1,1,1},{2,1}}; 47 | 48 | // Simulation - Don't change 49 | 50 | sim_type = gpgpusim; 51 | //sim_type = latency; 52 | injection_rate = 0.1; 53 | 54 | subnets = 2; 55 | 56 | // Always use read and write no matter following line 57 | //use_read_write = 1; 58 | 59 | 60 | read_request_subnet = 0; 61 | read_reply_subnet = 1; 62 | write_request_subnet = 0; 63 | write_reply_subnet = 1; 64 | 65 | read_request_begin_vc = 0; 66 | read_request_end_vc = 0; 67 | write_request_begin_vc = 0; 68 | write_request_end_vc = 0; 69 | read_reply_begin_vc = 0; 70 | read_reply_end_vc = 0; 71 | write_reply_begin_vc = 0; 72 | write_reply_end_vc = 0; 73 | 74 | -------------------------------------------------------------------------------- /configs/tested-cfgs/SM7_GV100/config_volta_islip.icnt: -------------------------------------------------------------------------------- 1 | //21*1 fly with 32 flits per packet under gpgpusim injection mode 2 | use_map = 0; 3 | flit_size = 40; 4 | 5 | // currently we do not use this, see subnets below 6 | network_count = 2; 7 | 8 | // Topology 9 | topology = fly; 10 | k = 144; 11 | n = 1; 12 | 13 | // Routing 14 | 15 | routing_function = dest_tag; 16 | 17 | 18 | // Flow control 19 | 20 | num_vcs = 1; 21 | vc_buf_size = 256; 22 | input_buffer_size = 256; 23 | ejection_buffer_size = 256; 24 | boundary_buffer_size = 256; 25 | 26 | wait_for_tail_credit = 0; 27 | 28 | // Router architecture 29 | 30 | vc_allocator = islip; //separable_input_first; 31 | sw_allocator = islip; //separable_input_first; 32 | alloc_iters = 1; 33 | 34 | credit_delay = 0; 35 | routing_delay = 0; 36 | vc_alloc_delay = 1; 37 | sw_alloc_delay = 1; 38 | 39 | input_speedup = 1; 40 | output_speedup = 1; 41 | internal_speedup = 2.0; 42 | 43 | // Traffic, GPGPU-Sim does not use this 44 | 45 | traffic = uniform; 46 | packet_size ={{1,2,3,4},{10,20}}; 47 | packet_size_rate={{1,1,1,1},{2,1}}; 48 | 49 | // Simulation - Don't change 50 | 51 | sim_type = gpgpusim; 52 | //sim_type = latency; 53 | injection_rate = 0.1; 54 | 55 | subnets = 2; 56 | 57 | // Always use read and write no matter following line 58 | //use_read_write = 1; 59 | 60 | 61 | read_request_subnet = 0; 62 | read_reply_subnet = 1; 63 | write_request_subnet = 0; 64 | write_reply_subnet = 1; 65 | 66 | read_request_begin_vc = 0; 67 | read_request_end_vc = 0; 68 | write_request_begin_vc = 0; 69 | write_request_end_vc = 0; 70 | read_reply_begin_vc = 0; 71 | read_reply_end_vc = 0; 72 | write_reply_begin_vc = 0; 73 | write_reply_end_vc = 0; 74 | 75 | -------------------------------------------------------------------------------- /configs/tested-cfgs/SM7_QV100/config_volta_islip.icnt: -------------------------------------------------------------------------------- 1 | //21*1 fly with 32 flits per packet under gpgpusim injection mode 2 | use_map = 0; 3 | flit_size = 40; 4 | 5 | // currently we do not use this, see subnets below 6 | network_count = 2; 7 | 8 | // Topology 9 | topology = fly; 10 | k = 144; 11 | n = 1; 12 | 13 | // Routing 14 | 15 | routing_function = dest_tag; 16 | 17 | 18 | // Flow control 19 | 20 | num_vcs = 1; 21 | vc_buf_size = 256; 22 | input_buffer_size = 256; 23 | ejection_buffer_size = 256; 24 | boundary_buffer_size = 256; 25 | 26 | wait_for_tail_credit = 0; 27 | 28 | // Router architecture 29 | 30 | vc_allocator = islip; //separable_input_first; 31 | sw_allocator = islip; //separable_input_first; 32 | alloc_iters = 1; 33 | 34 | credit_delay = 0; 35 | routing_delay = 0; 36 | vc_alloc_delay = 1; 37 | sw_alloc_delay = 1; 38 | 39 | input_speedup = 1; 40 | output_speedup = 1; 41 | internal_speedup = 2.0; 42 | 43 | // Traffic, GPGPU-Sim does not use this 44 | 45 | traffic = uniform; 46 | packet_size ={{1,2,3,4},{10,20}}; 47 | packet_size_rate={{1,1,1,1},{2,1}}; 48 | 49 | // Simulation - Don't change 50 | 51 | sim_type = gpgpusim; 52 | //sim_type = latency; 53 | injection_rate = 0.1; 54 | 55 | subnets = 2; 56 | 57 | // Always use read and write no matter following line 58 | //use_read_write = 1; 59 | 60 | 61 | read_request_subnet = 0; 62 | read_reply_subnet = 1; 63 | write_request_subnet = 0; 64 | write_reply_subnet = 1; 65 | 66 | read_request_begin_vc = 0; 67 | read_request_end_vc = 0; 68 | write_request_begin_vc = 0; 69 | write_request_end_vc = 0; 70 | read_reply_begin_vc = 0; 71 | read_reply_end_vc = 0; 72 | write_reply_begin_vc = 0; 73 | write_reply_end_vc = 0; 74 | 75 | -------------------------------------------------------------------------------- /configs/tested-cfgs/SM7_TITANV/config_volta_islip.icnt: -------------------------------------------------------------------------------- 1 | //21*1 fly with 32 flits per packet under gpgpusim injection mode 2 | use_map = 0; 3 | flit_size = 40; 4 | 5 | // currently we do not use this, see subnets below 6 | network_count = 2; 7 | 8 | // Topology 9 | topology = fly; 10 | k = 88; 11 | n = 1; 12 | 13 | // Routing 14 | 15 | routing_function = dest_tag; 16 | 17 | 18 | // Flow control 19 | 20 | num_vcs = 1; 21 | vc_buf_size = 256; 22 | input_buffer_size = 256; 23 | ejection_buffer_size = 256; 24 | boundary_buffer_size = 256; 25 | 26 | wait_for_tail_credit = 0; 27 | 28 | // Router architecture 29 | 30 | vc_allocator = islip; //separable_input_first; 31 | sw_allocator = islip; //separable_input_first; 32 | alloc_iters = 1; 33 | 34 | credit_delay = 0; 35 | routing_delay = 0; 36 | vc_alloc_delay = 1; 37 | sw_alloc_delay = 1; 38 | 39 | input_speedup = 1; 40 | output_speedup = 1; 41 | internal_speedup = 2.0; 42 | 43 | // Traffic, GPGPU-Sim does not use this 44 | 45 | traffic = uniform; 46 | packet_size ={{1,2,3,4},{10,20}}; 47 | packet_size_rate={{1,1,1,1},{2,1}}; 48 | 49 | // Simulation - Don't change 50 | 51 | sim_type = gpgpusim; 52 | //sim_type = latency; 53 | injection_rate = 0.1; 54 | 55 | subnets = 2; 56 | 57 | // Always use read and write no matter following line 58 | //use_read_write = 1; 59 | 60 | 61 | read_request_subnet = 0; 62 | read_reply_subnet = 1; 63 | write_request_subnet = 0; 64 | write_reply_subnet = 1; 65 | 66 | read_request_begin_vc = 0; 67 | read_request_end_vc = 0; 68 | write_request_begin_vc = 0; 69 | write_request_end_vc = 0; 70 | read_reply_begin_vc = 0; 71 | read_reply_end_vc = 0; 72 | write_reply_begin_vc = 0; 73 | write_reply_end_vc = 0; 74 | 75 | -------------------------------------------------------------------------------- /configs/tested-cfgs/SM86_RTX3070/config_ampere_islip.icnt: -------------------------------------------------------------------------------- 1 | //21*1 fly with 32 flits per packet under gpgpusim injection mode 2 | use_map = 0; 3 | flit_size = 40; 4 | 5 | // currently we do not use this, see subnets below 6 | network_count = 2; 7 | 8 | // Topology 9 | topology = fly; 10 | k = 78; 11 | n = 1; 12 | 13 | // Routing 14 | 15 | routing_function = dest_tag; 16 | 17 | 18 | // Flow control 19 | 20 | num_vcs = 1; 21 | vc_buf_size = 256; 22 | input_buffer_size = 256; 23 | ejection_buffer_size = 256; 24 | boundary_buffer_size = 256; 25 | 26 | wait_for_tail_credit = 0; 27 | 28 | // Router architecture 29 | 30 | vc_allocator = islip; //separable_input_first; 31 | sw_allocator = islip; //separable_input_first; 32 | alloc_iters = 1; 33 | 34 | credit_delay = 0; 35 | routing_delay = 0; 36 | vc_alloc_delay = 1; 37 | sw_alloc_delay = 1; 38 | 39 | input_speedup = 1; 40 | output_speedup = 1; 41 | internal_speedup = 2.0; 42 | 43 | // Traffic, GPGPU-Sim does not use this 44 | 45 | traffic = uniform; 46 | packet_size ={{1,2,3,4},{10,20}}; 47 | packet_size_rate={{1,1,1,1},{2,1}}; 48 | 49 | // Simulation - Don't change 50 | 51 | sim_type = gpgpusim; 52 | //sim_type = latency; 53 | injection_rate = 0.1; 54 | 55 | subnets = 2; 56 | 57 | // Always use read and write no matter following line 58 | //use_read_write = 1; 59 | 60 | 61 | read_request_subnet = 0; 62 | read_reply_subnet = 1; 63 | write_request_subnet = 0; 64 | write_reply_subnet = 1; 65 | 66 | read_request_begin_vc = 0; 67 | read_request_end_vc = 0; 68 | write_request_begin_vc = 0; 69 | write_request_end_vc = 0; 70 | read_reply_begin_vc = 0; 71 | read_reply_end_vc = 0; 72 | write_reply_begin_vc = 0; 73 | write_reply_end_vc = 0; 74 | 75 | -------------------------------------------------------------------------------- /src/accelwattch/mcpatXeonCore.mk: -------------------------------------------------------------------------------- 1 | TARGET = mcpatXeonCore 2 | SHELL = /bin/sh 3 | .PHONY: all depend clean 4 | .SUFFIXES: .cc .o 5 | 6 | ifndef NTHREADS 7 | NTHREADS = 4 8 | endif 9 | 10 | 11 | LIBS = 12 | INCS = -lm 13 | 14 | ifeq ($(TAG),dbg) 15 | DBG = -Wall 16 | OPT = -ggdb -g -O0 -DNTHREADS=1 -Icacti 17 | else 18 | DBG = 19 | OPT = -O3 -msse2 -mfpmath=sse -DNTHREADS=$(NTHREADS) -Icacti 20 | #OPT = -O0 -DNTHREADS=$(NTHREADS) 21 | endif 22 | 23 | #CXXFLAGS = -Wall -Wno-unknown-pragmas -Winline $(DBG) $(OPT) 24 | CXXFLAGS = -Wno-unknown-pragmas $(DBG) $(OPT) 25 | CXX = g++ -m32 26 | CC = gcc -m32 27 | 28 | VPATH = cacti 29 | 30 | SRCS = \ 31 | Ucache.cc \ 32 | XML_Parse.cc \ 33 | arbiter.cc \ 34 | area.cc \ 35 | array.cc \ 36 | bank.cc \ 37 | basic_circuit.cc \ 38 | basic_components.cc \ 39 | cacti_interface.cc \ 40 | component.cc \ 41 | core.cc \ 42 | crossbar.cc \ 43 | decoder.cc \ 44 | htree2.cc \ 45 | interconnect.cc \ 46 | io.cc \ 47 | iocontrollers.cc \ 48 | logic.cc \ 49 | main.cc \ 50 | mat.cc \ 51 | memoryctrl.cc \ 52 | noc.cc \ 53 | nuca.cc \ 54 | parameter.cc \ 55 | processor.cc \ 56 | router.cc \ 57 | sharedcache.cc \ 58 | subarray.cc \ 59 | technology_xeon_core.cc \ 60 | uca.cc \ 61 | wire.cc \ 62 | xmlParser.cc 63 | 64 | OBJS = $(patsubst %.cc,obj_$(TAG)/%.o,$(SRCS)) 65 | 66 | all: obj_$(TAG)/$(TARGET) 67 | cp -f obj_$(TAG)/$(TARGET) $(TARGET) 68 | 69 | obj_$(TAG)/$(TARGET) : $(OBJS) 70 | $(CXX) $(OBJS) -o $@ $(INCS) $(CXXFLAGS) $(LIBS) -pthread 71 | 72 | #obj_$(TAG)/%.o : %.cc 73 | # $(CXX) -c $(CXXFLAGS) $(INCS) -o $@ $< 74 | 75 | obj_$(TAG)/%.o : %.cc 76 | $(CXX) $(CXXFLAGS) -c $< -o $@ 77 | 78 | clean: 79 | -rm -f *.o $(TARGET) 80 | 81 | 82 | -------------------------------------------------------------------------------- /src/accelwattch/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(GPGPUSIM_ACCELWATTCH_NTHREADS "4" CACHE STRING "Accelwattch MCPAT thread count") 2 | add_library(accelwattch STATIC 3 | cacti/Ucache.cc 4 | XML_Parse.cc 5 | cacti/arbiter.cc 6 | cacti/area.cc 7 | array.cc 8 | cacti/bank.cc 9 | cacti/basic_circuit.cc 10 | basic_components.cc 11 | cacti/cacti_interface.cc 12 | cacti/component.cc 13 | core.cc 14 | cacti/crossbar.cc 15 | cacti/decoder.cc 16 | cacti/htree2.cc 17 | interconnect.cc 18 | cacti/io.cc 19 | iocontrollers.cc 20 | logic.cc 21 | main.cc 22 | cacti/mat.cc 23 | memoryctrl.cc 24 | noc.cc 25 | cacti/nuca.cc 26 | cacti/parameter.cc 27 | processor.cc 28 | cacti/router.cc 29 | sharedcache.cc 30 | cacti/subarray.cc 31 | cacti/technology.cc 32 | cacti/uca.cc 33 | cacti/wire.cc 34 | xmlParser.cc 35 | gpgpu_sim_wrapper.cc) 36 | target_include_directories(accelwattch PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) 37 | target_include_directories(accelwattch PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/cacti) 38 | # Compile options 39 | target_compile_options(accelwattch PRIVATE "-Wno-unknown-pragmas") 40 | if($) 41 | target_compile_definitions(NTHREADS=1) 42 | else() 43 | target_compile_options(accelwattch PRIVATE "-msse2;-mfpmath=sse") 44 | target_compile_definitions(accelwattch PRIVATE -DNTHREADS=${GPGPUSIM_ACCELWATTCH_NTHREADS}) 45 | endif() 46 | target_link_options(accelwattch PRIVATE "-lm;-lpthread;-lz") -------------------------------------------------------------------------------- /scripts/gen_ptxinfo: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright (c) 2009-2011, The University of British Columbia 4 | # All rights reserved. 5 | # 6 | # Redistribution and use in source and binary forms, with or without 7 | # modification, are permitted provided that the following conditions are met: 8 | # 9 | # Redistributions of source code must retain the above copyright notice, this 10 | # list of conditions and the following disclaimer. 11 | # Redistributions in binary form must reproduce the above copyright notice, this 12 | # list of conditions and the following disclaimer in the documentation and/or 13 | # other materials provided with the distribution. 14 | # Neither the name of The University of British Columbia nor the names of its 15 | # contributors may be used to endorse or promote products derived from this 16 | # software without specific prior written permission. 17 | # 18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 19 | # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20 | # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | 29 | for i in `ls *.ptx`; do 30 | echo Generating "$i"info... 31 | ptxas -v "$i" 2> "$i"info 32 | done 33 | -------------------------------------------------------------------------------- /src/intersim2/examples/torus88: -------------------------------------------------------------------------------- 1 | // $Id: torus88 5188 2012-08-30 00:31:31Z dub $ 2 | 3 | // Copyright (c) 2007-2012, Trustees of The Leland Stanford Junior University 4 | // All rights reserved. 5 | // 6 | // Redistribution and use in source and binary forms, with or without 7 | // modification, are permitted provided that the following conditions are met: 8 | // 9 | // Redistributions of source code must retain the above copyright notice, this 10 | // list of conditions and the following disclaimer. 11 | // Redistributions in binary form must reproduce the above copyright notice, 12 | // this list of conditions and the following disclaimer in the documentation 13 | // and/or other materials provided with the distribution. 14 | // 15 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | // POSSIBILITY OF SUCH DAMAGE. 26 | 27 | //simple 8X8 torus under injection mode 28 | 29 | 30 | // Topology 31 | topology = torus; 32 | k = 8; 33 | n = 2; 34 | // Routing 35 | routing_function = dim_order; 36 | // Flow control 37 | num_vcs = 2; 38 | // Traffic 39 | traffic = uniform; 40 | injection_rate = 0.15; 41 | -------------------------------------------------------------------------------- /src/intersim2/booksim.hpp: -------------------------------------------------------------------------------- 1 | // $Id: booksim.hpp 5188 2012-08-30 00:31:31Z dub $ 2 | 3 | /* 4 | Copyright (c) 2007-2012, Trustees of The Leland Stanford Junior University 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | Redistributions in binary form must reproduce the above copyright notice, this 13 | list of conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 20 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef _BOOKSIM_HPP_ 29 | #define _BOOKSIM_HPP_ 30 | 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #ifdef _WIN32_ 37 | #pragma warning (disable: 4786) 38 | #include 39 | #endif 40 | 41 | using namespace std; 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /src/accelwattch/cacti/cacti.mk: -------------------------------------------------------------------------------- 1 | 2 | OUTPUT_DIR=$(SIM_OBJ_FILES_DIR)/accelwattch/cacti 3 | TARGET = cacti 4 | SHELL = /bin/sh 5 | .PHONY: all depend clean 6 | .SUFFIXES: .cc .o 7 | 8 | ifndef NTHREADS 9 | NTHREADS = 8 10 | endif 11 | 12 | 13 | LIBS = 14 | INCS = -lm 15 | 16 | ifeq ($(TAG),dbg) 17 | DBG = -Wall 18 | OPT = -ggdb -g -O0 -DNTHREADS=1 -gstabs+ 19 | else 20 | DBG = 21 | OPT = -O3 -msse2 -mfpmath=sse -DNTHREADS=$(NTHREADS) 22 | endif 23 | 24 | #CXXFLAGS = -Wall -Wno-unknown-pragmas -Winline $(DBG) $(OPT) 25 | CXXFLAGS = -Wno-unknown-pragmas $(DBG) $(OPT) 26 | 27 | ifeq ($(shell getconf LONG_BIT),64) 28 | CXX = g++ -m64 29 | CC = gcc -m64 30 | else 31 | CXX = g++ -m32 32 | CC = gcc -m32 33 | endif 34 | 35 | 36 | SRCS = area.cc bank.cc mat.cc main.cc Ucache.cc io.cc technology.cc basic_circuit.cc parameter.cc \ 37 | decoder.cc component.cc uca.cc subarray.cc wire.cc htree2.cc \ 38 | cacti_interface.cc router.cc nuca.cc crossbar.cc arbiter.cc 39 | 40 | OBJS = $(patsubst %.cc,$(OUTPUT_DIR)/%.o,$(SRCS)) 41 | PYTHONLIB_SRCS = $(patsubst main.cc, ,$(SRCS)) $(OUTPUT_DIR)/cacti_wrap.cc 42 | PYTHONLIB_OBJS = $(patsubst %.cc,%.o,$(PYTHONLIB_SRCS)) 43 | INCLUDES = -I /usr/include/python2.4 -I /usr/lib/python2.4/config 44 | 45 | all: $(OUTPUT_DIR)/$(TARGET) 46 | 47 | $(OUTPUT_DIR)/$(TARGET) : $(OBJS) 48 | $(CXX) $(OBJS) -o $@ $(INCS) $(CXXFLAGS) $(LIBS) -pthread 49 | 50 | #obj_$(TAG)/%.o : %.cc 51 | # $(CXX) -c $(CXXFLAGS) $(INCS) -o $@ $< 52 | 53 | $(OUTPUT_DIR)/Makefile.makedepend: depend 54 | 55 | depend: 56 | touch $(OUTPUT_DIR)/Makefile.makedepend 57 | makedepend -f$(OUTPUT_DIR)/Makefile.makedepend -p$(OUTPUT_DIR)/ $(SRCS) 2> /dev/null 58 | 59 | $(OUTPUT_DIR)/%.o : %.cc 60 | $(CXX) $(CXXFLAGS) -c $< -o $@ 61 | 62 | clean: 63 | -rm -f *.o _cacti.so cacti.py $(TARGET) 64 | 65 | include $(OUTPUT_DIR)/Makefile.makedepend 66 | -------------------------------------------------------------------------------- /src/intersim2/allocators/pim.hpp: -------------------------------------------------------------------------------- 1 | // $Id: pim.hpp 5188 2012-08-30 00:31:31Z dub $ 2 | 3 | /* 4 | Copyright (c) 2007-2012, Trustees of The Leland Stanford Junior University 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | Redistributions in binary form must reproduce the above copyright notice, this 13 | list of conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 20 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef _PIM_HPP_ 29 | #define _PIM_HPP_ 30 | 31 | #include 32 | 33 | #include "allocator.hpp" 34 | 35 | class PIM : public DenseAllocator { 36 | int _PIM_iter; 37 | 38 | public: 39 | PIM( Module *parent, const string& name, 40 | int inputs, int outputs, int iters ); 41 | 42 | ~PIM( ); 43 | 44 | void Allocate( ); 45 | }; 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /src/intersim2/misc_utils.cpp: -------------------------------------------------------------------------------- 1 | // $Id: misc_utils.cpp 5188 2012-08-30 00:31:31Z dub $ 2 | 3 | /* 4 | Copyright (c) 2007-2012, Trustees of The Leland Stanford Junior University 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | Redistributions in binary form must reproduce the above copyright notice, this 13 | list of conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 20 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #include "booksim.hpp" 29 | #include "misc_utils.hpp" 30 | 31 | int powi( int x, int y ) // compute x to the y 32 | { 33 | int r = 1; 34 | 35 | for ( int i = 0; i < y; ++i ) { 36 | r *= x; 37 | } 38 | 39 | return r; 40 | } 41 | 42 | int log_two( int x ) 43 | { 44 | int r = 0; 45 | 46 | x >>= 1; 47 | while( x ) { 48 | r++; x >>= 1; 49 | } 50 | 51 | return r; 52 | } 53 | -------------------------------------------------------------------------------- /debug_tools/WatchYourStep/ptxjitplus/inc/timer.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 1993-2013 NVIDIA Corporation. All rights reserved. 3 | * 4 | * Please refer to the NVIDIA end user license agreement (EULA) associated 5 | * with this source code for terms and conditions that govern your use of 6 | * this software. Any use, reproduction, disclosure, or distribution of 7 | * this software and related documentation outside the terms of the EULA 8 | * is strictly prohibited. 9 | * 10 | */ 11 | 12 | #ifndef TIMER_H 13 | #define TIMER_H 14 | 15 | #include 16 | 17 | #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64) 18 | #define WIN32_LEAN_AND_MEAN 19 | #include 20 | #else 21 | #include 22 | #endif 23 | 24 | #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64) 25 | double PCFreq = 0.0; 26 | __int64 timerStart = 0; 27 | #else 28 | struct timeval timerStart; 29 | #endif 30 | 31 | void StartTimer() 32 | { 33 | #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64) 34 | LARGE_INTEGER li; 35 | 36 | if (!QueryPerformanceFrequency(&li)) 37 | { 38 | printf("QueryPerformanceFrequency failed!\n"); 39 | } 40 | 41 | PCFreq = (double)li.QuadPart/1000.0; 42 | QueryPerformanceCounter(&li); 43 | timerStart = li.QuadPart; 44 | #else 45 | gettimeofday(&timerStart, NULL); 46 | #endif 47 | } 48 | 49 | // time elapsed in ms 50 | double GetTimer() 51 | { 52 | #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64) 53 | LARGE_INTEGER li; 54 | QueryPerformanceCounter(&li); 55 | return (double)(li.QuadPart-timerStart)/PCFreq; 56 | #else 57 | struct timeval timerStop, timerElapsed; 58 | gettimeofday(&timerStop, NULL); 59 | timersub(&timerStop, &timerStart, &timerElapsed); 60 | return timerElapsed.tv_sec*1000.0+timerElapsed.tv_usec/1000.0; 61 | #endif 62 | } 63 | #endif // TIMER_H 64 | 65 | -------------------------------------------------------------------------------- /src/intersim2/allocators/loa.hpp: -------------------------------------------------------------------------------- 1 | // $Id: loa.hpp 5188 2012-08-30 00:31:31Z dub $ 2 | 3 | /* 4 | Copyright (c) 2007-2012, Trustees of The Leland Stanford Junior University 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | Redistributions in binary form must reproduce the above copyright notice, this 13 | list of conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 20 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef _LOA_HPP_ 29 | #define _LOA_HPP_ 30 | 31 | #include 32 | 33 | #include "allocator.hpp" 34 | 35 | class LOA : public DenseAllocator { 36 | vector _counts; 37 | vector _req; 38 | 39 | vector _rptr; 40 | vector _gptr; 41 | 42 | public: 43 | LOA( Module *parent, const string& name, 44 | int inputs, int outputs ); 45 | 46 | void Allocate( ); 47 | }; 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /src/intersim2/timed_module.hpp: -------------------------------------------------------------------------------- 1 | // $Id: timed_module.hpp 5188 2012-08-30 00:31:31Z dub $ 2 | 3 | /* 4 | Copyright (c) 2007-2012, Trustees of The Leland Stanford Junior University 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | Redistributions in binary form must reproduce the above copyright notice, this 13 | list of conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 20 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef _TIMED_MODULE_HPP_ 29 | #define _TIMED_MODULE_HPP_ 30 | 31 | #include "module.hpp" 32 | 33 | class TimedModule : public Module { 34 | 35 | public: 36 | TimedModule(Module * parent, string const & name) : Module(parent, name) {} 37 | virtual ~TimedModule() {} 38 | 39 | virtual void ReadInputs() = 0; 40 | virtual void Evaluate() = 0; 41 | virtual void WriteOutputs() = 0; 42 | }; 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /src/intersim2/allocators/islip.hpp: -------------------------------------------------------------------------------- 1 | // $Id: islip.hpp 5188 2012-08-30 00:31:31Z dub $ 2 | 3 | /* 4 | Copyright (c) 2007-2012, Trustees of The Leland Stanford Junior University 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | Redistributions in binary form must reproduce the above copyright notice, this 13 | list of conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 20 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef _ISLIP_HPP_ 29 | #define _ISLIP_HPP_ 30 | 31 | #include 32 | 33 | #include "allocator.hpp" 34 | 35 | class iSLIP_Sparse : public SparseAllocator { 36 | int _iSLIP_iter; 37 | 38 | vector _gptrs; 39 | vector _aptrs; 40 | 41 | public: 42 | iSLIP_Sparse( Module *parent, const string& name, 43 | int inputs, int outputs, int iters ); 44 | 45 | void Allocate( ); 46 | }; 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /src/intersim2/examples/cmeshconfig: -------------------------------------------------------------------------------- 1 | // $Id: cmeshconfig 5188 2012-08-30 00:31:31Z dub $ 2 | 3 | // Copyright (c) 2007-2012, Trustees of The Leland Stanford Junior University 4 | // All rights reserved. 5 | // 6 | // Redistribution and use in source and binary forms, with or without 7 | // modification, are permitted provided that the following conditions are met: 8 | // 9 | // Redistributions of source code must retain the above copyright notice, this 10 | // list of conditions and the following disclaimer. 11 | // Redistributions in binary form must reproduce the above copyright notice, 12 | // this list of conditions and the following disclaimer in the documentation 13 | // and/or other materials provided with the distribution. 14 | // 15 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | // POSSIBILITY OF SUCH DAMAGE. 26 | 27 | //concentrated mesh configuration file running batch mode 28 | //xr, yr, x, y, are use to indicate how the concnetration is formed. 29 | 30 | topology = cmesh; 31 | 32 | k = 4; 33 | n = 2; 34 | c = 4; 35 | xr = 2; 36 | yr = 2; 37 | 38 | x = 4; 39 | y = 4; 40 | 41 | routing_function = dor_no_express; 42 | 43 | traffic = bitcomp; 44 | 45 | use_read_write = 0; 46 | 47 | batch_size = 2000; 48 | -------------------------------------------------------------------------------- /debug_tools/WatchYourStep/ptxjitplus/inc/dynlink/cuda_drvapi_dynlink_gl.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 1993-2013 NVIDIA Corporation. All rights reserved. 3 | * 4 | * Please refer to the NVIDIA end user license agreement (EULA) associated 5 | * with this source code for terms and conditions that govern your use of 6 | * this software. Any use, reproduction, disclosure, or distribution of 7 | * this software and related documentation outside the terms of the EULA 8 | * is strictly prohibited. 9 | * 10 | */ 11 | 12 | #ifndef __cuda_drvapi_dynlink_cuda_gl_h__ 13 | #define __cuda_drvapi_dynlink_cuda_gl_h__ 14 | 15 | #ifdef CUDA_INIT_OPENGL 16 | 17 | #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64) 18 | # define WINDOWS_LEAN_AND_MEAN 19 | # define NOMINMAX 20 | # include 21 | #endif 22 | 23 | // includes, system 24 | #include 25 | #include 26 | #include 27 | #include 28 | 29 | // includes, GL 30 | #include 31 | 32 | #if defined (__APPLE__) || defined(MACOSX) 33 | #include 34 | #else 35 | #include 36 | #endif 37 | 38 | /************************************ 39 | ** 40 | ** OpenGL Graphics/Interop 41 | ** 42 | ***********************************/ 43 | 44 | // OpenGL/CUDA interop (CUDA 2.0+) 45 | typedef CUresult CUDAAPI tcuGLCtxCreate(CUcontext *pCtx, unsigned int Flags, CUdevice device); 46 | typedef CUresult CUDAAPI tcuGraphicsGLRegisterBuffer(CUgraphicsResource *pCudaResource, GLuint buffer, unsigned int Flags); 47 | typedef CUresult CUDAAPI tcuGraphicsGLRegisterImage(CUgraphicsResource *pCudaResource, GLuint image, GLenum target, unsigned int Flags); 48 | 49 | #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64) 50 | #include 51 | // WIN32 52 | typedef CUresult CUDAAPI tcuWGLGetDevice(CUdevice *pDevice, HGPUNV hGpu); 53 | #endif 54 | 55 | #endif // CUDA_INIT_OPENGL 56 | 57 | #endif // __cuda_drvapi_dynlink_cuda_gl_h__ 58 | 59 | -------------------------------------------------------------------------------- /src/gpgpu-sim/traffic_breakdown.cc: -------------------------------------------------------------------------------- 1 | #include "traffic_breakdown.h" 2 | #include "mem_fetch.h" 3 | 4 | void traffic_breakdown::print(FILE* fout) { 5 | for (traffic_stat_t::const_iterator i_stat = m_stats.begin(); 6 | i_stat != m_stats.end(); i_stat++) { 7 | unsigned int byte_transferred = 0; 8 | for (traffic_class_t::const_iterator i_class = i_stat->second.begin(); 9 | i_class != i_stat->second.end(); i_class++) { 10 | byte_transferred += 11 | i_class->first * i_class->second; // byte/packet x #packets 12 | } 13 | fprintf(fout, "traffic_breakdown_%s[%s] = %u {", m_network_name.c_str(), 14 | i_stat->first.c_str(), byte_transferred); 15 | for (traffic_class_t::const_iterator i_class = i_stat->second.begin(); 16 | i_class != i_stat->second.end(); i_class++) { 17 | fprintf(fout, "%u:%u,", i_class->first, i_class->second); 18 | } 19 | fprintf(fout, "}\n"); 20 | } 21 | } 22 | 23 | void traffic_breakdown::record_traffic(class mem_fetch* mf, unsigned int size) { 24 | m_stats[classify_memfetch(mf)][size] += 1; 25 | } 26 | 27 | std::string traffic_breakdown::classify_memfetch(class mem_fetch* mf) { 28 | std::string traffic_name; 29 | 30 | enum mem_access_type access_type = mf->get_access_type(); 31 | 32 | switch (access_type) { 33 | case CONST_ACC_R: 34 | case TEXTURE_ACC_R: 35 | case GLOBAL_ACC_W: 36 | case LOCAL_ACC_R: 37 | case LOCAL_ACC_W: 38 | case INST_ACC_R: 39 | case L1_WRBK_ACC: 40 | case L2_WRBK_ACC: 41 | case L1_WR_ALLOC_R: 42 | case L2_WR_ALLOC_R: 43 | traffic_name = mem_access_type_str(access_type); 44 | break; 45 | case GLOBAL_ACC_R: 46 | // check for global atomic operation 47 | traffic_name = (mf->isatomic()) ? "GLOBAL_ATOMIC" 48 | : mem_access_type_str(GLOBAL_ACC_R); 49 | break; 50 | default: 51 | assert(0 && "Unknown traffic type"); 52 | } 53 | return traffic_name; 54 | } 55 | -------------------------------------------------------------------------------- /src/intersim2/intersim_config.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2013, Tor M. Aamodt, Dongdong Li, Ali Bakhoda 2 | // The University of British Columbia 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // 8 | // Redistributions of source code must retain the above copyright notice, this 9 | // list of conditions and the following disclaimer. 10 | // Redistributions in binary form must reproduce the above copyright notice, this 11 | // list of conditions and the following disclaimer in the documentation and/or 12 | // other materials provided with the distribution. 13 | // Neither the name of The University of British Columbia nor the names of its 14 | // contributors may be used to endorse or promote products derived from this 15 | // software without specific prior written permission. 16 | // 17 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 18 | // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 | // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 21 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 23 | // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 24 | // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 25 | // OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | 28 | #ifndef _INTERSIM_CONFIG_HPP_ 29 | #define _INTERSIM_CONFIG_HPP_ 30 | 31 | #include "config_utils.hpp" 32 | #include "booksim_config.hpp" 33 | 34 | class IntersimConfig : public BookSimConfig { 35 | public: 36 | IntersimConfig(); 37 | }; 38 | 39 | #endif -------------------------------------------------------------------------------- /src/intersim2/booksim_config.hpp: -------------------------------------------------------------------------------- 1 | // $Id: booksim_config.hpp 5487 2013-02-27 08:16:18Z qtedq $ 2 | 3 | /* 4 | Copyright (c) 2007-2012, Trustees of The Leland Stanford Junior University 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | Redistributions in binary form must reproduce the above copyright notice, this 13 | list of conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 20 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef _BOOKSIM_CONFIG_HPP_ 29 | #define _BOOKSIM_CONFIG_HPP_ 30 | 31 | #include "config_utils.hpp" 32 | 33 | class BookSimConfig : public Configuration { 34 | protected: 35 | 36 | public: 37 | BookSimConfig( ); 38 | }; 39 | 40 | #endif 41 | 42 | #ifndef _POWER_CONFIG_HPP_ 43 | #define _POWER_CONFIG_HPP_ 44 | 45 | #include "config_utils.hpp" 46 | 47 | class PowerConfig : public Configuration { 48 | public: 49 | PowerConfig( ); 50 | 51 | }; 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /src/cuda-sim/cuda_device_printf.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2011, Tor M. Aamodt 2 | // The University of British Columbia 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // 8 | // Redistributions of source code must retain the above copyright notice, this 9 | // list of conditions and the following disclaimer. 10 | // Redistributions in binary form must reproduce the above copyright notice, 11 | // this list of conditions and the following disclaimer in the documentation 12 | // and/or other materials provided with the distribution. Neither the name of 13 | // The University of British Columbia nor the names of its contributors may be 14 | // used to endorse or promote products derived from this software without 15 | // specific prior written permission. 16 | // 17 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 21 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 | // POSSIBILITY OF SUCH DAMAGE. 28 | 29 | #ifndef CUDA_DEVICE_PRINTF_INCLUDED 30 | #define CUDA_DEVICE_PRINTF_INCLUDED 31 | 32 | void gpgpusim_cuda_vprintf(const class ptx_instruction* pI, 33 | class ptx_thread_info* thread, 34 | const class function_info* target_func); 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /src/trace_streams.tup: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009 by Tor M. Aamodt, Tim Rogers and 2 | // The University of British Columbia 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // 8 | // Redistributions of source code must retain the above copyright notice, this 9 | // list of conditions and the following disclaimer. 10 | // Redistributions in binary form must reproduce the above copyright notice, this 11 | // list of conditions and the following disclaimer in the documentation and/or 12 | // other materials provided with the distribution. 13 | // Neither the name of The University of British Columbia nor the names of its 14 | // contributors may be used to endorse or promote products derived from this 15 | // software without specific prior written permission. 16 | // 17 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 18 | // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 | // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 21 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 23 | // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 24 | // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 25 | // OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | 28 | TS_TUP_BEGIN( trace_streams_type ) 29 | TS_TUP( WARP_SCHEDULER ), 30 | TS_TUP( SCOREBOARD ), 31 | TS_TUP( MEMORY_PARTITION_UNIT ), 32 | TS_TUP( MEMORY_SUBPARTITION_UNIT ), 33 | TS_TUP( INTERCONNECT ), 34 | TS_TUP( LIVENESS ), 35 | TS_TUP( NUM_TRACE_STREAMS ) 36 | TS_TUP_END( trace_streams_type ) 37 | -------------------------------------------------------------------------------- /src/intersim2/credit.hpp: -------------------------------------------------------------------------------- 1 | // $Id: credit.hpp 5188 2012-08-30 00:31:31Z dub $ 2 | 3 | /* 4 | Copyright (c) 2007-2012, Trustees of The Leland Stanford Junior University 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | Redistributions in binary form must reproduce the above copyright notice, this 13 | list of conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 20 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef _CREDIT_HPP_ 29 | #define _CREDIT_HPP_ 30 | 31 | #include 32 | #include 33 | 34 | class Credit { 35 | 36 | public: 37 | 38 | set vc; 39 | 40 | // these are only used by the event router 41 | bool head, tail; 42 | int id; 43 | 44 | void Reset(); 45 | 46 | static Credit * New(); 47 | void Free(); 48 | static void FreeAll(); 49 | static int OutStanding(); 50 | private: 51 | 52 | static stack _all; 53 | static stack _free; 54 | 55 | Credit(); 56 | ~Credit() {} 57 | 58 | }; 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /src/intersim2/globals.hpp: -------------------------------------------------------------------------------- 1 | // $Id: globals.hpp 5188 2012-08-30 00:31:31Z dub $ 2 | 3 | /* 4 | Copyright (c) 2007-2012, Trustees of The Leland Stanford Junior University 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | Redistributions in binary form must reproduce the above copyright notice, this 13 | list of conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 20 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef _GLOBALS_HPP_ 29 | #define _GLOBALS_HPP_ 30 | #include 31 | #include 32 | #include 33 | 34 | /*all declared in main.cpp*/ 35 | 36 | int GetSimTime(); 37 | 38 | class Stats; 39 | Stats * GetStats(const std::string & name); 40 | 41 | class InterconnectInterface; 42 | extern InterconnectInterface *g_icnt_interface; 43 | 44 | extern bool gPrintActivity; 45 | 46 | extern int gK; 47 | extern int gN; 48 | extern int gC; 49 | 50 | extern int gNodes; 51 | 52 | extern bool gTrace; 53 | 54 | extern std::ostream * gWatchOut; 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /src/intersim2/examples/singleconfig: -------------------------------------------------------------------------------- 1 | // $Id: singleconfig 5188 2012-08-30 00:31:31Z dub $ 2 | 3 | // Copyright (c) 2007-2012, Trustees of The Leland Stanford Junior University 4 | // All rights reserved. 5 | // 6 | // Redistribution and use in source and binary forms, with or without 7 | // modification, are permitted provided that the following conditions are met: 8 | // 9 | // Redistributions of source code must retain the above copyright notice, this 10 | // list of conditions and the following disclaimer. 11 | // Redistributions in binary form must reproduce the above copyright notice, 12 | // this list of conditions and the following disclaimer in the documentation 13 | // and/or other materials provided with the distribution. 14 | // 15 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | // POSSIBILITY OF SUCH DAMAGE. 26 | 27 | //A single cross 10X10 cross bar under injection mode 28 | 29 | topology = fly; 30 | 31 | k = 10; 32 | n = 1; 33 | 34 | num_vcs = 8; 35 | 36 | vc_buf_size = 8; 37 | 38 | vc_allocator = separable_input_first; 39 | sw_allocator = separable_input_first; 40 | 41 | routing_function = dest_tag; 42 | 43 | traffic = uniform; 44 | 45 | use_read_write = 0; 46 | 47 | injection_rate = 1.0; 48 | 49 | 50 | 51 | 52 | sample_period = 100000; 53 | 54 | routing_delay = 0; 55 | vc_alloc_delay = 1; 56 | sw_alloc_delay = 1; 57 | st_final_delay = 1; 58 | -------------------------------------------------------------------------------- /src/intersim2/allocators/selalloc.hpp: -------------------------------------------------------------------------------- 1 | // $Id: selalloc.hpp 5188 2012-08-30 00:31:31Z dub $ 2 | 3 | /* 4 | Copyright (c) 2007-2012, Trustees of The Leland Stanford Junior University 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | Redistributions in binary form must reproduce the above copyright notice, this 13 | list of conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 20 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef _SELALLOC_HPP_ 29 | #define _SELALLOC_HPP_ 30 | 31 | #include 32 | 33 | #include "allocator.hpp" 34 | 35 | class SelAlloc : public SparseAllocator { 36 | int _iter; 37 | 38 | vector _aptrs; 39 | vector _gptrs; 40 | 41 | vector _outmask; 42 | 43 | public: 44 | SelAlloc( Module *parent, const string& name, 45 | int inputs, int outputs, int iters ); 46 | 47 | void Allocate( ); 48 | 49 | void MaskOutput( int out, int mask = 1 ); 50 | 51 | virtual void PrintRequests( ostream * os = NULL ) const; 52 | 53 | }; 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /src/intersim2/packet_reply_info.hpp: -------------------------------------------------------------------------------- 1 | // $Id: packet_reply_info.hpp 5188 2012-08-30 00:31:31Z dub $ 2 | 3 | /* 4 | Copyright (c) 2007-2012, Trustees of The Leland Stanford Junior University 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | Redistributions in binary form must reproduce the above copyright notice, this 13 | list of conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 20 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef _PACKET_REPLY_INFO_HPP_ 29 | #define _PACKET_REPLY_INFO_HPP_ 30 | 31 | #include 32 | 33 | #include "flit.hpp" 34 | 35 | //register the requests to a node 36 | class PacketReplyInfo { 37 | 38 | public: 39 | int source; 40 | int time; 41 | bool record; 42 | Flit::FlitType type; 43 | 44 | static PacketReplyInfo* New(); 45 | void Free(); 46 | static void FreeAll(); 47 | 48 | private: 49 | 50 | static stack _all; 51 | static stack _free; 52 | 53 | PacketReplyInfo() {} 54 | ~PacketReplyInfo() {} 55 | }; 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /src/intersim2/allocators/maxsize.hpp: -------------------------------------------------------------------------------- 1 | // $Id: maxsize.hpp 5188 2012-08-30 00:31:31Z dub $ 2 | 3 | /* 4 | Copyright (c) 2007-2012, Trustees of The Leland Stanford Junior University 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | Redistributions in binary form must reproduce the above copyright notice, this 13 | list of conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 20 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef _MAXSIZE_HPP_ 29 | #define _MAXSIZE_HPP_ 30 | 31 | #include 32 | 33 | #include "allocator.hpp" 34 | 35 | class MaxSizeMatch : public DenseAllocator { 36 | vector _from; // array to hold breadth-first tree 37 | int *_s; // stack of leaf nodes in tree 38 | int *_ns; // next stack 39 | int _prio; // priority pointer to ensure fairness 40 | 41 | bool _ShortestAugmenting( ); 42 | 43 | public: 44 | MaxSizeMatch( Module *parent, const string& name, 45 | int inputs, int ouputs ); 46 | ~MaxSizeMatch( ); 47 | 48 | void Allocate( ); 49 | }; 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /src/gpgpu-sim/visualizer.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2011, Tor M. Aamodt, Wilson W.L. Fung, 2 | // The University of British Columbia 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // 8 | // Redistributions of source code must retain the above copyright notice, this 9 | // list of conditions and the following disclaimer. 10 | // Redistributions in binary form must reproduce the above copyright notice, 11 | // this list of conditions and the following disclaimer in the documentation 12 | // and/or other materials provided with the distribution. Neither the name of 13 | // The University of British Columbia nor the names of its contributors may be 14 | // used to endorse or promote products derived from this software without 15 | // specific prior written permission. 16 | // 17 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 21 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 | // POSSIBILITY OF SUCH DAMAGE. 28 | 29 | #ifndef VISUALIZER_H_INCLUDED 30 | #define VISUALIZER_H_INCLUDED 31 | 32 | #include 33 | #include 34 | 35 | void time_vector_create(int size); 36 | void time_vector_print(void); 37 | void time_vector_update(unsigned int uid, int slot, long int cycle, int type); 38 | void check_time_vector_update(unsigned int uid, int slot, long int latency, 39 | int type); 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /src/intersim2/networks/fly.hpp: -------------------------------------------------------------------------------- 1 | // $Id: fly.hpp 5188 2012-08-30 00:31:31Z dub $ 2 | 3 | /* 4 | Copyright (c) 2007-2012, Trustees of The Leland Stanford Junior University 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | Redistributions in binary form must reproduce the above copyright notice, this 13 | list of conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 20 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef _FLY_HPP_ 29 | #define _FLY_HPP_ 30 | 31 | #include "network.hpp" 32 | 33 | class KNFly : public Network { 34 | 35 | int _k; 36 | int _n; 37 | 38 | void _ComputeSize( const Configuration &config ); 39 | void _BuildNet( const Configuration &config ); 40 | 41 | int _OutChannel( int stage, int addr, int port ) const; 42 | int _InChannel( int stage, int addr, int port ) const; 43 | 44 | public: 45 | KNFly( const Configuration &config, const string & name ); 46 | 47 | int GetN( ) const; 48 | int GetK( ) const; 49 | static void RegisterRoutingFunctions(){}; 50 | double Capacity( ) const; 51 | }; 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /src/accelwattch/version.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * McPAT 3 | * SOFTWARE LICENSE AGREEMENT 4 | * Copyright 2012 Hewlett-Packard Development Company, L.P. 5 | * All Rights Reserved 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions are 9 | * met: redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer; 11 | * redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution; 14 | * neither the name of the copyright holders nor the names of its 15 | * contributors may be used to endorse or promote products derived from 16 | * this software without specific prior written permission. 17 | 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.” 29 | * 30 | ***************************************************************************/ 31 | 32 | #ifndef VERSION_H_ 33 | #define VERSION_H_ 34 | 35 | #define VER_MAJOR 0 /* beta release */ 36 | #define VER_MINOR 8 37 | 38 | #define VER_UPDATE "Aug, 2010" 39 | 40 | #endif /* VERSION_H_ */ 41 | -------------------------------------------------------------------------------- /src/intersim2/packet_reply_info.cpp: -------------------------------------------------------------------------------- 1 | // $Id: packet_reply_info.cpp 5188 2012-08-30 00:31:31Z dub $ 2 | 3 | /* 4 | Copyright (c) 2007-2012, Trustees of The Leland Stanford Junior University 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | Redistributions in binary form must reproduce the above copyright notice, this 13 | list of conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 20 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #include "packet_reply_info.hpp" 29 | 30 | stack PacketReplyInfo::_all; 31 | stack PacketReplyInfo::_free; 32 | 33 | PacketReplyInfo * PacketReplyInfo::New() 34 | { 35 | PacketReplyInfo * pr; 36 | if(_free.empty()) { 37 | pr = new PacketReplyInfo(); 38 | _all.push(pr); 39 | } else { 40 | pr = _free.top(); 41 | _free.pop(); 42 | } 43 | return pr; 44 | } 45 | 46 | void PacketReplyInfo::Free() 47 | { 48 | _free.push(this); 49 | } 50 | 51 | void PacketReplyInfo::FreeAll() 52 | { 53 | while(!_all.empty()) { 54 | delete _all.top(); 55 | _all.pop(); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/gpgpu-sim/gpu-misc.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2011, Tor M. Aamodt, George L. Yuan, Andrew Turner, 2 | // Ali Bakhoda 3 | // The University of British Columbia 4 | // All rights reserved. 5 | // 6 | // Redistribution and use in source and binary forms, with or without 7 | // modification, are permitted provided that the following conditions are met: 8 | // 9 | // Redistributions of source code must retain the above copyright notice, this 10 | // list of conditions and the following disclaimer. 11 | // Redistributions in binary form must reproduce the above copyright notice, 12 | // this list of conditions and the following disclaimer in the documentation 13 | // and/or other materials provided with the distribution. Neither the name of 14 | // The University of British Columbia nor the names of its contributors may be 15 | // used to endorse or promote products derived from this software without 16 | // specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | // POSSIBILITY OF SUCH DAMAGE. 29 | 30 | #ifndef GPU_MISC_H 31 | #define GPU_MISC_H 32 | 33 | // enables a verbose printout of all L1 cache misses and all MSHR status changes 34 | // good for a single shader configuration 35 | #define DEBUGL1MISS 0 36 | 37 | unsigned int LOGB2(unsigned int v); 38 | 39 | #define gs_min2(a, b) (((a) < (b)) ? (a) : (b)) 40 | #define min3(x, y, z) (((x) < (y) && (x) < (z)) ? (x) : (gs_min2((y), (z)))) 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /src/intersim2/routefunc.hpp: -------------------------------------------------------------------------------- 1 | // $Id: routefunc.hpp 5188 2012-08-30 00:31:31Z dub $ 2 | 3 | /* 4 | Copyright (c) 2007-2012, Trustees of The Leland Stanford Junior University 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | Redistributions in binary form must reproduce the above copyright notice, this 13 | list of conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 20 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef _ROUTEFUNC_HPP_ 29 | #define _ROUTEFUNC_HPP_ 30 | 31 | #include "flit.hpp" 32 | #include "router.hpp" 33 | #include "outputset.hpp" 34 | #include "config_utils.hpp" 35 | 36 | typedef void (*tRoutingFunction)( const Router *, const Flit *, int in_channel, OutputSet *, bool ); 37 | 38 | void InitializeRoutingMap( const Configuration & config ); 39 | 40 | extern map gRoutingFunctionMap; 41 | 42 | extern int gNumVCs; 43 | extern int gReadReqBeginVC, gReadReqEndVC; 44 | extern int gWriteReqBeginVC, gWriteReqEndVC; 45 | extern int gReadReplyBeginVC, gReadReplyEndVC; 46 | extern int gWriteReplyBeginVC, gWriteReplyEndVC; 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /src/accelwattch/globalvar.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * McPAT 3 | * SOFTWARE LICENSE AGREEMENT 4 | * Copyright 2012 Hewlett-Packard Development Company, L.P. 5 | * All Rights Reserved 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions are 9 | * met: redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer; 11 | * redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution; 14 | * neither the name of the copyright holders nor the names of its 15 | * contributors may be used to endorse or promote products derived from 16 | * this software without specific prior written permission. 17 | 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.” 29 | * 30 | ***************************************************************************/ 31 | 32 | #ifndef GLOBALVAR_H_ 33 | #define GLOBALVAR_H_ 34 | 35 | #ifdef GLOBALVAR 36 | #define EXTERN 37 | #else 38 | #define EXTERN extern 39 | #endif 40 | 41 | EXTERN bool opt_for_clk; 42 | 43 | #endif /* GLOBALVAR_H_ */ 44 | -------------------------------------------------------------------------------- /src/intersim2/allocators/wavefront.hpp: -------------------------------------------------------------------------------- 1 | // $Id: wavefront.hpp 5188 2012-08-30 00:31:31Z dub $ 2 | 3 | /* 4 | Copyright (c) 2007-2012, Trustees of The Leland Stanford Junior University 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | Redistributions in binary form must reproduce the above copyright notice, this 13 | list of conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 20 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef _WAVEFRONT_HPP_ 29 | #define _WAVEFRONT_HPP_ 30 | 31 | #include 32 | 33 | #include "allocator.hpp" 34 | 35 | class Wavefront : public DenseAllocator { 36 | 37 | private: 38 | int _last_in; 39 | int _last_out; 40 | set > _priorities; 41 | bool _skip_diags; 42 | 43 | protected: 44 | int _square; 45 | int _pri; 46 | int _num_requests; 47 | 48 | public: 49 | Wavefront( Module *parent, const string& name, 50 | int inputs, int outputs, bool skip_diags = false ); 51 | 52 | virtual void AddRequest( int in, int out, int label = 1, 53 | int in_pri = 0, int out_pri = 0 ); 54 | virtual void Allocate( ); 55 | }; 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /gpgpusim_gen_setup_environment.cmake: -------------------------------------------------------------------------------- 1 | # Need to create a setup script to set some variables for others to interact with 2 | set(SETUP_SCRIPT_FILENAME "setup") 3 | message(STATUS "Writing setup commands to '${SETUP_SCRIPT_FILENAME}'") 4 | file(WRITE ${SETUP_SCRIPT_FILENAME} "export GPGPUSIM_SETUP_ENVIRONMENT_WAS_RUN=1\n") 5 | file(APPEND ${SETUP_SCRIPT_FILENAME} "export GPGPUSIM_ROOT=${PROJECT_SOURCE_DIR}\n") 6 | file(APPEND ${SETUP_SCRIPT_FILENAME} "export GPGPUSIM_CONFIG=${GPGPUSIM_CONFIG}\n") 7 | file(APPEND ${SETUP_SCRIPT_FILENAME} "export CUDA_INSTALL_PATH=${CUDAToolkit_TARGET_DIR}\n") 8 | file(APPEND ${SETUP_SCRIPT_FILENAME} "export PATH=`echo $PATH | sed 's#$GPGPUSIM_ROOT/bin:$CUDA_INSTALL_PATH/bin:##'`\n") 9 | file(APPEND ${SETUP_SCRIPT_FILENAME} "export PATH=$GPGPUSIM_ROOT/bin:$CUDA_INSTALL_PATH/bin:$PATH\n") 10 | file(APPEND ${SETUP_SCRIPT_FILENAME} "export CUDA_VERSION_NUMBER=${CUDA_VERSION_NUMBER}\n") 11 | if(CUDA_VERSION_NUMBER GREATER_EQUAL 6000) 12 | file(APPEND ${SETUP_SCRIPT_FILENAME} "export PTX_SIM_USE_PTX_FILE=1.ptx\n") 13 | file(APPEND ${SETUP_SCRIPT_FILENAME} "export PTX_SIM_KERNELFILE=_1.ptx\n") 14 | file(APPEND ${SETUP_SCRIPT_FILENAME} "export CUOBJDUMP_SIM_FILE=jj\n") 15 | endif() 16 | # TODO What about OpenCL support? 17 | 18 | # setting LD_LIBRARY_PATH as follows enables GPGPU-Sim to be invoked by 19 | # native CUDA and OpenCL applications. GPGPU-Sim is dynamically linked 20 | # against instead of the CUDA toolkit. This replaces this cumbersome 21 | # static link setup in prior GPGPU-Sim releases. 22 | # Create a softlink for backward support 23 | if(APPLE) 24 | file(APPEND ${SETUP_SCRIPT_FILENAME} "export DYLD_LIBRARY_PATH=`echo $DYLD_LIBRARY_PATH | sed -Ee 's#'$GPGPUSIM_ROOT'\/lib\/[0-9]+\/(debug|release):##'`\n") 25 | file(APPEND ${SETUP_SCRIPT_FILENAME} "export DYLD_LIBRARY_PATH=$GPGPUSIM_ROOT/lib/$GPGPUSIM_CONFIG:$DYLD_LIBRARY_PATH\n") 26 | else() 27 | file(APPEND ${SETUP_SCRIPT_FILENAME} "export LD_LIBRARY_PATH=`echo $LD_LIBRARY_PATH | sed -re 's#'$GPGPUSIM_ROOT'\/lib\/[0-9]+\/(debug|release):##'`\n") 28 | file(APPEND ${SETUP_SCRIPT_FILENAME} "export LD_LIBRARY_PATH=$GPGPUSIM_ROOT/lib/$GPGPUSIM_CONFIG:$LD_LIBRARY_PATH\n") 29 | endif() 30 | 31 | # TODO ignore the OPENCL_REMOTE_GPU_HOST part? -------------------------------------------------------------------------------- /debug_tools/WatchYourStep/ptxjitplus/ptxjitplus.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1993-2015 NVIDIA Corporation. All rights reserved. 3 | * 4 | * Please refer to the NVIDIA end user license agreement (EULA) associated 5 | * with this source code for terms and conditions that govern your use of 6 | * this software. Any use, reproduction, disclosure, or distribution of 7 | * this software and related documentation outside the terms of the EULA 8 | * is strictly prohibited. 9 | * 10 | */ 11 | 12 | #ifndef _PTXJIT_H_ 13 | #define _PTXJIT_H_ 14 | 15 | struct param{ 16 | bool isPointer; 17 | size_t size; 18 | unsigned char *data; 19 | unsigned offset; 20 | }; 21 | 22 | /* 23 | * PTX is equivalent to the following kernel: 24 | * 25 | * __global__ void myKernel(int *data) 26 | * { 27 | * int tid = blockIdx.x * blockDim.x + threadIdx.x; 28 | * data[tid] = tid; 29 | * } 30 | * 31 | */ 32 | 33 | char myPtx64[] = "\n\ 34 | .version 3.2\n\ 35 | .target sm_20\n\ 36 | .address_size 64\n\ 37 | .visible .entry _Z8myKernelPi(\n\ 38 | .param .u64 _Z8myKernelPi_param_0\n\ 39 | )\n\ 40 | {\n\ 41 | .reg .s32 %r<5>;\n\ 42 | .reg .s64 %rd<5>;\n\ 43 | ld.param.u64 %rd1, [_Z8myKernelPi_param_0];\n\ 44 | cvta.to.global.u64 %rd2, %rd1;\n\ 45 | .loc 1 3 1\n\ 46 | mov.u32 %r1, %ntid.x;\n\ 47 | mov.u32 %r2, %ctaid.x;\n\ 48 | mov.u32 %r3, %tid.x;\n\ 49 | mad.lo.s32 %r4, %r1, %r2, %r3;\n\ 50 | mul.wide.s32 %rd3, %r4, 4;\n\ 51 | add.s64 %rd4, %rd2, %rd3;\n\ 52 | .loc 1 4 1\n\ 53 | st.global.u32 [%rd4], %r4;\n\ 54 | .loc 1 5 2\n\ 55 | ret;\n\ 56 | }\n\ 57 | "; 58 | 59 | char myPtx32[] = "\n\ 60 | .version 3.2\n\ 61 | .target sm_20\n\ 62 | .address_size 32\n\ 63 | .visible .entry _Z8myKernelPi(\n\ 64 | .param .u32 _Z8myKernelPi_param_0\n\ 65 | )\n\ 66 | {\n\ 67 | .reg .s32 %r<9>;\n\ 68 | ld.param.u32 %r1, [_Z8myKernelPi_param_0];\n\ 69 | cvta.to.global.u32 %r2, %r1;\n\ 70 | .loc 1 3 1\n\ 71 | mov.u32 %r3, %ntid.x;\n\ 72 | mov.u32 %r4, %ctaid.x;\n\ 73 | mov.u32 %r5, %tid.x;\n\ 74 | mad.lo.s32 %r6, %r3, %r4, %r5;\n\ 75 | .loc 1 4 1\n\ 76 | shl.b32 %r7, %r6, 2;\n\ 77 | add.s32 %r8, %r2, %r7;\n\ 78 | st.global.u32 [%r8], %r6;\n\ 79 | .loc 1 5 2\n\ 80 | ret;\n\ 81 | }\n\ 82 | "; 83 | 84 | #endif 85 | -------------------------------------------------------------------------------- /src/accelwattch/cacti/io.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * McPAT/CACTI 3 | * SOFTWARE LICENSE AGREEMENT 4 | * Copyright 2012 Hewlett-Packard Development Company, L.P. 5 | * All Rights Reserved 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions are 9 | * met: redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer; 11 | * redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution; 14 | * neither the name of the copyright holders nor the names of its 15 | * contributors may be used to endorse or promote products derived from 16 | * this software without specific prior written permission. 17 | 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.” 29 | * 30 | ***************************************************************************/ 31 | 32 | 33 | #ifndef __IO_H__ 34 | #define __IO_H__ 35 | 36 | 37 | #include "const.h" 38 | #include "cacti_interface.h" 39 | 40 | 41 | void output_data_csv(const uca_org_t & fin_res); 42 | void output_UCA(uca_org_t * fin_res); 43 | 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /src/intersim2/allocators/separable_output_first.hpp: -------------------------------------------------------------------------------- 1 | // $Id: separable_output_first.hpp 5188 2012-08-30 00:31:31Z dub $ 2 | 3 | /* 4 | Copyright (c) 2007-2012, Trustees of The Leland Stanford Junior University 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | Redistributions in binary form must reproduce the above copyright notice, this 13 | list of conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 20 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | // ---------------------------------------------------------------------- 29 | // 30 | // SeparableOutputFirstAllocator: Separable Output-First Allocator 31 | // 32 | // ---------------------------------------------------------------------- 33 | 34 | #ifndef _SEPARABLE_OUTPUT_FIRST_HPP_ 35 | #define _SEPARABLE_OUTPUT_FIRST_HPP_ 36 | 37 | #include "separable.hpp" 38 | 39 | class SeparableOutputFirstAllocator : public SeparableAllocator { 40 | 41 | public: 42 | 43 | SeparableOutputFirstAllocator( Module* parent, const string& name, int inputs, 44 | int outputs, const string& arb_type ) ; 45 | 46 | virtual void Allocate() ; 47 | 48 | } ; 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /src/intersim2/allocators/separable_input_first.hpp: -------------------------------------------------------------------------------- 1 | // $Id: separable_input_first.hpp 5188 2012-08-30 00:31:31Z dub $ 2 | 3 | /* 4 | Copyright (c) 2007-2012, Trustees of The Leland Stanford Junior University 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | Redistributions in binary form must reproduce the above copyright notice, this 13 | list of conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 20 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | // ---------------------------------------------------------------------- 29 | // 30 | // SeparableInputFirstAllocator: Separable Input-First Allocator 31 | // 32 | // ---------------------------------------------------------------------- 33 | 34 | #ifndef _SEPARABLE_INPUT_FIRST_HPP_ 35 | #define _SEPARABLE_INPUT_FIRST_HPP_ 36 | 37 | #include 38 | 39 | #include "separable.hpp" 40 | 41 | class SeparableInputFirstAllocator : public SeparableAllocator { 42 | 43 | public: 44 | 45 | SeparableInputFirstAllocator( Module* parent, const string& name, int inputs, 46 | int outputs, const string& arb_type ) ; 47 | 48 | virtual void Allocate() ; 49 | 50 | } ; 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /src/accelwattch/cacti/area.cc: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * McPAT/CACTI 3 | * SOFTWARE LICENSE AGREEMENT 4 | * Copyright 2012 Hewlett-Packard Development Company, L.P. 5 | * All Rights Reserved 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions are 9 | * met: redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer; 11 | * redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution; 14 | * neither the name of the copyright holders nor the names of its 15 | * contributors may be used to endorse or promote products derived from 16 | * this software without specific prior written permission. 17 | 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.” 29 | * 30 | ***************************************************************************/ 31 | 32 | 33 | 34 | #include "area.h" 35 | #include "component.h" 36 | #include "decoder.h" 37 | #include "parameter.h" 38 | #include "basic_circuit.h" 39 | #include 40 | #include 41 | #include 42 | 43 | using namespace std; 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /src/gpgpu-sim/gpu-misc.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2011, Tor M. Aamodt, George L. Yuan 2 | // The University of British Columbia 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // 8 | // Redistributions of source code must retain the above copyright notice, this 9 | // list of conditions and the following disclaimer. 10 | // Redistributions in binary form must reproduce the above copyright notice, 11 | // this list of conditions and the following disclaimer in the documentation 12 | // and/or other materials provided with the distribution. Neither the name of 13 | // The University of British Columbia nor the names of its contributors may be 14 | // used to endorse or promote products derived from this software without 15 | // specific prior written permission. 16 | // 17 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 21 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 | // POSSIBILITY OF SUCH DAMAGE. 28 | 29 | #include "gpu-misc.h" 30 | 31 | unsigned int LOGB2(unsigned int v) { 32 | unsigned int shift; 33 | unsigned int r; 34 | 35 | r = 0; 36 | 37 | shift = ((v & 0xFFFF0000) != 0) << 4; 38 | v >>= shift; 39 | r |= shift; 40 | shift = ((v & 0xFF00) != 0) << 3; 41 | v >>= shift; 42 | r |= shift; 43 | shift = ((v & 0xF0) != 0) << 2; 44 | v >>= shift; 45 | r |= shift; 46 | shift = ((v & 0xC) != 0) << 1; 47 | v >>= shift; 48 | r |= shift; 49 | shift = ((v & 0x2) != 0) << 0; 50 | v >>= shift; 51 | r |= shift; 52 | 53 | return r; 54 | } 55 | -------------------------------------------------------------------------------- /src/gpgpu-sim/stats.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2011, Tor M. Aamodt, 2 | // The University of British Columbia 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // 8 | // Redistributions of source code must retain the above copyright notice, this 9 | // list of conditions and the following disclaimer. 10 | // Redistributions in binary form must reproduce the above copyright notice, 11 | // this list of conditions and the following disclaimer in the documentation 12 | // and/or other materials provided with the distribution. Neither the name of 13 | // The University of British Columbia nor the names of its contributors may be 14 | // used to endorse or promote products derived from this software without 15 | // specific prior written permission. 16 | // 17 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 21 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 | // POSSIBILITY OF SUCH DAMAGE. 28 | 29 | #ifndef STATS_INCLUDED 30 | #define STATS_INCLUDED 31 | 32 | enum mem_stage_access_type { 33 | C_MEM, 34 | T_MEM, 35 | S_MEM, 36 | G_MEM_LD, 37 | L_MEM_LD, 38 | G_MEM_ST, 39 | L_MEM_ST, 40 | N_MEM_STAGE_ACCESS_TYPE 41 | }; 42 | enum tlb_request_status { TLB_HIT = 0, TLB_READY, TLB_PENDING }; 43 | enum mem_stage_stall_type { 44 | NO_RC_FAIL = 0, 45 | BK_CONF, 46 | MSHR_RC_FAIL, 47 | ICNT_RC_FAIL, 48 | COAL_STALL, 49 | TLB_STALL, 50 | DATA_PORT_STALL, 51 | WB_ICNT_RC_FAIL, 52 | WB_CACHE_RSRV_FAIL, 53 | N_MEM_STAGE_STALL_TYPE 54 | }; 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /debug_tools/WatchYourStep/ptxjitplus/inc/cub/util_namespace.cuh: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Copyright (c) 2011, Duane Merrill. All rights reserved. 3 | * Copyright (c) 2011-2018, NVIDIA CORPORATION. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of the NVIDIA CORPORATION nor the 13 | * names of its contributors may be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR ANY 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | * 27 | ******************************************************************************/ 28 | 29 | /** 30 | * \file 31 | * Place-holder for prefixing the cub namespace 32 | */ 33 | 34 | #pragma once 35 | 36 | // For example: 37 | //#define CUB_NS_PREFIX namespace thrust{ namespace detail { 38 | //#define CUB_NS_POSTFIX } } 39 | 40 | #ifndef CUB_NS_PREFIX 41 | #define CUB_NS_PREFIX 42 | #endif 43 | 44 | #ifndef CUB_NS_POSTFIX 45 | #define CUB_NS_POSTFIX 46 | #endif 47 | -------------------------------------------------------------------------------- /src/gpgpu-sim/stack.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2011, Tor M. Aamodt, Ali Bakhoda, Ivan Sham 2 | // The University of British Columbia 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // 8 | // Redistributions of source code must retain the above copyright notice, this 9 | // list of conditions and the following disclaimer. 10 | // Redistributions in binary form must reproduce the above copyright notice, 11 | // this list of conditions and the following disclaimer in the documentation 12 | // and/or other materials provided with the distribution. Neither the name of 13 | // The University of British Columbia nor the names of its contributors may be 14 | // used to endorse or promote products derived from this software without 15 | // specific prior written permission. 16 | // 17 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 21 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 | // POSSIBILITY OF SUCH DAMAGE. 28 | 29 | #ifndef _MY_STACK_ 30 | #define _MY_STACK_ 31 | 32 | #include "../abstract_hardware_model.h" 33 | 34 | typedef struct { 35 | address_type *v; 36 | int max_size; 37 | int top; 38 | } Stack; 39 | 40 | void push_stack(Stack *S, address_type val); 41 | address_type pop_stack(Stack *S); 42 | address_type top_stack(Stack *S); 43 | Stack *new_stack(int size); 44 | void free_stack(Stack *S); 45 | int size_stack(Stack *S); 46 | int full_stack(Stack *S); 47 | int empty_stack(Stack *S); 48 | int element_exist_stack(Stack *S, address_type value); 49 | void reset_stack(Stack *S); 50 | #endif // _MY_STACK_ 51 | -------------------------------------------------------------------------------- /src/intersim2/allocators/separable.hpp: -------------------------------------------------------------------------------- 1 | // $Id: separable.hpp 5188 2012-08-30 00:31:31Z dub $ 2 | 3 | /* 4 | Copyright (c) 2007-2012, Trustees of The Leland Stanford Junior University 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | Redistributions in binary form must reproduce the above copyright notice, this 13 | list of conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 20 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | // ---------------------------------------------------------------------- 29 | // 30 | // SeparableAllocator: Separable Allocator Base Class 31 | // 32 | // ---------------------------------------------------------------------- 33 | 34 | #ifndef _SEPARABLE_HPP_ 35 | #define _SEPARABLE_HPP_ 36 | 37 | #include 38 | 39 | #include "allocator.hpp" 40 | 41 | class Arbiter; 42 | 43 | class SeparableAllocator : public SparseAllocator { 44 | 45 | protected: 46 | 47 | vector _input_arb ; 48 | vector _output_arb ; 49 | 50 | public: 51 | 52 | SeparableAllocator( Module* parent, const string& name, int inputs, 53 | int outputs, const string& arb_type ) ; 54 | 55 | virtual ~SeparableAllocator() ; 56 | 57 | virtual void Clear() ; 58 | 59 | } ; 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /src/intersim2/arbiters/prio_arb.hpp: -------------------------------------------------------------------------------- 1 | // $Id: prio_arb.hpp 5188 2012-08-30 00:31:31Z dub $ 2 | 3 | /* 4 | Copyright (c) 2007-2012, Trustees of The Leland Stanford Junior University 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | Redistributions in binary form must reproduce the above copyright notice, this 13 | list of conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 20 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef _PRIO_ARB_HPP_ 29 | #define _PRIO_ARB_HPP_ 30 | 31 | #include 32 | 33 | #include "module.hpp" 34 | #include "config_utils.hpp" 35 | 36 | class PriorityArbiter : public Module { 37 | int _rr_ptr; 38 | 39 | protected: 40 | const int _inputs; 41 | 42 | struct sRequest { 43 | int in; 44 | int label; 45 | int pri; 46 | }; 47 | 48 | list _requests; 49 | 50 | int _match; 51 | 52 | public: 53 | PriorityArbiter( const Configuration &config, 54 | Module *parent, const string& name, 55 | int inputs ); 56 | 57 | void Clear( ); 58 | 59 | void AddRequest( int in, int label = 0, int pri = 0 ); 60 | void RemoveRequest( int in, int label = 0 ); 61 | 62 | int Match( ) const; 63 | 64 | void Arbitrate( ); 65 | void Update( ); 66 | }; 67 | 68 | #endif 69 | -------------------------------------------------------------------------------- /src/intersim2/networks/kncube.hpp: -------------------------------------------------------------------------------- 1 | // $Id: kncube.hpp 5188 2012-08-30 00:31:31Z dub $ 2 | 3 | /* 4 | Copyright (c) 2007-2012, Trustees of The Leland Stanford Junior University 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | Redistributions in binary form must reproduce the above copyright notice, this 13 | list of conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 20 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef _KNCUBE_HPP_ 29 | #define _KNCUBE_HPP_ 30 | 31 | #include "network.hpp" 32 | 33 | class KNCube : public Network { 34 | 35 | bool _mesh; 36 | 37 | int _k; 38 | int _n; 39 | 40 | void _ComputeSize( const Configuration &config ); 41 | void _BuildNet( const Configuration &config ); 42 | 43 | int _LeftChannel( int node, int dim ); 44 | int _RightChannel( int node, int dim ); 45 | 46 | int _LeftNode( int node, int dim ); 47 | int _RightNode( int node, int dim ); 48 | 49 | public: 50 | KNCube( const Configuration &config, const string & name, bool mesh ); 51 | static void RegisterRoutingFunctions(); 52 | 53 | int GetN( ) const; 54 | int GetK( ) const; 55 | 56 | double Capacity( ) const; 57 | 58 | void InsertRandomFaults( const Configuration &config ); 59 | 60 | }; 61 | 62 | #endif 63 | -------------------------------------------------------------------------------- /src/intersim2/module.hpp: -------------------------------------------------------------------------------- 1 | // $Id: module.hpp 5188 2012-08-30 00:31:31Z dub $ 2 | 3 | /* 4 | Copyright (c) 2007-2012, Trustees of The Leland Stanford Junior University 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | Redistributions in binary form must reproduce the above copyright notice, this 13 | list of conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 20 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef _MODULE_HPP_ 29 | #define _MODULE_HPP_ 30 | 31 | #include "booksim.hpp" 32 | 33 | #include 34 | #include 35 | #include 36 | 37 | class Module { 38 | private: 39 | string _name; 40 | string _fullname; 41 | 42 | vector _children; 43 | 44 | protected: 45 | void _AddChild( Module *child ); 46 | 47 | public: 48 | Module( Module *parent, const string& name ); 49 | virtual ~Module( ) { } 50 | 51 | inline const string & Name() const { return _name; } 52 | inline const string & FullName() const { return _fullname; } 53 | 54 | void DisplayHierarchy( int level = 0, ostream & os = cout ) const; 55 | 56 | void Error( const string& msg ) const; 57 | void Debug( const string& msg ) const; 58 | 59 | virtual void Display( ostream & os = cout ) const; 60 | }; 61 | 62 | #endif 63 | -------------------------------------------------------------------------------- /src/intersim2/examples/mesh88_lat: -------------------------------------------------------------------------------- 1 | // $Id: mesh88_lat 5506 2013-05-07 21:22:23Z qtedq $ 2 | 3 | // Copyright (c) 2007-2012, Trustees of The Leland Stanford Junior University 4 | // All rights reserved. 5 | // 6 | // Redistribution and use in source and binary forms, with or without 7 | // modification, are permitted provided that the following conditions are met: 8 | // 9 | // Redistributions of source code must retain the above copyright notice, this 10 | // list of conditions and the following disclaimer. 11 | // Redistributions in binary form must reproduce the above copyright notice, 12 | // this list of conditions and the following disclaimer in the documentation 13 | // and/or other materials provided with the distribution. 14 | // 15 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | // POSSIBILITY OF SUCH DAMAGE. 26 | 27 | //8X8 mesh with 20 flits per packet under injection mode 28 | //injection rate here is packet per cycle, NOT flit per cycle 29 | 30 | // Topology 31 | 32 | topology = mesh; 33 | k = 8; 34 | n = 2; 35 | 36 | // Routing 37 | routing_function = dor; 38 | 39 | // Flow control 40 | num_vcs = 8; 41 | vc_buf_size = 8; 42 | wait_for_tail_credit = 1; 43 | 44 | // Router architecture 45 | vc_allocator = islip; 46 | sw_allocator = islip; 47 | alloc_iters = 1; 48 | 49 | credit_delay = 2; 50 | routing_delay = 0; 51 | vc_alloc_delay = 1; 52 | sw_alloc_delay = 1; 53 | 54 | input_speedup = 2; 55 | output_speedup = 1; 56 | internal_speedup = 1.0; 57 | 58 | 59 | // Traffic 60 | traffic = transpose; 61 | packet_size = 20; 62 | 63 | 64 | // Simulation 65 | sim_type = latency; 66 | 67 | injection_rate = 0.005; 68 | 69 | -------------------------------------------------------------------------------- /src/intersim2/random_utils.hpp: -------------------------------------------------------------------------------- 1 | // $Id: random_utils.hpp 5188 2012-08-30 00:31:31Z dub $ 2 | 3 | /* 4 | Copyright (c) 2007-2012, Trustees of The Leland Stanford Junior University 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | Redistributions in binary form must reproduce the above copyright notice, this 13 | list of conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 20 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef _RANDOM_UTILS_HPP_ 29 | #define _RANDOM_UTILS_HPP_ 30 | 31 | // interface to Knuth's RANARRAY RNG 32 | void ran_start(long seed); 33 | long ran_next( ); 34 | void ranf_start(long seed); 35 | double ranf_next( ); 36 | 37 | inline void RandomSeed( long seed ) { 38 | ran_start( seed ); 39 | ranf_start( seed ); 40 | } 41 | 42 | inline unsigned long RandomIntLong( ) { 43 | return ran_next( ); 44 | } 45 | 46 | // Returns a random integer in the range [0,max] 47 | inline int RandomInt( int max ) { 48 | return ( ran_next( ) % (max+1) ); 49 | } 50 | 51 | // Returns a random floating-point value in the rage [0,1] 52 | inline double RandomFloat( ) { 53 | return ranf_next( ); 54 | } 55 | 56 | // Returns a random floating-point value in the rage [0,max] 57 | inline double RandomFloat( double max ) { 58 | return ( ranf_next( ) * max ); 59 | } 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /src/intersim2/credit.cpp: -------------------------------------------------------------------------------- 1 | // $Id: credit.cpp 5188 2012-08-30 00:31:31Z dub $ 2 | 3 | /* 4 | Copyright (c) 2007-2012, Trustees of The Leland Stanford Junior University 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | Redistributions in binary form must reproduce the above copyright notice, this 13 | list of conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 20 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | /*credit.cpp 29 | * 30 | *A class for credits 31 | */ 32 | 33 | #include "booksim.hpp" 34 | #include "credit.hpp" 35 | 36 | stack Credit::_all; 37 | stack Credit::_free; 38 | 39 | Credit::Credit() 40 | { 41 | Reset(); 42 | } 43 | 44 | void Credit::Reset() 45 | { 46 | vc.clear(); 47 | head = false; 48 | tail = false; 49 | id = -1; 50 | } 51 | 52 | Credit * Credit::New() { 53 | Credit * c; 54 | if(_free.empty()) { 55 | c = new Credit(); 56 | _all.push(c); 57 | } else { 58 | c = _free.top(); 59 | c->Reset(); 60 | _free.pop(); 61 | } 62 | return c; 63 | } 64 | 65 | void Credit::Free() { 66 | _free.push(this); 67 | } 68 | 69 | void Credit::FreeAll() { 70 | while(!_all.empty()) { 71 | delete _all.top(); 72 | _all.pop(); 73 | } 74 | } 75 | 76 | 77 | int Credit::OutStanding(){ 78 | return _all.size()-_free.size(); 79 | } 80 | -------------------------------------------------------------------------------- /src/accelwattch/mcpat.mk: -------------------------------------------------------------------------------- 1 | 2 | OUTPUT_DIR=$(SIM_OBJ_FILES_DIR)/accelwattch 3 | TARGET = mcpat 4 | SHELL = /bin/sh 5 | .PHONY: all depend clean 6 | .SUFFIXES: .cc .o 7 | 8 | ifndef NTHREADS 9 | NTHREADS = 4 10 | endif 11 | 12 | 13 | LIBS = -I/usr/lib/ -I/usr/lib64/ 14 | INCS = -lm 15 | 16 | CC= 17 | CXX= 18 | 19 | ifeq ($(shell getconf LONG_BIT),64) 20 | CXX = g++ -m64 21 | CC = gcc -m64 22 | else 23 | CXX = g++ -m32 24 | CC = gcc -m32 25 | endif 26 | 27 | ifeq ($(TAG),dbg) 28 | DBG = -Wall 29 | OPT = -ggdb -fPIC -g -O0 -DNTHREADS=1 -Icacti -lz 30 | else 31 | DBG = 32 | OPT = -O3 -fPIC -msse2 -mfpmath=sse -DNTHREADS=$(NTHREADS) -Icacti -lz 33 | #OPT = -O0 -DNTHREADS=$(NTHREADS) 34 | endif 35 | 36 | #CXXFLAGS = -Wall -Wno-unknown-pragmas -Winline $(DBG) $(OPT) 37 | CXXFLAGS = -Wno-unknown-pragmas $(DBG) $(OPT) 38 | 39 | 40 | 41 | 42 | VPATH = cacti 43 | 44 | SRCS = \ 45 | Ucache.cc \ 46 | XML_Parse.cc \ 47 | arbiter.cc \ 48 | area.cc \ 49 | array.cc \ 50 | bank.cc \ 51 | basic_circuit.cc \ 52 | basic_components.cc \ 53 | cacti_interface.cc \ 54 | component.cc \ 55 | core.cc \ 56 | crossbar.cc \ 57 | decoder.cc \ 58 | htree2.cc \ 59 | interconnect.cc \ 60 | io.cc \ 61 | iocontrollers.cc \ 62 | logic.cc \ 63 | main.cc \ 64 | mat.cc \ 65 | memoryctrl.cc \ 66 | noc.cc \ 67 | nuca.cc \ 68 | parameter.cc \ 69 | processor.cc \ 70 | router.cc \ 71 | sharedcache.cc \ 72 | subarray.cc \ 73 | technology.cc \ 74 | uca.cc \ 75 | wire.cc \ 76 | xmlParser.cc \ 77 | gpgpu_sim_wrapper.cc \ 78 | 79 | 80 | 81 | OBJS = $(patsubst %.cc,$(OUTPUT_DIR)/%.o,$(SRCS)) 82 | 83 | all: $(OUTPUT_DIR)/$(TARGET) 84 | 85 | $(OUTPUT_DIR)/$(TARGET) : $(OBJS) 86 | $(CXX) $(OBJS) -o $@ $(INCS) $(CXXFLAGS) $(LIBS) -pthread 87 | 88 | #obj_$(TAG)/%.o : %.cc 89 | # $(CXX) -c $(CXXFLAGS) $(INCS) -o $@ $< 90 | 91 | $(OUTPUT_DIR)/%.o : %.cc 92 | $(CXX) $(CXXFLAGS) -c $< -o $@ 93 | 94 | $(OUTPUT_DIR)/Makefile.makedepend: depend 95 | 96 | depend: 97 | touch $(OUTPUT_DIR)/Makefile.makedepend 98 | makedepend -f$(OUTPUT_DIR)/Makefile.makedepend -p$(OUTPUT_DIR)/ $(SRCS) 2> /dev/null 99 | $(MAKE) -C ./cacti/ depend 100 | 101 | clean: 102 | -rm -f *.o $(TARGET) 103 | rm -f Makefile.makedepend Makefile.makedepend.bak 104 | 105 | include $(OUTPUT_DIR)/Makefile.makedepend 106 | -------------------------------------------------------------------------------- /src/intersim2/examples/fattree_config: -------------------------------------------------------------------------------- 1 | // $Id: dragonflyconfig 3555 2011-05-16 23:37:55Z dub $ 2 | 3 | // Copyright (c) 2007-2012, Trustees of The Leland Stanford Junior University 4 | // All rights reserved. 5 | // 6 | // Redistribution and use in source and binary forms, with or without 7 | // modification, are permitted provided that the following conditions are met: 8 | // 9 | // Redistributions of source code must retain the above copyright notice, this 10 | // list of conditions and the following disclaimer. 11 | // Redistributions in binary form must reproduce the above copyright notice, 12 | // this list of conditions and the following disclaimer in the documentation 13 | // and/or other materials provided with the distribution. 14 | // 15 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | // POSSIBILITY OF SUCH DAMAGE. 26 | 27 | 28 | hold_switch_for_packet=1; 29 | 30 | vc_buf_size = 16; 31 | 32 | 33 | wait_for_tail_credit = 0; 34 | 35 | // 36 | // Router architecture 37 | // 38 | vc_allocator = separable_input_first; 39 | sw_allocator = separable_input_first; 40 | alloc_iters = 1; 41 | 42 | credit_delay = 2; 43 | routing_delay = 0; 44 | vc_alloc_delay = 1; 45 | sw_alloc_delay = 1; 46 | st_final_delay = 1; 47 | 48 | input_speedup = 1; 49 | output_speedup = 1; 50 | internal_speedup = 1.0; 51 | 52 | 53 | warmup_periods = 3; 54 | sim_count = 1; 55 | 56 | sample_period = 10000; 57 | 58 | 59 | 60 | routing_function = nca; 61 | num_vcs = 4; 62 | 63 | priority = none; 64 | traffic = uniform; 65 | 66 | injection_rate = 0.6; 67 | packet_size = 1; 68 | injection_rate_uses_flits=1; 69 | 70 | topology = fattree; 71 | 72 | 73 | k = 4; 74 | n = 3; 75 | 76 | watch_out=-; -------------------------------------------------------------------------------- /src/tr1_hash_map.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2011, Tor M. Aamodt, Wilson W.L. Fung 2 | // The University of British Columbia 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // 8 | // Redistributions of source code must retain the above copyright notice, this 9 | // list of conditions and the following disclaimer. 10 | // Redistributions in binary form must reproduce the above copyright notice, 11 | // this list of conditions and the following disclaimer in the documentation 12 | // and/or other materials provided with the distribution. Neither the name of 13 | // The University of British Columbia nor the names of its contributors may be 14 | // used to endorse or promote products derived from this software without 15 | // specific prior written permission. 16 | // 17 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 21 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 | // POSSIBILITY OF SUCH DAMAGE. 28 | 29 | #pragma once 30 | 31 | // detection and fallback for unordered_map in C++0x 32 | #ifdef __cplusplus 33 | // detect GCC 4.3 or later and use unordered map (part of C++0x) 34 | // unordered map doesn't play nice with _GLIBCXX_DEBUG, just use a map if its 35 | // enabled. 36 | #if defined(__GNUC__) and not defined(_GLIBCXX_DEBUG) 37 | #if __GNUC__ >= 4 && __GNUC_MINOR__ >= 3 38 | #include 39 | #define tr1_hash_map std::unordered_map 40 | #define tr1_hash_map_ismap 0 41 | #else 42 | #include 43 | #define tr1_hash_map std::map 44 | #define tr1_hash_map_ismap 1 45 | #endif 46 | #else 47 | #include 48 | #define tr1_hash_map std::map 49 | #define tr1_hash_map_ismap 1 50 | #endif 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /src/intersim2/examples/dragonflyconfig: -------------------------------------------------------------------------------- 1 | // $Id: dragonflyconfig 5188 2012-08-30 00:31:31Z dub $ 2 | 3 | // Copyright (c) 2007-2012, Trustees of The Leland Stanford Junior University 4 | // All rights reserved. 5 | // 6 | // Redistribution and use in source and binary forms, with or without 7 | // modification, are permitted provided that the following conditions are met: 8 | // 9 | // Redistributions of source code must retain the above copyright notice, this 10 | // list of conditions and the following disclaimer. 11 | // Redistributions in binary form must reproduce the above copyright notice, 12 | // this list of conditions and the following disclaimer in the documentation 13 | // and/or other materials provided with the distribution. 14 | // 15 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | // POSSIBILITY OF SUCH DAMAGE. 26 | 27 | // Dragonfly 28 | // 29 | 30 | 31 | 32 | 33 | vc_buf_size = 256; 34 | 35 | 36 | wait_for_tail_credit = 0; 37 | 38 | // 39 | // Router architecture 40 | // 41 | vc_allocator = separable_input_first; 42 | sw_allocator = separable_input_first; 43 | alloc_iters = 1; 44 | 45 | credit_delay = 2; 46 | routing_delay = 0; 47 | vc_alloc_delay = 1; 48 | sw_alloc_delay = 1; 49 | st_final_delay = 1; 50 | 51 | input_speedup = 1; 52 | output_speedup = 1; 53 | internal_speedup = 2.0; 54 | 55 | 56 | warmup_periods = 3; 57 | sim_count = 1; 58 | 59 | sample_period = 10000; 60 | 61 | 62 | 63 | routing_function = min; 64 | num_vcs = 2; 65 | 66 | priority = none; 67 | traffic = uniform; 68 | 69 | injection_rate = 0.8; 70 | packet_size = 10; 71 | injection_rate_uses_flits=1; 72 | 73 | topology = dragonflynew; 74 | 75 | k = 4; 76 | n = 1; 77 | 78 | watch_out=-; 79 | 80 | -------------------------------------------------------------------------------- /src/cuda-sim/cuda_device_runtime.h: -------------------------------------------------------------------------------- 1 | #ifndef __cuda_device_runtime_h__ 2 | #define __cuda_device_runtime_h__ 3 | // Jin: cuda_device_runtime.h 4 | // Defines CUDA device runtime APIs for CDP support 5 | class device_launch_config_t { 6 | public: 7 | device_launch_config_t() {} 8 | 9 | device_launch_config_t(dim3 _grid_dim, dim3 _block_dim, 10 | unsigned int _shared_mem, function_info* _entry) 11 | : grid_dim(_grid_dim), 12 | block_dim(_block_dim), 13 | shared_mem(_shared_mem), 14 | entry(_entry) {} 15 | 16 | dim3 grid_dim; 17 | dim3 block_dim; 18 | unsigned int shared_mem; 19 | function_info* entry; 20 | }; 21 | 22 | class device_launch_operation_t { 23 | public: 24 | device_launch_operation_t() {} 25 | device_launch_operation_t(kernel_info_t* _grid, CUstream_st* _stream) 26 | : grid(_grid), stream(_stream) {} 27 | 28 | kernel_info_t* grid; // a new child grid 29 | 30 | CUstream_st* stream; 31 | }; 32 | 33 | class gpgpu_context; 34 | 35 | class cuda_device_runtime { 36 | public: 37 | cuda_device_runtime(gpgpu_context* ctx) { 38 | g_total_param_size = 0; 39 | g_max_total_param_size = 0; 40 | gpgpu_ctx = ctx; 41 | } 42 | unsigned long long g_total_param_size; 43 | std::map g_cuda_device_launch_param_map; 44 | std::list g_cuda_device_launch_op; 45 | unsigned g_kernel_launch_latency; 46 | unsigned g_TB_launch_latency; 47 | unsigned long long g_max_total_param_size; 48 | bool g_cdp_enabled; 49 | 50 | // backward pointer 51 | class gpgpu_context* gpgpu_ctx; 52 | #if (CUDART_VERSION >= 5000) 53 | #pragma once 54 | void gpgpusim_cuda_launchDeviceV2(const ptx_instruction* pI, 55 | ptx_thread_info* thread, 56 | const function_info* target_func); 57 | void gpgpusim_cuda_streamCreateWithFlags(const ptx_instruction* pI, 58 | ptx_thread_info* thread, 59 | const function_info* target_func); 60 | void gpgpusim_cuda_getParameterBufferV2(const ptx_instruction* pI, 61 | ptx_thread_info* thread, 62 | const function_info* target_func); 63 | void launch_all_device_kernels(); 64 | void launch_one_device_kernel(); 65 | #endif 66 | }; 67 | 68 | #endif /* __cuda_device_runtime_h__ */ 69 | -------------------------------------------------------------------------------- /gpgpusim_unset_cuda.cmake: -------------------------------------------------------------------------------- 1 | # Unset these variable to force a re-search on possible CUDA version changes 2 | unset(CUDAToolkit_BIN_DIR CACHE) 3 | unset(CUDAToolkit_CUPTI_INCLUDE_DIR CACHE) 4 | unset(CUDAToolkit_NVCC_EXECUTABLE CACHE) 5 | unset(CUDAToolkit_rt_LIBRARY CACHE) 6 | unset(CUDA_CUDART CACHE) 7 | unset(CUDA_OpenCL_LIBRARY CACHE) 8 | unset(CUDA_cublasLt_LIBRARY CACHE) 9 | unset(CUDA_cublasLt_static_LIBRARY CACHE) 10 | unset(CUDA_cublas_LIBRARY CACHE) 11 | unset(CUDA_cublas_static_LIBRARY CACHE) 12 | unset(CUDA_cuda_driver_LIBRARY CACHE) 13 | unset(CUDA_cudart_LIBRARY CACHE) 14 | unset(CUDA_cudart_static_LIBRARY CACHE) 15 | unset(CUDA_cufft_LIBRARY CACHE) 16 | unset(CUDA_cufft_static_LIBRARY CACHE) 17 | unset(CUDA_cufft_static_nocallback_LIBRARY CACHE) 18 | unset(CUDA_cufftw_LIBRARY CACHE) 19 | unset(CUDA_cufftw_static_LIBRARY CACHE) 20 | unset(CUDA_culibos_LIBRARY CACHE) 21 | unset(CUDA_cupti_LIBRARY CACHE) 22 | unset(CUDA_cupti_static_LIBRARY CACHE) 23 | unset(CUDA_curand_LIBRARY CACHE) 24 | unset(CUDA_curand_static_LIBRARY CACHE) 25 | unset(CUDA_cusolver_LIBRARY CACHE) 26 | unset(CUDA_cusolver_lapack_static_LIBRARY CACHE) 27 | unset(CUDA_cusolver_static_LIBRARY CACHE) 28 | unset(CUDA_cusparse_LIBRARY CACHE) 29 | unset(CUDA_cusparse_static_LIBRARY CACHE) 30 | unset(CUDA_nppc_LIBRARY CACHE) 31 | unset(CUDA_nppc_static_LIBRARY CACHE) 32 | unset(CUDA_nppial_LIBRARY CACHE) 33 | unset(CUDA_nppial_static_LIBRARY CACHE) 34 | unset(CUDA_nppicc_LIBRARY CACHE) 35 | unset(CUDA_nppicc_static_LIBRARY CACHE) 36 | unset(CUDA_nppicom_LIBRARY CACHE) 37 | unset(CUDA_nppicom_static_LIBRARY CACHE) 38 | unset(CUDA_nppidei_LIBRARY CACHE) 39 | unset(CUDA_nppidei_static_LIBRARY CACHE) 40 | unset(CUDA_nppif_LIBRARY CACHE) 41 | unset(CUDA_nppif_static_LIBRARY CACHE) 42 | unset(CUDA_nppig_LIBRARY CACHE) 43 | unset(CUDA_nppig_static_LIBRARY CACHE) 44 | unset(CUDA_nppim_LIBRARY CACHE) 45 | unset(CUDA_nppim_static_LIBRARY CACHE) 46 | unset(CUDA_nppist_LIBRARY CACHE) 47 | unset(CUDA_nppist_static_LIBRARY CACHE) 48 | unset(CUDA_nppisu_LIBRARY CACHE) 49 | unset(CUDA_nppisu_static_LIBRARY CACHE) 50 | unset(CUDA_nppitc_LIBRARY CACHE) 51 | unset(CUDA_nppitc_static_LIBRARY CACHE) 52 | unset(CUDA_npps_LIBRARY CACHE) 53 | unset(CUDA_npps_static_LIBRARY CACHE) 54 | unset(CUDA_nvToolsExt_LIBRARY CACHE) 55 | unset(CUDA_nvgraph_LIBRARY CACHE) 56 | unset(CUDA_nvgraph_static_LIBRARY CACHE) 57 | unset(CUDA_nvjpeg_LIBRARY CACHE) 58 | unset(CUDA_nvjpeg_static_LIBRARY CACHE) 59 | unset(CUDA_nvml_LIBRARY CACHE) 60 | unset(CUDA_nvrtc_LIBRARY CACHE) -------------------------------------------------------------------------------- /src/trace.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2013, Tor M. Aamodt, Timothy Rogers, 2 | // The University of British Columbia 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // 8 | // Redistributions of source code must retain the above copyright notice, this 9 | // list of conditions and the following disclaimer. 10 | // Redistributions in binary form must reproduce the above copyright notice, 11 | // this list of conditions and the following disclaimer in the documentation 12 | // and/or other materials provided with the distribution. Neither the name of 13 | // The University of British Columbia nor the names of its contributors may be 14 | // used to endorse or promote products derived from this software without 15 | // specific prior written permission. 16 | // 17 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 21 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 | // POSSIBILITY OF SUCH DAMAGE. 28 | 29 | #include "trace.h" 30 | #include "string.h" 31 | 32 | namespace Trace { 33 | 34 | #define TS_TUP_BEGIN(X) const char* trace_streams_str[] = { 35 | #define TS_TUP(X) #X 36 | #define TS_TUP_END(X) \ 37 | } \ 38 | ; 39 | #include "trace_streams.tup" 40 | #undef TS_TUP_BEGIN 41 | #undef TS_TUP 42 | #undef TS_TUP_END 43 | 44 | bool enabled = false; 45 | int sampling_core = 0; 46 | int sampling_memory_partition = -1; 47 | bool trace_streams_enabled[NUM_TRACE_STREAMS] = {false}; 48 | const char* config_str; 49 | 50 | void init() { 51 | for (unsigned i = 0; i < NUM_TRACE_STREAMS; ++i) { 52 | if (strstr(config_str, trace_streams_str[i]) != NULL) { 53 | trace_streams_enabled[i] = true; 54 | } 55 | } 56 | } 57 | } // namespace Trace 58 | -------------------------------------------------------------------------------- /src/intersim2/outputset.hpp: -------------------------------------------------------------------------------- 1 | // $Id: outputset.hpp 5188 2012-08-30 00:31:31Z dub $ 2 | 3 | /* 4 | Copyright (c) 2007-2012, Trustees of The Leland Stanford Junior University 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | Redistributions in binary form must reproduce the above copyright notice, this 13 | list of conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 20 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef _OUTPUTSET_HPP_ 29 | #define _OUTPUTSET_HPP_ 30 | 31 | #include 32 | 33 | class OutputSet { 34 | 35 | 36 | public: 37 | struct sSetElement { 38 | int vc_start; 39 | int vc_end; 40 | int pri; 41 | int output_port; 42 | }; 43 | 44 | void Clear( ); 45 | void Add( int output_port, int vc, int pri = 0 ); 46 | void AddRange( int output_port, int vc_start, int vc_end, int pri = 0 ); 47 | 48 | bool OutputEmpty( int output_port ) const; 49 | int NumVCs( int output_port ) const; 50 | 51 | const set & GetSet() const; 52 | 53 | int GetVC( int output_port, int vc_index, int *pri = 0 ) const; 54 | bool GetPortVC( int *out_port, int *out_vc ) const; 55 | private: 56 | set _outputs; 57 | }; 58 | 59 | inline bool operator<(const OutputSet::sSetElement & se1, 60 | const OutputSet::sSetElement & se2) { 61 | return se1.pri > se2.pri; // higher priorities first! 62 | } 63 | 64 | #endif 65 | 66 | 67 | -------------------------------------------------------------------------------- /src/cuda-sim/ptx_loader.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2011, Tor M. Aamodt 2 | // The University of British Columbia 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // 8 | // Redistributions of source code must retain the above copyright notice, this 9 | // list of conditions and the following disclaimer. 10 | // Redistributions in binary form must reproduce the above copyright notice, 11 | // this list of conditions and the following disclaimer in the documentation 12 | // and/or other materials provided with the distribution. Neither the name of 13 | // The University of British Columbia nor the names of its contributors may be 14 | // used to endorse or promote products derived from this software without 15 | // specific prior written permission. 16 | // 17 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 21 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 | // POSSIBILITY OF SUCH DAMAGE. 28 | 29 | #ifndef PTX_LOADER_H_INCLUDED 30 | #define PTX_LOADER_H_INCLUDED 31 | #include 32 | 33 | #define PTXINFO_LINEBUF_SIZE 1024 34 | class gpgpu_context; 35 | typedef void* yyscan_t; 36 | class ptxinfo_data { 37 | public: 38 | ptxinfo_data(gpgpu_context* ctx) { gpgpu_ctx = ctx; } 39 | yyscan_t scanner; 40 | char linebuf[PTXINFO_LINEBUF_SIZE]; 41 | unsigned col; 42 | const char* g_ptxinfo_filename; 43 | class gpgpu_context* gpgpu_ctx; 44 | bool g_keep_intermediate_files; 45 | bool m_ptx_save_converted_ptxplus; 46 | void ptxinfo_addinfo(); 47 | bool keep_intermediate_files(); 48 | char* gpgpu_ptx_sim_convert_ptx_and_sass_to_ptxplus( 49 | const std::string ptx_str, const std::string sass_str, 50 | const std::string elf_str); 51 | }; 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /src/intersim2/power/switch_monitor.hpp: -------------------------------------------------------------------------------- 1 | // $Id: switch_monitor.hpp 5188 2012-08-30 00:31:31Z dub $ 2 | 3 | /* 4 | Copyright (c) 2007-2012, Trustees of The Leland Stanford Junior University 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | Redistributions in binary form must reproduce the above copyright notice, this 13 | list of conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 20 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef _SWITCH_MONITOR_HPP_ 29 | #define _SWITCH_MONITOR_HPP_ 30 | 31 | #include 32 | #include 33 | 34 | using namespace std; 35 | 36 | class Flit; 37 | 38 | class SwitchMonitor { 39 | int _cycles ; 40 | int _inputs ; 41 | int _outputs ; 42 | int _classes ; 43 | vector _event ; 44 | int index( int input, int output, int cl ) const ; 45 | public: 46 | SwitchMonitor( int inputs, int outputs, int classes ) ; 47 | void cycle() ; 48 | vector const & GetActivity() const { 49 | return _event; 50 | } 51 | inline int const & NumInputs() const { 52 | return _inputs; 53 | } 54 | inline int const & NumOutputs() const { 55 | return _outputs; 56 | } 57 | inline int const & NumClasses() const { 58 | return _classes; 59 | } 60 | void traversal( int input, int output, Flit const * f ) ; 61 | void display(ostream & os) const; 62 | } ; 63 | 64 | ostream & operator<<( ostream & os, SwitchMonitor const & obj ) ; 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /libcuda/cuobjdump.h: -------------------------------------------------------------------------------- 1 | #ifndef __cuobjdump_h__ 2 | #define __cuobjdump_h__ 3 | #include 4 | #include 5 | #include 6 | 7 | typedef void *yyscan_t; 8 | struct cuobjdump_parser { 9 | yyscan_t scanner; 10 | int elfserial; 11 | int ptxserial; 12 | FILE *ptxfile; 13 | FILE *elffile; 14 | FILE *sassfile; 15 | char filename[1024]; 16 | }; 17 | 18 | class cuobjdumpSection { 19 | public: 20 | // Constructor 21 | cuobjdumpSection() { 22 | arch = 0; 23 | identifier = ""; 24 | } 25 | virtual ~cuobjdumpSection() {} 26 | unsigned getArch() { return arch; } 27 | void setArch(unsigned a) { arch = a; } 28 | std::string getIdentifier() { return identifier; } 29 | void setIdentifier(std::string i) { identifier = i; } 30 | virtual void print() { 31 | std::cout << "cuobjdump Section: unknown type" << std::endl; 32 | } 33 | 34 | private: 35 | unsigned arch; 36 | std::string identifier; 37 | }; 38 | 39 | class cuobjdumpELFSection : public cuobjdumpSection { 40 | public: 41 | cuobjdumpELFSection() {} 42 | virtual ~cuobjdumpELFSection() { 43 | elffilename = ""; 44 | sassfilename = ""; 45 | } 46 | std::string getELFfilename() { return elffilename; } 47 | void setELFfilename(std::string f) { elffilename = f; } 48 | std::string getSASSfilename() { return sassfilename; } 49 | void setSASSfilename(std::string f) { sassfilename = f; } 50 | virtual void print() { 51 | std::cout << "ELF Section:" << std::endl; 52 | std::cout << "arch: sm_" << getArch() << std::endl; 53 | std::cout << "identifier: " << getIdentifier() << std::endl; 54 | std::cout << "elf filename: " << getELFfilename() << std::endl; 55 | std::cout << "sass filename: " << getSASSfilename() << std::endl; 56 | std::cout << std::endl; 57 | } 58 | 59 | private: 60 | std::string elffilename; 61 | std::string sassfilename; 62 | }; 63 | 64 | class cuobjdumpPTXSection : public cuobjdumpSection { 65 | public: 66 | cuobjdumpPTXSection() { ptxfilename = ""; } 67 | std::string getPTXfilename() { return ptxfilename; } 68 | void setPTXfilename(std::string f) { ptxfilename = f; } 69 | virtual void print() { 70 | std::cout << "PTX Section:" << std::endl; 71 | std::cout << "arch: sm_" << getArch() << std::endl; 72 | std::cout << "identifier: " << getIdentifier() << std::endl; 73 | std::cout << "ptx filename: " << getPTXfilename() << std::endl; 74 | std::cout << std::endl; 75 | } 76 | 77 | private: 78 | std::string ptxfilename; 79 | }; 80 | 81 | #endif /* __cuobjdump_h__ */ 82 | -------------------------------------------------------------------------------- /src/intersim2/power/buffer_monitor.hpp: -------------------------------------------------------------------------------- 1 | // $Id: buffer_monitor.hpp 5188 2012-08-30 00:31:31Z dub $ 2 | 3 | /* 4 | Copyright (c) 2007-2012, Trustees of The Leland Stanford Junior University 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | Redistributions in binary form must reproduce the above copyright notice, this 13 | list of conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 20 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef _BUFFER_MONITOR_HPP_ 29 | #define _BUFFER_MONITOR_HPP_ 30 | 31 | #include 32 | #include 33 | 34 | using namespace std; 35 | 36 | class Flit; 37 | 38 | class BufferMonitor { 39 | int _cycles ; 40 | int _inputs ; 41 | int _classes ; 42 | vector _reads ; 43 | vector _writes ; 44 | int index( int input, int cl ) const ; 45 | public: 46 | BufferMonitor( int inputs, int classes ) ; 47 | void cycle() ; 48 | void write( int input, Flit const * f ) ; 49 | void read( int input, Flit const * f ) ; 50 | inline const vector & GetReads() const { 51 | return _reads; 52 | } 53 | inline const vector & GetWrites() const { 54 | return _writes; 55 | } 56 | inline int NumInputs() const { 57 | return _inputs; 58 | } 59 | inline int NumClasses() const { 60 | return _classes; 61 | } 62 | void display(ostream & os) const; 63 | 64 | } ; 65 | 66 | ostream & operator<<( ostream & os, BufferMonitor const & obj ) ; 67 | 68 | #endif 69 | -------------------------------------------------------------------------------- /src/intersim2/injection.hpp: -------------------------------------------------------------------------------- 1 | // $Id: injection.hpp 5188 2012-08-30 00:31:31Z dub $ 2 | 3 | /* 4 | Copyright (c) 2007-2012, Trustees of The Leland Stanford Junior University 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | Redistributions in binary form must reproduce the above copyright notice, this 13 | list of conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 20 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef _INJECTION_HPP_ 29 | #define _INJECTION_HPP_ 30 | 31 | #include "config_utils.hpp" 32 | 33 | using namespace std; 34 | 35 | class InjectionProcess { 36 | protected: 37 | int _nodes; 38 | double _rate; 39 | InjectionProcess(int nodes, double rate); 40 | public: 41 | virtual ~InjectionProcess() {} 42 | virtual bool test(int source) = 0; 43 | virtual void reset(); 44 | static InjectionProcess * New(string const & inject, int nodes, double load, 45 | Configuration const * const config = NULL); 46 | }; 47 | 48 | class BernoulliInjectionProcess : public InjectionProcess { 49 | public: 50 | BernoulliInjectionProcess(int nodes, double rate); 51 | virtual bool test(int source); 52 | }; 53 | 54 | class OnOffInjectionProcess : public InjectionProcess { 55 | private: 56 | double _alpha; 57 | double _beta; 58 | double _r1; 59 | vector _initial; 60 | vector _state; 61 | public: 62 | OnOffInjectionProcess(int nodes, double rate, double alpha, double beta, 63 | double r1, vector initial); 64 | virtual void reset(); 65 | virtual bool test(int source); 66 | }; 67 | 68 | #endif 69 | -------------------------------------------------------------------------------- /src/cuda-sim/opcodes.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2011, Tor M. Aamodt, Ali Bakhoda 2 | // The University of British Columbia 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // 8 | // Redistributions of source code must retain the above copyright notice, this 9 | // list of conditions and the following disclaimer. 10 | // Redistributions in binary form must reproduce the above copyright notice, 11 | // this list of conditions and the following disclaimer in the documentation 12 | // and/or other materials provided with the distribution. Neither the name of 13 | // The University of British Columbia nor the names of its contributors may be 14 | // used to endorse or promote products derived from this software without 15 | // specific prior written permission. 16 | // 17 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 21 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 | // POSSIBILITY OF SUCH DAMAGE. 28 | 29 | #ifndef opcodes_h_included 30 | #define opcodes_h_included 31 | 32 | enum opcode_t { 33 | #define OP_DEF(OP, FUNC, STR, DST, CLASSIFICATION) OP, 34 | #define OP_W_DEF(OP, FUNC, STR, DST, CLASSIFICATION) OP, 35 | #include "opcodes.def" 36 | NUM_OPCODES 37 | #undef OP_DEF 38 | #undef OP_W_DEF 39 | }; 40 | 41 | enum special_regs { 42 | CLOCK_REG, 43 | HALFCLOCK_ID, 44 | CLOCK64_REG, 45 | CTAID_REG, 46 | ENVREG_REG, 47 | GRIDID_REG, 48 | LANEID_REG, 49 | LANEMASK_EQ_REG, 50 | LANEMASK_LE_REG, 51 | LANEMASK_LT_REG, 52 | LANEMASK_GE_REG, 53 | LANEMASK_GT_REG, 54 | NCTAID_REG, 55 | NTID_REG, 56 | NSMID_REG, 57 | NWARPID_REG, 58 | PM_REG, 59 | SMID_REG, 60 | TID_REG, 61 | WARPID_REG, 62 | WARPSZ_REG 63 | }; 64 | enum wmma_type { 65 | LOAD_A, 66 | LOAD_B, 67 | LOAD_C, 68 | STORE_D, 69 | MMA, 70 | ROW, 71 | COL, 72 | M16N16K16, 73 | M32N8K16, 74 | M8N32K16 75 | 76 | }; 77 | #endif 78 | -------------------------------------------------------------------------------- /src/intersim2/arbiters/matrix_arb.hpp: -------------------------------------------------------------------------------- 1 | // $Id: matrix_arb.hpp 5188 2012-08-30 00:31:31Z dub $ 2 | 3 | /* 4 | Copyright (c) 2007-2012, Trustees of The Leland Stanford Junior University 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | Redistributions in binary form must reproduce the above copyright notice, this 13 | list of conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 20 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | // ---------------------------------------------------------------------- 29 | // 30 | // Matrix: Matrix Arbiter 31 | // 32 | // ---------------------------------------------------------------------- 33 | 34 | #ifndef _MATRIX_ARB_HPP_ 35 | #define _MATRIX_ARB_HPP_ 36 | 37 | #include 38 | 39 | #include "arbiter.hpp" 40 | 41 | using namespace std; 42 | 43 | class MatrixArbiter : public Arbiter { 44 | 45 | // Priority matrix 46 | vector > _matrix ; 47 | 48 | int _last_req ; 49 | 50 | public: 51 | 52 | // Constructors 53 | MatrixArbiter( Module *parent, const string &name, int size ) ; 54 | 55 | // Print priority matrix to standard output 56 | virtual void PrintState() const ; 57 | 58 | // Update priority matrix based on last aribtration result 59 | virtual void UpdateState() ; 60 | 61 | // Arbitrate amongst requests. Returns winning input and 62 | // updates pointers to metadata when valid pointers are passed 63 | virtual int Arbitrate( int* id = 0, int* pri = 0) ; 64 | 65 | virtual void AddRequest( int input, int id, int pri ) ; 66 | 67 | virtual void Clear(); 68 | 69 | } ; 70 | 71 | #endif 72 | -------------------------------------------------------------------------------- /src/intersim2/networks/qtree.hpp: -------------------------------------------------------------------------------- 1 | // $Id: qtree.hpp 5188 2012-08-30 00:31:31Z dub $ 2 | 3 | /* 4 | Copyright (c) 2007-2012, Trustees of The Leland Stanford Junior University 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | Redistributions in binary form must reproduce the above copyright notice, this 13 | list of conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 20 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | //////////////////////////////////////////////////////////////////////// 29 | // 30 | // QTree: A Quad-Tree Indirect Network. 31 | // 32 | // 33 | //////////////////////////////////////////////////////////////////////// 34 | // 35 | // RCS Information: 36 | // $Author: jbalfour $ 37 | // $Date: 2007/05/17 17:14:07 $ 38 | // $Id: qtree.hpp 5188 2012-08-30 00:31:31Z dub $ 39 | // 40 | //////////////////////////////////////////////////////////////////////// 41 | 42 | #ifndef _QTREE_HPP_ 43 | #define _QTREE_HPP_ 44 | #include 45 | #include "network.hpp" 46 | 47 | class QTree : public Network { 48 | 49 | int _k; 50 | int _n; 51 | 52 | void _ComputeSize( const Configuration& config ); 53 | void _BuildNet( const Configuration& config ); 54 | 55 | int _RouterIndex( int height, int pos ); 56 | int _InputIndex( int height, int pos, int port ); 57 | int _OutputIndex( int height, int pos, int port ); 58 | 59 | public: 60 | 61 | QTree( const Configuration& config, const string & name ); 62 | static void RegisterRoutingFunctions() ; 63 | 64 | static int HeightFromID( int id ); 65 | static int PosFromID( int id ); 66 | 67 | }; 68 | 69 | #endif 70 | -------------------------------------------------------------------------------- /src/intersim2/arbiters/tree_arb.hpp: -------------------------------------------------------------------------------- 1 | // $Id: tree_arb.hpp 5188 2012-08-30 00:31:31Z dub $ 2 | 3 | /* 4 | Copyright (c) 2007-2012, Trustees of The Leland Stanford Junior University 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | Redistributions in binary form must reproduce the above copyright notice, this 13 | list of conditions and the following disclaimer in the documentation and/or 14 | other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 20 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | // ---------------------------------------------------------------------- 29 | // 30 | // TreeArbiter 31 | // 32 | // ---------------------------------------------------------------------- 33 | 34 | #ifndef _TREE_ARB_HPP_ 35 | #define _TREE_ARB_HPP_ 36 | 37 | #include "arbiter.hpp" 38 | 39 | class TreeArbiter : public Arbiter { 40 | 41 | int _group_size ; 42 | 43 | vector _group_arbiters; 44 | Arbiter * _global_arbiter; 45 | 46 | vector _group_reqs; 47 | 48 | public: 49 | 50 | // Constructors 51 | TreeArbiter( Module *parent, const string &name, int size, int groups, const string & arb_type ) ; 52 | 53 | ~TreeArbiter(); 54 | 55 | // Print priority matrix to standard output 56 | virtual void PrintState() const ; 57 | 58 | // Update priority matrix based on last aribtration result 59 | virtual void UpdateState() ; 60 | 61 | // Arbitrate amongst requests. Returns winning input and 62 | // updates pointers to metadata when valid pointers are passed 63 | virtual int Arbitrate( int* id = 0, int* pri = 0) ; 64 | 65 | virtual void AddRequest( int input, int id, int pri ) ; 66 | 67 | virtual void Clear(); 68 | 69 | } ; 70 | 71 | #endif 72 | --------------------------------------------------------------------------------