Discussion:
[gem5-dev] Change in gem5/gem5[master]: mem-cache: Add compression bit to CacheBlk
(too old to reply)
Daniel Carvalho (Gerrit)
2018-06-13 12:37:13 UTC
Permalink
Daniel Carvalho has uploaded this change for review. (
https://gem5-review.googlesource.com/11102


Change subject: mem-cache: Add compression bit to CacheBlk
......................................................................

mem-cache: Add compression bit to CacheBlk

Add a compression bit to inform whether a block is compressed or not.

Change-Id: Ia9d8656552d60e8d4e85fe5379dd75fc5adb0abe
---
M src/mem/cache/blk.cc
M src/mem/cache/blk.hh
M src/mem/cache/sector_blk.cc
M src/mem/cache/sector_blk.hh
M src/mem/cache/superblock_blk.cc
M src/mem/cache/superblock_blk.hh
M src/mem/cache/tags/base_set_assoc.hh
M src/mem/cache/tags/compressed_tags.cc
M src/mem/cache/tags/fa_lru.cc
M src/mem/cache/tags/sector_tags.cc
10 files changed, 43 insertions(+), 17 deletions(-)



diff --git a/src/mem/cache/blk.cc b/src/mem/cache/blk.cc
index 45bd9bf..e68fe01 100644
--- a/src/mem/cache/blk.cc
+++ b/src/mem/cache/blk.cc
@@ -44,6 +44,7 @@

void
CacheBlk::insert(const Addr tag, const bool is_secure,
+ const bool is_compressed,
const int src_master_ID, const uint32_t task_ID)
{
// Set block tag
@@ -67,16 +68,22 @@
} else {
status = 0;
}
+
+ // Set compression bit
+ if (is_compressed) {
+ status |= BlkCompressed;
+ }
}

void
CacheBlkPrintWrapper::print(std::ostream &os, int verbosity,
const std::string &prefix) const
{
- ccprintf(os, "%sblk %c%c%c%c\n", prefix,
- blk->isValid() ? 'V' : '-',
- blk->isWritable() ? 'E' : '-',
- blk->isDirty() ? 'M' : '-',
- blk->isSecure() ? 'S' : '-');
+ ccprintf(os, "%sblk %c%c%c%c%c\n", prefix,
+ blk->isValid() ? 'V' : '-',
+ blk->isWritable() ? 'E' : '-',
+ blk->isDirty() ? 'M' : '-',
+ blk->isSecure() ? 'S' : '-',
+ blk->isCompressed() ? 'C' : '-');
}

diff --git a/src/mem/cache/blk.hh b/src/mem/cache/blk.hh
index 48deef5..cdc3974 100644
--- a/src/mem/cache/blk.hh
+++ b/src/mem/cache/blk.hh
@@ -76,6 +76,8 @@
BlkHWPrefetched = 0x20,
/** block holds data from the secure memory space */
BlkSecure = 0x40,
+ /** block holds compressed data */
+ BlkCompressed = 0x80
};

/**
@@ -250,6 +252,16 @@
}

/**
+ * Check if this block holds compressed data.
+ *
+ * @return True if the block holds compressed data.
+ */
+ bool isCompressed() const
+ {
+ return (status & BlkCompressed) != 0;
+ }
+
+ /**
* Set member variables when a block insertion occurs. Resets reference
* count to 1 (the insertion counts as a reference), and touch block if
* it hadn't been touched previously. Sets the insertion tick to the
@@ -257,10 +269,12 @@
*
* @param tag Block address tag.
* @param is_secure Whether the block is in secure space or not.
+ * @param is_compressed Whether the data has been compressed or not.
* @param src_master_ID The source requestor ID.
* @param task_ID The new task ID.
*/
virtual void insert(const Addr tag, const bool is_secure,
+ const bool is_compressed,
const int src_master_ID, const uint32_t task_ID);

