├── .clang-format ├── .gdbinit ├── .gitignore ├── .travis.yml ├── CHANGES ├── COPYRIGHT ├── Jenkinsfile ├── Makefile ├── README.md ├── aerialvision ├── README ├── configs.py ├── guiclasses.py ├── lexyacc.py ├── lexyaccbookmark.py ├── lexyacctexteditor.py ├── organizedata.py ├── startup.py └── variableclasses.py ├── bin └── aerialvision.py ├── bitbucket-pipelines.yml ├── checkpoint.md ├── configs ├── deprecated-cfgs │ ├── GTX480 │ │ ├── config_fermi_islip.icnt │ │ ├── gpgpusim.config │ │ └── gpuwattch_gtx480.xml │ ├── GeForceGTX750Ti │ │ ├── config_fermi_islip.icnt │ │ ├── gpgpusim.config │ │ └── gpuwattch_gtx750Ti.xml │ ├── QuadroFX5600 │ │ ├── gpgpusim.config │ │ ├── gpuwattch_quadrofx5600.xml │ │ └── icnt_config_islip.icnt │ ├── QuadroFX5800 │ │ ├── config_quadro_islip.icnt │ │ └── gpgpusim.config │ ├── SM6_GTX1080 │ │ ├── config_fermi_islip.icnt │ │ ├── gpgpusim.config │ │ ├── gpgpusim.config.orig │ │ └── gpuwattch_gtx1080Ti.xml │ ├── SM6_P100 │ │ ├── config_fermi_islip.icnt │ │ ├── gpgpusim.config │ │ └── gpuwattch_gtx480.xml │ ├── SM6_TITANX │ │ ├── config_fermi_islip.icnt │ │ ├── gpgpusim.config │ │ └── gpuwattch_gtx480.xml │ ├── SM7_TITANV │ │ ├── config_fermi_islip.icnt │ │ └── gpgpusim.config │ └── TeslaC2050 │ │ ├── config_fermi_islip.icnt │ │ └── gpgpusim.config └── tested-cfgs │ ├── MOBILE │ └── gpgpusim.config │ └── Turing │ └── gpgpusim.config ├── cuobjdump_to_ptxplus ├── Makefile ├── cuobjdumpInst.cc ├── cuobjdumpInst.h ├── cuobjdumpInstList.cc ├── cuobjdumpInstList.h ├── cuobjdump_to_ptxplus.cc ├── elf.l ├── elf.y ├── header.l ├── header.y ├── ptx.l ├── ptx.y ├── ptx_parser.h ├── sass.l └── sass.y ├── debug_tools └── WatchYourStep │ └── ptxjitplus │ ├── Makefile │ ├── inc │ ├── GL │ │ ├── freeglut.h │ │ ├── freeglut_ext.h │ │ ├── freeglut_std.h │ │ ├── glew.h │ │ ├── glext.h │ │ ├── glut.h │ │ ├── glxew.h │ │ ├── glxext.h │ │ └── wglew.h │ ├── cub │ │ ├── agent │ │ │ ├── agent_histogram.cuh │ │ │ ├── agent_radix_sort_downsweep.cuh │ │ │ ├── agent_radix_sort_upsweep.cuh │ │ │ ├── agent_reduce.cuh │ │ │ ├── agent_reduce_by_key.cuh │ │ │ ├── agent_rle.cuh │ │ │ ├── agent_scan.cuh │ │ │ ├── agent_segment_fixup.cuh │ │ │ ├── agent_select_if.cuh │ │ │ ├── agent_spmv_orig.cuh │ │ │ └── single_pass_scan_operators.cuh │ │ ├── block │ │ │ ├── block_adjacent_difference.cuh │ │ │ ├── block_discontinuity.cuh │ │ │ ├── block_exchange.cuh │ │ │ ├── block_histogram.cuh │ │ │ ├── block_load.cuh │ │ │ ├── block_radix_rank.cuh │ │ │ ├── block_radix_sort.cuh │ │ │ ├── block_raking_layout.cuh │ │ │ ├── block_reduce.cuh │ │ │ ├── block_scan.cuh │ │ │ ├── block_shuffle.cuh │ │ │ ├── block_store.cuh │ │ │ └── specializations │ │ │ │ ├── block_histogram_atomic.cuh │ │ │ │ ├── block_histogram_sort.cuh │ │ │ │ ├── block_reduce_raking.cuh │ │ │ │ ├── block_reduce_raking_commutative_only.cuh │ │ │ │ ├── block_reduce_warp_reductions.cuh │ │ │ │ ├── block_scan_raking.cuh │ │ │ │ ├── block_scan_warp_scans.cuh │ │ │ │ ├── block_scan_warp_scans2.cuh │ │ │ │ └── block_scan_warp_scans3.cuh │ │ ├── cub.cuh │ │ ├── device │ │ │ ├── device_histogram.cuh │ │ │ ├── device_partition.cuh │ │ │ ├── device_radix_sort.cuh │ │ │ ├── device_reduce.cuh │ │ │ ├── device_run_length_encode.cuh │ │ │ ├── device_scan.cuh │ │ │ ├── device_segmented_radix_sort.cuh │ │ │ ├── device_segmented_reduce.cuh │ │ │ ├── device_select.cuh │ │ │ ├── device_spmv.cuh │ │ │ └── dispatch │ │ │ │ ├── dispatch_histogram.cuh │ │ │ │ ├── dispatch_radix_sort.cuh │ │ │ │ ├── dispatch_reduce.cuh │ │ │ │ ├── dispatch_reduce_by_key.cuh │ │ │ │ ├── dispatch_rle.cuh │ │ │ │ ├── dispatch_scan.cuh │ │ │ │ ├── dispatch_select_if.cuh │ │ │ │ └── dispatch_spmv_orig.cuh │ │ ├── grid │ │ │ ├── grid_barrier.cuh │ │ │ ├── grid_even_share.cuh │ │ │ ├── grid_mapping.cuh │ │ │ └── grid_queue.cuh │ │ ├── host │ │ │ └── mutex.cuh │ │ ├── iterator │ │ │ ├── arg_index_input_iterator.cuh │ │ │ ├── cache_modified_input_iterator.cuh │ │ │ ├── cache_modified_output_iterator.cuh │ │ │ ├── constant_input_iterator.cuh │ │ │ ├── counting_input_iterator.cuh │ │ │ ├── discard_output_iterator.cuh │ │ │ ├── tex_obj_input_iterator.cuh │ │ │ ├── tex_ref_input_iterator.cuh │ │ │ └── transform_input_iterator.cuh │ │ ├── thread │ │ │ ├── thread_load.cuh │ │ │ ├── thread_operators.cuh │ │ │ ├── thread_reduce.cuh │ │ │ ├── thread_scan.cuh │ │ │ ├── thread_search.cuh │ │ │ └── thread_store.cuh │ │ ├── util_allocator.cuh │ │ ├── util_arch.cuh │ │ ├── util_debug.cuh │ │ ├── util_device.cuh │ │ ├── util_macro.cuh │ │ ├── util_namespace.cuh │ │ ├── util_ptx.cuh │ │ ├── util_type.cuh │ │ └── warp │ │ │ ├── specializations │ │ │ ├── warp_reduce_shfl.cuh │ │ │ ├── warp_reduce_smem.cuh │ │ │ ├── warp_scan_shfl.cuh │ │ │ └── warp_scan_smem.cuh │ │ │ ├── warp_reduce.cuh │ │ │ └── warp_scan.cuh │ ├── cuda_drvapi_dynlink.c │ ├── drvapi_error_string.h │ ├── dynlink │ │ ├── cuda_drvapi_dynlink.h │ │ ├── cuda_drvapi_dynlink_cuda.h │ │ ├── cuda_drvapi_dynlink_d3d.h │ │ └── cuda_drvapi_dynlink_gl.h │ ├── dynlink_d3d10.h │ ├── dynlink_d3d11.h │ ├── exception.h │ ├── helper_cuda.h │ ├── helper_cuda_drvapi.h │ ├── helper_cuda_gl.h │ ├── helper_cusolver.h │ ├── helper_functions.h │ ├── helper_gl.h │ ├── helper_image.h │ ├── helper_math.h │ ├── helper_string.h │ ├── helper_timer.h │ ├── multithreading.h │ ├── nvMath.h │ ├── nvMatrix.h │ ├── nvQuaternion.h │ ├── nvShaderUtils.h │ ├── nvVector.h │ ├── nvrtc_helper.h │ ├── param.h │ ├── paramgl.h │ ├── rendercheck_d3d10.h │ ├── rendercheck_d3d11.h │ ├── rendercheck_d3d9.h │ ├── rendercheck_gl.h │ ├── rendercheck_gles.h │ └── timer.h │ ├── launchkernels │ ├── ptxjitplus.cpp │ ├── ptxjitplus.h │ └── readme.txt ├── doc ├── checkpoint.png └── doxygen │ ├── Makefile │ ├── doxygen.css │ └── gpgpu-sim.doxygen ├── format-code.sh ├── groovy-html.nightly.success.template ├── groovy-html.success.template ├── libcuda ├── Makefile ├── cuda_api.h ├── cuda_api_object.h ├── cuda_runtime_api.cc ├── cuobjdump.h ├── cuobjdump.l ├── cuobjdump.y └── gpgpu_context.h ├── libopencl ├── Makefile ├── nvopencl_wrapper.cc └── opencl_runtime_api.cc ├── linux-so-version.txt ├── new ├── nightly.jenkinsfile ├── rtao-benchmark ├── .gitignore ├── README.MD ├── build_make │ └── Makefile ├── include │ ├── stb_image │ │ ├── stb_image.cpp │ │ ├── stb_image.h │ │ └── stb_image_write.h │ └── toml11 │ │ ├── LICENSE │ │ ├── toml.hpp │ │ └── toml │ │ ├── color.hpp │ │ ├── combinator.hpp │ │ ├── comments.hpp │ │ ├── datetime.hpp │ │ ├── exception.hpp │ │ ├── from.hpp │ │ ├── get.hpp │ │ ├── into.hpp │ │ ├── lexer.hpp │ │ ├── literal.hpp │ │ ├── parser.hpp │ │ ├── region.hpp │ │ ├── result.hpp │ │ ├── serializer.hpp │ │ ├── source_location.hpp │ │ ├── storage.hpp │ │ ├── string.hpp │ │ ├── traits.hpp │ │ ├── types.hpp │ │ ├── utility.hpp │ │ └── value.hpp ├── scene.toml ├── scenes │ ├── bunny.toml │ ├── dragon.toml │ ├── hairball.toml │ ├── sibenik1.toml │ ├── sibenik2.toml │ ├── sponza1.toml │ ├── sponza2.toml │ └── teapot.toml ├── src │ ├── BVHManager.cpp │ ├── BVHManager.h │ ├── CMake │ │ ├── FindEmbree.cmake │ │ └── FindTBB.cmake │ ├── CUDAAssert.h │ ├── Camera.cpp │ ├── Camera.h │ ├── EmbreeBVHBuilder.cpp │ ├── EmbreeBVHBuilder.h │ ├── FastDeviceMinMax.h │ ├── GPUBVHConverter.cpp │ ├── GPUBVHConverter.h │ ├── Logger.cpp │ ├── Logger.h │ ├── OBJ_Loader.h │ ├── PixelTable.cpp │ ├── PixelTable.hpp │ ├── RayGenerator.cpp │ ├── RayGenerator.h │ ├── RayTraceManager.cpp │ ├── RayTraceManager.h │ ├── SceneParser.cpp │ ├── SceneParser.hpp │ ├── TraversalKernelBVH2.cu │ ├── TraversalKernelBVH2.h │ ├── TraversalKernelCWBVH.cu │ ├── TraversalKernelCWBVH.h │ ├── ValidationKernels.cu │ ├── ValidationKernels.h │ ├── WoopTriangleHelper.h │ ├── helper_math.cu │ ├── helper_math.h │ └── main.cpp └── sweep_scenes.sh ├── run-clang-format.py ├── scripts └── gen_ptxinfo ├── setup_environment ├── src ├── Makefile ├── abstract_hardware_model.cc ├── abstract_hardware_model.h ├── cuda-sim │ ├── Makefile │ ├── cuda-math.h │ ├── cuda-sim.cc │ ├── cuda-sim.h │ ├── cuda_device_printf.cc │ ├── cuda_device_printf.h │ ├── cuda_device_runtime.cc │ ├── cuda_device_runtime.h │ ├── decuda_pred_table │ │ ├── decuda_pred_table.cc │ │ └── decuda_pred_table.h │ ├── half.h │ ├── half.hpp │ ├── instructions.cc │ ├── memory.cc │ ├── memory.h │ ├── opcodes.def │ ├── opcodes.h │ ├── ptx-stats.cc │ ├── ptx-stats.h │ ├── ptx.l │ ├── ptx.y │ ├── ptx_ir.cc │ ├── ptx_ir.h │ ├── ptx_loader.cc │ ├── ptx_loader.h │ ├── ptx_parser.cc │ ├── ptx_parser.h │ ├── ptx_sim.cc │ ├── ptx_sim.h │ ├── ptxinfo.l │ ├── ptxinfo.y │ ├── rt-sim.cc │ ├── rt-sim.h │ └── vector-math.h ├── debug.cc ├── debug.h ├── gpgpu-sim │ ├── Makefile │ ├── addrdec.cc │ ├── addrdec.h │ ├── delayqueue.h │ ├── dram.cc │ ├── dram.h │ ├── dram_sched.cc │ ├── dram_sched.h │ ├── gpu-cache.cc │ ├── gpu-cache.h │ ├── gpu-misc.cc │ ├── gpu-misc.h │ ├── gpu-sim.cc │ ├── gpu-sim.h │ ├── hashing.cc │ ├── hashing.h │ ├── histogram.cc │ ├── histogram.h │ ├── icnt_wrapper.cc │ ├── icnt_wrapper.h │ ├── l2cache.cc │ ├── l2cache.h │ ├── l2cache_trace.h │ ├── local_interconnect.cc │ ├── local_interconnect.h │ ├── mem_fetch.cc │ ├── mem_fetch.h │ ├── mem_fetch_status.tup │ ├── mem_latency_stat.cc │ ├── mem_latency_stat.h │ ├── power_interface.cc │ ├── power_interface.h │ ├── power_stat.cc │ ├── power_stat.h │ ├── ray-predictor.cc │ ├── ray-predictor.h │ ├── scoreboard.cc │ ├── scoreboard.h │ ├── shader.cc │ ├── shader.h │ ├── shader_trace.h │ ├── stack.cc │ ├── stack.h │ ├── stat-tool.cc │ ├── stat-tool.h │ ├── stats.h │ ├── traffic_breakdown.cc │ ├── traffic_breakdown.h │ ├── visualizer.cc │ └── visualizer.h ├── gpgpusim_entrypoint.cc ├── gpgpusim_entrypoint.h ├── gpuwattch │ ├── Alpha21364.xml │ ├── Niagara1.xml │ ├── Niagara1_sharing.xml │ ├── Niagara1_sharing_DC.xml │ ├── Niagara1_sharing_SBT.xml │ ├── Niagara1_sharing_ST.xml │ ├── Niagara2.xml │ ├── Penryn.xml │ ├── README │ ├── XML_Parse.cc │ ├── XML_Parse.h │ ├── Xeon.xml │ ├── arch_const.h │ ├── array.cc │ ├── array.h │ ├── basic_components.cc │ ├── basic_components.h │ ├── cacti │ │ ├── README │ │ ├── Ucache.cc │ │ ├── Ucache.h │ │ ├── arbiter.cc │ │ ├── arbiter.h │ │ ├── area.cc │ │ ├── area.h │ │ ├── bank.cc │ │ ├── bank.h │ │ ├── basic_circuit.cc │ │ ├── basic_circuit.h │ │ ├── batch_tests │ │ ├── cache.cfg │ │ ├── cacti.i │ │ ├── cacti.mk │ │ ├── cacti_interface.cc │ │ ├── cacti_interface.h │ │ ├── component.cc │ │ ├── component.h │ │ ├── const.h │ │ ├── contention.dat │ │ ├── crossbar.cc │ │ ├── crossbar.h │ │ ├── decoder.cc │ │ ├── decoder.h │ │ ├── highradix.cc │ │ ├── highradix.h │ │ ├── htree2.cc │ │ ├── htree2.h │ │ ├── io.cc │ │ ├── io.h │ │ ├── main.cc │ │ ├── makefile │ │ ├── mat.cc │ │ ├── mat.h │ │ ├── nuca.cc │ │ ├── nuca.h │ │ ├── out_batch_test_result.csv │ │ ├── parameter.cc │ │ ├── parameter.h │ │ ├── router.cc │ │ ├── router.h │ │ ├── subarray.cc │ │ ├── subarray.h │ │ ├── technology.cc │ │ ├── uca.cc │ │ ├── uca.h │ │ ├── wire.cc │ │ └── wire.h │ ├── core.cc │ ├── core.h │ ├── fermi.xml │ ├── globalvar.h │ ├── gpgpu.xml │ ├── gpgpu_sim.verify │ ├── gpgpu_sim_wrapper.cc │ ├── gpgpu_sim_wrapper.h │ ├── gpgpu_static.xml │ ├── interconnect.cc │ ├── interconnect.h │ ├── iocontrollers.cc │ ├── iocontrollers.h │ ├── logic.cc │ ├── logic.h │ ├── main.cc │ ├── makefile │ ├── mcpat.mk │ ├── mcpatXeonCore.mk │ ├── memoryctrl.cc │ ├── memoryctrl.h │ ├── noc.cc │ ├── noc.h │ ├── processor.cc │ ├── processor.h │ ├── quadro.xml │ ├── results │ │ ├── Alpha21364 │ │ ├── Alpha21364_90nm │ │ ├── Penryn │ │ ├── T1 │ │ ├── T1_DC_64 │ │ ├── T1_SBT_64 │ │ ├── T1_ST_64 │ │ ├── T2 │ │ ├── Xeon_core │ │ └── Xeon_uncore │ ├── sharedcache.cc │ ├── sharedcache.h │ ├── technology_xeon_core.cc │ ├── version.h │ ├── xmlParser.cc │ └── xmlParser.h ├── intersim2 │ ├── Makefile │ ├── allocators │ │ ├── allocator.cpp │ │ ├── allocator.hpp │ │ ├── islip.cpp │ │ ├── islip.hpp │ │ ├── loa.cpp │ │ ├── loa.hpp │ │ ├── maxsize.cpp │ │ ├── maxsize.hpp │ │ ├── pim.cpp │ │ ├── pim.hpp │ │ ├── selalloc.cpp │ │ ├── selalloc.hpp │ │ ├── separable.cpp │ │ ├── separable.hpp │ │ ├── separable_input_first.cpp │ │ ├── separable_input_first.hpp │ │ ├── separable_output_first.cpp │ │ ├── separable_output_first.hpp │ │ ├── wavefront.cpp │ │ └── wavefront.hpp │ ├── arbiters │ │ ├── arbiter.cpp │ │ ├── arbiter.hpp │ │ ├── matrix_arb.cpp │ │ ├── matrix_arb.hpp │ │ ├── prio_arb.cpp │ │ ├── prio_arb.hpp │ │ ├── roundrobin_arb.cpp │ │ ├── roundrobin_arb.hpp │ │ ├── tree_arb.cpp │ │ └── tree_arb.hpp │ ├── batchtrafficmanager.cpp │ ├── batchtrafficmanager.hpp │ ├── booksim.hpp │ ├── booksim_config.cpp │ ├── booksim_config.hpp │ ├── buffer.cpp │ ├── buffer.hpp │ ├── buffer_state.cpp │ ├── buffer_state.hpp │ ├── channel.hpp │ ├── config.l │ ├── config.y │ ├── config_utils.cpp │ ├── config_utils.hpp │ ├── credit.cpp │ ├── credit.hpp │ ├── examples │ │ ├── cmeshconfig │ │ ├── dragonflyconfig │ │ ├── fattree_config │ │ ├── flatflyconfig │ │ ├── mesh88_lat │ │ ├── singleconfig │ │ └── torus88 │ ├── flit.cpp │ ├── flit.hpp │ ├── flitchannel.cpp │ ├── flitchannel.hpp │ ├── globals.hpp │ ├── gputrafficmanager.cpp │ ├── gputrafficmanager.hpp │ ├── injection.cpp │ ├── injection.hpp │ ├── interconnect_interface.cpp │ ├── interconnect_interface.hpp │ ├── intersim_config.cpp │ ├── intersim_config.hpp │ ├── main.cpp │ ├── misc_utils.cpp │ ├── misc_utils.hpp │ ├── module.cpp │ ├── module.hpp │ ├── networks │ │ ├── anynet.cpp │ │ ├── anynet.hpp │ │ ├── cmesh.cpp │ │ ├── cmesh.hpp │ │ ├── dragonfly.cpp │ │ ├── dragonfly.hpp │ │ ├── fattree.cpp │ │ ├── fattree.hpp │ │ ├── flatfly_onchip.cpp │ │ ├── flatfly_onchip.hpp │ │ ├── fly.cpp │ │ ├── fly.hpp │ │ ├── kncube.cpp │ │ ├── kncube.hpp │ │ ├── network.cpp │ │ ├── network.hpp │ │ ├── qtree.cpp │ │ ├── qtree.hpp │ │ ├── tree4.cpp │ │ └── tree4.hpp │ ├── outputset.cpp │ ├── outputset.hpp │ ├── packet_reply_info.cpp │ ├── packet_reply_info.hpp │ ├── pipefifo.hpp │ ├── power │ │ ├── buffer_monitor.cpp │ │ ├── buffer_monitor.hpp │ │ ├── power_module.cpp │ │ ├── power_module.hpp │ │ ├── switch_monitor.cpp │ │ ├── switch_monitor.hpp │ │ └── techfile.txt │ ├── random_utils.hpp │ ├── rng-double.c │ ├── rng.c │ ├── rng_double_wrapper.cpp │ ├── rng_wrapper.cpp │ ├── routefunc.cpp │ ├── routefunc.hpp │ ├── routers │ │ ├── chaos_router.cpp │ │ ├── chaos_router.hpp │ │ ├── event_router.cpp │ │ ├── event_router.hpp │ │ ├── iq_router.cpp │ │ ├── iq_router.hpp │ │ ├── router.cpp │ │ └── router.hpp │ ├── stats.cpp │ ├── stats.hpp │ ├── timed_module.hpp │ ├── traffic.cpp │ ├── traffic.hpp │ ├── trafficmanager.cpp │ ├── trafficmanager.hpp │ ├── vc.cpp │ └── vc.hpp ├── option_parser.cc ├── option_parser.h ├── statwrapper.cc ├── statwrapper.h ├── stream_manager.cc ├── stream_manager.h ├── tr1_hash_map.h ├── trace.cc ├── trace.h └── trace_streams.tup ├── travis.sh ├── version └── version_detection.mk /.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 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /bitbucket-pipelines.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ubc-aamodt-group/ray-intersection-predictor/29eeb01a8ffeee1294433276a47696eaee6bfd02/bitbucket-pipelines.yml -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /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/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/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 -------------------------------------------------------------------------------- /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 -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /doc/checkpoint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ubc-aamodt-group/ray-intersection-predictor/29eeb01a8ffeee1294433276a47696eaee6bfd02/doc/checkpoint.png -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /format-code.sh: -------------------------------------------------------------------------------- 1 | # This bash script formats GPGPU-Sim using clang-format 2 | THIS_DIR="$( cd "$( dirname "$BASH_SOURCE" )" && pwd )" 3 | clang-format -i ${THIS_DIR}/libcuda/*.h 4 | clang-format -i ${THIS_DIR}/libcuda/*.cc 5 | clang-format -i ${THIS_DIR}/src/*.h 6 | clang-format -i ${THIS_DIR}/src/*.cc 7 | clang-format -i ${THIS_DIR}/src/gpgpu-sim/*.h 8 | clang-format -i ${THIS_DIR}/src/gpgpu-sim/*.cc 9 | clang-format -i ${THIS_DIR}/src/cuda-sim/*.h 10 | clang-format -i ${THIS_DIR}/src/cuda-sim/*.cc 11 | clang-format -i ${THIS_DIR}/src/gpuwattch/*.h 12 | clang-format -i ${THIS_DIR}/src/gpuwattch/*.cc 13 | clang-format -i ${THIS_DIR}/src/trace-driven/*.h 14 | clang-format -i ${THIS_DIR}/src/trace-driven/*.cc 15 | clang-format -i ${THIS_DIR}/src/trace-driven/ISA_Def/*.h 16 | -------------------------------------------------------------------------------- /groovy-html.nightly.success.template: -------------------------------------------------------------------------------- 1 | 55 | 56 | 57 | <% 58 | import hudson.model.* 59 | 60 | def JOB_NAME= build.getEnvVars()["JOB_NAME"]; 61 | def BUILD_NUMBER= build.getEnvVars()["BUILD_NUMBER"]; 62 | def BUILD_URL= build.getEnvVars()["BUILD_URL"]; 63 | %> 64 | 65 | See ${BUILD_URL} for full build detials. 66 | 67 |
Statistics changes since last commit:
68 | 
    https://engineering.purdue.edu/tgrogers/gpgpu-sim-plots/jenkins/${JOB_NAME}/${BUILD_NUMBER}/
