# Asssigment3: SoftCPU contributed by < `Cheng Yu` > ###### tags: `Computer Architure` ## Preliminary work :::spoiler Follow the instructions below 1. Adding PPA to Ubuntu and install Verilator ```shell $ sudo add-apt-repository ppa:iztok.jeras/ppa $ sudo apt update $ sudo apt install verilator ``` 2. Ensure the version of Verilator > ==4.0== ```shell $ verilator --version ``` 3. Install GNU Toolchain for RISC-V as [Lab2](https://hackmd.io/@sysprog/rJAufgHYS) mentioned ```shell $ cd /tmp $ wget https://github.com/xpack-dev-tools/riscv-none-embed-gcc-xpack/releases/download/v8.2.0-3.1/xpack-riscv-none-embed-gcc-8.2.0-3.1-linux-x64.tgz $ tar zxvf xpack-riscv-none-embed-gcc-8.2.0-3.1-linux-x64.tgz $ cp -af xPacks/riscv-none-embed-gcc $HOME/ $ cd $HOME/riscv-none-embed-gcc $ echo "export PATH=`pwd`/8.2.0-3.1/bin:$PATH" > setenv $ cd $HOME $ source riscv-none-embed-gcc/setenv $ riscv-none-embed-gcc -v $ riscv-none-embed-gcc --version | head -1 ``` Expected result: `riscv-none-embed-gcc (xPack GNU RISC-V Embedded GCC, 64-bit) 8.2.0` 4. Install GTKwave ```shell $ sudo apt install gtkwave ``` 5. Build from source code ```shell $ git clone https://github.com/PulseRain/Reindeer.git $ cd Reindeer/sim/verilator $ make ``` 6. Run compliance test for [all 55 cases](https://github.com/riscv/riscv-compliance/tree/master/riscv-test-suite/rv32i) ```shell $ make test_all ``` 7. Run compliance test for individual case. For example, [I-ADD-01](https://github.com/riscv/riscv-compliance/blob/master/riscv-test-suite/rv32i/src/I-ADD-01.S) ```shell $ make test I-ADD-01 ``` 8. Run simulator on an ELF file for 2000 cycles ```shell $ make run ../../bitstream_and_binary/zephyr/hello_world.elf ``` 9. Get wave ```shell $ gtkwave ``` ::: ## riscv-compliance
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up