Implementation of WepSIM's Elemental
Processor on an FPGA. This project was developed with a Nexys A7-100T
FPGA. While it should be able to work on other FPGAs, some things might
need to be manually adapted (such as the device's IO connections in src/constraints.xdc).
- Docker and Docker compose
- A Docker image of Vivado, which can be generated with vivado-docker-minimal
The Docker container image can be generated with docker compose build.
Afterwards, the local server can be opened using docker compose run --rm server.
Important
The server should be opened after the FPGA is connected to the PC. Otherwise, it won't be picked up by Docker and flashing it might fail.
Unit tests are run with uv and VUnit, using a VHDL compiler and simulator. For this, nvc is recommended. All tests can be run at once with:
uv run test.py -p 0The list of all tests can be obtained with:
uv run test.py --listTo run only a specific group of tests, a filter can be appended at the end using
* wildcards:
uv run test.py -p 0 "*<entityname>*"To debug a unit test, a waveform file can be exported and opened on a viewer like surfer:
uv run test.py --gui "*<entityname>_tb[.<generic-params>].<testname>"api/: Modules for bridging WepSIM, Vivado, and generating the VHDL firmware module based on WepSIM's firmware configurationsrc/: VHDL source filescircuits/: Implementation of complex logic circuits, formed by connecting primitive components togetherdevices/: Implementation of IO devicesfirmware/: Definition of firmware configurationprimitives/: Implementation of primitive logic componentsclk_divider.tcl: Script to generate the analog clock divider in Vivado for the system clockconstraints.xdc: Mapping of inputs/outputs of the circuit to FPGA pinsmain.vhdl: Top level element of the circuit
tests/: VHDL test benches for each of the components, using the same structure assrc/- Note: due to the complexity of testing a full CPU, the test benches for the
circuits/subdirectory as well asmain.vhdlare mostly intended as a stub to load the design in the simulator. Test conditions can be set on their respective test benches, and the result can be manually analyzed after loading it in the waveform viewer
- Note: due to the complexity of testing a full CPU, the test benches for the
riscv.wepsim: WepSIM firmware code implementing RISC-V's RV32I+Zmmul instructionsserver.py: Entry point for WepSIM's REST servertest.py: Entry point for unit tests execution