69 | 
        Correlation:
70 | 
            9.1:
71 | 
               https://engineering.purdue.edu/tgrogers/gpgpu-sim-plots/jenkins/${JOB_NAME}/${BUILD_NUMBER}/titanv-cycles.cuda-9.1.nightly.html
72 | 
               https://engineering.purdue.edu/tgrogers/gpgpu-sim-plots/jenkins/${JOB_NAME}/${BUILD_NUMBER}/titanv-cycles.cuda-9.1.nightly.apps.txt
73 | 
       Correlation also posted to: https://engineering.purdue.edu/tgrogers/group/correlator.html
74 | 
75 | 


--------------------------------------------------------------------------------
/groovy-html.success.template:
--------------------------------------------------------------------------------
 1 | 
55 | 
56 | 
57 | <%
58 |     import hudson.model.*
59 | 
60 |     def JOB_NAME= build.getEnvVars()["JOB_NAME"];
61 |     def BUILD_NUMBER= build.getEnvVars()["BUILD_NUMBER"];
62 |     def BUILD_URL= build.getEnvVars()["BUILD_URL"];
63 | %>
64 | 
65 | See ${BUILD_URL} for full build detials.
66 | 
67 | 
Statistics changes since last commit:
68 | 
    https://engineering.purdue.edu/tgrogers/gpgpu-sim-plots/jenkins/${JOB_NAME}/${BUILD_NUMBER}/