/**
diff --git a/src/mem/cache/sector_blk.cc b/src/mem/cache/sector_blk.cc
index 07d9e95..5881008 100644
--- a/src/mem/cache/sector_blk.cc
+++ b/src/mem/cache/sector_blk.cc
@@ -72,6 +72,7 @@

void
SectorSubBlk::insert(const Addr tag, const bool is_secure,
+ const bool is_compressed,
const int src_master_ID, const uint32_t task_ID)
{
// Make sure it is not overwriting another sector
@@ -80,7 +81,7 @@
(_sectorBlk->isSecure() != is_secure)),
"Overwriting valid sector!");

- CacheBlk::insert(tag, is_secure, src_master_ID, task_ID);
+ CacheBlk::insert(tag, is_secure, is_compressed, src_master_ID,
task_ID);

// Set sector tag
_sectorBlk->setTag(tag);
diff --git a/src/mem/cache/sector_blk.hh b/src/mem/cache/sector_blk.hh
index f8f8cd5..a564563 100644
--- a/src/mem/cache/sector_blk.hh
+++ b/src/mem/cache/sector_blk.hh
@@ -109,11 +109,12 @@
*
* @param tag Block address tag.
* @param is_secure Whether the block is in secure space or not.
+ * @param is_compressed Whether the data has been compressed or not.
* @param src_master_ID The source requestor ID.
* @param task_ID The new task ID.
*/
- void insert(const Addr tag, const bool is_secure, const int
src_master_ID,
- const uint32_t task_ID) override;
+ void insert(const Addr tag, const bool is_secure, const bool
is_compressed,
+ const int src_master_ID, const uint32_t task_ID) override;
};

/**
diff --git a/src/mem/cache/superblock_blk.cc
b/src/mem/cache/superblock_blk.cc
index 87fb455..c2724c5 100644
--- a/src/mem/cache/superblock_blk.cc
+++ b/src/mem/cache/superblock_blk.cc
@@ -93,6 +93,7 @@

void
CompressionBlk::insert(const Addr tag, const bool is_secure,
+ const bool is_compressed,
const int src_master_ID, const uint32_t task_ID,
std::unique_ptr<CompressionData>& compression_data)
{
@@ -102,7 +103,7 @@
(_superblock->isSecure() != is_secure)),
"Overwriting valid superblock!");

- CacheBlk::insert(tag, is_secure, src_master_ID, task_ID);
+ CacheBlk::insert(tag, is_secure, is_compressed, src_master_ID,
task_ID);

// Set superblock tag
_superblock->setTag(tag);
diff --git a/src/mem/cache/superblock_blk.hh
b/src/mem/cache/superblock_blk.hh
index 85160c0..dc1d048 100644
--- a/src/mem/cache/superblock_blk.hh
+++ b/src/mem/cache/superblock_blk.hh
@@ -131,12 +131,13 @@
*
* @param tag Block address tag.
* @param is_secure Whether the block is in secure space or not.
+ * @param is_compressed Whether the data has been compressed or not.
* @param src_master_ID The source requestor ID.
* @param task_ID The new task ID.
* @param compression_data The compression data.
*/
- void insert(const Addr tag, const bool is_secure, const int
src_master_ID,
- const uint32_t task_ID,
+ void insert(const Addr tag, const bool is_secure, const bool
is_compressed,
+ const int src_master_ID, const uint32_t task_ID,
std::unique_ptr<CompressionData>& compression_data);
};

diff --git a/src/mem/cache/tags/base_set_assoc.hh
b/src/mem/cache/tags/base_set_assoc.hh
index c6f9e18..74611e1 100644
--- a/src/mem/cache/tags/base_set_assoc.hh
+++ b/src/mem/cache/tags/base_set_assoc.hh
@@ -258,7 +258,7 @@
BaseTags::insertBlock(pkt, blk);

