-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
87 lines (69 loc) · 2.33 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
# 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 model_decl.mk
IMAGE=$(CURDIR)/images/COCO_val2014_000000174838_1.ppm
## Mute printf in source code
#SILENT=1
## Enable image grub from camera and disaply output to lcd
#FROM_CAMERA=1
io=host
$(info Building GAP8 mode with $(QUANT_BITS) bit quantization)
FLASH_TYPE ?= DEFAULT
RAM_TYPE ?= DEFAULT
ifeq '$(FLASH_TYPE)' 'HYPER'
MODEL_L3_FLASH=AT_MEM_L3_HFLASH
else ifeq '$(FLASH_TYPE)' 'MRAM'
MODEL_L3_FLASH=AT_MEM_L3_MRAMFLASH
READFS_FLASH = target/chip/soc/mram
else ifeq '$(FLASH_TYPE)' 'QSPI'
MODEL_L3_FLASH=AT_MEM_L3_QSPIFLASH
READFS_FLASH = target/board/devices/spiflash
else ifeq '$(FLASH_TYPE)' 'OSPI'
MODEL_L3_FLASH=AT_MEM_L3_OSPIFLASH
else ifeq '$(FLASH_TYPE)' 'DEFAULT'
MODEL_L3_FLASH=AT_MEM_L3_DEFAULTFLASH
endif
ifeq '$(RAM_TYPE)' 'HYPER'
MODEL_L3_RAM=AT_MEM_L3_HRAM
else ifeq '$(RAM_TYPE)' 'QSPI'
MODEL_L3_RAM=AT_MEM_L3_QSPIRAM
else ifeq '$(RAM_TYPE)' 'OSPI'
MODEL_L3_RAM=AT_MEM_L3_OSPIRAM
else ifeq '$(RAM_TYPE)' 'DEFAULT'
MODEL_L3_RAM=AT_MEM_L3_DEFAULTRAM
endif
APP = vww
APP_SRCS += vww_model.c $(MODEL_GEN_C) $(MODEL_COMMON_SRCS) $(CNN_LIB)
APP_CFLAGS += -O3 -DPERF -s -mno-memcpy -fno-tree-loop-distribute-patterns
APP_CFLAGS += -I$(GAP_SDK_HOME)/utils/power_meas_utils -I. -I$(MODEL_COMMON_INC) -I$(TILER_EMU_INC) -I$(TILER_INC) $(CNN_LIB_INCLUDE) -I$(MODEL_BUILD) -I$(TILER_CNN_KERNEL_PATH_SQ8)
APP_CFLAGS += -DAT_MODEL_PREFIX=$(MODEL_PREFIX) $(MODEL_SIZE_CFLAGS)
APP_CFLAGS += -DCLUSTER_STACK_SIZE=$(CLUSTER_STACK_SIZE) -DCLUSTER_SLAVE_STACK_SIZE=$(CLUSTER_SLAVE_STACK_SIZE)
APP_CFLAGS += -DAT_IMAGE=$(IMAGE)
APP_CFLAGS += -DFREQ_CL=$(FREQ_CL) -DFREQ_FC=$(FREQ_FC) -DFREQ_PE=$(FREQ_PE) -DPERF
ifneq '$(platform)' 'gvsoc'
ifdef GPIO_MEAS
APP_CFLAGS += -DGPIO_MEAS
endif
VOLTAGE?=800
ifeq '$(PMSIS_OS)' 'pulpos'
APP_CFLAGS += -DVOLTAGE=$(VOLTAGE)
endif
endif
ifeq ($(SILENT),1)
APP_CFLAGS += -DSILENT=1
endif
ifeq ($(FROM_CAMERA),1)
APP_CFLAGS += -DFROM_CAMERA=1
endif
READFS_FILES=$(abspath $(MODEL_TENSORS))
# build depends on the model
build:: model
clean:: clean_model
include model_rules.mk
include $(RULES_DIR)/pmsis_rules.mk