summaryrefslogtreecommitdiff
path: root/src/gpgpu-sim/mem_fetch.cc
diff options
context:
space:
mode:
authorTayler Hetherington <[email protected]>2012-11-30 21:29:42 -0800
committerAndrew Boktor <[email protected]>2014-08-14 13:49:22 -0700
commit36ce0f2243fd0723a746b3c2f5f0651577312400 (patch)
treee79475e75f800ad34b4851ea710c4ee409f5bd72 /src/gpgpu-sim/mem_fetch.cc
parent08ec3343d0bca75e63e130266f75f8242f22050b (diff)
Merging Power model into Fermi
//depot/gpgpu_sim_research/fermi_power/distribution/... to //depot/gpgpu_sim_research/fermi/distribution/... [git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 14723]
Diffstat (limited to 'src/gpgpu-sim/mem_fetch.cc')
-rw-r--r--src/gpgpu-sim/mem_fetch.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/gpgpu-sim/mem_fetch.cc b/src/gpgpu-sim/mem_fetch.cc
index 97721c0..1de10a5 100644
--- a/src/gpgpu-sim/mem_fetch.cc
+++ b/src/gpgpu-sim/mem_fetch.cc
@@ -60,6 +60,7 @@ mem_fetch::mem_fetch( const mem_access_t &access,
m_status = MEM_FETCH_INITIALIZED;
m_status_change = gpu_sim_cycle + gpu_tot_sim_cycle;
m_mem_config = config;
+ icnt_flit_size = config->icnt_flit_size;
}
mem_fetch::~mem_fetch()
@@ -119,3 +120,17 @@ bool mem_fetch::isconst() const
if( m_inst.empty() ) return false;
return (m_inst.space.get_type() == const_space) || (m_inst.space.get_type() == param_space_kernel);
}
+
+/// Returns number of flits traversing interconnect. simt_to_mem specifies the direction
+unsigned mem_fetch::get_num_flits(bool simt_to_mem){
+ unsigned sz=0;
+ if( (simt_to_mem && get_is_write()) || !(simt_to_mem || get_is_write()) )
+ sz = size();
+ else
+ sz = get_ctrl_size();
+
+ return (sz/icnt_flit_size) + ( (sz % icnt_flit_size)? 1:0);
+}
+
+
+