-
Notifications
You must be signed in to change notification settings - Fork 13
/
xilinx.mk
65 lines (51 loc) · 1.55 KB
/
xilinx.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
DEPS += $(BASE_TCL)
VIVADO := vivado -nolog -nojournal -mode batch -source
HSI := hsi -nolog -nojournal -mode batch
TARGET_PRJ=tmp/$(NAME).xpr
BIT_FILE=tmp/$(NAME).runs/impl_1/$(NAME)_wrapper.bit
BIN_FILE=$(NAME)_wrapper.bit.bin
BIF_FILE=$(NAME).bif
TARGET_BIN=tmp/$(NAME).runs/impl_1/$(NAME)
ifeq ($(USE_BD),y)
TARGET_BIN+=_wrapper
endif
TARGET_BIN+=.$(OUT_BIN)
INSTALL_DIR=$(OSCIMP_DIGITAL_NFS)/$(BOARD_NAME)/$(NAME)/bitstreams
.PHONY: all clean clean-all clean-trash
all: $(BIN_FILE)
$(BIT_FILE): $(DEPS)
-rm -rf tmp
$(VIVADO) $(BASE_TCL)
%.bin: $(BIT_FILE)
@rm -f $(BIF_FILE) $(BIN_FILE)
@echo "all:" >> $(BIF_FILE)
@echo "{" >> $(BIF_FILE)
@echo " $(BIT_FILE)" >> $(BIF_FILE)
@echo "}" >> $(BIF_FILE)
bootgen -w -image $(NAME).bif -arch zynq -process_bitstream bin
mv $(BIT_FILE).bin .
@rm -f $(BIF_FILE)
force_bin:
@rm -f $(BIF_FILE) $(BIN_FILE)
@echo "all:" >> $(BIF_FILE)
@echo "{" >> $(BIF_FILE)
@echo " $(BIT_FILE)" >> $(BIF_FILE)
@echo "}" >> $(BIF_FILE)
bootgen -w -image $(NAME).bif -arch zynq -process_bitstream bin
mv $(BIT_FILE).bin .
@rm -f $(BIF_FILE)
xml:$(TARGET_PRJ)
$(VIVADO) $(OSCIMP_DIGITAL_IP)/scripts/gen_module_generator_xml.tcl -tclargs tmp $(NAME)
install:$(BIN_FILE)
if [ ! -d $(INSTALL_DIR) ]; then mkdir -p $(INSTALL_DIR); fi
cp $(BIN_FILE) $(INSTALL_DIR)
force_install:
if [ ! -d $(INSTALL_DIR) ]; then mkdir -p $(INSTALL_DIR); fi
cp $(BIN_FILE) $(INSTALL_DIR)
clean: clean-all
clean-all: clean-trash
-rm -rf $(BIN_FILE) $(NAME)
-rm -f $(BIF_FILE)
clean-trash:
rm -rf tmp
rm -rf *.log *.jou .Xil *.zip *.str