summaryrefslogtreecommitdiff
path: root/src/abstract_hardware_model.h
diff options
context:
space:
mode:
authorInderpreet Singh <[email protected]>2011-05-25 16:01:16 -0800
committerInderpreet Singh <[email protected]>2011-05-25 16:01:16 -0800
commite1cffaf08733754ab55052b6a2729dae57665d29 (patch)
tree6bd1fda8aedad981d8295fdf765c85df1e1c8f3d /src/abstract_hardware_model.h
parent07376c3d981fbfea6bfad99657c2055b9bdb0e4f (diff)
Fix bug #100: local memory address translation returns multiple addresses
Fix bug #101: Coalescing allows multiple accesses per thread for local memory access This will break atomics which assume at most one thread per mem_fetch. It did not break scoreboard as that logic tracks mem_fetches at warp level, not thread level. [git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 9303]
Diffstat (limited to 'src/abstract_hardware_model.h')
-rw-r--r--src/abstract_hardware_model.h18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/abstract_hardware_model.h b/src/abstract_hardware_model.h
index 2332670..bb4545e 100644
--- a/src/abstract_hardware_model.h
+++ b/src/abstract_hardware_model.h
@@ -655,7 +655,16 @@ public:
m_per_scalar_thread.resize(m_config->warp_size);
m_per_scalar_thread_valid=true;
}
- m_per_scalar_thread[n].memreqaddr = addr;
+ m_per_scalar_thread[n].memreqaddr[0] = addr;
+ }
+ void set_addr( unsigned n, new_addr_type* addr, unsigned num_addrs )
+ {
+ if( !m_per_scalar_thread_valid ) {
+ m_per_scalar_thread.resize(m_config->warp_size);
+ m_per_scalar_thread_valid=true;
+ }
+ for(unsigned i=0; i<num_addrs; i++)
+ m_per_scalar_thread[n].memreqaddr[i] = addr[i];
}
void generate_mem_accesses();
void add_callback( unsigned lane_id,
@@ -720,7 +729,7 @@ public:
new_addr_type get_addr( unsigned n ) const
{
assert( m_per_scalar_thread_valid );
- return m_per_scalar_thread[n].memreqaddr;
+ return m_per_scalar_thread[n].memreqaddr[0];
}
bool isatomic() const { return m_isatomic; }
@@ -754,10 +763,11 @@ protected:
struct per_thread_info {
per_thread_info() {
- memreqaddr=0;
+ for(unsigned i=0; i<8; i++)
+ memreqaddr[i] = 0;
}
dram_callback_t callback;
- new_addr_type memreqaddr; // effective address
+ new_addr_type memreqaddr[8]; // effective address, upto 8 different requests (to support 32B access in 8 chunks of 4B each)
};
bool m_per_scalar_thread_valid;
std::vector<per_thread_info> m_per_scalar_thread;