summaryrefslogtreecommitdiff
path: root/src/mem/cache
diff options
context:
space:
mode:
authorSteve Reinhardt <Steve.Reinhardt@amd.com>2008-11-14 14:14:35 -0800
committerSteve Reinhardt <Steve.Reinhardt@amd.com>2008-11-14 14:14:35 -0800
commit640b415688f8942ee61ac26f8bbc538596df00a4 (patch)
treece6b1b25ee9c131e6687966984ce6dd36ea126d9 /src/mem/cache
parent5711282f87afb609c79d657ed6aa8c9259b5b827 (diff)
downloadgem5-640b415688f8942ee61ac26f8bbc538596df00a4.tar.xz
Cache: get rid of obsolete Tag methods.
I think readData() and writeData() were used for Erik's compression work, but that code is gone, these aren't called anymore, and they don't even really do what their names imply.
Diffstat (limited to 'src/mem/cache')
-rw-r--r--src/mem/cache/tags/fa_lru.hh25
-rw-r--r--src/mem/cache/tags/iic.cc60
-rw-r--r--src/mem/cache/tags/iic.hh20
-rw-r--r--src/mem/cache/tags/lru.hh27
4 files changed, 1 insertions, 131 deletions
diff --git a/src/mem/cache/tags/fa_lru.hh b/src/mem/cache/tags/fa_lru.hh
index a740d962f..7925e1870 100644
--- a/src/mem/cache/tags/fa_lru.hh
+++ b/src/mem/cache/tags/fa_lru.hh
@@ -279,31 +279,6 @@ public:
{
return (tag);
}
-
- /**
- * Read the data out of the internal storage of a cache block. FALRU
- * currently doesn't support data storage.
- * @param blk The cache block to read.
- * @param data The buffer to read the data into.
- * @return The data from the cache block.
- */
- void readData(FALRUBlk *blk, uint8_t *data)
- {
- }
-
- /**
- * Write data into the internal storage of a cache block. FALRU
- * currently doesn't support data storage.
- * @param blk The cache block to be written.
- * @param data The data to write.
- * @param size The number of bytes to write.
- * @param writebacks A list for any writebacks to be performed. May be
- * needed when writing to a compressed block.
- */
- void writeData(FALRUBlk *blk, uint8_t *data, int size,
- PacketList &writebacks)
- {
- }
};
#endif
diff --git a/src/mem/cache/tags/iic.cc b/src/mem/cache/tags/iic.cc
index 2b34634ab..7bc2543c5 100644
--- a/src/mem/cache/tags/iic.cc
+++ b/src/mem/cache/tags/iic.cc
@@ -634,66 +634,6 @@ IIC::invalidateBlk(IIC::BlkType *tag_ptr)
}
void
-IIC::readData(IICTag *blk, uint8_t *data)
-{
- assert(blk->size <= trivialSize || blk->numData > 0);
- int data_size = blk->size;
- if (data_size > trivialSize) {
- for (int i = 0; i < blk->numData; ++i){
- memcpy(data+i*subSize,
- &(dataBlks[blk->data_ptr[i]][0]),
- (data_size>subSize)?subSize:data_size);
- data_size -= subSize;
- }
- } else {
- memcpy(data,blk->trivialData,data_size);
- }
-}
-
-void
-IIC::writeData(IICTag *blk, uint8_t *write_data, int size,
- PacketList & writebacks)
-{
- DPRINTF(IIC, "Writing %d bytes to %x\n", size,
- blk->tag<<tagShift);
- // Find the number of subblocks needed, (round up)
- int num_subs = (size + (subSize -1))/subSize;
- if (size <= trivialSize) {
- num_subs = 0;
- }
- assert(num_subs <= numSub);
- if (num_subs > blk->numData) {
- // need to allocate more data blocks
- for (int i = blk->numData; i < num_subs; ++i){
- blk->data_ptr[i] = getFreeDataBlock(writebacks);
- dataReferenceCount[blk->data_ptr[i]] += 1;
- }
- } else if (num_subs < blk->numData){
- // can free data blocks
- for (int i=num_subs; i < blk->numData; ++i){
- // decrement reference count and compare to zero
- if (--dataReferenceCount[blk->data_ptr[i]] == 0) {
- freeDataBlock(blk->data_ptr[i]);
- }
- }
- }
-
- blk->numData = num_subs;
- blk->size = size;
- assert(size <= trivialSize || blk->numData > 0);
- if (size > trivialSize){
- for (int i = 0; i < blk->numData; ++i){
- memcpy(&dataBlks[blk->data_ptr[i]][0], write_data + i*subSize,
- (size>subSize)?subSize:size);
- size -= subSize;
- }
- } else {
- memcpy(blk->trivialData,write_data,size);
- }
-}
-
-
-void
IIC::cleanupRefs()
{
for (int i = 0; i < numTags; ++i) {
diff --git a/src/mem/cache/tags/iic.hh b/src/mem/cache/tags/iic.hh
index 984506a93..9e14dc119 100644
--- a/src/mem/cache/tags/iic.hh
+++ b/src/mem/cache/tags/iic.hh
@@ -440,28 +440,10 @@ class IIC : public BaseTags
void insertBlock(Addr addr, BlkType *blk);
/**
- * Read the data from the internal storage of the given cache block.
- * @param blk The block to read the data from.
- * @param data The buffer to read the data into.
- * @return The cache block's data.
- */
- void readData(IICTag *blk, uint8_t *data);
-
- /**
- * Write the data into the internal storage of the given cache block.
- * @param blk The block to write to.
- * @param data The data to write.
- * @param size The number of bytes to write.
- * @param writebacks A list for any writebacks to be performed. May be
- * needed when writing to a compressed block.
- */
- void writeData(IICTag *blk, uint8_t *data, int size,
- PacketList & writebacks);
-
- /**
* Called at end of simulation to complete average block reference stats.
*/
virtual void cleanupRefs();
+
private:
/**
* Return the hash of the address.
diff --git a/src/mem/cache/tags/lru.hh b/src/mem/cache/tags/lru.hh
index 79af973a0..7b6e95e84 100644
--- a/src/mem/cache/tags/lru.hh
+++ b/src/mem/cache/tags/lru.hh
@@ -256,33 +256,6 @@ public:
}
/**
- * Read the data out of the internal storage of the given cache block.
- * @param blk The cache block to read.
- * @param data The buffer to read the data into.
- * @return The cache block's data.
- */
- void readData(LRUBlk *blk, uint8_t *data)
- {
- std::memcpy(data, blk->data, blk->size);
- }
-
- /**
- * Write data into the internal storage of the given cache block. Since in
- * LRU does not store data differently this just needs to update the size.
- * @param blk The cache block to write.
- * @param data The data to write.
- * @param size The number of bytes to write.
- * @param writebacks A list for any writebacks to be performed. May be
- * needed when writing to a compressed block.
- */
- void writeData(LRUBlk *blk, uint8_t *data, int size,
- PacketList & writebacks)
- {
- assert(size <= blkSize);
- blk->size = size;
- }
-
- /**
* Called at end of simulation to complete average block reference stats.
*/
virtual void cleanupRefs();