blob: 263e271b733680b7c4075b7b60355275b4eafd51 [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
41#define NNX_ARCH_VERSION_MAJOR 0
Diqing Zhonga9f38d52020-04-27 11:00:13 +020042#define NNX_ARCH_VERSION_MINOR 169
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020043#define NNX_ARCH_VERSION_PATCH 0
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020044
45// Register offsets
46
47//
48// Register subpage DEBUG_INTERNAL
49//
50#define NPU_REG_SHARED_BUFFER0 0x0400
51#define NPU_REG_SHARED_BUFFER1 0x0404
52#define NPU_REG_SHARED_BUFFER2 0x0408
53#define NPU_REG_SHARED_BUFFER3 0x040C
54#define NPU_REG_SHARED_BUFFER4 0x0410
55#define NPU_REG_SHARED_BUFFER5 0x0414
56#define NPU_REG_SHARED_BUFFER6 0x0418
57#define NPU_REG_SHARED_BUFFER7 0x041C
58#define NPU_REG_SHARED_BUFFER8 0x0420
59#define NPU_REG_SHARED_BUFFER9 0x0424
60#define NPU_REG_SHARED_BUFFER10 0x0428
61#define NPU_REG_SHARED_BUFFER11 0x042C
62#define NPU_REG_SHARED_BUFFER12 0x0430
63#define NPU_REG_SHARED_BUFFER13 0x0434
64#define NPU_REG_SHARED_BUFFER14 0x0438
65#define NPU_REG_SHARED_BUFFER15 0x043C
66#define NPU_REG_SHARED_BUFFER16 0x0440
67#define NPU_REG_SHARED_BUFFER17 0x0444
68#define NPU_REG_SHARED_BUFFER18 0x0448
69#define NPU_REG_SHARED_BUFFER19 0x044C
70#define NPU_REG_SHARED_BUFFER20 0x0450
71#define NPU_REG_SHARED_BUFFER21 0x0454
72#define NPU_REG_SHARED_BUFFER22 0x0458
73#define NPU_REG_SHARED_BUFFER23 0x045C
74#define NPU_REG_SHARED_BUFFER24 0x0460
75#define NPU_REG_SHARED_BUFFER25 0x0464
76#define NPU_REG_SHARED_BUFFER26 0x0468
77#define NPU_REG_SHARED_BUFFER27 0x046C
78#define NPU_REG_SHARED_BUFFER28 0x0470
79#define NPU_REG_SHARED_BUFFER29 0x0474
80#define NPU_REG_SHARED_BUFFER30 0x0478
81#define NPU_REG_SHARED_BUFFER31 0x047C
82#define NPU_REG_SHARED_BUFFER32 0x0480
83#define NPU_REG_SHARED_BUFFER33 0x0484
84#define NPU_REG_SHARED_BUFFER34 0x0488
85#define NPU_REG_SHARED_BUFFER35 0x048C
86#define NPU_REG_SHARED_BUFFER36 0x0490
87#define NPU_REG_SHARED_BUFFER37 0x0494
88#define NPU_REG_SHARED_BUFFER38 0x0498
89#define NPU_REG_SHARED_BUFFER39 0x049C
90#define NPU_REG_SHARED_BUFFER40 0x04A0
91#define NPU_REG_SHARED_BUFFER41 0x04A4
92#define NPU_REG_SHARED_BUFFER42 0x04A8
93#define NPU_REG_SHARED_BUFFER43 0x04AC
94#define NPU_REG_SHARED_BUFFER44 0x04B0
95#define NPU_REG_SHARED_BUFFER45 0x04B4
96#define NPU_REG_SHARED_BUFFER46 0x04B8
97#define NPU_REG_SHARED_BUFFER47 0x04BC
98#define NPU_REG_SHARED_BUFFER48 0x04C0
99#define NPU_REG_SHARED_BUFFER49 0x04C4
100#define NPU_REG_SHARED_BUFFER50 0x04C8
101#define NPU_REG_SHARED_BUFFER51 0x04CC
102#define NPU_REG_SHARED_BUFFER52 0x04D0
103#define NPU_REG_SHARED_BUFFER53 0x04D4
104#define NPU_REG_SHARED_BUFFER54 0x04D8
105#define NPU_REG_SHARED_BUFFER55 0x04DC
106#define NPU_REG_SHARED_BUFFER56 0x04E0
107#define NPU_REG_SHARED_BUFFER57 0x04E4
108#define NPU_REG_SHARED_BUFFER58 0x04E8
109#define NPU_REG_SHARED_BUFFER59 0x04EC
110#define NPU_REG_SHARED_BUFFER60 0x04F0
111#define NPU_REG_SHARED_BUFFER61 0x04F4
112#define NPU_REG_SHARED_BUFFER62 0x04F8
113#define NPU_REG_SHARED_BUFFER63 0x04FC
114#define NPU_REG_SHARED_BUFFER64 0x0500
115#define NPU_REG_SHARED_BUFFER65 0x0504
116#define NPU_REG_SHARED_BUFFER66 0x0508
117#define NPU_REG_SHARED_BUFFER67 0x050C
118#define NPU_REG_SHARED_BUFFER68 0x0510
119#define NPU_REG_SHARED_BUFFER69 0x0514
120#define NPU_REG_SHARED_BUFFER70 0x0518
121#define NPU_REG_SHARED_BUFFER71 0x051C
122#define NPU_REG_SHARED_BUFFER72 0x0520
123#define NPU_REG_SHARED_BUFFER73 0x0524
124#define NPU_REG_SHARED_BUFFER74 0x0528
125#define NPU_REG_SHARED_BUFFER75 0x052C
126#define NPU_REG_SHARED_BUFFER76 0x0530
127#define NPU_REG_SHARED_BUFFER77 0x0534
128#define NPU_REG_SHARED_BUFFER78 0x0538
129#define NPU_REG_SHARED_BUFFER79 0x053C
130#define NPU_REG_SHARED_BUFFER80 0x0540
131#define NPU_REG_SHARED_BUFFER81 0x0544
132#define NPU_REG_SHARED_BUFFER82 0x0548
133#define NPU_REG_SHARED_BUFFER83 0x054C
134#define NPU_REG_SHARED_BUFFER84 0x0550
135#define NPU_REG_SHARED_BUFFER85 0x0554
136#define NPU_REG_SHARED_BUFFER86 0x0558
137#define NPU_REG_SHARED_BUFFER87 0x055C
138#define NPU_REG_SHARED_BUFFER88 0x0560
139#define NPU_REG_SHARED_BUFFER89 0x0564
140#define NPU_REG_SHARED_BUFFER90 0x0568
141#define NPU_REG_SHARED_BUFFER91 0x056C
142#define NPU_REG_SHARED_BUFFER92 0x0570
143#define NPU_REG_SHARED_BUFFER93 0x0574
144#define NPU_REG_SHARED_BUFFER94 0x0578
145#define NPU_REG_SHARED_BUFFER95 0x057C
146#define NPU_REG_SHARED_BUFFER96 0x0580
147#define NPU_REG_SHARED_BUFFER97 0x0584
148#define NPU_REG_SHARED_BUFFER98 0x0588
149#define NPU_REG_SHARED_BUFFER99 0x058C
150#define NPU_REG_SHARED_BUFFER100 0x0590
151#define NPU_REG_SHARED_BUFFER101 0x0594
152#define NPU_REG_SHARED_BUFFER102 0x0598
153#define NPU_REG_SHARED_BUFFER103 0x059C
154#define NPU_REG_SHARED_BUFFER104 0x05A0
155#define NPU_REG_SHARED_BUFFER105 0x05A4
156#define NPU_REG_SHARED_BUFFER106 0x05A8
157#define NPU_REG_SHARED_BUFFER107 0x05AC
158#define NPU_REG_SHARED_BUFFER108 0x05B0
159#define NPU_REG_SHARED_BUFFER109 0x05B4
160#define NPU_REG_SHARED_BUFFER110 0x05B8
161#define NPU_REG_SHARED_BUFFER111 0x05BC
162#define NPU_REG_SHARED_BUFFER112 0x05C0
163#define NPU_REG_SHARED_BUFFER113 0x05C4
164#define NPU_REG_SHARED_BUFFER114 0x05C8
165#define NPU_REG_SHARED_BUFFER115 0x05CC
166#define NPU_REG_SHARED_BUFFER116 0x05D0
167#define NPU_REG_SHARED_BUFFER117 0x05D4
168#define NPU_REG_SHARED_BUFFER118 0x05D8
169#define NPU_REG_SHARED_BUFFER119 0x05DC
170#define NPU_REG_SHARED_BUFFER120 0x05E0
171#define NPU_REG_SHARED_BUFFER121 0x05E4
172#define NPU_REG_SHARED_BUFFER122 0x05E8
173#define NPU_REG_SHARED_BUFFER123 0x05EC
174#define NPU_REG_SHARED_BUFFER124 0x05F0
175#define NPU_REG_SHARED_BUFFER125 0x05F4
176#define NPU_REG_SHARED_BUFFER126 0x05F8
177#define NPU_REG_SHARED_BUFFER127 0x05FC
178#define NPU_REG_SHARED_BUFFER128 0x0600
179#define NPU_REG_SHARED_BUFFER129 0x0604
180#define NPU_REG_SHARED_BUFFER130 0x0608
181#define NPU_REG_SHARED_BUFFER131 0x060C
182#define NPU_REG_SHARED_BUFFER132 0x0610
183#define NPU_REG_SHARED_BUFFER133 0x0614
184#define NPU_REG_SHARED_BUFFER134 0x0618
185#define NPU_REG_SHARED_BUFFER135 0x061C
186#define NPU_REG_SHARED_BUFFER136 0x0620
187#define NPU_REG_SHARED_BUFFER137 0x0624
188#define NPU_REG_SHARED_BUFFER138 0x0628
189#define NPU_REG_SHARED_BUFFER139 0x062C
190#define NPU_REG_SHARED_BUFFER140 0x0630
191#define NPU_REG_SHARED_BUFFER141 0x0634
192#define NPU_REG_SHARED_BUFFER142 0x0638
193#define NPU_REG_SHARED_BUFFER143 0x063C
194#define NPU_REG_SHARED_BUFFER144 0x0640
195#define NPU_REG_SHARED_BUFFER145 0x0644
196#define NPU_REG_SHARED_BUFFER146 0x0648
197#define NPU_REG_SHARED_BUFFER147 0x064C
198#define NPU_REG_SHARED_BUFFER148 0x0650
199#define NPU_REG_SHARED_BUFFER149 0x0654
200#define NPU_REG_SHARED_BUFFER150 0x0658
201#define NPU_REG_SHARED_BUFFER151 0x065C
202#define NPU_REG_SHARED_BUFFER152 0x0660
203#define NPU_REG_SHARED_BUFFER153 0x0664
204#define NPU_REG_SHARED_BUFFER154 0x0668
205#define NPU_REG_SHARED_BUFFER155 0x066C
206#define NPU_REG_SHARED_BUFFER156 0x0670
207#define NPU_REG_SHARED_BUFFER157 0x0674
208#define NPU_REG_SHARED_BUFFER158 0x0678
209#define NPU_REG_SHARED_BUFFER159 0x067C
210#define NPU_REG_SHARED_BUFFER160 0x0680
211#define NPU_REG_SHARED_BUFFER161 0x0684
212#define NPU_REG_SHARED_BUFFER162 0x0688
213#define NPU_REG_SHARED_BUFFER163 0x068C
214#define NPU_REG_SHARED_BUFFER164 0x0690
215#define NPU_REG_SHARED_BUFFER165 0x0694
216#define NPU_REG_SHARED_BUFFER166 0x0698
217#define NPU_REG_SHARED_BUFFER167 0x069C
218#define NPU_REG_SHARED_BUFFER168 0x06A0
219#define NPU_REG_SHARED_BUFFER169 0x06A4
220#define NPU_REG_SHARED_BUFFER170 0x06A8
221#define NPU_REG_SHARED_BUFFER171 0x06AC
222#define NPU_REG_SHARED_BUFFER172 0x06B0
223#define NPU_REG_SHARED_BUFFER173 0x06B4
224#define NPU_REG_SHARED_BUFFER174 0x06B8
225#define NPU_REG_SHARED_BUFFER175 0x06BC
226#define NPU_REG_SHARED_BUFFER176 0x06C0
227#define NPU_REG_SHARED_BUFFER177 0x06C4
228#define NPU_REG_SHARED_BUFFER178 0x06C8
229#define NPU_REG_SHARED_BUFFER179 0x06CC
230#define NPU_REG_SHARED_BUFFER180 0x06D0
231#define NPU_REG_SHARED_BUFFER181 0x06D4
232#define NPU_REG_SHARED_BUFFER182 0x06D8
233#define NPU_REG_SHARED_BUFFER183 0x06DC
234#define NPU_REG_SHARED_BUFFER184 0x06E0
235#define NPU_REG_SHARED_BUFFER185 0x06E4
236#define NPU_REG_SHARED_BUFFER186 0x06E8
237#define NPU_REG_SHARED_BUFFER187 0x06EC
238#define NPU_REG_SHARED_BUFFER188 0x06F0
239#define NPU_REG_SHARED_BUFFER189 0x06F4
240#define NPU_REG_SHARED_BUFFER190 0x06F8
241#define NPU_REG_SHARED_BUFFER191 0x06FC
242#define NPU_REG_SHARED_BUFFER192 0x0700
243#define NPU_REG_SHARED_BUFFER193 0x0704
244#define NPU_REG_SHARED_BUFFER194 0x0708
245#define NPU_REG_SHARED_BUFFER195 0x070C
246#define NPU_REG_SHARED_BUFFER196 0x0710
247#define NPU_REG_SHARED_BUFFER197 0x0714
248#define NPU_REG_SHARED_BUFFER198 0x0718
249#define NPU_REG_SHARED_BUFFER199 0x071C
250#define NPU_REG_SHARED_BUFFER200 0x0720
251#define NPU_REG_SHARED_BUFFER201 0x0724
252#define NPU_REG_SHARED_BUFFER202 0x0728
253#define NPU_REG_SHARED_BUFFER203 0x072C
254#define NPU_REG_SHARED_BUFFER204 0x0730
255#define NPU_REG_SHARED_BUFFER205 0x0734
256#define NPU_REG_SHARED_BUFFER206 0x0738
257#define NPU_REG_SHARED_BUFFER207 0x073C
258#define NPU_REG_SHARED_BUFFER208 0x0740
259#define NPU_REG_SHARED_BUFFER209 0x0744
260#define NPU_REG_SHARED_BUFFER210 0x0748
261#define NPU_REG_SHARED_BUFFER211 0x074C
262#define NPU_REG_SHARED_BUFFER212 0x0750
263#define NPU_REG_SHARED_BUFFER213 0x0754
264#define NPU_REG_SHARED_BUFFER214 0x0758
265#define NPU_REG_SHARED_BUFFER215 0x075C
266#define NPU_REG_SHARED_BUFFER216 0x0760
267#define NPU_REG_SHARED_BUFFER217 0x0764
268#define NPU_REG_SHARED_BUFFER218 0x0768
269#define NPU_REG_SHARED_BUFFER219 0x076C
270#define NPU_REG_SHARED_BUFFER220 0x0770
271#define NPU_REG_SHARED_BUFFER221 0x0774
272#define NPU_REG_SHARED_BUFFER222 0x0778
273#define NPU_REG_SHARED_BUFFER223 0x077C
274#define NPU_REG_SHARED_BUFFER224 0x0780
275#define NPU_REG_SHARED_BUFFER225 0x0784
276#define NPU_REG_SHARED_BUFFER226 0x0788
277#define NPU_REG_SHARED_BUFFER227 0x078C
278#define NPU_REG_SHARED_BUFFER228 0x0790
279#define NPU_REG_SHARED_BUFFER229 0x0794
280#define NPU_REG_SHARED_BUFFER230 0x0798
281#define NPU_REG_SHARED_BUFFER231 0x079C
282#define NPU_REG_SHARED_BUFFER232 0x07A0
283#define NPU_REG_SHARED_BUFFER233 0x07A4
284#define NPU_REG_SHARED_BUFFER234 0x07A8
285#define NPU_REG_SHARED_BUFFER235 0x07AC
286#define NPU_REG_SHARED_BUFFER236 0x07B0
287#define NPU_REG_SHARED_BUFFER237 0x07B4
288#define NPU_REG_SHARED_BUFFER238 0x07B8
289#define NPU_REG_SHARED_BUFFER239 0x07BC
290#define NPU_REG_SHARED_BUFFER240 0x07C0
291#define NPU_REG_SHARED_BUFFER241 0x07C4
292#define NPU_REG_SHARED_BUFFER242 0x07C8
293#define NPU_REG_SHARED_BUFFER243 0x07CC
294#define NPU_REG_SHARED_BUFFER244 0x07D0
295#define NPU_REG_SHARED_BUFFER245 0x07D4
296#define NPU_REG_SHARED_BUFFER246 0x07D8
297#define NPU_REG_SHARED_BUFFER247 0x07DC
298#define NPU_REG_SHARED_BUFFER248 0x07E0
299#define NPU_REG_SHARED_BUFFER249 0x07E4
300#define NPU_REG_SHARED_BUFFER250 0x07E8
301#define NPU_REG_SHARED_BUFFER251 0x07EC
302#define NPU_REG_SHARED_BUFFER252 0x07F0
303#define NPU_REG_SHARED_BUFFER253 0x07F4
304#define NPU_REG_SHARED_BUFFER254 0x07F8
305#define NPU_REG_SHARED_BUFFER255 0x07FC
306#define DEBUG_INTERNAL_REGISTERS_SIZE 0x0800
307
308//
309// Register subpage HW_DEBUG_INTERNAL
310//
Diqing Zhong04118062020-04-15 01:19:12 +0200311#define NPU_REG_WD_STATUS 0x0100
312#define NPU_REG_MAC_STATUS 0x0104
313#define NPU_REG_DMA_STATUS 0x0108
314#define NPU_REG_AO_STATUS 0x0110
Kristofer Jonsson49bdee82020-04-06 13:21:21 +0200315#define NPU_REG_CLKFORCE 0x0140
316#define NPU_REG_DEBUG 0x0144
317#define NPU_REG_DEBUG2 0x0148
318#define NPU_REG_DEBUGCORE 0x014C
319#define HW_DEBUG_INTERNAL_REGISTERS_SIZE 0x0150
320
321//
322// Register subpage NPU_BP
323//
324#define NPU_REG_BASEP0 0x0080
325#define NPU_REG_BASEP1 0x0084
326#define NPU_REG_BASEP2 0x0088
327#define NPU_REG_BASEP3 0x008C
328#define NPU_REG_BASEP4 0x0090
329#define NPU_REG_BASEP5 0x0094
330#define NPU_REG_BASEP6 0x0098
331#define NPU_REG_BASEP7 0x009C
332#define NPU_REG_BASEP8 0x00A0
333#define NPU_REG_BASEP9 0x00A4
334#define NPU_REG_BASEP10 0x00A8
335#define NPU_REG_BASEP11 0x00AC
336#define NPU_REG_BASEP12 0x00B0
337#define NPU_REG_BASEP13 0x00B4
338#define NPU_REG_BASEP14 0x00B8
339#define NPU_REG_BASEP15 0x00BC
340#define NPU_BP_REGISTERS_SIZE 0x00C0
341
342//
343// Register subpage NPU_IDS
344//
345#define NPU_REG_REVISION 0x0FC0
346#define NPU_REG_PID4 0x0FD0
347#define NPU_REG_PID5 0x0FD4
348#define NPU_REG_PID6 0x0FD8
349#define NPU_REG_PID7 0x0FDC
350#define NPU_REG_PID0 0x0FE0
351#define NPU_REG_PID1 0x0FE4
352#define NPU_REG_PID2 0x0FE8
353#define NPU_REG_PID3 0x0FEC
354#define NPU_REG_CID0 0x0FF0
355#define NPU_REG_CID1 0x0FF4
356#define NPU_REG_CID2 0x0FF8
357#define NPU_REG_CID3 0x0FFC
358#define NPU_IDS_REGISTERS_SIZE 0x1000
359
360//
361// Register subpage NPU_REG
362//
363#define NPU_REG_ID 0x0000
364#define NPU_REG_STATUS 0x0004
365#define NPU_REG_CMD 0x0008
366#define NPU_REG_RESET 0x000C
367#define NPU_REG_QBASE0 0x0010
368#define NPU_REG_QBASE1 0x0014
369#define NPU_REG_QREAD 0x0018
370#define NPU_REG_QCONFIG 0x001C
371#define NPU_REG_QSIZE 0x0020
372#define NPU_REG_PROT 0x0024
373#define NPU_REG_CONFIG 0x0028
374#define NPU_REG_LOCK 0x002C
375#define NPU_REG_REGIONCFG 0x003C
376#define NPU_REG_AXI_LIMIT0 0x0040
377#define NPU_REG_AXI_LIMIT1 0x0044
378#define NPU_REG_AXI_LIMIT2 0x0048
379#define NPU_REG_AXI_LIMIT3 0x004C
380#define NPU_REG_REGISTERS_SIZE 0x0050
381
382//
383// Register subpage PMU_INTERNAL
384//
385#define NPU_REG_PMCR 0x0180
386#define NPU_REG_PMCNTENSET 0x0184
387#define NPU_REG_PMCNTENCLR 0x0188
388#define NPU_REG_PMOVSSET 0x018C
389#define NPU_REG_PMOVSCLR 0x0190
390#define NPU_REG_PMINTSET 0x0194
391#define NPU_REG_PMINTCLR 0x0198
392#define NPU_REG_PMCCNTR_LO 0x01A0
393#define NPU_REG_PMCCNTR_HI 0x01A4
394#define NPU_REG_PMCCNTR_CFG 0x01A8
395#define NPU_REG_PMCAXI_CHAN 0x01AC
396#define NPU_REG_PMEVCNTR0 0x0300
397#define NPU_REG_PMEVCNTR1 0x0304
398#define NPU_REG_PMEVCNTR2 0x0308
399#define NPU_REG_PMEVCNTR3 0x030C
400#define NPU_REG_PMEVTYPER0 0x0380
401#define NPU_REG_PMEVTYPER1 0x0384
402#define NPU_REG_PMEVTYPER2 0x0388
403#define NPU_REG_PMEVTYPER3 0x038C
404#define PMU_INTERNAL_REGISTERS_SIZE 0x0390
405
406//
407// Register subpage TSU_DEBUG_INTERNAL
408//
409#define NPU_REG_IFM_PAD_TOP 0x0800
410#define NPU_REG_IFM_PAD_LEFT 0x0804
411#define NPU_REG_IFM_PAD_RIGHT 0x0808
412#define NPU_REG_IFM_PAD_BOTTOM 0x080C
413#define NPU_REG_IFM_DEPTH_M1 0x0810
414#define NPU_REG_IFM_PRECISION 0x0814
415#define NPU_REG_IFM_UPSCALE 0x081C
416#define NPU_REG_IFM_ZERO_POINT 0x0824
417#define NPU_REG_IFM_WIDTH0_M1 0x0828
418#define NPU_REG_IFM_HEIGHT0_M1 0x082C
419#define NPU_REG_IFM_HEIGHT1_M1 0x0830
420#define NPU_REG_IFM_IB_END 0x0834
421#define NPU_REG_IFM_REGION 0x083C
422#define NPU_REG_OFM_WIDTH_M1 0x0844
423#define NPU_REG_OFM_HEIGHT_M1 0x0848
424#define NPU_REG_OFM_DEPTH_M1 0x084C
425#define NPU_REG_OFM_PRECISION 0x0850
426#define NPU_REG_OFM_BLK_WIDTH_M1 0x0854
427#define NPU_REG_OFM_BLK_HEIGHT_M1 0x0858
428#define NPU_REG_OFM_BLK_DEPTH_M1 0x085C
429#define NPU_REG_OFM_ZERO_POINT 0x0860
430#define NPU_REG_OFM_WIDTH0_M1 0x0868
431#define NPU_REG_OFM_HEIGHT0_M1 0x086C
432#define NPU_REG_OFM_HEIGHT1_M1 0x0870
433#define NPU_REG_OFM_REGION 0x087C
434#define NPU_REG_KERNEL_WIDTH_M1 0x0880
435#define NPU_REG_KERNEL_HEIGHT_M1 0x0884
436#define NPU_REG_KERNEL_STRIDE 0x0888
437#define NPU_REG_PARALLEL_MODE 0x088C
438#define NPU_REG_ACC_FORMAT 0x0890
439#define NPU_REG_ACTIVATION 0x0894
440#define NPU_REG_ACTIVATION_MIN 0x0898
441#define NPU_REG_ACTIVATION_MAX 0x089C
442#define NPU_REG_WEIGHT_REGION 0x08A0
443#define NPU_REG_SCALE_REGION 0x08A4
444#define NPU_REG_AB_START 0x08B4
445#define NPU_REG_BLOCKDEP 0x08BC
446#define NPU_REG_DMA0_SRC_REGION 0x08C0
447#define NPU_REG_DMA0_DST_REGION 0x08C4
448#define NPU_REG_DMA0_SIZE0 0x08C8
449#define NPU_REG_DMA0_SIZE1 0x08CC
450#define NPU_REG_IFM2_BROADCAST 0x0900
451#define NPU_REG_IFM2_SCALAR 0x0904
452#define NPU_REG_IFM2_PRECISION 0x0914
453#define NPU_REG_IFM2_ZERO_POINT 0x0924
454#define NPU_REG_IFM2_WIDTH0_M1 0x0928
455#define NPU_REG_IFM2_HEIGHT0_M1 0x092C
456#define NPU_REG_IFM2_HEIGHT1_M1 0x0930
457#define NPU_REG_IFM2_IB_START 0x0934
458#define NPU_REG_IFM2_REGION 0x093C
459#define NPU_REG_IFM_BASE0 0x0A00
460#define NPU_REG_IFM_BASE0_HI 0x0A04
461#define NPU_REG_IFM_BASE1 0x0A08
462#define NPU_REG_IFM_BASE1_HI 0x0A0C
463#define NPU_REG_IFM_BASE2 0x0A10
464#define NPU_REG_IFM_BASE2_HI 0x0A14
465#define NPU_REG_IFM_BASE3 0x0A18
466#define NPU_REG_IFM_BASE3_HI 0x0A1C
467#define NPU_REG_IFM_STRIDE_X 0x0A20
468#define NPU_REG_IFM_STRIDE_X_HI 0x0A24
469#define NPU_REG_IFM_STRIDE_Y 0x0A28
470#define NPU_REG_IFM_STRIDE_Y_HI 0x0A2C
471#define NPU_REG_IFM_STRIDE_C 0x0A30
472#define NPU_REG_IFM_STRIDE_C_HI 0x0A34
473#define NPU_REG_OFM_BASE0 0x0A40
474#define NPU_REG_OFM_BASE0_HI 0x0A44
475#define NPU_REG_OFM_BASE1 0x0A48
476#define NPU_REG_OFM_BASE1_HI 0x0A4C
477#define NPU_REG_OFM_BASE2 0x0A50
478#define NPU_REG_OFM_BASE2_HI 0x0A54
479#define NPU_REG_OFM_BASE3 0x0A58
480#define NPU_REG_OFM_BASE3_HI 0x0A5C
481#define NPU_REG_OFM_STRIDE_X 0x0A60
482#define NPU_REG_OFM_STRIDE_X_HI 0x0A64
483#define NPU_REG_OFM_STRIDE_Y 0x0A68
484#define NPU_REG_OFM_STRIDE_Y_HI 0x0A6C
485#define NPU_REG_OFM_STRIDE_C 0x0A70
486#define NPU_REG_OFM_STRIDE_C_HI 0x0A74
487#define NPU_REG_WEIGHT_BASE 0x0A80
488#define NPU_REG_WEIGHT_BASE_HI 0x0A84
489#define NPU_REG_WEIGHT_LENGTH 0x0A88
490#define NPU_REG_WEIGHT_LENGTH_HI 0x0A8C
491#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
526#define NPU_REG_WEIGHT1_LENGTH_HI 0x0B4C
527#define NPU_REG_SCALE1_BASE 0x0B50
528#define NPU_REG_SCALE1_BASE_HI 0x0B54
529#define NPU_REG_SCALE1_LENGTH 0x0B58
530#define TSU_DEBUG_INTERNAL_REGISTERS_SIZE 0x0B5C
531
532//
533// Register subpage TSU_DEBUG_RO_INTERNAL
534//
535#define NPU_REG_KERNEL_X 0x0200
536#define NPU_REG_KERNEL_Y 0x0204
537#define NPU_REG_KERNEL_W_M1 0x0208
538#define NPU_REG_KERNEL_H_M1 0x020C
539#define NPU_REG_OFM_CBLK_WIDTH_M1 0x0210
540#define NPU_REG_OFM_CBLK_HEIGHT_M1 0x0214
541#define NPU_REG_OFM_CBLK_DEPTH_M1 0x0218
542#define NPU_REG_IFM_CBLK_DEPTH_M1 0x021C
543#define NPU_REG_OFM_X 0x0220
544#define NPU_REG_OFM_Y 0x0224
545#define NPU_REG_OFM_Z 0x0228
546#define NPU_REG_IFM_Z 0x022C
547#define NPU_REG_PAD_TOP 0x0230
548#define NPU_REG_PAD_LEFT 0x0234
549#define NPU_REG_IFM_CBLK_WIDTH 0x0238
550#define NPU_REG_IFM_CBLK_HEIGHT 0x023C
551#define NPU_REG_DMA_IFM_SRC 0x0240
552#define NPU_REG_DMA_IFM_SRC_HI 0x0244
553#define NPU_REG_DMA_IFM_DST 0x0248
554#define NPU_REG_DMA_OFM_SRC 0x024C
555#define NPU_REG_DMA_OFM_DST 0x0250
556#define NPU_REG_DMA_OFM_DST_HI 0x0254
557#define NPU_REG_DMA_WEIGHT_SRC 0x0258
558#define NPU_REG_DMA_WEIGHT_SRC_HI 0x025C
559#define NPU_REG_DMA_CMD_SRC 0x0260
560#define NPU_REG_DMA_CMD_SRC_HI 0x0264
561#define NPU_REG_DMA_CMD_SIZE 0x0268
562#define NPU_REG_DMA_M2M_SRC 0x026C
563#define NPU_REG_DMA_M2M_SRC_HI 0x0270
564#define NPU_REG_DMA_M2M_DST 0x0274
565#define NPU_REG_DMA_M2M_DST_HI 0x0278
566#define NPU_REG_CURRENT_QREAD 0x027C
567#define NPU_REG_DMA_SCALE_SRC 0x0280
568#define NPU_REG_DMA_SCALE_SRC_HI 0x0284
569#define NPU_REG_CURRENT_CMD 0x02BC
570#define TSU_DEBUG_RO_INTERNAL_REGISTERS_SIZE 0x02C0
571
572#ifdef __cplusplus
573
574// Enum types
575
576enum class acc_format : uint8_t
577{
578 INT_32BIT = 0,
579 INT_40BIT = 1,
580 FP_S5_10 = 2,
581};
582
583enum class activation : uint8_t
584{
585 NONE = 0,
586 TANH = 3,
587 SIGMOID = 4,
588 LUT_START = 16,
589 LUT_END = 23,
590};
591
592enum class clip_range : uint8_t
593{
594 OFM_PRECISION = 0,
595 FORCE_UINT8 = 2,
596 FORCE_INT8 = 3,
597 FORCE_INT16 = 5,
598};
599
600enum class cmd0 : uint16_t
601{
602 NPU_OP_STOP = 0x000,
603 NPU_OP_IRQ = 0x001,
604 NPU_OP_CONV = 0x002,
605 NPU_OP_DEPTHWISE = 0x003,
606 NPU_OP_POOL = 0x005,
607 NPU_OP_ELEMENTWISE = 0x006,
608 NPU_OP_DMA_START = 0x010,
609 NPU_OP_DMA_WAIT = 0x011,
610 NPU_OP_KERNEL_WAIT = 0x012,
611 NPU_OP_PMU_MASK = 0x013,
612 NPU_SET_IFM_PAD_TOP = 0x100,
613 NPU_SET_IFM_PAD_LEFT = 0x101,
614 NPU_SET_IFM_PAD_RIGHT = 0x102,
615 NPU_SET_IFM_PAD_BOTTOM = 0x103,
616 NPU_SET_IFM_DEPTH_M1 = 0x104,
617 NPU_SET_IFM_PRECISION = 0x105,
618 NPU_SET_IFM_UPSCALE = 0x107,
619 NPU_SET_IFM_ZERO_POINT = 0x109,
620 NPU_SET_IFM_WIDTH0_M1 = 0x10A,
621 NPU_SET_IFM_HEIGHT0_M1 = 0x10B,
622 NPU_SET_IFM_HEIGHT1_M1 = 0x10C,
623 NPU_SET_IFM_IB_END = 0x10D,
624 NPU_SET_IFM_REGION = 0x10F,
625 NPU_SET_OFM_WIDTH_M1 = 0x111,
626 NPU_SET_OFM_HEIGHT_M1 = 0x112,
627 NPU_SET_OFM_DEPTH_M1 = 0x113,
628 NPU_SET_OFM_PRECISION = 0x114,
629 NPU_SET_OFM_BLK_WIDTH_M1 = 0x115,
630 NPU_SET_OFM_BLK_HEIGHT_M1 = 0x116,
631 NPU_SET_OFM_BLK_DEPTH_M1 = 0x117,
632 NPU_SET_OFM_ZERO_POINT = 0x118,
633 NPU_SET_OFM_WIDTH0_M1 = 0x11A,
634 NPU_SET_OFM_HEIGHT0_M1 = 0x11B,
635 NPU_SET_OFM_HEIGHT1_M1 = 0x11C,
636 NPU_SET_OFM_REGION = 0x11F,
637 NPU_SET_KERNEL_WIDTH_M1 = 0x120,
638 NPU_SET_KERNEL_HEIGHT_M1 = 0x121,
639 NPU_SET_KERNEL_STRIDE = 0x122,
640 NPU_SET_PARALLEL_MODE = 0x123,
641 NPU_SET_ACC_FORMAT = 0x124,
642 NPU_SET_ACTIVATION = 0x125,
643 NPU_SET_ACTIVATION_MIN = 0x126,
644 NPU_SET_ACTIVATION_MAX = 0x127,
645 NPU_SET_WEIGHT_REGION = 0x128,
646 NPU_SET_SCALE_REGION = 0x129,
647 NPU_SET_AB_START = 0x12D,
648 NPU_SET_BLOCKDEP = 0x12F,
649 NPU_SET_DMA0_SRC_REGION = 0x130,
650 NPU_SET_DMA0_DST_REGION = 0x131,
651 NPU_SET_DMA0_SIZE0 = 0x132,
652 NPU_SET_DMA0_SIZE1 = 0x133,
653 NPU_SET_IFM2_BROADCAST = 0x180,
654 NPU_SET_IFM2_SCALAR = 0x181,
655 NPU_SET_IFM2_PRECISION = 0x185,
656 NPU_SET_IFM2_ZERO_POINT = 0x189,
657 NPU_SET_IFM2_WIDTH0_M1 = 0x18A,
658 NPU_SET_IFM2_HEIGHT0_M1 = 0x18B,
659 NPU_SET_IFM2_HEIGHT1_M1 = 0x18C,
660 NPU_SET_IFM2_IB_START = 0x18D,
661 NPU_SET_IFM2_REGION = 0x18F,
662};
663
664enum class cmd1 : uint8_t
665{
666 NPU_SET_IFM_BASE0 = 0x000,
667 NPU_SET_IFM_BASE1 = 0x001,
668 NPU_SET_IFM_BASE2 = 0x002,
669 NPU_SET_IFM_BASE3 = 0x003,
670 NPU_SET_IFM_STRIDE_X = 0x004,
671 NPU_SET_IFM_STRIDE_Y = 0x005,
672 NPU_SET_IFM_STRIDE_C = 0x006,
673 NPU_SET_OFM_BASE0 = 0x010,
674 NPU_SET_OFM_BASE1 = 0x011,
675 NPU_SET_OFM_BASE2 = 0x012,
676 NPU_SET_OFM_BASE3 = 0x013,
677 NPU_SET_OFM_STRIDE_X = 0x014,
678 NPU_SET_OFM_STRIDE_Y = 0x015,
679 NPU_SET_OFM_STRIDE_C = 0x016,
680 NPU_SET_WEIGHT_BASE = 0x020,
681 NPU_SET_WEIGHT_LENGTH = 0x021,
682 NPU_SET_SCALE_BASE = 0x022,
683 NPU_SET_SCALE_LENGTH = 0x023,
684 NPU_SET_OFM_SCALE = 0x024,
685 NPU_SET_OPA_SCALE = 0x025,
686 NPU_SET_OPB_SCALE = 0x026,
687 NPU_SET_DMA0_SRC = 0x030,
688 NPU_SET_DMA0_DST = 0x031,
689 NPU_SET_DMA0_LEN = 0x032,
690 NPU_SET_DMA0_SKIP0 = 0x033,
691 NPU_SET_DMA0_SKIP1 = 0x034,
692 NPU_SET_IFM2_BASE0 = 0x080,
693 NPU_SET_IFM2_BASE1 = 0x081,
694 NPU_SET_IFM2_BASE2 = 0x082,
695 NPU_SET_IFM2_BASE3 = 0x083,
696 NPU_SET_IFM2_STRIDE_X = 0x084,
697 NPU_SET_IFM2_STRIDE_Y = 0x085,
698 NPU_SET_IFM2_STRIDE_C = 0x086,
699 NPU_SET_WEIGHT1_BASE = 0x090,
700 NPU_SET_WEIGHT1_LENGTH = 0x091,
701 NPU_SET_SCALE1_BASE = 0x092,
702 NPU_SET_SCALE1_LENGTH = 0x093,
703};
704
705enum class data_format : uint8_t
706{
707 NHWC = 0,
708 NHCWB16 = 1,
709};
710
711enum class elementwise_mode : uint8_t
712{
713 MUL = 0,
714 ADD = 1,
715 SUB = 2,
716 MIN = 3,
717 MAX = 4,
718 LRELU = 5,
719 ABS = 6,
720 CLZ = 7,
721 SHR = 8,
722 SHL = 9,
723};
724
725enum class ifm_precision : uint8_t
726{
Diqing Zhonga9f38d52020-04-27 11:00:13 +0200727 U8 = 0,
728 S8 = 1,
729 U16 = 4,
730 S16 = 5,
731 S32 = 9,
Kristofer Jonsson49bdee82020-04-06 13:21:21 +0200732};
733
734enum class ifm_scale_mode : uint8_t
735{
736 SCALE_16BIT = 0,
737 SCALE_OPA_32BIT = 1,
738 SCALE_OPB_32BIT = 2,
739};
740
Diqing Zhong04118062020-04-15 01:19:12 +0200741enum class macs_per_cc : uint8_t
742{
743 MACS_PER_CC_IS_5 = 0x5,
744 MACS_PER_CC_IS_6 = 0x6,
745 MACS_PER_CC_IS_7 = 0x7,
746 MACS_PER_CC_IS_8 = 0x8,
747};
748
Kristofer Jonsson49bdee82020-04-06 13:21:21 +0200749enum class memory_type : uint8_t
750{
751 AXI0_OUTSTANDING_COUNTER0 = 0,
752 AXI0_OUTSTANDING_COUNTER1 = 1,
753 AXI1_OUTSTANDING_COUNTER2 = 2,
754 AXI1_OUTSTANDING_COUNTER3 = 3,
755};
756
757enum class ofm_precision : uint8_t
758{
759 U8 = 0,
760 S8 = 1,
761 U16 = 2,
762 S16 = 3,
763 S32 = 5,
764};
765
766enum class pmu_event_type : uint16_t
767{
Diqing Zhong04118062020-04-15 01:19:12 +0200768 NO_EVENT = 0x00,
Kristofer Jonsson49bdee82020-04-06 13:21:21 +0200769 CYCLE = 0x11,
770 NPU_IDLE = 0x20,
771 MAC_ACTIVE = 0x30,
772 MAC_ACTIVE_8BIT = 0x31,
773 MAC_ACTIVE_16BIT = 0x32,
774 MAC_DPU_ACTIVE = 0x33,
775 MAC_STALLED_BY_WD_ACC = 0x34,
776 MAC_STALLED_BY_WD = 0x35,
777 MAC_STALLED_BY_ACC = 0x36,
778 MAC_STALLED_BY_IB = 0x37,
Diqing Zhong04118062020-04-15 01:19:12 +0200779 MAC_ACTIVE_32BIT = 0x38,
Kristofer Jonsson49bdee82020-04-06 13:21:21 +0200780 AO_ACTIVE = 0x40,
781 AO_ACTIVE_8BIT = 0x41,
782 AO_ACTIVE_16BIT = 0x42,
783 AO_STALLED_BY_OFMP_OB = 0x43,
784 AO_STALLED_BY_OFMP = 0x44,
785 AO_STALLED_BY_OB = 0x45,
786 AO_STALLED_BY_ACC_IB = 0x46,
787 AO_STALLED_BY_ACC = 0x47,
788 AO_STALLED_BY_IB = 0x48,
789 WD_ACTIVE = 0x50,
790 WD_STALLED = 0x51,
791 WD_STALLED_BY_WS = 0x52,
792 WD_STALLED_BY_WD_BUF = 0x53,
793 WD_PARSE_ACTIVE = 0x54,
794 WD_PARSE_STALLED = 0x55,
795 WD_PARSE_STALLED_IN = 0x56,
796 WD_PARSE_STALLED_OUT = 0x57,
Diqing Zhong04118062020-04-15 01:19:12 +0200797 WD_TRANS_WS = 0x58,
798 WD_TRANS_WB = 0x59,
799 WD_TRANS_DW0 = 0x5a,
800 WD_TRANS_DW1 = 0x5b,
Kristofer Jonsson49bdee82020-04-06 13:21:21 +0200801 AXI0_RD_TRANS_ACCEPTED = 0x80,
802 AXI0_RD_TRANS_COMPLETED = 0x81,
803 AXI0_RD_DATA_BEAT_RECEIVED = 0x82,
804 AXI0_RD_TRAN_REQ_STALLED = 0x83,
805 AXI0_WR_TRANS_ACCEPTED = 0x84,
806 AXI0_WR_TRANS_COMPLETED_M = 0x85,
807 AXI0_WR_TRANS_COMPLETED_S = 0x86,
808 AXI0_WR_DATA_BEAT_WRITTEN = 0x87,
809 AXI0_WR_TRAN_REQ_STALLED = 0x88,
810 AXI0_WR_DATA_BEAT_STALLED = 0x89,
811 AXI0_ENABLED_CYCLES = 0x8c,
812 AXI0_RD_STALL_LIMIT = 0x8e,
813 AXI0_WR_STALL_LIMIT = 0x8f,
814 AXI1_RD_TRANS_ACCEPTED = 0x180,
815 AXI1_RD_TRANS_COMPLETED = 0x181,
816 AXI1_RD_DATA_BEAT_RECEIVED = 0x182,
817 AXI1_RD_TRAN_REQ_STALLED = 0x183,
818 AXI1_WR_TRANS_ACCEPTED = 0x184,
819 AXI1_WR_TRANS_COMPLETED_M = 0x185,
820 AXI1_WR_TRANS_COMPLETED_S = 0x186,
821 AXI1_WR_DATA_BEAT_WRITTEN = 0x187,
822 AXI1_WR_TRAN_REQ_STALLED = 0x188,
823 AXI1_WR_DATA_BEAT_STALLED = 0x189,
824 AXI1_ENABLED_CYCLES = 0x18c,
825 AXI1_RD_STALL_LIMIT = 0x18e,
826 AXI1_WR_STALL_LIMIT = 0x18f,
827 AXI_LATENCY_ANY = 0xa0,
828 AXI_LATENCY_32 = 0xa1,
829 AXI_LATENCY_64 = 0xa2,
830 AXI_LATENCY_128 = 0xa3,
831 AXI_LATENCY_256 = 0xa4,
832 AXI_LATENCY_512 = 0xa5,
833 AXI_LATENCY_1024 = 0xa6,
834};
835
836enum class pooling_mode : uint8_t
837{
838 MAX = 0,
839 AVERAGE = 1,
840 REDUCE_SUM = 2,
841};
842
843enum class privilege_level : uint8_t
844{
845 USER = 0,
846 PRIVILEGED = 1,
847};
848
Kristofer Jonsson49bdee82020-04-06 13:21:21 +0200849enum class resampling_mode : uint8_t
850{
851 NONE = 0,
852 NEAREST = 1,
853 TRANSPOSE = 2,
854};
855
856enum class rounding : uint8_t
857{
858 TFL = 0,
859 TRUNCATE = 1,
860 NATURAL = 2,
861};
862
863enum class security_level : uint8_t
864{
865 SECURE = 0,
866 NON_SECURE = 1,
867};
868
Diqing Zhong04118062020-04-15 01:19:12 +0200869enum class shram_size : uint8_t
870{
871 SHRAM_48KB = 0x30,
872 SHRAM_24KB = 0x18,
873 SHRAM_16KB = 0x10,
874};
875
Kristofer Jonsson49bdee82020-04-06 13:21:21 +0200876enum class state : uint8_t
877{
878 STOPPED = 0,
879 RUNNING = 1,
880};
881
882enum class stride_mode : uint8_t
883{
884 STRIDE_MODE_1D = 0,
885 STRIDE_MODE_2D = 1,
886 STRIDE_MODE_3D = 2,
887};
888
889#else
890
891enum acc_format
892{
893 ACC_FORMAT_INT_32BIT = 0,
894 ACC_FORMAT_INT_40BIT = 1,
895 ACC_FORMAT_FP_S5_10 = 2,
896};
897
898enum activation
899{
900 ACTIVATION_NONE = 0,
901 ACTIVATION_TANH = 3,
902 ACTIVATION_SIGMOID = 4,
903 ACTIVATION_LUT_START = 16,
904 ACTIVATION_LUT_END = 23,
905};
906
907enum clip_range
908{
909 CLIP_RANGE_OFM_PRECISION = 0,
910 CLIP_RANGE_FORCE_UINT8 = 2,
911 CLIP_RANGE_FORCE_INT8 = 3,
912 CLIP_RANGE_FORCE_INT16 = 5,
913};
914
915enum cmd0
916{
917 CMD0_NPU_OP_STOP = 0x000,
918 CMD0_NPU_OP_IRQ = 0x001,
919 CMD0_NPU_OP_CONV = 0x002,
920 CMD0_NPU_OP_DEPTHWISE = 0x003,
921 CMD0_NPU_OP_POOL = 0x005,
922 CMD0_NPU_OP_ELEMENTWISE = 0x006,
923 CMD0_NPU_OP_DMA_START = 0x010,
924 CMD0_NPU_OP_DMA_WAIT = 0x011,
925 CMD0_NPU_OP_KERNEL_WAIT = 0x012,
926 CMD0_NPU_OP_PMU_MASK = 0x013,
927 CMD0_NPU_SET_IFM_PAD_TOP = 0x100,
928 CMD0_NPU_SET_IFM_PAD_LEFT = 0x101,
929 CMD0_NPU_SET_IFM_PAD_RIGHT = 0x102,
930 CMD0_NPU_SET_IFM_PAD_BOTTOM = 0x103,
931 CMD0_NPU_SET_IFM_DEPTH_M1 = 0x104,
932 CMD0_NPU_SET_IFM_PRECISION = 0x105,
933 CMD0_NPU_SET_IFM_UPSCALE = 0x107,
934 CMD0_NPU_SET_IFM_ZERO_POINT = 0x109,
935 CMD0_NPU_SET_IFM_WIDTH0_M1 = 0x10A,
936 CMD0_NPU_SET_IFM_HEIGHT0_M1 = 0x10B,
937 CMD0_NPU_SET_IFM_HEIGHT1_M1 = 0x10C,
938 CMD0_NPU_SET_IFM_IB_END = 0x10D,
939 CMD0_NPU_SET_IFM_REGION = 0x10F,
940 CMD0_NPU_SET_OFM_WIDTH_M1 = 0x111,
941 CMD0_NPU_SET_OFM_HEIGHT_M1 = 0x112,
942 CMD0_NPU_SET_OFM_DEPTH_M1 = 0x113,
943 CMD0_NPU_SET_OFM_PRECISION = 0x114,
944 CMD0_NPU_SET_OFM_BLK_WIDTH_M1 = 0x115,
945 CMD0_NPU_SET_OFM_BLK_HEIGHT_M1 = 0x116,
946 CMD0_NPU_SET_OFM_BLK_DEPTH_M1 = 0x117,
947 CMD0_NPU_SET_OFM_ZERO_POINT = 0x118,
948 CMD0_NPU_SET_OFM_WIDTH0_M1 = 0x11A,
949 CMD0_NPU_SET_OFM_HEIGHT0_M1 = 0x11B,
950 CMD0_NPU_SET_OFM_HEIGHT1_M1 = 0x11C,
951 CMD0_NPU_SET_OFM_REGION = 0x11F,
952 CMD0_NPU_SET_KERNEL_WIDTH_M1 = 0x120,
953 CMD0_NPU_SET_KERNEL_HEIGHT_M1 = 0x121,
954 CMD0_NPU_SET_KERNEL_STRIDE = 0x122,
955 CMD0_NPU_SET_PARALLEL_MODE = 0x123,
956 CMD0_NPU_SET_ACC_FORMAT = 0x124,
957 CMD0_NPU_SET_ACTIVATION = 0x125,
958 CMD0_NPU_SET_ACTIVATION_MIN = 0x126,
959 CMD0_NPU_SET_ACTIVATION_MAX = 0x127,
960 CMD0_NPU_SET_WEIGHT_REGION = 0x128,
961 CMD0_NPU_SET_SCALE_REGION = 0x129,
962 CMD0_NPU_SET_AB_START = 0x12D,
963 CMD0_NPU_SET_BLOCKDEP = 0x12F,
964 CMD0_NPU_SET_DMA0_SRC_REGION = 0x130,
965 CMD0_NPU_SET_DMA0_DST_REGION = 0x131,
966 CMD0_NPU_SET_DMA0_SIZE0 = 0x132,
967 CMD0_NPU_SET_DMA0_SIZE1 = 0x133,
968 CMD0_NPU_SET_IFM2_BROADCAST = 0x180,
969 CMD0_NPU_SET_IFM2_SCALAR = 0x181,
970 CMD0_NPU_SET_IFM2_PRECISION = 0x185,
971 CMD0_NPU_SET_IFM2_ZERO_POINT = 0x189,
972 CMD0_NPU_SET_IFM2_WIDTH0_M1 = 0x18A,
973 CMD0_NPU_SET_IFM2_HEIGHT0_M1 = 0x18B,
974 CMD0_NPU_SET_IFM2_HEIGHT1_M1 = 0x18C,
975 CMD0_NPU_SET_IFM2_IB_START = 0x18D,
976 CMD0_NPU_SET_IFM2_REGION = 0x18F,
977};
978
979enum cmd1
980{
981 CMD1_NPU_SET_IFM_BASE0 = 0x000,
982 CMD1_NPU_SET_IFM_BASE1 = 0x001,
983 CMD1_NPU_SET_IFM_BASE2 = 0x002,
984 CMD1_NPU_SET_IFM_BASE3 = 0x003,
985 CMD1_NPU_SET_IFM_STRIDE_X = 0x004,
986 CMD1_NPU_SET_IFM_STRIDE_Y = 0x005,
987 CMD1_NPU_SET_IFM_STRIDE_C = 0x006,
988 CMD1_NPU_SET_OFM_BASE0 = 0x010,
989 CMD1_NPU_SET_OFM_BASE1 = 0x011,
990 CMD1_NPU_SET_OFM_BASE2 = 0x012,
991 CMD1_NPU_SET_OFM_BASE3 = 0x013,
992 CMD1_NPU_SET_OFM_STRIDE_X = 0x014,
993 CMD1_NPU_SET_OFM_STRIDE_Y = 0x015,
994 CMD1_NPU_SET_OFM_STRIDE_C = 0x016,
995 CMD1_NPU_SET_WEIGHT_BASE = 0x020,
996 CMD1_NPU_SET_WEIGHT_LENGTH = 0x021,
997 CMD1_NPU_SET_SCALE_BASE = 0x022,
998 CMD1_NPU_SET_SCALE_LENGTH = 0x023,
999 CMD1_NPU_SET_OFM_SCALE = 0x024,
1000 CMD1_NPU_SET_OPA_SCALE = 0x025,
1001 CMD1_NPU_SET_OPB_SCALE = 0x026,
1002 CMD1_NPU_SET_DMA0_SRC = 0x030,
1003 CMD1_NPU_SET_DMA0_DST = 0x031,
1004 CMD1_NPU_SET_DMA0_LEN = 0x032,
1005 CMD1_NPU_SET_DMA0_SKIP0 = 0x033,
1006 CMD1_NPU_SET_DMA0_SKIP1 = 0x034,
1007 CMD1_NPU_SET_IFM2_BASE0 = 0x080,
1008 CMD1_NPU_SET_IFM2_BASE1 = 0x081,
1009 CMD1_NPU_SET_IFM2_BASE2 = 0x082,
1010 CMD1_NPU_SET_IFM2_BASE3 = 0x083,
1011 CMD1_NPU_SET_IFM2_STRIDE_X = 0x084,
1012 CMD1_NPU_SET_IFM2_STRIDE_Y = 0x085,
1013 CMD1_NPU_SET_IFM2_STRIDE_C = 0x086,
1014 CMD1_NPU_SET_WEIGHT1_BASE = 0x090,
1015 CMD1_NPU_SET_WEIGHT1_LENGTH = 0x091,
1016 CMD1_NPU_SET_SCALE1_BASE = 0x092,
1017 CMD1_NPU_SET_SCALE1_LENGTH = 0x093,
1018};
1019
1020enum data_format
1021{
1022 DATA_FORMAT_NHWC = 0,
1023 DATA_FORMAT_NHCWB16 = 1,
1024};
1025
1026enum elementwise_mode
1027{
1028 ELEMENTWISE_MODE_MUL = 0,
1029 ELEMENTWISE_MODE_ADD = 1,
1030 ELEMENTWISE_MODE_SUB = 2,
1031 ELEMENTWISE_MODE_MIN = 3,
1032 ELEMENTWISE_MODE_MAX = 4,
1033 ELEMENTWISE_MODE_LRELU = 5,
1034 ELEMENTWISE_MODE_ABS = 6,
1035 ELEMENTWISE_MODE_CLZ = 7,
1036 ELEMENTWISE_MODE_SHR = 8,
1037 ELEMENTWISE_MODE_SHL = 9,
1038};
1039
1040enum ifm_precision
1041{
Diqing Zhonga9f38d52020-04-27 11:00:13 +02001042 IFM_PRECISION_U8 = 0,
1043 IFM_PRECISION_S8 = 1,
1044 IFM_PRECISION_U16 = 4,
1045 IFM_PRECISION_S16 = 5,
1046 IFM_PRECISION_S32 = 9,
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001047};
1048
1049enum ifm_scale_mode
1050{
1051 IFM_SCALE_MODE_SCALE_16BIT = 0,
1052 IFM_SCALE_MODE_SCALE_OPA_32BIT = 1,
1053 IFM_SCALE_MODE_SCALE_OPB_32BIT = 2,
1054};
1055
Diqing Zhong04118062020-04-15 01:19:12 +02001056enum macs_per_cc
1057{
1058 MACS_PER_CC_MACS_PER_CC_IS_5 = 0x5,
1059 MACS_PER_CC_MACS_PER_CC_IS_6 = 0x6,
1060 MACS_PER_CC_MACS_PER_CC_IS_7 = 0x7,
1061 MACS_PER_CC_MACS_PER_CC_IS_8 = 0x8,
1062};
1063
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001064enum memory_type
1065{
1066 MEMORY_TYPE_AXI0_OUTSTANDING_COUNTER0 = 0,
1067 MEMORY_TYPE_AXI0_OUTSTANDING_COUNTER1 = 1,
1068 MEMORY_TYPE_AXI1_OUTSTANDING_COUNTER2 = 2,
1069 MEMORY_TYPE_AXI1_OUTSTANDING_COUNTER3 = 3,
1070};
1071
1072enum ofm_precision
1073{
1074 OFM_PRECISION_U8 = 0,
1075 OFM_PRECISION_S8 = 1,
1076 OFM_PRECISION_U16 = 2,
1077 OFM_PRECISION_S16 = 3,
1078 OFM_PRECISION_S32 = 5,
1079};
1080
1081enum pmu_event_type
1082{
Diqing Zhong04118062020-04-15 01:19:12 +02001083 PMU_EVENT_TYPE_NO_EVENT = 0x00,
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001084 PMU_EVENT_TYPE_CYCLE = 0x11,
1085 PMU_EVENT_TYPE_NPU_IDLE = 0x20,
1086 PMU_EVENT_TYPE_MAC_ACTIVE = 0x30,
1087 PMU_EVENT_TYPE_MAC_ACTIVE_8BIT = 0x31,
1088 PMU_EVENT_TYPE_MAC_ACTIVE_16BIT = 0x32,
1089 PMU_EVENT_TYPE_MAC_DPU_ACTIVE = 0x33,
1090 PMU_EVENT_TYPE_MAC_STALLED_BY_WD_ACC = 0x34,
1091 PMU_EVENT_TYPE_MAC_STALLED_BY_WD = 0x35,
1092 PMU_EVENT_TYPE_MAC_STALLED_BY_ACC = 0x36,
1093 PMU_EVENT_TYPE_MAC_STALLED_BY_IB = 0x37,
Diqing Zhong04118062020-04-15 01:19:12 +02001094 PMU_EVENT_TYPE_MAC_ACTIVE_32BIT = 0x38,
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001095 PMU_EVENT_TYPE_AO_ACTIVE = 0x40,
1096 PMU_EVENT_TYPE_AO_ACTIVE_8BIT = 0x41,
1097 PMU_EVENT_TYPE_AO_ACTIVE_16BIT = 0x42,
1098 PMU_EVENT_TYPE_AO_STALLED_BY_OFMP_OB = 0x43,
1099 PMU_EVENT_TYPE_AO_STALLED_BY_OFMP = 0x44,
1100 PMU_EVENT_TYPE_AO_STALLED_BY_OB = 0x45,
1101 PMU_EVENT_TYPE_AO_STALLED_BY_ACC_IB = 0x46,
1102 PMU_EVENT_TYPE_AO_STALLED_BY_ACC = 0x47,
1103 PMU_EVENT_TYPE_AO_STALLED_BY_IB = 0x48,
1104 PMU_EVENT_TYPE_WD_ACTIVE = 0x50,
1105 PMU_EVENT_TYPE_WD_STALLED = 0x51,
1106 PMU_EVENT_TYPE_WD_STALLED_BY_WS = 0x52,
1107 PMU_EVENT_TYPE_WD_STALLED_BY_WD_BUF = 0x53,
1108 PMU_EVENT_TYPE_WD_PARSE_ACTIVE = 0x54,
1109 PMU_EVENT_TYPE_WD_PARSE_STALLED = 0x55,
1110 PMU_EVENT_TYPE_WD_PARSE_STALLED_IN = 0x56,
1111 PMU_EVENT_TYPE_WD_PARSE_STALLED_OUT = 0x57,
Diqing Zhong04118062020-04-15 01:19:12 +02001112 PMU_EVENT_TYPE_WD_TRANS_WS = 0x58,
1113 PMU_EVENT_TYPE_WD_TRANS_WB = 0x59,
1114 PMU_EVENT_TYPE_WD_TRANS_DW0 = 0x5a,
1115 PMU_EVENT_TYPE_WD_TRANS_DW1 = 0x5b,
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001116 PMU_EVENT_TYPE_AXI0_RD_TRANS_ACCEPTED = 0x80,
1117 PMU_EVENT_TYPE_AXI0_RD_TRANS_COMPLETED = 0x81,
1118 PMU_EVENT_TYPE_AXI0_RD_DATA_BEAT_RECEIVED = 0x82,
1119 PMU_EVENT_TYPE_AXI0_RD_TRAN_REQ_STALLED = 0x83,
1120 PMU_EVENT_TYPE_AXI0_WR_TRANS_ACCEPTED = 0x84,
1121 PMU_EVENT_TYPE_AXI0_WR_TRANS_COMPLETED_M = 0x85,
1122 PMU_EVENT_TYPE_AXI0_WR_TRANS_COMPLETED_S = 0x86,
1123 PMU_EVENT_TYPE_AXI0_WR_DATA_BEAT_WRITTEN = 0x87,
1124 PMU_EVENT_TYPE_AXI0_WR_TRAN_REQ_STALLED = 0x88,
1125 PMU_EVENT_TYPE_AXI0_WR_DATA_BEAT_STALLED = 0x89,
1126 PMU_EVENT_TYPE_AXI0_ENABLED_CYCLES = 0x8c,
1127 PMU_EVENT_TYPE_AXI0_RD_STALL_LIMIT = 0x8e,
1128 PMU_EVENT_TYPE_AXI0_WR_STALL_LIMIT = 0x8f,
1129 PMU_EVENT_TYPE_AXI1_RD_TRANS_ACCEPTED = 0x180,
1130 PMU_EVENT_TYPE_AXI1_RD_TRANS_COMPLETED = 0x181,
1131 PMU_EVENT_TYPE_AXI1_RD_DATA_BEAT_RECEIVED = 0x182,
1132 PMU_EVENT_TYPE_AXI1_RD_TRAN_REQ_STALLED = 0x183,
1133 PMU_EVENT_TYPE_AXI1_WR_TRANS_ACCEPTED = 0x184,
1134 PMU_EVENT_TYPE_AXI1_WR_TRANS_COMPLETED_M = 0x185,
1135 PMU_EVENT_TYPE_AXI1_WR_TRANS_COMPLETED_S = 0x186,
1136 PMU_EVENT_TYPE_AXI1_WR_DATA_BEAT_WRITTEN = 0x187,
1137 PMU_EVENT_TYPE_AXI1_WR_TRAN_REQ_STALLED = 0x188,
1138 PMU_EVENT_TYPE_AXI1_WR_DATA_BEAT_STALLED = 0x189,
1139 PMU_EVENT_TYPE_AXI1_ENABLED_CYCLES = 0x18c,
1140 PMU_EVENT_TYPE_AXI1_RD_STALL_LIMIT = 0x18e,
1141 PMU_EVENT_TYPE_AXI1_WR_STALL_LIMIT = 0x18f,
1142 PMU_EVENT_TYPE_AXI_LATENCY_ANY = 0xa0,
1143 PMU_EVENT_TYPE_AXI_LATENCY_32 = 0xa1,
1144 PMU_EVENT_TYPE_AXI_LATENCY_64 = 0xa2,
1145 PMU_EVENT_TYPE_AXI_LATENCY_128 = 0xa3,
1146 PMU_EVENT_TYPE_AXI_LATENCY_256 = 0xa4,
1147 PMU_EVENT_TYPE_AXI_LATENCY_512 = 0xa5,
1148 PMU_EVENT_TYPE_AXI_LATENCY_1024 = 0xa6,
1149};
1150
1151enum pooling_mode
1152{
1153 POOLING_MODE_MAX = 0,
1154 POOLING_MODE_AVERAGE = 1,
1155 POOLING_MODE_REDUCE_SUM = 2,
1156};
1157
1158enum privilege_level
1159{
1160 PRIVILEGE_LEVEL_USER = 0,
1161 PRIVILEGE_LEVEL_PRIVILEGED = 1,
1162};
1163
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001164enum resampling_mode
1165{
1166 RESAMPLING_MODE_NONE = 0,
1167 RESAMPLING_MODE_NEAREST = 1,
1168 RESAMPLING_MODE_TRANSPOSE = 2,
1169};
1170
1171enum rounding
1172{
1173 ROUNDING_TFL = 0,
1174 ROUNDING_TRUNCATE = 1,
1175 ROUNDING_NATURAL = 2,
1176};
1177
1178enum security_level
1179{
1180 SECURITY_LEVEL_SECURE = 0,
1181 SECURITY_LEVEL_NON_SECURE = 1,
1182};
1183
Diqing Zhong04118062020-04-15 01:19:12 +02001184enum shram_size
1185{
1186 SHRAM_SIZE_SHRAM_48KB = 0x30,
1187 SHRAM_SIZE_SHRAM_24KB = 0x18,
1188 SHRAM_SIZE_SHRAM_16KB = 0x10,
1189};
1190
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001191enum state
1192{
1193 STATE_STOPPED = 0,
1194 STATE_RUNNING = 1,
1195};
1196
1197enum stride_mode
1198{
1199 STRIDE_MODE_STRIDE_MODE_1D = 0,
1200 STRIDE_MODE_STRIDE_MODE_2D = 1,
1201 STRIDE_MODE_STRIDE_MODE_3D = 2,
1202};
1203
1204#endif
1205
1206// clkforce_r - Force clocks on for clock gating
1207struct clkforce_r
1208{
1209#ifdef __cplusplus
1210 private:
1211#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001212 union
1213 {
1214 struct
1215 {
1216 uint32_t top_level_clk : 1; // set to 1 to force on TOP level clock
1217 uint32_t cc_clk : 1; // set to 1 to force on CC clock
1218 uint32_t dma_clk : 1; // set to 1 to force on DMA clock
1219 uint32_t mac_clk : 1; // set to 1 to force on MAC clock
1220 uint32_t ao_clk : 1; // set to 1 to force on AO clock
1221 uint32_t wd_clk : 1; // set to 1 to force on WD clock
1222 uint32_t reserved0 : 26;
1223 };
1224 uint32_t word;
1225 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001226#ifdef __cplusplus
1227 public:
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001228 CONSTEXPR clkforce_r() :
1229 top_level_clk(static_cast<uint32_t>(0)), cc_clk(static_cast<uint32_t>(0)), dma_clk(static_cast<uint32_t>(0)),
1230 mac_clk(static_cast<uint32_t>(0)), ao_clk(static_cast<uint32_t>(0)), wd_clk(static_cast<uint32_t>(0)),
1231 reserved0(static_cast<uint32_t>(0))
1232 {
1233 }
1234 CONSTEXPR clkforce_r(uint32_t init) : word(init) {}
1235 CONSTEXPR void operator=(uint32_t value)
1236 {
1237 word = value;
1238 }
1239 void operator=(uint32_t value) volatile
1240 {
1241 word = value;
1242 }
1243 CONSTEXPR operator uint32_t()
1244 {
1245 return word;
1246 }
1247 operator uint32_t() volatile
1248 {
1249 return word;
1250 }
1251 clkforce_r copy() volatile
1252 {
1253 return *this;
1254 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001255 CONSTEXPR uint32_t get_top_level_clk() const
1256 {
1257 uint32_t value = static_cast<uint32_t>(top_level_clk);
1258 return value;
1259 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001260 uint32_t get_top_level_clk() const volatile
1261 {
1262 uint32_t value = static_cast<uint32_t>(top_level_clk);
1263 return value;
1264 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001265 CONSTEXPR clkforce_r &set_top_level_clk(uint32_t value)
1266 {
1267 top_level_clk = ((1u << 1) - 1) & static_cast<uint32_t>(value);
1268 return *this;
1269 }
1270 CONSTEXPR uint32_t get_cc_clk() const
1271 {
1272 uint32_t value = static_cast<uint32_t>(cc_clk);
1273 return value;
1274 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001275 uint32_t get_cc_clk() const volatile
1276 {
1277 uint32_t value = static_cast<uint32_t>(cc_clk);
1278 return value;
1279 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001280 CONSTEXPR clkforce_r &set_cc_clk(uint32_t value)
1281 {
1282 cc_clk = ((1u << 1) - 1) & static_cast<uint32_t>(value);
1283 return *this;
1284 }
1285 CONSTEXPR uint32_t get_dma_clk() const
1286 {
1287 uint32_t value = static_cast<uint32_t>(dma_clk);
1288 return value;
1289 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001290 uint32_t get_dma_clk() const volatile
1291 {
1292 uint32_t value = static_cast<uint32_t>(dma_clk);
1293 return value;
1294 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001295 CONSTEXPR clkforce_r &set_dma_clk(uint32_t value)
1296 {
1297 dma_clk = ((1u << 1) - 1) & static_cast<uint32_t>(value);
1298 return *this;
1299 }
1300 CONSTEXPR uint32_t get_mac_clk() const
1301 {
1302 uint32_t value = static_cast<uint32_t>(mac_clk);
1303 return value;
1304 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001305 uint32_t get_mac_clk() const volatile
1306 {
1307 uint32_t value = static_cast<uint32_t>(mac_clk);
1308 return value;
1309 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001310 CONSTEXPR clkforce_r &set_mac_clk(uint32_t value)
1311 {
1312 mac_clk = ((1u << 1) - 1) & static_cast<uint32_t>(value);
1313 return *this;
1314 }
1315 CONSTEXPR uint32_t get_ao_clk() const
1316 {
1317 uint32_t value = static_cast<uint32_t>(ao_clk);
1318 return value;
1319 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001320 uint32_t get_ao_clk() const volatile
1321 {
1322 uint32_t value = static_cast<uint32_t>(ao_clk);
1323 return value;
1324 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001325 CONSTEXPR clkforce_r &set_ao_clk(uint32_t value)
1326 {
1327 ao_clk = ((1u << 1) - 1) & static_cast<uint32_t>(value);
1328 return *this;
1329 }
1330 CONSTEXPR uint32_t get_wd_clk() const
1331 {
1332 uint32_t value = static_cast<uint32_t>(wd_clk);
1333 return value;
1334 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001335 uint32_t get_wd_clk() const volatile
1336 {
1337 uint32_t value = static_cast<uint32_t>(wd_clk);
1338 return value;
1339 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001340 CONSTEXPR clkforce_r &set_wd_clk(uint32_t value)
1341 {
1342 wd_clk = ((1u << 1) - 1) & static_cast<uint32_t>(value);
1343 return *this;
1344 }
1345#endif //__cplusplus
1346};
1347
1348// basep0_r - Lower 32 bits of the Base pointer for region index 0
1349struct basep0_r
1350{
1351#ifdef __cplusplus
1352 private:
1353#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001354 union
1355 {
1356 uint32_t addr_word; // The low word of the 64-bit address
1357 uint32_t word;
1358 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001359#ifdef __cplusplus
1360 public:
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001361 CONSTEXPR basep0_r() : addr_word(static_cast<uint32_t>(0)) {}
1362 CONSTEXPR basep0_r(uint32_t init) : word(init) {}
1363 CONSTEXPR void operator=(uint32_t value)
1364 {
1365 word = value;
1366 }
1367 void operator=(uint32_t value) volatile
1368 {
1369 word = value;
1370 }
1371 CONSTEXPR operator uint32_t()
1372 {
1373 return word;
1374 }
1375 operator uint32_t() volatile
1376 {
1377 return word;
1378 }
1379 basep0_r copy() volatile
1380 {
1381 return *this;
1382 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001383 CONSTEXPR uint32_t get_addr_word() const
1384 {
1385 uint32_t value = static_cast<uint32_t>(addr_word);
1386 return value;
1387 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001388 uint32_t get_addr_word() const volatile
1389 {
1390 uint32_t value = static_cast<uint32_t>(addr_word);
1391 return value;
1392 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001393 CONSTEXPR basep0_r &set_addr_word(uint32_t value)
1394 {
1395 addr_word = static_cast<uint32_t>(value);
1396 return *this;
1397 }
1398#endif //__cplusplus
1399};
1400
1401// basep1_r - Upper 32 bits of the Base pointer for region index 0
1402struct basep1_r
1403{
1404#ifdef __cplusplus
1405 private:
1406#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001407 union
1408 {
1409 uint32_t addr_word; // The high word of the 64-bit address
1410 uint32_t word;
1411 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001412#ifdef __cplusplus
1413 public:
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001414 CONSTEXPR basep1_r() : addr_word(static_cast<uint32_t>(0)) {}
1415 CONSTEXPR basep1_r(uint32_t init) : word(init) {}
1416 CONSTEXPR void operator=(uint32_t value)
1417 {
1418 word = value;
1419 }
1420 void operator=(uint32_t value) volatile
1421 {
1422 word = value;
1423 }
1424 CONSTEXPR operator uint32_t()
1425 {
1426 return word;
1427 }
1428 operator uint32_t() volatile
1429 {
1430 return word;
1431 }
1432 basep1_r copy() volatile
1433 {
1434 return *this;
1435 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001436 CONSTEXPR uint32_t get_addr_word() const
1437 {
1438 uint32_t value = static_cast<uint32_t>(addr_word);
1439 return value;
1440 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001441 uint32_t get_addr_word() const volatile
1442 {
1443 uint32_t value = static_cast<uint32_t>(addr_word);
1444 return value;
1445 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001446 CONSTEXPR basep1_r &set_addr_word(uint32_t value)
1447 {
1448 addr_word = static_cast<uint32_t>(value);
1449 return *this;
1450 }
1451#endif //__cplusplus
1452};
1453
1454// basep2_r - Lower 32 bits of the Base pointer for region index 1
1455struct basep2_r
1456{
1457#ifdef __cplusplus
1458 private:
1459#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001460 union
1461 {
1462 uint32_t addr_word; // The low word of the 64-bit address
1463 uint32_t word;
1464 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001465#ifdef __cplusplus
1466 public:
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001467 CONSTEXPR basep2_r() : addr_word(static_cast<uint32_t>(0)) {}
1468 CONSTEXPR basep2_r(uint32_t init) : word(init) {}
1469 CONSTEXPR void operator=(uint32_t value)
1470 {
1471 word = value;
1472 }
1473 void operator=(uint32_t value) volatile
1474 {
1475 word = value;
1476 }
1477 CONSTEXPR operator uint32_t()
1478 {
1479 return word;
1480 }
1481 operator uint32_t() volatile
1482 {
1483 return word;
1484 }
1485 basep2_r copy() volatile
1486 {
1487 return *this;
1488 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001489 CONSTEXPR uint32_t get_addr_word() const
1490 {
1491 uint32_t value = static_cast<uint32_t>(addr_word);
1492 return value;
1493 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001494 uint32_t get_addr_word() const volatile
1495 {
1496 uint32_t value = static_cast<uint32_t>(addr_word);
1497 return value;
1498 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001499 CONSTEXPR basep2_r &set_addr_word(uint32_t value)
1500 {
1501 addr_word = static_cast<uint32_t>(value);
1502 return *this;
1503 }
1504#endif //__cplusplus
1505};
1506
1507// basep3_r - Upper 32 bits of the Base pointer for region index 1
1508struct basep3_r
1509{
1510#ifdef __cplusplus
1511 private:
1512#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001513 union
1514 {
1515 uint32_t addr_word; // The high word of the 64-bit address
1516 uint32_t word;
1517 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001518#ifdef __cplusplus
1519 public:
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001520 CONSTEXPR basep3_r() : addr_word(static_cast<uint32_t>(0)) {}
1521 CONSTEXPR basep3_r(uint32_t init) : word(init) {}
1522 CONSTEXPR void operator=(uint32_t value)
1523 {
1524 word = value;
1525 }
1526 void operator=(uint32_t value) volatile
1527 {
1528 word = value;
1529 }
1530 CONSTEXPR operator uint32_t()
1531 {
1532 return word;
1533 }
1534 operator uint32_t() volatile
1535 {
1536 return word;
1537 }
1538 basep3_r copy() volatile
1539 {
1540 return *this;
1541 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001542 CONSTEXPR uint32_t get_addr_word() const
1543 {
1544 uint32_t value = static_cast<uint32_t>(addr_word);
1545 return value;
1546 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001547 uint32_t get_addr_word() const volatile
1548 {
1549 uint32_t value = static_cast<uint32_t>(addr_word);
1550 return value;
1551 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001552 CONSTEXPR basep3_r &set_addr_word(uint32_t value)
1553 {
1554 addr_word = static_cast<uint32_t>(value);
1555 return *this;
1556 }
1557#endif //__cplusplus
1558};
1559
1560// basep4_r - Lower 32 bits of the Base pointer for region index 2
1561struct basep4_r
1562{
1563#ifdef __cplusplus
1564 private:
1565#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001566 union
1567 {
1568 uint32_t addr_word; // The low word of the 64-bit address
1569 uint32_t word;
1570 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001571#ifdef __cplusplus
1572 public:
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001573 CONSTEXPR basep4_r() : addr_word(static_cast<uint32_t>(0)) {}
1574 CONSTEXPR basep4_r(uint32_t init) : word(init) {}
1575 CONSTEXPR void operator=(uint32_t value)
1576 {
1577 word = value;
1578 }
1579 void operator=(uint32_t value) volatile
1580 {
1581 word = value;
1582 }
1583 CONSTEXPR operator uint32_t()
1584 {
1585 return word;
1586 }
1587 operator uint32_t() volatile
1588 {
1589 return word;
1590 }
1591 basep4_r copy() volatile
1592 {
1593 return *this;
1594 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001595 CONSTEXPR uint32_t get_addr_word() const
1596 {
1597 uint32_t value = static_cast<uint32_t>(addr_word);
1598 return value;
1599 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001600 uint32_t get_addr_word() const volatile
1601 {
1602 uint32_t value = static_cast<uint32_t>(addr_word);
1603 return value;
1604 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001605 CONSTEXPR basep4_r &set_addr_word(uint32_t value)
1606 {
1607 addr_word = static_cast<uint32_t>(value);
1608 return *this;
1609 }
1610#endif //__cplusplus
1611};
1612
1613// basep5_r - Upper 32 bits of the Base pointer for region index 2
1614struct basep5_r
1615{
1616#ifdef __cplusplus
1617 private:
1618#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001619 union
1620 {
1621 uint32_t addr_word; // The high word of the 64-bit address
1622 uint32_t word;
1623 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001624#ifdef __cplusplus
1625 public:
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001626 CONSTEXPR basep5_r() : addr_word(static_cast<uint32_t>(0)) {}
1627 CONSTEXPR basep5_r(uint32_t init) : word(init) {}
1628 CONSTEXPR void operator=(uint32_t value)
1629 {
1630 word = value;
1631 }
1632 void operator=(uint32_t value) volatile
1633 {
1634 word = value;
1635 }
1636 CONSTEXPR operator uint32_t()
1637 {
1638 return word;
1639 }
1640 operator uint32_t() volatile
1641 {
1642 return word;
1643 }
1644 basep5_r copy() volatile
1645 {
1646 return *this;
1647 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001648 CONSTEXPR uint32_t get_addr_word() const
1649 {
1650 uint32_t value = static_cast<uint32_t>(addr_word);
1651 return value;
1652 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001653 uint32_t get_addr_word() const volatile
1654 {
1655 uint32_t value = static_cast<uint32_t>(addr_word);
1656 return value;
1657 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001658 CONSTEXPR basep5_r &set_addr_word(uint32_t value)
1659 {
1660 addr_word = static_cast<uint32_t>(value);
1661 return *this;
1662 }
1663#endif //__cplusplus
1664};
1665
1666// basep6_r - Lower 32 bits of the Base pointer for region index 3
1667struct basep6_r
1668{
1669#ifdef __cplusplus
1670 private:
1671#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001672 union
1673 {
1674 uint32_t addr_word; // The low word of the 64-bit address
1675 uint32_t word;
1676 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001677#ifdef __cplusplus
1678 public:
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001679 CONSTEXPR basep6_r() : addr_word(static_cast<uint32_t>(0)) {}
1680 CONSTEXPR basep6_r(uint32_t init) : word(init) {}
1681 CONSTEXPR void operator=(uint32_t value)
1682 {
1683 word = value;
1684 }
1685 void operator=(uint32_t value) volatile
1686 {
1687 word = value;
1688 }
1689 CONSTEXPR operator uint32_t()
1690 {
1691 return word;
1692 }
1693 operator uint32_t() volatile
1694 {
1695 return word;
1696 }
1697 basep6_r copy() volatile
1698 {
1699 return *this;
1700 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001701 CONSTEXPR uint32_t get_addr_word() const
1702 {
1703 uint32_t value = static_cast<uint32_t>(addr_word);
1704 return value;
1705 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001706 uint32_t get_addr_word() const volatile
1707 {
1708 uint32_t value = static_cast<uint32_t>(addr_word);
1709 return value;
1710 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001711 CONSTEXPR basep6_r &set_addr_word(uint32_t value)
1712 {
1713 addr_word = static_cast<uint32_t>(value);
1714 return *this;
1715 }
1716#endif //__cplusplus
1717};
1718
1719// basep7_r - Upper 32 bits of the Base pointer for region index 3
1720struct basep7_r
1721{
1722#ifdef __cplusplus
1723 private:
1724#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001725 union
1726 {
1727 uint32_t addr_word; // The high word of the 64-bit address
1728 uint32_t word;
1729 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001730#ifdef __cplusplus
1731 public:
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001732 CONSTEXPR basep7_r() : addr_word(static_cast<uint32_t>(0)) {}
1733 CONSTEXPR basep7_r(uint32_t init) : word(init) {}
1734 CONSTEXPR void operator=(uint32_t value)
1735 {
1736 word = value;
1737 }
1738 void operator=(uint32_t value) volatile
1739 {
1740 word = value;
1741 }
1742 CONSTEXPR operator uint32_t()
1743 {
1744 return word;
1745 }
1746 operator uint32_t() volatile
1747 {
1748 return word;
1749 }
1750 basep7_r copy() volatile
1751 {
1752 return *this;
1753 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001754 CONSTEXPR uint32_t get_addr_word() const
1755 {
1756 uint32_t value = static_cast<uint32_t>(addr_word);
1757 return value;
1758 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001759 uint32_t get_addr_word() const volatile
1760 {
1761 uint32_t value = static_cast<uint32_t>(addr_word);
1762 return value;
1763 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001764 CONSTEXPR basep7_r &set_addr_word(uint32_t value)
1765 {
1766 addr_word = static_cast<uint32_t>(value);
1767 return *this;
1768 }
1769#endif //__cplusplus
1770};
1771
1772// basep8_r - Lower 32 bits of the Base pointer for region index 4
1773struct basep8_r
1774{
1775#ifdef __cplusplus
1776 private:
1777#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001778 union
1779 {
1780 uint32_t addr_word; // The low word of the 64-bit address
1781 uint32_t word;
1782 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001783#ifdef __cplusplus
1784 public:
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001785 CONSTEXPR basep8_r() : addr_word(static_cast<uint32_t>(0)) {}
1786 CONSTEXPR basep8_r(uint32_t init) : word(init) {}
1787 CONSTEXPR void operator=(uint32_t value)
1788 {
1789 word = value;
1790 }
1791 void operator=(uint32_t value) volatile
1792 {
1793 word = value;
1794 }
1795 CONSTEXPR operator uint32_t()
1796 {
1797 return word;
1798 }
1799 operator uint32_t() volatile
1800 {
1801 return word;
1802 }
1803 basep8_r copy() volatile
1804 {
1805 return *this;
1806 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001807 CONSTEXPR uint32_t get_addr_word() const
1808 {
1809 uint32_t value = static_cast<uint32_t>(addr_word);
1810 return value;
1811 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001812 uint32_t get_addr_word() const volatile
1813 {
1814 uint32_t value = static_cast<uint32_t>(addr_word);
1815 return value;
1816 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001817 CONSTEXPR basep8_r &set_addr_word(uint32_t value)
1818 {
1819 addr_word = static_cast<uint32_t>(value);
1820 return *this;
1821 }
1822#endif //__cplusplus
1823};
1824
1825// basep9_r - Upper 32 bits of the Base pointer for region index 4
1826struct basep9_r
1827{
1828#ifdef __cplusplus
1829 private:
1830#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001831 union
1832 {
1833 uint32_t addr_word; // The high word of the 64-bit address
1834 uint32_t word;
1835 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001836#ifdef __cplusplus
1837 public:
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001838 CONSTEXPR basep9_r() : addr_word(static_cast<uint32_t>(0)) {}
1839 CONSTEXPR basep9_r(uint32_t init) : word(init) {}
1840 CONSTEXPR void operator=(uint32_t value)
1841 {
1842 word = value;
1843 }
1844 void operator=(uint32_t value) volatile
1845 {
1846 word = value;
1847 }
1848 CONSTEXPR operator uint32_t()
1849 {
1850 return word;
1851 }
1852 operator uint32_t() volatile
1853 {
1854 return word;
1855 }
1856 basep9_r copy() volatile
1857 {
1858 return *this;
1859 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001860 CONSTEXPR uint32_t get_addr_word() const
1861 {
1862 uint32_t value = static_cast<uint32_t>(addr_word);
1863 return value;
1864 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001865 uint32_t get_addr_word() const volatile
1866 {
1867 uint32_t value = static_cast<uint32_t>(addr_word);
1868 return value;
1869 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001870 CONSTEXPR basep9_r &set_addr_word(uint32_t value)
1871 {
1872 addr_word = static_cast<uint32_t>(value);
1873 return *this;
1874 }
1875#endif //__cplusplus
1876};
1877
1878// basep10_r - Lower 32 bits of the Base pointer for region index 5
1879struct basep10_r
1880{
1881#ifdef __cplusplus
1882 private:
1883#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001884 union
1885 {
1886 uint32_t addr_word; // The low word of the 64-bit address
1887 uint32_t word;
1888 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001889#ifdef __cplusplus
1890 public:
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001891 CONSTEXPR basep10_r() : addr_word(static_cast<uint32_t>(0)) {}
1892 CONSTEXPR basep10_r(uint32_t init) : word(init) {}
1893 CONSTEXPR void operator=(uint32_t value)
1894 {
1895 word = value;
1896 }
1897 void operator=(uint32_t value) volatile
1898 {
1899 word = value;
1900 }
1901 CONSTEXPR operator uint32_t()
1902 {
1903 return word;
1904 }
1905 operator uint32_t() volatile
1906 {
1907 return word;
1908 }
1909 basep10_r copy() volatile
1910 {
1911 return *this;
1912 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001913 CONSTEXPR uint32_t get_addr_word() const
1914 {
1915 uint32_t value = static_cast<uint32_t>(addr_word);
1916 return value;
1917 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001918 uint32_t get_addr_word() const volatile
1919 {
1920 uint32_t value = static_cast<uint32_t>(addr_word);
1921 return value;
1922 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001923 CONSTEXPR basep10_r &set_addr_word(uint32_t value)
1924 {
1925 addr_word = static_cast<uint32_t>(value);
1926 return *this;
1927 }
1928#endif //__cplusplus
1929};
1930
1931// basep11_r - Upper 32 bits of the Base pointer for region index 5
1932struct basep11_r
1933{
1934#ifdef __cplusplus
1935 private:
1936#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001937 union
1938 {
1939 uint32_t addr_word; // The high word of the 64-bit address
1940 uint32_t word;
1941 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001942#ifdef __cplusplus
1943 public:
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001944 CONSTEXPR basep11_r() : addr_word(static_cast<uint32_t>(0)) {}
1945 CONSTEXPR basep11_r(uint32_t init) : word(init) {}
1946 CONSTEXPR void operator=(uint32_t value)
1947 {
1948 word = value;
1949 }
1950 void operator=(uint32_t value) volatile
1951 {
1952 word = value;
1953 }
1954 CONSTEXPR operator uint32_t()
1955 {
1956 return word;
1957 }
1958 operator uint32_t() volatile
1959 {
1960 return word;
1961 }
1962 basep11_r copy() volatile
1963 {
1964 return *this;
1965 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001966 CONSTEXPR uint32_t get_addr_word() const
1967 {
1968 uint32_t value = static_cast<uint32_t>(addr_word);
1969 return value;
1970 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001971 uint32_t get_addr_word() const volatile
1972 {
1973 uint32_t value = static_cast<uint32_t>(addr_word);
1974 return value;
1975 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001976 CONSTEXPR basep11_r &set_addr_word(uint32_t value)
1977 {
1978 addr_word = static_cast<uint32_t>(value);
1979 return *this;
1980 }
1981#endif //__cplusplus
1982};
1983
1984// basep12_r - Lower 32 bits of the Base pointer for region index 6
1985struct basep12_r
1986{
1987#ifdef __cplusplus
1988 private:
1989#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001990 union
1991 {
1992 uint32_t addr_word; // The low word of the 64-bit address
1993 uint32_t word;
1994 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001995#ifdef __cplusplus
1996 public:
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001997 CONSTEXPR basep12_r() : addr_word(static_cast<uint32_t>(0)) {}
1998 CONSTEXPR basep12_r(uint32_t init) : word(init) {}
1999 CONSTEXPR void operator=(uint32_t value)
2000 {
2001 word = value;
2002 }
2003 void operator=(uint32_t value) volatile
2004 {
2005 word = value;
2006 }
2007 CONSTEXPR operator uint32_t()
2008 {
2009 return word;
2010 }
2011 operator uint32_t() volatile
2012 {
2013 return word;
2014 }
2015 basep12_r copy() volatile
2016 {
2017 return *this;
2018 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002019 CONSTEXPR uint32_t get_addr_word() const
2020 {
2021 uint32_t value = static_cast<uint32_t>(addr_word);
2022 return value;
2023 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002024 uint32_t get_addr_word() const volatile
2025 {
2026 uint32_t value = static_cast<uint32_t>(addr_word);
2027 return value;
2028 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002029 CONSTEXPR basep12_r &set_addr_word(uint32_t value)
2030 {
2031 addr_word = static_cast<uint32_t>(value);
2032 return *this;
2033 }
2034#endif //__cplusplus
2035};
2036
2037// basep13_r - Upper 32 bits of the Base pointer for region index 6
2038struct basep13_r
2039{
2040#ifdef __cplusplus
2041 private:
2042#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002043 union
2044 {
2045 uint32_t addr_word; // The high word of the 64-bit address
2046 uint32_t word;
2047 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002048#ifdef __cplusplus
2049 public:
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002050 CONSTEXPR basep13_r() : addr_word(static_cast<uint32_t>(0)) {}
2051 CONSTEXPR basep13_r(uint32_t init) : word(init) {}
2052 CONSTEXPR void operator=(uint32_t value)
2053 {
2054 word = value;
2055 }
2056 void operator=(uint32_t value) volatile
2057 {
2058 word = value;
2059 }
2060 CONSTEXPR operator uint32_t()
2061 {
2062 return word;
2063 }
2064 operator uint32_t() volatile
2065 {
2066 return word;
2067 }
2068 basep13_r copy() volatile
2069 {
2070 return *this;
2071 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002072 CONSTEXPR uint32_t get_addr_word() const
2073 {
2074 uint32_t value = static_cast<uint32_t>(addr_word);
2075 return value;
2076 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002077 uint32_t get_addr_word() const volatile
2078 {
2079 uint32_t value = static_cast<uint32_t>(addr_word);
2080 return value;
2081 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002082 CONSTEXPR basep13_r &set_addr_word(uint32_t value)
2083 {
2084 addr_word = static_cast<uint32_t>(value);
2085 return *this;
2086 }
2087#endif //__cplusplus
2088};
2089
2090// basep14_r - Lower 32 bits of the Base pointer for region index 7
2091struct basep14_r
2092{
2093#ifdef __cplusplus
2094 private:
2095#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002096 union
2097 {
2098 uint32_t addr_word; // The low word of the 64-bit address
2099 uint32_t word;
2100 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002101#ifdef __cplusplus
2102 public:
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002103 CONSTEXPR basep14_r() : addr_word(static_cast<uint32_t>(0)) {}
2104 CONSTEXPR basep14_r(uint32_t init) : word(init) {}
2105 CONSTEXPR void operator=(uint32_t value)
2106 {
2107 word = value;
2108 }
2109 void operator=(uint32_t value) volatile
2110 {
2111 word = value;
2112 }
2113 CONSTEXPR operator uint32_t()
2114 {
2115 return word;
2116 }
2117 operator uint32_t() volatile
2118 {
2119 return word;
2120 }
2121 basep14_r copy() volatile
2122 {
2123 return *this;
2124 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002125 CONSTEXPR uint32_t get_addr_word() const
2126 {
2127 uint32_t value = static_cast<uint32_t>(addr_word);
2128 return value;
2129 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002130 uint32_t get_addr_word() const volatile
2131 {
2132 uint32_t value = static_cast<uint32_t>(addr_word);
2133 return value;
2134 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002135 CONSTEXPR basep14_r &set_addr_word(uint32_t value)
2136 {
2137 addr_word = static_cast<uint32_t>(value);
2138 return *this;
2139 }
2140#endif //__cplusplus
2141};
2142
2143// basep15_r - Upper 32 bits of the Base pointer for region index 7
2144struct basep15_r
2145{
2146#ifdef __cplusplus
2147 private:
2148#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002149 union
2150 {
2151 uint32_t addr_word; // The high word of the 64-bit address
2152 uint32_t word;
2153 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002154#ifdef __cplusplus
2155 public:
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002156 CONSTEXPR basep15_r() : addr_word(static_cast<uint32_t>(0)) {}
2157 CONSTEXPR basep15_r(uint32_t init) : word(init) {}
2158 CONSTEXPR void operator=(uint32_t value)
2159 {
2160 word = value;
2161 }
2162 void operator=(uint32_t value) volatile
2163 {
2164 word = value;
2165 }
2166 CONSTEXPR operator uint32_t()
2167 {
2168 return word;
2169 }
2170 operator uint32_t() volatile
2171 {
2172 return word;
2173 }
2174 basep15_r copy() volatile
2175 {
2176 return *this;
2177 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002178 CONSTEXPR uint32_t get_addr_word() const
2179 {
2180 uint32_t value = static_cast<uint32_t>(addr_word);
2181 return value;
2182 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002183 uint32_t get_addr_word() const volatile
2184 {
2185 uint32_t value = static_cast<uint32_t>(addr_word);
2186 return value;
2187 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002188 CONSTEXPR basep15_r &set_addr_word(uint32_t value)
2189 {
2190 addr_word = static_cast<uint32_t>(value);
2191 return *this;
2192 }
2193#endif //__cplusplus
2194};
2195
2196// pid4_r - Peripheral ID byte 4 (Arm=code 4)
2197struct pid4_r
2198{
2199#ifdef __cplusplus
2200 private:
2201#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002202 union
2203 {
2204 uint32_t PID4; // Byte 4 of Peripheral ID (Lower 8 bits valid)
2205 uint32_t word;
2206 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002207#ifdef __cplusplus
2208 public:
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002209 CONSTEXPR pid4_r() : PID4(static_cast<uint32_t>(0x04)) {}
2210 CONSTEXPR pid4_r(uint32_t init) : word(init) {}
2211 CONSTEXPR void operator=(uint32_t value)
2212 {
2213 word = value;
2214 }
2215 void operator=(uint32_t value) volatile
2216 {
2217 word = value;
2218 }
2219 CONSTEXPR operator uint32_t()
2220 {
2221 return word;
2222 }
2223 operator uint32_t() volatile
2224 {
2225 return word;
2226 }
2227 pid4_r copy() volatile
2228 {
2229 return *this;
2230 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002231 CONSTEXPR uint32_t get_PID4() const
2232 {
2233 uint32_t value = static_cast<uint32_t>(PID4);
2234 return value;
2235 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002236 uint32_t get_PID4() const volatile
2237 {
2238 uint32_t value = static_cast<uint32_t>(PID4);
2239 return value;
2240 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002241 CONSTEXPR pid4_r &set_PID4(uint32_t value)
2242 {
2243 PID4 = static_cast<uint32_t>(value);
2244 return *this;
2245 }
2246#endif //__cplusplus
2247};
2248
2249// pid5_r - Peripheral ID byte 5 (reserved)
2250struct pid5_r
2251{
2252#ifdef __cplusplus
2253 private:
2254#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002255 union
2256 {
2257 uint32_t PID5; // Byte 5 of Peripheral ID (Lower 8 bits valid)
2258 uint32_t word;
2259 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002260#ifdef __cplusplus
2261 public:
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002262 CONSTEXPR pid5_r() : PID5(static_cast<uint32_t>(0x00)) {}
2263 CONSTEXPR pid5_r(uint32_t init) : word(init) {}
2264 CONSTEXPR void operator=(uint32_t value)
2265 {
2266 word = value;
2267 }
2268 void operator=(uint32_t value) volatile
2269 {
2270 word = value;
2271 }
2272 CONSTEXPR operator uint32_t()
2273 {
2274 return word;
2275 }
2276 operator uint32_t() volatile
2277 {
2278 return word;
2279 }
2280 pid5_r copy() volatile
2281 {
2282 return *this;
2283 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002284 CONSTEXPR uint32_t get_PID5() const
2285 {
2286 uint32_t value = static_cast<uint32_t>(PID5);
2287 return value;
2288 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002289 uint32_t get_PID5() const volatile
2290 {
2291 uint32_t value = static_cast<uint32_t>(PID5);
2292 return value;
2293 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002294 CONSTEXPR pid5_r &set_PID5(uint32_t value)
2295 {
2296 PID5 = static_cast<uint32_t>(value);
2297 return *this;
2298 }
2299#endif //__cplusplus
2300};
2301
2302// pid6_r - Peripheral ID byte 6 (reserved)
2303struct pid6_r
2304{
2305#ifdef __cplusplus
2306 private:
2307#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002308 union
2309 {
2310 uint32_t PID6; // Byte 6 of Peripheral ID (Lower 8 bits valid)
2311 uint32_t word;
2312 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002313#ifdef __cplusplus
2314 public:
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002315 CONSTEXPR pid6_r() : PID6(static_cast<uint32_t>(0x00)) {}
2316 CONSTEXPR pid6_r(uint32_t init) : word(init) {}
2317 CONSTEXPR void operator=(uint32_t value)
2318 {
2319 word = value;
2320 }
2321 void operator=(uint32_t value) volatile
2322 {
2323 word = value;
2324 }
2325 CONSTEXPR operator uint32_t()
2326 {
2327 return word;
2328 }
2329 operator uint32_t() volatile
2330 {
2331 return word;
2332 }
2333 pid6_r copy() volatile
2334 {
2335 return *this;
2336 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002337 CONSTEXPR uint32_t get_PID6() const
2338 {
2339 uint32_t value = static_cast<uint32_t>(PID6);
2340 return value;
2341 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002342 uint32_t get_PID6() const volatile
2343 {
2344 uint32_t value = static_cast<uint32_t>(PID6);
2345 return value;
2346 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002347 CONSTEXPR pid6_r &set_PID6(uint32_t value)
2348 {
2349 PID6 = static_cast<uint32_t>(value);
2350 return *this;
2351 }
2352#endif //__cplusplus
2353};
2354
2355// pid7_r - Peripheral ID byte 7 (reserved)
2356struct pid7_r
2357{
2358#ifdef __cplusplus
2359 private:
2360#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002361 union
2362 {
2363 uint32_t PID7; // Byte 7 of Peripheral ID (Lower 8 bits valid)
2364 uint32_t word;
2365 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002366#ifdef __cplusplus
2367 public:
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002368 CONSTEXPR pid7_r() : PID7(static_cast<uint32_t>(0x00)) {}
2369 CONSTEXPR pid7_r(uint32_t init) : word(init) {}
2370 CONSTEXPR void operator=(uint32_t value)
2371 {
2372 word = value;
2373 }
2374 void operator=(uint32_t value) volatile
2375 {
2376 word = value;
2377 }
2378 CONSTEXPR operator uint32_t()
2379 {
2380 return word;
2381 }
2382 operator uint32_t() volatile
2383 {
2384 return word;
2385 }
2386 pid7_r copy() volatile
2387 {
2388 return *this;
2389 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002390 CONSTEXPR uint32_t get_PID7() const
2391 {
2392 uint32_t value = static_cast<uint32_t>(PID7);
2393 return value;
2394 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002395 uint32_t get_PID7() const volatile
2396 {
2397 uint32_t value = static_cast<uint32_t>(PID7);
2398 return value;
2399 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002400 CONSTEXPR pid7_r &set_PID7(uint32_t value)
2401 {
2402 PID7 = static_cast<uint32_t>(value);
2403 return *this;
2404 }
2405#endif //__cplusplus
2406};
2407
2408// pid0_r - Peripheral ID byte 0. This is bits[7:0] of the part number.
2409struct pid0_r
2410{
2411#ifdef __cplusplus
2412 private:
2413#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002414 union
2415 {
2416 uint32_t PID0; // Byte 0 of Peripheral ID (Lower 8 bits valid)
2417 uint32_t word;
2418 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002419#ifdef __cplusplus
2420 public:
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002421 CONSTEXPR pid0_r() : PID0(static_cast<uint32_t>(0x80)) {}
2422 CONSTEXPR pid0_r(uint32_t init) : word(init) {}
2423 CONSTEXPR void operator=(uint32_t value)
2424 {
2425 word = value;
2426 }
2427 void operator=(uint32_t value) volatile
2428 {
2429 word = value;
2430 }
2431 CONSTEXPR operator uint32_t()
2432 {
2433 return word;
2434 }
2435 operator uint32_t() volatile
2436 {
2437 return word;
2438 }
2439 pid0_r copy() volatile
2440 {
2441 return *this;
2442 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002443 CONSTEXPR uint32_t get_PID0() const
2444 {
2445 uint32_t value = static_cast<uint32_t>(PID0);
2446 return value;
2447 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002448 uint32_t get_PID0() const volatile
2449 {
2450 uint32_t value = static_cast<uint32_t>(PID0);
2451 return value;
2452 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002453 CONSTEXPR pid0_r &set_PID0(uint32_t value)
2454 {
2455 PID0 = static_cast<uint32_t>(value);
2456 return *this;
2457 }
2458#endif //__cplusplus
2459};
2460
2461// 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
2462// bits[7:4].
2463struct pid1_r
2464{
2465#ifdef __cplusplus
2466 private:
2467#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002468 union
2469 {
2470 uint32_t PID1; // Byte 1 of Peripheral ID (Lower 8 bits valid)
2471 uint32_t word;
2472 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002473#ifdef __cplusplus
2474 public:
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002475 CONSTEXPR pid1_r() : PID1(static_cast<uint32_t>(0xB5)) {}
2476 CONSTEXPR pid1_r(uint32_t init) : word(init) {}
2477 CONSTEXPR void operator=(uint32_t value)
2478 {
2479 word = value;
2480 }
2481 void operator=(uint32_t value) volatile
2482 {
2483 word = value;
2484 }
2485 CONSTEXPR operator uint32_t()
2486 {
2487 return word;
2488 }
2489 operator uint32_t() volatile
2490 {
2491 return word;
2492 }
2493 pid1_r copy() volatile
2494 {
2495 return *this;
2496 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002497 CONSTEXPR uint32_t get_PID1() const
2498 {
2499 uint32_t value = static_cast<uint32_t>(PID1);
2500 return value;
2501 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002502 uint32_t get_PID1() const volatile
2503 {
2504 uint32_t value = static_cast<uint32_t>(PID1);
2505 return value;
2506 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002507 CONSTEXPR pid1_r &set_PID1(uint32_t value)
2508 {
2509 PID1 = static_cast<uint32_t>(value);
2510 return *this;
2511 }
2512#endif //__cplusplus
2513};
2514
2515// 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.
2516struct pid2_r
2517{
2518#ifdef __cplusplus
2519 private:
2520#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002521 union
2522 {
2523 uint32_t PID2; // Byte 2 of Peripheral ID (Lower 8 bits valid)
2524 uint32_t word;
2525 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002526#ifdef __cplusplus
2527 public:
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002528 CONSTEXPR pid2_r() : PID2(static_cast<uint32_t>(0x0B)) {}
2529 CONSTEXPR pid2_r(uint32_t init) : word(init) {}
2530 CONSTEXPR void operator=(uint32_t value)
2531 {
2532 word = value;
2533 }
2534 void operator=(uint32_t value) volatile
2535 {
2536 word = value;
2537 }
2538 CONSTEXPR operator uint32_t()
2539 {
2540 return word;
2541 }
2542 operator uint32_t() volatile
2543 {
2544 return word;
2545 }
2546 pid2_r copy() volatile
2547 {
2548 return *this;
2549 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002550 CONSTEXPR uint32_t get_PID2() const
2551 {
2552 uint32_t value = static_cast<uint32_t>(PID2);
2553 return value;
2554 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002555 uint32_t get_PID2() const volatile
2556 {
2557 uint32_t value = static_cast<uint32_t>(PID2);
2558 return value;
2559 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002560 CONSTEXPR pid2_r &set_PID2(uint32_t value)
2561 {
2562 PID2 = static_cast<uint32_t>(value);
2563 return *this;
2564 }
2565#endif //__cplusplus
2566};
2567
2568// pid3_r - Peripheral ID byte 3.
2569struct pid3_r
2570{
2571#ifdef __cplusplus
2572 private:
2573#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002574 union
2575 {
2576 uint32_t PID3; // Byte 1 of Peripheral ID (Lower 8 bits valid)
2577 uint32_t word;
2578 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002579#ifdef __cplusplus
2580 public:
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002581 CONSTEXPR pid3_r() : PID3(static_cast<uint32_t>(0x0)) {}
2582 CONSTEXPR pid3_r(uint32_t init) : word(init) {}
2583 CONSTEXPR void operator=(uint32_t value)
2584 {
2585 word = value;
2586 }
2587 void operator=(uint32_t value) volatile
2588 {
2589 word = value;
2590 }
2591 CONSTEXPR operator uint32_t()
2592 {
2593 return word;
2594 }
2595 operator uint32_t() volatile
2596 {
2597 return word;
2598 }
2599 pid3_r copy() volatile
2600 {
2601 return *this;
2602 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002603 CONSTEXPR uint32_t get_PID3() const
2604 {
2605 uint32_t value = static_cast<uint32_t>(PID3);
2606 return value;
2607 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002608 uint32_t get_PID3() const volatile
2609 {
2610 uint32_t value = static_cast<uint32_t>(PID3);
2611 return value;
2612 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002613 CONSTEXPR pid3_r &set_PID3(uint32_t value)
2614 {
2615 PID3 = static_cast<uint32_t>(value);
2616 return *this;
2617 }
2618#endif //__cplusplus
2619};
2620
2621// cid0_r - Component ID byte 0.
2622struct cid0_r
2623{
2624#ifdef __cplusplus
2625 private:
2626#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002627 union
2628 {
2629 uint32_t CID0; // Byte 0 of Component ID (Lower 8 bits valid)
2630 uint32_t word;
2631 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002632#ifdef __cplusplus
2633 public:
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002634 CONSTEXPR cid0_r() : CID0(static_cast<uint32_t>(0x0D)) {}
2635 CONSTEXPR cid0_r(uint32_t init) : word(init) {}
2636 CONSTEXPR void operator=(uint32_t value)
2637 {
2638 word = value;
2639 }
2640 void operator=(uint32_t value) volatile
2641 {
2642 word = value;
2643 }
2644 CONSTEXPR operator uint32_t()
2645 {
2646 return word;
2647 }
2648 operator uint32_t() volatile
2649 {
2650 return word;
2651 }
2652 cid0_r copy() volatile
2653 {
2654 return *this;
2655 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002656 CONSTEXPR uint32_t get_CID0() const
2657 {
2658 uint32_t value = static_cast<uint32_t>(CID0);
2659 return value;
2660 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002661 uint32_t get_CID0() const volatile
2662 {
2663 uint32_t value = static_cast<uint32_t>(CID0);
2664 return value;
2665 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002666 CONSTEXPR cid0_r &set_CID0(uint32_t value)
2667 {
2668 CID0 = static_cast<uint32_t>(value);
2669 return *this;
2670 }
2671#endif //__cplusplus
2672};
2673
2674// cid1_r - Component ID byte 1.
2675struct cid1_r
2676{
2677#ifdef __cplusplus
2678 private:
2679#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002680 union
2681 {
2682 uint32_t CID1; // Byte 1 of Component ID (Lower 8 bits valid)
2683 uint32_t word;
2684 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002685#ifdef __cplusplus
2686 public:
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002687 CONSTEXPR cid1_r() : CID1(static_cast<uint32_t>(0xF0)) {}
2688 CONSTEXPR cid1_r(uint32_t init) : word(init) {}
2689 CONSTEXPR void operator=(uint32_t value)
2690 {
2691 word = value;
2692 }
2693 void operator=(uint32_t value) volatile
2694 {
2695 word = value;
2696 }
2697 CONSTEXPR operator uint32_t()
2698 {
2699 return word;
2700 }
2701 operator uint32_t() volatile
2702 {
2703 return word;
2704 }
2705 cid1_r copy() volatile
2706 {
2707 return *this;
2708 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002709 CONSTEXPR uint32_t get_CID1() const
2710 {
2711 uint32_t value = static_cast<uint32_t>(CID1);
2712 return value;
2713 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002714 uint32_t get_CID1() const volatile
2715 {
2716 uint32_t value = static_cast<uint32_t>(CID1);
2717 return value;
2718 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002719 CONSTEXPR cid1_r &set_CID1(uint32_t value)
2720 {
2721 CID1 = static_cast<uint32_t>(value);
2722 return *this;
2723 }
2724#endif //__cplusplus
2725};
2726
2727// cid2_r - Component ID byte 2.
2728struct cid2_r
2729{
2730#ifdef __cplusplus
2731 private:
2732#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002733 union
2734 {
2735 uint32_t CID2; // Byte 2 of Component ID (Lower 8 bits valid)
2736 uint32_t word;
2737 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002738#ifdef __cplusplus
2739 public:
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002740 CONSTEXPR cid2_r() : CID2(static_cast<uint32_t>(0x05)) {}
2741 CONSTEXPR cid2_r(uint32_t init) : word(init) {}
2742 CONSTEXPR void operator=(uint32_t value)
2743 {
2744 word = value;
2745 }
2746 void operator=(uint32_t value) volatile
2747 {
2748 word = value;
2749 }
2750 CONSTEXPR operator uint32_t()
2751 {
2752 return word;
2753 }
2754 operator uint32_t() volatile
2755 {
2756 return word;
2757 }
2758 cid2_r copy() volatile
2759 {
2760 return *this;
2761 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002762 CONSTEXPR uint32_t get_CID2() const
2763 {
2764 uint32_t value = static_cast<uint32_t>(CID2);
2765 return value;
2766 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002767 uint32_t get_CID2() const volatile
2768 {
2769 uint32_t value = static_cast<uint32_t>(CID2);
2770 return value;
2771 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002772 CONSTEXPR cid2_r &set_CID2(uint32_t value)
2773 {
2774 CID2 = static_cast<uint32_t>(value);
2775 return *this;
2776 }
2777#endif //__cplusplus
2778};
2779
2780// cid3_r - Component ID byte 3.
2781struct cid3_r
2782{
2783#ifdef __cplusplus
2784 private:
2785#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002786 union
2787 {
2788 uint32_t CID3; // Byte 3 of Component ID (Lower 8 bits valid)
2789 uint32_t word;
2790 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002791#ifdef __cplusplus
2792 public:
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002793 CONSTEXPR cid3_r() : CID3(static_cast<uint32_t>(0xB1)) {}
2794 CONSTEXPR cid3_r(uint32_t init) : word(init) {}
2795 CONSTEXPR void operator=(uint32_t value)
2796 {
2797 word = value;
2798 }
2799 void operator=(uint32_t value) volatile
2800 {
2801 word = value;
2802 }
2803 CONSTEXPR operator uint32_t()
2804 {
2805 return word;
2806 }
2807 operator uint32_t() volatile
2808 {
2809 return word;
2810 }
2811 cid3_r copy() volatile
2812 {
2813 return *this;
2814 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002815 CONSTEXPR uint32_t get_CID3() const
2816 {
2817 uint32_t value = static_cast<uint32_t>(CID3);
2818 return value;
2819 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002820 uint32_t get_CID3() const volatile
2821 {
2822 uint32_t value = static_cast<uint32_t>(CID3);
2823 return value;
2824 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002825 CONSTEXPR cid3_r &set_CID3(uint32_t value)
2826 {
2827 CID3 = static_cast<uint32_t>(value);
2828 return *this;
2829 }
2830#endif //__cplusplus
2831};
2832
2833// id_r - ID register
2834struct id_r
2835{
2836#ifdef __cplusplus
2837 private:
2838#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002839 union
2840 {
2841 struct
2842 {
Diqing Zhong04118062020-04-15 01:19:12 +02002843 uint32_t version_status : 4; // This is the version of the product
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002844 uint32_t version_minor : 4; // This is the n for the P part of an RnPn release number
2845 uint32_t version_major : 4; // This is the n for the R part of an RnPn release number
Diqing Zhong04118062020-04-15 01:19:12 +02002846 uint32_t product_major : 4; // This is the X part of the ML00X product number
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002847 uint32_t arch_patch_rev : 4; // This is the patch number of the architecture version a.b
2848 uint32_t
2849 arch_minor_rev : 8; // This is the minor architecture version number, b in the architecture version a.b
2850 uint32_t
2851 arch_major_rev : 4; // This is the major architecture version number, a in the architecture version a.b
2852 };
2853 uint32_t word;
2854 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002855#ifdef __cplusplus
2856 public:
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002857 CONSTEXPR id_r() :
Diqing Zhong04118062020-04-15 01:19:12 +02002858 version_status(static_cast<uint32_t>(1)), version_minor(static_cast<uint32_t>(0x0)),
2859 version_major(static_cast<uint32_t>(0x0)), product_major(static_cast<uint32_t>(4)),
Diqing Zhonga9f38d52020-04-27 11:00:13 +02002860 arch_patch_rev(static_cast<uint32_t>(0)), arch_minor_rev(static_cast<uint32_t>(169)),
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002861 arch_major_rev(static_cast<uint32_t>(0))
2862 {
2863 }
2864 CONSTEXPR id_r(uint32_t init) : word(init) {}
2865 CONSTEXPR void operator=(uint32_t value)
2866 {
2867 word = value;
2868 }
2869 void operator=(uint32_t value) volatile
2870 {
2871 word = value;
2872 }
2873 CONSTEXPR operator uint32_t()
2874 {
2875 return word;
2876 }
2877 operator uint32_t() volatile
2878 {
2879 return word;
2880 }
2881 id_r copy() volatile
2882 {
2883 return *this;
2884 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002885 CONSTEXPR uint32_t get_version_status() const
2886 {
2887 uint32_t value = static_cast<uint32_t>(version_status);
2888 return value;
2889 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002890 uint32_t get_version_status() const volatile
2891 {
2892 uint32_t value = static_cast<uint32_t>(version_status);
2893 return value;
2894 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002895 CONSTEXPR id_r &set_version_status(uint32_t value)
2896 {
2897 version_status = ((1u << 4) - 1) & static_cast<uint32_t>(value);
2898 return *this;
2899 }
2900 CONSTEXPR uint32_t get_version_minor() const
2901 {
2902 uint32_t value = static_cast<uint32_t>(version_minor);
2903 return value;
2904 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002905 uint32_t get_version_minor() const volatile
2906 {
2907 uint32_t value = static_cast<uint32_t>(version_minor);
2908 return value;
2909 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002910 CONSTEXPR id_r &set_version_minor(uint32_t value)
2911 {
2912 version_minor = ((1u << 4) - 1) & static_cast<uint32_t>(value);
2913 return *this;
2914 }
2915 CONSTEXPR uint32_t get_version_major() const
2916 {
2917 uint32_t value = static_cast<uint32_t>(version_major);
2918 return value;
2919 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002920 uint32_t get_version_major() const volatile
2921 {
2922 uint32_t value = static_cast<uint32_t>(version_major);
2923 return value;
2924 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002925 CONSTEXPR id_r &set_version_major(uint32_t value)
2926 {
2927 version_major = ((1u << 4) - 1) & static_cast<uint32_t>(value);
2928 return *this;
2929 }
2930 CONSTEXPR uint32_t get_product_major() const
2931 {
2932 uint32_t value = static_cast<uint32_t>(product_major);
2933 return value;
2934 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002935 uint32_t get_product_major() const volatile
2936 {
2937 uint32_t value = static_cast<uint32_t>(product_major);
2938 return value;
2939 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002940 CONSTEXPR id_r &set_product_major(uint32_t value)
2941 {
2942 product_major = ((1u << 4) - 1) & static_cast<uint32_t>(value);
2943 return *this;
2944 }
2945 CONSTEXPR uint32_t get_arch_patch_rev() const
2946 {
2947 uint32_t value = static_cast<uint32_t>(arch_patch_rev);
2948 return value;
2949 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002950 uint32_t get_arch_patch_rev() const volatile
2951 {
2952 uint32_t value = static_cast<uint32_t>(arch_patch_rev);
2953 return value;
2954 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002955 CONSTEXPR id_r &set_arch_patch_rev(uint32_t value)
2956 {
2957 arch_patch_rev = ((1u << 4) - 1) & static_cast<uint32_t>(value);
2958 return *this;
2959 }
2960 CONSTEXPR uint32_t get_arch_minor_rev() const
2961 {
2962 uint32_t value = static_cast<uint32_t>(arch_minor_rev);
2963 return value;
2964 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002965 uint32_t get_arch_minor_rev() const volatile
2966 {
2967 uint32_t value = static_cast<uint32_t>(arch_minor_rev);
2968 return value;
2969 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002970 CONSTEXPR id_r &set_arch_minor_rev(uint32_t value)
2971 {
2972 arch_minor_rev = ((1u << 8) - 1) & static_cast<uint32_t>(value);
2973 return *this;
2974 }
2975 CONSTEXPR uint32_t get_arch_major_rev() const
2976 {
2977 uint32_t value = static_cast<uint32_t>(arch_major_rev);
2978 return value;
2979 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002980 uint32_t get_arch_major_rev() const volatile
2981 {
2982 uint32_t value = static_cast<uint32_t>(arch_major_rev);
2983 return value;
2984 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002985 CONSTEXPR id_r &set_arch_major_rev(uint32_t value)
2986 {
2987 arch_major_rev = ((1u << 4) - 1) & static_cast<uint32_t>(value);
2988 return *this;
2989 }
2990#endif //__cplusplus
2991};
2992
2993// status_r - Register describes the current operating status of the NPU
2994struct status_r
2995{
2996#ifdef __cplusplus
2997 private:
2998#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02002999 union
3000 {
3001 struct
3002 {
3003 uint32_t state : 1; // NPU state, 0 = Stopped, 1 = Running
3004 uint32_t irq_raised : 1; // Raw IRQ status, 0 = IRQ not raised, 1 = IRQ raised. IRQ is cleared using command
3005 // register bit 1
3006 uint32_t
3007 bus_status : 1; // 0=OK, 1=Bus abort detected and processing halted (NPU will reach IDLE state and not
3008 // to start process any more commands/AXI transactions). Can only be cleared by a reset
3009 uint32_t reset_status : 1; // Reset is ongoing and only this register can be read (other registers read as 0
3010 // and writes are ignored.) A value of 0 means NPU is not being reset and can be
3011 // accessed as normal
3012 uint32_t
3013 cmd_parse_error : 1; // 0=No error 1=Command stream parsing error detected. Can only be cleared by reset
3014 uint32_t cmd_end_reached : 1; // 0=Not reached, 1=Reached. Cleared by writing QBASE or QSIZE when NPU is in
3015 // stopped state
3016 uint32_t pmu_irq_raised : 1; // 0=No PMU IRQ, 1=PMU IRQ raised. Cleared by using command register bit 1
3017 uint32_t wd_fault : 1; // Weight decoder state: 0=no fault 1=weight decoder decompression fault. Can only be
3018 // cleared by reset
3019 uint32_t reserved0 : 3;
3020 uint32_t faulting_interface : 1; // Faulting interface on bus abort. 0=AXI-M0 1=AXI-M1
3021 uint32_t faulting_channel : 4; // Faulting channel on a bus abort. Read: 0=Cmd 1=IFM 2=Weights 3=Scale+Bias
3022 // 4=Mem2Mem; Write: 8=OFM 9=Mem2Mem
3023 uint32_t irq_history_mask : 16; // IRQ History mask
3024 };
3025 uint32_t word;
3026 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003027#ifdef __cplusplus
3028 public:
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003029 CONSTEXPR status_r() :
3030 state(static_cast<uint32_t>(::state::STOPPED)), irq_raised(static_cast<uint32_t>(0x0)),
3031 bus_status(static_cast<uint32_t>(0x0)), reset_status(static_cast<uint32_t>(0x1)),
3032 cmd_parse_error(static_cast<uint32_t>(0x0)), cmd_end_reached(static_cast<uint32_t>(0x0)),
3033 pmu_irq_raised(static_cast<uint32_t>(0x0)), wd_fault(static_cast<uint32_t>(0x0)),
3034 reserved0(static_cast<uint32_t>(0)), faulting_interface(static_cast<uint32_t>(0x0)),
3035 faulting_channel(static_cast<uint32_t>(0x0)), irq_history_mask(static_cast<uint32_t>(0x0))
3036 {
3037 }
3038 CONSTEXPR status_r(uint32_t init) : word(init) {}
3039 CONSTEXPR void operator=(uint32_t value)
3040 {
3041 word = value;
3042 }
3043 void operator=(uint32_t value) volatile
3044 {
3045 word = value;
3046 }
3047 CONSTEXPR operator uint32_t()
3048 {
3049 return word;
3050 }
3051 operator uint32_t() volatile
3052 {
3053 return word;
3054 }
3055 status_r copy() volatile
3056 {
3057 return *this;
3058 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003059 CONSTEXPR ::state get_state() const
3060 {
3061 ::state value = static_cast<::state>(state);
3062 return value;
3063 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003064 ::state get_state() const volatile
3065 {
3066 ::state value = static_cast<::state>(state);
3067 return value;
3068 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003069 CONSTEXPR status_r &set_state(::state value)
3070 {
3071 state = ((1u << 1) - 1) & static_cast<uint32_t>(value);
3072 return *this;
3073 }
3074 CONSTEXPR uint32_t get_irq_raised() const
3075 {
3076 uint32_t value = static_cast<uint32_t>(irq_raised);
3077 return value;
3078 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003079 uint32_t get_irq_raised() const volatile
3080 {
3081 uint32_t value = static_cast<uint32_t>(irq_raised);
3082 return value;
3083 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003084 CONSTEXPR status_r &set_irq_raised(uint32_t value)
3085 {
3086 irq_raised = ((1u << 1) - 1) & static_cast<uint32_t>(value);
3087 return *this;
3088 }
3089 CONSTEXPR uint32_t get_bus_status() const
3090 {
3091 uint32_t value = static_cast<uint32_t>(bus_status);
3092 return value;
3093 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003094 uint32_t get_bus_status() const volatile
3095 {
3096 uint32_t value = static_cast<uint32_t>(bus_status);
3097 return value;
3098 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003099 CONSTEXPR status_r &set_bus_status(uint32_t value)
3100 {
3101 bus_status = ((1u << 1) - 1) & static_cast<uint32_t>(value);
3102 return *this;
3103 }
3104 CONSTEXPR uint32_t get_reset_status() const
3105 {
3106 uint32_t value = static_cast<uint32_t>(reset_status);
3107 return value;
3108 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003109 uint32_t get_reset_status() const volatile
3110 {
3111 uint32_t value = static_cast<uint32_t>(reset_status);
3112 return value;
3113 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003114 CONSTEXPR status_r &set_reset_status(uint32_t value)
3115 {
3116 reset_status = ((1u << 1) - 1) & static_cast<uint32_t>(value);
3117 return *this;
3118 }
3119 CONSTEXPR uint32_t get_cmd_parse_error() const
3120 {
3121 uint32_t value = static_cast<uint32_t>(cmd_parse_error);
3122 return value;
3123 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003124 uint32_t get_cmd_parse_error() const volatile
3125 {
3126 uint32_t value = static_cast<uint32_t>(cmd_parse_error);
3127 return value;
3128 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003129 CONSTEXPR status_r &set_cmd_parse_error(uint32_t value)
3130 {
3131 cmd_parse_error = ((1u << 1) - 1) & static_cast<uint32_t>(value);
3132 return *this;
3133 }
3134 CONSTEXPR uint32_t get_cmd_end_reached() const
3135 {
3136 uint32_t value = static_cast<uint32_t>(cmd_end_reached);
3137 return value;
3138 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003139 uint32_t get_cmd_end_reached() const volatile
3140 {
3141 uint32_t value = static_cast<uint32_t>(cmd_end_reached);
3142 return value;
3143 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003144 CONSTEXPR status_r &set_cmd_end_reached(uint32_t value)
3145 {
3146 cmd_end_reached = ((1u << 1) - 1) & static_cast<uint32_t>(value);
3147 return *this;
3148 }
3149 CONSTEXPR uint32_t get_pmu_irq_raised() const
3150 {
3151 uint32_t value = static_cast<uint32_t>(pmu_irq_raised);
3152 return value;
3153 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003154 uint32_t get_pmu_irq_raised() const volatile
3155 {
3156 uint32_t value = static_cast<uint32_t>(pmu_irq_raised);
3157 return value;
3158 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003159 CONSTEXPR status_r &set_pmu_irq_raised(uint32_t value)
3160 {
3161 pmu_irq_raised = ((1u << 1) - 1) & static_cast<uint32_t>(value);
3162 return *this;
3163 }
3164 CONSTEXPR uint32_t get_wd_fault() const
3165 {
3166 uint32_t value = static_cast<uint32_t>(wd_fault);
3167 return value;
3168 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003169 uint32_t get_wd_fault() const volatile
3170 {
3171 uint32_t value = static_cast<uint32_t>(wd_fault);
3172 return value;
3173 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003174 CONSTEXPR status_r &set_wd_fault(uint32_t value)
3175 {
3176 wd_fault = ((1u << 1) - 1) & static_cast<uint32_t>(value);
3177 return *this;
3178 }
3179 CONSTEXPR uint32_t get_faulting_interface() const
3180 {
3181 uint32_t value = static_cast<uint32_t>(faulting_interface);
3182 return value;
3183 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003184 uint32_t get_faulting_interface() const volatile
3185 {
3186 uint32_t value = static_cast<uint32_t>(faulting_interface);
3187 return value;
3188 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003189 CONSTEXPR status_r &set_faulting_interface(uint32_t value)
3190 {
3191 faulting_interface = ((1u << 1) - 1) & static_cast<uint32_t>(value);
3192 return *this;
3193 }
3194 CONSTEXPR uint32_t get_faulting_channel() const
3195 {
3196 uint32_t value = static_cast<uint32_t>(faulting_channel);
3197 return value;
3198 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003199 uint32_t get_faulting_channel() const volatile
3200 {
3201 uint32_t value = static_cast<uint32_t>(faulting_channel);
3202 return value;
3203 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003204 CONSTEXPR status_r &set_faulting_channel(uint32_t value)
3205 {
3206 faulting_channel = ((1u << 4) - 1) & static_cast<uint32_t>(value);
3207 return *this;
3208 }
3209 CONSTEXPR uint32_t get_irq_history_mask() const
3210 {
3211 uint32_t value = static_cast<uint32_t>(irq_history_mask);
3212 return value;
3213 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003214 uint32_t get_irq_history_mask() const volatile
3215 {
3216 uint32_t value = static_cast<uint32_t>(irq_history_mask);
3217 return value;
3218 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003219 CONSTEXPR status_r &set_irq_history_mask(uint32_t value)
3220 {
3221 irq_history_mask = ((1u << 16) - 1) & static_cast<uint32_t>(value);
3222 return *this;
3223 }
3224#endif //__cplusplus
3225};
3226
3227// cmd_r - Command register, reads as last written command
3228struct cmd_r
3229{
3230#ifdef __cplusplus
3231 private:
3232#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003233 union
3234 {
3235 struct
3236 {
3237 uint32_t transition_to_running_state : 1; // Write 1 to transition the NPU to running state. Writing 0 has
3238 // no effect
3239 uint32_t clear_irq : 1; // Write 1 to clear the IRQ status in the STATUS register. Writing 0 has no effect
3240 uint32_t clock_q_enable : 1; // Write 1 to this bit to enable clock off using clock q-interface and enable
3241 // the master clock gate
3242 uint32_t power_q_enable : 1; // Write 1 to this bit to enable power off using power q-interface
3243 uint32_t
3244 stop_request : 1; // Write 1 to this bit to request STOP after completing any already-started commands
3245 uint32_t reserved0 : 11;
3246 uint32_t clear_irq_history : 16; // Clears the IRQ history mask
3247 };
3248 uint32_t word;
3249 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003250#ifdef __cplusplus
3251 public:
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003252 CONSTEXPR cmd_r() :
3253 transition_to_running_state(static_cast<uint32_t>(0x0)), clear_irq(static_cast<uint32_t>(0x0)),
3254 clock_q_enable(static_cast<uint32_t>(0x0)), power_q_enable(static_cast<uint32_t>(0x0)),
3255 stop_request(static_cast<uint32_t>(0x0)), reserved0(static_cast<uint32_t>(0)),
3256 clear_irq_history(static_cast<uint32_t>(0x0))
3257 {
3258 }
3259 CONSTEXPR cmd_r(uint32_t init) : word(init) {}
3260 CONSTEXPR void operator=(uint32_t value)
3261 {
3262 word = value;
3263 }
3264 void operator=(uint32_t value) volatile
3265 {
3266 word = value;
3267 }
3268 CONSTEXPR operator uint32_t()
3269 {
3270 return word;
3271 }
3272 operator uint32_t() volatile
3273 {
3274 return word;
3275 }
3276 cmd_r copy() volatile
3277 {
3278 return *this;
3279 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003280 CONSTEXPR uint32_t get_transition_to_running_state() const
3281 {
3282 uint32_t value = static_cast<uint32_t>(transition_to_running_state);
3283 return value;
3284 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003285 uint32_t get_transition_to_running_state() const volatile
3286 {
3287 uint32_t value = static_cast<uint32_t>(transition_to_running_state);
3288 return value;
3289 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003290 CONSTEXPR cmd_r &set_transition_to_running_state(uint32_t value)
3291 {
3292 transition_to_running_state = ((1u << 1) - 1) & static_cast<uint32_t>(value);
3293 return *this;
3294 }
3295 CONSTEXPR uint32_t get_clear_irq() const
3296 {
3297 uint32_t value = static_cast<uint32_t>(clear_irq);
3298 return value;
3299 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003300 uint32_t get_clear_irq() const volatile
3301 {
3302 uint32_t value = static_cast<uint32_t>(clear_irq);
3303 return value;
3304 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003305 CONSTEXPR cmd_r &set_clear_irq(uint32_t value)
3306 {
3307 clear_irq = ((1u << 1) - 1) & static_cast<uint32_t>(value);
3308 return *this;
3309 }
3310 CONSTEXPR uint32_t get_clock_q_enable() const
3311 {
3312 uint32_t value = static_cast<uint32_t>(clock_q_enable);
3313 return value;
3314 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003315 uint32_t get_clock_q_enable() const volatile
3316 {
3317 uint32_t value = static_cast<uint32_t>(clock_q_enable);
3318 return value;
3319 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003320 CONSTEXPR cmd_r &set_clock_q_enable(uint32_t value)
3321 {
3322 clock_q_enable = ((1u << 1) - 1) & static_cast<uint32_t>(value);
3323 return *this;
3324 }
3325 CONSTEXPR uint32_t get_power_q_enable() const
3326 {
3327 uint32_t value = static_cast<uint32_t>(power_q_enable);
3328 return value;
3329 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003330 uint32_t get_power_q_enable() const volatile
3331 {
3332 uint32_t value = static_cast<uint32_t>(power_q_enable);
3333 return value;
3334 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003335 CONSTEXPR cmd_r &set_power_q_enable(uint32_t value)
3336 {
3337 power_q_enable = ((1u << 1) - 1) & static_cast<uint32_t>(value);
3338 return *this;
3339 }
3340 CONSTEXPR uint32_t get_stop_request() const
3341 {
3342 uint32_t value = static_cast<uint32_t>(stop_request);
3343 return value;
3344 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003345 uint32_t get_stop_request() const volatile
3346 {
3347 uint32_t value = static_cast<uint32_t>(stop_request);
3348 return value;
3349 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003350 CONSTEXPR cmd_r &set_stop_request(uint32_t value)
3351 {
3352 stop_request = ((1u << 1) - 1) & static_cast<uint32_t>(value);
3353 return *this;
3354 }
3355 CONSTEXPR uint32_t get_clear_irq_history() const
3356 {
3357 uint32_t value = static_cast<uint32_t>(clear_irq_history);
3358 return value;
3359 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003360 uint32_t get_clear_irq_history() const volatile
3361 {
3362 uint32_t value = static_cast<uint32_t>(clear_irq_history);
3363 return value;
3364 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003365 CONSTEXPR cmd_r &set_clear_irq_history(uint32_t value)
3366 {
3367 clear_irq_history = ((1u << 16) - 1) & static_cast<uint32_t>(value);
3368 return *this;
3369 }
3370#endif //__cplusplus
3371};
3372
3373// reset_r - Request Reset and new security mode
3374struct reset_r
3375{
3376#ifdef __cplusplus
3377 private:
3378#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003379 union
3380 {
3381 struct
3382 {
3383 uint32_t pending_CPL : 1; // Current privilege level 0=User 1=Privileged
3384 uint32_t pending_CSL : 1; // Current security level 0=Secure 1=Non secure
3385 uint32_t reserved0 : 30;
3386 };
3387 uint32_t word;
3388 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003389#ifdef __cplusplus
3390 public:
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003391 CONSTEXPR reset_r() :
3392 pending_CPL(static_cast<uint32_t>(::privilege_level::USER)),
3393 pending_CSL(static_cast<uint32_t>(::security_level::SECURE)), reserved0(static_cast<uint32_t>(0))
3394 {
3395 }
3396 CONSTEXPR reset_r(uint32_t init) : word(init) {}
3397 CONSTEXPR void operator=(uint32_t value)
3398 {
3399 word = value;
3400 }
3401 void operator=(uint32_t value) volatile
3402 {
3403 word = value;
3404 }
3405 CONSTEXPR operator uint32_t()
3406 {
3407 return word;
3408 }
3409 operator uint32_t() volatile
3410 {
3411 return word;
3412 }
3413 reset_r copy() volatile
3414 {
3415 return *this;
3416 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003417 CONSTEXPR ::privilege_level get_pending_CPL() const
3418 {
3419 ::privilege_level value = static_cast<::privilege_level>(pending_CPL);
3420 return value;
3421 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003422 ::privilege_level get_pending_CPL() const volatile
3423 {
3424 ::privilege_level value = static_cast<::privilege_level>(pending_CPL);
3425 return value;
3426 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003427 CONSTEXPR reset_r &set_pending_CPL(::privilege_level value)
3428 {
3429 pending_CPL = ((1u << 1) - 1) & static_cast<uint32_t>(value);
3430 return *this;
3431 }
3432 CONSTEXPR ::security_level get_pending_CSL() const
3433 {
3434 ::security_level value = static_cast<::security_level>(pending_CSL);
3435 return value;
3436 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003437 ::security_level get_pending_CSL() const volatile
3438 {
3439 ::security_level value = static_cast<::security_level>(pending_CSL);
3440 return value;
3441 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003442 CONSTEXPR reset_r &set_pending_CSL(::security_level value)
3443 {
3444 pending_CSL = ((1u << 1) - 1) & static_cast<uint32_t>(value);
3445 return *this;
3446 }
3447#endif //__cplusplus
3448};
3449
3450// qbase0_r - Base address of command queue bits [31:0]. The address is 4 byte aligned
3451struct qbase0_r
3452{
3453#ifdef __cplusplus
3454 private:
3455#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003456 union
3457 {
3458 uint32_t QBASE0; // The 4 byte aligned lower bytes of the base address value for the command stream
3459 uint32_t word;
3460 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003461#ifdef __cplusplus
3462 public:
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003463 CONSTEXPR qbase0_r() : QBASE0(static_cast<uint32_t>(0x00000000)) {}
3464 CONSTEXPR qbase0_r(uint32_t init) : word(init) {}
3465 CONSTEXPR void operator=(uint32_t value)
3466 {
3467 word = value;
3468 }
3469 void operator=(uint32_t value) volatile
3470 {
3471 word = value;
3472 }
3473 CONSTEXPR operator uint32_t()
3474 {
3475 return word;
3476 }
3477 operator uint32_t() volatile
3478 {
3479 return word;
3480 }
3481 qbase0_r copy() volatile
3482 {
3483 return *this;
3484 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003485 CONSTEXPR uint32_t get_QBASE0() const
3486 {
3487 uint32_t value = static_cast<uint32_t>(QBASE0);
3488 return value;
3489 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003490 uint32_t get_QBASE0() const volatile
3491 {
3492 uint32_t value = static_cast<uint32_t>(QBASE0);
3493 return value;
3494 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003495 CONSTEXPR qbase0_r &set_QBASE0(uint32_t value)
3496 {
3497 QBASE0 = static_cast<uint32_t>(value);
3498 return *this;
3499 }
3500#endif //__cplusplus
3501};
3502
3503// qbase1_r - Address extension bits [47:32] bits for queue base
3504struct qbase1_r
3505{
3506#ifdef __cplusplus
3507 private:
3508#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003509 union
3510 {
3511 uint32_t QBASE1; // The 4 byte aligned upper bytes of the base address value for the command stream
3512 uint32_t word;
3513 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003514#ifdef __cplusplus
3515 public:
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003516 CONSTEXPR qbase1_r() : QBASE1(static_cast<uint32_t>(0x00000000)) {}
3517 CONSTEXPR qbase1_r(uint32_t init) : word(init) {}
3518 CONSTEXPR void operator=(uint32_t value)
3519 {
3520 word = value;
3521 }
3522 void operator=(uint32_t value) volatile
3523 {
3524 word = value;
3525 }
3526 CONSTEXPR operator uint32_t()
3527 {
3528 return word;
3529 }
3530 operator uint32_t() volatile
3531 {
3532 return word;
3533 }
3534 qbase1_r copy() volatile
3535 {
3536 return *this;
3537 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003538 CONSTEXPR uint32_t get_QBASE1() const
3539 {
3540 uint32_t value = static_cast<uint32_t>(QBASE1);
3541 return value;
3542 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003543 uint32_t get_QBASE1() const volatile
3544 {
3545 uint32_t value = static_cast<uint32_t>(QBASE1);
3546 return value;
3547 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003548 CONSTEXPR qbase1_r &set_QBASE1(uint32_t value)
3549 {
3550 QBASE1 = static_cast<uint32_t>(value);
3551 return *this;
3552 }
3553#endif //__cplusplus
3554};
3555
3556// qread_r - Read offset in the command stream in bytes. Multiple of 4 in the range 0 to 16 MB
3557struct qread_r
3558{
3559#ifdef __cplusplus
3560 private:
3561#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003562 union
3563 {
3564 uint32_t QREAD; // The read offset of the current command under execution
3565 uint32_t word;
3566 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003567#ifdef __cplusplus
3568 public:
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003569 CONSTEXPR qread_r() : QREAD(static_cast<uint32_t>(0x00000000)) {}
3570 CONSTEXPR qread_r(uint32_t init) : word(init) {}
3571 CONSTEXPR void operator=(uint32_t value)
3572 {
3573 word = value;
3574 }
3575 void operator=(uint32_t value) volatile
3576 {
3577 word = value;
3578 }
3579 CONSTEXPR operator uint32_t()
3580 {
3581 return word;
3582 }
3583 operator uint32_t() volatile
3584 {
3585 return word;
3586 }
3587 qread_r copy() volatile
3588 {
3589 return *this;
3590 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003591 CONSTEXPR uint32_t get_QREAD() const
3592 {
3593 uint32_t value = static_cast<uint32_t>(QREAD);
3594 return value;
3595 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003596 uint32_t get_QREAD() const volatile
3597 {
3598 uint32_t value = static_cast<uint32_t>(QREAD);
3599 return value;
3600 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003601 CONSTEXPR qread_r &set_QREAD(uint32_t value)
3602 {
3603 QREAD = static_cast<uint32_t>(value);
3604 return *this;
3605 }
3606#endif //__cplusplus
3607};
3608
3609// qconfig_r - AXI configuration for the command stream in the range 0-3. Same encoding as for REGIONCFG
3610struct qconfig_r
3611{
3612#ifdef __cplusplus
3613 private:
3614#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003615 union
3616 {
3617 uint32_t QCONFIG; // AXI configuration for the command stream in the range 0-3
3618 uint32_t word;
3619 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003620#ifdef __cplusplus
3621 public:
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003622 CONSTEXPR qconfig_r() : QCONFIG(static_cast<uint32_t>(0x00000000)) {}
3623 CONSTEXPR qconfig_r(uint32_t init) : word(init) {}
3624 CONSTEXPR void operator=(uint32_t value)
3625 {
3626 word = value;
3627 }
3628 void operator=(uint32_t value) volatile
3629 {
3630 word = value;
3631 }
3632 CONSTEXPR operator uint32_t()
3633 {
3634 return word;
3635 }
3636 operator uint32_t() volatile
3637 {
3638 return word;
3639 }
3640 qconfig_r copy() volatile
3641 {
3642 return *this;
3643 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003644 CONSTEXPR uint32_t get_QCONFIG() const
3645 {
3646 uint32_t value = static_cast<uint32_t>(QCONFIG);
3647 return value;
3648 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003649 uint32_t get_QCONFIG() const volatile
3650 {
3651 uint32_t value = static_cast<uint32_t>(QCONFIG);
3652 return value;
3653 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003654 CONSTEXPR qconfig_r &set_QCONFIG(uint32_t value)
3655 {
3656 QCONFIG = static_cast<uint32_t>(value);
3657 return *this;
3658 }
3659#endif //__cplusplus
3660};
3661
3662// qsize_r - Size of the command stream in bytes. Multiple of 4 in the range 0 to 16 MB
3663struct qsize_r
3664{
3665#ifdef __cplusplus
3666 private:
3667#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003668 union
3669 {
3670 uint32_t QSIZE; // Size of the next command stream to be executed by the NPU
3671 uint32_t word;
3672 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003673#ifdef __cplusplus
3674 public:
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003675 CONSTEXPR qsize_r() : QSIZE(static_cast<uint32_t>(0x00000000)) {}
3676 CONSTEXPR qsize_r(uint32_t init) : word(init) {}
3677 CONSTEXPR void operator=(uint32_t value)
3678 {
3679 word = value;
3680 }
3681 void operator=(uint32_t value) volatile
3682 {
3683 word = value;
3684 }
3685 CONSTEXPR operator uint32_t()
3686 {
3687 return word;
3688 }
3689 operator uint32_t() volatile
3690 {
3691 return word;
3692 }
3693 qsize_r copy() volatile
3694 {
3695 return *this;
3696 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003697 CONSTEXPR uint32_t get_QSIZE() const
3698 {
3699 uint32_t value = static_cast<uint32_t>(QSIZE);
3700 return value;
3701 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003702 uint32_t get_QSIZE() const volatile
3703 {
3704 uint32_t value = static_cast<uint32_t>(QSIZE);
3705 return value;
3706 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003707 CONSTEXPR qsize_r &set_QSIZE(uint32_t value)
3708 {
3709 QSIZE = static_cast<uint32_t>(value);
3710 return *this;
3711 }
3712#endif //__cplusplus
3713};
3714
3715// prot_r - Protection level configured for the NPU when acting as an AXI master
3716struct prot_r
3717{
3718#ifdef __cplusplus
3719 private:
3720#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003721 union
3722 {
3723 struct
3724 {
3725 uint32_t active_CPL : 1; // Current privilege level 0=User 1=Privileged
3726 uint32_t active_CSL : 1; // Current security level 0=Secure 1=Non secure
3727 uint32_t reserved0 : 30;
3728 };
3729 uint32_t word;
3730 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003731#ifdef __cplusplus
3732 public:
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003733 CONSTEXPR prot_r() :
3734 active_CPL(static_cast<uint32_t>(::privilege_level::USER)),
3735 active_CSL(static_cast<uint32_t>(::security_level::SECURE)), reserved0(static_cast<uint32_t>(0))
3736 {
3737 }
3738 CONSTEXPR prot_r(uint32_t init) : word(init) {}
3739 CONSTEXPR void operator=(uint32_t value)
3740 {
3741 word = value;
3742 }
3743 void operator=(uint32_t value) volatile
3744 {
3745 word = value;
3746 }
3747 CONSTEXPR operator uint32_t()
3748 {
3749 return word;
3750 }
3751 operator uint32_t() volatile
3752 {
3753 return word;
3754 }
3755 prot_r copy() volatile
3756 {
3757 return *this;
3758 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003759 CONSTEXPR ::privilege_level get_active_CPL() const
3760 {
3761 ::privilege_level value = static_cast<::privilege_level>(active_CPL);
3762 return value;
3763 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003764 ::privilege_level get_active_CPL() const volatile
3765 {
3766 ::privilege_level value = static_cast<::privilege_level>(active_CPL);
3767 return value;
3768 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003769 CONSTEXPR prot_r &set_active_CPL(::privilege_level value)
3770 {
3771 active_CPL = ((1u << 1) - 1) & static_cast<uint32_t>(value);
3772 return *this;
3773 }
3774 CONSTEXPR ::security_level get_active_CSL() const
3775 {
3776 ::security_level value = static_cast<::security_level>(active_CSL);
3777 return value;
3778 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003779 ::security_level get_active_CSL() const volatile
3780 {
3781 ::security_level value = static_cast<::security_level>(active_CSL);
3782 return value;
3783 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003784 CONSTEXPR prot_r &set_active_CSL(::security_level value)
3785 {
3786 active_CSL = ((1u << 1) - 1) & static_cast<uint32_t>(value);
3787 return *this;
3788 }
3789#endif //__cplusplus
3790};
3791
3792// config_r - RTL configuration
3793struct config_r
3794{
3795#ifdef __cplusplus
3796 private:
3797#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003798 union
3799 {
3800 struct
3801 {
3802 uint32_t macs_per_cc : 4; // The log2(macs/clock cycle). Valid encoding range is 5 to 8 for 32 to 256
3803 // MACs/clock cycle.
3804 uint32_t cmd_stream_version : 4; // command stream version accepted by this NPU. Set to 0 for Ethos-U55 EAC.
3805 uint32_t shram_size : 8; // Size in KB of SHRAM in the range 8 to 48.
3806 uint32_t reserved0 : 12;
3807 uint32_t product : 4; // Product configuration
3808 };
3809 uint32_t word;
3810 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003811#ifdef __cplusplus
3812 public:
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003813 CONSTEXPR config_r() :
Diqing Zhong04118062020-04-15 01:19:12 +02003814 macs_per_cc(static_cast<uint32_t>(0)), cmd_stream_version(static_cast<uint32_t>(0x0)),
3815 shram_size(static_cast<uint32_t>(0)), reserved0(static_cast<uint32_t>(0)), product(static_cast<uint32_t>(0))
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003816 {
3817 }
3818 CONSTEXPR config_r(uint32_t init) : word(init) {}
3819 CONSTEXPR void operator=(uint32_t value)
3820 {
3821 word = value;
3822 }
3823 void operator=(uint32_t value) volatile
3824 {
3825 word = value;
3826 }
3827 CONSTEXPR operator uint32_t()
3828 {
3829 return word;
3830 }
3831 operator uint32_t() volatile
3832 {
3833 return word;
3834 }
3835 config_r copy() volatile
3836 {
3837 return *this;
3838 }
Diqing Zhong04118062020-04-15 01:19:12 +02003839 CONSTEXPR ::macs_per_cc get_macs_per_cc() const
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003840 {
Diqing Zhong04118062020-04-15 01:19:12 +02003841 ::macs_per_cc value = static_cast<::macs_per_cc>(macs_per_cc);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003842 return value;
3843 }
Diqing Zhong04118062020-04-15 01:19:12 +02003844 ::macs_per_cc get_macs_per_cc() const volatile
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003845 {
Diqing Zhong04118062020-04-15 01:19:12 +02003846 ::macs_per_cc value = static_cast<::macs_per_cc>(macs_per_cc);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003847 return value;
3848 }
Diqing Zhong04118062020-04-15 01:19:12 +02003849 CONSTEXPR config_r &set_macs_per_cc(::macs_per_cc value)
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003850 {
3851 macs_per_cc = ((1u << 4) - 1) & static_cast<uint32_t>(value);
3852 return *this;
3853 }
3854 CONSTEXPR uint32_t get_cmd_stream_version() const
3855 {
3856 uint32_t value = static_cast<uint32_t>(cmd_stream_version);
3857 return value;
3858 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003859 uint32_t get_cmd_stream_version() const volatile
3860 {
3861 uint32_t value = static_cast<uint32_t>(cmd_stream_version);
3862 return value;
3863 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003864 CONSTEXPR config_r &set_cmd_stream_version(uint32_t value)
3865 {
3866 cmd_stream_version = ((1u << 4) - 1) & static_cast<uint32_t>(value);
3867 return *this;
3868 }
Diqing Zhong04118062020-04-15 01:19:12 +02003869 CONSTEXPR ::shram_size get_shram_size() const
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003870 {
Diqing Zhong04118062020-04-15 01:19:12 +02003871 ::shram_size value = static_cast<::shram_size>(shram_size);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003872 return value;
3873 }
Diqing Zhong04118062020-04-15 01:19:12 +02003874 ::shram_size get_shram_size() const volatile
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003875 {
Diqing Zhong04118062020-04-15 01:19:12 +02003876 ::shram_size value = static_cast<::shram_size>(shram_size);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003877 return value;
3878 }
Diqing Zhong04118062020-04-15 01:19:12 +02003879 CONSTEXPR config_r &set_shram_size(::shram_size value)
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003880 {
3881 shram_size = ((1u << 8) - 1) & static_cast<uint32_t>(value);
3882 return *this;
3883 }
Diqing Zhong04118062020-04-15 01:19:12 +02003884 CONSTEXPR uint32_t get_product() const
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003885 {
Diqing Zhong04118062020-04-15 01:19:12 +02003886 uint32_t value = static_cast<uint32_t>(product);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003887 return value;
3888 }
Diqing Zhong04118062020-04-15 01:19:12 +02003889 uint32_t get_product() const volatile
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003890 {
Diqing Zhong04118062020-04-15 01:19:12 +02003891 uint32_t value = static_cast<uint32_t>(product);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003892 return value;
3893 }
Diqing Zhong04118062020-04-15 01:19:12 +02003894 CONSTEXPR config_r &set_product(uint32_t value)
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003895 {
3896 product = ((1u << 4) - 1) & static_cast<uint32_t>(value);
3897 return *this;
3898 }
3899#endif //__cplusplus
3900};
3901
3902// lock_r - Lock register. This register is designed for driver use and does not affect NPU functionality
3903struct lock_r
3904{
3905#ifdef __cplusplus
3906 private:
3907#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003908 union
3909 {
3910 uint32_t LOCK; // 32 bit value for LOCK configuration
3911 uint32_t word;
3912 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003913#ifdef __cplusplus
3914 public:
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003915 CONSTEXPR lock_r() : LOCK(static_cast<uint32_t>(0x00000000)) {}
3916 CONSTEXPR lock_r(uint32_t init) : word(init) {}
3917 CONSTEXPR void operator=(uint32_t value)
3918 {
3919 word = value;
3920 }
3921 void operator=(uint32_t value) volatile
3922 {
3923 word = value;
3924 }
3925 CONSTEXPR operator uint32_t()
3926 {
3927 return word;
3928 }
3929 operator uint32_t() volatile
3930 {
3931 return word;
3932 }
3933 lock_r copy() volatile
3934 {
3935 return *this;
3936 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003937 CONSTEXPR uint32_t get_LOCK() const
3938 {
3939 uint32_t value = static_cast<uint32_t>(LOCK);
3940 return value;
3941 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003942 uint32_t get_LOCK() const volatile
3943 {
3944 uint32_t value = static_cast<uint32_t>(LOCK);
3945 return value;
3946 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003947 CONSTEXPR lock_r &set_LOCK(uint32_t value)
3948 {
3949 LOCK = static_cast<uint32_t>(value);
3950 return *this;
3951 }
3952#endif //__cplusplus
3953};
3954
3955// regioncfg_r - Base pointer configuration. Bits[2*k+1:2*k] give the memory type for REGION[k]
3956struct regioncfg_r
3957{
3958#ifdef __cplusplus
3959 private:
3960#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003961 union
3962 {
3963 struct
3964 {
3965 uint32_t region0 : 2; // Bits for Region0 Configurion
3966 uint32_t region1 : 2; // Bits for Region1 Configurion
3967 uint32_t region2 : 2; // Bits for Region2 Configurion
3968 uint32_t region3 : 2; // Bits for Region3 Configurion
3969 uint32_t region4 : 2; // Bits for Region4 Configurion
3970 uint32_t region5 : 2; // Bits for Region5 Configurion
3971 uint32_t region6 : 2; // Bits for Region6 Configurion
3972 uint32_t region7 : 2; // Bits for Region7 Configurion
3973 uint32_t reserved0 : 16;
3974 };
3975 uint32_t word;
3976 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003977#ifdef __cplusplus
3978 public:
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003979 CONSTEXPR regioncfg_r() :
3980 region0(static_cast<uint32_t>(::memory_type::AXI0_OUTSTANDING_COUNTER0)),
3981 region1(static_cast<uint32_t>(::memory_type::AXI0_OUTSTANDING_COUNTER0)),
3982 region2(static_cast<uint32_t>(::memory_type::AXI0_OUTSTANDING_COUNTER0)),
3983 region3(static_cast<uint32_t>(::memory_type::AXI0_OUTSTANDING_COUNTER0)),
3984 region4(static_cast<uint32_t>(::memory_type::AXI0_OUTSTANDING_COUNTER0)),
3985 region5(static_cast<uint32_t>(::memory_type::AXI0_OUTSTANDING_COUNTER0)),
3986 region6(static_cast<uint32_t>(::memory_type::AXI0_OUTSTANDING_COUNTER0)),
3987 region7(static_cast<uint32_t>(::memory_type::AXI0_OUTSTANDING_COUNTER0)), reserved0(static_cast<uint32_t>(0))
3988 {
3989 }
3990 CONSTEXPR regioncfg_r(uint32_t init) : word(init) {}
3991 CONSTEXPR void operator=(uint32_t value)
3992 {
3993 word = value;
3994 }
3995 void operator=(uint32_t value) volatile
3996 {
3997 word = value;
3998 }
3999 CONSTEXPR operator uint32_t()
4000 {
4001 return word;
4002 }
4003 operator uint32_t() volatile
4004 {
4005 return word;
4006 }
4007 regioncfg_r copy() volatile
4008 {
4009 return *this;
4010 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004011 CONSTEXPR ::memory_type get_region0() const
4012 {
4013 ::memory_type value = static_cast<::memory_type>(region0);
4014 return value;
4015 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004016 ::memory_type get_region0() const volatile
4017 {
4018 ::memory_type value = static_cast<::memory_type>(region0);
4019 return value;
4020 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004021 CONSTEXPR regioncfg_r &set_region0(::memory_type value)
4022 {
4023 region0 = ((1u << 2) - 1) & static_cast<uint32_t>(value);
4024 return *this;
4025 }
4026 CONSTEXPR ::memory_type get_region1() const
4027 {
4028 ::memory_type value = static_cast<::memory_type>(region1);
4029 return value;
4030 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004031 ::memory_type get_region1() const volatile
4032 {
4033 ::memory_type value = static_cast<::memory_type>(region1);
4034 return value;
4035 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004036 CONSTEXPR regioncfg_r &set_region1(::memory_type value)
4037 {
4038 region1 = ((1u << 2) - 1) & static_cast<uint32_t>(value);
4039 return *this;
4040 }
4041 CONSTEXPR ::memory_type get_region2() const
4042 {
4043 ::memory_type value = static_cast<::memory_type>(region2);
4044 return value;
4045 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004046 ::memory_type get_region2() const volatile
4047 {
4048 ::memory_type value = static_cast<::memory_type>(region2);
4049 return value;
4050 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004051 CONSTEXPR regioncfg_r &set_region2(::memory_type value)
4052 {
4053 region2 = ((1u << 2) - 1) & static_cast<uint32_t>(value);
4054 return *this;
4055 }
4056 CONSTEXPR ::memory_type get_region3() const
4057 {
4058 ::memory_type value = static_cast<::memory_type>(region3);
4059 return value;
4060 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004061 ::memory_type get_region3() const volatile
4062 {
4063 ::memory_type value = static_cast<::memory_type>(region3);
4064 return value;
4065 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004066 CONSTEXPR regioncfg_r &set_region3(::memory_type value)
4067 {
4068 region3 = ((1u << 2) - 1) & static_cast<uint32_t>(value);
4069 return *this;
4070 }
4071 CONSTEXPR ::memory_type get_region4() const
4072 {
4073 ::memory_type value = static_cast<::memory_type>(region4);
4074 return value;
4075 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004076 ::memory_type get_region4() const volatile
4077 {
4078 ::memory_type value = static_cast<::memory_type>(region4);
4079 return value;
4080 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004081 CONSTEXPR regioncfg_r &set_region4(::memory_type value)
4082 {
4083 region4 = ((1u << 2) - 1) & static_cast<uint32_t>(value);
4084 return *this;
4085 }
4086 CONSTEXPR ::memory_type get_region5() const
4087 {
4088 ::memory_type value = static_cast<::memory_type>(region5);
4089 return value;
4090 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004091 ::memory_type get_region5() const volatile
4092 {
4093 ::memory_type value = static_cast<::memory_type>(region5);
4094 return value;
4095 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004096 CONSTEXPR regioncfg_r &set_region5(::memory_type value)
4097 {
4098 region5 = ((1u << 2) - 1) & static_cast<uint32_t>(value);
4099 return *this;
4100 }
4101 CONSTEXPR ::memory_type get_region6() const
4102 {
4103 ::memory_type value = static_cast<::memory_type>(region6);
4104 return value;
4105 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004106 ::memory_type get_region6() const volatile
4107 {
4108 ::memory_type value = static_cast<::memory_type>(region6);
4109 return value;
4110 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004111 CONSTEXPR regioncfg_r &set_region6(::memory_type value)
4112 {
4113 region6 = ((1u << 2) - 1) & static_cast<uint32_t>(value);
4114 return *this;
4115 }
4116 CONSTEXPR ::memory_type get_region7() const
4117 {
4118 ::memory_type value = static_cast<::memory_type>(region7);
4119 return value;
4120 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004121 ::memory_type get_region7() const volatile
4122 {
4123 ::memory_type value = static_cast<::memory_type>(region7);
4124 return value;
4125 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004126 CONSTEXPR regioncfg_r &set_region7(::memory_type value)
4127 {
4128 region7 = ((1u << 2) - 1) & static_cast<uint32_t>(value);
4129 return *this;
4130 }
4131#endif //__cplusplus
4132};
4133
4134// axi_limit0_r - AXI limits for port 0 counter 0
4135struct axi_limit0_r
4136{
4137#ifdef __cplusplus
4138 private:
4139#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004140 union
4141 {
4142 struct
4143 {
4144 uint32_t max_beats : 2; // Burst split alignment: 0=64 bytes, 1=128 bytes, 2=256 bytes, 3=reserved
4145 uint32_t reserved0 : 2;
4146 uint32_t memtype : 4; // Memtype
4147 uint32_t reserved1 : 8;
4148 uint32_t
4149 max_outstanding_read_m1 : 8; // Maximum number of outstanding AXI read transactions - 1 in range 0 to 31
4150 uint32_t max_outstanding_write_m1 : 8; // Maximum number of outstanding AXI write transactions - 1 in range
4151 // 0 to 15
4152 };
4153 uint32_t word;
4154 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004155#ifdef __cplusplus
4156 public:
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004157 CONSTEXPR axi_limit0_r() :
Diqing Zhong04118062020-04-15 01:19:12 +02004158 max_beats(static_cast<uint32_t>(0x0)), reserved0(static_cast<uint32_t>(0)), memtype(static_cast<uint32_t>(0)),
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004159 reserved1(static_cast<uint32_t>(0)), max_outstanding_read_m1(static_cast<uint32_t>(0x00)),
4160 max_outstanding_write_m1(static_cast<uint32_t>(0x000000))
4161 {
4162 }
4163 CONSTEXPR axi_limit0_r(uint32_t init) : word(init) {}
4164 CONSTEXPR void operator=(uint32_t value)
4165 {
4166 word = value;
4167 }
4168 void operator=(uint32_t value) volatile
4169 {
4170 word = value;
4171 }
4172 CONSTEXPR operator uint32_t()
4173 {
4174 return word;
4175 }
4176 operator uint32_t() volatile
4177 {
4178 return word;
4179 }
4180 axi_limit0_r copy() volatile
4181 {
4182 return *this;
4183 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004184 CONSTEXPR uint32_t get_max_beats() const
4185 {
4186 uint32_t value = static_cast<uint32_t>(max_beats);
4187 return value;
4188 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004189 uint32_t get_max_beats() const volatile
4190 {
4191 uint32_t value = static_cast<uint32_t>(max_beats);
4192 return value;
4193 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004194 CONSTEXPR axi_limit0_r &set_max_beats(uint32_t value)
4195 {
4196 max_beats = ((1u << 2) - 1) & static_cast<uint32_t>(value);
4197 return *this;
4198 }
4199 CONSTEXPR uint32_t get_memtype() const
4200 {
4201 uint32_t value = static_cast<uint32_t>(memtype);
4202 return value;
4203 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004204 uint32_t get_memtype() const volatile
4205 {
4206 uint32_t value = static_cast<uint32_t>(memtype);
4207 return value;
4208 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004209 CONSTEXPR axi_limit0_r &set_memtype(uint32_t value)
4210 {
4211 memtype = ((1u << 4) - 1) & static_cast<uint32_t>(value);
4212 return *this;
4213 }
4214 CONSTEXPR uint32_t get_max_outstanding_read_m1() const
4215 {
4216 uint32_t value = static_cast<uint32_t>(max_outstanding_read_m1);
4217 return value;
4218 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004219 uint32_t get_max_outstanding_read_m1() const volatile
4220 {
4221 uint32_t value = static_cast<uint32_t>(max_outstanding_read_m1);
4222 return value;
4223 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004224 CONSTEXPR axi_limit0_r &set_max_outstanding_read_m1(uint32_t value)
4225 {
4226 max_outstanding_read_m1 = ((1u << 8) - 1) & static_cast<uint32_t>(value);
4227 return *this;
4228 }
4229 CONSTEXPR uint32_t get_max_outstanding_write_m1() const
4230 {
4231 uint32_t value = static_cast<uint32_t>(max_outstanding_write_m1);
4232 return value;
4233 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004234 uint32_t get_max_outstanding_write_m1() const volatile
4235 {
4236 uint32_t value = static_cast<uint32_t>(max_outstanding_write_m1);
4237 return value;
4238 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004239 CONSTEXPR axi_limit0_r &set_max_outstanding_write_m1(uint32_t value)
4240 {
4241 max_outstanding_write_m1 = ((1u << 8) - 1) & static_cast<uint32_t>(value);
4242 return *this;
4243 }
4244#endif //__cplusplus
4245};
4246
4247// axi_limit1_r - AXI limits for port 0 counter 1
4248struct axi_limit1_r
4249{
4250#ifdef __cplusplus
4251 private:
4252#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004253 union
4254 {
4255 struct
4256 {
4257 uint32_t max_beats : 2; // Burst split alignment: 0=64 bytes, 1=128 bytes, 2=256 bytes, 3=reserved
4258 uint32_t reserved0 : 2;
4259 uint32_t memtype : 4; // Memtype
4260 uint32_t reserved1 : 8;
4261 uint32_t
4262 max_outstanding_read_m1 : 8; // Maximum number of outstanding AXI read transactions - 1 in range 0 to 31
4263 uint32_t max_outstanding_write_m1 : 8; // Maximum number of outstanding AXI write transactions - 1 in range
4264 // 0 to 15
4265 };
4266 uint32_t word;
4267 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004268#ifdef __cplusplus
4269 public:
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004270 CONSTEXPR axi_limit1_r() :
Diqing Zhong04118062020-04-15 01:19:12 +02004271 max_beats(static_cast<uint32_t>(0x0)), reserved0(static_cast<uint32_t>(0)), memtype(static_cast<uint32_t>(0)),
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004272 reserved1(static_cast<uint32_t>(0)), max_outstanding_read_m1(static_cast<uint32_t>(0x00)),
4273 max_outstanding_write_m1(static_cast<uint32_t>(0x000000))
4274 {
4275 }
4276 CONSTEXPR axi_limit1_r(uint32_t init) : word(init) {}
4277 CONSTEXPR void operator=(uint32_t value)
4278 {
4279 word = value;
4280 }
4281 void operator=(uint32_t value) volatile
4282 {
4283 word = value;
4284 }
4285 CONSTEXPR operator uint32_t()
4286 {
4287 return word;
4288 }
4289 operator uint32_t() volatile
4290 {
4291 return word;
4292 }
4293 axi_limit1_r copy() volatile
4294 {
4295 return *this;
4296 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004297 CONSTEXPR uint32_t get_max_beats() const
4298 {
4299 uint32_t value = static_cast<uint32_t>(max_beats);
4300 return value;
4301 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004302 uint32_t get_max_beats() const volatile
4303 {
4304 uint32_t value = static_cast<uint32_t>(max_beats);
4305 return value;
4306 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004307 CONSTEXPR axi_limit1_r &set_max_beats(uint32_t value)
4308 {
4309 max_beats = ((1u << 2) - 1) & static_cast<uint32_t>(value);
4310 return *this;
4311 }
4312 CONSTEXPR uint32_t get_memtype() const
4313 {
4314 uint32_t value = static_cast<uint32_t>(memtype);
4315 return value;
4316 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004317 uint32_t get_memtype() const volatile
4318 {
4319 uint32_t value = static_cast<uint32_t>(memtype);
4320 return value;
4321 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004322 CONSTEXPR axi_limit1_r &set_memtype(uint32_t value)
4323 {
4324 memtype = ((1u << 4) - 1) & static_cast<uint32_t>(value);
4325 return *this;
4326 }
4327 CONSTEXPR uint32_t get_max_outstanding_read_m1() const
4328 {
4329 uint32_t value = static_cast<uint32_t>(max_outstanding_read_m1);
4330 return value;
4331 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004332 uint32_t get_max_outstanding_read_m1() const volatile
4333 {
4334 uint32_t value = static_cast<uint32_t>(max_outstanding_read_m1);
4335 return value;
4336 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004337 CONSTEXPR axi_limit1_r &set_max_outstanding_read_m1(uint32_t value)
4338 {
4339 max_outstanding_read_m1 = ((1u << 8) - 1) & static_cast<uint32_t>(value);
4340 return *this;
4341 }
4342 CONSTEXPR uint32_t get_max_outstanding_write_m1() const
4343 {
4344 uint32_t value = static_cast<uint32_t>(max_outstanding_write_m1);
4345 return value;
4346 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004347 uint32_t get_max_outstanding_write_m1() const volatile
4348 {
4349 uint32_t value = static_cast<uint32_t>(max_outstanding_write_m1);
4350 return value;
4351 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004352 CONSTEXPR axi_limit1_r &set_max_outstanding_write_m1(uint32_t value)
4353 {
4354 max_outstanding_write_m1 = ((1u << 8) - 1) & static_cast<uint32_t>(value);
4355 return *this;
4356 }
4357#endif //__cplusplus
4358};
4359
4360// axi_limit2_r - AXI limits for port 1 counter 2
4361struct axi_limit2_r
4362{
4363#ifdef __cplusplus
4364 private:
4365#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004366 union
4367 {
4368 struct
4369 {
4370 uint32_t max_beats : 2; // Burst split alignment: 0=64 bytes, 1=128 bytes, 2=256 bytes, 3=reserved
4371 uint32_t reserved0 : 2;
4372 uint32_t memtype : 4; // Memtype
4373 uint32_t reserved1 : 8;
4374 uint32_t
4375 max_outstanding_read_m1 : 8; // Maximum number of outstanding AXI read transactions - 1 in range 0 to 31
4376 uint32_t max_outstanding_write_m1 : 8; // Maximum number of outstanding AXI write transactions - 1 in range
4377 // 0 to 15
4378 };
4379 uint32_t word;
4380 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004381#ifdef __cplusplus
4382 public:
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004383 CONSTEXPR axi_limit2_r() :
Diqing Zhong04118062020-04-15 01:19:12 +02004384 max_beats(static_cast<uint32_t>(0x0)), reserved0(static_cast<uint32_t>(0)), memtype(static_cast<uint32_t>(0)),
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004385 reserved1(static_cast<uint32_t>(0)), max_outstanding_read_m1(static_cast<uint32_t>(0x00)),
4386 max_outstanding_write_m1(static_cast<uint32_t>(0x000000))
4387 {
4388 }
4389 CONSTEXPR axi_limit2_r(uint32_t init) : word(init) {}
4390 CONSTEXPR void operator=(uint32_t value)
4391 {
4392 word = value;
4393 }
4394 void operator=(uint32_t value) volatile
4395 {
4396 word = value;
4397 }
4398 CONSTEXPR operator uint32_t()
4399 {
4400 return word;
4401 }
4402 operator uint32_t() volatile
4403 {
4404 return word;
4405 }
4406 axi_limit2_r copy() volatile
4407 {
4408 return *this;
4409 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004410 CONSTEXPR uint32_t get_max_beats() const
4411 {
4412 uint32_t value = static_cast<uint32_t>(max_beats);
4413 return value;
4414 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004415 uint32_t get_max_beats() const volatile
4416 {
4417 uint32_t value = static_cast<uint32_t>(max_beats);
4418 return value;
4419 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004420 CONSTEXPR axi_limit2_r &set_max_beats(uint32_t value)
4421 {
4422 max_beats = ((1u << 2) - 1) & static_cast<uint32_t>(value);
4423 return *this;
4424 }
4425 CONSTEXPR uint32_t get_memtype() const
4426 {
4427 uint32_t value = static_cast<uint32_t>(memtype);
4428 return value;
4429 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004430 uint32_t get_memtype() const volatile
4431 {
4432 uint32_t value = static_cast<uint32_t>(memtype);
4433 return value;
4434 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004435 CONSTEXPR axi_limit2_r &set_memtype(uint32_t value)
4436 {
4437 memtype = ((1u << 4) - 1) & static_cast<uint32_t>(value);
4438 return *this;
4439 }
4440 CONSTEXPR uint32_t get_max_outstanding_read_m1() const
4441 {
4442 uint32_t value = static_cast<uint32_t>(max_outstanding_read_m1);
4443 return value;
4444 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004445 uint32_t get_max_outstanding_read_m1() const volatile
4446 {
4447 uint32_t value = static_cast<uint32_t>(max_outstanding_read_m1);
4448 return value;
4449 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004450 CONSTEXPR axi_limit2_r &set_max_outstanding_read_m1(uint32_t value)
4451 {
4452 max_outstanding_read_m1 = ((1u << 8) - 1) & static_cast<uint32_t>(value);
4453 return *this;
4454 }
4455 CONSTEXPR uint32_t get_max_outstanding_write_m1() const
4456 {
4457 uint32_t value = static_cast<uint32_t>(max_outstanding_write_m1);
4458 return value;
4459 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004460 uint32_t get_max_outstanding_write_m1() const volatile
4461 {
4462 uint32_t value = static_cast<uint32_t>(max_outstanding_write_m1);
4463 return value;
4464 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004465 CONSTEXPR axi_limit2_r &set_max_outstanding_write_m1(uint32_t value)
4466 {
4467 max_outstanding_write_m1 = ((1u << 8) - 1) & static_cast<uint32_t>(value);
4468 return *this;
4469 }
4470#endif //__cplusplus
4471};
4472
4473// axi_limit3_r - AXI limits for port 1 counter 3
4474struct axi_limit3_r
4475{
4476#ifdef __cplusplus
4477 private:
4478#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004479 union
4480 {
4481 struct
4482 {
4483 uint32_t max_beats : 2; // Burst split alignment: 0=64 bytes, 1=128 bytes, 2=256 bytes, 3=reserved
4484 uint32_t reserved0 : 2;
4485 uint32_t memtype : 4; // Memtype
4486 uint32_t reserved1 : 8;
4487 uint32_t
4488 max_outstanding_read_m1 : 8; // Maximum number of outstanding AXI read transactions - 1 in range 0 to 31
4489 uint32_t max_outstanding_write_m1 : 8; // Maximum number of outstanding AXI write transactions - 1 in range
4490 // 0 to 15
4491 };
4492 uint32_t word;
4493 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004494#ifdef __cplusplus
4495 public:
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004496 CONSTEXPR axi_limit3_r() :
Diqing Zhong04118062020-04-15 01:19:12 +02004497 max_beats(static_cast<uint32_t>(0x0)), reserved0(static_cast<uint32_t>(0)), memtype(static_cast<uint32_t>(0)),
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004498 reserved1(static_cast<uint32_t>(0)), max_outstanding_read_m1(static_cast<uint32_t>(0x00)),
4499 max_outstanding_write_m1(static_cast<uint32_t>(0x000000))
4500 {
4501 }
4502 CONSTEXPR axi_limit3_r(uint32_t init) : word(init) {}
4503 CONSTEXPR void operator=(uint32_t value)
4504 {
4505 word = value;
4506 }
4507 void operator=(uint32_t value) volatile
4508 {
4509 word = value;
4510 }
4511 CONSTEXPR operator uint32_t()
4512 {
4513 return word;
4514 }
4515 operator uint32_t() volatile
4516 {
4517 return word;
4518 }
4519 axi_limit3_r copy() volatile
4520 {
4521 return *this;
4522 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004523 CONSTEXPR uint32_t get_max_beats() const
4524 {
4525 uint32_t value = static_cast<uint32_t>(max_beats);
4526 return value;
4527 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004528 uint32_t get_max_beats() const volatile
4529 {
4530 uint32_t value = static_cast<uint32_t>(max_beats);
4531 return value;
4532 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004533 CONSTEXPR axi_limit3_r &set_max_beats(uint32_t value)
4534 {
4535 max_beats = ((1u << 2) - 1) & static_cast<uint32_t>(value);
4536 return *this;
4537 }
4538 CONSTEXPR uint32_t get_memtype() const
4539 {
4540 uint32_t value = static_cast<uint32_t>(memtype);
4541 return value;
4542 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004543 uint32_t get_memtype() const volatile
4544 {
4545 uint32_t value = static_cast<uint32_t>(memtype);
4546 return value;
4547 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004548 CONSTEXPR axi_limit3_r &set_memtype(uint32_t value)
4549 {
4550 memtype = ((1u << 4) - 1) & static_cast<uint32_t>(value);
4551 return *this;
4552 }
4553 CONSTEXPR uint32_t get_max_outstanding_read_m1() const
4554 {
4555 uint32_t value = static_cast<uint32_t>(max_outstanding_read_m1);
4556 return value;
4557 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004558 uint32_t get_max_outstanding_read_m1() const volatile
4559 {
4560 uint32_t value = static_cast<uint32_t>(max_outstanding_read_m1);
4561 return value;
4562 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004563 CONSTEXPR axi_limit3_r &set_max_outstanding_read_m1(uint32_t value)
4564 {
4565 max_outstanding_read_m1 = ((1u << 8) - 1) & static_cast<uint32_t>(value);
4566 return *this;
4567 }
4568 CONSTEXPR uint32_t get_max_outstanding_write_m1() const
4569 {
4570 uint32_t value = static_cast<uint32_t>(max_outstanding_write_m1);
4571 return value;
4572 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004573 uint32_t get_max_outstanding_write_m1() const volatile
4574 {
4575 uint32_t value = static_cast<uint32_t>(max_outstanding_write_m1);
4576 return value;
4577 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004578 CONSTEXPR axi_limit3_r &set_max_outstanding_write_m1(uint32_t value)
4579 {
4580 max_outstanding_write_m1 = ((1u << 8) - 1) & static_cast<uint32_t>(value);
4581 return *this;
4582 }
4583#endif //__cplusplus
4584};
4585
4586// pmcr_r - PMU Register control
4587struct pmcr_r
4588{
4589#ifdef __cplusplus
4590 private:
4591#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004592 union
4593 {
4594 struct
4595 {
4596 uint32_t cnt_en : 1; // Enable counters (RW)
4597 uint32_t event_cnt_rst : 1; // Reset event counters (WO)
4598 uint32_t cycle_cnt_rst : 1; // Reset cycle counter (WO)
4599 uint32_t mask_en : 1; // PMU can be enabled/disabled by command stream operation NPU_OP_PMU_MASK
4600 uint32_t reserved0 : 7;
4601 uint32_t num_event_cnt : 5; // Number of event counters (RO)
4602 uint32_t reserved1 : 16;
4603 };
4604 uint32_t word;
4605 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004606#ifdef __cplusplus
4607 public:
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004608 CONSTEXPR pmcr_r() :
4609 cnt_en(static_cast<uint32_t>(0)), event_cnt_rst(static_cast<uint32_t>(0)),
4610 cycle_cnt_rst(static_cast<uint32_t>(0)), mask_en(static_cast<uint32_t>(0)), reserved0(static_cast<uint32_t>(0)),
4611 num_event_cnt(static_cast<uint32_t>(4)), reserved1(static_cast<uint32_t>(0))
4612 {
4613 }
4614 CONSTEXPR pmcr_r(uint32_t init) : word(init) {}
4615 CONSTEXPR void operator=(uint32_t value)
4616 {
4617 word = value;
4618 }
4619 void operator=(uint32_t value) volatile
4620 {
4621 word = value;
4622 }
4623 CONSTEXPR operator uint32_t()
4624 {
4625 return word;
4626 }
4627 operator uint32_t() volatile
4628 {
4629 return word;
4630 }
4631 pmcr_r copy() volatile
4632 {
4633 return *this;
4634 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004635 CONSTEXPR uint32_t get_cnt_en() const
4636 {
4637 uint32_t value = static_cast<uint32_t>(cnt_en);
4638 return value;
4639 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004640 uint32_t get_cnt_en() const volatile
4641 {
4642 uint32_t value = static_cast<uint32_t>(cnt_en);
4643 return value;
4644 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004645 CONSTEXPR pmcr_r &set_cnt_en(uint32_t value)
4646 {
4647 cnt_en = ((1u << 1) - 1) & static_cast<uint32_t>(value);
4648 return *this;
4649 }
4650 CONSTEXPR uint32_t get_event_cnt_rst() const
4651 {
4652 uint32_t value = static_cast<uint32_t>(event_cnt_rst);
4653 return value;
4654 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004655 uint32_t get_event_cnt_rst() const volatile
4656 {
4657 uint32_t value = static_cast<uint32_t>(event_cnt_rst);
4658 return value;
4659 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004660 CONSTEXPR pmcr_r &set_event_cnt_rst(uint32_t value)
4661 {
4662 event_cnt_rst = ((1u << 1) - 1) & static_cast<uint32_t>(value);
4663 return *this;
4664 }
4665 CONSTEXPR uint32_t get_cycle_cnt_rst() const
4666 {
4667 uint32_t value = static_cast<uint32_t>(cycle_cnt_rst);
4668 return value;
4669 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004670 uint32_t get_cycle_cnt_rst() const volatile
4671 {
4672 uint32_t value = static_cast<uint32_t>(cycle_cnt_rst);
4673 return value;
4674 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004675 CONSTEXPR pmcr_r &set_cycle_cnt_rst(uint32_t value)
4676 {
4677 cycle_cnt_rst = ((1u << 1) - 1) & static_cast<uint32_t>(value);
4678 return *this;
4679 }
4680 CONSTEXPR uint32_t get_mask_en() const
4681 {
4682 uint32_t value = static_cast<uint32_t>(mask_en);
4683 return value;
4684 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004685 uint32_t get_mask_en() const volatile
4686 {
4687 uint32_t value = static_cast<uint32_t>(mask_en);
4688 return value;
4689 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004690 CONSTEXPR pmcr_r &set_mask_en(uint32_t value)
4691 {
4692 mask_en = ((1u << 1) - 1) & static_cast<uint32_t>(value);
4693 return *this;
4694 }
4695 CONSTEXPR uint32_t get_num_event_cnt() const
4696 {
4697 uint32_t value = static_cast<uint32_t>(num_event_cnt);
4698 return value;
4699 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004700 uint32_t get_num_event_cnt() const volatile
4701 {
4702 uint32_t value = static_cast<uint32_t>(num_event_cnt);
4703 return value;
4704 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004705 CONSTEXPR pmcr_r &set_num_event_cnt(uint32_t value)
4706 {
4707 num_event_cnt = ((1u << 5) - 1) & static_cast<uint32_t>(value);
4708 return *this;
4709 }
4710#endif //__cplusplus
4711};
4712
4713// pmcntenset_r - Count enable set register
4714struct pmcntenset_r
4715{
4716#ifdef __cplusplus
4717 private:
4718#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004719 union
4720 {
4721 struct
4722 {
4723 uint32_t EVENT_CNT_0 : 1; // Event counter enable bit for PMEVCNTR0
4724 uint32_t EVENT_CNT_1 : 1; // Event counter enable bit for PMEVCNTR1
4725 uint32_t EVENT_CNT_2 : 1; // Event counter enable bit for PMEVCNTR2
4726 uint32_t EVENT_CNT_3 : 1; // Event counter enable bit for PMEVCNTR3
4727 uint32_t reserved0 : 27;
4728 uint32_t CYCLE_CNT : 1; // PMCCNTR enable bit
4729 };
4730 uint32_t word;
4731 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004732#ifdef __cplusplus
4733 public:
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004734 CONSTEXPR pmcntenset_r() :
4735 EVENT_CNT_0(static_cast<uint32_t>(0)), EVENT_CNT_1(static_cast<uint32_t>(0)),
4736 EVENT_CNT_2(static_cast<uint32_t>(0)), EVENT_CNT_3(static_cast<uint32_t>(0)),
4737 reserved0(static_cast<uint32_t>(0)), CYCLE_CNT(static_cast<uint32_t>(0))
4738 {
4739 }
4740 CONSTEXPR pmcntenset_r(uint32_t init) : word(init) {}
4741 CONSTEXPR void operator=(uint32_t value)
4742 {
4743 word = value;
4744 }
4745 void operator=(uint32_t value) volatile
4746 {
4747 word = value;
4748 }
4749 CONSTEXPR operator uint32_t()
4750 {
4751 return word;
4752 }
4753 operator uint32_t() volatile
4754 {
4755 return word;
4756 }
4757 pmcntenset_r copy() volatile
4758 {
4759 return *this;
4760 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004761 CONSTEXPR uint32_t get_EVENT_CNT_0() const
4762 {
4763 uint32_t value = static_cast<uint32_t>(EVENT_CNT_0);
4764 return value;
4765 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004766 uint32_t get_EVENT_CNT_0() const volatile
4767 {
4768 uint32_t value = static_cast<uint32_t>(EVENT_CNT_0);
4769 return value;
4770 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004771 CONSTEXPR pmcntenset_r &set_EVENT_CNT_0(uint32_t value)
4772 {
4773 EVENT_CNT_0 = ((1u << 1) - 1) & static_cast<uint32_t>(value);
4774 return *this;
4775 }
4776 CONSTEXPR uint32_t get_EVENT_CNT_1() const
4777 {
4778 uint32_t value = static_cast<uint32_t>(EVENT_CNT_1);
4779 return value;
4780 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004781 uint32_t get_EVENT_CNT_1() const volatile
4782 {
4783 uint32_t value = static_cast<uint32_t>(EVENT_CNT_1);
4784 return value;
4785 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004786 CONSTEXPR pmcntenset_r &set_EVENT_CNT_1(uint32_t value)
4787 {
4788 EVENT_CNT_1 = ((1u << 1) - 1) & static_cast<uint32_t>(value);
4789 return *this;
4790 }
4791 CONSTEXPR uint32_t get_EVENT_CNT_2() const
4792 {
4793 uint32_t value = static_cast<uint32_t>(EVENT_CNT_2);
4794 return value;
4795 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004796 uint32_t get_EVENT_CNT_2() const volatile
4797 {
4798 uint32_t value = static_cast<uint32_t>(EVENT_CNT_2);
4799 return value;
4800 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004801 CONSTEXPR pmcntenset_r &set_EVENT_CNT_2(uint32_t value)
4802 {
4803 EVENT_CNT_2 = ((1u << 1) - 1) & static_cast<uint32_t>(value);
4804 return *this;
4805 }
4806 CONSTEXPR uint32_t get_EVENT_CNT_3() const
4807 {
4808 uint32_t value = static_cast<uint32_t>(EVENT_CNT_3);
4809 return value;
4810 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004811 uint32_t get_EVENT_CNT_3() const volatile
4812 {
4813 uint32_t value = static_cast<uint32_t>(EVENT_CNT_3);
4814 return value;
4815 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004816 CONSTEXPR pmcntenset_r &set_EVENT_CNT_3(uint32_t value)
4817 {
4818 EVENT_CNT_3 = ((1u << 1) - 1) & static_cast<uint32_t>(value);
4819 return *this;
4820 }
4821 CONSTEXPR uint32_t get_CYCLE_CNT() const
4822 {
4823 uint32_t value = static_cast<uint32_t>(CYCLE_CNT);
4824 return value;
4825 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004826 uint32_t get_CYCLE_CNT() const volatile
4827 {
4828 uint32_t value = static_cast<uint32_t>(CYCLE_CNT);
4829 return value;
4830 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004831 CONSTEXPR pmcntenset_r &set_CYCLE_CNT(uint32_t value)
4832 {
4833 CYCLE_CNT = ((1u << 1) - 1) & static_cast<uint32_t>(value);
4834 return *this;
4835 }
4836#endif //__cplusplus
4837};
4838
4839// pmcntenclr_r - Count enable clear register
4840struct pmcntenclr_r
4841{
4842#ifdef __cplusplus
4843 private:
4844#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004845 union
4846 {
4847 struct
4848 {
4849 uint32_t EVENT_CNT_0 : 1; // Event counter disable bit for PMEVCNTR0
4850 uint32_t EVENT_CNT_1 : 1; // Event counter disable bit for PMEVCNTR1
4851 uint32_t EVENT_CNT_2 : 1; // Event counter disable bit for PMEVCNTR2
4852 uint32_t EVENT_CNT_3 : 1; // Event counter disable bit for PMEVCNTR3
4853 uint32_t reserved0 : 27;
4854 uint32_t CYCLE_CNT : 1; // PMCCNTR disable bit
4855 };
4856 uint32_t word;
4857 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004858#ifdef __cplusplus
4859 public:
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004860 CONSTEXPR pmcntenclr_r() :
4861 EVENT_CNT_0(static_cast<uint32_t>(0)), EVENT_CNT_1(static_cast<uint32_t>(0)),
4862 EVENT_CNT_2(static_cast<uint32_t>(0)), EVENT_CNT_3(static_cast<uint32_t>(0)),
4863 reserved0(static_cast<uint32_t>(0)), CYCLE_CNT(static_cast<uint32_t>(0))
4864 {
4865 }
4866 CONSTEXPR pmcntenclr_r(uint32_t init) : word(init) {}
4867 CONSTEXPR void operator=(uint32_t value)
4868 {
4869 word = value;
4870 }
4871 void operator=(uint32_t value) volatile
4872 {
4873 word = value;
4874 }
4875 CONSTEXPR operator uint32_t()
4876 {
4877 return word;
4878 }
4879 operator uint32_t() volatile
4880 {
4881 return word;
4882 }
4883 pmcntenclr_r copy() volatile
4884 {
4885 return *this;
4886 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004887 CONSTEXPR uint32_t get_EVENT_CNT_0() const
4888 {
4889 uint32_t value = static_cast<uint32_t>(EVENT_CNT_0);
4890 return value;
4891 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004892 uint32_t get_EVENT_CNT_0() const volatile
4893 {
4894 uint32_t value = static_cast<uint32_t>(EVENT_CNT_0);
4895 return value;
4896 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004897 CONSTEXPR pmcntenclr_r &set_EVENT_CNT_0(uint32_t value)
4898 {
4899 EVENT_CNT_0 = ((1u << 1) - 1) & static_cast<uint32_t>(value);
4900 return *this;
4901 }
4902 CONSTEXPR uint32_t get_EVENT_CNT_1() const
4903 {
4904 uint32_t value = static_cast<uint32_t>(EVENT_CNT_1);
4905 return value;
4906 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004907 uint32_t get_EVENT_CNT_1() const volatile
4908 {
4909 uint32_t value = static_cast<uint32_t>(EVENT_CNT_1);
4910 return value;
4911 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004912 CONSTEXPR pmcntenclr_r &set_EVENT_CNT_1(uint32_t value)
4913 {
4914 EVENT_CNT_1 = ((1u << 1) - 1) & static_cast<uint32_t>(value);
4915 return *this;
4916 }
4917 CONSTEXPR uint32_t get_EVENT_CNT_2() const
4918 {
4919 uint32_t value = static_cast<uint32_t>(EVENT_CNT_2);
4920 return value;
4921 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004922 uint32_t get_EVENT_CNT_2() const volatile
4923 {
4924 uint32_t value = static_cast<uint32_t>(EVENT_CNT_2);
4925 return value;
4926 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004927 CONSTEXPR pmcntenclr_r &set_EVENT_CNT_2(uint32_t value)
4928 {
4929 EVENT_CNT_2 = ((1u << 1) - 1) & static_cast<uint32_t>(value);
4930 return *this;
4931 }
4932 CONSTEXPR uint32_t get_EVENT_CNT_3() const
4933 {
4934 uint32_t value = static_cast<uint32_t>(EVENT_CNT_3);
4935 return value;
4936 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004937 uint32_t get_EVENT_CNT_3() const volatile
4938 {
4939 uint32_t value = static_cast<uint32_t>(EVENT_CNT_3);
4940 return value;
4941 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004942 CONSTEXPR pmcntenclr_r &set_EVENT_CNT_3(uint32_t value)
4943 {
4944 EVENT_CNT_3 = ((1u << 1) - 1) & static_cast<uint32_t>(value);
4945 return *this;
4946 }
4947 CONSTEXPR uint32_t get_CYCLE_CNT() const
4948 {
4949 uint32_t value = static_cast<uint32_t>(CYCLE_CNT);
4950 return value;
4951 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004952 uint32_t get_CYCLE_CNT() const volatile
4953 {
4954 uint32_t value = static_cast<uint32_t>(CYCLE_CNT);
4955 return value;
4956 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004957 CONSTEXPR pmcntenclr_r &set_CYCLE_CNT(uint32_t value)
4958 {
4959 CYCLE_CNT = ((1u << 1) - 1) & static_cast<uint32_t>(value);
4960 return *this;
4961 }
4962#endif //__cplusplus
4963};
4964
4965// pmovsset_r - Overflow flag status set register
4966struct pmovsset_r
4967{
4968#ifdef __cplusplus
4969 private:
4970#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004971 union
4972 {
4973 struct
4974 {
4975 uint32_t EVENT_CNT_0_OVF : 1; // Event counter overflow set bit for PMEVCNTR0
4976 uint32_t EVENT_CNT_1_OVF : 1; // Event counter overflow set bit for PMEVCNTR1
4977 uint32_t EVENT_CNT_2_OVF : 1; // Event counter overflow set bit for PMEVCNTR2
4978 uint32_t EVENT_CNT_3_OVF : 1; // Event counter overflow set bit for PMEVCNTR3
4979 uint32_t reserved0 : 27;
4980 uint32_t CYCLE_CNT_OVF : 1; // PMCCNTR overflow set bit
4981 };
4982 uint32_t word;
4983 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004984#ifdef __cplusplus
4985 public:
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004986 CONSTEXPR pmovsset_r() :
4987 EVENT_CNT_0_OVF(static_cast<uint32_t>(0)), EVENT_CNT_1_OVF(static_cast<uint32_t>(0)),
4988 EVENT_CNT_2_OVF(static_cast<uint32_t>(0)), EVENT_CNT_3_OVF(static_cast<uint32_t>(0)),
4989 reserved0(static_cast<uint32_t>(0)), CYCLE_CNT_OVF(static_cast<uint32_t>(0))
4990 {
4991 }
4992 CONSTEXPR pmovsset_r(uint32_t init) : word(init) {}
4993 CONSTEXPR void operator=(uint32_t value)
4994 {
4995 word = value;
4996 }
4997 void operator=(uint32_t value) volatile
4998 {
4999 word = value;
5000 }
5001 CONSTEXPR operator uint32_t()
5002 {
5003 return word;
5004 }
5005 operator uint32_t() volatile
5006 {
5007 return word;
5008 }
5009 pmovsset_r copy() volatile
5010 {
5011 return *this;
5012 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005013 CONSTEXPR uint32_t get_EVENT_CNT_0_OVF() const
5014 {
5015 uint32_t value = static_cast<uint32_t>(EVENT_CNT_0_OVF);
5016 return value;
5017 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005018 uint32_t get_EVENT_CNT_0_OVF() const volatile
5019 {
5020 uint32_t value = static_cast<uint32_t>(EVENT_CNT_0_OVF);
5021 return value;
5022 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005023 CONSTEXPR pmovsset_r &set_EVENT_CNT_0_OVF(uint32_t value)
5024 {
5025 EVENT_CNT_0_OVF = ((1u << 1) - 1) & static_cast<uint32_t>(value);
5026 return *this;
5027 }
5028 CONSTEXPR uint32_t get_EVENT_CNT_1_OVF() const
5029 {
5030 uint32_t value = static_cast<uint32_t>(EVENT_CNT_1_OVF);
5031 return value;
5032 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005033 uint32_t get_EVENT_CNT_1_OVF() const volatile
5034 {
5035 uint32_t value = static_cast<uint32_t>(EVENT_CNT_1_OVF);
5036 return value;
5037 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005038 CONSTEXPR pmovsset_r &set_EVENT_CNT_1_OVF(uint32_t value)
5039 {
5040 EVENT_CNT_1_OVF = ((1u << 1) - 1) & static_cast<uint32_t>(value);
5041 return *this;
5042 }
5043 CONSTEXPR uint32_t get_EVENT_CNT_2_OVF() const
5044 {
5045 uint32_t value = static_cast<uint32_t>(EVENT_CNT_2_OVF);
5046 return value;
5047 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005048 uint32_t get_EVENT_CNT_2_OVF() const volatile
5049 {
5050 uint32_t value = static_cast<uint32_t>(EVENT_CNT_2_OVF);
5051 return value;
5052 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005053 CONSTEXPR pmovsset_r &set_EVENT_CNT_2_OVF(uint32_t value)
5054 {
5055 EVENT_CNT_2_OVF = ((1u << 1) - 1) & static_cast<uint32_t>(value);
5056 return *this;
5057 }
5058 CONSTEXPR uint32_t get_EVENT_CNT_3_OVF() const
5059 {
5060 uint32_t value = static_cast<uint32_t>(EVENT_CNT_3_OVF);
5061 return value;
5062 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005063 uint32_t get_EVENT_CNT_3_OVF() const volatile
5064 {
5065 uint32_t value = static_cast<uint32_t>(EVENT_CNT_3_OVF);
5066 return value;
5067 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005068 CONSTEXPR pmovsset_r &set_EVENT_CNT_3_OVF(uint32_t value)
5069 {
5070 EVENT_CNT_3_OVF = ((1u << 1) - 1) & static_cast<uint32_t>(value);
5071 return *this;
5072 }
5073 CONSTEXPR uint32_t get_CYCLE_CNT_OVF() const
5074 {
5075 uint32_t value = static_cast<uint32_t>(CYCLE_CNT_OVF);
5076 return value;
5077 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005078 uint32_t get_CYCLE_CNT_OVF() const volatile
5079 {
5080 uint32_t value = static_cast<uint32_t>(CYCLE_CNT_OVF);
5081 return value;
5082 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005083 CONSTEXPR pmovsset_r &set_CYCLE_CNT_OVF(uint32_t value)
5084 {
5085 CYCLE_CNT_OVF = ((1u << 1) - 1) & static_cast<uint32_t>(value);
5086 return *this;
5087 }
5088#endif //__cplusplus
5089};
5090
5091// pmovsclr_r - Overflow flag status clear register
5092struct pmovsclr_r
5093{
5094#ifdef __cplusplus
5095 private:
5096#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005097 union
5098 {
5099 struct
5100 {
5101 uint32_t EVENT_CNT_0_OVF : 1; // Event counter overflow clear bit for PMEVCNTR0
5102 uint32_t EVENT_CNT_1_OVF : 1; // Event counter overflow clear bit for PMEVCNTR1
5103 uint32_t EVENT_CNT_2_OVF : 1; // Event counter overflow clear bit for PMEVCNTR2
5104 uint32_t EVENT_CNT_3_OVF : 1; // Event counter overflow clear bit for PMEVCNTR3
5105 uint32_t reserved0 : 27;
5106 uint32_t CYCLE_CNT_OVF : 1; // PMCCNTR overflow clear bit
5107 };
5108 uint32_t word;
5109 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005110#ifdef __cplusplus
5111 public:
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005112 CONSTEXPR pmovsclr_r() :
5113 EVENT_CNT_0_OVF(static_cast<uint32_t>(0)), EVENT_CNT_1_OVF(static_cast<uint32_t>(0)),
5114 EVENT_CNT_2_OVF(static_cast<uint32_t>(0)), EVENT_CNT_3_OVF(static_cast<uint32_t>(0)),
5115 reserved0(static_cast<uint32_t>(0)), CYCLE_CNT_OVF(static_cast<uint32_t>(0))
5116 {
5117 }
5118 CONSTEXPR pmovsclr_r(uint32_t init) : word(init) {}
5119 CONSTEXPR void operator=(uint32_t value)
5120 {
5121 word = value;
5122 }
5123 void operator=(uint32_t value) volatile
5124 {
5125 word = value;
5126 }
5127 CONSTEXPR operator uint32_t()
5128 {
5129 return word;
5130 }
5131 operator uint32_t() volatile
5132 {
5133 return word;
5134 }
5135 pmovsclr_r copy() volatile
5136 {
5137 return *this;
5138 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005139 CONSTEXPR uint32_t get_EVENT_CNT_0_OVF() const
5140 {
5141 uint32_t value = static_cast<uint32_t>(EVENT_CNT_0_OVF);
5142 return value;
5143 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005144 uint32_t get_EVENT_CNT_0_OVF() const volatile
5145 {
5146 uint32_t value = static_cast<uint32_t>(EVENT_CNT_0_OVF);
5147 return value;
5148 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005149 CONSTEXPR pmovsclr_r &set_EVENT_CNT_0_OVF(uint32_t value)
5150 {
5151 EVENT_CNT_0_OVF = ((1u << 1) - 1) & static_cast<uint32_t>(value);
5152 return *this;
5153 }
5154 CONSTEXPR uint32_t get_EVENT_CNT_1_OVF() const
5155 {
5156 uint32_t value = static_cast<uint32_t>(EVENT_CNT_1_OVF);
5157 return value;
5158 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005159 uint32_t get_EVENT_CNT_1_OVF() const volatile
5160 {
5161 uint32_t value = static_cast<uint32_t>(EVENT_CNT_1_OVF);
5162 return value;
5163 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005164 CONSTEXPR pmovsclr_r &set_EVENT_CNT_1_OVF(uint32_t value)
5165 {
5166 EVENT_CNT_1_OVF = ((1u << 1) - 1) & static_cast<uint32_t>(value);
5167 return *this;
5168 }
5169 CONSTEXPR uint32_t get_EVENT_CNT_2_OVF() const
5170 {
5171 uint32_t value = static_cast<uint32_t>(EVENT_CNT_2_OVF);
5172 return value;
5173 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005174 uint32_t get_EVENT_CNT_2_OVF() const volatile
5175 {
5176 uint32_t value = static_cast<uint32_t>(EVENT_CNT_2_OVF);
5177 return value;
5178 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005179 CONSTEXPR pmovsclr_r &set_EVENT_CNT_2_OVF(uint32_t value)
5180 {
5181 EVENT_CNT_2_OVF = ((1u << 1) - 1) & static_cast<uint32_t>(value);
5182 return *this;
5183 }
5184 CONSTEXPR uint32_t get_EVENT_CNT_3_OVF() const
5185 {
5186 uint32_t value = static_cast<uint32_t>(EVENT_CNT_3_OVF);
5187 return value;
5188 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005189 uint32_t get_EVENT_CNT_3_OVF() const volatile
5190 {
5191 uint32_t value = static_cast<uint32_t>(EVENT_CNT_3_OVF);
5192 return value;
5193 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005194 CONSTEXPR pmovsclr_r &set_EVENT_CNT_3_OVF(uint32_t value)
5195 {
5196 EVENT_CNT_3_OVF = ((1u << 1) - 1) & static_cast<uint32_t>(value);
5197 return *this;
5198 }
5199 CONSTEXPR uint32_t get_CYCLE_CNT_OVF() const
5200 {
5201 uint32_t value = static_cast<uint32_t>(CYCLE_CNT_OVF);
5202 return value;
5203 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005204 uint32_t get_CYCLE_CNT_OVF() const volatile
5205 {
5206 uint32_t value = static_cast<uint32_t>(CYCLE_CNT_OVF);
5207 return value;
5208 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005209 CONSTEXPR pmovsclr_r &set_CYCLE_CNT_OVF(uint32_t value)
5210 {
5211 CYCLE_CNT_OVF = ((1u << 1) - 1) & static_cast<uint32_t>(value);
5212 return *this;
5213 }
5214#endif //__cplusplus
5215};
5216
5217// pmintset_r - Interrupt enable set register
5218struct pmintset_r
5219{
5220#ifdef __cplusplus
5221 private:
5222#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005223 union
5224 {
5225 struct
5226 {
5227 uint32_t EVENT_CNT_0_INT : 1; // Event counter overflow interrupt request enable bit for PMEVCNTR0
5228 uint32_t EVENT_CNT_1_INT : 1; // Event counter overflow interrupt request enable bit for PMEVCNTR1
5229 uint32_t EVENT_CNT_2_INT : 1; // Event counter overflow interrupt request enable bit for PMEVCNTR2
5230 uint32_t EVENT_CNT_3_INT : 1; // Event counter overflow interrupt request enable bit for PMEVCNTR3
5231 uint32_t reserved0 : 27;
5232 uint32_t CYCLE_CNT_INT : 1; // PMCCNTR overflow interrupt request enable bit
5233 };
5234 uint32_t word;
5235 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005236#ifdef __cplusplus
5237 public:
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005238 CONSTEXPR pmintset_r() :
5239 EVENT_CNT_0_INT(static_cast<uint32_t>(0)), EVENT_CNT_1_INT(static_cast<uint32_t>(0)),
5240 EVENT_CNT_2_INT(static_cast<uint32_t>(0)), EVENT_CNT_3_INT(static_cast<uint32_t>(0)),
5241 reserved0(static_cast<uint32_t>(0)), CYCLE_CNT_INT(static_cast<uint32_t>(0))
5242 {
5243 }
5244 CONSTEXPR pmintset_r(uint32_t init) : word(init) {}
5245 CONSTEXPR void operator=(uint32_t value)
5246 {
5247 word = value;
5248 }
5249 void operator=(uint32_t value) volatile
5250 {
5251 word = value;
5252 }
5253 CONSTEXPR operator uint32_t()
5254 {
5255 return word;
5256 }
5257 operator uint32_t() volatile
5258 {
5259 return word;
5260 }
5261 pmintset_r copy() volatile
5262 {
5263 return *this;
5264 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005265 CONSTEXPR uint32_t get_EVENT_CNT_0_INT() const
5266 {
5267 uint32_t value = static_cast<uint32_t>(EVENT_CNT_0_INT);
5268 return value;
5269 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005270 uint32_t get_EVENT_CNT_0_INT() const volatile
5271 {
5272 uint32_t value = static_cast<uint32_t>(EVENT_CNT_0_INT);
5273 return value;
5274 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005275 CONSTEXPR pmintset_r &set_EVENT_CNT_0_INT(uint32_t value)
5276 {
5277 EVENT_CNT_0_INT = ((1u << 1) - 1) & static_cast<uint32_t>(value);
5278 return *this;
5279 }
5280 CONSTEXPR uint32_t get_EVENT_CNT_1_INT() const
5281 {
5282 uint32_t value = static_cast<uint32_t>(EVENT_CNT_1_INT);
5283 return value;
5284 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005285 uint32_t get_EVENT_CNT_1_INT() const volatile
5286 {
5287 uint32_t value = static_cast<uint32_t>(EVENT_CNT_1_INT);
5288 return value;
5289 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005290 CONSTEXPR pmintset_r &set_EVENT_CNT_1_INT(uint32_t value)
5291 {
5292 EVENT_CNT_1_INT = ((1u << 1) - 1) & static_cast<uint32_t>(value);
5293 return *this;
5294 }
5295 CONSTEXPR uint32_t get_EVENT_CNT_2_INT() const
5296 {
5297 uint32_t value = static_cast<uint32_t>(EVENT_CNT_2_INT);
5298 return value;
5299 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005300 uint32_t get_EVENT_CNT_2_INT() const volatile
5301 {
5302 uint32_t value = static_cast<uint32_t>(EVENT_CNT_2_INT);
5303 return value;
5304 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005305 CONSTEXPR pmintset_r &set_EVENT_CNT_2_INT(uint32_t value)
5306 {
5307 EVENT_CNT_2_INT = ((1u << 1) - 1) & static_cast<uint32_t>(value);
5308 return *this;
5309 }
5310 CONSTEXPR uint32_t get_EVENT_CNT_3_INT() const
5311 {
5312 uint32_t value = static_cast<uint32_t>(EVENT_CNT_3_INT);
5313 return value;
5314 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005315 uint32_t get_EVENT_CNT_3_INT() const volatile
5316 {
5317 uint32_t value = static_cast<uint32_t>(EVENT_CNT_3_INT);
5318 return value;
5319 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005320 CONSTEXPR pmintset_r &set_EVENT_CNT_3_INT(uint32_t value)
5321 {
5322 EVENT_CNT_3_INT = ((1u << 1) - 1) & static_cast<uint32_t>(value);
5323 return *this;
5324 }
5325 CONSTEXPR uint32_t get_CYCLE_CNT_INT() const
5326 {
5327 uint32_t value = static_cast<uint32_t>(CYCLE_CNT_INT);
5328 return value;
5329 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005330 uint32_t get_CYCLE_CNT_INT() const volatile
5331 {
5332 uint32_t value = static_cast<uint32_t>(CYCLE_CNT_INT);
5333 return value;
5334 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005335 CONSTEXPR pmintset_r &set_CYCLE_CNT_INT(uint32_t value)
5336 {
5337 CYCLE_CNT_INT = ((1u << 1) - 1) & static_cast<uint32_t>(value);
5338 return *this;
5339 }
5340#endif //__cplusplus
5341};
5342
5343// pmintclr_r - Interrupt enable clear register
5344struct pmintclr_r
5345{
5346#ifdef __cplusplus
5347 private:
5348#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005349 union
5350 {
5351 struct
5352 {
5353 uint32_t EVENT_CNT_0_INT : 1; // Event counter overflow interrupt request disable bit for PMEVCNTR0
5354 uint32_t EVENT_CNT_1_INT : 1; // Event counter overflow interrupt request disable bit for PMEVCNTR1
5355 uint32_t EVENT_CNT_2_INT : 1; // Event counter overflow interrupt request disable bit for PMEVCNTR2
5356 uint32_t EVENT_CNT_3_INT : 1; // Event counter overflow interrupt request disable bit for PMEVCNTR3
5357 uint32_t reserved0 : 27;
5358 uint32_t CYCLE_CNT_INT : 1; // PMCCNTR overflow interrupt request disable bit
5359 };
5360 uint32_t word;
5361 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005362#ifdef __cplusplus
5363 public:
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005364 CONSTEXPR pmintclr_r() :
5365 EVENT_CNT_0_INT(static_cast<uint32_t>(0)), EVENT_CNT_1_INT(static_cast<uint32_t>(0)),
5366 EVENT_CNT_2_INT(static_cast<uint32_t>(0)), EVENT_CNT_3_INT(static_cast<uint32_t>(0)),
5367 reserved0(static_cast<uint32_t>(0)), CYCLE_CNT_INT(static_cast<uint32_t>(0))
5368 {
5369 }
5370 CONSTEXPR pmintclr_r(uint32_t init) : word(init) {}
5371 CONSTEXPR void operator=(uint32_t value)
5372 {
5373 word = value;
5374 }
5375 void operator=(uint32_t value) volatile
5376 {
5377 word = value;
5378 }
5379 CONSTEXPR operator uint32_t()
5380 {
5381 return word;
5382 }
5383 operator uint32_t() volatile
5384 {
5385 return word;
5386 }
5387 pmintclr_r copy() volatile
5388 {
5389 return *this;
5390 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005391 CONSTEXPR uint32_t get_EVENT_CNT_0_INT() const
5392 {
5393 uint32_t value = static_cast<uint32_t>(EVENT_CNT_0_INT);
5394 return value;
5395 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005396 uint32_t get_EVENT_CNT_0_INT() const volatile
5397 {
5398 uint32_t value = static_cast<uint32_t>(EVENT_CNT_0_INT);
5399 return value;
5400 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005401 CONSTEXPR pmintclr_r &set_EVENT_CNT_0_INT(uint32_t value)
5402 {
5403 EVENT_CNT_0_INT = ((1u << 1) - 1) & static_cast<uint32_t>(value);
5404 return *this;
5405 }
5406 CONSTEXPR uint32_t get_EVENT_CNT_1_INT() const
5407 {
5408 uint32_t value = static_cast<uint32_t>(EVENT_CNT_1_INT);
5409 return value;
5410 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005411 uint32_t get_EVENT_CNT_1_INT() const volatile
5412 {
5413 uint32_t value = static_cast<uint32_t>(EVENT_CNT_1_INT);
5414 return value;
5415 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005416 CONSTEXPR pmintclr_r &set_EVENT_CNT_1_INT(uint32_t value)
5417 {
5418 EVENT_CNT_1_INT = ((1u << 1) - 1) & static_cast<uint32_t>(value);
5419 return *this;
5420 }
5421 CONSTEXPR uint32_t get_EVENT_CNT_2_INT() const
5422 {
5423 uint32_t value = static_cast<uint32_t>(EVENT_CNT_2_INT);
5424 return value;
5425 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005426 uint32_t get_EVENT_CNT_2_INT() const volatile
5427 {
5428 uint32_t value = static_cast<uint32_t>(EVENT_CNT_2_INT);
5429 return value;
5430 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005431 CONSTEXPR pmintclr_r &set_EVENT_CNT_2_INT(uint32_t value)
5432 {
5433 EVENT_CNT_2_INT = ((1u << 1) - 1) & static_cast<uint32_t>(value);
5434 return *this;
5435 }
5436 CONSTEXPR uint32_t get_EVENT_CNT_3_INT() const
5437 {
5438 uint32_t value = static_cast<uint32_t>(EVENT_CNT_3_INT);
5439 return value;
5440 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005441 uint32_t get_EVENT_CNT_3_INT() const volatile
5442 {
5443 uint32_t value = static_cast<uint32_t>(EVENT_CNT_3_INT);
5444 return value;
5445 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005446 CONSTEXPR pmintclr_r &set_EVENT_CNT_3_INT(uint32_t value)
5447 {
5448 EVENT_CNT_3_INT = ((1u << 1) - 1) & static_cast<uint32_t>(value);
5449 return *this;
5450 }
5451 CONSTEXPR uint32_t get_CYCLE_CNT_INT() const
5452 {
5453 uint32_t value = static_cast<uint32_t>(CYCLE_CNT_INT);
5454 return value;
5455 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005456 uint32_t get_CYCLE_CNT_INT() const volatile
5457 {
5458 uint32_t value = static_cast<uint32_t>(CYCLE_CNT_INT);
5459 return value;
5460 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005461 CONSTEXPR pmintclr_r &set_CYCLE_CNT_INT(uint32_t value)
5462 {
5463 CYCLE_CNT_INT = ((1u << 1) - 1) & static_cast<uint32_t>(value);
5464 return *this;
5465 }
5466#endif //__cplusplus
5467};
5468
5469// pmccntr_lo_r - Performance monitor cycle count low register
5470struct pmccntr_lo_r
5471{
5472#ifdef __cplusplus
5473 private:
5474#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005475 union
5476 {
5477 uint32_t CYCLE_CNT_LO; // Cycle count low
5478 uint32_t word;
5479 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005480#ifdef __cplusplus
5481 public:
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005482 CONSTEXPR pmccntr_lo_r() : CYCLE_CNT_LO(static_cast<uint32_t>(0)) {}
5483 CONSTEXPR pmccntr_lo_r(uint32_t init) : word(init) {}
5484 CONSTEXPR void operator=(uint32_t value)
5485 {
5486 word = value;
5487 }
5488 void operator=(uint32_t value) volatile
5489 {
5490 word = value;
5491 }
5492 CONSTEXPR operator uint32_t()
5493 {
5494 return word;
5495 }
5496 operator uint32_t() volatile
5497 {
5498 return word;
5499 }
5500 pmccntr_lo_r copy() volatile
5501 {
5502 return *this;
5503 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005504 CONSTEXPR uint32_t get_CYCLE_CNT_LO() const
5505 {
5506 uint32_t value = static_cast<uint32_t>(CYCLE_CNT_LO);
5507 return value;
5508 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005509 uint32_t get_CYCLE_CNT_LO() const volatile
5510 {
5511 uint32_t value = static_cast<uint32_t>(CYCLE_CNT_LO);
5512 return value;
5513 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005514 CONSTEXPR pmccntr_lo_r &set_CYCLE_CNT_LO(uint32_t value)
5515 {
5516 CYCLE_CNT_LO = static_cast<uint32_t>(value);
5517 return *this;
5518 }
5519#endif //__cplusplus
5520};
5521
5522// pmccntr_hi_r - Performance monitor cycle count high register
5523struct pmccntr_hi_r
5524{
5525#ifdef __cplusplus
5526 private:
5527#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005528 union
5529 {
5530 struct
5531 {
5532 uint32_t CYCLE_CNT_HI : 16; // Cycle count high
5533 uint32_t reserved0 : 16;
5534 };
5535 uint32_t word;
5536 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005537#ifdef __cplusplus
5538 public:
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005539 CONSTEXPR pmccntr_hi_r() : CYCLE_CNT_HI(static_cast<uint32_t>(0)), reserved0(static_cast<uint32_t>(0)) {}
5540 CONSTEXPR pmccntr_hi_r(uint32_t init) : word(init) {}
5541 CONSTEXPR void operator=(uint32_t value)
5542 {
5543 word = value;
5544 }
5545 void operator=(uint32_t value) volatile
5546 {
5547 word = value;
5548 }
5549 CONSTEXPR operator uint32_t()
5550 {
5551 return word;
5552 }
5553 operator uint32_t() volatile
5554 {
5555 return word;
5556 }
5557 pmccntr_hi_r copy() volatile
5558 {
5559 return *this;
5560 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005561 CONSTEXPR uint32_t get_CYCLE_CNT_HI() const
5562 {
5563 uint32_t value = static_cast<uint32_t>(CYCLE_CNT_HI);
5564 return value;
5565 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005566 uint32_t get_CYCLE_CNT_HI() const volatile
5567 {
5568 uint32_t value = static_cast<uint32_t>(CYCLE_CNT_HI);
5569 return value;
5570 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005571 CONSTEXPR pmccntr_hi_r &set_CYCLE_CNT_HI(uint32_t value)
5572 {
5573 CYCLE_CNT_HI = ((1u << 16) - 1) & static_cast<uint32_t>(value);
5574 return *this;
5575 }
5576#endif //__cplusplus
5577};
5578
5579// pmccntr_cfg_r - Set start/stop event on the cycle counter
5580struct pmccntr_cfg_r
5581{
5582#ifdef __cplusplus
5583 private:
5584#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005585 union
5586 {
5587 struct
5588 {
5589 uint32_t CYCLE_CNT_CFG_START : 10; // Cycle counter start event
5590 uint32_t reserved0 : 6;
5591 uint32_t CYCLE_CNT_CFG_STOP : 10; // Cycle counter stop event
5592 uint32_t reserved1 : 6;
5593 };
5594 uint32_t word;
5595 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005596#ifdef __cplusplus
5597 public:
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005598 CONSTEXPR pmccntr_cfg_r() :
5599 CYCLE_CNT_CFG_START(static_cast<uint32_t>(0)), reserved0(static_cast<uint32_t>(0)),
5600 CYCLE_CNT_CFG_STOP(static_cast<uint32_t>(0)), reserved1(static_cast<uint32_t>(0))
5601 {
5602 }
5603 CONSTEXPR pmccntr_cfg_r(uint32_t init) : word(init) {}
5604 CONSTEXPR void operator=(uint32_t value)
5605 {
5606 word = value;
5607 }
5608 void operator=(uint32_t value) volatile
5609 {
5610 word = value;
5611 }
5612 CONSTEXPR operator uint32_t()
5613 {
5614 return word;
5615 }
5616 operator uint32_t() volatile
5617 {
5618 return word;
5619 }
5620 pmccntr_cfg_r copy() volatile
5621 {
5622 return *this;
5623 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005624 CONSTEXPR uint32_t get_CYCLE_CNT_CFG_START() const
5625 {
5626 uint32_t value = static_cast<uint32_t>(CYCLE_CNT_CFG_START);
5627 return value;
5628 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005629 uint32_t get_CYCLE_CNT_CFG_START() const volatile
5630 {
5631 uint32_t value = static_cast<uint32_t>(CYCLE_CNT_CFG_START);
5632 return value;
5633 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005634 CONSTEXPR pmccntr_cfg_r &set_CYCLE_CNT_CFG_START(uint32_t value)
5635 {
5636 CYCLE_CNT_CFG_START = ((1u << 10) - 1) & static_cast<uint32_t>(value);
5637 return *this;
5638 }
5639 CONSTEXPR uint32_t get_CYCLE_CNT_CFG_STOP() const
5640 {
5641 uint32_t value = static_cast<uint32_t>(CYCLE_CNT_CFG_STOP);
5642 return value;
5643 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005644 uint32_t get_CYCLE_CNT_CFG_STOP() const volatile
5645 {
5646 uint32_t value = static_cast<uint32_t>(CYCLE_CNT_CFG_STOP);
5647 return value;
5648 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005649 CONSTEXPR pmccntr_cfg_r &set_CYCLE_CNT_CFG_STOP(uint32_t value)
5650 {
5651 CYCLE_CNT_CFG_STOP = ((1u << 10) - 1) & static_cast<uint32_t>(value);
5652 return *this;
5653 }
5654#endif //__cplusplus
5655};
5656
5657// pmcaxi_chan_r - Set which AXI channel to monitor in PMU
5658struct pmcaxi_chan_r
5659{
5660#ifdef __cplusplus
5661 private:
5662#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005663 union
5664 {
5665 struct
5666 {
5667 uint32_t AXI_CHAN : 4; // Channel number to monitor (Read: 0=Cmd 1=IFM 2=Weights 3=Scale+Bias 4=Mem2Mem;
5668 // Write: 8=OFM 9=Mem2Mem)
5669 uint32_t reserved0 : 3;
5670 uint32_t RW : 1; // 0 for read, 1 for write
5671 uint32_t AXI_CNT : 2; // AXI counter to monitor (0=AXI0 counter0, 1=AXI0 counter1, 2=AXI1 counter 2, 3=AXI
5672 // counter3)
5673 uint32_t reserved1 : 22;
5674 };
5675 uint32_t word;
5676 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005677#ifdef __cplusplus
5678 public:
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005679 CONSTEXPR pmcaxi_chan_r() :
5680 AXI_CHAN(static_cast<uint32_t>(0)), reserved0(static_cast<uint32_t>(0)), RW(static_cast<uint32_t>(0)),
5681 AXI_CNT(static_cast<uint32_t>(0)), reserved1(static_cast<uint32_t>(0))
5682 {
5683 }
5684 CONSTEXPR pmcaxi_chan_r(uint32_t init) : word(init) {}
5685 CONSTEXPR void operator=(uint32_t value)
5686 {
5687 word = value;
5688 }
5689 void operator=(uint32_t value) volatile
5690 {
5691 word = value;
5692 }
5693 CONSTEXPR operator uint32_t()
5694 {
5695 return word;
5696 }
5697 operator uint32_t() volatile
5698 {
5699 return word;
5700 }
5701 pmcaxi_chan_r copy() volatile
5702 {
5703 return *this;
5704 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005705 CONSTEXPR uint32_t get_AXI_CHAN() const
5706 {
5707 uint32_t value = static_cast<uint32_t>(AXI_CHAN);
5708 return value;
5709 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005710 uint32_t get_AXI_CHAN() const volatile
5711 {
5712 uint32_t value = static_cast<uint32_t>(AXI_CHAN);
5713 return value;
5714 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005715 CONSTEXPR pmcaxi_chan_r &set_AXI_CHAN(uint32_t value)
5716 {
5717 AXI_CHAN = ((1u << 4) - 1) & static_cast<uint32_t>(value);
5718 return *this;
5719 }
5720 CONSTEXPR uint32_t get_RW() const
5721 {
5722 uint32_t value = static_cast<uint32_t>(RW);
5723 return value;
5724 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005725 uint32_t get_RW() const volatile
5726 {
5727 uint32_t value = static_cast<uint32_t>(RW);
5728 return value;
5729 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005730 CONSTEXPR pmcaxi_chan_r &set_RW(uint32_t value)
5731 {
5732 RW = ((1u << 1) - 1) & static_cast<uint32_t>(value);
5733 return *this;
5734 }
5735 CONSTEXPR uint32_t get_AXI_CNT() const
5736 {
5737 uint32_t value = static_cast<uint32_t>(AXI_CNT);
5738 return value;
5739 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005740 uint32_t get_AXI_CNT() const volatile
5741 {
5742 uint32_t value = static_cast<uint32_t>(AXI_CNT);
5743 return value;
5744 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005745 CONSTEXPR pmcaxi_chan_r &set_AXI_CNT(uint32_t value)
5746 {
5747 AXI_CNT = ((1u << 2) - 1) & static_cast<uint32_t>(value);
5748 return *this;
5749 }
5750#endif //__cplusplus
5751};
5752
5753// pmevtyper0_r - Performance monitor event type register 0
5754struct pmevtyper0_r
5755{
5756#ifdef __cplusplus
5757 private:
5758#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005759 union
5760 {
5761 struct
5762 {
5763 uint32_t EV_TYPE : 10; // Event Type
5764 uint32_t reserved0 : 22;
5765 };
5766 uint32_t word;
5767 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005768#ifdef __cplusplus
5769 public:
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005770 CONSTEXPR pmevtyper0_r() : EV_TYPE(static_cast<uint32_t>(0)), reserved0(static_cast<uint32_t>(0)) {}
5771 CONSTEXPR pmevtyper0_r(uint32_t init) : word(init) {}
5772 CONSTEXPR void operator=(uint32_t value)
5773 {
5774 word = value;
5775 }
5776 void operator=(uint32_t value) volatile
5777 {
5778 word = value;
5779 }
5780 CONSTEXPR operator uint32_t()
5781 {
5782 return word;
5783 }
5784 operator uint32_t() volatile
5785 {
5786 return word;
5787 }
5788 pmevtyper0_r copy() volatile
5789 {
5790 return *this;
5791 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005792 CONSTEXPR ::pmu_event_type get_EV_TYPE() const
5793 {
5794 ::pmu_event_type value = static_cast<::pmu_event_type>(EV_TYPE);
5795 return value;
5796 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005797 ::pmu_event_type get_EV_TYPE() const volatile
5798 {
5799 ::pmu_event_type value = static_cast<::pmu_event_type>(EV_TYPE);
5800 return value;
5801 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005802 CONSTEXPR pmevtyper0_r &set_EV_TYPE(::pmu_event_type value)
5803 {
5804 EV_TYPE = ((1u << 10) - 1) & static_cast<uint32_t>(value);
5805 return *this;
5806 }
5807#endif //__cplusplus
5808};
5809
5810// pmevtyper1_r - Performance monitor event type register 1
5811struct pmevtyper1_r
5812{
5813#ifdef __cplusplus
5814 private:
5815#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005816 union
5817 {
5818 struct
5819 {
5820 uint32_t EV_TYPE : 10; // Event Type
5821 uint32_t reserved0 : 22;
5822 };
5823 uint32_t word;
5824 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005825#ifdef __cplusplus
5826 public:
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005827 CONSTEXPR pmevtyper1_r() : EV_TYPE(static_cast<uint32_t>(0)), reserved0(static_cast<uint32_t>(0)) {}
5828 CONSTEXPR pmevtyper1_r(uint32_t init) : word(init) {}
5829 CONSTEXPR void operator=(uint32_t value)
5830 {
5831 word = value;
5832 }
5833 void operator=(uint32_t value) volatile
5834 {
5835 word = value;
5836 }
5837 CONSTEXPR operator uint32_t()
5838 {
5839 return word;
5840 }
5841 operator uint32_t() volatile
5842 {
5843 return word;
5844 }
5845 pmevtyper1_r copy() volatile
5846 {
5847 return *this;
5848 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005849 CONSTEXPR ::pmu_event_type get_EV_TYPE() const
5850 {
5851 ::pmu_event_type value = static_cast<::pmu_event_type>(EV_TYPE);
5852 return value;
5853 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005854 ::pmu_event_type get_EV_TYPE() const volatile
5855 {
5856 ::pmu_event_type value = static_cast<::pmu_event_type>(EV_TYPE);
5857 return value;
5858 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005859 CONSTEXPR pmevtyper1_r &set_EV_TYPE(::pmu_event_type value)
5860 {
5861 EV_TYPE = ((1u << 10) - 1) & static_cast<uint32_t>(value);
5862 return *this;
5863 }
5864#endif //__cplusplus
5865};
5866
5867// pmevtyper2_r - Performance monitor event type register 2
5868struct pmevtyper2_r
5869{
5870#ifdef __cplusplus
5871 private:
5872#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005873 union
5874 {
5875 struct
5876 {
5877 uint32_t EV_TYPE : 10; // Event Type
5878 uint32_t reserved0 : 22;
5879 };
5880 uint32_t word;
5881 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005882#ifdef __cplusplus
5883 public:
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005884 CONSTEXPR pmevtyper2_r() : EV_TYPE(static_cast<uint32_t>(0)), reserved0(static_cast<uint32_t>(0)) {}
5885 CONSTEXPR pmevtyper2_r(uint32_t init) : word(init) {}
5886 CONSTEXPR void operator=(uint32_t value)
5887 {
5888 word = value;
5889 }
5890 void operator=(uint32_t value) volatile
5891 {
5892 word = value;
5893 }
5894 CONSTEXPR operator uint32_t()
5895 {
5896 return word;
5897 }
5898 operator uint32_t() volatile
5899 {
5900 return word;
5901 }
5902 pmevtyper2_r copy() volatile
5903 {
5904 return *this;
5905 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005906 CONSTEXPR ::pmu_event_type get_EV_TYPE() const
5907 {
5908 ::pmu_event_type value = static_cast<::pmu_event_type>(EV_TYPE);
5909 return value;
5910 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005911 ::pmu_event_type get_EV_TYPE() const volatile
5912 {
5913 ::pmu_event_type value = static_cast<::pmu_event_type>(EV_TYPE);
5914 return value;
5915 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005916 CONSTEXPR pmevtyper2_r &set_EV_TYPE(::pmu_event_type value)
5917 {
5918 EV_TYPE = ((1u << 10) - 1) & static_cast<uint32_t>(value);
5919 return *this;
5920 }
5921#endif //__cplusplus
5922};
5923
5924// pmevtyper3_r - Performance monitor event type register 3
5925struct pmevtyper3_r
5926{
5927#ifdef __cplusplus
5928 private:
5929#endif //__cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005930 union
5931 {
5932 struct
5933 {
5934 uint32_t EV_TYPE : 10; // Event Type
5935 uint32_t reserved0 : 22;
5936 };
5937 uint32_t word;
5938 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005939#ifdef __cplusplus
5940 public:
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005941 CONSTEXPR pmevtyper3_r() : EV_TYPE(static_cast<uint32_t>(0)), reserved0(static_cast<uint32_t>(0)) {}
5942 CONSTEXPR pmevtyper3_r(uint32_t init) : word(init) {}
5943 CONSTEXPR void operator=(uint32_t value)
5944 {
5945 word = value;
5946 }
5947 void operator=(uint32_t value) volatile
5948 {
5949 word = value;
5950 }
5951 CONSTEXPR operator uint32_t()
5952 {
5953 return word;
5954 }
5955 operator uint32_t() volatile
5956 {
5957 return word;
5958 }
5959 pmevtyper3_r copy() volatile
5960 {
5961 return *this;
5962 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005963 CONSTEXPR ::pmu_event_type get_EV_TYPE() const
5964 {
5965 ::pmu_event_type value = static_cast<::pmu_event_type>(EV_TYPE);
5966 return value;
5967 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005968 ::pmu_event_type get_EV_TYPE() const volatile
5969 {
5970 ::pmu_event_type value = static_cast<::pmu_event_type>(EV_TYPE);
5971 return value;
5972 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005973 CONSTEXPR pmevtyper3_r &set_EV_TYPE(::pmu_event_type value)
5974 {
5975 EV_TYPE = ((1u << 10) - 1) & static_cast<uint32_t>(value);
5976 return *this;
5977 }
5978#endif //__cplusplus
5979};
5980
5981struct NPU_REG
5982{
5983 STRUCT id_r ID; // 0x0
5984 STRUCT status_r STATUS; // 0x4
5985 STRUCT cmd_r CMD; // 0x8
5986 STRUCT reset_r RESET; // 0xc
5987 STRUCT qbase0_r QBASE0; // 0x10
5988 STRUCT qbase1_r QBASE1; // 0x14
5989 STRUCT qread_r QREAD; // 0x18
5990 STRUCT qconfig_r QCONFIG; // 0x1c
5991 STRUCT qsize_r QSIZE; // 0x20
5992 STRUCT prot_r PROT; // 0x24
5993 STRUCT config_r CONFIG; // 0x28
5994 STRUCT lock_r LOCK; // 0x2c
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005995 uint32_t unused0[3];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005996 STRUCT regioncfg_r REGIONCFG; // 0x3c
5997 STRUCT axi_limit0_r AXI_LIMIT0; // 0x40
5998 STRUCT axi_limit1_r AXI_LIMIT1; // 0x44
5999 STRUCT axi_limit2_r AXI_LIMIT2; // 0x48
6000 STRUCT axi_limit3_r AXI_LIMIT3; // 0x4c
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006001 uint32_t unused1[12];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006002 STRUCT basep0_r BASEP0; // 0x80
6003 STRUCT basep1_r BASEP1; // 0x84
6004 STRUCT basep2_r BASEP2; // 0x88
6005 STRUCT basep3_r BASEP3; // 0x8c
6006 STRUCT basep4_r BASEP4; // 0x90
6007 STRUCT basep5_r BASEP5; // 0x94
6008 STRUCT basep6_r BASEP6; // 0x98
6009 STRUCT basep7_r BASEP7; // 0x9c
6010 STRUCT basep8_r BASEP8; // 0xa0
6011 STRUCT basep9_r BASEP9; // 0xa4
6012 STRUCT basep10_r BASEP10; // 0xa8
6013 STRUCT basep11_r BASEP11; // 0xac
6014 STRUCT basep12_r BASEP12; // 0xb0
6015 STRUCT basep13_r BASEP13; // 0xb4
6016 STRUCT basep14_r BASEP14; // 0xb8
6017 STRUCT basep15_r BASEP15; // 0xbc
Diqing Zhong04118062020-04-15 01:19:12 +02006018 uint32_t unused2[16];
Diqing Zhong04118062020-04-15 01:19:12 +02006019 uint32_t WD_STATUS; // 0x100
6020 uint32_t MAC_STATUS; // 0x104
6021 uint32_t DMA_STATUS; // 0x108
Diqing Zhong04118062020-04-15 01:19:12 +02006022 uint32_t unused3[1];
Diqing Zhong04118062020-04-15 01:19:12 +02006023 uint32_t AO_STATUS; // 0x110
Diqing Zhong04118062020-04-15 01:19:12 +02006024 uint32_t unused4[11];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006025 STRUCT clkforce_r CLKFORCE; // 0x140
6026 uint32_t DEBUG; // 0x144
6027 uint32_t DEBUG2; // 0x148
6028 uint32_t DEBUGCORE; // 0x14c
Diqing Zhong04118062020-04-15 01:19:12 +02006029 uint32_t unused5[12];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006030 STRUCT pmcr_r PMCR; // 0x180
6031 STRUCT pmcntenset_r PMCNTENSET; // 0x184
6032 STRUCT pmcntenclr_r PMCNTENCLR; // 0x188
6033 STRUCT pmovsset_r PMOVSSET; // 0x18c
6034 STRUCT pmovsclr_r PMOVSCLR; // 0x190
6035 STRUCT pmintset_r PMINTSET; // 0x194
6036 STRUCT pmintclr_r PMINTCLR; // 0x198
Diqing Zhong04118062020-04-15 01:19:12 +02006037 uint32_t unused6[1];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006038 STRUCT pmccntr_lo_r PMCCNTR_LO; // 0x1a0
6039 STRUCT pmccntr_hi_r PMCCNTR_HI; // 0x1a4
6040 STRUCT pmccntr_cfg_r PMCCNTR_CFG; // 0x1a8
6041 STRUCT pmcaxi_chan_r PMCAXI_CHAN; // 0x1ac
Diqing Zhong04118062020-04-15 01:19:12 +02006042 uint32_t unused7[20];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006043 uint32_t KERNEL_X; // 0x200
6044 uint32_t KERNEL_Y; // 0x204
6045 uint32_t KERNEL_W_M1; // 0x208
6046 uint32_t KERNEL_H_M1; // 0x20c
6047 uint32_t OFM_CBLK_WIDTH_M1; // 0x210
6048 uint32_t OFM_CBLK_HEIGHT_M1; // 0x214
6049 uint32_t OFM_CBLK_DEPTH_M1; // 0x218
6050 uint32_t IFM_CBLK_DEPTH_M1; // 0x21c
6051 uint32_t OFM_X; // 0x220
6052 uint32_t OFM_Y; // 0x224
6053 uint32_t OFM_Z; // 0x228
6054 uint32_t IFM_Z; // 0x22c
6055 uint32_t PAD_TOP; // 0x230
6056 uint32_t PAD_LEFT; // 0x234
6057 uint32_t IFM_CBLK_WIDTH; // 0x238
6058 uint32_t IFM_CBLK_HEIGHT; // 0x23c
6059 uint32_t DMA_IFM_SRC; // 0x240
6060 uint32_t DMA_IFM_SRC_HI; // 0x244
6061 uint32_t DMA_IFM_DST; // 0x248
6062 uint32_t DMA_OFM_SRC; // 0x24c
6063 uint32_t DMA_OFM_DST; // 0x250
6064 uint32_t DMA_OFM_DST_HI; // 0x254
6065 uint32_t DMA_WEIGHT_SRC; // 0x258
6066 uint32_t DMA_WEIGHT_SRC_HI; // 0x25c
6067 uint32_t DMA_CMD_SRC; // 0x260
6068 uint32_t DMA_CMD_SRC_HI; // 0x264
6069 uint32_t DMA_CMD_SIZE; // 0x268
6070 uint32_t DMA_M2M_SRC; // 0x26c
6071 uint32_t DMA_M2M_SRC_HI; // 0x270
6072 uint32_t DMA_M2M_DST; // 0x274
6073 uint32_t DMA_M2M_DST_HI; // 0x278
6074 uint32_t CURRENT_QREAD; // 0x27c
6075 uint32_t DMA_SCALE_SRC; // 0x280
6076 uint32_t DMA_SCALE_SRC_HI; // 0x284
Diqing Zhong04118062020-04-15 01:19:12 +02006077 uint32_t unused8[13];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006078 uint32_t CURRENT_CMD; // 0x2bc
Diqing Zhong04118062020-04-15 01:19:12 +02006079 uint32_t unused9[16];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006080 uint32_t PMEVCNTR[4]; // 0x300
Diqing Zhong04118062020-04-15 01:19:12 +02006081 uint32_t unused10[28];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006082 STRUCT pmevtyper0_r PMEVTYPER[4]; // 0x380
Diqing Zhong04118062020-04-15 01:19:12 +02006083 uint32_t unused11[28];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006084 uint32_t SHARED_BUFFER[256]; // 0x400
6085 uint32_t IFM_PAD_TOP; // 0x800
6086 uint32_t IFM_PAD_LEFT; // 0x804
6087 uint32_t IFM_PAD_RIGHT; // 0x808
6088 uint32_t IFM_PAD_BOTTOM; // 0x80c
6089 uint32_t IFM_DEPTH_M1; // 0x810
6090 uint32_t IFM_PRECISION; // 0x814
Diqing Zhong04118062020-04-15 01:19:12 +02006091 uint32_t unused12[1];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006092 uint32_t IFM_UPSCALE; // 0x81c
Diqing Zhong04118062020-04-15 01:19:12 +02006093 uint32_t unused13[1];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006094 uint32_t IFM_ZERO_POINT; // 0x824
6095 uint32_t IFM_WIDTH0_M1; // 0x828
6096 uint32_t IFM_HEIGHT0_M1; // 0x82c
6097 uint32_t IFM_HEIGHT1_M1; // 0x830
6098 uint32_t IFM_IB_END; // 0x834
Diqing Zhong04118062020-04-15 01:19:12 +02006099 uint32_t unused14[1];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006100 uint32_t IFM_REGION; // 0x83c
Diqing Zhong04118062020-04-15 01:19:12 +02006101 uint32_t unused15[1];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006102 uint32_t OFM_WIDTH_M1; // 0x844
6103 uint32_t OFM_HEIGHT_M1; // 0x848
6104 uint32_t OFM_DEPTH_M1; // 0x84c
6105 uint32_t OFM_PRECISION; // 0x850
6106 uint32_t OFM_BLK_WIDTH_M1; // 0x854
6107 uint32_t OFM_BLK_HEIGHT_M1; // 0x858
6108 uint32_t OFM_BLK_DEPTH_M1; // 0x85c
6109 uint32_t OFM_ZERO_POINT; // 0x860
Diqing Zhong04118062020-04-15 01:19:12 +02006110 uint32_t unused16[1];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006111 uint32_t OFM_WIDTH0_M1; // 0x868
6112 uint32_t OFM_HEIGHT0_M1; // 0x86c
6113 uint32_t OFM_HEIGHT1_M1; // 0x870
Diqing Zhong04118062020-04-15 01:19:12 +02006114 uint32_t unused17[2];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006115 uint32_t OFM_REGION; // 0x87c
6116 uint32_t KERNEL_WIDTH_M1; // 0x880
6117 uint32_t KERNEL_HEIGHT_M1; // 0x884
6118 uint32_t KERNEL_STRIDE; // 0x888
6119 uint32_t PARALLEL_MODE; // 0x88c
6120 uint32_t ACC_FORMAT; // 0x890
6121 uint32_t ACTIVATION; // 0x894
6122 uint32_t ACTIVATION_MIN; // 0x898
6123 uint32_t ACTIVATION_MAX; // 0x89c
6124 uint32_t WEIGHT_REGION; // 0x8a0
6125 uint32_t SCALE_REGION; // 0x8a4
Diqing Zhong04118062020-04-15 01:19:12 +02006126 uint32_t unused18[3];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006127 uint32_t AB_START; // 0x8b4
Diqing Zhong04118062020-04-15 01:19:12 +02006128 uint32_t unused19[1];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006129 uint32_t BLOCKDEP; // 0x8bc
6130 uint32_t DMA0_SRC_REGION; // 0x8c0
6131 uint32_t DMA0_DST_REGION; // 0x8c4
6132 uint32_t DMA0_SIZE0; // 0x8c8
6133 uint32_t DMA0_SIZE1; // 0x8cc
Diqing Zhong04118062020-04-15 01:19:12 +02006134 uint32_t unused20[12];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006135 uint32_t IFM2_BROADCAST; // 0x900
6136 uint32_t IFM2_SCALAR; // 0x904
Diqing Zhong04118062020-04-15 01:19:12 +02006137 uint32_t unused21[3];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006138 uint32_t IFM2_PRECISION; // 0x914
Diqing Zhong04118062020-04-15 01:19:12 +02006139 uint32_t unused22[3];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006140 uint32_t IFM2_ZERO_POINT; // 0x924
6141 uint32_t IFM2_WIDTH0_M1; // 0x928
6142 uint32_t IFM2_HEIGHT0_M1; // 0x92c
6143 uint32_t IFM2_HEIGHT1_M1; // 0x930
6144 uint32_t IFM2_IB_START; // 0x934
Diqing Zhong04118062020-04-15 01:19:12 +02006145 uint32_t unused23[1];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006146 uint32_t IFM2_REGION; // 0x93c
Diqing Zhong04118062020-04-15 01:19:12 +02006147 uint32_t unused24[48];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006148 uint32_t IFM_BASE0; // 0xa00
6149 uint32_t IFM_BASE0_HI; // 0xa04
6150 uint32_t IFM_BASE1; // 0xa08
6151 uint32_t IFM_BASE1_HI; // 0xa0c
6152 uint32_t IFM_BASE2; // 0xa10
6153 uint32_t IFM_BASE2_HI; // 0xa14
6154 uint32_t IFM_BASE3; // 0xa18
6155 uint32_t IFM_BASE3_HI; // 0xa1c
6156 uint32_t IFM_STRIDE_X; // 0xa20
6157 uint32_t IFM_STRIDE_X_HI; // 0xa24
6158 uint32_t IFM_STRIDE_Y; // 0xa28
6159 uint32_t IFM_STRIDE_Y_HI; // 0xa2c
6160 uint32_t IFM_STRIDE_C; // 0xa30
6161 uint32_t IFM_STRIDE_C_HI; // 0xa34
Diqing Zhong04118062020-04-15 01:19:12 +02006162 uint32_t unused25[2];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006163 uint32_t OFM_BASE0; // 0xa40
6164 uint32_t OFM_BASE0_HI; // 0xa44
6165 uint32_t OFM_BASE1; // 0xa48
6166 uint32_t OFM_BASE1_HI; // 0xa4c
6167 uint32_t OFM_BASE2; // 0xa50
6168 uint32_t OFM_BASE2_HI; // 0xa54
6169 uint32_t OFM_BASE3; // 0xa58
6170 uint32_t OFM_BASE3_HI; // 0xa5c
6171 uint32_t OFM_STRIDE_X; // 0xa60
6172 uint32_t OFM_STRIDE_X_HI; // 0xa64
6173 uint32_t OFM_STRIDE_Y; // 0xa68
6174 uint32_t OFM_STRIDE_Y_HI; // 0xa6c
6175 uint32_t OFM_STRIDE_C; // 0xa70
6176 uint32_t OFM_STRIDE_C_HI; // 0xa74
Diqing Zhong04118062020-04-15 01:19:12 +02006177 uint32_t unused26[2];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006178 uint32_t WEIGHT_BASE; // 0xa80
6179 uint32_t WEIGHT_BASE_HI; // 0xa84
6180 uint32_t WEIGHT_LENGTH; // 0xa88
6181 uint32_t WEIGHT_LENGTH_HI; // 0xa8c
6182 uint32_t SCALE_BASE; // 0xa90
6183 uint32_t SCALE_BASE_HI; // 0xa94
6184 uint32_t SCALE_LENGTH; // 0xa98
Diqing Zhong04118062020-04-15 01:19:12 +02006185 uint32_t unused27[1];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006186 uint32_t OFM_SCALE; // 0xaa0
6187 uint32_t OFM_SCALE_SHIFT; // 0xaa4
6188 uint32_t OPA_SCALE; // 0xaa8
6189 uint32_t OPA_SCALE_SHIFT; // 0xaac
6190 uint32_t OPB_SCALE; // 0xab0
Diqing Zhong04118062020-04-15 01:19:12 +02006191 uint32_t unused28[3];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006192 uint32_t DMA0_SRC; // 0xac0
6193 uint32_t DMA0_SRC_HI; // 0xac4
6194 uint32_t DMA0_DST; // 0xac8
6195 uint32_t DMA0_DST_HI; // 0xacc
6196 uint32_t DMA0_LEN; // 0xad0
6197 uint32_t DMA0_LEN_HI; // 0xad4
6198 uint32_t DMA0_SKIP0; // 0xad8
6199 uint32_t DMA0_SKIP0_HI; // 0xadc
6200 uint32_t DMA0_SKIP1; // 0xae0
6201 uint32_t DMA0_SKIP1_HI; // 0xae4
Diqing Zhong04118062020-04-15 01:19:12 +02006202 uint32_t unused29[6];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006203 uint32_t IFM2_BASE0; // 0xb00
6204 uint32_t IFM2_BASE0_HI; // 0xb04
6205 uint32_t IFM2_BASE1; // 0xb08
6206 uint32_t IFM2_BASE1_HI; // 0xb0c
6207 uint32_t IFM2_BASE2; // 0xb10
6208 uint32_t IFM2_BASE2_HI; // 0xb14
6209 uint32_t IFM2_BASE3; // 0xb18
6210 uint32_t IFM2_BASE3_HI; // 0xb1c
6211 uint32_t IFM2_STRIDE_X; // 0xb20
6212 uint32_t IFM2_STRIDE_X_HI; // 0xb24
6213 uint32_t IFM2_STRIDE_Y; // 0xb28
6214 uint32_t IFM2_STRIDE_Y_HI; // 0xb2c
6215 uint32_t IFM2_STRIDE_C; // 0xb30
6216 uint32_t IFM2_STRIDE_C_HI; // 0xb34
Diqing Zhong04118062020-04-15 01:19:12 +02006217 uint32_t unused30[2];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006218 uint32_t WEIGHT1_BASE; // 0xb40
6219 uint32_t WEIGHT1_BASE_HI; // 0xb44
6220 uint32_t WEIGHT1_LENGTH; // 0xb48
6221 uint32_t WEIGHT1_LENGTH_HI; // 0xb4c
6222 uint32_t SCALE1_BASE; // 0xb50
6223 uint32_t SCALE1_BASE_HI; // 0xb54
6224 uint32_t SCALE1_LENGTH; // 0xb58
Diqing Zhong04118062020-04-15 01:19:12 +02006225 uint32_t unused31[281];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006226 uint32_t REVISION; // 0xfc0
Diqing Zhong04118062020-04-15 01:19:12 +02006227 uint32_t unused32[3];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006228 STRUCT pid4_r PID4; // 0xfd0
6229 STRUCT pid5_r PID5; // 0xfd4
6230 STRUCT pid6_r PID6; // 0xfd8
6231 STRUCT pid7_r PID7; // 0xfdc
6232 STRUCT pid0_r PID0; // 0xfe0
6233 STRUCT pid1_r PID1; // 0xfe4
6234 STRUCT pid2_r PID2; // 0xfe8
6235 STRUCT pid3_r PID3; // 0xfec
6236 STRUCT cid0_r CID0; // 0xff0
6237 STRUCT cid1_r CID1; // 0xff4
6238 STRUCT cid2_r CID2; // 0xff8
6239 STRUCT cid3_r CID3; // 0xffc
6240#ifdef __cplusplus
6241 NPU_REG()
6242 {
6243 reset();
6244 }
6245 void reset()
6246 {
Diqing Zhonga9f38d52020-04-27 11:00:13 +02006247 ID = 177225729;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006248 STATUS = 8;
6249 CMD = 0;
6250 RESET = 0;
6251 QBASE0 = 0;
6252 QBASE1 = 0;
6253 QREAD = 0;
6254 QCONFIG = 0;
6255 QSIZE = 0;
6256 PROT = 0;
6257 CONFIG = 0;
6258 LOCK = 0;
6259 REGIONCFG = 0;
6260 AXI_LIMIT0 = 0;
6261 AXI_LIMIT1 = 0;
6262 AXI_LIMIT2 = 0;
6263 AXI_LIMIT3 = 0;
6264 BASEP0 = 0;
6265 BASEP1 = 0;
6266 BASEP2 = 0;
6267 BASEP3 = 0;
6268 BASEP4 = 0;
6269 BASEP5 = 0;
6270 BASEP6 = 0;
6271 BASEP7 = 0;
6272 BASEP8 = 0;
6273 BASEP9 = 0;
6274 BASEP10 = 0;
6275 BASEP11 = 0;
6276 BASEP12 = 0;
6277 BASEP13 = 0;
6278 BASEP14 = 0;
6279 BASEP15 = 0;
6280 REVISION = 0;
6281 PID4 = 4;
6282 PID5 = 0;
6283 PID6 = 0;
6284 PID7 = 0;
6285 PID0 = 128;
6286 PID1 = 181;
6287 PID2 = 11;
6288 PID3 = 0;
6289 CID0 = 13;
6290 CID1 = 240;
6291 CID2 = 5;
6292 CID3 = 177;
Diqing Zhong04118062020-04-15 01:19:12 +02006293 WD_STATUS = 0;
6294 MAC_STATUS = 0;
6295 DMA_STATUS = 0;
6296 AO_STATUS = 0;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006297 CLKFORCE = 0;
6298 DEBUG = 0;
6299 DEBUG2 = 0;
6300 DEBUGCORE = 0;
6301 KERNEL_X = 0;
6302 KERNEL_Y = 0;
6303 KERNEL_W_M1 = 0;
6304 KERNEL_H_M1 = 0;
6305 OFM_CBLK_WIDTH_M1 = 0;
6306 OFM_CBLK_HEIGHT_M1 = 0;
6307 OFM_CBLK_DEPTH_M1 = 0;
6308 IFM_CBLK_DEPTH_M1 = 0;
6309 OFM_X = 0;
6310 OFM_Y = 0;
6311 OFM_Z = 0;
6312 IFM_Z = 0;
6313 PAD_TOP = 0;
6314 PAD_LEFT = 0;
6315 IFM_CBLK_WIDTH = 0;
6316 IFM_CBLK_HEIGHT = 0;
6317 DMA_IFM_SRC = 0;
6318 DMA_IFM_SRC_HI = 0;
6319 DMA_IFM_DST = 0;
6320 DMA_OFM_SRC = 0;
6321 DMA_OFM_DST = 0;
6322 DMA_OFM_DST_HI = 0;
6323 DMA_WEIGHT_SRC = 0;
6324 DMA_WEIGHT_SRC_HI = 0;
6325 DMA_CMD_SRC = 0;
6326 DMA_CMD_SRC_HI = 0;
6327 DMA_CMD_SIZE = 0;
6328 DMA_M2M_SRC = 0;
6329 DMA_M2M_SRC_HI = 0;
6330 DMA_M2M_DST = 0;
6331 DMA_M2M_DST_HI = 0;
6332 CURRENT_QREAD = 0;
6333 DMA_SCALE_SRC = 0;
6334 DMA_SCALE_SRC_HI = 0;
6335 CURRENT_CMD = 0;
6336 IFM_PAD_TOP = 0;
6337 IFM_PAD_LEFT = 0;
6338 IFM_PAD_RIGHT = 0;
6339 IFM_PAD_BOTTOM = 0;
6340 IFM_DEPTH_M1 = 0;
6341 IFM_PRECISION = 0;
6342 IFM_UPSCALE = 0;
6343 IFM_ZERO_POINT = 0;
6344 IFM_WIDTH0_M1 = 0;
6345 IFM_HEIGHT0_M1 = 0;
6346 IFM_HEIGHT1_M1 = 0;
6347 IFM_IB_END = 0;
6348 IFM_REGION = 0;
6349 OFM_WIDTH_M1 = 0;
6350 OFM_HEIGHT_M1 = 0;
6351 OFM_DEPTH_M1 = 0;
6352 OFM_PRECISION = 0;
6353 OFM_BLK_WIDTH_M1 = 0;
6354 OFM_BLK_HEIGHT_M1 = 0;
6355 OFM_BLK_DEPTH_M1 = 0;
6356 OFM_ZERO_POINT = 0;
6357 OFM_WIDTH0_M1 = 0;
6358 OFM_HEIGHT0_M1 = 0;
6359 OFM_HEIGHT1_M1 = 0;
6360 OFM_REGION = 0;
6361 KERNEL_WIDTH_M1 = 0;
6362 KERNEL_HEIGHT_M1 = 0;
6363 KERNEL_STRIDE = 0;
6364 PARALLEL_MODE = 0;
6365 ACC_FORMAT = 0;
6366 ACTIVATION = 0;
6367 ACTIVATION_MIN = 0;
6368 ACTIVATION_MAX = 0;
6369 WEIGHT_REGION = 0;
6370 SCALE_REGION = 0;
6371 AB_START = 0;
6372 BLOCKDEP = 0;
6373 DMA0_SRC_REGION = 0;
6374 DMA0_DST_REGION = 0;
6375 DMA0_SIZE0 = 0;
6376 DMA0_SIZE1 = 0;
6377 IFM2_BROADCAST = 0;
6378 IFM2_SCALAR = 0;
6379 IFM2_PRECISION = 0;
6380 IFM2_ZERO_POINT = 0;
6381 IFM2_WIDTH0_M1 = 0;
6382 IFM2_HEIGHT0_M1 = 0;
6383 IFM2_HEIGHT1_M1 = 0;
6384 IFM2_IB_START = 0;
6385 IFM2_REGION = 0;
6386 IFM_BASE0 = 0;
6387 IFM_BASE0_HI = 0;
6388 IFM_BASE1 = 0;
6389 IFM_BASE1_HI = 0;
6390 IFM_BASE2 = 0;
6391 IFM_BASE2_HI = 0;
6392 IFM_BASE3 = 0;
6393 IFM_BASE3_HI = 0;
6394 IFM_STRIDE_X = 0;
6395 IFM_STRIDE_X_HI = 0;
6396 IFM_STRIDE_Y = 0;
6397 IFM_STRIDE_Y_HI = 0;
6398 IFM_STRIDE_C = 0;
6399 IFM_STRIDE_C_HI = 0;
6400 OFM_BASE0 = 0;
6401 OFM_BASE0_HI = 0;
6402 OFM_BASE1 = 0;
6403 OFM_BASE1_HI = 0;
6404 OFM_BASE2 = 0;
6405 OFM_BASE2_HI = 0;
6406 OFM_BASE3 = 0;
6407 OFM_BASE3_HI = 0;
6408 OFM_STRIDE_X = 0;
6409 OFM_STRIDE_X_HI = 0;
6410 OFM_STRIDE_Y = 0;
6411 OFM_STRIDE_Y_HI = 0;
6412 OFM_STRIDE_C = 0;
6413 OFM_STRIDE_C_HI = 0;
6414 WEIGHT_BASE = 0;
6415 WEIGHT_BASE_HI = 0;
6416 WEIGHT_LENGTH = 0;
6417 WEIGHT_LENGTH_HI = 0;
6418 SCALE_BASE = 0;
6419 SCALE_BASE_HI = 0;
6420 SCALE_LENGTH = 0;
6421 OFM_SCALE = 0;
6422 OFM_SCALE_SHIFT = 0;
6423 OPA_SCALE = 0;
6424 OPA_SCALE_SHIFT = 0;
6425 OPB_SCALE = 0;
6426 DMA0_SRC = 0;
6427 DMA0_SRC_HI = 0;
6428 DMA0_DST = 0;
6429 DMA0_DST_HI = 0;
6430 DMA0_LEN = 0;
6431 DMA0_LEN_HI = 0;
6432 DMA0_SKIP0 = 0;
6433 DMA0_SKIP0_HI = 0;
6434 DMA0_SKIP1 = 0;
6435 DMA0_SKIP1_HI = 0;
6436 IFM2_BASE0 = 0;
6437 IFM2_BASE0_HI = 0;
6438 IFM2_BASE1 = 0;
6439 IFM2_BASE1_HI = 0;
6440 IFM2_BASE2 = 0;
6441 IFM2_BASE2_HI = 0;
6442 IFM2_BASE3 = 0;
6443 IFM2_BASE3_HI = 0;
6444 IFM2_STRIDE_X = 0;
6445 IFM2_STRIDE_X_HI = 0;
6446 IFM2_STRIDE_Y = 0;
6447 IFM2_STRIDE_Y_HI = 0;
6448 IFM2_STRIDE_C = 0;
6449 IFM2_STRIDE_C_HI = 0;
6450 WEIGHT1_BASE = 0;
6451 WEIGHT1_BASE_HI = 0;
6452 WEIGHT1_LENGTH = 0;
6453 WEIGHT1_LENGTH_HI = 0;
6454 SCALE1_BASE = 0;
6455 SCALE1_BASE_HI = 0;
6456 SCALE1_LENGTH = 0;
6457 PMCR = 8192;
6458 PMCNTENSET = 0;
6459 PMCNTENCLR = 0;
6460 PMOVSSET = 0;
6461 PMOVSCLR = 0;
6462 PMINTSET = 0;
6463 PMINTCLR = 0;
6464 PMCCNTR_LO = 0;
6465 PMCCNTR_HI = 0;
6466 PMCCNTR_CFG = 0;
6467 PMCAXI_CHAN = 0;
6468 for (size_t i = 0; i < (sizeof(PMEVCNTR) / sizeof(PMEVCNTR[0])); ++i)
6469 PMEVCNTR[i] = 0;
6470 for (size_t i = 0; i < (sizeof(PMEVTYPER) / sizeof(PMEVTYPER[0])); ++i)
6471 PMEVTYPER[i] = 0;
6472 for (size_t i = 0; i < (sizeof(SHARED_BUFFER) / sizeof(SHARED_BUFFER[0])); ++i)
6473 SHARED_BUFFER[i] = 0;
6474 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006475 uint32_t &operator[](const int addr_offset)
6476 {
6477 return reinterpret_cast<uint32_t *>(this)[addr_offset / 4];
6478 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006479 enum class access_type_t : bool
6480 {
6481 RO,
6482 RW
6483 };
6484 access_type_t get_access_type(uint32_t offset)
6485 {
6486 switch (offset)
6487 {
6488 case 0:
6489 return access_type_t::RO;
6490 case 4:
6491 return access_type_t::RO;
6492 case 8:
6493 return access_type_t::RW;
6494 case 12:
6495 return access_type_t::RW;
6496 case 16:
6497 return access_type_t::RW;
6498 case 20:
6499 return access_type_t::RW;
6500 case 24:
6501 return access_type_t::RO;
6502 case 28:
6503 return access_type_t::RW;
6504 case 32:
6505 return access_type_t::RW;
6506 case 36:
6507 return access_type_t::RO;
6508 case 40:
6509 return access_type_t::RO;
6510 case 44:
6511 return access_type_t::RW;
6512 case 60:
6513 return access_type_t::RW;
6514 case 64:
6515 return access_type_t::RW;
6516 case 68:
6517 return access_type_t::RW;
6518 case 72:
6519 return access_type_t::RW;
6520 case 76:
6521 return access_type_t::RW;
6522 case 128:
6523 return access_type_t::RW;
6524 case 132:
6525 return access_type_t::RW;
6526 case 136:
6527 return access_type_t::RW;
6528 case 140:
6529 return access_type_t::RW;
6530 case 144:
6531 return access_type_t::RW;
6532 case 148:
6533 return access_type_t::RW;
6534 case 152:
6535 return access_type_t::RW;
6536 case 156:
6537 return access_type_t::RW;
6538 case 160:
6539 return access_type_t::RW;
6540 case 164:
6541 return access_type_t::RW;
6542 case 168:
6543 return access_type_t::RW;
6544 case 172:
6545 return access_type_t::RW;
6546 case 176:
6547 return access_type_t::RW;
6548 case 180:
6549 return access_type_t::RW;
6550 case 184:
6551 return access_type_t::RW;
6552 case 188:
6553 return access_type_t::RW;
6554 case 4032:
6555 return access_type_t::RO;
6556 case 4048:
6557 return access_type_t::RO;
6558 case 4052:
6559 return access_type_t::RO;
6560 case 4056:
6561 return access_type_t::RO;
6562 case 4060:
6563 return access_type_t::RO;
6564 case 4064:
6565 return access_type_t::RO;
6566 case 4068:
6567 return access_type_t::RO;
6568 case 4072:
6569 return access_type_t::RO;
6570 case 4076:
6571 return access_type_t::RO;
6572 case 4080:
6573 return access_type_t::RO;
6574 case 4084:
6575 return access_type_t::RO;
6576 case 4088:
6577 return access_type_t::RO;
6578 case 4092:
6579 return access_type_t::RO;
Diqing Zhong04118062020-04-15 01:19:12 +02006580 case 256:
6581 return access_type_t::RO;
6582 case 260:
6583 return access_type_t::RO;
6584 case 264:
6585 return access_type_t::RO;
6586 case 272:
6587 return access_type_t::RO;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006588 case 320:
6589 return access_type_t::RW;
6590 case 324:
6591 return access_type_t::RW;
6592 case 328:
6593 return access_type_t::RW;
6594 case 332:
6595 return access_type_t::RW;
6596 case 512:
6597 return access_type_t::RO;
6598 case 516:
6599 return access_type_t::RO;
6600 case 520:
6601 return access_type_t::RO;
6602 case 524:
6603 return access_type_t::RO;
6604 case 528:
6605 return access_type_t::RO;
6606 case 532:
6607 return access_type_t::RO;
6608 case 536:
6609 return access_type_t::RO;
6610 case 540:
6611 return access_type_t::RO;
6612 case 544:
6613 return access_type_t::RO;
6614 case 548:
6615 return access_type_t::RO;
6616 case 552:
6617 return access_type_t::RO;
6618 case 556:
6619 return access_type_t::RO;
6620 case 560:
6621 return access_type_t::RO;
6622 case 564:
6623 return access_type_t::RO;
6624 case 568:
6625 return access_type_t::RO;
6626 case 572:
6627 return access_type_t::RO;
6628 case 576:
6629 return access_type_t::RO;
6630 case 580:
6631 return access_type_t::RO;
6632 case 584:
6633 return access_type_t::RO;
6634 case 588:
6635 return access_type_t::RO;
6636 case 592:
6637 return access_type_t::RO;
6638 case 596:
6639 return access_type_t::RO;
6640 case 600:
6641 return access_type_t::RO;
6642 case 604:
6643 return access_type_t::RO;
6644 case 608:
6645 return access_type_t::RO;
6646 case 612:
6647 return access_type_t::RO;
6648 case 616:
6649 return access_type_t::RO;
6650 case 620:
6651 return access_type_t::RO;
6652 case 624:
6653 return access_type_t::RO;
6654 case 628:
6655 return access_type_t::RO;
6656 case 632:
6657 return access_type_t::RO;
6658 case 636:
6659 return access_type_t::RO;
6660 case 640:
6661 return access_type_t::RO;
6662 case 644:
6663 return access_type_t::RO;
6664 case 700:
6665 return access_type_t::RO;
6666 case 2048:
6667 return access_type_t::RW;
6668 case 2052:
6669 return access_type_t::RW;
6670 case 2056:
6671 return access_type_t::RW;
6672 case 2060:
6673 return access_type_t::RW;
6674 case 2064:
6675 return access_type_t::RW;
6676 case 2068:
6677 return access_type_t::RW;
6678 case 2076:
6679 return access_type_t::RW;
6680 case 2084:
6681 return access_type_t::RW;
6682 case 2088:
6683 return access_type_t::RW;
6684 case 2092:
6685 return access_type_t::RW;
6686 case 2096:
6687 return access_type_t::RW;
6688 case 2100:
6689 return access_type_t::RW;
6690 case 2108:
6691 return access_type_t::RW;
6692 case 2116:
6693 return access_type_t::RW;
6694 case 2120:
6695 return access_type_t::RW;
6696 case 2124:
6697 return access_type_t::RW;
6698 case 2128:
6699 return access_type_t::RW;
6700 case 2132:
6701 return access_type_t::RW;
6702 case 2136:
6703 return access_type_t::RW;
6704 case 2140:
6705 return access_type_t::RW;
6706 case 2144:
6707 return access_type_t::RW;
6708 case 2152:
6709 return access_type_t::RW;
6710 case 2156:
6711 return access_type_t::RW;
6712 case 2160:
6713 return access_type_t::RW;
6714 case 2172:
6715 return access_type_t::RW;
6716 case 2176:
6717 return access_type_t::RW;
6718 case 2180:
6719 return access_type_t::RW;
6720 case 2184:
6721 return access_type_t::RW;
6722 case 2188:
6723 return access_type_t::RW;
6724 case 2192:
6725 return access_type_t::RW;
6726 case 2196:
6727 return access_type_t::RW;
6728 case 2200:
6729 return access_type_t::RW;
6730 case 2204:
6731 return access_type_t::RW;
6732 case 2208:
6733 return access_type_t::RW;
6734 case 2212:
6735 return access_type_t::RW;
6736 case 2228:
6737 return access_type_t::RW;
6738 case 2236:
6739 return access_type_t::RW;
6740 case 2240:
6741 return access_type_t::RW;
6742 case 2244:
6743 return access_type_t::RW;
6744 case 2248:
6745 return access_type_t::RW;
6746 case 2252:
6747 return access_type_t::RW;
6748 case 2304:
6749 return access_type_t::RW;
6750 case 2308:
6751 return access_type_t::RW;
6752 case 2324:
6753 return access_type_t::RW;
6754 case 2340:
6755 return access_type_t::RW;
6756 case 2344:
6757 return access_type_t::RW;
6758 case 2348:
6759 return access_type_t::RW;
6760 case 2352:
6761 return access_type_t::RW;
6762 case 2356:
6763 return access_type_t::RW;
6764 case 2364:
6765 return access_type_t::RW;
6766 case 2560:
6767 return access_type_t::RW;
6768 case 2564:
6769 return access_type_t::RW;
6770 case 2568:
6771 return access_type_t::RW;
6772 case 2572:
6773 return access_type_t::RW;
6774 case 2576:
6775 return access_type_t::RW;
6776 case 2580:
6777 return access_type_t::RW;
6778 case 2584:
6779 return access_type_t::RW;
6780 case 2588:
6781 return access_type_t::RW;
6782 case 2592:
6783 return access_type_t::RW;
6784 case 2596:
6785 return access_type_t::RW;
6786 case 2600:
6787 return access_type_t::RW;
6788 case 2604:
6789 return access_type_t::RW;
6790 case 2608:
6791 return access_type_t::RW;
6792 case 2612:
6793 return access_type_t::RW;
6794 case 2624:
6795 return access_type_t::RW;
6796 case 2628:
6797 return access_type_t::RW;
6798 case 2632:
6799 return access_type_t::RW;
6800 case 2636:
6801 return access_type_t::RW;
6802 case 2640:
6803 return access_type_t::RW;
6804 case 2644:
6805 return access_type_t::RW;
6806 case 2648:
6807 return access_type_t::RW;
6808 case 2652:
6809 return access_type_t::RW;
6810 case 2656:
6811 return access_type_t::RW;
6812 case 2660:
6813 return access_type_t::RW;
6814 case 2664:
6815 return access_type_t::RW;
6816 case 2668:
6817 return access_type_t::RW;
6818 case 2672:
6819 return access_type_t::RW;
6820 case 2676:
6821 return access_type_t::RW;
6822 case 2688:
6823 return access_type_t::RW;
6824 case 2692:
6825 return access_type_t::RW;
6826 case 2696:
6827 return access_type_t::RW;
6828 case 2700:
6829 return access_type_t::RW;
6830 case 2704:
6831 return access_type_t::RW;
6832 case 2708:
6833 return access_type_t::RW;
6834 case 2712:
6835 return access_type_t::RW;
6836 case 2720:
6837 return access_type_t::RW;
6838 case 2724:
6839 return access_type_t::RW;
6840 case 2728:
6841 return access_type_t::RW;
6842 case 2732:
6843 return access_type_t::RW;
6844 case 2736:
6845 return access_type_t::RW;
6846 case 2752:
6847 return access_type_t::RW;
6848 case 2756:
6849 return access_type_t::RW;
6850 case 2760:
6851 return access_type_t::RW;
6852 case 2764:
6853 return access_type_t::RW;
6854 case 2768:
6855 return access_type_t::RW;
6856 case 2772:
6857 return access_type_t::RW;
6858 case 2776:
6859 return access_type_t::RW;
6860 case 2780:
6861 return access_type_t::RW;
6862 case 2784:
6863 return access_type_t::RW;
6864 case 2788:
6865 return access_type_t::RW;
6866 case 2816:
6867 return access_type_t::RW;
6868 case 2820:
6869 return access_type_t::RW;
6870 case 2824:
6871 return access_type_t::RW;
6872 case 2828:
6873 return access_type_t::RW;
6874 case 2832:
6875 return access_type_t::RW;
6876 case 2836:
6877 return access_type_t::RW;
6878 case 2840:
6879 return access_type_t::RW;
6880 case 2844:
6881 return access_type_t::RW;
6882 case 2848:
6883 return access_type_t::RW;
6884 case 2852:
6885 return access_type_t::RW;
6886 case 2856:
6887 return access_type_t::RW;
6888 case 2860:
6889 return access_type_t::RW;
6890 case 2864:
6891 return access_type_t::RW;
6892 case 2868:
6893 return access_type_t::RW;
6894 case 2880:
6895 return access_type_t::RW;
6896 case 2884:
6897 return access_type_t::RW;
6898 case 2888:
6899 return access_type_t::RW;
6900 case 2892:
6901 return access_type_t::RW;
6902 case 2896:
6903 return access_type_t::RW;
6904 case 2900:
6905 return access_type_t::RW;
6906 case 2904:
6907 return access_type_t::RW;
6908 case 384:
6909 return access_type_t::RW;
6910 case 388:
6911 return access_type_t::RW;
6912 case 392:
6913 return access_type_t::RW;
6914 case 396:
6915 return access_type_t::RW;
6916 case 400:
6917 return access_type_t::RW;
6918 case 404:
6919 return access_type_t::RW;
6920 case 408:
6921 return access_type_t::RW;
6922 case 416:
6923 return access_type_t::RW;
6924 case 420:
6925 return access_type_t::RW;
6926 case 424:
6927 return access_type_t::RW;
6928 case 428:
6929 return access_type_t::RW;
6930 case 768:
6931 return access_type_t::RW;
6932 case 772:
6933 return access_type_t::RW;
6934 case 776:
6935 return access_type_t::RW;
6936 case 780:
6937 return access_type_t::RW;
6938 case 896:
6939 return access_type_t::RW;
6940 case 900:
6941 return access_type_t::RW;
6942 case 904:
6943 return access_type_t::RW;
6944 case 908:
6945 return access_type_t::RW;
6946 case 1024:
6947 return access_type_t::RW;
6948 case 1028:
6949 return access_type_t::RW;
6950 case 1032:
6951 return access_type_t::RW;
6952 case 1036:
6953 return access_type_t::RW;
6954 case 1040:
6955 return access_type_t::RW;
6956 case 1044:
6957 return access_type_t::RW;
6958 case 1048:
6959 return access_type_t::RW;
6960 case 1052:
6961 return access_type_t::RW;
6962 case 1056:
6963 return access_type_t::RW;
6964 case 1060:
6965 return access_type_t::RW;
6966 case 1064:
6967 return access_type_t::RW;
6968 case 1068:
6969 return access_type_t::RW;
6970 case 1072:
6971 return access_type_t::RW;
6972 case 1076:
6973 return access_type_t::RW;
6974 case 1080:
6975 return access_type_t::RW;
6976 case 1084:
6977 return access_type_t::RW;
6978 case 1088:
6979 return access_type_t::RW;
6980 case 1092:
6981 return access_type_t::RW;
6982 case 1096:
6983 return access_type_t::RW;
6984 case 1100:
6985 return access_type_t::RW;
6986 case 1104:
6987 return access_type_t::RW;
6988 case 1108:
6989 return access_type_t::RW;
6990 case 1112:
6991 return access_type_t::RW;
6992 case 1116:
6993 return access_type_t::RW;
6994 case 1120:
6995 return access_type_t::RW;
6996 case 1124:
6997 return access_type_t::RW;
6998 case 1128:
6999 return access_type_t::RW;
7000 case 1132:
7001 return access_type_t::RW;
7002 case 1136:
7003 return access_type_t::RW;
7004 case 1140:
7005 return access_type_t::RW;
7006 case 1144:
7007 return access_type_t::RW;
7008 case 1148:
7009 return access_type_t::RW;
7010 case 1152:
7011 return access_type_t::RW;
7012 case 1156:
7013 return access_type_t::RW;
7014 case 1160:
7015 return access_type_t::RW;
7016 case 1164:
7017 return access_type_t::RW;
7018 case 1168:
7019 return access_type_t::RW;
7020 case 1172:
7021 return access_type_t::RW;
7022 case 1176:
7023 return access_type_t::RW;
7024 case 1180:
7025 return access_type_t::RW;
7026 case 1184:
7027 return access_type_t::RW;
7028 case 1188:
7029 return access_type_t::RW;
7030 case 1192:
7031 return access_type_t::RW;
7032 case 1196:
7033 return access_type_t::RW;
7034 case 1200:
7035 return access_type_t::RW;
7036 case 1204:
7037 return access_type_t::RW;
7038 case 1208:
7039 return access_type_t::RW;
7040 case 1212:
7041 return access_type_t::RW;
7042 case 1216:
7043 return access_type_t::RW;
7044 case 1220:
7045 return access_type_t::RW;
7046 case 1224:
7047 return access_type_t::RW;
7048 case 1228:
7049 return access_type_t::RW;
7050 case 1232:
7051 return access_type_t::RW;
7052 case 1236:
7053 return access_type_t::RW;
7054 case 1240:
7055 return access_type_t::RW;
7056 case 1244:
7057 return access_type_t::RW;
7058 case 1248:
7059 return access_type_t::RW;
7060 case 1252:
7061 return access_type_t::RW;
7062 case 1256:
7063 return access_type_t::RW;
7064 case 1260:
7065 return access_type_t::RW;
7066 case 1264:
7067 return access_type_t::RW;
7068 case 1268:
7069 return access_type_t::RW;
7070 case 1272:
7071 return access_type_t::RW;
7072 case 1276:
7073 return access_type_t::RW;
7074 case 1280:
7075 return access_type_t::RW;
7076 case 1284:
7077 return access_type_t::RW;
7078 case 1288:
7079 return access_type_t::RW;
7080 case 1292:
7081 return access_type_t::RW;
7082 case 1296:
7083 return access_type_t::RW;
7084 case 1300:
7085 return access_type_t::RW;
7086 case 1304:
7087 return access_type_t::RW;
7088 case 1308:
7089 return access_type_t::RW;
7090 case 1312:
7091 return access_type_t::RW;
7092 case 1316:
7093 return access_type_t::RW;
7094 case 1320:
7095 return access_type_t::RW;
7096 case 1324:
7097 return access_type_t::RW;
7098 case 1328:
7099 return access_type_t::RW;
7100 case 1332:
7101 return access_type_t::RW;
7102 case 1336:
7103 return access_type_t::RW;
7104 case 1340:
7105 return access_type_t::RW;
7106 case 1344:
7107 return access_type_t::RW;
7108 case 1348:
7109 return access_type_t::RW;
7110 case 1352:
7111 return access_type_t::RW;
7112 case 1356:
7113 return access_type_t::RW;
7114 case 1360:
7115 return access_type_t::RW;
7116 case 1364:
7117 return access_type_t::RW;
7118 case 1368:
7119 return access_type_t::RW;
7120 case 1372:
7121 return access_type_t::RW;
7122 case 1376:
7123 return access_type_t::RW;
7124 case 1380:
7125 return access_type_t::RW;
7126 case 1384:
7127 return access_type_t::RW;
7128 case 1388:
7129 return access_type_t::RW;
7130 case 1392:
7131 return access_type_t::RW;
7132 case 1396:
7133 return access_type_t::RW;
7134 case 1400:
7135 return access_type_t::RW;
7136 case 1404:
7137 return access_type_t::RW;
7138 case 1408:
7139 return access_type_t::RW;
7140 case 1412:
7141 return access_type_t::RW;
7142 case 1416:
7143 return access_type_t::RW;
7144 case 1420:
7145 return access_type_t::RW;
7146 case 1424:
7147 return access_type_t::RW;
7148 case 1428:
7149 return access_type_t::RW;
7150 case 1432:
7151 return access_type_t::RW;
7152 case 1436:
7153 return access_type_t::RW;
7154 case 1440:
7155 return access_type_t::RW;
7156 case 1444:
7157 return access_type_t::RW;
7158 case 1448:
7159 return access_type_t::RW;
7160 case 1452:
7161 return access_type_t::RW;
7162 case 1456:
7163 return access_type_t::RW;
7164 case 1460:
7165 return access_type_t::RW;
7166 case 1464:
7167 return access_type_t::RW;
7168 case 1468:
7169 return access_type_t::RW;
7170 case 1472:
7171 return access_type_t::RW;
7172 case 1476:
7173 return access_type_t::RW;
7174 case 1480:
7175 return access_type_t::RW;
7176 case 1484:
7177 return access_type_t::RW;
7178 case 1488:
7179 return access_type_t::RW;
7180 case 1492:
7181 return access_type_t::RW;
7182 case 1496:
7183 return access_type_t::RW;
7184 case 1500:
7185 return access_type_t::RW;
7186 case 1504:
7187 return access_type_t::RW;
7188 case 1508:
7189 return access_type_t::RW;
7190 case 1512:
7191 return access_type_t::RW;
7192 case 1516:
7193 return access_type_t::RW;
7194 case 1520:
7195 return access_type_t::RW;
7196 case 1524:
7197 return access_type_t::RW;
7198 case 1528:
7199 return access_type_t::RW;
7200 case 1532:
7201 return access_type_t::RW;
7202 case 1536:
7203 return access_type_t::RW;
7204 case 1540:
7205 return access_type_t::RW;
7206 case 1544:
7207 return access_type_t::RW;
7208 case 1548:
7209 return access_type_t::RW;
7210 case 1552:
7211 return access_type_t::RW;
7212 case 1556:
7213 return access_type_t::RW;
7214 case 1560:
7215 return access_type_t::RW;
7216 case 1564:
7217 return access_type_t::RW;
7218 case 1568:
7219 return access_type_t::RW;
7220 case 1572:
7221 return access_type_t::RW;
7222 case 1576:
7223 return access_type_t::RW;
7224 case 1580:
7225 return access_type_t::RW;
7226 case 1584:
7227 return access_type_t::RW;
7228 case 1588:
7229 return access_type_t::RW;
7230 case 1592:
7231 return access_type_t::RW;
7232 case 1596:
7233 return access_type_t::RW;
7234 case 1600:
7235 return access_type_t::RW;
7236 case 1604:
7237 return access_type_t::RW;
7238 case 1608:
7239 return access_type_t::RW;
7240 case 1612:
7241 return access_type_t::RW;
7242 case 1616:
7243 return access_type_t::RW;
7244 case 1620:
7245 return access_type_t::RW;
7246 case 1624:
7247 return access_type_t::RW;
7248 case 1628:
7249 return access_type_t::RW;
7250 case 1632:
7251 return access_type_t::RW;
7252 case 1636:
7253 return access_type_t::RW;
7254 case 1640:
7255 return access_type_t::RW;
7256 case 1644:
7257 return access_type_t::RW;
7258 case 1648:
7259 return access_type_t::RW;
7260 case 1652:
7261 return access_type_t::RW;
7262 case 1656:
7263 return access_type_t::RW;
7264 case 1660:
7265 return access_type_t::RW;
7266 case 1664:
7267 return access_type_t::RW;
7268 case 1668:
7269 return access_type_t::RW;
7270 case 1672:
7271 return access_type_t::RW;
7272 case 1676:
7273 return access_type_t::RW;
7274 case 1680:
7275 return access_type_t::RW;
7276 case 1684:
7277 return access_type_t::RW;
7278 case 1688:
7279 return access_type_t::RW;
7280 case 1692:
7281 return access_type_t::RW;
7282 case 1696:
7283 return access_type_t::RW;
7284 case 1700:
7285 return access_type_t::RW;
7286 case 1704:
7287 return access_type_t::RW;
7288 case 1708:
7289 return access_type_t::RW;
7290 case 1712:
7291 return access_type_t::RW;
7292 case 1716:
7293 return access_type_t::RW;
7294 case 1720:
7295 return access_type_t::RW;
7296 case 1724:
7297 return access_type_t::RW;
7298 case 1728:
7299 return access_type_t::RW;
7300 case 1732:
7301 return access_type_t::RW;
7302 case 1736:
7303 return access_type_t::RW;
7304 case 1740:
7305 return access_type_t::RW;
7306 case 1744:
7307 return access_type_t::RW;
7308 case 1748:
7309 return access_type_t::RW;
7310 case 1752:
7311 return access_type_t::RW;
7312 case 1756:
7313 return access_type_t::RW;
7314 case 1760:
7315 return access_type_t::RW;
7316 case 1764:
7317 return access_type_t::RW;
7318 case 1768:
7319 return access_type_t::RW;
7320 case 1772:
7321 return access_type_t::RW;
7322 case 1776:
7323 return access_type_t::RW;
7324 case 1780:
7325 return access_type_t::RW;
7326 case 1784:
7327 return access_type_t::RW;
7328 case 1788:
7329 return access_type_t::RW;
7330 case 1792:
7331 return access_type_t::RW;
7332 case 1796:
7333 return access_type_t::RW;
7334 case 1800:
7335 return access_type_t::RW;
7336 case 1804:
7337 return access_type_t::RW;
7338 case 1808:
7339 return access_type_t::RW;
7340 case 1812:
7341 return access_type_t::RW;
7342 case 1816:
7343 return access_type_t::RW;
7344 case 1820:
7345 return access_type_t::RW;
7346 case 1824:
7347 return access_type_t::RW;
7348 case 1828:
7349 return access_type_t::RW;
7350 case 1832:
7351 return access_type_t::RW;
7352 case 1836:
7353 return access_type_t::RW;
7354 case 1840:
7355 return access_type_t::RW;
7356 case 1844:
7357 return access_type_t::RW;
7358 case 1848:
7359 return access_type_t::RW;
7360 case 1852:
7361 return access_type_t::RW;
7362 case 1856:
7363 return access_type_t::RW;
7364 case 1860:
7365 return access_type_t::RW;
7366 case 1864:
7367 return access_type_t::RW;
7368 case 1868:
7369 return access_type_t::RW;
7370 case 1872:
7371 return access_type_t::RW;
7372 case 1876:
7373 return access_type_t::RW;
7374 case 1880:
7375 return access_type_t::RW;
7376 case 1884:
7377 return access_type_t::RW;
7378 case 1888:
7379 return access_type_t::RW;
7380 case 1892:
7381 return access_type_t::RW;
7382 case 1896:
7383 return access_type_t::RW;
7384 case 1900:
7385 return access_type_t::RW;
7386 case 1904:
7387 return access_type_t::RW;
7388 case 1908:
7389 return access_type_t::RW;
7390 case 1912:
7391 return access_type_t::RW;
7392 case 1916:
7393 return access_type_t::RW;
7394 case 1920:
7395 return access_type_t::RW;
7396 case 1924:
7397 return access_type_t::RW;
7398 case 1928:
7399 return access_type_t::RW;
7400 case 1932:
7401 return access_type_t::RW;
7402 case 1936:
7403 return access_type_t::RW;
7404 case 1940:
7405 return access_type_t::RW;
7406 case 1944:
7407 return access_type_t::RW;
7408 case 1948:
7409 return access_type_t::RW;
7410 case 1952:
7411 return access_type_t::RW;
7412 case 1956:
7413 return access_type_t::RW;
7414 case 1960:
7415 return access_type_t::RW;
7416 case 1964:
7417 return access_type_t::RW;
7418 case 1968:
7419 return access_type_t::RW;
7420 case 1972:
7421 return access_type_t::RW;
7422 case 1976:
7423 return access_type_t::RW;
7424 case 1980:
7425 return access_type_t::RW;
7426 case 1984:
7427 return access_type_t::RW;
7428 case 1988:
7429 return access_type_t::RW;
7430 case 1992:
7431 return access_type_t::RW;
7432 case 1996:
7433 return access_type_t::RW;
7434 case 2000:
7435 return access_type_t::RW;
7436 case 2004:
7437 return access_type_t::RW;
7438 case 2008:
7439 return access_type_t::RW;
7440 case 2012:
7441 return access_type_t::RW;
7442 case 2016:
7443 return access_type_t::RW;
7444 case 2020:
7445 return access_type_t::RW;
7446 case 2024:
7447 return access_type_t::RW;
7448 case 2028:
7449 return access_type_t::RW;
7450 case 2032:
7451 return access_type_t::RW;
7452 case 2036:
7453 return access_type_t::RW;
7454 case 2040:
7455 return access_type_t::RW;
7456 case 2044:
7457 return access_type_t::RW;
7458 default:
7459 throw std::runtime_error("invalid register address");
7460 }
7461 }
7462#endif //__cplusplus
7463};
7464
7465// Data structure for commands without payload
7466struct command_no_payload_t
7467{
7468 uint32_t cmd_code : 10;
7469 uint32_t must_be_zero0 : 6; // 0
7470 uint32_t param : 16;
7471#ifdef __cplusplus
7472 CONSTEXPR bool valid() const
7473 {
7474 return must_be_zero0 == 0;
7475 }
7476 CONSTEXPR void init()
7477 {
7478 must_be_zero0 = 0;
7479 }
7480 CONSTEXPR ::cmd0 get_cmd_code() const
7481 {
7482 return static_cast<::cmd0>(cmd_code);
7483 }
7484 CONSTEXPR command_no_payload_t &set_cmd_code(::cmd0 value)
7485 {
7486 cmd_code = static_cast<uint32_t>(value);
7487 return *this;
7488 }
7489 CONSTEXPR uint32_t get_param() const
7490 {
7491 return static_cast<uint32_t>(param);
7492 }
7493 CONSTEXPR command_no_payload_t &set_param(uint32_t value)
7494 {
7495 param = static_cast<uint32_t>(value);
7496 return *this;
7497 }
7498#endif //__cplusplus
7499};
7500
7501// Data structure for commands with payload
7502struct command_with_payload_t
7503{
7504 uint32_t cmd_code : 10;
7505 uint32_t must_be_zero : 4; // 0
7506 uint32_t payload_size : 2; // Min:1 Max:2
7507 uint32_t param : 16;
7508 uint32_t data : 32;
7509#ifdef __cplusplus
7510 CONSTEXPR bool valid() const
7511 {
7512 return must_be_zero == 0 && payload_size >= 1 && payload_size <= 2;
7513 }
7514 CONSTEXPR void init()
7515 {
7516 must_be_zero = 0;
7517 payload_size = 1;
7518 }
7519 CONSTEXPR ::cmd1 get_cmd_code() const
7520 {
7521 return static_cast<::cmd1>(cmd_code);
7522 }
7523 CONSTEXPR command_with_payload_t &set_cmd_code(::cmd1 value)
7524 {
7525 cmd_code = static_cast<uint32_t>(value);
7526 return *this;
7527 }
7528 CONSTEXPR uint32_t get_data() const
7529 {
7530 return static_cast<uint32_t>(data);
7531 }
7532 CONSTEXPR command_with_payload_t &set_data(uint32_t value)
7533 {
7534 data = static_cast<uint32_t>(value);
7535 return *this;
7536 }
7537 CONSTEXPR uint32_t get_param() const
7538 {
7539 return static_cast<uint32_t>(param);
7540 }
7541 CONSTEXPR command_with_payload_t &set_param(uint32_t value)
7542 {
7543 param = static_cast<uint32_t>(value);
7544 return *this;
7545 }
7546 CONSTEXPR uint32_t get_payload_size() const
7547 {
7548 return static_cast<uint32_t>(payload_size);
7549 }
7550 CONSTEXPR command_with_payload_t &set_payload_size(uint32_t value)
7551 {
7552 payload_size = static_cast<uint32_t>(value);
7553 return *this;
7554 }
7555#endif //__cplusplus
7556};
7557
7558// Move to stopped state once all commands to this point are done. Raise IRQ to the host and logically OR the mask into
7559// the status register upper 16 bits (see the status register)
7560struct npu_op_stop_t
7561{
7562 uint32_t cmd_code : 10; // NPU_OP_STOP
7563 uint32_t must_be_zero0 : 6; // 0
7564 uint32_t mask : 16;
7565#ifdef __cplusplus
7566 CONSTEXPR bool valid() const
7567 {
7568 return cmd_code == static_cast<uint32_t>(cmd0::NPU_OP_STOP) && must_be_zero0 == 0;
7569 }
7570 CONSTEXPR void init()
7571 {
7572 cmd_code = static_cast<uint32_t>(cmd0::NPU_OP_STOP);
7573 must_be_zero0 = 0;
7574 }
7575 CONSTEXPR ::cmd0 get_cmd_code() const
7576 {
7577 return static_cast<::cmd0>(cmd_code);
7578 }
7579 CONSTEXPR npu_op_stop_t &set_cmd_code(::cmd0 value)
7580 {
7581 cmd_code = static_cast<uint32_t>(value);
7582 return *this;
7583 }
7584 CONSTEXPR uint32_t get_mask() const
7585 {
7586 return static_cast<uint32_t>(mask);
7587 }
7588 CONSTEXPR npu_op_stop_t &set_mask(uint32_t value)
7589 {
7590 mask = static_cast<uint32_t>(value);
7591 return *this;
7592 }
7593#endif //__cplusplus
7594};
7595
7596// Raise IRQ to the host and logically OR the mask into the status register upper 16 bits (see the status register)
7597struct npu_op_irq_t
7598{
7599 uint32_t cmd_code : 10; // NPU_OP_IRQ
7600 uint32_t must_be_zero0 : 6; // 0
7601 uint32_t mask : 16;
7602#ifdef __cplusplus
7603 CONSTEXPR bool valid() const
7604 {
7605 return cmd_code == static_cast<uint32_t>(cmd0::NPU_OP_IRQ) && must_be_zero0 == 0;
7606 }
7607 CONSTEXPR void init()
7608 {
7609 cmd_code = static_cast<uint32_t>(cmd0::NPU_OP_IRQ);
7610 must_be_zero0 = 0;
7611 }
7612 CONSTEXPR ::cmd0 get_cmd_code() const
7613 {
7614 return static_cast<::cmd0>(cmd_code);
7615 }
7616 CONSTEXPR npu_op_irq_t &set_cmd_code(::cmd0 value)
7617 {
7618 cmd_code = static_cast<uint32_t>(value);
7619 return *this;
7620 }
7621 CONSTEXPR uint32_t get_mask() const
7622 {
7623 return static_cast<uint32_t>(mask);
7624 }
7625 CONSTEXPR npu_op_irq_t &set_mask(uint32_t value)
7626 {
7627 mask = static_cast<uint32_t>(value);
7628 return *this;
7629 }
7630#endif //__cplusplus
7631};
7632
7633// Start stripe with full convolution or deconvolution
7634struct npu_op_conv_t
7635{
7636 uint32_t cmd_code : 10; // NPU_OP_CONV
7637 uint32_t must_be_zero0 : 6; // 0
7638 uint32_t reserved0 : 16;
7639#ifdef __cplusplus
7640 CONSTEXPR bool valid() const
7641 {
7642 return cmd_code == static_cast<uint32_t>(cmd0::NPU_OP_CONV) && must_be_zero0 == 0;
7643 }
7644 CONSTEXPR void init()
7645 {
7646 cmd_code = static_cast<uint32_t>(cmd0::NPU_OP_CONV);
7647 must_be_zero0 = 0;
7648 }
7649 CONSTEXPR ::cmd0 get_cmd_code() const
7650 {
7651 return static_cast<::cmd0>(cmd_code);
7652 }
7653 CONSTEXPR npu_op_conv_t &set_cmd_code(::cmd0 value)
7654 {
7655 cmd_code = static_cast<uint32_t>(value);
7656 return *this;
7657 }
7658#endif //__cplusplus
7659};
7660
7661// Start stripe width depth-wise convolution or deconvolution operation
7662struct npu_op_depthwise_t
7663{
7664 uint32_t cmd_code : 10; // NPU_OP_DEPTHWISE
7665 uint32_t must_be_zero0 : 6; // 0
7666 uint32_t reserved0 : 16;
7667#ifdef __cplusplus
7668 CONSTEXPR bool valid() const
7669 {
7670 return cmd_code == static_cast<uint32_t>(cmd0::NPU_OP_DEPTHWISE) && must_be_zero0 == 0;
7671 }
7672 CONSTEXPR void init()
7673 {
7674 cmd_code = static_cast<uint32_t>(cmd0::NPU_OP_DEPTHWISE);
7675 must_be_zero0 = 0;
7676 }
7677 CONSTEXPR ::cmd0 get_cmd_code() const
7678 {
7679 return static_cast<::cmd0>(cmd_code);
7680 }
7681 CONSTEXPR npu_op_depthwise_t &set_cmd_code(::cmd0 value)
7682 {
7683 cmd_code = static_cast<uint32_t>(value);
7684 return *this;
7685 }
7686#endif //__cplusplus
7687};
7688
7689// Start stripe with pooling operation
7690struct npu_op_pool_t
7691{
7692 uint32_t cmd_code : 10; // NPU_OP_POOL
7693 uint32_t must_be_zero0 : 6; // 0
7694 uint32_t mode : 16;
7695#ifdef __cplusplus
7696 CONSTEXPR bool valid() const
7697 {
7698 return cmd_code == static_cast<uint32_t>(cmd0::NPU_OP_POOL) && must_be_zero0 == 0;
7699 }
7700 CONSTEXPR void init()
7701 {
7702 cmd_code = static_cast<uint32_t>(cmd0::NPU_OP_POOL);
7703 must_be_zero0 = 0;
7704 }
7705 CONSTEXPR ::cmd0 get_cmd_code() const
7706 {
7707 return static_cast<::cmd0>(cmd_code);
7708 }
7709 CONSTEXPR npu_op_pool_t &set_cmd_code(::cmd0 value)
7710 {
7711 cmd_code = static_cast<uint32_t>(value);
7712 return *this;
7713 }
7714 CONSTEXPR ::pooling_mode get_mode() const
7715 {
7716 return static_cast<::pooling_mode>(mode);
7717 }
7718 CONSTEXPR npu_op_pool_t &set_mode(::pooling_mode value)
7719 {
7720 mode = static_cast<uint32_t>(value);
7721 return *this;
7722 }
7723#endif //__cplusplus
7724};
7725
7726// Start stripe with pointwise operation
7727struct npu_op_elementwise_t
7728{
7729 uint32_t cmd_code : 10; // NPU_OP_ELEMENTWISE
7730 uint32_t must_be_zero0 : 6; // 0
7731 uint32_t mode : 16;
7732#ifdef __cplusplus
7733 CONSTEXPR bool valid() const
7734 {
7735 return cmd_code == static_cast<uint32_t>(cmd0::NPU_OP_ELEMENTWISE) && must_be_zero0 == 0;
7736 }
7737 CONSTEXPR void init()
7738 {
7739 cmd_code = static_cast<uint32_t>(cmd0::NPU_OP_ELEMENTWISE);
7740 must_be_zero0 = 0;
7741 }
7742 CONSTEXPR ::cmd0 get_cmd_code() const
7743 {
7744 return static_cast<::cmd0>(cmd_code);
7745 }
7746 CONSTEXPR npu_op_elementwise_t &set_cmd_code(::cmd0 value)
7747 {
7748 cmd_code = static_cast<uint32_t>(value);
7749 return *this;
7750 }
7751 CONSTEXPR ::elementwise_mode get_mode() const
7752 {
7753 return static_cast<::elementwise_mode>(mode);
7754 }
7755 CONSTEXPR npu_op_elementwise_t &set_mode(::elementwise_mode value)
7756 {
7757 mode = static_cast<uint32_t>(value);
7758 return *this;
7759 }
7760#endif //__cplusplus
7761};
7762
7763// Queue new DMA for the given channel with the given mode. Mode bit 0 specifies the source address type 0=external,
7764// 1=internal Mode bit 1 specifies the destination address type 0=external, 1=internal In Ethos-U55 there is only one
7765// user channel so channel=0. If the channel is fully in use then the command blocks until a new DMA can start
7766struct npu_op_dma_start_t
7767{
7768 uint32_t cmd_code : 10; // NPU_OP_DMA_START
7769 uint32_t must_be_zero0 : 6; // 0
7770 uint32_t channel_mode : 16;
7771#ifdef __cplusplus
7772 CONSTEXPR bool valid() const
7773 {
7774 return cmd_code == static_cast<uint32_t>(cmd0::NPU_OP_DMA_START) && must_be_zero0 == 0;
7775 }
7776 CONSTEXPR void init()
7777 {
7778 cmd_code = static_cast<uint32_t>(cmd0::NPU_OP_DMA_START);
7779 must_be_zero0 = 0;
7780 }
7781 CONSTEXPR uint32_t get_channel_mode() const
7782 {
7783 return static_cast<uint32_t>(channel_mode);
7784 }
7785 CONSTEXPR npu_op_dma_start_t &set_channel_mode(uint32_t value)
7786 {
7787 channel_mode = static_cast<uint32_t>(value);
7788 return *this;
7789 }
7790 CONSTEXPR ::cmd0 get_cmd_code() const
7791 {
7792 return static_cast<::cmd0>(cmd_code);
7793 }
7794 CONSTEXPR npu_op_dma_start_t &set_cmd_code(::cmd0 value)
7795 {
7796 cmd_code = static_cast<uint32_t>(value);
7797 return *this;
7798 }
7799#endif //__cplusplus
7800};
7801
7802// Wait for the DMA channel to have k or fewer active descriptors outstanding. In Ethos-U55 there is only one user
7803// channel so channel=0. In Ethos-U55 there is only one descriptor per channel so k=0 and the command waits for the
7804// single DMA to be complete.
7805struct npu_op_dma_wait_t
7806{
7807 uint32_t cmd_code : 10; // NPU_OP_DMA_WAIT
7808 uint32_t must_be_zero0 : 6; // 0
7809 uint32_t reserved0 : 16;
7810#ifdef __cplusplus
7811 CONSTEXPR bool valid() const
7812 {
7813 return cmd_code == static_cast<uint32_t>(cmd0::NPU_OP_DMA_WAIT) && must_be_zero0 == 0;
7814 }
7815 CONSTEXPR void init()
7816 {
7817 cmd_code = static_cast<uint32_t>(cmd0::NPU_OP_DMA_WAIT);
7818 must_be_zero0 = 0;
7819 }
7820 CONSTEXPR ::cmd0 get_cmd_code() const
7821 {
7822 return static_cast<::cmd0>(cmd_code);
7823 }
7824 CONSTEXPR npu_op_dma_wait_t &set_cmd_code(::cmd0 value)
7825 {
7826 cmd_code = static_cast<uint32_t>(value);
7827 return *this;
7828 }
7829#endif //__cplusplus
7830};
7831
7832// Wait for n or fewer kernel operations to be remaining (not complete) before starting the next command. A kernel
7833// operation is Conv, Depthwise, Pool, VectorProd Elementwise. This command is typically placed before an
7834// NPU_OP_DMA_START command to prevent the DMA from starting until a previous kernel operation reading the memory has
7835// completed.
7836struct npu_op_kernel_wait_t
7837{
7838 uint32_t cmd_code : 10; // NPU_OP_KERNEL_WAIT
7839 uint32_t must_be_zero0 : 6; // 0
7840 uint32_t param : 16;
7841#ifdef __cplusplus
7842 CONSTEXPR bool valid() const
7843 {
7844 return cmd_code == static_cast<uint32_t>(cmd0::NPU_OP_KERNEL_WAIT) && must_be_zero0 == 0;
7845 }
7846 CONSTEXPR void init()
7847 {
7848 cmd_code = static_cast<uint32_t>(cmd0::NPU_OP_KERNEL_WAIT);
7849 must_be_zero0 = 0;
7850 }
7851 CONSTEXPR ::cmd0 get_cmd_code() const
7852 {
7853 return static_cast<::cmd0>(cmd_code);
7854 }
7855 CONSTEXPR npu_op_kernel_wait_t &set_cmd_code(::cmd0 value)
7856 {
7857 cmd_code = static_cast<uint32_t>(value);
7858 return *this;
7859 }
7860 CONSTEXPR uint32_t get_param() const
7861 {
7862 return static_cast<uint32_t>(param);
7863 }
7864 CONSTEXPR npu_op_kernel_wait_t &set_param(uint32_t value)
7865 {
7866 param = static_cast<uint32_t>(value);
7867 return *this;
7868 }
7869#endif //__cplusplus
7870};
7871
7872// Enable or disable PMU counting (debug feature only).
7873struct npu_op_pmu_mask_t
7874{
7875 uint32_t cmd_code : 10; // NPU_OP_PMU_MASK
7876 uint32_t must_be_zero0 : 6; // 0
7877 uint32_t param : 16;
7878#ifdef __cplusplus
7879 CONSTEXPR bool valid() const
7880 {
7881 return cmd_code == static_cast<uint32_t>(cmd0::NPU_OP_PMU_MASK) && must_be_zero0 == 0;
7882 }
7883 CONSTEXPR void init()
7884 {
7885 cmd_code = static_cast<uint32_t>(cmd0::NPU_OP_PMU_MASK);
7886 must_be_zero0 = 0;
7887 }
7888 CONSTEXPR ::cmd0 get_cmd_code() const
7889 {
7890 return static_cast<::cmd0>(cmd_code);
7891 }
7892 CONSTEXPR npu_op_pmu_mask_t &set_cmd_code(::cmd0 value)
7893 {
7894 cmd_code = static_cast<uint32_t>(value);
7895 return *this;
7896 }
7897 CONSTEXPR uint32_t get_param() const
7898 {
7899 return static_cast<uint32_t>(param);
7900 }
7901 CONSTEXPR npu_op_pmu_mask_t &set_param(uint32_t value)
7902 {
7903 param = static_cast<uint32_t>(value);
7904 return *this;
7905 }
7906#endif //__cplusplus
7907};
7908
7909// IFM top pad
7910struct npu_set_ifm_pad_top_t
7911{
7912 uint32_t cmd_code : 10; // NPU_SET_IFM_PAD_TOP
7913 uint32_t must_be_zero0 : 6; // 0
7914 uint32_t param : 16;
7915#ifdef __cplusplus
7916 CONSTEXPR bool valid() const
7917 {
7918 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_IFM_PAD_TOP) && must_be_zero0 == 0;
7919 }
7920 CONSTEXPR void init()
7921 {
7922 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_IFM_PAD_TOP);
7923 must_be_zero0 = 0;
7924 }
7925 CONSTEXPR ::cmd0 get_cmd_code() const
7926 {
7927 return static_cast<::cmd0>(cmd_code);
7928 }
7929 CONSTEXPR npu_set_ifm_pad_top_t &set_cmd_code(::cmd0 value)
7930 {
7931 cmd_code = static_cast<uint32_t>(value);
7932 return *this;
7933 }
7934 CONSTEXPR uint32_t get_param() const
7935 {
7936 return static_cast<uint32_t>(param);
7937 }
7938 CONSTEXPR npu_set_ifm_pad_top_t &set_param(uint32_t value)
7939 {
7940 param = static_cast<uint32_t>(value);
7941 return *this;
7942 }
7943#endif //__cplusplus
7944};
7945
7946// IFM left pad
7947struct npu_set_ifm_pad_left_t
7948{
7949 uint32_t cmd_code : 10; // NPU_SET_IFM_PAD_LEFT
7950 uint32_t must_be_zero0 : 6; // 0
7951 uint32_t param : 16;
7952#ifdef __cplusplus
7953 CONSTEXPR bool valid() const
7954 {
7955 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_IFM_PAD_LEFT) && must_be_zero0 == 0;
7956 }
7957 CONSTEXPR void init()
7958 {
7959 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_IFM_PAD_LEFT);
7960 must_be_zero0 = 0;
7961 }
7962 CONSTEXPR ::cmd0 get_cmd_code() const
7963 {
7964 return static_cast<::cmd0>(cmd_code);
7965 }
7966 CONSTEXPR npu_set_ifm_pad_left_t &set_cmd_code(::cmd0 value)
7967 {
7968 cmd_code = static_cast<uint32_t>(value);
7969 return *this;
7970 }
7971 CONSTEXPR uint32_t get_param() const
7972 {
7973 return static_cast<uint32_t>(param);
7974 }
7975 CONSTEXPR npu_set_ifm_pad_left_t &set_param(uint32_t value)
7976 {
7977 param = static_cast<uint32_t>(value);
7978 return *this;
7979 }
7980#endif //__cplusplus
7981};
7982
7983// IFM right pad
7984struct npu_set_ifm_pad_right_t
7985{
7986 uint32_t cmd_code : 10; // NPU_SET_IFM_PAD_RIGHT
7987 uint32_t must_be_zero0 : 6; // 0
7988 uint32_t param : 16;
7989#ifdef __cplusplus
7990 CONSTEXPR bool valid() const
7991 {
7992 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_IFM_PAD_RIGHT) && must_be_zero0 == 0;
7993 }
7994 CONSTEXPR void init()
7995 {
7996 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_IFM_PAD_RIGHT);
7997 must_be_zero0 = 0;
7998 }
7999 CONSTEXPR ::cmd0 get_cmd_code() const
8000 {
8001 return static_cast<::cmd0>(cmd_code);
8002 }
8003 CONSTEXPR npu_set_ifm_pad_right_t &set_cmd_code(::cmd0 value)
8004 {
8005 cmd_code = static_cast<uint32_t>(value);
8006 return *this;
8007 }
8008 CONSTEXPR uint32_t get_param() const
8009 {
8010 return static_cast<uint32_t>(param);
8011 }
8012 CONSTEXPR npu_set_ifm_pad_right_t &set_param(uint32_t value)
8013 {
8014 param = static_cast<uint32_t>(value);
8015 return *this;
8016 }
8017#endif //__cplusplus
8018};
8019
8020// IFM bottom pad
8021struct npu_set_ifm_pad_bottom_t
8022{
8023 uint32_t cmd_code : 10; // NPU_SET_IFM_PAD_BOTTOM
8024 uint32_t must_be_zero0 : 6; // 0
8025 uint32_t param : 16;
8026#ifdef __cplusplus
8027 CONSTEXPR bool valid() const
8028 {
8029 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_IFM_PAD_BOTTOM) && must_be_zero0 == 0;
8030 }
8031 CONSTEXPR void init()
8032 {
8033 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_IFM_PAD_BOTTOM);
8034 must_be_zero0 = 0;
8035 }
8036 CONSTEXPR ::cmd0 get_cmd_code() const
8037 {
8038 return static_cast<::cmd0>(cmd_code);
8039 }
8040 CONSTEXPR npu_set_ifm_pad_bottom_t &set_cmd_code(::cmd0 value)
8041 {
8042 cmd_code = static_cast<uint32_t>(value);
8043 return *this;
8044 }
8045 CONSTEXPR uint32_t get_param() const
8046 {
8047 return static_cast<uint32_t>(param);
8048 }
8049 CONSTEXPR npu_set_ifm_pad_bottom_t &set_param(uint32_t value)
8050 {
8051 param = static_cast<uint32_t>(value);
8052 return *this;
8053 }
8054#endif //__cplusplus
8055};
8056
8057// Number of input channels - 1
8058struct npu_set_ifm_depth_m1_t
8059{
8060 uint32_t cmd_code : 10; // NPU_SET_IFM_DEPTH_M1
8061 uint32_t must_be_zero0 : 6; // 0
8062 uint32_t param : 16;
8063#ifdef __cplusplus
8064 CONSTEXPR bool valid() const
8065 {
8066 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_IFM_DEPTH_M1) && must_be_zero0 == 0;
8067 }
8068 CONSTEXPR void init()
8069 {
8070 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_IFM_DEPTH_M1);
8071 must_be_zero0 = 0;
8072 }
8073 CONSTEXPR ::cmd0 get_cmd_code() const
8074 {
8075 return static_cast<::cmd0>(cmd_code);
8076 }
8077 CONSTEXPR npu_set_ifm_depth_m1_t &set_cmd_code(::cmd0 value)
8078 {
8079 cmd_code = static_cast<uint32_t>(value);
8080 return *this;
8081 }
8082 CONSTEXPR uint32_t get_param() const
8083 {
8084 return static_cast<uint32_t>(param);
8085 }
8086 CONSTEXPR npu_set_ifm_depth_m1_t &set_param(uint32_t value)
8087 {
8088 param = static_cast<uint32_t>(value);
8089 return *this;
8090 }
8091#endif //__cplusplus
8092};
8093
8094// Set IFM precision
8095struct npu_set_ifm_precision_t
8096{
8097 uint32_t cmd_code : 10; // NPU_SET_IFM_PRECISION
8098 uint32_t must_be_zero0 : 6; // 0
Diqing Zhonga9f38d52020-04-27 11:00:13 +02008099 uint32_t precision : 4;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008100 uint32_t reserved0 : 2;
8101 uint32_t format : 2;
8102 uint32_t scale_mode : 2;
8103 uint32_t reserved1 : 4;
8104 uint32_t round_mode : 2;
8105#ifdef __cplusplus
8106 CONSTEXPR bool valid() const
8107 {
8108 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_IFM_PRECISION) && must_be_zero0 == 0;
8109 }
8110 CONSTEXPR void init()
8111 {
8112 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_IFM_PRECISION);
8113 must_be_zero0 = 0;
8114 }
8115 CONSTEXPR ::cmd0 get_cmd_code() const
8116 {
8117 return static_cast<::cmd0>(cmd_code);
8118 }
8119 CONSTEXPR npu_set_ifm_precision_t &set_cmd_code(::cmd0 value)
8120 {
8121 cmd_code = static_cast<uint32_t>(value);
8122 return *this;
8123 }
8124 CONSTEXPR ::data_format get_format() const
8125 {
8126 return static_cast<::data_format>(format);
8127 }
8128 CONSTEXPR npu_set_ifm_precision_t &set_format(::data_format value)
8129 {
8130 format = static_cast<uint32_t>(value);
8131 return *this;
8132 }
Diqing Zhonga9f38d52020-04-27 11:00:13 +02008133 CONSTEXPR ::ifm_precision get_precision() const
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008134 {
Diqing Zhonga9f38d52020-04-27 11:00:13 +02008135 return static_cast<::ifm_precision>(precision);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008136 }
Diqing Zhonga9f38d52020-04-27 11:00:13 +02008137 CONSTEXPR npu_set_ifm_precision_t &set_precision(::ifm_precision value)
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008138 {
Diqing Zhonga9f38d52020-04-27 11:00:13 +02008139 precision = static_cast<uint32_t>(value);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008140 return *this;
8141 }
8142 CONSTEXPR ::rounding get_round_mode() const
8143 {
8144 return static_cast<::rounding>(round_mode);
8145 }
8146 CONSTEXPR npu_set_ifm_precision_t &set_round_mode(::rounding value)
8147 {
8148 round_mode = static_cast<uint32_t>(value);
8149 return *this;
8150 }
8151 CONSTEXPR ::ifm_scale_mode get_scale_mode() const
8152 {
8153 return static_cast<::ifm_scale_mode>(scale_mode);
8154 }
8155 CONSTEXPR npu_set_ifm_precision_t &set_scale_mode(::ifm_scale_mode value)
8156 {
8157 scale_mode = static_cast<uint32_t>(value);
8158 return *this;
8159 }
8160#endif //__cplusplus
8161};
8162
8163// b[1:0] = upscale mode (0=none, 1=2x2 nearest, 2=2x2 transpose)
8164struct npu_set_ifm_upscale_t
8165{
8166 uint32_t cmd_code : 10; // NPU_SET_IFM_UPSCALE
8167 uint32_t must_be_zero0 : 6; // 0
8168 uint32_t mode : 2;
8169 uint32_t reserved0 : 14;
8170#ifdef __cplusplus
8171 CONSTEXPR bool valid() const
8172 {
8173 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_IFM_UPSCALE) && must_be_zero0 == 0;
8174 }
8175 CONSTEXPR void init()
8176 {
8177 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_IFM_UPSCALE);
8178 must_be_zero0 = 0;
8179 }
8180 CONSTEXPR ::cmd0 get_cmd_code() const
8181 {
8182 return static_cast<::cmd0>(cmd_code);
8183 }
8184 CONSTEXPR npu_set_ifm_upscale_t &set_cmd_code(::cmd0 value)
8185 {
8186 cmd_code = static_cast<uint32_t>(value);
8187 return *this;
8188 }
8189 CONSTEXPR ::resampling_mode get_mode() const
8190 {
8191 return static_cast<::resampling_mode>(mode);
8192 }
8193 CONSTEXPR npu_set_ifm_upscale_t &set_mode(::resampling_mode value)
8194 {
8195 mode = static_cast<uint32_t>(value);
8196 return *this;
8197 }
8198#endif //__cplusplus
8199};
8200
8201// Zero point offset (so value that 0 is encoded as)
8202struct npu_set_ifm_zero_point_t
8203{
8204 uint32_t cmd_code : 10; // NPU_SET_IFM_ZERO_POINT
8205 uint32_t must_be_zero0 : 6; // 0
8206 uint32_t param : 16;
8207#ifdef __cplusplus
8208 CONSTEXPR bool valid() const
8209 {
8210 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_IFM_ZERO_POINT) && must_be_zero0 == 0;
8211 }
8212 CONSTEXPR void init()
8213 {
8214 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_IFM_ZERO_POINT);
8215 must_be_zero0 = 0;
8216 }
8217 CONSTEXPR ::cmd0 get_cmd_code() const
8218 {
8219 return static_cast<::cmd0>(cmd_code);
8220 }
8221 CONSTEXPR npu_set_ifm_zero_point_t &set_cmd_code(::cmd0 value)
8222 {
8223 cmd_code = static_cast<uint32_t>(value);
8224 return *this;
8225 }
8226 CONSTEXPR uint32_t get_param() const
8227 {
8228 return static_cast<uint32_t>(param);
8229 }
8230 CONSTEXPR npu_set_ifm_zero_point_t &set_param(uint32_t value)
8231 {
8232 param = static_cast<uint32_t>(value);
8233 return *this;
8234 }
8235#endif //__cplusplus
8236};
8237
8238// IFM Tile 0 and tile 2 (width-1)
8239struct npu_set_ifm_width0_m1_t
8240{
8241 uint32_t cmd_code : 10; // NPU_SET_IFM_WIDTH0_M1
8242 uint32_t must_be_zero0 : 6; // 0
8243 uint32_t param : 16;
8244#ifdef __cplusplus
8245 CONSTEXPR bool valid() const
8246 {
8247 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_IFM_WIDTH0_M1) && must_be_zero0 == 0;
8248 }
8249 CONSTEXPR void init()
8250 {
8251 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_IFM_WIDTH0_M1);
8252 must_be_zero0 = 0;
8253 }
8254 CONSTEXPR ::cmd0 get_cmd_code() const
8255 {
8256 return static_cast<::cmd0>(cmd_code);
8257 }
8258 CONSTEXPR npu_set_ifm_width0_m1_t &set_cmd_code(::cmd0 value)
8259 {
8260 cmd_code = static_cast<uint32_t>(value);
8261 return *this;
8262 }
8263 CONSTEXPR uint32_t get_param() const
8264 {
8265 return static_cast<uint32_t>(param);
8266 }
8267 CONSTEXPR npu_set_ifm_width0_m1_t &set_param(uint32_t value)
8268 {
8269 param = static_cast<uint32_t>(value);
8270 return *this;
8271 }
8272#endif //__cplusplus
8273};
8274
8275// IFM Tile 0 (height-1)
8276struct npu_set_ifm_height0_m1_t
8277{
8278 uint32_t cmd_code : 10; // NPU_SET_IFM_HEIGHT0_M1
8279 uint32_t must_be_zero0 : 6; // 0
8280 uint32_t param : 16;
8281#ifdef __cplusplus
8282 CONSTEXPR bool valid() const
8283 {
8284 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_IFM_HEIGHT0_M1) && must_be_zero0 == 0;
8285 }
8286 CONSTEXPR void init()
8287 {
8288 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_IFM_HEIGHT0_M1);
8289 must_be_zero0 = 0;
8290 }
8291 CONSTEXPR ::cmd0 get_cmd_code() const
8292 {
8293 return static_cast<::cmd0>(cmd_code);
8294 }
8295 CONSTEXPR npu_set_ifm_height0_m1_t &set_cmd_code(::cmd0 value)
8296 {
8297 cmd_code = static_cast<uint32_t>(value);
8298 return *this;
8299 }
8300 CONSTEXPR uint32_t get_param() const
8301 {
8302 return static_cast<uint32_t>(param);
8303 }
8304 CONSTEXPR npu_set_ifm_height0_m1_t &set_param(uint32_t value)
8305 {
8306 param = static_cast<uint32_t>(value);
8307 return *this;
8308 }
8309#endif //__cplusplus
8310};
8311
8312// IFM Tile 1 (height-1)
8313struct npu_set_ifm_height1_m1_t
8314{
8315 uint32_t cmd_code : 10; // NPU_SET_IFM_HEIGHT1_M1
8316 uint32_t must_be_zero0 : 6; // 0
8317 uint32_t param : 16;
8318#ifdef __cplusplus
8319 CONSTEXPR bool valid() const
8320 {
8321 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_IFM_HEIGHT1_M1) && must_be_zero0 == 0;
8322 }
8323 CONSTEXPR void init()
8324 {
8325 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_IFM_HEIGHT1_M1);
8326 must_be_zero0 = 0;
8327 }
8328 CONSTEXPR ::cmd0 get_cmd_code() const
8329 {
8330 return static_cast<::cmd0>(cmd_code);
8331 }
8332 CONSTEXPR npu_set_ifm_height1_m1_t &set_cmd_code(::cmd0 value)
8333 {
8334 cmd_code = static_cast<uint32_t>(value);
8335 return *this;
8336 }
8337 CONSTEXPR uint32_t get_param() const
8338 {
8339 return static_cast<uint32_t>(param);
8340 }
8341 CONSTEXPR npu_set_ifm_height1_m1_t &set_param(uint32_t value)
8342 {
8343 param = static_cast<uint32_t>(value);
8344 return *this;
8345 }
8346#endif //__cplusplus
8347};
8348
8349// End of IB0,IB1 buffers in the SHRAM in KB units. Multiple of 2.
8350struct npu_set_ifm_ib_end_t
8351{
8352 uint32_t cmd_code : 10; // NPU_SET_IFM_IB_END
8353 uint32_t must_be_zero0 : 6; // 0
8354 uint32_t param : 16;
8355#ifdef __cplusplus
8356 CONSTEXPR bool valid() const
8357 {
8358 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_IFM_IB_END) && must_be_zero0 == 0;
8359 }
8360 CONSTEXPR void init()
8361 {
8362 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_IFM_IB_END);
8363 must_be_zero0 = 0;
8364 }
8365 CONSTEXPR ::cmd0 get_cmd_code() const
8366 {
8367 return static_cast<::cmd0>(cmd_code);
8368 }
8369 CONSTEXPR npu_set_ifm_ib_end_t &set_cmd_code(::cmd0 value)
8370 {
8371 cmd_code = static_cast<uint32_t>(value);
8372 return *this;
8373 }
8374 CONSTEXPR uint32_t get_param() const
8375 {
8376 return static_cast<uint32_t>(param);
8377 }
8378 CONSTEXPR npu_set_ifm_ib_end_t &set_param(uint32_t value)
8379 {
8380 param = static_cast<uint32_t>(value);
8381 return *this;
8382 }
8383#endif //__cplusplus
8384};
8385
8386// Index n for IFM access: BasePointer[n] is added to all IFM offsets
8387struct npu_set_ifm_region_t
8388{
8389 uint32_t cmd_code : 10; // NPU_SET_IFM_REGION
8390 uint32_t must_be_zero0 : 6; // 0
8391 uint32_t param : 16;
8392#ifdef __cplusplus
8393 CONSTEXPR bool valid() const
8394 {
8395 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_IFM_REGION) && must_be_zero0 == 0;
8396 }
8397 CONSTEXPR void init()
8398 {
8399 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_IFM_REGION);
8400 must_be_zero0 = 0;
8401 }
8402 CONSTEXPR ::cmd0 get_cmd_code() const
8403 {
8404 return static_cast<::cmd0>(cmd_code);
8405 }
8406 CONSTEXPR npu_set_ifm_region_t &set_cmd_code(::cmd0 value)
8407 {
8408 cmd_code = static_cast<uint32_t>(value);
8409 return *this;
8410 }
8411 CONSTEXPR uint32_t get_param() const
8412 {
8413 return static_cast<uint32_t>(param);
8414 }
8415 CONSTEXPR npu_set_ifm_region_t &set_param(uint32_t value)
8416 {
8417 param = static_cast<uint32_t>(value);
8418 return *this;
8419 }
8420#endif //__cplusplus
8421};
8422
8423// Output feature map width -1 (for the stripe to process)
8424struct npu_set_ofm_width_m1_t
8425{
8426 uint32_t cmd_code : 10; // NPU_SET_OFM_WIDTH_M1
8427 uint32_t must_be_zero0 : 6; // 0
8428 uint32_t param : 16;
8429#ifdef __cplusplus
8430 CONSTEXPR bool valid() const
8431 {
8432 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_OFM_WIDTH_M1) && must_be_zero0 == 0;
8433 }
8434 CONSTEXPR void init()
8435 {
8436 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_OFM_WIDTH_M1);
8437 must_be_zero0 = 0;
8438 }
8439 CONSTEXPR ::cmd0 get_cmd_code() const
8440 {
8441 return static_cast<::cmd0>(cmd_code);
8442 }
8443 CONSTEXPR npu_set_ofm_width_m1_t &set_cmd_code(::cmd0 value)
8444 {
8445 cmd_code = static_cast<uint32_t>(value);
8446 return *this;
8447 }
8448 CONSTEXPR uint32_t get_param() const
8449 {
8450 return static_cast<uint32_t>(param);
8451 }
8452 CONSTEXPR npu_set_ofm_width_m1_t &set_param(uint32_t value)
8453 {
8454 param = static_cast<uint32_t>(value);
8455 return *this;
8456 }
8457#endif //__cplusplus
8458};
8459
8460// Output feature map height -1 (for the stripe to process)
8461struct npu_set_ofm_height_m1_t
8462{
8463 uint32_t cmd_code : 10; // NPU_SET_OFM_HEIGHT_M1
8464 uint32_t must_be_zero0 : 6; // 0
8465 uint32_t param : 16;
8466#ifdef __cplusplus
8467 CONSTEXPR bool valid() const
8468 {
8469 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_OFM_HEIGHT_M1) && must_be_zero0 == 0;
8470 }
8471 CONSTEXPR void init()
8472 {
8473 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_OFM_HEIGHT_M1);
8474 must_be_zero0 = 0;
8475 }
8476 CONSTEXPR ::cmd0 get_cmd_code() const
8477 {
8478 return static_cast<::cmd0>(cmd_code);
8479 }
8480 CONSTEXPR npu_set_ofm_height_m1_t &set_cmd_code(::cmd0 value)
8481 {
8482 cmd_code = static_cast<uint32_t>(value);
8483 return *this;
8484 }
8485 CONSTEXPR uint32_t get_param() const
8486 {
8487 return static_cast<uint32_t>(param);
8488 }
8489 CONSTEXPR npu_set_ofm_height_m1_t &set_param(uint32_t value)
8490 {
8491 param = static_cast<uint32_t>(value);
8492 return *this;
8493 }
8494#endif //__cplusplus
8495};
8496
8497// Output feature map depth -1 (for the stripe to process)
8498struct npu_set_ofm_depth_m1_t
8499{
8500 uint32_t cmd_code : 10; // NPU_SET_OFM_DEPTH_M1
8501 uint32_t must_be_zero0 : 6; // 0
8502 uint32_t param : 16;
8503#ifdef __cplusplus
8504 CONSTEXPR bool valid() const
8505 {
8506 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_OFM_DEPTH_M1) && must_be_zero0 == 0;
8507 }
8508 CONSTEXPR void init()
8509 {
8510 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_OFM_DEPTH_M1);
8511 must_be_zero0 = 0;
8512 }
8513 CONSTEXPR ::cmd0 get_cmd_code() const
8514 {
8515 return static_cast<::cmd0>(cmd_code);
8516 }
8517 CONSTEXPR npu_set_ofm_depth_m1_t &set_cmd_code(::cmd0 value)
8518 {
8519 cmd_code = static_cast<uint32_t>(value);
8520 return *this;
8521 }
8522 CONSTEXPR uint32_t get_param() const
8523 {
8524 return static_cast<uint32_t>(param);
8525 }
8526 CONSTEXPR npu_set_ofm_depth_m1_t &set_param(uint32_t value)
8527 {
8528 param = static_cast<uint32_t>(value);
8529 return *this;
8530 }
8531#endif //__cplusplus
8532};
8533
8534// Set OFM precision
8535struct npu_set_ofm_precision_t
8536{
8537 uint32_t cmd_code : 10; // NPU_SET_OFM_PRECISION
8538 uint32_t must_be_zero0 : 6; // 0
8539 uint32_t precision : 3;
8540 uint32_t reserved0 : 3;
8541 uint32_t format : 2;
8542 uint32_t scaling : 1; // 0=Per channel scale/bias 1=Global scale (SET_OFM_SCALE), no bias
8543 uint32_t reserved1 : 5;
8544 uint32_t rounding : 2; // 0=TFL rounding 1=truncate towards zero 2=natural rounding
8545#ifdef __cplusplus
8546 CONSTEXPR bool valid() const
8547 {
8548 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_OFM_PRECISION) && must_be_zero0 == 0;
8549 }
8550 CONSTEXPR void init()
8551 {
8552 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_OFM_PRECISION);
8553 must_be_zero0 = 0;
8554 }
8555 CONSTEXPR ::cmd0 get_cmd_code() const
8556 {
8557 return static_cast<::cmd0>(cmd_code);
8558 }
8559 CONSTEXPR npu_set_ofm_precision_t &set_cmd_code(::cmd0 value)
8560 {
8561 cmd_code = static_cast<uint32_t>(value);
8562 return *this;
8563 }
8564 CONSTEXPR ::data_format get_format() const
8565 {
8566 return static_cast<::data_format>(format);
8567 }
8568 CONSTEXPR npu_set_ofm_precision_t &set_format(::data_format value)
8569 {
8570 format = static_cast<uint32_t>(value);
8571 return *this;
8572 }
8573 CONSTEXPR ::ofm_precision get_precision() const
8574 {
8575 return static_cast<::ofm_precision>(precision);
8576 }
8577 CONSTEXPR npu_set_ofm_precision_t &set_precision(::ofm_precision value)
8578 {
8579 precision = static_cast<uint32_t>(value);
8580 return *this;
8581 }
8582 CONSTEXPR ::rounding get_rounding() const
8583 {
8584 return static_cast<::rounding>(rounding);
8585 }
8586 CONSTEXPR npu_set_ofm_precision_t &set_rounding(::rounding value)
8587 {
8588 rounding = static_cast<uint32_t>(value);
8589 return *this;
8590 }
8591 CONSTEXPR uint32_t get_scaling() const
8592 {
8593 return static_cast<uint32_t>(scaling);
8594 }
8595 CONSTEXPR npu_set_ofm_precision_t &set_scaling(uint32_t value)
8596 {
8597 scaling = static_cast<uint32_t>(value);
8598 return *this;
8599 }
8600#endif //__cplusplus
8601};
8602
8603// TSU block width - 1 (provided sufficient data remaining)
8604struct npu_set_ofm_blk_width_m1_t
8605{
8606 uint32_t cmd_code : 10; // NPU_SET_OFM_BLK_WIDTH_M1
8607 uint32_t must_be_zero0 : 6; // 0
8608 uint32_t param : 16;
8609#ifdef __cplusplus
8610 CONSTEXPR bool valid() const
8611 {
8612 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_OFM_BLK_WIDTH_M1) && must_be_zero0 == 0;
8613 }
8614 CONSTEXPR void init()
8615 {
8616 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_OFM_BLK_WIDTH_M1);
8617 must_be_zero0 = 0;
8618 }
8619 CONSTEXPR ::cmd0 get_cmd_code() const
8620 {
8621 return static_cast<::cmd0>(cmd_code);
8622 }
8623 CONSTEXPR npu_set_ofm_blk_width_m1_t &set_cmd_code(::cmd0 value)
8624 {
8625 cmd_code = static_cast<uint32_t>(value);
8626 return *this;
8627 }
8628 CONSTEXPR uint32_t get_param() const
8629 {
8630 return static_cast<uint32_t>(param);
8631 }
8632 CONSTEXPR npu_set_ofm_blk_width_m1_t &set_param(uint32_t value)
8633 {
8634 param = static_cast<uint32_t>(value);
8635 return *this;
8636 }
8637#endif //__cplusplus
8638};
8639
8640// TSU block height -1 (provided sufficient data remaining)
8641struct npu_set_ofm_blk_height_m1_t
8642{
8643 uint32_t cmd_code : 10; // NPU_SET_OFM_BLK_HEIGHT_M1
8644 uint32_t must_be_zero0 : 6; // 0
8645 uint32_t param : 16;
8646#ifdef __cplusplus
8647 CONSTEXPR bool valid() const
8648 {
8649 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_OFM_BLK_HEIGHT_M1) && must_be_zero0 == 0;
8650 }
8651 CONSTEXPR void init()
8652 {
8653 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_OFM_BLK_HEIGHT_M1);
8654 must_be_zero0 = 0;
8655 }
8656 CONSTEXPR ::cmd0 get_cmd_code() const
8657 {
8658 return static_cast<::cmd0>(cmd_code);
8659 }
8660 CONSTEXPR npu_set_ofm_blk_height_m1_t &set_cmd_code(::cmd0 value)
8661 {
8662 cmd_code = static_cast<uint32_t>(value);
8663 return *this;
8664 }
8665 CONSTEXPR uint32_t get_param() const
8666 {
8667 return static_cast<uint32_t>(param);
8668 }
8669 CONSTEXPR npu_set_ofm_blk_height_m1_t &set_param(uint32_t value)
8670 {
8671 param = static_cast<uint32_t>(value);
8672 return *this;
8673 }
8674#endif //__cplusplus
8675};
8676
8677// TSU block depth -1 (provided sufficient data remaining)
8678struct npu_set_ofm_blk_depth_m1_t
8679{
8680 uint32_t cmd_code : 10; // NPU_SET_OFM_BLK_DEPTH_M1
8681 uint32_t must_be_zero0 : 6; // 0
8682 uint32_t param : 16;
8683#ifdef __cplusplus
8684 CONSTEXPR bool valid() const
8685 {
8686 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_OFM_BLK_DEPTH_M1) && must_be_zero0 == 0;
8687 }
8688 CONSTEXPR void init()
8689 {
8690 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_OFM_BLK_DEPTH_M1);
8691 must_be_zero0 = 0;
8692 }
8693 CONSTEXPR ::cmd0 get_cmd_code() const
8694 {
8695 return static_cast<::cmd0>(cmd_code);
8696 }
8697 CONSTEXPR npu_set_ofm_blk_depth_m1_t &set_cmd_code(::cmd0 value)
8698 {
8699 cmd_code = static_cast<uint32_t>(value);
8700 return *this;
8701 }
8702 CONSTEXPR uint32_t get_param() const
8703 {
8704 return static_cast<uint32_t>(param);
8705 }
8706 CONSTEXPR npu_set_ofm_blk_depth_m1_t &set_param(uint32_t value)
8707 {
8708 param = static_cast<uint32_t>(value);
8709 return *this;
8710 }
8711#endif //__cplusplus
8712};
8713
8714// Zero point offset (so value that 0 is encoded as)
8715struct npu_set_ofm_zero_point_t
8716{
8717 uint32_t cmd_code : 10; // NPU_SET_OFM_ZERO_POINT
8718 uint32_t must_be_zero0 : 6; // 0
8719 uint32_t param : 16;
8720#ifdef __cplusplus
8721 CONSTEXPR bool valid() const
8722 {
8723 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_OFM_ZERO_POINT) && must_be_zero0 == 0;
8724 }
8725 CONSTEXPR void init()
8726 {
8727 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_OFM_ZERO_POINT);
8728 must_be_zero0 = 0;
8729 }
8730 CONSTEXPR ::cmd0 get_cmd_code() const
8731 {
8732 return static_cast<::cmd0>(cmd_code);
8733 }
8734 CONSTEXPR npu_set_ofm_zero_point_t &set_cmd_code(::cmd0 value)
8735 {
8736 cmd_code = static_cast<uint32_t>(value);
8737 return *this;
8738 }
8739 CONSTEXPR uint32_t get_param() const
8740 {
8741 return static_cast<uint32_t>(param);
8742 }
8743 CONSTEXPR npu_set_ofm_zero_point_t &set_param(uint32_t value)
8744 {
8745 param = static_cast<uint32_t>(value);
8746 return *this;
8747 }
8748#endif //__cplusplus
8749};
8750
8751// OFM Tile 0 and tile 2 (width-1)
8752struct npu_set_ofm_width0_m1_t
8753{
8754 uint32_t cmd_code : 10; // NPU_SET_OFM_WIDTH0_M1
8755 uint32_t must_be_zero0 : 6; // 0
8756 uint32_t param : 16;
8757#ifdef __cplusplus
8758 CONSTEXPR bool valid() const
8759 {
8760 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_OFM_WIDTH0_M1) && must_be_zero0 == 0;
8761 }
8762 CONSTEXPR void init()
8763 {
8764 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_OFM_WIDTH0_M1);
8765 must_be_zero0 = 0;
8766 }
8767 CONSTEXPR ::cmd0 get_cmd_code() const
8768 {
8769 return static_cast<::cmd0>(cmd_code);
8770 }
8771 CONSTEXPR npu_set_ofm_width0_m1_t &set_cmd_code(::cmd0 value)
8772 {
8773 cmd_code = static_cast<uint32_t>(value);
8774 return *this;
8775 }
8776 CONSTEXPR uint32_t get_param() const
8777 {
8778 return static_cast<uint32_t>(param);
8779 }
8780 CONSTEXPR npu_set_ofm_width0_m1_t &set_param(uint32_t value)
8781 {
8782 param = static_cast<uint32_t>(value);
8783 return *this;
8784 }
8785#endif //__cplusplus
8786};
8787
8788// OFM Tile 0 (height-1)
8789struct npu_set_ofm_height0_m1_t
8790{
8791 uint32_t cmd_code : 10; // NPU_SET_OFM_HEIGHT0_M1
8792 uint32_t must_be_zero0 : 6; // 0
8793 uint32_t param : 16;
8794#ifdef __cplusplus
8795 CONSTEXPR bool valid() const
8796 {
8797 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_OFM_HEIGHT0_M1) && must_be_zero0 == 0;
8798 }
8799 CONSTEXPR void init()
8800 {
8801 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_OFM_HEIGHT0_M1);
8802 must_be_zero0 = 0;
8803 }
8804 CONSTEXPR ::cmd0 get_cmd_code() const
8805 {
8806 return static_cast<::cmd0>(cmd_code);
8807 }
8808 CONSTEXPR npu_set_ofm_height0_m1_t &set_cmd_code(::cmd0 value)
8809 {
8810 cmd_code = static_cast<uint32_t>(value);
8811 return *this;
8812 }
8813 CONSTEXPR uint32_t get_param() const
8814 {
8815 return static_cast<uint32_t>(param);
8816 }
8817 CONSTEXPR npu_set_ofm_height0_m1_t &set_param(uint32_t value)
8818 {
8819 param = static_cast<uint32_t>(value);
8820 return *this;
8821 }
8822#endif //__cplusplus
8823};
8824
8825// OFM Tile 1 (height-1)
8826struct npu_set_ofm_height1_m1_t
8827{
8828 uint32_t cmd_code : 10; // NPU_SET_OFM_HEIGHT1_M1
8829 uint32_t must_be_zero0 : 6; // 0
8830 uint32_t param : 16;
8831#ifdef __cplusplus
8832 CONSTEXPR bool valid() const
8833 {
8834 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_OFM_HEIGHT1_M1) && must_be_zero0 == 0;
8835 }
8836 CONSTEXPR void init()
8837 {
8838 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_OFM_HEIGHT1_M1);
8839 must_be_zero0 = 0;
8840 }
8841 CONSTEXPR ::cmd0 get_cmd_code() const
8842 {
8843 return static_cast<::cmd0>(cmd_code);
8844 }
8845 CONSTEXPR npu_set_ofm_height1_m1_t &set_cmd_code(::cmd0 value)
8846 {
8847 cmd_code = static_cast<uint32_t>(value);
8848 return *this;
8849 }
8850 CONSTEXPR uint32_t get_param() const
8851 {
8852 return static_cast<uint32_t>(param);
8853 }
8854 CONSTEXPR npu_set_ofm_height1_m1_t &set_param(uint32_t value)
8855 {
8856 param = static_cast<uint32_t>(value);
8857 return *this;
8858 }
8859#endif //__cplusplus
8860};
8861
8862// Index n for OFM access: BasePointer[n] is added to all OFM offsets
8863struct npu_set_ofm_region_t
8864{
8865 uint32_t cmd_code : 10; // NPU_SET_OFM_REGION
8866 uint32_t must_be_zero0 : 6; // 0
8867 uint32_t param : 16;
8868#ifdef __cplusplus
8869 CONSTEXPR bool valid() const
8870 {
8871 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_OFM_REGION) && must_be_zero0 == 0;
8872 }
8873 CONSTEXPR void init()
8874 {
8875 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_OFM_REGION);
8876 must_be_zero0 = 0;
8877 }
8878 CONSTEXPR ::cmd0 get_cmd_code() const
8879 {
8880 return static_cast<::cmd0>(cmd_code);
8881 }
8882 CONSTEXPR npu_set_ofm_region_t &set_cmd_code(::cmd0 value)
8883 {
8884 cmd_code = static_cast<uint32_t>(value);
8885 return *this;
8886 }
8887 CONSTEXPR uint32_t get_param() const
8888 {
8889 return static_cast<uint32_t>(param);
8890 }
8891 CONSTEXPR npu_set_ofm_region_t &set_param(uint32_t value)
8892 {
8893 param = static_cast<uint32_t>(value);
8894 return *this;
8895 }
8896#endif //__cplusplus
8897};
8898
8899// Set kernel width - 1
8900struct npu_set_kernel_width_m1_t
8901{
8902 uint32_t cmd_code : 10; // NPU_SET_KERNEL_WIDTH_M1
8903 uint32_t must_be_zero0 : 6; // 0
8904 uint32_t param : 16;
8905#ifdef __cplusplus
8906 CONSTEXPR bool valid() const
8907 {
8908 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_KERNEL_WIDTH_M1) && must_be_zero0 == 0;
8909 }
8910 CONSTEXPR void init()
8911 {
8912 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_KERNEL_WIDTH_M1);
8913 must_be_zero0 = 0;
8914 }
8915 CONSTEXPR ::cmd0 get_cmd_code() const
8916 {
8917 return static_cast<::cmd0>(cmd_code);
8918 }
8919 CONSTEXPR npu_set_kernel_width_m1_t &set_cmd_code(::cmd0 value)
8920 {
8921 cmd_code = static_cast<uint32_t>(value);
8922 return *this;
8923 }
8924 CONSTEXPR uint32_t get_param() const
8925 {
8926 return static_cast<uint32_t>(param);
8927 }
8928 CONSTEXPR npu_set_kernel_width_m1_t &set_param(uint32_t value)
8929 {
8930 param = static_cast<uint32_t>(value);
8931 return *this;
8932 }
8933#endif //__cplusplus
8934};
8935
8936// Set kernel height - 1
8937struct npu_set_kernel_height_m1_t
8938{
8939 uint32_t cmd_code : 10; // NPU_SET_KERNEL_HEIGHT_M1
8940 uint32_t must_be_zero0 : 6; // 0
8941 uint32_t param : 16;
8942#ifdef __cplusplus
8943 CONSTEXPR bool valid() const
8944 {
8945 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_KERNEL_HEIGHT_M1) && must_be_zero0 == 0;
8946 }
8947 CONSTEXPR void init()
8948 {
8949 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_KERNEL_HEIGHT_M1);
8950 must_be_zero0 = 0;
8951 }
8952 CONSTEXPR ::cmd0 get_cmd_code() const
8953 {
8954 return static_cast<::cmd0>(cmd_code);
8955 }
8956 CONSTEXPR npu_set_kernel_height_m1_t &set_cmd_code(::cmd0 value)
8957 {
8958 cmd_code = static_cast<uint32_t>(value);
8959 return *this;
8960 }
8961 CONSTEXPR uint32_t get_param() const
8962 {
8963 return static_cast<uint32_t>(param);
8964 }
8965 CONSTEXPR npu_set_kernel_height_m1_t &set_param(uint32_t value)
8966 {
8967 param = static_cast<uint32_t>(value);
8968 return *this;
8969 }
8970#endif //__cplusplus
8971};
8972
Diqing Zhonga9f38d52020-04-27 11:00:13 +02008973// Kernel stride b0=(X stride-1)&1, b1=(Y stride-1)&1, b2=weight order (0=depth, 1=kernel) b3 = kernel_x_dilation - 1
8974// (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
8975// 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
8976// stride-1)>>1
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008977struct npu_set_kernel_stride_t
8978{
8979 uint32_t cmd_code : 10; // NPU_SET_KERNEL_STRIDE
8980 uint32_t must_be_zero0 : 6; // 0
8981 uint32_t param : 16;
8982#ifdef __cplusplus
8983 CONSTEXPR bool valid() const
8984 {
8985 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_KERNEL_STRIDE) && must_be_zero0 == 0;
8986 }
8987 CONSTEXPR void init()
8988 {
8989 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_KERNEL_STRIDE);
8990 must_be_zero0 = 0;
8991 }
8992 CONSTEXPR ::cmd0 get_cmd_code() const
8993 {
8994 return static_cast<::cmd0>(cmd_code);
8995 }
8996 CONSTEXPR npu_set_kernel_stride_t &set_cmd_code(::cmd0 value)
8997 {
8998 cmd_code = static_cast<uint32_t>(value);
8999 return *this;
9000 }
9001 CONSTEXPR uint32_t get_param() const
9002 {
9003 return static_cast<uint32_t>(param);
9004 }
9005 CONSTEXPR npu_set_kernel_stride_t &set_param(uint32_t value)
9006 {
9007 param = static_cast<uint32_t>(value);
9008 return *this;
9009 }
9010#endif //__cplusplus
9011};
9012
9013// 0=1-core, 1=2-core depth
9014struct npu_set_parallel_mode_t
9015{
9016 uint32_t cmd_code : 10; // NPU_SET_PARALLEL_MODE
9017 uint32_t must_be_zero0 : 6; // 0
9018 uint32_t param : 16;
9019#ifdef __cplusplus
9020 CONSTEXPR bool valid() const
9021 {
9022 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_PARALLEL_MODE) && must_be_zero0 == 0;
9023 }
9024 CONSTEXPR void init()
9025 {
9026 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_PARALLEL_MODE);
9027 must_be_zero0 = 0;
9028 }
9029 CONSTEXPR ::cmd0 get_cmd_code() const
9030 {
9031 return static_cast<::cmd0>(cmd_code);
9032 }
9033 CONSTEXPR npu_set_parallel_mode_t &set_cmd_code(::cmd0 value)
9034 {
9035 cmd_code = static_cast<uint32_t>(value);
9036 return *this;
9037 }
9038 CONSTEXPR uint32_t get_param() const
9039 {
9040 return static_cast<uint32_t>(param);
9041 }
9042 CONSTEXPR npu_set_parallel_mode_t &set_param(uint32_t value)
9043 {
9044 param = static_cast<uint32_t>(value);
9045 return *this;
9046 }
9047#endif //__cplusplus
9048};
9049
9050// Set accumulator format
9051struct npu_set_acc_format_t
9052{
9053 uint32_t cmd_code : 10; // NPU_SET_ACC_FORMAT
9054 uint32_t must_be_zero0 : 6; // 0
9055 uint32_t param : 16;
9056#ifdef __cplusplus
9057 CONSTEXPR bool valid() const
9058 {
9059 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_ACC_FORMAT) && must_be_zero0 == 0;
9060 }
9061 CONSTEXPR void init()
9062 {
9063 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_ACC_FORMAT);
9064 must_be_zero0 = 0;
9065 }
9066 CONSTEXPR ::cmd0 get_cmd_code() const
9067 {
9068 return static_cast<::cmd0>(cmd_code);
9069 }
9070 CONSTEXPR npu_set_acc_format_t &set_cmd_code(::cmd0 value)
9071 {
9072 cmd_code = static_cast<uint32_t>(value);
9073 return *this;
9074 }
9075 CONSTEXPR ::acc_format get_param() const
9076 {
9077 return static_cast<::acc_format>(param);
9078 }
9079 CONSTEXPR npu_set_acc_format_t &set_param(::acc_format value)
9080 {
9081 param = static_cast<uint32_t>(value);
9082 return *this;
9083 }
9084#endif //__cplusplus
9085};
9086
9087// Set activation
9088struct npu_set_activation_t
9089{
9090 uint32_t cmd_code : 10; // NPU_SET_ACTIVATION
9091 uint32_t must_be_zero0 : 6; // 0
9092 uint32_t type : 12;
9093 uint32_t act_clip_range : 4;
9094#ifdef __cplusplus
9095 CONSTEXPR bool valid() const
9096 {
9097 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_ACTIVATION) && must_be_zero0 == 0;
9098 }
9099 CONSTEXPR void init()
9100 {
9101 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_ACTIVATION);
9102 must_be_zero0 = 0;
9103 }
9104 CONSTEXPR ::clip_range get_act_clip_range() const
9105 {
9106 return static_cast<::clip_range>(act_clip_range);
9107 }
9108 CONSTEXPR npu_set_activation_t &set_act_clip_range(::clip_range value)
9109 {
9110 act_clip_range = static_cast<uint32_t>(value);
9111 return *this;
9112 }
9113 CONSTEXPR ::cmd0 get_cmd_code() const
9114 {
9115 return static_cast<::cmd0>(cmd_code);
9116 }
9117 CONSTEXPR npu_set_activation_t &set_cmd_code(::cmd0 value)
9118 {
9119 cmd_code = static_cast<uint32_t>(value);
9120 return *this;
9121 }
9122 CONSTEXPR ::activation get_type() const
9123 {
9124 return static_cast<::activation>(type);
9125 }
9126 CONSTEXPR npu_set_activation_t &set_type(::activation value)
9127 {
9128 type = static_cast<uint32_t>(value);
9129 return *this;
9130 }
9131#endif //__cplusplus
9132};
9133
9134// Lower bound clip for OFM activations – range is the OFM type range
9135struct npu_set_activation_min_t
9136{
9137 uint32_t cmd_code : 10; // NPU_SET_ACTIVATION_MIN
9138 uint32_t must_be_zero0 : 6; // 0
9139 uint32_t param : 16;
9140#ifdef __cplusplus
9141 CONSTEXPR bool valid() const
9142 {
9143 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_ACTIVATION_MIN) && must_be_zero0 == 0;
9144 }
9145 CONSTEXPR void init()
9146 {
9147 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_ACTIVATION_MIN);
9148 must_be_zero0 = 0;
9149 }
9150 CONSTEXPR ::cmd0 get_cmd_code() const
9151 {
9152 return static_cast<::cmd0>(cmd_code);
9153 }
9154 CONSTEXPR npu_set_activation_min_t &set_cmd_code(::cmd0 value)
9155 {
9156 cmd_code = static_cast<uint32_t>(value);
9157 return *this;
9158 }
9159 CONSTEXPR uint32_t get_param() const
9160 {
9161 return static_cast<uint32_t>(param);
9162 }
9163 CONSTEXPR npu_set_activation_min_t &set_param(uint32_t value)
9164 {
9165 param = static_cast<uint32_t>(value);
9166 return *this;
9167 }
9168#endif //__cplusplus
9169};
9170
9171// Upper bound clip for OFM activations – range is the OFM type range
9172struct npu_set_activation_max_t
9173{
9174 uint32_t cmd_code : 10; // NPU_SET_ACTIVATION_MAX
9175 uint32_t must_be_zero0 : 6; // 0
9176 uint32_t param : 16;
9177#ifdef __cplusplus
9178 CONSTEXPR bool valid() const
9179 {
9180 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_ACTIVATION_MAX) && must_be_zero0 == 0;
9181 }
9182 CONSTEXPR void init()
9183 {
9184 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_ACTIVATION_MAX);
9185 must_be_zero0 = 0;
9186 }
9187 CONSTEXPR ::cmd0 get_cmd_code() const
9188 {
9189 return static_cast<::cmd0>(cmd_code);
9190 }
9191 CONSTEXPR npu_set_activation_max_t &set_cmd_code(::cmd0 value)
9192 {
9193 cmd_code = static_cast<uint32_t>(value);
9194 return *this;
9195 }
9196 CONSTEXPR uint32_t get_param() const
9197 {
9198 return static_cast<uint32_t>(param);
9199 }
9200 CONSTEXPR npu_set_activation_max_t &set_param(uint32_t value)
9201 {
9202 param = static_cast<uint32_t>(value);
9203 return *this;
9204 }
9205#endif //__cplusplus
9206};
9207
9208// Index n for weight access: BasePointer[n] is added to all Weight stream offsets
9209struct npu_set_weight_region_t
9210{
9211 uint32_t cmd_code : 10; // NPU_SET_WEIGHT_REGION
9212 uint32_t must_be_zero0 : 6; // 0
9213 uint32_t param : 16;
9214#ifdef __cplusplus
9215 CONSTEXPR bool valid() const
9216 {
9217 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_WEIGHT_REGION) && must_be_zero0 == 0;
9218 }
9219 CONSTEXPR void init()
9220 {
9221 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_WEIGHT_REGION);
9222 must_be_zero0 = 0;
9223 }
9224 CONSTEXPR ::cmd0 get_cmd_code() const
9225 {
9226 return static_cast<::cmd0>(cmd_code);
9227 }
9228 CONSTEXPR npu_set_weight_region_t &set_cmd_code(::cmd0 value)
9229 {
9230 cmd_code = static_cast<uint32_t>(value);
9231 return *this;
9232 }
9233 CONSTEXPR uint32_t get_param() const
9234 {
9235 return static_cast<uint32_t>(param);
9236 }
9237 CONSTEXPR npu_set_weight_region_t &set_param(uint32_t value)
9238 {
9239 param = static_cast<uint32_t>(value);
9240 return *this;
9241 }
9242#endif //__cplusplus
9243};
9244
9245// Index n for weight access: BasePointer[n] is added to all scale stream offsets
9246struct npu_set_scale_region_t
9247{
9248 uint32_t cmd_code : 10; // NPU_SET_SCALE_REGION
9249 uint32_t must_be_zero0 : 6; // 0
9250 uint32_t param : 16;
9251#ifdef __cplusplus
9252 CONSTEXPR bool valid() const
9253 {
9254 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_SCALE_REGION) && must_be_zero0 == 0;
9255 }
9256 CONSTEXPR void init()
9257 {
9258 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_SCALE_REGION);
9259 must_be_zero0 = 0;
9260 }
9261 CONSTEXPR ::cmd0 get_cmd_code() const
9262 {
9263 return static_cast<::cmd0>(cmd_code);
9264 }
9265 CONSTEXPR npu_set_scale_region_t &set_cmd_code(::cmd0 value)
9266 {
9267 cmd_code = static_cast<uint32_t>(value);
9268 return *this;
9269 }
9270 CONSTEXPR uint32_t get_param() const
9271 {
9272 return static_cast<uint32_t>(param);
9273 }
9274 CONSTEXPR npu_set_scale_region_t &set_param(uint32_t value)
9275 {
9276 param = static_cast<uint32_t>(value);
9277 return *this;
9278 }
9279#endif //__cplusplus
9280};
9281
9282// Start of ACC0,ACC1 buffers in the SHRAM in KB units. Multiple of 4.)
9283struct npu_set_ab_start_t
9284{
9285 uint32_t cmd_code : 10; // NPU_SET_AB_START
9286 uint32_t must_be_zero0 : 6; // 0
9287 uint32_t param : 16;
9288#ifdef __cplusplus
9289 CONSTEXPR bool valid() const
9290 {
9291 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_AB_START) && must_be_zero0 == 0;
9292 }
9293 CONSTEXPR void init()
9294 {
9295 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_AB_START);
9296 must_be_zero0 = 0;
9297 }
9298 CONSTEXPR ::cmd0 get_cmd_code() const
9299 {
9300 return static_cast<::cmd0>(cmd_code);
9301 }
9302 CONSTEXPR npu_set_ab_start_t &set_cmd_code(::cmd0 value)
9303 {
9304 cmd_code = static_cast<uint32_t>(value);
9305 return *this;
9306 }
9307 CONSTEXPR uint32_t get_param() const
9308 {
9309 return static_cast<uint32_t>(param);
9310 }
9311 CONSTEXPR npu_set_ab_start_t &set_param(uint32_t value)
9312 {
9313 param = static_cast<uint32_t>(value);
9314 return *this;
9315 }
9316#endif //__cplusplus
9317};
9318
9319// Set block number of blocks dependency between kernel operations
9320struct npu_set_blockdep_t
9321{
9322 uint32_t cmd_code : 10; // NPU_SET_BLOCKDEP
9323 uint32_t must_be_zero0 : 6; // 0
9324 uint32_t param : 16;
9325#ifdef __cplusplus
9326 CONSTEXPR bool valid() const
9327 {
9328 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_BLOCKDEP) && must_be_zero0 == 0;
9329 }
9330 CONSTEXPR void init()
9331 {
9332 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_BLOCKDEP);
9333 must_be_zero0 = 0;
9334 }
9335 CONSTEXPR ::cmd0 get_cmd_code() const
9336 {
9337 return static_cast<::cmd0>(cmd_code);
9338 }
9339 CONSTEXPR npu_set_blockdep_t &set_cmd_code(::cmd0 value)
9340 {
9341 cmd_code = static_cast<uint32_t>(value);
9342 return *this;
9343 }
9344 CONSTEXPR uint32_t get_param() const
9345 {
9346 return static_cast<uint32_t>(param);
9347 }
9348 CONSTEXPR npu_set_blockdep_t &set_param(uint32_t value)
9349 {
9350 param = static_cast<uint32_t>(value);
9351 return *this;
9352 }
9353#endif //__cplusplus
9354};
9355
9356// DMA0 SRC region bitmap
9357struct npu_set_dma0_src_region_t
9358{
9359 uint32_t cmd_code : 10; // NPU_SET_DMA0_SRC_REGION
9360 uint32_t must_be_zero0 : 6; // 0
9361 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,
9362 // Bit[7:0]=Core number (0 or 1) to read.
9363 uint32_t internal : 1; // Must be 0 (external)
9364 uint32_t stride_mode : 2; // stride mode 0/1/2=1D/2D/3D
9365 uint32_t reserved0 : 5;
9366#ifdef __cplusplus
9367 CONSTEXPR bool valid() const
9368 {
9369 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_DMA0_SRC_REGION) && must_be_zero0 == 0;
9370 }
9371 CONSTEXPR void init()
9372 {
9373 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_DMA0_SRC_REGION);
9374 must_be_zero0 = 0;
9375 }
9376 CONSTEXPR ::cmd0 get_cmd_code() const
9377 {
9378 return static_cast<::cmd0>(cmd_code);
9379 }
9380 CONSTEXPR npu_set_dma0_src_region_t &set_cmd_code(::cmd0 value)
9381 {
9382 cmd_code = static_cast<uint32_t>(value);
9383 return *this;
9384 }
9385 CONSTEXPR uint32_t get_internal() const
9386 {
9387 return static_cast<uint32_t>(internal);
9388 }
9389 CONSTEXPR npu_set_dma0_src_region_t &set_internal(uint32_t value)
9390 {
9391 internal = static_cast<uint32_t>(value);
9392 return *this;
9393 }
9394 CONSTEXPR uint32_t get_region() const
9395 {
9396 return static_cast<uint32_t>(region);
9397 }
9398 CONSTEXPR npu_set_dma0_src_region_t &set_region(uint32_t value)
9399 {
9400 region = static_cast<uint32_t>(value);
9401 return *this;
9402 }
9403 CONSTEXPR ::stride_mode get_stride_mode() const
9404 {
9405 return static_cast<::stride_mode>(stride_mode);
9406 }
9407 CONSTEXPR npu_set_dma0_src_region_t &set_stride_mode(::stride_mode value)
9408 {
9409 stride_mode = static_cast<uint32_t>(value);
9410 return *this;
9411 }
9412#endif //__cplusplus
9413};
9414
9415// DMA0 DST region bitmap
9416struct npu_set_dma0_dst_region_t
9417{
9418 uint32_t cmd_code : 10; // NPU_SET_DMA0_DST_REGION
9419 uint32_t must_be_zero0 : 6; // 0
9420 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,
9421 // Bit[7:0]=Core mask to write to (bit k set for core k=0,1).
9422 uint32_t internal : 1; // Select external/internal=0/1
9423 uint32_t stride_mode : 2; // stride mode 0/1/2=1D/2D/3D
9424 uint32_t reserved0 : 5;
9425#ifdef __cplusplus
9426 CONSTEXPR bool valid() const
9427 {
9428 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_DMA0_DST_REGION) && must_be_zero0 == 0;
9429 }
9430 CONSTEXPR void init()
9431 {
9432 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_DMA0_DST_REGION);
9433 must_be_zero0 = 0;
9434 }
9435 CONSTEXPR ::cmd0 get_cmd_code() const
9436 {
9437 return static_cast<::cmd0>(cmd_code);
9438 }
9439 CONSTEXPR npu_set_dma0_dst_region_t &set_cmd_code(::cmd0 value)
9440 {
9441 cmd_code = static_cast<uint32_t>(value);
9442 return *this;
9443 }
9444 CONSTEXPR uint32_t get_internal() const
9445 {
9446 return static_cast<uint32_t>(internal);
9447 }
9448 CONSTEXPR npu_set_dma0_dst_region_t &set_internal(uint32_t value)
9449 {
9450 internal = static_cast<uint32_t>(value);
9451 return *this;
9452 }
9453 CONSTEXPR uint32_t get_region() const
9454 {
9455 return static_cast<uint32_t>(region);
9456 }
9457 CONSTEXPR npu_set_dma0_dst_region_t &set_region(uint32_t value)
9458 {
9459 region = static_cast<uint32_t>(value);
9460 return *this;
9461 }
9462 CONSTEXPR ::stride_mode get_stride_mode() const
9463 {
9464 return static_cast<::stride_mode>(stride_mode);
9465 }
9466 CONSTEXPR npu_set_dma0_dst_region_t &set_stride_mode(::stride_mode value)
9467 {
9468 stride_mode = static_cast<uint32_t>(value);
9469 return *this;
9470 }
9471#endif //__cplusplus
9472};
9473
9474// Inner size for 2D/3D mode.
9475struct npu_set_dma0_size0_t
9476{
9477 uint32_t cmd_code : 10; // NPU_SET_DMA0_SIZE0
9478 uint32_t must_be_zero0 : 6; // 0
9479 uint32_t param : 16;
9480#ifdef __cplusplus
9481 CONSTEXPR bool valid() const
9482 {
9483 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_DMA0_SIZE0) && must_be_zero0 == 0;
9484 }
9485 CONSTEXPR void init()
9486 {
9487 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_DMA0_SIZE0);
9488 must_be_zero0 = 0;
9489 }
9490 CONSTEXPR ::cmd0 get_cmd_code() const
9491 {
9492 return static_cast<::cmd0>(cmd_code);
9493 }
9494 CONSTEXPR npu_set_dma0_size0_t &set_cmd_code(::cmd0 value)
9495 {
9496 cmd_code = static_cast<uint32_t>(value);
9497 return *this;
9498 }
9499 CONSTEXPR uint32_t get_param() const
9500 {
9501 return static_cast<uint32_t>(param);
9502 }
9503 CONSTEXPR npu_set_dma0_size0_t &set_param(uint32_t value)
9504 {
9505 param = static_cast<uint32_t>(value);
9506 return *this;
9507 }
9508#endif //__cplusplus
9509};
9510
9511// Outer size for 3D mode.
9512struct npu_set_dma0_size1_t
9513{
9514 uint32_t cmd_code : 10; // NPU_SET_DMA0_SIZE1
9515 uint32_t must_be_zero0 : 6; // 0
9516 uint32_t param : 16;
9517#ifdef __cplusplus
9518 CONSTEXPR bool valid() const
9519 {
9520 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_DMA0_SIZE1) && must_be_zero0 == 0;
9521 }
9522 CONSTEXPR void init()
9523 {
9524 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_DMA0_SIZE1);
9525 must_be_zero0 = 0;
9526 }
9527 CONSTEXPR ::cmd0 get_cmd_code() const
9528 {
9529 return static_cast<::cmd0>(cmd_code);
9530 }
9531 CONSTEXPR npu_set_dma0_size1_t &set_cmd_code(::cmd0 value)
9532 {
9533 cmd_code = static_cast<uint32_t>(value);
9534 return *this;
9535 }
9536 CONSTEXPR uint32_t get_param() const
9537 {
9538 return static_cast<uint32_t>(param);
9539 }
9540 CONSTEXPR npu_set_dma0_size1_t &set_param(uint32_t value)
9541 {
9542 param = static_cast<uint32_t>(value);
9543 return *this;
9544 }
9545#endif //__cplusplus
9546};
9547
9548// Set IFM2 Broadcast mode
9549struct npu_set_ifm2_broadcast_t
9550{
9551 uint32_t cmd_code : 10; // NPU_SET_IFM2_BROADCAST
9552 uint32_t must_be_zero0 : 6; // 0
9553 uint32_t broadcast_height : 1;
9554 uint32_t broadcast_width : 1;
9555 uint32_t broadcast_depth : 1;
9556 uint32_t reserved0 : 3;
9557 uint32_t operand_order : 1;
9558 uint32_t broadcast_scalar : 1;
9559 uint32_t reserved1 : 8;
9560#ifdef __cplusplus
9561 CONSTEXPR bool valid() const
9562 {
9563 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_IFM2_BROADCAST) && must_be_zero0 == 0;
9564 }
9565 CONSTEXPR void init()
9566 {
9567 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_IFM2_BROADCAST);
9568 must_be_zero0 = 0;
9569 }
9570 CONSTEXPR uint32_t get_broadcast_depth() const
9571 {
9572 return static_cast<uint32_t>(broadcast_depth);
9573 }
9574 CONSTEXPR npu_set_ifm2_broadcast_t &set_broadcast_depth(uint32_t value)
9575 {
9576 broadcast_depth = static_cast<uint32_t>(value);
9577 return *this;
9578 }
9579 CONSTEXPR uint32_t get_broadcast_height() const
9580 {
9581 return static_cast<uint32_t>(broadcast_height);
9582 }
9583 CONSTEXPR npu_set_ifm2_broadcast_t &set_broadcast_height(uint32_t value)
9584 {
9585 broadcast_height = static_cast<uint32_t>(value);
9586 return *this;
9587 }
9588 CONSTEXPR uint32_t get_broadcast_scalar() const
9589 {
9590 return static_cast<uint32_t>(broadcast_scalar);
9591 }
9592 CONSTEXPR npu_set_ifm2_broadcast_t &set_broadcast_scalar(uint32_t value)
9593 {
9594 broadcast_scalar = static_cast<uint32_t>(value);
9595 return *this;
9596 }
9597 CONSTEXPR uint32_t get_broadcast_width() const
9598 {
9599 return static_cast<uint32_t>(broadcast_width);
9600 }
9601 CONSTEXPR npu_set_ifm2_broadcast_t &set_broadcast_width(uint32_t value)
9602 {
9603 broadcast_width = static_cast<uint32_t>(value);
9604 return *this;
9605 }
9606 CONSTEXPR ::cmd0 get_cmd_code() const
9607 {
9608 return static_cast<::cmd0>(cmd_code);
9609 }
9610 CONSTEXPR npu_set_ifm2_broadcast_t &set_cmd_code(::cmd0 value)
9611 {
9612 cmd_code = static_cast<uint32_t>(value);
9613 return *this;
9614 }
9615 CONSTEXPR uint32_t get_operand_order() const
9616 {
9617 return static_cast<uint32_t>(operand_order);
9618 }
9619 CONSTEXPR npu_set_ifm2_broadcast_t &set_operand_order(uint32_t value)
9620 {
9621 operand_order = static_cast<uint32_t>(value);
9622 return *this;
9623 }
9624#endif //__cplusplus
9625};
9626
9627// IFM2 scalar value at range IFM_PRECISION
9628struct npu_set_ifm2_scalar_t
9629{
9630 uint32_t cmd_code : 10; // NPU_SET_IFM2_SCALAR
9631 uint32_t must_be_zero0 : 6; // 0
9632 uint32_t param : 16;
9633#ifdef __cplusplus
9634 CONSTEXPR bool valid() const
9635 {
9636 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_IFM2_SCALAR) && must_be_zero0 == 0;
9637 }
9638 CONSTEXPR void init()
9639 {
9640 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_IFM2_SCALAR);
9641 must_be_zero0 = 0;
9642 }
9643 CONSTEXPR ::cmd0 get_cmd_code() const
9644 {
9645 return static_cast<::cmd0>(cmd_code);
9646 }
9647 CONSTEXPR npu_set_ifm2_scalar_t &set_cmd_code(::cmd0 value)
9648 {
9649 cmd_code = static_cast<uint32_t>(value);
9650 return *this;
9651 }
9652 CONSTEXPR uint32_t get_param() const
9653 {
9654 return static_cast<uint32_t>(param);
9655 }
9656 CONSTEXPR npu_set_ifm2_scalar_t &set_param(uint32_t value)
9657 {
9658 param = static_cast<uint32_t>(value);
9659 return *this;
9660 }
9661#endif //__cplusplus
9662};
9663
9664// Set activation
9665struct npu_set_ifm2_precision_t
9666{
9667 uint32_t cmd_code : 10; // NPU_SET_IFM2_PRECISION
9668 uint32_t must_be_zero0 : 6; // 0
Diqing Zhonga9f38d52020-04-27 11:00:13 +02009669 uint32_t precision : 4;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02009670 uint32_t reserved0 : 2;
9671 uint32_t format : 2;
9672 uint32_t reserved1 : 8;
9673#ifdef __cplusplus
9674 CONSTEXPR bool valid() const
9675 {
9676 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_IFM2_PRECISION) && must_be_zero0 == 0;
9677 }
9678 CONSTEXPR void init()
9679 {
9680 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_IFM2_PRECISION);
9681 must_be_zero0 = 0;
9682 }
9683 CONSTEXPR ::cmd0 get_cmd_code() const
9684 {
9685 return static_cast<::cmd0>(cmd_code);
9686 }
9687 CONSTEXPR npu_set_ifm2_precision_t &set_cmd_code(::cmd0 value)
9688 {
9689 cmd_code = static_cast<uint32_t>(value);
9690 return *this;
9691 }
9692 CONSTEXPR ::data_format get_format() const
9693 {
9694 return static_cast<::data_format>(format);
9695 }
9696 CONSTEXPR npu_set_ifm2_precision_t &set_format(::data_format value)
9697 {
9698 format = static_cast<uint32_t>(value);
9699 return *this;
9700 }
Diqing Zhonga9f38d52020-04-27 11:00:13 +02009701 CONSTEXPR ::ifm_precision get_precision() const
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02009702 {
Diqing Zhonga9f38d52020-04-27 11:00:13 +02009703 return static_cast<::ifm_precision>(precision);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02009704 }
Diqing Zhonga9f38d52020-04-27 11:00:13 +02009705 CONSTEXPR npu_set_ifm2_precision_t &set_precision(::ifm_precision value)
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02009706 {
Diqing Zhonga9f38d52020-04-27 11:00:13 +02009707 precision = static_cast<uint32_t>(value);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02009708 return *this;
9709 }
9710#endif //__cplusplus
9711};
9712
9713// Zero point offset (so value that 0 is encoded as) at range IFM_PRECISION
9714struct npu_set_ifm2_zero_point_t
9715{
9716 uint32_t cmd_code : 10; // NPU_SET_IFM2_ZERO_POINT
9717 uint32_t must_be_zero0 : 6; // 0
9718 uint32_t param : 16;
9719#ifdef __cplusplus
9720 CONSTEXPR bool valid() const
9721 {
9722 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_IFM2_ZERO_POINT) && must_be_zero0 == 0;
9723 }
9724 CONSTEXPR void init()
9725 {
9726 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_IFM2_ZERO_POINT);
9727 must_be_zero0 = 0;
9728 }
9729 CONSTEXPR ::cmd0 get_cmd_code() const
9730 {
9731 return static_cast<::cmd0>(cmd_code);
9732 }
9733 CONSTEXPR npu_set_ifm2_zero_point_t &set_cmd_code(::cmd0 value)
9734 {
9735 cmd_code = static_cast<uint32_t>(value);
9736 return *this;
9737 }
9738 CONSTEXPR uint32_t get_param() const
9739 {
9740 return static_cast<uint32_t>(param);
9741 }
9742 CONSTEXPR npu_set_ifm2_zero_point_t &set_param(uint32_t value)
9743 {
9744 param = static_cast<uint32_t>(value);
9745 return *this;
9746 }
9747#endif //__cplusplus
9748};
9749
9750// IFM2 Tile 0 and tile 2 (width-1)
9751struct npu_set_ifm2_width0_m1_t
9752{
9753 uint32_t cmd_code : 10; // NPU_SET_IFM2_WIDTH0_M1
9754 uint32_t must_be_zero0 : 6; // 0
9755 uint32_t param : 16;
9756#ifdef __cplusplus
9757 CONSTEXPR bool valid() const
9758 {
9759 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_IFM2_WIDTH0_M1) && must_be_zero0 == 0;
9760 }
9761 CONSTEXPR void init()
9762 {
9763 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_IFM2_WIDTH0_M1);
9764 must_be_zero0 = 0;
9765 }
9766 CONSTEXPR ::cmd0 get_cmd_code() const
9767 {
9768 return static_cast<::cmd0>(cmd_code);
9769 }
9770 CONSTEXPR npu_set_ifm2_width0_m1_t &set_cmd_code(::cmd0 value)
9771 {
9772 cmd_code = static_cast<uint32_t>(value);
9773 return *this;
9774 }
9775 CONSTEXPR uint32_t get_param() const
9776 {
9777 return static_cast<uint32_t>(param);
9778 }
9779 CONSTEXPR npu_set_ifm2_width0_m1_t &set_param(uint32_t value)
9780 {
9781 param = static_cast<uint32_t>(value);
9782 return *this;
9783 }
9784#endif //__cplusplus
9785};
9786
9787// IFM2 Tile 0 (height-1)
9788struct npu_set_ifm2_height0_m1_t
9789{
9790 uint32_t cmd_code : 10; // NPU_SET_IFM2_HEIGHT0_M1
9791 uint32_t must_be_zero0 : 6; // 0
9792 uint32_t param : 16;
9793#ifdef __cplusplus
9794 CONSTEXPR bool valid() const
9795 {
9796 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_IFM2_HEIGHT0_M1) && must_be_zero0 == 0;
9797 }
9798 CONSTEXPR void init()
9799 {
9800 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_IFM2_HEIGHT0_M1);
9801 must_be_zero0 = 0;
9802 }
9803 CONSTEXPR ::cmd0 get_cmd_code() const
9804 {
9805 return static_cast<::cmd0>(cmd_code);
9806 }
9807 CONSTEXPR npu_set_ifm2_height0_m1_t &set_cmd_code(::cmd0 value)
9808 {
9809 cmd_code = static_cast<uint32_t>(value);
9810 return *this;
9811 }
9812 CONSTEXPR uint32_t get_param() const
9813 {
9814 return static_cast<uint32_t>(param);
9815 }
9816 CONSTEXPR npu_set_ifm2_height0_m1_t &set_param(uint32_t value)
9817 {
9818 param = static_cast<uint32_t>(value);
9819 return *this;
9820 }
9821#endif //__cplusplus
9822};
9823
9824// IFM2 Tile 1 (height-1)
9825struct npu_set_ifm2_height1_m1_t
9826{
9827 uint32_t cmd_code : 10; // NPU_SET_IFM2_HEIGHT1_M1
9828 uint32_t must_be_zero0 : 6; // 0
9829 uint32_t param : 16;
9830#ifdef __cplusplus
9831 CONSTEXPR bool valid() const
9832 {
9833 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_IFM2_HEIGHT1_M1) && must_be_zero0 == 0;
9834 }
9835 CONSTEXPR void init()
9836 {
9837 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_IFM2_HEIGHT1_M1);
9838 must_be_zero0 = 0;
9839 }
9840 CONSTEXPR ::cmd0 get_cmd_code() const
9841 {
9842 return static_cast<::cmd0>(cmd_code);
9843 }
9844 CONSTEXPR npu_set_ifm2_height1_m1_t &set_cmd_code(::cmd0 value)
9845 {
9846 cmd_code = static_cast<uint32_t>(value);
9847 return *this;
9848 }
9849 CONSTEXPR uint32_t get_param() const
9850 {
9851 return static_cast<uint32_t>(param);
9852 }
9853 CONSTEXPR npu_set_ifm2_height1_m1_t &set_param(uint32_t value)
9854 {
9855 param = static_cast<uint32_t>(value);
9856 return *this;
9857 }
9858#endif //__cplusplus
9859};
9860
9861// Start of IB0, IB1 buffers for IFM2 in SHRAM. In KB units, multiple of 2.
9862struct npu_set_ifm2_ib_start_t
9863{
9864 uint32_t cmd_code : 10; // NPU_SET_IFM2_IB_START
9865 uint32_t must_be_zero0 : 6; // 0
9866 uint32_t param : 16;
9867#ifdef __cplusplus
9868 CONSTEXPR bool valid() const
9869 {
9870 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_IFM2_IB_START) && must_be_zero0 == 0;
9871 }
9872 CONSTEXPR void init()
9873 {
9874 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_IFM2_IB_START);
9875 must_be_zero0 = 0;
9876 }
9877 CONSTEXPR ::cmd0 get_cmd_code() const
9878 {
9879 return static_cast<::cmd0>(cmd_code);
9880 }
9881 CONSTEXPR npu_set_ifm2_ib_start_t &set_cmd_code(::cmd0 value)
9882 {
9883 cmd_code = static_cast<uint32_t>(value);
9884 return *this;
9885 }
9886 CONSTEXPR uint32_t get_param() const
9887 {
9888 return static_cast<uint32_t>(param);
9889 }
9890 CONSTEXPR npu_set_ifm2_ib_start_t &set_param(uint32_t value)
9891 {
9892 param = static_cast<uint32_t>(value);
9893 return *this;
9894 }
9895#endif //__cplusplus
9896};
9897
9898// Index n for IFM2 access: Region[n] is added to all IFM2 addresses
9899struct npu_set_ifm2_region_t
9900{
9901 uint32_t cmd_code : 10; // NPU_SET_IFM2_REGION
9902 uint32_t must_be_zero0 : 6; // 0
9903 uint32_t param : 16;
9904#ifdef __cplusplus
9905 CONSTEXPR bool valid() const
9906 {
9907 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_IFM2_REGION) && must_be_zero0 == 0;
9908 }
9909 CONSTEXPR void init()
9910 {
9911 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_IFM2_REGION);
9912 must_be_zero0 = 0;
9913 }
9914 CONSTEXPR ::cmd0 get_cmd_code() const
9915 {
9916 return static_cast<::cmd0>(cmd_code);
9917 }
9918 CONSTEXPR npu_set_ifm2_region_t &set_cmd_code(::cmd0 value)
9919 {
9920 cmd_code = static_cast<uint32_t>(value);
9921 return *this;
9922 }
9923 CONSTEXPR uint32_t get_param() const
9924 {
9925 return static_cast<uint32_t>(param);
9926 }
9927 CONSTEXPR npu_set_ifm2_region_t &set_param(uint32_t value)
9928 {
9929 param = static_cast<uint32_t>(value);
9930 return *this;
9931 }
9932#endif //__cplusplus
9933};
9934
9935// Set IFM base address (top left tile)
9936struct npu_set_ifm_base0_t
9937{
9938 uint32_t cmd_code : 10; // NPU_SET_IFM_BASE0
9939 uint32_t must_be_zero : 4; // 0
9940 uint32_t payload_size : 2; // Min:1 Max:2
9941 uint32_t reserved0 : 16;
9942 uint32_t data : 32; // IFM base address (top left tile)
9943#ifdef __cplusplus
9944 CONSTEXPR bool valid() const
9945 {
9946 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_IFM_BASE0) && must_be_zero == 0 && payload_size >= 1 &&
9947 payload_size <= 2;
9948 }
9949 CONSTEXPR void init()
9950 {
9951 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_IFM_BASE0);
9952 must_be_zero = 0;
9953 payload_size = 1;
9954 }
9955 CONSTEXPR ::cmd1 get_cmd_code() const
9956 {
9957 return static_cast<::cmd1>(cmd_code);
9958 }
9959 CONSTEXPR npu_set_ifm_base0_t &set_cmd_code(::cmd1 value)
9960 {
9961 cmd_code = static_cast<uint32_t>(value);
9962 return *this;
9963 }
9964 CONSTEXPR uint32_t get_data() const
9965 {
9966 return static_cast<uint32_t>(data);
9967 }
9968 CONSTEXPR npu_set_ifm_base0_t &set_data(uint32_t value)
9969 {
9970 data = static_cast<uint32_t>(value);
9971 return *this;
9972 }
9973 CONSTEXPR uint32_t get_payload_size() const
9974 {
9975 return static_cast<uint32_t>(payload_size);
9976 }
9977 CONSTEXPR npu_set_ifm_base0_t &set_payload_size(uint32_t value)
9978 {
9979 payload_size = static_cast<uint32_t>(value);
9980 return *this;
9981 }
9982#endif //__cplusplus
9983};
9984
9985// Set IFM base address (top right tile)
9986struct npu_set_ifm_base1_t
9987{
9988 uint32_t cmd_code : 10; // NPU_SET_IFM_BASE1
9989 uint32_t must_be_zero : 4; // 0
9990 uint32_t payload_size : 2; // Min:1 Max:2
9991 uint32_t reserved0 : 16;
9992 uint32_t data : 32; // IFM base address (top right tile)
9993#ifdef __cplusplus
9994 CONSTEXPR bool valid() const
9995 {
9996 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_IFM_BASE1) && must_be_zero == 0 && payload_size >= 1 &&
9997 payload_size <= 2;
9998 }
9999 CONSTEXPR void init()
10000 {
10001 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_IFM_BASE1);
10002 must_be_zero = 0;
10003 payload_size = 1;
10004 }
10005 CONSTEXPR ::cmd1 get_cmd_code() const
10006 {
10007 return static_cast<::cmd1>(cmd_code);
10008 }
10009 CONSTEXPR npu_set_ifm_base1_t &set_cmd_code(::cmd1 value)
10010 {
10011 cmd_code = static_cast<uint32_t>(value);
10012 return *this;
10013 }
10014 CONSTEXPR uint32_t get_data() const
10015 {
10016 return static_cast<uint32_t>(data);
10017 }
10018 CONSTEXPR npu_set_ifm_base1_t &set_data(uint32_t value)
10019 {
10020 data = static_cast<uint32_t>(value);
10021 return *this;
10022 }
10023 CONSTEXPR uint32_t get_payload_size() const
10024 {
10025 return static_cast<uint32_t>(payload_size);
10026 }
10027 CONSTEXPR npu_set_ifm_base1_t &set_payload_size(uint32_t value)
10028 {
10029 payload_size = static_cast<uint32_t>(value);
10030 return *this;
10031 }
10032#endif //__cplusplus
10033};
10034
10035// Set IFM base address (bottom left tile)
10036struct npu_set_ifm_base2_t
10037{
10038 uint32_t cmd_code : 10; // NPU_SET_IFM_BASE2
10039 uint32_t must_be_zero : 4; // 0
10040 uint32_t payload_size : 2; // Min:1 Max:2
10041 uint32_t reserved0 : 16;
10042 uint32_t data : 32; // IFM base address (bottom left tile)
10043#ifdef __cplusplus
10044 CONSTEXPR bool valid() const
10045 {
10046 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_IFM_BASE2) && must_be_zero == 0 && payload_size >= 1 &&
10047 payload_size <= 2;
10048 }
10049 CONSTEXPR void init()
10050 {
10051 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_IFM_BASE2);
10052 must_be_zero = 0;
10053 payload_size = 1;
10054 }
10055 CONSTEXPR ::cmd1 get_cmd_code() const
10056 {
10057 return static_cast<::cmd1>(cmd_code);
10058 }
10059 CONSTEXPR npu_set_ifm_base2_t &set_cmd_code(::cmd1 value)
10060 {
10061 cmd_code = static_cast<uint32_t>(value);
10062 return *this;
10063 }
10064 CONSTEXPR uint32_t get_data() const
10065 {
10066 return static_cast<uint32_t>(data);
10067 }
10068 CONSTEXPR npu_set_ifm_base2_t &set_data(uint32_t value)
10069 {
10070 data = static_cast<uint32_t>(value);
10071 return *this;
10072 }
10073 CONSTEXPR uint32_t get_payload_size() const
10074 {
10075 return static_cast<uint32_t>(payload_size);
10076 }
10077 CONSTEXPR npu_set_ifm_base2_t &set_payload_size(uint32_t value)
10078 {
10079 payload_size = static_cast<uint32_t>(value);
10080 return *this;
10081 }
10082#endif //__cplusplus
10083};
10084
10085// Set IFM base address (bottom right tile)
10086struct npu_set_ifm_base3_t
10087{
10088 uint32_t cmd_code : 10; // NPU_SET_IFM_BASE3
10089 uint32_t must_be_zero : 4; // 0
10090 uint32_t payload_size : 2; // Min:1 Max:2
10091 uint32_t reserved0 : 16;
10092 uint32_t data : 32; // IFM base address (bottom right tile)
10093#ifdef __cplusplus
10094 CONSTEXPR bool valid() const
10095 {
10096 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_IFM_BASE3) && must_be_zero == 0 && payload_size >= 1 &&
10097 payload_size <= 2;
10098 }
10099 CONSTEXPR void init()
10100 {
10101 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_IFM_BASE3);
10102 must_be_zero = 0;
10103 payload_size = 1;
10104 }
10105 CONSTEXPR ::cmd1 get_cmd_code() const
10106 {
10107 return static_cast<::cmd1>(cmd_code);
10108 }
10109 CONSTEXPR npu_set_ifm_base3_t &set_cmd_code(::cmd1 value)
10110 {
10111 cmd_code = static_cast<uint32_t>(value);
10112 return *this;
10113 }
10114 CONSTEXPR uint32_t get_data() const
10115 {
10116 return static_cast<uint32_t>(data);
10117 }
10118 CONSTEXPR npu_set_ifm_base3_t &set_data(uint32_t value)
10119 {
10120 data = static_cast<uint32_t>(value);
10121 return *this;
10122 }
10123 CONSTEXPR uint32_t get_payload_size() const
10124 {
10125 return static_cast<uint32_t>(payload_size);
10126 }
10127 CONSTEXPR npu_set_ifm_base3_t &set_payload_size(uint32_t value)
10128 {
10129 payload_size = static_cast<uint32_t>(value);
10130 return *this;
10131 }
10132#endif //__cplusplus
10133};
10134
10135// Set IFM byte stride between horizontal values
10136struct npu_set_ifm_stride_x_t
10137{
10138 uint32_t cmd_code : 10; // NPU_SET_IFM_STRIDE_X
10139 uint32_t must_be_zero : 4; // 0
10140 uint32_t payload_size : 2; // Min:1 Max:2
10141 uint32_t reserved0 : 16;
10142 uint32_t data : 32; // IFM byte stride between horizontal values
10143#ifdef __cplusplus
10144 CONSTEXPR bool valid() const
10145 {
10146 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_IFM_STRIDE_X) && must_be_zero == 0 &&
10147 payload_size >= 1 && payload_size <= 2;
10148 }
10149 CONSTEXPR void init()
10150 {
10151 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_IFM_STRIDE_X);
10152 must_be_zero = 0;
10153 payload_size = 1;
10154 }
10155 CONSTEXPR ::cmd1 get_cmd_code() const
10156 {
10157 return static_cast<::cmd1>(cmd_code);
10158 }
10159 CONSTEXPR npu_set_ifm_stride_x_t &set_cmd_code(::cmd1 value)
10160 {
10161 cmd_code = static_cast<uint32_t>(value);
10162 return *this;
10163 }
10164 CONSTEXPR uint32_t get_data() const
10165 {
10166 return static_cast<uint32_t>(data);
10167 }
10168 CONSTEXPR npu_set_ifm_stride_x_t &set_data(uint32_t value)
10169 {
10170 data = static_cast<uint32_t>(value);
10171 return *this;
10172 }
10173 CONSTEXPR uint32_t get_payload_size() const
10174 {
10175 return static_cast<uint32_t>(payload_size);
10176 }
10177 CONSTEXPR npu_set_ifm_stride_x_t &set_payload_size(uint32_t value)
10178 {
10179 payload_size = static_cast<uint32_t>(value);
10180 return *this;
10181 }
10182#endif //__cplusplus
10183};
10184
10185// Set IFM byte stride between vertical values
10186struct npu_set_ifm_stride_y_t
10187{
10188 uint32_t cmd_code : 10; // NPU_SET_IFM_STRIDE_Y
10189 uint32_t must_be_zero : 4; // 0
10190 uint32_t payload_size : 2; // Min:1 Max:2
10191 uint32_t reserved0 : 16;
10192 uint32_t data : 32; // IFM byte stride between vertical values
10193#ifdef __cplusplus
10194 CONSTEXPR bool valid() const
10195 {
10196 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_IFM_STRIDE_Y) && must_be_zero == 0 &&
10197 payload_size >= 1 && payload_size <= 2;
10198 }
10199 CONSTEXPR void init()
10200 {
10201 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_IFM_STRIDE_Y);
10202 must_be_zero = 0;
10203 payload_size = 1;
10204 }
10205 CONSTEXPR ::cmd1 get_cmd_code() const
10206 {
10207 return static_cast<::cmd1>(cmd_code);
10208 }
10209 CONSTEXPR npu_set_ifm_stride_y_t &set_cmd_code(::cmd1 value)
10210 {
10211 cmd_code = static_cast<uint32_t>(value);
10212 return *this;
10213 }
10214 CONSTEXPR uint32_t get_data() const
10215 {
10216 return static_cast<uint32_t>(data);
10217 }
10218 CONSTEXPR npu_set_ifm_stride_y_t &set_data(uint32_t value)
10219 {
10220 data = static_cast<uint32_t>(value);
10221 return *this;
10222 }
10223 CONSTEXPR uint32_t get_payload_size() const
10224 {
10225 return static_cast<uint32_t>(payload_size);
10226 }
10227 CONSTEXPR npu_set_ifm_stride_y_t &set_payload_size(uint32_t value)
10228 {
10229 payload_size = static_cast<uint32_t>(value);
10230 return *this;
10231 }
10232#endif //__cplusplus
10233};
10234
10235// Set IFM byte stride between channel blocks (of 16 bytes each block)
10236struct npu_set_ifm_stride_c_t
10237{
10238 uint32_t cmd_code : 10; // NPU_SET_IFM_STRIDE_C
10239 uint32_t must_be_zero : 4; // 0
10240 uint32_t payload_size : 2; // Min:1 Max:2
10241 uint32_t reserved0 : 16;
10242 uint32_t data : 32; // IFM byte stride between channel blocks (of 16 bytes each block)
10243#ifdef __cplusplus
10244 CONSTEXPR bool valid() const
10245 {
10246 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_IFM_STRIDE_C) && must_be_zero == 0 &&
10247 payload_size >= 1 && payload_size <= 2;
10248 }
10249 CONSTEXPR void init()
10250 {
10251 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_IFM_STRIDE_C);
10252 must_be_zero = 0;
10253 payload_size = 1;
10254 }
10255 CONSTEXPR ::cmd1 get_cmd_code() const
10256 {
10257 return static_cast<::cmd1>(cmd_code);
10258 }
10259 CONSTEXPR npu_set_ifm_stride_c_t &set_cmd_code(::cmd1 value)
10260 {
10261 cmd_code = static_cast<uint32_t>(value);
10262 return *this;
10263 }
10264 CONSTEXPR uint32_t get_data() const
10265 {
10266 return static_cast<uint32_t>(data);
10267 }
10268 CONSTEXPR npu_set_ifm_stride_c_t &set_data(uint32_t value)
10269 {
10270 data = static_cast<uint32_t>(value);
10271 return *this;
10272 }
10273 CONSTEXPR uint32_t get_payload_size() const
10274 {
10275 return static_cast<uint32_t>(payload_size);
10276 }
10277 CONSTEXPR npu_set_ifm_stride_c_t &set_payload_size(uint32_t value)
10278 {
10279 payload_size = static_cast<uint32_t>(value);
10280 return *this;
10281 }
10282#endif //__cplusplus
10283};
10284
10285// Set OFM base address (top left tile)
10286struct npu_set_ofm_base0_t
10287{
10288 uint32_t cmd_code : 10; // NPU_SET_OFM_BASE0
10289 uint32_t must_be_zero : 4; // 0
10290 uint32_t payload_size : 2; // Min:1 Max:2
10291 uint32_t reserved0 : 16;
10292 uint32_t data : 32; // OFM base address (top left tile)
10293#ifdef __cplusplus
10294 CONSTEXPR bool valid() const
10295 {
10296 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_OFM_BASE0) && must_be_zero == 0 && payload_size >= 1 &&
10297 payload_size <= 2;
10298 }
10299 CONSTEXPR void init()
10300 {
10301 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_OFM_BASE0);
10302 must_be_zero = 0;
10303 payload_size = 1;
10304 }
10305 CONSTEXPR ::cmd1 get_cmd_code() const
10306 {
10307 return static_cast<::cmd1>(cmd_code);
10308 }
10309 CONSTEXPR npu_set_ofm_base0_t &set_cmd_code(::cmd1 value)
10310 {
10311 cmd_code = static_cast<uint32_t>(value);
10312 return *this;
10313 }
10314 CONSTEXPR uint32_t get_data() const
10315 {
10316 return static_cast<uint32_t>(data);
10317 }
10318 CONSTEXPR npu_set_ofm_base0_t &set_data(uint32_t value)
10319 {
10320 data = static_cast<uint32_t>(value);
10321 return *this;
10322 }
10323 CONSTEXPR uint32_t get_payload_size() const
10324 {
10325 return static_cast<uint32_t>(payload_size);
10326 }
10327 CONSTEXPR npu_set_ofm_base0_t &set_payload_size(uint32_t value)
10328 {
10329 payload_size = static_cast<uint32_t>(value);
10330 return *this;
10331 }
10332#endif //__cplusplus
10333};
10334
10335// Set OFM base address (top right tile)
10336struct npu_set_ofm_base1_t
10337{
10338 uint32_t cmd_code : 10; // NPU_SET_OFM_BASE1
10339 uint32_t must_be_zero : 4; // 0
10340 uint32_t payload_size : 2; // Min:1 Max:2
10341 uint32_t reserved0 : 16;
10342 uint32_t data : 32; // OFM base address (top right tile)
10343#ifdef __cplusplus
10344 CONSTEXPR bool valid() const
10345 {
10346 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_OFM_BASE1) && must_be_zero == 0 && payload_size >= 1 &&
10347 payload_size <= 2;
10348 }
10349 CONSTEXPR void init()
10350 {
10351 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_OFM_BASE1);
10352 must_be_zero = 0;
10353 payload_size = 1;
10354 }
10355 CONSTEXPR ::cmd1 get_cmd_code() const
10356 {
10357 return static_cast<::cmd1>(cmd_code);
10358 }
10359 CONSTEXPR npu_set_ofm_base1_t &set_cmd_code(::cmd1 value)
10360 {
10361 cmd_code = static_cast<uint32_t>(value);
10362 return *this;
10363 }
10364 CONSTEXPR uint32_t get_data() const
10365 {
10366 return static_cast<uint32_t>(data);
10367 }
10368 CONSTEXPR npu_set_ofm_base1_t &set_data(uint32_t value)
10369 {
10370 data = static_cast<uint32_t>(value);
10371 return *this;
10372 }
10373 CONSTEXPR uint32_t get_payload_size() const
10374 {
10375 return static_cast<uint32_t>(payload_size);
10376 }
10377 CONSTEXPR npu_set_ofm_base1_t &set_payload_size(uint32_t value)
10378 {
10379 payload_size = static_cast<uint32_t>(value);
10380 return *this;
10381 }
10382#endif //__cplusplus
10383};
10384
10385// Set OFM base address (bottom left tile)
10386struct npu_set_ofm_base2_t
10387{
10388 uint32_t cmd_code : 10; // NPU_SET_OFM_BASE2
10389 uint32_t must_be_zero : 4; // 0
10390 uint32_t payload_size : 2; // Min:1 Max:2
10391 uint32_t reserved0 : 16;
10392 uint32_t data : 32; // OFM base address (bottom left tile)
10393#ifdef __cplusplus
10394 CONSTEXPR bool valid() const
10395 {
10396 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_OFM_BASE2) && must_be_zero == 0 && payload_size >= 1 &&
10397 payload_size <= 2;
10398 }
10399 CONSTEXPR void init()
10400 {
10401 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_OFM_BASE2);
10402 must_be_zero = 0;
10403 payload_size = 1;
10404 }
10405 CONSTEXPR ::cmd1 get_cmd_code() const
10406 {
10407 return static_cast<::cmd1>(cmd_code);
10408 }
10409 CONSTEXPR npu_set_ofm_base2_t &set_cmd_code(::cmd1 value)
10410 {
10411 cmd_code = static_cast<uint32_t>(value);
10412 return *this;
10413 }
10414 CONSTEXPR uint32_t get_data() const
10415 {
10416 return static_cast<uint32_t>(data);
10417 }
10418 CONSTEXPR npu_set_ofm_base2_t &set_data(uint32_t value)
10419 {
10420 data = static_cast<uint32_t>(value);
10421 return *this;
10422 }
10423 CONSTEXPR uint32_t get_payload_size() const
10424 {
10425 return static_cast<uint32_t>(payload_size);
10426 }
10427 CONSTEXPR npu_set_ofm_base2_t &set_payload_size(uint32_t value)
10428 {
10429 payload_size = static_cast<uint32_t>(value);
10430 return *this;
10431 }
10432#endif //__cplusplus
10433};
10434
10435// Set OFM base address (bottom right tile)
10436struct npu_set_ofm_base3_t
10437{
10438 uint32_t cmd_code : 10; // NPU_SET_OFM_BASE3
10439 uint32_t must_be_zero : 4; // 0
10440 uint32_t payload_size : 2; // Min:1 Max:2
10441 uint32_t reserved0 : 16;
10442 uint32_t data : 32; // OFM base address (bottom right tile)
10443#ifdef __cplusplus
10444 CONSTEXPR bool valid() const
10445 {
10446 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_OFM_BASE3) && must_be_zero == 0 && payload_size >= 1 &&
10447 payload_size <= 2;
10448 }
10449 CONSTEXPR void init()
10450 {
10451 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_OFM_BASE3);
10452 must_be_zero = 0;
10453 payload_size = 1;
10454 }
10455 CONSTEXPR ::cmd1 get_cmd_code() const
10456 {
10457 return static_cast<::cmd1>(cmd_code);
10458 }
10459 CONSTEXPR npu_set_ofm_base3_t &set_cmd_code(::cmd1 value)
10460 {
10461 cmd_code = static_cast<uint32_t>(value);
10462 return *this;
10463 }
10464 CONSTEXPR uint32_t get_data() const
10465 {
10466 return static_cast<uint32_t>(data);
10467 }
10468 CONSTEXPR npu_set_ofm_base3_t &set_data(uint32_t value)
10469 {
10470 data = static_cast<uint32_t>(value);
10471 return *this;
10472 }
10473 CONSTEXPR uint32_t get_payload_size() const
10474 {
10475 return static_cast<uint32_t>(payload_size);
10476 }
10477 CONSTEXPR npu_set_ofm_base3_t &set_payload_size(uint32_t value)
10478 {
10479 payload_size = static_cast<uint32_t>(value);
10480 return *this;
10481 }
10482#endif //__cplusplus
10483};
10484
10485// Set OFM byte stride between horizontal values
10486struct npu_set_ofm_stride_x_t
10487{
10488 uint32_t cmd_code : 10; // NPU_SET_OFM_STRIDE_X
10489 uint32_t must_be_zero : 4; // 0
10490 uint32_t payload_size : 2; // Min:1 Max:2
10491 uint32_t reserved0 : 16;
10492 uint32_t data : 32; // OFM byte stride between horizontal values
10493#ifdef __cplusplus
10494 CONSTEXPR bool valid() const
10495 {
10496 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_OFM_STRIDE_X) && must_be_zero == 0 &&
10497 payload_size >= 1 && payload_size <= 2;
10498 }
10499 CONSTEXPR void init()
10500 {
10501 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_OFM_STRIDE_X);
10502 must_be_zero = 0;
10503 payload_size = 1;
10504 }
10505 CONSTEXPR ::cmd1 get_cmd_code() const
10506 {
10507 return static_cast<::cmd1>(cmd_code);
10508 }
10509 CONSTEXPR npu_set_ofm_stride_x_t &set_cmd_code(::cmd1 value)
10510 {
10511 cmd_code = static_cast<uint32_t>(value);
10512 return *this;
10513 }
10514 CONSTEXPR uint32_t get_data() const
10515 {
10516 return static_cast<uint32_t>(data);
10517 }
10518 CONSTEXPR npu_set_ofm_stride_x_t &set_data(uint32_t value)
10519 {
10520 data = static_cast<uint32_t>(value);
10521 return *this;
10522 }
10523 CONSTEXPR uint32_t get_payload_size() const
10524 {
10525 return static_cast<uint32_t>(payload_size);
10526 }
10527 CONSTEXPR npu_set_ofm_stride_x_t &set_payload_size(uint32_t value)
10528 {
10529 payload_size = static_cast<uint32_t>(value);
10530 return *this;
10531 }
10532#endif //__cplusplus
10533};
10534
10535// Set OFM byte stride between vertical values
10536struct npu_set_ofm_stride_y_t
10537{
10538 uint32_t cmd_code : 10; // NPU_SET_OFM_STRIDE_Y
10539 uint32_t must_be_zero : 4; // 0
10540 uint32_t payload_size : 2; // Min:1 Max:2
10541 uint32_t reserved0 : 16;
10542 uint32_t data : 32; // OFM byte stride between vertical values
10543#ifdef __cplusplus
10544 CONSTEXPR bool valid() const
10545 {
10546 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_OFM_STRIDE_Y) && must_be_zero == 0 &&
10547 payload_size >= 1 && payload_size <= 2;
10548 }
10549 CONSTEXPR void init()
10550 {
10551 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_OFM_STRIDE_Y);
10552 must_be_zero = 0;
10553 payload_size = 1;
10554 }
10555 CONSTEXPR ::cmd1 get_cmd_code() const
10556 {
10557 return static_cast<::cmd1>(cmd_code);
10558 }
10559 CONSTEXPR npu_set_ofm_stride_y_t &set_cmd_code(::cmd1 value)
10560 {
10561 cmd_code = static_cast<uint32_t>(value);
10562 return *this;
10563 }
10564 CONSTEXPR uint32_t get_data() const
10565 {
10566 return static_cast<uint32_t>(data);
10567 }
10568 CONSTEXPR npu_set_ofm_stride_y_t &set_data(uint32_t value)
10569 {
10570 data = static_cast<uint32_t>(value);
10571 return *this;
10572 }
10573 CONSTEXPR uint32_t get_payload_size() const
10574 {
10575 return static_cast<uint32_t>(payload_size);
10576 }
10577 CONSTEXPR npu_set_ofm_stride_y_t &set_payload_size(uint32_t value)
10578 {
10579 payload_size = static_cast<uint32_t>(value);
10580 return *this;
10581 }
10582#endif //__cplusplus
10583};
10584
10585// Set OFM byte stride between channel blocks (of 16 bytes each block)
10586struct npu_set_ofm_stride_c_t
10587{
10588 uint32_t cmd_code : 10; // NPU_SET_OFM_STRIDE_C
10589 uint32_t must_be_zero : 4; // 0
10590 uint32_t payload_size : 2; // Min:1 Max:2
10591 uint32_t reserved0 : 16;
10592 uint32_t data : 32; // OFM byte stride between channel blocks (of 16 bytes each block)
10593#ifdef __cplusplus
10594 CONSTEXPR bool valid() const
10595 {
10596 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_OFM_STRIDE_C) && must_be_zero == 0 &&
10597 payload_size >= 1 && payload_size <= 2;
10598 }
10599 CONSTEXPR void init()
10600 {
10601 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_OFM_STRIDE_C);
10602 must_be_zero = 0;
10603 payload_size = 1;
10604 }
10605 CONSTEXPR ::cmd1 get_cmd_code() const
10606 {
10607 return static_cast<::cmd1>(cmd_code);
10608 }
10609 CONSTEXPR npu_set_ofm_stride_c_t &set_cmd_code(::cmd1 value)
10610 {
10611 cmd_code = static_cast<uint32_t>(value);
10612 return *this;
10613 }
10614 CONSTEXPR uint32_t get_data() const
10615 {
10616 return static_cast<uint32_t>(data);
10617 }
10618 CONSTEXPR npu_set_ofm_stride_c_t &set_data(uint32_t value)
10619 {
10620 data = static_cast<uint32_t>(value);
10621 return *this;
10622 }
10623 CONSTEXPR uint32_t get_payload_size() const
10624 {
10625 return static_cast<uint32_t>(payload_size);
10626 }
10627 CONSTEXPR npu_set_ofm_stride_c_t &set_payload_size(uint32_t value)
10628 {
10629 payload_size = static_cast<uint32_t>(value);
10630 return *this;
10631 }
10632#endif //__cplusplus
10633};
10634
10635// Set Weight stream input base address
10636struct npu_set_weight_base_t
10637{
10638 uint32_t cmd_code : 10; // NPU_SET_WEIGHT_BASE
10639 uint32_t must_be_zero : 4; // 0
10640 uint32_t payload_size : 2; // Min:1 Max:2
10641 uint32_t reserved0 : 16;
10642 uint32_t data : 32; // Weight stream input base address
10643#ifdef __cplusplus
10644 CONSTEXPR bool valid() const
10645 {
10646 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_WEIGHT_BASE) && must_be_zero == 0 && payload_size >= 1 &&
10647 payload_size <= 2;
10648 }
10649 CONSTEXPR void init()
10650 {
10651 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_WEIGHT_BASE);
10652 must_be_zero = 0;
10653 payload_size = 1;
10654 }
10655 CONSTEXPR ::cmd1 get_cmd_code() const
10656 {
10657 return static_cast<::cmd1>(cmd_code);
10658 }
10659 CONSTEXPR npu_set_weight_base_t &set_cmd_code(::cmd1 value)
10660 {
10661 cmd_code = static_cast<uint32_t>(value);
10662 return *this;
10663 }
10664 CONSTEXPR uint32_t get_data() const
10665 {
10666 return static_cast<uint32_t>(data);
10667 }
10668 CONSTEXPR npu_set_weight_base_t &set_data(uint32_t value)
10669 {
10670 data = static_cast<uint32_t>(value);
10671 return *this;
10672 }
10673 CONSTEXPR uint32_t get_payload_size() const
10674 {
10675 return static_cast<uint32_t>(payload_size);
10676 }
10677 CONSTEXPR npu_set_weight_base_t &set_payload_size(uint32_t value)
10678 {
10679 payload_size = static_cast<uint32_t>(value);
10680 return *this;
10681 }
10682#endif //__cplusplus
10683};
10684
10685// Set Weight stream length
10686struct npu_set_weight_length_t
10687{
10688 uint32_t cmd_code : 10; // NPU_SET_WEIGHT_LENGTH
10689 uint32_t must_be_zero : 4; // 0
10690 uint32_t payload_size : 2; // Min:1 Max:2
10691 uint32_t reserved0 : 16;
10692 uint32_t data : 32; // Weight stream length
10693#ifdef __cplusplus
10694 CONSTEXPR bool valid() const
10695 {
10696 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_WEIGHT_LENGTH) && must_be_zero == 0 &&
10697 payload_size >= 1 && payload_size <= 2;
10698 }
10699 CONSTEXPR void init()
10700 {
10701 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_WEIGHT_LENGTH);
10702 must_be_zero = 0;
10703 payload_size = 1;
10704 }
10705 CONSTEXPR ::cmd1 get_cmd_code() const
10706 {
10707 return static_cast<::cmd1>(cmd_code);
10708 }
10709 CONSTEXPR npu_set_weight_length_t &set_cmd_code(::cmd1 value)
10710 {
10711 cmd_code = static_cast<uint32_t>(value);
10712 return *this;
10713 }
10714 CONSTEXPR uint32_t get_data() const
10715 {
10716 return static_cast<uint32_t>(data);
10717 }
10718 CONSTEXPR npu_set_weight_length_t &set_data(uint32_t value)
10719 {
10720 data = static_cast<uint32_t>(value);
10721 return *this;
10722 }
10723 CONSTEXPR uint32_t get_payload_size() const
10724 {
10725 return static_cast<uint32_t>(payload_size);
10726 }
10727 CONSTEXPR npu_set_weight_length_t &set_payload_size(uint32_t value)
10728 {
10729 payload_size = static_cast<uint32_t>(value);
10730 return *this;
10731 }
10732#endif //__cplusplus
10733};
10734
10735// Set Scale and bias stream input base address
10736struct npu_set_scale_base_t
10737{
10738 uint32_t cmd_code : 10; // NPU_SET_SCALE_BASE
10739 uint32_t must_be_zero : 4; // 0
10740 uint32_t payload_size : 2; // Min:1 Max:2
10741 uint32_t reserved0 : 16;
10742 uint32_t data : 32; // Scale and bias stream input base address
10743#ifdef __cplusplus
10744 CONSTEXPR bool valid() const
10745 {
10746 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_SCALE_BASE) && must_be_zero == 0 && payload_size >= 1 &&
10747 payload_size <= 2;
10748 }
10749 CONSTEXPR void init()
10750 {
10751 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_SCALE_BASE);
10752 must_be_zero = 0;
10753 payload_size = 1;
10754 }
10755 CONSTEXPR ::cmd1 get_cmd_code() const
10756 {
10757 return static_cast<::cmd1>(cmd_code);
10758 }
10759 CONSTEXPR npu_set_scale_base_t &set_cmd_code(::cmd1 value)
10760 {
10761 cmd_code = static_cast<uint32_t>(value);
10762 return *this;
10763 }
10764 CONSTEXPR uint32_t get_data() const
10765 {
10766 return static_cast<uint32_t>(data);
10767 }
10768 CONSTEXPR npu_set_scale_base_t &set_data(uint32_t value)
10769 {
10770 data = static_cast<uint32_t>(value);
10771 return *this;
10772 }
10773 CONSTEXPR uint32_t get_payload_size() const
10774 {
10775 return static_cast<uint32_t>(payload_size);
10776 }
10777 CONSTEXPR npu_set_scale_base_t &set_payload_size(uint32_t value)
10778 {
10779 payload_size = static_cast<uint32_t>(value);
10780 return *this;
10781 }
10782#endif //__cplusplus
10783};
10784
10785// Set Scale and bias stream input length
10786struct npu_set_scale_length_t
10787{
10788 uint32_t cmd_code : 10; // NPU_SET_SCALE_LENGTH
10789 uint32_t must_be_zero : 4; // 0
10790 uint32_t payload_size : 2; // Min:1 Max:2
10791 uint32_t reserved0 : 16;
10792 uint32_t data : 32; // Scale and bias stream input length
10793#ifdef __cplusplus
10794 CONSTEXPR bool valid() const
10795 {
10796 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_SCALE_LENGTH) && must_be_zero == 0 &&
10797 payload_size >= 1 && payload_size <= 2;
10798 }
10799 CONSTEXPR void init()
10800 {
10801 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_SCALE_LENGTH);
10802 must_be_zero = 0;
10803 payload_size = 1;
10804 }
10805 CONSTEXPR ::cmd1 get_cmd_code() const
10806 {
10807 return static_cast<::cmd1>(cmd_code);
10808 }
10809 CONSTEXPR npu_set_scale_length_t &set_cmd_code(::cmd1 value)
10810 {
10811 cmd_code = static_cast<uint32_t>(value);
10812 return *this;
10813 }
10814 CONSTEXPR uint32_t get_data() const
10815 {
10816 return static_cast<uint32_t>(data);
10817 }
10818 CONSTEXPR npu_set_scale_length_t &set_data(uint32_t value)
10819 {
10820 data = static_cast<uint32_t>(value);
10821 return *this;
10822 }
10823 CONSTEXPR uint32_t get_payload_size() const
10824 {
10825 return static_cast<uint32_t>(payload_size);
10826 }
10827 CONSTEXPR npu_set_scale_length_t &set_payload_size(uint32_t value)
10828 {
10829 payload_size = static_cast<uint32_t>(value);
10830 return *this;
10831 }
10832#endif //__cplusplus
10833};
10834
10835// Set scale (32-bit). Used by average pool with pad=0, elementwise MUL, ADD, SUB
10836struct npu_set_ofm_scale_t
10837{
10838 uint32_t cmd_code : 10; // NPU_SET_OFM_SCALE
10839 uint32_t must_be_zero : 4; // 0
10840 uint32_t payload_size : 2; // Min:1 Max:2
10841 uint32_t shift : 16;
10842 uint32_t data : 32; // scale (32-bit). Used by average pool with pad=0, elementwise MUL, ADD, SUB
10843#ifdef __cplusplus
10844 CONSTEXPR bool valid() const
10845 {
10846 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_OFM_SCALE) && must_be_zero == 0 && payload_size >= 1 &&
10847 payload_size <= 2;
10848 }
10849 CONSTEXPR void init()
10850 {
10851 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_OFM_SCALE);
10852 must_be_zero = 0;
10853 payload_size = 1;
10854 }
10855 CONSTEXPR ::cmd1 get_cmd_code() const
10856 {
10857 return static_cast<::cmd1>(cmd_code);
10858 }
10859 CONSTEXPR npu_set_ofm_scale_t &set_cmd_code(::cmd1 value)
10860 {
10861 cmd_code = static_cast<uint32_t>(value);
10862 return *this;
10863 }
10864 CONSTEXPR uint32_t get_data() const
10865 {
10866 return static_cast<uint32_t>(data);
10867 }
10868 CONSTEXPR npu_set_ofm_scale_t &set_data(uint32_t value)
10869 {
10870 data = static_cast<uint32_t>(value);
10871 return *this;
10872 }
10873 CONSTEXPR uint32_t get_payload_size() const
10874 {
10875 return static_cast<uint32_t>(payload_size);
10876 }
10877 CONSTEXPR npu_set_ofm_scale_t &set_payload_size(uint32_t value)
10878 {
10879 payload_size = static_cast<uint32_t>(value);
10880 return *this;
10881 }
10882 CONSTEXPR uint32_t get_shift() const
10883 {
10884 return static_cast<uint32_t>(shift);
10885 }
10886 CONSTEXPR npu_set_ofm_scale_t &set_shift(uint32_t value)
10887 {
10888 shift = static_cast<uint32_t>(value);
10889 return *this;
10890 }
10891#endif //__cplusplus
10892};
10893
10894// Set scale (32-bit) used for elementwise ADD/SUB OPA prescale. If IFM scale mode is 0 then shift is ignored and scale
10895// is 16-bit. If IFM scale mode is 1 or 2 then shift is 6-bit and scale is 32-bit
10896struct npu_set_opa_scale_t
10897{
10898 uint32_t cmd_code : 10; // NPU_SET_OPA_SCALE
10899 uint32_t must_be_zero : 4; // 0
10900 uint32_t payload_size : 2; // Min:1 Max:2
10901 uint32_t shift : 16;
10902 uint32_t
10903 data : 32; // scale (32-bit) used for elementwise ADD/SUB OPA prescale. If IFM scale mode is 0 then shift is
10904 // ignored and scale is 16-bit. If IFM scale mode is 1 or 2 then shift is 6-bit and scale is 32-bit
10905#ifdef __cplusplus
10906 CONSTEXPR bool valid() const
10907 {
10908 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_OPA_SCALE) && must_be_zero == 0 && payload_size >= 1 &&
10909 payload_size <= 2;
10910 }
10911 CONSTEXPR void init()
10912 {
10913 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_OPA_SCALE);
10914 must_be_zero = 0;
10915 payload_size = 1;
10916 }
10917 CONSTEXPR ::cmd1 get_cmd_code() const
10918 {
10919 return static_cast<::cmd1>(cmd_code);
10920 }
10921 CONSTEXPR npu_set_opa_scale_t &set_cmd_code(::cmd1 value)
10922 {
10923 cmd_code = static_cast<uint32_t>(value);
10924 return *this;
10925 }
10926 CONSTEXPR uint32_t get_data() const
10927 {
10928 return static_cast<uint32_t>(data);
10929 }
10930 CONSTEXPR npu_set_opa_scale_t &set_data(uint32_t value)
10931 {
10932 data = static_cast<uint32_t>(value);
10933 return *this;
10934 }
10935 CONSTEXPR uint32_t get_payload_size() const
10936 {
10937 return static_cast<uint32_t>(payload_size);
10938 }
10939 CONSTEXPR npu_set_opa_scale_t &set_payload_size(uint32_t value)
10940 {
10941 payload_size = static_cast<uint32_t>(value);
10942 return *this;
10943 }
10944 CONSTEXPR uint32_t get_shift() const
10945 {
10946 return static_cast<uint32_t>(shift);
10947 }
10948 CONSTEXPR npu_set_opa_scale_t &set_shift(uint32_t value)
10949 {
10950 shift = static_cast<uint32_t>(value);
10951 return *this;
10952 }
10953#endif //__cplusplus
10954};
10955
10956// Set scale (16-bit) used for elementwise ADD/SUB OPB prescale. If IFM scale mode is 0 then scale is 16-bit. If IFM
10957// scale mode is 1 or 2 then this register is not used
10958struct npu_set_opb_scale_t
10959{
10960 uint32_t cmd_code : 10; // NPU_SET_OPB_SCALE
10961 uint32_t must_be_zero : 4; // 0
10962 uint32_t payload_size : 2; // Min:1 Max:2
10963 uint32_t reserved0 : 16;
10964 uint32_t data : 32; // scale (16-bit) used for elementwise ADD/SUB OPB prescale. If IFM scale mode is 0 then scale
10965 // is 16-bit. If IFM scale mode is 1 or 2 then this register is not used
10966#ifdef __cplusplus
10967 CONSTEXPR bool valid() const
10968 {
10969 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_OPB_SCALE) && must_be_zero == 0 && payload_size >= 1 &&
10970 payload_size <= 2;
10971 }
10972 CONSTEXPR void init()
10973 {
10974 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_OPB_SCALE);
10975 must_be_zero = 0;
10976 payload_size = 1;
10977 }
10978 CONSTEXPR ::cmd1 get_cmd_code() const
10979 {
10980 return static_cast<::cmd1>(cmd_code);
10981 }
10982 CONSTEXPR npu_set_opb_scale_t &set_cmd_code(::cmd1 value)
10983 {
10984 cmd_code = static_cast<uint32_t>(value);
10985 return *this;
10986 }
10987 CONSTEXPR uint32_t get_data() const
10988 {
10989 return static_cast<uint32_t>(data);
10990 }
10991 CONSTEXPR npu_set_opb_scale_t &set_data(uint32_t value)
10992 {
10993 data = static_cast<uint32_t>(value);
10994 return *this;
10995 }
10996 CONSTEXPR uint32_t get_payload_size() const
10997 {
10998 return static_cast<uint32_t>(payload_size);
10999 }
11000 CONSTEXPR npu_set_opb_scale_t &set_payload_size(uint32_t value)
11001 {
11002 payload_size = static_cast<uint32_t>(value);
11003 return *this;
11004 }
11005#endif //__cplusplus
11006};
11007
11008// Set DMA source address
11009struct npu_set_dma0_src_t
11010{
11011 uint32_t cmd_code : 10; // NPU_SET_DMA0_SRC
11012 uint32_t must_be_zero : 4; // 0
11013 uint32_t payload_size : 2; // Min:1 Max:2
11014 uint32_t reserved0 : 16;
11015 uint32_t data : 32;
11016#ifdef __cplusplus
11017 CONSTEXPR bool valid() const
11018 {
11019 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_DMA0_SRC) && must_be_zero == 0 && payload_size >= 1 &&
11020 payload_size <= 2;
11021 }
11022 CONSTEXPR void init()
11023 {
11024 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_DMA0_SRC);
11025 must_be_zero = 0;
11026 payload_size = 1;
11027 }
11028 CONSTEXPR ::cmd1 get_cmd_code() const
11029 {
11030 return static_cast<::cmd1>(cmd_code);
11031 }
11032 CONSTEXPR npu_set_dma0_src_t &set_cmd_code(::cmd1 value)
11033 {
11034 cmd_code = static_cast<uint32_t>(value);
11035 return *this;
11036 }
11037 CONSTEXPR uint32_t get_data() const
11038 {
11039 return static_cast<uint32_t>(data);
11040 }
11041 CONSTEXPR npu_set_dma0_src_t &set_data(uint32_t value)
11042 {
11043 data = static_cast<uint32_t>(value);
11044 return *this;
11045 }
11046 CONSTEXPR uint32_t get_payload_size() const
11047 {
11048 return static_cast<uint32_t>(payload_size);
11049 }
11050 CONSTEXPR npu_set_dma0_src_t &set_payload_size(uint32_t value)
11051 {
11052 payload_size = static_cast<uint32_t>(value);
11053 return *this;
11054 }
11055#endif //__cplusplus
11056};
11057
11058// Set DMA destination address
11059struct npu_set_dma0_dst_t
11060{
11061 uint32_t cmd_code : 10; // NPU_SET_DMA0_DST
11062 uint32_t must_be_zero : 4; // 0
11063 uint32_t payload_size : 2; // Min:1 Max:2
11064 uint32_t reserved0 : 16;
11065 uint32_t data : 32;
11066#ifdef __cplusplus
11067 CONSTEXPR bool valid() const
11068 {
11069 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_DMA0_DST) && must_be_zero == 0 && payload_size >= 1 &&
11070 payload_size <= 2;
11071 }
11072 CONSTEXPR void init()
11073 {
11074 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_DMA0_DST);
11075 must_be_zero = 0;
11076 payload_size = 1;
11077 }
11078 CONSTEXPR ::cmd1 get_cmd_code() const
11079 {
11080 return static_cast<::cmd1>(cmd_code);
11081 }
11082 CONSTEXPR npu_set_dma0_dst_t &set_cmd_code(::cmd1 value)
11083 {
11084 cmd_code = static_cast<uint32_t>(value);
11085 return *this;
11086 }
11087 CONSTEXPR uint32_t get_data() const
11088 {
11089 return static_cast<uint32_t>(data);
11090 }
11091 CONSTEXPR npu_set_dma0_dst_t &set_data(uint32_t value)
11092 {
11093 data = static_cast<uint32_t>(value);
11094 return *this;
11095 }
11096 CONSTEXPR uint32_t get_payload_size() const
11097 {
11098 return static_cast<uint32_t>(payload_size);
11099 }
11100 CONSTEXPR npu_set_dma0_dst_t &set_payload_size(uint32_t value)
11101 {
11102 payload_size = static_cast<uint32_t>(value);
11103 return *this;
11104 }
11105#endif //__cplusplus
11106};
11107
11108// Set DMA length
11109struct npu_set_dma0_len_t
11110{
11111 uint32_t cmd_code : 10; // NPU_SET_DMA0_LEN
11112 uint32_t must_be_zero : 4; // 0
11113 uint32_t payload_size : 2; // Min:1 Max:2
11114 uint32_t reserved0 : 16;
11115 uint32_t data : 32; // DMA length
11116#ifdef __cplusplus
11117 CONSTEXPR bool valid() const
11118 {
11119 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_DMA0_LEN) && must_be_zero == 0 && payload_size >= 1 &&
11120 payload_size <= 2;
11121 }
11122 CONSTEXPR void init()
11123 {
11124 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_DMA0_LEN);
11125 must_be_zero = 0;
11126 payload_size = 1;
11127 }
11128 CONSTEXPR ::cmd1 get_cmd_code() const
11129 {
11130 return static_cast<::cmd1>(cmd_code);
11131 }
11132 CONSTEXPR npu_set_dma0_len_t &set_cmd_code(::cmd1 value)
11133 {
11134 cmd_code = static_cast<uint32_t>(value);
11135 return *this;
11136 }
11137 CONSTEXPR uint32_t get_data() const
11138 {
11139 return static_cast<uint32_t>(data);
11140 }
11141 CONSTEXPR npu_set_dma0_len_t &set_data(uint32_t value)
11142 {
11143 data = static_cast<uint32_t>(value);
11144 return *this;
11145 }
11146 CONSTEXPR uint32_t get_payload_size() const
11147 {
11148 return static_cast<uint32_t>(payload_size);
11149 }
11150 CONSTEXPR npu_set_dma0_len_t &set_payload_size(uint32_t value)
11151 {
11152 payload_size = static_cast<uint32_t>(value);
11153 return *this;
11154 }
11155#endif //__cplusplus
11156};
11157
11158// Set Byte distance to skip after inner size (2D/3D mode)
11159struct npu_set_dma0_skip0_t
11160{
11161 uint32_t cmd_code : 10; // NPU_SET_DMA0_SKIP0
11162 uint32_t must_be_zero : 4; // 0
11163 uint32_t payload_size : 2; // Min:1 Max:2
11164 uint32_t param : 16;
11165 uint32_t data : 32; // Byte distance to skip after inner size (2D/3D mode)
11166#ifdef __cplusplus
11167 CONSTEXPR bool valid() const
11168 {
11169 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_DMA0_SKIP0) && must_be_zero == 0 && payload_size >= 1 &&
11170 payload_size <= 2;
11171 }
11172 CONSTEXPR void init()
11173 {
11174 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_DMA0_SKIP0);
11175 must_be_zero = 0;
11176 payload_size = 1;
11177 }
11178 CONSTEXPR ::cmd1 get_cmd_code() const
11179 {
11180 return static_cast<::cmd1>(cmd_code);
11181 }
11182 CONSTEXPR npu_set_dma0_skip0_t &set_cmd_code(::cmd1 value)
11183 {
11184 cmd_code = static_cast<uint32_t>(value);
11185 return *this;
11186 }
11187 CONSTEXPR uint32_t get_data() const
11188 {
11189 return static_cast<uint32_t>(data);
11190 }
11191 CONSTEXPR npu_set_dma0_skip0_t &set_data(uint32_t value)
11192 {
11193 data = static_cast<uint32_t>(value);
11194 return *this;
11195 }
11196 CONSTEXPR uint32_t get_param() const
11197 {
11198 return static_cast<uint32_t>(param);
11199 }
11200 CONSTEXPR npu_set_dma0_skip0_t &set_param(uint32_t value)
11201 {
11202 param = static_cast<uint32_t>(value);
11203 return *this;
11204 }
11205 CONSTEXPR uint32_t get_payload_size() const
11206 {
11207 return static_cast<uint32_t>(payload_size);
11208 }
11209 CONSTEXPR npu_set_dma0_skip0_t &set_payload_size(uint32_t value)
11210 {
11211 payload_size = static_cast<uint32_t>(value);
11212 return *this;
11213 }
11214#endif //__cplusplus
11215};
11216
11217// Set Byte distance to skip after outer size (3D mode)
11218struct npu_set_dma0_skip1_t
11219{
11220 uint32_t cmd_code : 10; // NPU_SET_DMA0_SKIP1
11221 uint32_t must_be_zero : 4; // 0
11222 uint32_t payload_size : 2; // Min:1 Max:2
11223 uint32_t param : 16;
11224 uint32_t data : 32; // Byte distance to skip after outer size (3D mode)
11225#ifdef __cplusplus
11226 CONSTEXPR bool valid() const
11227 {
11228 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_DMA0_SKIP1) && must_be_zero == 0 && payload_size >= 1 &&
11229 payload_size <= 2;
11230 }
11231 CONSTEXPR void init()
11232 {
11233 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_DMA0_SKIP1);
11234 must_be_zero = 0;
11235 payload_size = 1;
11236 }
11237 CONSTEXPR ::cmd1 get_cmd_code() const
11238 {
11239 return static_cast<::cmd1>(cmd_code);
11240 }
11241 CONSTEXPR npu_set_dma0_skip1_t &set_cmd_code(::cmd1 value)
11242 {
11243 cmd_code = static_cast<uint32_t>(value);
11244 return *this;
11245 }
11246 CONSTEXPR uint32_t get_data() const
11247 {
11248 return static_cast<uint32_t>(data);
11249 }
11250 CONSTEXPR npu_set_dma0_skip1_t &set_data(uint32_t value)
11251 {
11252 data = static_cast<uint32_t>(value);
11253 return *this;
11254 }
11255 CONSTEXPR uint32_t get_param() const
11256 {
11257 return static_cast<uint32_t>(param);
11258 }
11259 CONSTEXPR npu_set_dma0_skip1_t &set_param(uint32_t value)
11260 {
11261 param = static_cast<uint32_t>(value);
11262 return *this;
11263 }
11264 CONSTEXPR uint32_t get_payload_size() const
11265 {
11266 return static_cast<uint32_t>(payload_size);
11267 }
11268 CONSTEXPR npu_set_dma0_skip1_t &set_payload_size(uint32_t value)
11269 {
11270 payload_size = static_cast<uint32_t>(value);
11271 return *this;
11272 }
11273#endif //__cplusplus
11274};
11275
11276// Set IFM2 tile0 offset (top left tile) from IFM_REGION start
11277struct npu_set_ifm2_base0_t
11278{
11279 uint32_t cmd_code : 10; // NPU_SET_IFM2_BASE0
11280 uint32_t must_be_zero : 4; // 0
11281 uint32_t payload_size : 2; // Min:1 Max:2
11282 uint32_t reserved0 : 16;
11283 uint32_t data : 32; // IFM2 tile0 offset (top left tile) from IFM_REGION start
11284#ifdef __cplusplus
11285 CONSTEXPR bool valid() const
11286 {
11287 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_IFM2_BASE0) && must_be_zero == 0 && payload_size >= 1 &&
11288 payload_size <= 2;
11289 }
11290 CONSTEXPR void init()
11291 {
11292 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_IFM2_BASE0);
11293 must_be_zero = 0;
11294 payload_size = 1;
11295 }
11296 CONSTEXPR ::cmd1 get_cmd_code() const
11297 {
11298 return static_cast<::cmd1>(cmd_code);
11299 }
11300 CONSTEXPR npu_set_ifm2_base0_t &set_cmd_code(::cmd1 value)
11301 {
11302 cmd_code = static_cast<uint32_t>(value);
11303 return *this;
11304 }
11305 CONSTEXPR uint32_t get_data() const
11306 {
11307 return static_cast<uint32_t>(data);
11308 }
11309 CONSTEXPR npu_set_ifm2_base0_t &set_data(uint32_t value)
11310 {
11311 data = static_cast<uint32_t>(value);
11312 return *this;
11313 }
11314 CONSTEXPR uint32_t get_payload_size() const
11315 {
11316 return static_cast<uint32_t>(payload_size);
11317 }
11318 CONSTEXPR npu_set_ifm2_base0_t &set_payload_size(uint32_t value)
11319 {
11320 payload_size = static_cast<uint32_t>(value);
11321 return *this;
11322 }
11323#endif //__cplusplus
11324};
11325
11326// Set IFM2 tile1 offset (top right tile) from IFM_REGION start
11327struct npu_set_ifm2_base1_t
11328{
11329 uint32_t cmd_code : 10; // NPU_SET_IFM2_BASE1
11330 uint32_t must_be_zero : 4; // 0
11331 uint32_t payload_size : 2; // Min:1 Max:2
11332 uint32_t reserved0 : 16;
11333 uint32_t data : 32; // IFM2 tile1 offset (top right tile) from IFM_REGION start
11334#ifdef __cplusplus
11335 CONSTEXPR bool valid() const
11336 {
11337 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_IFM2_BASE1) && must_be_zero == 0 && payload_size >= 1 &&
11338 payload_size <= 2;
11339 }
11340 CONSTEXPR void init()
11341 {
11342 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_IFM2_BASE1);
11343 must_be_zero = 0;
11344 payload_size = 1;
11345 }
11346 CONSTEXPR ::cmd1 get_cmd_code() const
11347 {
11348 return static_cast<::cmd1>(cmd_code);
11349 }
11350 CONSTEXPR npu_set_ifm2_base1_t &set_cmd_code(::cmd1 value)
11351 {
11352 cmd_code = static_cast<uint32_t>(value);
11353 return *this;
11354 }
11355 CONSTEXPR uint32_t get_data() const
11356 {
11357 return static_cast<uint32_t>(data);
11358 }
11359 CONSTEXPR npu_set_ifm2_base1_t &set_data(uint32_t value)
11360 {
11361 data = static_cast<uint32_t>(value);
11362 return *this;
11363 }
11364 CONSTEXPR uint32_t get_payload_size() const
11365 {
11366 return static_cast<uint32_t>(payload_size);
11367 }
11368 CONSTEXPR npu_set_ifm2_base1_t &set_payload_size(uint32_t value)
11369 {
11370 payload_size = static_cast<uint32_t>(value);
11371 return *this;
11372 }
11373#endif //__cplusplus
11374};
11375
11376// Set IFM2 tile2 offset (bottom left tile) from IFM_REGION start
11377struct npu_set_ifm2_base2_t
11378{
11379 uint32_t cmd_code : 10; // NPU_SET_IFM2_BASE2
11380 uint32_t must_be_zero : 4; // 0
11381 uint32_t payload_size : 2; // Min:1 Max:2
11382 uint32_t reserved0 : 16;
11383 uint32_t data : 32; // IFM2 tile2 offset (bottom left tile) from IFM_REGION start
11384#ifdef __cplusplus
11385 CONSTEXPR bool valid() const
11386 {
11387 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_IFM2_BASE2) && must_be_zero == 0 && payload_size >= 1 &&
11388 payload_size <= 2;
11389 }
11390 CONSTEXPR void init()
11391 {
11392 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_IFM2_BASE2);
11393 must_be_zero = 0;
11394 payload_size = 1;
11395 }
11396 CONSTEXPR ::cmd1 get_cmd_code() const
11397 {
11398 return static_cast<::cmd1>(cmd_code);
11399 }
11400 CONSTEXPR npu_set_ifm2_base2_t &set_cmd_code(::cmd1 value)
11401 {
11402 cmd_code = static_cast<uint32_t>(value);
11403 return *this;
11404 }
11405 CONSTEXPR uint32_t get_data() const
11406 {
11407 return static_cast<uint32_t>(data);
11408 }
11409 CONSTEXPR npu_set_ifm2_base2_t &set_data(uint32_t value)
11410 {
11411 data = static_cast<uint32_t>(value);
11412 return *this;
11413 }
11414 CONSTEXPR uint32_t get_payload_size() const
11415 {
11416 return static_cast<uint32_t>(payload_size);
11417 }
11418 CONSTEXPR npu_set_ifm2_base2_t &set_payload_size(uint32_t value)
11419 {
11420 payload_size = static_cast<uint32_t>(value);
11421 return *this;
11422 }
11423#endif //__cplusplus
11424};
11425
11426// Set IFM2 tile3 offset (bottom right tile) from IFM_REGION start
11427struct npu_set_ifm2_base3_t
11428{
11429 uint32_t cmd_code : 10; // NPU_SET_IFM2_BASE3
11430 uint32_t must_be_zero : 4; // 0
11431 uint32_t payload_size : 2; // Min:1 Max:2
11432 uint32_t reserved0 : 16;
11433 uint32_t data : 32; // IFM2 tile3 offset (bottom right tile) from IFM_REGION start
11434#ifdef __cplusplus
11435 CONSTEXPR bool valid() const
11436 {
11437 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_IFM2_BASE3) && must_be_zero == 0 && payload_size >= 1 &&
11438 payload_size <= 2;
11439 }
11440 CONSTEXPR void init()
11441 {
11442 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_IFM2_BASE3);
11443 must_be_zero = 0;
11444 payload_size = 1;
11445 }
11446 CONSTEXPR ::cmd1 get_cmd_code() const
11447 {
11448 return static_cast<::cmd1>(cmd_code);
11449 }
11450 CONSTEXPR npu_set_ifm2_base3_t &set_cmd_code(::cmd1 value)
11451 {
11452 cmd_code = static_cast<uint32_t>(value);
11453 return *this;
11454 }
11455 CONSTEXPR uint32_t get_data() const
11456 {
11457 return static_cast<uint32_t>(data);
11458 }
11459 CONSTEXPR npu_set_ifm2_base3_t &set_data(uint32_t value)
11460 {
11461 data = static_cast<uint32_t>(value);
11462 return *this;
11463 }
11464 CONSTEXPR uint32_t get_payload_size() const
11465 {
11466 return static_cast<uint32_t>(payload_size);
11467 }
11468 CONSTEXPR npu_set_ifm2_base3_t &set_payload_size(uint32_t value)
11469 {
11470 payload_size = static_cast<uint32_t>(value);
11471 return *this;
11472 }
11473#endif //__cplusplus
11474};
11475
11476// Set IFM2 byte stride between horizontal values
11477struct npu_set_ifm2_stride_x_t
11478{
11479 uint32_t cmd_code : 10; // NPU_SET_IFM2_STRIDE_X
11480 uint32_t must_be_zero : 4; // 0
11481 uint32_t payload_size : 2; // Min:1 Max:2
11482 uint32_t reserved0 : 16;
11483 uint32_t data : 32; // IFM2 byte stride between horizontal values
11484#ifdef __cplusplus
11485 CONSTEXPR bool valid() const
11486 {
11487 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_IFM2_STRIDE_X) && must_be_zero == 0 &&
11488 payload_size >= 1 && payload_size <= 2;
11489 }
11490 CONSTEXPR void init()
11491 {
11492 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_IFM2_STRIDE_X);
11493 must_be_zero = 0;
11494 payload_size = 1;
11495 }
11496 CONSTEXPR ::cmd1 get_cmd_code() const
11497 {
11498 return static_cast<::cmd1>(cmd_code);
11499 }
11500 CONSTEXPR npu_set_ifm2_stride_x_t &set_cmd_code(::cmd1 value)
11501 {
11502 cmd_code = static_cast<uint32_t>(value);
11503 return *this;
11504 }
11505 CONSTEXPR uint32_t get_data() const
11506 {
11507 return static_cast<uint32_t>(data);
11508 }
11509 CONSTEXPR npu_set_ifm2_stride_x_t &set_data(uint32_t value)
11510 {
11511 data = static_cast<uint32_t>(value);
11512 return *this;
11513 }
11514 CONSTEXPR uint32_t get_payload_size() const
11515 {
11516 return static_cast<uint32_t>(payload_size);
11517 }
11518 CONSTEXPR npu_set_ifm2_stride_x_t &set_payload_size(uint32_t value)
11519 {
11520 payload_size = static_cast<uint32_t>(value);
11521 return *this;
11522 }
11523#endif //__cplusplus
11524};
11525
11526// Set IFM2 byte stride between vertical values
11527struct npu_set_ifm2_stride_y_t
11528{
11529 uint32_t cmd_code : 10; // NPU_SET_IFM2_STRIDE_Y
11530 uint32_t must_be_zero : 4; // 0
11531 uint32_t payload_size : 2; // Min:1 Max:2
11532 uint32_t reserved0 : 16;
11533 uint32_t data : 32; // IFM2 byte stride between vertical values
11534#ifdef __cplusplus
11535 CONSTEXPR bool valid() const
11536 {
11537 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_IFM2_STRIDE_Y) && must_be_zero == 0 &&
11538 payload_size >= 1 && payload_size <= 2;
11539 }
11540 CONSTEXPR void init()
11541 {
11542 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_IFM2_STRIDE_Y);
11543 must_be_zero = 0;
11544 payload_size = 1;
11545 }
11546 CONSTEXPR ::cmd1 get_cmd_code() const
11547 {
11548 return static_cast<::cmd1>(cmd_code);
11549 }
11550 CONSTEXPR npu_set_ifm2_stride_y_t &set_cmd_code(::cmd1 value)
11551 {
11552 cmd_code = static_cast<uint32_t>(value);
11553 return *this;
11554 }
11555 CONSTEXPR uint32_t get_data() const
11556 {
11557 return static_cast<uint32_t>(data);
11558 }
11559 CONSTEXPR npu_set_ifm2_stride_y_t &set_data(uint32_t value)
11560 {
11561 data = static_cast<uint32_t>(value);
11562 return *this;
11563 }
11564 CONSTEXPR uint32_t get_payload_size() const
11565 {
11566 return static_cast<uint32_t>(payload_size);
11567 }
11568 CONSTEXPR npu_set_ifm2_stride_y_t &set_payload_size(uint32_t value)
11569 {
11570 payload_size = static_cast<uint32_t>(value);
11571 return *this;
11572 }
11573#endif //__cplusplus
11574};
11575
11576// Set IFM2 byte stride between channel blocks (of 16 bytes each block)
11577struct npu_set_ifm2_stride_c_t
11578{
11579 uint32_t cmd_code : 10; // NPU_SET_IFM2_STRIDE_C
11580 uint32_t must_be_zero : 4; // 0
11581 uint32_t payload_size : 2; // Min:1 Max:2
11582 uint32_t reserved0 : 16;
11583 uint32_t data : 32; // IFM2 byte stride between channel blocks (of 16 bytes each block)
11584#ifdef __cplusplus
11585 CONSTEXPR bool valid() const
11586 {
11587 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_IFM2_STRIDE_C) && must_be_zero == 0 &&
11588 payload_size >= 1 && payload_size <= 2;
11589 }
11590 CONSTEXPR void init()
11591 {
11592 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_IFM2_STRIDE_C);
11593 must_be_zero = 0;
11594 payload_size = 1;
11595 }
11596 CONSTEXPR ::cmd1 get_cmd_code() const
11597 {
11598 return static_cast<::cmd1>(cmd_code);
11599 }
11600 CONSTEXPR npu_set_ifm2_stride_c_t &set_cmd_code(::cmd1 value)
11601 {
11602 cmd_code = static_cast<uint32_t>(value);
11603 return *this;
11604 }
11605 CONSTEXPR uint32_t get_data() const
11606 {
11607 return static_cast<uint32_t>(data);
11608 }
11609 CONSTEXPR npu_set_ifm2_stride_c_t &set_data(uint32_t value)
11610 {
11611 data = static_cast<uint32_t>(value);
11612 return *this;
11613 }
11614 CONSTEXPR uint32_t get_payload_size() const
11615 {
11616 return static_cast<uint32_t>(payload_size);
11617 }
11618 CONSTEXPR npu_set_ifm2_stride_c_t &set_payload_size(uint32_t value)
11619 {
11620 payload_size = static_cast<uint32_t>(value);
11621 return *this;
11622 }
11623#endif //__cplusplus
11624};
11625
11626// Set Weight stream byte offset in WEIGHT_REGION
11627struct npu_set_weight1_base_t
11628{
11629 uint32_t cmd_code : 10; // NPU_SET_WEIGHT1_BASE
11630 uint32_t must_be_zero : 4; // 0
11631 uint32_t payload_size : 2; // Min:1 Max:2
11632 uint32_t param : 16;
11633 uint32_t data : 32; // Weight stream byte offset in WEIGHT_REGION
11634#ifdef __cplusplus
11635 CONSTEXPR bool valid() const
11636 {
11637 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_WEIGHT1_BASE) && must_be_zero == 0 &&
11638 payload_size >= 1 && payload_size <= 2;
11639 }
11640 CONSTEXPR void init()
11641 {
11642 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_WEIGHT1_BASE);
11643 must_be_zero = 0;
11644 payload_size = 1;
11645 }
11646 CONSTEXPR ::cmd1 get_cmd_code() const
11647 {
11648 return static_cast<::cmd1>(cmd_code);
11649 }
11650 CONSTEXPR npu_set_weight1_base_t &set_cmd_code(::cmd1 value)
11651 {
11652 cmd_code = static_cast<uint32_t>(value);
11653 return *this;
11654 }
11655 CONSTEXPR uint32_t get_data() const
11656 {
11657 return static_cast<uint32_t>(data);
11658 }
11659 CONSTEXPR npu_set_weight1_base_t &set_data(uint32_t value)
11660 {
11661 data = static_cast<uint32_t>(value);
11662 return *this;
11663 }
11664 CONSTEXPR uint32_t get_param() const
11665 {
11666 return static_cast<uint32_t>(param);
11667 }
11668 CONSTEXPR npu_set_weight1_base_t &set_param(uint32_t value)
11669 {
11670 param = static_cast<uint32_t>(value);
11671 return *this;
11672 }
11673 CONSTEXPR uint32_t get_payload_size() const
11674 {
11675 return static_cast<uint32_t>(payload_size);
11676 }
11677 CONSTEXPR npu_set_weight1_base_t &set_payload_size(uint32_t value)
11678 {
11679 payload_size = static_cast<uint32_t>(value);
11680 return *this;
11681 }
11682#endif //__cplusplus
11683};
11684
11685// Set Weight stream byte length (unsigned 32 bits)
11686struct npu_set_weight1_length_t
11687{
11688 uint32_t cmd_code : 10; // NPU_SET_WEIGHT1_LENGTH
11689 uint32_t must_be_zero : 4; // 0
11690 uint32_t payload_size : 2; // Min:1 Max:2
11691 uint32_t reserved0 : 16;
11692 uint32_t data : 32; // Weight stream byte length (unsigned 32 bits)
11693#ifdef __cplusplus
11694 CONSTEXPR bool valid() const
11695 {
11696 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_WEIGHT1_LENGTH) && must_be_zero == 0 &&
11697 payload_size >= 1 && payload_size <= 2;
11698 }
11699 CONSTEXPR void init()
11700 {
11701 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_WEIGHT1_LENGTH);
11702 must_be_zero = 0;
11703 payload_size = 1;
11704 }
11705 CONSTEXPR ::cmd1 get_cmd_code() const
11706 {
11707 return static_cast<::cmd1>(cmd_code);
11708 }
11709 CONSTEXPR npu_set_weight1_length_t &set_cmd_code(::cmd1 value)
11710 {
11711 cmd_code = static_cast<uint32_t>(value);
11712 return *this;
11713 }
11714 CONSTEXPR uint32_t get_data() const
11715 {
11716 return static_cast<uint32_t>(data);
11717 }
11718 CONSTEXPR npu_set_weight1_length_t &set_data(uint32_t value)
11719 {
11720 data = static_cast<uint32_t>(value);
11721 return *this;
11722 }
11723 CONSTEXPR uint32_t get_payload_size() const
11724 {
11725 return static_cast<uint32_t>(payload_size);
11726 }
11727 CONSTEXPR npu_set_weight1_length_t &set_payload_size(uint32_t value)
11728 {
11729 payload_size = static_cast<uint32_t>(value);
11730 return *this;
11731 }
11732#endif //__cplusplus
11733};
11734
11735// Set Scale and bias stream input byte offset from SCALE_REGION
11736struct npu_set_scale1_base_t
11737{
11738 uint32_t cmd_code : 10; // NPU_SET_SCALE1_BASE
11739 uint32_t must_be_zero : 4; // 0
11740 uint32_t payload_size : 2; // Min:1 Max:2
11741 uint32_t param : 16;
11742 uint32_t data : 32; // Scale and bias stream input byte offset from SCALE_REGION
11743#ifdef __cplusplus
11744 CONSTEXPR bool valid() const
11745 {
11746 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_SCALE1_BASE) && must_be_zero == 0 && payload_size >= 1 &&
11747 payload_size <= 2;
11748 }
11749 CONSTEXPR void init()
11750 {
11751 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_SCALE1_BASE);
11752 must_be_zero = 0;
11753 payload_size = 1;
11754 }
11755 CONSTEXPR ::cmd1 get_cmd_code() const
11756 {
11757 return static_cast<::cmd1>(cmd_code);
11758 }
11759 CONSTEXPR npu_set_scale1_base_t &set_cmd_code(::cmd1 value)
11760 {
11761 cmd_code = static_cast<uint32_t>(value);
11762 return *this;
11763 }
11764 CONSTEXPR uint32_t get_data() const
11765 {
11766 return static_cast<uint32_t>(data);
11767 }
11768 CONSTEXPR npu_set_scale1_base_t &set_data(uint32_t value)
11769 {
11770 data = static_cast<uint32_t>(value);
11771 return *this;
11772 }
11773 CONSTEXPR uint32_t get_param() const
11774 {
11775 return static_cast<uint32_t>(param);
11776 }
11777 CONSTEXPR npu_set_scale1_base_t &set_param(uint32_t value)
11778 {
11779 param = static_cast<uint32_t>(value);
11780 return *this;
11781 }
11782 CONSTEXPR uint32_t get_payload_size() const
11783 {
11784 return static_cast<uint32_t>(payload_size);
11785 }
11786 CONSTEXPR npu_set_scale1_base_t &set_payload_size(uint32_t value)
11787 {
11788 payload_size = static_cast<uint32_t>(value);
11789 return *this;
11790 }
11791#endif //__cplusplus
11792};
11793
11794// Set Scale and bias stream input byte length (unsigned 20 bits)
11795struct npu_set_scale1_length_t
11796{
11797 uint32_t cmd_code : 10; // NPU_SET_SCALE1_LENGTH
11798 uint32_t must_be_zero : 4; // 0
11799 uint32_t payload_size : 2; // Min:1 Max:2
11800 uint32_t reserved0 : 16;
11801 uint32_t data : 32; // Scale and bias stream input byte length (unsigned 20 bits)
11802#ifdef __cplusplus
11803 CONSTEXPR bool valid() const
11804 {
11805 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_SCALE1_LENGTH) && must_be_zero == 0 &&
11806 payload_size >= 1 && payload_size <= 2;
11807 }
11808 CONSTEXPR void init()
11809 {
11810 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_SCALE1_LENGTH);
11811 must_be_zero = 0;
11812 payload_size = 1;
11813 }
11814 CONSTEXPR ::cmd1 get_cmd_code() const
11815 {
11816 return static_cast<::cmd1>(cmd_code);
11817 }
11818 CONSTEXPR npu_set_scale1_length_t &set_cmd_code(::cmd1 value)
11819 {
11820 cmd_code = static_cast<uint32_t>(value);
11821 return *this;
11822 }
11823 CONSTEXPR uint32_t get_data() const
11824 {
11825 return static_cast<uint32_t>(data);
11826 }
11827 CONSTEXPR npu_set_scale1_length_t &set_data(uint32_t value)
11828 {
11829 data = static_cast<uint32_t>(value);
11830 return *this;
11831 }
11832 CONSTEXPR uint32_t get_payload_size() const
11833 {
11834 return static_cast<uint32_t>(payload_size);
11835 }
11836 CONSTEXPR npu_set_scale1_length_t &set_payload_size(uint32_t value)
11837 {
11838 payload_size = static_cast<uint32_t>(value);
11839 return *this;
11840 }
11841#endif //__cplusplus
11842};
11843
11844#define NPU_DATA_STRUCTS \
11845 NPU_STRUCT(command_no_payload) \
11846 NPU_STRUCT(command_with_payload) \
11847 NPU_STRUCT(npu_op_stop) \
11848 NPU_STRUCT(npu_op_irq) \
11849 NPU_STRUCT(npu_op_conv) \
11850 NPU_STRUCT(npu_op_depthwise) \
11851 NPU_STRUCT(npu_op_pool) \
11852 NPU_STRUCT(npu_op_elementwise) \
11853 NPU_STRUCT(npu_op_dma_start) \
11854 NPU_STRUCT(npu_op_dma_wait) \
11855 NPU_STRUCT(npu_op_kernel_wait) \
11856 NPU_STRUCT(npu_op_pmu_mask) \
11857 NPU_STRUCT(npu_set_ifm_pad_top) \
11858 NPU_STRUCT(npu_set_ifm_pad_left) \
11859 NPU_STRUCT(npu_set_ifm_pad_right) \
11860 NPU_STRUCT(npu_set_ifm_pad_bottom) \
11861 NPU_STRUCT(npu_set_ifm_depth_m1) \
11862 NPU_STRUCT(npu_set_ifm_precision) \
11863 NPU_STRUCT(npu_set_ifm_upscale) \
11864 NPU_STRUCT(npu_set_ifm_zero_point) \
11865 NPU_STRUCT(npu_set_ifm_width0_m1) \
11866 NPU_STRUCT(npu_set_ifm_height0_m1) \
11867 NPU_STRUCT(npu_set_ifm_height1_m1) \
11868 NPU_STRUCT(npu_set_ifm_ib_end) \
11869 NPU_STRUCT(npu_set_ifm_region) \
11870 NPU_STRUCT(npu_set_ofm_width_m1) \
11871 NPU_STRUCT(npu_set_ofm_height_m1) \
11872 NPU_STRUCT(npu_set_ofm_depth_m1) \
11873 NPU_STRUCT(npu_set_ofm_precision) \
11874 NPU_STRUCT(npu_set_ofm_blk_width_m1) \
11875 NPU_STRUCT(npu_set_ofm_blk_height_m1) \
11876 NPU_STRUCT(npu_set_ofm_blk_depth_m1) \
11877 NPU_STRUCT(npu_set_ofm_zero_point) \
11878 NPU_STRUCT(npu_set_ofm_width0_m1) \
11879 NPU_STRUCT(npu_set_ofm_height0_m1) \
11880 NPU_STRUCT(npu_set_ofm_height1_m1) \
11881 NPU_STRUCT(npu_set_ofm_region) \
11882 NPU_STRUCT(npu_set_kernel_width_m1) \
11883 NPU_STRUCT(npu_set_kernel_height_m1) \
11884 NPU_STRUCT(npu_set_kernel_stride) \
11885 NPU_STRUCT(npu_set_parallel_mode) \
11886 NPU_STRUCT(npu_set_acc_format) \
11887 NPU_STRUCT(npu_set_activation) \
11888 NPU_STRUCT(npu_set_activation_min) \
11889 NPU_STRUCT(npu_set_activation_max) \
11890 NPU_STRUCT(npu_set_weight_region) \
11891 NPU_STRUCT(npu_set_scale_region) \
11892 NPU_STRUCT(npu_set_ab_start) \
11893 NPU_STRUCT(npu_set_blockdep) \
11894 NPU_STRUCT(npu_set_dma0_src_region) \
11895 NPU_STRUCT(npu_set_dma0_dst_region) \
11896 NPU_STRUCT(npu_set_dma0_size0) \
11897 NPU_STRUCT(npu_set_dma0_size1) \
11898 NPU_STRUCT(npu_set_ifm2_broadcast) \
11899 NPU_STRUCT(npu_set_ifm2_scalar) \
11900 NPU_STRUCT(npu_set_ifm2_precision) \
11901 NPU_STRUCT(npu_set_ifm2_zero_point) \
11902 NPU_STRUCT(npu_set_ifm2_width0_m1) \
11903 NPU_STRUCT(npu_set_ifm2_height0_m1) \
11904 NPU_STRUCT(npu_set_ifm2_height1_m1) \
11905 NPU_STRUCT(npu_set_ifm2_ib_start) \
11906 NPU_STRUCT(npu_set_ifm2_region) \
11907 NPU_STRUCT(npu_set_ifm_base0) \
11908 NPU_STRUCT(npu_set_ifm_base1) \
11909 NPU_STRUCT(npu_set_ifm_base2) \
11910 NPU_STRUCT(npu_set_ifm_base3) \
11911 NPU_STRUCT(npu_set_ifm_stride_x) \
11912 NPU_STRUCT(npu_set_ifm_stride_y) \
11913 NPU_STRUCT(npu_set_ifm_stride_c) \
11914 NPU_STRUCT(npu_set_ofm_base0) \
11915 NPU_STRUCT(npu_set_ofm_base1) \
11916 NPU_STRUCT(npu_set_ofm_base2) \
11917 NPU_STRUCT(npu_set_ofm_base3) \
11918 NPU_STRUCT(npu_set_ofm_stride_x) \
11919 NPU_STRUCT(npu_set_ofm_stride_y) \
11920 NPU_STRUCT(npu_set_ofm_stride_c) \
11921 NPU_STRUCT(npu_set_weight_base) \
11922 NPU_STRUCT(npu_set_weight_length) \
11923 NPU_STRUCT(npu_set_scale_base) \
11924 NPU_STRUCT(npu_set_scale_length) \
11925 NPU_STRUCT(npu_set_ofm_scale) \
11926 NPU_STRUCT(npu_set_opa_scale) \
11927 NPU_STRUCT(npu_set_opb_scale) \
11928 NPU_STRUCT(npu_set_dma0_src) \
11929 NPU_STRUCT(npu_set_dma0_dst) \
11930 NPU_STRUCT(npu_set_dma0_len) \
11931 NPU_STRUCT(npu_set_dma0_skip0) \
11932 NPU_STRUCT(npu_set_dma0_skip1) \
11933 NPU_STRUCT(npu_set_ifm2_base0) \
11934 NPU_STRUCT(npu_set_ifm2_base1) \
11935 NPU_STRUCT(npu_set_ifm2_base2) \
11936 NPU_STRUCT(npu_set_ifm2_base3) \
11937 NPU_STRUCT(npu_set_ifm2_stride_x) \
11938 NPU_STRUCT(npu_set_ifm2_stride_y) \
11939 NPU_STRUCT(npu_set_ifm2_stride_c) \
11940 NPU_STRUCT(npu_set_weight1_base) \
11941 NPU_STRUCT(npu_set_weight1_length) \
11942 NPU_STRUCT(npu_set_scale1_base) \
11943 NPU_STRUCT(npu_set_scale1_length)
11944#define NPU_OP_STRUCTS \
11945 NPU_OP_(stop) \
11946 NPU_OP_(irq) \
11947 NPU_OP_(conv) \
11948 NPU_OP_(depthwise) \
11949 NPU_OP_(pool) \
11950 NPU_OP_(elementwise) \
11951 NPU_OP_(dma_start) \
11952 NPU_OP_(dma_wait) \
11953 NPU_OP_(kernel_wait) \
11954 NPU_OP_(pmu_mask)
11955#define NPU_SET_STRUCTS \
11956 NPU_SET_(ifm_pad_top) \
11957 NPU_SET_(ifm_pad_left) \
11958 NPU_SET_(ifm_pad_right) \
11959 NPU_SET_(ifm_pad_bottom) \
11960 NPU_SET_(ifm_depth_m1) \
11961 NPU_SET_(ifm_precision) \
11962 NPU_SET_(ifm_upscale) \
11963 NPU_SET_(ifm_zero_point) \
11964 NPU_SET_(ifm_width0_m1) \
11965 NPU_SET_(ifm_height0_m1) \
11966 NPU_SET_(ifm_height1_m1) \
11967 NPU_SET_(ifm_ib_end) \
11968 NPU_SET_(ifm_region) \
11969 NPU_SET_(ofm_width_m1) \
11970 NPU_SET_(ofm_height_m1) \
11971 NPU_SET_(ofm_depth_m1) \
11972 NPU_SET_(ofm_precision) \
11973 NPU_SET_(ofm_blk_width_m1) \
11974 NPU_SET_(ofm_blk_height_m1) \
11975 NPU_SET_(ofm_blk_depth_m1) \
11976 NPU_SET_(ofm_zero_point) \
11977 NPU_SET_(ofm_width0_m1) \
11978 NPU_SET_(ofm_height0_m1) \
11979 NPU_SET_(ofm_height1_m1) \
11980 NPU_SET_(ofm_region) \
11981 NPU_SET_(kernel_width_m1) \
11982 NPU_SET_(kernel_height_m1) \
11983 NPU_SET_(kernel_stride) \
11984 NPU_SET_(parallel_mode) \
11985 NPU_SET_(acc_format) \
11986 NPU_SET_(activation) \
11987 NPU_SET_(activation_min) \
11988 NPU_SET_(activation_max) \
11989 NPU_SET_(weight_region) \
11990 NPU_SET_(scale_region) \
11991 NPU_SET_(ab_start) \
11992 NPU_SET_(blockdep) \
11993 NPU_SET_(dma0_src_region) \
11994 NPU_SET_(dma0_dst_region) \
11995 NPU_SET_(dma0_size0) \
11996 NPU_SET_(dma0_size1) \
11997 NPU_SET_(ifm2_broadcast) \
11998 NPU_SET_(ifm2_scalar) \
11999 NPU_SET_(ifm2_precision) \
12000 NPU_SET_(ifm2_zero_point) \
12001 NPU_SET_(ifm2_width0_m1) \
12002 NPU_SET_(ifm2_height0_m1) \
12003 NPU_SET_(ifm2_height1_m1) \
12004 NPU_SET_(ifm2_ib_start) \
12005 NPU_SET_(ifm2_region) \
12006 NPU_SET_(ifm_base0) \
12007 NPU_SET_(ifm_base1) \
12008 NPU_SET_(ifm_base2) \
12009 NPU_SET_(ifm_base3) \
12010 NPU_SET_(ifm_stride_x) \
12011 NPU_SET_(ifm_stride_y) \
12012 NPU_SET_(ifm_stride_c) \
12013 NPU_SET_(ofm_base0) \
12014 NPU_SET_(ofm_base1) \
12015 NPU_SET_(ofm_base2) \
12016 NPU_SET_(ofm_base3) \
12017 NPU_SET_(ofm_stride_x) \
12018 NPU_SET_(ofm_stride_y) \
12019 NPU_SET_(ofm_stride_c) \
12020 NPU_SET_(weight_base) \
12021 NPU_SET_(weight_length) \
12022 NPU_SET_(scale_base) \
12023 NPU_SET_(scale_length) \
12024 NPU_SET_(ofm_scale) \
12025 NPU_SET_(opa_scale) \
12026 NPU_SET_(opb_scale) \
12027 NPU_SET_(dma0_src) \
12028 NPU_SET_(dma0_dst) \
12029 NPU_SET_(dma0_len) \
12030 NPU_SET_(dma0_skip0) \
12031 NPU_SET_(dma0_skip1) \
12032 NPU_SET_(ifm2_base0) \
12033 NPU_SET_(ifm2_base1) \
12034 NPU_SET_(ifm2_base2) \
12035 NPU_SET_(ifm2_base3) \
12036 NPU_SET_(ifm2_stride_x) \
12037 NPU_SET_(ifm2_stride_y) \
12038 NPU_SET_(ifm2_stride_c) \
12039 NPU_SET_(weight1_base) \
12040 NPU_SET_(weight1_length) \
12041 NPU_SET_(scale1_base) \
12042 NPU_SET_(scale1_length)
12043#define COMMAND_STRUCTS \
12044 COMMAND_(no_payload) \
12045 COMMAND_(with_payload)
12046
12047#define EXPAND_ACC_FORMAT(FUNC, SEP) \
12048 FUNC(acc_format, INT_32BIT) SEP FUNC(acc_format, INT_40BIT) SEP FUNC(acc_format, FP_S5_10)
12049
12050#define EXPAND_ACTIVATION(FUNC, SEP) \
12051 FUNC(activation, NONE) \
12052 SEP FUNC(activation, TANH) SEP FUNC(activation, SIGMOID) SEP FUNC(activation, LUT_START) \
12053 SEP FUNC(activation, LUT_END)
12054
12055#define EXPAND_CLIP_RANGE(FUNC, SEP) \
12056 FUNC(clip_range, OFM_PRECISION) \
12057 SEP FUNC(clip_range, FORCE_UINT8) SEP FUNC(clip_range, FORCE_INT8) SEP FUNC(clip_range, FORCE_INT16)
12058
12059#define EXPAND_CMD0(FUNC, SEP) \
12060 FUNC(cmd0, NPU_OP_STOP) \
12061 SEP FUNC(cmd0, NPU_OP_IRQ) SEP FUNC(cmd0, NPU_OP_CONV) SEP FUNC(cmd0, NPU_OP_DEPTHWISE) SEP FUNC( \
12062 cmd0, NPU_OP_POOL) SEP FUNC(cmd0, NPU_OP_ELEMENTWISE) SEP FUNC(cmd0, NPU_OP_DMA_START) \
12063 SEP FUNC(cmd0, NPU_OP_DMA_WAIT) SEP FUNC(cmd0, NPU_OP_KERNEL_WAIT) SEP FUNC(cmd0, NPU_OP_PMU_MASK) SEP FUNC( \
12064 cmd0, NPU_SET_IFM_PAD_TOP) SEP FUNC(cmd0, NPU_SET_IFM_PAD_LEFT) SEP FUNC(cmd0, NPU_SET_IFM_PAD_RIGHT) \
12065 SEP FUNC(cmd0, NPU_SET_IFM_PAD_BOTTOM) SEP FUNC(cmd0, NPU_SET_IFM_DEPTH_M1) SEP FUNC( \
12066 cmd0, NPU_SET_IFM_PRECISION) SEP FUNC(cmd0, NPU_SET_IFM_UPSCALE) \
12067 SEP FUNC(cmd0, NPU_SET_IFM_ZERO_POINT) SEP FUNC(cmd0, NPU_SET_IFM_WIDTH0_M1) SEP FUNC( \
12068 cmd0, NPU_SET_IFM_HEIGHT0_M1) SEP FUNC(cmd0, NPU_SET_IFM_HEIGHT1_M1) SEP FUNC(cmd0, \
12069 NPU_SET_IFM_IB_END) \
12070 SEP FUNC(cmd0, NPU_SET_IFM_REGION) SEP FUNC(cmd0, NPU_SET_OFM_WIDTH_M1) SEP FUNC( \
12071 cmd0, NPU_SET_OFM_HEIGHT_M1) SEP FUNC(cmd0, NPU_SET_OFM_DEPTH_M1) \
12072 SEP FUNC(cmd0, NPU_SET_OFM_PRECISION) SEP FUNC(cmd0, NPU_SET_OFM_BLK_WIDTH_M1) SEP FUNC( \
12073 cmd0, NPU_SET_OFM_BLK_HEIGHT_M1) SEP FUNC(cmd0, NPU_SET_OFM_BLK_DEPTH_M1) \
12074 SEP FUNC(cmd0, NPU_SET_OFM_ZERO_POINT) SEP FUNC(cmd0, NPU_SET_OFM_WIDTH0_M1) SEP FUNC( \
12075 cmd0, NPU_SET_OFM_HEIGHT0_M1) SEP FUNC(cmd0, NPU_SET_OFM_HEIGHT1_M1) \
12076 SEP FUNC(cmd0, NPU_SET_OFM_REGION) SEP FUNC(cmd0, NPU_SET_KERNEL_WIDTH_M1) SEP FUNC( \
12077 cmd0, NPU_SET_KERNEL_HEIGHT_M1) SEP FUNC(cmd0, NPU_SET_KERNEL_STRIDE) \
12078 SEP FUNC(cmd0, NPU_SET_PARALLEL_MODE) SEP FUNC(cmd0, NPU_SET_ACC_FORMAT) SEP FUNC( \
12079 cmd0, NPU_SET_ACTIVATION) SEP FUNC(cmd0, NPU_SET_ACTIVATION_MIN) \
12080 SEP FUNC(cmd0, NPU_SET_ACTIVATION_MAX) SEP FUNC(cmd0, NPU_SET_WEIGHT_REGION) \
12081 SEP FUNC(cmd0, NPU_SET_SCALE_REGION) SEP FUNC(cmd0, NPU_SET_AB_START) \
12082 SEP FUNC(cmd0, \
12083 NPU_SET_BLOCKDEP) SEP FUNC(cmd0, NPU_SET_DMA0_SRC_REGION) \
12084 SEP FUNC(cmd0, NPU_SET_DMA0_DST_REGION) SEP FUNC( \
12085 cmd0, NPU_SET_DMA0_SIZE0) SEP FUNC(cmd0, NPU_SET_DMA0_SIZE1) \
12086 SEP FUNC(cmd0, NPU_SET_IFM2_BROADCAST) \
12087 SEP FUNC(cmd0, NPU_SET_IFM2_SCALAR) \
12088 SEP FUNC(cmd0, NPU_SET_IFM2_PRECISION) SEP FUNC( \
12089 cmd0, NPU_SET_IFM2_ZERO_POINT) \
12090 SEP FUNC(cmd0, NPU_SET_IFM2_WIDTH0_M1) SEP FUNC( \
12091 cmd0, NPU_SET_IFM2_HEIGHT0_M1) \
12092 SEP FUNC(cmd0, NPU_SET_IFM2_HEIGHT1_M1) \
12093 SEP FUNC(cmd0, NPU_SET_IFM2_IB_START) \
12094 SEP FUNC(cmd0, NPU_SET_IFM2_REGION)
12095
12096#define EXPAND_CMD1(FUNC, SEP) \
12097 FUNC(cmd1, NPU_SET_IFM_BASE0) \
12098 SEP FUNC(cmd1, NPU_SET_IFM_BASE1) SEP FUNC(cmd1, NPU_SET_IFM_BASE2) SEP FUNC(cmd1, NPU_SET_IFM_BASE3) \
12099 SEP FUNC(cmd1, NPU_SET_IFM_STRIDE_X) SEP FUNC(cmd1, NPU_SET_IFM_STRIDE_Y) SEP FUNC(cmd1, NPU_SET_IFM_STRIDE_C) \
12100 SEP FUNC(cmd1, NPU_SET_OFM_BASE0) SEP FUNC(cmd1, NPU_SET_OFM_BASE1) SEP FUNC(cmd1, NPU_SET_OFM_BASE2) \
12101 SEP FUNC(cmd1, NPU_SET_OFM_BASE3) SEP FUNC(cmd1, NPU_SET_OFM_STRIDE_X) \
12102 SEP FUNC(cmd1, NPU_SET_OFM_STRIDE_Y) SEP FUNC(cmd1, NPU_SET_OFM_STRIDE_C) \
12103 SEP FUNC(cmd1, NPU_SET_WEIGHT_BASE) SEP FUNC(cmd1, NPU_SET_WEIGHT_LENGTH) \
12104 SEP FUNC(cmd1, NPU_SET_SCALE_BASE) SEP FUNC(cmd1, NPU_SET_SCALE_LENGTH) \
12105 SEP FUNC(cmd1, NPU_SET_OFM_SCALE) SEP FUNC(cmd1, NPU_SET_OPA_SCALE) \
12106 SEP FUNC(cmd1, NPU_SET_OPB_SCALE) SEP FUNC(cmd1, NPU_SET_DMA0_SRC) \
12107 SEP FUNC(cmd1, NPU_SET_DMA0_DST) SEP FUNC(cmd1, NPU_SET_DMA0_LEN) SEP FUNC( \
12108 cmd1, NPU_SET_DMA0_SKIP0) SEP FUNC(cmd1, NPU_SET_DMA0_SKIP1) \
12109 SEP FUNC(cmd1, NPU_SET_IFM2_BASE0) SEP FUNC(cmd1, NPU_SET_IFM2_BASE1) \
12110 SEP FUNC(cmd1, NPU_SET_IFM2_BASE2) SEP FUNC(cmd1, NPU_SET_IFM2_BASE3) \
12111 SEP FUNC(cmd1, NPU_SET_IFM2_STRIDE_X) \
12112 SEP FUNC(cmd1, NPU_SET_IFM2_STRIDE_Y) \
12113 SEP FUNC(cmd1, NPU_SET_IFM2_STRIDE_C) \
12114 SEP FUNC(cmd1, NPU_SET_WEIGHT1_BASE) \
12115 SEP FUNC(cmd1, NPU_SET_WEIGHT1_LENGTH) \
12116 SEP FUNC(cmd1, NPU_SET_SCALE1_BASE) \
12117 SEP FUNC(cmd1, NPU_SET_SCALE1_LENGTH)
12118
12119#define EXPAND_DATA_FORMAT(FUNC, SEP) FUNC(data_format, NHWC) SEP FUNC(data_format, NHCWB16)
12120
12121#define EXPAND_ELEMENTWISE_MODE(FUNC, SEP) \
12122 FUNC(elementwise_mode, MUL) \
12123 SEP FUNC(elementwise_mode, ADD) SEP FUNC(elementwise_mode, SUB) SEP FUNC(elementwise_mode, MIN) \
12124 SEP FUNC(elementwise_mode, MAX) SEP FUNC(elementwise_mode, LRELU) SEP FUNC(elementwise_mode, ABS) \
12125 SEP FUNC(elementwise_mode, CLZ) SEP FUNC(elementwise_mode, SHR) SEP FUNC(elementwise_mode, SHL)
12126
12127#define EXPAND_IFM_PRECISION(FUNC, SEP) \
Diqing Zhonga9f38d52020-04-27 11:00:13 +020012128 FUNC(ifm_precision, U8) \
12129 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 +020012130
12131#define EXPAND_IFM_SCALE_MODE(FUNC, SEP) \
12132 FUNC(ifm_scale_mode, SCALE_16BIT) \
12133 SEP FUNC(ifm_scale_mode, SCALE_OPA_32BIT) SEP FUNC(ifm_scale_mode, SCALE_OPB_32BIT)
12134
Diqing Zhong04118062020-04-15 01:19:12 +020012135#define EXPAND_MACS_PER_CC(FUNC, SEP) \
12136 FUNC(macs_per_cc, MACS_PER_CC_IS_5) \
12137 SEP FUNC(macs_per_cc, MACS_PER_CC_IS_6) SEP FUNC(macs_per_cc, MACS_PER_CC_IS_7) \
12138 SEP FUNC(macs_per_cc, MACS_PER_CC_IS_8)
12139
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020012140#define EXPAND_MEMORY_TYPE(FUNC, SEP) \
12141 FUNC(memory_type, AXI0_OUTSTANDING_COUNTER0) \
12142 SEP FUNC(memory_type, AXI0_OUTSTANDING_COUNTER1) SEP FUNC(memory_type, AXI1_OUTSTANDING_COUNTER2) \
12143 SEP FUNC(memory_type, AXI1_OUTSTANDING_COUNTER3)
12144
12145#define EXPAND_OFM_PRECISION(FUNC, SEP) \
12146 FUNC(ofm_precision, U8) \
12147 SEP FUNC(ofm_precision, S8) SEP FUNC(ofm_precision, U16) SEP FUNC(ofm_precision, S16) SEP FUNC(ofm_precision, S32)
12148
12149#define EXPAND_PMU_EVENT_TYPE(FUNC, SEP) \
Diqing Zhong04118062020-04-15 01:19:12 +020012150 FUNC(pmu_event_type, NO_EVENT) \
12151 SEP FUNC(pmu_event_type, CYCLE) SEP FUNC(pmu_event_type, NPU_IDLE) SEP FUNC(pmu_event_type, MAC_ACTIVE) SEP FUNC( \
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020012152 pmu_event_type, MAC_ACTIVE_8BIT) SEP FUNC(pmu_event_type, MAC_ACTIVE_16BIT) SEP FUNC(pmu_event_type, \
12153 MAC_DPU_ACTIVE) \
12154 SEP FUNC(pmu_event_type, MAC_STALLED_BY_WD_ACC) SEP FUNC(pmu_event_type, MAC_STALLED_BY_WD) SEP FUNC( \
12155 pmu_event_type, MAC_STALLED_BY_ACC) SEP FUNC(pmu_event_type, MAC_STALLED_BY_IB) SEP FUNC(pmu_event_type, \
Diqing Zhong04118062020-04-15 01:19:12 +020012156 MAC_ACTIVE_32BIT) \
12157 SEP FUNC(pmu_event_type, AO_ACTIVE) SEP FUNC(pmu_event_type, AO_ACTIVE_8BIT) SEP FUNC( \
12158 pmu_event_type, AO_ACTIVE_16BIT) SEP FUNC(pmu_event_type, AO_STALLED_BY_OFMP_OB) \
12159 SEP FUNC(pmu_event_type, AO_STALLED_BY_OFMP) SEP FUNC(pmu_event_type, AO_STALLED_BY_OB) SEP FUNC( \
12160 pmu_event_type, AO_STALLED_BY_ACC_IB) SEP FUNC(pmu_event_type, AO_STALLED_BY_ACC) \
12161 SEP FUNC(pmu_event_type, AO_STALLED_BY_IB) SEP FUNC(pmu_event_type, WD_ACTIVE) SEP FUNC( \
12162 pmu_event_type, WD_STALLED) SEP FUNC(pmu_event_type, \
12163 WD_STALLED_BY_WS) SEP FUNC(pmu_event_type, \
12164 WD_STALLED_BY_WD_BUF) \
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020012165 SEP FUNC(pmu_event_type, WD_PARSE_ACTIVE) SEP FUNC(pmu_event_type, WD_PARSE_STALLED) SEP FUNC( \
Diqing Zhong04118062020-04-15 01:19:12 +020012166 pmu_event_type, \
12167 WD_PARSE_STALLED_IN) SEP FUNC(pmu_event_type, \
12168 WD_PARSE_STALLED_OUT) SEP FUNC(pmu_event_type, WD_TRANS_WS) \
12169 SEP FUNC(pmu_event_type, WD_TRANS_WB) SEP FUNC(pmu_event_type, WD_TRANS_DW0) SEP FUNC( \
12170 pmu_event_type, \
12171 WD_TRANS_DW1) SEP FUNC(pmu_event_type, AXI0_RD_TRANS_ACCEPTED) \
12172 SEP FUNC(pmu_event_type, AXI0_RD_TRANS_COMPLETED) SEP FUNC( \
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020012173 pmu_event_type, \
Diqing Zhong04118062020-04-15 01:19:12 +020012174 AXI0_RD_DATA_BEAT_RECEIVED) SEP FUNC(pmu_event_type, AXI0_RD_TRAN_REQ_STALLED) \
12175 SEP FUNC(pmu_event_type, AXI0_WR_TRANS_ACCEPTED) SEP FUNC( \
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020012176 pmu_event_type, \
Diqing Zhong04118062020-04-15 01:19:12 +020012177 AXI0_WR_TRANS_COMPLETED_M) SEP FUNC(pmu_event_type, AXI0_WR_TRANS_COMPLETED_S) \
12178 SEP FUNC(pmu_event_type, AXI0_WR_DATA_BEAT_WRITTEN) SEP FUNC( \
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020012179 pmu_event_type, \
Diqing Zhong04118062020-04-15 01:19:12 +020012180 AXI0_WR_TRAN_REQ_STALLED) SEP FUNC(pmu_event_type, \
12181 AXI0_WR_DATA_BEAT_STALLED) \
12182 SEP FUNC(pmu_event_type, AXI0_ENABLED_CYCLES) SEP FUNC( \
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020012183 pmu_event_type, \
Diqing Zhong04118062020-04-15 01:19:12 +020012184 AXI0_RD_STALL_LIMIT) SEP FUNC(pmu_event_type, AXI0_WR_STALL_LIMIT) \
12185 SEP FUNC(pmu_event_type, \
12186 AXI1_RD_TRANS_ACCEPTED) SEP FUNC(pmu_event_type, \
12187 AXI1_RD_TRANS_COMPLETED) \
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020012188 SEP FUNC(pmu_event_type, AXI1_RD_DATA_BEAT_RECEIVED) SEP FUNC( \
12189 pmu_event_type, \
12190 AXI1_RD_TRAN_REQ_STALLED) SEP FUNC(pmu_event_type, \
12191 AXI1_WR_TRANS_ACCEPTED) \
12192 SEP FUNC(pmu_event_type, AXI1_WR_TRANS_COMPLETED_M) SEP FUNC( \
12193 pmu_event_type, \
12194 AXI1_WR_TRANS_COMPLETED_S) SEP \
12195 FUNC(pmu_event_type, AXI1_WR_DATA_BEAT_WRITTEN) SEP FUNC( \
12196 pmu_event_type, \
12197 AXI1_WR_TRAN_REQ_STALLED) SEP \
12198 FUNC(pmu_event_type, AXI1_WR_DATA_BEAT_STALLED) SEP FUNC( \
12199 pmu_event_type, \
12200 AXI1_ENABLED_CYCLES) SEP \
12201 FUNC(pmu_event_type, AXI1_RD_STALL_LIMIT) SEP FUNC( \
12202 pmu_event_type, \
12203 AXI1_WR_STALL_LIMIT) SEP FUNC(pmu_event_type, \
12204 AXI_LATENCY_ANY) \
12205 SEP FUNC(pmu_event_type, AXI_LATENCY_32) \
12206 SEP FUNC(pmu_event_type, AXI_LATENCY_64) \
12207 SEP FUNC(pmu_event_type, \
12208 AXI_LATENCY_128) \
12209 SEP FUNC(pmu_event_type, \
12210 AXI_LATENCY_256) \
12211 SEP FUNC(pmu_event_type, \
12212 AXI_LATENCY_512) \
12213 SEP FUNC(pmu_event_type, \
12214 AXI_LATENCY_1024)
12215
12216#define EXPAND_POOLING_MODE(FUNC, SEP) \
12217 FUNC(pooling_mode, MAX) SEP FUNC(pooling_mode, AVERAGE) SEP FUNC(pooling_mode, REDUCE_SUM)
12218
12219#define EXPAND_PRIVILEGE_LEVEL(FUNC, SEP) FUNC(privilege_level, USER) SEP FUNC(privilege_level, PRIVILEGED)
12220
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020012221#define EXPAND_RESAMPLING_MODE(FUNC, SEP) \
12222 FUNC(resampling_mode, NONE) SEP FUNC(resampling_mode, NEAREST) SEP FUNC(resampling_mode, TRANSPOSE)
12223
12224#define EXPAND_ROUNDING(FUNC, SEP) FUNC(rounding, TFL) SEP FUNC(rounding, TRUNCATE) SEP FUNC(rounding, NATURAL)
12225
12226#define EXPAND_SECURITY_LEVEL(FUNC, SEP) FUNC(security_level, SECURE) SEP FUNC(security_level, NON_SECURE)
12227
Diqing Zhong04118062020-04-15 01:19:12 +020012228#define EXPAND_SHRAM_SIZE(FUNC, SEP) \
12229 FUNC(shram_size, SHRAM_48KB) SEP FUNC(shram_size, SHRAM_24KB) SEP FUNC(shram_size, SHRAM_16KB)
12230
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020012231#define EXPAND_STATE(FUNC, SEP) FUNC(state, STOPPED) SEP FUNC(state, RUNNING)
12232
12233#define EXPAND_STRIDE_MODE(FUNC, SEP) \
12234 FUNC(stride_mode, STRIDE_MODE_1D) SEP FUNC(stride_mode, STRIDE_MODE_2D) SEP FUNC(stride_mode, STRIDE_MODE_3D)
Diqing Zhonga9f38d52020-04-27 11:00:13 +020012235#endif /* ETHOSU55_INTERFACE_H */