Skip to content

Commit 25156a9

Browse files
committed
Add example design for Alveo U55C
Signed-off-by: Alex Forencich <[email protected]>
1 parent 195be74 commit 25156a9

File tree

4 files changed

+187
-0
lines changed

4 files changed

+187
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Example designs are included for the following FPGA boards:
2121
* Intel Stratix 10 MX dev kit (Intel Stratix 10 MX 1SM21CHU1F53E1VG)
2222
* Terasic DE10-Agilex (Intel Agilex F AGFB014R24B2E2V)
2323
* Xilinx Alveo U50 (Xilinx Virtex UltraScale+ XCU50)
24+
* Xilinx Alveo U55C (Xilinx Virtex UltraScale+ XCU55C)
2425
* Xilinx Alveo U55N/Varium C1100 (Xilinx Virtex UltraScale+ XCU55N)
2526
* Xilinx Alveo U200 (Xilinx Virtex UltraScale+ XCU200)
2627
* Xilinx Alveo U250 (Xilinx Virtex UltraScale+ XCU250)

example/Alveo/fpga/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ The design implements the PCIe AXI lite master module, the PCIe AXI master modul
88

99
* FPGA
1010
* AU50: xcu50-fsvh2104-2-e
11+
* AU55C: xcu55c-fsvh2892-2L-e
1112
* AU55N/C1100: xcu55n-fsvh2892-2L-e
1213
* AU200: xcu200-fsgd2104-2-e
1314
* AU250: xcu250-fsgd2104-2-e
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
2+
# FPGA settings
3+
FPGA_PART = xcu55c-fsvh2892-2L-e
4+
FPGA_TOP = fpga
5+
FPGA_ARCH = virtexuplus
6+
7+
# Files for synthesis
8+
SYN_FILES = rtl/fpga_au55.v
9+
SYN_FILES += rtl/fpga_core.v
10+
SYN_FILES += rtl/common/example_core_pcie_us.v
11+
SYN_FILES += rtl/common/example_core_pcie.v
12+
SYN_FILES += rtl/common/example_core.v
13+
SYN_FILES += rtl/common/axi_ram.v
14+
SYN_FILES += lib/pcie/rtl/pcie_us_if.v
15+
SYN_FILES += lib/pcie/rtl/pcie_us_if_rc.v
16+
SYN_FILES += lib/pcie/rtl/pcie_us_if_rq.v
17+
SYN_FILES += lib/pcie/rtl/pcie_us_if_cq.v
18+
SYN_FILES += lib/pcie/rtl/pcie_us_if_cc.v
19+
SYN_FILES += lib/pcie/rtl/pcie_us_cfg.v
20+
SYN_FILES += lib/pcie/rtl/pcie_axil_master.v
21+
SYN_FILES += lib/pcie/rtl/pcie_axi_master.v
22+
SYN_FILES += lib/pcie/rtl/pcie_axi_master_rd.v
23+
SYN_FILES += lib/pcie/rtl/pcie_axi_master_wr.v
24+
SYN_FILES += lib/pcie/rtl/pcie_tlp_demux_bar.v
25+
SYN_FILES += lib/pcie/rtl/pcie_tlp_demux.v
26+
SYN_FILES += lib/pcie/rtl/pcie_tlp_mux.v
27+
SYN_FILES += lib/pcie/rtl/pcie_tlp_fifo.v
28+
SYN_FILES += lib/pcie/rtl/pcie_tlp_fifo_raw.v
29+
SYN_FILES += lib/pcie/rtl/pcie_msix.v
30+
SYN_FILES += lib/pcie/rtl/dma_if_pcie.v
31+
SYN_FILES += lib/pcie/rtl/dma_if_pcie_rd.v
32+
SYN_FILES += lib/pcie/rtl/dma_if_pcie_wr.v
33+
SYN_FILES += lib/pcie/rtl/dma_psdpram.v
34+
SYN_FILES += lib/pcie/rtl/priority_encoder.v
35+
SYN_FILES += lib/pcie/rtl/pulse_merge.v
36+
37+
# XDC files
38+
XDC_FILES = fpga_au55.xdc
39+
40+
# IP
41+
IP_TCL_FILES = ip/pcie4c_uscale_plus_0.tcl
42+
43+
# Configuration
44+
CONFIG_TCL_FILES = ./config.tcl
45+
46+
include ../common/vivado.mk
47+
48+
program: $(FPGA_TOP).bit
49+
echo "open_hw" > program.tcl
50+
echo "connect_hw_server" >> program.tcl
51+
echo "open_hw_target" >> program.tcl
52+
echo "current_hw_device [lindex [get_hw_devices] 0]" >> program.tcl
53+
echo "refresh_hw_device -update_hw_probes false [current_hw_device]" >> program.tcl
54+
echo "set_property PROGRAM.FILE {$(FPGA_TOP).bit} [current_hw_device]" >> program.tcl
55+
echo "program_hw_devices [current_hw_device]" >> program.tcl
56+
echo "exit" >> program.tcl
57+
vivado -nojournal -nolog -mode batch -source program.tcl
58+
59+
%.mcs %.prm: %.bit
60+
echo "write_cfgmem -force -format mcs -size 128 -interface SPIx4 -loadbit {up 0x01002000 $*.bit} -checksum -file $*.mcs" > generate_mcs.tcl
61+
echo "exit" >> generate_mcs.tcl
62+
vivado -nojournal -nolog -mode batch -source generate_mcs.tcl
63+
mkdir -p rev
64+
COUNT=100; \
65+
while [ -e rev/$*_rev$$COUNT.bit ]; \
66+
do COUNT=$$((COUNT+1)); done; \
67+
COUNT=$$((COUNT-1)); \
68+
for x in .mcs .prm; \
69+
do cp $*$$x rev/$*_rev$$COUNT$$x; \
70+
echo "Output: rev/$*_rev$$COUNT$$x"; done;
71+
72+
flash: $(FPGA_TOP).mcs $(FPGA_TOP).prm
73+
echo "open_hw" > flash.tcl
74+
echo "connect_hw_server" >> flash.tcl
75+
echo "open_hw_target" >> flash.tcl
76+
echo "current_hw_device [lindex [get_hw_devices] 0]" >> flash.tcl
77+
echo "refresh_hw_device -update_hw_probes false [current_hw_device]" >> flash.tcl
78+
echo "create_hw_cfgmem -hw_device [current_hw_device] [lindex [get_cfgmem_parts {mt25qu01g-spi-x1_x2_x4}] 0]" >> flash.tcl
79+
echo "current_hw_cfgmem -hw_device [current_hw_device] [get_property PROGRAM.HW_CFGMEM [current_hw_device]]" >> flash.tcl
80+
echo "set_property PROGRAM.FILES [list \"$(FPGA_TOP).mcs\"] [current_hw_cfgmem]" >> flash.tcl
81+
echo "set_property PROGRAM.PRM_FILES [list \"$(FPGA_TOP).prm\"] [current_hw_cfgmem]" >> flash.tcl
82+
echo "set_property PROGRAM.ERASE 1 [current_hw_cfgmem]" >> flash.tcl
83+
echo "set_property PROGRAM.CFG_PROGRAM 1 [current_hw_cfgmem]" >> flash.tcl
84+
echo "set_property PROGRAM.VERIFY 1 [current_hw_cfgmem]" >> flash.tcl
85+
echo "set_property PROGRAM.CHECKSUM 0 [current_hw_cfgmem]" >> flash.tcl
86+
echo "set_property PROGRAM.ADDRESS_RANGE {use_file} [current_hw_cfgmem]" >> flash.tcl
87+
echo "set_property PROGRAM.UNUSED_PIN_TERMINATION {pull-none} [current_hw_cfgmem]" >> flash.tcl
88+
echo "create_hw_bitstream -hw_device [current_hw_device] [get_property PROGRAM.HW_CFGMEM_BITFILE [current_hw_device]]" >> flash.tcl
89+
echo "program_hw_devices [current_hw_device]" >> flash.tcl
90+
echo "refresh_hw_device [current_hw_device]" >> flash.tcl
91+
echo "program_hw_cfgmem -hw_cfgmem [current_hw_cfgmem]" >> flash.tcl
92+
echo "boot_hw_device [current_hw_device]" >> flash.tcl
93+
echo "exit" >> flash.tcl
94+
vivado -nojournal -nolog -mode batch -source flash.tcl
95+
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
set params [dict create]
2+
3+
# Board info
4+
set board_vendor_id [expr 0x10ee]
5+
set board_device_id [expr 0x9037]
6+
7+
# PCIe IDs
8+
set pcie_vendor_id [expr 0x1234]
9+
set pcie_device_id [expr 0x0001]
10+
set pcie_class_code [expr 0x058000]
11+
set pcie_revision_id [expr 0x00]
12+
set pcie_subsystem_vendor_id $board_vendor_id
13+
set pcie_subsystem_device_id $board_device_id
14+
15+
# BAR sizes
16+
dict set params BAR0_APERTURE "24"
17+
dict set params BAR2_APERTURE "24"
18+
dict set params BAR4_APERTURE "16"
19+
20+
# PCIe IP core settings
21+
set pcie [get_ips pcie4c_uscale_plus_0]
22+
23+
# Internal interface settings
24+
dict set params AXIS_PCIE_DATA_WIDTH [regexp -all -inline -- {[0-9]+} [get_property CONFIG.axisten_if_width $pcie]]
25+
26+
# configure BAR settings
27+
proc configure_bar {pcie pf bar aperture} {
28+
set size_list {Bytes Kilobytes Megabytes Gigabytes Terabytes Petabytes Exabytes}
29+
for { set i 0 } { $i < [llength $size_list] } { incr i } {
30+
set scale [lindex $size_list $i]
31+
32+
if {$aperture > 0 && $aperture < ($i+1)*10} {
33+
set size [expr 1 << $aperture - ($i*10)]
34+
35+
puts "${pcie} PF${pf} BAR${bar}: aperture ${aperture} bits ($size $scale)"
36+
37+
set pcie_config [dict create]
38+
39+
dict set pcie_config "CONFIG.pf${pf}_bar${bar}_enabled" {true}
40+
dict set pcie_config "CONFIG.pf${pf}_bar${bar}_type" {Memory}
41+
dict set pcie_config "CONFIG.pf${pf}_bar${bar}_64bit" {true}
42+
dict set pcie_config "CONFIG.pf${pf}_bar${bar}_prefetchable" {true}
43+
dict set pcie_config "CONFIG.pf${pf}_bar${bar}_scale" $scale
44+
dict set pcie_config "CONFIG.pf${pf}_bar${bar}_size" $size
45+
46+
set_property -dict $pcie_config $pcie
47+
48+
return
49+
}
50+
}
51+
puts "${pcie} PF${pf} BAR${bar}: disabled"
52+
set_property "CONFIG.pf${pf}_bar${bar}_enabled" {false} $pcie
53+
}
54+
55+
# Configure BARs
56+
configure_bar $pcie 0 0 [dict get $params BAR0_APERTURE]
57+
configure_bar $pcie 0 2 [dict get $params BAR2_APERTURE]
58+
configure_bar $pcie 0 4 [dict get $params BAR4_APERTURE]
59+
60+
# PCIe IP core configuration
61+
set pcie_config [dict create]
62+
63+
# PCIe IDs
64+
dict set pcie_config "CONFIG.vendor_id" [format "%04x" $pcie_vendor_id]
65+
dict set pcie_config "CONFIG.PF0_DEVICE_ID" [format "%04x" $pcie_device_id]
66+
dict set pcie_config "CONFIG.PF0_CLASS_CODE" [format "%06x" $pcie_class_code]
67+
dict set pcie_config "CONFIG.PF0_REVISION_ID" [format "%02x" $pcie_revision_id]
68+
dict set pcie_config "CONFIG.PF0_SUBSYSTEM_VENDOR_ID" [format "%04x" $pcie_subsystem_vendor_id]
69+
dict set pcie_config "CONFIG.PF0_SUBSYSTEM_ID" [format "%04x" $pcie_subsystem_device_id]
70+
71+
# MSI-X
72+
dict set pcie_config "CONFIG.pf0_msi_enabled" {false}
73+
dict set pcie_config "CONFIG.pf0_msix_enabled" {true}
74+
dict set pcie_config "CONFIG.PF0_MSIX_CAP_TABLE_SIZE" {01F}
75+
dict set pcie_config "CONFIG.PF0_MSIX_CAP_TABLE_BIR" {BAR_5:4}
76+
dict set pcie_config "CONFIG.PF0_MSIX_CAP_TABLE_OFFSET" {00000000}
77+
dict set pcie_config "CONFIG.PF0_MSIX_CAP_PBA_BIR" {BAR_5:4}
78+
dict set pcie_config "CONFIG.PF0_MSIX_CAP_PBA_OFFSET" {00008000}
79+
dict set pcie_config "CONFIG.MSI_X_OPTIONS" {MSI-X_External}
80+
81+
set_property -dict $pcie_config $pcie
82+
83+
# apply parameters to top-level
84+
set param_list {}
85+
dict for {name value} $params {
86+
lappend param_list $name=$value
87+
}
88+
89+
# set_property generic $param_list [current_fileset]
90+
set_property generic $param_list [get_filesets sources_1]

0 commit comments

Comments
 (0)