From 15819dff8c2eec408379cae0bf42e275404885cb Mon Sep 17 00:00:00 2001 From: Ayub Gubran Date: Mon, 9 Jan 2012 13:17:31 -0800 Subject: Integrating the pure functional simulation Merging //depot/gpgpu_sim_research/fermi_ayoub/distribution/src/cuda-sim/cuda-sim.cc //depot/gpgpu_sim_research/fermi_ayoub/distribution/src/cuda-sim/cuda-sim.h //depot/gpgpu_sim_research/fermi_ayoub/distribution/src/cuda-sim/instructions.cc //depot/gpgpu_sim_research/fermi_ayoub/distribution/src/cuda-sim/ptx_sim.h to //depot/gpgpu_sim_research/fermi/distribution/src/cuda-sim/... [git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 11288] --- src/cuda-sim/ptx_sim.h | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'src/cuda-sim/ptx_sim.h') diff --git a/src/cuda-sim/ptx_sim.h b/src/cuda-sim/ptx_sim.h index 4d54245..3c12cc8 100644 --- a/src/cuda-sim/ptx_sim.h +++ b/src/cuda-sim/ptx_sim.h @@ -237,7 +237,7 @@ public: ~ptx_thread_info(); ptx_thread_info( kernel_info_t &kernel ); - void init(gpgpu_t *gpu, core_t *core, unsigned sid, unsigned cta_id, unsigned wid, unsigned tid ) + void init(gpgpu_t *gpu, core_t *core, unsigned sid, unsigned cta_id, unsigned wid, unsigned tid, bool fsim) { m_gpu = gpu; m_core = core; @@ -245,6 +245,7 @@ public: m_hw_ctaid=cta_id; m_hw_wid=wid; m_hw_tid=tid; + m_functionalSimulationMode = fsim; } void ptx_fetch_inst( inst_t &inst ) const; @@ -276,7 +277,7 @@ public: dim3 get_ctaid() const { return m_ctaid; } dim3 get_tid() const { return m_tid; } - class gpgpu_sim *get_gpu() { return m_core->get_gpu(); } + class gpgpu_sim *get_gpu() { return (gpgpu_sim*)m_gpu;} unsigned get_hw_tid() const { return m_hw_tid;} unsigned get_hw_ctaid() const { return m_hw_ctaid;} unsigned get_hw_wid() const { return m_hw_wid;} @@ -392,6 +393,15 @@ public: memory_space *get_surf_memory() { return m_gpu->get_surf_memory(); } memory_space *get_param_memory() { return m_kernel.get_param_memory(); } const gpgpu_functional_sim_config &get_config() const { return m_gpu->get_config(); } + bool isInFunctionalSimulationMode(){ return m_functionalSimulationMode;} + void exitCore() + { + //m_core is not used in case of functional simulation mode + if(!m_functionalSimulationMode) + m_core->warp_exit(m_hw_wid); + } + + void registerExit(){m_cta_info->register_thread_exit(this);} public: addr_t m_last_effective_address; @@ -405,7 +415,7 @@ public: private: - + bool m_functionalSimulationMode; unsigned m_uid; kernel_info_t &m_kernel; core_t *m_core; -- cgit v1.3