添加cache
首先给出系统架构图
gem5中有两种子系统来模拟cache,一种是Ruby, 用来详细描述cache coherence protocol, 一种使用classic cache, 使用MOESI, 不关注cache coherence protocol。
cache SimObject 继承自 BaseCache 对象, 在src/mem/cache/Cache.py中,许多参数没有默认值,在实例化( m5.instantiate( ) )之前,我们要设置这些参数。
L1cache 与 L2cache 相连时,由于只希望有一个连接端口,而L1cache covers L1_ icache and L1_dcache, 因此我们需要创建一个L2 bus, i.e. system.l2bus = L2XBar()
向脚本中添加参数
由于python版本较老,许多脚本中使用optpaese, 可以考虑采用新版中augparse函数。