69 | 
        Correlation:
70 | 
            4.2:
71 | 
               https://engineering.purdue.edu/tgrogers/gpgpu-sim-plots/jenkins/${JOB_NAME}/${BUILD_NUMBER}/titanv-cycles.cuda-4.2.html
72 | 
               https://engineering.purdue.edu/tgrogers/gpgpu-sim-plots/jenkins/${JOB_NAME}/${BUILD_NUMBER}/titanv-cycles.cuda-4.2.apps.txt
73 | 
            10.1:
74 | 
               https://engineering.purdue.edu/tgrogers/gpgpu-sim-plots/jenkins/${JOB_NAME}/${BUILD_NUMBER}/titanv-cycles.cuda-10.1.html
75 | 
               https://engineering.purdue.edu/tgrogers/gpgpu-sim-plots/jenkins/${JOB_NAME}/${BUILD_NUMBER}/titanv-cycles.cuda-10.1.apps.txt
76 | 
       Correlation also posted to: https://engineering.purdue.edu/tgrogers/group/correlator.html
77 | 
78 | 


--------------------------------------------------------------------------------
/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 | 


--------------------------------------------------------------------------------
/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 | 


--------------------------------------------------------------------------------
/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 | 


--------------------------------------------------------------------------------
/rtao-benchmark/build_make/Makefile:
--------------------------------------------------------------------------------
 1 | PROJECT_NAME = CWBVH
 2 | PROJECT_NAME_MAGIC = magic_CWBVH
 3 | BUILD_DIR = ./
 4 | SRC_DIR = ../src/
 5 | INC_DIR = ../include/
 6 | 
 7 | # Embree3
 8 | EMBREE_INCLUDE_DIR = $(HOME)/downloads/embree-3.13.0.x86_64.linux/include
 9 | EMBREE_LIB = $(HOME)/downloads/embree-3.13.0.x86_64.linux/lib
