├── .gitignore ├── AUTHORS ├── COPYING ├── ChangeLog ├── Doxyfile ├── Makefile.am ├── NEWS ├── README ├── TODO ├── bin ├── .gitignore └── m2s-visual.py ├── configure.ac ├── docker ├── build-env │ └── Dockerfile ├── debug │ └── Dockerfile └── release │ └── Dockerfile ├── images ├── alu_engine.png ├── back-double.png ├── back-single.png ├── back-triple.png ├── cf_engine.png ├── close-sel.png ├── close.png ├── engines.odg ├── forward-double.png ├── forward-single.png ├── forward-triple.png ├── go.png ├── m2s-icon.png ├── m2s-icon.xcf └── tex_engine.png ├── runtime ├── .gitignore ├── Makefile.am ├── cuda │ ├── .gitignore │ ├── Makefile.am │ ├── api-rt.c │ ├── api.c │ ├── api.h │ ├── context.c │ ├── context.h │ ├── debug.c │ ├── debug.h │ ├── device.c │ ├── device.h │ ├── elf-format.c │ ├── elf-format.h │ ├── event.c │ ├── event.h │ ├── function-arg.c │ ├── function-arg.h │ ├── function.c │ ├── function.h │ ├── list.c │ ├── list.h │ ├── memory.c │ ├── memory.h │ ├── mhandle.c │ ├── mhandle.h │ ├── misc.c │ ├── misc.h │ ├── module.c │ ├── module.h │ ├── stream.c │ └── stream.h ├── hsa │ ├── .gitignore │ ├── Makefile.am │ ├── debug.c │ ├── debug.h │ ├── hsa.c │ ├── hsa.h │ ├── hsa_agent.c │ ├── hsa_code_object.c │ ├── hsa_executable.c │ ├── hsa_finalize.c │ ├── hsa_isa.c │ ├── hsa_queue.c │ ├── hsa_region.c │ ├── hsa_signal.c │ └── hsa_system.c ├── include │ ├── .gitignore │ ├── CL │ │ └── cl.h │ ├── GL │ │ ├── gl.h │ │ ├── glew.h │ │ ├── glu.h │ │ └── glut.h │ ├── Makefile.am │ ├── cuda.h │ ├── cuda_runtime.h │ ├── cuda_runtime_api.h │ ├── hsa.h │ └── hsa_ext_finalize.h └── opencl │ ├── .gitignore │ ├── Makefile.am │ ├── command-queue.c │ ├── command-queue.h │ ├── command.c │ ├── command.h │ ├── context.c │ ├── context.h │ ├── debug.c │ ├── debug.h │ ├── device.c │ ├── device.h │ ├── elf-format.c │ ├── elf-format.h │ ├── event.c │ ├── event.h │ ├── evg-device.c │ ├── evg-device.h │ ├── evg-kernel.c │ ├── evg-kernel.h │ ├── evg-program.c │ ├── evg-program.h │ ├── kernel.c │ ├── kernel.h │ ├── list.c │ ├── list.h │ ├── mem.c │ ├── mem.h │ ├── mhandle.c │ ├── mhandle.h │ ├── misc.c │ ├── misc.h │ ├── object.c │ ├── object.h │ ├── opencl.c │ ├── opencl.h │ ├── platform.c │ ├── platform.h │ ├── program.c │ ├── program.h │ ├── sampler.c │ ├── sampler.h │ ├── si-device.c │ ├── si-device.h │ ├── si-kernel.c │ ├── si-kernel.h │ ├── si-program.c │ ├── si-program.h │ ├── string.c │ ├── string.h │ ├── thread-list.c │ ├── thread-list.h │ ├── union-device.c │ ├── union-device.h │ ├── union-kernel.c │ ├── union-kernel.h │ ├── union-program.c │ ├── union-program.h │ ├── x86-device-wi.s │ ├── x86-device.c │ ├── x86-device.h │ ├── x86-kernel.c │ ├── x86-kernel.h │ ├── x86-program.c │ └── x86-program.h ├── samples ├── arm │ ├── test-args │ ├── test-args.c │ ├── test-sort │ └── test-sort.c ├── fused │ ├── mem-config │ ├── net-config │ ├── si-config │ └── x86-config ├── hsa │ ├── .gitignore │ ├── histogram │ │ ├── hist │ │ ├── hist_benchmark.cc │ │ ├── hist_benchmark.h │ │ ├── isa.debug │ │ ├── kernels.cl │ │ ├── kernels.h │ │ ├── kernels.hsail │ │ ├── kernels.snackwrap.c │ │ ├── kernels_brig.h │ │ └── main.cc │ └── vector_copy │ │ ├── .gitignore │ │ ├── Makefile │ │ ├── loader.debug │ │ ├── vector_copy │ │ ├── vector_copy.brig │ │ ├── vector_copy.c │ │ └── vector_copy.cl ├── kepler │ └── vectorAdd │ │ ├── vectorAdd │ │ ├── vector_add.cu │ │ └── vector_add.cubin ├── memory │ ├── example-1 │ │ ├── README │ │ ├── mem-config │ │ └── x86-config │ ├── example-2 │ │ ├── README │ │ ├── mem-config │ │ ├── net-config │ │ └── x86-config │ ├── example-3 │ │ ├── README │ │ ├── mem-config │ │ ├── net-config │ │ └── x86-config │ ├── example-4 │ │ ├── README │ │ ├── evg-config │ │ ├── mem-config │ │ └── x86-config │ └── example-5 │ │ ├── README │ │ ├── mem-config │ │ ├── si-config │ │ └── x86-config ├── mips │ ├── test-args │ ├── test-args.c │ ├── test-sort │ └── test-sort.c ├── network │ ├── example-1 │ │ ├── README │ │ └── net-si │ ├── example-10 │ │ ├── README │ │ ├── ctx-config │ │ ├── mem-si-44 │ │ ├── net-si-44 │ │ └── si-config-44 │ ├── example-11 │ │ ├── README │ │ ├── ctx-config │ │ ├── mem-x86-40 │ │ ├── net-x86-40 │ │ └── x86-config-40 │ ├── example-12 │ │ ├── README │ │ └── net-cycle.ini │ ├── example-13 │ │ ├── README │ │ └── net-config │ ├── example-14 │ │ ├── README │ │ └── net-config.ini │ ├── example-15 │ │ ├── README │ │ ├── ctx-config │ │ ├── mem-si │ │ ├── net-ideal │ │ └── si-config │ ├── example-2 │ │ ├── README │ │ ├── ctx-config │ │ ├── mem-si │ │ ├── net-si │ │ └── si-config │ ├── example-3 │ │ ├── README │ │ └── net-bus │ ├── example-4 │ │ ├── README │ │ └── net-mesh │ ├── example-5 │ │ ├── README │ │ └── net-config.ini │ ├── example-6 │ │ ├── README │ │ └── net-mesh-routing │ ├── example-7 │ │ ├── README │ │ └── net-torus │ ├── example-8 │ │ ├── Mesh-40-final.eps │ │ ├── README │ │ ├── ctx-config │ │ ├── mem-si │ │ ├── net-mesh-si │ │ └── si-config │ ├── example-9 │ │ ├── README │ │ ├── ctx-config │ │ ├── mem-si-32 │ │ ├── net-si-32 │ │ └── si-config-32 │ ├── graphplot │ └── scripts │ │ ├── mesh_maker-X_Y-Routing.sh │ │ ├── mesh_maker-full.sh │ │ ├── si-bus-ideal.sh │ │ ├── si-default_crossbar.sh │ │ ├── si-ideal.sh │ │ └── torus_maker-full.sh ├── southern-islands │ ├── 7770 │ │ ├── mem-config │ │ └── si-config │ ├── 7850 │ │ ├── mem-config │ │ └── si-config │ ├── 7870 │ │ ├── mem-config │ │ └── si-config │ ├── 7970 │ │ ├── mem-config │ │ ├── mem-config-unified-L1s │ │ └── si-config │ └── scripts │ │ ├── README │ │ └── si_ideal_config_maker.sh └── x86 │ ├── example-1 │ ├── README │ ├── ctx-config.ini │ ├── test-args │ ├── test-args.c │ └── x86-config.ini │ ├── example-2 │ ├── README │ ├── ctx-config.ini │ ├── test-sort │ ├── test-sort.c │ └── x86-config.ini │ ├── example-3 │ ├── README │ ├── ctx-config.ini │ ├── test-args │ ├── test-args.c │ ├── test-sort │ ├── test-sort.c │ └── x86-config.ini │ └── example-4 │ ├── README │ ├── ctx-config.ini │ ├── test-threads │ ├── test-threads.c │ └── x86-config.ini ├── src ├── .gitignore ├── Makefile.am ├── arch │ ├── .gitignore │ ├── Makefile.am │ ├── arm │ │ ├── .gitignore │ │ ├── Makefile.am │ │ ├── disassembler │ │ │ ├── .gitignore │ │ │ ├── Disassembler.cc │ │ │ ├── Disassembler.h │ │ │ ├── Instruction.cc │ │ │ ├── Instruction.def │ │ │ ├── Instruction.h │ │ │ ├── InstructionThumb.def │ │ │ ├── InstructionThumb32.def │ │ │ └── Makefile.am │ │ ├── emulator │ │ │ ├── .gitignore │ │ │ ├── Context.cc │ │ │ ├── Context.h │ │ │ ├── ContextIsa.cc │ │ │ ├── ContextIsaArm32.cc │ │ │ ├── ContextIsaThumb16.cc │ │ │ ├── ContextIsaThumb32.cc │ │ │ ├── ContextLoader.cc │ │ │ ├── ContextSignal.cc │ │ │ ├── ContextSyscall.cc │ │ │ ├── ContextSyscall.def │ │ │ ├── Emulator.cc │ │ │ ├── Emulator.h │ │ │ ├── Makefile.am │ │ │ ├── Regs.cc │ │ │ ├── Regs.h │ │ │ └── Signal.h │ │ └── timing │ │ │ ├── .gitignore │ │ │ └── Makefile.am │ ├── common │ │ ├── .gitignore │ │ ├── Arch.cc │ │ ├── Arch.h │ │ ├── CallStack.cc │ │ ├── CallStack.h │ │ ├── Context.cc │ │ ├── Context.h │ │ ├── Disassembler.cc │ │ ├── Disassembler.h │ │ ├── Driver.cc │ │ ├── Driver.h │ │ ├── Emulator.cc │ │ ├── Emulator.h │ │ ├── FileTable.cc │ │ ├── FileTable.h │ │ ├── Makefile.am │ │ ├── Runtime.cc │ │ ├── Runtime.h │ │ ├── Timing.cc │ │ └── Timing.h │ ├── hsa │ │ ├── .gitignore │ │ ├── Makefile.am │ │ ├── disassembler │ │ │ ├── .gitignore │ │ │ ├── AsmService.cc │ │ │ ├── AsmService.h │ │ │ ├── Brig.h │ │ │ ├── BrigCodeEntry.h │ │ │ ├── BrigCodeEntryDump.cc │ │ │ ├── BrigCodeEntryGetter.cc │ │ │ ├── BrigDataEntry.cc │ │ │ ├── BrigDataEntry.h │ │ │ ├── BrigEntry.cc │ │ │ ├── BrigEntry.h │ │ │ ├── BrigFile.cc │ │ │ ├── BrigFile.h │ │ │ ├── BrigImmed.cc │ │ │ ├── BrigImmed.h │ │ │ ├── BrigOperandEntry.cc │ │ │ ├── BrigOperandEntry.h │ │ │ ├── BrigSection.cc │ │ │ ├── BrigSection.h │ │ │ ├── Disassembler.cc │ │ │ ├── Disassembler.h │ │ │ ├── Instruction.def │ │ │ └── Makefile.am │ │ ├── driver │ │ │ ├── .gitignore │ │ │ ├── Driver.cc │ │ │ ├── Driver.def │ │ │ ├── Driver.h │ │ │ ├── DriverCall.cc │ │ │ ├── DriverCallHandler.h │ │ │ ├── DriverCallbackInfo.h │ │ │ ├── HsaExecutable.cc │ │ │ ├── HsaExecutable.h │ │ │ ├── HsaExecutableSymbol.cc │ │ │ ├── HsaExecutableSymbol.h │ │ │ ├── HsaProgram.cc │ │ │ ├── HsaProgram.h │ │ │ ├── Makefile.am │ │ │ ├── Signal.cc │ │ │ ├── Signal.h │ │ │ ├── SignalDestroyHandler.cc │ │ │ ├── SignalDestroyHandler.h │ │ │ ├── SignalManager.cc │ │ │ └── SignalManager.h │ │ └── emulator │ │ │ ├── .gitignore │ │ │ ├── AQLPacket.cc │ │ │ ├── AQLPacket.h │ │ │ ├── AQLQueue.cc │ │ │ ├── AQLQueue.h │ │ │ ├── AddInstructionWorker.cc │ │ │ ├── AddInstructionWorker.h │ │ │ ├── AndInstructionWorker.cc │ │ │ ├── AndInstructionWorker.h │ │ │ ├── AtomicNoRetInstructionWorker.cc │ │ │ ├── AtomicNoRetInstructionWorker.h │ │ │ ├── BarrierInstructionWorker.cc │ │ │ ├── BarrierInstructionWorker.h │ │ │ ├── BrInstructionWorker.cc │ │ │ ├── BrInstructionWorker.h │ │ │ ├── CbrInstructionWorker.cc │ │ │ ├── CbrInstructionWorker.h │ │ │ ├── CmpInstructionWorker.cc │ │ │ ├── CmpInstructionWorker.h │ │ │ ├── Component.cc │ │ │ ├── Component.h │ │ │ ├── CurrentWorkGroupSizeInstructionWorker.cc │ │ │ ├── CurrentWorkGroupSizeInstructionWorker.h │ │ │ ├── CurrentWorkGroupSizeInstructionWorker_test.cc │ │ │ ├── CvtInstructionWorker.cc │ │ │ ├── CvtInstructionWorker.h │ │ │ ├── Emulator.cc │ │ │ ├── Emulator.h │ │ │ ├── Function.cc │ │ │ ├── Function.h │ │ │ ├── Grid.cc │ │ │ ├── Grid.h │ │ │ ├── GridSizeInstructionWorker.cc │ │ │ ├── GridSizeInstructionWorker.h │ │ │ ├── HsaInstructionWorker.cc │ │ │ ├── HsaInstructionWorker.h │ │ │ ├── LdInstructionWorker.cc │ │ │ ├── LdInstructionWorker.h │ │ │ ├── LdaInstructionWorker.cc │ │ │ ├── LdaInstructionWorker.h │ │ │ ├── MadInstructionWorker.cc │ │ │ ├── MadInstructionWorker.h │ │ │ ├── MadInstructionWorker_test.cc │ │ │ ├── Makefile.am │ │ │ ├── MemFenceInstructionWorker.cc │ │ │ ├── MemFenceInstructionWorker.h │ │ │ ├── MovInstructionWorker.cc │ │ │ ├── MovInstructionWorker.h │ │ │ ├── MulInstructionWorker.cc │ │ │ ├── MulInstructionWorker.h │ │ │ ├── OperandValueRetriever.cc │ │ │ ├── OperandValueRetriever.h │ │ │ ├── OperandValueWriter.cc │ │ │ ├── OperandValueWriter.h │ │ │ ├── OrInstructionWorker.cc │ │ │ ├── OrInstructionWorker.h │ │ │ ├── RetInstructionWorker.cc │ │ │ ├── RetInstructionWorker.h │ │ │ ├── SegmentManager.cc │ │ │ ├── SegmentManager.h │ │ │ ├── ShlInstructionWorker.cc │ │ │ ├── ShlInstructionWorker.h │ │ │ ├── ShrInstructionWorker.cc │ │ │ ├── ShrInstructionWorker.h │ │ │ ├── Signal.cc │ │ │ ├── Signal.h │ │ │ ├── StInstructionWorker.cc │ │ │ ├── StInstructionWorker.h │ │ │ ├── StackFrame.cc │ │ │ ├── StackFrame.h │ │ │ ├── SubInstructionWorker.cc │ │ │ ├── SubInstructionWorker.h │ │ │ ├── Variable.cc │ │ │ ├── Variable.h │ │ │ ├── Wavefront.cc │ │ │ ├── Wavefront.h │ │ │ ├── WorkGroup.cc │ │ │ ├── WorkGroup.h │ │ │ ├── WorkGroupIdInstructionWorker.cc │ │ │ ├── WorkGroupIdInstructionWorker.h │ │ │ ├── WorkGroupIdInstructionWorker_test.cc │ │ │ ├── WorkItem.cc │ │ │ ├── WorkItem.h │ │ │ ├── WorkItemAbsIdInstructionWorker.cc │ │ │ ├── WorkItemAbsIdInstructionWorker.h │ │ │ ├── WorkItemIdInstructionWorker.cc │ │ │ ├── WorkItemIdInstructionWorker.h │ │ │ ├── WorkItemIdInstructionWorker_test.cc │ │ │ └── WorkItemIsa.cc │ ├── kepler │ │ ├── .gitignore │ │ ├── Makefile.am │ │ ├── disassembler │ │ │ ├── .gitignore │ │ │ ├── Disassembler.cc │ │ │ ├── Disassembler.h │ │ │ ├── Instruction.cc │ │ │ ├── Instruction.def │ │ │ ├── Instruction.h │ │ │ └── Makefile.am │ │ ├── driver │ │ │ ├── .gitignore │ │ │ ├── Argument.cc │ │ │ ├── Argument.h │ │ │ ├── Driver.cc │ │ │ ├── Driver.def │ │ │ ├── Driver.h │ │ │ ├── DriverCall.cc │ │ │ ├── Function.cc │ │ │ ├── Function.h │ │ │ ├── Makefile.am │ │ │ ├── Module.cc │ │ │ └── Module.h │ │ └── emulator │ │ │ ├── .gitignore │ │ │ ├── Emulator.cc │ │ │ ├── Emulator.h │ │ │ ├── Grid.cc │ │ │ ├── Grid.h │ │ │ ├── Makefile.am │ │ │ ├── Register.h │ │ │ ├── ReturnAddressStack.cc │ │ │ ├── ReturnAddressStack.h │ │ │ ├── SyncStack.cc │ │ │ ├── SyncStack.h │ │ │ ├── Thread.cc │ │ │ ├── Thread.h │ │ │ ├── ThreadBlock.cc │ │ │ ├── ThreadBlock.h │ │ │ ├── ThreadIsa.cc │ │ │ ├── Warp.cc │ │ │ ├── Warp.h │ │ │ └── Warp.h.bakup │ ├── mips │ │ ├── .gitignore │ │ ├── Makefile.am │ │ ├── disassembler │ │ │ ├── .gitignore │ │ │ ├── Disassembler.cc │ │ │ ├── Disassembler.h │ │ │ ├── Inst.cc │ │ │ ├── Inst.def │ │ │ ├── Inst.h │ │ │ ├── Instruction.cc │ │ │ ├── Instruction.def │ │ │ ├── Instruction.h │ │ │ └── Makefile.am │ │ ├── emulator │ │ │ ├── .gitignore │ │ │ ├── Context.cc │ │ │ ├── Context.h │ │ │ ├── ContextIsa.cc │ │ │ ├── ContextLoader.cc │ │ │ ├── ContextSignal.cc │ │ │ ├── ContextSyscall.cc │ │ │ ├── ContextSyscall.def │ │ │ ├── Emulator.cc │ │ │ ├── Emulator.h │ │ │ ├── File.cc │ │ │ ├── File.h │ │ │ ├── Makefile.am │ │ │ ├── Mem.cc │ │ │ ├── Mem.h │ │ │ ├── Regs.cc │ │ │ ├── Regs.h │ │ │ ├── Signal.cc │ │ │ └── Signal.h │ │ └── timing │ │ │ ├── .gitignore │ │ │ └── Makefile.am │ ├── southern-islands │ │ ├── .gitignore │ │ ├── Makefile.am │ │ ├── disassembler │ │ │ ├── .gitignore │ │ │ ├── Argument.cc │ │ │ ├── Argument.h │ │ │ ├── Binary.cc │ │ │ ├── Binary.h │ │ │ ├── Disassembler.cc │ │ │ ├── Disassembler.h │ │ │ ├── Instruction.cc │ │ │ ├── Instruction.def │ │ │ ├── Instruction.h │ │ │ └── Makefile.am │ │ ├── driver │ │ │ ├── .gitignore │ │ │ ├── Driver.cc │ │ │ ├── Driver.def │ │ │ ├── Driver.h │ │ │ ├── DriverCall.cc │ │ │ ├── Kernel.cc │ │ │ ├── Kernel.h │ │ │ ├── Makefile.am │ │ │ ├── Program.cc │ │ │ └── Program.h │ │ ├── emulator │ │ │ ├── .gitignore │ │ │ ├── Emulator.cc │ │ │ ├── Emulator.h │ │ │ ├── Makefile.am │ │ │ ├── NDRange.cc │ │ │ ├── NDRange.h │ │ │ ├── Wavefront.cc │ │ │ ├── Wavefront.h │ │ │ ├── WorkGroup.cc │ │ │ ├── WorkGroup.h │ │ │ ├── WorkItem.cc │ │ │ ├── WorkItem.h │ │ │ └── WorkItemIsa.cc │ │ └── timing │ │ │ ├── .gitignore │ │ │ ├── BranchUnit.cc │ │ │ ├── BranchUnit.h │ │ │ ├── ComputeUnit.cc │ │ │ ├── ComputeUnit.h │ │ │ ├── ExecutionUnit.cc │ │ │ ├── ExecutionUnit.h │ │ │ ├── FetchBuffer.cc │ │ │ ├── FetchBuffer.h │ │ │ ├── Gpu.cc │ │ │ ├── Gpu.h │ │ │ ├── LdsUnit.cc │ │ │ ├── LdsUnit.h │ │ │ ├── Makefile.am │ │ │ ├── ScalarUnit.cc │ │ │ ├── ScalarUnit.h │ │ │ ├── SimdUnit.cc │ │ │ ├── SimdUnit.h │ │ │ ├── Timing.cc │ │ │ ├── Timing.h │ │ │ ├── Uop.cc │ │ │ ├── Uop.h │ │ │ ├── VectorMemoryUnit.cc │ │ │ ├── VectorMemoryUnit.h │ │ │ ├── WavefrontPool.cc │ │ │ └── WavefrontPool.h │ └── x86 │ │ ├── .gitignore │ │ ├── Makefile.am │ │ ├── disassembler │ │ ├── .gitignore │ │ ├── Disassembler.cc │ │ ├── Disassembler.h │ │ ├── Instruction.cc │ │ ├── Instruction.def │ │ ├── Instruction.h │ │ └── Makefile.am │ │ ├── emulator │ │ ├── .gitignore │ │ ├── Context.cc │ │ ├── Context.h │ │ ├── ContextIsa.cc │ │ ├── ContextIsaCtrl.cc │ │ ├── ContextIsaFp.cc │ │ ├── ContextIsaMisc.cc │ │ ├── ContextIsaRot.cc │ │ ├── ContextIsaSse.cc │ │ ├── ContextIsaSse2.cc │ │ ├── ContextIsaSse3.cc │ │ ├── ContextIsaSse4.cc │ │ ├── ContextIsaStd.cc │ │ ├── ContextIsaStr.cc │ │ ├── ContextIsaXmm.cc │ │ ├── ContextLoader.cc │ │ ├── ContextSignal.cc │ │ ├── ContextSyscall.cc │ │ ├── ContextSyscall.def │ │ ├── ContextUinst.cc │ │ ├── Emulator.cc │ │ ├── Emulator.h │ │ ├── Extended.cc │ │ ├── Extended.h │ │ ├── Makefile.am │ │ ├── Regs.cc │ │ ├── Regs.h │ │ ├── Signal.cc │ │ ├── Signal.h │ │ ├── Uinst.cc │ │ ├── Uinst.h │ │ ├── XmmValue.cc │ │ └── XmmValue.h │ │ └── timing │ │ ├── .gitignore │ │ ├── Alu.cc │ │ ├── Alu.h │ │ ├── BranchPredictor.cc │ │ ├── BranchPredictor.h │ │ ├── Core.cc │ │ ├── Core.h │ │ ├── Cpu.cc │ │ ├── Cpu.h │ │ ├── CpuScheduler.cc │ │ ├── FunctionalUnit.cc │ │ ├── FunctionalUnit.h │ │ ├── Makefile.am │ │ ├── RegisterFile.cc │ │ ├── RegisterFile.h │ │ ├── Thread.cc │ │ ├── Thread.h │ │ ├── ThreadCommit.cc │ │ ├── ThreadDecode.cc │ │ ├── ThreadDispatch.cc │ │ ├── ThreadFetch.cc │ │ ├── ThreadIssue.cc │ │ ├── ThreadRecover.cc │ │ ├── ThreadScheduler.cc │ │ ├── Timing.cc │ │ ├── Timing.h │ │ ├── TraceCache.cc │ │ ├── TraceCache.h │ │ ├── Uop.cc │ │ └── Uop.h ├── dram │ ├── .gitignore │ ├── Action.cc │ ├── Action.h │ ├── Address.cc │ ├── Address.h │ ├── Bank.cc │ ├── Bank.h │ ├── Channel.cc │ ├── Channel.h │ ├── Command.cc │ ├── Command.h │ ├── Controller.cc │ ├── Controller.h │ ├── Makefile.am │ ├── Rank.cc │ ├── Rank.h │ ├── Request.cc │ ├── Request.h │ ├── Scheduler.cc │ ├── Scheduler.h │ ├── System.cc │ ├── System.h │ ├── TimingParameters.cc │ └── TimingParameters.h ├── lib │ ├── Makefile.am │ ├── cpp │ │ ├── Bitmap.cc │ │ ├── Bitmap.h │ │ ├── CommandLine.cc │ │ ├── CommandLine.h │ │ ├── Debug.cc │ │ ├── Debug.h │ │ ├── ELFReader.cc │ │ ├── ELFReader.h │ │ ├── ELFWriter.cc │ │ ├── ELFWriter.h │ │ ├── Environment.cc │ │ ├── Environment.h │ │ ├── Error.cc │ │ ├── Error.h │ │ ├── Graph.cc │ │ ├── Graph.h │ │ ├── IniFile.cc │ │ ├── IniFile.h │ │ ├── List.cc │ │ ├── List.h │ │ ├── Makefile.am │ │ ├── Misc.cc │ │ ├── Misc.h │ │ ├── OldList.cc │ │ ├── OldList.h │ │ ├── String.cc │ │ ├── String.h │ │ ├── Terminal.cc │ │ ├── Terminal.h │ │ ├── Timer.cc │ │ └── Timer.h │ ├── esim │ │ ├── Engine.cc │ │ ├── Engine.h │ │ ├── Event.cc │ │ ├── Event.h │ │ ├── Frame.cc │ │ ├── Frame.h │ │ ├── FrequencyDomain.cc │ │ ├── FrequencyDomain.h │ │ ├── Makefile.am │ │ ├── Queue.cc │ │ ├── Queue.h │ │ ├── Trace.cc │ │ └── Trace.h │ ├── gtest │ │ ├── Makefile.am │ │ ├── README │ │ ├── include │ │ │ └── gtest │ │ │ │ ├── gtest-death-test.h │ │ │ │ ├── gtest-message.h │ │ │ │ ├── gtest-param-test.h │ │ │ │ ├── gtest-param-test.h.pump │ │ │ │ ├── gtest-printers.h │ │ │ │ ├── gtest-spi.h │ │ │ │ ├── gtest-test-part.h │ │ │ │ ├── gtest-typed-test.h │ │ │ │ ├── gtest.h │ │ │ │ ├── gtest_pred_impl.h │ │ │ │ ├── gtest_prod.h │ │ │ │ └── internal │ │ │ │ ├── gtest-death-test-internal.h │ │ │ │ ├── gtest-filepath.h │ │ │ │ ├── gtest-internal.h │ │ │ │ ├── gtest-linked_ptr.h │ │ │ │ ├── gtest-param-util-generated.h │ │ │ │ ├── gtest-param-util-generated.h.pump │ │ │ │ ├── gtest-param-util.h │ │ │ │ ├── gtest-port.h │ │ │ │ ├── gtest-string.h │ │ │ │ ├── gtest-tuple.h │ │ │ │ ├── gtest-tuple.h.pump │ │ │ │ ├── gtest-type-util.h │ │ │ │ └── gtest-type-util.h.pump │ │ └── src │ │ │ ├── gtest-all.cc │ │ │ ├── gtest-death-test.cc │ │ │ ├── gtest-filepath.cc │ │ │ ├── gtest-internal-inl.h │ │ │ ├── gtest-port.cc │ │ │ ├── gtest-printers.cc │ │ │ ├── gtest-test-part.cc │ │ │ ├── gtest-typed-test.cc │ │ │ ├── gtest.cc │ │ │ └── gtest_main.cc │ ├── mhandle │ │ ├── Makefile.am │ │ ├── mhandle.c │ │ └── mhandle.h │ └── util │ │ ├── ChangeLog │ │ ├── Makefile.am │ │ ├── bin-config.c │ │ ├── bin-config.h │ │ ├── bit-map.c │ │ ├── bit-map.h │ │ ├── buffer.c │ │ ├── buffer.h │ │ ├── config.c │ │ ├── config.h │ │ ├── debug.c │ │ ├── debug.h │ │ ├── elf-encode.c │ │ ├── elf-encode.h │ │ ├── elf-format.c │ │ ├── elf-format.h │ │ ├── file.c │ │ ├── file.h │ │ ├── graph.c │ │ ├── graph.h │ │ ├── hash-table.c │ │ ├── hash-table.h │ │ ├── heap.c │ │ ├── heap.h │ │ ├── linked-list.c │ │ ├── linked-list.h │ │ ├── list.c │ │ ├── list.h │ │ ├── matrix.c │ │ ├── matrix.h │ │ ├── misc.c │ │ ├── misc.h │ │ ├── repos.c │ │ ├── repos.h │ │ ├── string.c │ │ ├── string.h │ │ ├── timer.c │ │ └── timer.h ├── m2s.cc ├── memory │ ├── .gitignore │ ├── Cache.cc │ ├── Cache.h │ ├── Directory.cc │ ├── Directory.h │ ├── Frame.cc │ ├── Frame.h │ ├── Makefile.am │ ├── Manager.cc │ ├── Manager.h │ ├── Memory.cc │ ├── Memory.h │ ├── Mmu.cc │ ├── Mmu.h │ ├── Module.cc │ ├── Module.h │ ├── SpecMem.cc │ ├── SpecMem.h │ ├── System.cc │ ├── System.h │ ├── SystemConfig.cc │ └── SystemEvents.cc ├── network │ ├── .gitignore │ ├── Buffer.cc │ ├── Buffer.h │ ├── Bus.cc │ ├── Bus.h │ ├── Connection.cc │ ├── Connection.h │ ├── EndNode.cc │ ├── EndNode.h │ ├── Frame.h │ ├── Graph.cc │ ├── Graph.h │ ├── Link.cc │ ├── Link.h │ ├── Makefile.am │ ├── Message.cc │ ├── Message.h │ ├── Network.cc │ ├── Network.h │ ├── Node.cc │ ├── Node.h │ ├── Packet.cc │ ├── Packet.h │ ├── RoutingTable.cc │ ├── RoutingTable.h │ ├── Switch.cc │ ├── Switch.h │ ├── System.cc │ ├── System.h │ ├── SystemConfig.cc │ └── SystemEvents.cc └── visual │ ├── .gitignore │ ├── Makefile.am │ ├── common │ ├── .gitignore │ ├── Makefile.am │ ├── cycle-bar.c │ ├── cycle-bar.h │ ├── led.c │ ├── led.h │ ├── list.c │ ├── list.h │ ├── popup.c │ ├── popup.h │ ├── state.c │ ├── state.h │ ├── trace.c │ ├── trace.h │ ├── visual-missing.c │ ├── visual.c │ └── visual.h │ ├── evergreen │ ├── .gitignore │ ├── Makefile.am │ ├── compute-unit.c │ ├── compute-unit.h │ ├── gpu.c │ ├── gpu.h │ ├── inst.c │ ├── inst.h │ ├── panel.c │ ├── panel.h │ ├── time-dia.c │ ├── time-dia.h │ ├── work-group.c │ └── work-group.h │ ├── memory │ ├── .gitignore │ ├── Makefile.am │ ├── mem-system.c │ ├── mem-system.h │ ├── mod-access.c │ ├── mod-access.h │ ├── mod-widget.c │ ├── mod-widget.h │ ├── mod.c │ ├── mod.h │ ├── panel.c │ └── panel.h │ ├── network │ ├── .gitignore │ ├── Makefile.am │ ├── buffer.c │ ├── buffer.h │ ├── link.c │ ├── link.h │ ├── net-graph.c │ ├── net-graph.h │ ├── net-message.c │ ├── net-message.h │ ├── net-packet.c │ ├── net-packet.h │ ├── net-system.c │ ├── net-system.h │ ├── net-widget.c │ ├── net-widget.h │ ├── net.c │ ├── net.h │ ├── node-widget.c │ ├── node-widget.h │ ├── node.c │ ├── node.h │ ├── panel.c │ └── panel.h │ ├── southern-islands │ ├── .gitignore │ ├── Makefile.am │ ├── compute-unit.c │ ├── compute-unit.h │ ├── gpu.c │ ├── gpu.h │ ├── inst.c │ ├── inst.h │ ├── panel.c │ ├── panel.h │ ├── time-dia.c │ ├── time-dia.h │ ├── work-group.c │ └── work-group.h │ └── x86 │ ├── .gitignore │ ├── Makefile.am │ ├── context.c │ ├── context.h │ ├── core.c │ ├── core.h │ ├── cpu.c │ ├── cpu.h │ ├── inst.c │ ├── inst.h │ ├── panel.c │ ├── panel.h │ ├── time-dia.c │ └── time-dia.h └── tests ├── .gitignore ├── Makefile.am └── src ├── .gitignore ├── arch ├── .gitignore ├── southern-islands │ ├── .gitignore │ ├── emu │ │ ├── .gitignore │ │ ├── ObjectPool.cc │ │ ├── ObjectPool.h │ │ ├── TestISASOP2.cc │ │ └── TestISAVOP2.cc │ └── timing │ │ ├── .gitignore │ │ └── TestTiming.cc └── x86 │ ├── .gitignore │ └── timing │ ├── .gitignore │ ├── ObjectPool.cc │ ├── ObjectPool.h │ ├── TestAlu.cc │ ├── TestBranchPredictor.cc │ ├── TestFetch.cc │ ├── TestRegisterFile.cc │ └── TestTraceCache.cc ├── dram ├── .gitignore ├── TestDramConfig.cc └── TestDramEvents.cc ├── lib └── esim │ └── TestEngine.cc ├── memory ├── .gitignore ├── TestModule.cc ├── TestSystemConfig.cc └── TestSystemEvents.cc └── network ├── .gitignore ├── TestNetworkConfig.cc └── TestNetworkEvents.cc /.gitignore: -------------------------------------------------------------------------------- 1 | INSTALL 2 | Makefile 3 | Makefile.in 4 | aclocal.m4 5 | autom4te.cache 6 | compile 7 | config.guess 8 | config.log 9 | config.status 10 | config.sub 11 | configure 12 | depcomp 13 | install-sh 14 | lib 15 | libtool 16 | ltmain.sh 17 | m4 18 | missing 19 | test-driver 20 | -------------------------------------------------------------------------------- /ChangeLog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Multi2Sim/multi2sim/77b16e0ba3c23c5609657834b8cdfc7d0e22c303/ChangeLog -------------------------------------------------------------------------------- /bin/.gitignore: -------------------------------------------------------------------------------- 1 | .dirstamp 2 | m2s 3 | -------------------------------------------------------------------------------- /docker/build-env/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:14.04.5 2 | MAINTAINER NUCAR 3 | 4 | # Libs for build Multi2Sim 5 | RUN apt-get update 6 | RUN DEBIAN_FRONTEND=noninteractive apt-get install -y git build-essential automake autoconf libtool zlib1g-dev lib32gcc1 gcc-multilib libgtk-3-dev 7 | 8 | -------------------------------------------------------------------------------- /docker/debug/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM multi2sim/multi2sim:build-env 2 | MAINTAINER NUCAR 3 | 4 | # Build Multi2Sim with debug and install gdb 5 | RUN cd /tmp && git clone https://github.com/Multi2Sim/multi2sim.git && cd multi2sim && libtoolize && aclocal && autoconf && automake --add-missing && ./configure --enable-debug && make && make install 6 | RUN DEBIAN_FRONTEND=noninteractive apt-get -y install gdb 7 | -------------------------------------------------------------------------------- /docker/release/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM multi2sim/multi2sim:build-env 2 | MAINTAINER NUCAR 3 | 4 | # Build Multi2Sim 5 | RUN cd /tmp && git clone https://github.com/Multi2Sim/multi2sim.git && cd multi2sim && libtoolize && aclocal && autoconf && automake --add-missing && ./configure && make && make install 6 | -------------------------------------------------------------------------------- /images/alu_engine.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Multi2Sim/multi2sim/77b16e0ba3c23c5609657834b8cdfc7d0e22c303/images/alu_engine.png -------------------------------------------------------------------------------- /images/back-double.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Multi2Sim/multi2sim/77b16e0ba3c23c5609657834b8cdfc7d0e22c303/images/back-double.png -------------------------------------------------------------------------------- /images/back-single.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Multi2Sim/multi2sim/77b16e0ba3c23c5609657834b8cdfc7d0e22c303/images/back-single.png -------------------------------------------------------------------------------- /images/back-triple.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Multi2Sim/multi2sim/77b16e0ba3c23c5609657834b8cdfc7d0e22c303/images/back-triple.png -------------------------------------------------------------------------------- /images/cf_engine.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Multi2Sim/multi2sim/77b16e0ba3c23c5609657834b8cdfc7d0e22c303/images/cf_engine.png -------------------------------------------------------------------------------- /images/close-sel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Multi2Sim/multi2sim/77b16e0ba3c23c5609657834b8cdfc7d0e22c303/images/close-sel.png -------------------------------------------------------------------------------- /images/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Multi2Sim/multi2sim/77b16e0ba3c23c5609657834b8cdfc7d0e22c303/images/close.png -------------------------------------------------------------------------------- /images/engines.odg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Multi2Sim/multi2sim/77b16e0ba3c23c5609657834b8cdfc7d0e22c303/images/engines.odg -------------------------------------------------------------------------------- /images/forward-double.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Multi2Sim/multi2sim/77b16e0ba3c23c5609657834b8cdfc7d0e22c303/images/forward-double.png -------------------------------------------------------------------------------- /images/forward-single.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Multi2Sim/multi2sim/77b16e0ba3c23c5609657834b8cdfc7d0e22c303/images/forward-single.png -------------------------------------------------------------------------------- /images/forward-triple.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Multi2Sim/multi2sim/77b16e0ba3c23c5609657834b8cdfc7d0e22c303/images/forward-triple.png -------------------------------------------------------------------------------- /images/go.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Multi2Sim/multi2sim/77b16e0ba3c23c5609657834b8cdfc7d0e22c303/images/go.png -------------------------------------------------------------------------------- /images/m2s-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Multi2Sim/multi2sim/77b16e0ba3c23c5609657834b8cdfc7d0e22c303/images/m2s-icon.png -------------------------------------------------------------------------------- /images/m2s-icon.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Multi2Sim/multi2sim/77b16e0ba3c23c5609657834b8cdfc7d0e22c303/images/m2s-icon.xcf -------------------------------------------------------------------------------- /images/tex_engine.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Multi2Sim/multi2sim/77b16e0ba3c23c5609657834b8cdfc7d0e22c303/images/tex_engine.png -------------------------------------------------------------------------------- /runtime/.gitignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | Makefile.in 3 | -------------------------------------------------------------------------------- /runtime/Makefile.am: -------------------------------------------------------------------------------- 1 | SUBDIRS = \ 2 | opencl \ 3 | cuda \ 4 | hsa \ 5 | include 6 | 7 | -------------------------------------------------------------------------------- /runtime/cuda/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.lo 3 | .deps 4 | Makefile 5 | Makefile.in 6 | -------------------------------------------------------------------------------- /runtime/cuda/Makefile.am: -------------------------------------------------------------------------------- 1 | if HAVE_M32_FLAG 2 | 3 | lib_LTLIBRARIES = $(top_builddir)/lib/libm2s-cuda.la 4 | 5 | __top_builddir__lib_libm2s_cuda_la_LDFLAGS = -version-info 1:0:0 -lpthread 6 | 7 | __top_builddir__lib_libm2s_cuda_la_SOURCES = \ 8 | \ 9 | api.c \ 10 | api.h \ 11 | api-rt.c \ 12 | \ 13 | debug.c \ 14 | debug.h \ 15 | \ 16 | elf-format.c \ 17 | elf-format.h \ 18 | \ 19 | list.c \ 20 | list.h \ 21 | \ 22 | mhandle.c \ 23 | mhandle.h \ 24 | \ 25 | context.c \ 26 | context.h \ 27 | \ 28 | device.c \ 29 | device.h \ 30 | \ 31 | event.c \ 32 | event.h \ 33 | \ 34 | function.c \ 35 | function.h \ 36 | \ 37 | function-arg.c \ 38 | function-arg.h \ 39 | \ 40 | memory.c \ 41 | memory.h \ 42 | \ 43 | misc.c \ 44 | misc.h \ 45 | \ 46 | module.c \ 47 | module.h \ 48 | \ 49 | stream.c \ 50 | stream.h 51 | 52 | AM_CFLAGS = -m32 53 | 54 | endif 55 | 56 | -------------------------------------------------------------------------------- /runtime/cuda/context.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim 3 | * Copyright (C) 2012 Rafael Ubal (ubal@ece.neu.edu) 4 | * 5 | * This module is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This module is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this module; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #include "../include/cuda.h" 21 | #include "context.h" 22 | #include "list.h" 23 | #include "mhandle.h" 24 | 25 | 26 | /* Create a context */ 27 | CUcontext cuda_context_create(CUdevice device) 28 | { 29 | CUcontext context; 30 | 31 | /* Create context */ 32 | context = xcalloc(1, sizeof(struct CUctx_st)); 33 | 34 | /* Initialize */ 35 | context->id = list_count(context_list); 36 | context->device = device; 37 | context->version = 5050; 38 | 39 | /* Add to context list */ 40 | list_add(context_list, context); 41 | 42 | return context; 43 | } 44 | 45 | /* Free context */ 46 | void cuda_context_free(CUcontext context) 47 | { 48 | list_remove(context_list, context); 49 | 50 | free(context); 51 | } 52 | 53 | -------------------------------------------------------------------------------- /runtime/cuda/context.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim 3 | * Copyright (C) 2012 Rafael Ubal (ubal@ece.neu.edu) 4 | * 5 | * This module is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This module is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this module; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef RUNTIME_CUDA_CONTEXT_H 21 | #define RUNTIME_CUDA_CONTEXT_H 22 | 23 | 24 | extern struct list_t *context_list; 25 | 26 | struct CUctx_st 27 | { 28 | unsigned id; 29 | 30 | CUdevice device; 31 | 32 | unsigned version; 33 | }; 34 | 35 | CUcontext cuda_context_create(CUdevice device); 36 | void cuda_context_free(CUcontext context); 37 | 38 | 39 | #endif 40 | 41 | -------------------------------------------------------------------------------- /runtime/cuda/device.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim 3 | * Copyright (C) 2012 Rafael Ubal (ubal@ece.neu.edu) 4 | * 5 | * This module is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This module is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this module; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef RUNTIME_CUDA_DEVICE_H 21 | #define RUNTIME_CUDA_DEVICE_H 22 | 23 | 24 | #include "api.h" 25 | 26 | struct cuda_device_t 27 | { 28 | /* CUdevice is also an ID */ 29 | CUdevice device; 30 | 31 | /* File descriptor, as returned by 'open' system call */ 32 | int fd; 33 | 34 | /* Name */ 35 | char *name; 36 | 37 | /* Attributes */ 38 | int attributes[CU_DEVICE_ATTRIBUTE_MAX]; 39 | 40 | /* Streams associated */ 41 | struct list_t *stream_list; 42 | }; 43 | 44 | struct cuda_device_t *cuda_device_create(); 45 | void cuda_device_free(struct cuda_device_t *device); 46 | 47 | 48 | #endif 49 | 50 | -------------------------------------------------------------------------------- /runtime/cuda/event.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim 3 | * Copyright (C) 2012 Rafael Ubal (ubal@ece.neu.edu) 4 | * 5 | * This module is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This module is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this module; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef RUNTIME_CUDA_EVENT_H 21 | #define RUNTIME_CUDA_EVENT_H 22 | 23 | 24 | #include "api.h" 25 | 26 | struct CUevent_st 27 | { 28 | unsigned id; 29 | 30 | CUstream stream; 31 | 32 | clock_t t; 33 | 34 | /* Flags */ 35 | unsigned to_be_recorded; 36 | unsigned recorded; 37 | unsigned flags; 38 | }; 39 | 40 | CUevent cuda_event_create(unsigned flags); 41 | void cuda_event_free(CUevent event); 42 | void cuda_event_record(CUevent event); 43 | 44 | 45 | #endif 46 | 47 | -------------------------------------------------------------------------------- /runtime/cuda/function-arg.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim 3 | * Copyright (C) 2012 Rafael Ubal (ubal@ece.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #include "../include/cuda.h" 21 | #include "function-arg.h" 22 | #include "function.h" 23 | #include "list.h" 24 | #include "mhandle.h" 25 | 26 | 27 | struct cuda_function_arg_t *cuda_function_arg_create(const void *ptr, int size, 28 | int offset) 29 | { 30 | struct cuda_function_arg_t *arg; 31 | 32 | /* Create a new function argument */ 33 | arg = xcalloc(1, sizeof(struct cuda_function_arg_t)); 34 | 35 | /* Initialize */ 36 | arg->ptr = (void *)ptr; 37 | arg->size = size; 38 | arg->offset = offset; 39 | 40 | return arg; 41 | } 42 | 43 | void cuda_function_arg_free(CUfunction function, 44 | struct cuda_function_arg_t *arg) 45 | { 46 | free(arg); 47 | } 48 | 49 | -------------------------------------------------------------------------------- /runtime/cuda/function-arg.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim 3 | * Copyright (C) 2012 Rafael Ubal (ubal@ece.neu.edu) 4 | * 5 | * This module is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This module is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this module; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef RUNTIME_CUDA_FUNCTION_ARG_H 21 | #define RUNTIME_CUDA_FUNCTION_ARG_H 22 | 23 | 24 | struct cuda_function_arg_t 25 | { 26 | void *ptr; 27 | int size; 28 | 29 | /* Offset in constant memory where argument is saved */ 30 | int offset; 31 | }; 32 | 33 | struct cuda_function_arg_t *cuda_function_arg_create(const void *ptr, int size, 34 | int offset); 35 | void cuda_function_arg_free(CUfunction function, 36 | struct cuda_function_arg_t *arg); 37 | 38 | 39 | #endif 40 | 41 | -------------------------------------------------------------------------------- /runtime/cuda/memory.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim 3 | * Copyright (C) 2012 Rafael Ubal (ubal@ece.neu.edu) 4 | * 5 | * This module is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This module is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this module; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #include "list.h" 21 | #include "memory.h" 22 | #include "mhandle.h" 23 | 24 | 25 | struct cuda_memory_object_t *cuda_memory_object_create(void) 26 | { 27 | struct cuda_memory_object_t *mem; 28 | 29 | /* Create memory object */ 30 | mem = xcalloc(1, sizeof(struct cuda_memory_object_t)); 31 | 32 | /* Initialize */ 33 | mem->id = list_count(memory_object_list); 34 | 35 | /* Add to memory object list */ 36 | list_add(memory_object_list, mem); 37 | 38 | return mem; 39 | } 40 | 41 | void cuda_memory_object_free(struct cuda_memory_object_t *mem) 42 | { 43 | list_remove(memory_object_list, mem); 44 | 45 | free(mem); 46 | } 47 | 48 | -------------------------------------------------------------------------------- /runtime/cuda/memory.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim 3 | * Copyright (C) 2012 Rafael Ubal (ubal@ece.neu.edu) 4 | * 5 | * This module is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This module is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this module; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef RUNTIME_CUDA_MEMORY_H 21 | #define RUNTIME_CUDA_MEMORY_H 22 | 23 | 24 | #include "api.h" 25 | 26 | struct cuda_memory_object_t 27 | { 28 | unsigned int id; 29 | 30 | unsigned int size; 31 | 32 | unsigned int host_ptr; 33 | unsigned int device_ptr; 34 | }; 35 | 36 | struct cuda_memory_object_t *cuda_memory_object_create(void); 37 | void cuda_memory_object_free(struct cuda_memory_object_t *mem); 38 | 39 | 40 | #endif 41 | 42 | -------------------------------------------------------------------------------- /runtime/cuda/misc.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim 3 | * Copyright (C) 2012 Rafael Ubal (ubal@ece.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #include 21 | 22 | #include "misc.h" 23 | 24 | 25 | /* 26 | * File functions 27 | */ 28 | 29 | FILE *file_open_for_write(char *fname) 30 | { 31 | if (!fname[0]) 32 | return NULL; 33 | if (!strcmp(fname, "stdout")) 34 | return stdout; 35 | else if (!strcmp(fname, "stderr")) 36 | return stderr; 37 | else 38 | return fopen(fname, "wt"); 39 | } 40 | -------------------------------------------------------------------------------- /runtime/cuda/misc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim 3 | * Copyright (C) 2012 Rafael Ubal (ubal@ece.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef RUNTIME_CUDA_MISC_H 21 | #define RUNTIME_CUDA_MISC_H 22 | 23 | #include 24 | 25 | 26 | 27 | /* 28 | * File functions 29 | */ 30 | 31 | FILE *file_open_for_write(char *fname); 32 | 33 | 34 | 35 | 36 | #endif 37 | 38 | -------------------------------------------------------------------------------- /runtime/cuda/module.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim 3 | * Copyright (C) 2012 Rafael Ubal (ubal@ece.neu.edu) 4 | * 5 | * This module is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This module is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this module; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef RUNTIME_CUDA_MODULE_H 21 | #define RUNTIME_CUDA_MODULE_H 22 | 23 | 24 | #include "api.h" 25 | 26 | struct CUmod_st 27 | { 28 | unsigned id; 29 | 30 | /* Cubin associated */ 31 | struct elf_file_t *elf_file; 32 | }; 33 | 34 | CUmodule cuda_module_create(const char *cubin_path); 35 | void cuda_module_free(CUmodule module); 36 | 37 | 38 | #endif 39 | 40 | -------------------------------------------------------------------------------- /runtime/hsa/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.lo 3 | .deps 4 | Makefile 5 | Makefile.in 6 | -------------------------------------------------------------------------------- /runtime/hsa/Makefile.am: -------------------------------------------------------------------------------- 1 | if HAVE_M32_FLAG 2 | 3 | lib_LTLIBRARIES = $(top_builddir)/lib/libm2s-hsa.la 4 | 5 | __top_builddir__lib_libm2s_hsa_la_LDFLAGS = -version-info 1:0:0 6 | 7 | 8 | __top_builddir__lib_libm2s_hsa_la_SOURCES = \ 9 | debug.h \ 10 | debug.c \ 11 | \ 12 | hsa.h \ 13 | hsa.c \ 14 | \ 15 | hsa_agent.c \ 16 | hsa_code_object.c \ 17 | hsa_executable.c \ 18 | hsa_finalize.c \ 19 | hsa_isa.c \ 20 | hsa_queue.c \ 21 | hsa_region.c \ 22 | hsa_signal.c \ 23 | hsa_system.c 24 | 25 | 26 | AM_CFLAGS = -m32 -D_GNU_SOURCE 27 | AM_CXXFLAGS = -m32 28 | 29 | endif -------------------------------------------------------------------------------- /runtime/hsa/debug.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim 3 | * Copyright (C) 2012 Yifan Sun (yifansun@coe.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef RUNTIME_HSA_DEBUG_H 21 | #define RUNTIME_HSA_DEBUG_H 22 | 23 | /* debug messages */ 24 | void m2s_hsa_warning(char *fmt, ...) __attribute__ ((format (printf, 1, 2))); 25 | void m2s_hsa_fatal(char *fmt, ...) __attribute__ ((format (printf, 1, 2))); 26 | void m2s_hsa_panic(char *fmt, ...) __attribute__ ((format (printf, 1, 2))); 27 | 28 | #define warning m2s_hsa_warning 29 | #define fatal m2s_hsa_fatal 30 | #define panic m2s_hsa_panic 31 | 32 | #endif /* RUNTIME_HSA_DEBUG_H_ */ 33 | -------------------------------------------------------------------------------- /runtime/include/.gitignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | Makefile.in 3 | -------------------------------------------------------------------------------- /runtime/include/Makefile.am: -------------------------------------------------------------------------------- 1 | EXTRA_DIST = \ 2 | \ 3 | CL/cl.h \ 4 | \ 5 | cuda.h \ 6 | cuda_runtime_api.h \ 7 | \ 8 | GL/gl.h \ 9 | GL/glew.h \ 10 | GL/glu.h \ 11 | GL/glut.h \ 12 | \ 13 | hsa.h \ 14 | hsa_ext_finalize.h 15 | 16 | -------------------------------------------------------------------------------- /runtime/opencl/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.lo 3 | .deps 4 | Makefile 5 | Makefile.in 6 | -------------------------------------------------------------------------------- /runtime/opencl/context.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim 3 | * Copyright (C) 2012 Rafael Ubal (ubal@ece.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef RUNTIME_OPENCL_CONTEXT_H 21 | #define RUNTIME_OPENCL_CONTEXT_H 22 | 23 | #include "opencl.h" 24 | 25 | 26 | /* Context Object */ 27 | struct _cl_context 28 | { 29 | /* List of devices - elements of type opencl_device_t */ 30 | struct list_t *device_list; 31 | 32 | /* Properties */ 33 | size_t prop_count; 34 | cl_context_properties *props; 35 | }; 36 | 37 | 38 | struct opencl_context_t *opencl_context_create(void); 39 | void opencl_context_free(struct opencl_context_t *context); 40 | 41 | /* Return TRUE if the device is associated with the context. */ 42 | int opencl_context_has_device(struct opencl_context_t *context, 43 | struct opencl_device_t *device); 44 | 45 | 46 | 47 | #endif 48 | 49 | -------------------------------------------------------------------------------- /runtime/opencl/debug.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Libstruct 3 | * Copyright (C) 2012 Rafael Ubal (ubal@ece.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef RUNTIME_OPENCL_DEBUG_H 21 | #define RUNTIME_OPENCL_DEBUG_H 22 | 23 | /* Other messages */ 24 | void m2s_opencl_warning(char *fmt, ...) __attribute__ ((format (printf, 1, 2))); 25 | void m2s_opencl_fatal(char *fmt, ...) __attribute__ ((format (printf, 1, 2))); 26 | void m2s_opencl_panic(char *fmt, ...) __attribute__ ((format (printf, 1, 2))); 27 | 28 | #define warning m2s_opencl_warning 29 | #define fatal m2s_opencl_fatal 30 | #define panic m2s_opencl_panic 31 | 32 | #endif 33 | 34 | -------------------------------------------------------------------------------- /runtime/opencl/evg-device.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim 3 | * Copyright (C) 2012 Rafael Ubal (ubal@ece.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #include "evg-device.h" 21 | 22 | 23 | -------------------------------------------------------------------------------- /runtime/opencl/evg-device.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim 3 | * Copyright (C) 2012 Rafael Ubal (ubal@ece.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef RUNTIME_OPENCL_EVG_DEVICE_H 21 | #define RUNTIME_OPENCL_EVG_DEVICE_H 22 | 23 | #include "opencl.h" 24 | 25 | 26 | struct opencl_evg_device_t 27 | { 28 | /* Parent generic device object */ 29 | struct opencl_device_t *parent; 30 | }; 31 | 32 | 33 | 34 | struct opencl_evg_device_t *opencl_evg_device_create( 35 | struct opencl_device_t *parent); 36 | void opencl_evg_device_free( 37 | struct opencl_evg_device_t *device); 38 | 39 | #endif 40 | 41 | -------------------------------------------------------------------------------- /runtime/opencl/evg-kernel.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim 3 | * Copyright (C) 2012 Rafael Ubal (ubal@ece.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #include "evg-kernel.h" 21 | 22 | 23 | -------------------------------------------------------------------------------- /runtime/opencl/evg-program.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim 3 | * Copyright (C) 2012 Rafael Ubal (ubal@ece.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #include "evg-program.h" 21 | 22 | 23 | -------------------------------------------------------------------------------- /runtime/opencl/sampler.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim 3 | * Copyright (C) 2012 Rafael Ubal (ubal@ece.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef RUNTIME_OPENCL_SAMPLER_H 21 | #define RUNTIME_OPENCL_SAMPLER_H 22 | 23 | #include "opencl.h" 24 | 25 | 26 | /* Sampler object */ 27 | struct _cl_sampler 28 | { 29 | unsigned int id; 30 | }; 31 | 32 | 33 | /* Create/free */ 34 | struct opencl_sampler_t *opencl_sampler_create(void); 35 | void opencl_sampler_free(struct opencl_sampler_t *sampler); 36 | 37 | 38 | 39 | #endif 40 | 41 | -------------------------------------------------------------------------------- /runtime/opencl/thread-list.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim 3 | * Copyright (C) 2012 Rafael Ubal (ubal@ece.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef RUNTIME_OPENCL_THREAD_LIST_H 21 | #define RUNTIME_OPENCL_THREAD_LIST_H 22 | 23 | #include 24 | 25 | struct thread_list_t; 26 | 27 | typedef int (*thread_list_visit_func_t)(void *object, void *user_data); 28 | 29 | struct thread_list_t *thread_list_create(void); 30 | void thread_list_free(struct thread_list_t *list); 31 | 32 | void thread_list_insert(struct thread_list_t *list, void *data); 33 | int thread_list_remove(struct thread_list_t *list, void *data); 34 | 35 | void thread_list_visit(struct thread_list_t *list, 36 | thread_list_visit_func_t visit_func, void *context); 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /runtime/opencl/union-device.h: -------------------------------------------------------------------------------- 1 | #ifndef __UNION_DEVICE_H__ 2 | #define __UNION_DEVICE_H__ 3 | 4 | #include "list.h" 5 | #include "device.h" 6 | 7 | struct opencl_union_device_t 8 | { 9 | enum opencl_runtime_type_t type; /* First field */ 10 | 11 | struct opencl_device_t *parent; 12 | struct list_t *devices; 13 | }; 14 | 15 | struct opencl_union_device_t *opencl_union_device_create(struct opencl_device_t *parent, struct list_t *devices); 16 | void opencl_union_device_free(struct opencl_union_device_t *device); 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /runtime/opencl/union-program.h: -------------------------------------------------------------------------------- 1 | #ifndef __UNION_PROGRAM_H__ 2 | #define __UNION_PROGRAM_H__ 3 | 4 | #include "opencl.h" 5 | #include "list.h" 6 | #include "union-device.h" 7 | 8 | struct opencl_union_program_t 9 | { 10 | enum opencl_runtime_type_t type; /* First field */ 11 | 12 | struct opencl_program_t *parent; 13 | struct opencl_union_device_t *device; 14 | struct list_t *programs; 15 | }; 16 | 17 | /* use this format for 'multiple binaries' */ 18 | struct opencl_union_binary_t 19 | { 20 | enum opencl_runtime_type_t type; /* First field */ 21 | 22 | unsigned int num_entries; 23 | unsigned int entry_sizes[0]; 24 | }; 25 | 26 | struct opencl_union_program_t *opencl_union_program_create( 27 | struct opencl_program_t *parent, 28 | struct opencl_union_device_t *device, 29 | void *binary, 30 | unsigned int length); 31 | 32 | void opencl_union_program_free(struct opencl_union_program_t *program); 33 | 34 | int opencl_union_program_valid_binary(void *dev, void *binary, unsigned int length); 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /samples/arm/test-args: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Multi2Sim/multi2sim/77b16e0ba3c23c5609657834b8cdfc7d0e22c303/samples/arm/test-args -------------------------------------------------------------------------------- /samples/arm/test-args.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(int argc, char **argv, char **envp) { 4 | int i; 5 | printf("number of arguments: %d\n", argc); 6 | for (i = 0; i < argc; i++) 7 | printf("\targv[%d] = %s\n", i, argv[i]); 8 | return 0; 9 | } 10 | 11 | -------------------------------------------------------------------------------- /samples/arm/test-sort: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Multi2Sim/multi2sim/77b16e0ba3c23c5609657834b8cdfc7d0e22c303/samples/arm/test-sort -------------------------------------------------------------------------------- /samples/arm/test-sort.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int compar(const void *e1, const void *e2) 5 | { 6 | return * (int *) e1 - * (int *) e2; 7 | } 8 | 9 | 10 | #define NELEM 500 11 | int main(int argc, char **argv) 12 | { 13 | int *elem, i; 14 | 15 | /* Create vector */ 16 | printf("Creating a vector of %d elements...\n", NELEM); 17 | fflush(stdout); 18 | elem = calloc(NELEM, sizeof(int)); 19 | for (i = 0; i < NELEM; i++) 20 | elem[i] = random(); 21 | 22 | printf("Sorting vector...\n"); 23 | fflush(stdout); 24 | qsort(elem, NELEM, sizeof(int), compar); 25 | 26 | printf("Finished\n"); 27 | return 0; 28 | } 29 | 30 | -------------------------------------------------------------------------------- /samples/fused/si-config: -------------------------------------------------------------------------------- 1 | [ Device ] 2 | NumComputeUnits = 8 3 | -------------------------------------------------------------------------------- /samples/fused/x86-config: -------------------------------------------------------------------------------- 1 | [ General ] 2 | Frequency = 3000 3 | Cores = 4 4 | Threads = 1 5 | -------------------------------------------------------------------------------- /samples/hsa/.gitignore: -------------------------------------------------------------------------------- 1 | !Makefile 2 | -------------------------------------------------------------------------------- /samples/hsa/histogram/hist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Multi2Sim/multi2sim/77b16e0ba3c23c5609657834b8cdfc7d0e22c303/samples/hsa/histogram/hist -------------------------------------------------------------------------------- /samples/hsa/histogram/kernels.cl: -------------------------------------------------------------------------------- 1 | /*! 2 | * Calculate a histogram of an image linearized in input with size pixels 3 | * one work group, and the number of work items is the number of output points 4 | */ 5 | 6 | __kernel void HIST( 7 | __global uint * input, 8 | __global volatile uint * output, 9 | uint colors, 10 | uint size){ 11 | #if 1 12 | uint tid = get_global_id(0); 13 | uint gsize = get_global_size(0); 14 | 15 | if (tid >= size) 16 | { 17 | return; 18 | } 19 | uint priv_hist[256]; 20 | uint i=0; 21 | 22 | for (i=0; i 0) 44 | { 45 | atom_add(&output[i], priv_hist[i]); 46 | } 47 | } 48 | 49 | #endif 50 | } 51 | -------------------------------------------------------------------------------- /samples/hsa/vector_copy/.gitignore: -------------------------------------------------------------------------------- 1 | *.brig 2 | *.hsail 3 | -------------------------------------------------------------------------------- /samples/hsa/vector_copy/Makefile: -------------------------------------------------------------------------------- 1 | TEST_NAME=vector_copy 2 | LFLAGS= -g -Wl,--unresolved-symbols=ignore-in-shared-libs 3 | INCS = -I ../../../runtime/include 4 | C_FILES := $(wildcard *.c) 5 | OBJ_FILES := $(addprefix obj/, $(notdir $(C_FILES:.c=.o))) 6 | 7 | all: $(TEST_NAME) $(TEST_NAME).brig 8 | 9 | $(TEST_NAME): $(OBJ_FILES) $(COMMON_OBJ_FILES) 10 | $(CC) -m32 $(LFLAGS) $(OBJ_FILES) \ 11 | -L../../../lib/.libs -lm2s-hsa \ 12 | -o $(TEST_NAME) -static 13 | 14 | $(TEST_NAME).brig : 15 | cloc.sh $(TEST_NAME).cl 16 | 17 | obj/%.o: %.c 18 | $(CC) -m32 -c $(CFLAGS) $(INCS) -o $@ $< -std=c99 19 | 20 | clean: 21 | rm -rf obj/*o *.brig $(TEST_NAME) 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /samples/hsa/vector_copy/loader.debug: -------------------------------------------------------------------------------- 1 | Components installed. 2 | ***** CPU device ***** 3 | Name: Multi2Sim Virtual HSA CPU, 4 | Vendor name: Northeastern University, 5 | Wavesize: 1, 6 | 7 | ***** GPU device ***** 8 | Name: Multi2Sim Virtual HSA GPU, 9 | Vendor name: Northeastern University, 10 | Wavesize: 64, 11 | 12 | Preprocessing brig file: 13 | 14 | ******************************************************************************* 15 | Function name: &__OpenCL_vector_copy_kernel. 16 | 17 | ***** Arguments ***** 18 | Input u64 %__aqlwrap_pointer 19 | Input u64 %__global_offset_0 20 | Input u64 %__global_offset_1 21 | Input u64 %__global_offset_2 22 | Input u64 %__printf_buffer 23 | Input u64 %__vqueue_pointer 24 | Input u64 %in 25 | Input u64 %out 26 | Argument size allocated 64 bytes 27 | ********************* 28 | 29 | 30 | ***** Registers ***** 31 | register $d0, offset 4 32 | register $d1, offset 12 33 | register $d2, offset 20 34 | register $s0, offset 0 35 | Register size allocated 28 bytes 36 | ********************* 37 | 38 | First entry: pragma "AMD RTI", "ARGSTART:__OpenCL_vector_copy_kernel"; 39 | Last entry: ret; 40 | ******************************************************************************* 41 | -------------------------------------------------------------------------------- /samples/hsa/vector_copy/vector_copy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Multi2Sim/multi2sim/77b16e0ba3c23c5609657834b8cdfc7d0e22c303/samples/hsa/vector_copy/vector_copy -------------------------------------------------------------------------------- /samples/hsa/vector_copy/vector_copy.brig: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Multi2Sim/multi2sim/77b16e0ba3c23c5609657834b8cdfc7d0e22c303/samples/hsa/vector_copy/vector_copy.brig -------------------------------------------------------------------------------- /samples/hsa/vector_copy/vector_copy.cl: -------------------------------------------------------------------------------- 1 | __kernel void vector_copy(__global int *in, __global int *out) { 2 | int id = get_global_id(0); 3 | out[id] = in[id]; 4 | } 5 | -------------------------------------------------------------------------------- /samples/kepler/vectorAdd/vectorAdd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Multi2Sim/multi2sim/77b16e0ba3c23c5609657834b8cdfc7d0e22c303/samples/kepler/vectorAdd/vectorAdd -------------------------------------------------------------------------------- /samples/kepler/vectorAdd/vector_add.cubin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Multi2Sim/multi2sim/77b16e0ba3c23c5609657834b8cdfc7d0e22c303/samples/kepler/vectorAdd/vector_add.cubin -------------------------------------------------------------------------------- /samples/memory/example-1/README: -------------------------------------------------------------------------------- 1 | This file shows the m2s command line appended before the target executable. The 2 | command line utilizes the memory configuration present in "mem-config" and 3 | the x86 configuration present in "x86-config". 4 | 5 | m2s --x86-sim detailed --mem-config mem-config --x86-config x86-config 6 | -------------------------------------------------------------------------------- /samples/memory/example-1/x86-config: -------------------------------------------------------------------------------- 1 | [ General ] 2 | Cores = 3 3 | Threads = 1 4 | -------------------------------------------------------------------------------- /samples/memory/example-2/README: -------------------------------------------------------------------------------- 1 | This file shows the m2s command line appended before the target executable. The 2 | command line utilizes the memory configuration present in "mem-config", 3 | the x86 configuration present in "x86-config" and the network configuration in 4 | "net-config". 5 | 6 | m2s --x86-sim detailed --mem-config mem-config --x86-config x86-config --net-config net-config a.out 7 | -------------------------------------------------------------------------------- /samples/memory/example-2/net-config: -------------------------------------------------------------------------------- 1 | [Network.net0] 2 | DefaultInputBufferSize = 1024 3 | DefaultOutputBufferSize = 1024 4 | DefaultBandwidth = 256 5 | 6 | ; Three nodes of switch 0, connected to 3 L1s 7 | 8 | [Network.net0.Node.sw0] 9 | Type = Switch 10 | 11 | [Network.net0.Node.n0] 12 | Type = EndNode 13 | 14 | [Network.net0.Node.n1] 15 | Type = EndNode 16 | 17 | [Network.net0.Node.n2] 18 | Type = EndNode 19 | 20 | ; 2nd switch, with 2 L2s 21 | 22 | [Network.net0.Node.sw1] 23 | Type = Switch 24 | 25 | [Network.net0.Node.n3] 26 | Type = EndNode 27 | 28 | [Network.net0.Node.n4] 29 | Type = EndNode 30 | 31 | 32 | [Network.net0.Link.sw0-sw1] 33 | Source = sw0 34 | Dest = sw1 35 | Type = Bidirectional 36 | 37 | 38 | [Network.net0.Link.sw0-n0] 39 | Source = sw0 40 | Dest = n0 41 | Type = Bidirectional 42 | 43 | 44 | [Network.net0.Link.sw0-n1] 45 | Source = sw0 46 | Dest = n1 47 | Type = Bidirectional 48 | 49 | [Network.net0.Link.sw0-n2] 50 | Source = sw0 51 | Dest = n2 52 | Type = Bidirectional 53 | 54 | [Network.net0.Link.sw1-n3] 55 | Source = sw1 56 | Dest = n3 57 | Type = Bidirectional 58 | 59 | 60 | [Network.net0.Link.sw1-n4] 61 | Source = sw1 62 | Dest = n4 63 | Type = Bidirectional 64 | -------------------------------------------------------------------------------- /samples/memory/example-2/x86-config: -------------------------------------------------------------------------------- 1 | [ General ] 2 | Cores = 3 3 | Threads = 1 4 | -------------------------------------------------------------------------------- /samples/memory/example-3/README: -------------------------------------------------------------------------------- 1 | This file shows the m2s command line appended before the target executable. The 2 | command line utilizes the memory configuration present in "mem-config", 3 | the x86 configuration present in "x86-config" and the network configuration in 4 | "net-config". 5 | 6 | m2s --x86-sim detailed --mem-config mem-config --x86-config x86-config --net-config net-config 7 | -------------------------------------------------------------------------------- /samples/memory/example-3/x86-config: -------------------------------------------------------------------------------- 1 | [ General ] 2 | Cores = 4 3 | Threads = 1 4 | -------------------------------------------------------------------------------- /samples/memory/example-4/README: -------------------------------------------------------------------------------- 1 | This file shows the m2s command line appended before the target executable. The 2 | command line utilizes the memory configuration present in "mem-config", the x86 3 | configuration present in "x86-config" and the evergreeen GPU configuration in 4 | "evg-config". 5 | 6 | m2s --x86-sim detailed --x86-config x86-config --evg-sim detailed --evg-config gpu-config --mem-config mem-config 7 | -------------------------------------------------------------------------------- /samples/memory/example-4/evg-config: -------------------------------------------------------------------------------- 1 | [ Device ] 2 | NumComputeUnits = 4 3 | 4 | -------------------------------------------------------------------------------- /samples/memory/example-4/x86-config: -------------------------------------------------------------------------------- 1 | [ General ] 2 | Cores = 1 3 | Threads = 2 4 | -------------------------------------------------------------------------------- /samples/memory/example-5/README: -------------------------------------------------------------------------------- 1 | This file shows the m2s command line appended before the target executable. The 2 | command line utilizes the memory configuration present in "mem-config", the x86 3 | configuration present in "x86-config" and the SI GPU configuration in 4 | "si-config". 5 | 6 | The configuration files present implement a similar memory hierarchy as the 7 | files shown in example-4. However the Everygreen GPU compute units are 8 | replaced with SI compute units. 9 | 10 | m2s --x86-sim detailed --x86-config x86-config --si-sim detailed --si-config si-config --mem-config mem-config 11 | -------------------------------------------------------------------------------- /samples/memory/example-5/si-config: -------------------------------------------------------------------------------- 1 | [ Device ] 2 | NumComputeUnits = 4 3 | 4 | -------------------------------------------------------------------------------- /samples/memory/example-5/x86-config: -------------------------------------------------------------------------------- 1 | [ General ] 2 | Cores = 1 3 | Threads = 2 4 | -------------------------------------------------------------------------------- /samples/mips/test-args: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Multi2Sim/multi2sim/77b16e0ba3c23c5609657834b8cdfc7d0e22c303/samples/mips/test-args -------------------------------------------------------------------------------- /samples/mips/test-args.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(int argc, char **argv, char **envp) { 4 | int i; 5 | printf("number of arguments: %d\n", argc); 6 | for (i = 0; i < argc; i++) 7 | printf("\targv[%d] = %s\n", i, argv[i]); 8 | return 0; 9 | } 10 | 11 | -------------------------------------------------------------------------------- /samples/mips/test-sort: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Multi2Sim/multi2sim/77b16e0ba3c23c5609657834b8cdfc7d0e22c303/samples/mips/test-sort -------------------------------------------------------------------------------- /samples/mips/test-sort.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int compar(const void *e1, const void *e2) 5 | { 6 | return * (int *) e1 - * (int *) e2; 7 | } 8 | 9 | 10 | #define NELEM 500 11 | int main(int argc, char **argv) 12 | { 13 | int *elem, i; 14 | 15 | /* Create vector */ 16 | printf("Creating a vector of %d elements...\n", NELEM); 17 | fflush(stdout); 18 | elem = calloc(NELEM, sizeof(int)); 19 | for (i = 0; i < NELEM; i++) 20 | elem[i] = random(); 21 | 22 | printf("Sorting vector...\n"); 23 | fflush(stdout); 24 | qsort(elem, NELEM, sizeof(int), compar); 25 | 26 | printf("Finished\n"); 27 | return 0; 28 | } 29 | 30 | -------------------------------------------------------------------------------- /samples/network/example-10/README: -------------------------------------------------------------------------------- 1 | Ideal Network for Southern Island R9-290x 2 | -------------------------------------- 3 | It invloves Multiple Buses for each Compute Unit. Each Node writes in one specific 4 | BUS which all other Nodes are listening to. 5 | 6 | ../../../bin/m2s --si-sim detailed --si-config si-config-44 --mem-config mem-si-44 --net-config net-si-44 --ctx-config ctx-config --net-snapshot 1000 --net-report report.net 7 | 8 | -------------------------------------------------------------------------------- /samples/network/example-10/ctx-config: -------------------------------------------------------------------------------- 1 | [ Context 0 ] 2 | Exe = MatrixMultiplication 3 | Args = -x 128 -y 128 -z 128 --load MatrixMultiplication_Kernels_si.bin -q 4 | -------------------------------------------------------------------------------- /samples/network/example-10/si-config-44: -------------------------------------------------------------------------------- 1 | [ Device ] 2 | NumComputeUnits = 44 3 | -------------------------------------------------------------------------------- /samples/network/example-11/README: -------------------------------------------------------------------------------- 1 | Ideal Network for Many-Core 40 CPU system 2 | -------------------------------------- 3 | It invloves Multiple Buses for each Compute Unit. L1 to L2 contains a magic net with fix delay of 3 4 | 5 | ../../../bin/m2s --x86-sim detailed --x86-config x86-config-40 --mem-config mem-x86-40 --net-config net-x86-40 --ctx-config ctx-config --net-snapshot 10000 --net-report report.net 6 | -------------------------------------------------------------------------------- /samples/network/example-11/ctx-config: -------------------------------------------------------------------------------- 1 | [ Context 0 ] 2 | Exe = radix.i386 3 | Args = -p40 -r4096 -n262144 -m524288 4 | -------------------------------------------------------------------------------- /samples/network/example-11/x86-config-40: -------------------------------------------------------------------------------- 1 | [ General] 2 | Cores = 40 3 | Threads = 1 4 | -------------------------------------------------------------------------------- /samples/network/example-12/README: -------------------------------------------------------------------------------- 1 | # this test creates a cycle in the network but using the manual routing 2 | -------------------------------------------------------------------------------- /samples/network/example-12/net-cycle.ini: -------------------------------------------------------------------------------- 1 | [Network.mynet] 2 | DefaultInputBufferSize = 10 3 | DefaultOutputBufferSize = 20 4 | DefaultBandwidth = 2 5 | 6 | [Network.mynet.Node.N0] 7 | Type = EndNode 8 | 9 | [Network.mynet.Node.N1] 10 | Type = EndNode 11 | 12 | [Network.mynet.Node.N2] 13 | Type = EndNode 14 | 15 | [Network.mynet.Node.N3] 16 | Type = EndNode 17 | 18 | [Network.mynet.Node.S0] 19 | Type = Switch 20 | InputBufferSize = 30 21 | OutputBufferSize = 4 22 | 23 | [Network.mynet.Node.S1] 24 | Type = Switch 25 | InputBufferSize = 5 26 | OutputBufferSize = 6 27 | 28 | [Network.mynet.Node.S2] 29 | Type = Switch 30 | 31 | [Network.mynet.Node.S3] 32 | Type = Switch 33 | 34 | [Network.mynet.Link.N0-S0] 35 | Source = N0 36 | Dest = S0 37 | Type = Bidirectional 38 | 39 | [Network.mynet.Link.N1-S1] 40 | Source = N1 41 | Dest = S1 42 | Type = Bidirectional 43 | 44 | [Network.mynet.Link.N2-S2] 45 | Source = N2 46 | Dest = S2 47 | Type = Bidirectional 48 | 49 | [Network.mynet.Link.N3-S3] 50 | Source = N3 51 | Dest = S3 52 | Type = Bidirectional 53 | 54 | [Network.mynet.Link.S0-S1] 55 | Source = S0 56 | Dest = S1 57 | Type = Bidirectional 58 | 59 | [Network.mynet.Link.S0-S2] 60 | Source = S0 61 | Dest = S2 62 | Type = Bidirectional 63 | 64 | [Network.mynet.Link.S1-S3] 65 | Source = S1 66 | Dest = S3 67 | Type = Bidirectional 68 | 69 | [Network.mynet.Link.S2-S3] 70 | Source = S2 71 | Dest = S3 72 | Type = Bidirectional 73 | 74 | [Network.mynet.Routes] 75 | N0.to.N2 = S0 76 | S0.to.N2 = S1 77 | S1.to.N2 = S3 78 | S3.to.N2 = S2 79 | N3.to.N1 = S3 80 | S3.to.N1 = S2 81 | S2.to.N1 = S0 82 | S0.to.N1 = S1 83 | -------------------------------------------------------------------------------- /samples/network/example-13/README: -------------------------------------------------------------------------------- 1 | # Another manual routing test that mimics exactly what would happen if 2 | # the automatic routing would be used (which is the shortest path algorithm) 3 | 4 | $M2SROOT/bin/m2s --net-sim mynet --net-config net-config 5 | -------------------------------------------------------------------------------- /samples/network/example-14/README: -------------------------------------------------------------------------------- 1 | # Another manual routing test for multi2sim network model. 2 | # 3 | # This specific test accounts for every feature that manual routing provides, 4 | # which includes the use of virtual channels, and obviously the manual routes 5 | # that are not necessarily the shortest path 6 | 7 | $M2SROOT/bin/m2s --net-sim mynet --net-config net-config.ini 8 | -------------------------------------------------------------------------------- /samples/network/example-15/README: -------------------------------------------------------------------------------- 1 | The Southern Island 7970 with an Ideal network between L1 and L2. 2 | Ideal network has a constant latency of 1 cycle between send and receive of 3 | any package. 4 | 5 | ######################################################################################### 6 | 7 | L1S = L1 cache for Scalar Unit; There is 8 L1S in default Southern Island Configuration 8 | L1V = L1 cache for Vector Unit; There is 32 L1V in default SI Configuration 9 | L2N = L2 cache ; There is 6 L2 Cache in default SI Configuration 10 | _____ _____ _____ _____ _____ _____ _____ 11 | | L1S | | L1S | ... | L1S | | L1V | | L1V | | L1V | ... | L1V | 12 | |_____| |_____| |_____| |_____| |_____| |_____| |_____| 13 | 14 | 15 | ------------------------------------------------------- 16 | | | 17 | | Ideal Network | 18 | | | 19 | ------------------------------------------------------- 20 | _____ _____ _____ _____ _____ _____ 21 | | L2N | | L2N | | L2N | | L2N | | L2N | | L2N | 22 | |_____| |_____| |_____| |_____| |_____| |_____| 23 | 24 | ######################################################################################## 25 | To Run simulation, modify the following for your binary: 26 | 27 | $> m2s --si-sim detailed --mem-config mem-si --net-config net-ideal --si-config si-config --ctx-config ctx-config 28 | 29 | --------------------------------------------------------------------------------------- 30 | 31 | -------------------------------------------------------------------------------- /samples/network/example-15/ctx-config: -------------------------------------------------------------------------------- 1 | [ Context 0 ] 2 | Exe = MatrixMultiplication_static 3 | Args = -x 128 -y 128 -z 128 --load MatrixMultiplication_Kernels.bin -q 4 | -------------------------------------------------------------------------------- /samples/network/example-15/si-config: -------------------------------------------------------------------------------- 1 | [ Device ] 2 | NumComputeUnits = 32 3 | 4 | -------------------------------------------------------------------------------- /samples/network/example-2/README: -------------------------------------------------------------------------------- 1 | The Southern Island 7970 Default Configuration With external network between L1 and L2. 2 | 3 | ######################################################################################### 4 | 5 | L1S = L1 cache for Scalar Unit; There is 8 L1S in default Southern Island Configuration 6 | L1V = L1 cache for Vector Unit; There is 32 L1V in default SI Configuration 7 | L2N = L2 cache ; There is 6 L2 Cache in default SI Configuration 8 | SW = Switch ; One switch act as a Crossbar connecting L1 Cache Level to L2 Cache Level 9 | _____ _____ _____ _____ _____ _____ _____ 10 | | L1S | | L1S | ... | L1S | | L1V | | L1V | | L1V | ... | L1V | 11 | |_____| |_____| |_____| |_____| |_____| |_____| |_____| 12 | 13 | 14 | 15 | ____ 16 | | SW | 17 | |____| 18 | 19 | 20 | _____ _____ _____ _____ _____ _____ 21 | | L2N | | L2N | | L2N | | L2N | | L2N | | L2N | 22 | |_____| |_____| |_____| |_____| |_____| |_____| 23 | 24 | ######################################################################################## 25 | To Run simulation, modify the following for your binary: 26 | 27 | $> m2s --si-sim detailed --mem-config mem-si --net-config net-si --si-config si-config --ctx-config ctx-config --net-report report 28 | 29 | -------------------------------------------------------------------------------- /samples/network/example-2/ctx-config: -------------------------------------------------------------------------------- 1 | [ Context 0 ] 2 | Exe = MatrixMultiplication 3 | Args = -x 128 -y 128 -z 128 --load MatrixMultiplication_Kernels_si.bin -q 4 | -------------------------------------------------------------------------------- /samples/network/example-2/si-config: -------------------------------------------------------------------------------- 1 | [ Device ] 2 | NumComputeUnits = 32 3 | 4 | -------------------------------------------------------------------------------- /samples/network/example-3/README: -------------------------------------------------------------------------------- 1 | An example using BUS in Multi2sim. 2 | Run the following: 3 | 4 | --net-sim mynet --net-config net-bus --net-injection-rate 5 --net-max-cycles 1000 --net-msg-size 1 --net-visual net.vis 5 | -------------------------------------------------------------------------------- /samples/network/example-3/net-bus: -------------------------------------------------------------------------------- 1 | [Network.mynet] 2 | DefaultInputBufferSize = 10 3 | DefaultOutputBufferSize = 20 4 | DefaultBandwidth = 2 5 | 6 | [Network.mynet.Node.N0] 7 | Type = EndNode 8 | 9 | [Network.mynet.Node.N1] 10 | Type = EndNode 11 | 12 | [Network.mynet.Node.N2] 13 | Type = EndNode 14 | 15 | [Network.mynet.Node.N3] 16 | Type = EndNode 17 | 18 | [Network.mynet.Node.S0] 19 | Type = Switch 20 | InputBufferSize = 30 21 | OutputBufferSize = 4 22 | 23 | [Network.mynet.Node.S1] 24 | Type = Switch 25 | InputBufferSize = 5 26 | OutputBufferSize = 6 27 | 28 | [Network.mynet.Bus.B0] 29 | Lanes = 2 30 | 31 | [Network.mynet.Link.n0-s0] 32 | Source = N0 33 | Dest = S0 34 | Type = Unidirectional 35 | 36 | [Network.mynet.Link.n3-s1] 37 | Source = N3 38 | Dest = S1 39 | Type = Bidirectional 40 | 41 | [Network.mynet.BusPort.n1-b0] 42 | Bus = B0 43 | Node = N1 44 | Type = Receiver 45 | BufferSize = 7 46 | 47 | [Network.mynet.BusPort.n2-b0] 48 | Node = N2 49 | Bus = B0 50 | Type = Sender 51 | BufferSize = 8 52 | 53 | [Network.mynet.BusPort.b0-n2] 54 | Node = N2 55 | Bus = B0 56 | Type = Receiver 57 | BufferSize = 9 58 | 59 | [Network.mynet.BusPort.s0-b0] 60 | Node = S0 61 | Bus = B0 62 | Type = Sender 63 | BufferSize = 10 64 | 65 | [Network.mynet.BusPort.S1-b0] 66 | Node = S1 67 | Bus = B0 68 | Type = Sender 69 | BufferSize = 20 70 | 71 | -------------------------------------------------------------------------------- /samples/network/example-4/README: -------------------------------------------------------------------------------- 1 | An example of 4x4 Mesh. 2 | In order to make mesh with any size try using the scripts provided in /samples/network/scripts . You can use another script in this folder to create meshes with X-Y routing. 3 | Mesh without manual (here X-Y) routing may lead to cycle in the network and ultimately deadlock. For more information about cycle and deadlock check out multi2sim manual (Interconnection Network Chapter) 4 | 5 | Run the following: 6 | --net-sim net0 --net-config net-mesh --net-injection-rate 32 --net-msg-size 144 --net-max-cycles 120 --net-visual net2.vis 7 | -------------------------------------------------------------------------------- /samples/network/example-5/README: -------------------------------------------------------------------------------- 1 | This network has a cycle. It is a 5x2 torus. 2 | 3 | --net-sim net0 --net-config net-config.ini --net-injection-rate 32 --net-msg-size 144 --net-max-cycles 120 --net-visual net2.vis --net-debug net.debug 4 | 5 | If pointers are not freed, its due to inflight packets. The packet is ditached from message but not re-attached again. A cycle may lead to a dead-line in which 6 | case the packets never arrive at their destination. Since packets are inflight neither them nor their stack will be freed, resulting in unfreed space. 7 | 8 | This should be resolved. 9 | -------------------------------------------------------------------------------- /samples/network/example-6/README: -------------------------------------------------------------------------------- 1 | Example of a 6x6 Mesh with X-Y routing. 2 | In order to create Meshes or Meshes with X-Y routing use the scripts in /samples/network/scripts 3 | 4 | m2s --net-sim net0 --net-config net-mesh-example-rt --net-injection-rate 32 --net-msg-size 144 --net-max-cycles 120 --net-visual net.vis 5 | -------------------------------------------------------------------------------- /samples/network/example-7/README: -------------------------------------------------------------------------------- 1 | Example of a 4x4 torus. 2 | In order to make toruses with anysize try using the scripts provided in /samples/network/scripts 3 | 4 | Torus without manual routing may lead to cycle in the network and ultimately deadlock. For more information about cycle and deadlock check out multi2sim manual (Interconnection Network Chapter) 5 | 6 | Run the following: 7 | /m2s --net-sim net0 --net-config net-torus --net-injection-rate 32 --net-msg-size 144 --net-max-cycles 120 --net-visual net.vis 8 | -------------------------------------------------------------------------------- /samples/network/example-8/Mesh-40-final.eps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Multi2Sim/multi2sim/77b16e0ba3c23c5609657834b8cdfc7d0e22c303/samples/network/example-8/Mesh-40-final.eps -------------------------------------------------------------------------------- /samples/network/example-8/ctx-config: -------------------------------------------------------------------------------- 1 | [ Context 0 ] 2 | Exe = MatrixMultiplication_static 3 | Args = -x 128 -y 128 -z 128 --load MatrixMultiplication_Kernels.bin -q 4 | -------------------------------------------------------------------------------- /samples/network/example-8/si-config: -------------------------------------------------------------------------------- 1 | [ Device ] 2 | NumComputeUnits = 32 3 | 4 | -------------------------------------------------------------------------------- /samples/network/example-9/README: -------------------------------------------------------------------------------- 1 | Ideal Network for Southern Island 7970 2 | -------------------------------------- 3 | It invloves Multiple Buses for each Compute Unit. Each Node writes in one specific 4 | BUS which all other Nodes are listening to. 5 | 6 | ../../../bin/m2s --si-sim detailed --si-config si-config-32 --mem-config mem-si-32 --net-config net-si-32 --ctx-config ctx-config --net-snapshot 1000 --net-report report.net 7 | -------------------------------------------------------------------------------- /samples/network/example-9/ctx-config: -------------------------------------------------------------------------------- 1 | [ Context 0 ] 2 | Exe = MatrixMultiplication 3 | Args = -x 128 -y 128 -z 128 --load MatrixMultiplication_Kernels_si.bin -q 4 | -------------------------------------------------------------------------------- /samples/network/example-9/si-config-32: -------------------------------------------------------------------------------- 1 | [ Device ] 2 | NumComputeUnits = 32 3 | -------------------------------------------------------------------------------- /samples/southern-islands/7770/si-config: -------------------------------------------------------------------------------- 1 | [ Device ] 2 | NumComputeUnits = 10 3 | -------------------------------------------------------------------------------- /samples/southern-islands/7850/si-config: -------------------------------------------------------------------------------- 1 | [ Device ] 2 | NumComputeUnits = 16 3 | -------------------------------------------------------------------------------- /samples/southern-islands/7870/si-config: -------------------------------------------------------------------------------- 1 | [ Device ] 2 | NumComputeUnits = 20 3 | -------------------------------------------------------------------------------- /samples/southern-islands/7970/si-config: -------------------------------------------------------------------------------- 1 | [ Device ] 2 | NumComputeUnits = 32 3 | -------------------------------------------------------------------------------- /samples/southern-islands/scripts/README: -------------------------------------------------------------------------------- 1 | Script si_ideal_config_maker.sh: 2 | 3 | This script is an script to create all three main files for simulation of southern Island Architecture 4 | by variable arguments. The begining of the script has an Input section that one can change number of Compute Units, 5 | Sizes of Cache arguments, Network arguments and also the architecture of the Network between L1 and L2s. Right now this 6 | network is an ideal network with BUS technology. Every node in the simulation (that means compute Units and L2 units) are 7 | connected to one BUS that they can send messages to, and all other Ndoes are listening to it. The message Latency in all 8 | the case is just 2 cycles. 9 | -------------------------------------------------------------------------------- /samples/x86/example-1/README: -------------------------------------------------------------------------------- 1 | % A simple example to test the x86 functional simulation 2 | % in Multi2sim 3 | % For this test first we should build the binary from the source code 4 | % and then use the binary for Multi2sim 5 | 6 | % Building the binary 7 | gcc test-args.c -o test-args -m32 || exit 8 | 9 | % Using the binary in multi2sim 10 | $M2SROOT/bin/m2s --x86-sim functional --x86-config x86-config.ini \ 11 | --ctx-config ctx-config.ini 12 | -------------------------------------------------------------------------------- /samples/x86/example-1/ctx-config.ini: -------------------------------------------------------------------------------- 1 | [ Context 0 ] 2 | Exe = test-args 3 | Args = how are you 4 | StdOut = context-0.out 5 | -------------------------------------------------------------------------------- /samples/x86/example-1/test-args: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Multi2Sim/multi2sim/77b16e0ba3c23c5609657834b8cdfc7d0e22c303/samples/x86/example-1/test-args -------------------------------------------------------------------------------- /samples/x86/example-1/test-args.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(int argc, char **argv, char **envp) { 4 | int i; 5 | printf("number of arguments: %d\n", argc); 6 | for (i = 0; i < argc; i++) 7 | printf("\targv[%d] = %s\n", i, argv[i]); 8 | return 0; 9 | } 10 | 11 | -------------------------------------------------------------------------------- /samples/x86/example-1/x86-config.ini: -------------------------------------------------------------------------------- 1 | [ General ] 2 | Cores = 1 3 | -------------------------------------------------------------------------------- /samples/x86/example-2/README: -------------------------------------------------------------------------------- 1 | % Another simple example to test the x86 detailed simulation 2 | % in Multi2sim. The difference with example-1 is the use of detailed 3 | % simulation instead of functional. 4 | % 5 | % This example contains a test for sorting an array. 6 | % 7 | % For this test first we should build the binary from the source code 8 | % and then use the binary for Multi2sim 9 | 10 | % Building the binary 11 | gcc test-sort.c -o test-sort -m32 || exit 12 | 13 | % Using the binary in multi2sim 14 | $M2SROOT/bin/m2s --x86-sim detailed --x86-config x86-config.ini \ 15 | --ctx-config ctx-config.ini 16 | -------------------------------------------------------------------------------- /samples/x86/example-2/ctx-config.ini: -------------------------------------------------------------------------------- 1 | [ Context 0 ] 2 | Exe = test-sort 3 | Stdout = context-0.out 4 | -------------------------------------------------------------------------------- /samples/x86/example-2/test-sort: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Multi2Sim/multi2sim/77b16e0ba3c23c5609657834b8cdfc7d0e22c303/samples/x86/example-2/test-sort -------------------------------------------------------------------------------- /samples/x86/example-2/test-sort.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int compar(const void *e1, const void *e2) 5 | { 6 | return * (int *) e1 - * (int *) e2; 7 | } 8 | 9 | 10 | #define NELEM 500 11 | int main(int argc, char **argv) 12 | { 13 | int *elem, i; 14 | 15 | /* Create vector */ 16 | printf("Creating a vector of %d elements...\n", NELEM); 17 | fflush(stdout); 18 | elem = calloc(NELEM, sizeof(int)); 19 | for (i = 0; i < NELEM; i++) 20 | elem[i] = random(); 21 | 22 | printf("Sorting vector...\n"); 23 | fflush(stdout); 24 | qsort(elem, NELEM, sizeof(int), compar); 25 | 26 | printf("Finished\n"); 27 | return 0; 28 | } 29 | 30 | -------------------------------------------------------------------------------- /samples/x86/example-2/x86-config.ini: -------------------------------------------------------------------------------- 1 | [ General ] 2 | Cores = 1 3 | -------------------------------------------------------------------------------- /samples/x86/example-3/README: -------------------------------------------------------------------------------- 1 | % Example to test the x86 detailed simulation with two concurrent 2 | % contexts in Multi2sim. 3 | % 4 | % This example contains two applications, a test for sorting an array, and 5 | % also a test which separates the arguments of the input binary. 6 | % 7 | % For this test first we should build the binaries from the source code 8 | % and then use these binaries for Multi2sim 9 | 10 | % Building the binary 11 | gcc test-args.c -o test-args -m32 || exit 12 | gcc test-sort.c -o test-sort -m32 || exit 13 | 14 | % Using the binary in multi2sim 15 | $M2SROOT/bin/m2s --x86-sim detailed --x86-config x86-config.ini \ 16 | --ctx-config ctx-config.ini 17 | -------------------------------------------------------------------------------- /samples/x86/example-3/ctx-config.ini: -------------------------------------------------------------------------------- 1 | [ Context 0 ] 2 | Exe = test-args 3 | Args = how are you 4 | StdOut = context-0.out 5 | 6 | [ Context 1 ] 7 | Exe = test-sort 8 | Stdout = context-1.out 9 | -------------------------------------------------------------------------------- /samples/x86/example-3/test-args: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Multi2Sim/multi2sim/77b16e0ba3c23c5609657834b8cdfc7d0e22c303/samples/x86/example-3/test-args -------------------------------------------------------------------------------- /samples/x86/example-3/test-args.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(int argc, char **argv, char **envp) { 4 | int i; 5 | printf("number of arguments: %d\n", argc); 6 | for (i = 0; i < argc; i++) 7 | printf("\targv[%d] = %s\n", i, argv[i]); 8 | return 0; 9 | } 10 | 11 | -------------------------------------------------------------------------------- /samples/x86/example-3/test-sort: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Multi2Sim/multi2sim/77b16e0ba3c23c5609657834b8cdfc7d0e22c303/samples/x86/example-3/test-sort -------------------------------------------------------------------------------- /samples/x86/example-3/test-sort.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int compar(const void *e1, const void *e2) 5 | { 6 | return * (int *) e1 - * (int *) e2; 7 | } 8 | 9 | 10 | #define NELEM 500 11 | int main(int argc, char **argv) 12 | { 13 | int *elem, i; 14 | 15 | /* Create vector */ 16 | printf("Creating a vector of %d elements...\n", NELEM); 17 | fflush(stdout); 18 | elem = calloc(NELEM, sizeof(int)); 19 | for (i = 0; i < NELEM; i++) 20 | elem[i] = random(); 21 | 22 | printf("Sorting vector...\n"); 23 | fflush(stdout); 24 | qsort(elem, NELEM, sizeof(int), compar); 25 | 26 | printf("Finished\n"); 27 | return 0; 28 | } 29 | 30 | -------------------------------------------------------------------------------- /samples/x86/example-3/x86-config.ini: -------------------------------------------------------------------------------- 1 | [ General ] 2 | Cores = 1 3 | -------------------------------------------------------------------------------- /samples/x86/example-4/README: -------------------------------------------------------------------------------- 1 | % Example to test the x86 detailed simulation with one multi-threaded 2 | % application running multiple concurrent threads on a CPU with 2 cores 3 | % each capable of running two threads. 4 | % 5 | % For this test first we should build the binary from the source code 6 | % and then use this binary for Multi2sim 7 | 8 | % Building the binary 9 | gcc test-threads.c -o test-threads -lpthread -m32 || exit 10 | 11 | % Using the binary in multi2sim 12 | $M2SROOT/bin/m2s --x86-sim detailed --x86-config x86-config.ini \ 13 | --ctx-config ctx-config.ini 14 | -------------------------------------------------------------------------------- /samples/x86/example-4/ctx-config.ini: -------------------------------------------------------------------------------- 1 | [ Context 0 ] 2 | Exe = test-threads 3 | Args = 4 4 | Stdout = context-0.out 5 | -------------------------------------------------------------------------------- /samples/x86/example-4/test-threads: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Multi2Sim/multi2sim/77b16e0ba3c23c5609657834b8cdfc7d0e22c303/samples/x86/example-4/test-threads -------------------------------------------------------------------------------- /samples/x86/example-4/test-threads.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #define MAX_THREADS 32 6 | 7 | 8 | void *child_fn(void *arg) 9 | { 10 | int idx = (int) arg; 11 | printf("I'm thread %d\n", idx); 12 | fflush(stdout); 13 | return NULL; 14 | } 15 | 16 | int main(int argc, char **argv) 17 | { 18 | int nthreads, i; 19 | pthread_t child[MAX_THREADS]; 20 | 21 | /* Syntax */ 22 | if (argc < 2) { 23 | fprintf(stderr, "syntax: test-threads \n"); 24 | exit(1); 25 | } 26 | 27 | /* Get number of threads */ 28 | nthreads = atoi(argv[1]); 29 | if (nthreads < 1 || nthreads > MAX_THREADS) { 30 | fprintf(stderr, "error: nthreads must be > 0 and < %d\n", MAX_THREADS); 31 | exit(1); 32 | } 33 | 34 | /* Run */ 35 | for (i = 1; i < nthreads; i++) 36 | pthread_create(&child[i], NULL, child_fn, (int *) i); 37 | child_fn((int *) 0); 38 | for (i = 1; i < nthreads; i++) 39 | pthread_join(child[i], NULL); 40 | return 0; 41 | } 42 | 43 | -------------------------------------------------------------------------------- /samples/x86/example-4/x86-config.ini: -------------------------------------------------------------------------------- 1 | [ General ] 2 | Cores = 2 3 | Threads = 2 4 | -------------------------------------------------------------------------------- /src/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.a 3 | .deps 4 | Makefile 5 | Makefile.in 6 | -------------------------------------------------------------------------------- /src/arch/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.a 3 | .deps 4 | Makefile 5 | Makefile.in 6 | -------------------------------------------------------------------------------- /src/arch/Makefile.am: -------------------------------------------------------------------------------- 1 | SUBDIRS = \ 2 | arm \ 3 | common \ 4 | hsa \ 5 | kepler \ 6 | mips \ 7 | southern-islands \ 8 | x86 9 | -------------------------------------------------------------------------------- /src/arch/arm/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.a 3 | .deps 4 | Makefile 5 | Makefile.in 6 | -------------------------------------------------------------------------------- /src/arch/arm/Makefile.am: -------------------------------------------------------------------------------- 1 | SUBDIRS = \ 2 | disassembler \ 3 | emulator \ 4 | timing 5 | -------------------------------------------------------------------------------- /src/arch/arm/disassembler/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.a 3 | .deps 4 | Makefile 5 | Makefile.in 6 | -------------------------------------------------------------------------------- /src/arch/arm/disassembler/Makefile.am: -------------------------------------------------------------------------------- 1 | lib_LIBRARIES = libdisassembler.a 2 | 3 | libdisassembler_a_SOURCES = \ 4 | \ 5 | Instruction.cc \ 6 | Instruction.h \ 7 | \ 8 | Instruction.def \ 9 | InstructionThumb.def \ 10 | InstructionThumb32.def \ 11 | \ 12 | Disassembler.cc \ 13 | Disassembler.h 14 | 15 | 16 | AM_CPPFLAGS = @M2S_INCLUDES@ 17 | 18 | -------------------------------------------------------------------------------- /src/arch/arm/emulator/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.a 3 | .deps 4 | Makefile 5 | Makefile.in 6 | -------------------------------------------------------------------------------- /src/arch/arm/emulator/Makefile.am: -------------------------------------------------------------------------------- 1 | lib_LIBRARIES = libemulator.a 2 | 3 | libemulator_a_SOURCES = \ 4 | \ 5 | Emulator.h \ 6 | Emulator.cc \ 7 | \ 8 | Context.h \ 9 | Context.cc \ 10 | ContextLoader.cc \ 11 | ContextIsa.cc \ 12 | ContextIsaArm32.cc \ 13 | ContextIsaThumb16.cc \ 14 | ContextIsaThumb32.cc \ 15 | ContextSyscall.cc \ 16 | ContextSyscall.def \ 17 | ContextSignal.cc \ 18 | \ 19 | Regs.h \ 20 | Regs.cc \ 21 | \ 22 | Signal.h 23 | 24 | AM_CPPFLAGS = @M2S_INCLUDES@ 25 | 26 | -------------------------------------------------------------------------------- /src/arch/arm/timing/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.a 3 | .deps 4 | Makefile 5 | Makefile.in 6 | -------------------------------------------------------------------------------- /src/arch/arm/timing/Makefile.am: -------------------------------------------------------------------------------- 1 | lib_LIBRARIES = libtiming.a 2 | 3 | libtiming_a_SOURCES = 4 | 5 | AM_CPPFLAGS = @M2S_INCLUDES@ 6 | 7 | -------------------------------------------------------------------------------- /src/arch/common/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.a 3 | .deps 4 | Makefile 5 | Makefile.in 6 | -------------------------------------------------------------------------------- /src/arch/common/Makefile.am: -------------------------------------------------------------------------------- 1 | lib_LIBRARIES = libcommon.a 2 | 3 | libcommon_a_SOURCES = \ 4 | \ 5 | Arch.cc \ 6 | Arch.h \ 7 | \ 8 | CallStack.cc \ 9 | CallStack.h \ 10 | \ 11 | Context.cc \ 12 | Context.h \ 13 | \ 14 | Disassembler.cc \ 15 | Disassembler.h \ 16 | \ 17 | Driver.cc \ 18 | Driver.h \ 19 | \ 20 | Emulator.cc \ 21 | Emulator.h \ 22 | \ 23 | FileTable.cc \ 24 | FileTable.h \ 25 | \ 26 | Runtime.cc \ 27 | Runtime.h \ 28 | \ 29 | Timing.cc \ 30 | Timing.h 31 | 32 | AM_CPPFLAGS = @M2S_INCLUDES@ 33 | 34 | -------------------------------------------------------------------------------- /src/arch/hsa/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.a 3 | .deps 4 | Makefile 5 | Makefile.in 6 | -------------------------------------------------------------------------------- /src/arch/hsa/Makefile.am: -------------------------------------------------------------------------------- 1 | SUBDIRS = \ 2 | disassembler \ 3 | driver \ 4 | emulator 5 | -------------------------------------------------------------------------------- /src/arch/hsa/disassembler/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.a 3 | .deps 4 | Makefile 5 | Makefile.in 6 | -------------------------------------------------------------------------------- /src/arch/hsa/disassembler/BrigDataEntry.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim 3 | * Copyright (C) 2014 Yifan Sun (yifansun@coe.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #include "BrigSection.h" 21 | #include "BrigDataEntry.h" 22 | 23 | namespace HSA 24 | { 25 | 26 | const std::string BrigDataEntry::getString() const 27 | { 28 | std::string str((const char *)data->bytes, data->byteCount); 29 | return str; 30 | } 31 | 32 | 33 | unsigned int BrigDataEntry::getByteCount() const 34 | { 35 | return data->byteCount; 36 | } 37 | 38 | 39 | const unsigned char *BrigDataEntry::getBytes() const 40 | { 41 | return (const unsigned char *)data->bytes; 42 | } 43 | 44 | 45 | } // namespace HSA 46 | -------------------------------------------------------------------------------- /src/arch/hsa/disassembler/BrigEntry.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim 3 | * Copyright (C) 2014 Yifan Sun (yifansun@coe.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #include "BrigSection.h" 21 | #include "BrigEntry.h" 22 | 23 | namespace HSA 24 | { 25 | 26 | void BrigEntry::setSection(const BrigSection *section) 27 | { 28 | this->section = section; 29 | this->binary = section->getBinary(); 30 | } 31 | 32 | 33 | unsigned int BrigEntry::getOffset() const 34 | { 35 | return base - section->getBuffer(); 36 | } 37 | 38 | } // namespace HSA 39 | -------------------------------------------------------------------------------- /src/arch/hsa/disassembler/Makefile.am: -------------------------------------------------------------------------------- 1 | lib_LIBRARIES = libdisassembler.a 2 | 3 | libdisassembler_a_SOURCES = \ 4 | \ 5 | AsmService.h \ 6 | AsmService.cc \ 7 | \ 8 | Brig.h \ 9 | \ 10 | BrigCodeEntry.h \ 11 | BrigCodeEntryGetter.cc \ 12 | BrigCodeEntryDump.cc \ 13 | \ 14 | BrigDataEntry.h \ 15 | BrigDataEntry.cc \ 16 | \ 17 | BrigEntry.h \ 18 | BrigEntry.cc \ 19 | \ 20 | BrigFile.h \ 21 | BrigFile.cc \ 22 | \ 23 | BrigImmed.h \ 24 | BrigImmed.cc \ 25 | \ 26 | BrigOperandEntry.h \ 27 | BrigOperandEntry.cc \ 28 | \ 29 | BrigSection.h \ 30 | BrigSection.cc \ 31 | \ 32 | Disassembler.cc \ 33 | Disassembler.h \ 34 | \ 35 | Instruction.def 36 | 37 | AM_CPPFLAGS = @M2S_INCLUDES@ 38 | -------------------------------------------------------------------------------- /src/arch/hsa/driver/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.a 3 | .deps 4 | Makefile 5 | Makefile.in 6 | -------------------------------------------------------------------------------- /src/arch/hsa/driver/DriverCallHandler.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim 3 | * Copyright (C) 2014 Yifan Sun (yifansun@coe.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef ARCH_HSA_DRIVER_DRIVERCALLHANDLER_H 21 | #define ARCH_HSA_DRIVER_DRIVERCALLHANDLER_H 22 | 23 | #include 24 | 25 | namespace mem 26 | { 27 | class Memory; 28 | } 29 | 30 | namespace HSA 31 | { 32 | 33 | class DriverCallHandler 34 | { 35 | public: 36 | DriverCallHandler() {}; 37 | virtual ~DriverCallHandler() {}; 38 | virtual void Process(mem::Memory *memory, uint32_t args_ptr) = 0; 39 | }; 40 | 41 | } // namespace HSA 42 | 43 | #endif // ARCH_HSA_DRIVER_DRIVERCALLHANDLER_H 44 | -------------------------------------------------------------------------------- /src/arch/hsa/driver/HsaExecutableSymbol.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim 3 | * Copyright (C) 2014 Yifan Sun (yifansun@coe.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #include "HsaExecutableSymbol.h" 21 | 22 | namespace HSA 23 | { 24 | 25 | } // namespace HSA 26 | -------------------------------------------------------------------------------- /src/arch/hsa/driver/Makefile.am: -------------------------------------------------------------------------------- 1 | lib_LIBRARIES = libdriver.a 2 | 3 | libdriver_a_SOURCES = \ 4 | \ 5 | Driver.h \ 6 | Driver.cc \ 7 | DriverCall.cc \ 8 | \ 9 | Driver.def \ 10 | \ 11 | HsaExecutable.h \ 12 | HsaExecutable.cc \ 13 | \ 14 | HsaProgram.h \ 15 | HsaProgram.cc \ 16 | \ 17 | HsaExecutableSymbol.h \ 18 | HsaExecutableSymbol.cc \ 19 | \ 20 | Signal.h \ 21 | Signal.cc \ 22 | \ 23 | SignalManager.h \ 24 | SignalManager.cc \ 25 | \ 26 | DriverCallHandler.h \ 27 | \ 28 | SignalDestroyHandler.h \ 29 | SignalDestroyHandler.cc 30 | 31 | AM_CPPFLAGS = @M2S_INCLUDES@ 32 | -------------------------------------------------------------------------------- /src/arch/hsa/driver/Signal.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim 3 | * Copyright (C) 2014 Yifan Sun (yifansun@coe.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #include "Signal.h" 21 | 22 | namespace HSA 23 | { 24 | 25 | Signal::Signal() 26 | { 27 | } 28 | 29 | } // namespace net 30 | -------------------------------------------------------------------------------- /src/arch/hsa/driver/Signal.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim 3 | * Copyright (C) 2014 Yifan Sun (yifansun@coe.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef ARCH_HSA_EMULATOR_SIGNAL_H 21 | #define ARCH_HSA_EMULATOR_SIGNAL_H 22 | 23 | #include 24 | 25 | namespace HSA 26 | { 27 | 28 | class Signal 29 | { 30 | 31 | // Signal value 32 | int64_t value = 0; 33 | 34 | public: 35 | 36 | // Constructor 37 | Signal(); 38 | 39 | // Get value 40 | int64_t getValue() const { return value; } 41 | 42 | // Set value 43 | void setValue(int64_t value) { this->value = value; } 44 | 45 | }; 46 | 47 | } // namespace net 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /src/arch/hsa/driver/SignalDestroyHandler.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim 3 | * Copyright (C) 2014 Yifan Sun (yifansun@coe.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef ARCH_HSA_DRIVER_SIGNALDESTROYHANDLER_H 21 | #define ARCH_HSA_DRIVER_SIGNALDESTROYHANDLER_H 22 | 23 | #include "DriverCallHandler.h" 24 | 25 | namespace HSA 26 | { 27 | class SignalManager; 28 | 29 | class SignalDestroyHandler: public DriverCallHandler 30 | { 31 | struct __attribute__ ((packed)) Data 32 | { 33 | uint32_t status; 34 | uint64_t signal; 35 | }; 36 | 37 | SignalManager *signal_manager; 38 | 39 | public: 40 | SignalDestroyHandler(SignalManager *signal_manager); 41 | virtual ~SignalDestroyHandler(); 42 | void Process(mem::Memory *memory, uint32_t args_ptr); 43 | }; 44 | 45 | } // namespace HSA 46 | 47 | #endif // ARCH_HSA_DRIVER_SIGNALDESTROYHANDLER_H 48 | -------------------------------------------------------------------------------- /src/arch/hsa/emulator/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.a 3 | .deps 4 | Makefile 5 | Makefile.in 6 | -------------------------------------------------------------------------------- /src/arch/hsa/emulator/AddInstructionWorker.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim 3 | * Copyright (C) 2014 Yifan Sun (yifansun@coe.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef SRC_ARCH_HSA_EMULATOR_ADDINSTRUCTIONWORKER_H_ 21 | #define SRC_ARCH_HSA_EMULATOR_ADDINSTRUCTIONWORKER_H_ 22 | 23 | #include "HsaInstructionWorker.h" 24 | 25 | namespace HSA 26 | { 27 | 28 | class AddInstructionWorker: public HsaInstructionWorker 29 | { 30 | template 31 | void Inst_ADD_Aux(BrigCodeEntry *instruction); 32 | public: 33 | AddInstructionWorker(WorkItem *work_item, 34 | StackFrame *stack_frame); 35 | virtual ~AddInstructionWorker(); 36 | void Execute(BrigCodeEntry *instruction) override; 37 | }; 38 | 39 | } // namespace HSA 40 | 41 | #endif /* SRC_ARCH_HSA_EMULATOR_ADDINSTRUCTIONWORKER_H_ */ 42 | -------------------------------------------------------------------------------- /src/arch/hsa/emulator/AndInstructionWorker.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim 3 | * Copyright (C) 2014 Yifan Sun (yifansun@coe.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef ARCH_HSA_EMULATOR_ANDINSTRUCTIONWORKER_H 21 | #define ARCH_HSA_EMULATOR_ANDINSTRUCTIONWORKER_H 22 | 23 | #include "HsaInstructionWorker.h" 24 | 25 | namespace HSA 26 | { 27 | 28 | class AndInstructionWorker: public HsaInstructionWorker 29 | { 30 | template 31 | void Inst_AND_Aux(BrigCodeEntry *instruction); 32 | 33 | public: 34 | AndInstructionWorker(WorkItem *work_item, 35 | StackFrame *stack_frame); 36 | virtual ~AndInstructionWorker(); 37 | void Execute(BrigCodeEntry *instruction) override; 38 | }; 39 | 40 | } // namespace HSA 41 | 42 | #endif // SRC_ARCH_HSA_EMULATOR_ANDINSTRUCTIONWORKER_H 43 | -------------------------------------------------------------------------------- /src/arch/hsa/emulator/BarrierInstructionWorker.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim 3 | * Copyright (C) 2014 Yifan Sun (yifansun@coe.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef ARCH_HSA_EMULATOR_BARRIERINSTRUCTIONWORKER_H 21 | #define ARCH_HSA_EMULATOR_BARRIERINSTRUCTIONWORKER_H 22 | 23 | #include "HsaInstructionWorker.h" 24 | 25 | namespace HSA 26 | { 27 | 28 | class BarrierInstructionWorker: public HsaInstructionWorker 29 | { 30 | public: 31 | BarrierInstructionWorker(WorkItem *work_item, 32 | StackFrame *stack_frame); 33 | virtual ~BarrierInstructionWorker(); 34 | void Execute(BrigCodeEntry *instruction) override; 35 | }; 36 | 37 | } // namespace HSA 38 | 39 | #endif // SRC_ARCH_HSA_EMULATOR_BARRIERINSTRUCTIONWORKER_H 40 | -------------------------------------------------------------------------------- /src/arch/hsa/emulator/BrInstructionWorker.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim 3 | * Copyright (C) 2014 Yifan Sun (yifansun@coe.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef SRC_ARCH_HSA_EMULATOR_BRINSTRUCTIONWORKER_H_ 21 | #define SRC_ARCH_HSA_EMULATOR_BRINSTRUCTIONWORKER_H_ 22 | 23 | #include "HsaInstructionWorker.h" 24 | 25 | namespace HSA 26 | { 27 | 28 | class BrInstructionWorker: public HsaInstructionWorker 29 | { 30 | public: 31 | BrInstructionWorker(WorkItem *work_item, 32 | StackFrame *stack_frame); 33 | virtual ~BrInstructionWorker(); 34 | void Execute(BrigCodeEntry *instruction) override; 35 | }; 36 | 37 | } // namespace HSA 38 | 39 | #endif /* SRC_ARCH_HSA_EMULATOR_BRINSTRUCTIONWORKER_H_ */ 40 | -------------------------------------------------------------------------------- /src/arch/hsa/emulator/CbrInstructionWorker.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim 3 | * Copyright (C) 2014 Yifan Sun (yifansun@coe.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef ARCH_HSA_EMULATOR_CBRINSTRUCTIONWORKER_H 21 | #define ARCH_HSA_EMULATOR_CBRINSTRUCTIONWORKER_H 22 | 23 | #include "HsaInstructionWorker.h" 24 | 25 | namespace HSA 26 | { 27 | 28 | class CbrInstructionWorker: public HsaInstructionWorker 29 | { 30 | public: 31 | CbrInstructionWorker(WorkItem *work_item, 32 | StackFrame *stack_frame); 33 | virtual ~CbrInstructionWorker(); 34 | void Execute(BrigCodeEntry *instruction) override; 35 | }; 36 | 37 | } // namespace HSA 38 | 39 | #endif // ARCH_HSA_EMULATOR_CBRINSTRUCTIONWORKER_H 40 | -------------------------------------------------------------------------------- /src/arch/hsa/emulator/CmpInstructionWorker.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim 3 | * Copyright (C) 2014 Yifan Sun (yifansun@coe.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef ARCH_HSA_EMULATOR_CMPINSTRUCTIONWORKER_H 21 | #define ARCH_HSA_EMULATOR_CMPINSTRUCTIONWORKER_H 22 | 23 | #include "HsaInstructionWorker.h" 24 | 25 | namespace HSA 26 | { 27 | 28 | class CmpInstructionWorker: public HsaInstructionWorker 29 | { 30 | template 31 | void Inst_CMP_Aux(BrigCodeEntry *instruction); 32 | 33 | public: 34 | CmpInstructionWorker(WorkItem *work_item, 35 | StackFrame *stack_frame); 36 | virtual ~CmpInstructionWorker(); 37 | void Execute(BrigCodeEntry *instruction) override; 38 | }; 39 | 40 | } // namespace HSA 41 | 42 | #endif // ARCH_HSA_EMULATOR_CMPINSTRUCTIONWORKER_H 43 | -------------------------------------------------------------------------------- /src/arch/hsa/emulator/CurrentWorkGroupSizeInstructionWorker.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim 3 | * Copyright (C) 2014 Yifan Sun (yifansun@coe.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef ARCH_HSA_EMULATOR_CURRENTWORKGROUPSIZEINSTRUCTIONWORKER_H 21 | #define ARCH_HSA_EMULATOR_CURRENTWORKGROUPSIZEINSTRUCTIONWORKER_H 22 | 23 | #include "HsaInstructionWorker.h" 24 | 25 | namespace HSA 26 | { 27 | 28 | class CurrentWorkGroupSizeInstructionWorker: public HsaInstructionWorker 29 | { 30 | public: 31 | CurrentWorkGroupSizeInstructionWorker(WorkItem *work_item, 32 | StackFrame *stack_frame); 33 | virtual ~CurrentWorkGroupSizeInstructionWorker(); 34 | void Execute(BrigCodeEntry *instruction) override; 35 | }; 36 | 37 | } // namespace HSA 38 | 39 | #endif // ARCH_HSA_EMULATOR_CURRENTWORKGROUPSIZEINSTRUCTIONWORKER_H 40 | -------------------------------------------------------------------------------- /src/arch/hsa/emulator/CurrentWorkGroupSizeInstructionWorker_test.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim 3 | * Copyright (C) 2014 Yifan Sun (yifansun@coe.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #include "CurrentWorkGroupSizeInstructionWorker.h" 21 | 22 | namespace HSA 23 | { 24 | 25 | } // namespace HSA 26 | -------------------------------------------------------------------------------- /src/arch/hsa/emulator/GridSizeInstructionWorker.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim 3 | * Copyright (C) 2014 Yifan Sun (yifansun@coe.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef ARCH_HSA_EMULATOR_GRIDSIZEINSTRUCTIONWORKER_H 21 | #define ARCH_HSA_EMULATOR_GRIDSIZEINSTRUCTIONWORKER_H 22 | 23 | #include "HsaInstructionWorker.h" 24 | 25 | namespace HSA 26 | { 27 | 28 | class GridSizeInstructionWorker: public HsaInstructionWorker 29 | { 30 | public: 31 | GridSizeInstructionWorker(WorkItem *work_item, 32 | StackFrame *stack_frame); 33 | virtual ~GridSizeInstructionWorker(); 34 | void Execute(BrigCodeEntry *instruction) override; 35 | }; 36 | 37 | } // namespace HSA 38 | 39 | #endif // ARCH_HSA_EMULATOR_GRIDSIZEINSTRUCTIONWORKER_H 40 | -------------------------------------------------------------------------------- /src/arch/hsa/emulator/HsaInstructionWorker.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim 3 | * Copyright (C) 2014 Yifan Sun (yifansun@coe.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #include 21 | 22 | #include "HsaInstructionWorker.h" 23 | #include "WorkItem.h" 24 | #include "StackFrame.h" 25 | 26 | namespace HSA 27 | { 28 | 29 | HsaInstructionWorker::HsaInstructionWorker(WorkItem *work_item, 30 | StackFrame *stack_frame) : 31 | work_item(work_item), 32 | stack_frame(stack_frame), 33 | operand_value_retriever(new OperandValueRetriever( 34 | work_item, stack_frame)), 35 | operand_value_writer(new OperandValueWriter( 36 | work_item, stack_frame)) 37 | { 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/arch/hsa/emulator/LdInstructionWorker.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim 3 | * Copyright (C) 2014 Yifan Sun (yifansun@coe.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef ARCH_HSA_EMULATOR_LDINSTRUCTIONWORKER_H 21 | #define ARCH_HSA_EMULATOR_LDINSTRUCTIONWORKER_H 22 | 23 | #include "HsaInstructionWorker.h" 24 | 25 | namespace HSA 26 | { 27 | 28 | class LdInstructionWorker: public HsaInstructionWorker 29 | { 30 | 31 | template 32 | void Inst_LD_Aux(BrigCodeEntry *instruction); 33 | 34 | public: 35 | LdInstructionWorker(WorkItem *work_item, 36 | StackFrame *stack_frame); 37 | virtual ~LdInstructionWorker(); 38 | void Execute(BrigCodeEntry *instruction) override; 39 | }; 40 | 41 | } // namespace HSA 42 | 43 | #endif // ARCH_HSA_EMULATOR_LDINSTRUCTIONWORKER_H 44 | -------------------------------------------------------------------------------- /src/arch/hsa/emulator/LdaInstructionWorker.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim 3 | * Copyright (C) 2014 Yifan Sun (yifansun@coe.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef ARCH_HSA_EMULATOR_LDAINSTRUCTIONWORKER_H 21 | #define ARCH_HSA_EMULATOR_LDAINSTRUCTIONWORKER_H 22 | 23 | #include "HsaInstructionWorker.h" 24 | 25 | namespace HSA 26 | { 27 | 28 | class LdaInstructionWorker: public HsaInstructionWorker 29 | { 30 | template 31 | void Inst_LDA_Aux(BrigCodeEntry *instruction); 32 | 33 | public: 34 | LdaInstructionWorker(WorkItem *work_item, 35 | StackFrame *stack_frame); 36 | virtual ~LdaInstructionWorker(); 37 | void Execute(BrigCodeEntry *instruction) override; 38 | }; 39 | 40 | } // namespace HSA 41 | 42 | #endif // ARCH_HSA_EMULATOR_LDAINSTRUCTIONWORKER_H 43 | -------------------------------------------------------------------------------- /src/arch/hsa/emulator/MadInstructionWorker.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim 3 | * Copyright (C) 2014 Yifan Sun (yifansun@coe.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef ARCH_HSA_EMULATOR_MADINSTRUCTIONWORKER_H 21 | #define ARCH_HSA_EMULATOR_MADINSTRUCTIONWORKER_H 22 | 23 | #include "HsaInstructionWorker.h" 24 | 25 | namespace HSA 26 | { 27 | 28 | class MadInstructionWorker: public HsaInstructionWorker 29 | { 30 | template 31 | void Inst_MAD_Aux(BrigCodeEntry *instruction); 32 | public: 33 | MadInstructionWorker(WorkItem *work_item, 34 | StackFrame *stack_frame); 35 | virtual ~MadInstructionWorker(); 36 | void Execute(BrigCodeEntry *instruction) override; 37 | }; 38 | 39 | } // namespace HSA 40 | 41 | #endif // ARCH_HSA_EMULATOR_MADINSTRUCTIONWORKER_H 42 | -------------------------------------------------------------------------------- /src/arch/hsa/emulator/MadInstructionWorker_test.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim 3 | * Copyright (C) 2014 Yifan Sun (yifansun@coe.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #include "MadInstructionWorker.h" 21 | 22 | namespace HSA 23 | { 24 | 25 | } // namespace HSA 26 | -------------------------------------------------------------------------------- /src/arch/hsa/emulator/MemFenceInstructionWorker.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim 3 | * Copyright (C) 2014 Yifan Sun (yifansun@coe.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef SRC_ARCH_HSA_EMULATOR_MEMFENCEINSTRUCTIONWORKER_H_ 21 | #define SRC_ARCH_HSA_EMULATOR_MEMFENCEINSTRUCTIONWORKER_H_ 22 | 23 | #include "HsaInstructionWorker.h" 24 | 25 | namespace HSA 26 | { 27 | 28 | class MemFenceInstructionWorker: public HsaInstructionWorker 29 | { 30 | public: 31 | MemFenceInstructionWorker(WorkItem *work_item, 32 | StackFrame *stack_frame); 33 | virtual ~MemFenceInstructionWorker(); 34 | void Execute(BrigCodeEntry *instruction) override; 35 | }; 36 | 37 | } // namespace HSA 38 | 39 | #endif /* SRC_ARCH_HSA_EMULATOR_MEMFENCEINSTRUCTIONWORKER_H_ */ 40 | -------------------------------------------------------------------------------- /src/arch/hsa/emulator/MovInstructionWorker.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim 3 | * Copyright (C) 2014 Yifan Sun (yifansun@coe.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef ARCH_HSA_EMULATOR_MOVINSTRUCTIONWORKER_H 21 | #define ARCH_HSA_EMULATOR_MOVINSTRUCTIONWORKER_H 22 | 23 | #include "HsaInstructionWorker.h" 24 | 25 | namespace HSA 26 | { 27 | 28 | class MovInstructionWorker: public HsaInstructionWorker 29 | { 30 | template 31 | void Inst_MOV_Aux(BrigCodeEntry *instruction); 32 | public: 33 | MovInstructionWorker(WorkItem *work_item, 34 | StackFrame *stack_frame); 35 | virtual ~MovInstructionWorker(); 36 | void Execute(BrigCodeEntry *instruction) override; 37 | }; 38 | 39 | } // namespace HSA 40 | 41 | #endif // ARCH_HSA_EMULATOR_MOVINSTRUCTIONWORKER_H 42 | -------------------------------------------------------------------------------- /src/arch/hsa/emulator/MulInstructionWorker.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim 3 | * Copyright (C) 2014 Yifan Sun (yifansun@coe.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef ARCH_HSA_EMULATOR_MULINSTRUCTIONWORKER_H 21 | #define ARCH_HSA_EMULATOR_MULINSTRUCTIONWORKER_H 22 | 23 | #include "HsaInstructionWorker.h" 24 | 25 | namespace HSA 26 | { 27 | 28 | class MulInstructionWorker: public HsaInstructionWorker 29 | { 30 | template 31 | void Inst_MUL_Aux(BrigCodeEntry *instruction); 32 | public: 33 | MulInstructionWorker(WorkItem *work_item, 34 | StackFrame *stack_frame); 35 | virtual ~MulInstructionWorker(); 36 | void Execute(BrigCodeEntry *instruction) override; 37 | }; 38 | 39 | } // namespace HSA 40 | 41 | #endif // ARCH_HSA_EMULATOR_MULINSTRUCTIONWORKER_H 42 | -------------------------------------------------------------------------------- /src/arch/hsa/emulator/OperandValueRetriever.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim 3 | * Copyright (C) 2014 Yifan Sun (yifansun@coe.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef ARCH_HSA_EMULATOR_OPERANDVALUEGETTER_H 21 | #define ARCH_HSA_EMULATOR_OPERANDVALUEGETTER_H 22 | 23 | namespace HSA 24 | { 25 | class WorkItem; 26 | class StackFrame; 27 | class BrigCodeEntry; 28 | 29 | class OperandValueRetriever 30 | { 31 | WorkItem *work_item; 32 | StackFrame *stack_frame; 33 | public: 34 | OperandValueRetriever(WorkItem *work_item, StackFrame *stack_frame); 35 | virtual ~OperandValueRetriever(); 36 | virtual void Retrieve(BrigCodeEntry *instruction, 37 | unsigned int index, void *buffer); 38 | }; 39 | 40 | } 41 | 42 | #endif // ARCH_HSA_EMULATOR_OPERANDVALUEGETTER_H 43 | -------------------------------------------------------------------------------- /src/arch/hsa/emulator/OperandValueWriter.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim 3 | * Copyright (C) 2014 Yifan Sun (yifansun@coe.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef ARCH_HSA_EMULATOR_OPERANDVALUEWRITER_H 21 | #define ARCH_HSA_EMULATOR_OPERANDVALUEWRITER_H 22 | 23 | namespace HSA 24 | { 25 | class WorkItem; 26 | class StackFrame; 27 | class BrigCodeEntry; 28 | 29 | class OperandValueWriter 30 | { 31 | WorkItem *work_item; 32 | StackFrame *stack_frame; 33 | public: 34 | OperandValueWriter(WorkItem *work_item, StackFrame *stack_frame); 35 | virtual ~OperandValueWriter(); 36 | virtual void Write(BrigCodeEntry *instruction, unsigned int index, 37 | void *buffer); 38 | }; 39 | 40 | } 41 | 42 | #endif // ARCH_HSA_EMULATOR_OPERANDVALUEWRITER_H 43 | -------------------------------------------------------------------------------- /src/arch/hsa/emulator/OrInstructionWorker.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim 3 | * Copyright (C) 2014 Yifan Sun (yifansun@coe.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef ARCH_HSA_EMULATOR_ORINSTRUCTIONWORKER_H 21 | #define ARCH_HSA_EMULATOR_ORINSTRUCTIONWORKER_H 22 | 23 | #include "HsaInstructionWorker.h" 24 | 25 | namespace HSA 26 | { 27 | 28 | class OrInstructionWorker: public HsaInstructionWorker 29 | { 30 | template 31 | void Inst_OR_Aux(BrigCodeEntry *instruction); 32 | public: 33 | OrInstructionWorker(WorkItem *work_item, 34 | StackFrame *stack_frame); 35 | virtual ~OrInstructionWorker(); 36 | void Execute(BrigCodeEntry *instruction) override; 37 | }; 38 | 39 | } // namespace HSA 40 | 41 | #endif // ARCH_HSA_EMULATOR_ORINSTRUCTIONWORKER_H 42 | -------------------------------------------------------------------------------- /src/arch/hsa/emulator/RetInstructionWorker.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim 3 | * Copyright (C) 2014 Yifan Sun (yifansun@coe.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #include "RetInstructionWorker.h" 21 | #include "WorkItem.h" 22 | 23 | namespace HSA 24 | { 25 | 26 | RetInstructionWorker::RetInstructionWorker(WorkItem *work_item, 27 | StackFrame *stack_frame) : 28 | HsaInstructionWorker(work_item, stack_frame) 29 | { 30 | } 31 | 32 | RetInstructionWorker::~RetInstructionWorker() 33 | { 34 | } 35 | 36 | void RetInstructionWorker::Execute(BrigCodeEntry *instruction) 37 | { 38 | work_item->ReturnFunction(); 39 | } 40 | 41 | } // namespace HSA 42 | -------------------------------------------------------------------------------- /src/arch/hsa/emulator/RetInstructionWorker.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim 3 | * Copyright (C) 2014 Yifan Sun (yifansun@coe.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef ARCH_HSA_EMULATOR_RETINSTRUCTIONWORKER_H 21 | #define ARCH_HSA_EMULATOR_RETINSTRUCTIONWORKER_H 22 | 23 | #include "HsaInstructionWorker.h" 24 | 25 | namespace HSA 26 | { 27 | 28 | class RetInstructionWorker: public HsaInstructionWorker 29 | { 30 | public: 31 | RetInstructionWorker(WorkItem *work_item, 32 | StackFrame *stack_frame); 33 | virtual ~RetInstructionWorker(); 34 | void Execute(BrigCodeEntry *instruction) override; 35 | }; 36 | 37 | } // namespace HSA 38 | 39 | #endif // ARCH_HSA_EMULATOR_RETINSTRUCTIONWORKER_H 40 | -------------------------------------------------------------------------------- /src/arch/hsa/emulator/ShlInstructionWorker.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim 3 | * Copyright (C) 2014 Yifan Sun (yifansun@coe.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef ARCH_HSA_EMULATOR_SHLINSTRUCTIONWORKER_H 21 | #define ARCH_HSA_EMULATOR_SHLINSTRUCTIONWORKER_H 22 | 23 | #include "HsaInstructionWorker.h" 24 | 25 | namespace HSA 26 | { 27 | 28 | class ShlInstructionWorker: public HsaInstructionWorker 29 | { 30 | template 31 | void Inst_SHL_Aux(BrigCodeEntry *instruction); 32 | 33 | public: 34 | ShlInstructionWorker(WorkItem *work_item, 35 | StackFrame *stack_frame); 36 | virtual ~ShlInstructionWorker(); 37 | void Execute(BrigCodeEntry *instruction) override; 38 | }; 39 | 40 | } // namespace HSA 41 | 42 | #endif // ARCH_HSA_EMULATOR_SHLINSTRUCTIONWORKER_H 43 | -------------------------------------------------------------------------------- /src/arch/hsa/emulator/ShrInstructionWorker.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim 3 | * Copyright (C) 2014 Yifan Sun (yifansun@coe.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef ARCH_HSA_EMULATOR_SHRINSTRUCTIONWORKER_H 21 | #define ARCH_HSA_EMULATOR_SHRINSTRUCTIONWORKER_H 22 | 23 | #include "HsaInstructionWorker.h" 24 | 25 | 26 | namespace HSA 27 | { 28 | 29 | class ShrInstructionWorker : public HsaInstructionWorker 30 | { 31 | template 32 | void Inst_SHR_Aux(BrigCodeEntry *instruction); 33 | 34 | public: 35 | ShrInstructionWorker(WorkItem *work_item, 36 | StackFrame *stack_frame); 37 | virtual ~ShrInstructionWorker(); 38 | void Execute(BrigCodeEntry *instruction) override; 39 | }; 40 | 41 | } // namespace HSA 42 | 43 | #endif // ARCH_HSA_EMULATOR_SHRINSTRUCTIONWORKER_H 44 | -------------------------------------------------------------------------------- /src/arch/hsa/emulator/Signal.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim 3 | * Copyright (C) 2014 Yifan Sun (yifansun@coe.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #include "Signal.h" 21 | 22 | namespace HSA 23 | { 24 | 25 | Signal::Signal(unsigned long long init_value) : 26 | value(init_value) 27 | { 28 | } 29 | 30 | } // namespace net 31 | -------------------------------------------------------------------------------- /src/arch/hsa/emulator/Signal.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim 3 | * Copyright (C) 2014 Yifan Sun (yifansun@coe.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef ARCH_HSA_EMULATOR_SIGNAL_H 21 | #define ARCH_HSA_EMULATOR_SIGNAL_H 22 | 23 | namespace HSA 24 | { 25 | 26 | class Signal 27 | { 28 | 29 | // Signal value 30 | unsigned long long value; 31 | 32 | public: 33 | 34 | // Constructor 35 | Signal(unsigned long long init_value); 36 | 37 | // Get value 38 | unsigned long long getValue() const { return value; } 39 | 40 | // Set value 41 | void setValue(unsigned long long value) { this->value = value; } 42 | 43 | }; 44 | 45 | } // namespace net 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /src/arch/hsa/emulator/StInstructionWorker.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim 3 | * Copyright (C) 2014 Yifan Sun (yifansun@coe.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef ARCH_HSA_EMULATOR_STINSTRUCTIONWORKER_H 21 | #define ARCH_HSA_EMULATOR_STINSTRUCTIONWORKER_H 22 | 23 | #include "HsaInstructionWorker.h" 24 | 25 | namespace HSA 26 | { 27 | 28 | class StInstructionWorker: public HsaInstructionWorker 29 | { 30 | template 31 | void Inst_ST_Aux(BrigCodeEntry *instruction); 32 | public: 33 | StInstructionWorker(WorkItem *work_item, 34 | StackFrame *stack_frame); 35 | virtual ~StInstructionWorker(); 36 | void Execute(BrigCodeEntry *instruction); 37 | }; 38 | 39 | } // namespace HSA 40 | 41 | #endif // ARCH_HSA_EMULATOR_STINSTRUCTIONWORKER_H 42 | -------------------------------------------------------------------------------- /src/arch/hsa/emulator/SubInstructionWorker.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim 3 | * Copyright (C) 2014 Yifan Sun (yifansun@coe.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef ARCH_HSA_EMULATOR_SUBINSTRUCTIONWORKER_H 21 | #define ARCH_HSA_EMULATOR_SUBINSTRUCTIONWORKER_H 22 | 23 | #include "HsaInstructionWorker.h" 24 | 25 | namespace HSA 26 | { 27 | 28 | class SubInstructionWorker: public HsaInstructionWorker 29 | { 30 | template 31 | void Inst_SUB_Aux(BrigCodeEntry *instruction); 32 | public: 33 | SubInstructionWorker(WorkItem *work_item, 34 | StackFrame *stack_frame); 35 | virtual ~SubInstructionWorker(); 36 | void Execute(BrigCodeEntry *instruction) override; 37 | }; 38 | 39 | } // namespace HSA 40 | 41 | #endif // SRC_ARCH_HSA_EMULATOR_SUBINSTRUCTIONWORKER_H 42 | -------------------------------------------------------------------------------- /src/arch/hsa/emulator/Variable.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim 3 | * Copyright (C) 2014 Yifan Sun (yifansun@coe.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #include 21 | 22 | #include "Emulator.h" 23 | #include "Variable.h" 24 | #include "SegmentManager.h" 25 | 26 | 27 | namespace HSA 28 | { 29 | 30 | Variable::Variable(const std::string& name, BrigType type, 31 | unsigned long long dim, unsigned address, 32 | BrigSegment segment, 33 | bool isFormal = false) : 34 | name(name), 35 | type(type), 36 | segment(segment), 37 | size(AsmService::TypeToSize(type)), 38 | dim(dim), 39 | address(address), 40 | isFormal(isFormal) 41 | { 42 | } 43 | 44 | } // namespace HSA 45 | 46 | -------------------------------------------------------------------------------- /src/arch/hsa/emulator/WorkGroupIdInstructionWorker.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim 3 | * Copyright (C) 2014 Yifan Sun (yifansun@coe.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef ARCH_HSA_EMULATOR_WORKGROUPIDINSTRUCTIONWORKER_H 21 | #define ARCH_HSA_EMULATOR_WORKGROUPIDINSTRUCTIONWORKER_H 22 | 23 | #include "HsaInstructionWorker.h" 24 | 25 | namespace HSA 26 | { 27 | 28 | class WorkGroupIdInstructionWorker: public HsaInstructionWorker 29 | { 30 | public: 31 | WorkGroupIdInstructionWorker(WorkItem *work_item, 32 | StackFrame *stack_frame); 33 | virtual ~WorkGroupIdInstructionWorker(); 34 | void Execute(BrigCodeEntry *instruction) override; 35 | }; 36 | 37 | } // namespace HSA 38 | 39 | #endif // ARCH_HSA_EMULATOR_WORKGROUPIDINSTRUCTIONWORKER_H 40 | -------------------------------------------------------------------------------- /src/arch/hsa/emulator/WorkGroupIdInstructionWorker_test.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim 3 | * Copyright (C) 2014 Yifan Sun (yifansun@coe.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #include "WorkGroupIdInstructionWorker.h" 21 | 22 | namespace HSA 23 | { 24 | 25 | } // namespace HSA 26 | -------------------------------------------------------------------------------- /src/arch/hsa/emulator/WorkItemIdInstructionWorker.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim 3 | * Copyright (C) 2014 Yifan Sun (yifansun@coe.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef ARCH_HSA_EMULATOR_WORKITEMIDINSTRUCTIONWORKER_H 21 | #define ARCH_HSA_EMULATOR_WORKITEMIDINSTRUCTIONWORKER_H 22 | 23 | #include "HsaInstructionWorker.h" 24 | 25 | namespace HSA 26 | { 27 | 28 | class WorkItemIdInstructionWorker: public HsaInstructionWorker 29 | { 30 | public: 31 | WorkItemIdInstructionWorker(WorkItem *work_item, 32 | StackFrame *stack_frame); 33 | virtual ~WorkItemIdInstructionWorker(); 34 | void Execute(BrigCodeEntry *instruction) override; 35 | }; 36 | 37 | } // namespace HSA 38 | 39 | #endif // ARCH_HSA_EMULATOR_WORKITEMIDINSTRUCTIONWORKER_H 40 | -------------------------------------------------------------------------------- /src/arch/hsa/emulator/WorkItemIdInstructionWorker_test.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim 3 | * Copyright (C) 2014 Yifan Sun (yifansun@coe.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #include "WorkItemIdInstructionWorker.h" 21 | 22 | namespace HSA 23 | { 24 | 25 | } // namespace HSA 26 | -------------------------------------------------------------------------------- /src/arch/kepler/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.a 3 | .deps 4 | Makefile 5 | Makefile.in 6 | -------------------------------------------------------------------------------- /src/arch/kepler/Makefile.am: -------------------------------------------------------------------------------- 1 | SUBDIRS = \ 2 | disassembler \ 3 | driver \ 4 | emulator 5 | -------------------------------------------------------------------------------- /src/arch/kepler/disassembler/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.a 3 | .deps 4 | Makefile 5 | Makefile.in 6 | -------------------------------------------------------------------------------- /src/arch/kepler/disassembler/Makefile.am: -------------------------------------------------------------------------------- 1 | lib_LIBRARIES = libdisassembler.a 2 | 3 | libdisassembler_a_SOURCES = \ 4 | \ 5 | Disassembler.cc \ 6 | Disassembler.h \ 7 | \ 8 | Instruction.cc \ 9 | Instruction.def \ 10 | Instruction.h 11 | 12 | AM_CPPFLAGS = @M2S_INCLUDES@ 13 | 14 | -------------------------------------------------------------------------------- /src/arch/kepler/driver/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.a 3 | .deps 4 | Makefile 5 | Makefile.in 6 | -------------------------------------------------------------------------------- /src/arch/kepler/driver/Argument.cc: -------------------------------------------------------------------------------- 1 | /* Multi2Sim 2 | * Copyright (C) 2014 Xun Gong (gong.xun@husky.neu.edu) 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | */ 18 | 19 | #include "Argument.h" 20 | 21 | 22 | namespace Kepler 23 | { 24 | 25 | } // namespace Kepler 26 | 27 | -------------------------------------------------------------------------------- /src/arch/kepler/driver/Driver.def: -------------------------------------------------------------------------------- 1 | DEFCALL(Init, 1) 2 | DEFCALL(MemAlloc, 2) 3 | DEFCALL(MemWrite, 3) 4 | DEFCALL(MemRead, 4) 5 | DEFCALL(LaunchKernel, 5) 6 | DEFCALL(MemGetInfo, 6) 7 | DEFCALL(ModuleLoad, 7) 8 | DEFCALL(ModuleGetFunction, 8) 9 | DEFCALL(MemFree, 9) -------------------------------------------------------------------------------- /src/arch/kepler/driver/Makefile.am: -------------------------------------------------------------------------------- 1 | lib_LIBRARIES = libdriver.a 2 | 3 | libdriver_a_SOURCES = \ 4 | \ 5 | Argument.cc \ 6 | Argument.h \ 7 | \ 8 | Driver.cc \ 9 | Driver.h \ 10 | \ 11 | DriverCall.cc \ 12 | Driver.def \ 13 | \ 14 | Function.cc \ 15 | Function.h \ 16 | \ 17 | Module.cc \ 18 | Module.h 19 | 20 | 21 | AM_CPPFLAGS = @M2S_INCLUDES@ 22 | 23 | -------------------------------------------------------------------------------- /src/arch/kepler/driver/Module.cc: -------------------------------------------------------------------------------- 1 | /* Multi2Sim 2 | * Copyright (C) 2014 Xun Gong (gong.xun@husky.neu.edu) 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | */ 18 | 19 | #include "Module.h" 20 | 21 | 22 | namespace Kepler 23 | { 24 | 25 | Module::Module(int id, const std::string &cubin_path) : elf_file(cubin_path) 26 | { 27 | this->id = id; 28 | 29 | } 30 | 31 | Function *Module::addFunction(Module *module, const std::string &name) 32 | { 33 | // The function ID is its position in the list 34 | int id = functions.size(); 35 | 36 | // Create function and add it to the list of functions 37 | functions.emplace_back(new Function(id, module, name)); 38 | return functions.back().get(); 39 | } 40 | 41 | } // namespace Kepler 42 | -------------------------------------------------------------------------------- /src/arch/kepler/emulator/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.a 3 | .deps 4 | Makefile 5 | Makefile.in 6 | -------------------------------------------------------------------------------- /src/arch/kepler/emulator/Makefile.am: -------------------------------------------------------------------------------- 1 | lib_LIBRARIES = libemulator.a 2 | 3 | libemulator_a_SOURCES = \ 4 | \ 5 | Grid.h \ 6 | Grid.cc \ 7 | \ 8 | Emulator.cc \ 9 | Emulator.h \ 10 | \ 11 | Thread.cc \ 12 | Thread.h \ 13 | ThreadIsa.cc\ 14 | \ 15 | ThreadBlock.cc \ 16 | ThreadBlock.h \ 17 | \ 18 | SyncStack.h\ 19 | SyncStack.cc\ 20 | \ 21 | ReturnAddressStack.h\ 22 | ReturnAddressStack.cc\ 23 | \ 24 | Warp.cc \ 25 | Warp.h \ 26 | \ 27 | Register.h 28 | 29 | AM_CPPFLAGS = @M2S_INCLUDES@ 30 | 31 | -------------------------------------------------------------------------------- /src/arch/mips/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.a 3 | .deps 4 | Makefile 5 | Makefile.in 6 | -------------------------------------------------------------------------------- /src/arch/mips/Makefile.am: -------------------------------------------------------------------------------- 1 | SUBDIRS = \ 2 | disassembler \ 3 | emulator \ 4 | timing 5 | -------------------------------------------------------------------------------- /src/arch/mips/disassembler/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.a 3 | .deps 4 | Makefile 5 | Makefile.in 6 | -------------------------------------------------------------------------------- /src/arch/mips/disassembler/Makefile.am: -------------------------------------------------------------------------------- 1 | lib_LIBRARIES = libdisassembler.a 2 | 3 | libdisassembler_a_SOURCES = \ 4 | \ 5 | Disassembler.cc \ 6 | Disassembler.h \ 7 | \ 8 | Instruction.cc \ 9 | Instruction.def \ 10 | Instruction.h 11 | 12 | AM_CPPFLAGS = @M2S_INCLUDES@ 13 | -------------------------------------------------------------------------------- /src/arch/mips/emulator/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.a 3 | .deps 4 | Makefile 5 | Makefile.in 6 | -------------------------------------------------------------------------------- /src/arch/mips/emulator/File.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Multi2Sim/multi2sim/77b16e0ba3c23c5609657834b8cdfc7d0e22c303/src/arch/mips/emulator/File.cc -------------------------------------------------------------------------------- /src/arch/mips/emulator/File.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim 3 | * Copyright (C) 2014 Sida Gu (gu.sid@husky.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | namespace mips 21 | { 22 | class mips_file 23 | { 24 | public: 25 | 26 | }; 27 | } 28 | -------------------------------------------------------------------------------- /src/arch/mips/emulator/Makefile.am: -------------------------------------------------------------------------------- 1 | lib_LIBRARIES = libemulator.a 2 | 3 | libemulator_a_SOURCES = \ 4 | \ 5 | Context.cc \ 6 | Context.h \ 7 | ContextIsa.cc \ 8 | ContextLoader.cc \ 9 | ContextSignal.cc \ 10 | ContextSyscall.cc \ 11 | ContextSyscall.def \ 12 | \ 13 | Emulator.cc \ 14 | Emulator.h \ 15 | \ 16 | Regs.cc \ 17 | Regs.h \ 18 | \ 19 | Signal.cc \ 20 | Signal.h 21 | 22 | 23 | AM_CPPFLAGS = @M2S_INCLUDES@ 24 | -------------------------------------------------------------------------------- /src/arch/mips/emulator/Mem.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim 3 | * Copyright (C) 2014 Sida Gu (gu.sid@husky.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | -------------------------------------------------------------------------------- /src/arch/mips/emulator/Mem.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim 3 | * Copyright (C) 2014 Sida Gu (gu.sid@husky.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | namespace MIPS 21 | { 22 | class memory 23 | { 24 | public: 25 | ///Constructor and Destructor 26 | memory(); 27 | ~memory(); 28 | 29 | }; 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/arch/mips/emulator/Signal.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim 3 | * Copyright (C) 2014 Sida Gu(dudlykoo@gmail.com) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | -------------------------------------------------------------------------------- /src/arch/mips/timing/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.a 3 | .deps 4 | Makefile 5 | Makefile.in 6 | -------------------------------------------------------------------------------- /src/arch/mips/timing/Makefile.am: -------------------------------------------------------------------------------- 1 | lib_LIBRARIES = libtiming.a 2 | 3 | libtiming_a_SOURCES = 4 | 5 | AM_CPPFLAGS = @M2S_INCLUDES@ 6 | 7 | -------------------------------------------------------------------------------- /src/arch/southern-islands/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.a 3 | .deps 4 | Makefile 5 | Makefile.in 6 | -------------------------------------------------------------------------------- /src/arch/southern-islands/Makefile.am: -------------------------------------------------------------------------------- 1 | SUBDIRS = \ 2 | disassembler \ 3 | driver \ 4 | emulator \ 5 | timing 6 | -------------------------------------------------------------------------------- /src/arch/southern-islands/disassembler/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.a 3 | .deps 4 | Makefile 5 | Makefile.in 6 | -------------------------------------------------------------------------------- /src/arch/southern-islands/disassembler/Makefile.am: -------------------------------------------------------------------------------- 1 | lib_LIBRARIES = libdisassembler.a 2 | 3 | libdisassembler_a_SOURCES = \ 4 | \ 5 | Argument.cc \ 6 | Argument.h \ 7 | \ 8 | Binary.cc \ 9 | Binary.h \ 10 | \ 11 | Disassembler.cc \ 12 | Disassembler.h \ 13 | \ 14 | Instruction.cc \ 15 | Instruction.def \ 16 | Instruction.h 17 | 18 | AM_CPPFLAGS = @M2S_INCLUDES@ 19 | 20 | -------------------------------------------------------------------------------- /src/arch/southern-islands/driver/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.a 3 | .deps 4 | Makefile 5 | Makefile.in 6 | -------------------------------------------------------------------------------- /src/arch/southern-islands/driver/Driver.def: -------------------------------------------------------------------------------- 1 | DEFCALL(Init, 1) 2 | DEFCALL(MemAlloc, 2) 3 | DEFCALL(MemRead, 3) 4 | DEFCALL(MemWrite, 4) 5 | DEFCALL(MemCopy, 5) 6 | DEFCALL(MemFree, 6) 7 | DEFCALL(ProgramCreate, 7) 8 | DEFCALL(ProgramSetBinary, 8) 9 | DEFCALL(KernelCreate, 9) 10 | DEFCALL(KernelSetArgValue, 10) 11 | DEFCALL(KernelSetArgPointer, 11) 12 | DEFCALL(KernelSetArgImage, 12) 13 | DEFCALL(KernelSetArgSampler, 13) 14 | DEFCALL(NDRangeCreate, 14) 15 | DEFCALL(NDRangeGetNumBufferEntries, 15) 16 | DEFCALL(NDRangeSendWorkGroups, 16) 17 | DEFCALL(NDRangeFinish, 17) 18 | DEFCALL(NDRangePassMemObjs, 18) 19 | DEFCALL(NDRangeSetFused, 19) 20 | DEFCALL(NDRangeFlush, 20) 21 | DEFCALL(NDRangeFree, 21) 22 | DEFCALL(NDRangeStart, 22) 23 | DEFCALL(NDRangeEnd, 23) 24 | DEFCALL(RuntimeDebug, 24) 25 | 26 | -------------------------------------------------------------------------------- /src/arch/southern-islands/driver/Makefile.am: -------------------------------------------------------------------------------- 1 | lib_LIBRARIES = libdriver.a 2 | 3 | libdriver_a_SOURCES = \ 4 | \ 5 | Driver.h \ 6 | Driver.cc \ 7 | Driver.def \ 8 | DriverCall.cc \ 9 | \ 10 | Kernel.h \ 11 | Kernel.cc \ 12 | \ 13 | Program.h \ 14 | Program.cc 15 | 16 | AM_CPPFLAGS = @M2S_INCLUDES@ 17 | 18 | -------------------------------------------------------------------------------- /src/arch/southern-islands/emulator/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.a 3 | .deps 4 | Makefile 5 | Makefile.in 6 | -------------------------------------------------------------------------------- /src/arch/southern-islands/emulator/Makefile.am: -------------------------------------------------------------------------------- 1 | lib_LIBRARIES = libemulator.a 2 | 3 | libemulator_a_SOURCES = \ 4 | \ 5 | Emulator.cc \ 6 | Emulator.h \ 7 | \ 8 | NDRange.cc \ 9 | NDRange.h \ 10 | \ 11 | Wavefront.cc \ 12 | Wavefront.h \ 13 | \ 14 | WorkGroup.cc \ 15 | WorkGroup.h \ 16 | \ 17 | WorkItem.cc \ 18 | WorkItem.h \ 19 | WorkItemIsa.cc 20 | 21 | AM_CPPFLAGS = @M2S_INCLUDES@ 22 | 23 | -------------------------------------------------------------------------------- /src/arch/southern-islands/timing/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.a 3 | .deps 4 | Makefile 5 | Makefile.in 6 | -------------------------------------------------------------------------------- /src/arch/southern-islands/timing/ExecutionUnit.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim 3 | * Copyright (C) 2015 Rafael Ubal (ubal@ece.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #include 21 | #include 22 | 23 | #include "BranchUnit.h" 24 | #include "Timing.h" 25 | 26 | namespace SI 27 | { 28 | 29 | void ExecutionUnit::Issue(std::unique_ptr uop) 30 | { 31 | // Spend issue latency 32 | Timing *timing = Timing::getInstance(); 33 | assert(uop->issue_ready == 0); 34 | uop->issue_ready = timing->getCycle() + ComputeUnit::issue_latency; 35 | 36 | // Insert into issue buffer 37 | assert(canIssue()); 38 | issue_buffer.push_back(std::move(uop)); 39 | } 40 | 41 | } 42 | 43 | -------------------------------------------------------------------------------- /src/arch/southern-islands/timing/FetchBuffer.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim 3 | * Copyright (C) 2015 Rafael Ubal (ubal@ece.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #include 21 | 22 | #include "FetchBuffer.h" 23 | 24 | 25 | namespace SI 26 | { 27 | 28 | void FetchBuffer::Remove(std::list>::iterator it) 29 | { 30 | assert(it != buffer.end()); 31 | buffer.erase(it); 32 | } 33 | 34 | } 35 | 36 | -------------------------------------------------------------------------------- /src/arch/southern-islands/timing/Makefile.am: -------------------------------------------------------------------------------- 1 | lib_LIBRARIES = libtiming.a 2 | 3 | libtiming_a_SOURCES = \ 4 | \ 5 | BranchUnit.cc \ 6 | BranchUnit.h \ 7 | \ 8 | ComputeUnit.cc \ 9 | ComputeUnit.h \ 10 | \ 11 | ExecutionUnit.cc \ 12 | ExecutionUnit.h \ 13 | \ 14 | FetchBuffer.cc \ 15 | FetchBuffer.h \ 16 | \ 17 | Gpu.cc \ 18 | Gpu.h \ 19 | \ 20 | LdsUnit.cc \ 21 | LdsUnit.h \ 22 | \ 23 | ScalarUnit.cc \ 24 | ScalarUnit.h \ 25 | \ 26 | SimdUnit.cc \ 27 | SimdUnit.h \ 28 | \ 29 | Timing.cc \ 30 | Timing.h \ 31 | \ 32 | Uop.cc \ 33 | Uop.h \ 34 | \ 35 | VectorMemoryUnit.cc \ 36 | VectorMemoryUnit.h \ 37 | \ 38 | WavefrontPool.cc \ 39 | WavefrontPool.h 40 | 41 | 42 | AM_CPPFLAGS = @M2S_INCLUDES@ 43 | 44 | -------------------------------------------------------------------------------- /src/arch/x86/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.a 3 | .deps 4 | Makefile 5 | Makefile.in 6 | -------------------------------------------------------------------------------- /src/arch/x86/Makefile.am: -------------------------------------------------------------------------------- 1 | SUBDIRS = \ 2 | disassembler \ 3 | emulator \ 4 | timing 5 | -------------------------------------------------------------------------------- /src/arch/x86/disassembler/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.a 3 | .deps 4 | Makefile 5 | Makefile.in 6 | -------------------------------------------------------------------------------- /src/arch/x86/disassembler/Makefile.am: -------------------------------------------------------------------------------- 1 | lib_LIBRARIES = libdisassembler.a 2 | 3 | libdisassembler_a_SOURCES = \ 4 | \ 5 | Disassembler.cc \ 6 | Disassembler.h \ 7 | \ 8 | Instruction.cc \ 9 | Instruction.def \ 10 | Instruction.h 11 | 12 | AM_CPPFLAGS = @M2S_INCLUDES@ 13 | 14 | -------------------------------------------------------------------------------- /src/arch/x86/emulator/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.a 3 | .deps 4 | Makefile 5 | Makefile.in 6 | -------------------------------------------------------------------------------- /src/arch/x86/emulator/Makefile.am: -------------------------------------------------------------------------------- 1 | lib_LIBRARIES = libemulator.a 2 | 3 | libemulator_a_SOURCES = \ 4 | \ 5 | Context.cc \ 6 | ContextIsa.cc \ 7 | ContextIsaCtrl.cc \ 8 | ContextIsaFp.cc \ 9 | ContextIsaMisc.cc \ 10 | ContextIsaRot.cc \ 11 | ContextIsaSse.cc \ 12 | ContextIsaSse2.cc \ 13 | ContextIsaSse3.cc \ 14 | ContextIsaSse4.cc \ 15 | ContextIsaStd.cc \ 16 | ContextIsaStr.cc \ 17 | ContextIsaXmm.cc \ 18 | ContextLoader.cc \ 19 | ContextSignal.cc \ 20 | ContextSyscall.cc \ 21 | ContextSyscall.def \ 22 | ContextUinst.cc \ 23 | Context.h \ 24 | \ 25 | Emulator.cc \ 26 | Emulator.h \ 27 | \ 28 | Extended.cc \ 29 | Extended.h \ 30 | \ 31 | Regs.cc \ 32 | Regs.h \ 33 | \ 34 | Signal.cc \ 35 | Signal.h \ 36 | \ 37 | Uinst.cc \ 38 | Uinst.h \ 39 | \ 40 | XmmValue.cc \ 41 | XmmValue.h 42 | 43 | 44 | AM_CPPFLAGS = @M2S_INCLUDES@ 45 | 46 | -------------------------------------------------------------------------------- /src/arch/x86/timing/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.a 3 | .deps 4 | Makefile 5 | Makefile.in 6 | -------------------------------------------------------------------------------- /src/arch/x86/timing/Makefile.am: -------------------------------------------------------------------------------- 1 | lib_LIBRARIES = libtiming.a 2 | 3 | libtiming_a_SOURCES = \ 4 | \ 5 | Alu.h \ 6 | Alu.cc \ 7 | \ 8 | BranchPredictor.h \ 9 | BranchPredictor.cc \ 10 | \ 11 | Core.h \ 12 | Core.cc \ 13 | \ 14 | Cpu.h \ 15 | Cpu.cc \ 16 | CpuScheduler.cc \ 17 | \ 18 | FunctionalUnit.h \ 19 | FunctionalUnit.cc \ 20 | \ 21 | RegisterFile.h \ 22 | RegisterFile.cc \ 23 | \ 24 | Thread.h \ 25 | Thread.cc \ 26 | ThreadFetch.cc \ 27 | ThreadDecode.cc \ 28 | ThreadDispatch.cc \ 29 | ThreadIssue.cc \ 30 | ThreadRecover.cc \ 31 | ThreadCommit.cc \ 32 | ThreadScheduler.cc \ 33 | \ 34 | Timing.h \ 35 | Timing.cc \ 36 | \ 37 | TraceCache.h \ 38 | TraceCache.cc \ 39 | \ 40 | Uop.h \ 41 | Uop.cc 42 | 43 | AM_CPPFLAGS = @M2S_INCLUDES@ 44 | 45 | -------------------------------------------------------------------------------- /src/dram/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.a 3 | .deps 4 | Makefile 5 | Makefile.in 6 | -------------------------------------------------------------------------------- /src/dram/Makefile.am: -------------------------------------------------------------------------------- 1 | lib_LIBRARIES = libdram.a 2 | 3 | libdram_a_SOURCES = \ 4 | \ 5 | Address.cc \ 6 | Address.h \ 7 | \ 8 | Bank.cc \ 9 | Bank.h \ 10 | \ 11 | Channel.cc \ 12 | Channel.h \ 13 | \ 14 | Command.cc \ 15 | Command.h \ 16 | \ 17 | Controller.cc \ 18 | Controller.h \ 19 | \ 20 | Rank.cc \ 21 | Rank.h \ 22 | \ 23 | Request.cc \ 24 | Request.h \ 25 | \ 26 | Scheduler.cc \ 27 | Scheduler.h \ 28 | \ 29 | System.cc \ 30 | System.h \ 31 | \ 32 | TimingParameters.cc \ 33 | TimingParameters.h 34 | 35 | AM_CPPFLAGS = @M2S_INCLUDES@ 36 | 37 | -------------------------------------------------------------------------------- /src/lib/Makefile.am: -------------------------------------------------------------------------------- 1 | SUBDIRS = \ 2 | cpp \ 3 | esim \ 4 | gtest \ 5 | mhandle \ 6 | util 7 | 8 | -------------------------------------------------------------------------------- /src/lib/cpp/List.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim 3 | * Copyright (C) 2014 Rafael Ubal (ubal@ece.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #include "List.h" 21 | 22 | -------------------------------------------------------------------------------- /src/lib/cpp/Makefile.am: -------------------------------------------------------------------------------- 1 | lib_LIBRARIES = libcpp.a 2 | 3 | libcpp_a_SOURCES = \ 4 | \ 5 | Bitmap.cc \ 6 | Bitmap.h \ 7 | \ 8 | CommandLine.cc \ 9 | CommandLine.h \ 10 | \ 11 | Debug.cc \ 12 | Debug.h \ 13 | \ 14 | ELFReader.cc \ 15 | ELFReader.h \ 16 | \ 17 | ELFWriter.cc \ 18 | ELFWriter.h \ 19 | \ 20 | Environment.cc \ 21 | Environment.h \ 22 | \ 23 | Error.cc \ 24 | Error.h \ 25 | \ 26 | Graph.cc \ 27 | Graph.h \ 28 | \ 29 | IniFile.cc \ 30 | IniFile.h \ 31 | \ 32 | List.cc \ 33 | List.h \ 34 | \ 35 | Misc.cc \ 36 | Misc.h \ 37 | \ 38 | String.cc \ 39 | String.h \ 40 | \ 41 | Terminal.cc \ 42 | Terminal.h \ 43 | \ 44 | Timer.cc \ 45 | Timer.h 46 | 47 | AM_CPPFLAGS = @M2S_INCLUDES@ 48 | 49 | -------------------------------------------------------------------------------- /src/lib/esim/Event.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim 3 | * Copyright (C) 2012 Rafael Ubal (ubal@ece.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #include "Event.h" 21 | 22 | 23 | namespace esim 24 | { 25 | 26 | 27 | } // namespace esim 28 | 29 | -------------------------------------------------------------------------------- /src/lib/esim/Frame.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim 3 | * Copyright (C) 2012 Rafael Ubal (ubal@ece.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #include "Frame.h" 21 | 22 | 23 | namespace esim 24 | { 25 | 26 | 27 | } // namespace esim 28 | 29 | -------------------------------------------------------------------------------- /src/lib/esim/Makefile.am: -------------------------------------------------------------------------------- 1 | lib_LIBRARIES = libesim.a 2 | 3 | libesim_a_SOURCES = \ 4 | \ 5 | Engine.cc \ 6 | Engine.h \ 7 | \ 8 | Event.cc \ 9 | Event.h \ 10 | \ 11 | Frame.cc \ 12 | Frame.h \ 13 | \ 14 | FrequencyDomain.cc \ 15 | FrequencyDomain.h \ 16 | \ 17 | Queue.cc \ 18 | Queue.h \ 19 | \ 20 | Trace.cc \ 21 | Trace.h 22 | 23 | AM_CPPFLAGS = @M2S_INCLUDES@ 24 | 25 | -------------------------------------------------------------------------------- /src/lib/mhandle/Makefile.am: -------------------------------------------------------------------------------- 1 | lib_LIBRARIES = libmhandle.a 2 | libmhandle_a_SOURCES = mhandle.c mhandle.h 3 | AM_CFLAGS = -Wall 4 | 5 | -------------------------------------------------------------------------------- /src/lib/util/ChangeLog: -------------------------------------------------------------------------------- 1 | 2005-03-29 Rafael Ubal Tena 2 | 3 | * arraylist.h: Function arraylist_clear added. 4 | 5 | 2005-03-30 Rafael Ubal Tena 6 | 7 | * arraylist.c: Fixed buf in arraylist_push; 'return 1' was missing. 8 | 9 | 2005-03-30 Rafael Ubal Tena 10 | 11 | * arraylist.c: methods 'arraylist_delete' and 'arraylist_insert' more efficient. 12 | Worst cases are removals and insertions in the center of the list. 13 | * arraylist.h: new method 'arraylist_set'. 14 | 15 | 2005-06-02 Rafael Ubal Tena 16 | 17 | * heap.c: new files; structure 'bintree' substituted by 'heap'. 18 | In the heap, elements with the same value can be inserted, which are 19 | then extracted in insertion order. 20 | 21 | 2006-12-23 Rafael Ubal Tena 22 | 23 | * repos.c: removed function 'get_repos_id' and added integrity check when repos object is freed. 24 | Also added function 'repos_allocated_object'. 25 | 26 | 2008-10-24 27 | * lnlist.h: function 'lnlist_add' added. 28 | -------------------------------------------------------------------------------- /src/lib/util/Makefile.am: -------------------------------------------------------------------------------- 1 | lib_LIBRARIES = libutil.a 2 | 3 | libutil_a_SOURCES = \ 4 | \ 5 | bin-config.c \ 6 | bin-config.h \ 7 | \ 8 | bit-map.c \ 9 | bit-map.h \ 10 | \ 11 | buffer.c \ 12 | buffer.h \ 13 | \ 14 | config.c \ 15 | config.h \ 16 | \ 17 | debug.c \ 18 | debug.h \ 19 | \ 20 | elf-encode.c \ 21 | elf-encode.h \ 22 | \ 23 | elf-format.c \ 24 | elf-format.h \ 25 | \ 26 | file.c \ 27 | file.h \ 28 | \ 29 | graph.c \ 30 | graph.h \ 31 | \ 32 | hash-table.c \ 33 | hash-table.h \ 34 | \ 35 | heap.c \ 36 | heap.h \ 37 | \ 38 | list.c \ 39 | list.h \ 40 | \ 41 | linked-list.c \ 42 | linked-list.h \ 43 | \ 44 | misc.c \ 45 | misc.h \ 46 | \ 47 | matrix.c \ 48 | matrix.h \ 49 | \ 50 | repos.c \ 51 | repos.h \ 52 | \ 53 | string.c \ 54 | string.h \ 55 | \ 56 | timer.c \ 57 | timer.h 58 | 59 | AM_CPPFLAGS = @M2S_INCLUDES@ 60 | 61 | # For 'misc.c', we need the data directory to find distribution files. 62 | AM_CFLAGS = -DPACKAGE_DATA_DIR='"$(pkgdatadir)"' 63 | 64 | -------------------------------------------------------------------------------- /src/lib/util/buffer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Libstruct 3 | * Copyright (C) 2012 Rafael Ubal (ubal@ece.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef LIB_UTIL_BUFFER_H 21 | #define LIB_UTIL_BUFFER_H 22 | 23 | struct buffer_t; 24 | 25 | /* creation and destruction */ 26 | struct buffer_t *buffer_create(int size); 27 | void buffer_free(struct buffer_t *buffer); 28 | 29 | /* read/write */ 30 | int buffer_read(struct buffer_t *buffer, void *dest, int size); 31 | int buffer_write(struct buffer_t *buffer, void *src, int size); 32 | int buffer_count(struct buffer_t *buffer); 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /src/lib/util/file.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim 3 | * Copyright (C) 2012 Rafael Ubal (ubal@ece.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef LIB_UTIL_FILE_H 21 | #define LIB_UTIL_FILE_H 22 | 23 | #include 24 | 25 | 26 | FILE *file_open_for_read(char *file_name); 27 | FILE *file_open_for_write(char *file_name); 28 | void file_close(FILE *f); 29 | 30 | int file_can_open_for_read(char *file_name); 31 | int file_can_open_for_write(char *file_name); 32 | 33 | int file_read_line(FILE *f, char *line, int size); 34 | FILE *file_create_temp(char *ret_path, int ret_path_size); 35 | 36 | void file_full_path(char *file_name, char *default_path, char *full_path, int size); 37 | 38 | #endif 39 | 40 | -------------------------------------------------------------------------------- /src/memory/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.a 3 | .deps 4 | Makefile 5 | Makefile.in 6 | -------------------------------------------------------------------------------- /src/memory/Frame.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim 3 | * Copyright (C) 2012 Rafael Ubal (ubal@ece.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #include 21 | 22 | #include 23 | 24 | #include "Frame.h" 25 | #include "System.h" 26 | 27 | 28 | namespace mem 29 | { 30 | 31 | long long Frame::id_counter = 0; 32 | 33 | 34 | Frame::Frame(long long id, Module *module, unsigned address) : 35 | id(id), 36 | module(module), 37 | address(address) 38 | { 39 | // Initialize iterators to past-the-end iterators 40 | assert(module); 41 | accesses_iterator = module->getAccessListEnd(); 42 | write_accesses_iterator = module->getWriteAccessListEnd(); 43 | } 44 | 45 | 46 | } // namespace mem 47 | 48 | -------------------------------------------------------------------------------- /src/memory/Makefile.am: -------------------------------------------------------------------------------- 1 | lib_LIBRARIES = libmemory.a 2 | 3 | libmemory_a_SOURCES = \ 4 | \ 5 | Cache.cc \ 6 | Cache.h \ 7 | \ 8 | Directory.cc \ 9 | Directory.h \ 10 | \ 11 | Frame.cc \ 12 | Frame.h \ 13 | \ 14 | Memory.cc \ 15 | Memory.h \ 16 | \ 17 | Manager.cc \ 18 | Manager.h \ 19 | \ 20 | Mmu.cc \ 21 | Mmu.h \ 22 | \ 23 | Module.cc \ 24 | Module.h \ 25 | \ 26 | SpecMem.cc \ 27 | SpecMem.h \ 28 | \ 29 | System.cc \ 30 | SystemConfig.cc \ 31 | SystemEvents.cc \ 32 | System.h 33 | 34 | AM_CPPFLAGS = @M2S_INCLUDES@ 35 | 36 | -------------------------------------------------------------------------------- /src/network/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.a 3 | .deps 4 | Makefile 5 | Makefile.in 6 | -------------------------------------------------------------------------------- /src/network/Connection.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim 3 | * Copyright (C) 2014 Amir Kavyan Ziabari (aziabari@ece.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #include "Connection.h" 21 | #include "Network.h" 22 | #include "Buffer.h" 23 | 24 | namespace net 25 | { 26 | 27 | Connection::Connection(const std::string &name, Network *network) : 28 | network(network), 29 | name(name) 30 | { 31 | } 32 | 33 | 34 | void Connection::addSourceBuffer(Buffer* buffer) 35 | { 36 | this->source_buffers.emplace_back(buffer); 37 | } 38 | 39 | 40 | void Connection::addDestinationBuffer(Buffer* buffer) 41 | { 42 | this->destination_buffers.emplace_back(buffer); 43 | } 44 | 45 | } 46 | 47 | -------------------------------------------------------------------------------- /src/network/EndNode.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim 3 | * Copyright (C) 2014 Amir Kavyan Ziabari (aziabari@ece.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef NETWORK_ENDNODE_H 21 | #define NETWORK_ENDNODE_H 22 | 23 | #include "Node.h" 24 | 25 | namespace net 26 | { 27 | 28 | // An end node is where the packet is generated and consumed 29 | class EndNode : public Node 30 | { 31 | public: 32 | 33 | /// Constructor 34 | EndNode(Network *network, 35 | int index, 36 | int input_buffer_size, 37 | int output_buffer_size, 38 | const std::string &name, 39 | void *user_data); 40 | 41 | /// Dump node information 42 | void Dump(std::ostream &os) const; 43 | 44 | }; 45 | 46 | } // namespace net 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /src/network/Frame.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim 3 | * Copyright (C) 2014 Amir Kavyan Ziabari (aziabari@ece.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef NETWORK_FRAME_H 21 | #define NETWORK_FRAME_H 22 | 23 | #include 24 | 25 | namespace net 26 | { 27 | 28 | class Frame : public esim::Frame 29 | { 30 | 31 | // Packet 32 | Packet *packet; 33 | 34 | public: 35 | 36 | /// Constructor 37 | Frame(Packet *packet) : packet(packet) 38 | { 39 | } 40 | 41 | /// Return the packet 42 | Packet *getPacket() const { return packet; } 43 | 44 | /// If true, the packet associated with this frame will be consumed 45 | /// automatically by the destination end node. If false, the user 46 | /// is responsible for receiving that in the receive event handler. 47 | bool automatic_receive = false; 48 | }; 49 | 50 | } 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /src/network/Makefile.am: -------------------------------------------------------------------------------- 1 | lib_LIBRARIES = libnetwork.a 2 | libnetwork_a_SOURCES = \ 3 | \ 4 | Buffer.h \ 5 | Buffer.cc \ 6 | \ 7 | Bus.h \ 8 | Bus.cc \ 9 | \ 10 | Connection.h\ 11 | Connection.cc\ 12 | \ 13 | EndNode.h \ 14 | EndNode.cc \ 15 | \ 16 | Frame.h \ 17 | \ 18 | Graph.h \ 19 | Graph.cc \ 20 | \ 21 | Link.h \ 22 | Link.cc \ 23 | \ 24 | Message.h \ 25 | Message.cc \ 26 | \ 27 | Network.cc \ 28 | Network.h \ 29 | \ 30 | Node.cc \ 31 | Node.h \ 32 | \ 33 | Packet.h \ 34 | Packet.cc \ 35 | \ 36 | RoutingTable.h \ 37 | RoutingTable.cc \ 38 | \ 39 | System.h \ 40 | System.cc \ 41 | SystemConfig.cc \ 42 | SystemEvents.cc \ 43 | \ 44 | Switch.h \ 45 | Switch.cc 46 | 47 | AM_CPPFLAGS = @M2S_INCLUDES@ 48 | -------------------------------------------------------------------------------- /src/network/Packet.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim 3 | * Copyright (C) 2016 Amir Kavyan Ziabari (aziabari@ece.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #include "Packet.h" 21 | #include "Message.h" 22 | 23 | namespace net 24 | { 25 | 26 | Packet::Packet(Message *message, int size) : 27 | message(message), 28 | size(size) 29 | { 30 | // Assigning the packet's id 31 | id = message->getNumPackets(); 32 | } 33 | 34 | } // namespace net 35 | -------------------------------------------------------------------------------- /src/visual/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.a 3 | .deps 4 | Makefile 5 | Makefile.in 6 | -------------------------------------------------------------------------------- /src/visual/Makefile.am: -------------------------------------------------------------------------------- 1 | SUBDIRS = \ 2 | common \ 3 | evergreen \ 4 | memory \ 5 | network \ 6 | southern-islands \ 7 | x86 8 | 9 | -------------------------------------------------------------------------------- /src/visual/common/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.a 3 | .deps 4 | Makefile 5 | Makefile.in 6 | -------------------------------------------------------------------------------- /src/visual/common/Makefile.am: -------------------------------------------------------------------------------- 1 | lib_LIBRARIES = libcommon.a 2 | 3 | if HAVE_GTK 4 | libcommon_a_SOURCES = \ 5 | \ 6 | cycle-bar.c \ 7 | cycle-bar.h \ 8 | \ 9 | led.c \ 10 | led.h \ 11 | \ 12 | list.c \ 13 | list.h \ 14 | \ 15 | popup.c \ 16 | popup.h \ 17 | \ 18 | state.c \ 19 | state.h \ 20 | \ 21 | trace.c \ 22 | trace.h \ 23 | \ 24 | visual.c \ 25 | visual.h 26 | 27 | AM_CFLAGS = @GTK_CFLAGS@ 28 | 29 | else 30 | 31 | libcommon_a_SOURCES = \ 32 | \ 33 | visual-missing.c \ 34 | visual.h 35 | 36 | endif 37 | 38 | AM_CPPFLAGS = @M2S_INCLUDES@ 39 | -------------------------------------------------------------------------------- /src/visual/common/cycle-bar.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim Tools 3 | * Copyright (C) 2012 Rafael Ubal (ubal@ece.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef VISUAL_COMMON_CYCLE_BAR_H 21 | #define VISUAL_COMMON_CYCLE_BAR_H 22 | 23 | #include 24 | 25 | 26 | typedef void (*vi_cycle_bar_refresh_func_t)(void *user_data, long long cycle); 27 | 28 | void vi_cycle_bar_init(vi_cycle_bar_refresh_func_t refresh_func, void *user_data); 29 | void vi_cycle_bar_done(void); 30 | 31 | void vi_cycle_bar_set_refresh_func(vi_cycle_bar_refresh_func_t refresh_func, void *user_data); 32 | 33 | GtkWidget *vi_cycle_bar_get_widget(void); 34 | long long vi_cycle_bar_get_cycle(void); 35 | 36 | 37 | #endif 38 | 39 | -------------------------------------------------------------------------------- /src/visual/common/led.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim Tools 3 | * Copyright (C) 2012 Rafael Ubal (ubal@ece.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | 21 | #ifndef VISUAL_COMMON_LED_H 22 | #define VISUAL_COMMON_LED_H 23 | 24 | #include 25 | 26 | 27 | struct vi_led_t; 28 | 29 | struct vi_led_t *vi_led_create(int radius); 30 | void vi_led_free(struct vi_led_t *led); 31 | 32 | void vi_led_set_color(struct vi_led_t *led, GdkColor *color); 33 | 34 | GtkWidget *vi_led_get_widget(struct vi_led_t *led); 35 | 36 | 37 | #endif 38 | 39 | -------------------------------------------------------------------------------- /src/visual/common/popup.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim Tools 3 | * Copyright (C) 2012 Rafael Ubal (ubal@ece.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef VISUAL_COMMON_POPUP_H 21 | #define VISUAL_COMMON_POPUP_H 22 | 23 | 24 | struct vi_popup_t; 25 | 26 | struct vi_popup_t *vi_popup_create(char *text); 27 | void vi_popup_free(struct vi_popup_t *popup); 28 | 29 | void vi_popup_show(char *text); 30 | 31 | 32 | #endif 33 | 34 | -------------------------------------------------------------------------------- /src/visual/common/visual.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim Tools 3 | * Copyright (C) 2012 Rafael Ubal (ubal@ece.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | 21 | #ifndef VISUAL_COMMON_VISUAL_H 22 | #define VISUAL_COMMON_VISUAL_H 23 | 24 | 25 | /* Function to invoke visualization tool. 26 | * The name of the trace file is passed as the argument. */ 27 | void visual_run(const char *file_name); 28 | 29 | 30 | #endif 31 | 32 | -------------------------------------------------------------------------------- /src/visual/evergreen/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.a 3 | .deps 4 | Makefile 5 | Makefile.in 6 | -------------------------------------------------------------------------------- /src/visual/evergreen/Makefile.am: -------------------------------------------------------------------------------- 1 | lib_LIBRARIES = libevergreen.a 2 | 3 | libevergreen_a_SOURCES = 4 | 5 | if HAVE_GTK 6 | libevergreen_a_SOURCES += \ 7 | \ 8 | compute-unit.c \ 9 | compute-unit.h \ 10 | \ 11 | gpu.c \ 12 | gpu.h \ 13 | \ 14 | inst.c \ 15 | inst.h \ 16 | \ 17 | panel.c \ 18 | panel.h \ 19 | \ 20 | time-dia.c \ 21 | time-dia.h \ 22 | \ 23 | work-group.c \ 24 | work-group.h 25 | 26 | AM_CFLAGS = @GTK_CFLAGS@ 27 | 28 | endif 29 | 30 | AM_CPPFLAGS = @M2S_INCLUDES@ 31 | -------------------------------------------------------------------------------- /src/visual/evergreen/gpu.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim Tools 3 | * Copyright (C) 2012 Rafael Ubal (ubal@ece.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef VISUAL_EVERGREEN_GPU_H 21 | #define VISUAL_EVERGREEN_GPU_H 22 | 23 | 24 | struct vi_evg_gpu_t 25 | { 26 | struct list_t *compute_unit_list; 27 | 28 | /* True if the trace contains the Evergreen GPU */ 29 | int active; 30 | }; 31 | 32 | 33 | extern struct vi_evg_gpu_t *vi_evg_gpu; 34 | 35 | void vi_evg_gpu_init(void); 36 | void vi_evg_gpu_done(void); 37 | 38 | 39 | #endif 40 | 41 | -------------------------------------------------------------------------------- /src/visual/evergreen/panel.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim Tools 3 | * Copyright (C) 2012 Rafael Ubal (ubal@ece.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef VISUAL_EVERGREEN_PANEL_H 21 | #define VISUAL_EVERGREEN_PANEL_H 22 | 23 | #include 24 | 25 | struct vi_evg_panel_t; 26 | 27 | struct vi_evg_panel_t *vi_evg_panel_create(void); 28 | void vi_evg_panel_free(struct vi_evg_panel_t *panel); 29 | 30 | void vi_evg_panel_refresh(struct vi_evg_panel_t *panel); 31 | 32 | GtkWidget *vi_evg_panel_get_widget(struct vi_evg_panel_t *panel); 33 | 34 | 35 | #endif 36 | 37 | -------------------------------------------------------------------------------- /src/visual/evergreen/time-dia.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim Tools 3 | * Copyright (C) 2012 Rafael Ubal (ubal@ece.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef VISUAL_EVERGREEN_TIME_DIA_H 21 | #define VISUAL_EVERGREEN_TIME_DIA_H 22 | 23 | 24 | struct vi_evg_time_dia_t; 25 | 26 | struct vi_evg_compute_unit_t; 27 | struct vi_evg_time_dia_t *vi_evg_time_dia_create(struct vi_evg_compute_unit_t *compute_unit); 28 | void vi_evg_time_dia_free(struct vi_evg_time_dia_t *time_dia); 29 | 30 | GtkWidget *vi_evg_time_dia_get_widget(struct vi_evg_time_dia_t *time_dia); 31 | 32 | void vi_evg_time_dia_go_to_cycle(struct vi_evg_time_dia_t *time_dia, long long cycle); 33 | void vi_evg_time_dia_refresh(struct vi_evg_time_dia_t *time_dia); 34 | 35 | 36 | #endif 37 | 38 | -------------------------------------------------------------------------------- /src/visual/memory/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.a 3 | .deps 4 | Makefile 5 | Makefile.in 6 | -------------------------------------------------------------------------------- /src/visual/memory/Makefile.am: -------------------------------------------------------------------------------- 1 | lib_LIBRARIES = libmemory.a 2 | 3 | libmemory_a_SOURCES = 4 | 5 | if HAVE_GTK 6 | libmemory_a_SOURCES += \ 7 | \ 8 | mem-system.c \ 9 | mem-system.h \ 10 | \ 11 | mod-access.c \ 12 | mod-access.h \ 13 | \ 14 | mod.c \ 15 | mod.h \ 16 | \ 17 | mod-widget.c \ 18 | mod-widget.h \ 19 | \ 20 | panel.c \ 21 | panel.h 22 | 23 | AM_CFLAGS = @GTK_CFLAGS@ 24 | 25 | endif 26 | 27 | AM_CPPFLAGS = @M2S_INCLUDES@ 28 | -------------------------------------------------------------------------------- /src/visual/memory/mem-system.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim Tools 3 | * Copyright (C) 2012 Rafael Ubal (ubal@ece.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | 21 | #ifndef VISUAL_MEMORY_MEM_SYSTEM_H 22 | #define VISUAL_MEMORY_MEM_SYSTEM_H 23 | 24 | struct hash_table_t; 25 | struct list_t; 26 | 27 | struct vi_mem_system_t 28 | { 29 | struct hash_table_t *mod_table; 30 | struct hash_table_t *net_table; 31 | struct hash_table_t *access_table; 32 | struct list_t *mod_level_list; 33 | }; 34 | 35 | 36 | extern struct vi_mem_system_t *vi_mem_system; 37 | 38 | 39 | void vi_mem_system_init(void); 40 | void vi_mem_system_done(void); 41 | 42 | 43 | #endif 44 | 45 | -------------------------------------------------------------------------------- /src/visual/memory/mod-widget.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim Tools 3 | * Copyright (C) 2012 Rafael Ubal (ubal@ece.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef VISUAL_MEMORY_MOD_WIDGET_H 21 | #define VISUAL_MEMORY_MOD_WIDGET_H 22 | 23 | #include 24 | 25 | 26 | struct vi_mod_widget_t; 27 | 28 | struct vi_mod_widget_t *vi_mod_widget_create(char *name); 29 | void vi_mod_widget_free(struct vi_mod_widget_t *widget); 30 | 31 | void vi_mod_widget_refresh(struct vi_mod_widget_t *visual_mod_widget); 32 | 33 | GtkWidget *vi_mod_widget_get_widget(struct vi_mod_widget_t *widget); 34 | 35 | 36 | #endif 37 | 38 | -------------------------------------------------------------------------------- /src/visual/memory/panel.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim Tools 3 | * Copyright (C) 2012 Rafael Ubal (ubal@ece.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef VISUAL_MEMORY_PANEL_H 21 | #define VISUAL_MEMORY_PANEL_H 22 | 23 | #include 24 | 25 | 26 | struct vi_mem_panel_t; 27 | 28 | struct vi_mem_panel_t *vi_mem_panel_create(void); 29 | void vi_mem_panel_free(struct vi_mem_panel_t *panel); 30 | 31 | void vi_mem_panel_refresh(struct vi_mem_panel_t *panel); 32 | void vi_net_panel_refresh(struct vi_mem_panel_t *panel); 33 | 34 | GtkWidget *vi_mem_panel_get_widget(struct vi_mem_panel_t *panel); 35 | 36 | 37 | #endif 38 | 39 | -------------------------------------------------------------------------------- /src/visual/network/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.a 3 | .deps 4 | Makefile 5 | Makefile.in 6 | -------------------------------------------------------------------------------- /src/visual/network/Makefile.am: -------------------------------------------------------------------------------- 1 | lib_LIBRARIES = libnetwork.a 2 | 3 | libnetwork_a_SOURCES = 4 | 5 | if HAVE_GTK 6 | libnetwork_a_SOURCES += \ 7 | \ 8 | buffer.c \ 9 | buffer.h \ 10 | \ 11 | link.c \ 12 | link.h \ 13 | \ 14 | net.c \ 15 | net.h \ 16 | \ 17 | net-graph.c \ 18 | net-graph.h \ 19 | \ 20 | net-message.c \ 21 | net-message.h \ 22 | \ 23 | net-packet.c \ 24 | net-packet.h \ 25 | \ 26 | net-system.c \ 27 | net-system.h \ 28 | \ 29 | net-widget.c \ 30 | net-widget.h \ 31 | \ 32 | node.c \ 33 | node.h \ 34 | \ 35 | node-widget.c \ 36 | node-widget.h \ 37 | \ 38 | panel.c \ 39 | panel.h 40 | 41 | AM_CFLAGS = @GTK_CFLAGS@ 42 | 43 | endif 44 | 45 | AM_CPPFLAGS = @M2S_INCLUDES@ 46 | -------------------------------------------------------------------------------- /src/visual/network/net-system.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim Tools 3 | * Copyright (C) 2012 Rafael Ubal (ubal@ece.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef VISUAL_NETWORK_NET_SYSTEM_H 21 | #define VISUAL_NETWORK_NET_SYSTEM_H 22 | 23 | struct hash_table_t; 24 | 25 | struct vi_net_system_t 26 | { 27 | int active; 28 | 29 | struct hash_table_t *net_table; 30 | struct list_t *level_list; 31 | }; 32 | 33 | extern struct vi_net_system_t *vi_net_system; 34 | 35 | void vi_net_system_init(void); 36 | void vi_net_system_level_assign(void); 37 | void vi_net_system_coordination_config(void); 38 | void vi_net_system_done(void); 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /src/visual/southern-islands/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.a 3 | .deps 4 | Makefile 5 | Makefile.in 6 | -------------------------------------------------------------------------------- /src/visual/southern-islands/Makefile.am: -------------------------------------------------------------------------------- 1 | lib_LIBRARIES = libsouthernislands.a 2 | 3 | libsouthernislands_a_SOURCES = 4 | 5 | if HAVE_GTK 6 | libsouthernislands_a_SOURCES += \ 7 | \ 8 | compute-unit.c \ 9 | compute-unit.h \ 10 | \ 11 | gpu.c \ 12 | gpu.h \ 13 | \ 14 | inst.c \ 15 | inst.h \ 16 | \ 17 | panel.c \ 18 | panel.h \ 19 | \ 20 | time-dia.c \ 21 | time-dia.h \ 22 | \ 23 | work-group.c \ 24 | work-group.h 25 | 26 | AM_CFLAGS = @GTK_CFLAGS@ 27 | 28 | endif 29 | 30 | AM_CPPFLAGS = @M2S_INCLUDES@ 31 | -------------------------------------------------------------------------------- /src/visual/southern-islands/gpu.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim Tools 3 | * Copyright (C) 2012 Rafael Ubal (ubal@ece.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | 21 | #ifndef VISUAL_SOUTHERN_ISLANDS_GPU_H 22 | #define VISUAL_SOUTHERN_ISLANDS_GPU_H 23 | 24 | 25 | struct list_t; 26 | 27 | struct vi_si_gpu_t 28 | { 29 | struct list_t *compute_unit_list; 30 | 31 | /* True if the trace contains the Southern Islands GPU */ 32 | int active; 33 | }; 34 | 35 | 36 | extern struct vi_si_gpu_t *vi_si_gpu; 37 | 38 | void vi_si_gpu_init(void); 39 | void vi_si_gpu_done(void); 40 | 41 | 42 | #endif 43 | 44 | -------------------------------------------------------------------------------- /src/visual/southern-islands/panel.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim Tools 3 | * Copyright (C) 2012 Rafael Ubal (ubal@ece.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef VISUAL_SOUTHERN_ISLANDS_PANEL_H 21 | #define VISUAL_SOUTHERN_ISLANDS_PANEL_H 22 | 23 | #include 24 | 25 | 26 | struct vi_si_panel_t; 27 | 28 | struct vi_si_panel_t *vi_si_panel_create(void); 29 | void vi_si_panel_free(struct vi_si_panel_t *panel); 30 | 31 | void vi_si_panel_refresh(struct vi_si_panel_t *panel); 32 | 33 | GtkWidget *vi_si_panel_get_widget(struct vi_si_panel_t *panel); 34 | 35 | 36 | #endif 37 | 38 | -------------------------------------------------------------------------------- /src/visual/southern-islands/time-dia.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim Tools 3 | * Copyright (C) 2012 Rafael Ubal (ubal@ece.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef VISUAL_SOUTHERN_ISLANDS_TIME_DIA_H 21 | #define VISUAL_SOUTHERN_ISLANDS_TIME_DIA_H 22 | 23 | 24 | struct vi_si_time_dia_t; 25 | 26 | struct vi_si_compute_unit_t; 27 | struct vi_si_time_dia_t *vi_si_time_dia_create(struct vi_si_compute_unit_t *compute_unit); 28 | void vi_si_time_dia_free(struct vi_si_time_dia_t *time_dia); 29 | 30 | GtkWidget *vi_si_time_dia_get_widget(struct vi_si_time_dia_t *time_dia); 31 | 32 | void vi_si_time_dia_go_to_cycle(struct vi_si_time_dia_t *time_dia, long long cycle); 33 | void vi_si_time_dia_refresh(struct vi_si_time_dia_t *time_dia); 34 | 35 | 36 | #endif 37 | 38 | -------------------------------------------------------------------------------- /src/visual/x86/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.a 3 | .deps 4 | Makefile 5 | Makefile.in 6 | -------------------------------------------------------------------------------- /src/visual/x86/Makefile.am: -------------------------------------------------------------------------------- 1 | lib_LIBRARIES = libx86.a 2 | 3 | libx86_a_SOURCES = 4 | 5 | if HAVE_GTK 6 | libx86_a_SOURCES += \ 7 | \ 8 | context.c \ 9 | context.h \ 10 | \ 11 | core.c \ 12 | core.h \ 13 | \ 14 | cpu.c \ 15 | cpu.h \ 16 | \ 17 | inst.c \ 18 | inst.h \ 19 | \ 20 | panel.c \ 21 | panel.h \ 22 | \ 23 | time-dia.c \ 24 | time-dia.h 25 | 26 | AM_CFLAGS = @GTK_CFLAGS@ 27 | 28 | endif 29 | 30 | AM_CPPFLAGS = @M2S_INCLUDES@ 31 | -------------------------------------------------------------------------------- /src/visual/x86/cpu.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim Tools 3 | * Copyright (C) 2012 Rafael Ubal (ubal@ece.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef VISUAL_X86_CPU_H 21 | #define VISUAL_X86_CPU_H 22 | 23 | 24 | struct hash_table_t; 25 | struct list_t; 26 | 27 | struct vi_x86_cpu_t 28 | { 29 | struct list_t *core_list; 30 | 31 | /* Hash table of contexts. 32 | * Elements are of type 'struct vi_x86_context_t' */ 33 | struct hash_table_t *context_table; 34 | 35 | /* True if the trace file contains x86 information at all */ 36 | int active; 37 | }; 38 | 39 | 40 | extern struct vi_x86_cpu_t *vi_x86_cpu; 41 | 42 | void vi_x86_cpu_init(void); 43 | void vi_x86_cpu_done(void); 44 | 45 | 46 | #endif 47 | 48 | -------------------------------------------------------------------------------- /src/visual/x86/panel.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim Tools 3 | * Copyright (C) 2012 Rafael Ubal (ubal@ece.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef VISUAL_X86_PANEL_H 21 | #define VISUAL_X86_PANEL_H 22 | 23 | #include 24 | 25 | 26 | struct vi_x86_panel_t *vi_x86_panel_create(void); 27 | void vi_x86_panel_free(struct vi_x86_panel_t *panel); 28 | 29 | void vi_x86_panel_refresh(struct vi_x86_panel_t *panel); 30 | 31 | GtkWidget *vi_x86_panel_get_widget(struct vi_x86_panel_t *panel); 32 | 33 | 34 | #endif 35 | 36 | -------------------------------------------------------------------------------- /src/visual/x86/time-dia.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Multi2Sim Tools 3 | * Copyright (C) 2012 Rafael Ubal (ubal@ece.neu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef VISUAL_X86_TIME_DIA_H 21 | #define VISUAL_X86_TIME_DIA_H 22 | 23 | #include 24 | 25 | 26 | struct vi_x86_time_dia_t; 27 | 28 | struct vi_x86_core_t; 29 | struct vi_x86_time_dia_t *vi_x86_time_dia_create(struct vi_x86_core_t *core); 30 | void vi_x86_time_dia_free(struct vi_x86_time_dia_t *time_dia); 31 | 32 | GtkWidget *vi_x86_time_dia_get_widget(struct vi_x86_time_dia_t *time_dia); 33 | 34 | void vi_x86_time_dia_refresh(struct vi_x86_time_dia_t *time_dia); 35 | void vi_x86_time_dia_go_to_cycle(struct vi_x86_time_dia_t *time_dia, long long cycle); 36 | 37 | 38 | #endif 39 | 40 | -------------------------------------------------------------------------------- /tests/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.a 3 | *.log 4 | *.trs 5 | .deps 6 | Makefile 7 | Makefile.in 8 | src_* 9 | -------------------------------------------------------------------------------- /tests/src/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.a 3 | .deps 4 | Makefile 5 | Makefile.in 6 | -------------------------------------------------------------------------------- /tests/src/arch/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.a 3 | .deps 4 | Makefile 5 | Makefile.in 6 | -------------------------------------------------------------------------------- /tests/src/arch/southern-islands/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.a 3 | .deps 4 | Makefile 5 | Makefile.in 6 | -------------------------------------------------------------------------------- /tests/src/arch/southern-islands/emu/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.a 3 | .deps 4 | Makefile 5 | Makefile.in 6 | .dirstamp 7 | -------------------------------------------------------------------------------- /tests/src/arch/southern-islands/timing/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.a 3 | .deps 4 | Makefile 5 | Makefile.in 6 | .dirstamp 7 | -------------------------------------------------------------------------------- /tests/src/arch/x86/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.a 3 | .deps 4 | Makefile 5 | Makefile.in 6 | -------------------------------------------------------------------------------- /tests/src/arch/x86/timing/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.a 3 | .deps 4 | Makefile 5 | Makefile.in 6 | .dirstamp 7 | -------------------------------------------------------------------------------- /tests/src/dram/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.a 3 | .deps 4 | Makefile 5 | Makefile.in 6 | .dirstamp 7 | -------------------------------------------------------------------------------- /tests/src/memory/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.a 3 | .deps 4 | Makefile 5 | Makefile.in 6 | .dirstamp 7 | -------------------------------------------------------------------------------- /tests/src/network/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.a 3 | .deps 4 | Makefile 5 | Makefile.in 6 | .dirstamp 7 | --------------------------------------------------------------------------------