diff options
author | Rekai Gonzalez Alberquilla <Rekai.GonzalezAlberquilla@arm.com> | 2016-04-07 11:32:38 -0500 |
---|---|---|
committer | Rekai Gonzalez Alberquilla <Rekai.GonzalezAlberquilla@arm.com> | 2016-04-07 11:32:38 -0500 |
commit | dad7d9277b571305ee248cd761a7dbb9400b3681 (patch) | |
tree | 4d4127f796ca0b12b04e113b1a841e7055d48bf1 /src/mem/cache/prefetch/base.hh | |
parent | df5a81183303fa941d71e866ff8d258e4d6a510e (diff) | |
download | gem5-dad7d9277b571305ee248cd761a7dbb9400b3681.tar.xz |
mem: Handful extra features for BasePrefetcher
Some common functionality added to the base prefetcher, mainly dealing with
extracting the block address, page address, block index inside the page and
some other information that can be inferred from the block address. This is
used for some prefetching algorithms, and having the methods in the base,
as well as the block size and other information is the sensible way.
Diffstat (limited to 'src/mem/cache/prefetch/base.hh')
-rw-r--r-- | src/mem/cache/prefetch/base.hh | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/mem/cache/prefetch/base.hh b/src/mem/cache/prefetch/base.hh index dd768e0b4..683c59f1f 100644 --- a/src/mem/cache/prefetch/base.hh +++ b/src/mem/cache/prefetch/base.hh @@ -68,6 +68,9 @@ class BasePrefetcher : public ClockedObject /** The block size of the parent cache. */ unsigned blkSize; + /** log_2(block size of the parent cache). */ + unsigned lBlkSize; + /** System we belong to */ System* system; @@ -102,6 +105,17 @@ class BasePrefetcher : public ClockedObject /** Determine if addresses are on the same page */ bool samePage(Addr a, Addr b) const; + /** Determine the address of the block in which a lays */ + Addr blockAddress(Addr a) const; + /** Determine the address of a at block granularity */ + Addr blockIndex(Addr a) const; + /** Determine the address of the page in which a lays */ + Addr pageAddress(Addr a) const; + /** Determine the page-offset of a */ + Addr pageOffset(Addr a) const; + /** Build the address of the i-th block inside the page */ + Addr pageIthBlockAddress(Addr page, uint32_t i) const; + Stats::Scalar pfIssued; |