同步操作将从 西北工业大学-张萌/NWPU-gem5-CSArch 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
This repo is for the course U10M11007 of NWPU, Computer Organization and Architecture, which partially supported by University-Industry Collaborative Education Program, Ministy of Education (Phytium-NWPU).
Lab experiment includes:
This repo includes 5 labs, which focus processor architecture using open-source simulator GEM5. The experiment of GEM5 is docker based.
Firstly, just clone https://gitee.com/nwpu-ercesi/nwpu-gem5-csarch.git to your local folder. If you use Linux or BSP liked System (such as MacOS), just follow this command line
git clone https://gitee.com/nwpu-ercesi/nwpu-gem5-csarch.git
Docker is a set of platform-as-a-service products that use OS-level virtualization to deliver software in packages called containers. Containers are isolated from one another and bundle their own software, libraries and configuration files; they can communicate with each other through well-defined channels. All containers are run by a single operating-system kernel and are thus more lightweight than virtual machines. In this lab project, Docker is adopted for GEM5 simulator. The image can be pull from the Docker resource repository.
docker pull gcr.io/gem5-test/ubuntu-20.04_all-dependencies:v22-0
As the understandable concern of the cyber security and the WWW resources is monopolized oversea, the Docker Hub presents the unacceptable laggy in China. The Registry mirrors which servers are located in China is a reasonable approache to speed up the PULL of image from Docker Hub.
Some userful information can be found at Zhihu. We recommand to register a personal Aliyun registry mirror and add it in the configuration file daemon.json.
{ "registry-mirrors": [ "https://alimirrorusername.mirror.aliyuncs.com" ] }
Change the alimirrorusername
to your registry username of Aliyun Docker mirror.
As the gcr.io
is laggy or banned for unkown reason, the Dockerfile is provided in this repo.
The docker build
command listed below will build the docker image which has the essential libraries
of gem5.
The command should be run in the dir which contains the Dockerfile, for example in our gitee repository dir.
docker build -t gem5-ercesi:latest .
f the Docker image has been imported, the Docker would run by the command below.
docker run -u $UID:$GID \
--volume <gem5 directory>:/mnt/gem5arm \
--rm -it gem5-ercesi:latest
In which, the the argument -i
denotes an interactive mode of docker container execution,
t
implies a TTY prompt mode as while as bash is for a bash shell in command line.
To keep the container clean, we recommand not to save any user file in container.
So the --rm
is added in the script to remove the container after exit.
If you don’t use the --rm
optional argument, please resume the opened container next time.
<gem5 directory>
in the run script is where the GEM5 source code downloaded.
An example command below is for Windows users.
docker run -u gem5 --volume D://gem5_local:/mnt/gem5arm --rm -it gem5-ercesi:latest
Please note the performance of any app running in a docker container is limited by the resource assigned to the container. If any can be worked in the original OS, please do it in the original OS, such as doing git or compile in linux of mac os system.
The next step is cloning gem5 remote repo. It is recommande to use git clone from github or gitee.com.
git clone https://github.com/gem5/gem5.git
Note: Before compile the gem5, pre-commit libary is recommanded to install.
pip install pre-commit==2.20.0
When the end of the Docker lab, we use exit
command to exit the Docker promot.
docker ps -a
To restart the seleceted container, docker start
command can be used.
docker start [container ID]
If the run command used as that mentioned before, a sample command line is introdueced below.
docker exec -it [container ID] bash
As this repo is transfered from the Inner Source, and all the old history is deleted due to the copyright consideration, the contributors of this repo are not listed in git configurations. We listed all contributors below.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。