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