mem: Add a page_bytes parameter to the classic prefetcher.

This parameter is used to figure out if two addresses are on the same or
different pages, and could be used to find what page they were on and
the page offset, although it doesn't look like the later two are
actually used.

This value could possibly come from the TLB parameter attached to the
prefetcher, but making it explicit makes these more symmetric with the
Ruby prefetcher, and reduces the complexity of the TLB implementation.

Change-Id: I6921943c49af19971b84225ecfd1127304363426
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/50352
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
This commit is contained in:
Gabe Black
2021-09-14 18:21:00 -07:00
parent 13725927a0
commit d6974ef636
2 changed files with 3 additions and 1 deletions

View File

@@ -81,6 +81,8 @@ class BasePrefetcher(ClockedObject):
"Notify the hardware prefetcher on hit on prefetched lines")
use_virtual_addresses = Param.Bool(False,
"Use virtual addresses for prefetching")
page_bytes = Param.MemorySize('4KiB',
"Size of pages for virtual addresses")
def __init__(self, **kwargs):
super(BasePrefetcher, self).__init__(**kwargs)

View File

@@ -98,7 +98,7 @@ Base::Base(const BasePrefetcherParams &p)
lBlkSize(floorLog2(blkSize)), onMiss(p.on_miss), onRead(p.on_read),
onWrite(p.on_write), onData(p.on_data), onInst(p.on_inst),
requestorId(p.sys->getRequestorId(this)),
pageBytes(p.sys->getPageBytes()),
pageBytes(p.page_bytes),
prefetchOnAccess(p.prefetch_on_access),
prefetchOnPfHit(p.prefetch_on_pf_hit),
useVirtualAddresses(p.use_virtual_addresses),