Skip to content

Commit 7908f99

Browse files
authored
Add support for VCU118 block design (#287)
* fpga: Testing hyperram in block design * fpga: Testing hyperram in vanilla * fpga: Correct Xilinx IP verilog to follow the standard * fpga: Adding hyperram CDC constraints * fpga: Adding pads in vanilla * fpga: Adding vcu118 BD support * fpga: Cleaning PR * vcu118: Ethernet debug * docs: Updated Xilinx targets * fpga: Removed hyperbus for this PR * fpga: CI and flash script * fpga: Debug once again spi * fpga: Changing STARTUPE3 tie-off * fpga: Reset board after program * sw: New dts for vcu118 * ci: Update for FPGA * misc: Update docs and licenses
1 parent e68707b commit 7908f99

29 files changed

+1017
-1581
lines changed

carfield.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ include $(CAR_ROOT)/bender-safed.mk
4444
######################
4545

4646
CAR_NONFREE_REMOTE ?= [email protected]:carfield/carfield-nonfree.git
47-
CAR_NONFREE_COMMIT ?= 59e53134
47+
CAR_NONFREE_COMMIT ?= e39aebd1
4848

4949
## @section Carfield platform nonfree components
5050
## Clone the non-free verification IP for Carfield. Some components such as CI scripts and ASIC

docs/tg/xilinx.md

Lines changed: 40 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@ Additionally, for on-chip debugging you need:
88

99
We currently provide working setups for:
1010

11-
- Xilinx VCU128 with Vivado `>= 2020.2`
11+
- Xilinx VCU128 with Vivado `== 2020.2`
12+
- Xilinx VCU118 with Vivado `== 2020.2`
13+
14+
:warning: At the moment it is required to use the Vivado version above
15+
16+
**Note: Certain version of Vivado might cause issue, until these issues are resolved it is safer to use 2020.2**
1217

1318
We are working on support for more boards in the future.
1419

@@ -24,7 +29,17 @@ design flow to link Carfield with external IPs. This flow is less human readable
2429
integrating more complex IPs as Xilinx Ethernet. *Note that this may require you to own the
2530
respective licenses.*
2631

27-
## Building the vanilla bistream
32+
## Quick Start
33+
34+
The recommended command to build a bitstream (for VCU128) is
35+
36+
```bash
37+
make car-xil-all XILINX_FLAVOR=bd VIVADO="vitis-2020.2 vivado" VIVADO_MODE=gui XILINX_BOARD=vcu128 GEN_NO_HYPERBUS=1 GEN_EXT_JTAG=1 CARFIELD_CONFIG=carfield_l2dual_spatz_periph
38+
```
39+
40+
Please find below more explanations.
41+
42+
## Building the vanilla bistream (VCU128 only)
2843

2944
Due to the structure of the Makefile flow. All the following commands are to be executed at the root
3045
of the Carfield repository. If you want to see the Makefiles that you will be using, you can find
@@ -90,7 +105,7 @@ Generate the bitstream in `target/xilinx/out/` by running:
90105

91106
```bash
92107
make car-xil-all XILINX_FLAVOR=bd [VIVADO=version] [VIVADO_MODE={batch,gui}]
93-
[XILINX_BOARD={vcu128}] [GEN_NO_HYPERBUS={0,1}] [GEN_EXT_JTAG={0,1}]
108+
[XILINX_BOARD={vcu128, vcu118}] [GEN_NO_HYPERBUS={0,1}] [GEN_EXT_JTAG={0,1}]
94109
[CARFIELD_CONFIG=carfield_l2dual_{safe,spatz}_periph]
95110
```
96111

@@ -99,12 +114,12 @@ See the argument list below:
99114
| Argument | Relevance | Description |
100115
|---------------- |-----------|---------------------------------------------------------------------------------------------------------------------------------------|
101116
| VIVADO | all | Vivado command to use |
102-
| XILINX_BOARD | all | `vcu128` |
117+
| XILINX_BOARD | all | `vcu128` `vcu118` |
103118
| GEN_NO_HYPERBUS | all | `0` Use the hyperram controller inside `carfield.sv`<br>`1` Use the Xilinx DDR controller |
104-
| GEN_EXT_JTAG | vcu128 | `0` Connect the JTAG debugger to the board's JTAG (see [vcu128](#xilinx-vcu128)) <br>`1` Connect the JTAG debugger to an external JTAG chain |
119+
| GEN_EXT_JTAG | all | `0` Connect the JTAG debugger to the board's JTAG (see [vcu128](#xilinx-vcu128)) <br>`1` Connect the JTAG debugger to an external JTAG chain |
105120
| CARFIELD_CONFIG | all | Select the Carfield configuration to implement. See below for supported configs. |
106121
| VIVADO_MODE | all | `batch` Compile in Vivado shell<br>`gui` Compile in Vivado gui |
107-
| XILINX_BOOT_ETH | all | `0` Boot via SPI flash only (see [booting Linux](#booting_linux)) <br>`1` Boot via SPI flash and Ethernet |
122+
| XILINX_BOOT_ETH | vcu128 | `0` Boot via SPI flash only (see [booting Linux](#booting_linux)) <br>`1` Boot via SPI flash and Ethernet |
108123

109124
See below some typical building time for reference:
110125

@@ -141,19 +156,34 @@ can be set in the Vivado GUI (see [Using Vivado GUI](#bringup_vivado_gui)).
141156
> The VCU128 development board only provides one JTAG chain, used by Vivado to program the
142157
bitstream, and interact with certain Xilinx IPs (ILAs, VIOs, ...). The RV64 requires access to a
143158
JTAG chain to connect GDB to the debug-module in the bitstream.
144-
145159
> When using `EXT_JTAG=0` it is possible to connect the debug module to the internal FPGA's JTAG by
146160
using the Xilinx BSCANE macro. With this, you will only need the normal Xilinx USB cable to interact
147161
with CVA6. Note that it means that
148162
Vivado and OpenOCD can not use the same cable at the same time.
149-
>**WARNING: this setup (with `EXT_JTAG=0`) will only work for designs containing the host only** as
163+
> :warning: This setup (with `EXT_JTAG=0`) will only work for designs containing the host only** as
150164
it is not possible to chain multiple devices on the BSCANE macro. If you need to use `EXT_JTAG=0`
151165
consider modifying the RTL to remove the debug modules of the IPs.
152-
153166
> When using `EXT_JTAG=1` we add an external JTAG chain for the RV64 host and other island through
154167
the FPGA's GPIOs. Since the VCU128 does not have GPIOs we use we use a Digilent JTAG-HS2 cable
155168
connected to the Xilinx XM105 FMC debug card. See the connections in `vcu128.xdc`.
156169

170+
### Xilinx VCU118
171+
> #### Bootmodes and VIOs
172+
>
173+
> We currently do not use the switches on this board, the CVA6 bootmode (see [Cheshire
174+
bootrom](https://pulp-platform.github.io/cheshire/um/sw/#boot-rom)) is selected by Xilinx VIOs that
175+
can be set in the Vivado GUI (see [Using Vivado GUI](#bringup_vivado_gui)).
176+
>
177+
> #### External JTAG chain
178+
>
179+
> Similarly to the VCU128 we use GPIOs to connect an external JTAG-USB dongle (Digilent HS2). Unlike the VCU128, the availability of GPIOs directly on the board allow us to connect the HS2 without an FMC debug board (see constraints for related pins).
180+
>**WARNING: this setup (with `EXT_JTAG=0`) will only work for designs containing the host only** as
181+
it is not possible to chain multiple devices on the BSCANE macro. If you need to use `EXT_JTAG=0`
182+
consider modifying the RTL to remove the debug modules of the IPs.
183+
> #### Block design and Xilinx Ethernet IP
184+
>
185+
> The Xilinx Ethernet IP integration is still under debug and does not work out of the box in Linux or U-boot at the moment.
186+
157187
## Bare-metal bringup
158188

159189
### Programming the FPGA
@@ -248,7 +278,7 @@ integrated flash:
248278
> This script will erase your bitstream, once the flash has been written (c.a.
249279
10min) you will need to re-program the bitstream on the board.
250280
> You can attach the UART port of the FPGA to minicom and see the boot process!
251-
### Via Ethernet
281+
### Via Ethernet (VCU128 only)
252282
>
253283
> As flashing and reading the kernel from SPI can take a few minutes, a faster way is to
254284
> [ask U-Boot to fetch the image from the network](https://www.emcraft.com/som/using-dhcp).
@@ -259,9 +289,6 @@ integrated flash:
259289
> ```
260290
> make chs-xil-flash VIVADO_MODE=batch XILINX_BOARD=vcu128 XILINX_FLAVOR=bd XILINX_BOOT_ETH=1
261291
> ```
262-
### Via Ethernet
263-
264-
Tbd
265292
266293
## Add your own board
267294

sw/boot/carfield_bd_vcu118.dts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// Copyright 2025 ETH Zurich and University of Bologna.
2+
// Solderpad Hardware License, Version 0.51, see LICENSE for details.
3+
// SPDX-License-Identifier: SHL-0.51
4+
//
5+
// Cyril Koenig <[email protected]>
6+
7+
8+
/include/ "carfield.dtsi"

sw/boot/remote_boot.dtsi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
// Uncomment below for remote boot
2-
// remote-boot = "0.0.0.0:vcu128-01/carfield/uImage-ci";
2+
// remote-boot = "0.0.0.0:vcu128-01/carfield/uImage-ci";

target/xilinx/constraints/carfield_islands.tcl

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,31 @@ handle_domain_clock_mux [get_cells -hier u_l2_clk_sel] 0 l2_domain_clk
4141
# Carfield CDCs #
4242
#################
4343

44-
# Safety Island
45-
################
44+
## Find the first parent cell of matching module from a list of object paths
45+
## @param strs children objects paths
46+
## @param ref_to_find the module type of the parent cell
47+
proc find_parent_cell { strs ref_to_find } {
48+
foreach str $strs {
49+
set path ".";
50+
foreach cell [split $str '/'] {
51+
if {[get_cells -quiet $path] != ""} {
52+
if { [get_property "ORIG_REF_NAME" [get_cell $path]] == $ref_to_find } {
53+
return $path
54+
}
55+
if { [get_property "REF_NAME" [get_cell $path]] == $ref_to_find } {
56+
return $path
57+
}
58+
}
59+
set path $path/$cell;
60+
}
61+
}
62+
return ""
63+
}
4664

4765
proc handle_slv_cdc { slv_cdc_path } {
4866
upvar SOC_TCK SOC_TCK
4967
# Start from a known slv cdc_dst and get fanout to find the mst cdc_src
50-
set mst_cdc_path [lindex [regexp -inline {.*i_cheshire_ext_slv_cdc_src|.*i_intcluster_slv_cdc} [lindex [filter [all_fanout -flat [get_pins $slv_cdc_path/*rptr*]] -filter {NAME =~ *gen_ext_slv_src_cdc* || NAME =~ *gen_pulp_cluster*}] 0]] 0]
68+
set mst_cdc_path [find_parent_cell [all_fanout -flat [get_pins $slv_cdc_path/*rptr*]] "axi_cdc_src"]
5169
if { $mst_cdc_path != "" } {
5270
set_max_delay -datapath \
5371
-from [get_pins $mst_cdc_path/i_cdc_fifo_gray_*/*reg*/C] \
@@ -66,7 +84,6 @@ proc handle_slv_cdc { slv_cdc_path } {
6684
-to [get_pins $mst_cdc_path/i_cdc_fifo_gray_*/*i_sync/*reg*/D] \
6785
"$SOC_TCK"
6886
}
69-
7087
}
7188

7289
handle_slv_cdc [get_cells -hier gen_periph.i_cdc_dst_peripherals]
@@ -76,12 +93,12 @@ handle_slv_cdc [get_cells -hier gen_safety_island.i_safety_island_wrap]/i_cdc_in
7693
handle_slv_cdc [get_cells -hier gen_spatz_cluster.i_fp_cluster_wrapper]/i_spatz_cluster_cdc_dst
7794
handle_slv_cdc [get_cells -hier gen_pulp_cluster.i_integer_cluster]/axi_slave_cdc_i
7895
handle_slv_cdc [get_cells -hier gen_l2.i_reconfigurable_l2]/gen_cdc_fifos[0].i_dst_cdc
96+
handle_slv_cdc [get_cells -hier i_hyperbus_wrap]/i_hyper_cdc_dst
7997

8098
proc handle_mst_cdc { mst_cdc_path } {
8199
upvar SOC_TCK SOC_TCK
82-
# Get the dst_cdc in cheshire
83-
set slv_cdc_path [lindex [regexp -inline {.*i_cheshire_ext_mst_cdc_dst|.*i_intcluster_mst_cdc} [lindex [filter [all_fanout -flat [get_pins $mst_cdc_path/*wptr*]] -filter {NAME =~ *gen_ext_mst_dst_cdc* || NAME =~ *gen_pulp_cluster*}] 0]] 0]
84-
100+
# Start from a known mst cdc_src and get fanout to find the slv cdc_dst
101+
set slv_cdc_path [find_parent_cell [all_fanout -flat [get_pins $mst_cdc_path/*rptr*]] "axi_cdc_dst"]
85102
if { $slv_cdc_path != "" } {
86103
# From Safety Island master
87104
set_max_delay -datapath \
@@ -101,7 +118,6 @@ proc handle_mst_cdc { mst_cdc_path } {
101118
-to [get_pins $mst_cdc_path/i_cdc_fifo_gray_*/*i_sync/*reg*/D] \
102119
"$SOC_TCK"
103120
}
104-
105121
}
106122

107123
handle_mst_cdc [get_cells -hier gen_safety_island.i_safety_island_wrap]/i_cdc_out

target/xilinx/flavor_bd/.gitignore

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
.Xil
2-
carfield_*
3-
scripts/add_sources.tcl*
4-
scripts/add_includes.tcl
5-
out/
6-
probes.ltx
1+
# Makefile
2+
/out/
3+
# Bender
4+
/scripts/add_sources.tcl*
5+
/scripts/add_includes.tcl
6+
# Vivado
7+
/.Xil
8+
/carfield_*
9+
/probes.ltx
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Copyright 2024 ETH Zurich and University of Bologna.
2+
# Solderpad Hardware License, Version 0.51, see LICENSE for details.
3+
# SPDX-License-Identifier: SHL-0.51
4+
#
5+
# Cyril Koenig <[email protected]>
6+
7+
# VIOs are asynchronous
8+
set_false_path -through [get_pins -of_objects [get_cells design_1_i/vio_0] -filter {NAME =~ *probe*}]
9+
10+
# Create system clocks
11+
create_clock -period 4 -name sys_clk [get_pins design_1_i/util_ds_buf_0/IBUF_OUT]
12+
set_property CLOCK_DEDICATED_ROUTE BACKBONE [get_pins design_1_i/util_ds_buf_0/IBUF_OUT]
13+
create_clock -period 10 -name pcie_clk [get_nets design_1_i/util_ds_buf_1/U0/IBUF_OUT[0]]
14+
create_clock -period 10 -name pcie_clk_div [get_nets design_1_i/util_ds_buf_1/U0/IBUF_DS_ODIV2[0]]
15+
set_property CLOCK_DEDICATED_ROUTE BACKBONE [get_nets design_1_i/util_ds_buf_1/U0/IBUF_DS_ODIV2[0]]
16+
set_property CLOCK_DEDICATED_ROUTE BACKBONE [get_nets design_1_i/util_ds_buf_1/U0/IBUF_OUT[0]]
17+
18+
# PCIe clock LOC
19+
#set_property LOC [get_package_pins -of_objects [get_bels [get_sites -filter {NAME =~ *COMMON*} -of_objects [get_iobanks -of_objects [get_sites GTYE4_CHANNEL_X1Y15]]]/REFCLK0P]] [get_ports pcie_refclk_clk_p[0]]
20+
#set_property LOC [get_package_pins -of_objects [get_bels [get_sites -filter {NAME =~ *COMMON*} -of_objects [get_iobanks -of_objects [get_sites GTYE4_CHANNEL_X1Y15]]]/REFCLK0N]] [get_ports pcie_refclk_clk_n[0]]
21+
22+
set_property PACKAGE_PIN AW25 [get_ports "uart_rx_i"] ;# Bank 64 VCCO - VCC1V8_FPGA - IO_L9P_T1L_N4_AD12P_64
23+
set_property IOSTANDARD LVCMOS18 [get_ports "uart_rx_i"] ;# Bank 64 VCCO - VCC1V8_FPGA - IO_L9P_T1L_N4_AD12P_64
24+
set_property PACKAGE_PIN BB21 [get_ports "uart_tx_o"] ;# Bank 64 VCCO - VCC1V8_FPGA - IO_L8N_T1L_N3_AD5N_64
25+
set_property IOSTANDARD LVCMOS18 [get_ports "uart_tx_o"] ;# Bank 64 VCCO - VCC1V8_FPGA - IO_L8N_T1L_N3_AD5N_64
26+
#set_property PACKAGE_PIN BB22 [get_ports "uart_rts_o"] ;
27+
#set_property IOSTANDARD LVCMOS18 [get_ports "uart_rts_o"] ;
28+
#set_property PACKAGE_PIN AY25 [get_ports "uart_cts_i"] ;
29+
#set_property IOSTANDARD LVCMOS18 [get_ports "uart_cts_i"] ;
30+
31+
set_property PACKAGE_PIN L19 [get_ports cpu_reset] ;# Bank 73 VCCO - VCC1V2_FPGA - IO_T1U_N12_73
32+
set_property IOSTANDARD LVCMOS12 [get_ports cpu_reset] ;# Bank 73 VCCO - VCC1V2_FPGA - IO_T1U_N12_73
33+
34+
set_property BOARD_PART_PIN default_250mhz_clk1_n [get_ports default_250mhz_clk1_clk_n]
35+
set_property BOARD_PART_PIN default_250mhz_clk1_p [get_ports default_250mhz_clk1_clk_p]
36+
37+
set_property PACKAGE_PIN D12 [get_ports default_250mhz_clk1_clk_n] ; # Bank 71 VCCO - VCC1V2_FPGA - IO_L13N_T2L_N1_GC_QBC_71
38+
set_property IOSTANDARD DIFF_SSTL12 [get_ports default_250mhz_clk1_clk_n] ; # Bank 71 VCCO - VCC1V2_FPGA - IO_L13N_T2L_N1_GC_QBC_71
39+
set_property PACKAGE_PIN E12 [get_ports default_250mhz_clk1_clk_p] ; # Bank 71 VCCO - VCC1V2_FPGA - IO_L13P_T2L_N0_GC_QBC_71
40+
set_property IOSTANDARD DIFF_SSTL12 [get_ports default_250mhz_clk1_clk_p] ; # Bank 71 VCCO - VCC1V2_FPGA - IO_L13P_T2L_N0_GC_QBC_71
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Copyright 2025 ETH Zurich and University of Bologna.
2+
# Solderpad Hardware License, Version 0.51, see LICENSE for details.
3+
# SPDX-License-Identifier: SHL-0.51
4+
#
5+
# Cyril Koenig <[email protected]>
6+
#
7+
set_property PACKAGE_PIN N30 [get_ports jtag_tdo_o]
8+
set_property IOSTANDARD LVCMOS12 [get_ports jtag_tdo_o]
9+
10+
set_property PACKAGE_PIN P30 [get_ports jtag_tck_i]
11+
set_property IOSTANDARD LVCMOS12 [get_ports jtag_tck_i]
12+
13+
set_property PACKAGE_PIN N28 [get_ports jtag_tms_i]
14+
set_property IOSTANDARD LVCMOS12 [get_ports jtag_tms_i]
15+
16+
set_property PACKAGE_PIN M30 [get_ports jtag_tdi_i]
17+
set_property IOSTANDARD LVCMOS12 [get_ports jtag_tdi_i]

target/xilinx/flavor_bd/constraints/vcu128.xdc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# Copyright 2024 ETH Zurich and University of Bologna.
2+
# Solderpad Hardware License, Version 0.51, see LICENSE for details.
3+
# SPDX-License-Identifier: SHL-0.51
4+
#
5+
# Cyril Koenig <[email protected]>
6+
17
# VIOs are asynchronous
28
set_false_path -through [get_pins -of_objects [get_cells design_1_i/vio_0] -filter {NAME =~ *probe*}]
39

target/xilinx/flavor_bd/constraints/vcu128_ext_jtag.xdc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# Copyright 2025 ETH Zurich and University of Bologna.
2+
# Solderpad Hardware License, Version 0.51, see LICENSE for details.
3+
# SPDX-License-Identifier: SHL-0.51
4+
#
5+
# Cyril Koenig <[email protected]>
6+
17
set_property PACKAGE_PIN A23 [get_ports jtag_gnd_o] ;# A23 - C15 (FMCP_HSPC_LA10_N) - J1.04 - GND
28
set_property IOSTANDARD LVCMOS18 [get_ports jtag_gnd_o] ;
39

0 commit comments

Comments
 (0)