-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
191 additions
and
155 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 |
---|---|---|
|
@@ -5,15 +5,15 @@ | |
# Author: Cyril Koenig <[email protected]> | ||
|
||
# bender targets | ||
xilinx_targs += -t fpga | ||
xilinx_targs_common += -t fpga | ||
|
||
# bender defines | ||
xilinx_defs += -D PULP_FPGA_EMUL | ||
xilinx_defs_common += -D PULP_FPGA_EMUL | ||
|
||
# Conditionally add GEN_{island} to bender define | ||
define check_enable_island | ||
ifeq ($($(1)),1) | ||
xilinx_defs += -D$(1)=1 | ||
xilinx_defs_common += -D$(1)=1 | ||
endif | ||
endef | ||
|
||
|
@@ -25,7 +25,7 @@ $(eval $(call check_enable_island,GEN_NO_HYPERBUS)) | |
$(eval $(call check_enable_island,GEN_EXT_JTAG)) | ||
|
||
ifeq ($(GEN_EXT_JTAG),0) | ||
xilinx_targs += -t bscane | ||
xilinx_targs_common += -t bscane | ||
endif | ||
|
||
# note : bender targets are later modified in xilinx.mk |
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
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 |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
# Cyril Koenig <[email protected]> | ||
|
||
# | ||
# User input Makefile variables | ||
# Makefile variables (user inputs are in capital letters) | ||
# | ||
|
||
XILINX_PROJECT ?= carfield | ||
|
@@ -30,13 +30,11 @@ XILINX_CHECK_TIMING ?= 0 | |
VIVADO_MODE ?= batch | ||
VIVADO_FLAGS ?= -nojournal -mode $(VIVADO_MODE) | ||
|
||
xilinx_ip_dir := $(CAR_XIL_DIR)/xilinx_ips | ||
xilinx_ip_dirs := $(wildcard $(xilinx_ip_dir)/*) | ||
|
||
xilinx_ip_dir := $(CAR_XIL_DIR)/xilinx_ips | ||
xilinx_bit := $(CAR_XIL_DIR)/out/$(XILINX_PROJECT)_$(XILINX_FLAVOR)_$(XILINX_BOARD).bit | ||
|
||
# | ||
# Include flavors | ||
# Include other makefiles flavors | ||
# | ||
|
||
include $(CAR_XIL_DIR)/flavor_vanilla/flavor_vanilla.mk | ||
|
@@ -47,19 +45,20 @@ include $(CAR_XIL_DIR)/flavor_bd/flavor_bd.mk | |
# | ||
|
||
vivado_env := $(vivado_env_$(XILINX_FLAVOR)) | ||
xilinx_targs := $(xilinx_targs_$(XILINX_FLAVOR)) | ||
xilinx_defs := $(xilinx_defs_$(XILINX_FLAVOR)) | ||
|
||
# | ||
# Rules | ||
# IPs compile rules | ||
# | ||
|
||
# Generate ips | ||
%.xci: | ||
${MAKE} -C $(xilinx_ip_dir)/$(basename $(notdir $@)) \ | ||
XILINX_USE_ARTIFACTS=$(XILINX_USE_ARTIFACTS) \ | ||
XILINX_ARTIFACTS_ROOT=$(XILINX_ARTIFACTS_ROOT) \ | ||
vivado_env="$(subst ",\",$(vivado_env))" \ | ||
VIVADO="$(VIVADO)" \ | ||
clean all | ||
# Note: at the moment xilinx_ips uses vivado_env defined above, | ||
# but it could re-define its own vivado_env and xilinx_targs | ||
include $(CAR_XIL_DIR)/xilinx_ips/xilinx_ips.mk | ||
|
||
# | ||
# Top level compile rules | ||
# | ||
|
||
# Copy bitstream and probe file to final output location (/target/xilinx/out) | ||
$(CAR_XIL_DIR)/out/%.bit: $(xilinx_bit_$(XILINX_FLAVOR)) | ||
|
@@ -69,8 +68,8 @@ $(CAR_XIL_DIR)/out/%.bit: $(xilinx_bit_$(XILINX_FLAVOR)) | |
cp $(patsubst %.bit,%.ltx,$< $@); \ | ||
fi | ||
|
||
# Build a bitstream | ||
car-xil-all: car-xil-clean-ips $(xilinx_bit) | ||
# Build bitstream | ||
car-xil-all: $(xilinx_bit) | ||
|
||
# Program last bitstream | ||
car-xil-program: | ||
|
@@ -81,12 +80,6 @@ car-xil-program: | |
car-xil-flash: $(CAR_SW_DIR)/boot/linux_carfield_$(XILINX_FLAVOR)_$(XILINX_BOARD).gpt.bin | ||
$(vivado_env) FILE=$< OFFSET=0 $(VIVADO) $(VIVADO_FLAGS) -source $(CAR_XIL_DIR)/scripts/flash_spi.tcl | ||
|
||
# Clean a given IP folder | ||
%-xlnx-ip-clean: % | ||
make -C $< clean | ||
# Clean all IP folder using rule above | ||
car-xil-clean-ips: $(addsuffix -xlnx-ip-clean,$(shell find $(xilinx_ip_dir)/ -maxdepth 1 -mindepth 1 -type d)) | ||
|
||
car-xil-clean: car-xil-clean-ips car-xil-clean-vanilla | ||
car-xil-clean: car-xil-clean-vanilla car-xil-clean-bd xilinx-ip-clean-all | ||
|
||
.PHONY: car-xil-program car-xil-flash car-xil-clean car-xil-all car-xil-clean-ips | ||
.PHONY: car-xil-program car-xil-flash car-xil-clean car-xil-all |
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 |
---|---|---|
@@ -1,5 +1,10 @@ | ||
xlnx*/* | ||
!xlnx*/tcl | ||
!Makefile | ||
!common.mk | ||
!*.prj | ||
*.cache | ||
*.gen | ||
*.hw | ||
*.srcs | ||
*.xpr | ||
component.xml | ||
xgui | ||
*.jou | ||
*.log | ||
add_sources.* |
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,21 @@ | ||
# 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 | ||
|
||
ROOT_carfield_ip := $(CAR_XIL_DIR)/xilinx_ips/carfield_ip | ||
XILINX_USE_ARTIFACTS_carfield_ip := 0 | ||
|
||
# Add additional requirements for this ip | ||
IP_DEP_carfield_ip := $(CAR_XIL_DIR)/xilinx_ips/carfield_ip/tcl/add_sources.tcl | ||
|
||
# Generate the bender script for the ip | ||
$(CAR_XIL_DIR)/xilinx_ips/carfield_ip/tcl/add_sources.tcl: Bender.yml | ||
# Add source files for ip | ||
$(BENDER) script vivado $(xilinx_targs) $(common_defs) $(xilinx_defs_bd) > $@ | ||
cp $@ [email protected] | ||
# Remove ibex's vendored prim includes as they conflict with opentitan's vendored prim includes | ||
grep -v -P "lowrisc_ip/ip/prim/rtl" $@ > $@-tmp | ||
mv $@-tmp $@ | ||
# Override system verilog files | ||
target/xilinx/scripts/overrides.sh $@ | ||
echo "" >> $@ |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.