// Insert block with tag, src master id and task id
- blk->insert(extractTag(pkt->getAddr()), pkt->isSecure(),
+ blk->insert(extractTag(pkt->getAddr()), pkt->isSecure(), false,
pkt->req->masterId(), pkt->req->taskId());

// Increment tag counter
diff --git a/src/mem/cache/tags/compressed_tags.cc
b/src/mem/cache/tags/compressed_tags.cc
index 05db826..8ba850d 100644
--- a/src/mem/cache/tags/compressed_tags.cc
+++ b/src/mem/cache/tags/compressed_tags.cc
@@ -218,7 +218,7 @@
// stored uncompressed, even if a compressor is used, the
compression
// and decompression methods are called to calculate the amount of
// cycles used.
- if (blk->isValid()){
+ if (blk->isCompressed()){
lat += compressor->decompress(
compression_blk->getCompressionData());
}
@@ -316,7 +316,7 @@
if (evictSuperblock) {
for (const auto& blk : victim_superblock->blks){
// Decompress block to calculate victim search latency
- if (blk->isValid()) {
+ if (blk->isCompressed()) {
lat += compressor->decompress(blk->getCompressionData());
}

@@ -350,8 +350,9 @@
CompressionBlk* compression_blk = static_cast<CompressionBlk*>(blk);
const SuperblockBlk* superblock = compression_blk->getSuperblock();

- // Set block's metadata
+ // Set block's metadata. We always store compress blocks when possible
compression_blk->insert(extractTag(pkt->getAddr()), pkt->isSecure(),
+ canCoAllocate(superblock,
compression_data.get()),
pkt->req->masterId(), pkt->req->taskId(),
compression_data);

diff --git a/src/mem/cache/tags/fa_lru.cc b/src/mem/cache/tags/fa_lru.cc
index 85a5b5b..2b0dfc4 100644
--- a/src/mem/cache/tags/fa_lru.cc
+++ b/src/mem/cache/tags/fa_lru.cc
@@ -222,7 +222,7 @@
BaseTags::insertBlock(pkt, blk);

// Insert block with tag, src master id and task id
- blk->insert(extractTag(pkt->getAddr()), pkt->isSecure(),
+ blk->insert(extractTag(pkt->getAddr()), pkt->isSecure(), false,
pkt->req->masterId(), pkt->req->taskId());

// Increment tag counter
diff --git a/src/mem/cache/tags/sector_tags.cc
b/src/mem/cache/tags/sector_tags.cc
index 0a33d27..361afcd 100644
--- a/src/mem/cache/tags/sector_tags.cc
+++ b/src/mem/cache/tags/sector_tags.cc
@@ -204,7 +204,7 @@
const SectorBlk* sector_blk = sub_blk->getSectorBlock();

// Insert block with tag, src master id and task id
- sub_blk->insert(extractTag(pkt->getAddr()), pkt->isSecure(),
+ sub_blk->insert(extractTag(pkt->getAddr()), pkt->isSecure(), false,
pkt->req->masterId(), pkt->req->taskId());

// When a block is inserted, the tag is only a newly used tag if the
--
To view, visit https://gem5-review.googlesource.com/11102
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: Ia9d8656552d60e8d4e85fe5379dd75fc5adb0abe
Gerrit-Change-Number: 11102
Gerrit-PatchSet: 1
Gerrit-Owner: Daniel Carvalho <***@yahoo.com.br>
Gerrit-MessageType: newchange
Daniel Carvalho (Gerrit)
2018-06-15 15:23:33 UTC
Permalink
Hello Jason Lowe-Power, Nikos Nikoleris,

I'd like you to reexamine a change. Please visit

https://gem5-review.googlesource.com/11102

to look at the new patch set (#3).

Change subject: mem-cache: Add compression bit to CacheBlk
......................................................................

mem-cache: Add compression bit to CacheBlk

Add a compression bit to inform whether a block is compressed or not.

Change-Id: Ia9d8656552d60e8d4e85fe5379dd75fc5adb0abe
---
M src/mem/cache/blk.cc
M src/mem/cache/blk.hh
M src/mem/cache/sector_blk.cc
M src/mem/cache/sector_blk.hh
M src/mem/cache/superblock_blk.cc
M src/mem/cache/superblock_blk.hh
M src/mem/cache/tags/base_set_assoc.hh
M src/mem/cache/tags/compressed_tags.cc
M src/mem/cache/tags/fa_lru.cc
M src/mem/cache/tags/sector_tags.cc
10 files changed, 47 insertions(+), 19 deletions(-)
--
To view, visit https://gem5-review.googlesource.com/11102
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: Ia9d8656552d60e8d4e85fe5379dd75fc5adb0abe
Gerrit-Change-Number: 11102
Gerrit-PatchSet: 3
Gerrit-Owner: Daniel Carvalho <***@yahoo.com.br>
Gerrit-Reviewer: Daniel Carvalho <***@yahoo.com.br>
Gerrit-Reviewer: Jason Lowe-Power <***@lowepower.com>
Gerrit-Reviewer: Nikos Nikoleris <***@arm.com>
Gerrit-MessageType: newpatchset
Daniel Carvalho (Gerrit)
2018-06-19 16:11:12 UTC
Permalink
Hello Jason Lowe-Power, Nikos Nikoleris,

I'd like you to reexamine a change. Please visit

https://gem5-review.googlesource.com/11102

to look at the new patch set (#4).

Change subject: mem-cache: Add compression bit to CacheBlk
......................................................................

mem-cache: Add compression bit to CacheBlk

Add a compression bit to inform whether a block is compressed or not.

Change-Id: Ia9d8656552d60e8d4e85fe5379dd75fc5adb0abe
---
M src/mem/cache/blk.cc
M src/mem/cache/blk.hh
M src/mem/cache/sector_blk.cc
M src/mem/cache/sector_blk.hh
M src/mem/cache/superblock_blk.cc
M src/mem/cache/superblock_blk.hh
M src/mem/cache/tags/base_set_assoc.hh
M src/mem/cache/tags/compressed_tags.cc
M src/mem/cache/tags/fa_lru.cc
M src/mem/cache/tags/sector_tags.cc
10 files changed, 45 insertions(+), 17 deletions(-)
--
To view, visit https://gem5-review.googlesource.com/11102
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: Ia9d8656552d60e8d4e85fe5379dd75fc5adb0abe
Gerrit-Change-Number: 11102
Gerrit-PatchSet: 4
Gerrit-Owner: Daniel Carvalho <***@yahoo.com.br>
Gerrit-Reviewer: Daniel Carvalho <***@yahoo.com.br>
Gerrit-Reviewer: Jason Lowe-Power <***@lowepower.com>
Gerrit-Reviewer: Nikos Nikoleris <***@arm.com>
Gerrit-MessageType: newpatchset
Daniel Carvalho (Gerrit)
2018-06-22 13:53:37 UTC
Permalink
Hello Jason Lowe-Power, Nikos Nikoleris,

I'd like you to reexamine a change. Please visit

https://gem5-review.googlesource.com/11102

to look at the new patch set (#5).

Change subject: mem-cache: Add compression bit to CacheBlk
......................................................................

mem-cache: Add compression bit to CacheBlk

Add a compression bit to inform whether a block is compressed or not.

Change-Id: Ia9d8656552d60e8d4e85fe5379dd75fc5adb0abe
---
M src/mem/cache/blk.cc
M src/mem/cache/blk.hh
M src/mem/cache/sector_blk.cc
M src/mem/cache/sector_blk.hh
M src/mem/cache/superblock_blk.cc
M src/mem/cache/superblock_blk.hh
M src/mem/cache/tags/base_set_assoc.hh
M src/mem/cache/tags/fa_lru.cc
M src/mem/cache/tags/sector_tags.cc
9 files changed, 41 insertions(+), 14 deletions(-)
--
To view, visit https://gem5-review.googlesource.com/11102
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: Ia9d8656552d60e8d4e85fe5379dd75fc5adb0abe
Gerrit-Change-Number: 11102
Gerrit-PatchSet: 5
Gerrit-Owner: Daniel Carvalho <***@yahoo.com.br>
Gerrit-Reviewer: Daniel Carvalho <***@yahoo.com.br>
Gerrit-Reviewer: Jason Lowe-Power <***@lowepower.com>
Gerrit-Reviewer: Nikos Nikoleris <***@arm.com>
Gerrit-MessageType: newpatchset
Daniel Carvalho (Gerrit)
2018-06-28 09:30:17 UTC
Permalink
Hello Jason Lowe-Power, Nikos Nikoleris,

I'd like you to reexamine a change. Please visit

https://gem5-review.googlesource.com/11102

to look at the new patch set (#6).

Change subject: mem-cache: Add compression bit to CacheBlk
......................................................................

mem-cache: Add compression bit to CacheBlk

Add a compression bit to inform whether a block is compressed or not.

Change-Id: Ia9d8656552d60e8d4e85fe5379dd75fc5adb0abe
---
M src/mem/cache/blk.cc
M src/mem/cache/blk.hh
M src/mem/cache/sector_blk.cc
M src/mem/cache/sector_blk.hh
M src/mem/cache/superblock_blk.cc
M src/mem/cache/superblock_blk.hh
M src/mem/cache/tags/base_set_assoc.hh
M src/mem/cache/tags/fa_lru.cc
M src/mem/cache/tags/sector_tags.cc
9 files changed, 43 insertions(+), 15 deletions(-)
--
To view, visit https://gem5-review.googlesource.com/11102
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: Ia9d8656552d60e8d4e85fe5379dd75fc5adb0abe
Gerrit-Change-Number: 11102
Gerrit-PatchSet: 6
Gerrit-Owner: Daniel Carvalho <***@yahoo.com.br>
Gerrit-Reviewer: Daniel Carvalho <***@yahoo.com.br>
Gerrit-Reviewer: Jason Lowe-Power <***@lowepower.com>
Gerrit-Reviewer: Nikos Nikoleris <***@arm.com>
Gerrit-MessageType: newpatchset
Daniel Carvalho (Gerrit)
2018-08-16 09:38:13 UTC
Permalink
Hello Jason Lowe-Power, Nikos Nikoleris,

I'd like you to reexamine a change. Please visit

https://gem5-review.googlesource.com/c/public/gem5/+/11102

to look at the new patch set (#7).

Change subject: mem-cache: Add compression data to CompressionBlk
......................................................................

mem-cache: Add compression data to CompressionBlk

Add a compression bit, decompression latency and compressed
block size and their respective getters and setters.

Change-Id: Ia9d8656552d60e8d4e85fe5379dd75fc5adb0abe
---
M src/mem/cache/blk.hh
M src/mem/cache/superblock_blk.cc
M src/mem/cache/superblock_blk.hh
3 files changed, 149 insertions(+), 1 deletion(-)
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/11102
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: Ia9d8656552d60e8d4e85fe5379dd75fc5adb0abe
Gerrit-Change-Number: 11102
Gerrit-PatchSet: 7
Gerrit-Owner: Daniel Carvalho <***@yahoo.com.br>
Gerrit-Reviewer: Daniel Carvalho <***@yahoo.com.br>
Gerrit-Reviewer: Jason Lowe-Power <***@lowepower.com>
Gerrit-Reviewer: Nikos Nikoleris <***@arm.com>
Gerrit-MessageType: newpatchset
Daniel Carvalho (Gerrit)
2018-10-04 16:20:10 UTC
Permalink
Hello Jason Lowe-Power, Nikos Nikoleris,

I'd like you to reexamine a change. Please visit

https://gem5-review.googlesource.com/c/public/gem5/+/11102

to look at the new patch set (#8).

Change subject: mem-cache: Add compression data to CompressionBlk
......................................................................

mem-cache: Add compression data to CompressionBlk

Add a compression bit, decompression latency and compressed
block size and their respective getters and setters.

Change-Id: Ia9d8656552d60e8d4e85fe5379dd75fc5adb0abe
---
M src/mem/cache/blk.hh
M src/mem/cache/superblock_blk.cc
M src/mem/cache/superblock_blk.hh
3 files changed, 118 insertions(+), 1 deletion(-)
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/11102
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: Ia9d8656552d60e8d4e85fe5379dd75fc5adb0abe
Gerrit-Change-Number: 11102
Gerrit-PatchSet: 8
Gerrit-Owner: Daniel Carvalho <***@yahoo.com.br>
Gerrit-Reviewer: Daniel Carvalho <***@yahoo.com.br>
Gerrit-Reviewer: Jason Lowe-Power <***@lowepower.com>
Gerrit-Reviewer: Nikos Nikoleris <***@arm.com>
Gerrit-MessageType: newpatchset
Daniel Carvalho (Gerrit)
2018-10-12 09:36:05 UTC
Permalink
Hello Jason Lowe-Power, Nikos Nikoleris,

I'd like you to reexamine a change. Please visit

https://gem5-review.googlesource.com/c/public/gem5/+/11102

to look at the new patch set (#9).

Change subject: mem-cache: Add compression data to CompressionBlk
......................................................................

mem-cache: Add compression data to CompressionBlk

Add a compression bit, decompression latency and compressed
block size and their respective getters and setters.

Change-Id: Ia9d8656552d60e8d4e85fe5379dd75fc5adb0abe
---
M src/mem/cache/cache_blk.hh
M src/mem/cache/tags/super_blk.cc
M src/mem/cache/tags/super_blk.hh
3 files changed, 133 insertions(+), 1 deletion(-)
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/11102
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: Ia9d8656552d60e8d4e85fe5379dd75fc5adb0abe
Gerrit-Change-Number: 11102
Gerrit-PatchSet: 9
Gerrit-Owner: Daniel Carvalho <***@yahoo.com.br>
Gerrit-Reviewer: Daniel Carvalho <***@yahoo.com.br>
Gerrit-Reviewer: Jason Lowe-Power <***@lowepower.com>
Gerrit-Reviewer: Nikos Nikoleris <***@arm.com>
Gerrit-MessageType: newpatchset
Daniel Carvalho (Gerrit)
2018-10-23 12:27:54 UTC
Permalink
Hello Jason Lowe-Power, Nikos Nikoleris,

I'd like you to reexamine a change. Please visit

https://gem5-review.googlesource.com/c/public/gem5/+/11102

to look at the new patch set (#10).

Change subject: mem-cache: Add compression data to CompressionBlk
......................................................................

mem-cache: Add compression data to CompressionBlk

Add a compression bit, decompression latency and compressed
block size and their respective getters and setters.

Change-Id: Ia9d8656552d60e8d4e85fe5379dd75fc5adb0abe
---
M src/mem/cache/cache_blk.hh
M src/mem/cache/tags/super_blk.cc
M src/mem/cache/tags/super_blk.hh
3 files changed, 138 insertions(+), 1 deletion(-)
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/11102
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: Ia9d8656552d60e8d4e85fe5379dd75fc5adb0abe
Gerrit-Change-Number: 11102
Gerrit-PatchSet: 10
Gerrit-Owner: Daniel Carvalho <***@yahoo.com.br>
Gerrit-Reviewer: Daniel Carvalho <***@yahoo.com.br>
Gerrit-Reviewer: Jason Lowe-Power <***@lowepower.com>
Gerrit-Reviewer: Nikos Nikoleris <***@arm.com>
Gerrit-MessageType: newpatchset
Continue reading on narkive:
Loading...