-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fpga: Added flow and CI for implementation on VCU128 boards, added ov…
…erride files for Vivado compilation only
- Loading branch information
Showing
39 changed files
with
6,903 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -72,7 +72,7 @@ endif | |
###################### | ||
|
||
CAR_NONFREE_REMOTE ?= [email protected]:carfield/carfield-nonfree.git | ||
CAR_NONFREE_COMMIT ?= 5b6b7ed7c08ec079a6725f6b2c3ddf69fea3ba16 | ||
CAR_NONFREE_COMMIT ?= dafcfee5ad118c16a9795c25ce6a6f68e8bd6177 | ||
|
||
## Clone the non-free verification IP for the Carfield TB | ||
car-nonfree-init: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
# Copyright 2022 ETH Zurich and University of Bologna. | ||
# Licensed under the Apache License, Version 2.0, see LICENSE for details. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# Nicole Narr <[email protected]> | ||
# Christopher Reinwardt <[email protected]> | ||
# Cyril Koenig <[email protected]> | ||
|
||
BENDER ?= bender | ||
|
||
PROJECT ?= carfield | ||
|
||
# Board in {genesys2, zcu102, vcu128} | ||
BOARD ?= vcu128 | ||
ip-dir := xilinx | ||
|
||
# Derive from board | ||
bender-targets := -t fpga -t $(BOARD) -t cv64a6_imafdcsclic_sv39 -t cva6 -t mchan -t spatz -t cv32e40p_use_ff_regfile | ||
bender-defines := -D FEATURE_ICACHE_STAT -D PRIVATE_ICACHE -D HIERARCHY_ICACHE_32BIT -D CLUSTER_ALIAS -D PULP_FPGA_EMUL | ||
|
||
VIVADO ?= vitis-2020.2 vivado | ||
|
||
# Select board specific variables | ||
ifeq ($(BOARD),vcu128) | ||
XILINX_PART ?= xcvu37p-fsvh2892-2L-e | ||
XILINX_BOARD ?= xilinx.com:vcu128:part0:1.0 | ||
ips-names := xlnx_clk_wiz xlnx_vio | ||
endif | ||
ifeq ($(BOARD),genesys2) | ||
XILINX_PART ?= xc7k325tffg900-2 | ||
XILINX_BOARD ?= digilentinc.com:genesys2:part0:1.1 | ||
ips-names := xlnx_mig_7_ddr3 xlnx_clk_wiz xlnx_vio | ||
FPGA_PATH ?= xilinx_tcf/Digilent/200300A8C60DB | ||
endif | ||
ifeq ($(BOARD),zcu102) | ||
XILINX_PART ?= xczu9eg-ffvb1156-2-e | ||
XILINX_BOARD ?= xilinx.com:zcu102:part0:3.4 | ||
ips-names := xlnx_mig_ddr4 xlnx_clk_wiz xlnx_vio | ||
endif | ||
|
||
# Derive from ips | ||
ips := $(addsuffix .xci ,$(basename $(ips-names))) | ||
bender-targets := $(bender-targets) $(addprefix -t ,$(basename $(ips))) | ||
|
||
# Select islands | ||
ifeq ($(GEN_PULP_CLUSTER), 1) | ||
bender-defines += -D GEN_PULP_CLUSTER=1 | ||
endif | ||
ifeq ($(GEN_SAFETY_ISLAND), 1) | ||
bender-defines += -D GEN_SAFETY_ISLAND=1 | ||
endif | ||
ifeq ($(GEN_SPATZ_CLUSTER), 1) | ||
bender-defines += -D GEN_SPATZ_CLUSTER=1 | ||
endif | ||
ifeq ($(GEN_OPEN_TITAN), 1) | ||
bender-defines += -D GEN_OPEN_TITAN=1 | ||
endif | ||
|
||
out := out | ||
bit := $(out)/$(PROJECT)_top_xilinx.bit | ||
mcs := $(out)/$(PROJECT)_top_xilinx.mcs | ||
|
||
VIVADOENV ?= PROJECT=$(PROJECT) \ | ||
BOARD=$(BOARD) \ | ||
XILINX_PART=$(XILINX_PART) \ | ||
XILINX_BOARD=$(XILINX_BOARD) \ | ||
PORT=$(XILINX_PORT) \ | ||
HOST=$(XILINX_HOST) \ | ||
FPGA_PATH=$(FPGA_PATH) \ | ||
BIT=$(BIT) | ||
|
||
# select IIS-internal tool commands if we run on IIS machines | ||
ifneq (,$(wildcard /etc/iis.version)) | ||
VIVADO ?= vitis-2020.2 vivado | ||
else | ||
VIVADO ?= vivado | ||
endif | ||
|
||
MODE ?= gui | ||
VIVADOFLAGS ?= -nojournal -mode $(MODE) -source scripts/prologue.tcl | ||
|
||
all: $(bit) | ||
|
||
# Include Xilinx IPs simulation makefile | ||
include sim/simulate.mk | ||
|
||
# Generate mcs from bitstream | ||
$(mcs): $(bit) | ||
$(VIVADOENV) $(VIVADO) $(VIVADOFLAGS) -source scripts/write_cfgmem.tcl -tclargs $@ $^ | ||
|
||
$(bit): $(ips) scripts/add_sources.tcl | ||
@mkdir -p $(out) | ||
$(VIVADOENV) $(VIVADO) $(VIVADOFLAGS) -source scripts/run.tcl | ||
cp $(PROJECT).runs/impl_1/$(PROJECT)* ./$(out) | ||
|
||
%.xci: | ||
@echo "Generating IP $(basename $@)" | ||
cd $(ip-dir)/$(basename $@) && $(MAKE) clean && $(VIVADOENV) VIVADO="$(VIVADO)" $(MAKE) | ||
cp $(ip-dir)/$(basename $@)/$(basename $@).srcs/sources_1/ip/$(basename $@)/$@ $@ | ||
|
||
gui: | ||
@echo "Starting $(vivado) GUI" | ||
@$(VIVADOENV) $(VIVADO) -nojournal -mode gui $(PROJECT).xpr & | ||
|
||
program: #$(bit) | ||
@echo "Programming board $(BOARD) ($(XILINX_PART))" | ||
$(VIVADOENV) $(VIVADO) $(VIVADOFLAGS) -source scripts/program.tcl | ||
|
||
clean: | ||
rm -rf *.log *.jou *.str *.mif *.xci *.xpr .Xil/ $(out) $(PROJECT).cache $(PROJECT).hw $(PROJECT).ioplanning $(PROJECT).ip_user_files $(PROJECT).runs $(PROJECT).sim | ||
|
||
# Clean only top and copy back the IPs output here | ||
rebuild_top: | ||
${MAKE} clean | ||
rm -f scripts/add_sources.tcl | ||
find xilinx -wholename "**/*.srcs/**/*.xci" | xargs -n 1 -I {} cp {} . | ||
${MAKE} $(bit) | ||
|
||
# Bender | ||
scripts/add_sources.tcl: ../../Bender.yml | ||
$(BENDER) script vivado $(bender-targets) $(bender-defines) > $@ | ||
cp $@ $@.bak | ||
./scripts/overrides.sh $@ | ||
echo "" >> $@ | ||
echo "#Put the overrides folder at the head of the include list" >> $@ | ||
echo "set_property include_dirs [ \\" >> $@ | ||
echo " concat \"\$$ROOT/target/xilinx/src/overrides/include \" [get_property include_dirs [current_fileset]] \\" >> $@ | ||
echo "] [current_fileset]" >> $@ | ||
|
||
.PHONY: clean sim |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# VCU128 emulation | ||
|
||
```bash | ||
# Build the bitstream: | ||
make | ||
# Re-build the bitstream without | ||
# re-building the IPs: | ||
make rebuild-top | ||
# Simulate with the IPs | ||
# Note you need to generate the | ||
# Vivado IP models before | ||
make sim | ||
``` |
Oops, something went wrong.