summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWilson Fung <[email protected]>2012-02-13 10:36:29 -0800
committerAndrew Boktor <[email protected]>2014-08-14 13:19:02 -0700
commit95215f59825ff9def72c3bb237c58bb02c8c2411 (patch)
treeef008e44eff86a36e5a95ae44f09d9845e280522 /src
parentf0bfd72df3f664c2b44595d1a393ec6b535181c0 (diff)
Fixed the stat collection for gpgpu_n_shmem_insn. See Bug 128 for more detail. For verification, I added a directed test with a pre-calculated number of shared memory instructions.
[git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 11454]
Diffstat (limited to 'src')
-rw-r--r--src/gpgpu-sim/gpu-sim.cc13
-rw-r--r--src/gpgpu-sim/shader.cc7
-rw-r--r--src/gpgpu-sim/shader.h3
3 files changed, 15 insertions, 8 deletions
diff --git a/src/gpgpu-sim/gpu-sim.cc b/src/gpgpu-sim/gpu-sim.cc
index 6b448ab..3200c9c 100644
--- a/src/gpgpu-sim/gpu-sim.cc
+++ b/src/gpgpu-sim/gpu-sim.cc
@@ -639,30 +639,31 @@ unsigned gpgpu_sim::threads_per_core() const
void shader_core_ctx::mem_instruction_stats(const warp_inst_t &inst)
{
+ unsigned active_count = inst.active_count();
//this breaks some encapsulation: the is_[space] functions, if you change those, change this.
switch (inst.space.get_type()) {
case undefined_space:
case reg_space:
break;
case shared_space:
- m_stats->gpgpu_n_shmem_insn++;
+ m_stats->gpgpu_n_shmem_insn += active_count;
break;
case const_space:
- m_stats->gpgpu_n_const_insn++;
+ m_stats->gpgpu_n_const_insn += active_count;
break;
case param_space_kernel:
case param_space_local:
- m_stats->gpgpu_n_param_insn++;
+ m_stats->gpgpu_n_param_insn += active_count;
break;
case tex_space:
- m_stats->gpgpu_n_tex_insn++;
+ m_stats->gpgpu_n_tex_insn += active_count;
break;
case global_space:
case local_space:
if( inst.is_store() )
- m_stats->gpgpu_n_store_insn++;
+ m_stats->gpgpu_n_store_insn += active_count;
else
- m_stats->gpgpu_n_load_insn++;
+ m_stats->gpgpu_n_load_insn += active_count;
break;
default:
abort();
diff --git a/src/gpgpu-sim/shader.cc b/src/gpgpu-sim/shader.cc
index 42f43fe..82e4540 100644
--- a/src/gpgpu-sim/shader.cc
+++ b/src/gpgpu-sim/shader.cc
@@ -1026,6 +1026,13 @@ unsigned ldst_unit::clock_multiplier() const
return m_config->mem_warp_parts;
}
+void ldst_unit::issue( warp_inst_t *&inst )
+{
+ // stat collection
+ m_core->mem_instruction_stats(*inst);
+ pipelined_simd_unit::issue(inst);
+}
+
void ldst_unit::cycle()
{
writeback();
diff --git a/src/gpgpu-sim/shader.h b/src/gpgpu-sim/shader.h
index 43121a1..d367b7f 100644
--- a/src/gpgpu-sim/shader.h
+++ b/src/gpgpu-sim/shader.h
@@ -834,6 +834,7 @@ public:
unsigned sid, unsigned tpc );
// modifiers
+ virtual void issue( warp_inst_t *&inst );
virtual void cycle();
void fill( mem_fetch *mf );
@@ -1283,8 +1284,6 @@ public:
}
virtual void push(mem_fetch *mf)
{
- if( !mf->get_inst().empty() )
- m_core->mem_instruction_stats(mf->get_inst()); // not I$-fetch
m_cluster->icnt_inject_request_packet(mf);
}
private: