Skip to content

Commit 675f3a2

Browse files
committed
Updated READMEs
1 parent e2d4430 commit 675f3a2

2 files changed

Lines changed: 29 additions & 20 deletions

File tree

riscv_rocket64b4l2w_xdma/README.md

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ The design currently has a functional RISC-V core and UART.
1313

1414
---
1515

16+
**Block Diagram**
17+
1618
![Vivado RISC-V Block Diagram](img/vivado-risc-v_rocket64b4l2w_Block_Design_Diagram.png)
1719

1820
**AXI Addresses**
@@ -27,7 +29,7 @@ The design currently has a functional RISC-V core and UART.
2729
Refer to the `innova2_flex_xcku15p_notes` project's instructions to install XDMA Drivers and [Load the RISC-V User Image](https://github.com/mwrnd/innova2_flex_xcku15p_notes/#loading-a-user-image) into the FPGA's Configuration Memory.
2830

2931
```
30-
unzip innova2-riscv_bitstream.zip
32+
unzip -d . innova2-riscv_bitstream.zip
3133
md5sum innova2-riscv_primary.bin innova2-riscv_secondary.bin
3234
echo 01d74b05d4b5421fdcf21be70f2048af should be MD5 checksum of innova2-riscv_primary.bin
3335
echo 1948edcbf584d456683f0bd1530fb65a should be MD5 checksum of innova2-riscv_secondary.bin
@@ -63,12 +65,15 @@ Modify [`bare-metal hello-world boot.elf`](vivado-risc-v/bare-metal/hello-world/
6365
![bare-metal hello-world boot.elf](img/bare-metal_hello-world_modified.png)
6466

6567
```
68+
git clone --depth=1 https://github.com/mwrnd/innova2_experiments.git
69+
cd innova2_experiments/riscv_rocket64b4l2w_xdma/
70+
git submodule update --init vivado-risc-v
6671
cd vivado-risc-v/bare-metal/hello-world/
6772
make
68-
cd ../..
73+
cd ../../..
6974
```
7075

71-
Connect a [Xilinx-Compatible](https://docs.xilinx.com/r/en-US/ug908-vivado-programming-debugging/JTAG-Cables-and-Devices-Supported-by-hw_server) **1.8V** [JTAG Adapter](https://www.waveshare.com/platform-cable-usb.htm) to the Innova2. Run [`xsdb`](https://docs.xilinx.com/v/u/en-US/ug1043-embedded-system-tools) on the system hosting the JTAG Adapter. Note `xsdb` is included with [Vivado](https://www.xilinx.com/support/download/index.html/content/xilinx/en/downloadNav/vivado-design-tools/2021-2.html).
76+
Connect a [Xilinx-Compatible](https://docs.xilinx.com/r/en-US/ug908-vivado-programming-debugging/JTAG-Cables-and-Devices-Supported-by-hw_server) **1.8V** [JTAG Adapter](https://www.waveshare.com/platform-cable-usb.htm) to the Innova2. Run [`xsdb`](https://docs.xilinx.com/v/u/en-US/ug1043-embedded-system-tools) on the system hosting the JTAG Adapter. Note `xsdb` is included with [Vivado or Vivado Lab Edition](https://www.xilinx.com/support/download/index.html/content/xilinx/en/downloadNav/vivado-design-tools/2021-2.html).
7277
```
7378
source /tools/Xilinx/Vivado/2021.2/settings64.sh
7479
xsdb
@@ -138,8 +143,8 @@ The Linux system files can be [recreated](#recreating-the-risc-v-design) or [dow
138143

139144
Confirm the files downloaded correctly:
140145
```
141-
unzip -d . innova2-riscv_system.zip
142-
146+
unzip -d . innova2-riscv_system.zip
147+
md5sum Image ramdisk opensbi_boot.elf
143148
echo fd156f7719b39f41e0fe0f04dca36214 should be MD5 Checksum of Image
144149
echo 868f767b0b6e838852c9075643a9fd1d should be MD5 Checksum of ramdisk
145150
echo 0fef4ba92ff5d3014ab4787675458bfb should be MD5 Checksum of opensbi_boot.elf
@@ -177,7 +182,7 @@ targets
177182
```
178183

179184

180-
On the computer hosting the Innova-2, upload the Linux `Image` and `ramdisk` using [`dma_ip_driver`](https://github.com/mwrnd/innova2_flex_xcku15p_notes#install-xilinx-pcie-dma-ip-drivers)'s `dma_to_device` software. Note `Image` needs to be uploaded to `0x81000000` and `ramdisk` needs to be uploaded to `0x85000000`. `dma_to_device` also requires the exact size in bytes that will be uploaded. Using XDMA instead of JTAG is *significantly* faster.
185+
On the computer hosting the Innova-2, upload the Linux `Image` and `ramdisk` using [`dma_ip_driver`](https://github.com/mwrnd/innova2_flex_xcku15p_notes#install-xilinx-pcie-dma-ip-drivers)'s `dma_to_device` software. Note `Image` needs to be uploaded to `0x81000000` and `ramdisk` needs to be uploaded to `0x85000000`. `dma_to_device` also requires the exact size in bytes that will be uploaded. Using XDMA instead of JTAG is *significantly* faster. Once all firmware is uploaded, you can use `dma_from_device` to capture all memory for later upload. For now, JTAG is still required to set registers.
181186

182187
```
183188
sudo ./dma_to_device --verbose --device /dev/xdma0_h2c_0 --address 0x81000000 --size 19723012 -f Image
@@ -187,7 +192,7 @@ sudo ./dma_to_device --verbose --device /dev/xdma0_h2c_0 --address 0x85000000 --
187192
![Load Linux Image and ramdisk](img/Innova2_Linux_Image_and_RAMDisk_XDMA_Upload.png)
188193

189194

190-
Back on the computer hosting the [**1.8V** JTAG Adapter](https://docs.xilinx.com/r/en-US/ug908-vivado-programming-debugging/JTAG-Cables-and-Devices-Supported-by-hw_server),
195+
Back on the computer hosting the [**1.8V** JTAG Adapter](https://docs.xilinx.com/r/en-US/ug908-vivado-programming-debugging/JTAG-Cables-and-Devices-Supported-by-hw_server), upload OpenSBI and set the RISC-V core's registers to the start condition.
191196

192197

193198
```
@@ -211,7 +216,7 @@ On the computer hosting the Innova-2, [`xdma_tty_cuse` + `gtkterm`](#communicati
211216

212217
![xdma_tty_cuse and gtkterm OpenSBI Boot](img/Innova2_OpenSBI_Boot_Complete.png)
213218

214-
For some reason, `^@` gets added to every character typed into `gtkterm`. `initramfs` core correctly parses the input and commands work.
219+
For some reason, `^@` gets added to every character typed into `gtkterm`. `initramfs` correctly parses the input and commands work.
215220

216221
![initramfs communication fault](img/Innova2_initramfs_Communication.png)
217222

@@ -275,16 +280,20 @@ Run Generate Bitstream to compile the design. Refer to the `innova2_flex_xcku15p
275280

276281
![Vivado Generate Bitstream](img/Vivado_Generate_Bitstream.png)
277282

283+
The design takes around 2 hours to synthesize and implement.
284+
278285
![Design Runs Overview](img/vivado-innova2-riscv_rocket64b4l2w_DesignRuns.png)
279286

287+
About half the XCKU15P FPGA is used.
288+
280289
![Utilization](img/vivado-innova2-riscv_rocket64b4l2w_Utilization.png)
281290

282291

283292
## Recreating the RISC-V Design
284293

285294
To change the RISC-V core configuration, run frequency, or initial boot firmware, the RISC-V subsystem will need to be regenerated using a full [RocketChip](https://bar.eecs.berkeley.edu/projects/rocket_chip.html) install which requires about 8GB of downloads. Vivado **2021.2** is currently supported.
286295

287-
Run all the `vivado-risc-v` setup commands (`apt-install`, `update-submodules`) if this is the first use. 8GB of files will be downloaded. Then `source` Vivado environment settings and run `make` to generate a Vivado project, bitstream, and binary configuration files.
296+
Run all the `vivado-risc-v` setup commands (`apt-install`, `update-submodules`) if this is the first use. 8GB of files will be downloaded. Then `source` Vivado environment settings and run `make` for the `jtag-boot` target to generate a Vivado project, bitstream, binary configuration files, and all the Linux system boot files.
288297
```
289298
cd vivado-risc-v
290299
sudo make apt-install
@@ -311,7 +320,7 @@ source /tools/Xilinx/Vivado/2021.2/settings64.sh
311320
make CONFIG=rocket64b4l2w BOARD=innova2 vivado-tcl
312321
```
313322

314-
`source` the generated `vivado-risc-v/workspace/rocket64b4l2w/system-innova2.tcl` in Vivado.
323+
[`source`](https://docs.xilinx.com/r/2021.2-English/ug939-vivado-designing-with-ip-tutorial/Source-the-Tcl-Script?tocId=K45Kl8hoyn9dApZ7PZP~Ng) the generated `vivado-risc-v/workspace/rocket64b4l2w/system-innova2.tcl` in Vivado.
315324

316325
![Vivado source system-innova2.tcl](img/Vivado_source_system-innova2_tcl.png)
317326

xdma_uart-to-uart/README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ Two non-blocking [UARTs](https://github.com/eugene-tarassov/vivado-risc-v/blob/v
1212

1313
## Bitstream
1414

15-
Refer to the `innova2_flex_xcku15p_notes` project's instructions on installing XDMA drivers and [Loading a User Image](https://github.com/mwrnd/innova2_flex_xcku15p_notes/#loading-a-user-image) to load the included bitstream into the Innova-2's FPGA Configuration Memory.
15+
Refer to the `innova2_flex_xcku15p_notes` project's instructions on installing XDMA drivers and [Loading a User Image](https://github.com/mwrnd/innova2_flex_xcku15p_notes/#loading-a-user-image) to load the [release bitstream](https://github.com/mwrnd/innova2_experiments/releases) into the Innova-2's FPGA Configuration Memory.
1616

1717
```
18-
unzip xdma_uart-to-uart_bitstream.zip
18+
unzip -d . xdma_uart-to-uart_bitstream.zip
1919
md5sum xdma_uart-to-uart_primary.bin xdma_uart-to-uart_secondary.bin
2020
echo 4cab44d93b10960a7dd0ce653630d69b should be MD5 Checksum of xdma_uart-to-uart_primary.bin
2121
echo 015c797003f4ddf770c6ea418bd22a18 should be MD5 Checksum of xdma_uart-to-uart_secondary.bin
@@ -64,18 +64,18 @@ Typing in one `GTKTerm` window should display the characters in the other window
6464

6565
### Sending Files Larger than twice the FIFO Buffer Depth Fails
6666

67-
If you attempt to send a file, the TTY will lock up after sending twice the number of characters that the RX and TX FIFOs hold.
67+
If you attempt to send a file, the TTY will lock up after sending about twice the number of characters that the RX and TX FIFOs hold.
6868

6969
![Send RAW File](img/xdma_tty_cuse_Send_RAW_File_test.png)
7070

71-
`001abcdefghijklmnopqrstuvwxyzA` is 30 bytes while each FIFO has a [16-byte depth](https://github.com/mwrnd/innova2_experiments/blob/74f1473361b246bbb64e40fe7234f68de22aa502/xdma_uart-to-uart/uart.v#L113).
71+
`001abcdefghijklmnopqrstuvwxyzA` is 30 bytes while each FIFO has a [2^4=16-byte depth](https://github.com/mwrnd/innova2_experiments/blob/74f1473361b246bbb64e40fe7234f68de22aa502/xdma_uart-to-uart/uart.v#L113).
7272

7373
![TTY Locks](img/xdma_tty_cuse_Send_RAW_File_test_result.png)
7474

7575

7676
### Basic XDMA UART Testing
7777

78-
[`uart.c`](uart.c) sends as much data as it can to the first UART then reads as much data as it can from the second. Compile then run with:
78+
[`uart.c`](uart.c) sends as much data as it can to the first [AXI UART](uart.v) then reads as much data as it can from the second. Compile then run with:
7979
```
8080
gcc uart.c `pkg-config fuse --cflags --libs` --std=gnu17 -g -Wall -latomic -o uart
8181
```
@@ -85,7 +85,7 @@ In a seperate terminal, test with:
8585
sudo ./uart /dev/xdma0_c2h_0 /dev/xdma0_h2c_0 0x60100000 /dev/xdma0_c2h_1 /dev/xdma0_h2c_1 0x60110000
8686
```
8787

88-
The software is able to fill the RX and TX FIFOs to 30 bytes, and successfully read them back.
88+
The software is able to fill the RX and TX FIFOs with 30 bytes (15 to each FIFO), and successfully read them back.
8989
```
9090
...
9191
Wrote count = 30 bytes of data to XDMA0 : ABCDEFGHIJKLMNOPQRSTUVWXYZABCD
@@ -94,10 +94,10 @@ Read count = 30 bytes of data from XDMA1, readstring = ABCDEFGHIJKLMNOPQRSTUVWXY
9494
...
9595
```
9696

97-
Similarly, for the [`UARTlite`](https://docs.xilinx.com/v/u/en-US/pg142-axi-uartlite) interfaces:
97+
Similarly with [`uartlite.c`](uartlite.c) for the [`UARTlite`](https://docs.xilinx.com/v/u/en-US/pg142-axi-uartlite) interfaces:
9898
```
9999
gcc uartlite.c `pkg-config fuse --cflags --libs` --std=gnu17 -g -Wall -latomic -o uartlite
100-
sudo ./uartlite /dev/xdma0_c2h_0 /dev/xdma0_h2c_0 0x60100000 /dev/xdma0_c2h_1 /dev/xdma0_h2c_1 0x60110000
100+
sudo ./uartlite /dev/xdma0_c2h_0 /dev/xdma0_h2c_0 0x60300000 /dev/xdma0_c2h_1 /dev/xdma0_h2c_1 0x60310000
101101
```
102102

103103
The `UARTlite` software needs further debugging. Either delay after each byte sent or wait for the transmit FIFO to empty before sending another byte. Check for the various *STATUS* register errors.
@@ -125,15 +125,15 @@ sudo ~/Innova_2_Flex_Open_18_12/app/innova2_flex_app -v
125125

126126
![Enable JTAG Access](img/Innova-2_Enable_JTAG_Access.png)
127127

128-
Connect a [Xilinx-Compatible JTAG](https://docs.xilinx.com/r/en-US/ug908-vivado-programming-debugging/JTAG-Cables-and-Devices-Supported-by-hw_server) to the Innova-2 and run [Vivado Hardware Manager](https://docs.xilinx.com/r/en-US/ug908-vivado-programming-debugging/Debugging-Logic-Designs-in-Hardware). Add [`debug_nets.ltx`](debug_nets.ltx) to the *Trigger Setup* and capture AXI communication.
128+
Connect a [Xilinx-Compatible **1.8V** JTAG Adapter](https://docs.xilinx.com/r/en-US/ug908-vivado-programming-debugging/JTAG-Cables-and-Devices-Supported-by-hw_server) to the Innova-2 and run [Vivado Hardware Manager](https://docs.xilinx.com/r/en-US/ug908-vivado-programming-debugging/Debugging-Logic-Designs-in-Hardware). Add [`debug_nets.ltx`](debug_nets.ltx) to the *Trigger Setup* and capture AXI communication.
129129

130130
![Capture from Integrated Logic Analyzer](img/XDMA_UART_Integrated_Logic_Analyzer_ILA_Capture.png)
131131

132132

133133

134134
## Recreating the Design in Vivado
135135

136-
`source` [xdma_uart-to-uart.tcl](xdma_uart-to-uart.tcl) in Vivado.
136+
[`source`](https://docs.xilinx.com/r/2021.2-English/ug939-vivado-designing-with-ip-tutorial/Source-the-Tcl-Script?tocId=K45Kl8hoyn9dApZ7PZP~Ng) [xdma_uart-to-uart.tcl](xdma_uart-to-uart.tcl) in Vivado.
137137

138138

139139

0 commit comments

Comments
 (0)