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