diff options
| author | Tim Rogers <[email protected]> | 2013-02-09 08:00:44 -0800 |
|---|---|---|
| committer | Andrew Boktor <[email protected]> | 2014-08-14 13:50:04 -0700 |
| commit | e8b9773363a5543374d0951877f345fc4e7f917c (patch) | |
| tree | 6c73f403aa8d0cff28cd9610559a1db4c3d726ff /src/gpgpu-sim/gpu-cache.cc | |
| parent | 335cfe1bf2af2626d9c09847b194122d5d0b0399 (diff) | |
Addin in a protected constructor that can be used by derived classes of the tag_array so they can allocate their own type of lines
[git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 15214]
Diffstat (limited to 'src/gpgpu-sim/gpu-cache.cc')
| -rw-r--r-- | src/gpgpu-sim/gpu-cache.cc | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/src/gpgpu-sim/gpu-cache.cc b/src/gpgpu-sim/gpu-cache.cc index a09c92e..0b91727 100644 --- a/src/gpgpu-sim/gpu-cache.cc +++ b/src/gpgpu-sim/gpu-cache.cc @@ -50,12 +50,31 @@ tag_array::~tag_array() delete m_lines; } -tag_array::tag_array( const cache_config &config, int core_id, int type_id ) -: m_config(config), m_access(0), m_miss(0), m_pending_hit(0) +tag_array::tag_array( const cache_config &config, + int core_id, + int type_id, + cache_block_t* new_lines) + : m_config( config ), + m_lines( new_lines ) +{ + init( core_id, type_id ); +} + +tag_array::tag_array( const cache_config &config, + int core_id, + int type_id ) + : m_config( config ) { //assert( m_config.m_write_policy == READ_ONLY ); Old assert m_lines = new cache_block_t[ config.get_num_lines()]; + init( core_id, type_id ); +} +void tag_array::init( int core_id, int type_id ) +{ + m_access = 0; + m_miss = 0; + m_pending_hit = 0; // initialize snapshot counters for visualizer m_prev_snapshot_access = 0; m_prev_snapshot_miss = 0; |
