-
Notifications
You must be signed in to change notification settings - Fork 269
Expand file tree
/
Copy pathfpga.mk
More file actions
92 lines (74 loc) · 3.36 KB
/
Copy pathfpga.mk
File metadata and controls
92 lines (74 loc) · 3.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# See LICENSE for license details.
#############################
# FPGA Build Initialization #
#############################
platforms_dir := $(abspath $(firesim_base_dir)/../platforms)
ifeq ($(PLATFORM), vitis)
board_dir := $(platforms_dir)/vitis
else ifeq ($(PLATFORM), xilinx_alveo_u250)
board_dir := $(platforms_dir)/xilinx_alveo_u250
else ifeq ($(PLATFORM), xilinx_alveo_u280)
board_dir := $(platforms_dir)/xilinx_alveo_u280
else ifeq ($(PLATFORM), xilinx_alveo_u200)
board_dir := $(platforms_dir)/xilinx_alveo_u200
else ifeq ($(PLATFORM), xilinx_vcu118)
board_dir := $(platforms_dir)/xilinx_vcu118/garnet-firesim
else ifeq ($(PLATFORM), rhsresearch_nitefury_ii)
board_dir := $(platforms_dir)/rhsresearch_nitefury_ii/NiteFury-and-LiteFury-firesim/Sample-Projects/Project-0
else ifeq ($(PLATFORM), f2)
board_dir := $(platforms_dir)/f2/aws-fpga-firesim-f2/hdk/cl/developer_designs
else
$(error Invalid PLATFORM used: $(PLATFORM))
endif
fpga_work_dir := $(board_dir)/cl_$(name_quintuplet)
fpga_build_dir := $(fpga_work_dir)/build
verif_dir := $(fpga_work_dir)/verif
repo_state := $(fpga_work_dir)/design/repo_state
fpga_driver_dir:= $(fpga_work_dir)/driver
fpga_delivery_dir := $(fpga_work_dir)/design
ifeq ($(PLATFORM), rhsresearch_nitefury_ii)
fpga_delivery_dir := $(fpga_work_dir)/Nitefury-II/project/project.srcs/sources_1/imports/HDL
endif
# Enumerates the subset of generated files that must be copied over for FPGA compilation
fpga_delivery_files = $(addprefix $(fpga_delivery_dir)/$(BASE_FILE_NAME), \
.sv .defines.vh \
.synthesis.xdc .implementation.xdc)
# Files used to run FPGA-level metasimulation
fpga_sim_delivery_files = $(fpga_driver_dir)/$(DESIGN)-$(PLATFORM)
$(fpga_work_dir)/stamp: $(shell find $(board_dir)/cl_firesim -name '*')
mkdir -p $(@D)
cp -rf $(board_dir)/cl_firesim -T $(fpga_work_dir)
ifeq ($(PLATFORM), f2)
# Create symlink for config-specific synth TCL (F2 build_all.tcl sources synth_$${CL}.tcl)
cd $(fpga_build_dir)/scripts && ln -sf synth_cl_firesim.tcl synth_cl_$(name_quintuplet).tcl
endif
touch $@
$(repo_state): $(simulator_verilog) $(fpga_work_dir)/stamp
$(firesim_base_dir)/../scripts/repo_state_summary.sh > $(repo_state)
$(fpga_delivery_dir)/$(BASE_FILE_NAME)%: $(simulator_verilog) $(fpga_work_dir)/stamp
cp -f $(GENERATED_DIR)/*.ipgen.tcl $(@D) || true
cp -f $(GENERATED_DIR)/$(@F) $@
$(fpga_driver_dir)/$(BASE_FILE_NAME)%: $(simulator_verilog) $(fpga_work_dir)/stamp
mkdir -p $(@D)
cp -f $(GENERATED_DIR)/$(@F) $@
$(fpga_driver_dir)/$(DESIGN)-$(PLATFORM): $($(PLATFORM))
mkdir -p $(@D)
cp -f $< $@
# Goes as far as setting up the build directory without running the cad job
# Used by the manager before passing a build to a remote machine
replace-rtl: $(fpga_delivery_files) $(fpga_sim_delivery_files)
.PHONY: replace-rtl
$(firesim_base_dir)/scripts/checkpoints/$(target_sim_tuple): $(fpga_work_dir)/stamp
mkdir -p $(@D)
ln -sf $(fpga_build_dir)/checkpoints/to_aws $@
# Runs a local fpga-bitstream build. Strongly consider using the manager instead.
.PHONY: fpga
fpga: export CL_DIR := $(fpga_work_dir)
fpga: $(fpga_delivery_files) $(firesim_base_dir)/scripts/checkpoints/$(target_sim_tuple)
cd $(fpga_build_dir)/scripts && ./aws_build_dcp_from_cl.sh -notify
#########################
# Cleaning Recipes #
#########################
.PHONY: cleanfpga
cleanfpga:
rm -rf $(fpga_work_dir)