Sniper中cache实现

本文详细介绍了Sniper模拟器中Cache的相关文件及其功能。从gainestown.cfg和nehalem.cfg配置文件到内存子系统的实现,包括CacheCntlr、Cache、CacheBase、CacheSet、CacheBlockInfo和LRU替换算法的详细解析。文章通过实例展示了不同组件之间的关系,如32KB、8-way set-associative、64B blocks的Cache结构。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Sniper中cache相关的文件

  • config文件夹
    • gainestown.cfg包含L3 cache的配置情况。嵌套包含了nehalem.cfg文件
    • nehalem.cfg包含L2 cache和L1 cache的配置情况。
    • sniper默认参数为gainestown.cfg文件
    ############  nehalem.cfg
    [perf_model/l1_icache]
    perfect = false
    cache_size = 32
    associativity = 4
    address_hash = mask
    replacement_policy = lru
    data_access_time = 4
    tags_access_time = 1
    perf_model_type = parallel
    writethrough = 0
    shared_cores = 1

    [perf_model/l1_dcache]
    perfect = false
    cache_size = 32
    associativity = 8
    address_hash = mask
    replacement_policy = lru
    data_access_time = 4
    tags_access_time = 1
    perf_model_type = parallel
    writethrough = 0
    shared_cores = 1

    [perf_model/l2_cache]
    perfect = false
    cache_size = 256
    associativity = 8
    address_hash = mask
    replacement_policy = lru
    data_access_time = 8 
    # 8.something according to membench, -1 cycle L1 tag access time
    tags_access_time = 3
    # Total neighbor L1/L2 access time is around 40/70 cycles (60-70 when it's coming out of L1)
    writeback_time = 50 # L3 hit time will be added
    perf_model_type = parallel
    writethrough = 0
    shared_cores = 1
    [perf_model/l2_cache/srrip]
    bits[] = 3,3,3,3,3 
    #srrip算法需要额外增加这些信息,指明每个cacheline的额外需要的位数


    ############  gainestown.cfg
    [perf_model/l3_cache]
    perfect = false
    cache_block_size = 64
    cache_size = 8192
    associativity = 16
    address_hash = mask
    replacement_policy =lru 
    data_access_time = 30 
    # 35 cycles total according to membench, +L1+L2 tag times
    tags_access_time = 10
    perf_model_type = parallel
    wri
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值