6. Chipyard Simulation
Simple RISCV tests can be found under $RISCV/riscv64-unknown-elf/share/riscv-tests/isa/
and can be run as:
Open up the .out file generated by the assembly test you ran (in vcs/output
) and answer the following questions:
6.1. How many cycles did the simulation take to complete?
6.2. What is the hexidecimal representation of the last instruction run by the CPU?
In summary, when we run something like:
The first command will elaborate the design and create Verilog. This is done by converting the Chisel code, embedded in Scala, into a FIRRTL intermediate representation which is then run through the FIRRTL compiler to generate Verilog. Next it will run VCS to build a simulator out of the generated Verilog that can run RISC-V binaries. The second command will run the test specified by BINARY
and output results as an .out
file. This file will be emitted to the $chipyard/sims/vcs/output/
directory.
Many Chipyard Chisel-based design looks something like a Rocket core connected to some kind of "accelerator" (e.g. a DSP block like an FFT module). When building something like that, you would typically build your "accelerator" generator in Chisel, and unit test it using ChiselTesters. You can then write integration tests (eg. a baremetal C program) which can then be simulated with your Rocket Chip and "accelerator" block together to test end-to-end system functionality. Chipyard provides the infrastructure to help you do this for both VCS (Synopsys) and Verilator (open-source). The same infrastructure enables a few other applications as depicted below.
|
In summary...
|
Next Step
page7. Design, Test and IntegrationLast updated