summaryrefslogtreecommitdiff
path: root/src/gpgpu-sim/gpu-cache.cc
diff options
context:
space:
mode:
authorMahmoud Khairy A. Abdallah <[email protected]>2017-11-18 23:43:56 -0500
committerGitHub Enterprise <[email protected]>2017-11-18 23:43:56 -0500
commit77abdbf7a3c69631bceb5c96f4d3628447487612 (patch)
tree3c8de6a8d14739da6bc035c33a8c47292fe135c9 /src/gpgpu-sim/gpu-cache.cc
parentdccac457bb2263602a6a244297168cae8fda8e47 (diff)
parentf125fecc85fdbb29ed846a2acfdb5e8c6cf20e41 (diff)
Merge pull request #1 from tgrogers/copy-kernel
Copy kernel
Diffstat (limited to 'src/gpgpu-sim/gpu-cache.cc')
-rw-r--r--src/gpgpu-sim/gpu-cache.cc25
1 files changed, 18 insertions, 7 deletions
diff --git a/src/gpgpu-sim/gpu-cache.cc b/src/gpgpu-sim/gpu-cache.cc
index 32c2bb1..e1e41a5 100644
--- a/src/gpgpu-sim/gpu-cache.cc
+++ b/src/gpgpu-sim/gpu-cache.cc
@@ -190,11 +190,17 @@ void tag_array::init( int core_id, int type_id )
m_type_id = type_id;
}
+
enum cache_request_status tag_array::probe( new_addr_type addr, unsigned &idx, mem_fetch* mf) const {
+ mem_access_sector_mask_t mask = mf->get_access_sector_mask();
+ return probe(addr, idx, mask);
+}
+
+
+enum cache_request_status tag_array::probe( new_addr_type addr, unsigned &idx, mem_access_sector_mask_t mask) const {
//assert( m_config.m_write_policy == READ_ONLY );
unsigned set_index = m_config.set_index(addr);
new_addr_type tag = m_config.tag(addr);
- mem_access_sector_mask_t mask = mf->get_access_sector_mask();
unsigned invalid_line = (unsigned)-1;
unsigned valid_line = (unsigned)-1;
@@ -310,18 +316,23 @@ enum cache_request_status tag_array::access( new_addr_type addr, unsigned time,
void tag_array::fill( new_addr_type addr, unsigned time, mem_fetch* mf)
{
- assert( m_config.m_alloc_policy == ON_FILL );
+ fill(addr, time, mf->get_access_sector_mask());
+}
+
+void tag_array::fill( new_addr_type addr, unsigned time, mem_access_sector_mask_t mask )
+{
+ //assert( m_config.m_alloc_policy == ON_FILL );
unsigned idx;
- enum cache_request_status status = probe(addr,idx,mf);
- assert(status==MISS||status==SECTOR_MISS); // MSHR should have prevented redundant memory request
+ enum cache_request_status status = probe(addr,idx,mask);
+ //assert(status==MISS||status==SECTOR_MISS); // MSHR should have prevented redundant memory request
if(status==MISS)
- m_lines[idx]->allocate( m_config.tag(addr), m_config.block_addr(addr), time, mf->get_access_sector_mask() );
+ m_lines[idx]->allocate( m_config.tag(addr), m_config.block_addr(addr), time, mask );
else if (status==SECTOR_MISS) {
assert(m_config.m_cache_type == SECTOR);
- ((sector_cache_block*)m_lines[idx])->allocate_sector( time, mf->get_access_sector_mask() );
+ ((sector_cache_block*)m_lines[idx])->allocate_sector( time, mask );
}
- m_lines[idx]->fill(time, mf->get_access_sector_mask());
+ m_lines[idx]->fill(time, mask);
}
void tag_array::fill( unsigned index, unsigned time, mem_fetch* mf)