blob: b6834a859981f8615d19e894fab8844b376a7d8e [file] [log] [blame]
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001/*
2 * Copyright (c) 2019-2020 Arm Limited. All rights reserved.
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 *
6 * Licensed under the Apache License, Version 2.0 (the License); you may
7 * not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an AS IS BASIS, WITHOUT
14 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 */
18
Diqing Zhonga9f38d52020-04-27 11:00:13 +020019#ifndef ETHOSU55_INTERFACE_H
20#define ETHOSU55_INTERFACE_H
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020021
22#ifdef __KERNEL__
23#include <linux/types.h>
24#else
25#include <stdint.h>
26#endif
27
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020028#if !defined(__cplusplus) || __cplusplus < 201402L
29#define CONSTEXPR
30#else
31#define CONSTEXPR constexpr
32#endif
33
34#ifndef __cplusplus
35#define STRUCT struct
36#else
37#define STRUCT
38#include <stdexcept>
39#endif
40
Douglas Trohaf6a85da2020-05-11 11:45:28 +020041#define NNX_ARCH_VERSION_MAJOR 1
42#define NNX_ARCH_VERSION_MINOR 0
Stefan Nannessone2e70242020-08-19 16:01:29 +020043#define NNX_ARCH_VERSION_PATCH 6
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020044
45// Register offsets
46
47//
Douglas Troha2e7e3b72020-05-14 20:28:31 +020048// Register subpage BASE
49//
50#define NPU_REG_ID 0x0000
51#define NPU_REG_STATUS 0x0004
52#define NPU_REG_CMD 0x0008
53#define NPU_REG_RESET 0x000C
54#define NPU_REG_QBASE0 0x0010
55#define NPU_REG_QBASE1 0x0014
56#define NPU_REG_QREAD 0x0018
57#define NPU_REG_QCONFIG 0x001C
58#define NPU_REG_QSIZE 0x0020
59#define NPU_REG_PROT 0x0024
60#define NPU_REG_CONFIG 0x0028
61#define NPU_REG_LOCK 0x002C
62#define NPU_REG_REGIONCFG 0x003C
63#define NPU_REG_AXI_LIMIT0 0x0040
64#define NPU_REG_AXI_LIMIT1 0x0044
65#define NPU_REG_AXI_LIMIT2 0x0048
66#define NPU_REG_AXI_LIMIT3 0x004C
67#define BASE_REGISTERS_SIZE 0x0050
68
69//
70// Register subpage BASE_POINTERS
71//
72#define NPU_REG_BASEP0 0x0080
73#define NPU_REG_BASEP1 0x0084
74#define NPU_REG_BASEP2 0x0088
75#define NPU_REG_BASEP3 0x008C
76#define NPU_REG_BASEP4 0x0090
77#define NPU_REG_BASEP5 0x0094
78#define NPU_REG_BASEP6 0x0098
79#define NPU_REG_BASEP7 0x009C
80#define NPU_REG_BASEP8 0x00A0
81#define NPU_REG_BASEP9 0x00A4
82#define NPU_REG_BASEP10 0x00A8
83#define NPU_REG_BASEP11 0x00AC
84#define NPU_REG_BASEP12 0x00B0
85#define NPU_REG_BASEP13 0x00B4
86#define NPU_REG_BASEP14 0x00B8
87#define NPU_REG_BASEP15 0x00BC
88#define BASE_POINTERS_REGISTERS_SIZE 0x00C0
89
90//
91// Register subpage DEBUG
92//
93#define NPU_REG_WD_STATUS 0x0100
94#define NPU_REG_MAC_STATUS 0x0104
95#define NPU_REG_AO_STATUS 0x0108
96#define NPU_REG_DMA_STATUS0 0x0110
97#define NPU_REG_DMA_STATUS1 0x0114
98#define NPU_REG_CLKFORCE 0x0140
99#define NPU_REG_DEBUG_ADDRESS 0x0144
100#define NPU_REG_DEBUG_MISC 0x0148
101#define NPU_REG_DEBUGCORE 0x014C
Stefan Nannessone2e70242020-08-19 16:01:29 +0200102#define NPU_REG_DEBUG_BLOCK 0x0150
103#define DEBUG_REGISTERS_SIZE 0x0154
Douglas Troha2e7e3b72020-05-14 20:28:31 +0200104
105//
106// Register subpage ID
107//
108#define NPU_REG_REVISION 0x0FC0
109#define NPU_REG_PID4 0x0FD0
110#define NPU_REG_PID5 0x0FD4
111#define NPU_REG_PID6 0x0FD8
112#define NPU_REG_PID7 0x0FDC
113#define NPU_REG_PID0 0x0FE0
114#define NPU_REG_PID1 0x0FE4
115#define NPU_REG_PID2 0x0FE8
116#define NPU_REG_PID3 0x0FEC
117#define NPU_REG_CID0 0x0FF0
118#define NPU_REG_CID1 0x0FF4
119#define NPU_REG_CID2 0x0FF8
120#define NPU_REG_CID3 0x0FFC
121#define ID_REGISTERS_SIZE 0x1000
122
123//
124// Register subpage PMU
125//
126#define NPU_REG_PMCR 0x0180
127#define NPU_REG_PMCNTENSET 0x0184
128#define NPU_REG_PMCNTENCLR 0x0188
129#define NPU_REG_PMOVSSET 0x018C
130#define NPU_REG_PMOVSCLR 0x0190
131#define NPU_REG_PMINTSET 0x0194
132#define NPU_REG_PMINTCLR 0x0198
133#define NPU_REG_PMCCNTR_LO 0x01A0
134#define NPU_REG_PMCCNTR_HI 0x01A4
135#define NPU_REG_PMCCNTR_CFG 0x01A8
136#define NPU_REG_PMCAXI_CHAN 0x01AC
137#define NPU_REG_PMEVCNTR0 0x0300
138#define NPU_REG_PMEVCNTR1 0x0304
139#define NPU_REG_PMEVCNTR2 0x0308
140#define NPU_REG_PMEVCNTR3 0x030C
141#define NPU_REG_PMEVTYPER0 0x0380
142#define NPU_REG_PMEVTYPER1 0x0384
143#define NPU_REG_PMEVTYPER2 0x0388
144#define NPU_REG_PMEVTYPER3 0x038C
145#define PMU_REGISTERS_SIZE 0x0390
146
147//
148// Register subpage SHARED_BUFFER
Kristofer Jonsson49bdee82020-04-06 13:21:21 +0200149//
150#define NPU_REG_SHARED_BUFFER0 0x0400
151#define NPU_REG_SHARED_BUFFER1 0x0404
152#define NPU_REG_SHARED_BUFFER2 0x0408
153#define NPU_REG_SHARED_BUFFER3 0x040C
154#define NPU_REG_SHARED_BUFFER4 0x0410
155#define NPU_REG_SHARED_BUFFER5 0x0414
156#define NPU_REG_SHARED_BUFFER6 0x0418
157#define NPU_REG_SHARED_BUFFER7 0x041C
158#define NPU_REG_SHARED_BUFFER8 0x0420
159#define NPU_REG_SHARED_BUFFER9 0x0424
160#define NPU_REG_SHARED_BUFFER10 0x0428
161#define NPU_REG_SHARED_BUFFER11 0x042C
162#define NPU_REG_SHARED_BUFFER12 0x0430
163#define NPU_REG_SHARED_BUFFER13 0x0434
164#define NPU_REG_SHARED_BUFFER14 0x0438
165#define NPU_REG_SHARED_BUFFER15 0x043C
166#define NPU_REG_SHARED_BUFFER16 0x0440
167#define NPU_REG_SHARED_BUFFER17 0x0444
168#define NPU_REG_SHARED_BUFFER18 0x0448
169#define NPU_REG_SHARED_BUFFER19 0x044C
170#define NPU_REG_SHARED_BUFFER20 0x0450
171#define NPU_REG_SHARED_BUFFER21 0x0454
172#define NPU_REG_SHARED_BUFFER22 0x0458
173#define NPU_REG_SHARED_BUFFER23 0x045C
174#define NPU_REG_SHARED_BUFFER24 0x0460
175#define NPU_REG_SHARED_BUFFER25 0x0464
176#define NPU_REG_SHARED_BUFFER26 0x0468
177#define NPU_REG_SHARED_BUFFER27 0x046C
178#define NPU_REG_SHARED_BUFFER28 0x0470
179#define NPU_REG_SHARED_BUFFER29 0x0474
180#define NPU_REG_SHARED_BUFFER30 0x0478
181#define NPU_REG_SHARED_BUFFER31 0x047C
182#define NPU_REG_SHARED_BUFFER32 0x0480
183#define NPU_REG_SHARED_BUFFER33 0x0484
184#define NPU_REG_SHARED_BUFFER34 0x0488
185#define NPU_REG_SHARED_BUFFER35 0x048C
186#define NPU_REG_SHARED_BUFFER36 0x0490
187#define NPU_REG_SHARED_BUFFER37 0x0494
188#define NPU_REG_SHARED_BUFFER38 0x0498
189#define NPU_REG_SHARED_BUFFER39 0x049C
190#define NPU_REG_SHARED_BUFFER40 0x04A0
191#define NPU_REG_SHARED_BUFFER41 0x04A4
192#define NPU_REG_SHARED_BUFFER42 0x04A8
193#define NPU_REG_SHARED_BUFFER43 0x04AC
194#define NPU_REG_SHARED_BUFFER44 0x04B0
195#define NPU_REG_SHARED_BUFFER45 0x04B4
196#define NPU_REG_SHARED_BUFFER46 0x04B8
197#define NPU_REG_SHARED_BUFFER47 0x04BC
198#define NPU_REG_SHARED_BUFFER48 0x04C0
199#define NPU_REG_SHARED_BUFFER49 0x04C4
200#define NPU_REG_SHARED_BUFFER50 0x04C8
201#define NPU_REG_SHARED_BUFFER51 0x04CC
202#define NPU_REG_SHARED_BUFFER52 0x04D0
203#define NPU_REG_SHARED_BUFFER53 0x04D4
204#define NPU_REG_SHARED_BUFFER54 0x04D8
205#define NPU_REG_SHARED_BUFFER55 0x04DC
206#define NPU_REG_SHARED_BUFFER56 0x04E0
207#define NPU_REG_SHARED_BUFFER57 0x04E4
208#define NPU_REG_SHARED_BUFFER58 0x04E8
209#define NPU_REG_SHARED_BUFFER59 0x04EC
210#define NPU_REG_SHARED_BUFFER60 0x04F0
211#define NPU_REG_SHARED_BUFFER61 0x04F4
212#define NPU_REG_SHARED_BUFFER62 0x04F8
213#define NPU_REG_SHARED_BUFFER63 0x04FC
214#define NPU_REG_SHARED_BUFFER64 0x0500
215#define NPU_REG_SHARED_BUFFER65 0x0504
216#define NPU_REG_SHARED_BUFFER66 0x0508
217#define NPU_REG_SHARED_BUFFER67 0x050C
218#define NPU_REG_SHARED_BUFFER68 0x0510
219#define NPU_REG_SHARED_BUFFER69 0x0514
220#define NPU_REG_SHARED_BUFFER70 0x0518
221#define NPU_REG_SHARED_BUFFER71 0x051C
222#define NPU_REG_SHARED_BUFFER72 0x0520
223#define NPU_REG_SHARED_BUFFER73 0x0524
224#define NPU_REG_SHARED_BUFFER74 0x0528
225#define NPU_REG_SHARED_BUFFER75 0x052C
226#define NPU_REG_SHARED_BUFFER76 0x0530
227#define NPU_REG_SHARED_BUFFER77 0x0534
228#define NPU_REG_SHARED_BUFFER78 0x0538
229#define NPU_REG_SHARED_BUFFER79 0x053C
230#define NPU_REG_SHARED_BUFFER80 0x0540
231#define NPU_REG_SHARED_BUFFER81 0x0544
232#define NPU_REG_SHARED_BUFFER82 0x0548
233#define NPU_REG_SHARED_BUFFER83 0x054C
234#define NPU_REG_SHARED_BUFFER84 0x0550
235#define NPU_REG_SHARED_BUFFER85 0x0554
236#define NPU_REG_SHARED_BUFFER86 0x0558
237#define NPU_REG_SHARED_BUFFER87 0x055C
238#define NPU_REG_SHARED_BUFFER88 0x0560
239#define NPU_REG_SHARED_BUFFER89 0x0564
240#define NPU_REG_SHARED_BUFFER90 0x0568
241#define NPU_REG_SHARED_BUFFER91 0x056C
242#define NPU_REG_SHARED_BUFFER92 0x0570
243#define NPU_REG_SHARED_BUFFER93 0x0574
244#define NPU_REG_SHARED_BUFFER94 0x0578
245#define NPU_REG_SHARED_BUFFER95 0x057C
246#define NPU_REG_SHARED_BUFFER96 0x0580
247#define NPU_REG_SHARED_BUFFER97 0x0584
248#define NPU_REG_SHARED_BUFFER98 0x0588
249#define NPU_REG_SHARED_BUFFER99 0x058C
250#define NPU_REG_SHARED_BUFFER100 0x0590
251#define NPU_REG_SHARED_BUFFER101 0x0594
252#define NPU_REG_SHARED_BUFFER102 0x0598
253#define NPU_REG_SHARED_BUFFER103 0x059C
254#define NPU_REG_SHARED_BUFFER104 0x05A0
255#define NPU_REG_SHARED_BUFFER105 0x05A4
256#define NPU_REG_SHARED_BUFFER106 0x05A8
257#define NPU_REG_SHARED_BUFFER107 0x05AC
258#define NPU_REG_SHARED_BUFFER108 0x05B0
259#define NPU_REG_SHARED_BUFFER109 0x05B4
260#define NPU_REG_SHARED_BUFFER110 0x05B8
261#define NPU_REG_SHARED_BUFFER111 0x05BC
262#define NPU_REG_SHARED_BUFFER112 0x05C0
263#define NPU_REG_SHARED_BUFFER113 0x05C4
264#define NPU_REG_SHARED_BUFFER114 0x05C8
265#define NPU_REG_SHARED_BUFFER115 0x05CC
266#define NPU_REG_SHARED_BUFFER116 0x05D0
267#define NPU_REG_SHARED_BUFFER117 0x05D4
268#define NPU_REG_SHARED_BUFFER118 0x05D8
269#define NPU_REG_SHARED_BUFFER119 0x05DC
270#define NPU_REG_SHARED_BUFFER120 0x05E0
271#define NPU_REG_SHARED_BUFFER121 0x05E4
272#define NPU_REG_SHARED_BUFFER122 0x05E8
273#define NPU_REG_SHARED_BUFFER123 0x05EC
274#define NPU_REG_SHARED_BUFFER124 0x05F0
275#define NPU_REG_SHARED_BUFFER125 0x05F4
276#define NPU_REG_SHARED_BUFFER126 0x05F8
277#define NPU_REG_SHARED_BUFFER127 0x05FC
278#define NPU_REG_SHARED_BUFFER128 0x0600
279#define NPU_REG_SHARED_BUFFER129 0x0604
280#define NPU_REG_SHARED_BUFFER130 0x0608
281#define NPU_REG_SHARED_BUFFER131 0x060C
282#define NPU_REG_SHARED_BUFFER132 0x0610
283#define NPU_REG_SHARED_BUFFER133 0x0614
284#define NPU_REG_SHARED_BUFFER134 0x0618
285#define NPU_REG_SHARED_BUFFER135 0x061C
286#define NPU_REG_SHARED_BUFFER136 0x0620
287#define NPU_REG_SHARED_BUFFER137 0x0624
288#define NPU_REG_SHARED_BUFFER138 0x0628
289#define NPU_REG_SHARED_BUFFER139 0x062C
290#define NPU_REG_SHARED_BUFFER140 0x0630
291#define NPU_REG_SHARED_BUFFER141 0x0634
292#define NPU_REG_SHARED_BUFFER142 0x0638
293#define NPU_REG_SHARED_BUFFER143 0x063C
294#define NPU_REG_SHARED_BUFFER144 0x0640
295#define NPU_REG_SHARED_BUFFER145 0x0644
296#define NPU_REG_SHARED_BUFFER146 0x0648
297#define NPU_REG_SHARED_BUFFER147 0x064C
298#define NPU_REG_SHARED_BUFFER148 0x0650
299#define NPU_REG_SHARED_BUFFER149 0x0654
300#define NPU_REG_SHARED_BUFFER150 0x0658
301#define NPU_REG_SHARED_BUFFER151 0x065C
302#define NPU_REG_SHARED_BUFFER152 0x0660
303#define NPU_REG_SHARED_BUFFER153 0x0664
304#define NPU_REG_SHARED_BUFFER154 0x0668
305#define NPU_REG_SHARED_BUFFER155 0x066C
306#define NPU_REG_SHARED_BUFFER156 0x0670
307#define NPU_REG_SHARED_BUFFER157 0x0674
308#define NPU_REG_SHARED_BUFFER158 0x0678
309#define NPU_REG_SHARED_BUFFER159 0x067C
310#define NPU_REG_SHARED_BUFFER160 0x0680
311#define NPU_REG_SHARED_BUFFER161 0x0684
312#define NPU_REG_SHARED_BUFFER162 0x0688
313#define NPU_REG_SHARED_BUFFER163 0x068C
314#define NPU_REG_SHARED_BUFFER164 0x0690
315#define NPU_REG_SHARED_BUFFER165 0x0694
316#define NPU_REG_SHARED_BUFFER166 0x0698
317#define NPU_REG_SHARED_BUFFER167 0x069C
318#define NPU_REG_SHARED_BUFFER168 0x06A0
319#define NPU_REG_SHARED_BUFFER169 0x06A4
320#define NPU_REG_SHARED_BUFFER170 0x06A8
321#define NPU_REG_SHARED_BUFFER171 0x06AC
322#define NPU_REG_SHARED_BUFFER172 0x06B0
323#define NPU_REG_SHARED_BUFFER173 0x06B4
324#define NPU_REG_SHARED_BUFFER174 0x06B8
325#define NPU_REG_SHARED_BUFFER175 0x06BC
326#define NPU_REG_SHARED_BUFFER176 0x06C0
327#define NPU_REG_SHARED_BUFFER177 0x06C4
328#define NPU_REG_SHARED_BUFFER178 0x06C8
329#define NPU_REG_SHARED_BUFFER179 0x06CC
330#define NPU_REG_SHARED_BUFFER180 0x06D0
331#define NPU_REG_SHARED_BUFFER181 0x06D4
332#define NPU_REG_SHARED_BUFFER182 0x06D8
333#define NPU_REG_SHARED_BUFFER183 0x06DC
334#define NPU_REG_SHARED_BUFFER184 0x06E0
335#define NPU_REG_SHARED_BUFFER185 0x06E4
336#define NPU_REG_SHARED_BUFFER186 0x06E8
337#define NPU_REG_SHARED_BUFFER187 0x06EC
338#define NPU_REG_SHARED_BUFFER188 0x06F0
339#define NPU_REG_SHARED_BUFFER189 0x06F4
340#define NPU_REG_SHARED_BUFFER190 0x06F8
341#define NPU_REG_SHARED_BUFFER191 0x06FC
342#define NPU_REG_SHARED_BUFFER192 0x0700
343#define NPU_REG_SHARED_BUFFER193 0x0704
344#define NPU_REG_SHARED_BUFFER194 0x0708
345#define NPU_REG_SHARED_BUFFER195 0x070C
346#define NPU_REG_SHARED_BUFFER196 0x0710
347#define NPU_REG_SHARED_BUFFER197 0x0714
348#define NPU_REG_SHARED_BUFFER198 0x0718
349#define NPU_REG_SHARED_BUFFER199 0x071C
350#define NPU_REG_SHARED_BUFFER200 0x0720
351#define NPU_REG_SHARED_BUFFER201 0x0724
352#define NPU_REG_SHARED_BUFFER202 0x0728
353#define NPU_REG_SHARED_BUFFER203 0x072C
354#define NPU_REG_SHARED_BUFFER204 0x0730
355#define NPU_REG_SHARED_BUFFER205 0x0734
356#define NPU_REG_SHARED_BUFFER206 0x0738
357#define NPU_REG_SHARED_BUFFER207 0x073C
358#define NPU_REG_SHARED_BUFFER208 0x0740
359#define NPU_REG_SHARED_BUFFER209 0x0744
360#define NPU_REG_SHARED_BUFFER210 0x0748
361#define NPU_REG_SHARED_BUFFER211 0x074C
362#define NPU_REG_SHARED_BUFFER212 0x0750
363#define NPU_REG_SHARED_BUFFER213 0x0754
364#define NPU_REG_SHARED_BUFFER214 0x0758
365#define NPU_REG_SHARED_BUFFER215 0x075C
366#define NPU_REG_SHARED_BUFFER216 0x0760
367#define NPU_REG_SHARED_BUFFER217 0x0764
368#define NPU_REG_SHARED_BUFFER218 0x0768
369#define NPU_REG_SHARED_BUFFER219 0x076C
370#define NPU_REG_SHARED_BUFFER220 0x0770
371#define NPU_REG_SHARED_BUFFER221 0x0774
372#define NPU_REG_SHARED_BUFFER222 0x0778
373#define NPU_REG_SHARED_BUFFER223 0x077C
374#define NPU_REG_SHARED_BUFFER224 0x0780
375#define NPU_REG_SHARED_BUFFER225 0x0784
376#define NPU_REG_SHARED_BUFFER226 0x0788
377#define NPU_REG_SHARED_BUFFER227 0x078C
378#define NPU_REG_SHARED_BUFFER228 0x0790
379#define NPU_REG_SHARED_BUFFER229 0x0794
380#define NPU_REG_SHARED_BUFFER230 0x0798
381#define NPU_REG_SHARED_BUFFER231 0x079C
382#define NPU_REG_SHARED_BUFFER232 0x07A0
383#define NPU_REG_SHARED_BUFFER233 0x07A4
384#define NPU_REG_SHARED_BUFFER234 0x07A8
385#define NPU_REG_SHARED_BUFFER235 0x07AC
386#define NPU_REG_SHARED_BUFFER236 0x07B0
387#define NPU_REG_SHARED_BUFFER237 0x07B4
388#define NPU_REG_SHARED_BUFFER238 0x07B8
389#define NPU_REG_SHARED_BUFFER239 0x07BC
390#define NPU_REG_SHARED_BUFFER240 0x07C0
391#define NPU_REG_SHARED_BUFFER241 0x07C4
392#define NPU_REG_SHARED_BUFFER242 0x07C8
393#define NPU_REG_SHARED_BUFFER243 0x07CC
394#define NPU_REG_SHARED_BUFFER244 0x07D0
395#define NPU_REG_SHARED_BUFFER245 0x07D4
396#define NPU_REG_SHARED_BUFFER246 0x07D8
397#define NPU_REG_SHARED_BUFFER247 0x07DC
398#define NPU_REG_SHARED_BUFFER248 0x07E0
399#define NPU_REG_SHARED_BUFFER249 0x07E4
400#define NPU_REG_SHARED_BUFFER250 0x07E8
401#define NPU_REG_SHARED_BUFFER251 0x07EC
402#define NPU_REG_SHARED_BUFFER252 0x07F0
403#define NPU_REG_SHARED_BUFFER253 0x07F4
404#define NPU_REG_SHARED_BUFFER254 0x07F8
405#define NPU_REG_SHARED_BUFFER255 0x07FC
Douglas Troha2e7e3b72020-05-14 20:28:31 +0200406#define SHARED_BUFFER_REGISTERS_SIZE 0x0800
Kristofer Jonsson49bdee82020-04-06 13:21:21 +0200407
408//
Douglas Troha2e7e3b72020-05-14 20:28:31 +0200409// Register subpage TSU
Kristofer Jonsson49bdee82020-04-06 13:21:21 +0200410//
411#define NPU_REG_IFM_PAD_TOP 0x0800
412#define NPU_REG_IFM_PAD_LEFT 0x0804
413#define NPU_REG_IFM_PAD_RIGHT 0x0808
414#define NPU_REG_IFM_PAD_BOTTOM 0x080C
415#define NPU_REG_IFM_DEPTH_M1 0x0810
416#define NPU_REG_IFM_PRECISION 0x0814
417#define NPU_REG_IFM_UPSCALE 0x081C
418#define NPU_REG_IFM_ZERO_POINT 0x0824
419#define NPU_REG_IFM_WIDTH0_M1 0x0828
420#define NPU_REG_IFM_HEIGHT0_M1 0x082C
421#define NPU_REG_IFM_HEIGHT1_M1 0x0830
422#define NPU_REG_IFM_IB_END 0x0834
423#define NPU_REG_IFM_REGION 0x083C
424#define NPU_REG_OFM_WIDTH_M1 0x0844
425#define NPU_REG_OFM_HEIGHT_M1 0x0848
426#define NPU_REG_OFM_DEPTH_M1 0x084C
427#define NPU_REG_OFM_PRECISION 0x0850
428#define NPU_REG_OFM_BLK_WIDTH_M1 0x0854
429#define NPU_REG_OFM_BLK_HEIGHT_M1 0x0858
430#define NPU_REG_OFM_BLK_DEPTH_M1 0x085C
431#define NPU_REG_OFM_ZERO_POINT 0x0860
432#define NPU_REG_OFM_WIDTH0_M1 0x0868
433#define NPU_REG_OFM_HEIGHT0_M1 0x086C
434#define NPU_REG_OFM_HEIGHT1_M1 0x0870
435#define NPU_REG_OFM_REGION 0x087C
436#define NPU_REG_KERNEL_WIDTH_M1 0x0880
437#define NPU_REG_KERNEL_HEIGHT_M1 0x0884
438#define NPU_REG_KERNEL_STRIDE 0x0888
439#define NPU_REG_PARALLEL_MODE 0x088C
440#define NPU_REG_ACC_FORMAT 0x0890
441#define NPU_REG_ACTIVATION 0x0894
442#define NPU_REG_ACTIVATION_MIN 0x0898
443#define NPU_REG_ACTIVATION_MAX 0x089C
444#define NPU_REG_WEIGHT_REGION 0x08A0
445#define NPU_REG_SCALE_REGION 0x08A4
446#define NPU_REG_AB_START 0x08B4
447#define NPU_REG_BLOCKDEP 0x08BC
448#define NPU_REG_DMA0_SRC_REGION 0x08C0
449#define NPU_REG_DMA0_DST_REGION 0x08C4
450#define NPU_REG_DMA0_SIZE0 0x08C8
451#define NPU_REG_DMA0_SIZE1 0x08CC
452#define NPU_REG_IFM2_BROADCAST 0x0900
453#define NPU_REG_IFM2_SCALAR 0x0904
454#define NPU_REG_IFM2_PRECISION 0x0914
455#define NPU_REG_IFM2_ZERO_POINT 0x0924
456#define NPU_REG_IFM2_WIDTH0_M1 0x0928
457#define NPU_REG_IFM2_HEIGHT0_M1 0x092C
458#define NPU_REG_IFM2_HEIGHT1_M1 0x0930
459#define NPU_REG_IFM2_IB_START 0x0934
460#define NPU_REG_IFM2_REGION 0x093C
461#define NPU_REG_IFM_BASE0 0x0A00
462#define NPU_REG_IFM_BASE0_HI 0x0A04
463#define NPU_REG_IFM_BASE1 0x0A08
464#define NPU_REG_IFM_BASE1_HI 0x0A0C
465#define NPU_REG_IFM_BASE2 0x0A10
466#define NPU_REG_IFM_BASE2_HI 0x0A14
467#define NPU_REG_IFM_BASE3 0x0A18
468#define NPU_REG_IFM_BASE3_HI 0x0A1C
469#define NPU_REG_IFM_STRIDE_X 0x0A20
470#define NPU_REG_IFM_STRIDE_X_HI 0x0A24
471#define NPU_REG_IFM_STRIDE_Y 0x0A28
472#define NPU_REG_IFM_STRIDE_Y_HI 0x0A2C
473#define NPU_REG_IFM_STRIDE_C 0x0A30
474#define NPU_REG_IFM_STRIDE_C_HI 0x0A34
475#define NPU_REG_OFM_BASE0 0x0A40
476#define NPU_REG_OFM_BASE0_HI 0x0A44
477#define NPU_REG_OFM_BASE1 0x0A48
478#define NPU_REG_OFM_BASE1_HI 0x0A4C
479#define NPU_REG_OFM_BASE2 0x0A50
480#define NPU_REG_OFM_BASE2_HI 0x0A54
481#define NPU_REG_OFM_BASE3 0x0A58
482#define NPU_REG_OFM_BASE3_HI 0x0A5C
483#define NPU_REG_OFM_STRIDE_X 0x0A60
484#define NPU_REG_OFM_STRIDE_X_HI 0x0A64
485#define NPU_REG_OFM_STRIDE_Y 0x0A68
486#define NPU_REG_OFM_STRIDE_Y_HI 0x0A6C
487#define NPU_REG_OFM_STRIDE_C 0x0A70
488#define NPU_REG_OFM_STRIDE_C_HI 0x0A74
489#define NPU_REG_WEIGHT_BASE 0x0A80
490#define NPU_REG_WEIGHT_BASE_HI 0x0A84
491#define NPU_REG_WEIGHT_LENGTH 0x0A88
Kristofer Jonsson49bdee82020-04-06 13:21:21 +0200492#define NPU_REG_SCALE_BASE 0x0A90
493#define NPU_REG_SCALE_BASE_HI 0x0A94
494#define NPU_REG_SCALE_LENGTH 0x0A98
495#define NPU_REG_OFM_SCALE 0x0AA0
496#define NPU_REG_OFM_SCALE_SHIFT 0x0AA4
497#define NPU_REG_OPA_SCALE 0x0AA8
498#define NPU_REG_OPA_SCALE_SHIFT 0x0AAC
499#define NPU_REG_OPB_SCALE 0x0AB0
500#define NPU_REG_DMA0_SRC 0x0AC0
501#define NPU_REG_DMA0_SRC_HI 0x0AC4
502#define NPU_REG_DMA0_DST 0x0AC8
503#define NPU_REG_DMA0_DST_HI 0x0ACC
504#define NPU_REG_DMA0_LEN 0x0AD0
505#define NPU_REG_DMA0_LEN_HI 0x0AD4
506#define NPU_REG_DMA0_SKIP0 0x0AD8
507#define NPU_REG_DMA0_SKIP0_HI 0x0ADC
508#define NPU_REG_DMA0_SKIP1 0x0AE0
509#define NPU_REG_DMA0_SKIP1_HI 0x0AE4
510#define NPU_REG_IFM2_BASE0 0x0B00
511#define NPU_REG_IFM2_BASE0_HI 0x0B04
512#define NPU_REG_IFM2_BASE1 0x0B08
513#define NPU_REG_IFM2_BASE1_HI 0x0B0C
514#define NPU_REG_IFM2_BASE2 0x0B10
515#define NPU_REG_IFM2_BASE2_HI 0x0B14
516#define NPU_REG_IFM2_BASE3 0x0B18
517#define NPU_REG_IFM2_BASE3_HI 0x0B1C
518#define NPU_REG_IFM2_STRIDE_X 0x0B20
519#define NPU_REG_IFM2_STRIDE_X_HI 0x0B24
520#define NPU_REG_IFM2_STRIDE_Y 0x0B28
521#define NPU_REG_IFM2_STRIDE_Y_HI 0x0B2C
522#define NPU_REG_IFM2_STRIDE_C 0x0B30
523#define NPU_REG_IFM2_STRIDE_C_HI 0x0B34
524#define NPU_REG_WEIGHT1_BASE 0x0B40
525#define NPU_REG_WEIGHT1_BASE_HI 0x0B44
526#define NPU_REG_WEIGHT1_LENGTH 0x0B48
Kristofer Jonsson49bdee82020-04-06 13:21:21 +0200527#define NPU_REG_SCALE1_BASE 0x0B50
528#define NPU_REG_SCALE1_BASE_HI 0x0B54
529#define NPU_REG_SCALE1_LENGTH 0x0B58
Douglas Troha2e7e3b72020-05-14 20:28:31 +0200530#define TSU_REGISTERS_SIZE 0x0B5C
Kristofer Jonsson49bdee82020-04-06 13:21:21 +0200531
532//
Douglas Troha2e7e3b72020-05-14 20:28:31 +0200533// Register subpage TSU_DEBUG
Kristofer Jonsson49bdee82020-04-06 13:21:21 +0200534//
535#define NPU_REG_KERNEL_X 0x0200
536#define NPU_REG_KERNEL_Y 0x0204
537#define NPU_REG_KERNEL_W_M1 0x0208
538#define NPU_REG_KERNEL_H_M1 0x020C
539#define NPU_REG_OFM_CBLK_WIDTH_M1 0x0210
540#define NPU_REG_OFM_CBLK_HEIGHT_M1 0x0214
541#define NPU_REG_OFM_CBLK_DEPTH_M1 0x0218
542#define NPU_REG_IFM_CBLK_DEPTH_M1 0x021C
543#define NPU_REG_OFM_X 0x0220
544#define NPU_REG_OFM_Y 0x0224
545#define NPU_REG_OFM_Z 0x0228
546#define NPU_REG_IFM_Z 0x022C
547#define NPU_REG_PAD_TOP 0x0230
548#define NPU_REG_PAD_LEFT 0x0234
549#define NPU_REG_IFM_CBLK_WIDTH 0x0238
550#define NPU_REG_IFM_CBLK_HEIGHT 0x023C
551#define NPU_REG_DMA_IFM_SRC 0x0240
552#define NPU_REG_DMA_IFM_SRC_HI 0x0244
553#define NPU_REG_DMA_IFM_DST 0x0248
554#define NPU_REG_DMA_OFM_SRC 0x024C
555#define NPU_REG_DMA_OFM_DST 0x0250
556#define NPU_REG_DMA_OFM_DST_HI 0x0254
557#define NPU_REG_DMA_WEIGHT_SRC 0x0258
558#define NPU_REG_DMA_WEIGHT_SRC_HI 0x025C
559#define NPU_REG_DMA_CMD_SRC 0x0260
560#define NPU_REG_DMA_CMD_SRC_HI 0x0264
561#define NPU_REG_DMA_CMD_SIZE 0x0268
562#define NPU_REG_DMA_M2M_SRC 0x026C
563#define NPU_REG_DMA_M2M_SRC_HI 0x0270
564#define NPU_REG_DMA_M2M_DST 0x0274
565#define NPU_REG_DMA_M2M_DST_HI 0x0278
566#define NPU_REG_CURRENT_QREAD 0x027C
567#define NPU_REG_DMA_SCALE_SRC 0x0280
568#define NPU_REG_DMA_SCALE_SRC_HI 0x0284
Stefan Nannessone2e70242020-08-19 16:01:29 +0200569#define NPU_REG_CURRENT_BLOCK 0x02B4
570#define NPU_REG_CURRENT_OP 0x02B8
Kristofer Jonsson49bdee82020-04-06 13:21:21 +0200571#define NPU_REG_CURRENT_CMD 0x02BC
Douglas Troha2e7e3b72020-05-14 20:28:31 +0200572#define TSU_DEBUG_REGISTERS_SIZE 0x02C0
Kristofer Jonsson49bdee82020-04-06 13:21:21 +0200573
574#ifdef __cplusplus
575
576// Enum types
577
Douglas Trohaf6a85da2020-05-11 11:45:28 +0200578enum class acc_format : uint16_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +0200579{
580 INT_32BIT = 0,
581 INT_40BIT = 1,
582 FP_S5_10 = 2,
583};
584
Douglas Trohaf6a85da2020-05-11 11:45:28 +0200585enum class activation : uint16_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +0200586{
587 NONE = 0,
588 TANH = 3,
589 SIGMOID = 4,
590 LUT_START = 16,
591 LUT_END = 23,
592};
593
Stefan Nannessone2e70242020-08-19 16:01:29 +0200594enum class axi_mem_encoding_type : uint8_t
595{
596 DEVICE_NON_BUFFERABLE = 0x0,
597 DEVICE_BUFFERABLE = 0x1,
598 NORMAL_NON_CACHEABLE_NON_BUFFERABLE = 0x2,
599 NORMAL_NON_CACHEABLE_BUFFERABLE = 0x3,
600 WRITE_THROUGH_NO_ALLOCATE = 0x4,
601 WRITE_THROUGH_READ_ALLOCATE = 0x5,
602 WRITE_THROUGH_WRITE_ALLOCATE = 0x6,
603 WRITE_THROUGH_READ_AND_WRITE_ALLOCATE = 0x7,
604 WRITE_BACK_NO_ALLOCATE = 0x8,
605 WRITE_BACK_READ_ALLOCATE = 0x9,
606 WRITE_BACK_WRITE_ALLOCATE = 0xA,
607 WRITE_BACK_READ_AND_WRITE_ALLOCATE = 0xB,
608 RESERVED_12 = 0xC,
609 RESERVED_13 = 0xD,
610 RESERVED_14 = 0xE,
611 RESERVED_15 = 0xF,
612};
613
Kristofer Jonsson49bdee82020-04-06 13:21:21 +0200614enum class clip_range : uint8_t
615{
616 OFM_PRECISION = 0,
617 FORCE_UINT8 = 2,
618 FORCE_INT8 = 3,
619 FORCE_INT16 = 5,
620};
621
622enum class cmd0 : uint16_t
623{
624 NPU_OP_STOP = 0x000,
625 NPU_OP_IRQ = 0x001,
626 NPU_OP_CONV = 0x002,
627 NPU_OP_DEPTHWISE = 0x003,
628 NPU_OP_POOL = 0x005,
629 NPU_OP_ELEMENTWISE = 0x006,
630 NPU_OP_DMA_START = 0x010,
631 NPU_OP_DMA_WAIT = 0x011,
632 NPU_OP_KERNEL_WAIT = 0x012,
633 NPU_OP_PMU_MASK = 0x013,
634 NPU_SET_IFM_PAD_TOP = 0x100,
635 NPU_SET_IFM_PAD_LEFT = 0x101,
636 NPU_SET_IFM_PAD_RIGHT = 0x102,
637 NPU_SET_IFM_PAD_BOTTOM = 0x103,
638 NPU_SET_IFM_DEPTH_M1 = 0x104,
639 NPU_SET_IFM_PRECISION = 0x105,
640 NPU_SET_IFM_UPSCALE = 0x107,
641 NPU_SET_IFM_ZERO_POINT = 0x109,
642 NPU_SET_IFM_WIDTH0_M1 = 0x10A,
643 NPU_SET_IFM_HEIGHT0_M1 = 0x10B,
644 NPU_SET_IFM_HEIGHT1_M1 = 0x10C,
645 NPU_SET_IFM_IB_END = 0x10D,
646 NPU_SET_IFM_REGION = 0x10F,
647 NPU_SET_OFM_WIDTH_M1 = 0x111,
648 NPU_SET_OFM_HEIGHT_M1 = 0x112,
649 NPU_SET_OFM_DEPTH_M1 = 0x113,
650 NPU_SET_OFM_PRECISION = 0x114,
651 NPU_SET_OFM_BLK_WIDTH_M1 = 0x115,
652 NPU_SET_OFM_BLK_HEIGHT_M1 = 0x116,
653 NPU_SET_OFM_BLK_DEPTH_M1 = 0x117,
654 NPU_SET_OFM_ZERO_POINT = 0x118,
655 NPU_SET_OFM_WIDTH0_M1 = 0x11A,
656 NPU_SET_OFM_HEIGHT0_M1 = 0x11B,
657 NPU_SET_OFM_HEIGHT1_M1 = 0x11C,
658 NPU_SET_OFM_REGION = 0x11F,
659 NPU_SET_KERNEL_WIDTH_M1 = 0x120,
660 NPU_SET_KERNEL_HEIGHT_M1 = 0x121,
661 NPU_SET_KERNEL_STRIDE = 0x122,
662 NPU_SET_PARALLEL_MODE = 0x123,
663 NPU_SET_ACC_FORMAT = 0x124,
664 NPU_SET_ACTIVATION = 0x125,
665 NPU_SET_ACTIVATION_MIN = 0x126,
666 NPU_SET_ACTIVATION_MAX = 0x127,
667 NPU_SET_WEIGHT_REGION = 0x128,
668 NPU_SET_SCALE_REGION = 0x129,
669 NPU_SET_AB_START = 0x12D,
670 NPU_SET_BLOCKDEP = 0x12F,
671 NPU_SET_DMA0_SRC_REGION = 0x130,
672 NPU_SET_DMA0_DST_REGION = 0x131,
673 NPU_SET_DMA0_SIZE0 = 0x132,
674 NPU_SET_DMA0_SIZE1 = 0x133,
675 NPU_SET_IFM2_BROADCAST = 0x180,
676 NPU_SET_IFM2_SCALAR = 0x181,
677 NPU_SET_IFM2_PRECISION = 0x185,
678 NPU_SET_IFM2_ZERO_POINT = 0x189,
679 NPU_SET_IFM2_WIDTH0_M1 = 0x18A,
680 NPU_SET_IFM2_HEIGHT0_M1 = 0x18B,
681 NPU_SET_IFM2_HEIGHT1_M1 = 0x18C,
682 NPU_SET_IFM2_IB_START = 0x18D,
683 NPU_SET_IFM2_REGION = 0x18F,
684};
685
Douglas Trohaf6a85da2020-05-11 11:45:28 +0200686enum class cmd1 : uint16_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +0200687{
688 NPU_SET_IFM_BASE0 = 0x000,
689 NPU_SET_IFM_BASE1 = 0x001,
690 NPU_SET_IFM_BASE2 = 0x002,
691 NPU_SET_IFM_BASE3 = 0x003,
692 NPU_SET_IFM_STRIDE_X = 0x004,
693 NPU_SET_IFM_STRIDE_Y = 0x005,
694 NPU_SET_IFM_STRIDE_C = 0x006,
695 NPU_SET_OFM_BASE0 = 0x010,
696 NPU_SET_OFM_BASE1 = 0x011,
697 NPU_SET_OFM_BASE2 = 0x012,
698 NPU_SET_OFM_BASE3 = 0x013,
699 NPU_SET_OFM_STRIDE_X = 0x014,
700 NPU_SET_OFM_STRIDE_Y = 0x015,
701 NPU_SET_OFM_STRIDE_C = 0x016,
702 NPU_SET_WEIGHT_BASE = 0x020,
703 NPU_SET_WEIGHT_LENGTH = 0x021,
704 NPU_SET_SCALE_BASE = 0x022,
705 NPU_SET_SCALE_LENGTH = 0x023,
706 NPU_SET_OFM_SCALE = 0x024,
707 NPU_SET_OPA_SCALE = 0x025,
708 NPU_SET_OPB_SCALE = 0x026,
709 NPU_SET_DMA0_SRC = 0x030,
710 NPU_SET_DMA0_DST = 0x031,
711 NPU_SET_DMA0_LEN = 0x032,
712 NPU_SET_DMA0_SKIP0 = 0x033,
713 NPU_SET_DMA0_SKIP1 = 0x034,
714 NPU_SET_IFM2_BASE0 = 0x080,
715 NPU_SET_IFM2_BASE1 = 0x081,
716 NPU_SET_IFM2_BASE2 = 0x082,
717 NPU_SET_IFM2_BASE3 = 0x083,
718 NPU_SET_IFM2_STRIDE_X = 0x084,
719 NPU_SET_IFM2_STRIDE_Y = 0x085,
720 NPU_SET_IFM2_STRIDE_C = 0x086,
721 NPU_SET_WEIGHT1_BASE = 0x090,
722 NPU_SET_WEIGHT1_LENGTH = 0x091,
723 NPU_SET_SCALE1_BASE = 0x092,
724 NPU_SET_SCALE1_LENGTH = 0x093,
725};
726
727enum class data_format : uint8_t
728{
729 NHWC = 0,
730 NHCWB16 = 1,
731};
732
Douglas Trohaf6a85da2020-05-11 11:45:28 +0200733enum class elementwise_mode : uint16_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +0200734{
735 MUL = 0,
736 ADD = 1,
737 SUB = 2,
738 MIN = 3,
739 MAX = 4,
740 LRELU = 5,
741 ABS = 6,
742 CLZ = 7,
743 SHR = 8,
744 SHL = 9,
745};
746
747enum class ifm_precision : uint8_t
748{
Diqing Zhonga9f38d52020-04-27 11:00:13 +0200749 U8 = 0,
750 S8 = 1,
751 U16 = 4,
752 S16 = 5,
753 S32 = 9,
Kristofer Jonsson49bdee82020-04-06 13:21:21 +0200754};
755
756enum class ifm_scale_mode : uint8_t
757{
758 SCALE_16BIT = 0,
759 SCALE_OPA_32BIT = 1,
760 SCALE_OPB_32BIT = 2,
761};
762
Diqing Zhong04118062020-04-15 01:19:12 +0200763enum class macs_per_cc : uint8_t
764{
765 MACS_PER_CC_IS_5 = 0x5,
766 MACS_PER_CC_IS_6 = 0x6,
767 MACS_PER_CC_IS_7 = 0x7,
768 MACS_PER_CC_IS_8 = 0x8,
769};
770
Kristofer Jonsson49bdee82020-04-06 13:21:21 +0200771enum class memory_type : uint8_t
772{
773 AXI0_OUTSTANDING_COUNTER0 = 0,
774 AXI0_OUTSTANDING_COUNTER1 = 1,
775 AXI1_OUTSTANDING_COUNTER2 = 2,
776 AXI1_OUTSTANDING_COUNTER3 = 3,
777};
778
779enum class ofm_precision : uint8_t
780{
781 U8 = 0,
782 S8 = 1,
783 U16 = 2,
784 S16 = 3,
785 S32 = 5,
786};
787
788enum class pmu_event_type : uint16_t
789{
Douglas Trohaf6a85da2020-05-11 11:45:28 +0200790 NO_EVENT = 0x00,
791 CYCLE = 0x11,
792 NPU_IDLE = 0x20,
793 CC_STALLED_ON_BLOCKDEP = 0x21,
794 CC_STALLED_ON_SHRAM_RECONFIG = 0x22,
Douglas Troha2407e962020-06-15 14:31:45 +0200795 NPU_ACTIVE = 0x23,
Douglas Trohaf6a85da2020-05-11 11:45:28 +0200796 MAC_ACTIVE = 0x30,
797 MAC_ACTIVE_8BIT = 0x31,
798 MAC_ACTIVE_16BIT = 0x32,
799 MAC_DPU_ACTIVE = 0x33,
800 MAC_STALLED_BY_WD_ACC = 0x34,
801 MAC_STALLED_BY_WD = 0x35,
802 MAC_STALLED_BY_ACC = 0x36,
803 MAC_STALLED_BY_IB = 0x37,
804 MAC_ACTIVE_32BIT = 0x38,
805 MAC_STALLED_BY_INT_W = 0x39,
806 MAC_STALLED_BY_INT_ACC = 0x3A,
807 AO_ACTIVE = 0x40,
808 AO_ACTIVE_8BIT = 0x41,
809 AO_ACTIVE_16BIT = 0x42,
810 AO_STALLED_BY_OFMP_OB = 0x43,
811 AO_STALLED_BY_OFMP = 0x44,
812 AO_STALLED_BY_OB = 0x45,
813 AO_STALLED_BY_ACC_IB = 0x46,
814 AO_STALLED_BY_ACC = 0x47,
815 AO_STALLED_BY_IB = 0x48,
816 WD_ACTIVE = 0x50,
817 WD_STALLED = 0x51,
818 WD_STALLED_BY_WS = 0x52,
819 WD_STALLED_BY_WD_BUF = 0x53,
820 WD_PARSE_ACTIVE = 0x54,
821 WD_PARSE_STALLED = 0x55,
822 WD_PARSE_STALLED_IN = 0x56,
823 WD_PARSE_STALLED_OUT = 0x57,
824 WD_TRANS_WS = 0x58,
825 WD_TRANS_WB = 0x59,
826 WD_TRANS_DW0 = 0x5a,
827 WD_TRANS_DW1 = 0x5b,
828 AXI0_RD_TRANS_ACCEPTED = 0x80,
829 AXI0_RD_TRANS_COMPLETED = 0x81,
830 AXI0_RD_DATA_BEAT_RECEIVED = 0x82,
831 AXI0_RD_TRAN_REQ_STALLED = 0x83,
832 AXI0_WR_TRANS_ACCEPTED = 0x84,
833 AXI0_WR_TRANS_COMPLETED_M = 0x85,
834 AXI0_WR_TRANS_COMPLETED_S = 0x86,
835 AXI0_WR_DATA_BEAT_WRITTEN = 0x87,
836 AXI0_WR_TRAN_REQ_STALLED = 0x88,
837 AXI0_WR_DATA_BEAT_STALLED = 0x89,
838 AXI0_ENABLED_CYCLES = 0x8c,
839 AXI0_RD_STALL_LIMIT = 0x8e,
840 AXI0_WR_STALL_LIMIT = 0x8f,
841 AXI1_RD_TRANS_ACCEPTED = 0x180,
842 AXI1_RD_TRANS_COMPLETED = 0x181,
843 AXI1_RD_DATA_BEAT_RECEIVED = 0x182,
844 AXI1_RD_TRAN_REQ_STALLED = 0x183,
845 AXI1_WR_TRANS_ACCEPTED = 0x184,
846 AXI1_WR_TRANS_COMPLETED_M = 0x185,
847 AXI1_WR_TRANS_COMPLETED_S = 0x186,
848 AXI1_WR_DATA_BEAT_WRITTEN = 0x187,
849 AXI1_WR_TRAN_REQ_STALLED = 0x188,
850 AXI1_WR_DATA_BEAT_STALLED = 0x189,
851 AXI1_ENABLED_CYCLES = 0x18c,
852 AXI1_RD_STALL_LIMIT = 0x18e,
853 AXI1_WR_STALL_LIMIT = 0x18f,
854 AXI_LATENCY_ANY = 0xa0,
855 AXI_LATENCY_32 = 0xa1,
856 AXI_LATENCY_64 = 0xa2,
857 AXI_LATENCY_128 = 0xa3,
858 AXI_LATENCY_256 = 0xa4,
859 AXI_LATENCY_512 = 0xa5,
860 AXI_LATENCY_1024 = 0xa6,
Stefan Nannessone2e70242020-08-19 16:01:29 +0200861 ECC_DMA = 0xb0,
862 ECC_SB0 = 0xb1,
863 ECC_SB1 = 0x1b1,
Kristofer Jonsson49bdee82020-04-06 13:21:21 +0200864};
865
Douglas Trohaf6a85da2020-05-11 11:45:28 +0200866enum class pooling_mode : uint16_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +0200867{
868 MAX = 0,
869 AVERAGE = 1,
870 REDUCE_SUM = 2,
871};
872
873enum class privilege_level : uint8_t
874{
875 USER = 0,
876 PRIVILEGED = 1,
877};
878
Kristofer Jonsson49bdee82020-04-06 13:21:21 +0200879enum class resampling_mode : uint8_t
880{
881 NONE = 0,
882 NEAREST = 1,
883 TRANSPOSE = 2,
884};
885
886enum class rounding : uint8_t
887{
888 TFL = 0,
889 TRUNCATE = 1,
890 NATURAL = 2,
891};
892
893enum class security_level : uint8_t
894{
895 SECURE = 0,
896 NON_SECURE = 1,
897};
898
Diqing Zhong04118062020-04-15 01:19:12 +0200899enum class shram_size : uint8_t
900{
Stefan Nannessone2e70242020-08-19 16:01:29 +0200901 SHRAM_96KB = 0x60,
Diqing Zhong04118062020-04-15 01:19:12 +0200902 SHRAM_48KB = 0x30,
903 SHRAM_24KB = 0x18,
904 SHRAM_16KB = 0x10,
905};
906
Kristofer Jonsson49bdee82020-04-06 13:21:21 +0200907enum class state : uint8_t
908{
909 STOPPED = 0,
910 RUNNING = 1,
911};
912
913enum class stride_mode : uint8_t
914{
915 STRIDE_MODE_1D = 0,
916 STRIDE_MODE_2D = 1,
917 STRIDE_MODE_3D = 2,
918};
919
920#else
921
922enum acc_format
923{
924 ACC_FORMAT_INT_32BIT = 0,
925 ACC_FORMAT_INT_40BIT = 1,
926 ACC_FORMAT_FP_S5_10 = 2,
927};
928
929enum activation
930{
931 ACTIVATION_NONE = 0,
932 ACTIVATION_TANH = 3,
933 ACTIVATION_SIGMOID = 4,
934 ACTIVATION_LUT_START = 16,
935 ACTIVATION_LUT_END = 23,
936};
937
Stefan Nannessone2e70242020-08-19 16:01:29 +0200938enum axi_mem_encoding_type
939{
940 AXI_MEM_ENCODING_TYPE_DEVICE_NON_BUFFERABLE = 0x0,
941 AXI_MEM_ENCODING_TYPE_DEVICE_BUFFERABLE = 0x1,
942 AXI_MEM_ENCODING_TYPE_NORMAL_NON_CACHEABLE_NON_BUFFERABLE = 0x2,
943 AXI_MEM_ENCODING_TYPE_NORMAL_NON_CACHEABLE_BUFFERABLE = 0x3,
944 AXI_MEM_ENCODING_TYPE_WRITE_THROUGH_NO_ALLOCATE = 0x4,
945 AXI_MEM_ENCODING_TYPE_WRITE_THROUGH_READ_ALLOCATE = 0x5,
946 AXI_MEM_ENCODING_TYPE_WRITE_THROUGH_WRITE_ALLOCATE = 0x6,
947 AXI_MEM_ENCODING_TYPE_WRITE_THROUGH_READ_AND_WRITE_ALLOCATE = 0x7,
948 AXI_MEM_ENCODING_TYPE_WRITE_BACK_NO_ALLOCATE = 0x8,
949 AXI_MEM_ENCODING_TYPE_WRITE_BACK_READ_ALLOCATE = 0x9,
950 AXI_MEM_ENCODING_TYPE_WRITE_BACK_WRITE_ALLOCATE = 0xA,
951 AXI_MEM_ENCODING_TYPE_WRITE_BACK_READ_AND_WRITE_ALLOCATE = 0xB,
952 AXI_MEM_ENCODING_TYPE_RESERVED_12 = 0xC,
953 AXI_MEM_ENCODING_TYPE_RESERVED_13 = 0xD,
954 AXI_MEM_ENCODING_TYPE_RESERVED_14 = 0xE,
955 AXI_MEM_ENCODING_TYPE_RESERVED_15 = 0xF,
956};
957
Kristofer Jonsson49bdee82020-04-06 13:21:21 +0200958enum clip_range
959{
960 CLIP_RANGE_OFM_PRECISION = 0,
961 CLIP_RANGE_FORCE_UINT8 = 2,
962 CLIP_RANGE_FORCE_INT8 = 3,
963 CLIP_RANGE_FORCE_INT16 = 5,
964};
965
966enum cmd0
967{
968 CMD0_NPU_OP_STOP = 0x000,
969 CMD0_NPU_OP_IRQ = 0x001,
970 CMD0_NPU_OP_CONV = 0x002,
971 CMD0_NPU_OP_DEPTHWISE = 0x003,
972 CMD0_NPU_OP_POOL = 0x005,
973 CMD0_NPU_OP_ELEMENTWISE = 0x006,
974 CMD0_NPU_OP_DMA_START = 0x010,
975 CMD0_NPU_OP_DMA_WAIT = 0x011,
976 CMD0_NPU_OP_KERNEL_WAIT = 0x012,
977 CMD0_NPU_OP_PMU_MASK = 0x013,
978 CMD0_NPU_SET_IFM_PAD_TOP = 0x100,
979 CMD0_NPU_SET_IFM_PAD_LEFT = 0x101,
980 CMD0_NPU_SET_IFM_PAD_RIGHT = 0x102,
981 CMD0_NPU_SET_IFM_PAD_BOTTOM = 0x103,
982 CMD0_NPU_SET_IFM_DEPTH_M1 = 0x104,
983 CMD0_NPU_SET_IFM_PRECISION = 0x105,
984 CMD0_NPU_SET_IFM_UPSCALE = 0x107,
985 CMD0_NPU_SET_IFM_ZERO_POINT = 0x109,
986 CMD0_NPU_SET_IFM_WIDTH0_M1 = 0x10A,
987 CMD0_NPU_SET_IFM_HEIGHT0_M1 = 0x10B,
988 CMD0_NPU_SET_IFM_HEIGHT1_M1 = 0x10C,
989 CMD0_NPU_SET_IFM_IB_END = 0x10D,
990 CMD0_NPU_SET_IFM_REGION = 0x10F,
991 CMD0_NPU_SET_OFM_WIDTH_M1 = 0x111,
992 CMD0_NPU_SET_OFM_HEIGHT_M1 = 0x112,
993 CMD0_NPU_SET_OFM_DEPTH_M1 = 0x113,
994 CMD0_NPU_SET_OFM_PRECISION = 0x114,
995 CMD0_NPU_SET_OFM_BLK_WIDTH_M1 = 0x115,
996 CMD0_NPU_SET_OFM_BLK_HEIGHT_M1 = 0x116,
997 CMD0_NPU_SET_OFM_BLK_DEPTH_M1 = 0x117,
998 CMD0_NPU_SET_OFM_ZERO_POINT = 0x118,
999 CMD0_NPU_SET_OFM_WIDTH0_M1 = 0x11A,
1000 CMD0_NPU_SET_OFM_HEIGHT0_M1 = 0x11B,
1001 CMD0_NPU_SET_OFM_HEIGHT1_M1 = 0x11C,
1002 CMD0_NPU_SET_OFM_REGION = 0x11F,
1003 CMD0_NPU_SET_KERNEL_WIDTH_M1 = 0x120,
1004 CMD0_NPU_SET_KERNEL_HEIGHT_M1 = 0x121,
1005 CMD0_NPU_SET_KERNEL_STRIDE = 0x122,
1006 CMD0_NPU_SET_PARALLEL_MODE = 0x123,
1007 CMD0_NPU_SET_ACC_FORMAT = 0x124,
1008 CMD0_NPU_SET_ACTIVATION = 0x125,
1009 CMD0_NPU_SET_ACTIVATION_MIN = 0x126,
1010 CMD0_NPU_SET_ACTIVATION_MAX = 0x127,
1011 CMD0_NPU_SET_WEIGHT_REGION = 0x128,
1012 CMD0_NPU_SET_SCALE_REGION = 0x129,
1013 CMD0_NPU_SET_AB_START = 0x12D,
1014 CMD0_NPU_SET_BLOCKDEP = 0x12F,
1015 CMD0_NPU_SET_DMA0_SRC_REGION = 0x130,
1016 CMD0_NPU_SET_DMA0_DST_REGION = 0x131,
1017 CMD0_NPU_SET_DMA0_SIZE0 = 0x132,
1018 CMD0_NPU_SET_DMA0_SIZE1 = 0x133,
1019 CMD0_NPU_SET_IFM2_BROADCAST = 0x180,
1020 CMD0_NPU_SET_IFM2_SCALAR = 0x181,
1021 CMD0_NPU_SET_IFM2_PRECISION = 0x185,
1022 CMD0_NPU_SET_IFM2_ZERO_POINT = 0x189,
1023 CMD0_NPU_SET_IFM2_WIDTH0_M1 = 0x18A,
1024 CMD0_NPU_SET_IFM2_HEIGHT0_M1 = 0x18B,
1025 CMD0_NPU_SET_IFM2_HEIGHT1_M1 = 0x18C,
1026 CMD0_NPU_SET_IFM2_IB_START = 0x18D,
1027 CMD0_NPU_SET_IFM2_REGION = 0x18F,
1028};
1029
1030enum cmd1
1031{
1032 CMD1_NPU_SET_IFM_BASE0 = 0x000,
1033 CMD1_NPU_SET_IFM_BASE1 = 0x001,
1034 CMD1_NPU_SET_IFM_BASE2 = 0x002,
1035 CMD1_NPU_SET_IFM_BASE3 = 0x003,
1036 CMD1_NPU_SET_IFM_STRIDE_X = 0x004,
1037 CMD1_NPU_SET_IFM_STRIDE_Y = 0x005,
1038 CMD1_NPU_SET_IFM_STRIDE_C = 0x006,
1039 CMD1_NPU_SET_OFM_BASE0 = 0x010,
1040 CMD1_NPU_SET_OFM_BASE1 = 0x011,
1041 CMD1_NPU_SET_OFM_BASE2 = 0x012,
1042 CMD1_NPU_SET_OFM_BASE3 = 0x013,
1043 CMD1_NPU_SET_OFM_STRIDE_X = 0x014,
1044 CMD1_NPU_SET_OFM_STRIDE_Y = 0x015,
1045 CMD1_NPU_SET_OFM_STRIDE_C = 0x016,
1046 CMD1_NPU_SET_WEIGHT_BASE = 0x020,
1047 CMD1_NPU_SET_WEIGHT_LENGTH = 0x021,
1048 CMD1_NPU_SET_SCALE_BASE = 0x022,
1049 CMD1_NPU_SET_SCALE_LENGTH = 0x023,
1050 CMD1_NPU_SET_OFM_SCALE = 0x024,
1051 CMD1_NPU_SET_OPA_SCALE = 0x025,
1052 CMD1_NPU_SET_OPB_SCALE = 0x026,
1053 CMD1_NPU_SET_DMA0_SRC = 0x030,
1054 CMD1_NPU_SET_DMA0_DST = 0x031,
1055 CMD1_NPU_SET_DMA0_LEN = 0x032,
1056 CMD1_NPU_SET_DMA0_SKIP0 = 0x033,
1057 CMD1_NPU_SET_DMA0_SKIP1 = 0x034,
1058 CMD1_NPU_SET_IFM2_BASE0 = 0x080,
1059 CMD1_NPU_SET_IFM2_BASE1 = 0x081,
1060 CMD1_NPU_SET_IFM2_BASE2 = 0x082,
1061 CMD1_NPU_SET_IFM2_BASE3 = 0x083,
1062 CMD1_NPU_SET_IFM2_STRIDE_X = 0x084,
1063 CMD1_NPU_SET_IFM2_STRIDE_Y = 0x085,
1064 CMD1_NPU_SET_IFM2_STRIDE_C = 0x086,
1065 CMD1_NPU_SET_WEIGHT1_BASE = 0x090,
1066 CMD1_NPU_SET_WEIGHT1_LENGTH = 0x091,
1067 CMD1_NPU_SET_SCALE1_BASE = 0x092,
1068 CMD1_NPU_SET_SCALE1_LENGTH = 0x093,
1069};
1070
1071enum data_format
1072{
1073 DATA_FORMAT_NHWC = 0,
1074 DATA_FORMAT_NHCWB16 = 1,
1075};
1076
1077enum elementwise_mode
1078{
1079 ELEMENTWISE_MODE_MUL = 0,
1080 ELEMENTWISE_MODE_ADD = 1,
1081 ELEMENTWISE_MODE_SUB = 2,
1082 ELEMENTWISE_MODE_MIN = 3,
1083 ELEMENTWISE_MODE_MAX = 4,
1084 ELEMENTWISE_MODE_LRELU = 5,
1085 ELEMENTWISE_MODE_ABS = 6,
1086 ELEMENTWISE_MODE_CLZ = 7,
1087 ELEMENTWISE_MODE_SHR = 8,
1088 ELEMENTWISE_MODE_SHL = 9,
1089};
1090
1091enum ifm_precision
1092{
Diqing Zhonga9f38d52020-04-27 11:00:13 +02001093 IFM_PRECISION_U8 = 0,
1094 IFM_PRECISION_S8 = 1,
1095 IFM_PRECISION_U16 = 4,
1096 IFM_PRECISION_S16 = 5,
1097 IFM_PRECISION_S32 = 9,
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001098};
1099
1100enum ifm_scale_mode
1101{
1102 IFM_SCALE_MODE_SCALE_16BIT = 0,
1103 IFM_SCALE_MODE_SCALE_OPA_32BIT = 1,
1104 IFM_SCALE_MODE_SCALE_OPB_32BIT = 2,
1105};
1106
Diqing Zhong04118062020-04-15 01:19:12 +02001107enum macs_per_cc
1108{
1109 MACS_PER_CC_MACS_PER_CC_IS_5 = 0x5,
1110 MACS_PER_CC_MACS_PER_CC_IS_6 = 0x6,
1111 MACS_PER_CC_MACS_PER_CC_IS_7 = 0x7,
1112 MACS_PER_CC_MACS_PER_CC_IS_8 = 0x8,
1113};
1114
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001115enum memory_type
1116{
1117 MEMORY_TYPE_AXI0_OUTSTANDING_COUNTER0 = 0,
1118 MEMORY_TYPE_AXI0_OUTSTANDING_COUNTER1 = 1,
1119 MEMORY_TYPE_AXI1_OUTSTANDING_COUNTER2 = 2,
1120 MEMORY_TYPE_AXI1_OUTSTANDING_COUNTER3 = 3,
1121};
1122
1123enum ofm_precision
1124{
1125 OFM_PRECISION_U8 = 0,
1126 OFM_PRECISION_S8 = 1,
1127 OFM_PRECISION_U16 = 2,
1128 OFM_PRECISION_S16 = 3,
1129 OFM_PRECISION_S32 = 5,
1130};
1131
1132enum pmu_event_type
1133{
Douglas Trohaf6a85da2020-05-11 11:45:28 +02001134 PMU_EVENT_TYPE_NO_EVENT = 0x00,
1135 PMU_EVENT_TYPE_CYCLE = 0x11,
1136 PMU_EVENT_TYPE_NPU_IDLE = 0x20,
1137 PMU_EVENT_TYPE_CC_STALLED_ON_BLOCKDEP = 0x21,
1138 PMU_EVENT_TYPE_CC_STALLED_ON_SHRAM_RECONFIG = 0x22,
Douglas Troha2407e962020-06-15 14:31:45 +02001139 PMU_EVENT_TYPE_NPU_ACTIVE = 0x23,
Douglas Trohaf6a85da2020-05-11 11:45:28 +02001140 PMU_EVENT_TYPE_MAC_ACTIVE = 0x30,
1141 PMU_EVENT_TYPE_MAC_ACTIVE_8BIT = 0x31,
1142 PMU_EVENT_TYPE_MAC_ACTIVE_16BIT = 0x32,
1143 PMU_EVENT_TYPE_MAC_DPU_ACTIVE = 0x33,
1144 PMU_EVENT_TYPE_MAC_STALLED_BY_WD_ACC = 0x34,
1145 PMU_EVENT_TYPE_MAC_STALLED_BY_WD = 0x35,
1146 PMU_EVENT_TYPE_MAC_STALLED_BY_ACC = 0x36,
1147 PMU_EVENT_TYPE_MAC_STALLED_BY_IB = 0x37,
1148 PMU_EVENT_TYPE_MAC_ACTIVE_32BIT = 0x38,
1149 PMU_EVENT_TYPE_MAC_STALLED_BY_INT_W = 0x39,
1150 PMU_EVENT_TYPE_MAC_STALLED_BY_INT_ACC = 0x3A,
1151 PMU_EVENT_TYPE_AO_ACTIVE = 0x40,
1152 PMU_EVENT_TYPE_AO_ACTIVE_8BIT = 0x41,
1153 PMU_EVENT_TYPE_AO_ACTIVE_16BIT = 0x42,
1154 PMU_EVENT_TYPE_AO_STALLED_BY_OFMP_OB = 0x43,
1155 PMU_EVENT_TYPE_AO_STALLED_BY_OFMP = 0x44,
1156 PMU_EVENT_TYPE_AO_STALLED_BY_OB = 0x45,
1157 PMU_EVENT_TYPE_AO_STALLED_BY_ACC_IB = 0x46,
1158 PMU_EVENT_TYPE_AO_STALLED_BY_ACC = 0x47,
1159 PMU_EVENT_TYPE_AO_STALLED_BY_IB = 0x48,
1160 PMU_EVENT_TYPE_WD_ACTIVE = 0x50,
1161 PMU_EVENT_TYPE_WD_STALLED = 0x51,
1162 PMU_EVENT_TYPE_WD_STALLED_BY_WS = 0x52,
1163 PMU_EVENT_TYPE_WD_STALLED_BY_WD_BUF = 0x53,
1164 PMU_EVENT_TYPE_WD_PARSE_ACTIVE = 0x54,
1165 PMU_EVENT_TYPE_WD_PARSE_STALLED = 0x55,
1166 PMU_EVENT_TYPE_WD_PARSE_STALLED_IN = 0x56,
1167 PMU_EVENT_TYPE_WD_PARSE_STALLED_OUT = 0x57,
1168 PMU_EVENT_TYPE_WD_TRANS_WS = 0x58,
1169 PMU_EVENT_TYPE_WD_TRANS_WB = 0x59,
1170 PMU_EVENT_TYPE_WD_TRANS_DW0 = 0x5a,
1171 PMU_EVENT_TYPE_WD_TRANS_DW1 = 0x5b,
1172 PMU_EVENT_TYPE_AXI0_RD_TRANS_ACCEPTED = 0x80,
1173 PMU_EVENT_TYPE_AXI0_RD_TRANS_COMPLETED = 0x81,
1174 PMU_EVENT_TYPE_AXI0_RD_DATA_BEAT_RECEIVED = 0x82,
1175 PMU_EVENT_TYPE_AXI0_RD_TRAN_REQ_STALLED = 0x83,
1176 PMU_EVENT_TYPE_AXI0_WR_TRANS_ACCEPTED = 0x84,
1177 PMU_EVENT_TYPE_AXI0_WR_TRANS_COMPLETED_M = 0x85,
1178 PMU_EVENT_TYPE_AXI0_WR_TRANS_COMPLETED_S = 0x86,
1179 PMU_EVENT_TYPE_AXI0_WR_DATA_BEAT_WRITTEN = 0x87,
1180 PMU_EVENT_TYPE_AXI0_WR_TRAN_REQ_STALLED = 0x88,
1181 PMU_EVENT_TYPE_AXI0_WR_DATA_BEAT_STALLED = 0x89,
1182 PMU_EVENT_TYPE_AXI0_ENABLED_CYCLES = 0x8c,
1183 PMU_EVENT_TYPE_AXI0_RD_STALL_LIMIT = 0x8e,
1184 PMU_EVENT_TYPE_AXI0_WR_STALL_LIMIT = 0x8f,
1185 PMU_EVENT_TYPE_AXI1_RD_TRANS_ACCEPTED = 0x180,
1186 PMU_EVENT_TYPE_AXI1_RD_TRANS_COMPLETED = 0x181,
1187 PMU_EVENT_TYPE_AXI1_RD_DATA_BEAT_RECEIVED = 0x182,
1188 PMU_EVENT_TYPE_AXI1_RD_TRAN_REQ_STALLED = 0x183,
1189 PMU_EVENT_TYPE_AXI1_WR_TRANS_ACCEPTED = 0x184,
1190 PMU_EVENT_TYPE_AXI1_WR_TRANS_COMPLETED_M = 0x185,
1191 PMU_EVENT_TYPE_AXI1_WR_TRANS_COMPLETED_S = 0x186,
1192 PMU_EVENT_TYPE_AXI1_WR_DATA_BEAT_WRITTEN = 0x187,
1193 PMU_EVENT_TYPE_AXI1_WR_TRAN_REQ_STALLED = 0x188,
1194 PMU_EVENT_TYPE_AXI1_WR_DATA_BEAT_STALLED = 0x189,
1195 PMU_EVENT_TYPE_AXI1_ENABLED_CYCLES = 0x18c,
1196 PMU_EVENT_TYPE_AXI1_RD_STALL_LIMIT = 0x18e,
1197 PMU_EVENT_TYPE_AXI1_WR_STALL_LIMIT = 0x18f,
1198 PMU_EVENT_TYPE_AXI_LATENCY_ANY = 0xa0,
1199 PMU_EVENT_TYPE_AXI_LATENCY_32 = 0xa1,
1200 PMU_EVENT_TYPE_AXI_LATENCY_64 = 0xa2,
1201 PMU_EVENT_TYPE_AXI_LATENCY_128 = 0xa3,
1202 PMU_EVENT_TYPE_AXI_LATENCY_256 = 0xa4,
1203 PMU_EVENT_TYPE_AXI_LATENCY_512 = 0xa5,
1204 PMU_EVENT_TYPE_AXI_LATENCY_1024 = 0xa6,
Stefan Nannessone2e70242020-08-19 16:01:29 +02001205 PMU_EVENT_TYPE_ECC_DMA = 0xb0,
1206 PMU_EVENT_TYPE_ECC_SB0 = 0xb1,
1207 PMU_EVENT_TYPE_ECC_SB1 = 0x1b1,
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001208};
1209
1210enum pooling_mode
1211{
1212 POOLING_MODE_MAX = 0,
1213 POOLING_MODE_AVERAGE = 1,
1214 POOLING_MODE_REDUCE_SUM = 2,
1215};
1216
1217enum privilege_level
1218{
1219 PRIVILEGE_LEVEL_USER = 0,
1220 PRIVILEGE_LEVEL_PRIVILEGED = 1,
1221};
1222
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001223enum resampling_mode
1224{
1225 RESAMPLING_MODE_NONE = 0,
1226 RESAMPLING_MODE_NEAREST = 1,
1227 RESAMPLING_MODE_TRANSPOSE = 2,
1228};
1229
1230enum rounding
1231{
1232 ROUNDING_TFL = 0,
1233 ROUNDING_TRUNCATE = 1,
1234 ROUNDING_NATURAL = 2,
1235};
1236
1237enum security_level
1238{
1239 SECURITY_LEVEL_SECURE = 0,
1240 SECURITY_LEVEL_NON_SECURE = 1,
1241};
1242
Diqing Zhong04118062020-04-15 01:19:12 +02001243enum shram_size
1244{
Stefan Nannessone2e70242020-08-19 16:01:29 +02001245 SHRAM_SIZE_SHRAM_96KB = 0x60,
Diqing Zhong04118062020-04-15 01:19:12 +02001246 SHRAM_SIZE_SHRAM_48KB = 0x30,
1247 SHRAM_SIZE_SHRAM_24KB = 0x18,
1248 SHRAM_SIZE_SHRAM_16KB = 0x10,
1249};
1250
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001251enum state
1252{
1253 STATE_STOPPED = 0,
1254 STATE_RUNNING = 1,
1255};
1256
1257enum stride_mode
1258{
1259 STRIDE_MODE_STRIDE_MODE_1D = 0,
1260 STRIDE_MODE_STRIDE_MODE_2D = 1,
1261 STRIDE_MODE_STRIDE_MODE_3D = 2,
1262};
1263
1264#endif
1265
Douglas Troha2e7e3b72020-05-14 20:28:31 +02001266// id_r - ID register
1267struct id_r
1268{
1269#ifdef __cplusplus
1270 private:
1271#endif //__cplusplus
1272 union
1273 {
1274 struct
1275 {
1276 uint32_t version_status : 4; // This is the version of the product
1277 uint32_t version_minor : 4; // This is the n for the P part of an RnPn release number
1278 uint32_t version_major : 4; // This is the n for the R part of an RnPn release number
1279 uint32_t product_major : 4; // This is the X part of the ML00X product number
1280 uint32_t arch_patch_rev : 4; // This is the patch number of the architecture version a.b
1281 uint32_t
1282 arch_minor_rev : 8; // This is the minor architecture version number, b in the architecture version a.b
1283 uint32_t
1284 arch_major_rev : 4; // This is the major architecture version number, a in the architecture version a.b
1285 };
1286 uint32_t word;
1287 };
1288#ifdef __cplusplus
1289 public:
1290 CONSTEXPR id_r() :
1291 version_status(static_cast<uint32_t>(1)), version_minor(static_cast<uint32_t>(0x0)),
Stefan Nannessone2e70242020-08-19 16:01:29 +02001292 version_major(static_cast<uint32_t>(0x1)), product_major(static_cast<uint32_t>(4)),
1293 arch_patch_rev(static_cast<uint32_t>(6)), arch_minor_rev(static_cast<uint32_t>(0)),
Douglas Troha2e7e3b72020-05-14 20:28:31 +02001294 arch_major_rev(static_cast<uint32_t>(1))
1295 {
1296 }
1297 CONSTEXPR id_r(uint32_t init) : word(init) {}
1298 CONSTEXPR void operator=(uint32_t value)
1299 {
1300 word = value;
1301 }
1302 void operator=(uint32_t value) volatile
1303 {
1304 word = value;
1305 }
1306 CONSTEXPR operator uint32_t()
1307 {
1308 return word;
1309 }
1310 operator uint32_t() volatile
1311 {
1312 return word;
1313 }
1314 id_r copy() volatile
1315 {
1316 return *this;
1317 }
1318 CONSTEXPR uint32_t get_version_status() const
1319 {
1320 uint32_t value = static_cast<uint32_t>(version_status);
1321 return value;
1322 }
1323 uint32_t get_version_status() const volatile
1324 {
1325 uint32_t value = static_cast<uint32_t>(version_status);
1326 return value;
1327 }
1328 CONSTEXPR id_r &set_version_status(uint32_t value)
1329 {
1330 version_status = ((1u << 4) - 1) & static_cast<uint32_t>(value);
1331 return *this;
1332 }
1333 CONSTEXPR uint32_t get_version_minor() const
1334 {
1335 uint32_t value = static_cast<uint32_t>(version_minor);
1336 return value;
1337 }
1338 uint32_t get_version_minor() const volatile
1339 {
1340 uint32_t value = static_cast<uint32_t>(version_minor);
1341 return value;
1342 }
1343 CONSTEXPR id_r &set_version_minor(uint32_t value)
1344 {
1345 version_minor = ((1u << 4) - 1) & static_cast<uint32_t>(value);
1346 return *this;
1347 }
1348 CONSTEXPR uint32_t get_version_major() const
1349 {
1350 uint32_t value = static_cast<uint32_t>(version_major);
1351 return value;
1352 }
1353 uint32_t get_version_major() const volatile
1354 {
1355 uint32_t value = static_cast<uint32_t>(version_major);
1356 return value;
1357 }
1358 CONSTEXPR id_r &set_version_major(uint32_t value)
1359 {
1360 version_major = ((1u << 4) - 1) & static_cast<uint32_t>(value);
1361 return *this;
1362 }
1363 CONSTEXPR uint32_t get_product_major() const
1364 {
1365 uint32_t value = static_cast<uint32_t>(product_major);
1366 return value;
1367 }
1368 uint32_t get_product_major() const volatile
1369 {
1370 uint32_t value = static_cast<uint32_t>(product_major);
1371 return value;
1372 }
1373 CONSTEXPR id_r &set_product_major(uint32_t value)
1374 {
1375 product_major = ((1u << 4) - 1) & static_cast<uint32_t>(value);
1376 return *this;
1377 }
1378 CONSTEXPR uint32_t get_arch_patch_rev() const
1379 {
1380 uint32_t value = static_cast<uint32_t>(arch_patch_rev);
1381 return value;
1382 }
1383 uint32_t get_arch_patch_rev() const volatile
1384 {
1385 uint32_t value = static_cast<uint32_t>(arch_patch_rev);
1386 return value;
1387 }
1388 CONSTEXPR id_r &set_arch_patch_rev(uint32_t value)
1389 {
1390 arch_patch_rev = ((1u << 4) - 1) & static_cast<uint32_t>(value);
1391 return *this;
1392 }
1393 CONSTEXPR uint32_t get_arch_minor_rev() const
1394 {
1395 uint32_t value = static_cast<uint32_t>(arch_minor_rev);
1396 return value;
1397 }
1398 uint32_t get_arch_minor_rev() const volatile
1399 {
1400 uint32_t value = static_cast<uint32_t>(arch_minor_rev);
1401 return value;
1402 }
1403 CONSTEXPR id_r &set_arch_minor_rev(uint32_t value)
1404 {
1405 arch_minor_rev = ((1u << 8) - 1) & static_cast<uint32_t>(value);
1406 return *this;
1407 }
1408 CONSTEXPR uint32_t get_arch_major_rev() const
1409 {
1410 uint32_t value = static_cast<uint32_t>(arch_major_rev);
1411 return value;
1412 }
1413 uint32_t get_arch_major_rev() const volatile
1414 {
1415 uint32_t value = static_cast<uint32_t>(arch_major_rev);
1416 return value;
1417 }
1418 CONSTEXPR id_r &set_arch_major_rev(uint32_t value)
1419 {
1420 arch_major_rev = ((1u << 4) - 1) & static_cast<uint32_t>(value);
1421 return *this;
1422 }
1423#endif //__cplusplus
1424};
1425
1426// status_r - Register describes the current operating status of the NPU
1427struct status_r
1428{
1429#ifdef __cplusplus
1430 private:
1431#endif //__cplusplus
1432 union
1433 {
1434 struct
1435 {
1436 uint32_t state : 1; // NPU state, 0 = Stopped, 1 = Running
1437 uint32_t irq_raised : 1; // Raw IRQ status, 0 = IRQ not raised, 1 = IRQ raised. IRQ is cleared using command
1438 // register bit 1
1439 uint32_t
1440 bus_status : 1; // 0=OK, 1=Bus abort detected and processing halted (NPU will reach IDLE state and not
1441 // to start process any more commands/AXI transactions). Can only be cleared by a reset
1442 uint32_t reset_status : 1; // Reset is ongoing and only this register can be read (other registers read as 0
1443 // and writes are ignored.) A value of 0 means NPU is not being reset and can be
1444 // accessed as normal
1445 uint32_t
1446 cmd_parse_error : 1; // 0=No error 1=Command stream parsing error detected. Can only be cleared by reset
1447 uint32_t cmd_end_reached : 1; // 0=Not reached, 1=Reached. Cleared by writing QBASE or QSIZE when NPU is in
1448 // stopped state
1449 uint32_t pmu_irq_raised : 1; // 0=No PMU IRQ, 1=PMU IRQ raised. Cleared by using command register bit 1
1450 uint32_t wd_fault : 1; // Weight decoder state: 0=no fault 1=weight decoder decompression fault. Can only be
1451 // cleared by reset
Stefan Nannessone2e70242020-08-19 16:01:29 +02001452 uint32_t ecc_fault : 1; // ECC state for internal RAMs: 0=no fault 1=ECC fault signalled. Can only be
1453 // cleared by reset
1454 uint32_t reserved0 : 2;
Douglas Troha2e7e3b72020-05-14 20:28:31 +02001455 uint32_t faulting_interface : 1; // Faulting interface on bus abort. 0=AXI-M0 1=AXI-M1
1456 uint32_t faulting_channel : 4; // Faulting channel on a bus abort. Read: 0=Cmd 1=IFM 2=Weights 3=Scale+Bias
1457 // 4=Mem2Mem; Write: 8=OFM 9=Mem2Mem
1458 uint32_t irq_history_mask : 16; // IRQ History mask
1459 };
1460 uint32_t word;
1461 };
1462#ifdef __cplusplus
1463 public:
1464 CONSTEXPR status_r() :
1465 state(static_cast<uint32_t>(::state::STOPPED)), irq_raised(static_cast<uint32_t>(0x0)),
1466 bus_status(static_cast<uint32_t>(0x0)), reset_status(static_cast<uint32_t>(0x1)),
1467 cmd_parse_error(static_cast<uint32_t>(0x0)), cmd_end_reached(static_cast<uint32_t>(0x0)),
1468 pmu_irq_raised(static_cast<uint32_t>(0x0)), wd_fault(static_cast<uint32_t>(0x0)),
Stefan Nannessone2e70242020-08-19 16:01:29 +02001469 ecc_fault(static_cast<uint32_t>(0x0)), reserved0(static_cast<uint32_t>(0)),
1470 faulting_interface(static_cast<uint32_t>(0x0)), faulting_channel(static_cast<uint32_t>(0x0)),
1471 irq_history_mask(static_cast<uint32_t>(0x0))
Douglas Troha2e7e3b72020-05-14 20:28:31 +02001472 {
1473 }
1474 CONSTEXPR status_r(uint32_t init) : word(init) {}
1475 CONSTEXPR void operator=(uint32_t value)
1476 {
1477 word = value;
1478 }
1479 void operator=(uint32_t value) volatile
1480 {
1481 word = value;
1482 }
1483 CONSTEXPR operator uint32_t()
1484 {
1485 return word;
1486 }
1487 operator uint32_t() volatile
1488 {
1489 return word;
1490 }
1491 status_r copy() volatile
1492 {
1493 return *this;
1494 }
1495 CONSTEXPR ::state get_state() const
1496 {
1497 ::state value = static_cast<::state>(state);
1498 return value;
1499 }
1500 ::state get_state() const volatile
1501 {
1502 ::state value = static_cast<::state>(state);
1503 return value;
1504 }
1505 CONSTEXPR status_r &set_state(::state value)
1506 {
1507 state = ((1u << 1) - 1) & static_cast<uint32_t>(value);
1508 return *this;
1509 }
1510 CONSTEXPR uint32_t get_irq_raised() const
1511 {
1512 uint32_t value = static_cast<uint32_t>(irq_raised);
1513 return value;
1514 }
1515 uint32_t get_irq_raised() const volatile
1516 {
1517 uint32_t value = static_cast<uint32_t>(irq_raised);
1518 return value;
1519 }
1520 CONSTEXPR status_r &set_irq_raised(uint32_t value)
1521 {
1522 irq_raised = ((1u << 1) - 1) & static_cast<uint32_t>(value);
1523 return *this;
1524 }
1525 CONSTEXPR uint32_t get_bus_status() const
1526 {
1527 uint32_t value = static_cast<uint32_t>(bus_status);
1528 return value;
1529 }
1530 uint32_t get_bus_status() const volatile
1531 {
1532 uint32_t value = static_cast<uint32_t>(bus_status);
1533 return value;
1534 }
1535 CONSTEXPR status_r &set_bus_status(uint32_t value)
1536 {
1537 bus_status = ((1u << 1) - 1) & static_cast<uint32_t>(value);
1538 return *this;
1539 }
1540 CONSTEXPR uint32_t get_reset_status() const
1541 {
1542 uint32_t value = static_cast<uint32_t>(reset_status);
1543 return value;
1544 }
1545 uint32_t get_reset_status() const volatile
1546 {
1547 uint32_t value = static_cast<uint32_t>(reset_status);
1548 return value;
1549 }
1550 CONSTEXPR status_r &set_reset_status(uint32_t value)
1551 {
1552 reset_status = ((1u << 1) - 1) & static_cast<uint32_t>(value);
1553 return *this;
1554 }
1555 CONSTEXPR uint32_t get_cmd_parse_error() const
1556 {
1557 uint32_t value = static_cast<uint32_t>(cmd_parse_error);
1558 return value;
1559 }
1560 uint32_t get_cmd_parse_error() const volatile
1561 {
1562 uint32_t value = static_cast<uint32_t>(cmd_parse_error);
1563 return value;
1564 }
1565 CONSTEXPR status_r &set_cmd_parse_error(uint32_t value)
1566 {
1567 cmd_parse_error = ((1u << 1) - 1) & static_cast<uint32_t>(value);
1568 return *this;
1569 }
1570 CONSTEXPR uint32_t get_cmd_end_reached() const
1571 {
1572 uint32_t value = static_cast<uint32_t>(cmd_end_reached);
1573 return value;
1574 }
1575 uint32_t get_cmd_end_reached() const volatile
1576 {
1577 uint32_t value = static_cast<uint32_t>(cmd_end_reached);
1578 return value;
1579 }
1580 CONSTEXPR status_r &set_cmd_end_reached(uint32_t value)
1581 {
1582 cmd_end_reached = ((1u << 1) - 1) & static_cast<uint32_t>(value);
1583 return *this;
1584 }
1585 CONSTEXPR uint32_t get_pmu_irq_raised() const
1586 {
1587 uint32_t value = static_cast<uint32_t>(pmu_irq_raised);
1588 return value;
1589 }
1590 uint32_t get_pmu_irq_raised() const volatile
1591 {
1592 uint32_t value = static_cast<uint32_t>(pmu_irq_raised);
1593 return value;
1594 }
1595 CONSTEXPR status_r &set_pmu_irq_raised(uint32_t value)
1596 {
1597 pmu_irq_raised = ((1u << 1) - 1) & static_cast<uint32_t>(value);
1598 return *this;
1599 }
1600 CONSTEXPR uint32_t get_wd_fault() const
1601 {
1602 uint32_t value = static_cast<uint32_t>(wd_fault);
1603 return value;
1604 }
1605 uint32_t get_wd_fault() const volatile
1606 {
1607 uint32_t value = static_cast<uint32_t>(wd_fault);
1608 return value;
1609 }
1610 CONSTEXPR status_r &set_wd_fault(uint32_t value)
1611 {
1612 wd_fault = ((1u << 1) - 1) & static_cast<uint32_t>(value);
1613 return *this;
1614 }
Stefan Nannessone2e70242020-08-19 16:01:29 +02001615 CONSTEXPR uint32_t get_ecc_fault() const
1616 {
1617 uint32_t value = static_cast<uint32_t>(ecc_fault);
1618 return value;
1619 }
1620 uint32_t get_ecc_fault() const volatile
1621 {
1622 uint32_t value = static_cast<uint32_t>(ecc_fault);
1623 return value;
1624 }
1625 CONSTEXPR status_r &set_ecc_fault(uint32_t value)
1626 {
1627 ecc_fault = ((1u << 1) - 1) & static_cast<uint32_t>(value);
1628 return *this;
1629 }
Douglas Troha2e7e3b72020-05-14 20:28:31 +02001630 CONSTEXPR uint32_t get_faulting_interface() const
1631 {
1632 uint32_t value = static_cast<uint32_t>(faulting_interface);
1633 return value;
1634 }
1635 uint32_t get_faulting_interface() const volatile
1636 {
1637 uint32_t value = static_cast<uint32_t>(faulting_interface);
1638 return value;
1639 }
1640 CONSTEXPR status_r &set_faulting_interface(uint32_t value)
1641 {
1642 faulting_interface = ((1u << 1) - 1) & static_cast<uint32_t>(value);
1643 return *this;
1644 }
1645 CONSTEXPR uint32_t get_faulting_channel() const
1646 {
1647 uint32_t value = static_cast<uint32_t>(faulting_channel);
1648 return value;
1649 }
1650 uint32_t get_faulting_channel() const volatile
1651 {
1652 uint32_t value = static_cast<uint32_t>(faulting_channel);
1653 return value;
1654 }
1655 CONSTEXPR status_r &set_faulting_channel(uint32_t value)
1656 {
1657 faulting_channel = ((1u << 4) - 1) & static_cast<uint32_t>(value);
1658 return *this;
1659 }
1660 CONSTEXPR uint32_t get_irq_history_mask() const
1661 {
1662 uint32_t value = static_cast<uint32_t>(irq_history_mask);
1663 return value;
1664 }
1665 uint32_t get_irq_history_mask() const volatile
1666 {
1667 uint32_t value = static_cast<uint32_t>(irq_history_mask);
1668 return value;
1669 }
1670 CONSTEXPR status_r &set_irq_history_mask(uint32_t value)
1671 {
1672 irq_history_mask = ((1u << 16) - 1) & static_cast<uint32_t>(value);
1673 return *this;
1674 }
1675#endif //__cplusplus
1676};
1677
1678// cmd_r - Command register, reads as last written command
1679struct cmd_r
1680{
1681#ifdef __cplusplus
1682 private:
1683#endif //__cplusplus
1684 union
1685 {
1686 struct
1687 {
1688 uint32_t transition_to_running_state : 1; // Write 1 to transition the NPU to running state. Writing 0 has
1689 // no effect
1690 uint32_t clear_irq : 1; // Write 1 to clear the IRQ status in the STATUS register. Writing 0 has no effect
1691 uint32_t clock_q_enable : 1; // Write 1 to this bit to enable clock off using clock q-interface and enable
1692 // the master clock gate
1693 uint32_t power_q_enable : 1; // Write 1 to this bit to enable power off using power q-interface
1694 uint32_t
1695 stop_request : 1; // Write 1 to this bit to request STOP after completing any already-started commands
1696 uint32_t reserved0 : 11;
1697 uint32_t clear_irq_history : 16; // Clears the IRQ history mask
1698 };
1699 uint32_t word;
1700 };
1701#ifdef __cplusplus
1702 public:
1703 CONSTEXPR cmd_r() :
1704 transition_to_running_state(static_cast<uint32_t>(0x0)), clear_irq(static_cast<uint32_t>(0x0)),
Rakesh Gangarajaiaha20e5a72020-06-25 15:45:27 +02001705 clock_q_enable(static_cast<uint32_t>(0x1)), power_q_enable(static_cast<uint32_t>(0x1)),
Douglas Troha2e7e3b72020-05-14 20:28:31 +02001706 stop_request(static_cast<uint32_t>(0x0)), reserved0(static_cast<uint32_t>(0)),
1707 clear_irq_history(static_cast<uint32_t>(0x0))
1708 {
1709 }
1710 CONSTEXPR cmd_r(uint32_t init) : word(init) {}
1711 CONSTEXPR void operator=(uint32_t value)
1712 {
1713 word = value;
1714 }
1715 void operator=(uint32_t value) volatile
1716 {
1717 word = value;
1718 }
1719 CONSTEXPR operator uint32_t()
1720 {
1721 return word;
1722 }
1723 operator uint32_t() volatile
1724 {
1725 return word;
1726 }
1727 cmd_r copy() volatile
1728 {
1729 return *this;
1730 }
1731 CONSTEXPR uint32_t get_transition_to_running_state() const
1732 {
1733 uint32_t value = static_cast<uint32_t>(transition_to_running_state);
1734 return value;
1735 }
1736 uint32_t get_transition_to_running_state() const volatile
1737 {
1738 uint32_t value = static_cast<uint32_t>(transition_to_running_state);
1739 return value;
1740 }
1741 CONSTEXPR cmd_r &set_transition_to_running_state(uint32_t value)
1742 {
1743 transition_to_running_state = ((1u << 1) - 1) & static_cast<uint32_t>(value);
1744 return *this;
1745 }
1746 CONSTEXPR uint32_t get_clear_irq() const
1747 {
1748 uint32_t value = static_cast<uint32_t>(clear_irq);
1749 return value;
1750 }
1751 uint32_t get_clear_irq() const volatile
1752 {
1753 uint32_t value = static_cast<uint32_t>(clear_irq);
1754 return value;
1755 }
1756 CONSTEXPR cmd_r &set_clear_irq(uint32_t value)
1757 {
1758 clear_irq = ((1u << 1) - 1) & static_cast<uint32_t>(value);
1759 return *this;
1760 }
1761 CONSTEXPR uint32_t get_clock_q_enable() const
1762 {
1763 uint32_t value = static_cast<uint32_t>(clock_q_enable);
1764 return value;
1765 }
1766 uint32_t get_clock_q_enable() const volatile
1767 {
1768 uint32_t value = static_cast<uint32_t>(clock_q_enable);
1769 return value;
1770 }
1771 CONSTEXPR cmd_r &set_clock_q_enable(uint32_t value)
1772 {
1773 clock_q_enable = ((1u << 1) - 1) & static_cast<uint32_t>(value);
1774 return *this;
1775 }
1776 CONSTEXPR uint32_t get_power_q_enable() const
1777 {
1778 uint32_t value = static_cast<uint32_t>(power_q_enable);
1779 return value;
1780 }
1781 uint32_t get_power_q_enable() const volatile
1782 {
1783 uint32_t value = static_cast<uint32_t>(power_q_enable);
1784 return value;
1785 }
1786 CONSTEXPR cmd_r &set_power_q_enable(uint32_t value)
1787 {
1788 power_q_enable = ((1u << 1) - 1) & static_cast<uint32_t>(value);
1789 return *this;
1790 }
1791 CONSTEXPR uint32_t get_stop_request() const
1792 {
1793 uint32_t value = static_cast<uint32_t>(stop_request);
1794 return value;
1795 }
1796 uint32_t get_stop_request() const volatile
1797 {
1798 uint32_t value = static_cast<uint32_t>(stop_request);
1799 return value;
1800 }
1801 CONSTEXPR cmd_r &set_stop_request(uint32_t value)
1802 {
1803 stop_request = ((1u << 1) - 1) & static_cast<uint32_t>(value);
1804 return *this;
1805 }
1806 CONSTEXPR uint32_t get_clear_irq_history() const
1807 {
1808 uint32_t value = static_cast<uint32_t>(clear_irq_history);
1809 return value;
1810 }
1811 uint32_t get_clear_irq_history() const volatile
1812 {
1813 uint32_t value = static_cast<uint32_t>(clear_irq_history);
1814 return value;
1815 }
1816 CONSTEXPR cmd_r &set_clear_irq_history(uint32_t value)
1817 {
1818 clear_irq_history = ((1u << 16) - 1) & static_cast<uint32_t>(value);
1819 return *this;
1820 }
1821#endif //__cplusplus
1822};
1823
1824// reset_r - Request Reset and new security mode
1825struct reset_r
1826{
1827#ifdef __cplusplus
1828 private:
1829#endif //__cplusplus
1830 union
1831 {
1832 struct
1833 {
1834 uint32_t pending_CPL : 1; // Current privilege level 0=User 1=Privileged
1835 uint32_t pending_CSL : 1; // Current security level 0=Secure 1=Non secure
1836 uint32_t reserved0 : 30;
1837 };
1838 uint32_t word;
1839 };
1840#ifdef __cplusplus
1841 public:
1842 CONSTEXPR reset_r() :
1843 pending_CPL(static_cast<uint32_t>(::privilege_level::USER)),
1844 pending_CSL(static_cast<uint32_t>(::security_level::SECURE)), reserved0(static_cast<uint32_t>(0))
1845 {
1846 }
1847 CONSTEXPR reset_r(uint32_t init) : word(init) {}
1848 CONSTEXPR void operator=(uint32_t value)
1849 {
1850 word = value;
1851 }
1852 void operator=(uint32_t value) volatile
1853 {
1854 word = value;
1855 }
1856 CONSTEXPR operator uint32_t()
1857 {
1858 return word;
1859 }
1860 operator uint32_t() volatile
1861 {
1862 return word;
1863 }
1864 reset_r copy() volatile
1865 {
1866 return *this;
1867 }
1868 CONSTEXPR ::privilege_level get_pending_CPL() const
1869 {
1870 ::privilege_level value = static_cast<::privilege_level>(pending_CPL);
1871 return value;
1872 }
1873 ::privilege_level get_pending_CPL() const volatile
1874 {
1875 ::privilege_level value = static_cast<::privilege_level>(pending_CPL);
1876 return value;
1877 }
1878 CONSTEXPR reset_r &set_pending_CPL(::privilege_level value)
1879 {
1880 pending_CPL = ((1u << 1) - 1) & static_cast<uint32_t>(value);
1881 return *this;
1882 }
1883 CONSTEXPR ::security_level get_pending_CSL() const
1884 {
1885 ::security_level value = static_cast<::security_level>(pending_CSL);
1886 return value;
1887 }
1888 ::security_level get_pending_CSL() const volatile
1889 {
1890 ::security_level value = static_cast<::security_level>(pending_CSL);
1891 return value;
1892 }
1893 CONSTEXPR reset_r &set_pending_CSL(::security_level value)
1894 {
1895 pending_CSL = ((1u << 1) - 1) & static_cast<uint32_t>(value);
1896 return *this;
1897 }
1898#endif //__cplusplus
1899};
1900
1901// qbase0_r - Base address of command queue bits [31:0]. The address is 4 byte aligned
1902struct qbase0_r
1903{
1904#ifdef __cplusplus
1905 private:
1906#endif //__cplusplus
1907 union
1908 {
1909 uint32_t QBASE0; // The 4 byte aligned lower bytes of the base address value for the command stream
1910 uint32_t word;
1911 };
1912#ifdef __cplusplus
1913 public:
1914 CONSTEXPR qbase0_r() : QBASE0(static_cast<uint32_t>(0x00000000)) {}
1915 CONSTEXPR qbase0_r(uint32_t init) : word(init) {}
1916 CONSTEXPR void operator=(uint32_t value)
1917 {
1918 word = value;
1919 }
1920 void operator=(uint32_t value) volatile
1921 {
1922 word = value;
1923 }
1924 CONSTEXPR operator uint32_t()
1925 {
1926 return word;
1927 }
1928 operator uint32_t() volatile
1929 {
1930 return word;
1931 }
1932 qbase0_r copy() volatile
1933 {
1934 return *this;
1935 }
1936 CONSTEXPR uint32_t get_QBASE0() const
1937 {
1938 uint32_t value = static_cast<uint32_t>(QBASE0);
1939 return value;
1940 }
1941 uint32_t get_QBASE0() const volatile
1942 {
1943 uint32_t value = static_cast<uint32_t>(QBASE0);
1944 return value;
1945 }
1946 CONSTEXPR qbase0_r &set_QBASE0(uint32_t value)
1947 {
1948 QBASE0 = static_cast<uint32_t>(value);
1949 return *this;
1950 }
1951#endif //__cplusplus
1952};
1953
1954// qbase1_r - Address extension bits [47:32] bits for queue base
1955struct qbase1_r
1956{
1957#ifdef __cplusplus
1958 private:
1959#endif //__cplusplus
1960 union
1961 {
1962 uint32_t QBASE1; // The 4 byte aligned upper bytes of the base address value for the command stream
1963 uint32_t word;
1964 };
1965#ifdef __cplusplus
1966 public:
1967 CONSTEXPR qbase1_r() : QBASE1(static_cast<uint32_t>(0x00000000)) {}
1968 CONSTEXPR qbase1_r(uint32_t init) : word(init) {}
1969 CONSTEXPR void operator=(uint32_t value)
1970 {
1971 word = value;
1972 }
1973 void operator=(uint32_t value) volatile
1974 {
1975 word = value;
1976 }
1977 CONSTEXPR operator uint32_t()
1978 {
1979 return word;
1980 }
1981 operator uint32_t() volatile
1982 {
1983 return word;
1984 }
1985 qbase1_r copy() volatile
1986 {
1987 return *this;
1988 }
1989 CONSTEXPR uint32_t get_QBASE1() const
1990 {
1991 uint32_t value = static_cast<uint32_t>(QBASE1);
1992 return value;
1993 }
1994 uint32_t get_QBASE1() const volatile
1995 {
1996 uint32_t value = static_cast<uint32_t>(QBASE1);
1997 return value;
1998 }
1999 CONSTEXPR qbase1_r &set_QBASE1(uint32_t value)
2000 {
2001 QBASE1 = static_cast<uint32_t>(value);
2002 return *this;
2003 }
2004#endif //__cplusplus
2005};
2006
2007// qread_r - Read offset in the command stream in bytes. Multiple of 4 in the range 0 to 16 MB
2008struct qread_r
2009{
2010#ifdef __cplusplus
2011 private:
2012#endif //__cplusplus
2013 union
2014 {
2015 uint32_t QREAD; // The read offset of the current command under execution
2016 uint32_t word;
2017 };
2018#ifdef __cplusplus
2019 public:
2020 CONSTEXPR qread_r() : QREAD(static_cast<uint32_t>(0x00000000)) {}
2021 CONSTEXPR qread_r(uint32_t init) : word(init) {}
2022 CONSTEXPR void operator=(uint32_t value)
2023 {
2024 word = value;
2025 }
2026 void operator=(uint32_t value) volatile
2027 {
2028 word = value;
2029 }
2030 CONSTEXPR operator uint32_t()
2031 {
2032 return word;
2033 }
2034 operator uint32_t() volatile
2035 {
2036 return word;
2037 }
2038 qread_r copy() volatile
2039 {
2040 return *this;
2041 }
2042 CONSTEXPR uint32_t get_QREAD() const
2043 {
2044 uint32_t value = static_cast<uint32_t>(QREAD);
2045 return value;
2046 }
2047 uint32_t get_QREAD() const volatile
2048 {
2049 uint32_t value = static_cast<uint32_t>(QREAD);
2050 return value;
2051 }
2052 CONSTEXPR qread_r &set_QREAD(uint32_t value)
2053 {
2054 QREAD = static_cast<uint32_t>(value);
2055 return *this;
2056 }
2057#endif //__cplusplus
2058};
2059
2060// qconfig_r - AXI configuration for the command stream in the range 0-3. Same encoding as for REGIONCFG
2061struct qconfig_r
2062{
2063#ifdef __cplusplus
2064 private:
2065#endif //__cplusplus
2066 union
2067 {
2068 uint32_t QCONFIG; // AXI configuration for the command stream in the range 0-3
2069 uint32_t word;
2070 };
2071#ifdef __cplusplus
2072 public:
2073 CONSTEXPR qconfig_r() : QCONFIG(static_cast<uint32_t>(0x00000000)) {}
2074 CONSTEXPR qconfig_r(uint32_t init) : word(init) {}
2075 CONSTEXPR void operator=(uint32_t value)
2076 {
2077 word = value;
2078 }
2079 void operator=(uint32_t value) volatile
2080 {
2081 word = value;
2082 }
2083 CONSTEXPR operator uint32_t()
2084 {
2085 return word;
2086 }
2087 operator uint32_t() volatile
2088 {
2089 return word;
2090 }
2091 qconfig_r copy() volatile
2092 {
2093 return *this;
2094 }
2095 CONSTEXPR uint32_t get_QCONFIG() const
2096 {
2097 uint32_t value = static_cast<uint32_t>(QCONFIG);
2098 return value;
2099 }
2100 uint32_t get_QCONFIG() const volatile
2101 {
2102 uint32_t value = static_cast<uint32_t>(QCONFIG);
2103 return value;
2104 }
2105 CONSTEXPR qconfig_r &set_QCONFIG(uint32_t value)
2106 {
2107 QCONFIG = static_cast<uint32_t>(value);
2108 return *this;
2109 }
2110#endif //__cplusplus
2111};
2112
2113// qsize_r - Size of the command stream in bytes. Multiple of 4 in the range 0 to 16 MB
2114struct qsize_r
2115{
2116#ifdef __cplusplus
2117 private:
2118#endif //__cplusplus
2119 union
2120 {
2121 uint32_t QSIZE; // Size of the next command stream to be executed by the NPU
2122 uint32_t word;
2123 };
2124#ifdef __cplusplus
2125 public:
2126 CONSTEXPR qsize_r() : QSIZE(static_cast<uint32_t>(0x00000000)) {}
2127 CONSTEXPR qsize_r(uint32_t init) : word(init) {}
2128 CONSTEXPR void operator=(uint32_t value)
2129 {
2130 word = value;
2131 }
2132 void operator=(uint32_t value) volatile
2133 {
2134 word = value;
2135 }
2136 CONSTEXPR operator uint32_t()
2137 {
2138 return word;
2139 }
2140 operator uint32_t() volatile
2141 {
2142 return word;
2143 }
2144 qsize_r copy() volatile
2145 {
2146 return *this;
2147 }
2148 CONSTEXPR uint32_t get_QSIZE() const
2149 {
2150 uint32_t value = static_cast<uint32_t>(QSIZE);
2151 return value;
2152 }
2153 uint32_t get_QSIZE() const volatile
2154 {
2155 uint32_t value = static_cast<uint32_t>(QSIZE);
2156 return value;
2157 }
2158 CONSTEXPR qsize_r &set_QSIZE(uint32_t value)
2159 {
2160 QSIZE = static_cast<uint32_t>(value);
2161 return *this;
2162 }
2163#endif //__cplusplus
2164};
2165
2166// prot_r - Protection level configured for the NPU when acting as an AXI master
2167struct prot_r
2168{
2169#ifdef __cplusplus
2170 private:
2171#endif //__cplusplus
2172 union
2173 {
2174 struct
2175 {
2176 uint32_t active_CPL : 1; // Current privilege level 0=User 1=Privileged
2177 uint32_t active_CSL : 1; // Current security level 0=Secure 1=Non secure
2178 uint32_t reserved0 : 30;
2179 };
2180 uint32_t word;
2181 };
2182#ifdef __cplusplus
2183 public:
2184 CONSTEXPR prot_r() :
2185 active_CPL(static_cast<uint32_t>(::privilege_level::USER)),
2186 active_CSL(static_cast<uint32_t>(::security_level::SECURE)), reserved0(static_cast<uint32_t>(0))
2187 {
2188 }
2189 CONSTEXPR prot_r(uint32_t init) : word(init) {}
2190 CONSTEXPR void operator=(uint32_t value)
2191 {
2192 word = value;
2193 }
2194 void operator=(uint32_t value) volatile
2195 {
2196 word = value;
2197 }
2198 CONSTEXPR operator uint32_t()
2199 {
2200 return word;
2201 }
2202 operator uint32_t() volatile
2203 {
2204 return word;
2205 }
2206 prot_r copy() volatile
2207 {
2208 return *this;
2209 }
2210 CONSTEXPR ::privilege_level get_active_CPL() const
2211 {
2212 ::privilege_level value = static_cast<::privilege_level>(active_CPL);
2213 return value;
2214 }
2215 ::privilege_level get_active_CPL() const volatile
2216 {
2217 ::privilege_level value = static_cast<::privilege_level>(active_CPL);
2218 return value;
2219 }
2220 CONSTEXPR prot_r &set_active_CPL(::privilege_level value)
2221 {
2222 active_CPL = ((1u << 1) - 1) & static_cast<uint32_t>(value);
2223 return *this;
2224 }
2225 CONSTEXPR ::security_level get_active_CSL() const
2226 {
2227 ::security_level value = static_cast<::security_level>(active_CSL);
2228 return value;
2229 }
2230 ::security_level get_active_CSL() const volatile
2231 {
2232 ::security_level value = static_cast<::security_level>(active_CSL);
2233 return value;
2234 }
2235 CONSTEXPR prot_r &set_active_CSL(::security_level value)
2236 {
2237 active_CSL = ((1u << 1) - 1) & static_cast<uint32_t>(value);
2238 return *this;
2239 }
2240#endif //__cplusplus
2241};
2242
2243// config_r - RTL configuration
2244struct config_r
2245{
2246#ifdef __cplusplus
2247 private:
2248#endif //__cplusplus
2249 union
2250 {
2251 struct
2252 {
2253 uint32_t macs_per_cc : 4; // The log2(macs/clock cycle). Valid encoding range is 5 to 8 for 32 to 256
2254 // MACs/clock cycle.
Stefan Nannessone2e70242020-08-19 16:01:29 +02002255 uint32_t cmd_stream_version : 4; // command stream version accepted by this NPU.
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002256 uint32_t shram_size : 8; // Size in KB of SHRAM in the range 8 to 48.
2257 uint32_t reserved0 : 12;
2258 uint32_t product : 4; // Product configuration
2259 };
2260 uint32_t word;
2261 };
2262#ifdef __cplusplus
2263 public:
2264 CONSTEXPR config_r() :
2265 macs_per_cc(static_cast<uint32_t>(0)), cmd_stream_version(static_cast<uint32_t>(0x0)),
2266 shram_size(static_cast<uint32_t>(0)), reserved0(static_cast<uint32_t>(0)), product(static_cast<uint32_t>(0))
2267 {
2268 }
2269 CONSTEXPR config_r(uint32_t init) : word(init) {}
2270 CONSTEXPR void operator=(uint32_t value)
2271 {
2272 word = value;
2273 }
2274 void operator=(uint32_t value) volatile
2275 {
2276 word = value;
2277 }
2278 CONSTEXPR operator uint32_t()
2279 {
2280 return word;
2281 }
2282 operator uint32_t() volatile
2283 {
2284 return word;
2285 }
2286 config_r copy() volatile
2287 {
2288 return *this;
2289 }
2290 CONSTEXPR ::macs_per_cc get_macs_per_cc() const
2291 {
2292 ::macs_per_cc value = static_cast<::macs_per_cc>(macs_per_cc);
2293 return value;
2294 }
2295 ::macs_per_cc get_macs_per_cc() const volatile
2296 {
2297 ::macs_per_cc value = static_cast<::macs_per_cc>(macs_per_cc);
2298 return value;
2299 }
2300 CONSTEXPR config_r &set_macs_per_cc(::macs_per_cc value)
2301 {
2302 macs_per_cc = ((1u << 4) - 1) & static_cast<uint32_t>(value);
2303 return *this;
2304 }
2305 CONSTEXPR uint32_t get_cmd_stream_version() const
2306 {
2307 uint32_t value = static_cast<uint32_t>(cmd_stream_version);
2308 return value;
2309 }
2310 uint32_t get_cmd_stream_version() const volatile
2311 {
2312 uint32_t value = static_cast<uint32_t>(cmd_stream_version);
2313 return value;
2314 }
2315 CONSTEXPR config_r &set_cmd_stream_version(uint32_t value)
2316 {
2317 cmd_stream_version = ((1u << 4) - 1) & static_cast<uint32_t>(value);
2318 return *this;
2319 }
2320 CONSTEXPR ::shram_size get_shram_size() const
2321 {
2322 ::shram_size value = static_cast<::shram_size>(shram_size);
2323 return value;
2324 }
2325 ::shram_size get_shram_size() const volatile
2326 {
2327 ::shram_size value = static_cast<::shram_size>(shram_size);
2328 return value;
2329 }
2330 CONSTEXPR config_r &set_shram_size(::shram_size value)
2331 {
2332 shram_size = ((1u << 8) - 1) & static_cast<uint32_t>(value);
2333 return *this;
2334 }
2335 CONSTEXPR uint32_t get_product() const
2336 {
2337 uint32_t value = static_cast<uint32_t>(product);
2338 return value;
2339 }
2340 uint32_t get_product() const volatile
2341 {
2342 uint32_t value = static_cast<uint32_t>(product);
2343 return value;
2344 }
2345 CONSTEXPR config_r &set_product(uint32_t value)
2346 {
2347 product = ((1u << 4) - 1) & static_cast<uint32_t>(value);
2348 return *this;
2349 }
2350#endif //__cplusplus
2351};
2352
2353// lock_r - Lock register. This register is designed for driver use and does not affect NPU functionality
2354struct lock_r
2355{
2356#ifdef __cplusplus
2357 private:
2358#endif //__cplusplus
2359 union
2360 {
2361 uint32_t LOCK; // 32 bit value for LOCK configuration
2362 uint32_t word;
2363 };
2364#ifdef __cplusplus
2365 public:
2366 CONSTEXPR lock_r() : LOCK(static_cast<uint32_t>(0x00000000)) {}
2367 CONSTEXPR lock_r(uint32_t init) : word(init) {}
2368 CONSTEXPR void operator=(uint32_t value)
2369 {
2370 word = value;
2371 }
2372 void operator=(uint32_t value) volatile
2373 {
2374 word = value;
2375 }
2376 CONSTEXPR operator uint32_t()
2377 {
2378 return word;
2379 }
2380 operator uint32_t() volatile
2381 {
2382 return word;
2383 }
2384 lock_r copy() volatile
2385 {
2386 return *this;
2387 }
2388 CONSTEXPR uint32_t get_LOCK() const
2389 {
2390 uint32_t value = static_cast<uint32_t>(LOCK);
2391 return value;
2392 }
2393 uint32_t get_LOCK() const volatile
2394 {
2395 uint32_t value = static_cast<uint32_t>(LOCK);
2396 return value;
2397 }
2398 CONSTEXPR lock_r &set_LOCK(uint32_t value)
2399 {
2400 LOCK = static_cast<uint32_t>(value);
2401 return *this;
2402 }
2403#endif //__cplusplus
2404};
2405
Stefan Nannessone2e70242020-08-19 16:01:29 +02002406// regioncfg_r - Region memory type configuration. Bits[2*k+1:2*k] give the memory type for REGION[k]
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002407struct regioncfg_r
2408{
2409#ifdef __cplusplus
2410 private:
2411#endif //__cplusplus
2412 union
2413 {
2414 struct
2415 {
2416 uint32_t region0 : 2; // Bits for Region0 Configurion
2417 uint32_t region1 : 2; // Bits for Region1 Configurion
2418 uint32_t region2 : 2; // Bits for Region2 Configurion
2419 uint32_t region3 : 2; // Bits for Region3 Configurion
2420 uint32_t region4 : 2; // Bits for Region4 Configurion
2421 uint32_t region5 : 2; // Bits for Region5 Configurion
2422 uint32_t region6 : 2; // Bits for Region6 Configurion
2423 uint32_t region7 : 2; // Bits for Region7 Configurion
2424 uint32_t reserved0 : 16;
2425 };
2426 uint32_t word;
2427 };
2428#ifdef __cplusplus
2429 public:
2430 CONSTEXPR regioncfg_r() :
2431 region0(static_cast<uint32_t>(::memory_type::AXI0_OUTSTANDING_COUNTER0)),
2432 region1(static_cast<uint32_t>(::memory_type::AXI0_OUTSTANDING_COUNTER0)),
2433 region2(static_cast<uint32_t>(::memory_type::AXI0_OUTSTANDING_COUNTER0)),
2434 region3(static_cast<uint32_t>(::memory_type::AXI0_OUTSTANDING_COUNTER0)),
2435 region4(static_cast<uint32_t>(::memory_type::AXI0_OUTSTANDING_COUNTER0)),
2436 region5(static_cast<uint32_t>(::memory_type::AXI0_OUTSTANDING_COUNTER0)),
2437 region6(static_cast<uint32_t>(::memory_type::AXI0_OUTSTANDING_COUNTER0)),
2438 region7(static_cast<uint32_t>(::memory_type::AXI0_OUTSTANDING_COUNTER0)), reserved0(static_cast<uint32_t>(0))
2439 {
2440 }
2441 CONSTEXPR regioncfg_r(uint32_t init) : word(init) {}
2442 CONSTEXPR void operator=(uint32_t value)
2443 {
2444 word = value;
2445 }
2446 void operator=(uint32_t value) volatile
2447 {
2448 word = value;
2449 }
2450 CONSTEXPR operator uint32_t()
2451 {
2452 return word;
2453 }
2454 operator uint32_t() volatile
2455 {
2456 return word;
2457 }
2458 regioncfg_r copy() volatile
2459 {
2460 return *this;
2461 }
2462 CONSTEXPR ::memory_type get_region0() const
2463 {
2464 ::memory_type value = static_cast<::memory_type>(region0);
2465 return value;
2466 }
2467 ::memory_type get_region0() const volatile
2468 {
2469 ::memory_type value = static_cast<::memory_type>(region0);
2470 return value;
2471 }
2472 CONSTEXPR regioncfg_r &set_region0(::memory_type value)
2473 {
2474 region0 = ((1u << 2) - 1) & static_cast<uint32_t>(value);
2475 return *this;
2476 }
2477 CONSTEXPR ::memory_type get_region1() const
2478 {
2479 ::memory_type value = static_cast<::memory_type>(region1);
2480 return value;
2481 }
2482 ::memory_type get_region1() const volatile
2483 {
2484 ::memory_type value = static_cast<::memory_type>(region1);
2485 return value;
2486 }
2487 CONSTEXPR regioncfg_r &set_region1(::memory_type value)
2488 {
2489 region1 = ((1u << 2) - 1) & static_cast<uint32_t>(value);
2490 return *this;
2491 }
2492 CONSTEXPR ::memory_type get_region2() const
2493 {
2494 ::memory_type value = static_cast<::memory_type>(region2);
2495 return value;
2496 }
2497 ::memory_type get_region2() const volatile
2498 {
2499 ::memory_type value = static_cast<::memory_type>(region2);
2500 return value;
2501 }
2502 CONSTEXPR regioncfg_r &set_region2(::memory_type value)
2503 {
2504 region2 = ((1u << 2) - 1) & static_cast<uint32_t>(value);
2505 return *this;
2506 }
2507 CONSTEXPR ::memory_type get_region3() const
2508 {
2509 ::memory_type value = static_cast<::memory_type>(region3);
2510 return value;
2511 }
2512 ::memory_type get_region3() const volatile
2513 {
2514 ::memory_type value = static_cast<::memory_type>(region3);
2515 return value;
2516 }
2517 CONSTEXPR regioncfg_r &set_region3(::memory_type value)
2518 {
2519 region3 = ((1u << 2) - 1) & static_cast<uint32_t>(value);
2520 return *this;
2521 }
2522 CONSTEXPR ::memory_type get_region4() const
2523 {
2524 ::memory_type value = static_cast<::memory_type>(region4);
2525 return value;
2526 }
2527 ::memory_type get_region4() const volatile
2528 {
2529 ::memory_type value = static_cast<::memory_type>(region4);
2530 return value;
2531 }
2532 CONSTEXPR regioncfg_r &set_region4(::memory_type value)
2533 {
2534 region4 = ((1u << 2) - 1) & static_cast<uint32_t>(value);
2535 return *this;
2536 }
2537 CONSTEXPR ::memory_type get_region5() const
2538 {
2539 ::memory_type value = static_cast<::memory_type>(region5);
2540 return value;
2541 }
2542 ::memory_type get_region5() const volatile
2543 {
2544 ::memory_type value = static_cast<::memory_type>(region5);
2545 return value;
2546 }
2547 CONSTEXPR regioncfg_r &set_region5(::memory_type value)
2548 {
2549 region5 = ((1u << 2) - 1) & static_cast<uint32_t>(value);
2550 return *this;
2551 }
2552 CONSTEXPR ::memory_type get_region6() const
2553 {
2554 ::memory_type value = static_cast<::memory_type>(region6);
2555 return value;
2556 }
2557 ::memory_type get_region6() const volatile
2558 {
2559 ::memory_type value = static_cast<::memory_type>(region6);
2560 return value;
2561 }
2562 CONSTEXPR regioncfg_r &set_region6(::memory_type value)
2563 {
2564 region6 = ((1u << 2) - 1) & static_cast<uint32_t>(value);
2565 return *this;
2566 }
2567 CONSTEXPR ::memory_type get_region7() const
2568 {
2569 ::memory_type value = static_cast<::memory_type>(region7);
2570 return value;
2571 }
2572 ::memory_type get_region7() const volatile
2573 {
2574 ::memory_type value = static_cast<::memory_type>(region7);
2575 return value;
2576 }
2577 CONSTEXPR regioncfg_r &set_region7(::memory_type value)
2578 {
2579 region7 = ((1u << 2) - 1) & static_cast<uint32_t>(value);
2580 return *this;
2581 }
2582#endif //__cplusplus
2583};
2584
2585// axi_limit0_r - AXI limits for port 0 counter 0
2586struct axi_limit0_r
2587{
2588#ifdef __cplusplus
2589 private:
2590#endif //__cplusplus
2591 union
2592 {
2593 struct
2594 {
2595 uint32_t max_beats : 2; // Burst split alignment: 0=64 bytes, 1=128 bytes, 2=256 bytes, 3=reserved
2596 uint32_t reserved0 : 2;
Stefan Nannessone2e70242020-08-19 16:01:29 +02002597 uint32_t memtype : 4; // Memtype to be used to encode AxCACHE signals
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002598 uint32_t reserved1 : 8;
2599 uint32_t
2600 max_outstanding_read_m1 : 8; // Maximum number of outstanding AXI read transactions - 1 in range 0 to 31
2601 uint32_t max_outstanding_write_m1 : 8; // Maximum number of outstanding AXI write transactions - 1 in range
2602 // 0 to 15
2603 };
2604 uint32_t word;
2605 };
2606#ifdef __cplusplus
2607 public:
2608 CONSTEXPR axi_limit0_r() :
Stefan Nannessone2e70242020-08-19 16:01:29 +02002609 max_beats(static_cast<uint32_t>(0x0)), reserved0(static_cast<uint32_t>(0)),
2610 memtype(static_cast<uint32_t>(::axi_mem_encoding_type::DEVICE_NON_BUFFERABLE)),
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002611 reserved1(static_cast<uint32_t>(0)), max_outstanding_read_m1(static_cast<uint32_t>(0x00)),
2612 max_outstanding_write_m1(static_cast<uint32_t>(0x00))
2613 {
2614 }
2615 CONSTEXPR axi_limit0_r(uint32_t init) : word(init) {}
2616 CONSTEXPR void operator=(uint32_t value)
2617 {
2618 word = value;
2619 }
2620 void operator=(uint32_t value) volatile
2621 {
2622 word = value;
2623 }
2624 CONSTEXPR operator uint32_t()
2625 {
2626 return word;
2627 }
2628 operator uint32_t() volatile
2629 {
2630 return word;
2631 }
2632 axi_limit0_r copy() volatile
2633 {
2634 return *this;
2635 }
2636 CONSTEXPR uint32_t get_max_beats() const
2637 {
2638 uint32_t value = static_cast<uint32_t>(max_beats);
2639 return value;
2640 }
2641 uint32_t get_max_beats() const volatile
2642 {
2643 uint32_t value = static_cast<uint32_t>(max_beats);
2644 return value;
2645 }
2646 CONSTEXPR axi_limit0_r &set_max_beats(uint32_t value)
2647 {
2648 max_beats = ((1u << 2) - 1) & static_cast<uint32_t>(value);
2649 return *this;
2650 }
Stefan Nannessone2e70242020-08-19 16:01:29 +02002651 CONSTEXPR ::axi_mem_encoding_type get_memtype() const
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002652 {
Stefan Nannessone2e70242020-08-19 16:01:29 +02002653 ::axi_mem_encoding_type value = static_cast<::axi_mem_encoding_type>(memtype);
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002654 return value;
2655 }
Stefan Nannessone2e70242020-08-19 16:01:29 +02002656 ::axi_mem_encoding_type get_memtype() const volatile
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002657 {
Stefan Nannessone2e70242020-08-19 16:01:29 +02002658 ::axi_mem_encoding_type value = static_cast<::axi_mem_encoding_type>(memtype);
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002659 return value;
2660 }
Stefan Nannessone2e70242020-08-19 16:01:29 +02002661 CONSTEXPR axi_limit0_r &set_memtype(::axi_mem_encoding_type value)
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002662 {
2663 memtype = ((1u << 4) - 1) & static_cast<uint32_t>(value);
2664 return *this;
2665 }
2666 CONSTEXPR uint32_t get_max_outstanding_read_m1() const
2667 {
2668 uint32_t value = static_cast<uint32_t>(max_outstanding_read_m1);
2669 return value;
2670 }
2671 uint32_t get_max_outstanding_read_m1() const volatile
2672 {
2673 uint32_t value = static_cast<uint32_t>(max_outstanding_read_m1);
2674 return value;
2675 }
2676 CONSTEXPR axi_limit0_r &set_max_outstanding_read_m1(uint32_t value)
2677 {
2678 max_outstanding_read_m1 = ((1u << 8) - 1) & static_cast<uint32_t>(value);
2679 return *this;
2680 }
2681 CONSTEXPR uint32_t get_max_outstanding_write_m1() const
2682 {
2683 uint32_t value = static_cast<uint32_t>(max_outstanding_write_m1);
2684 return value;
2685 }
2686 uint32_t get_max_outstanding_write_m1() const volatile
2687 {
2688 uint32_t value = static_cast<uint32_t>(max_outstanding_write_m1);
2689 return value;
2690 }
2691 CONSTEXPR axi_limit0_r &set_max_outstanding_write_m1(uint32_t value)
2692 {
2693 max_outstanding_write_m1 = ((1u << 8) - 1) & static_cast<uint32_t>(value);
2694 return *this;
2695 }
2696#endif //__cplusplus
2697};
2698
2699// axi_limit1_r - AXI limits for port 0 counter 1
2700struct axi_limit1_r
2701{
2702#ifdef __cplusplus
2703 private:
2704#endif //__cplusplus
2705 union
2706 {
2707 struct
2708 {
2709 uint32_t max_beats : 2; // Burst split alignment: 0=64 bytes, 1=128 bytes, 2=256 bytes, 3=reserved
2710 uint32_t reserved0 : 2;
Stefan Nannessone2e70242020-08-19 16:01:29 +02002711 uint32_t memtype : 4; // Memtype to be used to encode AxCACHE signals
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002712 uint32_t reserved1 : 8;
2713 uint32_t
2714 max_outstanding_read_m1 : 8; // Maximum number of outstanding AXI read transactions - 1 in range 0 to 31
2715 uint32_t max_outstanding_write_m1 : 8; // Maximum number of outstanding AXI write transactions - 1 in range
2716 // 0 to 15
2717 };
2718 uint32_t word;
2719 };
2720#ifdef __cplusplus
2721 public:
2722 CONSTEXPR axi_limit1_r() :
Stefan Nannessone2e70242020-08-19 16:01:29 +02002723 max_beats(static_cast<uint32_t>(0x0)), reserved0(static_cast<uint32_t>(0)),
2724 memtype(static_cast<uint32_t>(::axi_mem_encoding_type::DEVICE_NON_BUFFERABLE)),
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002725 reserved1(static_cast<uint32_t>(0)), max_outstanding_read_m1(static_cast<uint32_t>(0x00)),
2726 max_outstanding_write_m1(static_cast<uint32_t>(0x00))
2727 {
2728 }
2729 CONSTEXPR axi_limit1_r(uint32_t init) : word(init) {}
2730 CONSTEXPR void operator=(uint32_t value)
2731 {
2732 word = value;
2733 }
2734 void operator=(uint32_t value) volatile
2735 {
2736 word = value;
2737 }
2738 CONSTEXPR operator uint32_t()
2739 {
2740 return word;
2741 }
2742 operator uint32_t() volatile
2743 {
2744 return word;
2745 }
2746 axi_limit1_r copy() volatile
2747 {
2748 return *this;
2749 }
2750 CONSTEXPR uint32_t get_max_beats() const
2751 {
2752 uint32_t value = static_cast<uint32_t>(max_beats);
2753 return value;
2754 }
2755 uint32_t get_max_beats() const volatile
2756 {
2757 uint32_t value = static_cast<uint32_t>(max_beats);
2758 return value;
2759 }
2760 CONSTEXPR axi_limit1_r &set_max_beats(uint32_t value)
2761 {
2762 max_beats = ((1u << 2) - 1) & static_cast<uint32_t>(value);
2763 return *this;
2764 }
Stefan Nannessone2e70242020-08-19 16:01:29 +02002765 CONSTEXPR ::axi_mem_encoding_type get_memtype() const
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002766 {
Stefan Nannessone2e70242020-08-19 16:01:29 +02002767 ::axi_mem_encoding_type value = static_cast<::axi_mem_encoding_type>(memtype);
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002768 return value;
2769 }
Stefan Nannessone2e70242020-08-19 16:01:29 +02002770 ::axi_mem_encoding_type get_memtype() const volatile
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002771 {
Stefan Nannessone2e70242020-08-19 16:01:29 +02002772 ::axi_mem_encoding_type value = static_cast<::axi_mem_encoding_type>(memtype);
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002773 return value;
2774 }
Stefan Nannessone2e70242020-08-19 16:01:29 +02002775 CONSTEXPR axi_limit1_r &set_memtype(::axi_mem_encoding_type value)
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002776 {
2777 memtype = ((1u << 4) - 1) & static_cast<uint32_t>(value);
2778 return *this;
2779 }
2780 CONSTEXPR uint32_t get_max_outstanding_read_m1() const
2781 {
2782 uint32_t value = static_cast<uint32_t>(max_outstanding_read_m1);
2783 return value;
2784 }
2785 uint32_t get_max_outstanding_read_m1() const volatile
2786 {
2787 uint32_t value = static_cast<uint32_t>(max_outstanding_read_m1);
2788 return value;
2789 }
2790 CONSTEXPR axi_limit1_r &set_max_outstanding_read_m1(uint32_t value)
2791 {
2792 max_outstanding_read_m1 = ((1u << 8) - 1) & static_cast<uint32_t>(value);
2793 return *this;
2794 }
2795 CONSTEXPR uint32_t get_max_outstanding_write_m1() const
2796 {
2797 uint32_t value = static_cast<uint32_t>(max_outstanding_write_m1);
2798 return value;
2799 }
2800 uint32_t get_max_outstanding_write_m1() const volatile
2801 {
2802 uint32_t value = static_cast<uint32_t>(max_outstanding_write_m1);
2803 return value;
2804 }
2805 CONSTEXPR axi_limit1_r &set_max_outstanding_write_m1(uint32_t value)
2806 {
2807 max_outstanding_write_m1 = ((1u << 8) - 1) & static_cast<uint32_t>(value);
2808 return *this;
2809 }
2810#endif //__cplusplus
2811};
2812
2813// axi_limit2_r - AXI limits for port 1 counter 2
2814struct axi_limit2_r
2815{
2816#ifdef __cplusplus
2817 private:
2818#endif //__cplusplus
2819 union
2820 {
2821 struct
2822 {
2823 uint32_t max_beats : 2; // Burst split alignment: 0=64 bytes, 1=128 bytes, 2=256 bytes, 3=reserved
2824 uint32_t reserved0 : 2;
Stefan Nannessone2e70242020-08-19 16:01:29 +02002825 uint32_t memtype : 4; // Memtype to be used to encode AxCACHE signals
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002826 uint32_t reserved1 : 8;
2827 uint32_t
2828 max_outstanding_read_m1 : 8; // Maximum number of outstanding AXI read transactions - 1 in range 0 to 31
2829 uint32_t max_outstanding_write_m1 : 8; // Maximum number of outstanding AXI write transactions - 1 in range
2830 // 0 to 15
2831 };
2832 uint32_t word;
2833 };
2834#ifdef __cplusplus
2835 public:
2836 CONSTEXPR axi_limit2_r() :
Stefan Nannessone2e70242020-08-19 16:01:29 +02002837 max_beats(static_cast<uint32_t>(0x0)), reserved0(static_cast<uint32_t>(0)),
2838 memtype(static_cast<uint32_t>(::axi_mem_encoding_type::DEVICE_NON_BUFFERABLE)),
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002839 reserved1(static_cast<uint32_t>(0)), max_outstanding_read_m1(static_cast<uint32_t>(0x00)),
2840 max_outstanding_write_m1(static_cast<uint32_t>(0x00))
2841 {
2842 }
2843 CONSTEXPR axi_limit2_r(uint32_t init) : word(init) {}
2844 CONSTEXPR void operator=(uint32_t value)
2845 {
2846 word = value;
2847 }
2848 void operator=(uint32_t value) volatile
2849 {
2850 word = value;
2851 }
2852 CONSTEXPR operator uint32_t()
2853 {
2854 return word;
2855 }
2856 operator uint32_t() volatile
2857 {
2858 return word;
2859 }
2860 axi_limit2_r copy() volatile
2861 {
2862 return *this;
2863 }
2864 CONSTEXPR uint32_t get_max_beats() const
2865 {
2866 uint32_t value = static_cast<uint32_t>(max_beats);
2867 return value;
2868 }
2869 uint32_t get_max_beats() const volatile
2870 {
2871 uint32_t value = static_cast<uint32_t>(max_beats);
2872 return value;
2873 }
2874 CONSTEXPR axi_limit2_r &set_max_beats(uint32_t value)
2875 {
2876 max_beats = ((1u << 2) - 1) & static_cast<uint32_t>(value);
2877 return *this;
2878 }
Stefan Nannessone2e70242020-08-19 16:01:29 +02002879 CONSTEXPR ::axi_mem_encoding_type get_memtype() const
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002880 {
Stefan Nannessone2e70242020-08-19 16:01:29 +02002881 ::axi_mem_encoding_type value = static_cast<::axi_mem_encoding_type>(memtype);
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002882 return value;
2883 }
Stefan Nannessone2e70242020-08-19 16:01:29 +02002884 ::axi_mem_encoding_type get_memtype() const volatile
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002885 {
Stefan Nannessone2e70242020-08-19 16:01:29 +02002886 ::axi_mem_encoding_type value = static_cast<::axi_mem_encoding_type>(memtype);
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002887 return value;
2888 }
Stefan Nannessone2e70242020-08-19 16:01:29 +02002889 CONSTEXPR axi_limit2_r &set_memtype(::axi_mem_encoding_type value)
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002890 {
2891 memtype = ((1u << 4) - 1) & static_cast<uint32_t>(value);
2892 return *this;
2893 }
2894 CONSTEXPR uint32_t get_max_outstanding_read_m1() const
2895 {
2896 uint32_t value = static_cast<uint32_t>(max_outstanding_read_m1);
2897 return value;
2898 }
2899 uint32_t get_max_outstanding_read_m1() const volatile
2900 {
2901 uint32_t value = static_cast<uint32_t>(max_outstanding_read_m1);
2902 return value;
2903 }
2904 CONSTEXPR axi_limit2_r &set_max_outstanding_read_m1(uint32_t value)
2905 {
2906 max_outstanding_read_m1 = ((1u << 8) - 1) & static_cast<uint32_t>(value);
2907 return *this;
2908 }
2909 CONSTEXPR uint32_t get_max_outstanding_write_m1() const
2910 {
2911 uint32_t value = static_cast<uint32_t>(max_outstanding_write_m1);
2912 return value;
2913 }
2914 uint32_t get_max_outstanding_write_m1() const volatile
2915 {
2916 uint32_t value = static_cast<uint32_t>(max_outstanding_write_m1);
2917 return value;
2918 }
2919 CONSTEXPR axi_limit2_r &set_max_outstanding_write_m1(uint32_t value)
2920 {
2921 max_outstanding_write_m1 = ((1u << 8) - 1) & static_cast<uint32_t>(value);
2922 return *this;
2923 }
2924#endif //__cplusplus
2925};
2926
2927// axi_limit3_r - AXI limits for port 1 counter 3
2928struct axi_limit3_r
2929{
2930#ifdef __cplusplus
2931 private:
2932#endif //__cplusplus
2933 union
2934 {
2935 struct
2936 {
2937 uint32_t max_beats : 2; // Burst split alignment: 0=64 bytes, 1=128 bytes, 2=256 bytes, 3=reserved
2938 uint32_t reserved0 : 2;
Stefan Nannessone2e70242020-08-19 16:01:29 +02002939 uint32_t memtype : 4; // Memtype to be used to encode AxCACHE signals
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002940 uint32_t reserved1 : 8;
2941 uint32_t
2942 max_outstanding_read_m1 : 8; // Maximum number of outstanding AXI read transactions - 1 in range 0 to 31
2943 uint32_t max_outstanding_write_m1 : 8; // Maximum number of outstanding AXI write transactions - 1 in range
2944 // 0 to 15
2945 };
2946 uint32_t word;
2947 };
2948#ifdef __cplusplus
2949 public:
2950 CONSTEXPR axi_limit3_r() :
Stefan Nannessone2e70242020-08-19 16:01:29 +02002951 max_beats(static_cast<uint32_t>(0x0)), reserved0(static_cast<uint32_t>(0)),
2952 memtype(static_cast<uint32_t>(::axi_mem_encoding_type::DEVICE_NON_BUFFERABLE)),
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002953 reserved1(static_cast<uint32_t>(0)), max_outstanding_read_m1(static_cast<uint32_t>(0x00)),
2954 max_outstanding_write_m1(static_cast<uint32_t>(0x00))
2955 {
2956 }
2957 CONSTEXPR axi_limit3_r(uint32_t init) : word(init) {}
2958 CONSTEXPR void operator=(uint32_t value)
2959 {
2960 word = value;
2961 }
2962 void operator=(uint32_t value) volatile
2963 {
2964 word = value;
2965 }
2966 CONSTEXPR operator uint32_t()
2967 {
2968 return word;
2969 }
2970 operator uint32_t() volatile
2971 {
2972 return word;
2973 }
2974 axi_limit3_r copy() volatile
2975 {
2976 return *this;
2977 }
2978 CONSTEXPR uint32_t get_max_beats() const
2979 {
2980 uint32_t value = static_cast<uint32_t>(max_beats);
2981 return value;
2982 }
2983 uint32_t get_max_beats() const volatile
2984 {
2985 uint32_t value = static_cast<uint32_t>(max_beats);
2986 return value;
2987 }
2988 CONSTEXPR axi_limit3_r &set_max_beats(uint32_t value)
2989 {
2990 max_beats = ((1u << 2) - 1) & static_cast<uint32_t>(value);
2991 return *this;
2992 }
Stefan Nannessone2e70242020-08-19 16:01:29 +02002993 CONSTEXPR ::axi_mem_encoding_type get_memtype() const
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002994 {
Stefan Nannessone2e70242020-08-19 16:01:29 +02002995 ::axi_mem_encoding_type value = static_cast<::axi_mem_encoding_type>(memtype);
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002996 return value;
2997 }
Stefan Nannessone2e70242020-08-19 16:01:29 +02002998 ::axi_mem_encoding_type get_memtype() const volatile
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002999 {
Stefan Nannessone2e70242020-08-19 16:01:29 +02003000 ::axi_mem_encoding_type value = static_cast<::axi_mem_encoding_type>(memtype);
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003001 return value;
3002 }
Stefan Nannessone2e70242020-08-19 16:01:29 +02003003 CONSTEXPR axi_limit3_r &set_memtype(::axi_mem_encoding_type value)
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003004 {
3005 memtype = ((1u << 4) - 1) & static_cast<uint32_t>(value);
3006 return *this;
3007 }
3008 CONSTEXPR uint32_t get_max_outstanding_read_m1() const
3009 {
3010 uint32_t value = static_cast<uint32_t>(max_outstanding_read_m1);
3011 return value;
3012 }
3013 uint32_t get_max_outstanding_read_m1() const volatile
3014 {
3015 uint32_t value = static_cast<uint32_t>(max_outstanding_read_m1);
3016 return value;
3017 }
3018 CONSTEXPR axi_limit3_r &set_max_outstanding_read_m1(uint32_t value)
3019 {
3020 max_outstanding_read_m1 = ((1u << 8) - 1) & static_cast<uint32_t>(value);
3021 return *this;
3022 }
3023 CONSTEXPR uint32_t get_max_outstanding_write_m1() const
3024 {
3025 uint32_t value = static_cast<uint32_t>(max_outstanding_write_m1);
3026 return value;
3027 }
3028 uint32_t get_max_outstanding_write_m1() const volatile
3029 {
3030 uint32_t value = static_cast<uint32_t>(max_outstanding_write_m1);
3031 return value;
3032 }
3033 CONSTEXPR axi_limit3_r &set_max_outstanding_write_m1(uint32_t value)
3034 {
3035 max_outstanding_write_m1 = ((1u << 8) - 1) & static_cast<uint32_t>(value);
3036 return *this;
3037 }
3038#endif //__cplusplus
3039};
3040
3041// basep0_r - Lower 32 bits of the Base pointer for region index 0
3042struct basep0_r
3043{
3044#ifdef __cplusplus
3045 private:
3046#endif //__cplusplus
3047 union
3048 {
3049 uint32_t addr_word; // The low word of the 64-bit address
3050 uint32_t word;
3051 };
3052#ifdef __cplusplus
3053 public:
3054 CONSTEXPR basep0_r() : addr_word(static_cast<uint32_t>(0)) {}
3055 CONSTEXPR basep0_r(uint32_t init) : word(init) {}
3056 CONSTEXPR void operator=(uint32_t value)
3057 {
3058 word = value;
3059 }
3060 void operator=(uint32_t value) volatile
3061 {
3062 word = value;
3063 }
3064 CONSTEXPR operator uint32_t()
3065 {
3066 return word;
3067 }
3068 operator uint32_t() volatile
3069 {
3070 return word;
3071 }
3072 basep0_r copy() volatile
3073 {
3074 return *this;
3075 }
3076 CONSTEXPR uint32_t get_addr_word() const
3077 {
3078 uint32_t value = static_cast<uint32_t>(addr_word);
3079 return value;
3080 }
3081 uint32_t get_addr_word() const volatile
3082 {
3083 uint32_t value = static_cast<uint32_t>(addr_word);
3084 return value;
3085 }
3086 CONSTEXPR basep0_r &set_addr_word(uint32_t value)
3087 {
3088 addr_word = static_cast<uint32_t>(value);
3089 return *this;
3090 }
3091#endif //__cplusplus
3092};
3093
3094// basep1_r - Upper 32 bits of the Base pointer for region index 0
3095struct basep1_r
3096{
3097#ifdef __cplusplus
3098 private:
3099#endif //__cplusplus
3100 union
3101 {
3102 uint32_t addr_word; // The high word of the 64-bit address
3103 uint32_t word;
3104 };
3105#ifdef __cplusplus
3106 public:
3107 CONSTEXPR basep1_r() : addr_word(static_cast<uint32_t>(0)) {}
3108 CONSTEXPR basep1_r(uint32_t init) : word(init) {}
3109 CONSTEXPR void operator=(uint32_t value)
3110 {
3111 word = value;
3112 }
3113 void operator=(uint32_t value) volatile
3114 {
3115 word = value;
3116 }
3117 CONSTEXPR operator uint32_t()
3118 {
3119 return word;
3120 }
3121 operator uint32_t() volatile
3122 {
3123 return word;
3124 }
3125 basep1_r copy() volatile
3126 {
3127 return *this;
3128 }
3129 CONSTEXPR uint32_t get_addr_word() const
3130 {
3131 uint32_t value = static_cast<uint32_t>(addr_word);
3132 return value;
3133 }
3134 uint32_t get_addr_word() const volatile
3135 {
3136 uint32_t value = static_cast<uint32_t>(addr_word);
3137 return value;
3138 }
3139 CONSTEXPR basep1_r &set_addr_word(uint32_t value)
3140 {
3141 addr_word = static_cast<uint32_t>(value);
3142 return *this;
3143 }
3144#endif //__cplusplus
3145};
3146
3147// basep2_r - Lower 32 bits of the Base pointer for region index 1
3148struct basep2_r
3149{
3150#ifdef __cplusplus
3151 private:
3152#endif //__cplusplus
3153 union
3154 {
3155 uint32_t addr_word; // The low word of the 64-bit address
3156 uint32_t word;
3157 };
3158#ifdef __cplusplus
3159 public:
3160 CONSTEXPR basep2_r() : addr_word(static_cast<uint32_t>(0)) {}
3161 CONSTEXPR basep2_r(uint32_t init) : word(init) {}
3162 CONSTEXPR void operator=(uint32_t value)
3163 {
3164 word = value;
3165 }
3166 void operator=(uint32_t value) volatile
3167 {
3168 word = value;
3169 }
3170 CONSTEXPR operator uint32_t()
3171 {
3172 return word;
3173 }
3174 operator uint32_t() volatile
3175 {
3176 return word;
3177 }
3178 basep2_r copy() volatile
3179 {
3180 return *this;
3181 }
3182 CONSTEXPR uint32_t get_addr_word() const
3183 {
3184 uint32_t value = static_cast<uint32_t>(addr_word);
3185 return value;
3186 }
3187 uint32_t get_addr_word() const volatile
3188 {
3189 uint32_t value = static_cast<uint32_t>(addr_word);
3190 return value;
3191 }
3192 CONSTEXPR basep2_r &set_addr_word(uint32_t value)
3193 {
3194 addr_word = static_cast<uint32_t>(value);
3195 return *this;
3196 }
3197#endif //__cplusplus
3198};
3199
3200// basep3_r - Upper 32 bits of the Base pointer for region index 1
3201struct basep3_r
3202{
3203#ifdef __cplusplus
3204 private:
3205#endif //__cplusplus
3206 union
3207 {
3208 uint32_t addr_word; // The high word of the 64-bit address
3209 uint32_t word;
3210 };
3211#ifdef __cplusplus
3212 public:
3213 CONSTEXPR basep3_r() : addr_word(static_cast<uint32_t>(0)) {}
3214 CONSTEXPR basep3_r(uint32_t init) : word(init) {}
3215 CONSTEXPR void operator=(uint32_t value)
3216 {
3217 word = value;
3218 }
3219 void operator=(uint32_t value) volatile
3220 {
3221 word = value;
3222 }
3223 CONSTEXPR operator uint32_t()
3224 {
3225 return word;
3226 }
3227 operator uint32_t() volatile
3228 {
3229 return word;
3230 }
3231 basep3_r copy() volatile
3232 {
3233 return *this;
3234 }
3235 CONSTEXPR uint32_t get_addr_word() const
3236 {
3237 uint32_t value = static_cast<uint32_t>(addr_word);
3238 return value;
3239 }
3240 uint32_t get_addr_word() const volatile
3241 {
3242 uint32_t value = static_cast<uint32_t>(addr_word);
3243 return value;
3244 }
3245 CONSTEXPR basep3_r &set_addr_word(uint32_t value)
3246 {
3247 addr_word = static_cast<uint32_t>(value);
3248 return *this;
3249 }
3250#endif //__cplusplus
3251};
3252
3253// basep4_r - Lower 32 bits of the Base pointer for region index 2
3254struct basep4_r
3255{
3256#ifdef __cplusplus
3257 private:
3258#endif //__cplusplus
3259 union
3260 {
3261 uint32_t addr_word; // The low word of the 64-bit address
3262 uint32_t word;
3263 };
3264#ifdef __cplusplus
3265 public:
3266 CONSTEXPR basep4_r() : addr_word(static_cast<uint32_t>(0)) {}
3267 CONSTEXPR basep4_r(uint32_t init) : word(init) {}
3268 CONSTEXPR void operator=(uint32_t value)
3269 {
3270 word = value;
3271 }
3272 void operator=(uint32_t value) volatile
3273 {
3274 word = value;
3275 }
3276 CONSTEXPR operator uint32_t()
3277 {
3278 return word;
3279 }
3280 operator uint32_t() volatile
3281 {
3282 return word;
3283 }
3284 basep4_r copy() volatile
3285 {
3286 return *this;
3287 }
3288 CONSTEXPR uint32_t get_addr_word() const
3289 {
3290 uint32_t value = static_cast<uint32_t>(addr_word);
3291 return value;
3292 }
3293 uint32_t get_addr_word() const volatile
3294 {
3295 uint32_t value = static_cast<uint32_t>(addr_word);
3296 return value;
3297 }
3298 CONSTEXPR basep4_r &set_addr_word(uint32_t value)
3299 {
3300 addr_word = static_cast<uint32_t>(value);
3301 return *this;
3302 }
3303#endif //__cplusplus
3304};
3305
3306// basep5_r - Upper 32 bits of the Base pointer for region index 2
3307struct basep5_r
3308{
3309#ifdef __cplusplus
3310 private:
3311#endif //__cplusplus
3312 union
3313 {
3314 uint32_t addr_word; // The high word of the 64-bit address
3315 uint32_t word;
3316 };
3317#ifdef __cplusplus
3318 public:
3319 CONSTEXPR basep5_r() : addr_word(static_cast<uint32_t>(0)) {}
3320 CONSTEXPR basep5_r(uint32_t init) : word(init) {}
3321 CONSTEXPR void operator=(uint32_t value)
3322 {
3323 word = value;
3324 }
3325 void operator=(uint32_t value) volatile
3326 {
3327 word = value;
3328 }
3329 CONSTEXPR operator uint32_t()
3330 {
3331 return word;
3332 }
3333 operator uint32_t() volatile
3334 {
3335 return word;
3336 }
3337 basep5_r copy() volatile
3338 {
3339 return *this;
3340 }
3341 CONSTEXPR uint32_t get_addr_word() const
3342 {
3343 uint32_t value = static_cast<uint32_t>(addr_word);
3344 return value;
3345 }
3346 uint32_t get_addr_word() const volatile
3347 {
3348 uint32_t value = static_cast<uint32_t>(addr_word);
3349 return value;
3350 }
3351 CONSTEXPR basep5_r &set_addr_word(uint32_t value)
3352 {
3353 addr_word = static_cast<uint32_t>(value);
3354 return *this;
3355 }
3356#endif //__cplusplus
3357};
3358
3359// basep6_r - Lower 32 bits of the Base pointer for region index 3
3360struct basep6_r
3361{
3362#ifdef __cplusplus
3363 private:
3364#endif //__cplusplus
3365 union
3366 {
3367 uint32_t addr_word; // The low word of the 64-bit address
3368 uint32_t word;
3369 };
3370#ifdef __cplusplus
3371 public:
3372 CONSTEXPR basep6_r() : addr_word(static_cast<uint32_t>(0)) {}
3373 CONSTEXPR basep6_r(uint32_t init) : word(init) {}
3374 CONSTEXPR void operator=(uint32_t value)
3375 {
3376 word = value;
3377 }
3378 void operator=(uint32_t value) volatile
3379 {
3380 word = value;
3381 }
3382 CONSTEXPR operator uint32_t()
3383 {
3384 return word;
3385 }
3386 operator uint32_t() volatile
3387 {
3388 return word;
3389 }
3390 basep6_r copy() volatile
3391 {
3392 return *this;
3393 }
3394 CONSTEXPR uint32_t get_addr_word() const
3395 {
3396 uint32_t value = static_cast<uint32_t>(addr_word);
3397 return value;
3398 }
3399 uint32_t get_addr_word() const volatile
3400 {
3401 uint32_t value = static_cast<uint32_t>(addr_word);
3402 return value;
3403 }
3404 CONSTEXPR basep6_r &set_addr_word(uint32_t value)
3405 {
3406 addr_word = static_cast<uint32_t>(value);
3407 return *this;
3408 }
3409#endif //__cplusplus
3410};
3411
3412// basep7_r - Upper 32 bits of the Base pointer for region index 3
3413struct basep7_r
3414{
3415#ifdef __cplusplus
3416 private:
3417#endif //__cplusplus
3418 union
3419 {
3420 uint32_t addr_word; // The high word of the 64-bit address
3421 uint32_t word;
3422 };
3423#ifdef __cplusplus
3424 public:
3425 CONSTEXPR basep7_r() : addr_word(static_cast<uint32_t>(0)) {}
3426 CONSTEXPR basep7_r(uint32_t init) : word(init) {}
3427 CONSTEXPR void operator=(uint32_t value)
3428 {
3429 word = value;
3430 }
3431 void operator=(uint32_t value) volatile
3432 {
3433 word = value;
3434 }
3435 CONSTEXPR operator uint32_t()
3436 {
3437 return word;
3438 }
3439 operator uint32_t() volatile
3440 {
3441 return word;
3442 }
3443 basep7_r copy() volatile
3444 {
3445 return *this;
3446 }
3447 CONSTEXPR uint32_t get_addr_word() const
3448 {
3449 uint32_t value = static_cast<uint32_t>(addr_word);
3450 return value;
3451 }
3452 uint32_t get_addr_word() const volatile
3453 {
3454 uint32_t value = static_cast<uint32_t>(addr_word);
3455 return value;
3456 }
3457 CONSTEXPR basep7_r &set_addr_word(uint32_t value)
3458 {
3459 addr_word = static_cast<uint32_t>(value);
3460 return *this;
3461 }
3462#endif //__cplusplus
3463};
3464
3465// basep8_r - Lower 32 bits of the Base pointer for region index 4
3466struct basep8_r
3467{
3468#ifdef __cplusplus
3469 private:
3470#endif //__cplusplus
3471 union
3472 {
3473 uint32_t addr_word; // The low word of the 64-bit address
3474 uint32_t word;
3475 };
3476#ifdef __cplusplus
3477 public:
3478 CONSTEXPR basep8_r() : addr_word(static_cast<uint32_t>(0)) {}
3479 CONSTEXPR basep8_r(uint32_t init) : word(init) {}
3480 CONSTEXPR void operator=(uint32_t value)
3481 {
3482 word = value;
3483 }
3484 void operator=(uint32_t value) volatile
3485 {
3486 word = value;
3487 }
3488 CONSTEXPR operator uint32_t()
3489 {
3490 return word;
3491 }
3492 operator uint32_t() volatile
3493 {
3494 return word;
3495 }
3496 basep8_r copy() volatile
3497 {
3498 return *this;
3499 }
3500 CONSTEXPR uint32_t get_addr_word() const
3501 {
3502 uint32_t value = static_cast<uint32_t>(addr_word);
3503 return value;
3504 }
3505 uint32_t get_addr_word() const volatile
3506 {
3507 uint32_t value = static_cast<uint32_t>(addr_word);
3508 return value;
3509 }
3510 CONSTEXPR basep8_r &set_addr_word(uint32_t value)
3511 {
3512 addr_word = static_cast<uint32_t>(value);
3513 return *this;
3514 }
3515#endif //__cplusplus
3516};
3517
3518// basep9_r - Upper 32 bits of the Base pointer for region index 4
3519struct basep9_r
3520{
3521#ifdef __cplusplus
3522 private:
3523#endif //__cplusplus
3524 union
3525 {
3526 uint32_t addr_word; // The high word of the 64-bit address
3527 uint32_t word;
3528 };
3529#ifdef __cplusplus
3530 public:
3531 CONSTEXPR basep9_r() : addr_word(static_cast<uint32_t>(0)) {}
3532 CONSTEXPR basep9_r(uint32_t init) : word(init) {}
3533 CONSTEXPR void operator=(uint32_t value)
3534 {
3535 word = value;
3536 }
3537 void operator=(uint32_t value) volatile
3538 {
3539 word = value;
3540 }
3541 CONSTEXPR operator uint32_t()
3542 {
3543 return word;
3544 }
3545 operator uint32_t() volatile
3546 {
3547 return word;
3548 }
3549 basep9_r copy() volatile
3550 {
3551 return *this;
3552 }
3553 CONSTEXPR uint32_t get_addr_word() const
3554 {
3555 uint32_t value = static_cast<uint32_t>(addr_word);
3556 return value;
3557 }
3558 uint32_t get_addr_word() const volatile
3559 {
3560 uint32_t value = static_cast<uint32_t>(addr_word);
3561 return value;
3562 }
3563 CONSTEXPR basep9_r &set_addr_word(uint32_t value)
3564 {
3565 addr_word = static_cast<uint32_t>(value);
3566 return *this;
3567 }
3568#endif //__cplusplus
3569};
3570
3571// basep10_r - Lower 32 bits of the Base pointer for region index 5
3572struct basep10_r
3573{
3574#ifdef __cplusplus
3575 private:
3576#endif //__cplusplus
3577 union
3578 {
3579 uint32_t addr_word; // The low word of the 64-bit address
3580 uint32_t word;
3581 };
3582#ifdef __cplusplus
3583 public:
3584 CONSTEXPR basep10_r() : addr_word(static_cast<uint32_t>(0)) {}
3585 CONSTEXPR basep10_r(uint32_t init) : word(init) {}
3586 CONSTEXPR void operator=(uint32_t value)
3587 {
3588 word = value;
3589 }
3590 void operator=(uint32_t value) volatile
3591 {
3592 word = value;
3593 }
3594 CONSTEXPR operator uint32_t()
3595 {
3596 return word;
3597 }
3598 operator uint32_t() volatile
3599 {
3600 return word;
3601 }
3602 basep10_r copy() volatile
3603 {
3604 return *this;
3605 }
3606 CONSTEXPR uint32_t get_addr_word() const
3607 {
3608 uint32_t value = static_cast<uint32_t>(addr_word);
3609 return value;
3610 }
3611 uint32_t get_addr_word() const volatile
3612 {
3613 uint32_t value = static_cast<uint32_t>(addr_word);
3614 return value;
3615 }
3616 CONSTEXPR basep10_r &set_addr_word(uint32_t value)
3617 {
3618 addr_word = static_cast<uint32_t>(value);
3619 return *this;
3620 }
3621#endif //__cplusplus
3622};
3623
3624// basep11_r - Upper 32 bits of the Base pointer for region index 5
3625struct basep11_r
3626{
3627#ifdef __cplusplus
3628 private:
3629#endif //__cplusplus
3630 union
3631 {
3632 uint32_t addr_word; // The high word of the 64-bit address
3633 uint32_t word;
3634 };
3635#ifdef __cplusplus
3636 public:
3637 CONSTEXPR basep11_r() : addr_word(static_cast<uint32_t>(0)) {}
3638 CONSTEXPR basep11_r(uint32_t init) : word(init) {}
3639 CONSTEXPR void operator=(uint32_t value)
3640 {
3641 word = value;
3642 }
3643 void operator=(uint32_t value) volatile
3644 {
3645 word = value;
3646 }
3647 CONSTEXPR operator uint32_t()
3648 {
3649 return word;
3650 }
3651 operator uint32_t() volatile
3652 {
3653 return word;
3654 }
3655 basep11_r copy() volatile
3656 {
3657 return *this;
3658 }
3659 CONSTEXPR uint32_t get_addr_word() const
3660 {
3661 uint32_t value = static_cast<uint32_t>(addr_word);
3662 return value;
3663 }
3664 uint32_t get_addr_word() const volatile
3665 {
3666 uint32_t value = static_cast<uint32_t>(addr_word);
3667 return value;
3668 }
3669 CONSTEXPR basep11_r &set_addr_word(uint32_t value)
3670 {
3671 addr_word = static_cast<uint32_t>(value);
3672 return *this;
3673 }
3674#endif //__cplusplus
3675};
3676
3677// basep12_r - Lower 32 bits of the Base pointer for region index 6
3678struct basep12_r
3679{
3680#ifdef __cplusplus
3681 private:
3682#endif //__cplusplus
3683 union
3684 {
3685 uint32_t addr_word; // The low word of the 64-bit address
3686 uint32_t word;
3687 };
3688#ifdef __cplusplus
3689 public:
3690 CONSTEXPR basep12_r() : addr_word(static_cast<uint32_t>(0)) {}
3691 CONSTEXPR basep12_r(uint32_t init) : word(init) {}
3692 CONSTEXPR void operator=(uint32_t value)
3693 {
3694 word = value;
3695 }
3696 void operator=(uint32_t value) volatile
3697 {
3698 word = value;
3699 }
3700 CONSTEXPR operator uint32_t()
3701 {
3702 return word;
3703 }
3704 operator uint32_t() volatile
3705 {
3706 return word;
3707 }
3708 basep12_r copy() volatile
3709 {
3710 return *this;
3711 }
3712 CONSTEXPR uint32_t get_addr_word() const
3713 {
3714 uint32_t value = static_cast<uint32_t>(addr_word);
3715 return value;
3716 }
3717 uint32_t get_addr_word() const volatile
3718 {
3719 uint32_t value = static_cast<uint32_t>(addr_word);
3720 return value;
3721 }
3722 CONSTEXPR basep12_r &set_addr_word(uint32_t value)
3723 {
3724 addr_word = static_cast<uint32_t>(value);
3725 return *this;
3726 }
3727#endif //__cplusplus
3728};
3729
3730// basep13_r - Upper 32 bits of the Base pointer for region index 6
3731struct basep13_r
3732{
3733#ifdef __cplusplus
3734 private:
3735#endif //__cplusplus
3736 union
3737 {
3738 uint32_t addr_word; // The high word of the 64-bit address
3739 uint32_t word;
3740 };
3741#ifdef __cplusplus
3742 public:
3743 CONSTEXPR basep13_r() : addr_word(static_cast<uint32_t>(0)) {}
3744 CONSTEXPR basep13_r(uint32_t init) : word(init) {}
3745 CONSTEXPR void operator=(uint32_t value)
3746 {
3747 word = value;
3748 }
3749 void operator=(uint32_t value) volatile
3750 {
3751 word = value;
3752 }
3753 CONSTEXPR operator uint32_t()
3754 {
3755 return word;
3756 }
3757 operator uint32_t() volatile
3758 {
3759 return word;
3760 }
3761 basep13_r copy() volatile
3762 {
3763 return *this;
3764 }
3765 CONSTEXPR uint32_t get_addr_word() const
3766 {
3767 uint32_t value = static_cast<uint32_t>(addr_word);
3768 return value;
3769 }
3770 uint32_t get_addr_word() const volatile
3771 {
3772 uint32_t value = static_cast<uint32_t>(addr_word);
3773 return value;
3774 }
3775 CONSTEXPR basep13_r &set_addr_word(uint32_t value)
3776 {
3777 addr_word = static_cast<uint32_t>(value);
3778 return *this;
3779 }
3780#endif //__cplusplus
3781};
3782
3783// basep14_r - Lower 32 bits of the Base pointer for region index 7
3784struct basep14_r
3785{
3786#ifdef __cplusplus
3787 private:
3788#endif //__cplusplus
3789 union
3790 {
3791 uint32_t addr_word; // The low word of the 64-bit address
3792 uint32_t word;
3793 };
3794#ifdef __cplusplus
3795 public:
3796 CONSTEXPR basep14_r() : addr_word(static_cast<uint32_t>(0)) {}
3797 CONSTEXPR basep14_r(uint32_t init) : word(init) {}
3798 CONSTEXPR void operator=(uint32_t value)
3799 {
3800 word = value;
3801 }
3802 void operator=(uint32_t value) volatile
3803 {
3804 word = value;
3805 }
3806 CONSTEXPR operator uint32_t()
3807 {
3808 return word;
3809 }
3810 operator uint32_t() volatile
3811 {
3812 return word;
3813 }
3814 basep14_r copy() volatile
3815 {
3816 return *this;
3817 }
3818 CONSTEXPR uint32_t get_addr_word() const
3819 {
3820 uint32_t value = static_cast<uint32_t>(addr_word);
3821 return value;
3822 }
3823 uint32_t get_addr_word() const volatile
3824 {
3825 uint32_t value = static_cast<uint32_t>(addr_word);
3826 return value;
3827 }
3828 CONSTEXPR basep14_r &set_addr_word(uint32_t value)
3829 {
3830 addr_word = static_cast<uint32_t>(value);
3831 return *this;
3832 }
3833#endif //__cplusplus
3834};
3835
3836// basep15_r - Upper 32 bits of the Base pointer for region index 7
3837struct basep15_r
3838{
3839#ifdef __cplusplus
3840 private:
3841#endif //__cplusplus
3842 union
3843 {
3844 uint32_t addr_word; // The high word of the 64-bit address
3845 uint32_t word;
3846 };
3847#ifdef __cplusplus
3848 public:
3849 CONSTEXPR basep15_r() : addr_word(static_cast<uint32_t>(0)) {}
3850 CONSTEXPR basep15_r(uint32_t init) : word(init) {}
3851 CONSTEXPR void operator=(uint32_t value)
3852 {
3853 word = value;
3854 }
3855 void operator=(uint32_t value) volatile
3856 {
3857 word = value;
3858 }
3859 CONSTEXPR operator uint32_t()
3860 {
3861 return word;
3862 }
3863 operator uint32_t() volatile
3864 {
3865 return word;
3866 }
3867 basep15_r copy() volatile
3868 {
3869 return *this;
3870 }
3871 CONSTEXPR uint32_t get_addr_word() const
3872 {
3873 uint32_t value = static_cast<uint32_t>(addr_word);
3874 return value;
3875 }
3876 uint32_t get_addr_word() const volatile
3877 {
3878 uint32_t value = static_cast<uint32_t>(addr_word);
3879 return value;
3880 }
3881 CONSTEXPR basep15_r &set_addr_word(uint32_t value)
3882 {
3883 addr_word = static_cast<uint32_t>(value);
3884 return *this;
3885 }
3886#endif //__cplusplus
3887};
3888
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003889// wd_status_r - WD_STATUS of core DEBUGCORE
3890struct wd_status_r
3891{
3892#ifdef __cplusplus
3893 private:
3894#endif //__cplusplus
3895 union
3896 {
3897 struct
3898 {
3899 uint32_t core_slice_state : 2; // STATE_HEADER=0, STATE_PALETTE=1, STATE_WEIGHTS=2
3900 uint32_t core_idle : 1; // Core idle
3901 uint32_t ctrl_state : 2; // IDLE=0, DRAIN=1, OFD_INIT=2, OFD_RUN=3
3902 uint32_t ctrl_idle : 1; // All stripe jobs idle (all weights consumed)
3903 uint32_t write_buf_index0 : 3; // current write index for next data from core
3904 uint32_t write_buf_valid0 : 1; // write buf valid (full)
3905 uint32_t write_buf_idle0 : 1; // write buf idle (empty)
3906 uint32_t write_buf_index1 : 3; // current write index for next data from core
3907 uint32_t write_buf_valid1 : 1; // write buf valid (full)
3908 uint32_t write_buf_idle1 : 1; // write buf idle (empty)
3909 uint32_t events : 12; // WD events mapped as appendix A
3910 uint32_t reserved0 : 4;
3911 };
3912 uint32_t word;
3913 };
3914#ifdef __cplusplus
3915 public:
3916 CONSTEXPR wd_status_r() :
3917 core_slice_state(static_cast<uint32_t>(0)), core_idle(static_cast<uint32_t>(0)),
3918 ctrl_state(static_cast<uint32_t>(0)), ctrl_idle(static_cast<uint32_t>(0)),
3919 write_buf_index0(static_cast<uint32_t>(0)), write_buf_valid0(static_cast<uint32_t>(0)),
3920 write_buf_idle0(static_cast<uint32_t>(0)), write_buf_index1(static_cast<uint32_t>(0)),
3921 write_buf_valid1(static_cast<uint32_t>(0)), write_buf_idle1(static_cast<uint32_t>(0)),
3922 events(static_cast<uint32_t>(0)), reserved0(static_cast<uint32_t>(0))
3923 {
3924 }
3925 CONSTEXPR wd_status_r(uint32_t init) : word(init) {}
3926 CONSTEXPR void operator=(uint32_t value)
3927 {
3928 word = value;
3929 }
3930 void operator=(uint32_t value) volatile
3931 {
3932 word = value;
3933 }
3934 CONSTEXPR operator uint32_t()
3935 {
3936 return word;
3937 }
3938 operator uint32_t() volatile
3939 {
3940 return word;
3941 }
3942 wd_status_r copy() volatile
3943 {
3944 return *this;
3945 }
3946 CONSTEXPR uint32_t get_core_slice_state() const
3947 {
3948 uint32_t value = static_cast<uint32_t>(core_slice_state);
3949 return value;
3950 }
3951 uint32_t get_core_slice_state() const volatile
3952 {
3953 uint32_t value = static_cast<uint32_t>(core_slice_state);
3954 return value;
3955 }
3956 CONSTEXPR wd_status_r &set_core_slice_state(uint32_t value)
3957 {
3958 core_slice_state = ((1u << 2) - 1) & static_cast<uint32_t>(value);
3959 return *this;
3960 }
3961 CONSTEXPR uint32_t get_core_idle() const
3962 {
3963 uint32_t value = static_cast<uint32_t>(core_idle);
3964 return value;
3965 }
3966 uint32_t get_core_idle() const volatile
3967 {
3968 uint32_t value = static_cast<uint32_t>(core_idle);
3969 return value;
3970 }
3971 CONSTEXPR wd_status_r &set_core_idle(uint32_t value)
3972 {
3973 core_idle = ((1u << 1) - 1) & static_cast<uint32_t>(value);
3974 return *this;
3975 }
3976 CONSTEXPR uint32_t get_ctrl_state() const
3977 {
3978 uint32_t value = static_cast<uint32_t>(ctrl_state);
3979 return value;
3980 }
3981 uint32_t get_ctrl_state() const volatile
3982 {
3983 uint32_t value = static_cast<uint32_t>(ctrl_state);
3984 return value;
3985 }
3986 CONSTEXPR wd_status_r &set_ctrl_state(uint32_t value)
3987 {
3988 ctrl_state = ((1u << 2) - 1) & static_cast<uint32_t>(value);
3989 return *this;
3990 }
3991 CONSTEXPR uint32_t get_ctrl_idle() const
3992 {
3993 uint32_t value = static_cast<uint32_t>(ctrl_idle);
3994 return value;
3995 }
3996 uint32_t get_ctrl_idle() const volatile
3997 {
3998 uint32_t value = static_cast<uint32_t>(ctrl_idle);
3999 return value;
4000 }
4001 CONSTEXPR wd_status_r &set_ctrl_idle(uint32_t value)
4002 {
4003 ctrl_idle = ((1u << 1) - 1) & static_cast<uint32_t>(value);
4004 return *this;
4005 }
4006 CONSTEXPR uint32_t get_write_buf_index0() const
4007 {
4008 uint32_t value = static_cast<uint32_t>(write_buf_index0);
4009 return value;
4010 }
4011 uint32_t get_write_buf_index0() const volatile
4012 {
4013 uint32_t value = static_cast<uint32_t>(write_buf_index0);
4014 return value;
4015 }
4016 CONSTEXPR wd_status_r &set_write_buf_index0(uint32_t value)
4017 {
4018 write_buf_index0 = ((1u << 3) - 1) & static_cast<uint32_t>(value);
4019 return *this;
4020 }
4021 CONSTEXPR uint32_t get_write_buf_valid0() const
4022 {
4023 uint32_t value = static_cast<uint32_t>(write_buf_valid0);
4024 return value;
4025 }
4026 uint32_t get_write_buf_valid0() const volatile
4027 {
4028 uint32_t value = static_cast<uint32_t>(write_buf_valid0);
4029 return value;
4030 }
4031 CONSTEXPR wd_status_r &set_write_buf_valid0(uint32_t value)
4032 {
4033 write_buf_valid0 = ((1u << 1) - 1) & static_cast<uint32_t>(value);
4034 return *this;
4035 }
4036 CONSTEXPR uint32_t get_write_buf_idle0() const
4037 {
4038 uint32_t value = static_cast<uint32_t>(write_buf_idle0);
4039 return value;
4040 }
4041 uint32_t get_write_buf_idle0() const volatile
4042 {
4043 uint32_t value = static_cast<uint32_t>(write_buf_idle0);
4044 return value;
4045 }
4046 CONSTEXPR wd_status_r &set_write_buf_idle0(uint32_t value)
4047 {
4048 write_buf_idle0 = ((1u << 1) - 1) & static_cast<uint32_t>(value);
4049 return *this;
4050 }
4051 CONSTEXPR uint32_t get_write_buf_index1() const
4052 {
4053 uint32_t value = static_cast<uint32_t>(write_buf_index1);
4054 return value;
4055 }
4056 uint32_t get_write_buf_index1() const volatile
4057 {
4058 uint32_t value = static_cast<uint32_t>(write_buf_index1);
4059 return value;
4060 }
4061 CONSTEXPR wd_status_r &set_write_buf_index1(uint32_t value)
4062 {
4063 write_buf_index1 = ((1u << 3) - 1) & static_cast<uint32_t>(value);
4064 return *this;
4065 }
4066 CONSTEXPR uint32_t get_write_buf_valid1() const
4067 {
4068 uint32_t value = static_cast<uint32_t>(write_buf_valid1);
4069 return value;
4070 }
4071 uint32_t get_write_buf_valid1() const volatile
4072 {
4073 uint32_t value = static_cast<uint32_t>(write_buf_valid1);
4074 return value;
4075 }
4076 CONSTEXPR wd_status_r &set_write_buf_valid1(uint32_t value)
4077 {
4078 write_buf_valid1 = ((1u << 1) - 1) & static_cast<uint32_t>(value);
4079 return *this;
4080 }
4081 CONSTEXPR uint32_t get_write_buf_idle1() const
4082 {
4083 uint32_t value = static_cast<uint32_t>(write_buf_idle1);
4084 return value;
4085 }
4086 uint32_t get_write_buf_idle1() const volatile
4087 {
4088 uint32_t value = static_cast<uint32_t>(write_buf_idle1);
4089 return value;
4090 }
4091 CONSTEXPR wd_status_r &set_write_buf_idle1(uint32_t value)
4092 {
4093 write_buf_idle1 = ((1u << 1) - 1) & static_cast<uint32_t>(value);
4094 return *this;
4095 }
4096 CONSTEXPR uint32_t get_events() const
4097 {
4098 uint32_t value = static_cast<uint32_t>(events);
4099 return value;
4100 }
4101 uint32_t get_events() const volatile
4102 {
4103 uint32_t value = static_cast<uint32_t>(events);
4104 return value;
4105 }
4106 CONSTEXPR wd_status_r &set_events(uint32_t value)
4107 {
4108 events = ((1u << 12) - 1) & static_cast<uint32_t>(value);
4109 return *this;
4110 }
4111#endif //__cplusplus
4112};
4113
4114// mac_status_r - MAC_STATUS of core DEBUGCORE
4115struct mac_status_r
4116{
4117#ifdef __cplusplus
4118 private:
4119#endif //__cplusplus
4120 union
4121 {
4122 struct
4123 {
4124 uint32_t block_cfg_valid : 1; // MAC has a valid block configuration
4125 uint32_t trav_en : 1; // MAC is doing block traversal
4126 uint32_t wait_for_ib : 1; // MAC is waiting for an Input Buffer to become available
4127 uint32_t wait_for_acc_buf : 1; // MAC is waiting for an Accumulator Buffer to become available
4128 uint32_t wait_for_weights : 1; // MAC is waiting for a Weight Block to become available
4129 uint32_t stall_stripe : 1; // MAC is stalling between two stripes
4130 uint32_t dw_sel : 1; // Currently used weight interface in MAC AI
4131 uint32_t wait_for_dw0_ready : 1; // MAC AI is waiting for MAC DPU to send dw0_ready to WD
4132 uint32_t wait_for_dw1_ready : 1; // MAC AI is waiting for MAC DPU to send dw1_ready to WD
4133 uint32_t acc_buf_sel_ai : 1; // Currently used AccBuf interface in MAC AI
4134 uint32_t wait_for_acc0_ready : 1; // MAC AI is waiting for acc0_ready from AO
4135 uint32_t wait_for_acc1_ready : 1; // MAC AI is waiting for acc1_ready from AO
4136 uint32_t acc_buf_sel_aa : 1; // Currently used AccBuf interface in MAC ADDER_ARRAY
4137 uint32_t acc0_valid : 1; // MAC outgoing value of acc0_valid
4138 uint32_t acc1_valid : 1; // MAC outgoing value of acc1_valid
4139 uint32_t reserved0 : 1;
4140 uint32_t events : 11; // Mapped to MAC events described in Appendix A
4141 uint32_t reserved1 : 5;
4142 };
4143 uint32_t word;
4144 };
4145#ifdef __cplusplus
4146 public:
4147 CONSTEXPR mac_status_r() :
4148 block_cfg_valid(static_cast<uint32_t>(0)), trav_en(static_cast<uint32_t>(0)),
4149 wait_for_ib(static_cast<uint32_t>(0)), wait_for_acc_buf(static_cast<uint32_t>(0)),
4150 wait_for_weights(static_cast<uint32_t>(0)), stall_stripe(static_cast<uint32_t>(0)),
4151 dw_sel(static_cast<uint32_t>(0)), wait_for_dw0_ready(static_cast<uint32_t>(0)),
4152 wait_for_dw1_ready(static_cast<uint32_t>(0)), acc_buf_sel_ai(static_cast<uint32_t>(0)),
4153 wait_for_acc0_ready(static_cast<uint32_t>(0)), wait_for_acc1_ready(static_cast<uint32_t>(0)),
4154 acc_buf_sel_aa(static_cast<uint32_t>(0)), acc0_valid(static_cast<uint32_t>(0)),
4155 acc1_valid(static_cast<uint32_t>(0)), reserved0(static_cast<uint32_t>(0)), events(static_cast<uint32_t>(0)),
4156 reserved1(static_cast<uint32_t>(0))
4157 {
4158 }
4159 CONSTEXPR mac_status_r(uint32_t init) : word(init) {}
4160 CONSTEXPR void operator=(uint32_t value)
4161 {
4162 word = value;
4163 }
4164 void operator=(uint32_t value) volatile
4165 {
4166 word = value;
4167 }
4168 CONSTEXPR operator uint32_t()
4169 {
4170 return word;
4171 }
4172 operator uint32_t() volatile
4173 {
4174 return word;
4175 }
4176 mac_status_r copy() volatile
4177 {
4178 return *this;
4179 }
4180 CONSTEXPR uint32_t get_block_cfg_valid() const
4181 {
4182 uint32_t value = static_cast<uint32_t>(block_cfg_valid);
4183 return value;
4184 }
4185 uint32_t get_block_cfg_valid() const volatile
4186 {
4187 uint32_t value = static_cast<uint32_t>(block_cfg_valid);
4188 return value;
4189 }
4190 CONSTEXPR mac_status_r &set_block_cfg_valid(uint32_t value)
4191 {
4192 block_cfg_valid = ((1u << 1) - 1) & static_cast<uint32_t>(value);
4193 return *this;
4194 }
4195 CONSTEXPR uint32_t get_trav_en() const
4196 {
4197 uint32_t value = static_cast<uint32_t>(trav_en);
4198 return value;
4199 }
4200 uint32_t get_trav_en() const volatile
4201 {
4202 uint32_t value = static_cast<uint32_t>(trav_en);
4203 return value;
4204 }
4205 CONSTEXPR mac_status_r &set_trav_en(uint32_t value)
4206 {
4207 trav_en = ((1u << 1) - 1) & static_cast<uint32_t>(value);
4208 return *this;
4209 }
4210 CONSTEXPR uint32_t get_wait_for_ib() const
4211 {
4212 uint32_t value = static_cast<uint32_t>(wait_for_ib);
4213 return value;
4214 }
4215 uint32_t get_wait_for_ib() const volatile
4216 {
4217 uint32_t value = static_cast<uint32_t>(wait_for_ib);
4218 return value;
4219 }
4220 CONSTEXPR mac_status_r &set_wait_for_ib(uint32_t value)
4221 {
4222 wait_for_ib = ((1u << 1) - 1) & static_cast<uint32_t>(value);
4223 return *this;
4224 }
4225 CONSTEXPR uint32_t get_wait_for_acc_buf() const
4226 {
4227 uint32_t value = static_cast<uint32_t>(wait_for_acc_buf);
4228 return value;
4229 }
4230 uint32_t get_wait_for_acc_buf() const volatile
4231 {
4232 uint32_t value = static_cast<uint32_t>(wait_for_acc_buf);
4233 return value;
4234 }
4235 CONSTEXPR mac_status_r &set_wait_for_acc_buf(uint32_t value)
4236 {
4237 wait_for_acc_buf = ((1u << 1) - 1) & static_cast<uint32_t>(value);
4238 return *this;
4239 }
4240 CONSTEXPR uint32_t get_wait_for_weights() const
4241 {
4242 uint32_t value = static_cast<uint32_t>(wait_for_weights);
4243 return value;
4244 }
4245 uint32_t get_wait_for_weights() const volatile
4246 {
4247 uint32_t value = static_cast<uint32_t>(wait_for_weights);
4248 return value;
4249 }
4250 CONSTEXPR mac_status_r &set_wait_for_weights(uint32_t value)
4251 {
4252 wait_for_weights = ((1u << 1) - 1) & static_cast<uint32_t>(value);
4253 return *this;
4254 }
4255 CONSTEXPR uint32_t get_stall_stripe() const
4256 {
4257 uint32_t value = static_cast<uint32_t>(stall_stripe);
4258 return value;
4259 }
4260 uint32_t get_stall_stripe() const volatile
4261 {
4262 uint32_t value = static_cast<uint32_t>(stall_stripe);
4263 return value;
4264 }
4265 CONSTEXPR mac_status_r &set_stall_stripe(uint32_t value)
4266 {
4267 stall_stripe = ((1u << 1) - 1) & static_cast<uint32_t>(value);
4268 return *this;
4269 }
4270 CONSTEXPR uint32_t get_dw_sel() const
4271 {
4272 uint32_t value = static_cast<uint32_t>(dw_sel);
4273 return value;
4274 }
4275 uint32_t get_dw_sel() const volatile
4276 {
4277 uint32_t value = static_cast<uint32_t>(dw_sel);
4278 return value;
4279 }
4280 CONSTEXPR mac_status_r &set_dw_sel(uint32_t value)
4281 {
4282 dw_sel = ((1u << 1) - 1) & static_cast<uint32_t>(value);
4283 return *this;
4284 }
4285 CONSTEXPR uint32_t get_wait_for_dw0_ready() const
4286 {
4287 uint32_t value = static_cast<uint32_t>(wait_for_dw0_ready);
4288 return value;
4289 }
4290 uint32_t get_wait_for_dw0_ready() const volatile
4291 {
4292 uint32_t value = static_cast<uint32_t>(wait_for_dw0_ready);
4293 return value;
4294 }
4295 CONSTEXPR mac_status_r &set_wait_for_dw0_ready(uint32_t value)
4296 {
4297 wait_for_dw0_ready = ((1u << 1) - 1) & static_cast<uint32_t>(value);
4298 return *this;
4299 }
4300 CONSTEXPR uint32_t get_wait_for_dw1_ready() const
4301 {
4302 uint32_t value = static_cast<uint32_t>(wait_for_dw1_ready);
4303 return value;
4304 }
4305 uint32_t get_wait_for_dw1_ready() const volatile
4306 {
4307 uint32_t value = static_cast<uint32_t>(wait_for_dw1_ready);
4308 return value;
4309 }
4310 CONSTEXPR mac_status_r &set_wait_for_dw1_ready(uint32_t value)
4311 {
4312 wait_for_dw1_ready = ((1u << 1) - 1) & static_cast<uint32_t>(value);
4313 return *this;
4314 }
4315 CONSTEXPR uint32_t get_acc_buf_sel_ai() const
4316 {
4317 uint32_t value = static_cast<uint32_t>(acc_buf_sel_ai);
4318 return value;
4319 }
4320 uint32_t get_acc_buf_sel_ai() const volatile
4321 {
4322 uint32_t value = static_cast<uint32_t>(acc_buf_sel_ai);
4323 return value;
4324 }
4325 CONSTEXPR mac_status_r &set_acc_buf_sel_ai(uint32_t value)
4326 {
4327 acc_buf_sel_ai = ((1u << 1) - 1) & static_cast<uint32_t>(value);
4328 return *this;
4329 }
4330 CONSTEXPR uint32_t get_wait_for_acc0_ready() const
4331 {
4332 uint32_t value = static_cast<uint32_t>(wait_for_acc0_ready);
4333 return value;
4334 }
4335 uint32_t get_wait_for_acc0_ready() const volatile
4336 {
4337 uint32_t value = static_cast<uint32_t>(wait_for_acc0_ready);
4338 return value;
4339 }
4340 CONSTEXPR mac_status_r &set_wait_for_acc0_ready(uint32_t value)
4341 {
4342 wait_for_acc0_ready = ((1u << 1) - 1) & static_cast<uint32_t>(value);
4343 return *this;
4344 }
4345 CONSTEXPR uint32_t get_wait_for_acc1_ready() const
4346 {
4347 uint32_t value = static_cast<uint32_t>(wait_for_acc1_ready);
4348 return value;
4349 }
4350 uint32_t get_wait_for_acc1_ready() const volatile
4351 {
4352 uint32_t value = static_cast<uint32_t>(wait_for_acc1_ready);
4353 return value;
4354 }
4355 CONSTEXPR mac_status_r &set_wait_for_acc1_ready(uint32_t value)
4356 {
4357 wait_for_acc1_ready = ((1u << 1) - 1) & static_cast<uint32_t>(value);
4358 return *this;
4359 }
4360 CONSTEXPR uint32_t get_acc_buf_sel_aa() const
4361 {
4362 uint32_t value = static_cast<uint32_t>(acc_buf_sel_aa);
4363 return value;
4364 }
4365 uint32_t get_acc_buf_sel_aa() const volatile
4366 {
4367 uint32_t value = static_cast<uint32_t>(acc_buf_sel_aa);
4368 return value;
4369 }
4370 CONSTEXPR mac_status_r &set_acc_buf_sel_aa(uint32_t value)
4371 {
4372 acc_buf_sel_aa = ((1u << 1) - 1) & static_cast<uint32_t>(value);
4373 return *this;
4374 }
4375 CONSTEXPR uint32_t get_acc0_valid() const
4376 {
4377 uint32_t value = static_cast<uint32_t>(acc0_valid);
4378 return value;
4379 }
4380 uint32_t get_acc0_valid() const volatile
4381 {
4382 uint32_t value = static_cast<uint32_t>(acc0_valid);
4383 return value;
4384 }
4385 CONSTEXPR mac_status_r &set_acc0_valid(uint32_t value)
4386 {
4387 acc0_valid = ((1u << 1) - 1) & static_cast<uint32_t>(value);
4388 return *this;
4389 }
4390 CONSTEXPR uint32_t get_acc1_valid() const
4391 {
4392 uint32_t value = static_cast<uint32_t>(acc1_valid);
4393 return value;
4394 }
4395 uint32_t get_acc1_valid() const volatile
4396 {
4397 uint32_t value = static_cast<uint32_t>(acc1_valid);
4398 return value;
4399 }
4400 CONSTEXPR mac_status_r &set_acc1_valid(uint32_t value)
4401 {
4402 acc1_valid = ((1u << 1) - 1) & static_cast<uint32_t>(value);
4403 return *this;
4404 }
4405 CONSTEXPR uint32_t get_events() const
4406 {
4407 uint32_t value = static_cast<uint32_t>(events);
4408 return value;
4409 }
4410 uint32_t get_events() const volatile
4411 {
4412 uint32_t value = static_cast<uint32_t>(events);
4413 return value;
4414 }
4415 CONSTEXPR mac_status_r &set_events(uint32_t value)
4416 {
4417 events = ((1u << 11) - 1) & static_cast<uint32_t>(value);
4418 return *this;
4419 }
4420#endif //__cplusplus
4421};
4422
4423// ao_status_r - AO_STATUS of core DEBUGCORE
4424struct ao_status_r
4425{
4426#ifdef __cplusplus
4427 private:
4428#endif //__cplusplus
4429 union
4430 {
4431 struct
4432 {
4433 uint32_t cmd_sbw_valid : 1; // Block command to shared buffer write module is valid.
4434 uint32_t cmd_act_valid : 1; // Block command to activation function module is valid.
4435 uint32_t cmd_ctl_valid : 1; // Block command to control module is valid.
4436 uint32_t cmd_scl_valid : 1; // Block command to scale module is valid.
4437 uint32_t cmd_sbr_valid : 1; // Block command to shared buffer read module is valid.
4438 uint32_t cmd_ofm_valid : 1; // Block command to ofm parameter module is valid.
4439 uint32_t blk_cmd_ready : 1; // Ready to accept block command.
4440 uint32_t blk_cmd_valid : 1; // Block command from CC is valid.
4441 uint32_t reserved0 : 8;
4442 uint32_t events : 8; // Mapped to AO events described in Appendix A.
4443 uint32_t reserved1 : 8;
4444 };
4445 uint32_t word;
4446 };
4447#ifdef __cplusplus
4448 public:
4449 CONSTEXPR ao_status_r() :
4450 cmd_sbw_valid(static_cast<uint32_t>(0)), cmd_act_valid(static_cast<uint32_t>(0)),
4451 cmd_ctl_valid(static_cast<uint32_t>(0)), cmd_scl_valid(static_cast<uint32_t>(0)),
4452 cmd_sbr_valid(static_cast<uint32_t>(0)), cmd_ofm_valid(static_cast<uint32_t>(0)),
4453 blk_cmd_ready(static_cast<uint32_t>(0)), blk_cmd_valid(static_cast<uint32_t>(0)),
4454 reserved0(static_cast<uint32_t>(0)), events(static_cast<uint32_t>(0)), reserved1(static_cast<uint32_t>(0))
4455 {
4456 }
4457 CONSTEXPR ao_status_r(uint32_t init) : word(init) {}
4458 CONSTEXPR void operator=(uint32_t value)
4459 {
4460 word = value;
4461 }
4462 void operator=(uint32_t value) volatile
4463 {
4464 word = value;
4465 }
4466 CONSTEXPR operator uint32_t()
4467 {
4468 return word;
4469 }
4470 operator uint32_t() volatile
4471 {
4472 return word;
4473 }
4474 ao_status_r copy() volatile
4475 {
4476 return *this;
4477 }
4478 CONSTEXPR uint32_t get_cmd_sbw_valid() const
4479 {
4480 uint32_t value = static_cast<uint32_t>(cmd_sbw_valid);
4481 return value;
4482 }
4483 uint32_t get_cmd_sbw_valid() const volatile
4484 {
4485 uint32_t value = static_cast<uint32_t>(cmd_sbw_valid);
4486 return value;
4487 }
4488 CONSTEXPR ao_status_r &set_cmd_sbw_valid(uint32_t value)
4489 {
4490 cmd_sbw_valid = ((1u << 1) - 1) & static_cast<uint32_t>(value);
4491 return *this;
4492 }
4493 CONSTEXPR uint32_t get_cmd_act_valid() const
4494 {
4495 uint32_t value = static_cast<uint32_t>(cmd_act_valid);
4496 return value;
4497 }
4498 uint32_t get_cmd_act_valid() const volatile
4499 {
4500 uint32_t value = static_cast<uint32_t>(cmd_act_valid);
4501 return value;
4502 }
4503 CONSTEXPR ao_status_r &set_cmd_act_valid(uint32_t value)
4504 {
4505 cmd_act_valid = ((1u << 1) - 1) & static_cast<uint32_t>(value);
4506 return *this;
4507 }
4508 CONSTEXPR uint32_t get_cmd_ctl_valid() const
4509 {
4510 uint32_t value = static_cast<uint32_t>(cmd_ctl_valid);
4511 return value;
4512 }
4513 uint32_t get_cmd_ctl_valid() const volatile
4514 {
4515 uint32_t value = static_cast<uint32_t>(cmd_ctl_valid);
4516 return value;
4517 }
4518 CONSTEXPR ao_status_r &set_cmd_ctl_valid(uint32_t value)
4519 {
4520 cmd_ctl_valid = ((1u << 1) - 1) & static_cast<uint32_t>(value);
4521 return *this;
4522 }
4523 CONSTEXPR uint32_t get_cmd_scl_valid() const
4524 {
4525 uint32_t value = static_cast<uint32_t>(cmd_scl_valid);
4526 return value;
4527 }
4528 uint32_t get_cmd_scl_valid() const volatile
4529 {
4530 uint32_t value = static_cast<uint32_t>(cmd_scl_valid);
4531 return value;
4532 }
4533 CONSTEXPR ao_status_r &set_cmd_scl_valid(uint32_t value)
4534 {
4535 cmd_scl_valid = ((1u << 1) - 1) & static_cast<uint32_t>(value);
4536 return *this;
4537 }
4538 CONSTEXPR uint32_t get_cmd_sbr_valid() const
4539 {
4540 uint32_t value = static_cast<uint32_t>(cmd_sbr_valid);
4541 return value;
4542 }
4543 uint32_t get_cmd_sbr_valid() const volatile
4544 {
4545 uint32_t value = static_cast<uint32_t>(cmd_sbr_valid);
4546 return value;
4547 }
4548 CONSTEXPR ao_status_r &set_cmd_sbr_valid(uint32_t value)
4549 {
4550 cmd_sbr_valid = ((1u << 1) - 1) & static_cast<uint32_t>(value);
4551 return *this;
4552 }
4553 CONSTEXPR uint32_t get_cmd_ofm_valid() const
4554 {
4555 uint32_t value = static_cast<uint32_t>(cmd_ofm_valid);
4556 return value;
4557 }
4558 uint32_t get_cmd_ofm_valid() const volatile
4559 {
4560 uint32_t value = static_cast<uint32_t>(cmd_ofm_valid);
4561 return value;
4562 }
4563 CONSTEXPR ao_status_r &set_cmd_ofm_valid(uint32_t value)
4564 {
4565 cmd_ofm_valid = ((1u << 1) - 1) & static_cast<uint32_t>(value);
4566 return *this;
4567 }
4568 CONSTEXPR uint32_t get_blk_cmd_ready() const
4569 {
4570 uint32_t value = static_cast<uint32_t>(blk_cmd_ready);
4571 return value;
4572 }
4573 uint32_t get_blk_cmd_ready() const volatile
4574 {
4575 uint32_t value = static_cast<uint32_t>(blk_cmd_ready);
4576 return value;
4577 }
4578 CONSTEXPR ao_status_r &set_blk_cmd_ready(uint32_t value)
4579 {
4580 blk_cmd_ready = ((1u << 1) - 1) & static_cast<uint32_t>(value);
4581 return *this;
4582 }
4583 CONSTEXPR uint32_t get_blk_cmd_valid() const
4584 {
4585 uint32_t value = static_cast<uint32_t>(blk_cmd_valid);
4586 return value;
4587 }
4588 uint32_t get_blk_cmd_valid() const volatile
4589 {
4590 uint32_t value = static_cast<uint32_t>(blk_cmd_valid);
4591 return value;
4592 }
4593 CONSTEXPR ao_status_r &set_blk_cmd_valid(uint32_t value)
4594 {
4595 blk_cmd_valid = ((1u << 1) - 1) & static_cast<uint32_t>(value);
4596 return *this;
4597 }
4598 CONSTEXPR uint32_t get_events() const
4599 {
4600 uint32_t value = static_cast<uint32_t>(events);
4601 return value;
4602 }
4603 uint32_t get_events() const volatile
4604 {
4605 uint32_t value = static_cast<uint32_t>(events);
4606 return value;
4607 }
4608 CONSTEXPR ao_status_r &set_events(uint32_t value)
4609 {
4610 events = ((1u << 8) - 1) & static_cast<uint32_t>(value);
4611 return *this;
4612 }
4613#endif //__cplusplus
4614};
4615
4616// dma_status0_r - DMA_STATUS0 of core DEBUGCORE
4617struct dma_status0_r
4618{
4619#ifdef __cplusplus
4620 private:
4621#endif //__cplusplus
4622 union
4623 {
4624 struct
4625 {
4626 uint32_t CMD_IDLE : 1; // When this bit is high means that the CMD block is not busy in generating addresses
4627 // for a CMD job.
4628 uint32_t IFM_IDLE : 1; // When this bit is high means that there are no ongoing IFM jobs
4629 uint32_t WGT_IDLE_C0 : 1; // When this bit is high means that the WGT block is not busy in generating
4630 // addresses for a WGT job
4631 uint32_t BAS_IDLE_C0 : 1; // When this bit is high means that the BAS block is not busy in generating
4632 // addresses for a BAS job
4633 uint32_t M2M_IDLE : 1; // When this bit is high means that there are no ongoing M2M jobs
4634 uint32_t OFM_IDLE : 1; // When this bit is high means that there are no ongoing OFM jobs
4635 uint32_t HALT_REQ : 1; // CPM has requested to HALT AXI bus before soft reset
4636 uint32_t HALT_ACK : 1; // DMA is in condition to halt the AXI bus since there are no pending transactions
4637 uint32_t PAUSE_REQ : 1; // CC has requested to pause the AXI
4638 uint32_t PAUSE_ACK : 1; // DMA is in condition to pause the AXI bus since there are no pending transactions
4639 uint32_t IB0_AI_VALID_C0 : 1; // Data for AI to be read in IFM input buffer 0 - Core 0
4640 uint32_t IB0_AI_READY_C0 : 1; // Data consumed from AI in IFM input buffer 0 - Core 0
4641 uint32_t IB1_AI_VALID_C0 : 1; // Data for AI to be read in IFM input buffer 1 - Core 0
4642 uint32_t IB1_AI_READY_C0 : 1; // Data consumed from AI in IFM input buffer 1 - Core 0
4643 uint32_t IB0_AO_VALID_C0 : 1; // Data for AO to be read in IFM input buffer 0 - Core 0
4644 uint32_t IB0_AO_READY_C0 : 1; // Data consumed from AO in IFM input buffer 0 - Core 0
4645 uint32_t IB1_AO_VALID_C0 : 1; // Data for AO to be read in IFM input buffer 0 - Core 0
4646 uint32_t IB1_AO_READY_C0 : 1; // Data consumed from AO in IFM input buffer 1 - Core 0
4647 uint32_t OB0_VALID_C0 : 1; // Data for DMA ready to be consumed in OFM output buffer 0 - Core 0
4648 uint32_t OB0_READY_C0 : 1; // Data consumed from DMA in OFM output buffer 0 - Core 0
4649 uint32_t OB1_VALID_C0 : 1; // Data for DMA ready to be consumed in OFM output buffer 1 - Core 0
4650 uint32_t OB1_READY_C0 : 1; // Data consumed from DMA in OFM output buffer 1 - Core 0
4651 uint32_t CMD_VALID : 1; // New command word for CC to be consumed
4652 uint32_t CMD_READY : 1; // command word consumed by CC
4653 uint32_t WD_BITSTREAM_VALID_C0 : 1; // New weight word for WD to be consumed - Core 0
4654 uint32_t WD_BITSTREAM_READY_C0 : 1; // Weight word consumed by WD - Core 0
4655 uint32_t BS_BITSTREAM_VALID_C0 : 1; // New BaS word for AO to be consumed - Core 0
4656 uint32_t BS_BITSTREAM_READY_C0 : 1; // BaS word consumed by AO - Core 0
4657 uint32_t AXI0_AR_STALLED : 1; // Read transfer request stalled on arready low AXI0 (due to memory system)
4658 uint32_t AXI0_RD_LIMIT_STALL : 1; // Read stalled due to one AXI0 limit counter being reached
4659 uint32_t AXI0_AW_STALLED : 1; // Write transfer request stalled on awready low AXI0 (due to memory system)
4660 uint32_t AXI0_W_STALLED : 1; // Write transfer stalled on awready low AXI0 (due to memory system)
4661 };
4662 uint32_t word;
4663 };
4664#ifdef __cplusplus
4665 public:
4666 CONSTEXPR dma_status0_r() :
4667 CMD_IDLE(static_cast<uint32_t>(0)), IFM_IDLE(static_cast<uint32_t>(0)), WGT_IDLE_C0(static_cast<uint32_t>(0)),
4668 BAS_IDLE_C0(static_cast<uint32_t>(0)), M2M_IDLE(static_cast<uint32_t>(0)), OFM_IDLE(static_cast<uint32_t>(0)),
4669 HALT_REQ(static_cast<uint32_t>(0)), HALT_ACK(static_cast<uint32_t>(0)), PAUSE_REQ(static_cast<uint32_t>(0)),
4670 PAUSE_ACK(static_cast<uint32_t>(0)), IB0_AI_VALID_C0(static_cast<uint32_t>(0)),
4671 IB0_AI_READY_C0(static_cast<uint32_t>(0)), IB1_AI_VALID_C0(static_cast<uint32_t>(0)),
4672 IB1_AI_READY_C0(static_cast<uint32_t>(0)), IB0_AO_VALID_C0(static_cast<uint32_t>(0)),
4673 IB0_AO_READY_C0(static_cast<uint32_t>(0)), IB1_AO_VALID_C0(static_cast<uint32_t>(0)),
4674 IB1_AO_READY_C0(static_cast<uint32_t>(0)), OB0_VALID_C0(static_cast<uint32_t>(0)),
4675 OB0_READY_C0(static_cast<uint32_t>(0)), OB1_VALID_C0(static_cast<uint32_t>(0)),
4676 OB1_READY_C0(static_cast<uint32_t>(0)), CMD_VALID(static_cast<uint32_t>(0)),
4677 CMD_READY(static_cast<uint32_t>(0)), WD_BITSTREAM_VALID_C0(static_cast<uint32_t>(0)),
4678 WD_BITSTREAM_READY_C0(static_cast<uint32_t>(0)), BS_BITSTREAM_VALID_C0(static_cast<uint32_t>(0)),
4679 BS_BITSTREAM_READY_C0(static_cast<uint32_t>(0)), AXI0_AR_STALLED(static_cast<uint32_t>(0)),
4680 AXI0_RD_LIMIT_STALL(static_cast<uint32_t>(0)), AXI0_AW_STALLED(static_cast<uint32_t>(0)),
4681 AXI0_W_STALLED(static_cast<uint32_t>(0))
4682 {
4683 }
4684 CONSTEXPR dma_status0_r(uint32_t init) : word(init) {}
4685 CONSTEXPR void operator=(uint32_t value)
4686 {
4687 word = value;
4688 }
4689 void operator=(uint32_t value) volatile
4690 {
4691 word = value;
4692 }
4693 CONSTEXPR operator uint32_t()
4694 {
4695 return word;
4696 }
4697 operator uint32_t() volatile
4698 {
4699 return word;
4700 }
4701 dma_status0_r copy() volatile
4702 {
4703 return *this;
4704 }
4705 CONSTEXPR uint32_t get_CMD_IDLE() const
4706 {
4707 uint32_t value = static_cast<uint32_t>(CMD_IDLE);
4708 return value;
4709 }
4710 uint32_t get_CMD_IDLE() const volatile
4711 {
4712 uint32_t value = static_cast<uint32_t>(CMD_IDLE);
4713 return value;
4714 }
4715 CONSTEXPR dma_status0_r &set_CMD_IDLE(uint32_t value)
4716 {
4717 CMD_IDLE = ((1u << 1) - 1) & static_cast<uint32_t>(value);
4718 return *this;
4719 }
4720 CONSTEXPR uint32_t get_IFM_IDLE() const
4721 {
4722 uint32_t value = static_cast<uint32_t>(IFM_IDLE);
4723 return value;
4724 }
4725 uint32_t get_IFM_IDLE() const volatile
4726 {
4727 uint32_t value = static_cast<uint32_t>(IFM_IDLE);
4728 return value;
4729 }
4730 CONSTEXPR dma_status0_r &set_IFM_IDLE(uint32_t value)
4731 {
4732 IFM_IDLE = ((1u << 1) - 1) & static_cast<uint32_t>(value);
4733 return *this;
4734 }
4735 CONSTEXPR uint32_t get_WGT_IDLE_C0() const
4736 {
4737 uint32_t value = static_cast<uint32_t>(WGT_IDLE_C0);
4738 return value;
4739 }
4740 uint32_t get_WGT_IDLE_C0() const volatile
4741 {
4742 uint32_t value = static_cast<uint32_t>(WGT_IDLE_C0);
4743 return value;
4744 }
4745 CONSTEXPR dma_status0_r &set_WGT_IDLE_C0(uint32_t value)
4746 {
4747 WGT_IDLE_C0 = ((1u << 1) - 1) & static_cast<uint32_t>(value);
4748 return *this;
4749 }
4750 CONSTEXPR uint32_t get_BAS_IDLE_C0() const
4751 {
4752 uint32_t value = static_cast<uint32_t>(BAS_IDLE_C0);
4753 return value;
4754 }
4755 uint32_t get_BAS_IDLE_C0() const volatile
4756 {
4757 uint32_t value = static_cast<uint32_t>(BAS_IDLE_C0);
4758 return value;
4759 }
4760 CONSTEXPR dma_status0_r &set_BAS_IDLE_C0(uint32_t value)
4761 {
4762 BAS_IDLE_C0 = ((1u << 1) - 1) & static_cast<uint32_t>(value);
4763 return *this;
4764 }
4765 CONSTEXPR uint32_t get_M2M_IDLE() const
4766 {
4767 uint32_t value = static_cast<uint32_t>(M2M_IDLE);
4768 return value;
4769 }
4770 uint32_t get_M2M_IDLE() const volatile
4771 {
4772 uint32_t value = static_cast<uint32_t>(M2M_IDLE);
4773 return value;
4774 }
4775 CONSTEXPR dma_status0_r &set_M2M_IDLE(uint32_t value)
4776 {
4777 M2M_IDLE = ((1u << 1) - 1) & static_cast<uint32_t>(value);
4778 return *this;
4779 }
4780 CONSTEXPR uint32_t get_OFM_IDLE() const
4781 {
4782 uint32_t value = static_cast<uint32_t>(OFM_IDLE);
4783 return value;
4784 }
4785 uint32_t get_OFM_IDLE() const volatile
4786 {
4787 uint32_t value = static_cast<uint32_t>(OFM_IDLE);
4788 return value;
4789 }
4790 CONSTEXPR dma_status0_r &set_OFM_IDLE(uint32_t value)
4791 {
4792 OFM_IDLE = ((1u << 1) - 1) & static_cast<uint32_t>(value);
4793 return *this;
4794 }
4795 CONSTEXPR uint32_t get_HALT_REQ() const
4796 {
4797 uint32_t value = static_cast<uint32_t>(HALT_REQ);
4798 return value;
4799 }
4800 uint32_t get_HALT_REQ() const volatile
4801 {
4802 uint32_t value = static_cast<uint32_t>(HALT_REQ);
4803 return value;
4804 }
4805 CONSTEXPR dma_status0_r &set_HALT_REQ(uint32_t value)
4806 {
4807 HALT_REQ = ((1u << 1) - 1) & static_cast<uint32_t>(value);
4808 return *this;
4809 }
4810 CONSTEXPR uint32_t get_HALT_ACK() const
4811 {
4812 uint32_t value = static_cast<uint32_t>(HALT_ACK);
4813 return value;
4814 }
4815 uint32_t get_HALT_ACK() const volatile
4816 {
4817 uint32_t value = static_cast<uint32_t>(HALT_ACK);
4818 return value;
4819 }
4820 CONSTEXPR dma_status0_r &set_HALT_ACK(uint32_t value)
4821 {
4822 HALT_ACK = ((1u << 1) - 1) & static_cast<uint32_t>(value);
4823 return *this;
4824 }
4825 CONSTEXPR uint32_t get_PAUSE_REQ() const
4826 {
4827 uint32_t value = static_cast<uint32_t>(PAUSE_REQ);
4828 return value;
4829 }
4830 uint32_t get_PAUSE_REQ() const volatile
4831 {
4832 uint32_t value = static_cast<uint32_t>(PAUSE_REQ);
4833 return value;
4834 }
4835 CONSTEXPR dma_status0_r &set_PAUSE_REQ(uint32_t value)
4836 {
4837 PAUSE_REQ = ((1u << 1) - 1) & static_cast<uint32_t>(value);
4838 return *this;
4839 }
4840 CONSTEXPR uint32_t get_PAUSE_ACK() const
4841 {
4842 uint32_t value = static_cast<uint32_t>(PAUSE_ACK);
4843 return value;
4844 }
4845 uint32_t get_PAUSE_ACK() const volatile
4846 {
4847 uint32_t value = static_cast<uint32_t>(PAUSE_ACK);
4848 return value;
4849 }
4850 CONSTEXPR dma_status0_r &set_PAUSE_ACK(uint32_t value)
4851 {
4852 PAUSE_ACK = ((1u << 1) - 1) & static_cast<uint32_t>(value);
4853 return *this;
4854 }
4855 CONSTEXPR uint32_t get_IB0_AI_VALID_C0() const
4856 {
4857 uint32_t value = static_cast<uint32_t>(IB0_AI_VALID_C0);
4858 return value;
4859 }
4860 uint32_t get_IB0_AI_VALID_C0() const volatile
4861 {
4862 uint32_t value = static_cast<uint32_t>(IB0_AI_VALID_C0);
4863 return value;
4864 }
4865 CONSTEXPR dma_status0_r &set_IB0_AI_VALID_C0(uint32_t value)
4866 {
4867 IB0_AI_VALID_C0 = ((1u << 1) - 1) & static_cast<uint32_t>(value);
4868 return *this;
4869 }
4870 CONSTEXPR uint32_t get_IB0_AI_READY_C0() const
4871 {
4872 uint32_t value = static_cast<uint32_t>(IB0_AI_READY_C0);
4873 return value;
4874 }
4875 uint32_t get_IB0_AI_READY_C0() const volatile
4876 {
4877 uint32_t value = static_cast<uint32_t>(IB0_AI_READY_C0);
4878 return value;
4879 }
4880 CONSTEXPR dma_status0_r &set_IB0_AI_READY_C0(uint32_t value)
4881 {
4882 IB0_AI_READY_C0 = ((1u << 1) - 1) & static_cast<uint32_t>(value);
4883 return *this;
4884 }
4885 CONSTEXPR uint32_t get_IB1_AI_VALID_C0() const
4886 {
4887 uint32_t value = static_cast<uint32_t>(IB1_AI_VALID_C0);
4888 return value;
4889 }
4890 uint32_t get_IB1_AI_VALID_C0() const volatile
4891 {
4892 uint32_t value = static_cast<uint32_t>(IB1_AI_VALID_C0);
4893 return value;
4894 }
4895 CONSTEXPR dma_status0_r &set_IB1_AI_VALID_C0(uint32_t value)
4896 {
4897 IB1_AI_VALID_C0 = ((1u << 1) - 1) & static_cast<uint32_t>(value);
4898 return *this;
4899 }
4900 CONSTEXPR uint32_t get_IB1_AI_READY_C0() const
4901 {
4902 uint32_t value = static_cast<uint32_t>(IB1_AI_READY_C0);
4903 return value;
4904 }
4905 uint32_t get_IB1_AI_READY_C0() const volatile
4906 {
4907 uint32_t value = static_cast<uint32_t>(IB1_AI_READY_C0);
4908 return value;
4909 }
4910 CONSTEXPR dma_status0_r &set_IB1_AI_READY_C0(uint32_t value)
4911 {
4912 IB1_AI_READY_C0 = ((1u << 1) - 1) & static_cast<uint32_t>(value);
4913 return *this;
4914 }
4915 CONSTEXPR uint32_t get_IB0_AO_VALID_C0() const
4916 {
4917 uint32_t value = static_cast<uint32_t>(IB0_AO_VALID_C0);
4918 return value;
4919 }
4920 uint32_t get_IB0_AO_VALID_C0() const volatile
4921 {
4922 uint32_t value = static_cast<uint32_t>(IB0_AO_VALID_C0);
4923 return value;
4924 }
4925 CONSTEXPR dma_status0_r &set_IB0_AO_VALID_C0(uint32_t value)
4926 {
4927 IB0_AO_VALID_C0 = ((1u << 1) - 1) & static_cast<uint32_t>(value);
4928 return *this;
4929 }
4930 CONSTEXPR uint32_t get_IB0_AO_READY_C0() const
4931 {
4932 uint32_t value = static_cast<uint32_t>(IB0_AO_READY_C0);
4933 return value;
4934 }
4935 uint32_t get_IB0_AO_READY_C0() const volatile
4936 {
4937 uint32_t value = static_cast<uint32_t>(IB0_AO_READY_C0);
4938 return value;
4939 }
4940 CONSTEXPR dma_status0_r &set_IB0_AO_READY_C0(uint32_t value)
4941 {
4942 IB0_AO_READY_C0 = ((1u << 1) - 1) & static_cast<uint32_t>(value);
4943 return *this;
4944 }
4945 CONSTEXPR uint32_t get_IB1_AO_VALID_C0() const
4946 {
4947 uint32_t value = static_cast<uint32_t>(IB1_AO_VALID_C0);
4948 return value;
4949 }
4950 uint32_t get_IB1_AO_VALID_C0() const volatile
4951 {
4952 uint32_t value = static_cast<uint32_t>(IB1_AO_VALID_C0);
4953 return value;
4954 }
4955 CONSTEXPR dma_status0_r &set_IB1_AO_VALID_C0(uint32_t value)
4956 {
4957 IB1_AO_VALID_C0 = ((1u << 1) - 1) & static_cast<uint32_t>(value);
4958 return *this;
4959 }
4960 CONSTEXPR uint32_t get_IB1_AO_READY_C0() const
4961 {
4962 uint32_t value = static_cast<uint32_t>(IB1_AO_READY_C0);
4963 return value;
4964 }
4965 uint32_t get_IB1_AO_READY_C0() const volatile
4966 {
4967 uint32_t value = static_cast<uint32_t>(IB1_AO_READY_C0);
4968 return value;
4969 }
4970 CONSTEXPR dma_status0_r &set_IB1_AO_READY_C0(uint32_t value)
4971 {
4972 IB1_AO_READY_C0 = ((1u << 1) - 1) & static_cast<uint32_t>(value);
4973 return *this;
4974 }
4975 CONSTEXPR uint32_t get_OB0_VALID_C0() const
4976 {
4977 uint32_t value = static_cast<uint32_t>(OB0_VALID_C0);
4978 return value;
4979 }
4980 uint32_t get_OB0_VALID_C0() const volatile
4981 {
4982 uint32_t value = static_cast<uint32_t>(OB0_VALID_C0);
4983 return value;
4984 }
4985 CONSTEXPR dma_status0_r &set_OB0_VALID_C0(uint32_t value)
4986 {
4987 OB0_VALID_C0 = ((1u << 1) - 1) & static_cast<uint32_t>(value);
4988 return *this;
4989 }
4990 CONSTEXPR uint32_t get_OB0_READY_C0() const
4991 {
4992 uint32_t value = static_cast<uint32_t>(OB0_READY_C0);
4993 return value;
4994 }
4995 uint32_t get_OB0_READY_C0() const volatile
4996 {
4997 uint32_t value = static_cast<uint32_t>(OB0_READY_C0);
4998 return value;
4999 }
5000 CONSTEXPR dma_status0_r &set_OB0_READY_C0(uint32_t value)
5001 {
5002 OB0_READY_C0 = ((1u << 1) - 1) & static_cast<uint32_t>(value);
5003 return *this;
5004 }
5005 CONSTEXPR uint32_t get_OB1_VALID_C0() const
5006 {
5007 uint32_t value = static_cast<uint32_t>(OB1_VALID_C0);
5008 return value;
5009 }
5010 uint32_t get_OB1_VALID_C0() const volatile
5011 {
5012 uint32_t value = static_cast<uint32_t>(OB1_VALID_C0);
5013 return value;
5014 }
5015 CONSTEXPR dma_status0_r &set_OB1_VALID_C0(uint32_t value)
5016 {
5017 OB1_VALID_C0 = ((1u << 1) - 1) & static_cast<uint32_t>(value);
5018 return *this;
5019 }
5020 CONSTEXPR uint32_t get_OB1_READY_C0() const
5021 {
5022 uint32_t value = static_cast<uint32_t>(OB1_READY_C0);
5023 return value;
5024 }
5025 uint32_t get_OB1_READY_C0() const volatile
5026 {
5027 uint32_t value = static_cast<uint32_t>(OB1_READY_C0);
5028 return value;
5029 }
5030 CONSTEXPR dma_status0_r &set_OB1_READY_C0(uint32_t value)
5031 {
5032 OB1_READY_C0 = ((1u << 1) - 1) & static_cast<uint32_t>(value);
5033 return *this;
5034 }
5035 CONSTEXPR uint32_t get_CMD_VALID() const
5036 {
5037 uint32_t value = static_cast<uint32_t>(CMD_VALID);
5038 return value;
5039 }
5040 uint32_t get_CMD_VALID() const volatile
5041 {
5042 uint32_t value = static_cast<uint32_t>(CMD_VALID);
5043 return value;
5044 }
5045 CONSTEXPR dma_status0_r &set_CMD_VALID(uint32_t value)
5046 {
5047 CMD_VALID = ((1u << 1) - 1) & static_cast<uint32_t>(value);
5048 return *this;
5049 }
5050 CONSTEXPR uint32_t get_CMD_READY() const
5051 {
5052 uint32_t value = static_cast<uint32_t>(CMD_READY);
5053 return value;
5054 }
5055 uint32_t get_CMD_READY() const volatile
5056 {
5057 uint32_t value = static_cast<uint32_t>(CMD_READY);
5058 return value;
5059 }
5060 CONSTEXPR dma_status0_r &set_CMD_READY(uint32_t value)
5061 {
5062 CMD_READY = ((1u << 1) - 1) & static_cast<uint32_t>(value);
5063 return *this;
5064 }
5065 CONSTEXPR uint32_t get_WD_BITSTREAM_VALID_C0() const
5066 {
5067 uint32_t value = static_cast<uint32_t>(WD_BITSTREAM_VALID_C0);
5068 return value;
5069 }
5070 uint32_t get_WD_BITSTREAM_VALID_C0() const volatile
5071 {
5072 uint32_t value = static_cast<uint32_t>(WD_BITSTREAM_VALID_C0);
5073 return value;
5074 }
5075 CONSTEXPR dma_status0_r &set_WD_BITSTREAM_VALID_C0(uint32_t value)
5076 {
5077 WD_BITSTREAM_VALID_C0 = ((1u << 1) - 1) & static_cast<uint32_t>(value);
5078 return *this;
5079 }
5080 CONSTEXPR uint32_t get_WD_BITSTREAM_READY_C0() const
5081 {
5082 uint32_t value = static_cast<uint32_t>(WD_BITSTREAM_READY_C0);
5083 return value;
5084 }
5085 uint32_t get_WD_BITSTREAM_READY_C0() const volatile
5086 {
5087 uint32_t value = static_cast<uint32_t>(WD_BITSTREAM_READY_C0);
5088 return value;
5089 }
5090 CONSTEXPR dma_status0_r &set_WD_BITSTREAM_READY_C0(uint32_t value)
5091 {
5092 WD_BITSTREAM_READY_C0 = ((1u << 1) - 1) & static_cast<uint32_t>(value);
5093 return *this;
5094 }
5095 CONSTEXPR uint32_t get_BS_BITSTREAM_VALID_C0() const
5096 {
5097 uint32_t value = static_cast<uint32_t>(BS_BITSTREAM_VALID_C0);
5098 return value;
5099 }
5100 uint32_t get_BS_BITSTREAM_VALID_C0() const volatile
5101 {
5102 uint32_t value = static_cast<uint32_t>(BS_BITSTREAM_VALID_C0);
5103 return value;
5104 }
5105 CONSTEXPR dma_status0_r &set_BS_BITSTREAM_VALID_C0(uint32_t value)
5106 {
5107 BS_BITSTREAM_VALID_C0 = ((1u << 1) - 1) & static_cast<uint32_t>(value);
5108 return *this;
5109 }
5110 CONSTEXPR uint32_t get_BS_BITSTREAM_READY_C0() const
5111 {
5112 uint32_t value = static_cast<uint32_t>(BS_BITSTREAM_READY_C0);
5113 return value;
5114 }
5115 uint32_t get_BS_BITSTREAM_READY_C0() const volatile
5116 {
5117 uint32_t value = static_cast<uint32_t>(BS_BITSTREAM_READY_C0);
5118 return value;
5119 }
5120 CONSTEXPR dma_status0_r &set_BS_BITSTREAM_READY_C0(uint32_t value)
5121 {
5122 BS_BITSTREAM_READY_C0 = ((1u << 1) - 1) & static_cast<uint32_t>(value);
5123 return *this;
5124 }
5125 CONSTEXPR uint32_t get_AXI0_AR_STALLED() const
5126 {
5127 uint32_t value = static_cast<uint32_t>(AXI0_AR_STALLED);
5128 return value;
5129 }
5130 uint32_t get_AXI0_AR_STALLED() const volatile
5131 {
5132 uint32_t value = static_cast<uint32_t>(AXI0_AR_STALLED);
5133 return value;
5134 }
5135 CONSTEXPR dma_status0_r &set_AXI0_AR_STALLED(uint32_t value)
5136 {
5137 AXI0_AR_STALLED = ((1u << 1) - 1) & static_cast<uint32_t>(value);
5138 return *this;
5139 }
5140 CONSTEXPR uint32_t get_AXI0_RD_LIMIT_STALL() const
5141 {
5142 uint32_t value = static_cast<uint32_t>(AXI0_RD_LIMIT_STALL);
5143 return value;
5144 }
5145 uint32_t get_AXI0_RD_LIMIT_STALL() const volatile
5146 {
5147 uint32_t value = static_cast<uint32_t>(AXI0_RD_LIMIT_STALL);
5148 return value;
5149 }
5150 CONSTEXPR dma_status0_r &set_AXI0_RD_LIMIT_STALL(uint32_t value)
5151 {
5152 AXI0_RD_LIMIT_STALL = ((1u << 1) - 1) & static_cast<uint32_t>(value);
5153 return *this;
5154 }
5155 CONSTEXPR uint32_t get_AXI0_AW_STALLED() const
5156 {
5157 uint32_t value = static_cast<uint32_t>(AXI0_AW_STALLED);
5158 return value;
5159 }
5160 uint32_t get_AXI0_AW_STALLED() const volatile
5161 {
5162 uint32_t value = static_cast<uint32_t>(AXI0_AW_STALLED);
5163 return value;
5164 }
5165 CONSTEXPR dma_status0_r &set_AXI0_AW_STALLED(uint32_t value)
5166 {
5167 AXI0_AW_STALLED = ((1u << 1) - 1) & static_cast<uint32_t>(value);
5168 return *this;
5169 }
5170 CONSTEXPR uint32_t get_AXI0_W_STALLED() const
5171 {
5172 uint32_t value = static_cast<uint32_t>(AXI0_W_STALLED);
5173 return value;
5174 }
5175 uint32_t get_AXI0_W_STALLED() const volatile
5176 {
5177 uint32_t value = static_cast<uint32_t>(AXI0_W_STALLED);
5178 return value;
5179 }
5180 CONSTEXPR dma_status0_r &set_AXI0_W_STALLED(uint32_t value)
5181 {
5182 AXI0_W_STALLED = ((1u << 1) - 1) & static_cast<uint32_t>(value);
5183 return *this;
5184 }
5185#endif //__cplusplus
5186};
5187
5188// dma_status1_r - DMA_STATUS1 of core DEBUGCORE
5189struct dma_status1_r
5190{
5191#ifdef __cplusplus
5192 private:
5193#endif //__cplusplus
5194 union
5195 {
5196 struct
5197 {
5198 uint32_t AXI0_WR_LIMIT_STALL : 1; // Write stalled due to one AXI0 limit counter being reached
5199 uint32_t AXI1_AR_STALLED : 1; // Read transfer request stalled on arready low AXI1 (due to memory system)
5200 uint32_t AXI1_RD_LIMIT_STALL : 1; // Read stalled due to one AXI1 limit counter being reached
5201 uint32_t AXI1_WR_STALLED : 1; // Write transfer request stalled on awready low AXI1 (due to memory system)
5202 uint32_t AXI1_W_STALLED : 1; // Write transfer stalled on wready low AXI1 (due to memory system)
5203 uint32_t AXI1_WR_LIMIT_STALL : 1; // Write stalled due to one AXI1 limit counter being reached
5204 uint32_t WGT_IDLE_C1 : 1; // When this bit is high means that the WGT block is not busy in generating
5205 // addresses for a WGT job
5206 uint32_t BAS_IDLE_C1 : 1; // When this bit is high means that the BAS block is not busy in generating
5207 // addresses for a BAS job.
5208 uint32_t IB0_AI_VALID_C1 : 1; // Data for AI to be read in IFM input buffer 0 - Core 1
5209 uint32_t IB0_AI_READY_C1 : 1; // Data consumed from AI in IFM input buffer 0 - Core 1
5210 uint32_t IB1_AI_VALID_C1 : 1; // Data for AI to be read in IFM input buffer 1 - Core 1
5211 uint32_t IB1_AI_READY_C1 : 1; // Data consumed from AI in IFM input buffer 1 - Core 1
5212 uint32_t IB0_AO_VALID_C1 : 1; // Data for AO to be read in IFM input buffer 0 - Core 1
5213 uint32_t IB0_AO_READY_C1 : 1; // Data consumed from AO in IFM input buffer 0 - Core 1
5214 uint32_t IB1_AO_VALID_C1 : 1; // Data for AO to be read in IFM input buffer 0 - Core 1
5215 uint32_t IB1_AO_READY_C1 : 1; // Data consumed from AO in IFM input buffer 1 - Core 1
5216 uint32_t OB0_VALID_C1 : 1; // Data for DMA ready to be consumed in OFM output buffer 0 - Core 1
5217 uint32_t OB0_READY_C1 : 1; // Data consumed from DMA in OFM output buffer 0 - Core 1
5218 uint32_t OB1_VALID_C1 : 1; // Data for DMA ready to be consumed in OFM output buffer 1 - Core 1
5219 uint32_t OB1_READY_C1 : 1; // Data consumed from DMA in OFM output buffer 1 - Core 1
5220 uint32_t WD_BITSTREAM_VALID_C1 : 1; // New weight word for WD to be consumed - Core 1
5221 uint32_t WD_BITSTREAM_READY_C1 : 1; // Weight word consumed by WD - Core 1
5222 uint32_t BS_BITSTREAM_VALID_C1 : 1; // New BaS word for AO to be consumed - Core 1
5223 uint32_t BS_BITSTREAM_READY_C1 : 1; // BaS word consumed by AO - Core 1
5224 uint32_t reserved0 : 8;
5225 };
5226 uint32_t word;
5227 };
5228#ifdef __cplusplus
5229 public:
5230 CONSTEXPR dma_status1_r() :
5231 AXI0_WR_LIMIT_STALL(static_cast<uint32_t>(0)), AXI1_AR_STALLED(static_cast<uint32_t>(0)),
5232 AXI1_RD_LIMIT_STALL(static_cast<uint32_t>(0)), AXI1_WR_STALLED(static_cast<uint32_t>(0)),
5233 AXI1_W_STALLED(static_cast<uint32_t>(0)), AXI1_WR_LIMIT_STALL(static_cast<uint32_t>(0)),
5234 WGT_IDLE_C1(static_cast<uint32_t>(0)), BAS_IDLE_C1(static_cast<uint32_t>(0)),
5235 IB0_AI_VALID_C1(static_cast<uint32_t>(0)), IB0_AI_READY_C1(static_cast<uint32_t>(0)),
5236 IB1_AI_VALID_C1(static_cast<uint32_t>(0)), IB1_AI_READY_C1(static_cast<uint32_t>(0)),
5237 IB0_AO_VALID_C1(static_cast<uint32_t>(0)), IB0_AO_READY_C1(static_cast<uint32_t>(0)),
5238 IB1_AO_VALID_C1(static_cast<uint32_t>(0)), IB1_AO_READY_C1(static_cast<uint32_t>(0)),
5239 OB0_VALID_C1(static_cast<uint32_t>(0)), OB0_READY_C1(static_cast<uint32_t>(0)),
5240 OB1_VALID_C1(static_cast<uint32_t>(0)), OB1_READY_C1(static_cast<uint32_t>(0)),
5241 WD_BITSTREAM_VALID_C1(static_cast<uint32_t>(0)), WD_BITSTREAM_READY_C1(static_cast<uint32_t>(0)),
5242 BS_BITSTREAM_VALID_C1(static_cast<uint32_t>(0)), BS_BITSTREAM_READY_C1(static_cast<uint32_t>(0)),
5243 reserved0(static_cast<uint32_t>(0))
5244 {
5245 }
5246 CONSTEXPR dma_status1_r(uint32_t init) : word(init) {}
5247 CONSTEXPR void operator=(uint32_t value)
5248 {
5249 word = value;
5250 }
5251 void operator=(uint32_t value) volatile
5252 {
5253 word = value;
5254 }
5255 CONSTEXPR operator uint32_t()
5256 {
5257 return word;
5258 }
5259 operator uint32_t() volatile
5260 {
5261 return word;
5262 }
5263 dma_status1_r copy() volatile
5264 {
5265 return *this;
5266 }
5267 CONSTEXPR uint32_t get_AXI0_WR_LIMIT_STALL() const
5268 {
5269 uint32_t value = static_cast<uint32_t>(AXI0_WR_LIMIT_STALL);
5270 return value;
5271 }
5272 uint32_t get_AXI0_WR_LIMIT_STALL() const volatile
5273 {
5274 uint32_t value = static_cast<uint32_t>(AXI0_WR_LIMIT_STALL);
5275 return value;
5276 }
5277 CONSTEXPR dma_status1_r &set_AXI0_WR_LIMIT_STALL(uint32_t value)
5278 {
5279 AXI0_WR_LIMIT_STALL = ((1u << 1) - 1) & static_cast<uint32_t>(value);
5280 return *this;
5281 }
5282 CONSTEXPR uint32_t get_AXI1_AR_STALLED() const
5283 {
5284 uint32_t value = static_cast<uint32_t>(AXI1_AR_STALLED);
5285 return value;
5286 }
5287 uint32_t get_AXI1_AR_STALLED() const volatile
5288 {
5289 uint32_t value = static_cast<uint32_t>(AXI1_AR_STALLED);
5290 return value;
5291 }
5292 CONSTEXPR dma_status1_r &set_AXI1_AR_STALLED(uint32_t value)
5293 {
5294 AXI1_AR_STALLED = ((1u << 1) - 1) & static_cast<uint32_t>(value);
5295 return *this;
5296 }
5297 CONSTEXPR uint32_t get_AXI1_RD_LIMIT_STALL() const
5298 {
5299 uint32_t value = static_cast<uint32_t>(AXI1_RD_LIMIT_STALL);
5300 return value;
5301 }
5302 uint32_t get_AXI1_RD_LIMIT_STALL() const volatile
5303 {
5304 uint32_t value = static_cast<uint32_t>(AXI1_RD_LIMIT_STALL);
5305 return value;
5306 }
5307 CONSTEXPR dma_status1_r &set_AXI1_RD_LIMIT_STALL(uint32_t value)
5308 {
5309 AXI1_RD_LIMIT_STALL = ((1u << 1) - 1) & static_cast<uint32_t>(value);
5310 return *this;
5311 }
5312 CONSTEXPR uint32_t get_AXI1_WR_STALLED() const
5313 {
5314 uint32_t value = static_cast<uint32_t>(AXI1_WR_STALLED);
5315 return value;
5316 }
5317 uint32_t get_AXI1_WR_STALLED() const volatile
5318 {
5319 uint32_t value = static_cast<uint32_t>(AXI1_WR_STALLED);
5320 return value;
5321 }
5322 CONSTEXPR dma_status1_r &set_AXI1_WR_STALLED(uint32_t value)
5323 {
5324 AXI1_WR_STALLED = ((1u << 1) - 1) & static_cast<uint32_t>(value);
5325 return *this;
5326 }
5327 CONSTEXPR uint32_t get_AXI1_W_STALLED() const
5328 {
5329 uint32_t value = static_cast<uint32_t>(AXI1_W_STALLED);
5330 return value;
5331 }
5332 uint32_t get_AXI1_W_STALLED() const volatile
5333 {
5334 uint32_t value = static_cast<uint32_t>(AXI1_W_STALLED);
5335 return value;
5336 }
5337 CONSTEXPR dma_status1_r &set_AXI1_W_STALLED(uint32_t value)
5338 {
5339 AXI1_W_STALLED = ((1u << 1) - 1) & static_cast<uint32_t>(value);
5340 return *this;
5341 }
5342 CONSTEXPR uint32_t get_AXI1_WR_LIMIT_STALL() const
5343 {
5344 uint32_t value = static_cast<uint32_t>(AXI1_WR_LIMIT_STALL);
5345 return value;
5346 }
5347 uint32_t get_AXI1_WR_LIMIT_STALL() const volatile
5348 {
5349 uint32_t value = static_cast<uint32_t>(AXI1_WR_LIMIT_STALL);
5350 return value;
5351 }
5352 CONSTEXPR dma_status1_r &set_AXI1_WR_LIMIT_STALL(uint32_t value)
5353 {
5354 AXI1_WR_LIMIT_STALL = ((1u << 1) - 1) & static_cast<uint32_t>(value);
5355 return *this;
5356 }
5357 CONSTEXPR uint32_t get_WGT_IDLE_C1() const
5358 {
5359 uint32_t value = static_cast<uint32_t>(WGT_IDLE_C1);
5360 return value;
5361 }
5362 uint32_t get_WGT_IDLE_C1() const volatile
5363 {
5364 uint32_t value = static_cast<uint32_t>(WGT_IDLE_C1);
5365 return value;
5366 }
5367 CONSTEXPR dma_status1_r &set_WGT_IDLE_C1(uint32_t value)
5368 {
5369 WGT_IDLE_C1 = ((1u << 1) - 1) & static_cast<uint32_t>(value);
5370 return *this;
5371 }
5372 CONSTEXPR uint32_t get_BAS_IDLE_C1() const
5373 {
5374 uint32_t value = static_cast<uint32_t>(BAS_IDLE_C1);
5375 return value;
5376 }
5377 uint32_t get_BAS_IDLE_C1() const volatile
5378 {
5379 uint32_t value = static_cast<uint32_t>(BAS_IDLE_C1);
5380 return value;
5381 }
5382 CONSTEXPR dma_status1_r &set_BAS_IDLE_C1(uint32_t value)
5383 {
5384 BAS_IDLE_C1 = ((1u << 1) - 1) & static_cast<uint32_t>(value);
5385 return *this;
5386 }
5387 CONSTEXPR uint32_t get_IB0_AI_VALID_C1() const
5388 {
5389 uint32_t value = static_cast<uint32_t>(IB0_AI_VALID_C1);
5390 return value;
5391 }
5392 uint32_t get_IB0_AI_VALID_C1() const volatile
5393 {
5394 uint32_t value = static_cast<uint32_t>(IB0_AI_VALID_C1);
5395 return value;
5396 }
5397 CONSTEXPR dma_status1_r &set_IB0_AI_VALID_C1(uint32_t value)
5398 {
5399 IB0_AI_VALID_C1 = ((1u << 1) - 1) & static_cast<uint32_t>(value);
5400 return *this;
5401 }
5402 CONSTEXPR uint32_t get_IB0_AI_READY_C1() const
5403 {
5404 uint32_t value = static_cast<uint32_t>(IB0_AI_READY_C1);
5405 return value;
5406 }
5407 uint32_t get_IB0_AI_READY_C1() const volatile
5408 {
5409 uint32_t value = static_cast<uint32_t>(IB0_AI_READY_C1);
5410 return value;
5411 }
5412 CONSTEXPR dma_status1_r &set_IB0_AI_READY_C1(uint32_t value)
5413 {
5414 IB0_AI_READY_C1 = ((1u << 1) - 1) & static_cast<uint32_t>(value);
5415 return *this;
5416 }
5417 CONSTEXPR uint32_t get_IB1_AI_VALID_C1() const
5418 {
5419 uint32_t value = static_cast<uint32_t>(IB1_AI_VALID_C1);
5420 return value;
5421 }
5422 uint32_t get_IB1_AI_VALID_C1() const volatile
5423 {
5424 uint32_t value = static_cast<uint32_t>(IB1_AI_VALID_C1);
5425 return value;
5426 }
5427 CONSTEXPR dma_status1_r &set_IB1_AI_VALID_C1(uint32_t value)
5428 {
5429 IB1_AI_VALID_C1 = ((1u << 1) - 1) & static_cast<uint32_t>(value);
5430 return *this;
5431 }
5432 CONSTEXPR uint32_t get_IB1_AI_READY_C1() const
5433 {
5434 uint32_t value = static_cast<uint32_t>(IB1_AI_READY_C1);
5435 return value;
5436 }
5437 uint32_t get_IB1_AI_READY_C1() const volatile
5438 {
5439 uint32_t value = static_cast<uint32_t>(IB1_AI_READY_C1);
5440 return value;
5441 }
5442 CONSTEXPR dma_status1_r &set_IB1_AI_READY_C1(uint32_t value)
5443 {
5444 IB1_AI_READY_C1 = ((1u << 1) - 1) & static_cast<uint32_t>(value);
5445 return *this;
5446 }
5447 CONSTEXPR uint32_t get_IB0_AO_VALID_C1() const
5448 {
5449 uint32_t value = static_cast<uint32_t>(IB0_AO_VALID_C1);
5450 return value;
5451 }
5452 uint32_t get_IB0_AO_VALID_C1() const volatile
5453 {
5454 uint32_t value = static_cast<uint32_t>(IB0_AO_VALID_C1);
5455 return value;
5456 }
5457 CONSTEXPR dma_status1_r &set_IB0_AO_VALID_C1(uint32_t value)
5458 {
5459 IB0_AO_VALID_C1 = ((1u << 1) - 1) & static_cast<uint32_t>(value);
5460 return *this;
5461 }
5462 CONSTEXPR uint32_t get_IB0_AO_READY_C1() const
5463 {
5464 uint32_t value = static_cast<uint32_t>(IB0_AO_READY_C1);
5465 return value;
5466 }
5467 uint32_t get_IB0_AO_READY_C1() const volatile
5468 {
5469 uint32_t value = static_cast<uint32_t>(IB0_AO_READY_C1);
5470 return value;
5471 }
5472 CONSTEXPR dma_status1_r &set_IB0_AO_READY_C1(uint32_t value)
5473 {
5474 IB0_AO_READY_C1 = ((1u << 1) - 1) & static_cast<uint32_t>(value);
5475 return *this;
5476 }
5477 CONSTEXPR uint32_t get_IB1_AO_VALID_C1() const
5478 {
5479 uint32_t value = static_cast<uint32_t>(IB1_AO_VALID_C1);
5480 return value;
5481 }
5482 uint32_t get_IB1_AO_VALID_C1() const volatile
5483 {
5484 uint32_t value = static_cast<uint32_t>(IB1_AO_VALID_C1);
5485 return value;
5486 }
5487 CONSTEXPR dma_status1_r &set_IB1_AO_VALID_C1(uint32_t value)
5488 {
5489 IB1_AO_VALID_C1 = ((1u << 1) - 1) & static_cast<uint32_t>(value);
5490 return *this;
5491 }
5492 CONSTEXPR uint32_t get_IB1_AO_READY_C1() const
5493 {
5494 uint32_t value = static_cast<uint32_t>(IB1_AO_READY_C1);
5495 return value;
5496 }
5497 uint32_t get_IB1_AO_READY_C1() const volatile
5498 {
5499 uint32_t value = static_cast<uint32_t>(IB1_AO_READY_C1);
5500 return value;
5501 }
5502 CONSTEXPR dma_status1_r &set_IB1_AO_READY_C1(uint32_t value)
5503 {
5504 IB1_AO_READY_C1 = ((1u << 1) - 1) & static_cast<uint32_t>(value);
5505 return *this;
5506 }
5507 CONSTEXPR uint32_t get_OB0_VALID_C1() const
5508 {
5509 uint32_t value = static_cast<uint32_t>(OB0_VALID_C1);
5510 return value;
5511 }
5512 uint32_t get_OB0_VALID_C1() const volatile
5513 {
5514 uint32_t value = static_cast<uint32_t>(OB0_VALID_C1);
5515 return value;
5516 }
5517 CONSTEXPR dma_status1_r &set_OB0_VALID_C1(uint32_t value)
5518 {
5519 OB0_VALID_C1 = ((1u << 1) - 1) & static_cast<uint32_t>(value);
5520 return *this;
5521 }
5522 CONSTEXPR uint32_t get_OB0_READY_C1() const
5523 {
5524 uint32_t value = static_cast<uint32_t>(OB0_READY_C1);
5525 return value;
5526 }
5527 uint32_t get_OB0_READY_C1() const volatile
5528 {
5529 uint32_t value = static_cast<uint32_t>(OB0_READY_C1);
5530 return value;
5531 }
5532 CONSTEXPR dma_status1_r &set_OB0_READY_C1(uint32_t value)
5533 {
5534 OB0_READY_C1 = ((1u << 1) - 1) & static_cast<uint32_t>(value);
5535 return *this;
5536 }
5537 CONSTEXPR uint32_t get_OB1_VALID_C1() const
5538 {
5539 uint32_t value = static_cast<uint32_t>(OB1_VALID_C1);
5540 return value;
5541 }
5542 uint32_t get_OB1_VALID_C1() const volatile
5543 {
5544 uint32_t value = static_cast<uint32_t>(OB1_VALID_C1);
5545 return value;
5546 }
5547 CONSTEXPR dma_status1_r &set_OB1_VALID_C1(uint32_t value)
5548 {
5549 OB1_VALID_C1 = ((1u << 1) - 1) & static_cast<uint32_t>(value);
5550 return *this;
5551 }
5552 CONSTEXPR uint32_t get_OB1_READY_C1() const
5553 {
5554 uint32_t value = static_cast<uint32_t>(OB1_READY_C1);
5555 return value;
5556 }
5557 uint32_t get_OB1_READY_C1() const volatile
5558 {
5559 uint32_t value = static_cast<uint32_t>(OB1_READY_C1);
5560 return value;
5561 }
5562 CONSTEXPR dma_status1_r &set_OB1_READY_C1(uint32_t value)
5563 {
5564 OB1_READY_C1 = ((1u << 1) - 1) & static_cast<uint32_t>(value);
5565 return *this;
5566 }
5567 CONSTEXPR uint32_t get_WD_BITSTREAM_VALID_C1() const
5568 {
5569 uint32_t value = static_cast<uint32_t>(WD_BITSTREAM_VALID_C1);
5570 return value;
5571 }
5572 uint32_t get_WD_BITSTREAM_VALID_C1() const volatile
5573 {
5574 uint32_t value = static_cast<uint32_t>(WD_BITSTREAM_VALID_C1);
5575 return value;
5576 }
5577 CONSTEXPR dma_status1_r &set_WD_BITSTREAM_VALID_C1(uint32_t value)
5578 {
5579 WD_BITSTREAM_VALID_C1 = ((1u << 1) - 1) & static_cast<uint32_t>(value);
5580 return *this;
5581 }
5582 CONSTEXPR uint32_t get_WD_BITSTREAM_READY_C1() const
5583 {
5584 uint32_t value = static_cast<uint32_t>(WD_BITSTREAM_READY_C1);
5585 return value;
5586 }
5587 uint32_t get_WD_BITSTREAM_READY_C1() const volatile
5588 {
5589 uint32_t value = static_cast<uint32_t>(WD_BITSTREAM_READY_C1);
5590 return value;
5591 }
5592 CONSTEXPR dma_status1_r &set_WD_BITSTREAM_READY_C1(uint32_t value)
5593 {
5594 WD_BITSTREAM_READY_C1 = ((1u << 1) - 1) & static_cast<uint32_t>(value);
5595 return *this;
5596 }
5597 CONSTEXPR uint32_t get_BS_BITSTREAM_VALID_C1() const
5598 {
5599 uint32_t value = static_cast<uint32_t>(BS_BITSTREAM_VALID_C1);
5600 return value;
5601 }
5602 uint32_t get_BS_BITSTREAM_VALID_C1() const volatile
5603 {
5604 uint32_t value = static_cast<uint32_t>(BS_BITSTREAM_VALID_C1);
5605 return value;
5606 }
5607 CONSTEXPR dma_status1_r &set_BS_BITSTREAM_VALID_C1(uint32_t value)
5608 {
5609 BS_BITSTREAM_VALID_C1 = ((1u << 1) - 1) & static_cast<uint32_t>(value);
5610 return *this;
5611 }
5612 CONSTEXPR uint32_t get_BS_BITSTREAM_READY_C1() const
5613 {
5614 uint32_t value = static_cast<uint32_t>(BS_BITSTREAM_READY_C1);
5615 return value;
5616 }
5617 uint32_t get_BS_BITSTREAM_READY_C1() const volatile
5618 {
5619 uint32_t value = static_cast<uint32_t>(BS_BITSTREAM_READY_C1);
5620 return value;
5621 }
5622 CONSTEXPR dma_status1_r &set_BS_BITSTREAM_READY_C1(uint32_t value)
5623 {
5624 BS_BITSTREAM_READY_C1 = ((1u << 1) - 1) & static_cast<uint32_t>(value);
5625 return *this;
5626 }
5627#endif //__cplusplus
5628};
5629
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005630// clkforce_r - Force clocks on for clock gating
5631struct clkforce_r
5632{
5633#ifdef __cplusplus
5634 private:
5635#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005636 union
5637 {
5638 struct
5639 {
5640 uint32_t top_level_clk : 1; // set to 1 to force on TOP level clock
5641 uint32_t cc_clk : 1; // set to 1 to force on CC clock
5642 uint32_t dma_clk : 1; // set to 1 to force on DMA clock
5643 uint32_t mac_clk : 1; // set to 1 to force on MAC clock
5644 uint32_t ao_clk : 1; // set to 1 to force on AO clock
5645 uint32_t wd_clk : 1; // set to 1 to force on WD clock
5646 uint32_t reserved0 : 26;
5647 };
5648 uint32_t word;
5649 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005650#ifdef __cplusplus
5651 public:
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005652 CONSTEXPR clkforce_r() :
5653 top_level_clk(static_cast<uint32_t>(0)), cc_clk(static_cast<uint32_t>(0)), dma_clk(static_cast<uint32_t>(0)),
5654 mac_clk(static_cast<uint32_t>(0)), ao_clk(static_cast<uint32_t>(0)), wd_clk(static_cast<uint32_t>(0)),
5655 reserved0(static_cast<uint32_t>(0))
5656 {
5657 }
5658 CONSTEXPR clkforce_r(uint32_t init) : word(init) {}
5659 CONSTEXPR void operator=(uint32_t value)
5660 {
5661 word = value;
5662 }
5663 void operator=(uint32_t value) volatile
5664 {
5665 word = value;
5666 }
5667 CONSTEXPR operator uint32_t()
5668 {
5669 return word;
5670 }
5671 operator uint32_t() volatile
5672 {
5673 return word;
5674 }
5675 clkforce_r copy() volatile
5676 {
5677 return *this;
5678 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005679 CONSTEXPR uint32_t get_top_level_clk() const
5680 {
5681 uint32_t value = static_cast<uint32_t>(top_level_clk);
5682 return value;
5683 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005684 uint32_t get_top_level_clk() const volatile
5685 {
5686 uint32_t value = static_cast<uint32_t>(top_level_clk);
5687 return value;
5688 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005689 CONSTEXPR clkforce_r &set_top_level_clk(uint32_t value)
5690 {
5691 top_level_clk = ((1u << 1) - 1) & static_cast<uint32_t>(value);
5692 return *this;
5693 }
5694 CONSTEXPR uint32_t get_cc_clk() const
5695 {
5696 uint32_t value = static_cast<uint32_t>(cc_clk);
5697 return value;
5698 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005699 uint32_t get_cc_clk() const volatile
5700 {
5701 uint32_t value = static_cast<uint32_t>(cc_clk);
5702 return value;
5703 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005704 CONSTEXPR clkforce_r &set_cc_clk(uint32_t value)
5705 {
5706 cc_clk = ((1u << 1) - 1) & static_cast<uint32_t>(value);
5707 return *this;
5708 }
5709 CONSTEXPR uint32_t get_dma_clk() const
5710 {
5711 uint32_t value = static_cast<uint32_t>(dma_clk);
5712 return value;
5713 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005714 uint32_t get_dma_clk() const volatile
5715 {
5716 uint32_t value = static_cast<uint32_t>(dma_clk);
5717 return value;
5718 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005719 CONSTEXPR clkforce_r &set_dma_clk(uint32_t value)
5720 {
5721 dma_clk = ((1u << 1) - 1) & static_cast<uint32_t>(value);
5722 return *this;
5723 }
5724 CONSTEXPR uint32_t get_mac_clk() const
5725 {
5726 uint32_t value = static_cast<uint32_t>(mac_clk);
5727 return value;
5728 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005729 uint32_t get_mac_clk() const volatile
5730 {
5731 uint32_t value = static_cast<uint32_t>(mac_clk);
5732 return value;
5733 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005734 CONSTEXPR clkforce_r &set_mac_clk(uint32_t value)
5735 {
5736 mac_clk = ((1u << 1) - 1) & static_cast<uint32_t>(value);
5737 return *this;
5738 }
5739 CONSTEXPR uint32_t get_ao_clk() const
5740 {
5741 uint32_t value = static_cast<uint32_t>(ao_clk);
5742 return value;
5743 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005744 uint32_t get_ao_clk() const volatile
5745 {
5746 uint32_t value = static_cast<uint32_t>(ao_clk);
5747 return value;
5748 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005749 CONSTEXPR clkforce_r &set_ao_clk(uint32_t value)
5750 {
5751 ao_clk = ((1u << 1) - 1) & static_cast<uint32_t>(value);
5752 return *this;
5753 }
5754 CONSTEXPR uint32_t get_wd_clk() const
5755 {
5756 uint32_t value = static_cast<uint32_t>(wd_clk);
5757 return value;
5758 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005759 uint32_t get_wd_clk() const volatile
5760 {
5761 uint32_t value = static_cast<uint32_t>(wd_clk);
5762 return value;
5763 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005764 CONSTEXPR clkforce_r &set_wd_clk(uint32_t value)
5765 {
5766 wd_clk = ((1u << 1) - 1) & static_cast<uint32_t>(value);
5767 return *this;
5768 }
5769#endif //__cplusplus
5770};
5771
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005772// pid4_r - Peripheral ID byte 4 (Arm=code 4)
5773struct pid4_r
5774{
5775#ifdef __cplusplus
5776 private:
5777#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005778 union
5779 {
5780 uint32_t PID4; // Byte 4 of Peripheral ID (Lower 8 bits valid)
5781 uint32_t word;
5782 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005783#ifdef __cplusplus
5784 public:
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005785 CONSTEXPR pid4_r() : PID4(static_cast<uint32_t>(0x04)) {}
5786 CONSTEXPR pid4_r(uint32_t init) : word(init) {}
5787 CONSTEXPR void operator=(uint32_t value)
5788 {
5789 word = value;
5790 }
5791 void operator=(uint32_t value) volatile
5792 {
5793 word = value;
5794 }
5795 CONSTEXPR operator uint32_t()
5796 {
5797 return word;
5798 }
5799 operator uint32_t() volatile
5800 {
5801 return word;
5802 }
5803 pid4_r copy() volatile
5804 {
5805 return *this;
5806 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005807 CONSTEXPR uint32_t get_PID4() const
5808 {
5809 uint32_t value = static_cast<uint32_t>(PID4);
5810 return value;
5811 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005812 uint32_t get_PID4() const volatile
5813 {
5814 uint32_t value = static_cast<uint32_t>(PID4);
5815 return value;
5816 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005817 CONSTEXPR pid4_r &set_PID4(uint32_t value)
5818 {
5819 PID4 = static_cast<uint32_t>(value);
5820 return *this;
5821 }
5822#endif //__cplusplus
5823};
5824
5825// pid5_r - Peripheral ID byte 5 (reserved)
5826struct pid5_r
5827{
5828#ifdef __cplusplus
5829 private:
5830#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005831 union
5832 {
5833 uint32_t PID5; // Byte 5 of Peripheral ID (Lower 8 bits valid)
5834 uint32_t word;
5835 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005836#ifdef __cplusplus
5837 public:
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005838 CONSTEXPR pid5_r() : PID5(static_cast<uint32_t>(0x00)) {}
5839 CONSTEXPR pid5_r(uint32_t init) : word(init) {}
5840 CONSTEXPR void operator=(uint32_t value)
5841 {
5842 word = value;
5843 }
5844 void operator=(uint32_t value) volatile
5845 {
5846 word = value;
5847 }
5848 CONSTEXPR operator uint32_t()
5849 {
5850 return word;
5851 }
5852 operator uint32_t() volatile
5853 {
5854 return word;
5855 }
5856 pid5_r copy() volatile
5857 {
5858 return *this;
5859 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005860 CONSTEXPR uint32_t get_PID5() const
5861 {
5862 uint32_t value = static_cast<uint32_t>(PID5);
5863 return value;
5864 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005865 uint32_t get_PID5() const volatile
5866 {
5867 uint32_t value = static_cast<uint32_t>(PID5);
5868 return value;
5869 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005870 CONSTEXPR pid5_r &set_PID5(uint32_t value)
5871 {
5872 PID5 = static_cast<uint32_t>(value);
5873 return *this;
5874 }
5875#endif //__cplusplus
5876};
5877
5878// pid6_r - Peripheral ID byte 6 (reserved)
5879struct pid6_r
5880{
5881#ifdef __cplusplus
5882 private:
5883#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005884 union
5885 {
5886 uint32_t PID6; // Byte 6 of Peripheral ID (Lower 8 bits valid)
5887 uint32_t word;
5888 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005889#ifdef __cplusplus
5890 public:
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005891 CONSTEXPR pid6_r() : PID6(static_cast<uint32_t>(0x00)) {}
5892 CONSTEXPR pid6_r(uint32_t init) : word(init) {}
5893 CONSTEXPR void operator=(uint32_t value)
5894 {
5895 word = value;
5896 }
5897 void operator=(uint32_t value) volatile
5898 {
5899 word = value;
5900 }
5901 CONSTEXPR operator uint32_t()
5902 {
5903 return word;
5904 }
5905 operator uint32_t() volatile
5906 {
5907 return word;
5908 }
5909 pid6_r copy() volatile
5910 {
5911 return *this;
5912 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005913 CONSTEXPR uint32_t get_PID6() const
5914 {
5915 uint32_t value = static_cast<uint32_t>(PID6);
5916 return value;
5917 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005918 uint32_t get_PID6() const volatile
5919 {
5920 uint32_t value = static_cast<uint32_t>(PID6);
5921 return value;
5922 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005923 CONSTEXPR pid6_r &set_PID6(uint32_t value)
5924 {
5925 PID6 = static_cast<uint32_t>(value);
5926 return *this;
5927 }
5928#endif //__cplusplus
5929};
5930
5931// pid7_r - Peripheral ID byte 7 (reserved)
5932struct pid7_r
5933{
5934#ifdef __cplusplus
5935 private:
5936#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005937 union
5938 {
5939 uint32_t PID7; // Byte 7 of Peripheral ID (Lower 8 bits valid)
5940 uint32_t word;
5941 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005942#ifdef __cplusplus
5943 public:
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005944 CONSTEXPR pid7_r() : PID7(static_cast<uint32_t>(0x00)) {}
5945 CONSTEXPR pid7_r(uint32_t init) : word(init) {}
5946 CONSTEXPR void operator=(uint32_t value)
5947 {
5948 word = value;
5949 }
5950 void operator=(uint32_t value) volatile
5951 {
5952 word = value;
5953 }
5954 CONSTEXPR operator uint32_t()
5955 {
5956 return word;
5957 }
5958 operator uint32_t() volatile
5959 {
5960 return word;
5961 }
5962 pid7_r copy() volatile
5963 {
5964 return *this;
5965 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005966 CONSTEXPR uint32_t get_PID7() const
5967 {
5968 uint32_t value = static_cast<uint32_t>(PID7);
5969 return value;
5970 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005971 uint32_t get_PID7() const volatile
5972 {
5973 uint32_t value = static_cast<uint32_t>(PID7);
5974 return value;
5975 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005976 CONSTEXPR pid7_r &set_PID7(uint32_t value)
5977 {
5978 PID7 = static_cast<uint32_t>(value);
5979 return *this;
5980 }
5981#endif //__cplusplus
5982};
5983
5984// pid0_r - Peripheral ID byte 0. This is bits[7:0] of the part number.
5985struct pid0_r
5986{
5987#ifdef __cplusplus
5988 private:
5989#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005990 union
5991 {
5992 uint32_t PID0; // Byte 0 of Peripheral ID (Lower 8 bits valid)
5993 uint32_t word;
5994 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005995#ifdef __cplusplus
5996 public:
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005997 CONSTEXPR pid0_r() : PID0(static_cast<uint32_t>(0x80)) {}
5998 CONSTEXPR pid0_r(uint32_t init) : word(init) {}
5999 CONSTEXPR void operator=(uint32_t value)
6000 {
6001 word = value;
6002 }
6003 void operator=(uint32_t value) volatile
6004 {
6005 word = value;
6006 }
6007 CONSTEXPR operator uint32_t()
6008 {
6009 return word;
6010 }
6011 operator uint32_t() volatile
6012 {
6013 return word;
6014 }
6015 pid0_r copy() volatile
6016 {
6017 return *this;
6018 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006019 CONSTEXPR uint32_t get_PID0() const
6020 {
6021 uint32_t value = static_cast<uint32_t>(PID0);
6022 return value;
6023 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006024 uint32_t get_PID0() const volatile
6025 {
6026 uint32_t value = static_cast<uint32_t>(PID0);
6027 return value;
6028 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006029 CONSTEXPR pid0_r &set_PID0(uint32_t value)
6030 {
6031 PID0 = static_cast<uint32_t>(value);
6032 return *this;
6033 }
6034#endif //__cplusplus
6035};
6036
6037// pid1_r - Peripheral ID byte 1. This is bits[11:8] of the part number in bits[3:0], and bits[3:0] of the Arm ID in
6038// bits[7:4].
6039struct pid1_r
6040{
6041#ifdef __cplusplus
6042 private:
6043#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006044 union
6045 {
6046 uint32_t PID1; // Byte 1 of Peripheral ID (Lower 8 bits valid)
6047 uint32_t word;
6048 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006049#ifdef __cplusplus
6050 public:
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006051 CONSTEXPR pid1_r() : PID1(static_cast<uint32_t>(0xB5)) {}
6052 CONSTEXPR pid1_r(uint32_t init) : word(init) {}
6053 CONSTEXPR void operator=(uint32_t value)
6054 {
6055 word = value;
6056 }
6057 void operator=(uint32_t value) volatile
6058 {
6059 word = value;
6060 }
6061 CONSTEXPR operator uint32_t()
6062 {
6063 return word;
6064 }
6065 operator uint32_t() volatile
6066 {
6067 return word;
6068 }
6069 pid1_r copy() volatile
6070 {
6071 return *this;
6072 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006073 CONSTEXPR uint32_t get_PID1() const
6074 {
6075 uint32_t value = static_cast<uint32_t>(PID1);
6076 return value;
6077 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006078 uint32_t get_PID1() const volatile
6079 {
6080 uint32_t value = static_cast<uint32_t>(PID1);
6081 return value;
6082 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006083 CONSTEXPR pid1_r &set_PID1(uint32_t value)
6084 {
6085 PID1 = static_cast<uint32_t>(value);
6086 return *this;
6087 }
6088#endif //__cplusplus
6089};
6090
6091// pid2_r - Peripheral ID byte 2. This is bits[6:4] of the Arm ID in bits[2:0], and bit 3 indicates format B.
6092struct pid2_r
6093{
6094#ifdef __cplusplus
6095 private:
6096#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006097 union
6098 {
6099 uint32_t PID2; // Byte 2 of Peripheral ID (Lower 8 bits valid)
6100 uint32_t word;
6101 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006102#ifdef __cplusplus
6103 public:
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006104 CONSTEXPR pid2_r() : PID2(static_cast<uint32_t>(0x0B)) {}
6105 CONSTEXPR pid2_r(uint32_t init) : word(init) {}
6106 CONSTEXPR void operator=(uint32_t value)
6107 {
6108 word = value;
6109 }
6110 void operator=(uint32_t value) volatile
6111 {
6112 word = value;
6113 }
6114 CONSTEXPR operator uint32_t()
6115 {
6116 return word;
6117 }
6118 operator uint32_t() volatile
6119 {
6120 return word;
6121 }
6122 pid2_r copy() volatile
6123 {
6124 return *this;
6125 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006126 CONSTEXPR uint32_t get_PID2() const
6127 {
6128 uint32_t value = static_cast<uint32_t>(PID2);
6129 return value;
6130 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006131 uint32_t get_PID2() const volatile
6132 {
6133 uint32_t value = static_cast<uint32_t>(PID2);
6134 return value;
6135 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006136 CONSTEXPR pid2_r &set_PID2(uint32_t value)
6137 {
6138 PID2 = static_cast<uint32_t>(value);
6139 return *this;
6140 }
6141#endif //__cplusplus
6142};
6143
6144// pid3_r - Peripheral ID byte 3.
6145struct pid3_r
6146{
6147#ifdef __cplusplus
6148 private:
6149#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006150 union
6151 {
6152 uint32_t PID3; // Byte 1 of Peripheral ID (Lower 8 bits valid)
6153 uint32_t word;
6154 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006155#ifdef __cplusplus
6156 public:
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006157 CONSTEXPR pid3_r() : PID3(static_cast<uint32_t>(0x0)) {}
6158 CONSTEXPR pid3_r(uint32_t init) : word(init) {}
6159 CONSTEXPR void operator=(uint32_t value)
6160 {
6161 word = value;
6162 }
6163 void operator=(uint32_t value) volatile
6164 {
6165 word = value;
6166 }
6167 CONSTEXPR operator uint32_t()
6168 {
6169 return word;
6170 }
6171 operator uint32_t() volatile
6172 {
6173 return word;
6174 }
6175 pid3_r copy() volatile
6176 {
6177 return *this;
6178 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006179 CONSTEXPR uint32_t get_PID3() const
6180 {
6181 uint32_t value = static_cast<uint32_t>(PID3);
6182 return value;
6183 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006184 uint32_t get_PID3() const volatile
6185 {
6186 uint32_t value = static_cast<uint32_t>(PID3);
6187 return value;
6188 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006189 CONSTEXPR pid3_r &set_PID3(uint32_t value)
6190 {
6191 PID3 = static_cast<uint32_t>(value);
6192 return *this;
6193 }
6194#endif //__cplusplus
6195};
6196
6197// cid0_r - Component ID byte 0.
6198struct cid0_r
6199{
6200#ifdef __cplusplus
6201 private:
6202#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006203 union
6204 {
6205 uint32_t CID0; // Byte 0 of Component ID (Lower 8 bits valid)
6206 uint32_t word;
6207 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006208#ifdef __cplusplus
6209 public:
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006210 CONSTEXPR cid0_r() : CID0(static_cast<uint32_t>(0x0D)) {}
6211 CONSTEXPR cid0_r(uint32_t init) : word(init) {}
6212 CONSTEXPR void operator=(uint32_t value)
6213 {
6214 word = value;
6215 }
6216 void operator=(uint32_t value) volatile
6217 {
6218 word = value;
6219 }
6220 CONSTEXPR operator uint32_t()
6221 {
6222 return word;
6223 }
6224 operator uint32_t() volatile
6225 {
6226 return word;
6227 }
6228 cid0_r copy() volatile
6229 {
6230 return *this;
6231 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006232 CONSTEXPR uint32_t get_CID0() const
6233 {
6234 uint32_t value = static_cast<uint32_t>(CID0);
6235 return value;
6236 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006237 uint32_t get_CID0() const volatile
6238 {
6239 uint32_t value = static_cast<uint32_t>(CID0);
6240 return value;
6241 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006242 CONSTEXPR cid0_r &set_CID0(uint32_t value)
6243 {
6244 CID0 = static_cast<uint32_t>(value);
6245 return *this;
6246 }
6247#endif //__cplusplus
6248};
6249
6250// cid1_r - Component ID byte 1.
6251struct cid1_r
6252{
6253#ifdef __cplusplus
6254 private:
6255#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006256 union
6257 {
6258 uint32_t CID1; // Byte 1 of Component ID (Lower 8 bits valid)
6259 uint32_t word;
6260 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006261#ifdef __cplusplus
6262 public:
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006263 CONSTEXPR cid1_r() : CID1(static_cast<uint32_t>(0xF0)) {}
6264 CONSTEXPR cid1_r(uint32_t init) : word(init) {}
6265 CONSTEXPR void operator=(uint32_t value)
6266 {
6267 word = value;
6268 }
6269 void operator=(uint32_t value) volatile
6270 {
6271 word = value;
6272 }
6273 CONSTEXPR operator uint32_t()
6274 {
6275 return word;
6276 }
6277 operator uint32_t() volatile
6278 {
6279 return word;
6280 }
6281 cid1_r copy() volatile
6282 {
6283 return *this;
6284 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006285 CONSTEXPR uint32_t get_CID1() const
6286 {
6287 uint32_t value = static_cast<uint32_t>(CID1);
6288 return value;
6289 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006290 uint32_t get_CID1() const volatile
6291 {
6292 uint32_t value = static_cast<uint32_t>(CID1);
6293 return value;
6294 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006295 CONSTEXPR cid1_r &set_CID1(uint32_t value)
6296 {
6297 CID1 = static_cast<uint32_t>(value);
6298 return *this;
6299 }
6300#endif //__cplusplus
6301};
6302
6303// cid2_r - Component ID byte 2.
6304struct cid2_r
6305{
6306#ifdef __cplusplus
6307 private:
6308#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006309 union
6310 {
6311 uint32_t CID2; // Byte 2 of Component ID (Lower 8 bits valid)
6312 uint32_t word;
6313 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006314#ifdef __cplusplus
6315 public:
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006316 CONSTEXPR cid2_r() : CID2(static_cast<uint32_t>(0x05)) {}
6317 CONSTEXPR cid2_r(uint32_t init) : word(init) {}
6318 CONSTEXPR void operator=(uint32_t value)
6319 {
6320 word = value;
6321 }
6322 void operator=(uint32_t value) volatile
6323 {
6324 word = value;
6325 }
6326 CONSTEXPR operator uint32_t()
6327 {
6328 return word;
6329 }
6330 operator uint32_t() volatile
6331 {
6332 return word;
6333 }
6334 cid2_r copy() volatile
6335 {
6336 return *this;
6337 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006338 CONSTEXPR uint32_t get_CID2() const
6339 {
6340 uint32_t value = static_cast<uint32_t>(CID2);
6341 return value;
6342 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006343 uint32_t get_CID2() const volatile
6344 {
6345 uint32_t value = static_cast<uint32_t>(CID2);
6346 return value;
6347 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006348 CONSTEXPR cid2_r &set_CID2(uint32_t value)
6349 {
6350 CID2 = static_cast<uint32_t>(value);
6351 return *this;
6352 }
6353#endif //__cplusplus
6354};
6355
6356// cid3_r - Component ID byte 3.
6357struct cid3_r
6358{
6359#ifdef __cplusplus
6360 private:
6361#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006362 union
6363 {
6364 uint32_t CID3; // Byte 3 of Component ID (Lower 8 bits valid)
6365 uint32_t word;
6366 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006367#ifdef __cplusplus
6368 public:
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006369 CONSTEXPR cid3_r() : CID3(static_cast<uint32_t>(0xB1)) {}
6370 CONSTEXPR cid3_r(uint32_t init) : word(init) {}
6371 CONSTEXPR void operator=(uint32_t value)
6372 {
6373 word = value;
6374 }
6375 void operator=(uint32_t value) volatile
6376 {
6377 word = value;
6378 }
6379 CONSTEXPR operator uint32_t()
6380 {
6381 return word;
6382 }
6383 operator uint32_t() volatile
6384 {
6385 return word;
6386 }
6387 cid3_r copy() volatile
6388 {
6389 return *this;
6390 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006391 CONSTEXPR uint32_t get_CID3() const
6392 {
6393 uint32_t value = static_cast<uint32_t>(CID3);
6394 return value;
6395 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006396 uint32_t get_CID3() const volatile
6397 {
6398 uint32_t value = static_cast<uint32_t>(CID3);
6399 return value;
6400 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006401 CONSTEXPR cid3_r &set_CID3(uint32_t value)
6402 {
6403 CID3 = static_cast<uint32_t>(value);
6404 return *this;
6405 }
6406#endif //__cplusplus
6407};
6408
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006409// pmcr_r - PMU Register control
6410struct pmcr_r
6411{
6412#ifdef __cplusplus
6413 private:
6414#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006415 union
6416 {
6417 struct
6418 {
Douglas Trohaf6a85da2020-05-11 11:45:28 +02006419 uint32_t cnt_en : 1; // Enable counter
6420 uint32_t event_cnt_rst : 1; // Reset event counter
6421 uint32_t cycle_cnt_rst : 1; // Reset cycle counter
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006422 uint32_t mask_en : 1; // PMU can be enabled/disabled by command stream operation NPU_OP_PMU_MASK
6423 uint32_t reserved0 : 7;
Douglas Trohaf6a85da2020-05-11 11:45:28 +02006424 uint32_t num_event_cnt : 5; // Number of event counters
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006425 uint32_t reserved1 : 16;
6426 };
6427 uint32_t word;
6428 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006429#ifdef __cplusplus
6430 public:
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006431 CONSTEXPR pmcr_r() :
Douglas Troha2e7e3b72020-05-14 20:28:31 +02006432 cnt_en(static_cast<uint32_t>(0x0)), event_cnt_rst(static_cast<uint32_t>(0)),
6433 cycle_cnt_rst(static_cast<uint32_t>(0)), mask_en(static_cast<uint32_t>(0x0)),
6434 reserved0(static_cast<uint32_t>(0)), num_event_cnt(static_cast<uint32_t>(0x04)),
6435 reserved1(static_cast<uint32_t>(0))
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006436 {
6437 }
6438 CONSTEXPR pmcr_r(uint32_t init) : word(init) {}
6439 CONSTEXPR void operator=(uint32_t value)
6440 {
6441 word = value;
6442 }
6443 void operator=(uint32_t value) volatile
6444 {
6445 word = value;
6446 }
6447 CONSTEXPR operator uint32_t()
6448 {
6449 return word;
6450 }
6451 operator uint32_t() volatile
6452 {
6453 return word;
6454 }
6455 pmcr_r copy() volatile
6456 {
6457 return *this;
6458 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006459 CONSTEXPR uint32_t get_cnt_en() const
6460 {
6461 uint32_t value = static_cast<uint32_t>(cnt_en);
6462 return value;
6463 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006464 uint32_t get_cnt_en() const volatile
6465 {
6466 uint32_t value = static_cast<uint32_t>(cnt_en);
6467 return value;
6468 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006469 CONSTEXPR pmcr_r &set_cnt_en(uint32_t value)
6470 {
6471 cnt_en = ((1u << 1) - 1) & static_cast<uint32_t>(value);
6472 return *this;
6473 }
6474 CONSTEXPR uint32_t get_event_cnt_rst() const
6475 {
6476 uint32_t value = static_cast<uint32_t>(event_cnt_rst);
6477 return value;
6478 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006479 uint32_t get_event_cnt_rst() const volatile
6480 {
6481 uint32_t value = static_cast<uint32_t>(event_cnt_rst);
6482 return value;
6483 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006484 CONSTEXPR pmcr_r &set_event_cnt_rst(uint32_t value)
6485 {
6486 event_cnt_rst = ((1u << 1) - 1) & static_cast<uint32_t>(value);
6487 return *this;
6488 }
6489 CONSTEXPR uint32_t get_cycle_cnt_rst() const
6490 {
6491 uint32_t value = static_cast<uint32_t>(cycle_cnt_rst);
6492 return value;
6493 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006494 uint32_t get_cycle_cnt_rst() const volatile
6495 {
6496 uint32_t value = static_cast<uint32_t>(cycle_cnt_rst);
6497 return value;
6498 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006499 CONSTEXPR pmcr_r &set_cycle_cnt_rst(uint32_t value)
6500 {
6501 cycle_cnt_rst = ((1u << 1) - 1) & static_cast<uint32_t>(value);
6502 return *this;
6503 }
6504 CONSTEXPR uint32_t get_mask_en() const
6505 {
6506 uint32_t value = static_cast<uint32_t>(mask_en);
6507 return value;
6508 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006509 uint32_t get_mask_en() const volatile
6510 {
6511 uint32_t value = static_cast<uint32_t>(mask_en);
6512 return value;
6513 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006514 CONSTEXPR pmcr_r &set_mask_en(uint32_t value)
6515 {
6516 mask_en = ((1u << 1) - 1) & static_cast<uint32_t>(value);
6517 return *this;
6518 }
6519 CONSTEXPR uint32_t get_num_event_cnt() const
6520 {
6521 uint32_t value = static_cast<uint32_t>(num_event_cnt);
6522 return value;
6523 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006524 uint32_t get_num_event_cnt() const volatile
6525 {
6526 uint32_t value = static_cast<uint32_t>(num_event_cnt);
6527 return value;
6528 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006529 CONSTEXPR pmcr_r &set_num_event_cnt(uint32_t value)
6530 {
6531 num_event_cnt = ((1u << 5) - 1) & static_cast<uint32_t>(value);
6532 return *this;
6533 }
6534#endif //__cplusplus
6535};
6536
6537// pmcntenset_r - Count enable set register
6538struct pmcntenset_r
6539{
6540#ifdef __cplusplus
6541 private:
6542#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006543 union
6544 {
6545 struct
6546 {
6547 uint32_t EVENT_CNT_0 : 1; // Event counter enable bit for PMEVCNTR0
6548 uint32_t EVENT_CNT_1 : 1; // Event counter enable bit for PMEVCNTR1
6549 uint32_t EVENT_CNT_2 : 1; // Event counter enable bit for PMEVCNTR2
6550 uint32_t EVENT_CNT_3 : 1; // Event counter enable bit for PMEVCNTR3
6551 uint32_t reserved0 : 27;
6552 uint32_t CYCLE_CNT : 1; // PMCCNTR enable bit
6553 };
6554 uint32_t word;
6555 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006556#ifdef __cplusplus
6557 public:
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006558 CONSTEXPR pmcntenset_r() :
6559 EVENT_CNT_0(static_cast<uint32_t>(0)), EVENT_CNT_1(static_cast<uint32_t>(0)),
6560 EVENT_CNT_2(static_cast<uint32_t>(0)), EVENT_CNT_3(static_cast<uint32_t>(0)),
6561 reserved0(static_cast<uint32_t>(0)), CYCLE_CNT(static_cast<uint32_t>(0))
6562 {
6563 }
6564 CONSTEXPR pmcntenset_r(uint32_t init) : word(init) {}
6565 CONSTEXPR void operator=(uint32_t value)
6566 {
6567 word = value;
6568 }
6569 void operator=(uint32_t value) volatile
6570 {
6571 word = value;
6572 }
6573 CONSTEXPR operator uint32_t()
6574 {
6575 return word;
6576 }
6577 operator uint32_t() volatile
6578 {
6579 return word;
6580 }
6581 pmcntenset_r copy() volatile
6582 {
6583 return *this;
6584 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006585 CONSTEXPR uint32_t get_EVENT_CNT_0() const
6586 {
6587 uint32_t value = static_cast<uint32_t>(EVENT_CNT_0);
6588 return value;
6589 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006590 uint32_t get_EVENT_CNT_0() const volatile
6591 {
6592 uint32_t value = static_cast<uint32_t>(EVENT_CNT_0);
6593 return value;
6594 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006595 CONSTEXPR pmcntenset_r &set_EVENT_CNT_0(uint32_t value)
6596 {
6597 EVENT_CNT_0 = ((1u << 1) - 1) & static_cast<uint32_t>(value);
6598 return *this;
6599 }
6600 CONSTEXPR uint32_t get_EVENT_CNT_1() const
6601 {
6602 uint32_t value = static_cast<uint32_t>(EVENT_CNT_1);
6603 return value;
6604 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006605 uint32_t get_EVENT_CNT_1() const volatile
6606 {
6607 uint32_t value = static_cast<uint32_t>(EVENT_CNT_1);
6608 return value;
6609 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006610 CONSTEXPR pmcntenset_r &set_EVENT_CNT_1(uint32_t value)
6611 {
6612 EVENT_CNT_1 = ((1u << 1) - 1) & static_cast<uint32_t>(value);
6613 return *this;
6614 }
6615 CONSTEXPR uint32_t get_EVENT_CNT_2() const
6616 {
6617 uint32_t value = static_cast<uint32_t>(EVENT_CNT_2);
6618 return value;
6619 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006620 uint32_t get_EVENT_CNT_2() const volatile
6621 {
6622 uint32_t value = static_cast<uint32_t>(EVENT_CNT_2);
6623 return value;
6624 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006625 CONSTEXPR pmcntenset_r &set_EVENT_CNT_2(uint32_t value)
6626 {
6627 EVENT_CNT_2 = ((1u << 1) - 1) & static_cast<uint32_t>(value);
6628 return *this;
6629 }
6630 CONSTEXPR uint32_t get_EVENT_CNT_3() const
6631 {
6632 uint32_t value = static_cast<uint32_t>(EVENT_CNT_3);
6633 return value;
6634 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006635 uint32_t get_EVENT_CNT_3() const volatile
6636 {
6637 uint32_t value = static_cast<uint32_t>(EVENT_CNT_3);
6638 return value;
6639 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006640 CONSTEXPR pmcntenset_r &set_EVENT_CNT_3(uint32_t value)
6641 {
6642 EVENT_CNT_3 = ((1u << 1) - 1) & static_cast<uint32_t>(value);
6643 return *this;
6644 }
6645 CONSTEXPR uint32_t get_CYCLE_CNT() const
6646 {
6647 uint32_t value = static_cast<uint32_t>(CYCLE_CNT);
6648 return value;
6649 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006650 uint32_t get_CYCLE_CNT() const volatile
6651 {
6652 uint32_t value = static_cast<uint32_t>(CYCLE_CNT);
6653 return value;
6654 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006655 CONSTEXPR pmcntenset_r &set_CYCLE_CNT(uint32_t value)
6656 {
6657 CYCLE_CNT = ((1u << 1) - 1) & static_cast<uint32_t>(value);
6658 return *this;
6659 }
6660#endif //__cplusplus
6661};
6662
6663// pmcntenclr_r - Count enable clear register
6664struct pmcntenclr_r
6665{
6666#ifdef __cplusplus
6667 private:
6668#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006669 union
6670 {
6671 struct
6672 {
6673 uint32_t EVENT_CNT_0 : 1; // Event counter disable bit for PMEVCNTR0
6674 uint32_t EVENT_CNT_1 : 1; // Event counter disable bit for PMEVCNTR1
6675 uint32_t EVENT_CNT_2 : 1; // Event counter disable bit for PMEVCNTR2
6676 uint32_t EVENT_CNT_3 : 1; // Event counter disable bit for PMEVCNTR3
6677 uint32_t reserved0 : 27;
6678 uint32_t CYCLE_CNT : 1; // PMCCNTR disable bit
6679 };
6680 uint32_t word;
6681 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006682#ifdef __cplusplus
6683 public:
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006684 CONSTEXPR pmcntenclr_r() :
6685 EVENT_CNT_0(static_cast<uint32_t>(0)), EVENT_CNT_1(static_cast<uint32_t>(0)),
6686 EVENT_CNT_2(static_cast<uint32_t>(0)), EVENT_CNT_3(static_cast<uint32_t>(0)),
6687 reserved0(static_cast<uint32_t>(0)), CYCLE_CNT(static_cast<uint32_t>(0))
6688 {
6689 }
6690 CONSTEXPR pmcntenclr_r(uint32_t init) : word(init) {}
6691 CONSTEXPR void operator=(uint32_t value)
6692 {
6693 word = value;
6694 }
6695 void operator=(uint32_t value) volatile
6696 {
6697 word = value;
6698 }
6699 CONSTEXPR operator uint32_t()
6700 {
6701 return word;
6702 }
6703 operator uint32_t() volatile
6704 {
6705 return word;
6706 }
6707 pmcntenclr_r copy() volatile
6708 {
6709 return *this;
6710 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006711 CONSTEXPR uint32_t get_EVENT_CNT_0() const
6712 {
6713 uint32_t value = static_cast<uint32_t>(EVENT_CNT_0);
6714 return value;
6715 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006716 uint32_t get_EVENT_CNT_0() const volatile
6717 {
6718 uint32_t value = static_cast<uint32_t>(EVENT_CNT_0);
6719 return value;
6720 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006721 CONSTEXPR pmcntenclr_r &set_EVENT_CNT_0(uint32_t value)
6722 {
6723 EVENT_CNT_0 = ((1u << 1) - 1) & static_cast<uint32_t>(value);
6724 return *this;
6725 }
6726 CONSTEXPR uint32_t get_EVENT_CNT_1() const
6727 {
6728 uint32_t value = static_cast<uint32_t>(EVENT_CNT_1);
6729 return value;
6730 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006731 uint32_t get_EVENT_CNT_1() const volatile
6732 {
6733 uint32_t value = static_cast<uint32_t>(EVENT_CNT_1);
6734 return value;
6735 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006736 CONSTEXPR pmcntenclr_r &set_EVENT_CNT_1(uint32_t value)
6737 {
6738 EVENT_CNT_1 = ((1u << 1) - 1) & static_cast<uint32_t>(value);
6739 return *this;
6740 }
6741 CONSTEXPR uint32_t get_EVENT_CNT_2() const
6742 {
6743 uint32_t value = static_cast<uint32_t>(EVENT_CNT_2);
6744 return value;
6745 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006746 uint32_t get_EVENT_CNT_2() const volatile
6747 {
6748 uint32_t value = static_cast<uint32_t>(EVENT_CNT_2);
6749 return value;
6750 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006751 CONSTEXPR pmcntenclr_r &set_EVENT_CNT_2(uint32_t value)
6752 {
6753 EVENT_CNT_2 = ((1u << 1) - 1) & static_cast<uint32_t>(value);
6754 return *this;
6755 }
6756 CONSTEXPR uint32_t get_EVENT_CNT_3() const
6757 {
6758 uint32_t value = static_cast<uint32_t>(EVENT_CNT_3);
6759 return value;
6760 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006761 uint32_t get_EVENT_CNT_3() const volatile
6762 {
6763 uint32_t value = static_cast<uint32_t>(EVENT_CNT_3);
6764 return value;
6765 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006766 CONSTEXPR pmcntenclr_r &set_EVENT_CNT_3(uint32_t value)
6767 {
6768 EVENT_CNT_3 = ((1u << 1) - 1) & static_cast<uint32_t>(value);
6769 return *this;
6770 }
6771 CONSTEXPR uint32_t get_CYCLE_CNT() const
6772 {
6773 uint32_t value = static_cast<uint32_t>(CYCLE_CNT);
6774 return value;
6775 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006776 uint32_t get_CYCLE_CNT() const volatile
6777 {
6778 uint32_t value = static_cast<uint32_t>(CYCLE_CNT);
6779 return value;
6780 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006781 CONSTEXPR pmcntenclr_r &set_CYCLE_CNT(uint32_t value)
6782 {
6783 CYCLE_CNT = ((1u << 1) - 1) & static_cast<uint32_t>(value);
6784 return *this;
6785 }
6786#endif //__cplusplus
6787};
6788
6789// pmovsset_r - Overflow flag status set register
6790struct pmovsset_r
6791{
6792#ifdef __cplusplus
6793 private:
6794#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006795 union
6796 {
6797 struct
6798 {
6799 uint32_t EVENT_CNT_0_OVF : 1; // Event counter overflow set bit for PMEVCNTR0
6800 uint32_t EVENT_CNT_1_OVF : 1; // Event counter overflow set bit for PMEVCNTR1
6801 uint32_t EVENT_CNT_2_OVF : 1; // Event counter overflow set bit for PMEVCNTR2
6802 uint32_t EVENT_CNT_3_OVF : 1; // Event counter overflow set bit for PMEVCNTR3
6803 uint32_t reserved0 : 27;
6804 uint32_t CYCLE_CNT_OVF : 1; // PMCCNTR overflow set bit
6805 };
6806 uint32_t word;
6807 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006808#ifdef __cplusplus
6809 public:
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006810 CONSTEXPR pmovsset_r() :
6811 EVENT_CNT_0_OVF(static_cast<uint32_t>(0)), EVENT_CNT_1_OVF(static_cast<uint32_t>(0)),
6812 EVENT_CNT_2_OVF(static_cast<uint32_t>(0)), EVENT_CNT_3_OVF(static_cast<uint32_t>(0)),
6813 reserved0(static_cast<uint32_t>(0)), CYCLE_CNT_OVF(static_cast<uint32_t>(0))
6814 {
6815 }
6816 CONSTEXPR pmovsset_r(uint32_t init) : word(init) {}
6817 CONSTEXPR void operator=(uint32_t value)
6818 {
6819 word = value;
6820 }
6821 void operator=(uint32_t value) volatile
6822 {
6823 word = value;
6824 }
6825 CONSTEXPR operator uint32_t()
6826 {
6827 return word;
6828 }
6829 operator uint32_t() volatile
6830 {
6831 return word;
6832 }
6833 pmovsset_r copy() volatile
6834 {
6835 return *this;
6836 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006837 CONSTEXPR uint32_t get_EVENT_CNT_0_OVF() const
6838 {
6839 uint32_t value = static_cast<uint32_t>(EVENT_CNT_0_OVF);
6840 return value;
6841 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006842 uint32_t get_EVENT_CNT_0_OVF() const volatile
6843 {
6844 uint32_t value = static_cast<uint32_t>(EVENT_CNT_0_OVF);
6845 return value;
6846 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006847 CONSTEXPR pmovsset_r &set_EVENT_CNT_0_OVF(uint32_t value)
6848 {
6849 EVENT_CNT_0_OVF = ((1u << 1) - 1) & static_cast<uint32_t>(value);
6850 return *this;
6851 }
6852 CONSTEXPR uint32_t get_EVENT_CNT_1_OVF() const
6853 {
6854 uint32_t value = static_cast<uint32_t>(EVENT_CNT_1_OVF);
6855 return value;
6856 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006857 uint32_t get_EVENT_CNT_1_OVF() const volatile
6858 {
6859 uint32_t value = static_cast<uint32_t>(EVENT_CNT_1_OVF);
6860 return value;
6861 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006862 CONSTEXPR pmovsset_r &set_EVENT_CNT_1_OVF(uint32_t value)
6863 {
6864 EVENT_CNT_1_OVF = ((1u << 1) - 1) & static_cast<uint32_t>(value);
6865 return *this;
6866 }
6867 CONSTEXPR uint32_t get_EVENT_CNT_2_OVF() const
6868 {
6869 uint32_t value = static_cast<uint32_t>(EVENT_CNT_2_OVF);
6870 return value;
6871 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006872 uint32_t get_EVENT_CNT_2_OVF() const volatile
6873 {
6874 uint32_t value = static_cast<uint32_t>(EVENT_CNT_2_OVF);
6875 return value;
6876 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006877 CONSTEXPR pmovsset_r &set_EVENT_CNT_2_OVF(uint32_t value)
6878 {
6879 EVENT_CNT_2_OVF = ((1u << 1) - 1) & static_cast<uint32_t>(value);
6880 return *this;
6881 }
6882 CONSTEXPR uint32_t get_EVENT_CNT_3_OVF() const
6883 {
6884 uint32_t value = static_cast<uint32_t>(EVENT_CNT_3_OVF);
6885 return value;
6886 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006887 uint32_t get_EVENT_CNT_3_OVF() const volatile
6888 {
6889 uint32_t value = static_cast<uint32_t>(EVENT_CNT_3_OVF);
6890 return value;
6891 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006892 CONSTEXPR pmovsset_r &set_EVENT_CNT_3_OVF(uint32_t value)
6893 {
6894 EVENT_CNT_3_OVF = ((1u << 1) - 1) & static_cast<uint32_t>(value);
6895 return *this;
6896 }
6897 CONSTEXPR uint32_t get_CYCLE_CNT_OVF() const
6898 {
6899 uint32_t value = static_cast<uint32_t>(CYCLE_CNT_OVF);
6900 return value;
6901 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006902 uint32_t get_CYCLE_CNT_OVF() const volatile
6903 {
6904 uint32_t value = static_cast<uint32_t>(CYCLE_CNT_OVF);
6905 return value;
6906 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006907 CONSTEXPR pmovsset_r &set_CYCLE_CNT_OVF(uint32_t value)
6908 {
6909 CYCLE_CNT_OVF = ((1u << 1) - 1) & static_cast<uint32_t>(value);
6910 return *this;
6911 }
6912#endif //__cplusplus
6913};
6914
6915// pmovsclr_r - Overflow flag status clear register
6916struct pmovsclr_r
6917{
6918#ifdef __cplusplus
6919 private:
6920#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006921 union
6922 {
6923 struct
6924 {
6925 uint32_t EVENT_CNT_0_OVF : 1; // Event counter overflow clear bit for PMEVCNTR0
6926 uint32_t EVENT_CNT_1_OVF : 1; // Event counter overflow clear bit for PMEVCNTR1
6927 uint32_t EVENT_CNT_2_OVF : 1; // Event counter overflow clear bit for PMEVCNTR2
6928 uint32_t EVENT_CNT_3_OVF : 1; // Event counter overflow clear bit for PMEVCNTR3
6929 uint32_t reserved0 : 27;
6930 uint32_t CYCLE_CNT_OVF : 1; // PMCCNTR overflow clear bit
6931 };
6932 uint32_t word;
6933 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006934#ifdef __cplusplus
6935 public:
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006936 CONSTEXPR pmovsclr_r() :
6937 EVENT_CNT_0_OVF(static_cast<uint32_t>(0)), EVENT_CNT_1_OVF(static_cast<uint32_t>(0)),
6938 EVENT_CNT_2_OVF(static_cast<uint32_t>(0)), EVENT_CNT_3_OVF(static_cast<uint32_t>(0)),
6939 reserved0(static_cast<uint32_t>(0)), CYCLE_CNT_OVF(static_cast<uint32_t>(0))
6940 {
6941 }
6942 CONSTEXPR pmovsclr_r(uint32_t init) : word(init) {}
6943 CONSTEXPR void operator=(uint32_t value)
6944 {
6945 word = value;
6946 }
6947 void operator=(uint32_t value) volatile
6948 {
6949 word = value;
6950 }
6951 CONSTEXPR operator uint32_t()
6952 {
6953 return word;
6954 }
6955 operator uint32_t() volatile
6956 {
6957 return word;
6958 }
6959 pmovsclr_r copy() volatile
6960 {
6961 return *this;
6962 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006963 CONSTEXPR uint32_t get_EVENT_CNT_0_OVF() const
6964 {
6965 uint32_t value = static_cast<uint32_t>(EVENT_CNT_0_OVF);
6966 return value;
6967 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006968 uint32_t get_EVENT_CNT_0_OVF() const volatile
6969 {
6970 uint32_t value = static_cast<uint32_t>(EVENT_CNT_0_OVF);
6971 return value;
6972 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006973 CONSTEXPR pmovsclr_r &set_EVENT_CNT_0_OVF(uint32_t value)
6974 {
6975 EVENT_CNT_0_OVF = ((1u << 1) - 1) & static_cast<uint32_t>(value);
6976 return *this;
6977 }
6978 CONSTEXPR uint32_t get_EVENT_CNT_1_OVF() const
6979 {
6980 uint32_t value = static_cast<uint32_t>(EVENT_CNT_1_OVF);
6981 return value;
6982 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006983 uint32_t get_EVENT_CNT_1_OVF() const volatile
6984 {
6985 uint32_t value = static_cast<uint32_t>(EVENT_CNT_1_OVF);
6986 return value;
6987 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006988 CONSTEXPR pmovsclr_r &set_EVENT_CNT_1_OVF(uint32_t value)
6989 {
6990 EVENT_CNT_1_OVF = ((1u << 1) - 1) & static_cast<uint32_t>(value);
6991 return *this;
6992 }
6993 CONSTEXPR uint32_t get_EVENT_CNT_2_OVF() const
6994 {
6995 uint32_t value = static_cast<uint32_t>(EVENT_CNT_2_OVF);
6996 return value;
6997 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006998 uint32_t get_EVENT_CNT_2_OVF() const volatile
6999 {
7000 uint32_t value = static_cast<uint32_t>(EVENT_CNT_2_OVF);
7001 return value;
7002 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007003 CONSTEXPR pmovsclr_r &set_EVENT_CNT_2_OVF(uint32_t value)
7004 {
7005 EVENT_CNT_2_OVF = ((1u << 1) - 1) & static_cast<uint32_t>(value);
7006 return *this;
7007 }
7008 CONSTEXPR uint32_t get_EVENT_CNT_3_OVF() const
7009 {
7010 uint32_t value = static_cast<uint32_t>(EVENT_CNT_3_OVF);
7011 return value;
7012 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007013 uint32_t get_EVENT_CNT_3_OVF() const volatile
7014 {
7015 uint32_t value = static_cast<uint32_t>(EVENT_CNT_3_OVF);
7016 return value;
7017 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007018 CONSTEXPR pmovsclr_r &set_EVENT_CNT_3_OVF(uint32_t value)
7019 {
7020 EVENT_CNT_3_OVF = ((1u << 1) - 1) & static_cast<uint32_t>(value);
7021 return *this;
7022 }
7023 CONSTEXPR uint32_t get_CYCLE_CNT_OVF() const
7024 {
7025 uint32_t value = static_cast<uint32_t>(CYCLE_CNT_OVF);
7026 return value;
7027 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007028 uint32_t get_CYCLE_CNT_OVF() const volatile
7029 {
7030 uint32_t value = static_cast<uint32_t>(CYCLE_CNT_OVF);
7031 return value;
7032 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007033 CONSTEXPR pmovsclr_r &set_CYCLE_CNT_OVF(uint32_t value)
7034 {
7035 CYCLE_CNT_OVF = ((1u << 1) - 1) & static_cast<uint32_t>(value);
7036 return *this;
7037 }
7038#endif //__cplusplus
7039};
7040
7041// pmintset_r - Interrupt enable set register
7042struct pmintset_r
7043{
7044#ifdef __cplusplus
7045 private:
7046#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007047 union
7048 {
7049 struct
7050 {
7051 uint32_t EVENT_CNT_0_INT : 1; // Event counter overflow interrupt request enable bit for PMEVCNTR0
7052 uint32_t EVENT_CNT_1_INT : 1; // Event counter overflow interrupt request enable bit for PMEVCNTR1
7053 uint32_t EVENT_CNT_2_INT : 1; // Event counter overflow interrupt request enable bit for PMEVCNTR2
7054 uint32_t EVENT_CNT_3_INT : 1; // Event counter overflow interrupt request enable bit for PMEVCNTR3
7055 uint32_t reserved0 : 27;
7056 uint32_t CYCLE_CNT_INT : 1; // PMCCNTR overflow interrupt request enable bit
7057 };
7058 uint32_t word;
7059 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007060#ifdef __cplusplus
7061 public:
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007062 CONSTEXPR pmintset_r() :
7063 EVENT_CNT_0_INT(static_cast<uint32_t>(0)), EVENT_CNT_1_INT(static_cast<uint32_t>(0)),
7064 EVENT_CNT_2_INT(static_cast<uint32_t>(0)), EVENT_CNT_3_INT(static_cast<uint32_t>(0)),
7065 reserved0(static_cast<uint32_t>(0)), CYCLE_CNT_INT(static_cast<uint32_t>(0))
7066 {
7067 }
7068 CONSTEXPR pmintset_r(uint32_t init) : word(init) {}
7069 CONSTEXPR void operator=(uint32_t value)
7070 {
7071 word = value;
7072 }
7073 void operator=(uint32_t value) volatile
7074 {
7075 word = value;
7076 }
7077 CONSTEXPR operator uint32_t()
7078 {
7079 return word;
7080 }
7081 operator uint32_t() volatile
7082 {
7083 return word;
7084 }
7085 pmintset_r copy() volatile
7086 {
7087 return *this;
7088 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007089 CONSTEXPR uint32_t get_EVENT_CNT_0_INT() const
7090 {
7091 uint32_t value = static_cast<uint32_t>(EVENT_CNT_0_INT);
7092 return value;
7093 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007094 uint32_t get_EVENT_CNT_0_INT() const volatile
7095 {
7096 uint32_t value = static_cast<uint32_t>(EVENT_CNT_0_INT);
7097 return value;
7098 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007099 CONSTEXPR pmintset_r &set_EVENT_CNT_0_INT(uint32_t value)
7100 {
7101 EVENT_CNT_0_INT = ((1u << 1) - 1) & static_cast<uint32_t>(value);
7102 return *this;
7103 }
7104 CONSTEXPR uint32_t get_EVENT_CNT_1_INT() const
7105 {
7106 uint32_t value = static_cast<uint32_t>(EVENT_CNT_1_INT);
7107 return value;
7108 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007109 uint32_t get_EVENT_CNT_1_INT() const volatile
7110 {
7111 uint32_t value = static_cast<uint32_t>(EVENT_CNT_1_INT);
7112 return value;
7113 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007114 CONSTEXPR pmintset_r &set_EVENT_CNT_1_INT(uint32_t value)
7115 {
7116 EVENT_CNT_1_INT = ((1u << 1) - 1) & static_cast<uint32_t>(value);
7117 return *this;
7118 }
7119 CONSTEXPR uint32_t get_EVENT_CNT_2_INT() const
7120 {
7121 uint32_t value = static_cast<uint32_t>(EVENT_CNT_2_INT);
7122 return value;
7123 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007124 uint32_t get_EVENT_CNT_2_INT() const volatile
7125 {
7126 uint32_t value = static_cast<uint32_t>(EVENT_CNT_2_INT);
7127 return value;
7128 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007129 CONSTEXPR pmintset_r &set_EVENT_CNT_2_INT(uint32_t value)
7130 {
7131 EVENT_CNT_2_INT = ((1u << 1) - 1) & static_cast<uint32_t>(value);
7132 return *this;
7133 }
7134 CONSTEXPR uint32_t get_EVENT_CNT_3_INT() const
7135 {
7136 uint32_t value = static_cast<uint32_t>(EVENT_CNT_3_INT);
7137 return value;
7138 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007139 uint32_t get_EVENT_CNT_3_INT() const volatile
7140 {
7141 uint32_t value = static_cast<uint32_t>(EVENT_CNT_3_INT);
7142 return value;
7143 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007144 CONSTEXPR pmintset_r &set_EVENT_CNT_3_INT(uint32_t value)
7145 {
7146 EVENT_CNT_3_INT = ((1u << 1) - 1) & static_cast<uint32_t>(value);
7147 return *this;
7148 }
7149 CONSTEXPR uint32_t get_CYCLE_CNT_INT() const
7150 {
7151 uint32_t value = static_cast<uint32_t>(CYCLE_CNT_INT);
7152 return value;
7153 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007154 uint32_t get_CYCLE_CNT_INT() const volatile
7155 {
7156 uint32_t value = static_cast<uint32_t>(CYCLE_CNT_INT);
7157 return value;
7158 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007159 CONSTEXPR pmintset_r &set_CYCLE_CNT_INT(uint32_t value)
7160 {
7161 CYCLE_CNT_INT = ((1u << 1) - 1) & static_cast<uint32_t>(value);
7162 return *this;
7163 }
7164#endif //__cplusplus
7165};
7166
7167// pmintclr_r - Interrupt enable clear register
7168struct pmintclr_r
7169{
7170#ifdef __cplusplus
7171 private:
7172#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007173 union
7174 {
7175 struct
7176 {
7177 uint32_t EVENT_CNT_0_INT : 1; // Event counter overflow interrupt request disable bit for PMEVCNTR0
7178 uint32_t EVENT_CNT_1_INT : 1; // Event counter overflow interrupt request disable bit for PMEVCNTR1
7179 uint32_t EVENT_CNT_2_INT : 1; // Event counter overflow interrupt request disable bit for PMEVCNTR2
7180 uint32_t EVENT_CNT_3_INT : 1; // Event counter overflow interrupt request disable bit for PMEVCNTR3
7181 uint32_t reserved0 : 27;
7182 uint32_t CYCLE_CNT_INT : 1; // PMCCNTR overflow interrupt request disable bit
7183 };
7184 uint32_t word;
7185 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007186#ifdef __cplusplus
7187 public:
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007188 CONSTEXPR pmintclr_r() :
7189 EVENT_CNT_0_INT(static_cast<uint32_t>(0)), EVENT_CNT_1_INT(static_cast<uint32_t>(0)),
7190 EVENT_CNT_2_INT(static_cast<uint32_t>(0)), EVENT_CNT_3_INT(static_cast<uint32_t>(0)),
7191 reserved0(static_cast<uint32_t>(0)), CYCLE_CNT_INT(static_cast<uint32_t>(0))
7192 {
7193 }
7194 CONSTEXPR pmintclr_r(uint32_t init) : word(init) {}
7195 CONSTEXPR void operator=(uint32_t value)
7196 {
7197 word = value;
7198 }
7199 void operator=(uint32_t value) volatile
7200 {
7201 word = value;
7202 }
7203 CONSTEXPR operator uint32_t()
7204 {
7205 return word;
7206 }
7207 operator uint32_t() volatile
7208 {
7209 return word;
7210 }
7211 pmintclr_r copy() volatile
7212 {
7213 return *this;
7214 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007215 CONSTEXPR uint32_t get_EVENT_CNT_0_INT() const
7216 {
7217 uint32_t value = static_cast<uint32_t>(EVENT_CNT_0_INT);
7218 return value;
7219 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007220 uint32_t get_EVENT_CNT_0_INT() const volatile
7221 {
7222 uint32_t value = static_cast<uint32_t>(EVENT_CNT_0_INT);
7223 return value;
7224 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007225 CONSTEXPR pmintclr_r &set_EVENT_CNT_0_INT(uint32_t value)
7226 {
7227 EVENT_CNT_0_INT = ((1u << 1) - 1) & static_cast<uint32_t>(value);
7228 return *this;
7229 }
7230 CONSTEXPR uint32_t get_EVENT_CNT_1_INT() const
7231 {
7232 uint32_t value = static_cast<uint32_t>(EVENT_CNT_1_INT);
7233 return value;
7234 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007235 uint32_t get_EVENT_CNT_1_INT() const volatile
7236 {
7237 uint32_t value = static_cast<uint32_t>(EVENT_CNT_1_INT);
7238 return value;
7239 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007240 CONSTEXPR pmintclr_r &set_EVENT_CNT_1_INT(uint32_t value)
7241 {
7242 EVENT_CNT_1_INT = ((1u << 1) - 1) & static_cast<uint32_t>(value);
7243 return *this;
7244 }
7245 CONSTEXPR uint32_t get_EVENT_CNT_2_INT() const
7246 {
7247 uint32_t value = static_cast<uint32_t>(EVENT_CNT_2_INT);
7248 return value;
7249 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007250 uint32_t get_EVENT_CNT_2_INT() const volatile
7251 {
7252 uint32_t value = static_cast<uint32_t>(EVENT_CNT_2_INT);
7253 return value;
7254 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007255 CONSTEXPR pmintclr_r &set_EVENT_CNT_2_INT(uint32_t value)
7256 {
7257 EVENT_CNT_2_INT = ((1u << 1) - 1) & static_cast<uint32_t>(value);
7258 return *this;
7259 }
7260 CONSTEXPR uint32_t get_EVENT_CNT_3_INT() const
7261 {
7262 uint32_t value = static_cast<uint32_t>(EVENT_CNT_3_INT);
7263 return value;
7264 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007265 uint32_t get_EVENT_CNT_3_INT() const volatile
7266 {
7267 uint32_t value = static_cast<uint32_t>(EVENT_CNT_3_INT);
7268 return value;
7269 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007270 CONSTEXPR pmintclr_r &set_EVENT_CNT_3_INT(uint32_t value)
7271 {
7272 EVENT_CNT_3_INT = ((1u << 1) - 1) & static_cast<uint32_t>(value);
7273 return *this;
7274 }
7275 CONSTEXPR uint32_t get_CYCLE_CNT_INT() const
7276 {
7277 uint32_t value = static_cast<uint32_t>(CYCLE_CNT_INT);
7278 return value;
7279 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007280 uint32_t get_CYCLE_CNT_INT() const volatile
7281 {
7282 uint32_t value = static_cast<uint32_t>(CYCLE_CNT_INT);
7283 return value;
7284 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007285 CONSTEXPR pmintclr_r &set_CYCLE_CNT_INT(uint32_t value)
7286 {
7287 CYCLE_CNT_INT = ((1u << 1) - 1) & static_cast<uint32_t>(value);
7288 return *this;
7289 }
7290#endif //__cplusplus
7291};
7292
7293// pmccntr_lo_r - Performance monitor cycle count low register
7294struct pmccntr_lo_r
7295{
7296#ifdef __cplusplus
7297 private:
7298#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007299 union
7300 {
7301 uint32_t CYCLE_CNT_LO; // Cycle count low
7302 uint32_t word;
7303 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007304#ifdef __cplusplus
7305 public:
Douglas Troha2e7e3b72020-05-14 20:28:31 +02007306 CONSTEXPR pmccntr_lo_r() : CYCLE_CNT_LO(static_cast<uint32_t>(0x00000000)) {}
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007307 CONSTEXPR pmccntr_lo_r(uint32_t init) : word(init) {}
7308 CONSTEXPR void operator=(uint32_t value)
7309 {
7310 word = value;
7311 }
7312 void operator=(uint32_t value) volatile
7313 {
7314 word = value;
7315 }
7316 CONSTEXPR operator uint32_t()
7317 {
7318 return word;
7319 }
7320 operator uint32_t() volatile
7321 {
7322 return word;
7323 }
7324 pmccntr_lo_r copy() volatile
7325 {
7326 return *this;
7327 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007328 CONSTEXPR uint32_t get_CYCLE_CNT_LO() const
7329 {
7330 uint32_t value = static_cast<uint32_t>(CYCLE_CNT_LO);
7331 return value;
7332 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007333 uint32_t get_CYCLE_CNT_LO() const volatile
7334 {
7335 uint32_t value = static_cast<uint32_t>(CYCLE_CNT_LO);
7336 return value;
7337 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007338 CONSTEXPR pmccntr_lo_r &set_CYCLE_CNT_LO(uint32_t value)
7339 {
7340 CYCLE_CNT_LO = static_cast<uint32_t>(value);
7341 return *this;
7342 }
7343#endif //__cplusplus
7344};
7345
7346// pmccntr_hi_r - Performance monitor cycle count high register
7347struct pmccntr_hi_r
7348{
7349#ifdef __cplusplus
7350 private:
7351#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007352 union
7353 {
7354 struct
7355 {
7356 uint32_t CYCLE_CNT_HI : 16; // Cycle count high
7357 uint32_t reserved0 : 16;
7358 };
7359 uint32_t word;
7360 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007361#ifdef __cplusplus
7362 public:
Douglas Troha2e7e3b72020-05-14 20:28:31 +02007363 CONSTEXPR pmccntr_hi_r() : CYCLE_CNT_HI(static_cast<uint32_t>(0x0000)), reserved0(static_cast<uint32_t>(0)) {}
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007364 CONSTEXPR pmccntr_hi_r(uint32_t init) : word(init) {}
7365 CONSTEXPR void operator=(uint32_t value)
7366 {
7367 word = value;
7368 }
7369 void operator=(uint32_t value) volatile
7370 {
7371 word = value;
7372 }
7373 CONSTEXPR operator uint32_t()
7374 {
7375 return word;
7376 }
7377 operator uint32_t() volatile
7378 {
7379 return word;
7380 }
7381 pmccntr_hi_r copy() volatile
7382 {
7383 return *this;
7384 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007385 CONSTEXPR uint32_t get_CYCLE_CNT_HI() const
7386 {
7387 uint32_t value = static_cast<uint32_t>(CYCLE_CNT_HI);
7388 return value;
7389 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007390 uint32_t get_CYCLE_CNT_HI() const volatile
7391 {
7392 uint32_t value = static_cast<uint32_t>(CYCLE_CNT_HI);
7393 return value;
7394 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007395 CONSTEXPR pmccntr_hi_r &set_CYCLE_CNT_HI(uint32_t value)
7396 {
7397 CYCLE_CNT_HI = ((1u << 16) - 1) & static_cast<uint32_t>(value);
7398 return *this;
7399 }
7400#endif //__cplusplus
7401};
7402
7403// pmccntr_cfg_r - Set start/stop event on the cycle counter
7404struct pmccntr_cfg_r
7405{
7406#ifdef __cplusplus
7407 private:
7408#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007409 union
7410 {
7411 struct
7412 {
7413 uint32_t CYCLE_CNT_CFG_START : 10; // Cycle counter start event
7414 uint32_t reserved0 : 6;
7415 uint32_t CYCLE_CNT_CFG_STOP : 10; // Cycle counter stop event
7416 uint32_t reserved1 : 6;
7417 };
7418 uint32_t word;
7419 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007420#ifdef __cplusplus
7421 public:
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007422 CONSTEXPR pmccntr_cfg_r() :
Douglas Troha2e7e3b72020-05-14 20:28:31 +02007423 CYCLE_CNT_CFG_START(static_cast<uint32_t>(0x00)), reserved0(static_cast<uint32_t>(0)),
7424 CYCLE_CNT_CFG_STOP(static_cast<uint32_t>(0x00)), reserved1(static_cast<uint32_t>(0))
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007425 {
7426 }
7427 CONSTEXPR pmccntr_cfg_r(uint32_t init) : word(init) {}
7428 CONSTEXPR void operator=(uint32_t value)
7429 {
7430 word = value;
7431 }
7432 void operator=(uint32_t value) volatile
7433 {
7434 word = value;
7435 }
7436 CONSTEXPR operator uint32_t()
7437 {
7438 return word;
7439 }
7440 operator uint32_t() volatile
7441 {
7442 return word;
7443 }
7444 pmccntr_cfg_r copy() volatile
7445 {
7446 return *this;
7447 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007448 CONSTEXPR uint32_t get_CYCLE_CNT_CFG_START() const
7449 {
7450 uint32_t value = static_cast<uint32_t>(CYCLE_CNT_CFG_START);
7451 return value;
7452 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007453 uint32_t get_CYCLE_CNT_CFG_START() const volatile
7454 {
7455 uint32_t value = static_cast<uint32_t>(CYCLE_CNT_CFG_START);
7456 return value;
7457 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007458 CONSTEXPR pmccntr_cfg_r &set_CYCLE_CNT_CFG_START(uint32_t value)
7459 {
7460 CYCLE_CNT_CFG_START = ((1u << 10) - 1) & static_cast<uint32_t>(value);
7461 return *this;
7462 }
7463 CONSTEXPR uint32_t get_CYCLE_CNT_CFG_STOP() const
7464 {
7465 uint32_t value = static_cast<uint32_t>(CYCLE_CNT_CFG_STOP);
7466 return value;
7467 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007468 uint32_t get_CYCLE_CNT_CFG_STOP() const volatile
7469 {
7470 uint32_t value = static_cast<uint32_t>(CYCLE_CNT_CFG_STOP);
7471 return value;
7472 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007473 CONSTEXPR pmccntr_cfg_r &set_CYCLE_CNT_CFG_STOP(uint32_t value)
7474 {
7475 CYCLE_CNT_CFG_STOP = ((1u << 10) - 1) & static_cast<uint32_t>(value);
7476 return *this;
7477 }
7478#endif //__cplusplus
7479};
7480
Douglas Trohaf6a85da2020-05-11 11:45:28 +02007481// pmcaxi_chan_r - Set which AXI channel to monitor for latency measurements in PMU
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007482struct pmcaxi_chan_r
7483{
7484#ifdef __cplusplus
7485 private:
7486#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007487 union
7488 {
7489 struct
7490 {
Douglas Trohaf6a85da2020-05-11 11:45:28 +02007491 uint32_t CH_SEL : 4; // Channel number to monitor for latency measurements (Read: 0=Cmd 1=IFM 2=Weights
7492 // 3=Scale+Bias 4=Mem2Mem; Write: 8=OFM 9=Mem2Mem)
7493 uint32_t reserved0 : 4;
7494 uint32_t AXI_CNT_SEL : 2; // AXI counter to monitor for latency measurements (0=AXI0 counter0, 1=AXI0
7495 // counter1, 2=AXI1 counter 2, 3=AXI counter3)
7496 uint32_t BW_CH_SEL_EN : 1; // Bandwidth channel selector enable: {0=AXI bw events measured for all channels,
7497 // 1=AXI bw events measured for channel specified by CH_SEL
7498 uint32_t reserved1 : 21;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007499 };
7500 uint32_t word;
7501 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007502#ifdef __cplusplus
7503 public:
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007504 CONSTEXPR pmcaxi_chan_r() :
Douglas Trohaf6a85da2020-05-11 11:45:28 +02007505 CH_SEL(static_cast<uint32_t>(0x0)), reserved0(static_cast<uint32_t>(0)),
7506 AXI_CNT_SEL(static_cast<uint32_t>(0x000000)), BW_CH_SEL_EN(static_cast<uint32_t>(0x000000)),
7507 reserved1(static_cast<uint32_t>(0))
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007508 {
7509 }
7510 CONSTEXPR pmcaxi_chan_r(uint32_t init) : word(init) {}
7511 CONSTEXPR void operator=(uint32_t value)
7512 {
7513 word = value;
7514 }
7515 void operator=(uint32_t value) volatile
7516 {
7517 word = value;
7518 }
7519 CONSTEXPR operator uint32_t()
7520 {
7521 return word;
7522 }
7523 operator uint32_t() volatile
7524 {
7525 return word;
7526 }
7527 pmcaxi_chan_r copy() volatile
7528 {
7529 return *this;
7530 }
Douglas Trohaf6a85da2020-05-11 11:45:28 +02007531 CONSTEXPR uint32_t get_CH_SEL() const
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007532 {
Douglas Trohaf6a85da2020-05-11 11:45:28 +02007533 uint32_t value = static_cast<uint32_t>(CH_SEL);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007534 return value;
7535 }
Douglas Trohaf6a85da2020-05-11 11:45:28 +02007536 uint32_t get_CH_SEL() const volatile
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007537 {
Douglas Trohaf6a85da2020-05-11 11:45:28 +02007538 uint32_t value = static_cast<uint32_t>(CH_SEL);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007539 return value;
7540 }
Douglas Trohaf6a85da2020-05-11 11:45:28 +02007541 CONSTEXPR pmcaxi_chan_r &set_CH_SEL(uint32_t value)
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007542 {
Douglas Trohaf6a85da2020-05-11 11:45:28 +02007543 CH_SEL = ((1u << 4) - 1) & static_cast<uint32_t>(value);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007544 return *this;
7545 }
Douglas Trohaf6a85da2020-05-11 11:45:28 +02007546 CONSTEXPR uint32_t get_AXI_CNT_SEL() const
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007547 {
Douglas Trohaf6a85da2020-05-11 11:45:28 +02007548 uint32_t value = static_cast<uint32_t>(AXI_CNT_SEL);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007549 return value;
7550 }
Douglas Trohaf6a85da2020-05-11 11:45:28 +02007551 uint32_t get_AXI_CNT_SEL() const volatile
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007552 {
Douglas Trohaf6a85da2020-05-11 11:45:28 +02007553 uint32_t value = static_cast<uint32_t>(AXI_CNT_SEL);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007554 return value;
7555 }
Douglas Trohaf6a85da2020-05-11 11:45:28 +02007556 CONSTEXPR pmcaxi_chan_r &set_AXI_CNT_SEL(uint32_t value)
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007557 {
Douglas Trohaf6a85da2020-05-11 11:45:28 +02007558 AXI_CNT_SEL = ((1u << 2) - 1) & static_cast<uint32_t>(value);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007559 return *this;
7560 }
Douglas Trohaf6a85da2020-05-11 11:45:28 +02007561 CONSTEXPR uint32_t get_BW_CH_SEL_EN() const
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007562 {
Douglas Trohaf6a85da2020-05-11 11:45:28 +02007563 uint32_t value = static_cast<uint32_t>(BW_CH_SEL_EN);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007564 return value;
7565 }
Douglas Trohaf6a85da2020-05-11 11:45:28 +02007566 uint32_t get_BW_CH_SEL_EN() const volatile
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007567 {
Douglas Trohaf6a85da2020-05-11 11:45:28 +02007568 uint32_t value = static_cast<uint32_t>(BW_CH_SEL_EN);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007569 return value;
7570 }
Douglas Trohaf6a85da2020-05-11 11:45:28 +02007571 CONSTEXPR pmcaxi_chan_r &set_BW_CH_SEL_EN(uint32_t value)
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007572 {
Douglas Trohaf6a85da2020-05-11 11:45:28 +02007573 BW_CH_SEL_EN = ((1u << 1) - 1) & static_cast<uint32_t>(value);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007574 return *this;
7575 }
7576#endif //__cplusplus
7577};
7578
7579// pmevtyper0_r - Performance monitor event type register 0
7580struct pmevtyper0_r
7581{
7582#ifdef __cplusplus
7583 private:
7584#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007585 union
7586 {
7587 struct
7588 {
7589 uint32_t EV_TYPE : 10; // Event Type
7590 uint32_t reserved0 : 22;
7591 };
7592 uint32_t word;
7593 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007594#ifdef __cplusplus
7595 public:
Douglas Trohaf6a85da2020-05-11 11:45:28 +02007596 CONSTEXPR pmevtyper0_r() :
7597 EV_TYPE(static_cast<uint32_t>(::pmu_event_type::NO_EVENT)), reserved0(static_cast<uint32_t>(0))
7598 {
7599 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007600 CONSTEXPR pmevtyper0_r(uint32_t init) : word(init) {}
7601 CONSTEXPR void operator=(uint32_t value)
7602 {
7603 word = value;
7604 }
7605 void operator=(uint32_t value) volatile
7606 {
7607 word = value;
7608 }
7609 CONSTEXPR operator uint32_t()
7610 {
7611 return word;
7612 }
7613 operator uint32_t() volatile
7614 {
7615 return word;
7616 }
7617 pmevtyper0_r copy() volatile
7618 {
7619 return *this;
7620 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007621 CONSTEXPR ::pmu_event_type get_EV_TYPE() const
7622 {
7623 ::pmu_event_type value = static_cast<::pmu_event_type>(EV_TYPE);
7624 return value;
7625 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007626 ::pmu_event_type get_EV_TYPE() const volatile
7627 {
7628 ::pmu_event_type value = static_cast<::pmu_event_type>(EV_TYPE);
7629 return value;
7630 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007631 CONSTEXPR pmevtyper0_r &set_EV_TYPE(::pmu_event_type value)
7632 {
7633 EV_TYPE = ((1u << 10) - 1) & static_cast<uint32_t>(value);
7634 return *this;
7635 }
7636#endif //__cplusplus
7637};
7638
7639// pmevtyper1_r - Performance monitor event type register 1
7640struct pmevtyper1_r
7641{
7642#ifdef __cplusplus
7643 private:
7644#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007645 union
7646 {
7647 struct
7648 {
7649 uint32_t EV_TYPE : 10; // Event Type
7650 uint32_t reserved0 : 22;
7651 };
7652 uint32_t word;
7653 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007654#ifdef __cplusplus
7655 public:
Douglas Trohaf6a85da2020-05-11 11:45:28 +02007656 CONSTEXPR pmevtyper1_r() :
7657 EV_TYPE(static_cast<uint32_t>(::pmu_event_type::NO_EVENT)), reserved0(static_cast<uint32_t>(0))
7658 {
7659 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007660 CONSTEXPR pmevtyper1_r(uint32_t init) : word(init) {}
7661 CONSTEXPR void operator=(uint32_t value)
7662 {
7663 word = value;
7664 }
7665 void operator=(uint32_t value) volatile
7666 {
7667 word = value;
7668 }
7669 CONSTEXPR operator uint32_t()
7670 {
7671 return word;
7672 }
7673 operator uint32_t() volatile
7674 {
7675 return word;
7676 }
7677 pmevtyper1_r copy() volatile
7678 {
7679 return *this;
7680 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007681 CONSTEXPR ::pmu_event_type get_EV_TYPE() const
7682 {
7683 ::pmu_event_type value = static_cast<::pmu_event_type>(EV_TYPE);
7684 return value;
7685 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007686 ::pmu_event_type get_EV_TYPE() const volatile
7687 {
7688 ::pmu_event_type value = static_cast<::pmu_event_type>(EV_TYPE);
7689 return value;
7690 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007691 CONSTEXPR pmevtyper1_r &set_EV_TYPE(::pmu_event_type value)
7692 {
7693 EV_TYPE = ((1u << 10) - 1) & static_cast<uint32_t>(value);
7694 return *this;
7695 }
7696#endif //__cplusplus
7697};
7698
7699// pmevtyper2_r - Performance monitor event type register 2
7700struct pmevtyper2_r
7701{
7702#ifdef __cplusplus
7703 private:
7704#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007705 union
7706 {
7707 struct
7708 {
7709 uint32_t EV_TYPE : 10; // Event Type
7710 uint32_t reserved0 : 22;
7711 };
7712 uint32_t word;
7713 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007714#ifdef __cplusplus
7715 public:
Douglas Trohaf6a85da2020-05-11 11:45:28 +02007716 CONSTEXPR pmevtyper2_r() :
7717 EV_TYPE(static_cast<uint32_t>(::pmu_event_type::NO_EVENT)), reserved0(static_cast<uint32_t>(0))
7718 {
7719 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007720 CONSTEXPR pmevtyper2_r(uint32_t init) : word(init) {}
7721 CONSTEXPR void operator=(uint32_t value)
7722 {
7723 word = value;
7724 }
7725 void operator=(uint32_t value) volatile
7726 {
7727 word = value;
7728 }
7729 CONSTEXPR operator uint32_t()
7730 {
7731 return word;
7732 }
7733 operator uint32_t() volatile
7734 {
7735 return word;
7736 }
7737 pmevtyper2_r copy() volatile
7738 {
7739 return *this;
7740 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007741 CONSTEXPR ::pmu_event_type get_EV_TYPE() const
7742 {
7743 ::pmu_event_type value = static_cast<::pmu_event_type>(EV_TYPE);
7744 return value;
7745 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007746 ::pmu_event_type get_EV_TYPE() const volatile
7747 {
7748 ::pmu_event_type value = static_cast<::pmu_event_type>(EV_TYPE);
7749 return value;
7750 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007751 CONSTEXPR pmevtyper2_r &set_EV_TYPE(::pmu_event_type value)
7752 {
7753 EV_TYPE = ((1u << 10) - 1) & static_cast<uint32_t>(value);
7754 return *this;
7755 }
7756#endif //__cplusplus
7757};
7758
7759// pmevtyper3_r - Performance monitor event type register 3
7760struct pmevtyper3_r
7761{
7762#ifdef __cplusplus
7763 private:
7764#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007765 union
7766 {
7767 struct
7768 {
7769 uint32_t EV_TYPE : 10; // Event Type
7770 uint32_t reserved0 : 22;
7771 };
7772 uint32_t word;
7773 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007774#ifdef __cplusplus
7775 public:
Douglas Trohaf6a85da2020-05-11 11:45:28 +02007776 CONSTEXPR pmevtyper3_r() :
7777 EV_TYPE(static_cast<uint32_t>(::pmu_event_type::NO_EVENT)), reserved0(static_cast<uint32_t>(0))
7778 {
7779 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007780 CONSTEXPR pmevtyper3_r(uint32_t init) : word(init) {}
7781 CONSTEXPR void operator=(uint32_t value)
7782 {
7783 word = value;
7784 }
7785 void operator=(uint32_t value) volatile
7786 {
7787 word = value;
7788 }
7789 CONSTEXPR operator uint32_t()
7790 {
7791 return word;
7792 }
7793 operator uint32_t() volatile
7794 {
7795 return word;
7796 }
7797 pmevtyper3_r copy() volatile
7798 {
7799 return *this;
7800 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007801 CONSTEXPR ::pmu_event_type get_EV_TYPE() const
7802 {
7803 ::pmu_event_type value = static_cast<::pmu_event_type>(EV_TYPE);
7804 return value;
7805 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007806 ::pmu_event_type get_EV_TYPE() const volatile
7807 {
7808 ::pmu_event_type value = static_cast<::pmu_event_type>(EV_TYPE);
7809 return value;
7810 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007811 CONSTEXPR pmevtyper3_r &set_EV_TYPE(::pmu_event_type value)
7812 {
7813 EV_TYPE = ((1u << 10) - 1) & static_cast<uint32_t>(value);
7814 return *this;
7815 }
7816#endif //__cplusplus
7817};
7818
7819struct NPU_REG
7820{
7821 STRUCT id_r ID; // 0x0
7822 STRUCT status_r STATUS; // 0x4
7823 STRUCT cmd_r CMD; // 0x8
7824 STRUCT reset_r RESET; // 0xc
7825 STRUCT qbase0_r QBASE0; // 0x10
7826 STRUCT qbase1_r QBASE1; // 0x14
7827 STRUCT qread_r QREAD; // 0x18
7828 STRUCT qconfig_r QCONFIG; // 0x1c
7829 STRUCT qsize_r QSIZE; // 0x20
7830 STRUCT prot_r PROT; // 0x24
7831 STRUCT config_r CONFIG; // 0x28
7832 STRUCT lock_r LOCK; // 0x2c
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007833 uint32_t unused0[3];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007834 STRUCT regioncfg_r REGIONCFG; // 0x3c
7835 STRUCT axi_limit0_r AXI_LIMIT0; // 0x40
7836 STRUCT axi_limit1_r AXI_LIMIT1; // 0x44
7837 STRUCT axi_limit2_r AXI_LIMIT2; // 0x48
7838 STRUCT axi_limit3_r AXI_LIMIT3; // 0x4c
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007839 uint32_t unused1[12];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007840 STRUCT basep0_r BASEP0; // 0x80
7841 STRUCT basep1_r BASEP1; // 0x84
7842 STRUCT basep2_r BASEP2; // 0x88
7843 STRUCT basep3_r BASEP3; // 0x8c
7844 STRUCT basep4_r BASEP4; // 0x90
7845 STRUCT basep5_r BASEP5; // 0x94
7846 STRUCT basep6_r BASEP6; // 0x98
7847 STRUCT basep7_r BASEP7; // 0x9c
7848 STRUCT basep8_r BASEP8; // 0xa0
7849 STRUCT basep9_r BASEP9; // 0xa4
7850 STRUCT basep10_r BASEP10; // 0xa8
7851 STRUCT basep11_r BASEP11; // 0xac
7852 STRUCT basep12_r BASEP12; // 0xb0
7853 STRUCT basep13_r BASEP13; // 0xb4
7854 STRUCT basep14_r BASEP14; // 0xb8
7855 STRUCT basep15_r BASEP15; // 0xbc
Diqing Zhong04118062020-04-15 01:19:12 +02007856 uint32_t unused2[16];
Douglas Trohaf6a85da2020-05-11 11:45:28 +02007857 STRUCT wd_status_r WD_STATUS; // 0x100
7858 STRUCT mac_status_r MAC_STATUS; // 0x104
7859 STRUCT ao_status_r AO_STATUS; // 0x108
Diqing Zhong04118062020-04-15 01:19:12 +02007860 uint32_t unused3[1];
Douglas Trohaf6a85da2020-05-11 11:45:28 +02007861 STRUCT dma_status0_r DMA_STATUS0; // 0x110
7862 STRUCT dma_status1_r DMA_STATUS1; // 0x114
7863 uint32_t unused4[10];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007864 STRUCT clkforce_r CLKFORCE; // 0x140
Douglas Troha2e7e3b72020-05-14 20:28:31 +02007865 uint32_t DEBUG_ADDRESS; // 0x144
Douglas Trohaf6a85da2020-05-11 11:45:28 +02007866 uint32_t DEBUG_MISC; // 0x148
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007867 uint32_t DEBUGCORE; // 0x14c
Stefan Nannessone2e70242020-08-19 16:01:29 +02007868 uint32_t DEBUG_BLOCK; // 0x150
7869 uint32_t unused5[11];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007870 STRUCT pmcr_r PMCR; // 0x180
7871 STRUCT pmcntenset_r PMCNTENSET; // 0x184
7872 STRUCT pmcntenclr_r PMCNTENCLR; // 0x188
7873 STRUCT pmovsset_r PMOVSSET; // 0x18c
7874 STRUCT pmovsclr_r PMOVSCLR; // 0x190
7875 STRUCT pmintset_r PMINTSET; // 0x194
7876 STRUCT pmintclr_r PMINTCLR; // 0x198
Diqing Zhong04118062020-04-15 01:19:12 +02007877 uint32_t unused6[1];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007878 STRUCT pmccntr_lo_r PMCCNTR_LO; // 0x1a0
7879 STRUCT pmccntr_hi_r PMCCNTR_HI; // 0x1a4
7880 STRUCT pmccntr_cfg_r PMCCNTR_CFG; // 0x1a8
7881 STRUCT pmcaxi_chan_r PMCAXI_CHAN; // 0x1ac
Diqing Zhong04118062020-04-15 01:19:12 +02007882 uint32_t unused7[20];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007883 uint32_t KERNEL_X; // 0x200
7884 uint32_t KERNEL_Y; // 0x204
7885 uint32_t KERNEL_W_M1; // 0x208
7886 uint32_t KERNEL_H_M1; // 0x20c
7887 uint32_t OFM_CBLK_WIDTH_M1; // 0x210
7888 uint32_t OFM_CBLK_HEIGHT_M1; // 0x214
7889 uint32_t OFM_CBLK_DEPTH_M1; // 0x218
7890 uint32_t IFM_CBLK_DEPTH_M1; // 0x21c
7891 uint32_t OFM_X; // 0x220
7892 uint32_t OFM_Y; // 0x224
7893 uint32_t OFM_Z; // 0x228
7894 uint32_t IFM_Z; // 0x22c
7895 uint32_t PAD_TOP; // 0x230
7896 uint32_t PAD_LEFT; // 0x234
7897 uint32_t IFM_CBLK_WIDTH; // 0x238
7898 uint32_t IFM_CBLK_HEIGHT; // 0x23c
7899 uint32_t DMA_IFM_SRC; // 0x240
7900 uint32_t DMA_IFM_SRC_HI; // 0x244
7901 uint32_t DMA_IFM_DST; // 0x248
7902 uint32_t DMA_OFM_SRC; // 0x24c
7903 uint32_t DMA_OFM_DST; // 0x250
7904 uint32_t DMA_OFM_DST_HI; // 0x254
7905 uint32_t DMA_WEIGHT_SRC; // 0x258
7906 uint32_t DMA_WEIGHT_SRC_HI; // 0x25c
7907 uint32_t DMA_CMD_SRC; // 0x260
7908 uint32_t DMA_CMD_SRC_HI; // 0x264
7909 uint32_t DMA_CMD_SIZE; // 0x268
7910 uint32_t DMA_M2M_SRC; // 0x26c
7911 uint32_t DMA_M2M_SRC_HI; // 0x270
7912 uint32_t DMA_M2M_DST; // 0x274
7913 uint32_t DMA_M2M_DST_HI; // 0x278
7914 uint32_t CURRENT_QREAD; // 0x27c
7915 uint32_t DMA_SCALE_SRC; // 0x280
7916 uint32_t DMA_SCALE_SRC_HI; // 0x284
Stefan Nannessone2e70242020-08-19 16:01:29 +02007917 uint32_t unused8[11];
7918 uint32_t CURRENT_BLOCK; // 0x2b4
7919 uint32_t CURRENT_OP; // 0x2b8
7920 uint32_t CURRENT_CMD; // 0x2bc
Diqing Zhong04118062020-04-15 01:19:12 +02007921 uint32_t unused9[16];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007922 uint32_t PMEVCNTR[4]; // 0x300
Diqing Zhong04118062020-04-15 01:19:12 +02007923 uint32_t unused10[28];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007924 STRUCT pmevtyper0_r PMEVTYPER[4]; // 0x380
Diqing Zhong04118062020-04-15 01:19:12 +02007925 uint32_t unused11[28];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007926 uint32_t SHARED_BUFFER[256]; // 0x400
7927 uint32_t IFM_PAD_TOP; // 0x800
7928 uint32_t IFM_PAD_LEFT; // 0x804
7929 uint32_t IFM_PAD_RIGHT; // 0x808
7930 uint32_t IFM_PAD_BOTTOM; // 0x80c
7931 uint32_t IFM_DEPTH_M1; // 0x810
7932 uint32_t IFM_PRECISION; // 0x814
Diqing Zhong04118062020-04-15 01:19:12 +02007933 uint32_t unused12[1];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007934 uint32_t IFM_UPSCALE; // 0x81c
Diqing Zhong04118062020-04-15 01:19:12 +02007935 uint32_t unused13[1];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007936 uint32_t IFM_ZERO_POINT; // 0x824
7937 uint32_t IFM_WIDTH0_M1; // 0x828
7938 uint32_t IFM_HEIGHT0_M1; // 0x82c
7939 uint32_t IFM_HEIGHT1_M1; // 0x830
7940 uint32_t IFM_IB_END; // 0x834
Diqing Zhong04118062020-04-15 01:19:12 +02007941 uint32_t unused14[1];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007942 uint32_t IFM_REGION; // 0x83c
Diqing Zhong04118062020-04-15 01:19:12 +02007943 uint32_t unused15[1];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007944 uint32_t OFM_WIDTH_M1; // 0x844
7945 uint32_t OFM_HEIGHT_M1; // 0x848
7946 uint32_t OFM_DEPTH_M1; // 0x84c
7947 uint32_t OFM_PRECISION; // 0x850
7948 uint32_t OFM_BLK_WIDTH_M1; // 0x854
7949 uint32_t OFM_BLK_HEIGHT_M1; // 0x858
7950 uint32_t OFM_BLK_DEPTH_M1; // 0x85c
7951 uint32_t OFM_ZERO_POINT; // 0x860
Diqing Zhong04118062020-04-15 01:19:12 +02007952 uint32_t unused16[1];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007953 uint32_t OFM_WIDTH0_M1; // 0x868
7954 uint32_t OFM_HEIGHT0_M1; // 0x86c
7955 uint32_t OFM_HEIGHT1_M1; // 0x870
Diqing Zhong04118062020-04-15 01:19:12 +02007956 uint32_t unused17[2];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007957 uint32_t OFM_REGION; // 0x87c
7958 uint32_t KERNEL_WIDTH_M1; // 0x880
7959 uint32_t KERNEL_HEIGHT_M1; // 0x884
7960 uint32_t KERNEL_STRIDE; // 0x888
7961 uint32_t PARALLEL_MODE; // 0x88c
7962 uint32_t ACC_FORMAT; // 0x890
7963 uint32_t ACTIVATION; // 0x894
7964 uint32_t ACTIVATION_MIN; // 0x898
7965 uint32_t ACTIVATION_MAX; // 0x89c
7966 uint32_t WEIGHT_REGION; // 0x8a0
7967 uint32_t SCALE_REGION; // 0x8a4
Diqing Zhong04118062020-04-15 01:19:12 +02007968 uint32_t unused18[3];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007969 uint32_t AB_START; // 0x8b4
Diqing Zhong04118062020-04-15 01:19:12 +02007970 uint32_t unused19[1];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007971 uint32_t BLOCKDEP; // 0x8bc
7972 uint32_t DMA0_SRC_REGION; // 0x8c0
7973 uint32_t DMA0_DST_REGION; // 0x8c4
7974 uint32_t DMA0_SIZE0; // 0x8c8
7975 uint32_t DMA0_SIZE1; // 0x8cc
Diqing Zhong04118062020-04-15 01:19:12 +02007976 uint32_t unused20[12];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007977 uint32_t IFM2_BROADCAST; // 0x900
7978 uint32_t IFM2_SCALAR; // 0x904
Diqing Zhong04118062020-04-15 01:19:12 +02007979 uint32_t unused21[3];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007980 uint32_t IFM2_PRECISION; // 0x914
Diqing Zhong04118062020-04-15 01:19:12 +02007981 uint32_t unused22[3];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007982 uint32_t IFM2_ZERO_POINT; // 0x924
7983 uint32_t IFM2_WIDTH0_M1; // 0x928
7984 uint32_t IFM2_HEIGHT0_M1; // 0x92c
7985 uint32_t IFM2_HEIGHT1_M1; // 0x930
7986 uint32_t IFM2_IB_START; // 0x934
Diqing Zhong04118062020-04-15 01:19:12 +02007987 uint32_t unused23[1];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007988 uint32_t IFM2_REGION; // 0x93c
Diqing Zhong04118062020-04-15 01:19:12 +02007989 uint32_t unused24[48];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007990 uint32_t IFM_BASE0; // 0xa00
7991 uint32_t IFM_BASE0_HI; // 0xa04
7992 uint32_t IFM_BASE1; // 0xa08
7993 uint32_t IFM_BASE1_HI; // 0xa0c
7994 uint32_t IFM_BASE2; // 0xa10
7995 uint32_t IFM_BASE2_HI; // 0xa14
7996 uint32_t IFM_BASE3; // 0xa18
7997 uint32_t IFM_BASE3_HI; // 0xa1c
7998 uint32_t IFM_STRIDE_X; // 0xa20
7999 uint32_t IFM_STRIDE_X_HI; // 0xa24
8000 uint32_t IFM_STRIDE_Y; // 0xa28
8001 uint32_t IFM_STRIDE_Y_HI; // 0xa2c
8002 uint32_t IFM_STRIDE_C; // 0xa30
8003 uint32_t IFM_STRIDE_C_HI; // 0xa34
Diqing Zhong04118062020-04-15 01:19:12 +02008004 uint32_t unused25[2];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008005 uint32_t OFM_BASE0; // 0xa40
8006 uint32_t OFM_BASE0_HI; // 0xa44
8007 uint32_t OFM_BASE1; // 0xa48
8008 uint32_t OFM_BASE1_HI; // 0xa4c
8009 uint32_t OFM_BASE2; // 0xa50
8010 uint32_t OFM_BASE2_HI; // 0xa54
8011 uint32_t OFM_BASE3; // 0xa58
8012 uint32_t OFM_BASE3_HI; // 0xa5c
8013 uint32_t OFM_STRIDE_X; // 0xa60
8014 uint32_t OFM_STRIDE_X_HI; // 0xa64
8015 uint32_t OFM_STRIDE_Y; // 0xa68
8016 uint32_t OFM_STRIDE_Y_HI; // 0xa6c
8017 uint32_t OFM_STRIDE_C; // 0xa70
8018 uint32_t OFM_STRIDE_C_HI; // 0xa74
Diqing Zhong04118062020-04-15 01:19:12 +02008019 uint32_t unused26[2];
Douglas Trohaf6a85da2020-05-11 11:45:28 +02008020 uint32_t WEIGHT_BASE; // 0xa80
8021 uint32_t WEIGHT_BASE_HI; // 0xa84
8022 uint32_t WEIGHT_LENGTH; // 0xa88
Diqing Zhong04118062020-04-15 01:19:12 +02008023 uint32_t unused27[1];
Douglas Trohaf6a85da2020-05-11 11:45:28 +02008024 uint32_t SCALE_BASE; // 0xa90
8025 uint32_t SCALE_BASE_HI; // 0xa94
8026 uint32_t SCALE_LENGTH; // 0xa98
8027 uint32_t unused28[1];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008028 uint32_t OFM_SCALE; // 0xaa0
8029 uint32_t OFM_SCALE_SHIFT; // 0xaa4
8030 uint32_t OPA_SCALE; // 0xaa8
8031 uint32_t OPA_SCALE_SHIFT; // 0xaac
8032 uint32_t OPB_SCALE; // 0xab0
Douglas Trohaf6a85da2020-05-11 11:45:28 +02008033 uint32_t unused29[3];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008034 uint32_t DMA0_SRC; // 0xac0
8035 uint32_t DMA0_SRC_HI; // 0xac4
8036 uint32_t DMA0_DST; // 0xac8
8037 uint32_t DMA0_DST_HI; // 0xacc
8038 uint32_t DMA0_LEN; // 0xad0
8039 uint32_t DMA0_LEN_HI; // 0xad4
8040 uint32_t DMA0_SKIP0; // 0xad8
8041 uint32_t DMA0_SKIP0_HI; // 0xadc
8042 uint32_t DMA0_SKIP1; // 0xae0
8043 uint32_t DMA0_SKIP1_HI; // 0xae4
Douglas Trohaf6a85da2020-05-11 11:45:28 +02008044 uint32_t unused30[6];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008045 uint32_t IFM2_BASE0; // 0xb00
8046 uint32_t IFM2_BASE0_HI; // 0xb04
8047 uint32_t IFM2_BASE1; // 0xb08
8048 uint32_t IFM2_BASE1_HI; // 0xb0c
8049 uint32_t IFM2_BASE2; // 0xb10
8050 uint32_t IFM2_BASE2_HI; // 0xb14
8051 uint32_t IFM2_BASE3; // 0xb18
8052 uint32_t IFM2_BASE3_HI; // 0xb1c
8053 uint32_t IFM2_STRIDE_X; // 0xb20
8054 uint32_t IFM2_STRIDE_X_HI; // 0xb24
8055 uint32_t IFM2_STRIDE_Y; // 0xb28
8056 uint32_t IFM2_STRIDE_Y_HI; // 0xb2c
8057 uint32_t IFM2_STRIDE_C; // 0xb30
8058 uint32_t IFM2_STRIDE_C_HI; // 0xb34
Douglas Trohaf6a85da2020-05-11 11:45:28 +02008059 uint32_t unused31[2];
8060 uint32_t WEIGHT1_BASE; // 0xb40
8061 uint32_t WEIGHT1_BASE_HI; // 0xb44
8062 uint32_t WEIGHT1_LENGTH; // 0xb48
8063 uint32_t unused32[1];
8064 uint32_t SCALE1_BASE; // 0xb50
8065 uint32_t SCALE1_BASE_HI; // 0xb54
8066 uint32_t SCALE1_LENGTH; // 0xb58
8067 uint32_t unused33[281];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008068 uint32_t REVISION; // 0xfc0
Douglas Trohaf6a85da2020-05-11 11:45:28 +02008069 uint32_t unused34[3];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008070 STRUCT pid4_r PID4; // 0xfd0
8071 STRUCT pid5_r PID5; // 0xfd4
8072 STRUCT pid6_r PID6; // 0xfd8
8073 STRUCT pid7_r PID7; // 0xfdc
8074 STRUCT pid0_r PID0; // 0xfe0
8075 STRUCT pid1_r PID1; // 0xfe4
8076 STRUCT pid2_r PID2; // 0xfe8
8077 STRUCT pid3_r PID3; // 0xfec
8078 STRUCT cid0_r CID0; // 0xff0
8079 STRUCT cid1_r CID1; // 0xff4
8080 STRUCT cid2_r CID2; // 0xff8
8081 STRUCT cid3_r CID3; // 0xffc
8082#ifdef __cplusplus
8083 NPU_REG()
8084 {
8085 reset();
8086 }
8087 void reset()
8088 {
Stefan Nannessone2e70242020-08-19 16:01:29 +02008089 ID = 268845313;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008090 STATUS = 8;
Rakesh Gangarajaiaha20e5a72020-06-25 15:45:27 +02008091 CMD = 12;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008092 RESET = 0;
8093 QBASE0 = 0;
8094 QBASE1 = 0;
8095 QREAD = 0;
8096 QCONFIG = 0;
8097 QSIZE = 0;
8098 PROT = 0;
8099 CONFIG = 0;
8100 LOCK = 0;
8101 REGIONCFG = 0;
8102 AXI_LIMIT0 = 0;
8103 AXI_LIMIT1 = 0;
8104 AXI_LIMIT2 = 0;
8105 AXI_LIMIT3 = 0;
8106 BASEP0 = 0;
8107 BASEP1 = 0;
8108 BASEP2 = 0;
8109 BASEP3 = 0;
8110 BASEP4 = 0;
8111 BASEP5 = 0;
8112 BASEP6 = 0;
8113 BASEP7 = 0;
8114 BASEP8 = 0;
8115 BASEP9 = 0;
8116 BASEP10 = 0;
8117 BASEP11 = 0;
8118 BASEP12 = 0;
8119 BASEP13 = 0;
8120 BASEP14 = 0;
8121 BASEP15 = 0;
8122 REVISION = 0;
8123 PID4 = 4;
8124 PID5 = 0;
8125 PID6 = 0;
8126 PID7 = 0;
8127 PID0 = 128;
8128 PID1 = 181;
8129 PID2 = 11;
8130 PID3 = 0;
8131 CID0 = 13;
8132 CID1 = 240;
8133 CID2 = 5;
8134 CID3 = 177;
Diqing Zhong04118062020-04-15 01:19:12 +02008135 WD_STATUS = 0;
8136 MAC_STATUS = 0;
Diqing Zhong04118062020-04-15 01:19:12 +02008137 AO_STATUS = 0;
Douglas Trohaf6a85da2020-05-11 11:45:28 +02008138 DMA_STATUS0 = 0;
8139 DMA_STATUS1 = 0;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008140 CLKFORCE = 0;
Douglas Troha2e7e3b72020-05-14 20:28:31 +02008141 DEBUG_ADDRESS = 0;
Douglas Trohaf6a85da2020-05-11 11:45:28 +02008142 DEBUG_MISC = 0;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008143 DEBUGCORE = 0;
Stefan Nannessone2e70242020-08-19 16:01:29 +02008144 DEBUG_BLOCK = 0;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008145 KERNEL_X = 0;
8146 KERNEL_Y = 0;
8147 KERNEL_W_M1 = 0;
8148 KERNEL_H_M1 = 0;
8149 OFM_CBLK_WIDTH_M1 = 0;
8150 OFM_CBLK_HEIGHT_M1 = 0;
8151 OFM_CBLK_DEPTH_M1 = 0;
8152 IFM_CBLK_DEPTH_M1 = 0;
8153 OFM_X = 0;
8154 OFM_Y = 0;
8155 OFM_Z = 0;
8156 IFM_Z = 0;
8157 PAD_TOP = 0;
8158 PAD_LEFT = 0;
8159 IFM_CBLK_WIDTH = 0;
8160 IFM_CBLK_HEIGHT = 0;
8161 DMA_IFM_SRC = 0;
8162 DMA_IFM_SRC_HI = 0;
8163 DMA_IFM_DST = 0;
8164 DMA_OFM_SRC = 0;
8165 DMA_OFM_DST = 0;
8166 DMA_OFM_DST_HI = 0;
8167 DMA_WEIGHT_SRC = 0;
8168 DMA_WEIGHT_SRC_HI = 0;
8169 DMA_CMD_SRC = 0;
8170 DMA_CMD_SRC_HI = 0;
8171 DMA_CMD_SIZE = 0;
8172 DMA_M2M_SRC = 0;
8173 DMA_M2M_SRC_HI = 0;
8174 DMA_M2M_DST = 0;
8175 DMA_M2M_DST_HI = 0;
8176 CURRENT_QREAD = 0;
8177 DMA_SCALE_SRC = 0;
8178 DMA_SCALE_SRC_HI = 0;
Stefan Nannessone2e70242020-08-19 16:01:29 +02008179 CURRENT_BLOCK = 0;
8180 CURRENT_OP = 0;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008181 CURRENT_CMD = 0;
8182 IFM_PAD_TOP = 0;
8183 IFM_PAD_LEFT = 0;
8184 IFM_PAD_RIGHT = 0;
8185 IFM_PAD_BOTTOM = 0;
8186 IFM_DEPTH_M1 = 0;
8187 IFM_PRECISION = 0;
8188 IFM_UPSCALE = 0;
8189 IFM_ZERO_POINT = 0;
8190 IFM_WIDTH0_M1 = 0;
8191 IFM_HEIGHT0_M1 = 0;
8192 IFM_HEIGHT1_M1 = 0;
8193 IFM_IB_END = 0;
8194 IFM_REGION = 0;
8195 OFM_WIDTH_M1 = 0;
8196 OFM_HEIGHT_M1 = 0;
8197 OFM_DEPTH_M1 = 0;
8198 OFM_PRECISION = 0;
8199 OFM_BLK_WIDTH_M1 = 0;
8200 OFM_BLK_HEIGHT_M1 = 0;
8201 OFM_BLK_DEPTH_M1 = 0;
8202 OFM_ZERO_POINT = 0;
8203 OFM_WIDTH0_M1 = 0;
8204 OFM_HEIGHT0_M1 = 0;
8205 OFM_HEIGHT1_M1 = 0;
8206 OFM_REGION = 0;
8207 KERNEL_WIDTH_M1 = 0;
8208 KERNEL_HEIGHT_M1 = 0;
8209 KERNEL_STRIDE = 0;
8210 PARALLEL_MODE = 0;
8211 ACC_FORMAT = 0;
8212 ACTIVATION = 0;
8213 ACTIVATION_MIN = 0;
8214 ACTIVATION_MAX = 0;
8215 WEIGHT_REGION = 0;
8216 SCALE_REGION = 0;
8217 AB_START = 0;
8218 BLOCKDEP = 0;
8219 DMA0_SRC_REGION = 0;
8220 DMA0_DST_REGION = 0;
8221 DMA0_SIZE0 = 0;
8222 DMA0_SIZE1 = 0;
8223 IFM2_BROADCAST = 0;
8224 IFM2_SCALAR = 0;
8225 IFM2_PRECISION = 0;
8226 IFM2_ZERO_POINT = 0;
8227 IFM2_WIDTH0_M1 = 0;
8228 IFM2_HEIGHT0_M1 = 0;
8229 IFM2_HEIGHT1_M1 = 0;
8230 IFM2_IB_START = 0;
8231 IFM2_REGION = 0;
8232 IFM_BASE0 = 0;
8233 IFM_BASE0_HI = 0;
8234 IFM_BASE1 = 0;
8235 IFM_BASE1_HI = 0;
8236 IFM_BASE2 = 0;
8237 IFM_BASE2_HI = 0;
8238 IFM_BASE3 = 0;
8239 IFM_BASE3_HI = 0;
8240 IFM_STRIDE_X = 0;
8241 IFM_STRIDE_X_HI = 0;
8242 IFM_STRIDE_Y = 0;
8243 IFM_STRIDE_Y_HI = 0;
8244 IFM_STRIDE_C = 0;
8245 IFM_STRIDE_C_HI = 0;
8246 OFM_BASE0 = 0;
8247 OFM_BASE0_HI = 0;
8248 OFM_BASE1 = 0;
8249 OFM_BASE1_HI = 0;
8250 OFM_BASE2 = 0;
8251 OFM_BASE2_HI = 0;
8252 OFM_BASE3 = 0;
8253 OFM_BASE3_HI = 0;
8254 OFM_STRIDE_X = 0;
8255 OFM_STRIDE_X_HI = 0;
8256 OFM_STRIDE_Y = 0;
8257 OFM_STRIDE_Y_HI = 0;
8258 OFM_STRIDE_C = 0;
8259 OFM_STRIDE_C_HI = 0;
8260 WEIGHT_BASE = 0;
8261 WEIGHT_BASE_HI = 0;
8262 WEIGHT_LENGTH = 0;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008263 SCALE_BASE = 0;
8264 SCALE_BASE_HI = 0;
8265 SCALE_LENGTH = 0;
8266 OFM_SCALE = 0;
8267 OFM_SCALE_SHIFT = 0;
8268 OPA_SCALE = 0;
8269 OPA_SCALE_SHIFT = 0;
8270 OPB_SCALE = 0;
8271 DMA0_SRC = 0;
8272 DMA0_SRC_HI = 0;
8273 DMA0_DST = 0;
8274 DMA0_DST_HI = 0;
8275 DMA0_LEN = 0;
8276 DMA0_LEN_HI = 0;
8277 DMA0_SKIP0 = 0;
8278 DMA0_SKIP0_HI = 0;
8279 DMA0_SKIP1 = 0;
8280 DMA0_SKIP1_HI = 0;
8281 IFM2_BASE0 = 0;
8282 IFM2_BASE0_HI = 0;
8283 IFM2_BASE1 = 0;
8284 IFM2_BASE1_HI = 0;
8285 IFM2_BASE2 = 0;
8286 IFM2_BASE2_HI = 0;
8287 IFM2_BASE3 = 0;
8288 IFM2_BASE3_HI = 0;
8289 IFM2_STRIDE_X = 0;
8290 IFM2_STRIDE_X_HI = 0;
8291 IFM2_STRIDE_Y = 0;
8292 IFM2_STRIDE_Y_HI = 0;
8293 IFM2_STRIDE_C = 0;
8294 IFM2_STRIDE_C_HI = 0;
8295 WEIGHT1_BASE = 0;
8296 WEIGHT1_BASE_HI = 0;
8297 WEIGHT1_LENGTH = 0;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008298 SCALE1_BASE = 0;
8299 SCALE1_BASE_HI = 0;
8300 SCALE1_LENGTH = 0;
8301 PMCR = 8192;
8302 PMCNTENSET = 0;
8303 PMCNTENCLR = 0;
8304 PMOVSSET = 0;
8305 PMOVSCLR = 0;
8306 PMINTSET = 0;
8307 PMINTCLR = 0;
8308 PMCCNTR_LO = 0;
8309 PMCCNTR_HI = 0;
8310 PMCCNTR_CFG = 0;
8311 PMCAXI_CHAN = 0;
8312 for (size_t i = 0; i < (sizeof(PMEVCNTR) / sizeof(PMEVCNTR[0])); ++i)
8313 PMEVCNTR[i] = 0;
8314 for (size_t i = 0; i < (sizeof(PMEVTYPER) / sizeof(PMEVTYPER[0])); ++i)
8315 PMEVTYPER[i] = 0;
8316 for (size_t i = 0; i < (sizeof(SHARED_BUFFER) / sizeof(SHARED_BUFFER[0])); ++i)
8317 SHARED_BUFFER[i] = 0;
8318 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008319 uint32_t &operator[](const int addr_offset)
8320 {
8321 return reinterpret_cast<uint32_t *>(this)[addr_offset / 4];
8322 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008323 enum class access_type_t : bool
8324 {
8325 RO,
8326 RW
8327 };
8328 access_type_t get_access_type(uint32_t offset)
8329 {
8330 switch (offset)
8331 {
8332 case 0:
8333 return access_type_t::RO;
8334 case 4:
8335 return access_type_t::RO;
8336 case 8:
8337 return access_type_t::RW;
8338 case 12:
8339 return access_type_t::RW;
8340 case 16:
8341 return access_type_t::RW;
8342 case 20:
8343 return access_type_t::RW;
8344 case 24:
8345 return access_type_t::RO;
8346 case 28:
8347 return access_type_t::RW;
8348 case 32:
8349 return access_type_t::RW;
8350 case 36:
8351 return access_type_t::RO;
8352 case 40:
8353 return access_type_t::RO;
8354 case 44:
8355 return access_type_t::RW;
8356 case 60:
8357 return access_type_t::RW;
8358 case 64:
8359 return access_type_t::RW;
8360 case 68:
8361 return access_type_t::RW;
8362 case 72:
8363 return access_type_t::RW;
8364 case 76:
8365 return access_type_t::RW;
8366 case 128:
8367 return access_type_t::RW;
8368 case 132:
8369 return access_type_t::RW;
8370 case 136:
8371 return access_type_t::RW;
8372 case 140:
8373 return access_type_t::RW;
8374 case 144:
8375 return access_type_t::RW;
8376 case 148:
8377 return access_type_t::RW;
8378 case 152:
8379 return access_type_t::RW;
8380 case 156:
8381 return access_type_t::RW;
8382 case 160:
8383 return access_type_t::RW;
8384 case 164:
8385 return access_type_t::RW;
8386 case 168:
8387 return access_type_t::RW;
8388 case 172:
8389 return access_type_t::RW;
8390 case 176:
8391 return access_type_t::RW;
8392 case 180:
8393 return access_type_t::RW;
8394 case 184:
8395 return access_type_t::RW;
8396 case 188:
8397 return access_type_t::RW;
8398 case 4032:
8399 return access_type_t::RO;
8400 case 4048:
8401 return access_type_t::RO;
8402 case 4052:
8403 return access_type_t::RO;
8404 case 4056:
8405 return access_type_t::RO;
8406 case 4060:
8407 return access_type_t::RO;
8408 case 4064:
8409 return access_type_t::RO;
8410 case 4068:
8411 return access_type_t::RO;
8412 case 4072:
8413 return access_type_t::RO;
8414 case 4076:
8415 return access_type_t::RO;
8416 case 4080:
8417 return access_type_t::RO;
8418 case 4084:
8419 return access_type_t::RO;
8420 case 4088:
8421 return access_type_t::RO;
8422 case 4092:
8423 return access_type_t::RO;
Diqing Zhong04118062020-04-15 01:19:12 +02008424 case 256:
8425 return access_type_t::RO;
8426 case 260:
8427 return access_type_t::RO;
8428 case 264:
8429 return access_type_t::RO;
8430 case 272:
8431 return access_type_t::RO;
Douglas Trohaf6a85da2020-05-11 11:45:28 +02008432 case 276:
8433 return access_type_t::RO;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008434 case 320:
8435 return access_type_t::RW;
8436 case 324:
8437 return access_type_t::RW;
8438 case 328:
8439 return access_type_t::RW;
8440 case 332:
8441 return access_type_t::RW;
Stefan Nannessone2e70242020-08-19 16:01:29 +02008442 case 336:
8443 return access_type_t::RW;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008444 case 512:
8445 return access_type_t::RO;
8446 case 516:
8447 return access_type_t::RO;
8448 case 520:
8449 return access_type_t::RO;
8450 case 524:
8451 return access_type_t::RO;
8452 case 528:
8453 return access_type_t::RO;
8454 case 532:
8455 return access_type_t::RO;
8456 case 536:
8457 return access_type_t::RO;
8458 case 540:
8459 return access_type_t::RO;
8460 case 544:
8461 return access_type_t::RO;
8462 case 548:
8463 return access_type_t::RO;
8464 case 552:
8465 return access_type_t::RO;
8466 case 556:
8467 return access_type_t::RO;
8468 case 560:
8469 return access_type_t::RO;
8470 case 564:
8471 return access_type_t::RO;
8472 case 568:
8473 return access_type_t::RO;
8474 case 572:
8475 return access_type_t::RO;
8476 case 576:
8477 return access_type_t::RO;
8478 case 580:
8479 return access_type_t::RO;
8480 case 584:
8481 return access_type_t::RO;
8482 case 588:
8483 return access_type_t::RO;
8484 case 592:
8485 return access_type_t::RO;
8486 case 596:
8487 return access_type_t::RO;
8488 case 600:
8489 return access_type_t::RO;
8490 case 604:
8491 return access_type_t::RO;
8492 case 608:
8493 return access_type_t::RO;
8494 case 612:
8495 return access_type_t::RO;
8496 case 616:
8497 return access_type_t::RO;
8498 case 620:
8499 return access_type_t::RO;
8500 case 624:
8501 return access_type_t::RO;
8502 case 628:
8503 return access_type_t::RO;
8504 case 632:
8505 return access_type_t::RO;
8506 case 636:
8507 return access_type_t::RO;
8508 case 640:
8509 return access_type_t::RO;
8510 case 644:
8511 return access_type_t::RO;
Stefan Nannessone2e70242020-08-19 16:01:29 +02008512 case 692:
8513 return access_type_t::RO;
8514 case 696:
8515 return access_type_t::RO;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008516 case 700:
8517 return access_type_t::RO;
8518 case 2048:
8519 return access_type_t::RW;
8520 case 2052:
8521 return access_type_t::RW;
8522 case 2056:
8523 return access_type_t::RW;
8524 case 2060:
8525 return access_type_t::RW;
8526 case 2064:
8527 return access_type_t::RW;
8528 case 2068:
8529 return access_type_t::RW;
8530 case 2076:
8531 return access_type_t::RW;
8532 case 2084:
8533 return access_type_t::RW;
8534 case 2088:
8535 return access_type_t::RW;
8536 case 2092:
8537 return access_type_t::RW;
8538 case 2096:
8539 return access_type_t::RW;
8540 case 2100:
8541 return access_type_t::RW;
8542 case 2108:
8543 return access_type_t::RW;
8544 case 2116:
8545 return access_type_t::RW;
8546 case 2120:
8547 return access_type_t::RW;
8548 case 2124:
8549 return access_type_t::RW;
8550 case 2128:
8551 return access_type_t::RW;
8552 case 2132:
8553 return access_type_t::RW;
8554 case 2136:
8555 return access_type_t::RW;
8556 case 2140:
8557 return access_type_t::RW;
8558 case 2144:
8559 return access_type_t::RW;
8560 case 2152:
8561 return access_type_t::RW;
8562 case 2156:
8563 return access_type_t::RW;
8564 case 2160:
8565 return access_type_t::RW;
8566 case 2172:
8567 return access_type_t::RW;
8568 case 2176:
8569 return access_type_t::RW;
8570 case 2180:
8571 return access_type_t::RW;
8572 case 2184:
8573 return access_type_t::RW;
8574 case 2188:
8575 return access_type_t::RW;
8576 case 2192:
8577 return access_type_t::RW;
8578 case 2196:
8579 return access_type_t::RW;
8580 case 2200:
8581 return access_type_t::RW;
8582 case 2204:
8583 return access_type_t::RW;
8584 case 2208:
8585 return access_type_t::RW;
8586 case 2212:
8587 return access_type_t::RW;
8588 case 2228:
8589 return access_type_t::RW;
8590 case 2236:
8591 return access_type_t::RW;
8592 case 2240:
8593 return access_type_t::RW;
8594 case 2244:
8595 return access_type_t::RW;
8596 case 2248:
8597 return access_type_t::RW;
8598 case 2252:
8599 return access_type_t::RW;
8600 case 2304:
8601 return access_type_t::RW;
8602 case 2308:
8603 return access_type_t::RW;
8604 case 2324:
8605 return access_type_t::RW;
8606 case 2340:
8607 return access_type_t::RW;
8608 case 2344:
8609 return access_type_t::RW;
8610 case 2348:
8611 return access_type_t::RW;
8612 case 2352:
8613 return access_type_t::RW;
8614 case 2356:
8615 return access_type_t::RW;
8616 case 2364:
8617 return access_type_t::RW;
8618 case 2560:
8619 return access_type_t::RW;
8620 case 2564:
8621 return access_type_t::RW;
8622 case 2568:
8623 return access_type_t::RW;
8624 case 2572:
8625 return access_type_t::RW;
8626 case 2576:
8627 return access_type_t::RW;
8628 case 2580:
8629 return access_type_t::RW;
8630 case 2584:
8631 return access_type_t::RW;
8632 case 2588:
8633 return access_type_t::RW;
8634 case 2592:
8635 return access_type_t::RW;
8636 case 2596:
8637 return access_type_t::RW;
8638 case 2600:
8639 return access_type_t::RW;
8640 case 2604:
8641 return access_type_t::RW;
8642 case 2608:
8643 return access_type_t::RW;
8644 case 2612:
8645 return access_type_t::RW;
8646 case 2624:
8647 return access_type_t::RW;
8648 case 2628:
8649 return access_type_t::RW;
8650 case 2632:
8651 return access_type_t::RW;
8652 case 2636:
8653 return access_type_t::RW;
8654 case 2640:
8655 return access_type_t::RW;
8656 case 2644:
8657 return access_type_t::RW;
8658 case 2648:
8659 return access_type_t::RW;
8660 case 2652:
8661 return access_type_t::RW;
8662 case 2656:
8663 return access_type_t::RW;
8664 case 2660:
8665 return access_type_t::RW;
8666 case 2664:
8667 return access_type_t::RW;
8668 case 2668:
8669 return access_type_t::RW;
8670 case 2672:
8671 return access_type_t::RW;
8672 case 2676:
8673 return access_type_t::RW;
8674 case 2688:
8675 return access_type_t::RW;
8676 case 2692:
8677 return access_type_t::RW;
8678 case 2696:
8679 return access_type_t::RW;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008680 case 2704:
8681 return access_type_t::RW;
8682 case 2708:
8683 return access_type_t::RW;
8684 case 2712:
8685 return access_type_t::RW;
8686 case 2720:
8687 return access_type_t::RW;
8688 case 2724:
8689 return access_type_t::RW;
8690 case 2728:
8691 return access_type_t::RW;
8692 case 2732:
8693 return access_type_t::RW;
8694 case 2736:
8695 return access_type_t::RW;
8696 case 2752:
8697 return access_type_t::RW;
8698 case 2756:
8699 return access_type_t::RW;
8700 case 2760:
8701 return access_type_t::RW;
8702 case 2764:
8703 return access_type_t::RW;
8704 case 2768:
8705 return access_type_t::RW;
8706 case 2772:
8707 return access_type_t::RW;
8708 case 2776:
8709 return access_type_t::RW;
8710 case 2780:
8711 return access_type_t::RW;
8712 case 2784:
8713 return access_type_t::RW;
8714 case 2788:
8715 return access_type_t::RW;
8716 case 2816:
8717 return access_type_t::RW;
8718 case 2820:
8719 return access_type_t::RW;
8720 case 2824:
8721 return access_type_t::RW;
8722 case 2828:
8723 return access_type_t::RW;
8724 case 2832:
8725 return access_type_t::RW;
8726 case 2836:
8727 return access_type_t::RW;
8728 case 2840:
8729 return access_type_t::RW;
8730 case 2844:
8731 return access_type_t::RW;
8732 case 2848:
8733 return access_type_t::RW;
8734 case 2852:
8735 return access_type_t::RW;
8736 case 2856:
8737 return access_type_t::RW;
8738 case 2860:
8739 return access_type_t::RW;
8740 case 2864:
8741 return access_type_t::RW;
8742 case 2868:
8743 return access_type_t::RW;
8744 case 2880:
8745 return access_type_t::RW;
8746 case 2884:
8747 return access_type_t::RW;
8748 case 2888:
8749 return access_type_t::RW;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008750 case 2896:
8751 return access_type_t::RW;
8752 case 2900:
8753 return access_type_t::RW;
8754 case 2904:
8755 return access_type_t::RW;
8756 case 384:
8757 return access_type_t::RW;
8758 case 388:
8759 return access_type_t::RW;
8760 case 392:
8761 return access_type_t::RW;
8762 case 396:
8763 return access_type_t::RW;
8764 case 400:
8765 return access_type_t::RW;
8766 case 404:
8767 return access_type_t::RW;
8768 case 408:
8769 return access_type_t::RW;
8770 case 416:
8771 return access_type_t::RW;
8772 case 420:
8773 return access_type_t::RW;
8774 case 424:
8775 return access_type_t::RW;
8776 case 428:
8777 return access_type_t::RW;
8778 case 768:
8779 return access_type_t::RW;
8780 case 772:
8781 return access_type_t::RW;
8782 case 776:
8783 return access_type_t::RW;
8784 case 780:
8785 return access_type_t::RW;
8786 case 896:
8787 return access_type_t::RW;
8788 case 900:
8789 return access_type_t::RW;
8790 case 904:
8791 return access_type_t::RW;
8792 case 908:
8793 return access_type_t::RW;
8794 case 1024:
8795 return access_type_t::RW;
8796 case 1028:
8797 return access_type_t::RW;
8798 case 1032:
8799 return access_type_t::RW;
8800 case 1036:
8801 return access_type_t::RW;
8802 case 1040:
8803 return access_type_t::RW;
8804 case 1044:
8805 return access_type_t::RW;
8806 case 1048:
8807 return access_type_t::RW;
8808 case 1052:
8809 return access_type_t::RW;
8810 case 1056:
8811 return access_type_t::RW;
8812 case 1060:
8813 return access_type_t::RW;
8814 case 1064:
8815 return access_type_t::RW;
8816 case 1068:
8817 return access_type_t::RW;
8818 case 1072:
8819 return access_type_t::RW;
8820 case 1076:
8821 return access_type_t::RW;
8822 case 1080:
8823 return access_type_t::RW;
8824 case 1084:
8825 return access_type_t::RW;
8826 case 1088:
8827 return access_type_t::RW;
8828 case 1092:
8829 return access_type_t::RW;
8830 case 1096:
8831 return access_type_t::RW;
8832 case 1100:
8833 return access_type_t::RW;
8834 case 1104:
8835 return access_type_t::RW;
8836 case 1108:
8837 return access_type_t::RW;
8838 case 1112:
8839 return access_type_t::RW;
8840 case 1116:
8841 return access_type_t::RW;
8842 case 1120:
8843 return access_type_t::RW;
8844 case 1124:
8845 return access_type_t::RW;
8846 case 1128:
8847 return access_type_t::RW;
8848 case 1132:
8849 return access_type_t::RW;
8850 case 1136:
8851 return access_type_t::RW;
8852 case 1140:
8853 return access_type_t::RW;
8854 case 1144:
8855 return access_type_t::RW;
8856 case 1148:
8857 return access_type_t::RW;
8858 case 1152:
8859 return access_type_t::RW;
8860 case 1156:
8861 return access_type_t::RW;
8862 case 1160:
8863 return access_type_t::RW;
8864 case 1164:
8865 return access_type_t::RW;
8866 case 1168:
8867 return access_type_t::RW;
8868 case 1172:
8869 return access_type_t::RW;
8870 case 1176:
8871 return access_type_t::RW;
8872 case 1180:
8873 return access_type_t::RW;
8874 case 1184:
8875 return access_type_t::RW;
8876 case 1188:
8877 return access_type_t::RW;
8878 case 1192:
8879 return access_type_t::RW;
8880 case 1196:
8881 return access_type_t::RW;
8882 case 1200:
8883 return access_type_t::RW;
8884 case 1204:
8885 return access_type_t::RW;
8886 case 1208:
8887 return access_type_t::RW;
8888 case 1212:
8889 return access_type_t::RW;
8890 case 1216:
8891 return access_type_t::RW;
8892 case 1220:
8893 return access_type_t::RW;
8894 case 1224:
8895 return access_type_t::RW;
8896 case 1228:
8897 return access_type_t::RW;
8898 case 1232:
8899 return access_type_t::RW;
8900 case 1236:
8901 return access_type_t::RW;
8902 case 1240:
8903 return access_type_t::RW;
8904 case 1244:
8905 return access_type_t::RW;
8906 case 1248:
8907 return access_type_t::RW;
8908 case 1252:
8909 return access_type_t::RW;
8910 case 1256:
8911 return access_type_t::RW;
8912 case 1260:
8913 return access_type_t::RW;
8914 case 1264:
8915 return access_type_t::RW;
8916 case 1268:
8917 return access_type_t::RW;
8918 case 1272:
8919 return access_type_t::RW;
8920 case 1276:
8921 return access_type_t::RW;
8922 case 1280:
8923 return access_type_t::RW;
8924 case 1284:
8925 return access_type_t::RW;
8926 case 1288:
8927 return access_type_t::RW;
8928 case 1292:
8929 return access_type_t::RW;
8930 case 1296:
8931 return access_type_t::RW;
8932 case 1300:
8933 return access_type_t::RW;
8934 case 1304:
8935 return access_type_t::RW;
8936 case 1308:
8937 return access_type_t::RW;
8938 case 1312:
8939 return access_type_t::RW;
8940 case 1316:
8941 return access_type_t::RW;
8942 case 1320:
8943 return access_type_t::RW;
8944 case 1324:
8945 return access_type_t::RW;
8946 case 1328:
8947 return access_type_t::RW;
8948 case 1332:
8949 return access_type_t::RW;
8950 case 1336:
8951 return access_type_t::RW;
8952 case 1340:
8953 return access_type_t::RW;
8954 case 1344:
8955 return access_type_t::RW;
8956 case 1348:
8957 return access_type_t::RW;
8958 case 1352:
8959 return access_type_t::RW;
8960 case 1356:
8961 return access_type_t::RW;
8962 case 1360:
8963 return access_type_t::RW;
8964 case 1364:
8965 return access_type_t::RW;
8966 case 1368:
8967 return access_type_t::RW;
8968 case 1372:
8969 return access_type_t::RW;
8970 case 1376:
8971 return access_type_t::RW;
8972 case 1380:
8973 return access_type_t::RW;
8974 case 1384:
8975 return access_type_t::RW;
8976 case 1388:
8977 return access_type_t::RW;
8978 case 1392:
8979 return access_type_t::RW;
8980 case 1396:
8981 return access_type_t::RW;
8982 case 1400:
8983 return access_type_t::RW;
8984 case 1404:
8985 return access_type_t::RW;
8986 case 1408:
8987 return access_type_t::RW;
8988 case 1412:
8989 return access_type_t::RW;
8990 case 1416:
8991 return access_type_t::RW;
8992 case 1420:
8993 return access_type_t::RW;
8994 case 1424:
8995 return access_type_t::RW;
8996 case 1428:
8997 return access_type_t::RW;
8998 case 1432:
8999 return access_type_t::RW;
9000 case 1436:
9001 return access_type_t::RW;
9002 case 1440:
9003 return access_type_t::RW;
9004 case 1444:
9005 return access_type_t::RW;
9006 case 1448:
9007 return access_type_t::RW;
9008 case 1452:
9009 return access_type_t::RW;
9010 case 1456:
9011 return access_type_t::RW;
9012 case 1460:
9013 return access_type_t::RW;
9014 case 1464:
9015 return access_type_t::RW;
9016 case 1468:
9017 return access_type_t::RW;
9018 case 1472:
9019 return access_type_t::RW;
9020 case 1476:
9021 return access_type_t::RW;
9022 case 1480:
9023 return access_type_t::RW;
9024 case 1484:
9025 return access_type_t::RW;
9026 case 1488:
9027 return access_type_t::RW;
9028 case 1492:
9029 return access_type_t::RW;
9030 case 1496:
9031 return access_type_t::RW;
9032 case 1500:
9033 return access_type_t::RW;
9034 case 1504:
9035 return access_type_t::RW;
9036 case 1508:
9037 return access_type_t::RW;
9038 case 1512:
9039 return access_type_t::RW;
9040 case 1516:
9041 return access_type_t::RW;
9042 case 1520:
9043 return access_type_t::RW;
9044 case 1524:
9045 return access_type_t::RW;
9046 case 1528:
9047 return access_type_t::RW;
9048 case 1532:
9049 return access_type_t::RW;
9050 case 1536:
9051 return access_type_t::RW;
9052 case 1540:
9053 return access_type_t::RW;
9054 case 1544:
9055 return access_type_t::RW;
9056 case 1548:
9057 return access_type_t::RW;
9058 case 1552:
9059 return access_type_t::RW;
9060 case 1556:
9061 return access_type_t::RW;
9062 case 1560:
9063 return access_type_t::RW;
9064 case 1564:
9065 return access_type_t::RW;
9066 case 1568:
9067 return access_type_t::RW;
9068 case 1572:
9069 return access_type_t::RW;
9070 case 1576:
9071 return access_type_t::RW;
9072 case 1580:
9073 return access_type_t::RW;
9074 case 1584:
9075 return access_type_t::RW;
9076 case 1588:
9077 return access_type_t::RW;
9078 case 1592:
9079 return access_type_t::RW;
9080 case 1596:
9081 return access_type_t::RW;
9082 case 1600:
9083 return access_type_t::RW;
9084 case 1604:
9085 return access_type_t::RW;
9086 case 1608:
9087 return access_type_t::RW;
9088 case 1612:
9089 return access_type_t::RW;
9090 case 1616:
9091 return access_type_t::RW;
9092 case 1620:
9093 return access_type_t::RW;
9094 case 1624:
9095 return access_type_t::RW;
9096 case 1628:
9097 return access_type_t::RW;
9098 case 1632:
9099 return access_type_t::RW;
9100 case 1636:
9101 return access_type_t::RW;
9102 case 1640:
9103 return access_type_t::RW;
9104 case 1644:
9105 return access_type_t::RW;
9106 case 1648:
9107 return access_type_t::RW;
9108 case 1652:
9109 return access_type_t::RW;
9110 case 1656:
9111 return access_type_t::RW;
9112 case 1660:
9113 return access_type_t::RW;
9114 case 1664:
9115 return access_type_t::RW;
9116 case 1668:
9117 return access_type_t::RW;
9118 case 1672:
9119 return access_type_t::RW;
9120 case 1676:
9121 return access_type_t::RW;
9122 case 1680:
9123 return access_type_t::RW;
9124 case 1684:
9125 return access_type_t::RW;
9126 case 1688:
9127 return access_type_t::RW;
9128 case 1692:
9129 return access_type_t::RW;
9130 case 1696:
9131 return access_type_t::RW;
9132 case 1700:
9133 return access_type_t::RW;
9134 case 1704:
9135 return access_type_t::RW;
9136 case 1708:
9137 return access_type_t::RW;
9138 case 1712:
9139 return access_type_t::RW;
9140 case 1716:
9141 return access_type_t::RW;
9142 case 1720:
9143 return access_type_t::RW;
9144 case 1724:
9145 return access_type_t::RW;
9146 case 1728:
9147 return access_type_t::RW;
9148 case 1732:
9149 return access_type_t::RW;
9150 case 1736:
9151 return access_type_t::RW;
9152 case 1740:
9153 return access_type_t::RW;
9154 case 1744:
9155 return access_type_t::RW;
9156 case 1748:
9157 return access_type_t::RW;
9158 case 1752:
9159 return access_type_t::RW;
9160 case 1756:
9161 return access_type_t::RW;
9162 case 1760:
9163 return access_type_t::RW;
9164 case 1764:
9165 return access_type_t::RW;
9166 case 1768:
9167 return access_type_t::RW;
9168 case 1772:
9169 return access_type_t::RW;
9170 case 1776:
9171 return access_type_t::RW;
9172 case 1780:
9173 return access_type_t::RW;
9174 case 1784:
9175 return access_type_t::RW;
9176 case 1788:
9177 return access_type_t::RW;
9178 case 1792:
9179 return access_type_t::RW;
9180 case 1796:
9181 return access_type_t::RW;
9182 case 1800:
9183 return access_type_t::RW;
9184 case 1804:
9185 return access_type_t::RW;
9186 case 1808:
9187 return access_type_t::RW;
9188 case 1812:
9189 return access_type_t::RW;
9190 case 1816:
9191 return access_type_t::RW;
9192 case 1820:
9193 return access_type_t::RW;
9194 case 1824:
9195 return access_type_t::RW;
9196 case 1828:
9197 return access_type_t::RW;
9198 case 1832:
9199 return access_type_t::RW;
9200 case 1836:
9201 return access_type_t::RW;
9202 case 1840:
9203 return access_type_t::RW;
9204 case 1844:
9205 return access_type_t::RW;
9206 case 1848:
9207 return access_type_t::RW;
9208 case 1852:
9209 return access_type_t::RW;
9210 case 1856:
9211 return access_type_t::RW;
9212 case 1860:
9213 return access_type_t::RW;
9214 case 1864:
9215 return access_type_t::RW;
9216 case 1868:
9217 return access_type_t::RW;
9218 case 1872:
9219 return access_type_t::RW;
9220 case 1876:
9221 return access_type_t::RW;
9222 case 1880:
9223 return access_type_t::RW;
9224 case 1884:
9225 return access_type_t::RW;
9226 case 1888:
9227 return access_type_t::RW;
9228 case 1892:
9229 return access_type_t::RW;
9230 case 1896:
9231 return access_type_t::RW;
9232 case 1900:
9233 return access_type_t::RW;
9234 case 1904:
9235 return access_type_t::RW;
9236 case 1908:
9237 return access_type_t::RW;
9238 case 1912:
9239 return access_type_t::RW;
9240 case 1916:
9241 return access_type_t::RW;
9242 case 1920:
9243 return access_type_t::RW;
9244 case 1924:
9245 return access_type_t::RW;
9246 case 1928:
9247 return access_type_t::RW;
9248 case 1932:
9249 return access_type_t::RW;
9250 case 1936:
9251 return access_type_t::RW;
9252 case 1940:
9253 return access_type_t::RW;
9254 case 1944:
9255 return access_type_t::RW;
9256 case 1948:
9257 return access_type_t::RW;
9258 case 1952:
9259 return access_type_t::RW;
9260 case 1956:
9261 return access_type_t::RW;
9262 case 1960:
9263 return access_type_t::RW;
9264 case 1964:
9265 return access_type_t::RW;
9266 case 1968:
9267 return access_type_t::RW;
9268 case 1972:
9269 return access_type_t::RW;
9270 case 1976:
9271 return access_type_t::RW;
9272 case 1980:
9273 return access_type_t::RW;
9274 case 1984:
9275 return access_type_t::RW;
9276 case 1988:
9277 return access_type_t::RW;
9278 case 1992:
9279 return access_type_t::RW;
9280 case 1996:
9281 return access_type_t::RW;
9282 case 2000:
9283 return access_type_t::RW;
9284 case 2004:
9285 return access_type_t::RW;
9286 case 2008:
9287 return access_type_t::RW;
9288 case 2012:
9289 return access_type_t::RW;
9290 case 2016:
9291 return access_type_t::RW;
9292 case 2020:
9293 return access_type_t::RW;
9294 case 2024:
9295 return access_type_t::RW;
9296 case 2028:
9297 return access_type_t::RW;
9298 case 2032:
9299 return access_type_t::RW;
9300 case 2036:
9301 return access_type_t::RW;
9302 case 2040:
9303 return access_type_t::RW;
9304 case 2044:
9305 return access_type_t::RW;
9306 default:
9307 throw std::runtime_error("invalid register address");
9308 }
9309 }
9310#endif //__cplusplus
9311};
9312
9313// Data structure for commands without payload
9314struct command_no_payload_t
9315{
9316 uint32_t cmd_code : 10;
9317 uint32_t must_be_zero0 : 6; // 0
9318 uint32_t param : 16;
9319#ifdef __cplusplus
9320 CONSTEXPR bool valid() const
9321 {
9322 return must_be_zero0 == 0;
9323 }
9324 CONSTEXPR void init()
9325 {
9326 must_be_zero0 = 0;
9327 }
9328 CONSTEXPR ::cmd0 get_cmd_code() const
9329 {
9330 return static_cast<::cmd0>(cmd_code);
9331 }
9332 CONSTEXPR command_no_payload_t &set_cmd_code(::cmd0 value)
9333 {
9334 cmd_code = static_cast<uint32_t>(value);
9335 return *this;
9336 }
9337 CONSTEXPR uint32_t get_param() const
9338 {
9339 return static_cast<uint32_t>(param);
9340 }
9341 CONSTEXPR command_no_payload_t &set_param(uint32_t value)
9342 {
9343 param = static_cast<uint32_t>(value);
9344 return *this;
9345 }
9346#endif //__cplusplus
9347};
9348
9349// Data structure for commands with payload
9350struct command_with_payload_t
9351{
9352 uint32_t cmd_code : 10;
9353 uint32_t must_be_zero : 4; // 0
9354 uint32_t payload_size : 2; // Min:1 Max:2
9355 uint32_t param : 16;
9356 uint32_t data : 32;
9357#ifdef __cplusplus
9358 CONSTEXPR bool valid() const
9359 {
9360 return must_be_zero == 0 && payload_size >= 1 && payload_size <= 2;
9361 }
9362 CONSTEXPR void init()
9363 {
9364 must_be_zero = 0;
9365 payload_size = 1;
9366 }
9367 CONSTEXPR ::cmd1 get_cmd_code() const
9368 {
9369 return static_cast<::cmd1>(cmd_code);
9370 }
9371 CONSTEXPR command_with_payload_t &set_cmd_code(::cmd1 value)
9372 {
9373 cmd_code = static_cast<uint32_t>(value);
9374 return *this;
9375 }
9376 CONSTEXPR uint32_t get_data() const
9377 {
9378 return static_cast<uint32_t>(data);
9379 }
9380 CONSTEXPR command_with_payload_t &set_data(uint32_t value)
9381 {
9382 data = static_cast<uint32_t>(value);
9383 return *this;
9384 }
9385 CONSTEXPR uint32_t get_param() const
9386 {
9387 return static_cast<uint32_t>(param);
9388 }
9389 CONSTEXPR command_with_payload_t &set_param(uint32_t value)
9390 {
9391 param = static_cast<uint32_t>(value);
9392 return *this;
9393 }
9394 CONSTEXPR uint32_t get_payload_size() const
9395 {
9396 return static_cast<uint32_t>(payload_size);
9397 }
9398 CONSTEXPR command_with_payload_t &set_payload_size(uint32_t value)
9399 {
9400 payload_size = static_cast<uint32_t>(value);
9401 return *this;
9402 }
9403#endif //__cplusplus
9404};
9405
9406// Move to stopped state once all commands to this point are done. Raise IRQ to the host and logically OR the mask into
9407// the status register upper 16 bits (see the status register)
9408struct npu_op_stop_t
9409{
9410 uint32_t cmd_code : 10; // NPU_OP_STOP
9411 uint32_t must_be_zero0 : 6; // 0
9412 uint32_t mask : 16;
9413#ifdef __cplusplus
9414 CONSTEXPR bool valid() const
9415 {
9416 return cmd_code == static_cast<uint32_t>(cmd0::NPU_OP_STOP) && must_be_zero0 == 0;
9417 }
9418 CONSTEXPR void init()
9419 {
9420 cmd_code = static_cast<uint32_t>(cmd0::NPU_OP_STOP);
9421 must_be_zero0 = 0;
9422 }
9423 CONSTEXPR ::cmd0 get_cmd_code() const
9424 {
9425 return static_cast<::cmd0>(cmd_code);
9426 }
9427 CONSTEXPR npu_op_stop_t &set_cmd_code(::cmd0 value)
9428 {
9429 cmd_code = static_cast<uint32_t>(value);
9430 return *this;
9431 }
9432 CONSTEXPR uint32_t get_mask() const
9433 {
9434 return static_cast<uint32_t>(mask);
9435 }
9436 CONSTEXPR npu_op_stop_t &set_mask(uint32_t value)
9437 {
9438 mask = static_cast<uint32_t>(value);
9439 return *this;
9440 }
9441#endif //__cplusplus
9442};
9443
9444// Raise IRQ to the host and logically OR the mask into the status register upper 16 bits (see the status register)
9445struct npu_op_irq_t
9446{
9447 uint32_t cmd_code : 10; // NPU_OP_IRQ
9448 uint32_t must_be_zero0 : 6; // 0
9449 uint32_t mask : 16;
9450#ifdef __cplusplus
9451 CONSTEXPR bool valid() const
9452 {
9453 return cmd_code == static_cast<uint32_t>(cmd0::NPU_OP_IRQ) && must_be_zero0 == 0;
9454 }
9455 CONSTEXPR void init()
9456 {
9457 cmd_code = static_cast<uint32_t>(cmd0::NPU_OP_IRQ);
9458 must_be_zero0 = 0;
9459 }
9460 CONSTEXPR ::cmd0 get_cmd_code() const
9461 {
9462 return static_cast<::cmd0>(cmd_code);
9463 }
9464 CONSTEXPR npu_op_irq_t &set_cmd_code(::cmd0 value)
9465 {
9466 cmd_code = static_cast<uint32_t>(value);
9467 return *this;
9468 }
9469 CONSTEXPR uint32_t get_mask() const
9470 {
9471 return static_cast<uint32_t>(mask);
9472 }
9473 CONSTEXPR npu_op_irq_t &set_mask(uint32_t value)
9474 {
9475 mask = static_cast<uint32_t>(value);
9476 return *this;
9477 }
9478#endif //__cplusplus
9479};
9480
9481// Start stripe with full convolution or deconvolution
9482struct npu_op_conv_t
9483{
9484 uint32_t cmd_code : 10; // NPU_OP_CONV
9485 uint32_t must_be_zero0 : 6; // 0
9486 uint32_t reserved0 : 16;
9487#ifdef __cplusplus
9488 CONSTEXPR bool valid() const
9489 {
9490 return cmd_code == static_cast<uint32_t>(cmd0::NPU_OP_CONV) && must_be_zero0 == 0;
9491 }
9492 CONSTEXPR void init()
9493 {
9494 cmd_code = static_cast<uint32_t>(cmd0::NPU_OP_CONV);
9495 must_be_zero0 = 0;
9496 }
9497 CONSTEXPR ::cmd0 get_cmd_code() const
9498 {
9499 return static_cast<::cmd0>(cmd_code);
9500 }
9501 CONSTEXPR npu_op_conv_t &set_cmd_code(::cmd0 value)
9502 {
9503 cmd_code = static_cast<uint32_t>(value);
9504 return *this;
9505 }
9506#endif //__cplusplus
9507};
9508
9509// Start stripe width depth-wise convolution or deconvolution operation
9510struct npu_op_depthwise_t
9511{
9512 uint32_t cmd_code : 10; // NPU_OP_DEPTHWISE
9513 uint32_t must_be_zero0 : 6; // 0
9514 uint32_t reserved0 : 16;
9515#ifdef __cplusplus
9516 CONSTEXPR bool valid() const
9517 {
9518 return cmd_code == static_cast<uint32_t>(cmd0::NPU_OP_DEPTHWISE) && must_be_zero0 == 0;
9519 }
9520 CONSTEXPR void init()
9521 {
9522 cmd_code = static_cast<uint32_t>(cmd0::NPU_OP_DEPTHWISE);
9523 must_be_zero0 = 0;
9524 }
9525 CONSTEXPR ::cmd0 get_cmd_code() const
9526 {
9527 return static_cast<::cmd0>(cmd_code);
9528 }
9529 CONSTEXPR npu_op_depthwise_t &set_cmd_code(::cmd0 value)
9530 {
9531 cmd_code = static_cast<uint32_t>(value);
9532 return *this;
9533 }
9534#endif //__cplusplus
9535};
9536
9537// Start stripe with pooling operation
9538struct npu_op_pool_t
9539{
9540 uint32_t cmd_code : 10; // NPU_OP_POOL
9541 uint32_t must_be_zero0 : 6; // 0
9542 uint32_t mode : 16;
9543#ifdef __cplusplus
9544 CONSTEXPR bool valid() const
9545 {
9546 return cmd_code == static_cast<uint32_t>(cmd0::NPU_OP_POOL) && must_be_zero0 == 0;
9547 }
9548 CONSTEXPR void init()
9549 {
9550 cmd_code = static_cast<uint32_t>(cmd0::NPU_OP_POOL);
9551 must_be_zero0 = 0;
9552 }
9553 CONSTEXPR ::cmd0 get_cmd_code() const
9554 {
9555 return static_cast<::cmd0>(cmd_code);
9556 }
9557 CONSTEXPR npu_op_pool_t &set_cmd_code(::cmd0 value)
9558 {
9559 cmd_code = static_cast<uint32_t>(value);
9560 return *this;
9561 }
9562 CONSTEXPR ::pooling_mode get_mode() const
9563 {
9564 return static_cast<::pooling_mode>(mode);
9565 }
9566 CONSTEXPR npu_op_pool_t &set_mode(::pooling_mode value)
9567 {
9568 mode = static_cast<uint32_t>(value);
9569 return *this;
9570 }
9571#endif //__cplusplus
9572};
9573
9574// Start stripe with pointwise operation
9575struct npu_op_elementwise_t
9576{
9577 uint32_t cmd_code : 10; // NPU_OP_ELEMENTWISE
9578 uint32_t must_be_zero0 : 6; // 0
9579 uint32_t mode : 16;
9580#ifdef __cplusplus
9581 CONSTEXPR bool valid() const
9582 {
9583 return cmd_code == static_cast<uint32_t>(cmd0::NPU_OP_ELEMENTWISE) && must_be_zero0 == 0;
9584 }
9585 CONSTEXPR void init()
9586 {
9587 cmd_code = static_cast<uint32_t>(cmd0::NPU_OP_ELEMENTWISE);
9588 must_be_zero0 = 0;
9589 }
9590 CONSTEXPR ::cmd0 get_cmd_code() const
9591 {
9592 return static_cast<::cmd0>(cmd_code);
9593 }
9594 CONSTEXPR npu_op_elementwise_t &set_cmd_code(::cmd0 value)
9595 {
9596 cmd_code = static_cast<uint32_t>(value);
9597 return *this;
9598 }
9599 CONSTEXPR ::elementwise_mode get_mode() const
9600 {
9601 return static_cast<::elementwise_mode>(mode);
9602 }
9603 CONSTEXPR npu_op_elementwise_t &set_mode(::elementwise_mode value)
9604 {
9605 mode = static_cast<uint32_t>(value);
9606 return *this;
9607 }
9608#endif //__cplusplus
9609};
9610
9611// Queue new DMA for the given channel with the given mode. Mode bit 0 specifies the source address type 0=external,
9612// 1=internal Mode bit 1 specifies the destination address type 0=external, 1=internal In Ethos-U55 there is only one
9613// user channel so channel=0. If the channel is fully in use then the command blocks until a new DMA can start
9614struct npu_op_dma_start_t
9615{
9616 uint32_t cmd_code : 10; // NPU_OP_DMA_START
9617 uint32_t must_be_zero0 : 6; // 0
9618 uint32_t channel_mode : 16;
9619#ifdef __cplusplus
9620 CONSTEXPR bool valid() const
9621 {
9622 return cmd_code == static_cast<uint32_t>(cmd0::NPU_OP_DMA_START) && must_be_zero0 == 0;
9623 }
9624 CONSTEXPR void init()
9625 {
9626 cmd_code = static_cast<uint32_t>(cmd0::NPU_OP_DMA_START);
9627 must_be_zero0 = 0;
9628 }
9629 CONSTEXPR uint32_t get_channel_mode() const
9630 {
9631 return static_cast<uint32_t>(channel_mode);
9632 }
9633 CONSTEXPR npu_op_dma_start_t &set_channel_mode(uint32_t value)
9634 {
9635 channel_mode = static_cast<uint32_t>(value);
9636 return *this;
9637 }
9638 CONSTEXPR ::cmd0 get_cmd_code() const
9639 {
9640 return static_cast<::cmd0>(cmd_code);
9641 }
9642 CONSTEXPR npu_op_dma_start_t &set_cmd_code(::cmd0 value)
9643 {
9644 cmd_code = static_cast<uint32_t>(value);
9645 return *this;
9646 }
9647#endif //__cplusplus
9648};
9649
9650// Wait for the DMA channel to have k or fewer active descriptors outstanding. In Ethos-U55 there is only one user
9651// channel so channel=0. In Ethos-U55 there is only one descriptor per channel so k=0 and the command waits for the
9652// single DMA to be complete.
9653struct npu_op_dma_wait_t
9654{
9655 uint32_t cmd_code : 10; // NPU_OP_DMA_WAIT
9656 uint32_t must_be_zero0 : 6; // 0
9657 uint32_t reserved0 : 16;
9658#ifdef __cplusplus
9659 CONSTEXPR bool valid() const
9660 {
9661 return cmd_code == static_cast<uint32_t>(cmd0::NPU_OP_DMA_WAIT) && must_be_zero0 == 0;
9662 }
9663 CONSTEXPR void init()
9664 {
9665 cmd_code = static_cast<uint32_t>(cmd0::NPU_OP_DMA_WAIT);
9666 must_be_zero0 = 0;
9667 }
9668 CONSTEXPR ::cmd0 get_cmd_code() const
9669 {
9670 return static_cast<::cmd0>(cmd_code);
9671 }
9672 CONSTEXPR npu_op_dma_wait_t &set_cmd_code(::cmd0 value)
9673 {
9674 cmd_code = static_cast<uint32_t>(value);
9675 return *this;
9676 }
9677#endif //__cplusplus
9678};
9679
9680// Wait for n or fewer kernel operations to be remaining (not complete) before starting the next command. A kernel
9681// operation is Conv, Depthwise, Pool, VectorProd Elementwise. This command is typically placed before an
9682// NPU_OP_DMA_START command to prevent the DMA from starting until a previous kernel operation reading the memory has
9683// completed.
9684struct npu_op_kernel_wait_t
9685{
9686 uint32_t cmd_code : 10; // NPU_OP_KERNEL_WAIT
9687 uint32_t must_be_zero0 : 6; // 0
9688 uint32_t param : 16;
9689#ifdef __cplusplus
9690 CONSTEXPR bool valid() const
9691 {
9692 return cmd_code == static_cast<uint32_t>(cmd0::NPU_OP_KERNEL_WAIT) && must_be_zero0 == 0;
9693 }
9694 CONSTEXPR void init()
9695 {
9696 cmd_code = static_cast<uint32_t>(cmd0::NPU_OP_KERNEL_WAIT);
9697 must_be_zero0 = 0;
9698 }
9699 CONSTEXPR ::cmd0 get_cmd_code() const
9700 {
9701 return static_cast<::cmd0>(cmd_code);
9702 }
9703 CONSTEXPR npu_op_kernel_wait_t &set_cmd_code(::cmd0 value)
9704 {
9705 cmd_code = static_cast<uint32_t>(value);
9706 return *this;
9707 }
9708 CONSTEXPR uint32_t get_param() const
9709 {
9710 return static_cast<uint32_t>(param);
9711 }
9712 CONSTEXPR npu_op_kernel_wait_t &set_param(uint32_t value)
9713 {
9714 param = static_cast<uint32_t>(value);
9715 return *this;
9716 }
9717#endif //__cplusplus
9718};
9719
9720// Enable or disable PMU counting (debug feature only).
9721struct npu_op_pmu_mask_t
9722{
9723 uint32_t cmd_code : 10; // NPU_OP_PMU_MASK
9724 uint32_t must_be_zero0 : 6; // 0
9725 uint32_t param : 16;
9726#ifdef __cplusplus
9727 CONSTEXPR bool valid() const
9728 {
9729 return cmd_code == static_cast<uint32_t>(cmd0::NPU_OP_PMU_MASK) && must_be_zero0 == 0;
9730 }
9731 CONSTEXPR void init()
9732 {
9733 cmd_code = static_cast<uint32_t>(cmd0::NPU_OP_PMU_MASK);
9734 must_be_zero0 = 0;
9735 }
9736 CONSTEXPR ::cmd0 get_cmd_code() const
9737 {
9738 return static_cast<::cmd0>(cmd_code);
9739 }
9740 CONSTEXPR npu_op_pmu_mask_t &set_cmd_code(::cmd0 value)
9741 {
9742 cmd_code = static_cast<uint32_t>(value);
9743 return *this;
9744 }
9745 CONSTEXPR uint32_t get_param() const
9746 {
9747 return static_cast<uint32_t>(param);
9748 }
9749 CONSTEXPR npu_op_pmu_mask_t &set_param(uint32_t value)
9750 {
9751 param = static_cast<uint32_t>(value);
9752 return *this;
9753 }
9754#endif //__cplusplus
9755};
9756
9757// IFM top pad
9758struct npu_set_ifm_pad_top_t
9759{
9760 uint32_t cmd_code : 10; // NPU_SET_IFM_PAD_TOP
9761 uint32_t must_be_zero0 : 6; // 0
9762 uint32_t param : 16;
9763#ifdef __cplusplus
9764 CONSTEXPR bool valid() const
9765 {
9766 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_IFM_PAD_TOP) && must_be_zero0 == 0;
9767 }
9768 CONSTEXPR void init()
9769 {
9770 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_IFM_PAD_TOP);
9771 must_be_zero0 = 0;
9772 }
9773 CONSTEXPR ::cmd0 get_cmd_code() const
9774 {
9775 return static_cast<::cmd0>(cmd_code);
9776 }
9777 CONSTEXPR npu_set_ifm_pad_top_t &set_cmd_code(::cmd0 value)
9778 {
9779 cmd_code = static_cast<uint32_t>(value);
9780 return *this;
9781 }
9782 CONSTEXPR uint32_t get_param() const
9783 {
9784 return static_cast<uint32_t>(param);
9785 }
9786 CONSTEXPR npu_set_ifm_pad_top_t &set_param(uint32_t value)
9787 {
9788 param = static_cast<uint32_t>(value);
9789 return *this;
9790 }
9791#endif //__cplusplus
9792};
9793
9794// IFM left pad
9795struct npu_set_ifm_pad_left_t
9796{
9797 uint32_t cmd_code : 10; // NPU_SET_IFM_PAD_LEFT
9798 uint32_t must_be_zero0 : 6; // 0
9799 uint32_t param : 16;
9800#ifdef __cplusplus
9801 CONSTEXPR bool valid() const
9802 {
9803 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_IFM_PAD_LEFT) && must_be_zero0 == 0;
9804 }
9805 CONSTEXPR void init()
9806 {
9807 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_IFM_PAD_LEFT);
9808 must_be_zero0 = 0;
9809 }
9810 CONSTEXPR ::cmd0 get_cmd_code() const
9811 {
9812 return static_cast<::cmd0>(cmd_code);
9813 }
9814 CONSTEXPR npu_set_ifm_pad_left_t &set_cmd_code(::cmd0 value)
9815 {
9816 cmd_code = static_cast<uint32_t>(value);
9817 return *this;
9818 }
9819 CONSTEXPR uint32_t get_param() const
9820 {
9821 return static_cast<uint32_t>(param);
9822 }
9823 CONSTEXPR npu_set_ifm_pad_left_t &set_param(uint32_t value)
9824 {
9825 param = static_cast<uint32_t>(value);
9826 return *this;
9827 }
9828#endif //__cplusplus
9829};
9830
9831// IFM right pad
9832struct npu_set_ifm_pad_right_t
9833{
9834 uint32_t cmd_code : 10; // NPU_SET_IFM_PAD_RIGHT
9835 uint32_t must_be_zero0 : 6; // 0
9836 uint32_t param : 16;
9837#ifdef __cplusplus
9838 CONSTEXPR bool valid() const
9839 {
9840 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_IFM_PAD_RIGHT) && must_be_zero0 == 0;
9841 }
9842 CONSTEXPR void init()
9843 {
9844 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_IFM_PAD_RIGHT);
9845 must_be_zero0 = 0;
9846 }
9847 CONSTEXPR ::cmd0 get_cmd_code() const
9848 {
9849 return static_cast<::cmd0>(cmd_code);
9850 }
9851 CONSTEXPR npu_set_ifm_pad_right_t &set_cmd_code(::cmd0 value)
9852 {
9853 cmd_code = static_cast<uint32_t>(value);
9854 return *this;
9855 }
9856 CONSTEXPR uint32_t get_param() const
9857 {
9858 return static_cast<uint32_t>(param);
9859 }
9860 CONSTEXPR npu_set_ifm_pad_right_t &set_param(uint32_t value)
9861 {
9862 param = static_cast<uint32_t>(value);
9863 return *this;
9864 }
9865#endif //__cplusplus
9866};
9867
9868// IFM bottom pad
9869struct npu_set_ifm_pad_bottom_t
9870{
9871 uint32_t cmd_code : 10; // NPU_SET_IFM_PAD_BOTTOM
9872 uint32_t must_be_zero0 : 6; // 0
9873 uint32_t param : 16;
9874#ifdef __cplusplus
9875 CONSTEXPR bool valid() const
9876 {
9877 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_IFM_PAD_BOTTOM) && must_be_zero0 == 0;
9878 }
9879 CONSTEXPR void init()
9880 {
9881 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_IFM_PAD_BOTTOM);
9882 must_be_zero0 = 0;
9883 }
9884 CONSTEXPR ::cmd0 get_cmd_code() const
9885 {
9886 return static_cast<::cmd0>(cmd_code);
9887 }
9888 CONSTEXPR npu_set_ifm_pad_bottom_t &set_cmd_code(::cmd0 value)
9889 {
9890 cmd_code = static_cast<uint32_t>(value);
9891 return *this;
9892 }
9893 CONSTEXPR uint32_t get_param() const
9894 {
9895 return static_cast<uint32_t>(param);
9896 }
9897 CONSTEXPR npu_set_ifm_pad_bottom_t &set_param(uint32_t value)
9898 {
9899 param = static_cast<uint32_t>(value);
9900 return *this;
9901 }
9902#endif //__cplusplus
9903};
9904
9905// Number of input channels - 1
9906struct npu_set_ifm_depth_m1_t
9907{
9908 uint32_t cmd_code : 10; // NPU_SET_IFM_DEPTH_M1
9909 uint32_t must_be_zero0 : 6; // 0
9910 uint32_t param : 16;
9911#ifdef __cplusplus
9912 CONSTEXPR bool valid() const
9913 {
9914 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_IFM_DEPTH_M1) && must_be_zero0 == 0;
9915 }
9916 CONSTEXPR void init()
9917 {
9918 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_IFM_DEPTH_M1);
9919 must_be_zero0 = 0;
9920 }
9921 CONSTEXPR ::cmd0 get_cmd_code() const
9922 {
9923 return static_cast<::cmd0>(cmd_code);
9924 }
9925 CONSTEXPR npu_set_ifm_depth_m1_t &set_cmd_code(::cmd0 value)
9926 {
9927 cmd_code = static_cast<uint32_t>(value);
9928 return *this;
9929 }
9930 CONSTEXPR uint32_t get_param() const
9931 {
9932 return static_cast<uint32_t>(param);
9933 }
9934 CONSTEXPR npu_set_ifm_depth_m1_t &set_param(uint32_t value)
9935 {
9936 param = static_cast<uint32_t>(value);
9937 return *this;
9938 }
9939#endif //__cplusplus
9940};
9941
9942// Set IFM precision
9943struct npu_set_ifm_precision_t
9944{
9945 uint32_t cmd_code : 10; // NPU_SET_IFM_PRECISION
9946 uint32_t must_be_zero0 : 6; // 0
Diqing Zhonga9f38d52020-04-27 11:00:13 +02009947 uint32_t precision : 4;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02009948 uint32_t reserved0 : 2;
9949 uint32_t format : 2;
9950 uint32_t scale_mode : 2;
9951 uint32_t reserved1 : 4;
9952 uint32_t round_mode : 2;
9953#ifdef __cplusplus
9954 CONSTEXPR bool valid() const
9955 {
9956 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_IFM_PRECISION) && must_be_zero0 == 0;
9957 }
9958 CONSTEXPR void init()
9959 {
9960 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_IFM_PRECISION);
9961 must_be_zero0 = 0;
9962 }
9963 CONSTEXPR ::cmd0 get_cmd_code() const
9964 {
9965 return static_cast<::cmd0>(cmd_code);
9966 }
9967 CONSTEXPR npu_set_ifm_precision_t &set_cmd_code(::cmd0 value)
9968 {
9969 cmd_code = static_cast<uint32_t>(value);
9970 return *this;
9971 }
9972 CONSTEXPR ::data_format get_format() const
9973 {
9974 return static_cast<::data_format>(format);
9975 }
9976 CONSTEXPR npu_set_ifm_precision_t &set_format(::data_format value)
9977 {
9978 format = static_cast<uint32_t>(value);
9979 return *this;
9980 }
Diqing Zhonga9f38d52020-04-27 11:00:13 +02009981 CONSTEXPR ::ifm_precision get_precision() const
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02009982 {
Diqing Zhonga9f38d52020-04-27 11:00:13 +02009983 return static_cast<::ifm_precision>(precision);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02009984 }
Diqing Zhonga9f38d52020-04-27 11:00:13 +02009985 CONSTEXPR npu_set_ifm_precision_t &set_precision(::ifm_precision value)
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02009986 {
Diqing Zhonga9f38d52020-04-27 11:00:13 +02009987 precision = static_cast<uint32_t>(value);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02009988 return *this;
9989 }
9990 CONSTEXPR ::rounding get_round_mode() const
9991 {
9992 return static_cast<::rounding>(round_mode);
9993 }
9994 CONSTEXPR npu_set_ifm_precision_t &set_round_mode(::rounding value)
9995 {
9996 round_mode = static_cast<uint32_t>(value);
9997 return *this;
9998 }
9999 CONSTEXPR ::ifm_scale_mode get_scale_mode() const
10000 {
10001 return static_cast<::ifm_scale_mode>(scale_mode);
10002 }
10003 CONSTEXPR npu_set_ifm_precision_t &set_scale_mode(::ifm_scale_mode value)
10004 {
10005 scale_mode = static_cast<uint32_t>(value);
10006 return *this;
10007 }
10008#endif //__cplusplus
10009};
10010
10011// b[1:0] = upscale mode (0=none, 1=2x2 nearest, 2=2x2 transpose)
10012struct npu_set_ifm_upscale_t
10013{
10014 uint32_t cmd_code : 10; // NPU_SET_IFM_UPSCALE
10015 uint32_t must_be_zero0 : 6; // 0
10016 uint32_t mode : 2;
10017 uint32_t reserved0 : 14;
10018#ifdef __cplusplus
10019 CONSTEXPR bool valid() const
10020 {
10021 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_IFM_UPSCALE) && must_be_zero0 == 0;
10022 }
10023 CONSTEXPR void init()
10024 {
10025 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_IFM_UPSCALE);
10026 must_be_zero0 = 0;
10027 }
10028 CONSTEXPR ::cmd0 get_cmd_code() const
10029 {
10030 return static_cast<::cmd0>(cmd_code);
10031 }
10032 CONSTEXPR npu_set_ifm_upscale_t &set_cmd_code(::cmd0 value)
10033 {
10034 cmd_code = static_cast<uint32_t>(value);
10035 return *this;
10036 }
10037 CONSTEXPR ::resampling_mode get_mode() const
10038 {
10039 return static_cast<::resampling_mode>(mode);
10040 }
10041 CONSTEXPR npu_set_ifm_upscale_t &set_mode(::resampling_mode value)
10042 {
10043 mode = static_cast<uint32_t>(value);
10044 return *this;
10045 }
10046#endif //__cplusplus
10047};
10048
10049// Zero point offset (so value that 0 is encoded as)
10050struct npu_set_ifm_zero_point_t
10051{
10052 uint32_t cmd_code : 10; // NPU_SET_IFM_ZERO_POINT
10053 uint32_t must_be_zero0 : 6; // 0
10054 uint32_t param : 16;
10055#ifdef __cplusplus
10056 CONSTEXPR bool valid() const
10057 {
10058 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_IFM_ZERO_POINT) && must_be_zero0 == 0;
10059 }
10060 CONSTEXPR void init()
10061 {
10062 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_IFM_ZERO_POINT);
10063 must_be_zero0 = 0;
10064 }
10065 CONSTEXPR ::cmd0 get_cmd_code() const
10066 {
10067 return static_cast<::cmd0>(cmd_code);
10068 }
10069 CONSTEXPR npu_set_ifm_zero_point_t &set_cmd_code(::cmd0 value)
10070 {
10071 cmd_code = static_cast<uint32_t>(value);
10072 return *this;
10073 }
10074 CONSTEXPR uint32_t get_param() const
10075 {
10076 return static_cast<uint32_t>(param);
10077 }
10078 CONSTEXPR npu_set_ifm_zero_point_t &set_param(uint32_t value)
10079 {
10080 param = static_cast<uint32_t>(value);
10081 return *this;
10082 }
10083#endif //__cplusplus
10084};
10085
10086// IFM Tile 0 and tile 2 (width-1)
10087struct npu_set_ifm_width0_m1_t
10088{
10089 uint32_t cmd_code : 10; // NPU_SET_IFM_WIDTH0_M1
10090 uint32_t must_be_zero0 : 6; // 0
10091 uint32_t param : 16;
10092#ifdef __cplusplus
10093 CONSTEXPR bool valid() const
10094 {
10095 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_IFM_WIDTH0_M1) && must_be_zero0 == 0;
10096 }
10097 CONSTEXPR void init()
10098 {
10099 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_IFM_WIDTH0_M1);
10100 must_be_zero0 = 0;
10101 }
10102 CONSTEXPR ::cmd0 get_cmd_code() const
10103 {
10104 return static_cast<::cmd0>(cmd_code);
10105 }
10106 CONSTEXPR npu_set_ifm_width0_m1_t &set_cmd_code(::cmd0 value)
10107 {
10108 cmd_code = static_cast<uint32_t>(value);
10109 return *this;
10110 }
10111 CONSTEXPR uint32_t get_param() const
10112 {
10113 return static_cast<uint32_t>(param);
10114 }
10115 CONSTEXPR npu_set_ifm_width0_m1_t &set_param(uint32_t value)
10116 {
10117 param = static_cast<uint32_t>(value);
10118 return *this;
10119 }
10120#endif //__cplusplus
10121};
10122
10123// IFM Tile 0 (height-1)
10124struct npu_set_ifm_height0_m1_t
10125{
10126 uint32_t cmd_code : 10; // NPU_SET_IFM_HEIGHT0_M1
10127 uint32_t must_be_zero0 : 6; // 0
10128 uint32_t param : 16;
10129#ifdef __cplusplus
10130 CONSTEXPR bool valid() const
10131 {
10132 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_IFM_HEIGHT0_M1) && must_be_zero0 == 0;
10133 }
10134 CONSTEXPR void init()
10135 {
10136 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_IFM_HEIGHT0_M1);
10137 must_be_zero0 = 0;
10138 }
10139 CONSTEXPR ::cmd0 get_cmd_code() const
10140 {
10141 return static_cast<::cmd0>(cmd_code);
10142 }
10143 CONSTEXPR npu_set_ifm_height0_m1_t &set_cmd_code(::cmd0 value)
10144 {
10145 cmd_code = static_cast<uint32_t>(value);
10146 return *this;
10147 }
10148 CONSTEXPR uint32_t get_param() const
10149 {
10150 return static_cast<uint32_t>(param);
10151 }
10152 CONSTEXPR npu_set_ifm_height0_m1_t &set_param(uint32_t value)
10153 {
10154 param = static_cast<uint32_t>(value);
10155 return *this;
10156 }
10157#endif //__cplusplus
10158};
10159
10160// IFM Tile 1 (height-1)
10161struct npu_set_ifm_height1_m1_t
10162{
10163 uint32_t cmd_code : 10; // NPU_SET_IFM_HEIGHT1_M1
10164 uint32_t must_be_zero0 : 6; // 0
10165 uint32_t param : 16;
10166#ifdef __cplusplus
10167 CONSTEXPR bool valid() const
10168 {
10169 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_IFM_HEIGHT1_M1) && must_be_zero0 == 0;
10170 }
10171 CONSTEXPR void init()
10172 {
10173 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_IFM_HEIGHT1_M1);
10174 must_be_zero0 = 0;
10175 }
10176 CONSTEXPR ::cmd0 get_cmd_code() const
10177 {
10178 return static_cast<::cmd0>(cmd_code);
10179 }
10180 CONSTEXPR npu_set_ifm_height1_m1_t &set_cmd_code(::cmd0 value)
10181 {
10182 cmd_code = static_cast<uint32_t>(value);
10183 return *this;
10184 }
10185 CONSTEXPR uint32_t get_param() const
10186 {
10187 return static_cast<uint32_t>(param);
10188 }
10189 CONSTEXPR npu_set_ifm_height1_m1_t &set_param(uint32_t value)
10190 {
10191 param = static_cast<uint32_t>(value);
10192 return *this;
10193 }
10194#endif //__cplusplus
10195};
10196
10197// End of IB0,IB1 buffers in the SHRAM in KB units. Multiple of 2.
10198struct npu_set_ifm_ib_end_t
10199{
10200 uint32_t cmd_code : 10; // NPU_SET_IFM_IB_END
10201 uint32_t must_be_zero0 : 6; // 0
10202 uint32_t param : 16;
10203#ifdef __cplusplus
10204 CONSTEXPR bool valid() const
10205 {
10206 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_IFM_IB_END) && must_be_zero0 == 0;
10207 }
10208 CONSTEXPR void init()
10209 {
10210 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_IFM_IB_END);
10211 must_be_zero0 = 0;
10212 }
10213 CONSTEXPR ::cmd0 get_cmd_code() const
10214 {
10215 return static_cast<::cmd0>(cmd_code);
10216 }
10217 CONSTEXPR npu_set_ifm_ib_end_t &set_cmd_code(::cmd0 value)
10218 {
10219 cmd_code = static_cast<uint32_t>(value);
10220 return *this;
10221 }
10222 CONSTEXPR uint32_t get_param() const
10223 {
10224 return static_cast<uint32_t>(param);
10225 }
10226 CONSTEXPR npu_set_ifm_ib_end_t &set_param(uint32_t value)
10227 {
10228 param = static_cast<uint32_t>(value);
10229 return *this;
10230 }
10231#endif //__cplusplus
10232};
10233
10234// Index n for IFM access: BasePointer[n] is added to all IFM offsets
10235struct npu_set_ifm_region_t
10236{
10237 uint32_t cmd_code : 10; // NPU_SET_IFM_REGION
10238 uint32_t must_be_zero0 : 6; // 0
10239 uint32_t param : 16;
10240#ifdef __cplusplus
10241 CONSTEXPR bool valid() const
10242 {
10243 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_IFM_REGION) && must_be_zero0 == 0;
10244 }
10245 CONSTEXPR void init()
10246 {
10247 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_IFM_REGION);
10248 must_be_zero0 = 0;
10249 }
10250 CONSTEXPR ::cmd0 get_cmd_code() const
10251 {
10252 return static_cast<::cmd0>(cmd_code);
10253 }
10254 CONSTEXPR npu_set_ifm_region_t &set_cmd_code(::cmd0 value)
10255 {
10256 cmd_code = static_cast<uint32_t>(value);
10257 return *this;
10258 }
10259 CONSTEXPR uint32_t get_param() const
10260 {
10261 return static_cast<uint32_t>(param);
10262 }
10263 CONSTEXPR npu_set_ifm_region_t &set_param(uint32_t value)
10264 {
10265 param = static_cast<uint32_t>(value);
10266 return *this;
10267 }
10268#endif //__cplusplus
10269};
10270
10271// Output feature map width -1 (for the stripe to process)
10272struct npu_set_ofm_width_m1_t
10273{
10274 uint32_t cmd_code : 10; // NPU_SET_OFM_WIDTH_M1
10275 uint32_t must_be_zero0 : 6; // 0
10276 uint32_t param : 16;
10277#ifdef __cplusplus
10278 CONSTEXPR bool valid() const
10279 {
10280 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_OFM_WIDTH_M1) && must_be_zero0 == 0;
10281 }
10282 CONSTEXPR void init()
10283 {
10284 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_OFM_WIDTH_M1);
10285 must_be_zero0 = 0;
10286 }
10287 CONSTEXPR ::cmd0 get_cmd_code() const
10288 {
10289 return static_cast<::cmd0>(cmd_code);
10290 }
10291 CONSTEXPR npu_set_ofm_width_m1_t &set_cmd_code(::cmd0 value)
10292 {
10293 cmd_code = static_cast<uint32_t>(value);
10294 return *this;
10295 }
10296 CONSTEXPR uint32_t get_param() const
10297 {
10298 return static_cast<uint32_t>(param);
10299 }
10300 CONSTEXPR npu_set_ofm_width_m1_t &set_param(uint32_t value)
10301 {
10302 param = static_cast<uint32_t>(value);
10303 return *this;
10304 }
10305#endif //__cplusplus
10306};
10307
10308// Output feature map height -1 (for the stripe to process)
10309struct npu_set_ofm_height_m1_t
10310{
10311 uint32_t cmd_code : 10; // NPU_SET_OFM_HEIGHT_M1
10312 uint32_t must_be_zero0 : 6; // 0
10313 uint32_t param : 16;
10314#ifdef __cplusplus
10315 CONSTEXPR bool valid() const
10316 {
10317 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_OFM_HEIGHT_M1) && must_be_zero0 == 0;
10318 }
10319 CONSTEXPR void init()
10320 {
10321 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_OFM_HEIGHT_M1);
10322 must_be_zero0 = 0;
10323 }
10324 CONSTEXPR ::cmd0 get_cmd_code() const
10325 {
10326 return static_cast<::cmd0>(cmd_code);
10327 }
10328 CONSTEXPR npu_set_ofm_height_m1_t &set_cmd_code(::cmd0 value)
10329 {
10330 cmd_code = static_cast<uint32_t>(value);
10331 return *this;
10332 }
10333 CONSTEXPR uint32_t get_param() const
10334 {
10335 return static_cast<uint32_t>(param);
10336 }
10337 CONSTEXPR npu_set_ofm_height_m1_t &set_param(uint32_t value)
10338 {
10339 param = static_cast<uint32_t>(value);
10340 return *this;
10341 }
10342#endif //__cplusplus
10343};
10344
10345// Output feature map depth -1 (for the stripe to process)
10346struct npu_set_ofm_depth_m1_t
10347{
10348 uint32_t cmd_code : 10; // NPU_SET_OFM_DEPTH_M1
10349 uint32_t must_be_zero0 : 6; // 0
10350 uint32_t param : 16;
10351#ifdef __cplusplus
10352 CONSTEXPR bool valid() const
10353 {
10354 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_OFM_DEPTH_M1) && must_be_zero0 == 0;
10355 }
10356 CONSTEXPR void init()
10357 {
10358 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_OFM_DEPTH_M1);
10359 must_be_zero0 = 0;
10360 }
10361 CONSTEXPR ::cmd0 get_cmd_code() const
10362 {
10363 return static_cast<::cmd0>(cmd_code);
10364 }
10365 CONSTEXPR npu_set_ofm_depth_m1_t &set_cmd_code(::cmd0 value)
10366 {
10367 cmd_code = static_cast<uint32_t>(value);
10368 return *this;
10369 }
10370 CONSTEXPR uint32_t get_param() const
10371 {
10372 return static_cast<uint32_t>(param);
10373 }
10374 CONSTEXPR npu_set_ofm_depth_m1_t &set_param(uint32_t value)
10375 {
10376 param = static_cast<uint32_t>(value);
10377 return *this;
10378 }
10379#endif //__cplusplus
10380};
10381
10382// Set OFM precision
10383struct npu_set_ofm_precision_t
10384{
10385 uint32_t cmd_code : 10; // NPU_SET_OFM_PRECISION
10386 uint32_t must_be_zero0 : 6; // 0
10387 uint32_t precision : 3;
10388 uint32_t reserved0 : 3;
10389 uint32_t format : 2;
10390 uint32_t scaling : 1; // 0=Per channel scale/bias 1=Global scale (SET_OFM_SCALE), no bias
10391 uint32_t reserved1 : 5;
10392 uint32_t rounding : 2; // 0=TFL rounding 1=truncate towards zero 2=natural rounding
10393#ifdef __cplusplus
10394 CONSTEXPR bool valid() const
10395 {
10396 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_OFM_PRECISION) && must_be_zero0 == 0;
10397 }
10398 CONSTEXPR void init()
10399 {
10400 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_OFM_PRECISION);
10401 must_be_zero0 = 0;
10402 }
10403 CONSTEXPR ::cmd0 get_cmd_code() const
10404 {
10405 return static_cast<::cmd0>(cmd_code);
10406 }
10407 CONSTEXPR npu_set_ofm_precision_t &set_cmd_code(::cmd0 value)
10408 {
10409 cmd_code = static_cast<uint32_t>(value);
10410 return *this;
10411 }
10412 CONSTEXPR ::data_format get_format() const
10413 {
10414 return static_cast<::data_format>(format);
10415 }
10416 CONSTEXPR npu_set_ofm_precision_t &set_format(::data_format value)
10417 {
10418 format = static_cast<uint32_t>(value);
10419 return *this;
10420 }
10421 CONSTEXPR ::ofm_precision get_precision() const
10422 {
10423 return static_cast<::ofm_precision>(precision);
10424 }
10425 CONSTEXPR npu_set_ofm_precision_t &set_precision(::ofm_precision value)
10426 {
10427 precision = static_cast<uint32_t>(value);
10428 return *this;
10429 }
10430 CONSTEXPR ::rounding get_rounding() const
10431 {
10432 return static_cast<::rounding>(rounding);
10433 }
10434 CONSTEXPR npu_set_ofm_precision_t &set_rounding(::rounding value)
10435 {
10436 rounding = static_cast<uint32_t>(value);
10437 return *this;
10438 }
10439 CONSTEXPR uint32_t get_scaling() const
10440 {
10441 return static_cast<uint32_t>(scaling);
10442 }
10443 CONSTEXPR npu_set_ofm_precision_t &set_scaling(uint32_t value)
10444 {
10445 scaling = static_cast<uint32_t>(value);
10446 return *this;
10447 }
10448#endif //__cplusplus
10449};
10450
10451// TSU block width - 1 (provided sufficient data remaining)
10452struct npu_set_ofm_blk_width_m1_t
10453{
10454 uint32_t cmd_code : 10; // NPU_SET_OFM_BLK_WIDTH_M1
10455 uint32_t must_be_zero0 : 6; // 0
10456 uint32_t param : 16;
10457#ifdef __cplusplus
10458 CONSTEXPR bool valid() const
10459 {
10460 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_OFM_BLK_WIDTH_M1) && must_be_zero0 == 0;
10461 }
10462 CONSTEXPR void init()
10463 {
10464 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_OFM_BLK_WIDTH_M1);
10465 must_be_zero0 = 0;
10466 }
10467 CONSTEXPR ::cmd0 get_cmd_code() const
10468 {
10469 return static_cast<::cmd0>(cmd_code);
10470 }
10471 CONSTEXPR npu_set_ofm_blk_width_m1_t &set_cmd_code(::cmd0 value)
10472 {
10473 cmd_code = static_cast<uint32_t>(value);
10474 return *this;
10475 }
10476 CONSTEXPR uint32_t get_param() const
10477 {
10478 return static_cast<uint32_t>(param);
10479 }
10480 CONSTEXPR npu_set_ofm_blk_width_m1_t &set_param(uint32_t value)
10481 {
10482 param = static_cast<uint32_t>(value);
10483 return *this;
10484 }
10485#endif //__cplusplus
10486};
10487
10488// TSU block height -1 (provided sufficient data remaining)
10489struct npu_set_ofm_blk_height_m1_t
10490{
10491 uint32_t cmd_code : 10; // NPU_SET_OFM_BLK_HEIGHT_M1
10492 uint32_t must_be_zero0 : 6; // 0
10493 uint32_t param : 16;
10494#ifdef __cplusplus
10495 CONSTEXPR bool valid() const
10496 {
10497 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_OFM_BLK_HEIGHT_M1) && must_be_zero0 == 0;
10498 }
10499 CONSTEXPR void init()
10500 {
10501 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_OFM_BLK_HEIGHT_M1);
10502 must_be_zero0 = 0;
10503 }
10504 CONSTEXPR ::cmd0 get_cmd_code() const
10505 {
10506 return static_cast<::cmd0>(cmd_code);
10507 }
10508 CONSTEXPR npu_set_ofm_blk_height_m1_t &set_cmd_code(::cmd0 value)
10509 {
10510 cmd_code = static_cast<uint32_t>(value);
10511 return *this;
10512 }
10513 CONSTEXPR uint32_t get_param() const
10514 {
10515 return static_cast<uint32_t>(param);
10516 }
10517 CONSTEXPR npu_set_ofm_blk_height_m1_t &set_param(uint32_t value)
10518 {
10519 param = static_cast<uint32_t>(value);
10520 return *this;
10521 }
10522#endif //__cplusplus
10523};
10524
10525// TSU block depth -1 (provided sufficient data remaining)
10526struct npu_set_ofm_blk_depth_m1_t
10527{
10528 uint32_t cmd_code : 10; // NPU_SET_OFM_BLK_DEPTH_M1
10529 uint32_t must_be_zero0 : 6; // 0
10530 uint32_t param : 16;
10531#ifdef __cplusplus
10532 CONSTEXPR bool valid() const
10533 {
10534 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_OFM_BLK_DEPTH_M1) && must_be_zero0 == 0;
10535 }
10536 CONSTEXPR void init()
10537 {
10538 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_OFM_BLK_DEPTH_M1);
10539 must_be_zero0 = 0;
10540 }
10541 CONSTEXPR ::cmd0 get_cmd_code() const
10542 {
10543 return static_cast<::cmd0>(cmd_code);
10544 }
10545 CONSTEXPR npu_set_ofm_blk_depth_m1_t &set_cmd_code(::cmd0 value)
10546 {
10547 cmd_code = static_cast<uint32_t>(value);
10548 return *this;
10549 }
10550 CONSTEXPR uint32_t get_param() const
10551 {
10552 return static_cast<uint32_t>(param);
10553 }
10554 CONSTEXPR npu_set_ofm_blk_depth_m1_t &set_param(uint32_t value)
10555 {
10556 param = static_cast<uint32_t>(value);
10557 return *this;
10558 }
10559#endif //__cplusplus
10560};
10561
10562// Zero point offset (so value that 0 is encoded as)
10563struct npu_set_ofm_zero_point_t
10564{
10565 uint32_t cmd_code : 10; // NPU_SET_OFM_ZERO_POINT
10566 uint32_t must_be_zero0 : 6; // 0
10567 uint32_t param : 16;
10568#ifdef __cplusplus
10569 CONSTEXPR bool valid() const
10570 {
10571 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_OFM_ZERO_POINT) && must_be_zero0 == 0;
10572 }
10573 CONSTEXPR void init()
10574 {
10575 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_OFM_ZERO_POINT);
10576 must_be_zero0 = 0;
10577 }
10578 CONSTEXPR ::cmd0 get_cmd_code() const
10579 {
10580 return static_cast<::cmd0>(cmd_code);
10581 }
10582 CONSTEXPR npu_set_ofm_zero_point_t &set_cmd_code(::cmd0 value)
10583 {
10584 cmd_code = static_cast<uint32_t>(value);
10585 return *this;
10586 }
10587 CONSTEXPR uint32_t get_param() const
10588 {
10589 return static_cast<uint32_t>(param);
10590 }
10591 CONSTEXPR npu_set_ofm_zero_point_t &set_param(uint32_t value)
10592 {
10593 param = static_cast<uint32_t>(value);
10594 return *this;
10595 }
10596#endif //__cplusplus
10597};
10598
10599// OFM Tile 0 and tile 2 (width-1)
10600struct npu_set_ofm_width0_m1_t
10601{
10602 uint32_t cmd_code : 10; // NPU_SET_OFM_WIDTH0_M1
10603 uint32_t must_be_zero0 : 6; // 0
10604 uint32_t param : 16;
10605#ifdef __cplusplus
10606 CONSTEXPR bool valid() const
10607 {
10608 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_OFM_WIDTH0_M1) && must_be_zero0 == 0;
10609 }
10610 CONSTEXPR void init()
10611 {
10612 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_OFM_WIDTH0_M1);
10613 must_be_zero0 = 0;
10614 }
10615 CONSTEXPR ::cmd0 get_cmd_code() const
10616 {
10617 return static_cast<::cmd0>(cmd_code);
10618 }
10619 CONSTEXPR npu_set_ofm_width0_m1_t &set_cmd_code(::cmd0 value)
10620 {
10621 cmd_code = static_cast<uint32_t>(value);
10622 return *this;
10623 }
10624 CONSTEXPR uint32_t get_param() const
10625 {
10626 return static_cast<uint32_t>(param);
10627 }
10628 CONSTEXPR npu_set_ofm_width0_m1_t &set_param(uint32_t value)
10629 {
10630 param = static_cast<uint32_t>(value);
10631 return *this;
10632 }
10633#endif //__cplusplus
10634};
10635
10636// OFM Tile 0 (height-1)
10637struct npu_set_ofm_height0_m1_t
10638{
10639 uint32_t cmd_code : 10; // NPU_SET_OFM_HEIGHT0_M1
10640 uint32_t must_be_zero0 : 6; // 0
10641 uint32_t param : 16;
10642#ifdef __cplusplus
10643 CONSTEXPR bool valid() const
10644 {
10645 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_OFM_HEIGHT0_M1) && must_be_zero0 == 0;
10646 }
10647 CONSTEXPR void init()
10648 {
10649 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_OFM_HEIGHT0_M1);
10650 must_be_zero0 = 0;
10651 }
10652 CONSTEXPR ::cmd0 get_cmd_code() const
10653 {
10654 return static_cast<::cmd0>(cmd_code);
10655 }
10656 CONSTEXPR npu_set_ofm_height0_m1_t &set_cmd_code(::cmd0 value)
10657 {
10658 cmd_code = static_cast<uint32_t>(value);
10659 return *this;
10660 }
10661 CONSTEXPR uint32_t get_param() const
10662 {
10663 return static_cast<uint32_t>(param);
10664 }
10665 CONSTEXPR npu_set_ofm_height0_m1_t &set_param(uint32_t value)
10666 {
10667 param = static_cast<uint32_t>(value);
10668 return *this;
10669 }
10670#endif //__cplusplus
10671};
10672
10673// OFM Tile 1 (height-1)
10674struct npu_set_ofm_height1_m1_t
10675{
10676 uint32_t cmd_code : 10; // NPU_SET_OFM_HEIGHT1_M1
10677 uint32_t must_be_zero0 : 6; // 0
10678 uint32_t param : 16;
10679#ifdef __cplusplus
10680 CONSTEXPR bool valid() const
10681 {
10682 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_OFM_HEIGHT1_M1) && must_be_zero0 == 0;
10683 }
10684 CONSTEXPR void init()
10685 {
10686 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_OFM_HEIGHT1_M1);
10687 must_be_zero0 = 0;
10688 }
10689 CONSTEXPR ::cmd0 get_cmd_code() const
10690 {
10691 return static_cast<::cmd0>(cmd_code);
10692 }
10693 CONSTEXPR npu_set_ofm_height1_m1_t &set_cmd_code(::cmd0 value)
10694 {
10695 cmd_code = static_cast<uint32_t>(value);
10696 return *this;
10697 }
10698 CONSTEXPR uint32_t get_param() const
10699 {
10700 return static_cast<uint32_t>(param);
10701 }
10702 CONSTEXPR npu_set_ofm_height1_m1_t &set_param(uint32_t value)
10703 {
10704 param = static_cast<uint32_t>(value);
10705 return *this;
10706 }
10707#endif //__cplusplus
10708};
10709
10710// Index n for OFM access: BasePointer[n] is added to all OFM offsets
10711struct npu_set_ofm_region_t
10712{
10713 uint32_t cmd_code : 10; // NPU_SET_OFM_REGION
10714 uint32_t must_be_zero0 : 6; // 0
10715 uint32_t param : 16;
10716#ifdef __cplusplus
10717 CONSTEXPR bool valid() const
10718 {
10719 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_OFM_REGION) && must_be_zero0 == 0;
10720 }
10721 CONSTEXPR void init()
10722 {
10723 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_OFM_REGION);
10724 must_be_zero0 = 0;
10725 }
10726 CONSTEXPR ::cmd0 get_cmd_code() const
10727 {
10728 return static_cast<::cmd0>(cmd_code);
10729 }
10730 CONSTEXPR npu_set_ofm_region_t &set_cmd_code(::cmd0 value)
10731 {
10732 cmd_code = static_cast<uint32_t>(value);
10733 return *this;
10734 }
10735 CONSTEXPR uint32_t get_param() const
10736 {
10737 return static_cast<uint32_t>(param);
10738 }
10739 CONSTEXPR npu_set_ofm_region_t &set_param(uint32_t value)
10740 {
10741 param = static_cast<uint32_t>(value);
10742 return *this;
10743 }
10744#endif //__cplusplus
10745};
10746
10747// Set kernel width - 1
10748struct npu_set_kernel_width_m1_t
10749{
10750 uint32_t cmd_code : 10; // NPU_SET_KERNEL_WIDTH_M1
10751 uint32_t must_be_zero0 : 6; // 0
10752 uint32_t param : 16;
10753#ifdef __cplusplus
10754 CONSTEXPR bool valid() const
10755 {
10756 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_KERNEL_WIDTH_M1) && must_be_zero0 == 0;
10757 }
10758 CONSTEXPR void init()
10759 {
10760 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_KERNEL_WIDTH_M1);
10761 must_be_zero0 = 0;
10762 }
10763 CONSTEXPR ::cmd0 get_cmd_code() const
10764 {
10765 return static_cast<::cmd0>(cmd_code);
10766 }
10767 CONSTEXPR npu_set_kernel_width_m1_t &set_cmd_code(::cmd0 value)
10768 {
10769 cmd_code = static_cast<uint32_t>(value);
10770 return *this;
10771 }
10772 CONSTEXPR uint32_t get_param() const
10773 {
10774 return static_cast<uint32_t>(param);
10775 }
10776 CONSTEXPR npu_set_kernel_width_m1_t &set_param(uint32_t value)
10777 {
10778 param = static_cast<uint32_t>(value);
10779 return *this;
10780 }
10781#endif //__cplusplus
10782};
10783
10784// Set kernel height - 1
10785struct npu_set_kernel_height_m1_t
10786{
10787 uint32_t cmd_code : 10; // NPU_SET_KERNEL_HEIGHT_M1
10788 uint32_t must_be_zero0 : 6; // 0
10789 uint32_t param : 16;
10790#ifdef __cplusplus
10791 CONSTEXPR bool valid() const
10792 {
10793 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_KERNEL_HEIGHT_M1) && must_be_zero0 == 0;
10794 }
10795 CONSTEXPR void init()
10796 {
10797 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_KERNEL_HEIGHT_M1);
10798 must_be_zero0 = 0;
10799 }
10800 CONSTEXPR ::cmd0 get_cmd_code() const
10801 {
10802 return static_cast<::cmd0>(cmd_code);
10803 }
10804 CONSTEXPR npu_set_kernel_height_m1_t &set_cmd_code(::cmd0 value)
10805 {
10806 cmd_code = static_cast<uint32_t>(value);
10807 return *this;
10808 }
10809 CONSTEXPR uint32_t get_param() const
10810 {
10811 return static_cast<uint32_t>(param);
10812 }
10813 CONSTEXPR npu_set_kernel_height_m1_t &set_param(uint32_t value)
10814 {
10815 param = static_cast<uint32_t>(value);
10816 return *this;
10817 }
10818#endif //__cplusplus
10819};
10820
Diqing Zhonga9f38d52020-04-27 11:00:13 +020010821// Kernel stride b0=(X stride-1)&1, b1=(Y stride-1)&1, b2=weight order (0=depth, 1=kernel) b3 = kernel_x_dilation - 1
10822// (0=no x dilation, 1=x dilation of x2) b4 = kernel_y_dilation -1 (0=no y dilation, 1=y dilation of x2) b5 = kernel
10823// decomposition size (0 for kernel_split_size=8, 1 for kernel_split_size=4) b[8:6] = (X stride-1)>>1 b[11:9] = (Y
10824// stride-1)>>1
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020010825struct npu_set_kernel_stride_t
10826{
10827 uint32_t cmd_code : 10; // NPU_SET_KERNEL_STRIDE
10828 uint32_t must_be_zero0 : 6; // 0
10829 uint32_t param : 16;
10830#ifdef __cplusplus
10831 CONSTEXPR bool valid() const
10832 {
10833 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_KERNEL_STRIDE) && must_be_zero0 == 0;
10834 }
10835 CONSTEXPR void init()
10836 {
10837 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_KERNEL_STRIDE);
10838 must_be_zero0 = 0;
10839 }
10840 CONSTEXPR ::cmd0 get_cmd_code() const
10841 {
10842 return static_cast<::cmd0>(cmd_code);
10843 }
10844 CONSTEXPR npu_set_kernel_stride_t &set_cmd_code(::cmd0 value)
10845 {
10846 cmd_code = static_cast<uint32_t>(value);
10847 return *this;
10848 }
10849 CONSTEXPR uint32_t get_param() const
10850 {
10851 return static_cast<uint32_t>(param);
10852 }
10853 CONSTEXPR npu_set_kernel_stride_t &set_param(uint32_t value)
10854 {
10855 param = static_cast<uint32_t>(value);
10856 return *this;
10857 }
10858#endif //__cplusplus
10859};
10860
Stefan Nannessone2e70242020-08-19 16:01:29 +020010861// 0=1-core, 1=2-core depth (this command is Ethos-U65 only and UNPREDICTABLE for Ethos-U55)
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020010862struct npu_set_parallel_mode_t
10863{
10864 uint32_t cmd_code : 10; // NPU_SET_PARALLEL_MODE
10865 uint32_t must_be_zero0 : 6; // 0
10866 uint32_t param : 16;
10867#ifdef __cplusplus
10868 CONSTEXPR bool valid() const
10869 {
10870 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_PARALLEL_MODE) && must_be_zero0 == 0;
10871 }
10872 CONSTEXPR void init()
10873 {
10874 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_PARALLEL_MODE);
10875 must_be_zero0 = 0;
10876 }
10877 CONSTEXPR ::cmd0 get_cmd_code() const
10878 {
10879 return static_cast<::cmd0>(cmd_code);
10880 }
10881 CONSTEXPR npu_set_parallel_mode_t &set_cmd_code(::cmd0 value)
10882 {
10883 cmd_code = static_cast<uint32_t>(value);
10884 return *this;
10885 }
10886 CONSTEXPR uint32_t get_param() const
10887 {
10888 return static_cast<uint32_t>(param);
10889 }
10890 CONSTEXPR npu_set_parallel_mode_t &set_param(uint32_t value)
10891 {
10892 param = static_cast<uint32_t>(value);
10893 return *this;
10894 }
10895#endif //__cplusplus
10896};
10897
10898// Set accumulator format
10899struct npu_set_acc_format_t
10900{
10901 uint32_t cmd_code : 10; // NPU_SET_ACC_FORMAT
10902 uint32_t must_be_zero0 : 6; // 0
10903 uint32_t param : 16;
10904#ifdef __cplusplus
10905 CONSTEXPR bool valid() const
10906 {
10907 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_ACC_FORMAT) && must_be_zero0 == 0;
10908 }
10909 CONSTEXPR void init()
10910 {
10911 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_ACC_FORMAT);
10912 must_be_zero0 = 0;
10913 }
10914 CONSTEXPR ::cmd0 get_cmd_code() const
10915 {
10916 return static_cast<::cmd0>(cmd_code);
10917 }
10918 CONSTEXPR npu_set_acc_format_t &set_cmd_code(::cmd0 value)
10919 {
10920 cmd_code = static_cast<uint32_t>(value);
10921 return *this;
10922 }
10923 CONSTEXPR ::acc_format get_param() const
10924 {
10925 return static_cast<::acc_format>(param);
10926 }
10927 CONSTEXPR npu_set_acc_format_t &set_param(::acc_format value)
10928 {
10929 param = static_cast<uint32_t>(value);
10930 return *this;
10931 }
10932#endif //__cplusplus
10933};
10934
10935// Set activation
10936struct npu_set_activation_t
10937{
10938 uint32_t cmd_code : 10; // NPU_SET_ACTIVATION
10939 uint32_t must_be_zero0 : 6; // 0
10940 uint32_t type : 12;
10941 uint32_t act_clip_range : 4;
10942#ifdef __cplusplus
10943 CONSTEXPR bool valid() const
10944 {
10945 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_ACTIVATION) && must_be_zero0 == 0;
10946 }
10947 CONSTEXPR void init()
10948 {
10949 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_ACTIVATION);
10950 must_be_zero0 = 0;
10951 }
10952 CONSTEXPR ::clip_range get_act_clip_range() const
10953 {
10954 return static_cast<::clip_range>(act_clip_range);
10955 }
10956 CONSTEXPR npu_set_activation_t &set_act_clip_range(::clip_range value)
10957 {
10958 act_clip_range = static_cast<uint32_t>(value);
10959 return *this;
10960 }
10961 CONSTEXPR ::cmd0 get_cmd_code() const
10962 {
10963 return static_cast<::cmd0>(cmd_code);
10964 }
10965 CONSTEXPR npu_set_activation_t &set_cmd_code(::cmd0 value)
10966 {
10967 cmd_code = static_cast<uint32_t>(value);
10968 return *this;
10969 }
10970 CONSTEXPR ::activation get_type() const
10971 {
10972 return static_cast<::activation>(type);
10973 }
10974 CONSTEXPR npu_set_activation_t &set_type(::activation value)
10975 {
10976 type = static_cast<uint32_t>(value);
10977 return *this;
10978 }
10979#endif //__cplusplus
10980};
10981
10982// Lower bound clip for OFM activations – range is the OFM type range
10983struct npu_set_activation_min_t
10984{
10985 uint32_t cmd_code : 10; // NPU_SET_ACTIVATION_MIN
10986 uint32_t must_be_zero0 : 6; // 0
10987 uint32_t param : 16;
10988#ifdef __cplusplus
10989 CONSTEXPR bool valid() const
10990 {
10991 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_ACTIVATION_MIN) && must_be_zero0 == 0;
10992 }
10993 CONSTEXPR void init()
10994 {
10995 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_ACTIVATION_MIN);
10996 must_be_zero0 = 0;
10997 }
10998 CONSTEXPR ::cmd0 get_cmd_code() const
10999 {
11000 return static_cast<::cmd0>(cmd_code);
11001 }
11002 CONSTEXPR npu_set_activation_min_t &set_cmd_code(::cmd0 value)
11003 {
11004 cmd_code = static_cast<uint32_t>(value);
11005 return *this;
11006 }
11007 CONSTEXPR uint32_t get_param() const
11008 {
11009 return static_cast<uint32_t>(param);
11010 }
11011 CONSTEXPR npu_set_activation_min_t &set_param(uint32_t value)
11012 {
11013 param = static_cast<uint32_t>(value);
11014 return *this;
11015 }
11016#endif //__cplusplus
11017};
11018
11019// Upper bound clip for OFM activations – range is the OFM type range
11020struct npu_set_activation_max_t
11021{
11022 uint32_t cmd_code : 10; // NPU_SET_ACTIVATION_MAX
11023 uint32_t must_be_zero0 : 6; // 0
11024 uint32_t param : 16;
11025#ifdef __cplusplus
11026 CONSTEXPR bool valid() const
11027 {
11028 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_ACTIVATION_MAX) && must_be_zero0 == 0;
11029 }
11030 CONSTEXPR void init()
11031 {
11032 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_ACTIVATION_MAX);
11033 must_be_zero0 = 0;
11034 }
11035 CONSTEXPR ::cmd0 get_cmd_code() const
11036 {
11037 return static_cast<::cmd0>(cmd_code);
11038 }
11039 CONSTEXPR npu_set_activation_max_t &set_cmd_code(::cmd0 value)
11040 {
11041 cmd_code = static_cast<uint32_t>(value);
11042 return *this;
11043 }
11044 CONSTEXPR uint32_t get_param() const
11045 {
11046 return static_cast<uint32_t>(param);
11047 }
11048 CONSTEXPR npu_set_activation_max_t &set_param(uint32_t value)
11049 {
11050 param = static_cast<uint32_t>(value);
11051 return *this;
11052 }
11053#endif //__cplusplus
11054};
11055
11056// Index n for weight access: BasePointer[n] is added to all Weight stream offsets
11057struct npu_set_weight_region_t
11058{
11059 uint32_t cmd_code : 10; // NPU_SET_WEIGHT_REGION
11060 uint32_t must_be_zero0 : 6; // 0
11061 uint32_t param : 16;
11062#ifdef __cplusplus
11063 CONSTEXPR bool valid() const
11064 {
11065 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_WEIGHT_REGION) && must_be_zero0 == 0;
11066 }
11067 CONSTEXPR void init()
11068 {
11069 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_WEIGHT_REGION);
11070 must_be_zero0 = 0;
11071 }
11072 CONSTEXPR ::cmd0 get_cmd_code() const
11073 {
11074 return static_cast<::cmd0>(cmd_code);
11075 }
11076 CONSTEXPR npu_set_weight_region_t &set_cmd_code(::cmd0 value)
11077 {
11078 cmd_code = static_cast<uint32_t>(value);
11079 return *this;
11080 }
11081 CONSTEXPR uint32_t get_param() const
11082 {
11083 return static_cast<uint32_t>(param);
11084 }
11085 CONSTEXPR npu_set_weight_region_t &set_param(uint32_t value)
11086 {
11087 param = static_cast<uint32_t>(value);
11088 return *this;
11089 }
11090#endif //__cplusplus
11091};
11092
11093// Index n for weight access: BasePointer[n] is added to all scale stream offsets
11094struct npu_set_scale_region_t
11095{
11096 uint32_t cmd_code : 10; // NPU_SET_SCALE_REGION
11097 uint32_t must_be_zero0 : 6; // 0
11098 uint32_t param : 16;
11099#ifdef __cplusplus
11100 CONSTEXPR bool valid() const
11101 {
11102 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_SCALE_REGION) && must_be_zero0 == 0;
11103 }
11104 CONSTEXPR void init()
11105 {
11106 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_SCALE_REGION);
11107 must_be_zero0 = 0;
11108 }
11109 CONSTEXPR ::cmd0 get_cmd_code() const
11110 {
11111 return static_cast<::cmd0>(cmd_code);
11112 }
11113 CONSTEXPR npu_set_scale_region_t &set_cmd_code(::cmd0 value)
11114 {
11115 cmd_code = static_cast<uint32_t>(value);
11116 return *this;
11117 }
11118 CONSTEXPR uint32_t get_param() const
11119 {
11120 return static_cast<uint32_t>(param);
11121 }
11122 CONSTEXPR npu_set_scale_region_t &set_param(uint32_t value)
11123 {
11124 param = static_cast<uint32_t>(value);
11125 return *this;
11126 }
11127#endif //__cplusplus
11128};
11129
11130// Start of ACC0,ACC1 buffers in the SHRAM in KB units. Multiple of 4.)
11131struct npu_set_ab_start_t
11132{
11133 uint32_t cmd_code : 10; // NPU_SET_AB_START
11134 uint32_t must_be_zero0 : 6; // 0
11135 uint32_t param : 16;
11136#ifdef __cplusplus
11137 CONSTEXPR bool valid() const
11138 {
11139 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_AB_START) && must_be_zero0 == 0;
11140 }
11141 CONSTEXPR void init()
11142 {
11143 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_AB_START);
11144 must_be_zero0 = 0;
11145 }
11146 CONSTEXPR ::cmd0 get_cmd_code() const
11147 {
11148 return static_cast<::cmd0>(cmd_code);
11149 }
11150 CONSTEXPR npu_set_ab_start_t &set_cmd_code(::cmd0 value)
11151 {
11152 cmd_code = static_cast<uint32_t>(value);
11153 return *this;
11154 }
11155 CONSTEXPR uint32_t get_param() const
11156 {
11157 return static_cast<uint32_t>(param);
11158 }
11159 CONSTEXPR npu_set_ab_start_t &set_param(uint32_t value)
11160 {
11161 param = static_cast<uint32_t>(value);
11162 return *this;
11163 }
11164#endif //__cplusplus
11165};
11166
11167// Set block number of blocks dependency between kernel operations
11168struct npu_set_blockdep_t
11169{
11170 uint32_t cmd_code : 10; // NPU_SET_BLOCKDEP
11171 uint32_t must_be_zero0 : 6; // 0
11172 uint32_t param : 16;
11173#ifdef __cplusplus
11174 CONSTEXPR bool valid() const
11175 {
11176 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_BLOCKDEP) && must_be_zero0 == 0;
11177 }
11178 CONSTEXPR void init()
11179 {
11180 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_BLOCKDEP);
11181 must_be_zero0 = 0;
11182 }
11183 CONSTEXPR ::cmd0 get_cmd_code() const
11184 {
11185 return static_cast<::cmd0>(cmd_code);
11186 }
11187 CONSTEXPR npu_set_blockdep_t &set_cmd_code(::cmd0 value)
11188 {
11189 cmd_code = static_cast<uint32_t>(value);
11190 return *this;
11191 }
11192 CONSTEXPR uint32_t get_param() const
11193 {
11194 return static_cast<uint32_t>(param);
11195 }
11196 CONSTEXPR npu_set_blockdep_t &set_param(uint32_t value)
11197 {
11198 param = static_cast<uint32_t>(value);
11199 return *this;
11200 }
11201#endif //__cplusplus
11202};
11203
11204// DMA0 SRC region bitmap
11205struct npu_set_dma0_src_region_t
11206{
11207 uint32_t cmd_code : 10; // NPU_SET_DMA0_SRC_REGION
11208 uint32_t must_be_zero0 : 6; // 0
11209 uint32_t region : 8; // If Bit[8]=0, Bit[7:0]=Region number in the range [0, 8) of SRC offset. If Bit[8]=1,
11210 // Bit[7:0]=Core number (0 or 1) to read.
11211 uint32_t internal : 1; // Must be 0 (external)
11212 uint32_t stride_mode : 2; // stride mode 0/1/2=1D/2D/3D
11213 uint32_t reserved0 : 5;
11214#ifdef __cplusplus
11215 CONSTEXPR bool valid() const
11216 {
11217 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_DMA0_SRC_REGION) && must_be_zero0 == 0;
11218 }
11219 CONSTEXPR void init()
11220 {
11221 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_DMA0_SRC_REGION);
11222 must_be_zero0 = 0;
11223 }
11224 CONSTEXPR ::cmd0 get_cmd_code() const
11225 {
11226 return static_cast<::cmd0>(cmd_code);
11227 }
11228 CONSTEXPR npu_set_dma0_src_region_t &set_cmd_code(::cmd0 value)
11229 {
11230 cmd_code = static_cast<uint32_t>(value);
11231 return *this;
11232 }
11233 CONSTEXPR uint32_t get_internal() const
11234 {
11235 return static_cast<uint32_t>(internal);
11236 }
11237 CONSTEXPR npu_set_dma0_src_region_t &set_internal(uint32_t value)
11238 {
11239 internal = static_cast<uint32_t>(value);
11240 return *this;
11241 }
11242 CONSTEXPR uint32_t get_region() const
11243 {
11244 return static_cast<uint32_t>(region);
11245 }
11246 CONSTEXPR npu_set_dma0_src_region_t &set_region(uint32_t value)
11247 {
11248 region = static_cast<uint32_t>(value);
11249 return *this;
11250 }
11251 CONSTEXPR ::stride_mode get_stride_mode() const
11252 {
11253 return static_cast<::stride_mode>(stride_mode);
11254 }
11255 CONSTEXPR npu_set_dma0_src_region_t &set_stride_mode(::stride_mode value)
11256 {
11257 stride_mode = static_cast<uint32_t>(value);
11258 return *this;
11259 }
11260#endif //__cplusplus
11261};
11262
11263// DMA0 DST region bitmap
11264struct npu_set_dma0_dst_region_t
11265{
11266 uint32_t cmd_code : 10; // NPU_SET_DMA0_DST_REGION
11267 uint32_t must_be_zero0 : 6; // 0
11268 uint32_t region : 8; // If Bit[8]=0, Bit[7:0]=Region number in the range [0, 8) of DST offset. If Bit[8]=1,
11269 // Bit[7:0]=Core mask to write to (bit k set for core k=0,1).
11270 uint32_t internal : 1; // Select external/internal=0/1
11271 uint32_t stride_mode : 2; // stride mode 0/1/2=1D/2D/3D
11272 uint32_t reserved0 : 5;
11273#ifdef __cplusplus
11274 CONSTEXPR bool valid() const
11275 {
11276 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_DMA0_DST_REGION) && must_be_zero0 == 0;
11277 }
11278 CONSTEXPR void init()
11279 {
11280 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_DMA0_DST_REGION);
11281 must_be_zero0 = 0;
11282 }
11283 CONSTEXPR ::cmd0 get_cmd_code() const
11284 {
11285 return static_cast<::cmd0>(cmd_code);
11286 }
11287 CONSTEXPR npu_set_dma0_dst_region_t &set_cmd_code(::cmd0 value)
11288 {
11289 cmd_code = static_cast<uint32_t>(value);
11290 return *this;
11291 }
11292 CONSTEXPR uint32_t get_internal() const
11293 {
11294 return static_cast<uint32_t>(internal);
11295 }
11296 CONSTEXPR npu_set_dma0_dst_region_t &set_internal(uint32_t value)
11297 {
11298 internal = static_cast<uint32_t>(value);
11299 return *this;
11300 }
11301 CONSTEXPR uint32_t get_region() const
11302 {
11303 return static_cast<uint32_t>(region);
11304 }
11305 CONSTEXPR npu_set_dma0_dst_region_t &set_region(uint32_t value)
11306 {
11307 region = static_cast<uint32_t>(value);
11308 return *this;
11309 }
11310 CONSTEXPR ::stride_mode get_stride_mode() const
11311 {
11312 return static_cast<::stride_mode>(stride_mode);
11313 }
11314 CONSTEXPR npu_set_dma0_dst_region_t &set_stride_mode(::stride_mode value)
11315 {
11316 stride_mode = static_cast<uint32_t>(value);
11317 return *this;
11318 }
11319#endif //__cplusplus
11320};
11321
11322// Inner size for 2D/3D mode.
11323struct npu_set_dma0_size0_t
11324{
11325 uint32_t cmd_code : 10; // NPU_SET_DMA0_SIZE0
11326 uint32_t must_be_zero0 : 6; // 0
11327 uint32_t param : 16;
11328#ifdef __cplusplus
11329 CONSTEXPR bool valid() const
11330 {
11331 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_DMA0_SIZE0) && must_be_zero0 == 0;
11332 }
11333 CONSTEXPR void init()
11334 {
11335 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_DMA0_SIZE0);
11336 must_be_zero0 = 0;
11337 }
11338 CONSTEXPR ::cmd0 get_cmd_code() const
11339 {
11340 return static_cast<::cmd0>(cmd_code);
11341 }
11342 CONSTEXPR npu_set_dma0_size0_t &set_cmd_code(::cmd0 value)
11343 {
11344 cmd_code = static_cast<uint32_t>(value);
11345 return *this;
11346 }
11347 CONSTEXPR uint32_t get_param() const
11348 {
11349 return static_cast<uint32_t>(param);
11350 }
11351 CONSTEXPR npu_set_dma0_size0_t &set_param(uint32_t value)
11352 {
11353 param = static_cast<uint32_t>(value);
11354 return *this;
11355 }
11356#endif //__cplusplus
11357};
11358
11359// Outer size for 3D mode.
11360struct npu_set_dma0_size1_t
11361{
11362 uint32_t cmd_code : 10; // NPU_SET_DMA0_SIZE1
11363 uint32_t must_be_zero0 : 6; // 0
11364 uint32_t param : 16;
11365#ifdef __cplusplus
11366 CONSTEXPR bool valid() const
11367 {
11368 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_DMA0_SIZE1) && must_be_zero0 == 0;
11369 }
11370 CONSTEXPR void init()
11371 {
11372 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_DMA0_SIZE1);
11373 must_be_zero0 = 0;
11374 }
11375 CONSTEXPR ::cmd0 get_cmd_code() const
11376 {
11377 return static_cast<::cmd0>(cmd_code);
11378 }
11379 CONSTEXPR npu_set_dma0_size1_t &set_cmd_code(::cmd0 value)
11380 {
11381 cmd_code = static_cast<uint32_t>(value);
11382 return *this;
11383 }
11384 CONSTEXPR uint32_t get_param() const
11385 {
11386 return static_cast<uint32_t>(param);
11387 }
11388 CONSTEXPR npu_set_dma0_size1_t &set_param(uint32_t value)
11389 {
11390 param = static_cast<uint32_t>(value);
11391 return *this;
11392 }
11393#endif //__cplusplus
11394};
11395
11396// Set IFM2 Broadcast mode
11397struct npu_set_ifm2_broadcast_t
11398{
11399 uint32_t cmd_code : 10; // NPU_SET_IFM2_BROADCAST
11400 uint32_t must_be_zero0 : 6; // 0
11401 uint32_t broadcast_height : 1;
11402 uint32_t broadcast_width : 1;
11403 uint32_t broadcast_depth : 1;
11404 uint32_t reserved0 : 3;
11405 uint32_t operand_order : 1;
11406 uint32_t broadcast_scalar : 1;
11407 uint32_t reserved1 : 8;
11408#ifdef __cplusplus
11409 CONSTEXPR bool valid() const
11410 {
11411 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_IFM2_BROADCAST) && must_be_zero0 == 0;
11412 }
11413 CONSTEXPR void init()
11414 {
11415 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_IFM2_BROADCAST);
11416 must_be_zero0 = 0;
11417 }
11418 CONSTEXPR uint32_t get_broadcast_depth() const
11419 {
11420 return static_cast<uint32_t>(broadcast_depth);
11421 }
11422 CONSTEXPR npu_set_ifm2_broadcast_t &set_broadcast_depth(uint32_t value)
11423 {
11424 broadcast_depth = static_cast<uint32_t>(value);
11425 return *this;
11426 }
11427 CONSTEXPR uint32_t get_broadcast_height() const
11428 {
11429 return static_cast<uint32_t>(broadcast_height);
11430 }
11431 CONSTEXPR npu_set_ifm2_broadcast_t &set_broadcast_height(uint32_t value)
11432 {
11433 broadcast_height = static_cast<uint32_t>(value);
11434 return *this;
11435 }
11436 CONSTEXPR uint32_t get_broadcast_scalar() const
11437 {
11438 return static_cast<uint32_t>(broadcast_scalar);
11439 }
11440 CONSTEXPR npu_set_ifm2_broadcast_t &set_broadcast_scalar(uint32_t value)
11441 {
11442 broadcast_scalar = static_cast<uint32_t>(value);
11443 return *this;
11444 }
11445 CONSTEXPR uint32_t get_broadcast_width() const
11446 {
11447 return static_cast<uint32_t>(broadcast_width);
11448 }
11449 CONSTEXPR npu_set_ifm2_broadcast_t &set_broadcast_width(uint32_t value)
11450 {
11451 broadcast_width = static_cast<uint32_t>(value);
11452 return *this;
11453 }
11454 CONSTEXPR ::cmd0 get_cmd_code() const
11455 {
11456 return static_cast<::cmd0>(cmd_code);
11457 }
11458 CONSTEXPR npu_set_ifm2_broadcast_t &set_cmd_code(::cmd0 value)
11459 {
11460 cmd_code = static_cast<uint32_t>(value);
11461 return *this;
11462 }
11463 CONSTEXPR uint32_t get_operand_order() const
11464 {
11465 return static_cast<uint32_t>(operand_order);
11466 }
11467 CONSTEXPR npu_set_ifm2_broadcast_t &set_operand_order(uint32_t value)
11468 {
11469 operand_order = static_cast<uint32_t>(value);
11470 return *this;
11471 }
11472#endif //__cplusplus
11473};
11474
11475// IFM2 scalar value at range IFM_PRECISION
11476struct npu_set_ifm2_scalar_t
11477{
11478 uint32_t cmd_code : 10; // NPU_SET_IFM2_SCALAR
11479 uint32_t must_be_zero0 : 6; // 0
11480 uint32_t param : 16;
11481#ifdef __cplusplus
11482 CONSTEXPR bool valid() const
11483 {
11484 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_IFM2_SCALAR) && must_be_zero0 == 0;
11485 }
11486 CONSTEXPR void init()
11487 {
11488 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_IFM2_SCALAR);
11489 must_be_zero0 = 0;
11490 }
11491 CONSTEXPR ::cmd0 get_cmd_code() const
11492 {
11493 return static_cast<::cmd0>(cmd_code);
11494 }
11495 CONSTEXPR npu_set_ifm2_scalar_t &set_cmd_code(::cmd0 value)
11496 {
11497 cmd_code = static_cast<uint32_t>(value);
11498 return *this;
11499 }
11500 CONSTEXPR uint32_t get_param() const
11501 {
11502 return static_cast<uint32_t>(param);
11503 }
11504 CONSTEXPR npu_set_ifm2_scalar_t &set_param(uint32_t value)
11505 {
11506 param = static_cast<uint32_t>(value);
11507 return *this;
11508 }
11509#endif //__cplusplus
11510};
11511
11512// Set activation
11513struct npu_set_ifm2_precision_t
11514{
11515 uint32_t cmd_code : 10; // NPU_SET_IFM2_PRECISION
11516 uint32_t must_be_zero0 : 6; // 0
Diqing Zhonga9f38d52020-04-27 11:00:13 +020011517 uint32_t precision : 4;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020011518 uint32_t reserved0 : 2;
11519 uint32_t format : 2;
11520 uint32_t reserved1 : 8;
11521#ifdef __cplusplus
11522 CONSTEXPR bool valid() const
11523 {
11524 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_IFM2_PRECISION) && must_be_zero0 == 0;
11525 }
11526 CONSTEXPR void init()
11527 {
11528 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_IFM2_PRECISION);
11529 must_be_zero0 = 0;
11530 }
11531 CONSTEXPR ::cmd0 get_cmd_code() const
11532 {
11533 return static_cast<::cmd0>(cmd_code);
11534 }
11535 CONSTEXPR npu_set_ifm2_precision_t &set_cmd_code(::cmd0 value)
11536 {
11537 cmd_code = static_cast<uint32_t>(value);
11538 return *this;
11539 }
11540 CONSTEXPR ::data_format get_format() const
11541 {
11542 return static_cast<::data_format>(format);
11543 }
11544 CONSTEXPR npu_set_ifm2_precision_t &set_format(::data_format value)
11545 {
11546 format = static_cast<uint32_t>(value);
11547 return *this;
11548 }
Diqing Zhonga9f38d52020-04-27 11:00:13 +020011549 CONSTEXPR ::ifm_precision get_precision() const
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020011550 {
Diqing Zhonga9f38d52020-04-27 11:00:13 +020011551 return static_cast<::ifm_precision>(precision);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020011552 }
Diqing Zhonga9f38d52020-04-27 11:00:13 +020011553 CONSTEXPR npu_set_ifm2_precision_t &set_precision(::ifm_precision value)
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020011554 {
Diqing Zhonga9f38d52020-04-27 11:00:13 +020011555 precision = static_cast<uint32_t>(value);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020011556 return *this;
11557 }
11558#endif //__cplusplus
11559};
11560
11561// Zero point offset (so value that 0 is encoded as) at range IFM_PRECISION
11562struct npu_set_ifm2_zero_point_t
11563{
11564 uint32_t cmd_code : 10; // NPU_SET_IFM2_ZERO_POINT
11565 uint32_t must_be_zero0 : 6; // 0
11566 uint32_t param : 16;
11567#ifdef __cplusplus
11568 CONSTEXPR bool valid() const
11569 {
11570 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_IFM2_ZERO_POINT) && must_be_zero0 == 0;
11571 }
11572 CONSTEXPR void init()
11573 {
11574 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_IFM2_ZERO_POINT);
11575 must_be_zero0 = 0;
11576 }
11577 CONSTEXPR ::cmd0 get_cmd_code() const
11578 {
11579 return static_cast<::cmd0>(cmd_code);
11580 }
11581 CONSTEXPR npu_set_ifm2_zero_point_t &set_cmd_code(::cmd0 value)
11582 {
11583 cmd_code = static_cast<uint32_t>(value);
11584 return *this;
11585 }
11586 CONSTEXPR uint32_t get_param() const
11587 {
11588 return static_cast<uint32_t>(param);
11589 }
11590 CONSTEXPR npu_set_ifm2_zero_point_t &set_param(uint32_t value)
11591 {
11592 param = static_cast<uint32_t>(value);
11593 return *this;
11594 }
11595#endif //__cplusplus
11596};
11597
11598// IFM2 Tile 0 and tile 2 (width-1)
11599struct npu_set_ifm2_width0_m1_t
11600{
11601 uint32_t cmd_code : 10; // NPU_SET_IFM2_WIDTH0_M1
11602 uint32_t must_be_zero0 : 6; // 0
11603 uint32_t param : 16;
11604#ifdef __cplusplus
11605 CONSTEXPR bool valid() const
11606 {
11607 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_IFM2_WIDTH0_M1) && must_be_zero0 == 0;
11608 }
11609 CONSTEXPR void init()
11610 {
11611 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_IFM2_WIDTH0_M1);
11612 must_be_zero0 = 0;
11613 }
11614 CONSTEXPR ::cmd0 get_cmd_code() const
11615 {
11616 return static_cast<::cmd0>(cmd_code);
11617 }
11618 CONSTEXPR npu_set_ifm2_width0_m1_t &set_cmd_code(::cmd0 value)
11619 {
11620 cmd_code = static_cast<uint32_t>(value);
11621 return *this;
11622 }
11623 CONSTEXPR uint32_t get_param() const
11624 {
11625 return static_cast<uint32_t>(param);
11626 }
11627 CONSTEXPR npu_set_ifm2_width0_m1_t &set_param(uint32_t value)
11628 {
11629 param = static_cast<uint32_t>(value);
11630 return *this;
11631 }
11632#endif //__cplusplus
11633};
11634
11635// IFM2 Tile 0 (height-1)
11636struct npu_set_ifm2_height0_m1_t
11637{
11638 uint32_t cmd_code : 10; // NPU_SET_IFM2_HEIGHT0_M1
11639 uint32_t must_be_zero0 : 6; // 0
11640 uint32_t param : 16;
11641#ifdef __cplusplus
11642 CONSTEXPR bool valid() const
11643 {
11644 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_IFM2_HEIGHT0_M1) && must_be_zero0 == 0;
11645 }
11646 CONSTEXPR void init()
11647 {
11648 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_IFM2_HEIGHT0_M1);
11649 must_be_zero0 = 0;
11650 }
11651 CONSTEXPR ::cmd0 get_cmd_code() const
11652 {
11653 return static_cast<::cmd0>(cmd_code);
11654 }
11655 CONSTEXPR npu_set_ifm2_height0_m1_t &set_cmd_code(::cmd0 value)
11656 {
11657 cmd_code = static_cast<uint32_t>(value);
11658 return *this;
11659 }
11660 CONSTEXPR uint32_t get_param() const
11661 {
11662 return static_cast<uint32_t>(param);
11663 }
11664 CONSTEXPR npu_set_ifm2_height0_m1_t &set_param(uint32_t value)
11665 {
11666 param = static_cast<uint32_t>(value);
11667 return *this;
11668 }
11669#endif //__cplusplus
11670};
11671
11672// IFM2 Tile 1 (height-1)
11673struct npu_set_ifm2_height1_m1_t
11674{
11675 uint32_t cmd_code : 10; // NPU_SET_IFM2_HEIGHT1_M1
11676 uint32_t must_be_zero0 : 6; // 0
11677 uint32_t param : 16;
11678#ifdef __cplusplus
11679 CONSTEXPR bool valid() const
11680 {
11681 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_IFM2_HEIGHT1_M1) && must_be_zero0 == 0;
11682 }
11683 CONSTEXPR void init()
11684 {
11685 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_IFM2_HEIGHT1_M1);
11686 must_be_zero0 = 0;
11687 }
11688 CONSTEXPR ::cmd0 get_cmd_code() const
11689 {
11690 return static_cast<::cmd0>(cmd_code);
11691 }
11692 CONSTEXPR npu_set_ifm2_height1_m1_t &set_cmd_code(::cmd0 value)
11693 {
11694 cmd_code = static_cast<uint32_t>(value);
11695 return *this;
11696 }
11697 CONSTEXPR uint32_t get_param() const
11698 {
11699 return static_cast<uint32_t>(param);
11700 }
11701 CONSTEXPR npu_set_ifm2_height1_m1_t &set_param(uint32_t value)
11702 {
11703 param = static_cast<uint32_t>(value);
11704 return *this;
11705 }
11706#endif //__cplusplus
11707};
11708
11709// Start of IB0, IB1 buffers for IFM2 in SHRAM. In KB units, multiple of 2.
11710struct npu_set_ifm2_ib_start_t
11711{
11712 uint32_t cmd_code : 10; // NPU_SET_IFM2_IB_START
11713 uint32_t must_be_zero0 : 6; // 0
11714 uint32_t param : 16;
11715#ifdef __cplusplus
11716 CONSTEXPR bool valid() const
11717 {
11718 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_IFM2_IB_START) && must_be_zero0 == 0;
11719 }
11720 CONSTEXPR void init()
11721 {
11722 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_IFM2_IB_START);
11723 must_be_zero0 = 0;
11724 }
11725 CONSTEXPR ::cmd0 get_cmd_code() const
11726 {
11727 return static_cast<::cmd0>(cmd_code);
11728 }
11729 CONSTEXPR npu_set_ifm2_ib_start_t &set_cmd_code(::cmd0 value)
11730 {
11731 cmd_code = static_cast<uint32_t>(value);
11732 return *this;
11733 }
11734 CONSTEXPR uint32_t get_param() const
11735 {
11736 return static_cast<uint32_t>(param);
11737 }
11738 CONSTEXPR npu_set_ifm2_ib_start_t &set_param(uint32_t value)
11739 {
11740 param = static_cast<uint32_t>(value);
11741 return *this;
11742 }
11743#endif //__cplusplus
11744};
11745
11746// Index n for IFM2 access: Region[n] is added to all IFM2 addresses
11747struct npu_set_ifm2_region_t
11748{
11749 uint32_t cmd_code : 10; // NPU_SET_IFM2_REGION
11750 uint32_t must_be_zero0 : 6; // 0
11751 uint32_t param : 16;
11752#ifdef __cplusplus
11753 CONSTEXPR bool valid() const
11754 {
11755 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_IFM2_REGION) && must_be_zero0 == 0;
11756 }
11757 CONSTEXPR void init()
11758 {
11759 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_IFM2_REGION);
11760 must_be_zero0 = 0;
11761 }
11762 CONSTEXPR ::cmd0 get_cmd_code() const
11763 {
11764 return static_cast<::cmd0>(cmd_code);
11765 }
11766 CONSTEXPR npu_set_ifm2_region_t &set_cmd_code(::cmd0 value)
11767 {
11768 cmd_code = static_cast<uint32_t>(value);
11769 return *this;
11770 }
11771 CONSTEXPR uint32_t get_param() const
11772 {
11773 return static_cast<uint32_t>(param);
11774 }
11775 CONSTEXPR npu_set_ifm2_region_t &set_param(uint32_t value)
11776 {
11777 param = static_cast<uint32_t>(value);
11778 return *this;
11779 }
11780#endif //__cplusplus
11781};
11782
11783// Set IFM base address (top left tile)
11784struct npu_set_ifm_base0_t
11785{
11786 uint32_t cmd_code : 10; // NPU_SET_IFM_BASE0
11787 uint32_t must_be_zero : 4; // 0
11788 uint32_t payload_size : 2; // Min:1 Max:2
11789 uint32_t reserved0 : 16;
11790 uint32_t data : 32; // IFM base address (top left tile)
11791#ifdef __cplusplus
11792 CONSTEXPR bool valid() const
11793 {
11794 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_IFM_BASE0) && must_be_zero == 0 && payload_size >= 1 &&
11795 payload_size <= 2;
11796 }
11797 CONSTEXPR void init()
11798 {
11799 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_IFM_BASE0);
11800 must_be_zero = 0;
11801 payload_size = 1;
11802 }
11803 CONSTEXPR ::cmd1 get_cmd_code() const
11804 {
11805 return static_cast<::cmd1>(cmd_code);
11806 }
11807 CONSTEXPR npu_set_ifm_base0_t &set_cmd_code(::cmd1 value)
11808 {
11809 cmd_code = static_cast<uint32_t>(value);
11810 return *this;
11811 }
11812 CONSTEXPR uint32_t get_data() const
11813 {
11814 return static_cast<uint32_t>(data);
11815 }
11816 CONSTEXPR npu_set_ifm_base0_t &set_data(uint32_t value)
11817 {
11818 data = static_cast<uint32_t>(value);
11819 return *this;
11820 }
11821 CONSTEXPR uint32_t get_payload_size() const
11822 {
11823 return static_cast<uint32_t>(payload_size);
11824 }
11825 CONSTEXPR npu_set_ifm_base0_t &set_payload_size(uint32_t value)
11826 {
11827 payload_size = static_cast<uint32_t>(value);
11828 return *this;
11829 }
11830#endif //__cplusplus
11831};
11832
11833// Set IFM base address (top right tile)
11834struct npu_set_ifm_base1_t
11835{
11836 uint32_t cmd_code : 10; // NPU_SET_IFM_BASE1
11837 uint32_t must_be_zero : 4; // 0
11838 uint32_t payload_size : 2; // Min:1 Max:2
11839 uint32_t reserved0 : 16;
11840 uint32_t data : 32; // IFM base address (top right tile)
11841#ifdef __cplusplus
11842 CONSTEXPR bool valid() const
11843 {
11844 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_IFM_BASE1) && must_be_zero == 0 && payload_size >= 1 &&
11845 payload_size <= 2;
11846 }
11847 CONSTEXPR void init()
11848 {
11849 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_IFM_BASE1);
11850 must_be_zero = 0;
11851 payload_size = 1;
11852 }
11853 CONSTEXPR ::cmd1 get_cmd_code() const
11854 {
11855 return static_cast<::cmd1>(cmd_code);
11856 }
11857 CONSTEXPR npu_set_ifm_base1_t &set_cmd_code(::cmd1 value)
11858 {
11859 cmd_code = static_cast<uint32_t>(value);
11860 return *this;
11861 }
11862 CONSTEXPR uint32_t get_data() const
11863 {
11864 return static_cast<uint32_t>(data);
11865 }
11866 CONSTEXPR npu_set_ifm_base1_t &set_data(uint32_t value)
11867 {
11868 data = static_cast<uint32_t>(value);
11869 return *this;
11870 }
11871 CONSTEXPR uint32_t get_payload_size() const
11872 {
11873 return static_cast<uint32_t>(payload_size);
11874 }
11875 CONSTEXPR npu_set_ifm_base1_t &set_payload_size(uint32_t value)
11876 {
11877 payload_size = static_cast<uint32_t>(value);
11878 return *this;
11879 }
11880#endif //__cplusplus
11881};
11882
11883// Set IFM base address (bottom left tile)
11884struct npu_set_ifm_base2_t
11885{
11886 uint32_t cmd_code : 10; // NPU_SET_IFM_BASE2
11887 uint32_t must_be_zero : 4; // 0
11888 uint32_t payload_size : 2; // Min:1 Max:2
11889 uint32_t reserved0 : 16;
11890 uint32_t data : 32; // IFM base address (bottom left tile)
11891#ifdef __cplusplus
11892 CONSTEXPR bool valid() const
11893 {
11894 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_IFM_BASE2) && must_be_zero == 0 && payload_size >= 1 &&
11895 payload_size <= 2;
11896 }
11897 CONSTEXPR void init()
11898 {
11899 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_IFM_BASE2);
11900 must_be_zero = 0;
11901 payload_size = 1;
11902 }
11903 CONSTEXPR ::cmd1 get_cmd_code() const
11904 {
11905 return static_cast<::cmd1>(cmd_code);
11906 }
11907 CONSTEXPR npu_set_ifm_base2_t &set_cmd_code(::cmd1 value)
11908 {
11909 cmd_code = static_cast<uint32_t>(value);
11910 return *this;
11911 }
11912 CONSTEXPR uint32_t get_data() const
11913 {
11914 return static_cast<uint32_t>(data);
11915 }
11916 CONSTEXPR npu_set_ifm_base2_t &set_data(uint32_t value)
11917 {
11918 data = static_cast<uint32_t>(value);
11919 return *this;
11920 }
11921 CONSTEXPR uint32_t get_payload_size() const
11922 {
11923 return static_cast<uint32_t>(payload_size);
11924 }
11925 CONSTEXPR npu_set_ifm_base2_t &set_payload_size(uint32_t value)
11926 {
11927 payload_size = static_cast<uint32_t>(value);
11928 return *this;
11929 }
11930#endif //__cplusplus
11931};
11932
11933// Set IFM base address (bottom right tile)
11934struct npu_set_ifm_base3_t
11935{
11936 uint32_t cmd_code : 10; // NPU_SET_IFM_BASE3
11937 uint32_t must_be_zero : 4; // 0
11938 uint32_t payload_size : 2; // Min:1 Max:2
11939 uint32_t reserved0 : 16;
11940 uint32_t data : 32; // IFM base address (bottom right tile)
11941#ifdef __cplusplus
11942 CONSTEXPR bool valid() const
11943 {
11944 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_IFM_BASE3) && must_be_zero == 0 && payload_size >= 1 &&
11945 payload_size <= 2;
11946 }
11947 CONSTEXPR void init()
11948 {
11949 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_IFM_BASE3);
11950 must_be_zero = 0;
11951 payload_size = 1;
11952 }
11953 CONSTEXPR ::cmd1 get_cmd_code() const
11954 {
11955 return static_cast<::cmd1>(cmd_code);
11956 }
11957 CONSTEXPR npu_set_ifm_base3_t &set_cmd_code(::cmd1 value)
11958 {
11959 cmd_code = static_cast<uint32_t>(value);
11960 return *this;
11961 }
11962 CONSTEXPR uint32_t get_data() const
11963 {
11964 return static_cast<uint32_t>(data);
11965 }
11966 CONSTEXPR npu_set_ifm_base3_t &set_data(uint32_t value)
11967 {
11968 data = static_cast<uint32_t>(value);
11969 return *this;
11970 }
11971 CONSTEXPR uint32_t get_payload_size() const
11972 {
11973 return static_cast<uint32_t>(payload_size);
11974 }
11975 CONSTEXPR npu_set_ifm_base3_t &set_payload_size(uint32_t value)
11976 {
11977 payload_size = static_cast<uint32_t>(value);
11978 return *this;
11979 }
11980#endif //__cplusplus
11981};
11982
11983// Set IFM byte stride between horizontal values
11984struct npu_set_ifm_stride_x_t
11985{
11986 uint32_t cmd_code : 10; // NPU_SET_IFM_STRIDE_X
11987 uint32_t must_be_zero : 4; // 0
11988 uint32_t payload_size : 2; // Min:1 Max:2
11989 uint32_t reserved0 : 16;
11990 uint32_t data : 32; // IFM byte stride between horizontal values
11991#ifdef __cplusplus
11992 CONSTEXPR bool valid() const
11993 {
11994 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_IFM_STRIDE_X) && must_be_zero == 0 &&
11995 payload_size >= 1 && payload_size <= 2;
11996 }
11997 CONSTEXPR void init()
11998 {
11999 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_IFM_STRIDE_X);
12000 must_be_zero = 0;
12001 payload_size = 1;
12002 }
12003 CONSTEXPR ::cmd1 get_cmd_code() const
12004 {
12005 return static_cast<::cmd1>(cmd_code);
12006 }
12007 CONSTEXPR npu_set_ifm_stride_x_t &set_cmd_code(::cmd1 value)
12008 {
12009 cmd_code = static_cast<uint32_t>(value);
12010 return *this;
12011 }
12012 CONSTEXPR uint32_t get_data() const
12013 {
12014 return static_cast<uint32_t>(data);
12015 }
12016 CONSTEXPR npu_set_ifm_stride_x_t &set_data(uint32_t value)
12017 {
12018 data = static_cast<uint32_t>(value);
12019 return *this;
12020 }
12021 CONSTEXPR uint32_t get_payload_size() const
12022 {
12023 return static_cast<uint32_t>(payload_size);
12024 }
12025 CONSTEXPR npu_set_ifm_stride_x_t &set_payload_size(uint32_t value)
12026 {
12027 payload_size = static_cast<uint32_t>(value);
12028 return *this;
12029 }
12030#endif //__cplusplus
12031};
12032
12033// Set IFM byte stride between vertical values
12034struct npu_set_ifm_stride_y_t
12035{
12036 uint32_t cmd_code : 10; // NPU_SET_IFM_STRIDE_Y
12037 uint32_t must_be_zero : 4; // 0
12038 uint32_t payload_size : 2; // Min:1 Max:2
12039 uint32_t reserved0 : 16;
12040 uint32_t data : 32; // IFM byte stride between vertical values
12041#ifdef __cplusplus
12042 CONSTEXPR bool valid() const
12043 {
12044 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_IFM_STRIDE_Y) && must_be_zero == 0 &&
12045 payload_size >= 1 && payload_size <= 2;
12046 }
12047 CONSTEXPR void init()
12048 {
12049 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_IFM_STRIDE_Y);
12050 must_be_zero = 0;
12051 payload_size = 1;
12052 }
12053 CONSTEXPR ::cmd1 get_cmd_code() const
12054 {
12055 return static_cast<::cmd1>(cmd_code);
12056 }
12057 CONSTEXPR npu_set_ifm_stride_y_t &set_cmd_code(::cmd1 value)
12058 {
12059 cmd_code = static_cast<uint32_t>(value);
12060 return *this;
12061 }
12062 CONSTEXPR uint32_t get_data() const
12063 {
12064 return static_cast<uint32_t>(data);
12065 }
12066 CONSTEXPR npu_set_ifm_stride_y_t &set_data(uint32_t value)
12067 {
12068 data = static_cast<uint32_t>(value);
12069 return *this;
12070 }
12071 CONSTEXPR uint32_t get_payload_size() const
12072 {
12073 return static_cast<uint32_t>(payload_size);
12074 }
12075 CONSTEXPR npu_set_ifm_stride_y_t &set_payload_size(uint32_t value)
12076 {
12077 payload_size = static_cast<uint32_t>(value);
12078 return *this;
12079 }
12080#endif //__cplusplus
12081};
12082
12083// Set IFM byte stride between channel blocks (of 16 bytes each block)
12084struct npu_set_ifm_stride_c_t
12085{
12086 uint32_t cmd_code : 10; // NPU_SET_IFM_STRIDE_C
12087 uint32_t must_be_zero : 4; // 0
12088 uint32_t payload_size : 2; // Min:1 Max:2
12089 uint32_t reserved0 : 16;
12090 uint32_t data : 32; // IFM byte stride between channel blocks (of 16 bytes each block)
12091#ifdef __cplusplus
12092 CONSTEXPR bool valid() const
12093 {
12094 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_IFM_STRIDE_C) && must_be_zero == 0 &&
12095 payload_size >= 1 && payload_size <= 2;
12096 }
12097 CONSTEXPR void init()
12098 {
12099 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_IFM_STRIDE_C);
12100 must_be_zero = 0;
12101 payload_size = 1;
12102 }
12103 CONSTEXPR ::cmd1 get_cmd_code() const
12104 {
12105 return static_cast<::cmd1>(cmd_code);
12106 }
12107 CONSTEXPR npu_set_ifm_stride_c_t &set_cmd_code(::cmd1 value)
12108 {
12109 cmd_code = static_cast<uint32_t>(value);
12110 return *this;
12111 }
12112 CONSTEXPR uint32_t get_data() const
12113 {
12114 return static_cast<uint32_t>(data);
12115 }
12116 CONSTEXPR npu_set_ifm_stride_c_t &set_data(uint32_t value)
12117 {
12118 data = static_cast<uint32_t>(value);
12119 return *this;
12120 }
12121 CONSTEXPR uint32_t get_payload_size() const
12122 {
12123 return static_cast<uint32_t>(payload_size);
12124 }
12125 CONSTEXPR npu_set_ifm_stride_c_t &set_payload_size(uint32_t value)
12126 {
12127 payload_size = static_cast<uint32_t>(value);
12128 return *this;
12129 }
12130#endif //__cplusplus
12131};
12132
12133// Set OFM base address (top left tile)
12134struct npu_set_ofm_base0_t
12135{
12136 uint32_t cmd_code : 10; // NPU_SET_OFM_BASE0
12137 uint32_t must_be_zero : 4; // 0
12138 uint32_t payload_size : 2; // Min:1 Max:2
12139 uint32_t reserved0 : 16;
12140 uint32_t data : 32; // OFM base address (top left tile)
12141#ifdef __cplusplus
12142 CONSTEXPR bool valid() const
12143 {
12144 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_OFM_BASE0) && must_be_zero == 0 && payload_size >= 1 &&
12145 payload_size <= 2;
12146 }
12147 CONSTEXPR void init()
12148 {
12149 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_OFM_BASE0);
12150 must_be_zero = 0;
12151 payload_size = 1;
12152 }
12153 CONSTEXPR ::cmd1 get_cmd_code() const
12154 {
12155 return static_cast<::cmd1>(cmd_code);
12156 }
12157 CONSTEXPR npu_set_ofm_base0_t &set_cmd_code(::cmd1 value)
12158 {
12159 cmd_code = static_cast<uint32_t>(value);
12160 return *this;
12161 }
12162 CONSTEXPR uint32_t get_data() const
12163 {
12164 return static_cast<uint32_t>(data);
12165 }
12166 CONSTEXPR npu_set_ofm_base0_t &set_data(uint32_t value)
12167 {
12168 data = static_cast<uint32_t>(value);
12169 return *this;
12170 }
12171 CONSTEXPR uint32_t get_payload_size() const
12172 {
12173 return static_cast<uint32_t>(payload_size);
12174 }
12175 CONSTEXPR npu_set_ofm_base0_t &set_payload_size(uint32_t value)
12176 {
12177 payload_size = static_cast<uint32_t>(value);
12178 return *this;
12179 }
12180#endif //__cplusplus
12181};
12182
12183// Set OFM base address (top right tile)
12184struct npu_set_ofm_base1_t
12185{
12186 uint32_t cmd_code : 10; // NPU_SET_OFM_BASE1
12187 uint32_t must_be_zero : 4; // 0
12188 uint32_t payload_size : 2; // Min:1 Max:2
12189 uint32_t reserved0 : 16;
12190 uint32_t data : 32; // OFM base address (top right tile)
12191#ifdef __cplusplus
12192 CONSTEXPR bool valid() const
12193 {
12194 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_OFM_BASE1) && must_be_zero == 0 && payload_size >= 1 &&
12195 payload_size <= 2;
12196 }
12197 CONSTEXPR void init()
12198 {
12199 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_OFM_BASE1);
12200 must_be_zero = 0;
12201 payload_size = 1;
12202 }
12203 CONSTEXPR ::cmd1 get_cmd_code() const
12204 {
12205 return static_cast<::cmd1>(cmd_code);
12206 }
12207 CONSTEXPR npu_set_ofm_base1_t &set_cmd_code(::cmd1 value)
12208 {
12209 cmd_code = static_cast<uint32_t>(value);
12210 return *this;
12211 }
12212 CONSTEXPR uint32_t get_data() const
12213 {
12214 return static_cast<uint32_t>(data);
12215 }
12216 CONSTEXPR npu_set_ofm_base1_t &set_data(uint32_t value)
12217 {
12218 data = static_cast<uint32_t>(value);
12219 return *this;
12220 }
12221 CONSTEXPR uint32_t get_payload_size() const
12222 {
12223 return static_cast<uint32_t>(payload_size);
12224 }
12225 CONSTEXPR npu_set_ofm_base1_t &set_payload_size(uint32_t value)
12226 {
12227 payload_size = static_cast<uint32_t>(value);
12228 return *this;
12229 }
12230#endif //__cplusplus
12231};
12232
12233// Set OFM base address (bottom left tile)
12234struct npu_set_ofm_base2_t
12235{
12236 uint32_t cmd_code : 10; // NPU_SET_OFM_BASE2
12237 uint32_t must_be_zero : 4; // 0
12238 uint32_t payload_size : 2; // Min:1 Max:2
12239 uint32_t reserved0 : 16;
12240 uint32_t data : 32; // OFM base address (bottom left tile)
12241#ifdef __cplusplus
12242 CONSTEXPR bool valid() const
12243 {
12244 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_OFM_BASE2) && must_be_zero == 0 && payload_size >= 1 &&
12245 payload_size <= 2;
12246 }
12247 CONSTEXPR void init()
12248 {
12249 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_OFM_BASE2);
12250 must_be_zero = 0;
12251 payload_size = 1;
12252 }
12253 CONSTEXPR ::cmd1 get_cmd_code() const
12254 {
12255 return static_cast<::cmd1>(cmd_code);
12256 }
12257 CONSTEXPR npu_set_ofm_base2_t &set_cmd_code(::cmd1 value)
12258 {
12259 cmd_code = static_cast<uint32_t>(value);
12260 return *this;
12261 }
12262 CONSTEXPR uint32_t get_data() const
12263 {
12264 return static_cast<uint32_t>(data);
12265 }
12266 CONSTEXPR npu_set_ofm_base2_t &set_data(uint32_t value)
12267 {
12268 data = static_cast<uint32_t>(value);
12269 return *this;
12270 }
12271 CONSTEXPR uint32_t get_payload_size() const
12272 {
12273 return static_cast<uint32_t>(payload_size);
12274 }
12275 CONSTEXPR npu_set_ofm_base2_t &set_payload_size(uint32_t value)
12276 {
12277 payload_size = static_cast<uint32_t>(value);
12278 return *this;
12279 }
12280#endif //__cplusplus
12281};
12282
12283// Set OFM base address (bottom right tile)
12284struct npu_set_ofm_base3_t
12285{
12286 uint32_t cmd_code : 10; // NPU_SET_OFM_BASE3
12287 uint32_t must_be_zero : 4; // 0
12288 uint32_t payload_size : 2; // Min:1 Max:2
12289 uint32_t reserved0 : 16;
12290 uint32_t data : 32; // OFM base address (bottom right tile)
12291#ifdef __cplusplus
12292 CONSTEXPR bool valid() const
12293 {
12294 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_OFM_BASE3) && must_be_zero == 0 && payload_size >= 1 &&
12295 payload_size <= 2;
12296 }
12297 CONSTEXPR void init()
12298 {
12299 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_OFM_BASE3);
12300 must_be_zero = 0;
12301 payload_size = 1;
12302 }
12303 CONSTEXPR ::cmd1 get_cmd_code() const
12304 {
12305 return static_cast<::cmd1>(cmd_code);
12306 }
12307 CONSTEXPR npu_set_ofm_base3_t &set_cmd_code(::cmd1 value)
12308 {
12309 cmd_code = static_cast<uint32_t>(value);
12310 return *this;
12311 }
12312 CONSTEXPR uint32_t get_data() const
12313 {
12314 return static_cast<uint32_t>(data);
12315 }
12316 CONSTEXPR npu_set_ofm_base3_t &set_data(uint32_t value)
12317 {
12318 data = static_cast<uint32_t>(value);
12319 return *this;
12320 }
12321 CONSTEXPR uint32_t get_payload_size() const
12322 {
12323 return static_cast<uint32_t>(payload_size);
12324 }
12325 CONSTEXPR npu_set_ofm_base3_t &set_payload_size(uint32_t value)
12326 {
12327 payload_size = static_cast<uint32_t>(value);
12328 return *this;
12329 }
12330#endif //__cplusplus
12331};
12332
12333// Set OFM byte stride between horizontal values
12334struct npu_set_ofm_stride_x_t
12335{
12336 uint32_t cmd_code : 10; // NPU_SET_OFM_STRIDE_X
12337 uint32_t must_be_zero : 4; // 0
12338 uint32_t payload_size : 2; // Min:1 Max:2
12339 uint32_t reserved0 : 16;
12340 uint32_t data : 32; // OFM byte stride between horizontal values
12341#ifdef __cplusplus
12342 CONSTEXPR bool valid() const
12343 {
12344 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_OFM_STRIDE_X) && must_be_zero == 0 &&
12345 payload_size >= 1 && payload_size <= 2;
12346 }
12347 CONSTEXPR void init()
12348 {
12349 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_OFM_STRIDE_X);
12350 must_be_zero = 0;
12351 payload_size = 1;
12352 }
12353 CONSTEXPR ::cmd1 get_cmd_code() const
12354 {
12355 return static_cast<::cmd1>(cmd_code);
12356 }
12357 CONSTEXPR npu_set_ofm_stride_x_t &set_cmd_code(::cmd1 value)
12358 {
12359 cmd_code = static_cast<uint32_t>(value);
12360 return *this;
12361 }
12362 CONSTEXPR uint32_t get_data() const
12363 {
12364 return static_cast<uint32_t>(data);
12365 }
12366 CONSTEXPR npu_set_ofm_stride_x_t &set_data(uint32_t value)
12367 {
12368 data = static_cast<uint32_t>(value);
12369 return *this;
12370 }
12371 CONSTEXPR uint32_t get_payload_size() const
12372 {
12373 return static_cast<uint32_t>(payload_size);
12374 }
12375 CONSTEXPR npu_set_ofm_stride_x_t &set_payload_size(uint32_t value)
12376 {
12377 payload_size = static_cast<uint32_t>(value);
12378 return *this;
12379 }
12380#endif //__cplusplus
12381};
12382
12383// Set OFM byte stride between vertical values
12384struct npu_set_ofm_stride_y_t
12385{
12386 uint32_t cmd_code : 10; // NPU_SET_OFM_STRIDE_Y
12387 uint32_t must_be_zero : 4; // 0
12388 uint32_t payload_size : 2; // Min:1 Max:2
12389 uint32_t reserved0 : 16;
12390 uint32_t data : 32; // OFM byte stride between vertical values
12391#ifdef __cplusplus
12392 CONSTEXPR bool valid() const
12393 {
12394 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_OFM_STRIDE_Y) && must_be_zero == 0 &&
12395 payload_size >= 1 && payload_size <= 2;
12396 }
12397 CONSTEXPR void init()
12398 {
12399 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_OFM_STRIDE_Y);
12400 must_be_zero = 0;
12401 payload_size = 1;
12402 }
12403 CONSTEXPR ::cmd1 get_cmd_code() const
12404 {
12405 return static_cast<::cmd1>(cmd_code);
12406 }
12407 CONSTEXPR npu_set_ofm_stride_y_t &set_cmd_code(::cmd1 value)
12408 {
12409 cmd_code = static_cast<uint32_t>(value);
12410 return *this;
12411 }
12412 CONSTEXPR uint32_t get_data() const
12413 {
12414 return static_cast<uint32_t>(data);
12415 }
12416 CONSTEXPR npu_set_ofm_stride_y_t &set_data(uint32_t value)
12417 {
12418 data = static_cast<uint32_t>(value);
12419 return *this;
12420 }
12421 CONSTEXPR uint32_t get_payload_size() const
12422 {
12423 return static_cast<uint32_t>(payload_size);
12424 }
12425 CONSTEXPR npu_set_ofm_stride_y_t &set_payload_size(uint32_t value)
12426 {
12427 payload_size = static_cast<uint32_t>(value);
12428 return *this;
12429 }
12430#endif //__cplusplus
12431};
12432
12433// Set OFM byte stride between channel blocks (of 16 bytes each block)
12434struct npu_set_ofm_stride_c_t
12435{
12436 uint32_t cmd_code : 10; // NPU_SET_OFM_STRIDE_C
12437 uint32_t must_be_zero : 4; // 0
12438 uint32_t payload_size : 2; // Min:1 Max:2
12439 uint32_t reserved0 : 16;
12440 uint32_t data : 32; // OFM byte stride between channel blocks (of 16 bytes each block)
12441#ifdef __cplusplus
12442 CONSTEXPR bool valid() const
12443 {
12444 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_OFM_STRIDE_C) && must_be_zero == 0 &&
12445 payload_size >= 1 && payload_size <= 2;
12446 }
12447 CONSTEXPR void init()
12448 {
12449 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_OFM_STRIDE_C);
12450 must_be_zero = 0;
12451 payload_size = 1;
12452 }
12453 CONSTEXPR ::cmd1 get_cmd_code() const
12454 {
12455 return static_cast<::cmd1>(cmd_code);
12456 }
12457 CONSTEXPR npu_set_ofm_stride_c_t &set_cmd_code(::cmd1 value)
12458 {
12459 cmd_code = static_cast<uint32_t>(value);
12460 return *this;
12461 }
12462 CONSTEXPR uint32_t get_data() const
12463 {
12464 return static_cast<uint32_t>(data);
12465 }
12466 CONSTEXPR npu_set_ofm_stride_c_t &set_data(uint32_t value)
12467 {
12468 data = static_cast<uint32_t>(value);
12469 return *this;
12470 }
12471 CONSTEXPR uint32_t get_payload_size() const
12472 {
12473 return static_cast<uint32_t>(payload_size);
12474 }
12475 CONSTEXPR npu_set_ofm_stride_c_t &set_payload_size(uint32_t value)
12476 {
12477 payload_size = static_cast<uint32_t>(value);
12478 return *this;
12479 }
12480#endif //__cplusplus
12481};
12482
12483// Set Weight stream input base address
12484struct npu_set_weight_base_t
12485{
12486 uint32_t cmd_code : 10; // NPU_SET_WEIGHT_BASE
12487 uint32_t must_be_zero : 4; // 0
12488 uint32_t payload_size : 2; // Min:1 Max:2
12489 uint32_t reserved0 : 16;
12490 uint32_t data : 32; // Weight stream input base address
12491#ifdef __cplusplus
12492 CONSTEXPR bool valid() const
12493 {
12494 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_WEIGHT_BASE) && must_be_zero == 0 && payload_size >= 1 &&
12495 payload_size <= 2;
12496 }
12497 CONSTEXPR void init()
12498 {
12499 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_WEIGHT_BASE);
12500 must_be_zero = 0;
12501 payload_size = 1;
12502 }
12503 CONSTEXPR ::cmd1 get_cmd_code() const
12504 {
12505 return static_cast<::cmd1>(cmd_code);
12506 }
12507 CONSTEXPR npu_set_weight_base_t &set_cmd_code(::cmd1 value)
12508 {
12509 cmd_code = static_cast<uint32_t>(value);
12510 return *this;
12511 }
12512 CONSTEXPR uint32_t get_data() const
12513 {
12514 return static_cast<uint32_t>(data);
12515 }
12516 CONSTEXPR npu_set_weight_base_t &set_data(uint32_t value)
12517 {
12518 data = static_cast<uint32_t>(value);
12519 return *this;
12520 }
12521 CONSTEXPR uint32_t get_payload_size() const
12522 {
12523 return static_cast<uint32_t>(payload_size);
12524 }
12525 CONSTEXPR npu_set_weight_base_t &set_payload_size(uint32_t value)
12526 {
12527 payload_size = static_cast<uint32_t>(value);
12528 return *this;
12529 }
12530#endif //__cplusplus
12531};
12532
12533// Set Weight stream length
12534struct npu_set_weight_length_t
12535{
12536 uint32_t cmd_code : 10; // NPU_SET_WEIGHT_LENGTH
12537 uint32_t must_be_zero : 4; // 0
12538 uint32_t payload_size : 2; // Min:1 Max:2
12539 uint32_t reserved0 : 16;
12540 uint32_t data : 32; // Weight stream length
12541#ifdef __cplusplus
12542 CONSTEXPR bool valid() const
12543 {
12544 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_WEIGHT_LENGTH) && must_be_zero == 0 &&
12545 payload_size >= 1 && payload_size <= 2;
12546 }
12547 CONSTEXPR void init()
12548 {
12549 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_WEIGHT_LENGTH);
12550 must_be_zero = 0;
12551 payload_size = 1;
12552 }
12553 CONSTEXPR ::cmd1 get_cmd_code() const
12554 {
12555 return static_cast<::cmd1>(cmd_code);
12556 }
12557 CONSTEXPR npu_set_weight_length_t &set_cmd_code(::cmd1 value)
12558 {
12559 cmd_code = static_cast<uint32_t>(value);
12560 return *this;
12561 }
12562 CONSTEXPR uint32_t get_data() const
12563 {
12564 return static_cast<uint32_t>(data);
12565 }
12566 CONSTEXPR npu_set_weight_length_t &set_data(uint32_t value)
12567 {
12568 data = static_cast<uint32_t>(value);
12569 return *this;
12570 }
12571 CONSTEXPR uint32_t get_payload_size() const
12572 {
12573 return static_cast<uint32_t>(payload_size);
12574 }
12575 CONSTEXPR npu_set_weight_length_t &set_payload_size(uint32_t value)
12576 {
12577 payload_size = static_cast<uint32_t>(value);
12578 return *this;
12579 }
12580#endif //__cplusplus
12581};
12582
12583// Set Scale and bias stream input base address
12584struct npu_set_scale_base_t
12585{
12586 uint32_t cmd_code : 10; // NPU_SET_SCALE_BASE
12587 uint32_t must_be_zero : 4; // 0
12588 uint32_t payload_size : 2; // Min:1 Max:2
12589 uint32_t reserved0 : 16;
12590 uint32_t data : 32; // Scale and bias stream input base address
12591#ifdef __cplusplus
12592 CONSTEXPR bool valid() const
12593 {
12594 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_SCALE_BASE) && must_be_zero == 0 && payload_size >= 1 &&
12595 payload_size <= 2;
12596 }
12597 CONSTEXPR void init()
12598 {
12599 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_SCALE_BASE);
12600 must_be_zero = 0;
12601 payload_size = 1;
12602 }
12603 CONSTEXPR ::cmd1 get_cmd_code() const
12604 {
12605 return static_cast<::cmd1>(cmd_code);
12606 }
12607 CONSTEXPR npu_set_scale_base_t &set_cmd_code(::cmd1 value)
12608 {
12609 cmd_code = static_cast<uint32_t>(value);
12610 return *this;
12611 }
12612 CONSTEXPR uint32_t get_data() const
12613 {
12614 return static_cast<uint32_t>(data);
12615 }
12616 CONSTEXPR npu_set_scale_base_t &set_data(uint32_t value)
12617 {
12618 data = static_cast<uint32_t>(value);
12619 return *this;
12620 }
12621 CONSTEXPR uint32_t get_payload_size() const
12622 {
12623 return static_cast<uint32_t>(payload_size);
12624 }
12625 CONSTEXPR npu_set_scale_base_t &set_payload_size(uint32_t value)
12626 {
12627 payload_size = static_cast<uint32_t>(value);
12628 return *this;
12629 }
12630#endif //__cplusplus
12631};
12632
12633// Set Scale and bias stream input length
12634struct npu_set_scale_length_t
12635{
12636 uint32_t cmd_code : 10; // NPU_SET_SCALE_LENGTH
12637 uint32_t must_be_zero : 4; // 0
12638 uint32_t payload_size : 2; // Min:1 Max:2
12639 uint32_t reserved0 : 16;
12640 uint32_t data : 32; // Scale and bias stream input length
12641#ifdef __cplusplus
12642 CONSTEXPR bool valid() const
12643 {
12644 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_SCALE_LENGTH) && must_be_zero == 0 &&
12645 payload_size >= 1 && payload_size <= 2;
12646 }
12647 CONSTEXPR void init()
12648 {
12649 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_SCALE_LENGTH);
12650 must_be_zero = 0;
12651 payload_size = 1;
12652 }
12653 CONSTEXPR ::cmd1 get_cmd_code() const
12654 {
12655 return static_cast<::cmd1>(cmd_code);
12656 }
12657 CONSTEXPR npu_set_scale_length_t &set_cmd_code(::cmd1 value)
12658 {
12659 cmd_code = static_cast<uint32_t>(value);
12660 return *this;
12661 }
12662 CONSTEXPR uint32_t get_data() const
12663 {
12664 return static_cast<uint32_t>(data);
12665 }
12666 CONSTEXPR npu_set_scale_length_t &set_data(uint32_t value)
12667 {
12668 data = static_cast<uint32_t>(value);
12669 return *this;
12670 }
12671 CONSTEXPR uint32_t get_payload_size() const
12672 {
12673 return static_cast<uint32_t>(payload_size);
12674 }
12675 CONSTEXPR npu_set_scale_length_t &set_payload_size(uint32_t value)
12676 {
12677 payload_size = static_cast<uint32_t>(value);
12678 return *this;
12679 }
12680#endif //__cplusplus
12681};
12682
12683// Set scale (32-bit). Used by average pool with pad=0, elementwise MUL, ADD, SUB
12684struct npu_set_ofm_scale_t
12685{
12686 uint32_t cmd_code : 10; // NPU_SET_OFM_SCALE
12687 uint32_t must_be_zero : 4; // 0
12688 uint32_t payload_size : 2; // Min:1 Max:2
12689 uint32_t shift : 16;
12690 uint32_t data : 32; // scale (32-bit). Used by average pool with pad=0, elementwise MUL, ADD, SUB
12691#ifdef __cplusplus
12692 CONSTEXPR bool valid() const
12693 {
12694 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_OFM_SCALE) && must_be_zero == 0 && payload_size >= 1 &&
12695 payload_size <= 2;
12696 }
12697 CONSTEXPR void init()
12698 {
12699 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_OFM_SCALE);
12700 must_be_zero = 0;
12701 payload_size = 1;
12702 }
12703 CONSTEXPR ::cmd1 get_cmd_code() const
12704 {
12705 return static_cast<::cmd1>(cmd_code);
12706 }
12707 CONSTEXPR npu_set_ofm_scale_t &set_cmd_code(::cmd1 value)
12708 {
12709 cmd_code = static_cast<uint32_t>(value);
12710 return *this;
12711 }
12712 CONSTEXPR uint32_t get_data() const
12713 {
12714 return static_cast<uint32_t>(data);
12715 }
12716 CONSTEXPR npu_set_ofm_scale_t &set_data(uint32_t value)
12717 {
12718 data = static_cast<uint32_t>(value);
12719 return *this;
12720 }
12721 CONSTEXPR uint32_t get_payload_size() const
12722 {
12723 return static_cast<uint32_t>(payload_size);
12724 }
12725 CONSTEXPR npu_set_ofm_scale_t &set_payload_size(uint32_t value)
12726 {
12727 payload_size = static_cast<uint32_t>(value);
12728 return *this;
12729 }
12730 CONSTEXPR uint32_t get_shift() const
12731 {
12732 return static_cast<uint32_t>(shift);
12733 }
12734 CONSTEXPR npu_set_ofm_scale_t &set_shift(uint32_t value)
12735 {
12736 shift = static_cast<uint32_t>(value);
12737 return *this;
12738 }
12739#endif //__cplusplus
12740};
12741
12742// Set scale (32-bit) used for elementwise ADD/SUB OPA prescale. If IFM scale mode is 0 then shift is ignored and scale
12743// is 16-bit. If IFM scale mode is 1 or 2 then shift is 6-bit and scale is 32-bit
12744struct npu_set_opa_scale_t
12745{
12746 uint32_t cmd_code : 10; // NPU_SET_OPA_SCALE
12747 uint32_t must_be_zero : 4; // 0
12748 uint32_t payload_size : 2; // Min:1 Max:2
12749 uint32_t shift : 16;
12750 uint32_t
12751 data : 32; // scale (32-bit) used for elementwise ADD/SUB OPA prescale. If IFM scale mode is 0 then shift is
12752 // ignored and scale is 16-bit. If IFM scale mode is 1 or 2 then shift is 6-bit and scale is 32-bit
12753#ifdef __cplusplus
12754 CONSTEXPR bool valid() const
12755 {
12756 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_OPA_SCALE) && must_be_zero == 0 && payload_size >= 1 &&
12757 payload_size <= 2;
12758 }
12759 CONSTEXPR void init()
12760 {
12761 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_OPA_SCALE);
12762 must_be_zero = 0;
12763 payload_size = 1;
12764 }
12765 CONSTEXPR ::cmd1 get_cmd_code() const
12766 {
12767 return static_cast<::cmd1>(cmd_code);
12768 }
12769 CONSTEXPR npu_set_opa_scale_t &set_cmd_code(::cmd1 value)
12770 {
12771 cmd_code = static_cast<uint32_t>(value);
12772 return *this;
12773 }
12774 CONSTEXPR uint32_t get_data() const
12775 {
12776 return static_cast<uint32_t>(data);
12777 }
12778 CONSTEXPR npu_set_opa_scale_t &set_data(uint32_t value)
12779 {
12780 data = static_cast<uint32_t>(value);
12781 return *this;
12782 }
12783 CONSTEXPR uint32_t get_payload_size() const
12784 {
12785 return static_cast<uint32_t>(payload_size);
12786 }
12787 CONSTEXPR npu_set_opa_scale_t &set_payload_size(uint32_t value)
12788 {
12789 payload_size = static_cast<uint32_t>(value);
12790 return *this;
12791 }
12792 CONSTEXPR uint32_t get_shift() const
12793 {
12794 return static_cast<uint32_t>(shift);
12795 }
12796 CONSTEXPR npu_set_opa_scale_t &set_shift(uint32_t value)
12797 {
12798 shift = static_cast<uint32_t>(value);
12799 return *this;
12800 }
12801#endif //__cplusplus
12802};
12803
12804// Set scale (16-bit) used for elementwise ADD/SUB OPB prescale. If IFM scale mode is 0 then scale is 16-bit. If IFM
12805// scale mode is 1 or 2 then this register is not used
12806struct npu_set_opb_scale_t
12807{
12808 uint32_t cmd_code : 10; // NPU_SET_OPB_SCALE
12809 uint32_t must_be_zero : 4; // 0
12810 uint32_t payload_size : 2; // Min:1 Max:2
12811 uint32_t reserved0 : 16;
12812 uint32_t data : 32; // scale (16-bit) used for elementwise ADD/SUB OPB prescale. If IFM scale mode is 0 then scale
12813 // is 16-bit. If IFM scale mode is 1 or 2 then this register is not used
12814#ifdef __cplusplus
12815 CONSTEXPR bool valid() const
12816 {
12817 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_OPB_SCALE) && must_be_zero == 0 && payload_size >= 1 &&
12818 payload_size <= 2;
12819 }
12820 CONSTEXPR void init()
12821 {
12822 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_OPB_SCALE);
12823 must_be_zero = 0;
12824 payload_size = 1;
12825 }
12826 CONSTEXPR ::cmd1 get_cmd_code() const
12827 {
12828 return static_cast<::cmd1>(cmd_code);
12829 }
12830 CONSTEXPR npu_set_opb_scale_t &set_cmd_code(::cmd1 value)
12831 {
12832 cmd_code = static_cast<uint32_t>(value);
12833 return *this;
12834 }
12835 CONSTEXPR uint32_t get_data() const
12836 {
12837 return static_cast<uint32_t>(data);
12838 }
12839 CONSTEXPR npu_set_opb_scale_t &set_data(uint32_t value)
12840 {
12841 data = static_cast<uint32_t>(value);
12842 return *this;
12843 }
12844 CONSTEXPR uint32_t get_payload_size() const
12845 {
12846 return static_cast<uint32_t>(payload_size);
12847 }
12848 CONSTEXPR npu_set_opb_scale_t &set_payload_size(uint32_t value)
12849 {
12850 payload_size = static_cast<uint32_t>(value);
12851 return *this;
12852 }
12853#endif //__cplusplus
12854};
12855
12856// Set DMA source address
12857struct npu_set_dma0_src_t
12858{
12859 uint32_t cmd_code : 10; // NPU_SET_DMA0_SRC
12860 uint32_t must_be_zero : 4; // 0
12861 uint32_t payload_size : 2; // Min:1 Max:2
12862 uint32_t reserved0 : 16;
12863 uint32_t data : 32;
12864#ifdef __cplusplus
12865 CONSTEXPR bool valid() const
12866 {
12867 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_DMA0_SRC) && must_be_zero == 0 && payload_size >= 1 &&
12868 payload_size <= 2;
12869 }
12870 CONSTEXPR void init()
12871 {
12872 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_DMA0_SRC);
12873 must_be_zero = 0;
12874 payload_size = 1;
12875 }
12876 CONSTEXPR ::cmd1 get_cmd_code() const
12877 {
12878 return static_cast<::cmd1>(cmd_code);
12879 }
12880 CONSTEXPR npu_set_dma0_src_t &set_cmd_code(::cmd1 value)
12881 {
12882 cmd_code = static_cast<uint32_t>(value);
12883 return *this;
12884 }
12885 CONSTEXPR uint32_t get_data() const
12886 {
12887 return static_cast<uint32_t>(data);
12888 }
12889 CONSTEXPR npu_set_dma0_src_t &set_data(uint32_t value)
12890 {
12891 data = static_cast<uint32_t>(value);
12892 return *this;
12893 }
12894 CONSTEXPR uint32_t get_payload_size() const
12895 {
12896 return static_cast<uint32_t>(payload_size);
12897 }
12898 CONSTEXPR npu_set_dma0_src_t &set_payload_size(uint32_t value)
12899 {
12900 payload_size = static_cast<uint32_t>(value);
12901 return *this;
12902 }
12903#endif //__cplusplus
12904};
12905
12906// Set DMA destination address
12907struct npu_set_dma0_dst_t
12908{
12909 uint32_t cmd_code : 10; // NPU_SET_DMA0_DST
12910 uint32_t must_be_zero : 4; // 0
12911 uint32_t payload_size : 2; // Min:1 Max:2
12912 uint32_t reserved0 : 16;
12913 uint32_t data : 32;
12914#ifdef __cplusplus
12915 CONSTEXPR bool valid() const
12916 {
12917 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_DMA0_DST) && must_be_zero == 0 && payload_size >= 1 &&
12918 payload_size <= 2;
12919 }
12920 CONSTEXPR void init()
12921 {
12922 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_DMA0_DST);
12923 must_be_zero = 0;
12924 payload_size = 1;
12925 }
12926 CONSTEXPR ::cmd1 get_cmd_code() const
12927 {
12928 return static_cast<::cmd1>(cmd_code);
12929 }
12930 CONSTEXPR npu_set_dma0_dst_t &set_cmd_code(::cmd1 value)
12931 {
12932 cmd_code = static_cast<uint32_t>(value);
12933 return *this;
12934 }
12935 CONSTEXPR uint32_t get_data() const
12936 {
12937 return static_cast<uint32_t>(data);
12938 }
12939 CONSTEXPR npu_set_dma0_dst_t &set_data(uint32_t value)
12940 {
12941 data = static_cast<uint32_t>(value);
12942 return *this;
12943 }
12944 CONSTEXPR uint32_t get_payload_size() const
12945 {
12946 return static_cast<uint32_t>(payload_size);
12947 }
12948 CONSTEXPR npu_set_dma0_dst_t &set_payload_size(uint32_t value)
12949 {
12950 payload_size = static_cast<uint32_t>(value);
12951 return *this;
12952 }
12953#endif //__cplusplus
12954};
12955
12956// Set DMA length
12957struct npu_set_dma0_len_t
12958{
12959 uint32_t cmd_code : 10; // NPU_SET_DMA0_LEN
12960 uint32_t must_be_zero : 4; // 0
12961 uint32_t payload_size : 2; // Min:1 Max:2
12962 uint32_t reserved0 : 16;
12963 uint32_t data : 32; // DMA length
12964#ifdef __cplusplus
12965 CONSTEXPR bool valid() const
12966 {
12967 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_DMA0_LEN) && must_be_zero == 0 && payload_size >= 1 &&
12968 payload_size <= 2;
12969 }
12970 CONSTEXPR void init()
12971 {
12972 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_DMA0_LEN);
12973 must_be_zero = 0;
12974 payload_size = 1;
12975 }
12976 CONSTEXPR ::cmd1 get_cmd_code() const
12977 {
12978 return static_cast<::cmd1>(cmd_code);
12979 }
12980 CONSTEXPR npu_set_dma0_len_t &set_cmd_code(::cmd1 value)
12981 {
12982 cmd_code = static_cast<uint32_t>(value);
12983 return *this;
12984 }
12985 CONSTEXPR uint32_t get_data() const
12986 {
12987 return static_cast<uint32_t>(data);
12988 }
12989 CONSTEXPR npu_set_dma0_len_t &set_data(uint32_t value)
12990 {
12991 data = static_cast<uint32_t>(value);
12992 return *this;
12993 }
12994 CONSTEXPR uint32_t get_payload_size() const
12995 {
12996 return static_cast<uint32_t>(payload_size);
12997 }
12998 CONSTEXPR npu_set_dma0_len_t &set_payload_size(uint32_t value)
12999 {
13000 payload_size = static_cast<uint32_t>(value);
13001 return *this;
13002 }
13003#endif //__cplusplus
13004};
13005
13006// Set Byte distance to skip after inner size (2D/3D mode)
13007struct npu_set_dma0_skip0_t
13008{
13009 uint32_t cmd_code : 10; // NPU_SET_DMA0_SKIP0
13010 uint32_t must_be_zero : 4; // 0
13011 uint32_t payload_size : 2; // Min:1 Max:2
13012 uint32_t param : 16;
13013 uint32_t data : 32; // Byte distance to skip after inner size (2D/3D mode)
13014#ifdef __cplusplus
13015 CONSTEXPR bool valid() const
13016 {
13017 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_DMA0_SKIP0) && must_be_zero == 0 && payload_size >= 1 &&
13018 payload_size <= 2;
13019 }
13020 CONSTEXPR void init()
13021 {
13022 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_DMA0_SKIP0);
13023 must_be_zero = 0;
13024 payload_size = 1;
13025 }
13026 CONSTEXPR ::cmd1 get_cmd_code() const
13027 {
13028 return static_cast<::cmd1>(cmd_code);
13029 }
13030 CONSTEXPR npu_set_dma0_skip0_t &set_cmd_code(::cmd1 value)
13031 {
13032 cmd_code = static_cast<uint32_t>(value);
13033 return *this;
13034 }
13035 CONSTEXPR uint32_t get_data() const
13036 {
13037 return static_cast<uint32_t>(data);
13038 }
13039 CONSTEXPR npu_set_dma0_skip0_t &set_data(uint32_t value)
13040 {
13041 data = static_cast<uint32_t>(value);
13042 return *this;
13043 }
13044 CONSTEXPR uint32_t get_param() const
13045 {
13046 return static_cast<uint32_t>(param);
13047 }
13048 CONSTEXPR npu_set_dma0_skip0_t &set_param(uint32_t value)
13049 {
13050 param = static_cast<uint32_t>(value);
13051 return *this;
13052 }
13053 CONSTEXPR uint32_t get_payload_size() const
13054 {
13055 return static_cast<uint32_t>(payload_size);
13056 }
13057 CONSTEXPR npu_set_dma0_skip0_t &set_payload_size(uint32_t value)
13058 {
13059 payload_size = static_cast<uint32_t>(value);
13060 return *this;
13061 }
13062#endif //__cplusplus
13063};
13064
13065// Set Byte distance to skip after outer size (3D mode)
13066struct npu_set_dma0_skip1_t
13067{
13068 uint32_t cmd_code : 10; // NPU_SET_DMA0_SKIP1
13069 uint32_t must_be_zero : 4; // 0
13070 uint32_t payload_size : 2; // Min:1 Max:2
13071 uint32_t param : 16;
13072 uint32_t data : 32; // Byte distance to skip after outer size (3D mode)
13073#ifdef __cplusplus
13074 CONSTEXPR bool valid() const
13075 {
13076 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_DMA0_SKIP1) && must_be_zero == 0 && payload_size >= 1 &&
13077 payload_size <= 2;
13078 }
13079 CONSTEXPR void init()
13080 {
13081 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_DMA0_SKIP1);
13082 must_be_zero = 0;
13083 payload_size = 1;
13084 }
13085 CONSTEXPR ::cmd1 get_cmd_code() const
13086 {
13087 return static_cast<::cmd1>(cmd_code);
13088 }
13089 CONSTEXPR npu_set_dma0_skip1_t &set_cmd_code(::cmd1 value)
13090 {
13091 cmd_code = static_cast<uint32_t>(value);
13092 return *this;
13093 }
13094 CONSTEXPR uint32_t get_data() const
13095 {
13096 return static_cast<uint32_t>(data);
13097 }
13098 CONSTEXPR npu_set_dma0_skip1_t &set_data(uint32_t value)
13099 {
13100 data = static_cast<uint32_t>(value);
13101 return *this;
13102 }
13103 CONSTEXPR uint32_t get_param() const
13104 {
13105 return static_cast<uint32_t>(param);
13106 }
13107 CONSTEXPR npu_set_dma0_skip1_t &set_param(uint32_t value)
13108 {
13109 param = static_cast<uint32_t>(value);
13110 return *this;
13111 }
13112 CONSTEXPR uint32_t get_payload_size() const
13113 {
13114 return static_cast<uint32_t>(payload_size);
13115 }
13116 CONSTEXPR npu_set_dma0_skip1_t &set_payload_size(uint32_t value)
13117 {
13118 payload_size = static_cast<uint32_t>(value);
13119 return *this;
13120 }
13121#endif //__cplusplus
13122};
13123
13124// Set IFM2 tile0 offset (top left tile) from IFM_REGION start
13125struct npu_set_ifm2_base0_t
13126{
13127 uint32_t cmd_code : 10; // NPU_SET_IFM2_BASE0
13128 uint32_t must_be_zero : 4; // 0
13129 uint32_t payload_size : 2; // Min:1 Max:2
13130 uint32_t reserved0 : 16;
13131 uint32_t data : 32; // IFM2 tile0 offset (top left tile) from IFM_REGION start
13132#ifdef __cplusplus
13133 CONSTEXPR bool valid() const
13134 {
13135 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_IFM2_BASE0) && must_be_zero == 0 && payload_size >= 1 &&
13136 payload_size <= 2;
13137 }
13138 CONSTEXPR void init()
13139 {
13140 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_IFM2_BASE0);
13141 must_be_zero = 0;
13142 payload_size = 1;
13143 }
13144 CONSTEXPR ::cmd1 get_cmd_code() const
13145 {
13146 return static_cast<::cmd1>(cmd_code);
13147 }
13148 CONSTEXPR npu_set_ifm2_base0_t &set_cmd_code(::cmd1 value)
13149 {
13150 cmd_code = static_cast<uint32_t>(value);
13151 return *this;
13152 }
13153 CONSTEXPR uint32_t get_data() const
13154 {
13155 return static_cast<uint32_t>(data);
13156 }
13157 CONSTEXPR npu_set_ifm2_base0_t &set_data(uint32_t value)
13158 {
13159 data = static_cast<uint32_t>(value);
13160 return *this;
13161 }
13162 CONSTEXPR uint32_t get_payload_size() const
13163 {
13164 return static_cast<uint32_t>(payload_size);
13165 }
13166 CONSTEXPR npu_set_ifm2_base0_t &set_payload_size(uint32_t value)
13167 {
13168 payload_size = static_cast<uint32_t>(value);
13169 return *this;
13170 }
13171#endif //__cplusplus
13172};
13173
13174// Set IFM2 tile1 offset (top right tile) from IFM_REGION start
13175struct npu_set_ifm2_base1_t
13176{
13177 uint32_t cmd_code : 10; // NPU_SET_IFM2_BASE1
13178 uint32_t must_be_zero : 4; // 0
13179 uint32_t payload_size : 2; // Min:1 Max:2
13180 uint32_t reserved0 : 16;
13181 uint32_t data : 32; // IFM2 tile1 offset (top right tile) from IFM_REGION start
13182#ifdef __cplusplus
13183 CONSTEXPR bool valid() const
13184 {
13185 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_IFM2_BASE1) && must_be_zero == 0 && payload_size >= 1 &&
13186 payload_size <= 2;
13187 }
13188 CONSTEXPR void init()
13189 {
13190 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_IFM2_BASE1);
13191 must_be_zero = 0;
13192 payload_size = 1;
13193 }
13194 CONSTEXPR ::cmd1 get_cmd_code() const
13195 {
13196 return static_cast<::cmd1>(cmd_code);
13197 }
13198 CONSTEXPR npu_set_ifm2_base1_t &set_cmd_code(::cmd1 value)
13199 {
13200 cmd_code = static_cast<uint32_t>(value);
13201 return *this;
13202 }
13203 CONSTEXPR uint32_t get_data() const
13204 {
13205 return static_cast<uint32_t>(data);
13206 }
13207 CONSTEXPR npu_set_ifm2_base1_t &set_data(uint32_t value)
13208 {
13209 data = static_cast<uint32_t>(value);
13210 return *this;
13211 }
13212 CONSTEXPR uint32_t get_payload_size() const
13213 {
13214 return static_cast<uint32_t>(payload_size);
13215 }
13216 CONSTEXPR npu_set_ifm2_base1_t &set_payload_size(uint32_t value)
13217 {
13218 payload_size = static_cast<uint32_t>(value);
13219 return *this;
13220 }
13221#endif //__cplusplus
13222};
13223
13224// Set IFM2 tile2 offset (bottom left tile) from IFM_REGION start
13225struct npu_set_ifm2_base2_t
13226{
13227 uint32_t cmd_code : 10; // NPU_SET_IFM2_BASE2
13228 uint32_t must_be_zero : 4; // 0
13229 uint32_t payload_size : 2; // Min:1 Max:2
13230 uint32_t reserved0 : 16;
13231 uint32_t data : 32; // IFM2 tile2 offset (bottom left tile) from IFM_REGION start
13232#ifdef __cplusplus
13233 CONSTEXPR bool valid() const
13234 {
13235 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_IFM2_BASE2) && must_be_zero == 0 && payload_size >= 1 &&
13236 payload_size <= 2;
13237 }
13238 CONSTEXPR void init()
13239 {
13240 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_IFM2_BASE2);
13241 must_be_zero = 0;
13242 payload_size = 1;
13243 }
13244 CONSTEXPR ::cmd1 get_cmd_code() const
13245 {
13246 return static_cast<::cmd1>(cmd_code);
13247 }
13248 CONSTEXPR npu_set_ifm2_base2_t &set_cmd_code(::cmd1 value)
13249 {
13250 cmd_code = static_cast<uint32_t>(value);
13251 return *this;
13252 }
13253 CONSTEXPR uint32_t get_data() const
13254 {
13255 return static_cast<uint32_t>(data);
13256 }
13257 CONSTEXPR npu_set_ifm2_base2_t &set_data(uint32_t value)
13258 {
13259 data = static_cast<uint32_t>(value);
13260 return *this;
13261 }
13262 CONSTEXPR uint32_t get_payload_size() const
13263 {
13264 return static_cast<uint32_t>(payload_size);
13265 }
13266 CONSTEXPR npu_set_ifm2_base2_t &set_payload_size(uint32_t value)
13267 {
13268 payload_size = static_cast<uint32_t>(value);
13269 return *this;
13270 }
13271#endif //__cplusplus
13272};
13273
13274// Set IFM2 tile3 offset (bottom right tile) from IFM_REGION start
13275struct npu_set_ifm2_base3_t
13276{
13277 uint32_t cmd_code : 10; // NPU_SET_IFM2_BASE3
13278 uint32_t must_be_zero : 4; // 0
13279 uint32_t payload_size : 2; // Min:1 Max:2
13280 uint32_t reserved0 : 16;
13281 uint32_t data : 32; // IFM2 tile3 offset (bottom right tile) from IFM_REGION start
13282#ifdef __cplusplus
13283 CONSTEXPR bool valid() const
13284 {
13285 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_IFM2_BASE3) && must_be_zero == 0 && payload_size >= 1 &&
13286 payload_size <= 2;
13287 }
13288 CONSTEXPR void init()
13289 {
13290 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_IFM2_BASE3);
13291 must_be_zero = 0;
13292 payload_size = 1;
13293 }
13294 CONSTEXPR ::cmd1 get_cmd_code() const
13295 {
13296 return static_cast<::cmd1>(cmd_code);
13297 }
13298 CONSTEXPR npu_set_ifm2_base3_t &set_cmd_code(::cmd1 value)
13299 {
13300 cmd_code = static_cast<uint32_t>(value);
13301 return *this;
13302 }
13303 CONSTEXPR uint32_t get_data() const
13304 {
13305 return static_cast<uint32_t>(data);
13306 }
13307 CONSTEXPR npu_set_ifm2_base3_t &set_data(uint32_t value)
13308 {
13309 data = static_cast<uint32_t>(value);
13310 return *this;
13311 }
13312 CONSTEXPR uint32_t get_payload_size() const
13313 {
13314 return static_cast<uint32_t>(payload_size);
13315 }
13316 CONSTEXPR npu_set_ifm2_base3_t &set_payload_size(uint32_t value)
13317 {
13318 payload_size = static_cast<uint32_t>(value);
13319 return *this;
13320 }
13321#endif //__cplusplus
13322};
13323
13324// Set IFM2 byte stride between horizontal values
13325struct npu_set_ifm2_stride_x_t
13326{
13327 uint32_t cmd_code : 10; // NPU_SET_IFM2_STRIDE_X
13328 uint32_t must_be_zero : 4; // 0
13329 uint32_t payload_size : 2; // Min:1 Max:2
13330 uint32_t reserved0 : 16;
13331 uint32_t data : 32; // IFM2 byte stride between horizontal values
13332#ifdef __cplusplus
13333 CONSTEXPR bool valid() const
13334 {
13335 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_IFM2_STRIDE_X) && must_be_zero == 0 &&
13336 payload_size >= 1 && payload_size <= 2;
13337 }
13338 CONSTEXPR void init()
13339 {
13340 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_IFM2_STRIDE_X);
13341 must_be_zero = 0;
13342 payload_size = 1;
13343 }
13344 CONSTEXPR ::cmd1 get_cmd_code() const
13345 {
13346 return static_cast<::cmd1>(cmd_code);
13347 }
13348 CONSTEXPR npu_set_ifm2_stride_x_t &set_cmd_code(::cmd1 value)
13349 {
13350 cmd_code = static_cast<uint32_t>(value);
13351 return *this;
13352 }
13353 CONSTEXPR uint32_t get_data() const
13354 {
13355 return static_cast<uint32_t>(data);
13356 }
13357 CONSTEXPR npu_set_ifm2_stride_x_t &set_data(uint32_t value)
13358 {
13359 data = static_cast<uint32_t>(value);
13360 return *this;
13361 }
13362 CONSTEXPR uint32_t get_payload_size() const
13363 {
13364 return static_cast<uint32_t>(payload_size);
13365 }
13366 CONSTEXPR npu_set_ifm2_stride_x_t &set_payload_size(uint32_t value)
13367 {
13368 payload_size = static_cast<uint32_t>(value);
13369 return *this;
13370 }
13371#endif //__cplusplus
13372};
13373
13374// Set IFM2 byte stride between vertical values
13375struct npu_set_ifm2_stride_y_t
13376{
13377 uint32_t cmd_code : 10; // NPU_SET_IFM2_STRIDE_Y
13378 uint32_t must_be_zero : 4; // 0
13379 uint32_t payload_size : 2; // Min:1 Max:2
13380 uint32_t reserved0 : 16;
13381 uint32_t data : 32; // IFM2 byte stride between vertical values
13382#ifdef __cplusplus
13383 CONSTEXPR bool valid() const
13384 {
13385 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_IFM2_STRIDE_Y) && must_be_zero == 0 &&
13386 payload_size >= 1 && payload_size <= 2;
13387 }
13388 CONSTEXPR void init()
13389 {
13390 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_IFM2_STRIDE_Y);
13391 must_be_zero = 0;
13392 payload_size = 1;
13393 }
13394 CONSTEXPR ::cmd1 get_cmd_code() const
13395 {
13396 return static_cast<::cmd1>(cmd_code);
13397 }
13398 CONSTEXPR npu_set_ifm2_stride_y_t &set_cmd_code(::cmd1 value)
13399 {
13400 cmd_code = static_cast<uint32_t>(value);
13401 return *this;
13402 }
13403 CONSTEXPR uint32_t get_data() const
13404 {
13405 return static_cast<uint32_t>(data);
13406 }
13407 CONSTEXPR npu_set_ifm2_stride_y_t &set_data(uint32_t value)
13408 {
13409 data = static_cast<uint32_t>(value);
13410 return *this;
13411 }
13412 CONSTEXPR uint32_t get_payload_size() const
13413 {
13414 return static_cast<uint32_t>(payload_size);
13415 }
13416 CONSTEXPR npu_set_ifm2_stride_y_t &set_payload_size(uint32_t value)
13417 {
13418 payload_size = static_cast<uint32_t>(value);
13419 return *this;
13420 }
13421#endif //__cplusplus
13422};
13423
13424// Set IFM2 byte stride between channel blocks (of 16 bytes each block)
13425struct npu_set_ifm2_stride_c_t
13426{
13427 uint32_t cmd_code : 10; // NPU_SET_IFM2_STRIDE_C
13428 uint32_t must_be_zero : 4; // 0
13429 uint32_t payload_size : 2; // Min:1 Max:2
13430 uint32_t reserved0 : 16;
13431 uint32_t data : 32; // IFM2 byte stride between channel blocks (of 16 bytes each block)
13432#ifdef __cplusplus
13433 CONSTEXPR bool valid() const
13434 {
13435 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_IFM2_STRIDE_C) && must_be_zero == 0 &&
13436 payload_size >= 1 && payload_size <= 2;
13437 }
13438 CONSTEXPR void init()
13439 {
13440 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_IFM2_STRIDE_C);
13441 must_be_zero = 0;
13442 payload_size = 1;
13443 }
13444 CONSTEXPR ::cmd1 get_cmd_code() const
13445 {
13446 return static_cast<::cmd1>(cmd_code);
13447 }
13448 CONSTEXPR npu_set_ifm2_stride_c_t &set_cmd_code(::cmd1 value)
13449 {
13450 cmd_code = static_cast<uint32_t>(value);
13451 return *this;
13452 }
13453 CONSTEXPR uint32_t get_data() const
13454 {
13455 return static_cast<uint32_t>(data);
13456 }
13457 CONSTEXPR npu_set_ifm2_stride_c_t &set_data(uint32_t value)
13458 {
13459 data = static_cast<uint32_t>(value);
13460 return *this;
13461 }
13462 CONSTEXPR uint32_t get_payload_size() const
13463 {
13464 return static_cast<uint32_t>(payload_size);
13465 }
13466 CONSTEXPR npu_set_ifm2_stride_c_t &set_payload_size(uint32_t value)
13467 {
13468 payload_size = static_cast<uint32_t>(value);
13469 return *this;
13470 }
13471#endif //__cplusplus
13472};
13473
13474// Set Weight stream byte offset in WEIGHT_REGION
13475struct npu_set_weight1_base_t
13476{
13477 uint32_t cmd_code : 10; // NPU_SET_WEIGHT1_BASE
13478 uint32_t must_be_zero : 4; // 0
13479 uint32_t payload_size : 2; // Min:1 Max:2
13480 uint32_t param : 16;
13481 uint32_t data : 32; // Weight stream byte offset in WEIGHT_REGION
13482#ifdef __cplusplus
13483 CONSTEXPR bool valid() const
13484 {
13485 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_WEIGHT1_BASE) && must_be_zero == 0 &&
13486 payload_size >= 1 && payload_size <= 2;
13487 }
13488 CONSTEXPR void init()
13489 {
13490 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_WEIGHT1_BASE);
13491 must_be_zero = 0;
13492 payload_size = 1;
13493 }
13494 CONSTEXPR ::cmd1 get_cmd_code() const
13495 {
13496 return static_cast<::cmd1>(cmd_code);
13497 }
13498 CONSTEXPR npu_set_weight1_base_t &set_cmd_code(::cmd1 value)
13499 {
13500 cmd_code = static_cast<uint32_t>(value);
13501 return *this;
13502 }
13503 CONSTEXPR uint32_t get_data() const
13504 {
13505 return static_cast<uint32_t>(data);
13506 }
13507 CONSTEXPR npu_set_weight1_base_t &set_data(uint32_t value)
13508 {
13509 data = static_cast<uint32_t>(value);
13510 return *this;
13511 }
13512 CONSTEXPR uint32_t get_param() const
13513 {
13514 return static_cast<uint32_t>(param);
13515 }
13516 CONSTEXPR npu_set_weight1_base_t &set_param(uint32_t value)
13517 {
13518 param = static_cast<uint32_t>(value);
13519 return *this;
13520 }
13521 CONSTEXPR uint32_t get_payload_size() const
13522 {
13523 return static_cast<uint32_t>(payload_size);
13524 }
13525 CONSTEXPR npu_set_weight1_base_t &set_payload_size(uint32_t value)
13526 {
13527 payload_size = static_cast<uint32_t>(value);
13528 return *this;
13529 }
13530#endif //__cplusplus
13531};
13532
13533// Set Weight stream byte length (unsigned 32 bits)
13534struct npu_set_weight1_length_t
13535{
13536 uint32_t cmd_code : 10; // NPU_SET_WEIGHT1_LENGTH
13537 uint32_t must_be_zero : 4; // 0
13538 uint32_t payload_size : 2; // Min:1 Max:2
13539 uint32_t reserved0 : 16;
13540 uint32_t data : 32; // Weight stream byte length (unsigned 32 bits)
13541#ifdef __cplusplus
13542 CONSTEXPR bool valid() const
13543 {
13544 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_WEIGHT1_LENGTH) && must_be_zero == 0 &&
13545 payload_size >= 1 && payload_size <= 2;
13546 }
13547 CONSTEXPR void init()
13548 {
13549 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_WEIGHT1_LENGTH);
13550 must_be_zero = 0;
13551 payload_size = 1;
13552 }
13553 CONSTEXPR ::cmd1 get_cmd_code() const
13554 {
13555 return static_cast<::cmd1>(cmd_code);
13556 }
13557 CONSTEXPR npu_set_weight1_length_t &set_cmd_code(::cmd1 value)
13558 {
13559 cmd_code = static_cast<uint32_t>(value);
13560 return *this;
13561 }
13562 CONSTEXPR uint32_t get_data() const
13563 {
13564 return static_cast<uint32_t>(data);
13565 }
13566 CONSTEXPR npu_set_weight1_length_t &set_data(uint32_t value)
13567 {
13568 data = static_cast<uint32_t>(value);
13569 return *this;
13570 }
13571 CONSTEXPR uint32_t get_payload_size() const
13572 {
13573 return static_cast<uint32_t>(payload_size);
13574 }
13575 CONSTEXPR npu_set_weight1_length_t &set_payload_size(uint32_t value)
13576 {
13577 payload_size = static_cast<uint32_t>(value);
13578 return *this;
13579 }
13580#endif //__cplusplus
13581};
13582
13583// Set Scale and bias stream input byte offset from SCALE_REGION
13584struct npu_set_scale1_base_t
13585{
13586 uint32_t cmd_code : 10; // NPU_SET_SCALE1_BASE
13587 uint32_t must_be_zero : 4; // 0
13588 uint32_t payload_size : 2; // Min:1 Max:2
13589 uint32_t param : 16;
13590 uint32_t data : 32; // Scale and bias stream input byte offset from SCALE_REGION
13591#ifdef __cplusplus
13592 CONSTEXPR bool valid() const
13593 {
13594 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_SCALE1_BASE) && must_be_zero == 0 && payload_size >= 1 &&
13595 payload_size <= 2;
13596 }
13597 CONSTEXPR void init()
13598 {
13599 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_SCALE1_BASE);
13600 must_be_zero = 0;
13601 payload_size = 1;
13602 }
13603 CONSTEXPR ::cmd1 get_cmd_code() const
13604 {
13605 return static_cast<::cmd1>(cmd_code);
13606 }
13607 CONSTEXPR npu_set_scale1_base_t &set_cmd_code(::cmd1 value)
13608 {
13609 cmd_code = static_cast<uint32_t>(value);
13610 return *this;
13611 }
13612 CONSTEXPR uint32_t get_data() const
13613 {
13614 return static_cast<uint32_t>(data);
13615 }
13616 CONSTEXPR npu_set_scale1_base_t &set_data(uint32_t value)
13617 {
13618 data = static_cast<uint32_t>(value);
13619 return *this;
13620 }
13621 CONSTEXPR uint32_t get_param() const
13622 {
13623 return static_cast<uint32_t>(param);
13624 }
13625 CONSTEXPR npu_set_scale1_base_t &set_param(uint32_t value)
13626 {
13627 param = static_cast<uint32_t>(value);
13628 return *this;
13629 }
13630 CONSTEXPR uint32_t get_payload_size() const
13631 {
13632 return static_cast<uint32_t>(payload_size);
13633 }
13634 CONSTEXPR npu_set_scale1_base_t &set_payload_size(uint32_t value)
13635 {
13636 payload_size = static_cast<uint32_t>(value);
13637 return *this;
13638 }
13639#endif //__cplusplus
13640};
13641
13642// Set Scale and bias stream input byte length (unsigned 20 bits)
13643struct npu_set_scale1_length_t
13644{
13645 uint32_t cmd_code : 10; // NPU_SET_SCALE1_LENGTH
13646 uint32_t must_be_zero : 4; // 0
13647 uint32_t payload_size : 2; // Min:1 Max:2
13648 uint32_t reserved0 : 16;
13649 uint32_t data : 32; // Scale and bias stream input byte length (unsigned 20 bits)
13650#ifdef __cplusplus
13651 CONSTEXPR bool valid() const
13652 {
13653 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_SCALE1_LENGTH) && must_be_zero == 0 &&
13654 payload_size >= 1 && payload_size <= 2;
13655 }
13656 CONSTEXPR void init()
13657 {
13658 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_SCALE1_LENGTH);
13659 must_be_zero = 0;
13660 payload_size = 1;
13661 }
13662 CONSTEXPR ::cmd1 get_cmd_code() const
13663 {
13664 return static_cast<::cmd1>(cmd_code);
13665 }
13666 CONSTEXPR npu_set_scale1_length_t &set_cmd_code(::cmd1 value)
13667 {
13668 cmd_code = static_cast<uint32_t>(value);
13669 return *this;
13670 }
13671 CONSTEXPR uint32_t get_data() const
13672 {
13673 return static_cast<uint32_t>(data);
13674 }
13675 CONSTEXPR npu_set_scale1_length_t &set_data(uint32_t value)
13676 {
13677 data = static_cast<uint32_t>(value);
13678 return *this;
13679 }
13680 CONSTEXPR uint32_t get_payload_size() const
13681 {
13682 return static_cast<uint32_t>(payload_size);
13683 }
13684 CONSTEXPR npu_set_scale1_length_t &set_payload_size(uint32_t value)
13685 {
13686 payload_size = static_cast<uint32_t>(value);
13687 return *this;
13688 }
13689#endif //__cplusplus
13690};
13691
13692#define NPU_DATA_STRUCTS \
13693 NPU_STRUCT(command_no_payload) \
13694 NPU_STRUCT(command_with_payload) \
13695 NPU_STRUCT(npu_op_stop) \
13696 NPU_STRUCT(npu_op_irq) \
13697 NPU_STRUCT(npu_op_conv) \
13698 NPU_STRUCT(npu_op_depthwise) \
13699 NPU_STRUCT(npu_op_pool) \
13700 NPU_STRUCT(npu_op_elementwise) \
13701 NPU_STRUCT(npu_op_dma_start) \
13702 NPU_STRUCT(npu_op_dma_wait) \
13703 NPU_STRUCT(npu_op_kernel_wait) \
13704 NPU_STRUCT(npu_op_pmu_mask) \
13705 NPU_STRUCT(npu_set_ifm_pad_top) \
13706 NPU_STRUCT(npu_set_ifm_pad_left) \
13707 NPU_STRUCT(npu_set_ifm_pad_right) \
13708 NPU_STRUCT(npu_set_ifm_pad_bottom) \
13709 NPU_STRUCT(npu_set_ifm_depth_m1) \
13710 NPU_STRUCT(npu_set_ifm_precision) \
13711 NPU_STRUCT(npu_set_ifm_upscale) \
13712 NPU_STRUCT(npu_set_ifm_zero_point) \
13713 NPU_STRUCT(npu_set_ifm_width0_m1) \
13714 NPU_STRUCT(npu_set_ifm_height0_m1) \
13715 NPU_STRUCT(npu_set_ifm_height1_m1) \
13716 NPU_STRUCT(npu_set_ifm_ib_end) \
13717 NPU_STRUCT(npu_set_ifm_region) \
13718 NPU_STRUCT(npu_set_ofm_width_m1) \
13719 NPU_STRUCT(npu_set_ofm_height_m1) \
13720 NPU_STRUCT(npu_set_ofm_depth_m1) \
13721 NPU_STRUCT(npu_set_ofm_precision) \
13722 NPU_STRUCT(npu_set_ofm_blk_width_m1) \
13723 NPU_STRUCT(npu_set_ofm_blk_height_m1) \
13724 NPU_STRUCT(npu_set_ofm_blk_depth_m1) \
13725 NPU_STRUCT(npu_set_ofm_zero_point) \
13726 NPU_STRUCT(npu_set_ofm_width0_m1) \
13727 NPU_STRUCT(npu_set_ofm_height0_m1) \
13728 NPU_STRUCT(npu_set_ofm_height1_m1) \
13729 NPU_STRUCT(npu_set_ofm_region) \
13730 NPU_STRUCT(npu_set_kernel_width_m1) \
13731 NPU_STRUCT(npu_set_kernel_height_m1) \
13732 NPU_STRUCT(npu_set_kernel_stride) \
13733 NPU_STRUCT(npu_set_parallel_mode) \
13734 NPU_STRUCT(npu_set_acc_format) \
13735 NPU_STRUCT(npu_set_activation) \
13736 NPU_STRUCT(npu_set_activation_min) \
13737 NPU_STRUCT(npu_set_activation_max) \
13738 NPU_STRUCT(npu_set_weight_region) \
13739 NPU_STRUCT(npu_set_scale_region) \
13740 NPU_STRUCT(npu_set_ab_start) \
13741 NPU_STRUCT(npu_set_blockdep) \
13742 NPU_STRUCT(npu_set_dma0_src_region) \
13743 NPU_STRUCT(npu_set_dma0_dst_region) \
13744 NPU_STRUCT(npu_set_dma0_size0) \
13745 NPU_STRUCT(npu_set_dma0_size1) \
13746 NPU_STRUCT(npu_set_ifm2_broadcast) \
13747 NPU_STRUCT(npu_set_ifm2_scalar) \
13748 NPU_STRUCT(npu_set_ifm2_precision) \
13749 NPU_STRUCT(npu_set_ifm2_zero_point) \
13750 NPU_STRUCT(npu_set_ifm2_width0_m1) \
13751 NPU_STRUCT(npu_set_ifm2_height0_m1) \
13752 NPU_STRUCT(npu_set_ifm2_height1_m1) \
13753 NPU_STRUCT(npu_set_ifm2_ib_start) \
13754 NPU_STRUCT(npu_set_ifm2_region) \
13755 NPU_STRUCT(npu_set_ifm_base0) \
13756 NPU_STRUCT(npu_set_ifm_base1) \
13757 NPU_STRUCT(npu_set_ifm_base2) \
13758 NPU_STRUCT(npu_set_ifm_base3) \
13759 NPU_STRUCT(npu_set_ifm_stride_x) \
13760 NPU_STRUCT(npu_set_ifm_stride_y) \
13761 NPU_STRUCT(npu_set_ifm_stride_c) \
13762 NPU_STRUCT(npu_set_ofm_base0) \
13763 NPU_STRUCT(npu_set_ofm_base1) \
13764 NPU_STRUCT(npu_set_ofm_base2) \
13765 NPU_STRUCT(npu_set_ofm_base3) \
13766 NPU_STRUCT(npu_set_ofm_stride_x) \
13767 NPU_STRUCT(npu_set_ofm_stride_y) \
13768 NPU_STRUCT(npu_set_ofm_stride_c) \
13769 NPU_STRUCT(npu_set_weight_base) \
13770 NPU_STRUCT(npu_set_weight_length) \
13771 NPU_STRUCT(npu_set_scale_base) \
13772 NPU_STRUCT(npu_set_scale_length) \
13773 NPU_STRUCT(npu_set_ofm_scale) \
13774 NPU_STRUCT(npu_set_opa_scale) \
13775 NPU_STRUCT(npu_set_opb_scale) \
13776 NPU_STRUCT(npu_set_dma0_src) \
13777 NPU_STRUCT(npu_set_dma0_dst) \
13778 NPU_STRUCT(npu_set_dma0_len) \
13779 NPU_STRUCT(npu_set_dma0_skip0) \
13780 NPU_STRUCT(npu_set_dma0_skip1) \
13781 NPU_STRUCT(npu_set_ifm2_base0) \
13782 NPU_STRUCT(npu_set_ifm2_base1) \
13783 NPU_STRUCT(npu_set_ifm2_base2) \
13784 NPU_STRUCT(npu_set_ifm2_base3) \
13785 NPU_STRUCT(npu_set_ifm2_stride_x) \
13786 NPU_STRUCT(npu_set_ifm2_stride_y) \
13787 NPU_STRUCT(npu_set_ifm2_stride_c) \
13788 NPU_STRUCT(npu_set_weight1_base) \
13789 NPU_STRUCT(npu_set_weight1_length) \
13790 NPU_STRUCT(npu_set_scale1_base) \
13791 NPU_STRUCT(npu_set_scale1_length)
13792#define NPU_OP_STRUCTS \
13793 NPU_OP_(stop) \
13794 NPU_OP_(irq) \
13795 NPU_OP_(conv) \
13796 NPU_OP_(depthwise) \
13797 NPU_OP_(pool) \
13798 NPU_OP_(elementwise) \
13799 NPU_OP_(dma_start) \
13800 NPU_OP_(dma_wait) \
13801 NPU_OP_(kernel_wait) \
13802 NPU_OP_(pmu_mask)
13803#define NPU_SET_STRUCTS \
13804 NPU_SET_(ifm_pad_top) \
13805 NPU_SET_(ifm_pad_left) \
13806 NPU_SET_(ifm_pad_right) \
13807 NPU_SET_(ifm_pad_bottom) \
13808 NPU_SET_(ifm_depth_m1) \
13809 NPU_SET_(ifm_precision) \
13810 NPU_SET_(ifm_upscale) \
13811 NPU_SET_(ifm_zero_point) \
13812 NPU_SET_(ifm_width0_m1) \
13813 NPU_SET_(ifm_height0_m1) \
13814 NPU_SET_(ifm_height1_m1) \
13815 NPU_SET_(ifm_ib_end) \
13816 NPU_SET_(ifm_region) \
13817 NPU_SET_(ofm_width_m1) \
13818 NPU_SET_(ofm_height_m1) \
13819 NPU_SET_(ofm_depth_m1) \
13820 NPU_SET_(ofm_precision) \
13821 NPU_SET_(ofm_blk_width_m1) \
13822 NPU_SET_(ofm_blk_height_m1) \
13823 NPU_SET_(ofm_blk_depth_m1) \
13824 NPU_SET_(ofm_zero_point) \
13825 NPU_SET_(ofm_width0_m1) \
13826 NPU_SET_(ofm_height0_m1) \
13827 NPU_SET_(ofm_height1_m1) \
13828 NPU_SET_(ofm_region) \
13829 NPU_SET_(kernel_width_m1) \
13830 NPU_SET_(kernel_height_m1) \
13831 NPU_SET_(kernel_stride) \
13832 NPU_SET_(parallel_mode) \
13833 NPU_SET_(acc_format) \
13834 NPU_SET_(activation) \
13835 NPU_SET_(activation_min) \
13836 NPU_SET_(activation_max) \
13837 NPU_SET_(weight_region) \
13838 NPU_SET_(scale_region) \
13839 NPU_SET_(ab_start) \
13840 NPU_SET_(blockdep) \
13841 NPU_SET_(dma0_src_region) \
13842 NPU_SET_(dma0_dst_region) \
13843 NPU_SET_(dma0_size0) \
13844 NPU_SET_(dma0_size1) \
13845 NPU_SET_(ifm2_broadcast) \
13846 NPU_SET_(ifm2_scalar) \
13847 NPU_SET_(ifm2_precision) \
13848 NPU_SET_(ifm2_zero_point) \
13849 NPU_SET_(ifm2_width0_m1) \
13850 NPU_SET_(ifm2_height0_m1) \
13851 NPU_SET_(ifm2_height1_m1) \
13852 NPU_SET_(ifm2_ib_start) \
13853 NPU_SET_(ifm2_region) \
13854 NPU_SET_(ifm_base0) \
13855 NPU_SET_(ifm_base1) \
13856 NPU_SET_(ifm_base2) \
13857 NPU_SET_(ifm_base3) \
13858 NPU_SET_(ifm_stride_x) \
13859 NPU_SET_(ifm_stride_y) \
13860 NPU_SET_(ifm_stride_c) \
13861 NPU_SET_(ofm_base0) \
13862 NPU_SET_(ofm_base1) \
13863 NPU_SET_(ofm_base2) \
13864 NPU_SET_(ofm_base3) \
13865 NPU_SET_(ofm_stride_x) \
13866 NPU_SET_(ofm_stride_y) \
13867 NPU_SET_(ofm_stride_c) \
13868 NPU_SET_(weight_base) \
13869 NPU_SET_(weight_length) \
13870 NPU_SET_(scale_base) \
13871 NPU_SET_(scale_length) \
13872 NPU_SET_(ofm_scale) \
13873 NPU_SET_(opa_scale) \
13874 NPU_SET_(opb_scale) \
13875 NPU_SET_(dma0_src) \
13876 NPU_SET_(dma0_dst) \
13877 NPU_SET_(dma0_len) \
13878 NPU_SET_(dma0_skip0) \
13879 NPU_SET_(dma0_skip1) \
13880 NPU_SET_(ifm2_base0) \
13881 NPU_SET_(ifm2_base1) \
13882 NPU_SET_(ifm2_base2) \
13883 NPU_SET_(ifm2_base3) \
13884 NPU_SET_(ifm2_stride_x) \
13885 NPU_SET_(ifm2_stride_y) \
13886 NPU_SET_(ifm2_stride_c) \
13887 NPU_SET_(weight1_base) \
13888 NPU_SET_(weight1_length) \
13889 NPU_SET_(scale1_base) \
13890 NPU_SET_(scale1_length)
13891#define COMMAND_STRUCTS \
13892 COMMAND_(no_payload) \
13893 COMMAND_(with_payload)
13894
13895#define EXPAND_ACC_FORMAT(FUNC, SEP) \
13896 FUNC(acc_format, INT_32BIT) SEP FUNC(acc_format, INT_40BIT) SEP FUNC(acc_format, FP_S5_10)
13897
13898#define EXPAND_ACTIVATION(FUNC, SEP) \
13899 FUNC(activation, NONE) \
13900 SEP FUNC(activation, TANH) SEP FUNC(activation, SIGMOID) SEP FUNC(activation, LUT_START) \
13901 SEP FUNC(activation, LUT_END)
13902
Stefan Nannessone2e70242020-08-19 16:01:29 +020013903#define EXPAND_AXI_MEM_ENCODING_TYPE(FUNC, SEP) \
13904 FUNC(axi_mem_encoding_type, DEVICE_NON_BUFFERABLE) \
13905 SEP FUNC(axi_mem_encoding_type, DEVICE_BUFFERABLE) \
13906 SEP FUNC(axi_mem_encoding_type, NORMAL_NON_CACHEABLE_NON_BUFFERABLE) \
13907 SEP FUNC(axi_mem_encoding_type, NORMAL_NON_CACHEABLE_BUFFERABLE) \
13908 SEP FUNC(axi_mem_encoding_type, WRITE_THROUGH_NO_ALLOCATE) \
13909 SEP FUNC(axi_mem_encoding_type, WRITE_THROUGH_READ_ALLOCATE) \
13910 SEP FUNC(axi_mem_encoding_type, WRITE_THROUGH_WRITE_ALLOCATE) \
13911 SEP FUNC(axi_mem_encoding_type, WRITE_THROUGH_READ_AND_WRITE_ALLOCATE) \
13912 SEP FUNC(axi_mem_encoding_type, WRITE_BACK_NO_ALLOCATE) \
13913 SEP FUNC(axi_mem_encoding_type, WRITE_BACK_READ_ALLOCATE) \
13914 SEP FUNC(axi_mem_encoding_type, WRITE_BACK_WRITE_ALLOCATE) \
13915 SEP FUNC(axi_mem_encoding_type, WRITE_BACK_READ_AND_WRITE_ALLOCATE) \
13916 SEP FUNC(axi_mem_encoding_type, RESERVED_12) \
13917 SEP FUNC(axi_mem_encoding_type, RESERVED_13) \
13918 SEP FUNC(axi_mem_encoding_type, RESERVED_14) \
13919 SEP FUNC(axi_mem_encoding_type, RESERVED_15)
13920
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020013921#define EXPAND_CLIP_RANGE(FUNC, SEP) \
13922 FUNC(clip_range, OFM_PRECISION) \
13923 SEP FUNC(clip_range, FORCE_UINT8) SEP FUNC(clip_range, FORCE_INT8) SEP FUNC(clip_range, FORCE_INT16)
13924
13925#define EXPAND_CMD0(FUNC, SEP) \
13926 FUNC(cmd0, NPU_OP_STOP) \
13927 SEP FUNC(cmd0, NPU_OP_IRQ) SEP FUNC(cmd0, NPU_OP_CONV) SEP FUNC(cmd0, NPU_OP_DEPTHWISE) SEP FUNC( \
13928 cmd0, NPU_OP_POOL) SEP FUNC(cmd0, NPU_OP_ELEMENTWISE) SEP FUNC(cmd0, NPU_OP_DMA_START) \
13929 SEP FUNC(cmd0, NPU_OP_DMA_WAIT) SEP FUNC(cmd0, NPU_OP_KERNEL_WAIT) SEP FUNC(cmd0, NPU_OP_PMU_MASK) SEP FUNC( \
13930 cmd0, NPU_SET_IFM_PAD_TOP) SEP FUNC(cmd0, NPU_SET_IFM_PAD_LEFT) SEP FUNC(cmd0, NPU_SET_IFM_PAD_RIGHT) \
13931 SEP FUNC(cmd0, NPU_SET_IFM_PAD_BOTTOM) SEP FUNC(cmd0, NPU_SET_IFM_DEPTH_M1) SEP FUNC( \
13932 cmd0, NPU_SET_IFM_PRECISION) SEP FUNC(cmd0, NPU_SET_IFM_UPSCALE) \
13933 SEP FUNC(cmd0, NPU_SET_IFM_ZERO_POINT) SEP FUNC(cmd0, NPU_SET_IFM_WIDTH0_M1) SEP FUNC( \
13934 cmd0, NPU_SET_IFM_HEIGHT0_M1) SEP FUNC(cmd0, NPU_SET_IFM_HEIGHT1_M1) SEP FUNC(cmd0, \
13935 NPU_SET_IFM_IB_END) \
13936 SEP FUNC(cmd0, NPU_SET_IFM_REGION) SEP FUNC(cmd0, NPU_SET_OFM_WIDTH_M1) SEP FUNC( \
13937 cmd0, NPU_SET_OFM_HEIGHT_M1) SEP FUNC(cmd0, NPU_SET_OFM_DEPTH_M1) \
13938 SEP FUNC(cmd0, NPU_SET_OFM_PRECISION) SEP FUNC(cmd0, NPU_SET_OFM_BLK_WIDTH_M1) SEP FUNC( \
13939 cmd0, NPU_SET_OFM_BLK_HEIGHT_M1) SEP FUNC(cmd0, NPU_SET_OFM_BLK_DEPTH_M1) \
13940 SEP FUNC(cmd0, NPU_SET_OFM_ZERO_POINT) SEP FUNC(cmd0, NPU_SET_OFM_WIDTH0_M1) SEP FUNC( \
13941 cmd0, NPU_SET_OFM_HEIGHT0_M1) SEP FUNC(cmd0, NPU_SET_OFM_HEIGHT1_M1) \
13942 SEP FUNC(cmd0, NPU_SET_OFM_REGION) SEP FUNC(cmd0, NPU_SET_KERNEL_WIDTH_M1) SEP FUNC( \
13943 cmd0, NPU_SET_KERNEL_HEIGHT_M1) SEP FUNC(cmd0, NPU_SET_KERNEL_STRIDE) \
13944 SEP FUNC(cmd0, NPU_SET_PARALLEL_MODE) SEP FUNC(cmd0, NPU_SET_ACC_FORMAT) SEP FUNC( \
13945 cmd0, NPU_SET_ACTIVATION) SEP FUNC(cmd0, NPU_SET_ACTIVATION_MIN) \
13946 SEP FUNC(cmd0, NPU_SET_ACTIVATION_MAX) SEP FUNC(cmd0, NPU_SET_WEIGHT_REGION) \
13947 SEP FUNC(cmd0, NPU_SET_SCALE_REGION) SEP FUNC(cmd0, NPU_SET_AB_START) \
13948 SEP FUNC(cmd0, \
13949 NPU_SET_BLOCKDEP) SEP FUNC(cmd0, NPU_SET_DMA0_SRC_REGION) \
13950 SEP FUNC(cmd0, NPU_SET_DMA0_DST_REGION) SEP FUNC( \
13951 cmd0, NPU_SET_DMA0_SIZE0) SEP FUNC(cmd0, NPU_SET_DMA0_SIZE1) \
13952 SEP FUNC(cmd0, NPU_SET_IFM2_BROADCAST) \
13953 SEP FUNC(cmd0, NPU_SET_IFM2_SCALAR) \
13954 SEP FUNC(cmd0, NPU_SET_IFM2_PRECISION) SEP FUNC( \
13955 cmd0, NPU_SET_IFM2_ZERO_POINT) \
13956 SEP FUNC(cmd0, NPU_SET_IFM2_WIDTH0_M1) SEP FUNC( \
13957 cmd0, NPU_SET_IFM2_HEIGHT0_M1) \
13958 SEP FUNC(cmd0, NPU_SET_IFM2_HEIGHT1_M1) \
13959 SEP FUNC(cmd0, NPU_SET_IFM2_IB_START) \
13960 SEP FUNC(cmd0, NPU_SET_IFM2_REGION)
13961
13962#define EXPAND_CMD1(FUNC, SEP) \
13963 FUNC(cmd1, NPU_SET_IFM_BASE0) \
13964 SEP FUNC(cmd1, NPU_SET_IFM_BASE1) SEP FUNC(cmd1, NPU_SET_IFM_BASE2) SEP FUNC(cmd1, NPU_SET_IFM_BASE3) \
13965 SEP FUNC(cmd1, NPU_SET_IFM_STRIDE_X) SEP FUNC(cmd1, NPU_SET_IFM_STRIDE_Y) SEP FUNC(cmd1, NPU_SET_IFM_STRIDE_C) \
13966 SEP FUNC(cmd1, NPU_SET_OFM_BASE0) SEP FUNC(cmd1, NPU_SET_OFM_BASE1) SEP FUNC(cmd1, NPU_SET_OFM_BASE2) \
13967 SEP FUNC(cmd1, NPU_SET_OFM_BASE3) SEP FUNC(cmd1, NPU_SET_OFM_STRIDE_X) \
13968 SEP FUNC(cmd1, NPU_SET_OFM_STRIDE_Y) SEP FUNC(cmd1, NPU_SET_OFM_STRIDE_C) \
13969 SEP FUNC(cmd1, NPU_SET_WEIGHT_BASE) SEP FUNC(cmd1, NPU_SET_WEIGHT_LENGTH) \
13970 SEP FUNC(cmd1, NPU_SET_SCALE_BASE) SEP FUNC(cmd1, NPU_SET_SCALE_LENGTH) \
13971 SEP FUNC(cmd1, NPU_SET_OFM_SCALE) SEP FUNC(cmd1, NPU_SET_OPA_SCALE) \
13972 SEP FUNC(cmd1, NPU_SET_OPB_SCALE) SEP FUNC(cmd1, NPU_SET_DMA0_SRC) \
13973 SEP FUNC(cmd1, NPU_SET_DMA0_DST) SEP FUNC(cmd1, NPU_SET_DMA0_LEN) SEP FUNC( \
13974 cmd1, NPU_SET_DMA0_SKIP0) SEP FUNC(cmd1, NPU_SET_DMA0_SKIP1) \
13975 SEP FUNC(cmd1, NPU_SET_IFM2_BASE0) SEP FUNC(cmd1, NPU_SET_IFM2_BASE1) \
13976 SEP FUNC(cmd1, NPU_SET_IFM2_BASE2) SEP FUNC(cmd1, NPU_SET_IFM2_BASE3) \
13977 SEP FUNC(cmd1, NPU_SET_IFM2_STRIDE_X) \
13978 SEP FUNC(cmd1, NPU_SET_IFM2_STRIDE_Y) \
13979 SEP FUNC(cmd1, NPU_SET_IFM2_STRIDE_C) \
13980 SEP FUNC(cmd1, NPU_SET_WEIGHT1_BASE) \
13981 SEP FUNC(cmd1, NPU_SET_WEIGHT1_LENGTH) \
13982 SEP FUNC(cmd1, NPU_SET_SCALE1_BASE) \
13983 SEP FUNC(cmd1, NPU_SET_SCALE1_LENGTH)
13984
13985#define EXPAND_DATA_FORMAT(FUNC, SEP) FUNC(data_format, NHWC) SEP FUNC(data_format, NHCWB16)
13986
13987#define EXPAND_ELEMENTWISE_MODE(FUNC, SEP) \
13988 FUNC(elementwise_mode, MUL) \
13989 SEP FUNC(elementwise_mode, ADD) SEP FUNC(elementwise_mode, SUB) SEP FUNC(elementwise_mode, MIN) \
13990 SEP FUNC(elementwise_mode, MAX) SEP FUNC(elementwise_mode, LRELU) SEP FUNC(elementwise_mode, ABS) \
13991 SEP FUNC(elementwise_mode, CLZ) SEP FUNC(elementwise_mode, SHR) SEP FUNC(elementwise_mode, SHL)
13992
13993#define EXPAND_IFM_PRECISION(FUNC, SEP) \
Diqing Zhonga9f38d52020-04-27 11:00:13 +020013994 FUNC(ifm_precision, U8) \
13995 SEP FUNC(ifm_precision, S8) SEP FUNC(ifm_precision, U16) SEP FUNC(ifm_precision, S16) SEP FUNC(ifm_precision, S32)
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020013996
13997#define EXPAND_IFM_SCALE_MODE(FUNC, SEP) \
13998 FUNC(ifm_scale_mode, SCALE_16BIT) \
13999 SEP FUNC(ifm_scale_mode, SCALE_OPA_32BIT) SEP FUNC(ifm_scale_mode, SCALE_OPB_32BIT)
14000
Diqing Zhong04118062020-04-15 01:19:12 +020014001#define EXPAND_MACS_PER_CC(FUNC, SEP) \
14002 FUNC(macs_per_cc, MACS_PER_CC_IS_5) \
14003 SEP FUNC(macs_per_cc, MACS_PER_CC_IS_6) SEP FUNC(macs_per_cc, MACS_PER_CC_IS_7) \
14004 SEP FUNC(macs_per_cc, MACS_PER_CC_IS_8)
14005
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020014006#define EXPAND_MEMORY_TYPE(FUNC, SEP) \
14007 FUNC(memory_type, AXI0_OUTSTANDING_COUNTER0) \
14008 SEP FUNC(memory_type, AXI0_OUTSTANDING_COUNTER1) SEP FUNC(memory_type, AXI1_OUTSTANDING_COUNTER2) \
14009 SEP FUNC(memory_type, AXI1_OUTSTANDING_COUNTER3)
14010
14011#define EXPAND_OFM_PRECISION(FUNC, SEP) \
14012 FUNC(ofm_precision, U8) \
14013 SEP FUNC(ofm_precision, S8) SEP FUNC(ofm_precision, U16) SEP FUNC(ofm_precision, S16) SEP FUNC(ofm_precision, S32)
14014
Stefan Nannessone2e70242020-08-19 16:01:29 +020014015#define EXPAND_PMU_EVENT_TYPE(FUNC, SEP) \
14016 FUNC(pmu_event_type, NO_EVENT) \
14017 SEP FUNC(pmu_event_type, CYCLE) SEP FUNC(pmu_event_type, NPU_IDLE) SEP FUNC( \
14018 pmu_event_type, CC_STALLED_ON_BLOCKDEP) SEP FUNC(pmu_event_type, \
14019 CC_STALLED_ON_SHRAM_RECONFIG) SEP FUNC(pmu_event_type, \
14020 NPU_ACTIVE) \
14021 SEP FUNC(pmu_event_type, MAC_ACTIVE) SEP FUNC(pmu_event_type, MAC_ACTIVE_8BIT) SEP FUNC( \
14022 pmu_event_type, MAC_ACTIVE_16BIT) SEP FUNC(pmu_event_type, MAC_DPU_ACTIVE) SEP FUNC(pmu_event_type, \
14023 MAC_STALLED_BY_WD_ACC) \
14024 SEP FUNC(pmu_event_type, MAC_STALLED_BY_WD) SEP FUNC(pmu_event_type, MAC_STALLED_BY_ACC) SEP FUNC( \
14025 pmu_event_type, MAC_STALLED_BY_IB) SEP FUNC(pmu_event_type, \
14026 MAC_ACTIVE_32BIT) SEP FUNC(pmu_event_type, \
14027 MAC_STALLED_BY_INT_W) \
14028 SEP FUNC(pmu_event_type, MAC_STALLED_BY_INT_ACC) SEP FUNC(pmu_event_type, AO_ACTIVE) SEP FUNC( \
14029 pmu_event_type, AO_ACTIVE_8BIT) SEP FUNC(pmu_event_type, \
14030 AO_ACTIVE_16BIT) SEP FUNC(pmu_event_type, \
14031 AO_STALLED_BY_OFMP_OB) \
14032 SEP FUNC(pmu_event_type, AO_STALLED_BY_OFMP) SEP FUNC(pmu_event_type, AO_STALLED_BY_OB) SEP FUNC( \
14033 pmu_event_type, \
14034 AO_STALLED_BY_ACC_IB) SEP FUNC(pmu_event_type, \
14035 AO_STALLED_BY_ACC) SEP FUNC(pmu_event_type, \
14036 AO_STALLED_BY_IB) SEP FUNC(pmu_event_type, \
14037 WD_ACTIVE) SEP \
14038 FUNC(pmu_event_type, WD_STALLED) SEP FUNC(pmu_event_type, WD_STALLED_BY_WS) SEP FUNC( \
14039 pmu_event_type, \
14040 WD_STALLED_BY_WD_BUF) SEP \
14041 FUNC(pmu_event_type, WD_PARSE_ACTIVE) SEP FUNC(pmu_event_type, WD_PARSE_STALLED) SEP FUNC( \
14042 pmu_event_type, \
14043 WD_PARSE_STALLED_IN) SEP FUNC(pmu_event_type, \
14044 WD_PARSE_STALLED_OUT) SEP \
14045 FUNC(pmu_event_type, WD_TRANS_WS) SEP FUNC(pmu_event_type, WD_TRANS_WB) SEP FUNC( \
14046 pmu_event_type, \
14047 WD_TRANS_DW0) SEP FUNC(pmu_event_type, \
14048 WD_TRANS_DW1) SEP FUNC(pmu_event_type, \
14049 AXI0_RD_TRANS_ACCEPTED) SEP \
14050 FUNC(pmu_event_type, AXI0_RD_TRANS_COMPLETED) SEP FUNC( \
14051 pmu_event_type, \
14052 AXI0_RD_DATA_BEAT_RECEIVED) SEP FUNC(pmu_event_type, AXI0_RD_TRAN_REQ_STALLED) \
14053 SEP FUNC(pmu_event_type, \
14054 AXI0_WR_TRANS_ACCEPTED) SEP FUNC(pmu_event_type, \
14055 AXI0_WR_TRANS_COMPLETED_M) \
14056 SEP FUNC(pmu_event_type, AXI0_WR_TRANS_COMPLETED_S) SEP FUNC( \
14057 pmu_event_type, \
14058 AXI0_WR_DATA_BEAT_WRITTEN) \
14059 SEP FUNC(pmu_event_type, AXI0_WR_TRAN_REQ_STALLED) SEP FUNC( \
14060 pmu_event_type, \
14061 AXI0_WR_DATA_BEAT_STALLED) SEP \
14062 FUNC(pmu_event_type, AXI0_ENABLED_CYCLES) SEP FUNC( \
14063 pmu_event_type, \
14064 AXI0_RD_STALL_LIMIT) SEP FUNC(pmu_event_type, \
14065 AXI0_WR_STALL_LIMIT) SEP \
14066 FUNC(pmu_event_type, AXI1_RD_TRANS_ACCEPTED) SEP FUNC( \
14067 pmu_event_type, \
14068 AXI1_RD_TRANS_COMPLETED) SEP FUNC(pmu_event_type, \
14069 AXI1_RD_DATA_BEAT_RECEIVED) SEP \
14070 FUNC(pmu_event_type, AXI1_RD_TRAN_REQ_STALLED) SEP FUNC( \
14071 pmu_event_type, \
14072 AXI1_WR_TRANS_ACCEPTED) SEP \
14073 FUNC(pmu_event_type, AXI1_WR_TRANS_COMPLETED_M) SEP FUNC( \
14074 pmu_event_type, \
14075 AXI1_WR_TRANS_COMPLETED_S) SEP \
14076 FUNC(pmu_event_type, AXI1_WR_DATA_BEAT_WRITTEN) SEP FUNC( \
14077 pmu_event_type, \
14078 AXI1_WR_TRAN_REQ_STALLED) SEP \
14079 FUNC(pmu_event_type, AXI1_WR_DATA_BEAT_STALLED) SEP FUNC( \
14080 pmu_event_type, \
14081 AXI1_ENABLED_CYCLES) SEP FUNC(pmu_event_type, \
14082 AXI1_RD_STALL_LIMIT) SEP \
14083 FUNC(pmu_event_type, AXI1_WR_STALL_LIMIT) SEP FUNC( \
14084 pmu_event_type, \
14085 AXI_LATENCY_ANY) SEP FUNC(pmu_event_type, \
14086 AXI_LATENCY_32) SEP \
14087 FUNC(pmu_event_type, AXI_LATENCY_64) SEP FUNC( \
14088 pmu_event_type, \
14089 AXI_LATENCY_128) SEP \
14090 FUNC(pmu_event_type, \
14091 AXI_LATENCY_256) SEP \
14092 FUNC(pmu_event_type, \
14093 AXI_LATENCY_512) SEP \
14094 FUNC(pmu_event_type, \
14095 AXI_LATENCY_1024) SEP \
14096 FUNC(pmu_event_type, \
14097 ECC_DMA) SEP \
14098 FUNC( \
14099 pmu_event_type, \
14100 ECC_SB0) SEP \
14101 FUNC( \
14102 pmu_event_type, \
14103 ECC_SB1)
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020014104
14105#define EXPAND_POOLING_MODE(FUNC, SEP) \
14106 FUNC(pooling_mode, MAX) SEP FUNC(pooling_mode, AVERAGE) SEP FUNC(pooling_mode, REDUCE_SUM)
14107
14108#define EXPAND_PRIVILEGE_LEVEL(FUNC, SEP) FUNC(privilege_level, USER) SEP FUNC(privilege_level, PRIVILEGED)
14109
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020014110#define EXPAND_RESAMPLING_MODE(FUNC, SEP) \
14111 FUNC(resampling_mode, NONE) SEP FUNC(resampling_mode, NEAREST) SEP FUNC(resampling_mode, TRANSPOSE)
14112
14113#define EXPAND_ROUNDING(FUNC, SEP) FUNC(rounding, TFL) SEP FUNC(rounding, TRUNCATE) SEP FUNC(rounding, NATURAL)
14114
14115#define EXPAND_SECURITY_LEVEL(FUNC, SEP) FUNC(security_level, SECURE) SEP FUNC(security_level, NON_SECURE)
14116
Diqing Zhong04118062020-04-15 01:19:12 +020014117#define EXPAND_SHRAM_SIZE(FUNC, SEP) \
Stefan Nannessone2e70242020-08-19 16:01:29 +020014118 FUNC(shram_size, SHRAM_96KB) \
14119 SEP FUNC(shram_size, SHRAM_48KB) SEP FUNC(shram_size, SHRAM_24KB) SEP FUNC(shram_size, SHRAM_16KB)
Diqing Zhong04118062020-04-15 01:19:12 +020014120
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020014121#define EXPAND_STATE(FUNC, SEP) FUNC(state, STOPPED) SEP FUNC(state, RUNNING)
14122
14123#define EXPAND_STRIDE_MODE(FUNC, SEP) \
14124 FUNC(stride_mode, STRIDE_MODE_1D) SEP FUNC(stride_mode, STRIDE_MODE_2D) SEP FUNC(stride_mode, STRIDE_MODE_3D)
Rakesh Gangarajaiaha20e5a72020-06-25 15:45:27 +020014125#endif /* ETHOSU55_INTERFACE_H */