-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
91 lines (70 loc) · 2.32 KB
/
Makefile
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
# Copyright (C) 2017 GreenWaves Technologies
# All rights reserved.
# This software may be modified and distributed under the terms
# of the BSD license. See the LICENSE file for details.
ifndef GAP_SDK_HOME
$(error Source sourceme in gap_sdk first)
endif
include common.mk
include $(RULES_DIR)/at_common_decl.mk
io?=host
FLASH_TYPE ?= HYPER
RAM_TYPE ?= HYPER
#PMSIS_OS=freertos
ifeq '$(FLASH_TYPE)' 'HYPER'
MODEL_L3_CONST=AT_MEM_L3_HFLASH
else ifeq '$(FLASH_TYPE)' 'MRAM'
MODEL_L3_CONST=AT_MEM_L3_MRAMFLASH
READFS_FLASH = target/chip/soc/mram
else ifeq '$(FLASH_TYPE)' 'QSPI'
MODEL_L3_CONST=AT_MEM_L3_QSPIFLASH
READFS_FLASH = target/board/devices/spiflash
else ifeq '$(FLASH_TYPE)' 'OSPI'
MODEL_L3_CONST=AT_MEM_L3_OSPIFLASH
READFS_FLASH = target/board/devices/ospiflash
endif
ifeq '$(RAM_TYPE)' 'HYPER'
MODEL_L3_EXEC=AT_MEM_L3_HRAM
else ifeq '$(RAM_TYPE)' 'QSPI'
MODEL_L3_EXEC=AT_MEM_L3_QSPIRAM
else ifeq '$(RAM_TYPE)' 'OSPI'
MODEL_L3_EXEC=AT_MEM_L3_OSPIRAM
endif
ifeq '$(TARGET_CHIP_FAMILY)' 'GAP9'
FREQ_CL?=370
FREQ_FC?=370
FREQ_PE?=370
else
ifeq '$(TARGET_CHIP)' 'GAP8_V3'
FREQ_CL?=175
else
FREQ_CL?=230
endif
FREQ_FC?=250
FREQ_PE?=250
endif
$(info Building NNTOOL model)
NNTOOL_EXTRA_FLAGS ?=
include common/model_decl.mk
# pulpChip = GAP
# PULP_APP = $(MODEL_PREFIX)
LIBSFLAGS += -lm # include math library, required for flo_proc
APP = $(MODEL_PREFIX)
APP_SRCS += $(MODEL_PREFIX).c $(MODEL_GEN_C) $(MODEL_EXPRESSIONS) $(MODEL_COMMON_SRCS) $(CNN_LIB) flo_proc.c
# setup camera variables
APP_CFLAGS += -DSLICE_MODE
APP_CFLAGS += -DQQVGA_IMG
APP_CFLAGS += -g -O3 -mno-memcpy -fno-tree-loop-distribute-patterns
APP_CFLAGS += -I. -I$(MODEL_COMMON_INC) -I$(TILER_EMU_INC) -I$(TILER_INC) $(CNN_LIB_INCLUDE) -I$(MODEL_BUILD)
APP_CFLAGS += -DPERF -DAT_MODEL_PREFIX=$(MODEL_PREFIX) $(MODEL_SIZE_CFLAGS)
APP_CFLAGS += -DSTACK_SIZE=$(CLUSTER_STACK_SIZE) -DSLAVE_STACK_SIZE=$(CLUSTER_SLAVE_STACK_SIZE)
APP_CFLAGS += -DAT_IMAGE=$(IMAGE) -DFREQ_FC=$(FREQ_FC) -DFREQ_CL=$(FREQ_CL) -DFREQ_PE=$(FREQ_PE)
READFS_FILES=$(abspath $(MODEL_TENSORS))
override config_args += --config-opt=camera/image-stream=$(CURDIR)/imgTest0.pgm # allow gvsoc execution
# all depends on the model
all:: model
clean:: clean_model
include common/model_rules.mk
$(info APP_SRCS... $(APP_SRCS))
$(info APP_CFLAGS... $(APP_CFLAGS))
include $(RULES_DIR)/pmsis_rules.mk