10 | 
11 | # tbb
12 | TBB_INCLUDE_DIR = $(HOME)/intel/oneapi/tbb/2021.2.0/include
13 | TBB_LIB = $(HOME)/intel/oneapi/tbb/2021.2.0/lib/intel64/gcc4.8
14 | 
15 | # Other flags
16 | profile=0
17 | debug=0
18 | 
19 | 
20 | # CUDA
21 | # plain cuda, use this option for running on hardware not on gpgpu-sim
22 | # CUDAPATH = ~/cuda/include
23 | NVCC = $(CUDA_HOME)/bin/nvcc
24 | NVCCFLAGS = -c -g -std=c++11
25 | CUDAARCH = -gencode arch=compute_75,code=compute_75
26 | 
27 | LFLAGS = -lcuda --cudart shared -lembree3 -ltbb
28 | DFLAGS =
29 | 
30 | ifeq ($(profile), 1)
31 | 		DFLAGS += -DENABLE_PROFILING
32 | endif
33 | 
34 | ifeq ($(debug), 1)
35 | 		GPUDEBUGFLAG = -g -G # Only use it when debugging the kernel in cuda gdb, don't set this when running with GPGPU-Sim!
36 | 		DFLAGS += -DDEBUG
37 | else
38 | 		GPUDEBUGFLAG =
39 | endif
40 | 
41 | 
42 | all: regular magic
43 | 
44 | magic: gpu_magic cpu_magic stb_image
45 | 		$(NVCC) $(GPUDEBUGFLAG) $(CUDAARCH) -o $(BUILD_DIR)/$(PROJECT_NAME_MAGIC) *.o -L $(EMBREE_LIB) -L $(TBB_LIB) $(LFLAGS)
46 | 
47 | regular: gpu cpu stb_image
48 | 		$(NVCC) $(GPUDEBUGFLAG) $(CUDAARCH) -o $(BUILD_DIR)/$(PROJECT_NAME) *.o -L $(EMBREE_LIB) -L $(TBB_LIB) $(LFLAGS)
49 | 
50 | gpu:
51 | 		$(NVCC) --keep $(NVCCFLAGS) $(CUDAARCH) $(SRC_DIR)*.cu $(DFLAGS)
52 | 
53 | cpu:
54 | 		$(NVCC) $(NVCCFLAGS) $(CUDAARCH) $(SRC_DIR)*.cpp -I $(INC_DIR) -I $(EMBREE_INCLUDE_DIR) -I $(TBB_INCLUDE_DIR) $(DFLAGS)
55 | 
56 | gpu_magic:
57 | 		$(NVCC) --keep $(NVCCFLAGS) $(CUDAARCH) $(SRC_DIR)*.cu $(DFLAGS) -DMAGIC
58 | 
59 | cpu_magic:
60 | 		$(NVCC) $(NVCCFLAGS) $(CUDAARCH) $(SRC_DIR)*.cpp -I $(INC_DIR) -I $(EMBREE_INCLUDE_DIR) -I $(TBB_INCLUDE_DIR) $(DFLAGS) -DMAGIC
61 | 
62 | stb_image:
63 | 		$(NVCC) $(NVCCFLAGS) $(CUDAARCH) $(INC_DIR)stb_image/stb_image.cpp $(DFLAGS)
64 | 
65 | clean:
66 | 		find . -type f -name _cuobjdump_list_ptx_\* -exec rm {} \;
67 | 		find . -type f -name _app_cuda_version_\* -exec rm {} \;
68 | 		rm -f *.o
69 | 
70 | help:
71 | 		@echo ""
72 | 		@echo "Options:"
73 | 		@echo "    > all: generates regular and 'magic' version"
74 | 		@echo "    > clean: clean up files"
75 | 		@echo "    use_optix=1 to use OptiX"
76 | 		@echo "    profile=1 to enable profiling (not for use with gpgpu-sim)"
77 | 		@echo ""
78 | 


--------------------------------------------------------------------------------
/rtao-benchmark/include/stb_image/stb_image.cpp:
--------------------------------------------------------------------------------
1 | #define STB_IMAGE_IMPLEMENTATION
2 | #define STB_IMAGE_WRITE_IMPLEMENTATION
3 | 
4 | #include "stb_image.h"
5 | #include "stb_image_write.h"
6 | 


--------------------------------------------------------------------------------
/rtao-benchmark/include/toml11/LICENSE:
--------------------------------------------------------------------------------
 1 | The MIT License (MIT)
 2 | 
 3 | Copyright (c) 2017 Toru Niina
 4 | 
 5 | Permission is hereby granted, free of charge, to any person obtaining a copy
 6 | of this software and associated documentation files (the "Software"), to deal
 7 | in the Software without restriction, including without limitation the rights
 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 | 
12 | The above copyright notice and this permission notice shall be included in
13 | all copies or substantial portions of the Software.
14 | 
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | THE SOFTWARE.
22 | 


--------------------------------------------------------------------------------
/rtao-benchmark/include/toml11/toml.hpp:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * The MIT License (MIT)
 3 |  *
 4 |  * Copyright (c) 2017 Toru Niina
 5 |  *
 6 |  * Permission is hereby granted, free of charge, to any person obtaining a copy
 7 |  * of this software and associated documentation files (the "Software"), to deal
 8 |  * in the Software without restriction, including without limitation the rights
 9 |  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 |  * copies of the Software, and to permit persons to whom the Software is
11 |  * furnished to do so, subject to the following conditions:
12 |  *
13 |  * The above copyright notice and this permission notice shall be included in
14 |  * all copies or substantial portions of the Software.
15 |  *
16 |  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 |  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 |  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 |  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 |  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 |  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 |  * THE SOFTWARE.
23 |  */
24 | 
25 | #ifndef TOML_FOR_MODERN_CPP
26 | #define TOML_FOR_MODERN_CPP
27 | 
28 | #ifndef __cplusplus
29 | #    error "__cplusplus is not defined"
30 | #endif
31 | 
32 | #if __cplusplus < 201103L && _MSC_VER < 1900
33 | #    error "toml11 requires C++11 or later."
34 | #endif
35 | 
36 | #define TOML11_VERSION_MAJOR 3
37 | #define TOML11_VERSION_MINOR 5
38 | #define TOML11_VERSION_PATCH 0
39 | 
40 | #include "toml/parser.hpp"
41 | #include "toml/literal.hpp"
42 | #include "toml/serializer.hpp"
43 | #include "toml/get.hpp"
44 | 
45 | #endif// TOML_FOR_MODERN_CPP
46 | 


--------------------------------------------------------------------------------
/rtao-benchmark/include/toml11/toml/color.hpp:
--------------------------------------------------------------------------------
 1 | #ifndef TOML11_COLOR_HPP
 2 | #define TOML11_COLOR_HPP
 3 | #include 
 4 | #include 
 5 | 
 6 | #ifdef TOML11_COLORIZE_ERROR_MESSAGE
 7 | #define TOML11_ERROR_MESSAGE_COLORIZED true
 8 | #else
 9 | #define TOML11_ERROR_MESSAGE_COLORIZED false
10 | #endif
11 | 
12 | namespace toml
13 | {
14 | 
15 | // put ANSI escape sequence to ostream
16 | namespace color_ansi
17 | {
18 | namespace detail
19 | {
20 | inline int colorize_index()
21 | {
22 |     static const int index = std::ios_base::xalloc();
23 |     return index;
24 | }
25 | } // detail
26 | 
27 | inline std::ostream& colorize(std::ostream& os)
28 | {
29 |     // by default, it is zero.
30 |     os.iword(detail::colorize_index()) = 1;
31 |     return os;
32 | }
33 | inline std::ostream& nocolorize(std::ostream& os)
34 | {
35 |     os.iword(detail::colorize_index()) = 0;
36 |     return os;
37 | }
38 | inline std::ostream& reset  (std::ostream& os)
39 | {if(os.iword(detail::colorize_index()) == 1) {os << "\033[00m";} return os;}
40 | inline std::ostream& bold   (std::ostream& os)
41 | {if(os.iword(detail::colorize_index()) == 1) {os << "\033[01m";} return os;}
42 | inline std::ostream& grey   (std::ostream& os)
43 | {if(os.iword(detail::colorize_index()) == 1) {os << "\033[30m";} return os;}
44 | inline std::ostream& red    (std::ostream& os)
45 | {if(os.iword(detail::colorize_index()) == 1) {os << "\033[31m";} return os;}
46 | inline std::ostream& green  (std::ostream& os)
47 | {if(os.iword(detail::colorize_index()) == 1) {os << "\033[32m";} return os;}
48 | inline std::ostream& yellow (std::ostream& os)
49 | {if(os.iword(detail::colorize_index()) == 1) {os << "\033[33m";} return os;}
50 | inline std::ostream& blue   (std::ostream& os)
51 | {if(os.iword(detail::colorize_index()) == 1) {os << "\033[34m";} return os;}
52 | inline std::ostream& magenta(std::ostream& os)
53 | {if(os.iword(detail::colorize_index()) == 1) {os << "\033[35m";} return os;}
54 | inline std::ostream& cyan   (std::ostream& os)
55 | {if(os.iword(detail::colorize_index()) == 1) {os << "\033[36m";} return os;}
56 | inline std::ostream& white  (std::ostream& os)
57 | {if(os.iword(detail::colorize_index()) == 1) {os << "\033[37m";} return os;}
58 | } // color_ansi
59 | 
60 | // ANSI escape sequence is the only and default colorization method currently
61 | namespace color = color_ansi;
62 | 
63 | } // toml
64 | #endif// TOML11_COLOR_HPP
65 | 


--------------------------------------------------------------------------------
/rtao-benchmark/include/toml11/toml/exception.hpp:
--------------------------------------------------------------------------------
 1 | //     Copyright Toru Niina 2017.
 2 | // Distributed under the MIT License.
 3 | #ifndef TOML11_EXCEPTION_HPP
 4 | #define TOML11_EXCEPTION_HPP
 5 | #include 
 6 | #include 
 7 | 
 8 | #include "source_location.hpp"
 9 | 
10 | namespace toml
11 | {
12 | 
13 | struct exception : public std::exception
14 | {
15 |   public:
16 |     explicit exception(const source_location& loc): loc_(loc) {}
17 |     virtual ~exception() noexcept override = default;
18 |     virtual const char* what() const noexcept override {return "";}
19 |     virtual source_location const& location() const noexcept {return loc_;}
20 | 
21 |   protected:
22 |     source_location loc_;
23 | };
24 | 
25 | struct syntax_error : public toml::exception
26 | {
27 |   public:
28 |     explicit syntax_error(const std::string& what_arg, const source_location& loc)
29 |         : exception(loc), what_(what_arg)
30 |     {}
31 |     virtual ~syntax_error() noexcept override = default;
32 |     virtual const char* what() const noexcept override {return what_.c_str();}
33 | 
34 |   protected:
35 |     std::string what_;
36 | };
37 | 
38 | struct type_error : public toml::exception
39 | {
40 |   public:
41 |     explicit type_error(const std::string& what_arg, const source_location& loc)
42 |         : exception(loc), what_(what_arg)
43 |     {}
44 |     virtual ~type_error() noexcept override = default;
45 |     virtual const char* what() const noexcept override {return what_.c_str();}
46 | 
47 |   protected:
48 |     std::string what_;
49 | };
50 | 
51 | struct internal_error : public toml::exception
52 | {
53 |   public:
54 |     explicit internal_error(const std::string& what_arg, const source_location& loc)
55 |         : exception(loc), what_(what_arg)
56 |     {}
57 |     virtual ~internal_error() noexcept override = default;
58 |     virtual const char* what() const noexcept override {return what_.c_str();}
59 | 
60 |   protected:
61 |     std::string what_;
62 | };
63 | 
64 | } // toml
65 | #endif // TOML_EXCEPTION
66 | 


