linux test project 如何得到cpu(s),ercesiMIPS: 用于计算机系统结构教学的处理器设计代码仓库,采用基于chisel的设计流程,完成单周期、多周期以及流水线MIPS处理...

ercesiMIPS Processor Porject

Author: Meng Zhang (zhangm@nwpu.edu.cn)

Author: Jianfeng An (anjf@nwpu.edu.cn)

Author: Danghui Wang (wangdh@nwpu.edu.cn)

Date: 2017 April 9

Diagrams: ercesiMIPS wiki. If you have any questions, share it with us in our community chat room.

This repo has been put together to demonstrate a number of simple MIPS Processors written in Chisel.

Install Chisel (according to usb-bar chisel3)

Install sbt

Run the following from the terminal to install sbt in (Ubuntu-like) Linux.

echo "deb https://dl.bintray.com/sbt/debian /" | sudo tee -a /etc/apt/sources.list.d/sbt.list

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2EE0EA64E40A89B84B2DF73499E82A75642AC823

sudo apt-get update

sudo apt-get install sbt

Install updated Verilator.

Install dependencies:

sudo apt-get install git make autoconf g++ flex bison

Clone the Verilator repository:

git clone http://git.veripool.org/git/verilator

In the Verilator repository directory, check out a known good version (You can skip the step if the latest version is statable.):

cd verilator

git pull

git checkout verilator_3_886

In Verilator directory, build and install:

cd verilator

unset VERILATOR_ROOT

autoconf

./configure

make

sudo make install

Clone lab repository

Run the following from the terminal to clone lab resources.

cd ~/

git clone https://github.com/zavs/ercesiMIPS.git

Write your CPU and test it

A template ALU block has been presented in src/main/scala/SingleCycle/ALU.scala with the tester in src/test/scala/SingleCycle/ALUtests.scala. We borrowed the Launcher method from ucb-bar/chisel-tutorial.

A new argument for shell runner needs to be name in Launcher.scala as the arguments of Map function:

object Launcher {

val tests = Map(

"ALU" -> { (backendName: String) =>

Driver(() => new ALU(), backendName) {

(c) => new ALUTests(c)

}

},

"ALU11" -> { (backendName: String) =>

Driver(() => new ALU11(), backendName) {

(c) => new ALU11Tests(c)

}

}

}

)

}

In which, "ALU" is the argument for the shell runner, and ALU() is denoted the instance class of DUT in ALUTests(c). Just add new argument for you own block class.

To test the ALU module with ALUtests, just input the following command in ercesiMIPS root directory.

./run-single.sh ALU

If you still want to monitor its verification via waveform, just run this:

./run-single.bak.v.sh ALU

And the output .vcd file can be monitored in gtkwave program which could be install in Ubuntu-like Linux:

sudo apt-get install gtkwave

To test multicycle CPU with TopTests, just input the following command in ercesiMIPS root directory.

./run-multi.sh Top

If you still want to monitor multicycle's waveform, just run this:

./run-multi.bak.v.sh Top

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值