1. 不同版本的gem5开启prefetch的方法可能不同,较新的版本需要在gem5/configs/common/Caches.py的class L2Cache(BaseCache)或者class L1Cache(BaseCache)添加相应的prefetcher
class L2Cache(BaseCache):
assoc = 8
block_size = 64
hit_latency = 20
response_latency = 20
mshrs = 20
tgts_per_mshr = 12
write_buffers = 8
#adding the following line
#prefetcher = StridePrefetcher(degree=8, latency=1.0)
之前的gem5版本添加prefetch时,需要在gem5/configs/common/Caches.py的class L2Cache(BaseCache)或者class L1Cache(BaseCache)添加相应的prefetch_policy
class L2Cache(BaseCache):
assoc = 8
block_size = 64
latency = '5ns'
mshrs = 20
tgts_per_mshr = 12
prefetch_policy='tagged'
2. statble_2013_06_16的TaggedPrefetcher有bug
class L2Cache(BaseCache):
assoc = 8
block_size = 64
hit_latency = 20
response_latency = 20
mshrs = 20
tgts_per_mshr = 12
write_buffers = 8
#adding the following line
#prefetcher = StridePrefetcher(degree=8, latency=1.0)
之前的gem5版本添加prefetch时,需要在gem5/configs/common/Caches.py的class L2Cache(BaseCache)或者class L1Cache(BaseCache)添加相应的prefetch_policy
class L2Cache(BaseCache):
assoc = 8
block_size = 64
latency = '5ns'
mshrs = 20
tgts_per_mshr = 12
prefetch_policy='tagged'
2. statble_2013_06_16的TaggedPrefetcher有bug
3. 添加预取时,要采用--cpu-type=timing或者--cpu-type=detailed,默认的atomic方式,其预取数据均为0
4. 如何添加自己的prefetcher(以PDFCMPrefetcher为例)
a)在gem5/src/mem/cache/prefetch/Prefetcher.py中添加
class PDFCMPrefetcher(BasePrefetcher):
type = 'PDFCMPrefetcher'
cxx_class = 'PDFCMPrefetcher'
cxx_header = "mem/cache/prefetch/pdfcm.hh"
b)添加相应的gem5/src/mem/cache/prefetch/pdfcm.hh文件和pdfcm.cc文件
c)重新编译