--------------------------------------------------------------------------------
/rtao-benchmark/include/toml11/toml/from.hpp:
--------------------------------------------------------------------------------
 1 | //     Copyright Toru Niina 2019.
 2 | // Distributed under the MIT License.
 3 | #ifndef TOML11_FROM_HPP
 4 | #define TOML11_FROM_HPP
 5 | #include "traits.hpp"
 6 | 
 7 | namespace toml
 8 | {
 9 | 
10 | template
11 | struct from;
12 | // {
13 | //     static T from_toml(const toml::value& v)
14 | //     {
15 | //         // User-defined conversions ...
16 | //     }
17 | // };
18 | 
19 | } // toml
20 | #endif // TOML11_FROM_HPP
21 | 


--------------------------------------------------------------------------------
/rtao-benchmark/include/toml11/toml/into.hpp:
--------------------------------------------------------------------------------
 1 | //     Copyright Toru Niina 2019.
 2 | // Distributed under the MIT License.
 3 | #ifndef TOML11_INTO_HPP
 4 | #define TOML11_INTO_HPP
 5 | #include "traits.hpp"
 6 | 
 7 | namespace toml
 8 | {
 9 | 
10 | template
11 | struct into;
12 | // {
13 | //     static toml::value into_toml(const T& user_defined_type)
14 | //     {
15 | //         // User-defined conversions ...
16 | //     }
17 | // };
18 | 
19 | } // toml
20 | #endif // TOML11_INTO_HPP
21 | 


--------------------------------------------------------------------------------
/rtao-benchmark/include/toml11/toml/storage.hpp:
--------------------------------------------------------------------------------
 1 | //     Copyright Toru Niina 2017.
 2 | // Distributed under the MIT License.
 3 | #ifndef TOML11_STORAGE_HPP
 4 | #define TOML11_STORAGE_HPP
 5 | #include "utility.hpp"
 6 | 
 7 | namespace toml
 8 | {
 9 | namespace detail
10 | {
11 | 
12 | // this contains pointer and deep-copy the content if copied.
13 | // to avoid recursive pointer.
14 | template
15 | struct storage
16 | {
17 |     using value_type = T;
18 | 
19 |     explicit storage(value_type const& v): ptr(toml::make_unique(v)) {}
20 |     explicit storage(value_type&&      v): ptr(toml::make_unique(std::move(v))) {}
21 |     ~storage() = default;
22 |     storage(const storage& rhs): ptr(toml::make_unique(*rhs.ptr)) {}
23 |     storage& operator=(const storage& rhs)
24 |     {
25 |         this->ptr = toml::make_unique(*rhs.ptr);
26 |         return *this;
27 |     }
28 |     storage(storage&&) = default;
29 |     storage& operator=(storage&&) = default;
30 | 
31 |     bool is_ok() const noexcept {return static_cast(ptr);}
32 | 
33 |     value_type&       value() &      noexcept {return *ptr;}
34 |     value_type const& value() const& noexcept {return *ptr;}
35 |     value_type&&      value() &&     noexcept {return std::move(*ptr);}
36 | 
37 |   private:
38 |     std::unique_ptr ptr;
39 | };
40 | 
41 | } // detail
42 | } // toml
43 | #endif// TOML11_STORAGE_HPP
44 | 


--------------------------------------------------------------------------------
/rtao-benchmark/include/toml11/toml/utility.hpp:
--------------------------------------------------------------------------------
 1 | //     Copyright Toru Niina 2017.
 2 | // Distributed under the MIT License.
 3 | #ifndef TOML11_UTILITY_HPP
 4 | #define TOML11_UTILITY_HPP
 5 | #include 
 6 | #include 
 7 | #include 
 8 | 
 9 | #include "traits.hpp"
10 | 
11 | #if __cplusplus >= 201402L
12 | #  define TOML11_MARK_AS_DEPRECATED(msg) [[deprecated(msg)]]
13 | #elif defined(__GNUC__)
14 | #  define TOML11_MARK_AS_DEPRECATED(msg) __attribute__((deprecated(msg)))
15 | #elif defined(_MSC_VER)
16 | #  define TOML11_MARK_AS_DEPRECATED(msg) __declspec(deprecated(msg))
17 | #else
18 | #  define TOML11_MARK_AS_DEPRECATED
19 | #endif
20 | 
21 | namespace toml
22 | {
23 | 
24 | #if __cplusplus >= 201402L
25 | 
26 | using std::make_unique;
27 | 
28 | #else
29 | 
30 | template
31 | inline std::unique_ptr make_unique(Ts&& ... args)
32 | {
33 |     return std::unique_ptr(new T(std::forward(args)...));
34 | }
35 | 
36 | #endif // __cplusplus >= 2014
37 | 
38 | namespace detail
39 | {
40 | template
41 | void try_reserve_impl(Container& container, std::size_t N, std::true_type)
42 | {
43 |     container.reserve(N);
44 |     return;
45 | }
46 | template
47 | void try_reserve_impl(Container&, std::size_t, std::false_type) noexcept
48 | {
49 |     return;
50 | }
51 | } // detail
52 | 
53 | template
54 | void try_reserve(Container& container, std::size_t N)
55 | {
56 |     if(N <= container.size()) {return;}
57 |     detail::try_reserve_impl(container, N, detail::has_reserve_method{});
58 |     return;
59 | }
60 | 
61 | namespace detail
62 | {
63 | inline std::string concat_to_string_impl(std::ostringstream& oss)
64 | {
65 |     return oss.str();
66 | }
67 | template
68 | std::string concat_to_string_impl(std::ostringstream& oss, T&& head, Ts&& ... tail)
69 | {
70 |     oss << std::forward(head);
71 |     return concat_to_string_impl(oss, std::forward(tail) ... );
72 | }
73 | } // detail
74 | 
75 | template
76 | std::string concat_to_string(Ts&& ... args)
77 | {
78 |     std::ostringstream oss;
79 |     oss << std::boolalpha << std::fixed;
80 |     return detail::concat_to_string_impl(oss, std::forward(args) ...);
81 | }
82 | 
83 | template
84 | T from_string(const std::string& str, T opt)
85 | {
86 |     T v(opt);
87 |     std::istringstream iss(str);
88 |     iss >> v;
89 |     return v;
90 | }
91 | 
92 | }// toml
93 | #endif // TOML11_UTILITY
94 | 


--------------------------------------------------------------------------------
/rtao-benchmark/scenes/bunny.toml:
--------------------------------------------------------------------------------
 1 | [options]
 2 | cwbvh = false
 3 | max_depth = 5
 4 | spp = 10
 5 | shading = "diffuse" # Diffuse shading
 6 | sort = false # Sort rays
 7 | 
 8 | #---------------------------------------------------------------------------------------------------
 9 | # Bunny
10 | #---------------------------------------------------------------------------------------------------
11 | [model]
12 | name = "bunny"
13 | output = "bunny.jpg"
14 | 
15 | [camera]
16 | resolution = [1280, 720]
17 | position = [0.0, 0.7, 2.5]
18 | target = [0.0, 0.7, 0.0]
19 | up = [0.0, 1.0, 0.0]
20 | fovy = 45.0
21 | 


--------------------------------------------------------------------------------
/rtao-benchmark/scenes/dragon.toml:
--------------------------------------------------------------------------------
 1 | [options]
 2 | cwbvh = false
 3 | max_depth = 5
 4 | spp = 10
 5 | shading = "diffuse" # Diffuse shading
 6 | sort = false # Sort rays
 7 | 
 8 | #---------------------------------------------------------------------------------------------------
 9 | # Dragon
10 | #---------------------------------------------------------------------------------------------------
11 | [model]
12 | name = "dragon"
13 | output = "dragon.jpg"
14 | 
15 | [camera]
16 | resolution = [1280, 720]
17 | position = [-0.8, 0.1, -0.8]
18 | target = [0.0, 0.0, 0.0]
19 | up = [0.0, 1.0, 0.0]
20 | fovy = 45.0
21 | 


--------------------------------------------------------------------------------
/rtao-benchmark/scenes/hairball.toml:
--------------------------------------------------------------------------------
 1 | [options]
 2 | cwbvh = false
 3 | max_depth = 5
 4 | spp = 10
 5 | shading = "diffuse" # Diffuse shading
 6 | sort = false # Sort rays
 7 | 
 8 | #---------------------------------------------------------------------------------------------------
 9 | # Hairball
10 | #---------------------------------------------------------------------------------------------------
11 | [model]
12 | name = "hairball"
13 | output = "hairball.jpg"
14 | 
15 | [camera]
16 | resolution = [1280, 720]
17 | position = [0.0, 0.0, 9.0]
18 | target = [0.0, 0.0, 0.0]
19 | up = [0.0, 1.0, 0.0]
20 | fovy = 45.0
21 | 


--------------------------------------------------------------------------------
/rtao-benchmark/scenes/sibenik1.toml:
--------------------------------------------------------------------------------
 1 | [options]
 2 | cwbvh = false
 3 | max_depth = 5
 4 | spp = 10
 5 | shading = "diffuse" # Diffuse shading
 6 | sort = false # Sort rays
 7 | 
 8 | #---------------------------------------------------------------------------------------------------
 9 | # Sibenik
10 | #---------------------------------------------------------------------------------------------------
11 | [model]
12 | name = "sibenik"
13 | output = "sibenik1.jpg"
14 | 
15 | [camera]
16 | resolution = [1280, 720]
17 | position = [-5.0, -12.0, 0.0]
18 | target = [0.0, -12.0, 0.0]
19 | up = [0.0, 1.0, 0.0]
20 | fovy = 45.0
21 | 


--------------------------------------------------------------------------------
/rtao-benchmark/scenes/sibenik2.toml:
--------------------------------------------------------------------------------
 1 | [options]
 2 | cwbvh = false
 3 | max_depth = 5
 4 | spp = 10
 5 | shading = "diffuse" # Diffuse shading
 6 | sort = false # Sort rays
 7 | 
 8 | #---------------------------------------------------------------------------------------------------
 9 | # Sibenik
10 | #---------------------------------------------------------------------------------------------------
11 | [model]
12 | name = "sibenik"
13 | output = "sibenik2.jpg"
14 | 
15 | [camera]
16 | resolution = [1280, 720]
17 | position = [14.0, -8.6, 8.0]
18 | target = [4.4, -12.0, 0.5]
19 | up = [0.0, 1.0, 0.0]
20 | fovy = 45.0
21 | 


