Once you have successfully generated the initial skeleton of the CVA6 SoC, the interesting part begins: modifying it. In this section, we will briefly cover the various parts that we will modify to add our peripherals.
Vivado block design is a graphical representation of interconnected IPs on the FPGA. It allows fast customization of some IPs as well as user-friendly interfaces for various project I/O.
To modify the block design, generate a first bitstream, then open Vivado and select “Open Block Design” on the left menu. You should land in the following panel:
The constraint file (.xdc
for Xilinx FPGAs) specifies the relationship between the external interfaces in the block design view and the physical FPGA pins, as well as various clocks or critical path length (hence giving constraints at the placement / routing step).
The current constraint file can be opened and edited directly in Vivado in the block design view using the top left “Source” pane and double-clicking in the file under the “Constraints” label, as illustrated in the following image:
Address mapping (i.e. routing in between IPs that uses an addressable interface [AXI in our case]) allows specification of the routing (and not rewrite) of the communication to the right IP. It is accessible using the “Address Editor” tab in Vivado block design, where each tree represent one self-contained network.
A devicetree (also written device tree) is a data structure describing the hardware components of a particular computer so that the operating system’s kernel can use and manage those components, including the CPU or CPUs, the memory, the buses and the integrated peripherals. (Wikipedia)
Adding peripherals requires to modify the device tree in order to advertise the presence of our new controllers to the software. The device tree is embedded in the bootROM, fixed after generation of the bitstream. The templated source file of the device tree is located in ./corev_apu/fpga/src/bootrom/cv64a6.dts.in
. Do not forget to run make bootrom-fpga
to integrate your changes in Vivado!