# rainbow **Repository Path**: yecr/rainbow ## Basic Information - **Project Name**: rainbow - **Description**: 【知易行难】从零开始写一个RISC-V超标量处理器 - **Primary Language**: Scala - **License**: MulanPSL-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 15 - **Forks**: 2 - **Created**: 2022-10-16 - **Last Updated**: 2025-12-16 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README #### 编译得到emu文件 ```sh make verilog ``` 即可在build中得到名为SimTop.v的仿真顶层。 ```sh make emu ``` 即可在build中得到名为emu的可执行文件。 ```sh ./build/emu -h ``` 可查看这个可执行文件的各种参数说明。 #### 加载镜像文件进行测试 emu可以通过-i参数加载镜像文件,bin目录下存放一部分测试文件,包括cpu-test、riscv-test等,还有一个开源操作系统rt-thread,以riscv-test中的addi测试为例: ```sh ./build/emu -i ./bin/non-output/riscv-tests/addi-riscv-tests.bin ``` 参考输出如下: ```sh Emu compiled at Feb 7 2023, 19:43:00 key num:0 share memory id:7 The image is ./bin/non-output/riscv-tests/addi-riscv-tests.bin Using simulated 256MB RAM --diff is not given, try to use $(NEMU_HOME)/build/riscv64-nemu-interpreter-so by default Using /home/yecr/rainbow/NEMU/build/riscv64-nemu-interpreter-so for difftest The first instruction of core 0 has commited. Difftest enabled. Core 0: HIT GOOD TRAP at pc = 0x800002c8 total guest instructions = 208 instrCnt = 208, cycleCnt = 213, IPC = 0.976526 Seed=0 Guest cycle spent: 215 (this will be different from cycleCnt if emu loads a snapshot) Host time spent: 0ms ```