--------------------------------------------------------------------------------
/rtao-benchmark/scenes/sponza1.toml:
--------------------------------------------------------------------------------
 1 | [options]
 2 | cwbvh = false
 3 | max_depth = 5
 4 | spp = 10
 5 | shading = "diffuse" # Diffuse shading
 6 | sort = false # Sort rays
 7 | 
 8 | #---------------------------------------------------------------------------------------------------
 9 | # CrySponza
10 | #---------------------------------------------------------------------------------------------------
11 | [model]
12 | name = "sponza"
13 | output = "sponza1.jpg"
14 | 
15 | [camera]
16 | resolution = [1280, 720]
17 | position = [1220.0, 700.0, -170.0]
18 | target = [0.0, 400.0, 0.0]
19 | up = [0.0, 1.0, 0.0]
20 | fovy = 45.0
21 | 


--------------------------------------------------------------------------------
/rtao-benchmark/scenes/sponza2.toml:
--------------------------------------------------------------------------------
 1 | [options]
 2 | cwbvh = false
 3 | max_depth = 5
 4 | spp = 10
 5 | shading = "diffuse" # Diffuse shading
 6 | sort = false # Sort rays
 7 | 
 8 | #---------------------------------------------------------------------------------------------------
 9 | # CrySponza
10 | #---------------------------------------------------------------------------------------------------
11 | [model]
12 | name = "sponza"
13 | output = "sponza2.jpg"
14 | 
15 | [camera]
16 | resolution = [1280, 720]
17 | position = [780.0, 270.0, 500.0]
18 | target = [-85.0, 120.0, 240.0]
19 | up = [0.0, 1.0, 0.0]
20 | fovy = 45.0
21 | 


--------------------------------------------------------------------------------
/rtao-benchmark/scenes/teapot.toml:
--------------------------------------------------------------------------------
 1 | [options]
 2 | cwbvh = false
 3 | max_depth = 5
 4 | spp = 10
 5 | shading = "diffuse" # Diffuse shading
 6 | sort = false # Sort rays
 7 | 
 8 | #---------------------------------------------------------------------------------------------------
 9 | # Teapot
10 | #---------------------------------------------------------------------------------------------------
11 | [model]
12 | name = "teapot"
13 | output = "teapot.jpg"
14 | 
15 | [camera]
16 | resolution = [1280, 720]
17 | position = [0.0, 40.0, 150.0]
18 | target = [0.0, 40.0, 0.0]
19 | up = [0.0, 1.0, 0.0]
20 | fovy = 45.0
21 | 


--------------------------------------------------------------------------------
/rtao-benchmark/src/BVHManager.h:
--------------------------------------------------------------------------------
 1 | 
 2 | #include 
 3 | 
 4 | class RayGenerator;
 5 | 
 6 | class BVHManager {
 7 |   public:
 8 |     BVHManager() {};
 9 |     ~BVHManager() {};
10 | 
11 |     void buildBVH2(RayGenerator& rg);
12 |     void buildCWBVH(RayGenerator& rg);
13 |     void newBuildCWBVH(RayGenerator& rg);
14 | 
15 |   private:
16 | 
17 |     friend class RayTraceManager;
18 | };


--------------------------------------------------------------------------------
/rtao-benchmark/src/CUDAAssert.h:
--------------------------------------------------------------------------------
 1 | #pragma once
 2 | #undef NDEBUG
 3 | #include 
 4 | #include "Logger.h"
 5 | 
 6 | #define cudaCheck(x) \
 7 | 	{ \
 8 | 		cudaError_t err = (x); \
 9 | 		if (err != cudaSuccess) { \
10 | 			Log("Line %d: cudaCheckError: %s", __LINE__, cudaGetErrorString(err)); \
11 | 			assert(0); \
12 | 		} \
13 | 	}
14 | 


--------------------------------------------------------------------------------
/rtao-benchmark/src/Camera.cpp:
--------------------------------------------------------------------------------
 1 | #include "Camera.h"
 2 | 
 3 | Camera::Camera(const float3& position,
 4 |                const float3& target,
 5 |                const float3& up,
 6 |                uint width,
 7 |                uint height,
 8 |                float fovy)
 9 |     : position(position), target(target), up(up), width(width), height(height), fovy(fovy) {
10 |     float3 w = normalize(position - target);
11 |     float3 u = normalize(cross(up, w));
12 |     float3 v = cross(w, u);
13 | 
14 |     basis = matrix4x4::From3Cols(make_float4(u, 0.0f), make_float4(v, 0.0f), make_float4(w, 0.0f));
15 | 
16 |     const auto to_rad = [](float deg) { return deg / 180.0f * M_PI; };
17 | 
18 |     half_fovy = to_rad(fovy) / 2.0f;
19 |     half_fovx = half_fovy * width / height;
20 |     half_width = width / 2.0f;
21 |     half_height = height / 2.0f;
22 | }
23 | 
24 | Ray Camera::create_primary_ray(float x, float y, float t_min, float t_max) const {
25 |     float alpha = tan(half_fovx) * (x - half_width) / half_width;
26 |     float beta = tan(half_fovy) * (half_height - y) / half_height;
27 | 
28 |     float3 direction = normalize(basis.transformVector3(make_float3(alpha, beta, -1.0f)));
29 | 
30 |     Ray ray;
31 |     ray.make_ray(
32 |         position.x, position.y, position.z,
33 |         direction.x, direction.y, direction.z,
34 |         t_min, t_max);
35 | 
36 |     return ray;
37 | }


--------------------------------------------------------------------------------
/rtao-benchmark/src/Camera.h:
--------------------------------------------------------------------------------
 1 | #pragma once
 2 | 
 3 | #include "helper_math.h"
 4 | 
 5 | class Camera {
 6 | public:
 7 |     Camera() = default;
 8 | 
 9 |     Camera(const float3& position,
10 |            const float3& target,
11 |            const float3& up,
12 |            uint width,
13 |            uint height,
14 |            float fovy);
15 | 
16 |     Ray create_primary_ray(float x, float y, float t_min, float t_max) const;
17 | 
18 |     uint get_width() const { return width; }
19 |     uint get_height() const { return height; }
20 |     float3 get_position() const { return position; }
21 | 
22 | private:
23 |     float3 position;
24 |     float3 target;
25 |     float3 up;
26 |     uint width;
27 |     uint height;
28 |     float fovy;
29 | 
30 |     matrix4x4 basis;
31 |     float half_fovy;
32 |     float half_fovx;
33 |     float half_width;
34 |     float half_height;
35 | };


--------------------------------------------------------------------------------
/rtao-benchmark/src/EmbreeBVHBuilder.h:
--------------------------------------------------------------------------------
 1 | #pragma once
 2 | 
 3 | #include 
 4 | #include 
 5 | #include "helper_math.h"
 6 | 
 7 | template 
 8 | class BVHNNode
 9 | {
10 | public:
11 | 	float3 ChildrenMin[N];
12 | 	float3 ChildrenMax[N];
13 | 	BVHNNode* Children[N] = {};
14 | 	int ChildCount = 0;
15 | 	int* LeafPrimitiveRefs = nullptr;
16 | 	int LeafPrimitiveCount = 0;
17 | 
18 | 	void Release()
19 | 	{
20 | 		for (int i = 0; i < N; i++)
21 | 			if (Children[i] != nullptr)
22 | 			{
23 | 				Children[i]->Release();
24 | 				delete Children[i];
25 | 				Children[i] = nullptr;
26 | 			}
27 | 
28 | 		if (LeafPrimitiveCount > 0)
29 | 		{
30 | 			delete[] LeafPrimitiveRefs;
31 | 			LeafPrimitiveRefs = nullptr;
32 | 		}
33 | 	}
34 | 	
35 | 	void print() {
36 | 		for (int i=0; i BVH2Node;
43 | typedef BVHNNode<8> BVH8Node;
44 | 
45 | BVH2Node* BuildBVH2AABB(int NumPrimitives, std::function GetPrimitiveBoundsFunc);
46 | BVH8Node* BuildBVH8AABB(int NumPrimitives, std::function GetPrimitiveBoundsFunc);
47 | 
48 | BVH2Node* BuildBVH2Triangle(std::vector& IndexBuffer, std::vector VertexBuffer);
49 | BVH8Node* BuildBVH8Triangle(std::vector& IndexBuffer, std::vector VertexBuffer);
50 | 
51 | struct MeshDescription
52 | {
53 | 	std::vector* IndexBuffer;
54 | 	std::vector* VertexBuffer;
55 | };
56 | 


--------------------------------------------------------------------------------
/rtao-benchmark/src/GPUBVHConverter.h:
--------------------------------------------------------------------------------
 1 | #pragma once
 2 | 
 3 | #include 
 4 | #include "EmbreeBVHBuilder.h"
 5 | 
 6 | struct GPUBVHIntermediates
 7 | {
 8 | 	std::vector BVHNodeData;
 9 | 	std::vector InlinedPrimitives;
10 | 	std::vector    PrimitiveIndices;
11 | };
12 | 
13 | struct meta
14 | {
15 | 	unsigned char upper : 3, lower : 5;
16 | };
17 | 
18 | struct CWBVHNode
19 | {
20 | 	float3 pOrigin;
21 | 	char3 e;
22 | 	unsigned char imask;
23 | 	unsigned int nodeBaseIndex, triBaseIndex;
24 | 	uchar3 qlo[8];	
25 | 	uchar3 qhi[8];	
26 | 	meta childMetaData[8];
27 | 
28 | };
29 | 
30 | struct CWBVHIntermediates
31 | {
32 | 	std::vector BVHNodeData;
33 | 	std::vector InlinedPrimitives;
34 | 	std::vector    PrimitiveIndices;
35 | };
36 | 
37 | void ConvertToGPUBVH2(
38 | 	BVH2Node*& root,
39 | 	std::function& InlinedPrimitives)> AppendPrimitiveFunc,
40 | 	GPUBVHIntermediates& OutIntermediates
41 | );
42 | 
43 | void ConvertToGPUCompressedWideBVH(
44 | 	BVH8Node * root,
45 | 	std::function& InlinedPrimitives)> AppendPrimitiveFunc,
46 | 	GPUBVHIntermediates& OutIntermediates
47 | );
48 | 
49 | void newConvertToGPUCompressedWideBVH(
50 | 	BVH8Node * root,
51 | 	std::function& InlinedPrimitives)> AppendPrimitiveFunc,
52 | 	CWBVHIntermediates& OutIntermediates
53 | );
54 | 
55 | void WoopifyTriangle(
56 | 	float3 v0,
57 | 	float3 v1,
58 | 	float3 v2,
59 | 	float4& OutWoopifiedV0,
60 | 	float4& OutWoopifiedV1,
61 | 	float4& OutWoopifiedV2
62 | );
63 | 
64 | 


