gem5: 在缓存代码中如何识别缓存是L1,L2还是L3呢?
来源:互联网 发布:mac webpack 编辑:程序博客网 时间:2024/06/05 06:42
参考:Checking Cache Levels
问题描述:有时候我们需要知道cpu当前在访问缓存的哪一级,然后针对性的作出信息统计,那么如何知道是L几呢?
方法:
If you want to know which level the target cache is at, I can tell you a simple approach that I used.
(1) Add a member variable in the BaseCache class in both .cc and .py called cache-level.
a.在BaseCache.py中加入cache_level.
cache_level = Param.Int("The cache level of this cache")
b.在base.hh中定义cache_level
const int cacheLevel;
c.在base.cc中初始化cache_level
cacheLevel(p->cache_level),
(2) Pass the cache level information to the python constructor function of L1 and L2 caches in config/example/se.py or whatever.
a.在configs/common/CacheConfig.py中加入对应的缓存加上级别设置,即
cache_level=1
(3) in the constructor function of C++ Caches, assign the python variable value to the C++ variable value.
(4) use the cache level information in your source code.
- gem5: 在缓存代码中如何识别缓存是L1,L2还是L3呢?
- CPU的缓存L1,L2,L3
- CPU的缓存L1,L2,L3
- CPU的缓存L1、L2、L3
- L1 和 L2 缓存
- gem5三级缓存配置,其中L1和L2为cpu独享
- L1 L2 L3 cache
- Volley的缓存策略(L1,L2)
- 已知顺序表L1,L2中数据由小到大有序,请用尽可能快的方法将L1与L2中的数据合并到L3中,使数据在L3中按升序排列
- gem5: 缓存中如何设置writeback dirty cachelines并invalidate该缓存块
- gem5中查看缓存信息cache_impl.hh
- CPU缓存——L1+L2详解
- gem5中查看缓存配置后的体系结构pydot
- 机器学习中的范数规则化(L1,L2,L3)
- 给定一个链表,比如L1--->L2---->L3---->................----->Ln,把链表调整为L1---->Ln----->L2----->Ln-1------>L3----
- 如何在程序中加入缓存机制
- 如何在UIWebView中使用缓存
- 如何在UIWebView中使用缓存?
- MyEclipse8.5 基于jax-ws的webservice对象(实体)传递的开发
- PHP开启opcache方法
- MyBatis学习七:spring和MyBatis整合、逆向工程
- JAXB--简单应用(一)
- Android API22/23 对应Eclipse选择
- gem5: 在缓存代码中如何识别缓存是L1,L2还是L3呢?
- ThreadLocal
- Struts1——文件上传
- 常用的Hql语句
- redis 高级应用— 安全性
- Data Vault初探(十) —— 星型模型向Data Vault模型转化
- ionic隐藏tabs(hideTabs)
- B/S和C/S的区别
- JAXB--@XmlElementWrapper注解(二)