forked from open-power/capi2-bsp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
capi_card.mk
103 lines (76 loc) · 3.32 KB
/
capi_card.mk
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
93
94
95
96
97
98
99
100
101
102
103
#
# Copyright 2018 International Business Machines
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
export ROOT_DIR ?= $(abspath ..)
ifndef FPGA_ACTION_CLK
export FPGA_ACTION_CLK = "250MHZ"
endif
include $(ROOT_DIR)/capi_bsp_env.mk
export PSL_IP ?= $(PSL_DIR)/build_$(FPGA_PART)/output
export PSL_CREATE_IP_DONE ?= $(PSL_DIR)/.psl_$(FPGA_PART)
.PHONY: help create_ip psl clean
help:
@echo "Main targets for the $(FPGA_CARD) capi_board_support project make process:";
@echo "====================================================================";
@echo "* create_ip Create capi_bsp ip for $(FPGA_DISPLAY) card";
@echo "* psl Create encrypted PSL IP";
@echo "* clean Remove all files generated in make process";
@echo "* help Print this message";
@echo;
all: create_ip
# Disabling implicit rule for shell scripts
%: %.sh
$(CARD_LOGS):
@mkdir -p $(CARD_LOGS)
$(CARD_CAPI_BSP_GEN): $(CARD_LOGS)
@echo "Creating the PSL for the $(FPGA_CARD) card."
@echo "[PREPARE DIRECTORIES.] start "`date +"%T %a %b %d %Y"`
@mkdir -p $(CARD_CAPI_BSP_GEN)
@echo "[PREPARE DIRECTORIES.] done "`date +"%T %a %b %d %Y"`
$(PSL_CREATE_IP_DONE):
@echo -e "======================================================="
@echo -e "== Creating the Processor Service Layer (PSL) =="
@echo -e "======================================================="
@echo "[CREATE PSL IP.......] start "`date +"%T %a %b %d %Y"`
@$(MAKE) -sC $(PSL_DIR) create_ip
@echo "[CREATE PSL IP.......] done "`date +"%T %a %b %d %Y"`
@touch $@
$(PSL_IP): $(PSL_CREATE_IP_DONE)
@if [ ! -d $@ ]; then \
echo "ERROR: Variable PSL_IP needs to point to directory containing the packaged IP for PSL."; \
echo "ERROR: Its value is $(PSL_IP)"; \
echo "ERROR: That is no valid path. Terminating."; \
exit -1; \
fi
psl: $(PSL_CREATE_IP_DONE)
$(CARD_DIR)/.create_ip_done: $(PSL_IP)
@$(MAKE) -s $(CARD_CAPI_BSP_GEN)
@echo "Starting vivado in $(VIVADO_MODE) mode ..."
@vivado -quiet -mode $(VIVADO_MODE) -source $(COMMON_TCL)/create_capi_bsp.tcl -notrace -log $(CARD_LOGS)/vivado_create_project.log -journal $(CARD_LOGS)/vivado_create_project.jou
@touch $(CARD_DIR)/.create_ip_done
@if [ $(FPGA_ACTION_CLK) == "225MHZ" ]; then \
touch .action_clk_225MHZ; \
fi
@if [ $(FPGA_ACTION_CLK) == "250MHZ" ]; then \
touch .action_clk_250MHZ; \
fi
create_ip: $(CARD_DIR)/.create_ip_done
clean:
@$(RM) *~
@$(RM) .create_ip_done
@$(RM) .action_clk_*
@$(RM) -r vivado.*
@$(RM) -r build
@$(RM) -r .Xil