--------------------------------------------------------------------------------
/rtao-benchmark/src/Logger.cpp:
--------------------------------------------------------------------------------
 1 | #include 
 2 | #include 
 3 | #include 
 4 | #include "Logger.h"
 5 | 
 6 | void Log(const char* format, ...)
 7 | {
 8 | 	va_list argptr;
 9 | 	va_start(argptr, format);
10 | 	vprintf((std::string(format) + "\n").c_str(), argptr);
11 | 	va_end(argptr);
12 | }
13 | 


--------------------------------------------------------------------------------
/rtao-benchmark/src/Logger.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | 
3 | extern void(*LogMessageWriter)(const wchar_t* message);
4 | 
5 | void Log(const char* format, ...);
6 | 


--------------------------------------------------------------------------------
/rtao-benchmark/src/RayTraceManager.h:
--------------------------------------------------------------------------------
 1 | #include "helper_math.h"
 2 | #include 
 3 | #include 
 4 | 
 5 | class RayGenerator;
 6 | class BVHManager;
 7 | 
 8 | enum class TraceType {
 9 |   Aila,
10 |   CWBVH,
11 | #ifdef OPTIX_PRIME
12 |   OptiXPrime,
13 | #endif
14 | };
15 | 
16 | class RayTraceManager {
17 |   public:
18 |     RayTraceManager(RayGenerator& rg);
19 |     ~RayTraceManager() {};
20 | 
21 |     void traceOptiXPrime(RayGenerator& rg);
22 |     void traceAila(RayGenerator& rg);
23 |     void traceCWBVH(RayGenerator& rg);
24 |     void traceCWBVHSingleRay(RayGenerator& rg);
25 |     void traceOptiX(RayGenerator& rg);
26 | 
27 |     void pathtrace(RayGenerator& rg, TraceType type);
28 |     void ao(RayGenerator& rg, TraceType type);
29 |     void outputToImage(RayGenerator& rg, const std::string& out_image_path);
30 |     void updatePixels(RayGenerator& rg);
31 | 
32 |     void evaluateAndPrintForPLYVisualization(RayGenerator& rg, const std::string& out_ply_path);
33 |     void debugging(RayGenerator& rg);
34 |     
35 |     uint getNumRays() { return numRays; }
36 |     void setNumRays(uint n);
37 | 
38 |     void setAnyHit(bool anyhit) { this->anyhit = anyhit; }
39 |     bool getAnyHit(bool anyhit) { return anyhit; };
40 | 
41 |     void setMaxDepth(int depth) { maxDepth = depth; }
42 |     int getMaxDepth() const { return maxDepth; }
43 | 
44 |     void setShading(const std::string& shading) { this->shading = shading; }
45 | 
46 |     void setSortRays(bool sort) { this->sort = sort; }
47 |     bool getSortRays(bool sort) { return sort; };
48 | 
49 |   private:
50 |     void allocCudaHits(size_t num);
51 | 
52 |     uint numRays;
53 |     Hit* cudaHits;
54 |     bool anyhit;
55 |     int maxDepth;
56 |     std::string shading;
57 |     bool sort;
58 |     std::vector pixels;
59 | };


--------------------------------------------------------------------------------
/rtao-benchmark/src/SceneParser.cpp:
--------------------------------------------------------------------------------
 1 | #include "SceneParser.hpp"
 2 | 
 3 | SceneParser::SceneParser(const std::string& path) : parsed_data(toml::parse(path)) {}
 4 | 
 5 | SceneParser::Options SceneParser::get_options() const {
 6 |     bool cwbvh = toml::find(parsed_data, "options", "cwbvh");
 7 |     int max_depth = toml::find(parsed_data, "options", "max_depth");
 8 |     int spp = toml::find(parsed_data, "options", "spp");
 9 |     std::string shading = toml::find(parsed_data, "options", "shading");
10 |     bool sort = toml::find(parsed_data, "options", "sort");
11 | 
12 |     return { cwbvh, max_depth, spp, shading, sort };
13 | }
14 | 
15 | SceneParser::Model SceneParser::get_model() const {
16 |     std::string name = toml::find(parsed_data, "model", "name");
17 |     std::string output = toml::find(parsed_data, "model", "output");
18 | 
19 |     return { name, output };
20 | }
21 | 
22 | SceneParser::Camera SceneParser::get_camera() const {
23 |     std::array position = toml::find>(parsed_data, "camera", "position");
24 |     std::array target = toml::find>(parsed_data, "camera", "target");
25 |     std::array up = toml::find>(parsed_data, "camera", "up");
26 |     std::array resolution = toml::find>(parsed_data, "camera", "resolution");
27 |     float fovy = toml::find(parsed_data, "camera", "fovy");
28 | 
29 |     return { position, target, up, resolution, fovy };
30 | }
31 | 


--------------------------------------------------------------------------------
/rtao-benchmark/src/SceneParser.hpp:
--------------------------------------------------------------------------------
 1 | #pragma once
 2 | 
 3 | #include 
 4 | 
 5 | class SceneParser {
 6 | public:
 7 |     struct Options {
 8 |         bool cwbvh;
 9 |         int max_depth;
10 |         int spp;
11 |         std::string shading;
12 |         bool sort;
13 |     };
14 | 
15 |     struct Model {
16 |         std::string name;
17 |         std::string output;
18 |     };
19 | 
20 |     struct Camera {
21 |         std::array position;
22 |         std::array target;
23 |         std::array up;
24 |         std::array resolution;
25 |         float fovy;
26 |     };
27 | 
28 |     SceneParser(const std::string& path);
29 | 
30 |     Options get_options() const;
31 |     Model get_model() const;
32 |     Camera get_camera() const;
33 | 
34 | private:
35 |     toml::value parsed_data;
36 | };
37 | 


--------------------------------------------------------------------------------
/rtao-benchmark/src/TraversalKernelBVH2.h:
--------------------------------------------------------------------------------
 1 | #pragma once
 2 | 
 3 | void rtBindBVH2Data(
 4 | 	const float4* InBVHTreeNodes,
 5 | 	const float4* InTriangleWoopCoordinates,
 6 | 	const int* InMappingFromTriangleAddressToIndex);
 7 | 
 8 | void rtTraceBVH2(
 9 | 	Ray* rayBuffer,
10 | 	Hit* rayResultBuffer,
11 | 	int rayCount,
12 | 	bool anyhit);
13 | 


--------------------------------------------------------------------------------
/rtao-benchmark/src/TraversalKernelCWBVH.h:
--------------------------------------------------------------------------------
 1 | #pragma once
 2 | 
 3 | void rtBindCWBVHData(
 4 | 	const float4* InBVHTreeNodes,
 5 | 	const float4* InTriangleWoopCoordinates,
 6 | 	const int* InMappingFromTriangleAddressToIndex);
 7 | 
 8 | void rtTraceCWBVH(
 9 | 	Ray* rayBuffer,
10 | 	Hit* rayResultBuffer,
11 | 	int rayCount,
12 | 	bool anyhit);
13 | 


--------------------------------------------------------------------------------
/rtao-benchmark/src/ValidationKernels.h:
--------------------------------------------------------------------------------
 1 | void GenerateValidationTriangles(int Count, std::vector& OutVertexBuffer, std::vector& OutIndexBuffer);
 2 | Ray* GenerateValidationRays(int Count);
 3 | Ray* GenerateRaysFromFile(std::vector &c_rays, int Count);
 4 | Ray* GenerateAORaysUniform(
 5 | 	int NumTexels,
 6 | 	int NumRaysPerTexel,
 7 | 	float4* WorldPosition,
 8 | 	float4* WorldNormal,
 9 | 	float* TexelRadius
10 | );
11 | 


--------------------------------------------------------------------------------
/rtao-benchmark/src/helper_math.cu:
--------------------------------------------------------------------------------
 1 | #include 
 2 | #include "helper_math.h"
 3 | 
 4 | inline __host__ __device__ int2 abs(int2 v)
 5 | {
 6 |   return make_int2(abs(v.x), abs(v.y));
 7 | }
 8 | inline __host__ __device__ int3 abs(int3 v)
 9 | {
10 |   return make_int3(abs(v.x), abs(v.y), abs(v.z));
11 | }
12 | inline __host__ __device__ int4 abs(int4 v)
13 | {
14 |   return make_int4(abs(v.x), abs(v.y), abs(v.z), abs(v.w));
15 | }
16 | 
17 | template
18 | __inline__ __device__
19 | T warpReduceSum(T val) {
20 |   for (int offset = warpSize / 2; offset > 0; offset /= 2)
21 |     val += __shfl_down_sync(__activemask(), val, offset);
22 |   return val;
23 | }
24 | 
25 | template
26 | __inline__ __device__
27 | T blockReduceSumToThread0(T val) {
28 | 
29 |   static __shared__ T shared[32]; // Shared mem for 32 partial sums
30 |   int lane = (threadIdx.y * blockDim.x + threadIdx.x) % warpSize;
31 |   int wid = (threadIdx.y * blockDim.x + threadIdx.x) / warpSize;
32 | 
33 |   val = warpReduceSum(val);     // Each warp performs partial reduction
34 | 
35 |   if (lane == 0) shared[wid] = val; // Write reduced value to shared memory
36 | 
37 |   __syncthreads();              // Wait for all partial reductions
38 | 
39 |                   //read from shared memory only if that warp existed
40 |   val = ((threadIdx.y * blockDim.x + threadIdx.x) < blockDim.x * blockDim.y / warpSize) ? shared[lane] : 0;
41 | 
42 |   if (wid == 0) val = warpReduceSum(val); //Final reduce within first warp
43 | 
44 |   return val;
45 | }


