1. 背景
Gem5模拟器是计算机系统体系结构研究的模块化平台,包括系统级体系结构和处理器微体系结构。Gem5最初是为学术界的计算机体系结构研究而设计的,但它已被学术界、研究行业和教学界用于计算机系统设计。
Gem5的官 :https://www.gem5.org/
Gem5的github:https://github.com/gem5/gem5
Garnet是Gem5中的互连 络模型,会随着Gem5的更新而更新。目前最新版本Gem5所包含的Garnet版本是Garnet 3.0(划重点,后面会用到),也就是HeteroGarnet。
参考 址:https://www.gem5.org/2020/05/27/heterogarnet.html
参考视频:https://www.youtube.com/embed/AH9r44r2lHA
Heterogrante改进了广受欢迎的Garnet2.0 络模型,实现了对新兴互连系统的精确模拟。具体而言,Heterogrante增加了对时钟域孤岛(clock-domain islands)、支持多个频域的 络交叉点(network crossings)以及能够连接到多个物理链路的 络接口控制器的支持。它还通过引入新的可配置SerDes组件来支持可变带宽链路和路由器。
**Garnet的参考论文:**Bharadwaj S, Yin J, Beckmann B, et al. Kite: A family of heterogeneous interposer topologies enabled via accurate interconnect modeling[C]//2020 57th ACM/IEEE Design Automation Conference (DAC). IEEE, 2020: 1-6.
2. Garnet的 络教学资源
通过最近对软件定义晶上系统(Software Defined System on Wafer,SDSoW)、以及chiplet系统的研究,发现许多高水平论文均使用Garnet作为互连(Interconnection)系统的仿真软件。而Garnet的 络教学资源相对较少,且更新不够及时,现有的主要资源如下:
地址:https://www.gem5.org/documentation/general_docs/ruby/garnet-2/
主要缺点:仍然处于Garnet2.0阶段,然而最新代码已经是Garnet3.0(Heterogrante),导致部分代码和现有文档不对应
课程链接:https://tusharkrishna.ece.gatech.edu/teaching/icn_s22/
实验链接:https://tusharkrishna.ece.gatech.edu/teaching/garnet_gt/
目前最新的是2022年春季的课程,有条件的可以学一下,里面有PPT和NoC实验,但是实验中的Gem5版本比较陈旧。
3. Gem5的下载、编译及运行
这部分参考Gem5的官方文档进行配置:
https://www.gem5.org/documentation/general_docs/building
以本机所在的Ubuntu 18.04为例,需要配置的依赖有(Gem5版本高于v21.0):
- git : gem5 uses git for version control.
- gcc: gcc is used to compiled gem5. Version >=7 must be used. We support up to gcc Version 11.
- Clang: Clang can also be used. At present, we support Clang 6 to Clang 11 (inclusive).
- SCons : gem5 uses SCons as its build environment. SCons 3.0 or greater must be used.
- Python 3.6+ : gem5 relies on Python development libraries. gem5 can be compiled and run in environments using Python 3.6+.
- protobuf 2.1+ (Optional): The protobuf library is used for trace generation and playback.
- Boost (Optional): The Boost library is a set of general purpose C++ libraries. It is a necessary dependency if you wish to use the SystemC implementation.
可以在终端中进行安装:
此外,推荐安装pydot,这样能够在仿真时同步生成系统结构图,pydot的链接是https://pypi.org/project/pydot/#description
首先将pydot从上面的 址下载下来,而后解压后在目录内执行
从Gem5的Github上对项目进行clone:
4. 基于8*8 Mesh NoC同构 络的demo仿真
项目 | 参数 |
---|---|
络类型 | garnet |
源节点数量 | 64 |
目的节点数量 | 64 |
拓扑类型 | Mesh_XY |
规模 | 8*8 |
仿真周期 | 10000 |
vnet注入参数 | 0 |
注入率 | 0.02 |
流量类型 | uniform_random |
通过设定不同的注入率(–injectionrate参数),来观察NoC系统的仿真运行结果,主要关注的指标有:
- 总发包数量
- 总收包数量
- 平均包排队延迟
- 平均包 络延迟
- 平均包延迟(等于平均包排队延迟+平均包 络延迟)
- 平均跳数
在Gem5的根目录下,输入其命令行代码:
仿真结果

声明:本站部分文章及图片源自用户投稿,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!