Skip to content

Commit c63d1bf

Browse files
committed
Add VCU118 + HTG 6x QSFP28 example design
Signed-off-by: Alex Forencich <[email protected]>
1 parent 3190175 commit c63d1bf

23 files changed

+10221
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Verilog Ethernet VCU118 + HTG 6x QSFP28 FMC+ Example Design
2+
3+
## Introduction
4+
5+
This example design targets the Xilinx VCU118 FPGA board with the HiTech Global HTG-FMC-X6QSFP28 FMC+ board installed on J2.
6+
7+
The design by default listens to UDP port 1234 at IP address 192.168.1.128 and will echo back any packets received. The design will also respond correctly to ARP requests. The design also enables the gigabit Ethernet interface for testing with a QSFP loopback adapter.
8+
9+
The design is configured to run all 8 QSFP28 modules synchronous to the QSFP Si570 (U38) on the VCU118. This is done by forwarding the MGT reference clock for QSFP1 through the FPGA to the SYNC_C2M pins on the FMC+, which is connected as a reference input to the Si5341 PLL (U7) on the FMC+.
10+
11+
* FPGA: xcvu9p-flga2104-2L-e
12+
* PHY: 25G BASE-R PHY IP core and internal GTY transceiver
13+
14+
## How to build
15+
16+
Run make to build. Ensure that the Xilinx Vivado toolchain components are in PATH.
17+
18+
## How to test
19+
20+
Run make program to program the VCU118 board with Vivado. Then run
21+
22+
netcat -u 192.168.1.128 1234
23+
24+
to open a UDP connection to port 1234. Any text entered into netcat will be echoed back after pressing enter.
25+
26+
It is also possible to use hping to test the design by running
27+
28+
hping 192.168.1.128 -2 -p 1234 -d 1024
29+
30+
Note that the gigabit PHY is also enabled for debugging. The gigabit port can be inserted into the 25G data path between the 25G MAC and 25G PHY so that the 25G interface can be tested with a QSFP loopback adapter. Turn on SW12.1 to insert the gigabit port into the 25G data path, or off to bypass the gigabit port. Turn on SW12.2 to place the port in the TX path or off to place the port in the RX path.
Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
###################################################################
2+
#
3+
# Xilinx Vivado FPGA Makefile
4+
#
5+
# Copyright (c) 2016 Alex Forencich
6+
#
7+
###################################################################
8+
#
9+
# Parameters:
10+
# FPGA_TOP - Top module name
11+
# FPGA_FAMILY - FPGA family (e.g. VirtexUltrascale)
12+
# FPGA_DEVICE - FPGA device (e.g. xcvu095-ffva2104-2-e)
13+
# SYN_FILES - space-separated list of source files
14+
# INC_FILES - space-separated list of include files
15+
# XDC_FILES - space-separated list of timing constraint files
16+
# XCI_FILES - space-separated list of IP XCI files
17+
#
18+
# Example:
19+
#
20+
# FPGA_TOP = fpga
21+
# FPGA_FAMILY = VirtexUltrascale
22+
# FPGA_DEVICE = xcvu095-ffva2104-2-e
23+
# SYN_FILES = rtl/fpga.v
24+
# XDC_FILES = fpga.xdc
25+
# XCI_FILES = ip/pcspma.xci
26+
# include ../common/vivado.mk
27+
#
28+
###################################################################
29+
30+
# phony targets
31+
.PHONY: fpga vivado tmpclean clean distclean
32+
33+
# prevent make from deleting intermediate files and reports
34+
.PRECIOUS: %.xpr %.bit %.mcs %.prm
35+
.SECONDARY:
36+
37+
CONFIG ?= config.mk
38+
-include ../$(CONFIG)
39+
40+
FPGA_TOP ?= fpga
41+
PROJECT ?= $(FPGA_TOP)
42+
43+
SYN_FILES_REL = $(foreach p,$(SYN_FILES),$(if $(filter /% ./%,$p),$p,../$p))
44+
INC_FILES_REL = $(foreach p,$(INC_FILES),$(if $(filter /% ./%,$p),$p,../$p))
45+
XCI_FILES_REL = $(foreach p,$(XCI_FILES),$(if $(filter /% ./%,$p),$p,../$p))
46+
IP_TCL_FILES_REL = $(foreach p,$(IP_TCL_FILES),$(if $(filter /% ./%,$p),$p,../$p))
47+
CONFIG_TCL_FILES_REL = $(foreach p,$(CONFIG_TCL_FILES),$(if $(filter /% ./%,$p),$p,../$p))
48+
49+
ifdef XDC_FILES
50+
XDC_FILES_REL = $(foreach p,$(XDC_FILES),$(if $(filter /% ./%,$p),$p,../$p))
51+
else
52+
XDC_FILES_REL = $(PROJECT).xdc
53+
endif
54+
55+
###################################################################
56+
# Main Targets
57+
#
58+
# all: build everything
59+
# clean: remove output files and project files
60+
###################################################################
61+
62+
all: fpga
63+
64+
fpga: $(PROJECT).bit
65+
66+
vivado: $(PROJECT).xpr
67+
vivado $(PROJECT).xpr
68+
69+
tmpclean::
70+
-rm -rf *.log *.jou *.cache *.gen *.hbs *.hw *.ip_user_files *.runs *.xpr *.html *.xml *.sim *.srcs *.str .Xil defines.v
71+
-rm -rf create_project.tcl update_config.tcl run_synth.tcl run_impl.tcl generate_bit.tcl
72+
73+
clean:: tmpclean
74+
-rm -rf *.bit *.ltx program.tcl generate_mcs.tcl *.mcs *.prm flash.tcl
75+
-rm -rf *_utilization.rpt *_utilization_hierarchical.rpt
76+
77+
distclean:: clean
78+
-rm -rf rev
79+
80+
###################################################################
81+
# Target implementations
82+
###################################################################
83+
84+
# Vivado project file
85+
create_project.tcl: Makefile $(XCI_FILES_REL) $(IP_TCL_FILES_REL)
86+
rm -rf defines.v
87+
touch defines.v
88+
for x in $(DEFS); do echo '`define' $$x >> defines.v; done
89+
echo "create_project -force -part $(FPGA_PART) $(PROJECT)" > $@
90+
echo "add_files -fileset sources_1 defines.v $(SYN_FILES_REL)" >> $@
91+
echo "set_property top $(FPGA_TOP) [current_fileset]" >> $@
92+
echo "add_files -fileset constrs_1 $(XDC_FILES_REL)" >> $@
93+
for x in $(XCI_FILES_REL); do echo "import_ip $$x" >> $@; done
94+
for x in $(IP_TCL_FILES_REL); do echo "source $$x" >> $@; done
95+
for x in $(CONFIG_TCL_FILES_REL); do echo "source $$x" >> $@; done
96+
97+
update_config.tcl: $(CONFIG_TCL_FILES_REL) $(SYN_FILES_REL) $(INC_FILES_REL) $(XDC_FILES_REL)
98+
echo "open_project -quiet $(PROJECT).xpr" > $@
99+
for x in $(CONFIG_TCL_FILES_REL); do echo "source $$x" >> $@; done
100+
101+
$(PROJECT).xpr: create_project.tcl update_config.tcl
102+
vivado -nojournal -nolog -mode batch $(foreach x,$?,-source $x)
103+
104+
# synthesis run
105+
$(PROJECT).runs/synth_1/$(PROJECT).dcp: create_project.tcl update_config.tcl $(SYN_FILES_REL) $(INC_FILES_REL) $(XDC_FILES_REL) | $(PROJECT).xpr
106+
echo "open_project $(PROJECT).xpr" > run_synth.tcl
107+
echo "reset_run synth_1" >> run_synth.tcl
108+
echo "launch_runs -jobs 4 synth_1" >> run_synth.tcl
109+
echo "wait_on_run synth_1" >> run_synth.tcl
110+
vivado -nojournal -nolog -mode batch -source run_synth.tcl
111+
112+
# implementation run
113+
$(PROJECT).runs/impl_1/$(PROJECT)_routed.dcp: $(PROJECT).runs/synth_1/$(PROJECT).dcp
114+
echo "open_project $(PROJECT).xpr" > run_impl.tcl
115+
echo "reset_run impl_1" >> run_impl.tcl
116+
echo "launch_runs -jobs 4 impl_1" >> run_impl.tcl
117+
echo "wait_on_run impl_1" >> run_impl.tcl
118+
echo "open_run impl_1" >> run_impl.tcl
119+
echo "report_utilization -file $(PROJECT)_utilization.rpt" >> run_impl.tcl
120+
echo "report_utilization -hierarchical -file $(PROJECT)_utilization_hierarchical.rpt" >> run_impl.tcl
121+
vivado -nojournal -nolog -mode batch -source run_impl.tcl
122+
123+
# bit file
124+
$(PROJECT).bit $(PROJECT).ltx: $(PROJECT).runs/impl_1/$(PROJECT)_routed.dcp
125+
echo "open_project $(PROJECT).xpr" > generate_bit.tcl
126+
echo "open_run impl_1" >> generate_bit.tcl
127+
echo "write_bitstream -force $(PROJECT).runs/impl_1/$(PROJECT).bit" >> generate_bit.tcl
128+
echo "write_debug_probes -force $(PROJECT).runs/impl_1/$(PROJECT).ltx" >> generate_bit.tcl
129+
vivado -nojournal -nolog -mode batch -source generate_bit.tcl
130+
ln -f -s $(PROJECT).runs/impl_1/$(PROJECT).bit .
131+
if [ -e $(PROJECT).runs/impl_1/$(PROJECT).ltx ]; then ln -f -s $(PROJECT).runs/impl_1/$(PROJECT).ltx .; fi
132+
mkdir -p rev
133+
COUNT=100; \
134+
while [ -e rev/$(PROJECT)_rev$$COUNT.bit ]; \
135+
do COUNT=$$((COUNT+1)); done; \
136+
cp -pv $(PROJECT).runs/impl_1/$(PROJECT).bit rev/$(PROJECT)_rev$$COUNT.bit; \
137+
if [ -e $(PROJECT).runs/impl_1/$(PROJECT).ltx ]; then cp -pv $(PROJECT).runs/impl_1/$(PROJECT).ltx rev/$(PROJECT)_rev$$COUNT.ltx; fi

0 commit comments

Comments
 (0)