--------------------------------------------------------------------------------
/rtao-benchmark/sweep_scenes.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | 
3 | cd build_make
4 | 
5 | for scene in ../scenes/*; do
6 |     ./CWBVH --pathtrace --cwbvh --config ../scenes/$scene
7 |     ./CWBVH --pathtrace --config ../scenes/$scene
8 | done
9 | 


--------------------------------------------------------------------------------
/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/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/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 | 


--------------------------------------------------------------------------------
/src/cuda-sim/decuda_pred_table/decuda_pred_table.h:
--------------------------------------------------------------------------------
1 | bool pred_lookup(int condition, int flags);
2 | 


--------------------------------------------------------------------------------
/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/cuda-sim/rt-sim.h:
--------------------------------------------------------------------------------
 1 | #ifndef RAY_TRACE_FUNCTION_INCLUDED
 2 | #define RAY_TRACE_FUNCTION_INCLUDED
 3 | 
 4 | 
 5 | #define MAX(a,b) (((a)>(b))?(a):(b))
 6 | #define MIN(a,b) (((a)<(b))?(a):(b))
 7 | #define MIN_MAX(a,b,c) MAX(MIN((a), (b)), (c))
 8 | #define MAX_MIN(a,b,c) MIN(MAX((a), (b)), (c))
 9 | 
10 | #define EMPTY_STACK 0x7654321
11 | #define MAX_TRAVERSAL_STACK_SIZE 32
12 | 
13 | // #define DEBUG_PRINT
14 | 
15 | // Debugging
16 | void print_float4(float4 printVal);
17 | void print_stack(std::list &traversal_stack);
18 | 
19 | // Trace Ray
20 | void trace_ray(const class ptx_instruction * pI, class ptx_thread_info * thread, const class function_info * target_func);
21 | float magic_max7(float a0, float a1, float b0, float b1, float c0, float c1, float d);
22 | float magic_min7(float a0, float a1, float b0, float b1, float c0, float c1, float d);
23 | float3 get_t_bound(float3 box, float3 origin, float3 idirection);
24 | 
25 | // Predictor
26 | typedef uint64_t(*HashFunc)(const Ray&, const float3&, const float3&);
27 | std::vector get_ray_hashes(const Ray&, const float3&, const float3&);
28 | 
29 | // Ray Data Types
30 | struct Hit
31 | {
32 | 	float4 t_triId_u_v;
33 | 	//float4 triNormal_instId;
34 | 	//float4 geom_normal;
35 | 	//float4 texcoord;
36 | };
37 | 
38 | struct meta
39 | {
40 | 	unsigned char upper : 3, lower : 5;
41 | };
42 | 
43 | bool ray_box_test(float3 low, float3 high, float3 direction, float3 origin, float tmin, float tmax, float& thit);
44 | bool mt_ray_triangle_test(float3 p0, float3 p1, float3 p2, Ray ray_properties, float* thit);
45 | bool rtao_ray_triangle_test(float4 v00, float4 v11, float4 v22, Ray ray_properties, float* thit, Hit& ray_payload);
46 | bool rtao_ray_triangle_test(float4 v00, float4 v11, float4 v22, Ray ray_properties, float* thit);
47 | Hit traverse_intersect(addr_t next_node, Ray ray_properties, addr_t node_start, addr_t tri_start, class ptx_thread_info * thread, memory_space * mem, std::map &tree_level_map);
48 | 
49 | unsigned bfind(unsigned a);
50 | unsigned popc(unsigned a);
51 | float uint_as_float(unsigned int a);
52 | float3 calculate_idir(float3 direction);
53 | 
54 | #endif


--------------------------------------------------------------------------------
/src/cuda-sim/vector-math.h:
--------------------------------------------------------------------------------
 1 | #ifndef VECTOR_MATH_INCLUDED
 2 | #define VECTOR_MATH_INCLUDED
 3 | 
 4 | float3 make_float3(float a, float b, float c)
 5 | {
 6 |     return {a, b, c};
 7 | }
 8 | float4 make_float4(float a, float b, float c, float d)
 9 | {
10 |     return {a, b, c, d};
11 | }
12 | 
13 | // Subtraction
14 | float3 operator-(float3 a, float3 b)
15 | {
16 |     return make_float3(a.x - b.x, a.y - b.y, a.z - b.z);
17 | }
18 | 
19 | // Addition
20 | float3 operator+(float3 a, float3 b)
21 | {
22 |     return make_float3(a.x + b.x, a.y + b.y, a.z + b.z);
23 | }
24 | 
25 | // Multiply elements
26 | float3 operator*(float3 a, float3 b)
27 | {
28 |     return make_float3(a.x * b.x, a.y * b.y, a.z * b.z);
29 | }
30 | 
31 | float3 operator*(float3 a, float s)
32 | {
33 |     return make_float3(a.x * s, a.y * s, a.z * s);
34 | }
35 | 
36 | float3 operator*(float s, float3 a)
37 | {
38 |     return make_float3(a.x * s, a.y * s, a.z * s);
39 | }
40 | 
41 | // Cross Product
42 | float3 cross(float3 a, float3 b)
43 | {
44 |     return make_float3(a.y*b.z - a.z*b.y, a.z*b.x - a.x*b.z, a.x*b.y - a.y*b.x);
45 | }
46 | 
47 | // Dot Product
48 | float dot(float3 a, float3 b)
49 | {
50 |     return a.x * b.x + a.y * b.y + a.z * b.z;
51 | }
52 | 
53 | /* FLOAT 4 */
54 | float4 operator-(float4 a, float4 b)
55 | {
56 |     return make_float4(a.x - b.x, a.y - b.y, a.z - b.z,  a.w - b.w);
57 | }
58 | 
59 | float4 operator+(float4 a, float4 b)
60 | {
61 |     return make_float4(a.x + b.x, a.y + b.y, a.z + b.z,  a.w + b.w);
62 | }
63 | 
64 | float4 operator*(float4 a, float4 b)
65 | {
66 |     return make_float4(a.x * b.x, a.y * b.y, a.z * b.z,  a.w * b.w);
67 | }
68 | 
69 | float clamp(float x, float lo, float hi)
70 | {
71 |     return std::max(std::min(x, hi), lo);
72 | }
73 | 
74 | float3 min(float3 a, float3 b)
75 | {
76 |     return make_float3(std::min(a.x, b.x), std::min(a.y, b.y), std::min(a.z, b.z));
77 | }
78 | 
79 | float3 max(float3 a, float3 b)
80 | {
81 |     return make_float3(std::max(a.x, b.x), std::max(a.y, b.y), std::max(a.z, b.z));
82 | }
83 | 
84 | const float PI = 3.14159265358979323846;
85 | 
86 | #endif


--------------------------------------------------------------------------------
/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/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/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 | 


--------------------------------------------------------------------------------
/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/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 |   RT_C_MEM,
37 |   RT_T_MEM,
38 |   G_MEM_LD,
39 |   L_MEM_LD,
40 |   G_MEM_ST,
41 |   L_MEM_ST,
42 |   N_MEM_STAGE_ACCESS_TYPE
43 | };
44 | enum tlb_request_status { TLB_HIT = 0, TLB_READY, TLB_PENDING };
45 | enum mem_stage_stall_type {
46 |   NO_RC_FAIL = 0,
47 |   BK_CONF,
48 |   MSHR_RC_FAIL,
49 |   ICNT_RC_FAIL,
50 |   COAL_STALL,
51 |   TLB_STALL,
52 |   DATA_PORT_STALL,
53 |   WB_ICNT_RC_FAIL,
54 |   WB_CACHE_RSRV_FAIL,
55 |   N_MEM_STAGE_STALL_TYPE
56 | };
57 | 
58 | #endif
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/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 | 


--------------------------------------------------------------------------------
/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/gpuwattch/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/gpuwattch/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"


--------------------------------------------------------------------------------
/src/gpuwattch/cacti/cacti.mk:
--------------------------------------------------------------------------------
 1 | 
 2 | OUTPUT_DIR=$(SIM_OBJ_FILES_DIR)/gpuwattch/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/gpuwattch/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/gpuwattch/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 | 


--------------------------------------------------------------------------------
/src/gpuwattch/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/gpuwattch/gpgpu_sim.verify:
--------------------------------------------------------------------------------
1 | /********************** GPGPU-Sim Verification File **********************/
2 | This file ensures that the GPGPU-Sim version of McPAT is included.
3 | /*************************************************************************/
4 | 


--------------------------------------------------------------------------------
/src/gpuwattch/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/gpuwattch/mcpat.mk:
--------------------------------------------------------------------------------
  1 | 
  2 | OUTPUT_DIR=$(SIM_OBJ_FILES_DIR)/gpuwattch
  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/gpuwattch/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/gpuwattch/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/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/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/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/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/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/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/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/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/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 | 


--------------------------------------------------------------------------------
/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/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/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/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 | 


--------------------------------------------------------------------------------
/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 | 


--------------------------------------------------------------------------------
/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/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/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 | 


--------------------------------------------------------------------------------
/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/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/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/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/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/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/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/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 | 


--------------------------------------------------------------------------------
/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/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/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/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/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/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/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/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/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 | 


--------------------------------------------------------------------------------
/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


--------------------------------------------------------------------------------
/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/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 | 


--------------------------------------------------------------------------------
/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 | 


--------------------------------------------------------------------------------
/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/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/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 | 


--------------------------------------------------------------------------------
/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 | 


--------------------------------------------------------------------------------
/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/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/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 | 


--------------------------------------------------------------------------------
/travis.sh:
--------------------------------------------------------------------------------
 1 | if [ ! -n "$CUDA_INSTALL_PATH" ]; then
 2 | 	echo "ERROR ** Install CUDA Toolkit and set CUDA_INSTALL_PATH.";
 3 | 	exit;
 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;
 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;
14 | fi
15 | 
16 | export PATH=$CUDA_INSTALL_PATH/bin:$PATH
17 | source ./setup_environment
18 | make -j
19 | 
20 | pip install psutil
21 | rm -rf accel-sim-framework
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 | 


--------------------------------------------------------------------------------
/version:
--------------------------------------------------------------------------------
1 | const char *g_gpgpusim_version_string = "GPGPU-Sim Simulator Version 4.0.0 ";
2 | 


--------------------------------------------------------------------------------