blob: 5825d47dc06052e4572495ddd218e55308fa4c9a [file] [log] [blame]
alexander3c798932021-03-26 21:42:19 +00001; Copyright (c) 2021 Arm Limited. All rights reserved.
2; SPDX-License-Identifier: Apache-2.0
3;
4; Licensed under the Apache License, Version 2.0 (the "License");
5; you may not use this file except in compliance with the License.
6; You may obtain a copy of the License at
7;
8; http://www.apache.org/licenses/LICENSE-2.0
9;
10; Unless required by applicable law or agreed to in writing, software
11; distributed under the License is distributed on an "AS IS" BASIS,
12; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13; See the License for the specific language governing permissions and
14; limitations under the License.
15
16; *************************************************************
17; *** Scatter-Loading Description File ***
18; *************************************************************
Isabella Gottardi118f73e2021-09-16 17:54:35 +010019; Please see docs/sections/appendix.md for memory mapping information.
20;
Kshitij Sisodia661959c2021-11-24 10:39:52 +000021; Note: Ethos-U NPU can access BRAM, internal SRAM and the DDR
22; sections => activation buffers and the model should only
23; be placed in those regions.
alexander3c798932021-03-26 21:42:19 +000024;
25;---------------------------------------------------------
26; First load region (ITCM)
27;---------------------------------------------------------
28LOAD_REGION_0 0x00000000 0x00080000
29{
30 ;-----------------------------------------------------
31 ; First part of code mem - 512kiB
32 ;-----------------------------------------------------
33 itcm.bin 0x00000000 0x00080000
34 {
35 *.o (RESET, +First)
36 * (InRoot$$Sections)
37
38 ; Essentially only RO-CODE, RO-DATA is in a
39 ; different region.
40 .ANY (+RO)
41 }
42
43 ;-----------------------------------------------------
Kshitij Sisodiaf9c19ea2021-05-07 16:08:14 +010044 ; 128kiB of 512kiB DTCM is used for any other RW or ZI
alexander3c798932021-03-26 21:42:19 +000045 ; data. Note: this region is internal to the Cortex-M
Kshitij Sisodiaf9c19ea2021-05-07 16:08:14 +010046 ; CPU.
alexander3c798932021-03-26 21:42:19 +000047 ;-----------------------------------------------------
48 dtcm.bin 0x20000000 0x00020000
49 {
Kshitij Sisodiaf9c19ea2021-05-07 16:08:14 +010050 ; Any R/W and/or zero initialised data
alexander3c798932021-03-26 21:42:19 +000051 .ANY(+RW +ZI)
52 }
53
54 ;-----------------------------------------------------
Kshitij Sisodiaf9c19ea2021-05-07 16:08:14 +010055 ; 384kiB of stack space within the DTCM region. See
56 ; `dtcm.bin` for the first section. Note: by virtue of
57 ; being part of DTCM, this region is only accessible
58 ; from Cortex-M55.
alexander3c798932021-03-26 21:42:19 +000059 ;-----------------------------------------------------
Kshitij Sisodiaf9c19ea2021-05-07 16:08:14 +010060 ARM_LIB_STACK 0x20020000 EMPTY ALIGN 8 0x00060000
alexander3c798932021-03-26 21:42:19 +000061 {}
62
63 ;-----------------------------------------------------
Kshitij Sisodia661959c2021-11-24 10:39:52 +000064 ; SSE-300's internal SRAM of 2MiB - reserved for
Kshitij Sisodiaf9c19ea2021-05-07 16:08:14 +010065 ; activation buffers.
66 ; This region should have 3 cycle read latency from
Isabella Gottardif5907732021-08-06 15:39:41 +010067 ; both Cortex-M55 and Ethos-U NPU
alexander3c798932021-03-26 21:42:19 +000068 ;-----------------------------------------------------
Kshitij Sisodia661959c2021-11-24 10:39:52 +000069 isram.bin 0x31000000 UNINIT ALIGN 16 0x00200000
Kshitij Sisodiaf9c19ea2021-05-07 16:08:14 +010070 {
Isabella Gottardi118f73e2021-09-16 17:54:35 +010071 ; Cache area (if used)
72 *.o (.bss.NoInit.ethos_u_cache)
73
Kshitij Sisodia661959c2021-11-24 10:39:52 +000074 ; activation buffers a.k.a tensor arena when
75 ; memory mode sram only or shared sram
Isabella Gottardi118f73e2021-09-16 17:54:35 +010076 *.o (.bss.NoInit.activation_buf_sram)
Kshitij Sisodiaf9c19ea2021-05-07 16:08:14 +010077 }
alexander3c798932021-03-26 21:42:19 +000078}
79
80;---------------------------------------------------------
81; Second load region (DDR)
82;---------------------------------------------------------
83LOAD_REGION_1 0x70000000 0x02000000
84{
85 ;-----------------------------------------------------
Kshitij Sisodiaf9c19ea2021-05-07 16:08:14 +010086 ; 32 MiB of DDR space for neural network model,
87 ; input vectors and labels. If the activation buffer
88 ; size required by the network is bigger than the
89 ; SRAM size available, it is accommodated here.
alexander3c798932021-03-26 21:42:19 +000090 ;-----------------------------------------------------
Kshitij Sisodiaf9c19ea2021-05-07 16:08:14 +010091 ddr.bin 0x70000000 ALIGN 16 0x02000000
alexander3c798932021-03-26 21:42:19 +000092 {
93 ; nn model's baked in input matrices
94 *.o (ifm)
95
Isabella Gottardi118f73e2021-09-16 17:54:35 +010096 ; nn model's default space
alexander3c798932021-03-26 21:42:19 +000097 *.o (nn_model)
98
Kshitij Sisodiaf9c19ea2021-05-07 16:08:14 +010099 ; labels
100 *.o (labels)
101
Isabella Gottardi118f73e2021-09-16 17:54:35 +0100102 ; activation buffers a.k.a tensor arena when memory mode dedicated sram
103 *.o (activation_buf_dram)
alexander3c798932021-03-26 21:42:19 +0000104 }
105
106 ;-----------------------------------------------------
Kshitij Sisodiaf9c19ea2021-05-07 16:08:14 +0100107 ; First 256kiB of BRAM (FPGA SRAM) used for RO data.
Kshitij Sisodia661959c2021-11-24 10:39:52 +0000108 ; Note: Total BRAM size available is 1MiB.
alexander3c798932021-03-26 21:42:19 +0000109 ;-----------------------------------------------------
Kshitij Sisodiaf9c19ea2021-05-07 16:08:14 +0100110 bram.bin 0x11000000 ALIGN 8 0x00040000
alexander3c798932021-03-26 21:42:19 +0000111 {
112 ; RO data (incl. unwinding tables for debugging)
113 .ANY (+RO-DATA)
114 }
Kshitij Sisodiaf9c19ea2021-05-07 16:08:14 +0100115
116 ;-----------------------------------------------------
Kshitij Sisodia661959c2021-11-24 10:39:52 +0000117 ; 768 KiB of remaining part of the 1MiB BRAM used as
118 ; heap space.
Kshitij Sisodiaf9c19ea2021-05-07 16:08:14 +0100119 ;-----------------------------------------------------
Kshitij Sisodia661959c2021-11-24 10:39:52 +0000120 ARM_LIB_HEAP 0x11040000 EMPTY ALIGN 8 0x000C0000
Kshitij Sisodiaf9c19ea2021-05-07 16:08:14 +0100121 {}
alexander3c798932021-03-26 21:42:19 +0000122}