Skip to content

Commit 01f4868

Browse files
authored
Merge pull request #45 from foss-for-synopsys-dwc-arc-processors/mli_dev
Release 1.0 RC2
2 parents db74782 + 747ec66 commit 01f4868

File tree

101 files changed

+13529
-4444
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+13529
-4444
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
EmbARC Machine Learning Inference Library
1+
embARC Machine Learning Inference Library
22
==================================================
33

4-
This repository contains source code of embARC Machine Learning Inference Library (embARC MLI Lib),
4+
This repository contains source code of embARC Machine Learning Inference Library (embARC MLI Library),
55
examples and documentation.
66

77
## Release notes
88
----------------
9-
1. Preliminary version 0.5
9+
1. Version 1.0
1010
2. This release supports following functional primitives
1111
* 2D Convolution
1212
* 2D depthwise convolution
@@ -39,7 +39,7 @@ defined in [MetaWare Development Tools](https://www.synopsys.com/dw/ipdir.php?ds
3939
EM or HS configuration.
4040

4141
Build requirements:
42-
1. MetaWare Development tools 2018.12 or later
42+
1. MetaWare Development tools 2019.03-1 or later
4343

4444
Building of embARC MLI library
4545
1. Open command line and change working directory to './lib/make/'
@@ -76,5 +76,5 @@ Building of embARC MLI library
7676

7777
## Known Issues
7878
---------------
79-
None
79+
1. Optimal performance for 8-bit data requires version of MetaWare Development Tools 2019.06 or later
8080

build/rules.mk

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,17 @@
99
#=============================================================
1010
# OS-specific definitions
1111
#=============================================================
12+
COMMA=,
13+
OPEN_PAREN=(
14+
CLOSE_PAREN=)
15+
BACKSLASH=\$(nullstring)
1216
ifneq ($(ComSpec)$(COMSPEC),)
1317
O_SYS=Windows
1418
RM=del /F /Q
1519
MKDIR=mkdir
1620
CP=copy /Y
1721
TYPE=type
18-
PS=\$(nullstring)
22+
PS=$(BACKSLASH)
1923
Q=
2024
coQ=\$(nullstring)
2125
fix_platform_path = $(subst /,$(PS), $(1))
@@ -27,17 +31,20 @@ else
2731
CP=cp
2832
TYPE=cat
2933
PS=/
30-
Q=\$(nullstring)
31-
coQ=^
34+
Q=$(BACKSLASH)
35+
coQ=
3236
fix_platform_path=$(1)
3337
DEV_NULL=/dev/null
3438
endif
3539

36-
COMMA=,
37-
OPEN_PAREN=(
38-
CLOSE_PAREN=)
39-
quote=$(subst $(coQ),$(Q)$(coQ), \
40-
$(subst %,$(Q)%, \
40+
# Note: Windows escaping rules is very combersome
41+
# initially I tried to use Q=^, but this depends on the context and (looks like) on Win version.
42+
# Also expecially ugly thing is that in quoted strings the quotes the same are remain.
43+
# Batch has special parameter expansion syntax to remove quotes,
44+
# but many tools themselves remove quotes (unless escaped with backslash)
45+
# So finally we've found that in our use cases we may not escaping any symbols but prepend backslashes before quotes.
46+
47+
quote=$(subst %,$(Q)%, \
4148
$(subst &,$(Q)&, \
4249
$(subst <,$(Q)<, \
4350
$(subst >,$(Q)>, \
@@ -48,9 +55,9 @@ quote=$(subst $(coQ),$(Q)$(coQ), \
4855
$(subst $(OPEN_PAREN),$(Q)$(OPEN_PAREN), \
4956
$(subst $(CLOSE_PAREN),$(Q)$(CLOSE_PAREN), \
5057
$(subst !,$(Q)!, \
51-
$(subst ",$(Q)", \
58+
$(subst ",$(BACKSLASH)", \
5259
$(subst $(Q),$(Q)$(Q), \
53-
$(1) ))))))))))))))
60+
$(1) )))))))))))))
5461

5562

5663
#=============================================================
@@ -118,15 +125,15 @@ ifeq ($(TOOLCHAIN),mwdt)
118125
LD = ccac
119126
AR = arac
120127
AS = ccac
121-
CFLAGS += -tcf=$(TCF_FILE) -tcf_core_config
128+
TCF_CFLAGS += -tcf=$(TCF_FILE) -tcf_core_config
122129
LDFLAGS += -tcf=$(TCF_FILE) $(LCF)
123130
else
124131
CC = arc-elf32-gcc
125132
LD = arc-elf32-ld
126133
AR = arc-elf32-ar
127134
AS = arc-elf32-as
128135
CFLAGS += $(addprefix -I, $(HEADER_DIRS))
129-
CFLAGS += -D_Interrupt=__attribute__((interrupt(\"ilink\")))
136+
CFLAGS += -D_Interrupt=__attribute__((interrupt("ilink")))
130137
CFLAGS += -D_lr=__builtin_arc_lr
131138
CFLAGS += -D_sr=__builtin_arc_sr
132139
CFLAGS += -D_seti=__builtin_arc_seti
@@ -152,7 +159,8 @@ else
152159
endif
153160
endif
154161

155-
CFLAGS := $(call quote, $(CFLAGS))
162+
# TCF file needs to be the in front of the other CFLAGS
163+
CFLAGS := $(TCF_CFLAGS) $(call quote, $(CFLAGS))
156164
LDFLAGS := $(call quote, $(LDFLAGS))
157165

158166
vpath %.c $(SRC_DIRS)
@@ -216,6 +224,9 @@ endif
216224
ifneq ($(CPP_DEPENDS),)
217225
-include $(CPP_DEPENDS)
218226
endif
227+
ifneq ($(CC_DEPENDS),)
228+
-include $(CC_DEPENDS)
229+
endif
219230

220231
#=================================================================
221232
# Applications rules

0 commit comments

Comments
 (0)