blob: 1f6a6aa2a369c17494ff405b1ecde348dc9f0271 [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
19#pragma once
20
21#ifdef __KERNEL__
22#include <linux/types.h>
23#else
24#include <stdint.h>
25#endif
26
27#ifdef MODEL_REGS
28#include "core/simple_types.h"
29#endif
30
31#if !defined(__cplusplus) || __cplusplus < 201402L
32#define CONSTEXPR
33#else
34#define CONSTEXPR constexpr
35#endif
36
37#ifndef __cplusplus
38#define STRUCT struct
39#else
40#define STRUCT
41#include <stdexcept>
42#endif
43
44#define NNX_ARCH_VERSION_MAJOR 0
Diqing Zhong04118062020-04-15 01:19:12 +020045#define NNX_ARCH_VERSION_MINOR 162
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020046#define NNX_ARCH_VERSION_PATCH 0
47#define NNX_ARCH_BASENAME "ULTAN"
48
49// Register offsets
50
51//
52// Register subpage DEBUG_INTERNAL
53//
54#define NPU_REG_SHARED_BUFFER0 0x0400
55#define NPU_REG_SHARED_BUFFER1 0x0404
56#define NPU_REG_SHARED_BUFFER2 0x0408
57#define NPU_REG_SHARED_BUFFER3 0x040C
58#define NPU_REG_SHARED_BUFFER4 0x0410
59#define NPU_REG_SHARED_BUFFER5 0x0414
60#define NPU_REG_SHARED_BUFFER6 0x0418
61#define NPU_REG_SHARED_BUFFER7 0x041C
62#define NPU_REG_SHARED_BUFFER8 0x0420
63#define NPU_REG_SHARED_BUFFER9 0x0424
64#define NPU_REG_SHARED_BUFFER10 0x0428
65#define NPU_REG_SHARED_BUFFER11 0x042C
66#define NPU_REG_SHARED_BUFFER12 0x0430
67#define NPU_REG_SHARED_BUFFER13 0x0434
68#define NPU_REG_SHARED_BUFFER14 0x0438
69#define NPU_REG_SHARED_BUFFER15 0x043C
70#define NPU_REG_SHARED_BUFFER16 0x0440
71#define NPU_REG_SHARED_BUFFER17 0x0444
72#define NPU_REG_SHARED_BUFFER18 0x0448
73#define NPU_REG_SHARED_BUFFER19 0x044C
74#define NPU_REG_SHARED_BUFFER20 0x0450
75#define NPU_REG_SHARED_BUFFER21 0x0454
76#define NPU_REG_SHARED_BUFFER22 0x0458
77#define NPU_REG_SHARED_BUFFER23 0x045C
78#define NPU_REG_SHARED_BUFFER24 0x0460
79#define NPU_REG_SHARED_BUFFER25 0x0464
80#define NPU_REG_SHARED_BUFFER26 0x0468
81#define NPU_REG_SHARED_BUFFER27 0x046C
82#define NPU_REG_SHARED_BUFFER28 0x0470
83#define NPU_REG_SHARED_BUFFER29 0x0474
84#define NPU_REG_SHARED_BUFFER30 0x0478
85#define NPU_REG_SHARED_BUFFER31 0x047C
86#define NPU_REG_SHARED_BUFFER32 0x0480
87#define NPU_REG_SHARED_BUFFER33 0x0484
88#define NPU_REG_SHARED_BUFFER34 0x0488
89#define NPU_REG_SHARED_BUFFER35 0x048C
90#define NPU_REG_SHARED_BUFFER36 0x0490
91#define NPU_REG_SHARED_BUFFER37 0x0494
92#define NPU_REG_SHARED_BUFFER38 0x0498
93#define NPU_REG_SHARED_BUFFER39 0x049C
94#define NPU_REG_SHARED_BUFFER40 0x04A0
95#define NPU_REG_SHARED_BUFFER41 0x04A4
96#define NPU_REG_SHARED_BUFFER42 0x04A8
97#define NPU_REG_SHARED_BUFFER43 0x04AC
98#define NPU_REG_SHARED_BUFFER44 0x04B0
99#define NPU_REG_SHARED_BUFFER45 0x04B4
100#define NPU_REG_SHARED_BUFFER46 0x04B8
101#define NPU_REG_SHARED_BUFFER47 0x04BC
102#define NPU_REG_SHARED_BUFFER48 0x04C0
103#define NPU_REG_SHARED_BUFFER49 0x04C4
104#define NPU_REG_SHARED_BUFFER50 0x04C8
105#define NPU_REG_SHARED_BUFFER51 0x04CC
106#define NPU_REG_SHARED_BUFFER52 0x04D0
107#define NPU_REG_SHARED_BUFFER53 0x04D4
108#define NPU_REG_SHARED_BUFFER54 0x04D8
109#define NPU_REG_SHARED_BUFFER55 0x04DC
110#define NPU_REG_SHARED_BUFFER56 0x04E0
111#define NPU_REG_SHARED_BUFFER57 0x04E4
112#define NPU_REG_SHARED_BUFFER58 0x04E8
113#define NPU_REG_SHARED_BUFFER59 0x04EC
114#define NPU_REG_SHARED_BUFFER60 0x04F0
115#define NPU_REG_SHARED_BUFFER61 0x04F4
116#define NPU_REG_SHARED_BUFFER62 0x04F8
117#define NPU_REG_SHARED_BUFFER63 0x04FC
118#define NPU_REG_SHARED_BUFFER64 0x0500
119#define NPU_REG_SHARED_BUFFER65 0x0504
120#define NPU_REG_SHARED_BUFFER66 0x0508
121#define NPU_REG_SHARED_BUFFER67 0x050C
122#define NPU_REG_SHARED_BUFFER68 0x0510
123#define NPU_REG_SHARED_BUFFER69 0x0514
124#define NPU_REG_SHARED_BUFFER70 0x0518
125#define NPU_REG_SHARED_BUFFER71 0x051C
126#define NPU_REG_SHARED_BUFFER72 0x0520
127#define NPU_REG_SHARED_BUFFER73 0x0524
128#define NPU_REG_SHARED_BUFFER74 0x0528
129#define NPU_REG_SHARED_BUFFER75 0x052C
130#define NPU_REG_SHARED_BUFFER76 0x0530
131#define NPU_REG_SHARED_BUFFER77 0x0534
132#define NPU_REG_SHARED_BUFFER78 0x0538
133#define NPU_REG_SHARED_BUFFER79 0x053C
134#define NPU_REG_SHARED_BUFFER80 0x0540
135#define NPU_REG_SHARED_BUFFER81 0x0544
136#define NPU_REG_SHARED_BUFFER82 0x0548
137#define NPU_REG_SHARED_BUFFER83 0x054C
138#define NPU_REG_SHARED_BUFFER84 0x0550
139#define NPU_REG_SHARED_BUFFER85 0x0554
140#define NPU_REG_SHARED_BUFFER86 0x0558
141#define NPU_REG_SHARED_BUFFER87 0x055C
142#define NPU_REG_SHARED_BUFFER88 0x0560
143#define NPU_REG_SHARED_BUFFER89 0x0564
144#define NPU_REG_SHARED_BUFFER90 0x0568
145#define NPU_REG_SHARED_BUFFER91 0x056C
146#define NPU_REG_SHARED_BUFFER92 0x0570
147#define NPU_REG_SHARED_BUFFER93 0x0574
148#define NPU_REG_SHARED_BUFFER94 0x0578
149#define NPU_REG_SHARED_BUFFER95 0x057C
150#define NPU_REG_SHARED_BUFFER96 0x0580
151#define NPU_REG_SHARED_BUFFER97 0x0584
152#define NPU_REG_SHARED_BUFFER98 0x0588
153#define NPU_REG_SHARED_BUFFER99 0x058C
154#define NPU_REG_SHARED_BUFFER100 0x0590
155#define NPU_REG_SHARED_BUFFER101 0x0594
156#define NPU_REG_SHARED_BUFFER102 0x0598
157#define NPU_REG_SHARED_BUFFER103 0x059C
158#define NPU_REG_SHARED_BUFFER104 0x05A0
159#define NPU_REG_SHARED_BUFFER105 0x05A4
160#define NPU_REG_SHARED_BUFFER106 0x05A8
161#define NPU_REG_SHARED_BUFFER107 0x05AC
162#define NPU_REG_SHARED_BUFFER108 0x05B0
163#define NPU_REG_SHARED_BUFFER109 0x05B4
164#define NPU_REG_SHARED_BUFFER110 0x05B8
165#define NPU_REG_SHARED_BUFFER111 0x05BC
166#define NPU_REG_SHARED_BUFFER112 0x05C0
167#define NPU_REG_SHARED_BUFFER113 0x05C4
168#define NPU_REG_SHARED_BUFFER114 0x05C8
169#define NPU_REG_SHARED_BUFFER115 0x05CC
170#define NPU_REG_SHARED_BUFFER116 0x05D0
171#define NPU_REG_SHARED_BUFFER117 0x05D4
172#define NPU_REG_SHARED_BUFFER118 0x05D8
173#define NPU_REG_SHARED_BUFFER119 0x05DC
174#define NPU_REG_SHARED_BUFFER120 0x05E0
175#define NPU_REG_SHARED_BUFFER121 0x05E4
176#define NPU_REG_SHARED_BUFFER122 0x05E8
177#define NPU_REG_SHARED_BUFFER123 0x05EC
178#define NPU_REG_SHARED_BUFFER124 0x05F0
179#define NPU_REG_SHARED_BUFFER125 0x05F4
180#define NPU_REG_SHARED_BUFFER126 0x05F8
181#define NPU_REG_SHARED_BUFFER127 0x05FC
182#define NPU_REG_SHARED_BUFFER128 0x0600
183#define NPU_REG_SHARED_BUFFER129 0x0604
184#define NPU_REG_SHARED_BUFFER130 0x0608
185#define NPU_REG_SHARED_BUFFER131 0x060C
186#define NPU_REG_SHARED_BUFFER132 0x0610
187#define NPU_REG_SHARED_BUFFER133 0x0614
188#define NPU_REG_SHARED_BUFFER134 0x0618
189#define NPU_REG_SHARED_BUFFER135 0x061C
190#define NPU_REG_SHARED_BUFFER136 0x0620
191#define NPU_REG_SHARED_BUFFER137 0x0624
192#define NPU_REG_SHARED_BUFFER138 0x0628
193#define NPU_REG_SHARED_BUFFER139 0x062C
194#define NPU_REG_SHARED_BUFFER140 0x0630
195#define NPU_REG_SHARED_BUFFER141 0x0634
196#define NPU_REG_SHARED_BUFFER142 0x0638
197#define NPU_REG_SHARED_BUFFER143 0x063C
198#define NPU_REG_SHARED_BUFFER144 0x0640
199#define NPU_REG_SHARED_BUFFER145 0x0644
200#define NPU_REG_SHARED_BUFFER146 0x0648
201#define NPU_REG_SHARED_BUFFER147 0x064C
202#define NPU_REG_SHARED_BUFFER148 0x0650
203#define NPU_REG_SHARED_BUFFER149 0x0654
204#define NPU_REG_SHARED_BUFFER150 0x0658
205#define NPU_REG_SHARED_BUFFER151 0x065C
206#define NPU_REG_SHARED_BUFFER152 0x0660
207#define NPU_REG_SHARED_BUFFER153 0x0664
208#define NPU_REG_SHARED_BUFFER154 0x0668
209#define NPU_REG_SHARED_BUFFER155 0x066C
210#define NPU_REG_SHARED_BUFFER156 0x0670
211#define NPU_REG_SHARED_BUFFER157 0x0674
212#define NPU_REG_SHARED_BUFFER158 0x0678
213#define NPU_REG_SHARED_BUFFER159 0x067C
214#define NPU_REG_SHARED_BUFFER160 0x0680
215#define NPU_REG_SHARED_BUFFER161 0x0684
216#define NPU_REG_SHARED_BUFFER162 0x0688
217#define NPU_REG_SHARED_BUFFER163 0x068C
218#define NPU_REG_SHARED_BUFFER164 0x0690
219#define NPU_REG_SHARED_BUFFER165 0x0694
220#define NPU_REG_SHARED_BUFFER166 0x0698
221#define NPU_REG_SHARED_BUFFER167 0x069C
222#define NPU_REG_SHARED_BUFFER168 0x06A0
223#define NPU_REG_SHARED_BUFFER169 0x06A4
224#define NPU_REG_SHARED_BUFFER170 0x06A8
225#define NPU_REG_SHARED_BUFFER171 0x06AC
226#define NPU_REG_SHARED_BUFFER172 0x06B0
227#define NPU_REG_SHARED_BUFFER173 0x06B4
228#define NPU_REG_SHARED_BUFFER174 0x06B8
229#define NPU_REG_SHARED_BUFFER175 0x06BC
230#define NPU_REG_SHARED_BUFFER176 0x06C0
231#define NPU_REG_SHARED_BUFFER177 0x06C4
232#define NPU_REG_SHARED_BUFFER178 0x06C8
233#define NPU_REG_SHARED_BUFFER179 0x06CC
234#define NPU_REG_SHARED_BUFFER180 0x06D0
235#define NPU_REG_SHARED_BUFFER181 0x06D4
236#define NPU_REG_SHARED_BUFFER182 0x06D8
237#define NPU_REG_SHARED_BUFFER183 0x06DC
238#define NPU_REG_SHARED_BUFFER184 0x06E0
239#define NPU_REG_SHARED_BUFFER185 0x06E4
240#define NPU_REG_SHARED_BUFFER186 0x06E8
241#define NPU_REG_SHARED_BUFFER187 0x06EC
242#define NPU_REG_SHARED_BUFFER188 0x06F0
243#define NPU_REG_SHARED_BUFFER189 0x06F4
244#define NPU_REG_SHARED_BUFFER190 0x06F8
245#define NPU_REG_SHARED_BUFFER191 0x06FC
246#define NPU_REG_SHARED_BUFFER192 0x0700
247#define NPU_REG_SHARED_BUFFER193 0x0704
248#define NPU_REG_SHARED_BUFFER194 0x0708
249#define NPU_REG_SHARED_BUFFER195 0x070C
250#define NPU_REG_SHARED_BUFFER196 0x0710
251#define NPU_REG_SHARED_BUFFER197 0x0714
252#define NPU_REG_SHARED_BUFFER198 0x0718
253#define NPU_REG_SHARED_BUFFER199 0x071C
254#define NPU_REG_SHARED_BUFFER200 0x0720
255#define NPU_REG_SHARED_BUFFER201 0x0724
256#define NPU_REG_SHARED_BUFFER202 0x0728
257#define NPU_REG_SHARED_BUFFER203 0x072C
258#define NPU_REG_SHARED_BUFFER204 0x0730
259#define NPU_REG_SHARED_BUFFER205 0x0734
260#define NPU_REG_SHARED_BUFFER206 0x0738
261#define NPU_REG_SHARED_BUFFER207 0x073C
262#define NPU_REG_SHARED_BUFFER208 0x0740
263#define NPU_REG_SHARED_BUFFER209 0x0744
264#define NPU_REG_SHARED_BUFFER210 0x0748
265#define NPU_REG_SHARED_BUFFER211 0x074C
266#define NPU_REG_SHARED_BUFFER212 0x0750
267#define NPU_REG_SHARED_BUFFER213 0x0754
268#define NPU_REG_SHARED_BUFFER214 0x0758
269#define NPU_REG_SHARED_BUFFER215 0x075C
270#define NPU_REG_SHARED_BUFFER216 0x0760
271#define NPU_REG_SHARED_BUFFER217 0x0764
272#define NPU_REG_SHARED_BUFFER218 0x0768
273#define NPU_REG_SHARED_BUFFER219 0x076C
274#define NPU_REG_SHARED_BUFFER220 0x0770
275#define NPU_REG_SHARED_BUFFER221 0x0774
276#define NPU_REG_SHARED_BUFFER222 0x0778
277#define NPU_REG_SHARED_BUFFER223 0x077C
278#define NPU_REG_SHARED_BUFFER224 0x0780
279#define NPU_REG_SHARED_BUFFER225 0x0784
280#define NPU_REG_SHARED_BUFFER226 0x0788
281#define NPU_REG_SHARED_BUFFER227 0x078C
282#define NPU_REG_SHARED_BUFFER228 0x0790
283#define NPU_REG_SHARED_BUFFER229 0x0794
284#define NPU_REG_SHARED_BUFFER230 0x0798
285#define NPU_REG_SHARED_BUFFER231 0x079C
286#define NPU_REG_SHARED_BUFFER232 0x07A0
287#define NPU_REG_SHARED_BUFFER233 0x07A4
288#define NPU_REG_SHARED_BUFFER234 0x07A8
289#define NPU_REG_SHARED_BUFFER235 0x07AC
290#define NPU_REG_SHARED_BUFFER236 0x07B0
291#define NPU_REG_SHARED_BUFFER237 0x07B4
292#define NPU_REG_SHARED_BUFFER238 0x07B8
293#define NPU_REG_SHARED_BUFFER239 0x07BC
294#define NPU_REG_SHARED_BUFFER240 0x07C0
295#define NPU_REG_SHARED_BUFFER241 0x07C4
296#define NPU_REG_SHARED_BUFFER242 0x07C8
297#define NPU_REG_SHARED_BUFFER243 0x07CC
298#define NPU_REG_SHARED_BUFFER244 0x07D0
299#define NPU_REG_SHARED_BUFFER245 0x07D4
300#define NPU_REG_SHARED_BUFFER246 0x07D8
301#define NPU_REG_SHARED_BUFFER247 0x07DC
302#define NPU_REG_SHARED_BUFFER248 0x07E0
303#define NPU_REG_SHARED_BUFFER249 0x07E4
304#define NPU_REG_SHARED_BUFFER250 0x07E8
305#define NPU_REG_SHARED_BUFFER251 0x07EC
306#define NPU_REG_SHARED_BUFFER252 0x07F0
307#define NPU_REG_SHARED_BUFFER253 0x07F4
308#define NPU_REG_SHARED_BUFFER254 0x07F8
309#define NPU_REG_SHARED_BUFFER255 0x07FC
310#define DEBUG_INTERNAL_REGISTERS_SIZE 0x0800
311
312//
313// Register subpage HW_DEBUG_INTERNAL
314//
Diqing Zhong04118062020-04-15 01:19:12 +0200315#define NPU_REG_WD_STATUS 0x0100
316#define NPU_REG_MAC_STATUS 0x0104
317#define NPU_REG_DMA_STATUS 0x0108
318#define NPU_REG_AO_STATUS 0x0110
Kristofer Jonsson49bdee82020-04-06 13:21:21 +0200319#define NPU_REG_CLKFORCE 0x0140
320#define NPU_REG_DEBUG 0x0144
321#define NPU_REG_DEBUG2 0x0148
322#define NPU_REG_DEBUGCORE 0x014C
323#define HW_DEBUG_INTERNAL_REGISTERS_SIZE 0x0150
324
325//
326// Register subpage NPU_BP
327//
328#define NPU_REG_BASEP0 0x0080
329#define NPU_REG_BASEP1 0x0084
330#define NPU_REG_BASEP2 0x0088
331#define NPU_REG_BASEP3 0x008C
332#define NPU_REG_BASEP4 0x0090
333#define NPU_REG_BASEP5 0x0094
334#define NPU_REG_BASEP6 0x0098
335#define NPU_REG_BASEP7 0x009C
336#define NPU_REG_BASEP8 0x00A0
337#define NPU_REG_BASEP9 0x00A4
338#define NPU_REG_BASEP10 0x00A8
339#define NPU_REG_BASEP11 0x00AC
340#define NPU_REG_BASEP12 0x00B0
341#define NPU_REG_BASEP13 0x00B4
342#define NPU_REG_BASEP14 0x00B8
343#define NPU_REG_BASEP15 0x00BC
344#define NPU_BP_REGISTERS_SIZE 0x00C0
345
346//
347// Register subpage NPU_IDS
348//
349#define NPU_REG_REVISION 0x0FC0
350#define NPU_REG_PID4 0x0FD0
351#define NPU_REG_PID5 0x0FD4
352#define NPU_REG_PID6 0x0FD8
353#define NPU_REG_PID7 0x0FDC
354#define NPU_REG_PID0 0x0FE0
355#define NPU_REG_PID1 0x0FE4
356#define NPU_REG_PID2 0x0FE8
357#define NPU_REG_PID3 0x0FEC
358#define NPU_REG_CID0 0x0FF0
359#define NPU_REG_CID1 0x0FF4
360#define NPU_REG_CID2 0x0FF8
361#define NPU_REG_CID3 0x0FFC
362#define NPU_IDS_REGISTERS_SIZE 0x1000
363
364//
365// Register subpage NPU_REG
366//
367#define NPU_REG_ID 0x0000
368#define NPU_REG_STATUS 0x0004
369#define NPU_REG_CMD 0x0008
370#define NPU_REG_RESET 0x000C
371#define NPU_REG_QBASE0 0x0010
372#define NPU_REG_QBASE1 0x0014
373#define NPU_REG_QREAD 0x0018
374#define NPU_REG_QCONFIG 0x001C
375#define NPU_REG_QSIZE 0x0020
376#define NPU_REG_PROT 0x0024
377#define NPU_REG_CONFIG 0x0028
378#define NPU_REG_LOCK 0x002C
379#define NPU_REG_REGIONCFG 0x003C
380#define NPU_REG_AXI_LIMIT0 0x0040
381#define NPU_REG_AXI_LIMIT1 0x0044
382#define NPU_REG_AXI_LIMIT2 0x0048
383#define NPU_REG_AXI_LIMIT3 0x004C
384#define NPU_REG_REGISTERS_SIZE 0x0050
385
386//
387// Register subpage PMU_INTERNAL
388//
389#define NPU_REG_PMCR 0x0180
390#define NPU_REG_PMCNTENSET 0x0184
391#define NPU_REG_PMCNTENCLR 0x0188
392#define NPU_REG_PMOVSSET 0x018C
393#define NPU_REG_PMOVSCLR 0x0190
394#define NPU_REG_PMINTSET 0x0194
395#define NPU_REG_PMINTCLR 0x0198
396#define NPU_REG_PMCCNTR_LO 0x01A0
397#define NPU_REG_PMCCNTR_HI 0x01A4
398#define NPU_REG_PMCCNTR_CFG 0x01A8
399#define NPU_REG_PMCAXI_CHAN 0x01AC
400#define NPU_REG_PMEVCNTR0 0x0300
401#define NPU_REG_PMEVCNTR1 0x0304
402#define NPU_REG_PMEVCNTR2 0x0308
403#define NPU_REG_PMEVCNTR3 0x030C
404#define NPU_REG_PMEVTYPER0 0x0380
405#define NPU_REG_PMEVTYPER1 0x0384
406#define NPU_REG_PMEVTYPER2 0x0388
407#define NPU_REG_PMEVTYPER3 0x038C
408#define PMU_INTERNAL_REGISTERS_SIZE 0x0390
409
410//
411// Register subpage TSU_DEBUG_INTERNAL
412//
413#define NPU_REG_IFM_PAD_TOP 0x0800
414#define NPU_REG_IFM_PAD_LEFT 0x0804
415#define NPU_REG_IFM_PAD_RIGHT 0x0808
416#define NPU_REG_IFM_PAD_BOTTOM 0x080C
417#define NPU_REG_IFM_DEPTH_M1 0x0810
418#define NPU_REG_IFM_PRECISION 0x0814
419#define NPU_REG_IFM_UPSCALE 0x081C
420#define NPU_REG_IFM_ZERO_POINT 0x0824
421#define NPU_REG_IFM_WIDTH0_M1 0x0828
422#define NPU_REG_IFM_HEIGHT0_M1 0x082C
423#define NPU_REG_IFM_HEIGHT1_M1 0x0830
424#define NPU_REG_IFM_IB_END 0x0834
425#define NPU_REG_IFM_REGION 0x083C
426#define NPU_REG_OFM_WIDTH_M1 0x0844
427#define NPU_REG_OFM_HEIGHT_M1 0x0848
428#define NPU_REG_OFM_DEPTH_M1 0x084C
429#define NPU_REG_OFM_PRECISION 0x0850
430#define NPU_REG_OFM_BLK_WIDTH_M1 0x0854
431#define NPU_REG_OFM_BLK_HEIGHT_M1 0x0858
432#define NPU_REG_OFM_BLK_DEPTH_M1 0x085C
433#define NPU_REG_OFM_ZERO_POINT 0x0860
434#define NPU_REG_OFM_WIDTH0_M1 0x0868
435#define NPU_REG_OFM_HEIGHT0_M1 0x086C
436#define NPU_REG_OFM_HEIGHT1_M1 0x0870
437#define NPU_REG_OFM_REGION 0x087C
438#define NPU_REG_KERNEL_WIDTH_M1 0x0880
439#define NPU_REG_KERNEL_HEIGHT_M1 0x0884
440#define NPU_REG_KERNEL_STRIDE 0x0888
441#define NPU_REG_PARALLEL_MODE 0x088C
442#define NPU_REG_ACC_FORMAT 0x0890
443#define NPU_REG_ACTIVATION 0x0894
444#define NPU_REG_ACTIVATION_MIN 0x0898
445#define NPU_REG_ACTIVATION_MAX 0x089C
446#define NPU_REG_WEIGHT_REGION 0x08A0
447#define NPU_REG_SCALE_REGION 0x08A4
448#define NPU_REG_AB_START 0x08B4
449#define NPU_REG_BLOCKDEP 0x08BC
450#define NPU_REG_DMA0_SRC_REGION 0x08C0
451#define NPU_REG_DMA0_DST_REGION 0x08C4
452#define NPU_REG_DMA0_SIZE0 0x08C8
453#define NPU_REG_DMA0_SIZE1 0x08CC
454#define NPU_REG_IFM2_BROADCAST 0x0900
455#define NPU_REG_IFM2_SCALAR 0x0904
456#define NPU_REG_IFM2_PRECISION 0x0914
457#define NPU_REG_IFM2_ZERO_POINT 0x0924
458#define NPU_REG_IFM2_WIDTH0_M1 0x0928
459#define NPU_REG_IFM2_HEIGHT0_M1 0x092C
460#define NPU_REG_IFM2_HEIGHT1_M1 0x0930
461#define NPU_REG_IFM2_IB_START 0x0934
462#define NPU_REG_IFM2_REGION 0x093C
463#define NPU_REG_IFM_BASE0 0x0A00
464#define NPU_REG_IFM_BASE0_HI 0x0A04
465#define NPU_REG_IFM_BASE1 0x0A08
466#define NPU_REG_IFM_BASE1_HI 0x0A0C
467#define NPU_REG_IFM_BASE2 0x0A10
468#define NPU_REG_IFM_BASE2_HI 0x0A14
469#define NPU_REG_IFM_BASE3 0x0A18
470#define NPU_REG_IFM_BASE3_HI 0x0A1C
471#define NPU_REG_IFM_STRIDE_X 0x0A20
472#define NPU_REG_IFM_STRIDE_X_HI 0x0A24
473#define NPU_REG_IFM_STRIDE_Y 0x0A28
474#define NPU_REG_IFM_STRIDE_Y_HI 0x0A2C
475#define NPU_REG_IFM_STRIDE_C 0x0A30
476#define NPU_REG_IFM_STRIDE_C_HI 0x0A34
477#define NPU_REG_OFM_BASE0 0x0A40
478#define NPU_REG_OFM_BASE0_HI 0x0A44
479#define NPU_REG_OFM_BASE1 0x0A48
480#define NPU_REG_OFM_BASE1_HI 0x0A4C
481#define NPU_REG_OFM_BASE2 0x0A50
482#define NPU_REG_OFM_BASE2_HI 0x0A54
483#define NPU_REG_OFM_BASE3 0x0A58
484#define NPU_REG_OFM_BASE3_HI 0x0A5C
485#define NPU_REG_OFM_STRIDE_X 0x0A60
486#define NPU_REG_OFM_STRIDE_X_HI 0x0A64
487#define NPU_REG_OFM_STRIDE_Y 0x0A68
488#define NPU_REG_OFM_STRIDE_Y_HI 0x0A6C
489#define NPU_REG_OFM_STRIDE_C 0x0A70
490#define NPU_REG_OFM_STRIDE_C_HI 0x0A74
491#define NPU_REG_WEIGHT_BASE 0x0A80
492#define NPU_REG_WEIGHT_BASE_HI 0x0A84
493#define NPU_REG_WEIGHT_LENGTH 0x0A88
494#define NPU_REG_WEIGHT_LENGTH_HI 0x0A8C
495#define NPU_REG_SCALE_BASE 0x0A90
496#define NPU_REG_SCALE_BASE_HI 0x0A94
497#define NPU_REG_SCALE_LENGTH 0x0A98
498#define NPU_REG_OFM_SCALE 0x0AA0
499#define NPU_REG_OFM_SCALE_SHIFT 0x0AA4
500#define NPU_REG_OPA_SCALE 0x0AA8
501#define NPU_REG_OPA_SCALE_SHIFT 0x0AAC
502#define NPU_REG_OPB_SCALE 0x0AB0
503#define NPU_REG_DMA0_SRC 0x0AC0
504#define NPU_REG_DMA0_SRC_HI 0x0AC4
505#define NPU_REG_DMA0_DST 0x0AC8
506#define NPU_REG_DMA0_DST_HI 0x0ACC
507#define NPU_REG_DMA0_LEN 0x0AD0
508#define NPU_REG_DMA0_LEN_HI 0x0AD4
509#define NPU_REG_DMA0_SKIP0 0x0AD8
510#define NPU_REG_DMA0_SKIP0_HI 0x0ADC
511#define NPU_REG_DMA0_SKIP1 0x0AE0
512#define NPU_REG_DMA0_SKIP1_HI 0x0AE4
513#define NPU_REG_IFM2_BASE0 0x0B00
514#define NPU_REG_IFM2_BASE0_HI 0x0B04
515#define NPU_REG_IFM2_BASE1 0x0B08
516#define NPU_REG_IFM2_BASE1_HI 0x0B0C
517#define NPU_REG_IFM2_BASE2 0x0B10
518#define NPU_REG_IFM2_BASE2_HI 0x0B14
519#define NPU_REG_IFM2_BASE3 0x0B18
520#define NPU_REG_IFM2_BASE3_HI 0x0B1C
521#define NPU_REG_IFM2_STRIDE_X 0x0B20
522#define NPU_REG_IFM2_STRIDE_X_HI 0x0B24
523#define NPU_REG_IFM2_STRIDE_Y 0x0B28
524#define NPU_REG_IFM2_STRIDE_Y_HI 0x0B2C
525#define NPU_REG_IFM2_STRIDE_C 0x0B30
526#define NPU_REG_IFM2_STRIDE_C_HI 0x0B34
527#define NPU_REG_WEIGHT1_BASE 0x0B40
528#define NPU_REG_WEIGHT1_BASE_HI 0x0B44
529#define NPU_REG_WEIGHT1_LENGTH 0x0B48
530#define NPU_REG_WEIGHT1_LENGTH_HI 0x0B4C
531#define NPU_REG_SCALE1_BASE 0x0B50
532#define NPU_REG_SCALE1_BASE_HI 0x0B54
533#define NPU_REG_SCALE1_LENGTH 0x0B58
534#define TSU_DEBUG_INTERNAL_REGISTERS_SIZE 0x0B5C
535
536//
537// Register subpage TSU_DEBUG_RO_INTERNAL
538//
539#define NPU_REG_KERNEL_X 0x0200
540#define NPU_REG_KERNEL_Y 0x0204
541#define NPU_REG_KERNEL_W_M1 0x0208
542#define NPU_REG_KERNEL_H_M1 0x020C
543#define NPU_REG_OFM_CBLK_WIDTH_M1 0x0210
544#define NPU_REG_OFM_CBLK_HEIGHT_M1 0x0214
545#define NPU_REG_OFM_CBLK_DEPTH_M1 0x0218
546#define NPU_REG_IFM_CBLK_DEPTH_M1 0x021C
547#define NPU_REG_OFM_X 0x0220
548#define NPU_REG_OFM_Y 0x0224
549#define NPU_REG_OFM_Z 0x0228
550#define NPU_REG_IFM_Z 0x022C
551#define NPU_REG_PAD_TOP 0x0230
552#define NPU_REG_PAD_LEFT 0x0234
553#define NPU_REG_IFM_CBLK_WIDTH 0x0238
554#define NPU_REG_IFM_CBLK_HEIGHT 0x023C
555#define NPU_REG_DMA_IFM_SRC 0x0240
556#define NPU_REG_DMA_IFM_SRC_HI 0x0244
557#define NPU_REG_DMA_IFM_DST 0x0248
558#define NPU_REG_DMA_OFM_SRC 0x024C
559#define NPU_REG_DMA_OFM_DST 0x0250
560#define NPU_REG_DMA_OFM_DST_HI 0x0254
561#define NPU_REG_DMA_WEIGHT_SRC 0x0258
562#define NPU_REG_DMA_WEIGHT_SRC_HI 0x025C
563#define NPU_REG_DMA_CMD_SRC 0x0260
564#define NPU_REG_DMA_CMD_SRC_HI 0x0264
565#define NPU_REG_DMA_CMD_SIZE 0x0268
566#define NPU_REG_DMA_M2M_SRC 0x026C
567#define NPU_REG_DMA_M2M_SRC_HI 0x0270
568#define NPU_REG_DMA_M2M_DST 0x0274
569#define NPU_REG_DMA_M2M_DST_HI 0x0278
570#define NPU_REG_CURRENT_QREAD 0x027C
571#define NPU_REG_DMA_SCALE_SRC 0x0280
572#define NPU_REG_DMA_SCALE_SRC_HI 0x0284
573#define NPU_REG_CURRENT_CMD 0x02BC
574#define TSU_DEBUG_RO_INTERNAL_REGISTERS_SIZE 0x02C0
575
576#ifdef __cplusplus
577
578// Enum types
579
580enum class acc_format : uint8_t
581{
582 INT_32BIT = 0,
583 INT_40BIT = 1,
584 FP_S5_10 = 2,
585};
586
587enum class activation : uint8_t
588{
589 NONE = 0,
590 TANH = 3,
591 SIGMOID = 4,
592 LUT_START = 16,
593 LUT_END = 23,
594};
595
596enum class clip_range : uint8_t
597{
598 OFM_PRECISION = 0,
599 FORCE_UINT8 = 2,
600 FORCE_INT8 = 3,
601 FORCE_INT16 = 5,
602};
603
604enum class cmd0 : uint16_t
605{
606 NPU_OP_STOP = 0x000,
607 NPU_OP_IRQ = 0x001,
608 NPU_OP_CONV = 0x002,
609 NPU_OP_DEPTHWISE = 0x003,
610 NPU_OP_POOL = 0x005,
611 NPU_OP_ELEMENTWISE = 0x006,
612 NPU_OP_DMA_START = 0x010,
613 NPU_OP_DMA_WAIT = 0x011,
614 NPU_OP_KERNEL_WAIT = 0x012,
615 NPU_OP_PMU_MASK = 0x013,
616 NPU_SET_IFM_PAD_TOP = 0x100,
617 NPU_SET_IFM_PAD_LEFT = 0x101,
618 NPU_SET_IFM_PAD_RIGHT = 0x102,
619 NPU_SET_IFM_PAD_BOTTOM = 0x103,
620 NPU_SET_IFM_DEPTH_M1 = 0x104,
621 NPU_SET_IFM_PRECISION = 0x105,
622 NPU_SET_IFM_UPSCALE = 0x107,
623 NPU_SET_IFM_ZERO_POINT = 0x109,
624 NPU_SET_IFM_WIDTH0_M1 = 0x10A,
625 NPU_SET_IFM_HEIGHT0_M1 = 0x10B,
626 NPU_SET_IFM_HEIGHT1_M1 = 0x10C,
627 NPU_SET_IFM_IB_END = 0x10D,
628 NPU_SET_IFM_REGION = 0x10F,
629 NPU_SET_OFM_WIDTH_M1 = 0x111,
630 NPU_SET_OFM_HEIGHT_M1 = 0x112,
631 NPU_SET_OFM_DEPTH_M1 = 0x113,
632 NPU_SET_OFM_PRECISION = 0x114,
633 NPU_SET_OFM_BLK_WIDTH_M1 = 0x115,
634 NPU_SET_OFM_BLK_HEIGHT_M1 = 0x116,
635 NPU_SET_OFM_BLK_DEPTH_M1 = 0x117,
636 NPU_SET_OFM_ZERO_POINT = 0x118,
637 NPU_SET_OFM_WIDTH0_M1 = 0x11A,
638 NPU_SET_OFM_HEIGHT0_M1 = 0x11B,
639 NPU_SET_OFM_HEIGHT1_M1 = 0x11C,
640 NPU_SET_OFM_REGION = 0x11F,
641 NPU_SET_KERNEL_WIDTH_M1 = 0x120,
642 NPU_SET_KERNEL_HEIGHT_M1 = 0x121,
643 NPU_SET_KERNEL_STRIDE = 0x122,
644 NPU_SET_PARALLEL_MODE = 0x123,
645 NPU_SET_ACC_FORMAT = 0x124,
646 NPU_SET_ACTIVATION = 0x125,
647 NPU_SET_ACTIVATION_MIN = 0x126,
648 NPU_SET_ACTIVATION_MAX = 0x127,
649 NPU_SET_WEIGHT_REGION = 0x128,
650 NPU_SET_SCALE_REGION = 0x129,
651 NPU_SET_AB_START = 0x12D,
652 NPU_SET_BLOCKDEP = 0x12F,
653 NPU_SET_DMA0_SRC_REGION = 0x130,
654 NPU_SET_DMA0_DST_REGION = 0x131,
655 NPU_SET_DMA0_SIZE0 = 0x132,
656 NPU_SET_DMA0_SIZE1 = 0x133,
657 NPU_SET_IFM2_BROADCAST = 0x180,
658 NPU_SET_IFM2_SCALAR = 0x181,
659 NPU_SET_IFM2_PRECISION = 0x185,
660 NPU_SET_IFM2_ZERO_POINT = 0x189,
661 NPU_SET_IFM2_WIDTH0_M1 = 0x18A,
662 NPU_SET_IFM2_HEIGHT0_M1 = 0x18B,
663 NPU_SET_IFM2_HEIGHT1_M1 = 0x18C,
664 NPU_SET_IFM2_IB_START = 0x18D,
665 NPU_SET_IFM2_REGION = 0x18F,
666};
667
668enum class cmd1 : uint8_t
669{
670 NPU_SET_IFM_BASE0 = 0x000,
671 NPU_SET_IFM_BASE1 = 0x001,
672 NPU_SET_IFM_BASE2 = 0x002,
673 NPU_SET_IFM_BASE3 = 0x003,
674 NPU_SET_IFM_STRIDE_X = 0x004,
675 NPU_SET_IFM_STRIDE_Y = 0x005,
676 NPU_SET_IFM_STRIDE_C = 0x006,
677 NPU_SET_OFM_BASE0 = 0x010,
678 NPU_SET_OFM_BASE1 = 0x011,
679 NPU_SET_OFM_BASE2 = 0x012,
680 NPU_SET_OFM_BASE3 = 0x013,
681 NPU_SET_OFM_STRIDE_X = 0x014,
682 NPU_SET_OFM_STRIDE_Y = 0x015,
683 NPU_SET_OFM_STRIDE_C = 0x016,
684 NPU_SET_WEIGHT_BASE = 0x020,
685 NPU_SET_WEIGHT_LENGTH = 0x021,
686 NPU_SET_SCALE_BASE = 0x022,
687 NPU_SET_SCALE_LENGTH = 0x023,
688 NPU_SET_OFM_SCALE = 0x024,
689 NPU_SET_OPA_SCALE = 0x025,
690 NPU_SET_OPB_SCALE = 0x026,
691 NPU_SET_DMA0_SRC = 0x030,
692 NPU_SET_DMA0_DST = 0x031,
693 NPU_SET_DMA0_LEN = 0x032,
694 NPU_SET_DMA0_SKIP0 = 0x033,
695 NPU_SET_DMA0_SKIP1 = 0x034,
696 NPU_SET_IFM2_BASE0 = 0x080,
697 NPU_SET_IFM2_BASE1 = 0x081,
698 NPU_SET_IFM2_BASE2 = 0x082,
699 NPU_SET_IFM2_BASE3 = 0x083,
700 NPU_SET_IFM2_STRIDE_X = 0x084,
701 NPU_SET_IFM2_STRIDE_Y = 0x085,
702 NPU_SET_IFM2_STRIDE_C = 0x086,
703 NPU_SET_WEIGHT1_BASE = 0x090,
704 NPU_SET_WEIGHT1_LENGTH = 0x091,
705 NPU_SET_SCALE1_BASE = 0x092,
706 NPU_SET_SCALE1_LENGTH = 0x093,
707};
708
709enum class data_format : uint8_t
710{
711 NHWC = 0,
712 NHCWB16 = 1,
713};
714
715enum class elementwise_mode : uint8_t
716{
717 MUL = 0,
718 ADD = 1,
719 SUB = 2,
720 MIN = 3,
721 MAX = 4,
722 LRELU = 5,
723 ABS = 6,
724 CLZ = 7,
725 SHR = 8,
726 SHL = 9,
727};
728
729enum class ifm_precision : uint8_t
730{
731 W8_U8 = 0,
732 W8_S8 = 1,
733 W8_U16 = 4,
734 W8_S16 = 5,
735 W8_S32 = 9,
736};
737
738enum class ifm_scale_mode : uint8_t
739{
740 SCALE_16BIT = 0,
741 SCALE_OPA_32BIT = 1,
742 SCALE_OPB_32BIT = 2,
743};
744
Diqing Zhong04118062020-04-15 01:19:12 +0200745enum class macs_per_cc : uint8_t
746{
747 MACS_PER_CC_IS_5 = 0x5,
748 MACS_PER_CC_IS_6 = 0x6,
749 MACS_PER_CC_IS_7 = 0x7,
750 MACS_PER_CC_IS_8 = 0x8,
751};
752
Kristofer Jonsson49bdee82020-04-06 13:21:21 +0200753enum class memory_type : uint8_t
754{
755 AXI0_OUTSTANDING_COUNTER0 = 0,
756 AXI0_OUTSTANDING_COUNTER1 = 1,
757 AXI1_OUTSTANDING_COUNTER2 = 2,
758 AXI1_OUTSTANDING_COUNTER3 = 3,
759};
760
761enum class ofm_precision : uint8_t
762{
763 U8 = 0,
764 S8 = 1,
765 U16 = 2,
766 S16 = 3,
767 S32 = 5,
768};
769
770enum class pmu_event_type : uint16_t
771{
Diqing Zhong04118062020-04-15 01:19:12 +0200772 NO_EVENT = 0x00,
Kristofer Jonsson49bdee82020-04-06 13:21:21 +0200773 CYCLE = 0x11,
774 NPU_IDLE = 0x20,
775 MAC_ACTIVE = 0x30,
776 MAC_ACTIVE_8BIT = 0x31,
777 MAC_ACTIVE_16BIT = 0x32,
778 MAC_DPU_ACTIVE = 0x33,
779 MAC_STALLED_BY_WD_ACC = 0x34,
780 MAC_STALLED_BY_WD = 0x35,
781 MAC_STALLED_BY_ACC = 0x36,
782 MAC_STALLED_BY_IB = 0x37,
Diqing Zhong04118062020-04-15 01:19:12 +0200783 MAC_ACTIVE_32BIT = 0x38,
Kristofer Jonsson49bdee82020-04-06 13:21:21 +0200784 AO_ACTIVE = 0x40,
785 AO_ACTIVE_8BIT = 0x41,
786 AO_ACTIVE_16BIT = 0x42,
787 AO_STALLED_BY_OFMP_OB = 0x43,
788 AO_STALLED_BY_OFMP = 0x44,
789 AO_STALLED_BY_OB = 0x45,
790 AO_STALLED_BY_ACC_IB = 0x46,
791 AO_STALLED_BY_ACC = 0x47,
792 AO_STALLED_BY_IB = 0x48,
793 WD_ACTIVE = 0x50,
794 WD_STALLED = 0x51,
795 WD_STALLED_BY_WS = 0x52,
796 WD_STALLED_BY_WD_BUF = 0x53,
797 WD_PARSE_ACTIVE = 0x54,
798 WD_PARSE_STALLED = 0x55,
799 WD_PARSE_STALLED_IN = 0x56,
800 WD_PARSE_STALLED_OUT = 0x57,
Diqing Zhong04118062020-04-15 01:19:12 +0200801 WD_TRANS_WS = 0x58,
802 WD_TRANS_WB = 0x59,
803 WD_TRANS_DW0 = 0x5a,
804 WD_TRANS_DW1 = 0x5b,
Kristofer Jonsson49bdee82020-04-06 13:21:21 +0200805 AXI0_RD_TRANS_ACCEPTED = 0x80,
806 AXI0_RD_TRANS_COMPLETED = 0x81,
807 AXI0_RD_DATA_BEAT_RECEIVED = 0x82,
808 AXI0_RD_TRAN_REQ_STALLED = 0x83,
809 AXI0_WR_TRANS_ACCEPTED = 0x84,
810 AXI0_WR_TRANS_COMPLETED_M = 0x85,
811 AXI0_WR_TRANS_COMPLETED_S = 0x86,
812 AXI0_WR_DATA_BEAT_WRITTEN = 0x87,
813 AXI0_WR_TRAN_REQ_STALLED = 0x88,
814 AXI0_WR_DATA_BEAT_STALLED = 0x89,
815 AXI0_ENABLED_CYCLES = 0x8c,
816 AXI0_RD_STALL_LIMIT = 0x8e,
817 AXI0_WR_STALL_LIMIT = 0x8f,
818 AXI1_RD_TRANS_ACCEPTED = 0x180,
819 AXI1_RD_TRANS_COMPLETED = 0x181,
820 AXI1_RD_DATA_BEAT_RECEIVED = 0x182,
821 AXI1_RD_TRAN_REQ_STALLED = 0x183,
822 AXI1_WR_TRANS_ACCEPTED = 0x184,
823 AXI1_WR_TRANS_COMPLETED_M = 0x185,
824 AXI1_WR_TRANS_COMPLETED_S = 0x186,
825 AXI1_WR_DATA_BEAT_WRITTEN = 0x187,
826 AXI1_WR_TRAN_REQ_STALLED = 0x188,
827 AXI1_WR_DATA_BEAT_STALLED = 0x189,
828 AXI1_ENABLED_CYCLES = 0x18c,
829 AXI1_RD_STALL_LIMIT = 0x18e,
830 AXI1_WR_STALL_LIMIT = 0x18f,
831 AXI_LATENCY_ANY = 0xa0,
832 AXI_LATENCY_32 = 0xa1,
833 AXI_LATENCY_64 = 0xa2,
834 AXI_LATENCY_128 = 0xa3,
835 AXI_LATENCY_256 = 0xa4,
836 AXI_LATENCY_512 = 0xa5,
837 AXI_LATENCY_1024 = 0xa6,
838};
839
840enum class pooling_mode : uint8_t
841{
842 MAX = 0,
843 AVERAGE = 1,
844 REDUCE_SUM = 2,
845};
846
847enum class privilege_level : uint8_t
848{
849 USER = 0,
850 PRIVILEGED = 1,
851};
852
Kristofer Jonsson49bdee82020-04-06 13:21:21 +0200853enum class resampling_mode : uint8_t
854{
855 NONE = 0,
856 NEAREST = 1,
857 TRANSPOSE = 2,
858};
859
860enum class rounding : uint8_t
861{
862 TFL = 0,
863 TRUNCATE = 1,
864 NATURAL = 2,
865};
866
867enum class security_level : uint8_t
868{
869 SECURE = 0,
870 NON_SECURE = 1,
871};
872
Diqing Zhong04118062020-04-15 01:19:12 +0200873enum class shram_size : uint8_t
874{
875 SHRAM_48KB = 0x30,
876 SHRAM_24KB = 0x18,
877 SHRAM_16KB = 0x10,
878};
879
Kristofer Jonsson49bdee82020-04-06 13:21:21 +0200880enum class state : uint8_t
881{
882 STOPPED = 0,
883 RUNNING = 1,
884};
885
886enum class stride_mode : uint8_t
887{
888 STRIDE_MODE_1D = 0,
889 STRIDE_MODE_2D = 1,
890 STRIDE_MODE_3D = 2,
891};
892
893#else
894
895enum acc_format
896{
897 ACC_FORMAT_INT_32BIT = 0,
898 ACC_FORMAT_INT_40BIT = 1,
899 ACC_FORMAT_FP_S5_10 = 2,
900};
901
902enum activation
903{
904 ACTIVATION_NONE = 0,
905 ACTIVATION_TANH = 3,
906 ACTIVATION_SIGMOID = 4,
907 ACTIVATION_LUT_START = 16,
908 ACTIVATION_LUT_END = 23,
909};
910
911enum clip_range
912{
913 CLIP_RANGE_OFM_PRECISION = 0,
914 CLIP_RANGE_FORCE_UINT8 = 2,
915 CLIP_RANGE_FORCE_INT8 = 3,
916 CLIP_RANGE_FORCE_INT16 = 5,
917};
918
919enum cmd0
920{
921 CMD0_NPU_OP_STOP = 0x000,
922 CMD0_NPU_OP_IRQ = 0x001,
923 CMD0_NPU_OP_CONV = 0x002,
924 CMD0_NPU_OP_DEPTHWISE = 0x003,
925 CMD0_NPU_OP_POOL = 0x005,
926 CMD0_NPU_OP_ELEMENTWISE = 0x006,
927 CMD0_NPU_OP_DMA_START = 0x010,
928 CMD0_NPU_OP_DMA_WAIT = 0x011,
929 CMD0_NPU_OP_KERNEL_WAIT = 0x012,
930 CMD0_NPU_OP_PMU_MASK = 0x013,
931 CMD0_NPU_SET_IFM_PAD_TOP = 0x100,
932 CMD0_NPU_SET_IFM_PAD_LEFT = 0x101,
933 CMD0_NPU_SET_IFM_PAD_RIGHT = 0x102,
934 CMD0_NPU_SET_IFM_PAD_BOTTOM = 0x103,
935 CMD0_NPU_SET_IFM_DEPTH_M1 = 0x104,
936 CMD0_NPU_SET_IFM_PRECISION = 0x105,
937 CMD0_NPU_SET_IFM_UPSCALE = 0x107,
938 CMD0_NPU_SET_IFM_ZERO_POINT = 0x109,
939 CMD0_NPU_SET_IFM_WIDTH0_M1 = 0x10A,
940 CMD0_NPU_SET_IFM_HEIGHT0_M1 = 0x10B,
941 CMD0_NPU_SET_IFM_HEIGHT1_M1 = 0x10C,
942 CMD0_NPU_SET_IFM_IB_END = 0x10D,
943 CMD0_NPU_SET_IFM_REGION = 0x10F,
944 CMD0_NPU_SET_OFM_WIDTH_M1 = 0x111,
945 CMD0_NPU_SET_OFM_HEIGHT_M1 = 0x112,
946 CMD0_NPU_SET_OFM_DEPTH_M1 = 0x113,
947 CMD0_NPU_SET_OFM_PRECISION = 0x114,
948 CMD0_NPU_SET_OFM_BLK_WIDTH_M1 = 0x115,
949 CMD0_NPU_SET_OFM_BLK_HEIGHT_M1 = 0x116,
950 CMD0_NPU_SET_OFM_BLK_DEPTH_M1 = 0x117,
951 CMD0_NPU_SET_OFM_ZERO_POINT = 0x118,
952 CMD0_NPU_SET_OFM_WIDTH0_M1 = 0x11A,
953 CMD0_NPU_SET_OFM_HEIGHT0_M1 = 0x11B,
954 CMD0_NPU_SET_OFM_HEIGHT1_M1 = 0x11C,
955 CMD0_NPU_SET_OFM_REGION = 0x11F,
956 CMD0_NPU_SET_KERNEL_WIDTH_M1 = 0x120,
957 CMD0_NPU_SET_KERNEL_HEIGHT_M1 = 0x121,
958 CMD0_NPU_SET_KERNEL_STRIDE = 0x122,
959 CMD0_NPU_SET_PARALLEL_MODE = 0x123,
960 CMD0_NPU_SET_ACC_FORMAT = 0x124,
961 CMD0_NPU_SET_ACTIVATION = 0x125,
962 CMD0_NPU_SET_ACTIVATION_MIN = 0x126,
963 CMD0_NPU_SET_ACTIVATION_MAX = 0x127,
964 CMD0_NPU_SET_WEIGHT_REGION = 0x128,
965 CMD0_NPU_SET_SCALE_REGION = 0x129,
966 CMD0_NPU_SET_AB_START = 0x12D,
967 CMD0_NPU_SET_BLOCKDEP = 0x12F,
968 CMD0_NPU_SET_DMA0_SRC_REGION = 0x130,
969 CMD0_NPU_SET_DMA0_DST_REGION = 0x131,
970 CMD0_NPU_SET_DMA0_SIZE0 = 0x132,
971 CMD0_NPU_SET_DMA0_SIZE1 = 0x133,
972 CMD0_NPU_SET_IFM2_BROADCAST = 0x180,
973 CMD0_NPU_SET_IFM2_SCALAR = 0x181,
974 CMD0_NPU_SET_IFM2_PRECISION = 0x185,
975 CMD0_NPU_SET_IFM2_ZERO_POINT = 0x189,
976 CMD0_NPU_SET_IFM2_WIDTH0_M1 = 0x18A,
977 CMD0_NPU_SET_IFM2_HEIGHT0_M1 = 0x18B,
978 CMD0_NPU_SET_IFM2_HEIGHT1_M1 = 0x18C,
979 CMD0_NPU_SET_IFM2_IB_START = 0x18D,
980 CMD0_NPU_SET_IFM2_REGION = 0x18F,
981};
982
983enum cmd1
984{
985 CMD1_NPU_SET_IFM_BASE0 = 0x000,
986 CMD1_NPU_SET_IFM_BASE1 = 0x001,
987 CMD1_NPU_SET_IFM_BASE2 = 0x002,
988 CMD1_NPU_SET_IFM_BASE3 = 0x003,
989 CMD1_NPU_SET_IFM_STRIDE_X = 0x004,
990 CMD1_NPU_SET_IFM_STRIDE_Y = 0x005,
991 CMD1_NPU_SET_IFM_STRIDE_C = 0x006,
992 CMD1_NPU_SET_OFM_BASE0 = 0x010,
993 CMD1_NPU_SET_OFM_BASE1 = 0x011,
994 CMD1_NPU_SET_OFM_BASE2 = 0x012,
995 CMD1_NPU_SET_OFM_BASE3 = 0x013,
996 CMD1_NPU_SET_OFM_STRIDE_X = 0x014,
997 CMD1_NPU_SET_OFM_STRIDE_Y = 0x015,
998 CMD1_NPU_SET_OFM_STRIDE_C = 0x016,
999 CMD1_NPU_SET_WEIGHT_BASE = 0x020,
1000 CMD1_NPU_SET_WEIGHT_LENGTH = 0x021,
1001 CMD1_NPU_SET_SCALE_BASE = 0x022,
1002 CMD1_NPU_SET_SCALE_LENGTH = 0x023,
1003 CMD1_NPU_SET_OFM_SCALE = 0x024,
1004 CMD1_NPU_SET_OPA_SCALE = 0x025,
1005 CMD1_NPU_SET_OPB_SCALE = 0x026,
1006 CMD1_NPU_SET_DMA0_SRC = 0x030,
1007 CMD1_NPU_SET_DMA0_DST = 0x031,
1008 CMD1_NPU_SET_DMA0_LEN = 0x032,
1009 CMD1_NPU_SET_DMA0_SKIP0 = 0x033,
1010 CMD1_NPU_SET_DMA0_SKIP1 = 0x034,
1011 CMD1_NPU_SET_IFM2_BASE0 = 0x080,
1012 CMD1_NPU_SET_IFM2_BASE1 = 0x081,
1013 CMD1_NPU_SET_IFM2_BASE2 = 0x082,
1014 CMD1_NPU_SET_IFM2_BASE3 = 0x083,
1015 CMD1_NPU_SET_IFM2_STRIDE_X = 0x084,
1016 CMD1_NPU_SET_IFM2_STRIDE_Y = 0x085,
1017 CMD1_NPU_SET_IFM2_STRIDE_C = 0x086,
1018 CMD1_NPU_SET_WEIGHT1_BASE = 0x090,
1019 CMD1_NPU_SET_WEIGHT1_LENGTH = 0x091,
1020 CMD1_NPU_SET_SCALE1_BASE = 0x092,
1021 CMD1_NPU_SET_SCALE1_LENGTH = 0x093,
1022};
1023
1024enum data_format
1025{
1026 DATA_FORMAT_NHWC = 0,
1027 DATA_FORMAT_NHCWB16 = 1,
1028};
1029
1030enum elementwise_mode
1031{
1032 ELEMENTWISE_MODE_MUL = 0,
1033 ELEMENTWISE_MODE_ADD = 1,
1034 ELEMENTWISE_MODE_SUB = 2,
1035 ELEMENTWISE_MODE_MIN = 3,
1036 ELEMENTWISE_MODE_MAX = 4,
1037 ELEMENTWISE_MODE_LRELU = 5,
1038 ELEMENTWISE_MODE_ABS = 6,
1039 ELEMENTWISE_MODE_CLZ = 7,
1040 ELEMENTWISE_MODE_SHR = 8,
1041 ELEMENTWISE_MODE_SHL = 9,
1042};
1043
1044enum ifm_precision
1045{
1046 IFM_PRECISION_W8_U8 = 0,
1047 IFM_PRECISION_W8_S8 = 1,
1048 IFM_PRECISION_W8_U16 = 4,
1049 IFM_PRECISION_W8_S16 = 5,
1050 IFM_PRECISION_W8_S32 = 9,
1051};
1052
1053enum ifm_scale_mode
1054{
1055 IFM_SCALE_MODE_SCALE_16BIT = 0,
1056 IFM_SCALE_MODE_SCALE_OPA_32BIT = 1,
1057 IFM_SCALE_MODE_SCALE_OPB_32BIT = 2,
1058};
1059
Diqing Zhong04118062020-04-15 01:19:12 +02001060enum macs_per_cc
1061{
1062 MACS_PER_CC_MACS_PER_CC_IS_5 = 0x5,
1063 MACS_PER_CC_MACS_PER_CC_IS_6 = 0x6,
1064 MACS_PER_CC_MACS_PER_CC_IS_7 = 0x7,
1065 MACS_PER_CC_MACS_PER_CC_IS_8 = 0x8,
1066};
1067
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001068enum memory_type
1069{
1070 MEMORY_TYPE_AXI0_OUTSTANDING_COUNTER0 = 0,
1071 MEMORY_TYPE_AXI0_OUTSTANDING_COUNTER1 = 1,
1072 MEMORY_TYPE_AXI1_OUTSTANDING_COUNTER2 = 2,
1073 MEMORY_TYPE_AXI1_OUTSTANDING_COUNTER3 = 3,
1074};
1075
1076enum ofm_precision
1077{
1078 OFM_PRECISION_U8 = 0,
1079 OFM_PRECISION_S8 = 1,
1080 OFM_PRECISION_U16 = 2,
1081 OFM_PRECISION_S16 = 3,
1082 OFM_PRECISION_S32 = 5,
1083};
1084
1085enum pmu_event_type
1086{
Diqing Zhong04118062020-04-15 01:19:12 +02001087 PMU_EVENT_TYPE_NO_EVENT = 0x00,
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001088 PMU_EVENT_TYPE_CYCLE = 0x11,
1089 PMU_EVENT_TYPE_NPU_IDLE = 0x20,
1090 PMU_EVENT_TYPE_MAC_ACTIVE = 0x30,
1091 PMU_EVENT_TYPE_MAC_ACTIVE_8BIT = 0x31,
1092 PMU_EVENT_TYPE_MAC_ACTIVE_16BIT = 0x32,
1093 PMU_EVENT_TYPE_MAC_DPU_ACTIVE = 0x33,
1094 PMU_EVENT_TYPE_MAC_STALLED_BY_WD_ACC = 0x34,
1095 PMU_EVENT_TYPE_MAC_STALLED_BY_WD = 0x35,
1096 PMU_EVENT_TYPE_MAC_STALLED_BY_ACC = 0x36,
1097 PMU_EVENT_TYPE_MAC_STALLED_BY_IB = 0x37,
Diqing Zhong04118062020-04-15 01:19:12 +02001098 PMU_EVENT_TYPE_MAC_ACTIVE_32BIT = 0x38,
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001099 PMU_EVENT_TYPE_AO_ACTIVE = 0x40,
1100 PMU_EVENT_TYPE_AO_ACTIVE_8BIT = 0x41,
1101 PMU_EVENT_TYPE_AO_ACTIVE_16BIT = 0x42,
1102 PMU_EVENT_TYPE_AO_STALLED_BY_OFMP_OB = 0x43,
1103 PMU_EVENT_TYPE_AO_STALLED_BY_OFMP = 0x44,
1104 PMU_EVENT_TYPE_AO_STALLED_BY_OB = 0x45,
1105 PMU_EVENT_TYPE_AO_STALLED_BY_ACC_IB = 0x46,
1106 PMU_EVENT_TYPE_AO_STALLED_BY_ACC = 0x47,
1107 PMU_EVENT_TYPE_AO_STALLED_BY_IB = 0x48,
1108 PMU_EVENT_TYPE_WD_ACTIVE = 0x50,
1109 PMU_EVENT_TYPE_WD_STALLED = 0x51,
1110 PMU_EVENT_TYPE_WD_STALLED_BY_WS = 0x52,
1111 PMU_EVENT_TYPE_WD_STALLED_BY_WD_BUF = 0x53,
1112 PMU_EVENT_TYPE_WD_PARSE_ACTIVE = 0x54,
1113 PMU_EVENT_TYPE_WD_PARSE_STALLED = 0x55,
1114 PMU_EVENT_TYPE_WD_PARSE_STALLED_IN = 0x56,
1115 PMU_EVENT_TYPE_WD_PARSE_STALLED_OUT = 0x57,
Diqing Zhong04118062020-04-15 01:19:12 +02001116 PMU_EVENT_TYPE_WD_TRANS_WS = 0x58,
1117 PMU_EVENT_TYPE_WD_TRANS_WB = 0x59,
1118 PMU_EVENT_TYPE_WD_TRANS_DW0 = 0x5a,
1119 PMU_EVENT_TYPE_WD_TRANS_DW1 = 0x5b,
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001120 PMU_EVENT_TYPE_AXI0_RD_TRANS_ACCEPTED = 0x80,
1121 PMU_EVENT_TYPE_AXI0_RD_TRANS_COMPLETED = 0x81,
1122 PMU_EVENT_TYPE_AXI0_RD_DATA_BEAT_RECEIVED = 0x82,
1123 PMU_EVENT_TYPE_AXI0_RD_TRAN_REQ_STALLED = 0x83,
1124 PMU_EVENT_TYPE_AXI0_WR_TRANS_ACCEPTED = 0x84,
1125 PMU_EVENT_TYPE_AXI0_WR_TRANS_COMPLETED_M = 0x85,
1126 PMU_EVENT_TYPE_AXI0_WR_TRANS_COMPLETED_S = 0x86,
1127 PMU_EVENT_TYPE_AXI0_WR_DATA_BEAT_WRITTEN = 0x87,
1128 PMU_EVENT_TYPE_AXI0_WR_TRAN_REQ_STALLED = 0x88,
1129 PMU_EVENT_TYPE_AXI0_WR_DATA_BEAT_STALLED = 0x89,
1130 PMU_EVENT_TYPE_AXI0_ENABLED_CYCLES = 0x8c,
1131 PMU_EVENT_TYPE_AXI0_RD_STALL_LIMIT = 0x8e,
1132 PMU_EVENT_TYPE_AXI0_WR_STALL_LIMIT = 0x8f,
1133 PMU_EVENT_TYPE_AXI1_RD_TRANS_ACCEPTED = 0x180,
1134 PMU_EVENT_TYPE_AXI1_RD_TRANS_COMPLETED = 0x181,
1135 PMU_EVENT_TYPE_AXI1_RD_DATA_BEAT_RECEIVED = 0x182,
1136 PMU_EVENT_TYPE_AXI1_RD_TRAN_REQ_STALLED = 0x183,
1137 PMU_EVENT_TYPE_AXI1_WR_TRANS_ACCEPTED = 0x184,
1138 PMU_EVENT_TYPE_AXI1_WR_TRANS_COMPLETED_M = 0x185,
1139 PMU_EVENT_TYPE_AXI1_WR_TRANS_COMPLETED_S = 0x186,
1140 PMU_EVENT_TYPE_AXI1_WR_DATA_BEAT_WRITTEN = 0x187,
1141 PMU_EVENT_TYPE_AXI1_WR_TRAN_REQ_STALLED = 0x188,
1142 PMU_EVENT_TYPE_AXI1_WR_DATA_BEAT_STALLED = 0x189,
1143 PMU_EVENT_TYPE_AXI1_ENABLED_CYCLES = 0x18c,
1144 PMU_EVENT_TYPE_AXI1_RD_STALL_LIMIT = 0x18e,
1145 PMU_EVENT_TYPE_AXI1_WR_STALL_LIMIT = 0x18f,
1146 PMU_EVENT_TYPE_AXI_LATENCY_ANY = 0xa0,
1147 PMU_EVENT_TYPE_AXI_LATENCY_32 = 0xa1,
1148 PMU_EVENT_TYPE_AXI_LATENCY_64 = 0xa2,
1149 PMU_EVENT_TYPE_AXI_LATENCY_128 = 0xa3,
1150 PMU_EVENT_TYPE_AXI_LATENCY_256 = 0xa4,
1151 PMU_EVENT_TYPE_AXI_LATENCY_512 = 0xa5,
1152 PMU_EVENT_TYPE_AXI_LATENCY_1024 = 0xa6,
1153};
1154
1155enum pooling_mode
1156{
1157 POOLING_MODE_MAX = 0,
1158 POOLING_MODE_AVERAGE = 1,
1159 POOLING_MODE_REDUCE_SUM = 2,
1160};
1161
1162enum privilege_level
1163{
1164 PRIVILEGE_LEVEL_USER = 0,
1165 PRIVILEGE_LEVEL_PRIVILEGED = 1,
1166};
1167
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001168enum resampling_mode
1169{
1170 RESAMPLING_MODE_NONE = 0,
1171 RESAMPLING_MODE_NEAREST = 1,
1172 RESAMPLING_MODE_TRANSPOSE = 2,
1173};
1174
1175enum rounding
1176{
1177 ROUNDING_TFL = 0,
1178 ROUNDING_TRUNCATE = 1,
1179 ROUNDING_NATURAL = 2,
1180};
1181
1182enum security_level
1183{
1184 SECURITY_LEVEL_SECURE = 0,
1185 SECURITY_LEVEL_NON_SECURE = 1,
1186};
1187
Diqing Zhong04118062020-04-15 01:19:12 +02001188enum shram_size
1189{
1190 SHRAM_SIZE_SHRAM_48KB = 0x30,
1191 SHRAM_SIZE_SHRAM_24KB = 0x18,
1192 SHRAM_SIZE_SHRAM_16KB = 0x10,
1193};
1194
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001195enum state
1196{
1197 STATE_STOPPED = 0,
1198 STATE_RUNNING = 1,
1199};
1200
1201enum stride_mode
1202{
1203 STRIDE_MODE_STRIDE_MODE_1D = 0,
1204 STRIDE_MODE_STRIDE_MODE_2D = 1,
1205 STRIDE_MODE_STRIDE_MODE_3D = 2,
1206};
1207
1208#endif
1209
1210// clkforce_r - Force clocks on for clock gating
1211struct clkforce_r
1212{
1213#ifdef __cplusplus
1214 private:
1215#endif //__cplusplus
1216#ifdef MODEL_REGS
1217 ::core::dt::uint_t<1> top_level_clk; // set to 1 to force on TOP level clock
1218 ::core::dt::uint_t<1> cc_clk; // set to 1 to force on CC clock
1219 ::core::dt::uint_t<1> dma_clk; // set to 1 to force on DMA clock
1220 ::core::dt::uint_t<1> mac_clk; // set to 1 to force on MAC clock
1221 ::core::dt::uint_t<1> ao_clk; // set to 1 to force on AO clock
1222 ::core::dt::uint_t<1> wd_clk; // set to 1 to force on WD clock
1223#else
1224 union
1225 {
1226 struct
1227 {
1228 uint32_t top_level_clk : 1; // set to 1 to force on TOP level clock
1229 uint32_t cc_clk : 1; // set to 1 to force on CC clock
1230 uint32_t dma_clk : 1; // set to 1 to force on DMA clock
1231 uint32_t mac_clk : 1; // set to 1 to force on MAC clock
1232 uint32_t ao_clk : 1; // set to 1 to force on AO clock
1233 uint32_t wd_clk : 1; // set to 1 to force on WD clock
1234 uint32_t reserved0 : 26;
1235 };
1236 uint32_t word;
1237 };
1238#endif
1239#ifdef __cplusplus
1240 public:
1241#ifdef MODEL_REGS
1242 CONSTEXPR clkforce_r() :
1243 top_level_clk(static_cast<uint32_t>(0)), cc_clk(static_cast<uint32_t>(0)), dma_clk(static_cast<uint32_t>(0)),
1244 mac_clk(static_cast<uint32_t>(0)), ao_clk(static_cast<uint32_t>(0)), wd_clk(static_cast<uint32_t>(0))
1245 {
1246 }
1247 CONSTEXPR clkforce_r(uint32_t value) :
1248 top_level_clk(value >> 0), cc_clk(value >> 1), dma_clk(value >> 2), mac_clk(value >> 3), ao_clk(value >> 4),
1249 wd_clk(value >> 5)
1250 {
1251 }
1252 CONSTEXPR void operator=(uint32_t value)
1253 {
1254 top_level_clk = value >> 0;
1255 cc_clk = value >> 1;
1256 dma_clk = value >> 2;
1257 mac_clk = value >> 3;
1258 ao_clk = value >> 4;
1259 wd_clk = value >> 5;
1260 }
1261 CONSTEXPR operator uint32_t() const
1262 {
1263 return (top_level_clk << 0) | (cc_clk << 1) | (dma_clk << 2) | (mac_clk << 3) | (ao_clk << 4) | (wd_clk << 5);
1264 }
1265 clkforce_r copy()
1266 {
1267 return *this;
1268 }
1269#else
1270 CONSTEXPR clkforce_r() :
1271 top_level_clk(static_cast<uint32_t>(0)), cc_clk(static_cast<uint32_t>(0)), dma_clk(static_cast<uint32_t>(0)),
1272 mac_clk(static_cast<uint32_t>(0)), ao_clk(static_cast<uint32_t>(0)), wd_clk(static_cast<uint32_t>(0)),
1273 reserved0(static_cast<uint32_t>(0))
1274 {
1275 }
1276 CONSTEXPR clkforce_r(uint32_t init) : word(init) {}
1277 CONSTEXPR void operator=(uint32_t value)
1278 {
1279 word = value;
1280 }
1281 void operator=(uint32_t value) volatile
1282 {
1283 word = value;
1284 }
1285 CONSTEXPR operator uint32_t()
1286 {
1287 return word;
1288 }
1289 operator uint32_t() volatile
1290 {
1291 return word;
1292 }
1293 clkforce_r copy() volatile
1294 {
1295 return *this;
1296 }
1297#endif
1298 CONSTEXPR uint32_t get_top_level_clk() const
1299 {
1300 uint32_t value = static_cast<uint32_t>(top_level_clk);
1301 return value;
1302 }
1303#ifndef MODEL_REGS
1304 uint32_t get_top_level_clk() const volatile
1305 {
1306 uint32_t value = static_cast<uint32_t>(top_level_clk);
1307 return value;
1308 }
1309#endif
1310 CONSTEXPR clkforce_r &set_top_level_clk(uint32_t value)
1311 {
1312 top_level_clk = ((1u << 1) - 1) & static_cast<uint32_t>(value);
1313 return *this;
1314 }
1315 CONSTEXPR uint32_t get_cc_clk() const
1316 {
1317 uint32_t value = static_cast<uint32_t>(cc_clk);
1318 return value;
1319 }
1320#ifndef MODEL_REGS
1321 uint32_t get_cc_clk() const volatile
1322 {
1323 uint32_t value = static_cast<uint32_t>(cc_clk);
1324 return value;
1325 }
1326#endif
1327 CONSTEXPR clkforce_r &set_cc_clk(uint32_t value)
1328 {
1329 cc_clk = ((1u << 1) - 1) & static_cast<uint32_t>(value);
1330 return *this;
1331 }
1332 CONSTEXPR uint32_t get_dma_clk() const
1333 {
1334 uint32_t value = static_cast<uint32_t>(dma_clk);
1335 return value;
1336 }
1337#ifndef MODEL_REGS
1338 uint32_t get_dma_clk() const volatile
1339 {
1340 uint32_t value = static_cast<uint32_t>(dma_clk);
1341 return value;
1342 }
1343#endif
1344 CONSTEXPR clkforce_r &set_dma_clk(uint32_t value)
1345 {
1346 dma_clk = ((1u << 1) - 1) & static_cast<uint32_t>(value);
1347 return *this;
1348 }
1349 CONSTEXPR uint32_t get_mac_clk() const
1350 {
1351 uint32_t value = static_cast<uint32_t>(mac_clk);
1352 return value;
1353 }
1354#ifndef MODEL_REGS
1355 uint32_t get_mac_clk() const volatile
1356 {
1357 uint32_t value = static_cast<uint32_t>(mac_clk);
1358 return value;
1359 }
1360#endif
1361 CONSTEXPR clkforce_r &set_mac_clk(uint32_t value)
1362 {
1363 mac_clk = ((1u << 1) - 1) & static_cast<uint32_t>(value);
1364 return *this;
1365 }
1366 CONSTEXPR uint32_t get_ao_clk() const
1367 {
1368 uint32_t value = static_cast<uint32_t>(ao_clk);
1369 return value;
1370 }
1371#ifndef MODEL_REGS
1372 uint32_t get_ao_clk() const volatile
1373 {
1374 uint32_t value = static_cast<uint32_t>(ao_clk);
1375 return value;
1376 }
1377#endif
1378 CONSTEXPR clkforce_r &set_ao_clk(uint32_t value)
1379 {
1380 ao_clk = ((1u << 1) - 1) & static_cast<uint32_t>(value);
1381 return *this;
1382 }
1383 CONSTEXPR uint32_t get_wd_clk() const
1384 {
1385 uint32_t value = static_cast<uint32_t>(wd_clk);
1386 return value;
1387 }
1388#ifndef MODEL_REGS
1389 uint32_t get_wd_clk() const volatile
1390 {
1391 uint32_t value = static_cast<uint32_t>(wd_clk);
1392 return value;
1393 }
1394#endif
1395 CONSTEXPR clkforce_r &set_wd_clk(uint32_t value)
1396 {
1397 wd_clk = ((1u << 1) - 1) & static_cast<uint32_t>(value);
1398 return *this;
1399 }
1400#endif //__cplusplus
1401};
1402
1403// basep0_r - Lower 32 bits of the Base pointer for region index 0
1404struct basep0_r
1405{
1406#ifdef __cplusplus
1407 private:
1408#endif //__cplusplus
1409#ifdef MODEL_REGS
1410 ::core::dt::uint_t<32> addr_word; // The low word of the 64-bit address
1411#else
1412 union
1413 {
1414 uint32_t addr_word; // The low word of the 64-bit address
1415 uint32_t word;
1416 };
1417#endif
1418#ifdef __cplusplus
1419 public:
1420#ifdef MODEL_REGS
1421 CONSTEXPR basep0_r() : addr_word(static_cast<uint32_t>(0)) {}
1422 CONSTEXPR basep0_r(uint32_t value) : addr_word(value >> 0) {}
1423 CONSTEXPR void operator=(uint32_t value)
1424 {
1425 addr_word = value >> 0;
1426 }
1427 CONSTEXPR operator uint32_t() const
1428 {
1429 return (addr_word << 0);
1430 }
1431 basep0_r copy()
1432 {
1433 return *this;
1434 }
1435#else
1436 CONSTEXPR basep0_r() : addr_word(static_cast<uint32_t>(0)) {}
1437 CONSTEXPR basep0_r(uint32_t init) : word(init) {}
1438 CONSTEXPR void operator=(uint32_t value)
1439 {
1440 word = value;
1441 }
1442 void operator=(uint32_t value) volatile
1443 {
1444 word = value;
1445 }
1446 CONSTEXPR operator uint32_t()
1447 {
1448 return word;
1449 }
1450 operator uint32_t() volatile
1451 {
1452 return word;
1453 }
1454 basep0_r copy() volatile
1455 {
1456 return *this;
1457 }
1458#endif
1459 CONSTEXPR uint32_t get_addr_word() const
1460 {
1461 uint32_t value = static_cast<uint32_t>(addr_word);
1462 return value;
1463 }
1464#ifndef MODEL_REGS
1465 uint32_t get_addr_word() const volatile
1466 {
1467 uint32_t value = static_cast<uint32_t>(addr_word);
1468 return value;
1469 }
1470#endif
1471 CONSTEXPR basep0_r &set_addr_word(uint32_t value)
1472 {
1473 addr_word = static_cast<uint32_t>(value);
1474 return *this;
1475 }
1476#endif //__cplusplus
1477};
1478
1479// basep1_r - Upper 32 bits of the Base pointer for region index 0
1480struct basep1_r
1481{
1482#ifdef __cplusplus
1483 private:
1484#endif //__cplusplus
1485#ifdef MODEL_REGS
1486 ::core::dt::uint_t<32> addr_word; // The high word of the 64-bit address
1487#else
1488 union
1489 {
1490 uint32_t addr_word; // The high word of the 64-bit address
1491 uint32_t word;
1492 };
1493#endif
1494#ifdef __cplusplus
1495 public:
1496#ifdef MODEL_REGS
1497 CONSTEXPR basep1_r() : addr_word(static_cast<uint32_t>(0)) {}
1498 CONSTEXPR basep1_r(uint32_t value) : addr_word(value >> 0) {}
1499 CONSTEXPR void operator=(uint32_t value)
1500 {
1501 addr_word = value >> 0;
1502 }
1503 CONSTEXPR operator uint32_t() const
1504 {
1505 return (addr_word << 0);
1506 }
1507 basep1_r copy()
1508 {
1509 return *this;
1510 }
1511#else
1512 CONSTEXPR basep1_r() : addr_word(static_cast<uint32_t>(0)) {}
1513 CONSTEXPR basep1_r(uint32_t init) : word(init) {}
1514 CONSTEXPR void operator=(uint32_t value)
1515 {
1516 word = value;
1517 }
1518 void operator=(uint32_t value) volatile
1519 {
1520 word = value;
1521 }
1522 CONSTEXPR operator uint32_t()
1523 {
1524 return word;
1525 }
1526 operator uint32_t() volatile
1527 {
1528 return word;
1529 }
1530 basep1_r copy() volatile
1531 {
1532 return *this;
1533 }
1534#endif
1535 CONSTEXPR uint32_t get_addr_word() const
1536 {
1537 uint32_t value = static_cast<uint32_t>(addr_word);
1538 return value;
1539 }
1540#ifndef MODEL_REGS
1541 uint32_t get_addr_word() const volatile
1542 {
1543 uint32_t value = static_cast<uint32_t>(addr_word);
1544 return value;
1545 }
1546#endif
1547 CONSTEXPR basep1_r &set_addr_word(uint32_t value)
1548 {
1549 addr_word = static_cast<uint32_t>(value);
1550 return *this;
1551 }
1552#endif //__cplusplus
1553};
1554
1555// basep2_r - Lower 32 bits of the Base pointer for region index 1
1556struct basep2_r
1557{
1558#ifdef __cplusplus
1559 private:
1560#endif //__cplusplus
1561#ifdef MODEL_REGS
1562 ::core::dt::uint_t<32> addr_word; // The low word of the 64-bit address
1563#else
1564 union
1565 {
1566 uint32_t addr_word; // The low word of the 64-bit address
1567 uint32_t word;
1568 };
1569#endif
1570#ifdef __cplusplus
1571 public:
1572#ifdef MODEL_REGS
1573 CONSTEXPR basep2_r() : addr_word(static_cast<uint32_t>(0)) {}
1574 CONSTEXPR basep2_r(uint32_t value) : addr_word(value >> 0) {}
1575 CONSTEXPR void operator=(uint32_t value)
1576 {
1577 addr_word = value >> 0;
1578 }
1579 CONSTEXPR operator uint32_t() const
1580 {
1581 return (addr_word << 0);
1582 }
1583 basep2_r copy()
1584 {
1585 return *this;
1586 }
1587#else
1588 CONSTEXPR basep2_r() : addr_word(static_cast<uint32_t>(0)) {}
1589 CONSTEXPR basep2_r(uint32_t init) : word(init) {}
1590 CONSTEXPR void operator=(uint32_t value)
1591 {
1592 word = value;
1593 }
1594 void operator=(uint32_t value) volatile
1595 {
1596 word = value;
1597 }
1598 CONSTEXPR operator uint32_t()
1599 {
1600 return word;
1601 }
1602 operator uint32_t() volatile
1603 {
1604 return word;
1605 }
1606 basep2_r copy() volatile
1607 {
1608 return *this;
1609 }
1610#endif
1611 CONSTEXPR uint32_t get_addr_word() const
1612 {
1613 uint32_t value = static_cast<uint32_t>(addr_word);
1614 return value;
1615 }
1616#ifndef MODEL_REGS
1617 uint32_t get_addr_word() const volatile
1618 {
1619 uint32_t value = static_cast<uint32_t>(addr_word);
1620 return value;
1621 }
1622#endif
1623 CONSTEXPR basep2_r &set_addr_word(uint32_t value)
1624 {
1625 addr_word = static_cast<uint32_t>(value);
1626 return *this;
1627 }
1628#endif //__cplusplus
1629};
1630
1631// basep3_r - Upper 32 bits of the Base pointer for region index 1
1632struct basep3_r
1633{
1634#ifdef __cplusplus
1635 private:
1636#endif //__cplusplus
1637#ifdef MODEL_REGS
1638 ::core::dt::uint_t<32> addr_word; // The high word of the 64-bit address
1639#else
1640 union
1641 {
1642 uint32_t addr_word; // The high word of the 64-bit address
1643 uint32_t word;
1644 };
1645#endif
1646#ifdef __cplusplus
1647 public:
1648#ifdef MODEL_REGS
1649 CONSTEXPR basep3_r() : addr_word(static_cast<uint32_t>(0)) {}
1650 CONSTEXPR basep3_r(uint32_t value) : addr_word(value >> 0) {}
1651 CONSTEXPR void operator=(uint32_t value)
1652 {
1653 addr_word = value >> 0;
1654 }
1655 CONSTEXPR operator uint32_t() const
1656 {
1657 return (addr_word << 0);
1658 }
1659 basep3_r copy()
1660 {
1661 return *this;
1662 }
1663#else
1664 CONSTEXPR basep3_r() : addr_word(static_cast<uint32_t>(0)) {}
1665 CONSTEXPR basep3_r(uint32_t init) : word(init) {}
1666 CONSTEXPR void operator=(uint32_t value)
1667 {
1668 word = value;
1669 }
1670 void operator=(uint32_t value) volatile
1671 {
1672 word = value;
1673 }
1674 CONSTEXPR operator uint32_t()
1675 {
1676 return word;
1677 }
1678 operator uint32_t() volatile
1679 {
1680 return word;
1681 }
1682 basep3_r copy() volatile
1683 {
1684 return *this;
1685 }
1686#endif
1687 CONSTEXPR uint32_t get_addr_word() const
1688 {
1689 uint32_t value = static_cast<uint32_t>(addr_word);
1690 return value;
1691 }
1692#ifndef MODEL_REGS
1693 uint32_t get_addr_word() const volatile
1694 {
1695 uint32_t value = static_cast<uint32_t>(addr_word);
1696 return value;
1697 }
1698#endif
1699 CONSTEXPR basep3_r &set_addr_word(uint32_t value)
1700 {
1701 addr_word = static_cast<uint32_t>(value);
1702 return *this;
1703 }
1704#endif //__cplusplus
1705};
1706
1707// basep4_r - Lower 32 bits of the Base pointer for region index 2
1708struct basep4_r
1709{
1710#ifdef __cplusplus
1711 private:
1712#endif //__cplusplus
1713#ifdef MODEL_REGS
1714 ::core::dt::uint_t<32> addr_word; // The low word of the 64-bit address
1715#else
1716 union
1717 {
1718 uint32_t addr_word; // The low word of the 64-bit address
1719 uint32_t word;
1720 };
1721#endif
1722#ifdef __cplusplus
1723 public:
1724#ifdef MODEL_REGS
1725 CONSTEXPR basep4_r() : addr_word(static_cast<uint32_t>(0)) {}
1726 CONSTEXPR basep4_r(uint32_t value) : addr_word(value >> 0) {}
1727 CONSTEXPR void operator=(uint32_t value)
1728 {
1729 addr_word = value >> 0;
1730 }
1731 CONSTEXPR operator uint32_t() const
1732 {
1733 return (addr_word << 0);
1734 }
1735 basep4_r copy()
1736 {
1737 return *this;
1738 }
1739#else
1740 CONSTEXPR basep4_r() : addr_word(static_cast<uint32_t>(0)) {}
1741 CONSTEXPR basep4_r(uint32_t init) : word(init) {}
1742 CONSTEXPR void operator=(uint32_t value)
1743 {
1744 word = value;
1745 }
1746 void operator=(uint32_t value) volatile
1747 {
1748 word = value;
1749 }
1750 CONSTEXPR operator uint32_t()
1751 {
1752 return word;
1753 }
1754 operator uint32_t() volatile
1755 {
1756 return word;
1757 }
1758 basep4_r copy() volatile
1759 {
1760 return *this;
1761 }
1762#endif
1763 CONSTEXPR uint32_t get_addr_word() const
1764 {
1765 uint32_t value = static_cast<uint32_t>(addr_word);
1766 return value;
1767 }
1768#ifndef MODEL_REGS
1769 uint32_t get_addr_word() const volatile
1770 {
1771 uint32_t value = static_cast<uint32_t>(addr_word);
1772 return value;
1773 }
1774#endif
1775 CONSTEXPR basep4_r &set_addr_word(uint32_t value)
1776 {
1777 addr_word = static_cast<uint32_t>(value);
1778 return *this;
1779 }
1780#endif //__cplusplus
1781};
1782
1783// basep5_r - Upper 32 bits of the Base pointer for region index 2
1784struct basep5_r
1785{
1786#ifdef __cplusplus
1787 private:
1788#endif //__cplusplus
1789#ifdef MODEL_REGS
1790 ::core::dt::uint_t<32> addr_word; // The high word of the 64-bit address
1791#else
1792 union
1793 {
1794 uint32_t addr_word; // The high word of the 64-bit address
1795 uint32_t word;
1796 };
1797#endif
1798#ifdef __cplusplus
1799 public:
1800#ifdef MODEL_REGS
1801 CONSTEXPR basep5_r() : addr_word(static_cast<uint32_t>(0)) {}
1802 CONSTEXPR basep5_r(uint32_t value) : addr_word(value >> 0) {}
1803 CONSTEXPR void operator=(uint32_t value)
1804 {
1805 addr_word = value >> 0;
1806 }
1807 CONSTEXPR operator uint32_t() const
1808 {
1809 return (addr_word << 0);
1810 }
1811 basep5_r copy()
1812 {
1813 return *this;
1814 }
1815#else
1816 CONSTEXPR basep5_r() : addr_word(static_cast<uint32_t>(0)) {}
1817 CONSTEXPR basep5_r(uint32_t init) : word(init) {}
1818 CONSTEXPR void operator=(uint32_t value)
1819 {
1820 word = value;
1821 }
1822 void operator=(uint32_t value) volatile
1823 {
1824 word = value;
1825 }
1826 CONSTEXPR operator uint32_t()
1827 {
1828 return word;
1829 }
1830 operator uint32_t() volatile
1831 {
1832 return word;
1833 }
1834 basep5_r copy() volatile
1835 {
1836 return *this;
1837 }
1838#endif
1839 CONSTEXPR uint32_t get_addr_word() const
1840 {
1841 uint32_t value = static_cast<uint32_t>(addr_word);
1842 return value;
1843 }
1844#ifndef MODEL_REGS
1845 uint32_t get_addr_word() const volatile
1846 {
1847 uint32_t value = static_cast<uint32_t>(addr_word);
1848 return value;
1849 }
1850#endif
1851 CONSTEXPR basep5_r &set_addr_word(uint32_t value)
1852 {
1853 addr_word = static_cast<uint32_t>(value);
1854 return *this;
1855 }
1856#endif //__cplusplus
1857};
1858
1859// basep6_r - Lower 32 bits of the Base pointer for region index 3
1860struct basep6_r
1861{
1862#ifdef __cplusplus
1863 private:
1864#endif //__cplusplus
1865#ifdef MODEL_REGS
1866 ::core::dt::uint_t<32> addr_word; // The low word of the 64-bit address
1867#else
1868 union
1869 {
1870 uint32_t addr_word; // The low word of the 64-bit address
1871 uint32_t word;
1872 };
1873#endif
1874#ifdef __cplusplus
1875 public:
1876#ifdef MODEL_REGS
1877 CONSTEXPR basep6_r() : addr_word(static_cast<uint32_t>(0)) {}
1878 CONSTEXPR basep6_r(uint32_t value) : addr_word(value >> 0) {}
1879 CONSTEXPR void operator=(uint32_t value)
1880 {
1881 addr_word = value >> 0;
1882 }
1883 CONSTEXPR operator uint32_t() const
1884 {
1885 return (addr_word << 0);
1886 }
1887 basep6_r copy()
1888 {
1889 return *this;
1890 }
1891#else
1892 CONSTEXPR basep6_r() : addr_word(static_cast<uint32_t>(0)) {}
1893 CONSTEXPR basep6_r(uint32_t init) : word(init) {}
1894 CONSTEXPR void operator=(uint32_t value)
1895 {
1896 word = value;
1897 }
1898 void operator=(uint32_t value) volatile
1899 {
1900 word = value;
1901 }
1902 CONSTEXPR operator uint32_t()
1903 {
1904 return word;
1905 }
1906 operator uint32_t() volatile
1907 {
1908 return word;
1909 }
1910 basep6_r copy() volatile
1911 {
1912 return *this;
1913 }
1914#endif
1915 CONSTEXPR uint32_t get_addr_word() const
1916 {
1917 uint32_t value = static_cast<uint32_t>(addr_word);
1918 return value;
1919 }
1920#ifndef MODEL_REGS
1921 uint32_t get_addr_word() const volatile
1922 {
1923 uint32_t value = static_cast<uint32_t>(addr_word);
1924 return value;
1925 }
1926#endif
1927 CONSTEXPR basep6_r &set_addr_word(uint32_t value)
1928 {
1929 addr_word = static_cast<uint32_t>(value);
1930 return *this;
1931 }
1932#endif //__cplusplus
1933};
1934
1935// basep7_r - Upper 32 bits of the Base pointer for region index 3
1936struct basep7_r
1937{
1938#ifdef __cplusplus
1939 private:
1940#endif //__cplusplus
1941#ifdef MODEL_REGS
1942 ::core::dt::uint_t<32> addr_word; // The high word of the 64-bit address
1943#else
1944 union
1945 {
1946 uint32_t addr_word; // The high word of the 64-bit address
1947 uint32_t word;
1948 };
1949#endif
1950#ifdef __cplusplus
1951 public:
1952#ifdef MODEL_REGS
1953 CONSTEXPR basep7_r() : addr_word(static_cast<uint32_t>(0)) {}
1954 CONSTEXPR basep7_r(uint32_t value) : addr_word(value >> 0) {}
1955 CONSTEXPR void operator=(uint32_t value)
1956 {
1957 addr_word = value >> 0;
1958 }
1959 CONSTEXPR operator uint32_t() const
1960 {
1961 return (addr_word << 0);
1962 }
1963 basep7_r copy()
1964 {
1965 return *this;
1966 }
1967#else
1968 CONSTEXPR basep7_r() : addr_word(static_cast<uint32_t>(0)) {}
1969 CONSTEXPR basep7_r(uint32_t init) : word(init) {}
1970 CONSTEXPR void operator=(uint32_t value)
1971 {
1972 word = value;
1973 }
1974 void operator=(uint32_t value) volatile
1975 {
1976 word = value;
1977 }
1978 CONSTEXPR operator uint32_t()
1979 {
1980 return word;
1981 }
1982 operator uint32_t() volatile
1983 {
1984 return word;
1985 }
1986 basep7_r copy() volatile
1987 {
1988 return *this;
1989 }
1990#endif
1991 CONSTEXPR uint32_t get_addr_word() const
1992 {
1993 uint32_t value = static_cast<uint32_t>(addr_word);
1994 return value;
1995 }
1996#ifndef MODEL_REGS
1997 uint32_t get_addr_word() const volatile
1998 {
1999 uint32_t value = static_cast<uint32_t>(addr_word);
2000 return value;
2001 }
2002#endif
2003 CONSTEXPR basep7_r &set_addr_word(uint32_t value)
2004 {
2005 addr_word = static_cast<uint32_t>(value);
2006 return *this;
2007 }
2008#endif //__cplusplus
2009};
2010
2011// basep8_r - Lower 32 bits of the Base pointer for region index 4
2012struct basep8_r
2013{
2014#ifdef __cplusplus
2015 private:
2016#endif //__cplusplus
2017#ifdef MODEL_REGS
2018 ::core::dt::uint_t<32> addr_word; // The low word of the 64-bit address
2019#else
2020 union
2021 {
2022 uint32_t addr_word; // The low word of the 64-bit address
2023 uint32_t word;
2024 };
2025#endif
2026#ifdef __cplusplus
2027 public:
2028#ifdef MODEL_REGS
2029 CONSTEXPR basep8_r() : addr_word(static_cast<uint32_t>(0)) {}
2030 CONSTEXPR basep8_r(uint32_t value) : addr_word(value >> 0) {}
2031 CONSTEXPR void operator=(uint32_t value)
2032 {
2033 addr_word = value >> 0;
2034 }
2035 CONSTEXPR operator uint32_t() const
2036 {
2037 return (addr_word << 0);
2038 }
2039 basep8_r copy()
2040 {
2041 return *this;
2042 }
2043#else
2044 CONSTEXPR basep8_r() : addr_word(static_cast<uint32_t>(0)) {}
2045 CONSTEXPR basep8_r(uint32_t init) : word(init) {}
2046 CONSTEXPR void operator=(uint32_t value)
2047 {
2048 word = value;
2049 }
2050 void operator=(uint32_t value) volatile
2051 {
2052 word = value;
2053 }
2054 CONSTEXPR operator uint32_t()
2055 {
2056 return word;
2057 }
2058 operator uint32_t() volatile
2059 {
2060 return word;
2061 }
2062 basep8_r copy() volatile
2063 {
2064 return *this;
2065 }
2066#endif
2067 CONSTEXPR uint32_t get_addr_word() const
2068 {
2069 uint32_t value = static_cast<uint32_t>(addr_word);
2070 return value;
2071 }
2072#ifndef MODEL_REGS
2073 uint32_t get_addr_word() const volatile
2074 {
2075 uint32_t value = static_cast<uint32_t>(addr_word);
2076 return value;
2077 }
2078#endif
2079 CONSTEXPR basep8_r &set_addr_word(uint32_t value)
2080 {
2081 addr_word = static_cast<uint32_t>(value);
2082 return *this;
2083 }
2084#endif //__cplusplus
2085};
2086
2087// basep9_r - Upper 32 bits of the Base pointer for region index 4
2088struct basep9_r
2089{
2090#ifdef __cplusplus
2091 private:
2092#endif //__cplusplus
2093#ifdef MODEL_REGS
2094 ::core::dt::uint_t<32> addr_word; // The high word of the 64-bit address
2095#else
2096 union
2097 {
2098 uint32_t addr_word; // The high word of the 64-bit address
2099 uint32_t word;
2100 };
2101#endif
2102#ifdef __cplusplus
2103 public:
2104#ifdef MODEL_REGS
2105 CONSTEXPR basep9_r() : addr_word(static_cast<uint32_t>(0)) {}
2106 CONSTEXPR basep9_r(uint32_t value) : addr_word(value >> 0) {}
2107 CONSTEXPR void operator=(uint32_t value)
2108 {
2109 addr_word = value >> 0;
2110 }
2111 CONSTEXPR operator uint32_t() const
2112 {
2113 return (addr_word << 0);
2114 }
2115 basep9_r copy()
2116 {
2117 return *this;
2118 }
2119#else
2120 CONSTEXPR basep9_r() : addr_word(static_cast<uint32_t>(0)) {}
2121 CONSTEXPR basep9_r(uint32_t init) : word(init) {}
2122 CONSTEXPR void operator=(uint32_t value)
2123 {
2124 word = value;
2125 }
2126 void operator=(uint32_t value) volatile
2127 {
2128 word = value;
2129 }
2130 CONSTEXPR operator uint32_t()
2131 {
2132 return word;
2133 }
2134 operator uint32_t() volatile
2135 {
2136 return word;
2137 }
2138 basep9_r copy() volatile
2139 {
2140 return *this;
2141 }
2142#endif
2143 CONSTEXPR uint32_t get_addr_word() const
2144 {
2145 uint32_t value = static_cast<uint32_t>(addr_word);
2146 return value;
2147 }
2148#ifndef MODEL_REGS
2149 uint32_t get_addr_word() const volatile
2150 {
2151 uint32_t value = static_cast<uint32_t>(addr_word);
2152 return value;
2153 }
2154#endif
2155 CONSTEXPR basep9_r &set_addr_word(uint32_t value)
2156 {
2157 addr_word = static_cast<uint32_t>(value);
2158 return *this;
2159 }
2160#endif //__cplusplus
2161};
2162
2163// basep10_r - Lower 32 bits of the Base pointer for region index 5
2164struct basep10_r
2165{
2166#ifdef __cplusplus
2167 private:
2168#endif //__cplusplus
2169#ifdef MODEL_REGS
2170 ::core::dt::uint_t<32> addr_word; // The low word of the 64-bit address
2171#else
2172 union
2173 {
2174 uint32_t addr_word; // The low word of the 64-bit address
2175 uint32_t word;
2176 };
2177#endif
2178#ifdef __cplusplus
2179 public:
2180#ifdef MODEL_REGS
2181 CONSTEXPR basep10_r() : addr_word(static_cast<uint32_t>(0)) {}
2182 CONSTEXPR basep10_r(uint32_t value) : addr_word(value >> 0) {}
2183 CONSTEXPR void operator=(uint32_t value)
2184 {
2185 addr_word = value >> 0;
2186 }
2187 CONSTEXPR operator uint32_t() const
2188 {
2189 return (addr_word << 0);
2190 }
2191 basep10_r copy()
2192 {
2193 return *this;
2194 }
2195#else
2196 CONSTEXPR basep10_r() : addr_word(static_cast<uint32_t>(0)) {}
2197 CONSTEXPR basep10_r(uint32_t init) : word(init) {}
2198 CONSTEXPR void operator=(uint32_t value)
2199 {
2200 word = value;
2201 }
2202 void operator=(uint32_t value) volatile
2203 {
2204 word = value;
2205 }
2206 CONSTEXPR operator uint32_t()
2207 {
2208 return word;
2209 }
2210 operator uint32_t() volatile
2211 {
2212 return word;
2213 }
2214 basep10_r copy() volatile
2215 {
2216 return *this;
2217 }
2218#endif
2219 CONSTEXPR uint32_t get_addr_word() const
2220 {
2221 uint32_t value = static_cast<uint32_t>(addr_word);
2222 return value;
2223 }
2224#ifndef MODEL_REGS
2225 uint32_t get_addr_word() const volatile
2226 {
2227 uint32_t value = static_cast<uint32_t>(addr_word);
2228 return value;
2229 }
2230#endif
2231 CONSTEXPR basep10_r &set_addr_word(uint32_t value)
2232 {
2233 addr_word = static_cast<uint32_t>(value);
2234 return *this;
2235 }
2236#endif //__cplusplus
2237};
2238
2239// basep11_r - Upper 32 bits of the Base pointer for region index 5
2240struct basep11_r
2241{
2242#ifdef __cplusplus
2243 private:
2244#endif //__cplusplus
2245#ifdef MODEL_REGS
2246 ::core::dt::uint_t<32> addr_word; // The high word of the 64-bit address
2247#else
2248 union
2249 {
2250 uint32_t addr_word; // The high word of the 64-bit address
2251 uint32_t word;
2252 };
2253#endif
2254#ifdef __cplusplus
2255 public:
2256#ifdef MODEL_REGS
2257 CONSTEXPR basep11_r() : addr_word(static_cast<uint32_t>(0)) {}
2258 CONSTEXPR basep11_r(uint32_t value) : addr_word(value >> 0) {}
2259 CONSTEXPR void operator=(uint32_t value)
2260 {
2261 addr_word = value >> 0;
2262 }
2263 CONSTEXPR operator uint32_t() const
2264 {
2265 return (addr_word << 0);
2266 }
2267 basep11_r copy()
2268 {
2269 return *this;
2270 }
2271#else
2272 CONSTEXPR basep11_r() : addr_word(static_cast<uint32_t>(0)) {}
2273 CONSTEXPR basep11_r(uint32_t init) : word(init) {}
2274 CONSTEXPR void operator=(uint32_t value)
2275 {
2276 word = value;
2277 }
2278 void operator=(uint32_t value) volatile
2279 {
2280 word = value;
2281 }
2282 CONSTEXPR operator uint32_t()
2283 {
2284 return word;
2285 }
2286 operator uint32_t() volatile
2287 {
2288 return word;
2289 }
2290 basep11_r copy() volatile
2291 {
2292 return *this;
2293 }
2294#endif
2295 CONSTEXPR uint32_t get_addr_word() const
2296 {
2297 uint32_t value = static_cast<uint32_t>(addr_word);
2298 return value;
2299 }
2300#ifndef MODEL_REGS
2301 uint32_t get_addr_word() const volatile
2302 {
2303 uint32_t value = static_cast<uint32_t>(addr_word);
2304 return value;
2305 }
2306#endif
2307 CONSTEXPR basep11_r &set_addr_word(uint32_t value)
2308 {
2309 addr_word = static_cast<uint32_t>(value);
2310 return *this;
2311 }
2312#endif //__cplusplus
2313};
2314
2315// basep12_r - Lower 32 bits of the Base pointer for region index 6
2316struct basep12_r
2317{
2318#ifdef __cplusplus
2319 private:
2320#endif //__cplusplus
2321#ifdef MODEL_REGS
2322 ::core::dt::uint_t<32> addr_word; // The low word of the 64-bit address
2323#else
2324 union
2325 {
2326 uint32_t addr_word; // The low word of the 64-bit address
2327 uint32_t word;
2328 };
2329#endif
2330#ifdef __cplusplus
2331 public:
2332#ifdef MODEL_REGS
2333 CONSTEXPR basep12_r() : addr_word(static_cast<uint32_t>(0)) {}
2334 CONSTEXPR basep12_r(uint32_t value) : addr_word(value >> 0) {}
2335 CONSTEXPR void operator=(uint32_t value)
2336 {
2337 addr_word = value >> 0;
2338 }
2339 CONSTEXPR operator uint32_t() const
2340 {
2341 return (addr_word << 0);
2342 }
2343 basep12_r copy()
2344 {
2345 return *this;
2346 }
2347#else
2348 CONSTEXPR basep12_r() : addr_word(static_cast<uint32_t>(0)) {}
2349 CONSTEXPR basep12_r(uint32_t init) : word(init) {}
2350 CONSTEXPR void operator=(uint32_t value)
2351 {
2352 word = value;
2353 }
2354 void operator=(uint32_t value) volatile
2355 {
2356 word = value;
2357 }
2358 CONSTEXPR operator uint32_t()
2359 {
2360 return word;
2361 }
2362 operator uint32_t() volatile
2363 {
2364 return word;
2365 }
2366 basep12_r copy() volatile
2367 {
2368 return *this;
2369 }
2370#endif
2371 CONSTEXPR uint32_t get_addr_word() const
2372 {
2373 uint32_t value = static_cast<uint32_t>(addr_word);
2374 return value;
2375 }
2376#ifndef MODEL_REGS
2377 uint32_t get_addr_word() const volatile
2378 {
2379 uint32_t value = static_cast<uint32_t>(addr_word);
2380 return value;
2381 }
2382#endif
2383 CONSTEXPR basep12_r &set_addr_word(uint32_t value)
2384 {
2385 addr_word = static_cast<uint32_t>(value);
2386 return *this;
2387 }
2388#endif //__cplusplus
2389};
2390
2391// basep13_r - Upper 32 bits of the Base pointer for region index 6
2392struct basep13_r
2393{
2394#ifdef __cplusplus
2395 private:
2396#endif //__cplusplus
2397#ifdef MODEL_REGS
2398 ::core::dt::uint_t<32> addr_word; // The high word of the 64-bit address
2399#else
2400 union
2401 {
2402 uint32_t addr_word; // The high word of the 64-bit address
2403 uint32_t word;
2404 };
2405#endif
2406#ifdef __cplusplus
2407 public:
2408#ifdef MODEL_REGS
2409 CONSTEXPR basep13_r() : addr_word(static_cast<uint32_t>(0)) {}
2410 CONSTEXPR basep13_r(uint32_t value) : addr_word(value >> 0) {}
2411 CONSTEXPR void operator=(uint32_t value)
2412 {
2413 addr_word = value >> 0;
2414 }
2415 CONSTEXPR operator uint32_t() const
2416 {
2417 return (addr_word << 0);
2418 }
2419 basep13_r copy()
2420 {
2421 return *this;
2422 }
2423#else
2424 CONSTEXPR basep13_r() : addr_word(static_cast<uint32_t>(0)) {}
2425 CONSTEXPR basep13_r(uint32_t init) : word(init) {}
2426 CONSTEXPR void operator=(uint32_t value)
2427 {
2428 word = value;
2429 }
2430 void operator=(uint32_t value) volatile
2431 {
2432 word = value;
2433 }
2434 CONSTEXPR operator uint32_t()
2435 {
2436 return word;
2437 }
2438 operator uint32_t() volatile
2439 {
2440 return word;
2441 }
2442 basep13_r copy() volatile
2443 {
2444 return *this;
2445 }
2446#endif
2447 CONSTEXPR uint32_t get_addr_word() const
2448 {
2449 uint32_t value = static_cast<uint32_t>(addr_word);
2450 return value;
2451 }
2452#ifndef MODEL_REGS
2453 uint32_t get_addr_word() const volatile
2454 {
2455 uint32_t value = static_cast<uint32_t>(addr_word);
2456 return value;
2457 }
2458#endif
2459 CONSTEXPR basep13_r &set_addr_word(uint32_t value)
2460 {
2461 addr_word = static_cast<uint32_t>(value);
2462 return *this;
2463 }
2464#endif //__cplusplus
2465};
2466
2467// basep14_r - Lower 32 bits of the Base pointer for region index 7
2468struct basep14_r
2469{
2470#ifdef __cplusplus
2471 private:
2472#endif //__cplusplus
2473#ifdef MODEL_REGS
2474 ::core::dt::uint_t<32> addr_word; // The low word of the 64-bit address
2475#else
2476 union
2477 {
2478 uint32_t addr_word; // The low word of the 64-bit address
2479 uint32_t word;
2480 };
2481#endif
2482#ifdef __cplusplus
2483 public:
2484#ifdef MODEL_REGS
2485 CONSTEXPR basep14_r() : addr_word(static_cast<uint32_t>(0)) {}
2486 CONSTEXPR basep14_r(uint32_t value) : addr_word(value >> 0) {}
2487 CONSTEXPR void operator=(uint32_t value)
2488 {
2489 addr_word = value >> 0;
2490 }
2491 CONSTEXPR operator uint32_t() const
2492 {
2493 return (addr_word << 0);
2494 }
2495 basep14_r copy()
2496 {
2497 return *this;
2498 }
2499#else
2500 CONSTEXPR basep14_r() : addr_word(static_cast<uint32_t>(0)) {}
2501 CONSTEXPR basep14_r(uint32_t init) : word(init) {}
2502 CONSTEXPR void operator=(uint32_t value)
2503 {
2504 word = value;
2505 }
2506 void operator=(uint32_t value) volatile
2507 {
2508 word = value;
2509 }
2510 CONSTEXPR operator uint32_t()
2511 {
2512 return word;
2513 }
2514 operator uint32_t() volatile
2515 {
2516 return word;
2517 }
2518 basep14_r copy() volatile
2519 {
2520 return *this;
2521 }
2522#endif
2523 CONSTEXPR uint32_t get_addr_word() const
2524 {
2525 uint32_t value = static_cast<uint32_t>(addr_word);
2526 return value;
2527 }
2528#ifndef MODEL_REGS
2529 uint32_t get_addr_word() const volatile
2530 {
2531 uint32_t value = static_cast<uint32_t>(addr_word);
2532 return value;
2533 }
2534#endif
2535 CONSTEXPR basep14_r &set_addr_word(uint32_t value)
2536 {
2537 addr_word = static_cast<uint32_t>(value);
2538 return *this;
2539 }
2540#endif //__cplusplus
2541};
2542
2543// basep15_r - Upper 32 bits of the Base pointer for region index 7
2544struct basep15_r
2545{
2546#ifdef __cplusplus
2547 private:
2548#endif //__cplusplus
2549#ifdef MODEL_REGS
2550 ::core::dt::uint_t<32> addr_word; // The high word of the 64-bit address
2551#else
2552 union
2553 {
2554 uint32_t addr_word; // The high word of the 64-bit address
2555 uint32_t word;
2556 };
2557#endif
2558#ifdef __cplusplus
2559 public:
2560#ifdef MODEL_REGS
2561 CONSTEXPR basep15_r() : addr_word(static_cast<uint32_t>(0)) {}
2562 CONSTEXPR basep15_r(uint32_t value) : addr_word(value >> 0) {}
2563 CONSTEXPR void operator=(uint32_t value)
2564 {
2565 addr_word = value >> 0;
2566 }
2567 CONSTEXPR operator uint32_t() const
2568 {
2569 return (addr_word << 0);
2570 }
2571 basep15_r copy()
2572 {
2573 return *this;
2574 }
2575#else
2576 CONSTEXPR basep15_r() : addr_word(static_cast<uint32_t>(0)) {}
2577 CONSTEXPR basep15_r(uint32_t init) : word(init) {}
2578 CONSTEXPR void operator=(uint32_t value)
2579 {
2580 word = value;
2581 }
2582 void operator=(uint32_t value) volatile
2583 {
2584 word = value;
2585 }
2586 CONSTEXPR operator uint32_t()
2587 {
2588 return word;
2589 }
2590 operator uint32_t() volatile
2591 {
2592 return word;
2593 }
2594 basep15_r copy() volatile
2595 {
2596 return *this;
2597 }
2598#endif
2599 CONSTEXPR uint32_t get_addr_word() const
2600 {
2601 uint32_t value = static_cast<uint32_t>(addr_word);
2602 return value;
2603 }
2604#ifndef MODEL_REGS
2605 uint32_t get_addr_word() const volatile
2606 {
2607 uint32_t value = static_cast<uint32_t>(addr_word);
2608 return value;
2609 }
2610#endif
2611 CONSTEXPR basep15_r &set_addr_word(uint32_t value)
2612 {
2613 addr_word = static_cast<uint32_t>(value);
2614 return *this;
2615 }
2616#endif //__cplusplus
2617};
2618
2619// pid4_r - Peripheral ID byte 4 (Arm=code 4)
2620struct pid4_r
2621{
2622#ifdef __cplusplus
2623 private:
2624#endif //__cplusplus
2625#ifdef MODEL_REGS
2626 ::core::dt::uint_t<32> PID4; // Byte 4 of Peripheral ID (Lower 8 bits valid)
2627#else
2628 union
2629 {
2630 uint32_t PID4; // Byte 4 of Peripheral ID (Lower 8 bits valid)
2631 uint32_t word;
2632 };
2633#endif
2634#ifdef __cplusplus
2635 public:
2636#ifdef MODEL_REGS
2637 CONSTEXPR pid4_r() : PID4(static_cast<uint32_t>(0x04)) {}
2638 CONSTEXPR pid4_r(uint32_t value) : PID4(value >> 0) {}
2639 CONSTEXPR void operator=(uint32_t value)
2640 {
2641 PID4 = value >> 0;
2642 }
2643 CONSTEXPR operator uint32_t() const
2644 {
2645 return (PID4 << 0);
2646 }
2647 pid4_r copy()
2648 {
2649 return *this;
2650 }
2651#else
2652 CONSTEXPR pid4_r() : PID4(static_cast<uint32_t>(0x04)) {}
2653 CONSTEXPR pid4_r(uint32_t init) : word(init) {}
2654 CONSTEXPR void operator=(uint32_t value)
2655 {
2656 word = value;
2657 }
2658 void operator=(uint32_t value) volatile
2659 {
2660 word = value;
2661 }
2662 CONSTEXPR operator uint32_t()
2663 {
2664 return word;
2665 }
2666 operator uint32_t() volatile
2667 {
2668 return word;
2669 }
2670 pid4_r copy() volatile
2671 {
2672 return *this;
2673 }
2674#endif
2675 CONSTEXPR uint32_t get_PID4() const
2676 {
2677 uint32_t value = static_cast<uint32_t>(PID4);
2678 return value;
2679 }
2680#ifndef MODEL_REGS
2681 uint32_t get_PID4() const volatile
2682 {
2683 uint32_t value = static_cast<uint32_t>(PID4);
2684 return value;
2685 }
2686#endif
2687 CONSTEXPR pid4_r &set_PID4(uint32_t value)
2688 {
2689 PID4 = static_cast<uint32_t>(value);
2690 return *this;
2691 }
2692#endif //__cplusplus
2693};
2694
2695// pid5_r - Peripheral ID byte 5 (reserved)
2696struct pid5_r
2697{
2698#ifdef __cplusplus
2699 private:
2700#endif //__cplusplus
2701#ifdef MODEL_REGS
2702 ::core::dt::uint_t<32> PID5; // Byte 5 of Peripheral ID (Lower 8 bits valid)
2703#else
2704 union
2705 {
2706 uint32_t PID5; // Byte 5 of Peripheral ID (Lower 8 bits valid)
2707 uint32_t word;
2708 };
2709#endif
2710#ifdef __cplusplus
2711 public:
2712#ifdef MODEL_REGS
2713 CONSTEXPR pid5_r() : PID5(static_cast<uint32_t>(0x00)) {}
2714 CONSTEXPR pid5_r(uint32_t value) : PID5(value >> 0) {}
2715 CONSTEXPR void operator=(uint32_t value)
2716 {
2717 PID5 = value >> 0;
2718 }
2719 CONSTEXPR operator uint32_t() const
2720 {
2721 return (PID5 << 0);
2722 }
2723 pid5_r copy()
2724 {
2725 return *this;
2726 }
2727#else
2728 CONSTEXPR pid5_r() : PID5(static_cast<uint32_t>(0x00)) {}
2729 CONSTEXPR pid5_r(uint32_t init) : word(init) {}
2730 CONSTEXPR void operator=(uint32_t value)
2731 {
2732 word = value;
2733 }
2734 void operator=(uint32_t value) volatile
2735 {
2736 word = value;
2737 }
2738 CONSTEXPR operator uint32_t()
2739 {
2740 return word;
2741 }
2742 operator uint32_t() volatile
2743 {
2744 return word;
2745 }
2746 pid5_r copy() volatile
2747 {
2748 return *this;
2749 }
2750#endif
2751 CONSTEXPR uint32_t get_PID5() const
2752 {
2753 uint32_t value = static_cast<uint32_t>(PID5);
2754 return value;
2755 }
2756#ifndef MODEL_REGS
2757 uint32_t get_PID5() const volatile
2758 {
2759 uint32_t value = static_cast<uint32_t>(PID5);
2760 return value;
2761 }
2762#endif
2763 CONSTEXPR pid5_r &set_PID5(uint32_t value)
2764 {
2765 PID5 = static_cast<uint32_t>(value);
2766 return *this;
2767 }
2768#endif //__cplusplus
2769};
2770
2771// pid6_r - Peripheral ID byte 6 (reserved)
2772struct pid6_r
2773{
2774#ifdef __cplusplus
2775 private:
2776#endif //__cplusplus
2777#ifdef MODEL_REGS
2778 ::core::dt::uint_t<32> PID6; // Byte 6 of Peripheral ID (Lower 8 bits valid)
2779#else
2780 union
2781 {
2782 uint32_t PID6; // Byte 6 of Peripheral ID (Lower 8 bits valid)
2783 uint32_t word;
2784 };
2785#endif
2786#ifdef __cplusplus
2787 public:
2788#ifdef MODEL_REGS
2789 CONSTEXPR pid6_r() : PID6(static_cast<uint32_t>(0x00)) {}
2790 CONSTEXPR pid6_r(uint32_t value) : PID6(value >> 0) {}
2791 CONSTEXPR void operator=(uint32_t value)
2792 {
2793 PID6 = value >> 0;
2794 }
2795 CONSTEXPR operator uint32_t() const
2796 {
2797 return (PID6 << 0);
2798 }
2799 pid6_r copy()
2800 {
2801 return *this;
2802 }
2803#else
2804 CONSTEXPR pid6_r() : PID6(static_cast<uint32_t>(0x00)) {}
2805 CONSTEXPR pid6_r(uint32_t init) : word(init) {}
2806 CONSTEXPR void operator=(uint32_t value)
2807 {
2808 word = value;
2809 }
2810 void operator=(uint32_t value) volatile
2811 {
2812 word = value;
2813 }
2814 CONSTEXPR operator uint32_t()
2815 {
2816 return word;
2817 }
2818 operator uint32_t() volatile
2819 {
2820 return word;
2821 }
2822 pid6_r copy() volatile
2823 {
2824 return *this;
2825 }
2826#endif
2827 CONSTEXPR uint32_t get_PID6() const
2828 {
2829 uint32_t value = static_cast<uint32_t>(PID6);
2830 return value;
2831 }
2832#ifndef MODEL_REGS
2833 uint32_t get_PID6() const volatile
2834 {
2835 uint32_t value = static_cast<uint32_t>(PID6);
2836 return value;
2837 }
2838#endif
2839 CONSTEXPR pid6_r &set_PID6(uint32_t value)
2840 {
2841 PID6 = static_cast<uint32_t>(value);
2842 return *this;
2843 }
2844#endif //__cplusplus
2845};
2846
2847// pid7_r - Peripheral ID byte 7 (reserved)
2848struct pid7_r
2849{
2850#ifdef __cplusplus
2851 private:
2852#endif //__cplusplus
2853#ifdef MODEL_REGS
2854 ::core::dt::uint_t<32> PID7; // Byte 7 of Peripheral ID (Lower 8 bits valid)
2855#else
2856 union
2857 {
2858 uint32_t PID7; // Byte 7 of Peripheral ID (Lower 8 bits valid)
2859 uint32_t word;
2860 };
2861#endif
2862#ifdef __cplusplus
2863 public:
2864#ifdef MODEL_REGS
2865 CONSTEXPR pid7_r() : PID7(static_cast<uint32_t>(0x00)) {}
2866 CONSTEXPR pid7_r(uint32_t value) : PID7(value >> 0) {}
2867 CONSTEXPR void operator=(uint32_t value)
2868 {
2869 PID7 = value >> 0;
2870 }
2871 CONSTEXPR operator uint32_t() const
2872 {
2873 return (PID7 << 0);
2874 }
2875 pid7_r copy()
2876 {
2877 return *this;
2878 }
2879#else
2880 CONSTEXPR pid7_r() : PID7(static_cast<uint32_t>(0x00)) {}
2881 CONSTEXPR pid7_r(uint32_t init) : word(init) {}
2882 CONSTEXPR void operator=(uint32_t value)
2883 {
2884 word = value;
2885 }
2886 void operator=(uint32_t value) volatile
2887 {
2888 word = value;
2889 }
2890 CONSTEXPR operator uint32_t()
2891 {
2892 return word;
2893 }
2894 operator uint32_t() volatile
2895 {
2896 return word;
2897 }
2898 pid7_r copy() volatile
2899 {
2900 return *this;
2901 }
2902#endif
2903 CONSTEXPR uint32_t get_PID7() const
2904 {
2905 uint32_t value = static_cast<uint32_t>(PID7);
2906 return value;
2907 }
2908#ifndef MODEL_REGS
2909 uint32_t get_PID7() const volatile
2910 {
2911 uint32_t value = static_cast<uint32_t>(PID7);
2912 return value;
2913 }
2914#endif
2915 CONSTEXPR pid7_r &set_PID7(uint32_t value)
2916 {
2917 PID7 = static_cast<uint32_t>(value);
2918 return *this;
2919 }
2920#endif //__cplusplus
2921};
2922
2923// pid0_r - Peripheral ID byte 0. This is bits[7:0] of the part number.
2924struct pid0_r
2925{
2926#ifdef __cplusplus
2927 private:
2928#endif //__cplusplus
2929#ifdef MODEL_REGS
2930 ::core::dt::uint_t<32> PID0; // Byte 0 of Peripheral ID (Lower 8 bits valid)
2931#else
2932 union
2933 {
2934 uint32_t PID0; // Byte 0 of Peripheral ID (Lower 8 bits valid)
2935 uint32_t word;
2936 };
2937#endif
2938#ifdef __cplusplus
2939 public:
2940#ifdef MODEL_REGS
2941 CONSTEXPR pid0_r() : PID0(static_cast<uint32_t>(0x80)) {}
2942 CONSTEXPR pid0_r(uint32_t value) : PID0(value >> 0) {}
2943 CONSTEXPR void operator=(uint32_t value)
2944 {
2945 PID0 = value >> 0;
2946 }
2947 CONSTEXPR operator uint32_t() const
2948 {
2949 return (PID0 << 0);
2950 }
2951 pid0_r copy()
2952 {
2953 return *this;
2954 }
2955#else
2956 CONSTEXPR pid0_r() : PID0(static_cast<uint32_t>(0x80)) {}
2957 CONSTEXPR pid0_r(uint32_t init) : word(init) {}
2958 CONSTEXPR void operator=(uint32_t value)
2959 {
2960 word = value;
2961 }
2962 void operator=(uint32_t value) volatile
2963 {
2964 word = value;
2965 }
2966 CONSTEXPR operator uint32_t()
2967 {
2968 return word;
2969 }
2970 operator uint32_t() volatile
2971 {
2972 return word;
2973 }
2974 pid0_r copy() volatile
2975 {
2976 return *this;
2977 }
2978#endif
2979 CONSTEXPR uint32_t get_PID0() const
2980 {
2981 uint32_t value = static_cast<uint32_t>(PID0);
2982 return value;
2983 }
2984#ifndef MODEL_REGS
2985 uint32_t get_PID0() const volatile
2986 {
2987 uint32_t value = static_cast<uint32_t>(PID0);
2988 return value;
2989 }
2990#endif
2991 CONSTEXPR pid0_r &set_PID0(uint32_t value)
2992 {
2993 PID0 = static_cast<uint32_t>(value);
2994 return *this;
2995 }
2996#endif //__cplusplus
2997};
2998
2999// 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
3000// bits[7:4].
3001struct pid1_r
3002{
3003#ifdef __cplusplus
3004 private:
3005#endif //__cplusplus
3006#ifdef MODEL_REGS
3007 ::core::dt::uint_t<32> PID1; // Byte 1 of Peripheral ID (Lower 8 bits valid)
3008#else
3009 union
3010 {
3011 uint32_t PID1; // Byte 1 of Peripheral ID (Lower 8 bits valid)
3012 uint32_t word;
3013 };
3014#endif
3015#ifdef __cplusplus
3016 public:
3017#ifdef MODEL_REGS
3018 CONSTEXPR pid1_r() : PID1(static_cast<uint32_t>(0xB5)) {}
3019 CONSTEXPR pid1_r(uint32_t value) : PID1(value >> 0) {}
3020 CONSTEXPR void operator=(uint32_t value)
3021 {
3022 PID1 = value >> 0;
3023 }
3024 CONSTEXPR operator uint32_t() const
3025 {
3026 return (PID1 << 0);
3027 }
3028 pid1_r copy()
3029 {
3030 return *this;
3031 }
3032#else
3033 CONSTEXPR pid1_r() : PID1(static_cast<uint32_t>(0xB5)) {}
3034 CONSTEXPR pid1_r(uint32_t init) : word(init) {}
3035 CONSTEXPR void operator=(uint32_t value)
3036 {
3037 word = value;
3038 }
3039 void operator=(uint32_t value) volatile
3040 {
3041 word = value;
3042 }
3043 CONSTEXPR operator uint32_t()
3044 {
3045 return word;
3046 }
3047 operator uint32_t() volatile
3048 {
3049 return word;
3050 }
3051 pid1_r copy() volatile
3052 {
3053 return *this;
3054 }
3055#endif
3056 CONSTEXPR uint32_t get_PID1() const
3057 {
3058 uint32_t value = static_cast<uint32_t>(PID1);
3059 return value;
3060 }
3061#ifndef MODEL_REGS
3062 uint32_t get_PID1() const volatile
3063 {
3064 uint32_t value = static_cast<uint32_t>(PID1);
3065 return value;
3066 }
3067#endif
3068 CONSTEXPR pid1_r &set_PID1(uint32_t value)
3069 {
3070 PID1 = static_cast<uint32_t>(value);
3071 return *this;
3072 }
3073#endif //__cplusplus
3074};
3075
3076// 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.
3077struct pid2_r
3078{
3079#ifdef __cplusplus
3080 private:
3081#endif //__cplusplus
3082#ifdef MODEL_REGS
3083 ::core::dt::uint_t<32> PID2; // Byte 2 of Peripheral ID (Lower 8 bits valid)
3084#else
3085 union
3086 {
3087 uint32_t PID2; // Byte 2 of Peripheral ID (Lower 8 bits valid)
3088 uint32_t word;
3089 };
3090#endif
3091#ifdef __cplusplus
3092 public:
3093#ifdef MODEL_REGS
3094 CONSTEXPR pid2_r() : PID2(static_cast<uint32_t>(0x0B)) {}
3095 CONSTEXPR pid2_r(uint32_t value) : PID2(value >> 0) {}
3096 CONSTEXPR void operator=(uint32_t value)
3097 {
3098 PID2 = value >> 0;
3099 }
3100 CONSTEXPR operator uint32_t() const
3101 {
3102 return (PID2 << 0);
3103 }
3104 pid2_r copy()
3105 {
3106 return *this;
3107 }
3108#else
3109 CONSTEXPR pid2_r() : PID2(static_cast<uint32_t>(0x0B)) {}
3110 CONSTEXPR pid2_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 pid2_r copy() volatile
3128 {
3129 return *this;
3130 }
3131#endif
3132 CONSTEXPR uint32_t get_PID2() const
3133 {
3134 uint32_t value = static_cast<uint32_t>(PID2);
3135 return value;
3136 }
3137#ifndef MODEL_REGS
3138 uint32_t get_PID2() const volatile
3139 {
3140 uint32_t value = static_cast<uint32_t>(PID2);
3141 return value;
3142 }
3143#endif
3144 CONSTEXPR pid2_r &set_PID2(uint32_t value)
3145 {
3146 PID2 = static_cast<uint32_t>(value);
3147 return *this;
3148 }
3149#endif //__cplusplus
3150};
3151
3152// pid3_r - Peripheral ID byte 3.
3153struct pid3_r
3154{
3155#ifdef __cplusplus
3156 private:
3157#endif //__cplusplus
3158#ifdef MODEL_REGS
3159 ::core::dt::uint_t<32> PID3; // Byte 1 of Peripheral ID (Lower 8 bits valid)
3160#else
3161 union
3162 {
3163 uint32_t PID3; // Byte 1 of Peripheral ID (Lower 8 bits valid)
3164 uint32_t word;
3165 };
3166#endif
3167#ifdef __cplusplus
3168 public:
3169#ifdef MODEL_REGS
3170 CONSTEXPR pid3_r() : PID3(static_cast<uint32_t>(0x0)) {}
3171 CONSTEXPR pid3_r(uint32_t value) : PID3(value >> 0) {}
3172 CONSTEXPR void operator=(uint32_t value)
3173 {
3174 PID3 = value >> 0;
3175 }
3176 CONSTEXPR operator uint32_t() const
3177 {
3178 return (PID3 << 0);
3179 }
3180 pid3_r copy()
3181 {
3182 return *this;
3183 }
3184#else
3185 CONSTEXPR pid3_r() : PID3(static_cast<uint32_t>(0x0)) {}
3186 CONSTEXPR pid3_r(uint32_t init) : word(init) {}
3187 CONSTEXPR void operator=(uint32_t value)
3188 {
3189 word = value;
3190 }
3191 void operator=(uint32_t value) volatile
3192 {
3193 word = value;
3194 }
3195 CONSTEXPR operator uint32_t()
3196 {
3197 return word;
3198 }
3199 operator uint32_t() volatile
3200 {
3201 return word;
3202 }
3203 pid3_r copy() volatile
3204 {
3205 return *this;
3206 }
3207#endif
3208 CONSTEXPR uint32_t get_PID3() const
3209 {
3210 uint32_t value = static_cast<uint32_t>(PID3);
3211 return value;
3212 }
3213#ifndef MODEL_REGS
3214 uint32_t get_PID3() const volatile
3215 {
3216 uint32_t value = static_cast<uint32_t>(PID3);
3217 return value;
3218 }
3219#endif
3220 CONSTEXPR pid3_r &set_PID3(uint32_t value)
3221 {
3222 PID3 = static_cast<uint32_t>(value);
3223 return *this;
3224 }
3225#endif //__cplusplus
3226};
3227
3228// cid0_r - Component ID byte 0.
3229struct cid0_r
3230{
3231#ifdef __cplusplus
3232 private:
3233#endif //__cplusplus
3234#ifdef MODEL_REGS
3235 ::core::dt::uint_t<32> CID0; // Byte 0 of Component ID (Lower 8 bits valid)
3236#else
3237 union
3238 {
3239 uint32_t CID0; // Byte 0 of Component ID (Lower 8 bits valid)
3240 uint32_t word;
3241 };
3242#endif
3243#ifdef __cplusplus
3244 public:
3245#ifdef MODEL_REGS
3246 CONSTEXPR cid0_r() : CID0(static_cast<uint32_t>(0x0D)) {}
3247 CONSTEXPR cid0_r(uint32_t value) : CID0(value >> 0) {}
3248 CONSTEXPR void operator=(uint32_t value)
3249 {
3250 CID0 = value >> 0;
3251 }
3252 CONSTEXPR operator uint32_t() const
3253 {
3254 return (CID0 << 0);
3255 }
3256 cid0_r copy()
3257 {
3258 return *this;
3259 }
3260#else
3261 CONSTEXPR cid0_r() : CID0(static_cast<uint32_t>(0x0D)) {}
3262 CONSTEXPR cid0_r(uint32_t init) : word(init) {}
3263 CONSTEXPR void operator=(uint32_t value)
3264 {
3265 word = value;
3266 }
3267 void operator=(uint32_t value) volatile
3268 {
3269 word = value;
3270 }
3271 CONSTEXPR operator uint32_t()
3272 {
3273 return word;
3274 }
3275 operator uint32_t() volatile
3276 {
3277 return word;
3278 }
3279 cid0_r copy() volatile
3280 {
3281 return *this;
3282 }
3283#endif
3284 CONSTEXPR uint32_t get_CID0() const
3285 {
3286 uint32_t value = static_cast<uint32_t>(CID0);
3287 return value;
3288 }
3289#ifndef MODEL_REGS
3290 uint32_t get_CID0() const volatile
3291 {
3292 uint32_t value = static_cast<uint32_t>(CID0);
3293 return value;
3294 }
3295#endif
3296 CONSTEXPR cid0_r &set_CID0(uint32_t value)
3297 {
3298 CID0 = static_cast<uint32_t>(value);
3299 return *this;
3300 }
3301#endif //__cplusplus
3302};
3303
3304// cid1_r - Component ID byte 1.
3305struct cid1_r
3306{
3307#ifdef __cplusplus
3308 private:
3309#endif //__cplusplus
3310#ifdef MODEL_REGS
3311 ::core::dt::uint_t<32> CID1; // Byte 1 of Component ID (Lower 8 bits valid)
3312#else
3313 union
3314 {
3315 uint32_t CID1; // Byte 1 of Component ID (Lower 8 bits valid)
3316 uint32_t word;
3317 };
3318#endif
3319#ifdef __cplusplus
3320 public:
3321#ifdef MODEL_REGS
3322 CONSTEXPR cid1_r() : CID1(static_cast<uint32_t>(0xF0)) {}
3323 CONSTEXPR cid1_r(uint32_t value) : CID1(value >> 0) {}
3324 CONSTEXPR void operator=(uint32_t value)
3325 {
3326 CID1 = value >> 0;
3327 }
3328 CONSTEXPR operator uint32_t() const
3329 {
3330 return (CID1 << 0);
3331 }
3332 cid1_r copy()
3333 {
3334 return *this;
3335 }
3336#else
3337 CONSTEXPR cid1_r() : CID1(static_cast<uint32_t>(0xF0)) {}
3338 CONSTEXPR cid1_r(uint32_t init) : word(init) {}
3339 CONSTEXPR void operator=(uint32_t value)
3340 {
3341 word = value;
3342 }
3343 void operator=(uint32_t value) volatile
3344 {
3345 word = value;
3346 }
3347 CONSTEXPR operator uint32_t()
3348 {
3349 return word;
3350 }
3351 operator uint32_t() volatile
3352 {
3353 return word;
3354 }
3355 cid1_r copy() volatile
3356 {
3357 return *this;
3358 }
3359#endif
3360 CONSTEXPR uint32_t get_CID1() const
3361 {
3362 uint32_t value = static_cast<uint32_t>(CID1);
3363 return value;
3364 }
3365#ifndef MODEL_REGS
3366 uint32_t get_CID1() const volatile
3367 {
3368 uint32_t value = static_cast<uint32_t>(CID1);
3369 return value;
3370 }
3371#endif
3372 CONSTEXPR cid1_r &set_CID1(uint32_t value)
3373 {
3374 CID1 = static_cast<uint32_t>(value);
3375 return *this;
3376 }
3377#endif //__cplusplus
3378};
3379
3380// cid2_r - Component ID byte 2.
3381struct cid2_r
3382{
3383#ifdef __cplusplus
3384 private:
3385#endif //__cplusplus
3386#ifdef MODEL_REGS
3387 ::core::dt::uint_t<32> CID2; // Byte 2 of Component ID (Lower 8 bits valid)
3388#else
3389 union
3390 {
3391 uint32_t CID2; // Byte 2 of Component ID (Lower 8 bits valid)
3392 uint32_t word;
3393 };
3394#endif
3395#ifdef __cplusplus
3396 public:
3397#ifdef MODEL_REGS
3398 CONSTEXPR cid2_r() : CID2(static_cast<uint32_t>(0x05)) {}
3399 CONSTEXPR cid2_r(uint32_t value) : CID2(value >> 0) {}
3400 CONSTEXPR void operator=(uint32_t value)
3401 {
3402 CID2 = value >> 0;
3403 }
3404 CONSTEXPR operator uint32_t() const
3405 {
3406 return (CID2 << 0);
3407 }
3408 cid2_r copy()
3409 {
3410 return *this;
3411 }
3412#else
3413 CONSTEXPR cid2_r() : CID2(static_cast<uint32_t>(0x05)) {}
3414 CONSTEXPR cid2_r(uint32_t init) : word(init) {}
3415 CONSTEXPR void operator=(uint32_t value)
3416 {
3417 word = value;
3418 }
3419 void operator=(uint32_t value) volatile
3420 {
3421 word = value;
3422 }
3423 CONSTEXPR operator uint32_t()
3424 {
3425 return word;
3426 }
3427 operator uint32_t() volatile
3428 {
3429 return word;
3430 }
3431 cid2_r copy() volatile
3432 {
3433 return *this;
3434 }
3435#endif
3436 CONSTEXPR uint32_t get_CID2() const
3437 {
3438 uint32_t value = static_cast<uint32_t>(CID2);
3439 return value;
3440 }
3441#ifndef MODEL_REGS
3442 uint32_t get_CID2() const volatile
3443 {
3444 uint32_t value = static_cast<uint32_t>(CID2);
3445 return value;
3446 }
3447#endif
3448 CONSTEXPR cid2_r &set_CID2(uint32_t value)
3449 {
3450 CID2 = static_cast<uint32_t>(value);
3451 return *this;
3452 }
3453#endif //__cplusplus
3454};
3455
3456// cid3_r - Component ID byte 3.
3457struct cid3_r
3458{
3459#ifdef __cplusplus
3460 private:
3461#endif //__cplusplus
3462#ifdef MODEL_REGS
3463 ::core::dt::uint_t<32> CID3; // Byte 3 of Component ID (Lower 8 bits valid)
3464#else
3465 union
3466 {
3467 uint32_t CID3; // Byte 3 of Component ID (Lower 8 bits valid)
3468 uint32_t word;
3469 };
3470#endif
3471#ifdef __cplusplus
3472 public:
3473#ifdef MODEL_REGS
3474 CONSTEXPR cid3_r() : CID3(static_cast<uint32_t>(0xB1)) {}
3475 CONSTEXPR cid3_r(uint32_t value) : CID3(value >> 0) {}
3476 CONSTEXPR void operator=(uint32_t value)
3477 {
3478 CID3 = value >> 0;
3479 }
3480 CONSTEXPR operator uint32_t() const
3481 {
3482 return (CID3 << 0);
3483 }
3484 cid3_r copy()
3485 {
3486 return *this;
3487 }
3488#else
3489 CONSTEXPR cid3_r() : CID3(static_cast<uint32_t>(0xB1)) {}
3490 CONSTEXPR cid3_r(uint32_t init) : word(init) {}
3491 CONSTEXPR void operator=(uint32_t value)
3492 {
3493 word = value;
3494 }
3495 void operator=(uint32_t value) volatile
3496 {
3497 word = value;
3498 }
3499 CONSTEXPR operator uint32_t()
3500 {
3501 return word;
3502 }
3503 operator uint32_t() volatile
3504 {
3505 return word;
3506 }
3507 cid3_r copy() volatile
3508 {
3509 return *this;
3510 }
3511#endif
3512 CONSTEXPR uint32_t get_CID3() const
3513 {
3514 uint32_t value = static_cast<uint32_t>(CID3);
3515 return value;
3516 }
3517#ifndef MODEL_REGS
3518 uint32_t get_CID3() const volatile
3519 {
3520 uint32_t value = static_cast<uint32_t>(CID3);
3521 return value;
3522 }
3523#endif
3524 CONSTEXPR cid3_r &set_CID3(uint32_t value)
3525 {
3526 CID3 = static_cast<uint32_t>(value);
3527 return *this;
3528 }
3529#endif //__cplusplus
3530};
3531
3532// id_r - ID register
3533struct id_r
3534{
3535#ifdef __cplusplus
3536 private:
3537#endif //__cplusplus
3538#ifdef MODEL_REGS
Diqing Zhong04118062020-04-15 01:19:12 +02003539 ::core::dt::uint_t<4> version_status; // This is the version of the product
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003540 ::core::dt::uint_t<4> version_minor; // This is the n for the P part of an RnPn release number
3541 ::core::dt::uint_t<4> version_major; // This is the n for the R part of an RnPn release number
Diqing Zhong04118062020-04-15 01:19:12 +02003542 ::core::dt::uint_t<4> product_major; // This is the X part of the ML00X product number
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003543 ::core::dt::uint_t<4> arch_patch_rev; // This is the patch number of the architecture version a.b
3544 ::core::dt::uint_t<8>
3545 arch_minor_rev; // This is the minor architecture version number, b in the architecture version a.b
3546 ::core::dt::uint_t<4>
3547 arch_major_rev; // This is the major architecture version number, a in the architecture version a.b
3548#else
3549 union
3550 {
3551 struct
3552 {
Diqing Zhong04118062020-04-15 01:19:12 +02003553 uint32_t version_status : 4; // This is the version of the product
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003554 uint32_t version_minor : 4; // This is the n for the P part of an RnPn release number
3555 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 +02003556 uint32_t product_major : 4; // This is the X part of the ML00X product number
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003557 uint32_t arch_patch_rev : 4; // This is the patch number of the architecture version a.b
3558 uint32_t
3559 arch_minor_rev : 8; // This is the minor architecture version number, b in the architecture version a.b
3560 uint32_t
3561 arch_major_rev : 4; // This is the major architecture version number, a in the architecture version a.b
3562 };
3563 uint32_t word;
3564 };
3565#endif
3566#ifdef __cplusplus
3567 public:
3568#ifdef MODEL_REGS
3569 CONSTEXPR id_r() :
Diqing Zhong04118062020-04-15 01:19:12 +02003570 version_status(static_cast<uint32_t>(1)), version_minor(static_cast<uint32_t>(0x0)),
3571 version_major(static_cast<uint32_t>(0x0)), product_major(static_cast<uint32_t>(4)),
3572 arch_patch_rev(static_cast<uint32_t>(0)), arch_minor_rev(static_cast<uint32_t>(162)),
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003573 arch_major_rev(static_cast<uint32_t>(0))
3574 {
3575 }
3576 CONSTEXPR id_r(uint32_t value) :
3577 version_status(value >> 0), version_minor(value >> 4), version_major(value >> 8), product_major(value >> 12),
3578 arch_patch_rev(value >> 16), arch_minor_rev(value >> 20), arch_major_rev(value >> 28)
3579 {
3580 }
3581 CONSTEXPR void operator=(uint32_t value)
3582 {
3583 version_status = value >> 0;
3584 version_minor = value >> 4;
3585 version_major = value >> 8;
3586 product_major = value >> 12;
3587 arch_patch_rev = value >> 16;
3588 arch_minor_rev = value >> 20;
3589 arch_major_rev = value >> 28;
3590 }
3591 CONSTEXPR operator uint32_t() const
3592 {
3593 return (version_status << 0) | (version_minor << 4) | (version_major << 8) | (product_major << 12) |
3594 (arch_patch_rev << 16) | (arch_minor_rev << 20) | (arch_major_rev << 28);
3595 }
3596 id_r copy()
3597 {
3598 return *this;
3599 }
3600#else
3601 CONSTEXPR id_r() :
Diqing Zhong04118062020-04-15 01:19:12 +02003602 version_status(static_cast<uint32_t>(1)), version_minor(static_cast<uint32_t>(0x0)),
3603 version_major(static_cast<uint32_t>(0x0)), product_major(static_cast<uint32_t>(4)),
3604 arch_patch_rev(static_cast<uint32_t>(0)), arch_minor_rev(static_cast<uint32_t>(162)),
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02003605 arch_major_rev(static_cast<uint32_t>(0))
3606 {
3607 }
3608 CONSTEXPR id_r(uint32_t init) : word(init) {}
3609 CONSTEXPR void operator=(uint32_t value)
3610 {
3611 word = value;
3612 }
3613 void operator=(uint32_t value) volatile
3614 {
3615 word = value;
3616 }
3617 CONSTEXPR operator uint32_t()
3618 {
3619 return word;
3620 }
3621 operator uint32_t() volatile
3622 {
3623 return word;
3624 }
3625 id_r copy() volatile
3626 {
3627 return *this;
3628 }
3629#endif
3630 CONSTEXPR uint32_t get_version_status() const
3631 {
3632 uint32_t value = static_cast<uint32_t>(version_status);
3633 return value;
3634 }
3635#ifndef MODEL_REGS
3636 uint32_t get_version_status() const volatile
3637 {
3638 uint32_t value = static_cast<uint32_t>(version_status);
3639 return value;
3640 }
3641#endif
3642 CONSTEXPR id_r &set_version_status(uint32_t value)
3643 {
3644 version_status = ((1u << 4) - 1) & static_cast<uint32_t>(value);
3645 return *this;
3646 }
3647 CONSTEXPR uint32_t get_version_minor() const
3648 {
3649 uint32_t value = static_cast<uint32_t>(version_minor);
3650 return value;
3651 }
3652#ifndef MODEL_REGS
3653 uint32_t get_version_minor() const volatile
3654 {
3655 uint32_t value = static_cast<uint32_t>(version_minor);
3656 return value;
3657 }
3658#endif
3659 CONSTEXPR id_r &set_version_minor(uint32_t value)
3660 {
3661 version_minor = ((1u << 4) - 1) & static_cast<uint32_t>(value);
3662 return *this;
3663 }
3664 CONSTEXPR uint32_t get_version_major() const
3665 {
3666 uint32_t value = static_cast<uint32_t>(version_major);
3667 return value;
3668 }
3669#ifndef MODEL_REGS
3670 uint32_t get_version_major() const volatile
3671 {
3672 uint32_t value = static_cast<uint32_t>(version_major);
3673 return value;
3674 }
3675#endif
3676 CONSTEXPR id_r &set_version_major(uint32_t value)
3677 {
3678 version_major = ((1u << 4) - 1) & static_cast<uint32_t>(value);
3679 return *this;
3680 }
3681 CONSTEXPR uint32_t get_product_major() const
3682 {
3683 uint32_t value = static_cast<uint32_t>(product_major);
3684 return value;
3685 }
3686#ifndef MODEL_REGS
3687 uint32_t get_product_major() const volatile
3688 {
3689 uint32_t value = static_cast<uint32_t>(product_major);
3690 return value;
3691 }
3692#endif
3693 CONSTEXPR id_r &set_product_major(uint32_t value)
3694 {
3695 product_major = ((1u << 4) - 1) & static_cast<uint32_t>(value);
3696 return *this;
3697 }
3698 CONSTEXPR uint32_t get_arch_patch_rev() const
3699 {
3700 uint32_t value = static_cast<uint32_t>(arch_patch_rev);
3701 return value;
3702 }
3703#ifndef MODEL_REGS
3704 uint32_t get_arch_patch_rev() const volatile
3705 {
3706 uint32_t value = static_cast<uint32_t>(arch_patch_rev);
3707 return value;
3708 }
3709#endif
3710 CONSTEXPR id_r &set_arch_patch_rev(uint32_t value)
3711 {
3712 arch_patch_rev = ((1u << 4) - 1) & static_cast<uint32_t>(value);
3713 return *this;
3714 }
3715 CONSTEXPR uint32_t get_arch_minor_rev() const
3716 {
3717 uint32_t value = static_cast<uint32_t>(arch_minor_rev);
3718 return value;
3719 }
3720#ifndef MODEL_REGS
3721 uint32_t get_arch_minor_rev() const volatile
3722 {
3723 uint32_t value = static_cast<uint32_t>(arch_minor_rev);
3724 return value;
3725 }
3726#endif
3727 CONSTEXPR id_r &set_arch_minor_rev(uint32_t value)
3728 {
3729 arch_minor_rev = ((1u << 8) - 1) & static_cast<uint32_t>(value);
3730 return *this;
3731 }
3732 CONSTEXPR uint32_t get_arch_major_rev() const
3733 {
3734 uint32_t value = static_cast<uint32_t>(arch_major_rev);
3735 return value;
3736 }
3737#ifndef MODEL_REGS
3738 uint32_t get_arch_major_rev() const volatile
3739 {
3740 uint32_t value = static_cast<uint32_t>(arch_major_rev);
3741 return value;
3742 }
3743#endif
3744 CONSTEXPR id_r &set_arch_major_rev(uint32_t value)
3745 {
3746 arch_major_rev = ((1u << 4) - 1) & static_cast<uint32_t>(value);
3747 return *this;
3748 }
3749#endif //__cplusplus
3750};
3751
3752// status_r - Register describes the current operating status of the NPU
3753struct status_r
3754{
3755#ifdef __cplusplus
3756 private:
3757#endif //__cplusplus
3758#ifdef MODEL_REGS
3759 ::core::dt::uint_t<1> state; // NPU state, 0 = Stopped, 1 = Running
3760 ::core::dt::uint_t<1>
3761 irq_raised; // Raw IRQ status, 0 = IRQ not raised, 1 = IRQ raised. IRQ is cleared using command register bit 1
3762 ::core::dt::uint_t<1>
3763 bus_status; // 0=OK, 1=Bus abort detected and processing halted (NPU will reach IDLE state and not to start
3764 // process any more commands/AXI transactions). Can only be cleared by a reset
3765 ::core::dt::uint_t<1>
3766 reset_status; // Reset is ongoing and only this register can be read (other registers read as 0 and writes are
3767 // ignored.) A value of 0 means NPU is not being reset and can be accessed as normal
3768 ::core::dt::uint_t<1>
3769 cmd_parse_error; // 0=No error 1=Command stream parsing error detected. Can only be cleared by reset
3770 ::core::dt::uint_t<1>
3771 cmd_end_reached; // 0=Not reached, 1=Reached. Cleared by writing QBASE or QSIZE when NPU is in stopped state
3772 ::core::dt::uint_t<1> pmu_irq_raised; // 0=No PMU IRQ, 1=PMU IRQ raised. Cleared by using command register bit 1
3773 ::core::dt::uint_t<1>
3774 wd_fault; // Weight decoder state: 0=no fault 1=weight decoder decompression fault. Can only be cleared by reset
3775 ::core::dt::uint_t<1> faulting_interface; // Faulting interface on bus abort. 0=AXI-M0 1=AXI-M1
3776 ::core::dt::uint_t<4> faulting_channel; // Faulting channel on a bus abort. Read: 0=Cmd 1=IFM 2=Weights 3=Scale+Bias
3777 // 4=Mem2Mem; Write: 8=OFM 9=Mem2Mem
3778 ::core::dt::uint_t<16> irq_history_mask; // IRQ History mask
3779#else
3780 union
3781 {
3782 struct
3783 {
3784 uint32_t state : 1; // NPU state, 0 = Stopped, 1 = Running
3785 uint32_t irq_raised : 1; // Raw IRQ status, 0 = IRQ not raised, 1 = IRQ raised. IRQ is cleared using command
3786 // register bit 1
3787 uint32_t
3788 bus_status : 1; // 0=OK, 1=Bus abort detected and processing halted (NPU will reach IDLE state and not
3789 // to start process any more commands/AXI transactions). Can only be cleared by a reset
3790 uint32_t reset_status : 1; // Reset is ongoing and only this register can be read (other registers read as 0
3791 // and writes are ignored.) A value of 0 means NPU is not being reset and can be
3792 // accessed as normal
3793 uint32_t
3794 cmd_parse_error : 1; // 0=No error 1=Command stream parsing error detected. Can only be cleared by reset
3795 uint32_t cmd_end_reached : 1; // 0=Not reached, 1=Reached. Cleared by writing QBASE or QSIZE when NPU is in
3796 // stopped state
3797 uint32_t pmu_irq_raised : 1; // 0=No PMU IRQ, 1=PMU IRQ raised. Cleared by using command register bit 1
3798 uint32_t wd_fault : 1; // Weight decoder state: 0=no fault 1=weight decoder decompression fault. Can only be
3799 // cleared by reset
3800 uint32_t reserved0 : 3;
3801 uint32_t faulting_interface : 1; // Faulting interface on bus abort. 0=AXI-M0 1=AXI-M1
3802 uint32_t faulting_channel : 4; // Faulting channel on a bus abort. Read: 0=Cmd 1=IFM 2=Weights 3=Scale+Bias
3803 // 4=Mem2Mem; Write: 8=OFM 9=Mem2Mem
3804 uint32_t irq_history_mask : 16; // IRQ History mask
3805 };
3806 uint32_t word;
3807 };
3808#endif
3809#ifdef __cplusplus
3810 public:
3811#ifdef MODEL_REGS
3812 CONSTEXPR status_r() :
3813 state(static_cast<uint32_t>(::state::STOPPED)), irq_raised(static_cast<uint32_t>(0x0)),
3814 bus_status(static_cast<uint32_t>(0x0)), reset_status(static_cast<uint32_t>(0x1)),
3815 cmd_parse_error(static_cast<uint32_t>(0x0)), cmd_end_reached(static_cast<uint32_t>(0x0)),
3816 pmu_irq_raised(static_cast<uint32_t>(0x0)), wd_fault(static_cast<uint32_t>(0x0)),
3817 faulting_interface(static_cast<uint32_t>(0x0)), faulting_channel(static_cast<uint32_t>(0x0)),
3818 irq_history_mask(static_cast<uint32_t>(0x0))
3819 {
3820 }
3821 CONSTEXPR status_r(uint32_t value) :
3822 state(value >> 0), irq_raised(value >> 1), bus_status(value >> 2), reset_status(value >> 3),
3823 cmd_parse_error(value >> 4), cmd_end_reached(value >> 5), pmu_irq_raised(value >> 6), wd_fault(value >> 7),
3824 faulting_interface(value >> 11), faulting_channel(value >> 12), irq_history_mask(value >> 16)
3825 {
3826 }
3827 CONSTEXPR void operator=(uint32_t value)
3828 {
3829 state = value >> 0;
3830 irq_raised = value >> 1;
3831 bus_status = value >> 2;
3832 reset_status = value >> 3;
3833 cmd_parse_error = value >> 4;
3834 cmd_end_reached = value >> 5;
3835 pmu_irq_raised = value >> 6;
3836 wd_fault = value >> 7;
3837 faulting_interface = value >> 11;
3838 faulting_channel = value >> 12;
3839 irq_history_mask = value >> 16;
3840 }
3841 CONSTEXPR operator uint32_t() const
3842 {
3843 return (state << 0) | (irq_raised << 1) | (bus_status << 2) | (reset_status << 3) | (cmd_parse_error << 4) |
3844 (cmd_end_reached << 5) | (pmu_irq_raised << 6) | (wd_fault << 7) | (faulting_interface << 11) |
3845 (faulting_channel << 12) | (irq_history_mask << 16);
3846 }
3847 status_r copy()
3848 {
3849 return *this;
3850 }
3851#else
3852 CONSTEXPR status_r() :
3853 state(static_cast<uint32_t>(::state::STOPPED)), irq_raised(static_cast<uint32_t>(0x0)),
3854 bus_status(static_cast<uint32_t>(0x0)), reset_status(static_cast<uint32_t>(0x1)),
3855 cmd_parse_error(static_cast<uint32_t>(0x0)), cmd_end_reached(static_cast<uint32_t>(0x0)),
3856 pmu_irq_raised(static_cast<uint32_t>(0x0)), wd_fault(static_cast<uint32_t>(0x0)),
3857 reserved0(static_cast<uint32_t>(0)), faulting_interface(static_cast<uint32_t>(0x0)),
3858 faulting_channel(static_cast<uint32_t>(0x0)), irq_history_mask(static_cast<uint32_t>(0x0))
3859 {
3860 }
3861 CONSTEXPR status_r(uint32_t init) : word(init) {}
3862 CONSTEXPR void operator=(uint32_t value)
3863 {
3864 word = value;
3865 }
3866 void operator=(uint32_t value) volatile
3867 {
3868 word = value;
3869 }
3870 CONSTEXPR operator uint32_t()
3871 {
3872 return word;
3873 }
3874 operator uint32_t() volatile
3875 {
3876 return word;
3877 }
3878 status_r copy() volatile
3879 {
3880 return *this;
3881 }
3882#endif
3883 CONSTEXPR ::state get_state() const
3884 {
3885 ::state value = static_cast<::state>(state);
3886 return value;
3887 }
3888#ifndef MODEL_REGS
3889 ::state get_state() const volatile
3890 {
3891 ::state value = static_cast<::state>(state);
3892 return value;
3893 }
3894#endif
3895 CONSTEXPR status_r &set_state(::state value)
3896 {
3897 state = ((1u << 1) - 1) & static_cast<uint32_t>(value);
3898 return *this;
3899 }
3900 CONSTEXPR uint32_t get_irq_raised() const
3901 {
3902 uint32_t value = static_cast<uint32_t>(irq_raised);
3903 return value;
3904 }
3905#ifndef MODEL_REGS
3906 uint32_t get_irq_raised() const volatile
3907 {
3908 uint32_t value = static_cast<uint32_t>(irq_raised);
3909 return value;
3910 }
3911#endif
3912 CONSTEXPR status_r &set_irq_raised(uint32_t value)
3913 {
3914 irq_raised = ((1u << 1) - 1) & static_cast<uint32_t>(value);
3915 return *this;
3916 }
3917 CONSTEXPR uint32_t get_bus_status() const
3918 {
3919 uint32_t value = static_cast<uint32_t>(bus_status);
3920 return value;
3921 }
3922#ifndef MODEL_REGS
3923 uint32_t get_bus_status() const volatile
3924 {
3925 uint32_t value = static_cast<uint32_t>(bus_status);
3926 return value;
3927 }
3928#endif
3929 CONSTEXPR status_r &set_bus_status(uint32_t value)
3930 {
3931 bus_status = ((1u << 1) - 1) & static_cast<uint32_t>(value);
3932 return *this;
3933 }
3934 CONSTEXPR uint32_t get_reset_status() const
3935 {
3936 uint32_t value = static_cast<uint32_t>(reset_status);
3937 return value;
3938 }
3939#ifndef MODEL_REGS
3940 uint32_t get_reset_status() const volatile
3941 {
3942 uint32_t value = static_cast<uint32_t>(reset_status);
3943 return value;
3944 }
3945#endif
3946 CONSTEXPR status_r &set_reset_status(uint32_t value)
3947 {
3948 reset_status = ((1u << 1) - 1) & static_cast<uint32_t>(value);
3949 return *this;
3950 }
3951 CONSTEXPR uint32_t get_cmd_parse_error() const
3952 {
3953 uint32_t value = static_cast<uint32_t>(cmd_parse_error);
3954 return value;
3955 }
3956#ifndef MODEL_REGS
3957 uint32_t get_cmd_parse_error() const volatile
3958 {
3959 uint32_t value = static_cast<uint32_t>(cmd_parse_error);
3960 return value;
3961 }
3962#endif
3963 CONSTEXPR status_r &set_cmd_parse_error(uint32_t value)
3964 {
3965 cmd_parse_error = ((1u << 1) - 1) & static_cast<uint32_t>(value);
3966 return *this;
3967 }
3968 CONSTEXPR uint32_t get_cmd_end_reached() const
3969 {
3970 uint32_t value = static_cast<uint32_t>(cmd_end_reached);
3971 return value;
3972 }
3973#ifndef MODEL_REGS
3974 uint32_t get_cmd_end_reached() const volatile
3975 {
3976 uint32_t value = static_cast<uint32_t>(cmd_end_reached);
3977 return value;
3978 }
3979#endif
3980 CONSTEXPR status_r &set_cmd_end_reached(uint32_t value)
3981 {
3982 cmd_end_reached = ((1u << 1) - 1) & static_cast<uint32_t>(value);
3983 return *this;
3984 }
3985 CONSTEXPR uint32_t get_pmu_irq_raised() const
3986 {
3987 uint32_t value = static_cast<uint32_t>(pmu_irq_raised);
3988 return value;
3989 }
3990#ifndef MODEL_REGS
3991 uint32_t get_pmu_irq_raised() const volatile
3992 {
3993 uint32_t value = static_cast<uint32_t>(pmu_irq_raised);
3994 return value;
3995 }
3996#endif
3997 CONSTEXPR status_r &set_pmu_irq_raised(uint32_t value)
3998 {
3999 pmu_irq_raised = ((1u << 1) - 1) & static_cast<uint32_t>(value);
4000 return *this;
4001 }
4002 CONSTEXPR uint32_t get_wd_fault() const
4003 {
4004 uint32_t value = static_cast<uint32_t>(wd_fault);
4005 return value;
4006 }
4007#ifndef MODEL_REGS
4008 uint32_t get_wd_fault() const volatile
4009 {
4010 uint32_t value = static_cast<uint32_t>(wd_fault);
4011 return value;
4012 }
4013#endif
4014 CONSTEXPR status_r &set_wd_fault(uint32_t value)
4015 {
4016 wd_fault = ((1u << 1) - 1) & static_cast<uint32_t>(value);
4017 return *this;
4018 }
4019 CONSTEXPR uint32_t get_faulting_interface() const
4020 {
4021 uint32_t value = static_cast<uint32_t>(faulting_interface);
4022 return value;
4023 }
4024#ifndef MODEL_REGS
4025 uint32_t get_faulting_interface() const volatile
4026 {
4027 uint32_t value = static_cast<uint32_t>(faulting_interface);
4028 return value;
4029 }
4030#endif
4031 CONSTEXPR status_r &set_faulting_interface(uint32_t value)
4032 {
4033 faulting_interface = ((1u << 1) - 1) & static_cast<uint32_t>(value);
4034 return *this;
4035 }
4036 CONSTEXPR uint32_t get_faulting_channel() const
4037 {
4038 uint32_t value = static_cast<uint32_t>(faulting_channel);
4039 return value;
4040 }
4041#ifndef MODEL_REGS
4042 uint32_t get_faulting_channel() const volatile
4043 {
4044 uint32_t value = static_cast<uint32_t>(faulting_channel);
4045 return value;
4046 }
4047#endif
4048 CONSTEXPR status_r &set_faulting_channel(uint32_t value)
4049 {
4050 faulting_channel = ((1u << 4) - 1) & static_cast<uint32_t>(value);
4051 return *this;
4052 }
4053 CONSTEXPR uint32_t get_irq_history_mask() const
4054 {
4055 uint32_t value = static_cast<uint32_t>(irq_history_mask);
4056 return value;
4057 }
4058#ifndef MODEL_REGS
4059 uint32_t get_irq_history_mask() const volatile
4060 {
4061 uint32_t value = static_cast<uint32_t>(irq_history_mask);
4062 return value;
4063 }
4064#endif
4065 CONSTEXPR status_r &set_irq_history_mask(uint32_t value)
4066 {
4067 irq_history_mask = ((1u << 16) - 1) & static_cast<uint32_t>(value);
4068 return *this;
4069 }
4070#endif //__cplusplus
4071};
4072
4073// cmd_r - Command register, reads as last written command
4074struct cmd_r
4075{
4076#ifdef __cplusplus
4077 private:
4078#endif //__cplusplus
4079#ifdef MODEL_REGS
4080 ::core::dt::uint_t<1>
4081 transition_to_running_state; // Write 1 to transition the NPU to running state. Writing 0 has no effect
4082 ::core::dt::uint_t<1> clear_irq; // Write 1 to clear the IRQ status in the STATUS register. Writing 0 has no effect
4083 ::core::dt::uint_t<1> clock_q_enable; // Write 1 to this bit to enable clock off using clock q-interface and enable
4084 // the master clock gate
4085 ::core::dt::uint_t<1> power_q_enable; // Write 1 to this bit to enable power off using power q-interface
4086 ::core::dt::uint_t<1>
4087 stop_request; // Write 1 to this bit to request STOP after completing any already-started commands
4088 ::core::dt::uint_t<16> clear_irq_history; // Clears the IRQ history mask
4089#else
4090 union
4091 {
4092 struct
4093 {
4094 uint32_t transition_to_running_state : 1; // Write 1 to transition the NPU to running state. Writing 0 has
4095 // no effect
4096 uint32_t clear_irq : 1; // Write 1 to clear the IRQ status in the STATUS register. Writing 0 has no effect
4097 uint32_t clock_q_enable : 1; // Write 1 to this bit to enable clock off using clock q-interface and enable
4098 // the master clock gate
4099 uint32_t power_q_enable : 1; // Write 1 to this bit to enable power off using power q-interface
4100 uint32_t
4101 stop_request : 1; // Write 1 to this bit to request STOP after completing any already-started commands
4102 uint32_t reserved0 : 11;
4103 uint32_t clear_irq_history : 16; // Clears the IRQ history mask
4104 };
4105 uint32_t word;
4106 };
4107#endif
4108#ifdef __cplusplus
4109 public:
4110#ifdef MODEL_REGS
4111 CONSTEXPR cmd_r() :
4112 transition_to_running_state(static_cast<uint32_t>(0x0)), clear_irq(static_cast<uint32_t>(0x0)),
4113 clock_q_enable(static_cast<uint32_t>(0x0)), power_q_enable(static_cast<uint32_t>(0x0)),
4114 stop_request(static_cast<uint32_t>(0x0)), clear_irq_history(static_cast<uint32_t>(0x0))
4115 {
4116 }
4117 CONSTEXPR cmd_r(uint32_t value) :
4118 transition_to_running_state(value >> 0), clear_irq(value >> 1), clock_q_enable(value >> 2),
4119 power_q_enable(value >> 3), stop_request(value >> 4), clear_irq_history(value >> 16)
4120 {
4121 }
4122 CONSTEXPR void operator=(uint32_t value)
4123 {
4124 transition_to_running_state = value >> 0;
4125 clear_irq = value >> 1;
4126 clock_q_enable = value >> 2;
4127 power_q_enable = value >> 3;
4128 stop_request = value >> 4;
4129 clear_irq_history = value >> 16;
4130 }
4131 CONSTEXPR operator uint32_t() const
4132 {
4133 return (transition_to_running_state << 0) | (clear_irq << 1) | (clock_q_enable << 2) | (power_q_enable << 3) |
4134 (stop_request << 4) | (clear_irq_history << 16);
4135 }
4136 cmd_r copy()
4137 {
4138 return *this;
4139 }
4140#else
4141 CONSTEXPR cmd_r() :
4142 transition_to_running_state(static_cast<uint32_t>(0x0)), clear_irq(static_cast<uint32_t>(0x0)),
4143 clock_q_enable(static_cast<uint32_t>(0x0)), power_q_enable(static_cast<uint32_t>(0x0)),
4144 stop_request(static_cast<uint32_t>(0x0)), reserved0(static_cast<uint32_t>(0)),
4145 clear_irq_history(static_cast<uint32_t>(0x0))
4146 {
4147 }
4148 CONSTEXPR cmd_r(uint32_t init) : word(init) {}
4149 CONSTEXPR void operator=(uint32_t value)
4150 {
4151 word = value;
4152 }
4153 void operator=(uint32_t value) volatile
4154 {
4155 word = value;
4156 }
4157 CONSTEXPR operator uint32_t()
4158 {
4159 return word;
4160 }
4161 operator uint32_t() volatile
4162 {
4163 return word;
4164 }
4165 cmd_r copy() volatile
4166 {
4167 return *this;
4168 }
4169#endif
4170 CONSTEXPR uint32_t get_transition_to_running_state() const
4171 {
4172 uint32_t value = static_cast<uint32_t>(transition_to_running_state);
4173 return value;
4174 }
4175#ifndef MODEL_REGS
4176 uint32_t get_transition_to_running_state() const volatile
4177 {
4178 uint32_t value = static_cast<uint32_t>(transition_to_running_state);
4179 return value;
4180 }
4181#endif
4182 CONSTEXPR cmd_r &set_transition_to_running_state(uint32_t value)
4183 {
4184 transition_to_running_state = ((1u << 1) - 1) & static_cast<uint32_t>(value);
4185 return *this;
4186 }
4187 CONSTEXPR uint32_t get_clear_irq() const
4188 {
4189 uint32_t value = static_cast<uint32_t>(clear_irq);
4190 return value;
4191 }
4192#ifndef MODEL_REGS
4193 uint32_t get_clear_irq() const volatile
4194 {
4195 uint32_t value = static_cast<uint32_t>(clear_irq);
4196 return value;
4197 }
4198#endif
4199 CONSTEXPR cmd_r &set_clear_irq(uint32_t value)
4200 {
4201 clear_irq = ((1u << 1) - 1) & static_cast<uint32_t>(value);
4202 return *this;
4203 }
4204 CONSTEXPR uint32_t get_clock_q_enable() const
4205 {
4206 uint32_t value = static_cast<uint32_t>(clock_q_enable);
4207 return value;
4208 }
4209#ifndef MODEL_REGS
4210 uint32_t get_clock_q_enable() const volatile
4211 {
4212 uint32_t value = static_cast<uint32_t>(clock_q_enable);
4213 return value;
4214 }
4215#endif
4216 CONSTEXPR cmd_r &set_clock_q_enable(uint32_t value)
4217 {
4218 clock_q_enable = ((1u << 1) - 1) & static_cast<uint32_t>(value);
4219 return *this;
4220 }
4221 CONSTEXPR uint32_t get_power_q_enable() const
4222 {
4223 uint32_t value = static_cast<uint32_t>(power_q_enable);
4224 return value;
4225 }
4226#ifndef MODEL_REGS
4227 uint32_t get_power_q_enable() const volatile
4228 {
4229 uint32_t value = static_cast<uint32_t>(power_q_enable);
4230 return value;
4231 }
4232#endif
4233 CONSTEXPR cmd_r &set_power_q_enable(uint32_t value)
4234 {
4235 power_q_enable = ((1u << 1) - 1) & static_cast<uint32_t>(value);
4236 return *this;
4237 }
4238 CONSTEXPR uint32_t get_stop_request() const
4239 {
4240 uint32_t value = static_cast<uint32_t>(stop_request);
4241 return value;
4242 }
4243#ifndef MODEL_REGS
4244 uint32_t get_stop_request() const volatile
4245 {
4246 uint32_t value = static_cast<uint32_t>(stop_request);
4247 return value;
4248 }
4249#endif
4250 CONSTEXPR cmd_r &set_stop_request(uint32_t value)
4251 {
4252 stop_request = ((1u << 1) - 1) & static_cast<uint32_t>(value);
4253 return *this;
4254 }
4255 CONSTEXPR uint32_t get_clear_irq_history() const
4256 {
4257 uint32_t value = static_cast<uint32_t>(clear_irq_history);
4258 return value;
4259 }
4260#ifndef MODEL_REGS
4261 uint32_t get_clear_irq_history() const volatile
4262 {
4263 uint32_t value = static_cast<uint32_t>(clear_irq_history);
4264 return value;
4265 }
4266#endif
4267 CONSTEXPR cmd_r &set_clear_irq_history(uint32_t value)
4268 {
4269 clear_irq_history = ((1u << 16) - 1) & static_cast<uint32_t>(value);
4270 return *this;
4271 }
4272#endif //__cplusplus
4273};
4274
4275// reset_r - Request Reset and new security mode
4276struct reset_r
4277{
4278#ifdef __cplusplus
4279 private:
4280#endif //__cplusplus
4281#ifdef MODEL_REGS
4282 ::core::dt::uint_t<1> pending_CPL; // Current privilege level 0=User 1=Privileged
4283 ::core::dt::uint_t<1> pending_CSL; // Current security level 0=Secure 1=Non secure
4284#else
4285 union
4286 {
4287 struct
4288 {
4289 uint32_t pending_CPL : 1; // Current privilege level 0=User 1=Privileged
4290 uint32_t pending_CSL : 1; // Current security level 0=Secure 1=Non secure
4291 uint32_t reserved0 : 30;
4292 };
4293 uint32_t word;
4294 };
4295#endif
4296#ifdef __cplusplus
4297 public:
4298#ifdef MODEL_REGS
4299 CONSTEXPR reset_r() :
4300 pending_CPL(static_cast<uint32_t>(::privilege_level::USER)),
4301 pending_CSL(static_cast<uint32_t>(::security_level::SECURE))
4302 {
4303 }
4304 CONSTEXPR reset_r(uint32_t value) : pending_CPL(value >> 0), pending_CSL(value >> 1) {}
4305 CONSTEXPR void operator=(uint32_t value)
4306 {
4307 pending_CPL = value >> 0;
4308 pending_CSL = value >> 1;
4309 }
4310 CONSTEXPR operator uint32_t() const
4311 {
4312 return (pending_CPL << 0) | (pending_CSL << 1);
4313 }
4314 reset_r copy()
4315 {
4316 return *this;
4317 }
4318#else
4319 CONSTEXPR reset_r() :
4320 pending_CPL(static_cast<uint32_t>(::privilege_level::USER)),
4321 pending_CSL(static_cast<uint32_t>(::security_level::SECURE)), reserved0(static_cast<uint32_t>(0))
4322 {
4323 }
4324 CONSTEXPR reset_r(uint32_t init) : word(init) {}
4325 CONSTEXPR void operator=(uint32_t value)
4326 {
4327 word = value;
4328 }
4329 void operator=(uint32_t value) volatile
4330 {
4331 word = value;
4332 }
4333 CONSTEXPR operator uint32_t()
4334 {
4335 return word;
4336 }
4337 operator uint32_t() volatile
4338 {
4339 return word;
4340 }
4341 reset_r copy() volatile
4342 {
4343 return *this;
4344 }
4345#endif
4346 CONSTEXPR ::privilege_level get_pending_CPL() const
4347 {
4348 ::privilege_level value = static_cast<::privilege_level>(pending_CPL);
4349 return value;
4350 }
4351#ifndef MODEL_REGS
4352 ::privilege_level get_pending_CPL() const volatile
4353 {
4354 ::privilege_level value = static_cast<::privilege_level>(pending_CPL);
4355 return value;
4356 }
4357#endif
4358 CONSTEXPR reset_r &set_pending_CPL(::privilege_level value)
4359 {
4360 pending_CPL = ((1u << 1) - 1) & static_cast<uint32_t>(value);
4361 return *this;
4362 }
4363 CONSTEXPR ::security_level get_pending_CSL() const
4364 {
4365 ::security_level value = static_cast<::security_level>(pending_CSL);
4366 return value;
4367 }
4368#ifndef MODEL_REGS
4369 ::security_level get_pending_CSL() const volatile
4370 {
4371 ::security_level value = static_cast<::security_level>(pending_CSL);
4372 return value;
4373 }
4374#endif
4375 CONSTEXPR reset_r &set_pending_CSL(::security_level value)
4376 {
4377 pending_CSL = ((1u << 1) - 1) & static_cast<uint32_t>(value);
4378 return *this;
4379 }
4380#endif //__cplusplus
4381};
4382
4383// qbase0_r - Base address of command queue bits [31:0]. The address is 4 byte aligned
4384struct qbase0_r
4385{
4386#ifdef __cplusplus
4387 private:
4388#endif //__cplusplus
4389#ifdef MODEL_REGS
4390 ::core::dt::uint_t<32> QBASE0; // The 4 byte aligned lower bytes of the base address value for the command stream
4391#else
4392 union
4393 {
4394 uint32_t QBASE0; // The 4 byte aligned lower bytes of the base address value for the command stream
4395 uint32_t word;
4396 };
4397#endif
4398#ifdef __cplusplus
4399 public:
4400#ifdef MODEL_REGS
4401 CONSTEXPR qbase0_r() : QBASE0(static_cast<uint32_t>(0x00000000)) {}
4402 CONSTEXPR qbase0_r(uint32_t value) : QBASE0(value >> 0) {}
4403 CONSTEXPR void operator=(uint32_t value)
4404 {
4405 QBASE0 = value >> 0;
4406 }
4407 CONSTEXPR operator uint32_t() const
4408 {
4409 return (QBASE0 << 0);
4410 }
4411 qbase0_r copy()
4412 {
4413 return *this;
4414 }
4415#else
4416 CONSTEXPR qbase0_r() : QBASE0(static_cast<uint32_t>(0x00000000)) {}
4417 CONSTEXPR qbase0_r(uint32_t init) : word(init) {}
4418 CONSTEXPR void operator=(uint32_t value)
4419 {
4420 word = value;
4421 }
4422 void operator=(uint32_t value) volatile
4423 {
4424 word = value;
4425 }
4426 CONSTEXPR operator uint32_t()
4427 {
4428 return word;
4429 }
4430 operator uint32_t() volatile
4431 {
4432 return word;
4433 }
4434 qbase0_r copy() volatile
4435 {
4436 return *this;
4437 }
4438#endif
4439 CONSTEXPR uint32_t get_QBASE0() const
4440 {
4441 uint32_t value = static_cast<uint32_t>(QBASE0);
4442 return value;
4443 }
4444#ifndef MODEL_REGS
4445 uint32_t get_QBASE0() const volatile
4446 {
4447 uint32_t value = static_cast<uint32_t>(QBASE0);
4448 return value;
4449 }
4450#endif
4451 CONSTEXPR qbase0_r &set_QBASE0(uint32_t value)
4452 {
4453 QBASE0 = static_cast<uint32_t>(value);
4454 return *this;
4455 }
4456#endif //__cplusplus
4457};
4458
4459// qbase1_r - Address extension bits [47:32] bits for queue base
4460struct qbase1_r
4461{
4462#ifdef __cplusplus
4463 private:
4464#endif //__cplusplus
4465#ifdef MODEL_REGS
4466 ::core::dt::uint_t<32> QBASE1; // The 4 byte aligned upper bytes of the base address value for the command stream
4467#else
4468 union
4469 {
4470 uint32_t QBASE1; // The 4 byte aligned upper bytes of the base address value for the command stream
4471 uint32_t word;
4472 };
4473#endif
4474#ifdef __cplusplus
4475 public:
4476#ifdef MODEL_REGS
4477 CONSTEXPR qbase1_r() : QBASE1(static_cast<uint32_t>(0x00000000)) {}
4478 CONSTEXPR qbase1_r(uint32_t value) : QBASE1(value >> 0) {}
4479 CONSTEXPR void operator=(uint32_t value)
4480 {
4481 QBASE1 = value >> 0;
4482 }
4483 CONSTEXPR operator uint32_t() const
4484 {
4485 return (QBASE1 << 0);
4486 }
4487 qbase1_r copy()
4488 {
4489 return *this;
4490 }
4491#else
4492 CONSTEXPR qbase1_r() : QBASE1(static_cast<uint32_t>(0x00000000)) {}
4493 CONSTEXPR qbase1_r(uint32_t init) : word(init) {}
4494 CONSTEXPR void operator=(uint32_t value)
4495 {
4496 word = value;
4497 }
4498 void operator=(uint32_t value) volatile
4499 {
4500 word = value;
4501 }
4502 CONSTEXPR operator uint32_t()
4503 {
4504 return word;
4505 }
4506 operator uint32_t() volatile
4507 {
4508 return word;
4509 }
4510 qbase1_r copy() volatile
4511 {
4512 return *this;
4513 }
4514#endif
4515 CONSTEXPR uint32_t get_QBASE1() const
4516 {
4517 uint32_t value = static_cast<uint32_t>(QBASE1);
4518 return value;
4519 }
4520#ifndef MODEL_REGS
4521 uint32_t get_QBASE1() const volatile
4522 {
4523 uint32_t value = static_cast<uint32_t>(QBASE1);
4524 return value;
4525 }
4526#endif
4527 CONSTEXPR qbase1_r &set_QBASE1(uint32_t value)
4528 {
4529 QBASE1 = static_cast<uint32_t>(value);
4530 return *this;
4531 }
4532#endif //__cplusplus
4533};
4534
4535// qread_r - Read offset in the command stream in bytes. Multiple of 4 in the range 0 to 16 MB
4536struct qread_r
4537{
4538#ifdef __cplusplus
4539 private:
4540#endif //__cplusplus
4541#ifdef MODEL_REGS
4542 ::core::dt::uint_t<32> QREAD; // The read offset of the current command under execution
4543#else
4544 union
4545 {
4546 uint32_t QREAD; // The read offset of the current command under execution
4547 uint32_t word;
4548 };
4549#endif
4550#ifdef __cplusplus
4551 public:
4552#ifdef MODEL_REGS
4553 CONSTEXPR qread_r() : QREAD(static_cast<uint32_t>(0x00000000)) {}
4554 CONSTEXPR qread_r(uint32_t value) : QREAD(value >> 0) {}
4555 CONSTEXPR void operator=(uint32_t value)
4556 {
4557 QREAD = value >> 0;
4558 }
4559 CONSTEXPR operator uint32_t() const
4560 {
4561 return (QREAD << 0);
4562 }
4563 qread_r copy()
4564 {
4565 return *this;
4566 }
4567#else
4568 CONSTEXPR qread_r() : QREAD(static_cast<uint32_t>(0x00000000)) {}
4569 CONSTEXPR qread_r(uint32_t init) : word(init) {}
4570 CONSTEXPR void operator=(uint32_t value)
4571 {
4572 word = value;
4573 }
4574 void operator=(uint32_t value) volatile
4575 {
4576 word = value;
4577 }
4578 CONSTEXPR operator uint32_t()
4579 {
4580 return word;
4581 }
4582 operator uint32_t() volatile
4583 {
4584 return word;
4585 }
4586 qread_r copy() volatile
4587 {
4588 return *this;
4589 }
4590#endif
4591 CONSTEXPR uint32_t get_QREAD() const
4592 {
4593 uint32_t value = static_cast<uint32_t>(QREAD);
4594 return value;
4595 }
4596#ifndef MODEL_REGS
4597 uint32_t get_QREAD() const volatile
4598 {
4599 uint32_t value = static_cast<uint32_t>(QREAD);
4600 return value;
4601 }
4602#endif
4603 CONSTEXPR qread_r &set_QREAD(uint32_t value)
4604 {
4605 QREAD = static_cast<uint32_t>(value);
4606 return *this;
4607 }
4608#endif //__cplusplus
4609};
4610
4611// qconfig_r - AXI configuration for the command stream in the range 0-3. Same encoding as for REGIONCFG
4612struct qconfig_r
4613{
4614#ifdef __cplusplus
4615 private:
4616#endif //__cplusplus
4617#ifdef MODEL_REGS
4618 ::core::dt::uint_t<32> QCONFIG; // AXI configuration for the command stream in the range 0-3
4619#else
4620 union
4621 {
4622 uint32_t QCONFIG; // AXI configuration for the command stream in the range 0-3
4623 uint32_t word;
4624 };
4625#endif
4626#ifdef __cplusplus
4627 public:
4628#ifdef MODEL_REGS
4629 CONSTEXPR qconfig_r() : QCONFIG(static_cast<uint32_t>(0x00000000)) {}
4630 CONSTEXPR qconfig_r(uint32_t value) : QCONFIG(value >> 0) {}
4631 CONSTEXPR void operator=(uint32_t value)
4632 {
4633 QCONFIG = value >> 0;
4634 }
4635 CONSTEXPR operator uint32_t() const
4636 {
4637 return (QCONFIG << 0);
4638 }
4639 qconfig_r copy()
4640 {
4641 return *this;
4642 }
4643#else
4644 CONSTEXPR qconfig_r() : QCONFIG(static_cast<uint32_t>(0x00000000)) {}
4645 CONSTEXPR qconfig_r(uint32_t init) : word(init) {}
4646 CONSTEXPR void operator=(uint32_t value)
4647 {
4648 word = value;
4649 }
4650 void operator=(uint32_t value) volatile
4651 {
4652 word = value;
4653 }
4654 CONSTEXPR operator uint32_t()
4655 {
4656 return word;
4657 }
4658 operator uint32_t() volatile
4659 {
4660 return word;
4661 }
4662 qconfig_r copy() volatile
4663 {
4664 return *this;
4665 }
4666#endif
4667 CONSTEXPR uint32_t get_QCONFIG() const
4668 {
4669 uint32_t value = static_cast<uint32_t>(QCONFIG);
4670 return value;
4671 }
4672#ifndef MODEL_REGS
4673 uint32_t get_QCONFIG() const volatile
4674 {
4675 uint32_t value = static_cast<uint32_t>(QCONFIG);
4676 return value;
4677 }
4678#endif
4679 CONSTEXPR qconfig_r &set_QCONFIG(uint32_t value)
4680 {
4681 QCONFIG = static_cast<uint32_t>(value);
4682 return *this;
4683 }
4684#endif //__cplusplus
4685};
4686
4687// qsize_r - Size of the command stream in bytes. Multiple of 4 in the range 0 to 16 MB
4688struct qsize_r
4689{
4690#ifdef __cplusplus
4691 private:
4692#endif //__cplusplus
4693#ifdef MODEL_REGS
4694 ::core::dt::uint_t<32> QSIZE; // Size of the next command stream to be executed by the NPU
4695#else
4696 union
4697 {
4698 uint32_t QSIZE; // Size of the next command stream to be executed by the NPU
4699 uint32_t word;
4700 };
4701#endif
4702#ifdef __cplusplus
4703 public:
4704#ifdef MODEL_REGS
4705 CONSTEXPR qsize_r() : QSIZE(static_cast<uint32_t>(0x00000000)) {}
4706 CONSTEXPR qsize_r(uint32_t value) : QSIZE(value >> 0) {}
4707 CONSTEXPR void operator=(uint32_t value)
4708 {
4709 QSIZE = value >> 0;
4710 }
4711 CONSTEXPR operator uint32_t() const
4712 {
4713 return (QSIZE << 0);
4714 }
4715 qsize_r copy()
4716 {
4717 return *this;
4718 }
4719#else
4720 CONSTEXPR qsize_r() : QSIZE(static_cast<uint32_t>(0x00000000)) {}
4721 CONSTEXPR qsize_r(uint32_t init) : word(init) {}
4722 CONSTEXPR void operator=(uint32_t value)
4723 {
4724 word = value;
4725 }
4726 void operator=(uint32_t value) volatile
4727 {
4728 word = value;
4729 }
4730 CONSTEXPR operator uint32_t()
4731 {
4732 return word;
4733 }
4734 operator uint32_t() volatile
4735 {
4736 return word;
4737 }
4738 qsize_r copy() volatile
4739 {
4740 return *this;
4741 }
4742#endif
4743 CONSTEXPR uint32_t get_QSIZE() const
4744 {
4745 uint32_t value = static_cast<uint32_t>(QSIZE);
4746 return value;
4747 }
4748#ifndef MODEL_REGS
4749 uint32_t get_QSIZE() const volatile
4750 {
4751 uint32_t value = static_cast<uint32_t>(QSIZE);
4752 return value;
4753 }
4754#endif
4755 CONSTEXPR qsize_r &set_QSIZE(uint32_t value)
4756 {
4757 QSIZE = static_cast<uint32_t>(value);
4758 return *this;
4759 }
4760#endif //__cplusplus
4761};
4762
4763// prot_r - Protection level configured for the NPU when acting as an AXI master
4764struct prot_r
4765{
4766#ifdef __cplusplus
4767 private:
4768#endif //__cplusplus
4769#ifdef MODEL_REGS
4770 ::core::dt::uint_t<1> active_CPL; // Current privilege level 0=User 1=Privileged
4771 ::core::dt::uint_t<1> active_CSL; // Current security level 0=Secure 1=Non secure
4772#else
4773 union
4774 {
4775 struct
4776 {
4777 uint32_t active_CPL : 1; // Current privilege level 0=User 1=Privileged
4778 uint32_t active_CSL : 1; // Current security level 0=Secure 1=Non secure
4779 uint32_t reserved0 : 30;
4780 };
4781 uint32_t word;
4782 };
4783#endif
4784#ifdef __cplusplus
4785 public:
4786#ifdef MODEL_REGS
4787 CONSTEXPR prot_r() :
4788 active_CPL(static_cast<uint32_t>(::privilege_level::USER)),
4789 active_CSL(static_cast<uint32_t>(::security_level::SECURE))
4790 {
4791 }
4792 CONSTEXPR prot_r(uint32_t value) : active_CPL(value >> 0), active_CSL(value >> 1) {}
4793 CONSTEXPR void operator=(uint32_t value)
4794 {
4795 active_CPL = value >> 0;
4796 active_CSL = value >> 1;
4797 }
4798 CONSTEXPR operator uint32_t() const
4799 {
4800 return (active_CPL << 0) | (active_CSL << 1);
4801 }
4802 prot_r copy()
4803 {
4804 return *this;
4805 }
4806#else
4807 CONSTEXPR prot_r() :
4808 active_CPL(static_cast<uint32_t>(::privilege_level::USER)),
4809 active_CSL(static_cast<uint32_t>(::security_level::SECURE)), reserved0(static_cast<uint32_t>(0))
4810 {
4811 }
4812 CONSTEXPR prot_r(uint32_t init) : word(init) {}
4813 CONSTEXPR void operator=(uint32_t value)
4814 {
4815 word = value;
4816 }
4817 void operator=(uint32_t value) volatile
4818 {
4819 word = value;
4820 }
4821 CONSTEXPR operator uint32_t()
4822 {
4823 return word;
4824 }
4825 operator uint32_t() volatile
4826 {
4827 return word;
4828 }
4829 prot_r copy() volatile
4830 {
4831 return *this;
4832 }
4833#endif
4834 CONSTEXPR ::privilege_level get_active_CPL() const
4835 {
4836 ::privilege_level value = static_cast<::privilege_level>(active_CPL);
4837 return value;
4838 }
4839#ifndef MODEL_REGS
4840 ::privilege_level get_active_CPL() const volatile
4841 {
4842 ::privilege_level value = static_cast<::privilege_level>(active_CPL);
4843 return value;
4844 }
4845#endif
4846 CONSTEXPR prot_r &set_active_CPL(::privilege_level value)
4847 {
4848 active_CPL = ((1u << 1) - 1) & static_cast<uint32_t>(value);
4849 return *this;
4850 }
4851 CONSTEXPR ::security_level get_active_CSL() const
4852 {
4853 ::security_level value = static_cast<::security_level>(active_CSL);
4854 return value;
4855 }
4856#ifndef MODEL_REGS
4857 ::security_level get_active_CSL() const volatile
4858 {
4859 ::security_level value = static_cast<::security_level>(active_CSL);
4860 return value;
4861 }
4862#endif
4863 CONSTEXPR prot_r &set_active_CSL(::security_level value)
4864 {
4865 active_CSL = ((1u << 1) - 1) & static_cast<uint32_t>(value);
4866 return *this;
4867 }
4868#endif //__cplusplus
4869};
4870
4871// config_r - RTL configuration
4872struct config_r
4873{
4874#ifdef __cplusplus
4875 private:
4876#endif //__cplusplus
4877#ifdef MODEL_REGS
4878 ::core::dt::uint_t<4>
4879 macs_per_cc; // The log2(macs/clock cycle). Valid encoding range is 5 to 8 for 32 to 256 MACs/clock cycle.
4880 ::core::dt::uint_t<4>
4881 cmd_stream_version; // command stream version accepted by this NPU. Set to 0 for Ethos-U55 EAC.
4882 ::core::dt::uint_t<8> shram_size; // Size in KB of SHRAM in the range 8 to 48.
4883 ::core::dt::uint_t<4> product; // Product configuration
4884#else
4885 union
4886 {
4887 struct
4888 {
4889 uint32_t macs_per_cc : 4; // The log2(macs/clock cycle). Valid encoding range is 5 to 8 for 32 to 256
4890 // MACs/clock cycle.
4891 uint32_t cmd_stream_version : 4; // command stream version accepted by this NPU. Set to 0 for Ethos-U55 EAC.
4892 uint32_t shram_size : 8; // Size in KB of SHRAM in the range 8 to 48.
4893 uint32_t reserved0 : 12;
4894 uint32_t product : 4; // Product configuration
4895 };
4896 uint32_t word;
4897 };
4898#endif
4899#ifdef __cplusplus
4900 public:
4901#ifdef MODEL_REGS
4902 CONSTEXPR config_r() :
Diqing Zhong04118062020-04-15 01:19:12 +02004903 macs_per_cc(static_cast<uint32_t>(0)), cmd_stream_version(static_cast<uint32_t>(0x0)),
4904 shram_size(static_cast<uint32_t>(0)), product(static_cast<uint32_t>(0))
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004905 {
4906 }
4907 CONSTEXPR config_r(uint32_t value) :
4908 macs_per_cc(value >> 0), cmd_stream_version(value >> 4), shram_size(value >> 8), product(value >> 28)
4909 {
4910 }
4911 CONSTEXPR void operator=(uint32_t value)
4912 {
4913 macs_per_cc = value >> 0;
4914 cmd_stream_version = value >> 4;
4915 shram_size = value >> 8;
4916 product = value >> 28;
4917 }
4918 CONSTEXPR operator uint32_t() const
4919 {
4920 return (macs_per_cc << 0) | (cmd_stream_version << 4) | (shram_size << 8) | (product << 28);
4921 }
4922 config_r copy()
4923 {
4924 return *this;
4925 }
4926#else
4927 CONSTEXPR config_r() :
Diqing Zhong04118062020-04-15 01:19:12 +02004928 macs_per_cc(static_cast<uint32_t>(0)), cmd_stream_version(static_cast<uint32_t>(0x0)),
4929 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 +02004930 {
4931 }
4932 CONSTEXPR config_r(uint32_t init) : word(init) {}
4933 CONSTEXPR void operator=(uint32_t value)
4934 {
4935 word = value;
4936 }
4937 void operator=(uint32_t value) volatile
4938 {
4939 word = value;
4940 }
4941 CONSTEXPR operator uint32_t()
4942 {
4943 return word;
4944 }
4945 operator uint32_t() volatile
4946 {
4947 return word;
4948 }
4949 config_r copy() volatile
4950 {
4951 return *this;
4952 }
4953#endif
Diqing Zhong04118062020-04-15 01:19:12 +02004954 CONSTEXPR ::macs_per_cc get_macs_per_cc() const
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004955 {
Diqing Zhong04118062020-04-15 01:19:12 +02004956 ::macs_per_cc value = static_cast<::macs_per_cc>(macs_per_cc);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004957 return value;
4958 }
4959#ifndef MODEL_REGS
Diqing Zhong04118062020-04-15 01:19:12 +02004960 ::macs_per_cc get_macs_per_cc() const volatile
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004961 {
Diqing Zhong04118062020-04-15 01:19:12 +02004962 ::macs_per_cc value = static_cast<::macs_per_cc>(macs_per_cc);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004963 return value;
4964 }
4965#endif
Diqing Zhong04118062020-04-15 01:19:12 +02004966 CONSTEXPR config_r &set_macs_per_cc(::macs_per_cc value)
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004967 {
4968 macs_per_cc = ((1u << 4) - 1) & static_cast<uint32_t>(value);
4969 return *this;
4970 }
4971 CONSTEXPR uint32_t get_cmd_stream_version() const
4972 {
4973 uint32_t value = static_cast<uint32_t>(cmd_stream_version);
4974 return value;
4975 }
4976#ifndef MODEL_REGS
4977 uint32_t get_cmd_stream_version() const volatile
4978 {
4979 uint32_t value = static_cast<uint32_t>(cmd_stream_version);
4980 return value;
4981 }
4982#endif
4983 CONSTEXPR config_r &set_cmd_stream_version(uint32_t value)
4984 {
4985 cmd_stream_version = ((1u << 4) - 1) & static_cast<uint32_t>(value);
4986 return *this;
4987 }
Diqing Zhong04118062020-04-15 01:19:12 +02004988 CONSTEXPR ::shram_size get_shram_size() const
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004989 {
Diqing Zhong04118062020-04-15 01:19:12 +02004990 ::shram_size value = static_cast<::shram_size>(shram_size);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004991 return value;
4992 }
4993#ifndef MODEL_REGS
Diqing Zhong04118062020-04-15 01:19:12 +02004994 ::shram_size get_shram_size() const volatile
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004995 {
Diqing Zhong04118062020-04-15 01:19:12 +02004996 ::shram_size value = static_cast<::shram_size>(shram_size);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02004997 return value;
4998 }
4999#endif
Diqing Zhong04118062020-04-15 01:19:12 +02005000 CONSTEXPR config_r &set_shram_size(::shram_size value)
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005001 {
5002 shram_size = ((1u << 8) - 1) & static_cast<uint32_t>(value);
5003 return *this;
5004 }
Diqing Zhong04118062020-04-15 01:19:12 +02005005 CONSTEXPR uint32_t get_product() const
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005006 {
Diqing Zhong04118062020-04-15 01:19:12 +02005007 uint32_t value = static_cast<uint32_t>(product);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005008 return value;
5009 }
5010#ifndef MODEL_REGS
Diqing Zhong04118062020-04-15 01:19:12 +02005011 uint32_t get_product() const volatile
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005012 {
Diqing Zhong04118062020-04-15 01:19:12 +02005013 uint32_t value = static_cast<uint32_t>(product);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005014 return value;
5015 }
5016#endif
Diqing Zhong04118062020-04-15 01:19:12 +02005017 CONSTEXPR config_r &set_product(uint32_t value)
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005018 {
5019 product = ((1u << 4) - 1) & static_cast<uint32_t>(value);
5020 return *this;
5021 }
5022#endif //__cplusplus
5023};
5024
5025// lock_r - Lock register. This register is designed for driver use and does not affect NPU functionality
5026struct lock_r
5027{
5028#ifdef __cplusplus
5029 private:
5030#endif //__cplusplus
5031#ifdef MODEL_REGS
5032 ::core::dt::uint_t<32> LOCK; // 32 bit value for LOCK configuration
5033#else
5034 union
5035 {
5036 uint32_t LOCK; // 32 bit value for LOCK configuration
5037 uint32_t word;
5038 };
5039#endif
5040#ifdef __cplusplus
5041 public:
5042#ifdef MODEL_REGS
5043 CONSTEXPR lock_r() : LOCK(static_cast<uint32_t>(0x00000000)) {}
5044 CONSTEXPR lock_r(uint32_t value) : LOCK(value >> 0) {}
5045 CONSTEXPR void operator=(uint32_t value)
5046 {
5047 LOCK = value >> 0;
5048 }
5049 CONSTEXPR operator uint32_t() const
5050 {
5051 return (LOCK << 0);
5052 }
5053 lock_r copy()
5054 {
5055 return *this;
5056 }
5057#else
5058 CONSTEXPR lock_r() : LOCK(static_cast<uint32_t>(0x00000000)) {}
5059 CONSTEXPR lock_r(uint32_t init) : word(init) {}
5060 CONSTEXPR void operator=(uint32_t value)
5061 {
5062 word = value;
5063 }
5064 void operator=(uint32_t value) volatile
5065 {
5066 word = value;
5067 }
5068 CONSTEXPR operator uint32_t()
5069 {
5070 return word;
5071 }
5072 operator uint32_t() volatile
5073 {
5074 return word;
5075 }
5076 lock_r copy() volatile
5077 {
5078 return *this;
5079 }
5080#endif
5081 CONSTEXPR uint32_t get_LOCK() const
5082 {
5083 uint32_t value = static_cast<uint32_t>(LOCK);
5084 return value;
5085 }
5086#ifndef MODEL_REGS
5087 uint32_t get_LOCK() const volatile
5088 {
5089 uint32_t value = static_cast<uint32_t>(LOCK);
5090 return value;
5091 }
5092#endif
5093 CONSTEXPR lock_r &set_LOCK(uint32_t value)
5094 {
5095 LOCK = static_cast<uint32_t>(value);
5096 return *this;
5097 }
5098#endif //__cplusplus
5099};
5100
5101// regioncfg_r - Base pointer configuration. Bits[2*k+1:2*k] give the memory type for REGION[k]
5102struct regioncfg_r
5103{
5104#ifdef __cplusplus
5105 private:
5106#endif //__cplusplus
5107#ifdef MODEL_REGS
5108 ::core::dt::uint_t<2> region0; // Bits for Region0 Configurion
5109 ::core::dt::uint_t<2> region1; // Bits for Region1 Configurion
5110 ::core::dt::uint_t<2> region2; // Bits for Region2 Configurion
5111 ::core::dt::uint_t<2> region3; // Bits for Region3 Configurion
5112 ::core::dt::uint_t<2> region4; // Bits for Region4 Configurion
5113 ::core::dt::uint_t<2> region5; // Bits for Region5 Configurion
5114 ::core::dt::uint_t<2> region6; // Bits for Region6 Configurion
5115 ::core::dt::uint_t<2> region7; // Bits for Region7 Configurion
5116#else
5117 union
5118 {
5119 struct
5120 {
5121 uint32_t region0 : 2; // Bits for Region0 Configurion
5122 uint32_t region1 : 2; // Bits for Region1 Configurion
5123 uint32_t region2 : 2; // Bits for Region2 Configurion
5124 uint32_t region3 : 2; // Bits for Region3 Configurion
5125 uint32_t region4 : 2; // Bits for Region4 Configurion
5126 uint32_t region5 : 2; // Bits for Region5 Configurion
5127 uint32_t region6 : 2; // Bits for Region6 Configurion
5128 uint32_t region7 : 2; // Bits for Region7 Configurion
5129 uint32_t reserved0 : 16;
5130 };
5131 uint32_t word;
5132 };
5133#endif
5134#ifdef __cplusplus
5135 public:
5136#ifdef MODEL_REGS
5137 CONSTEXPR regioncfg_r() :
5138 region0(static_cast<uint32_t>(::memory_type::AXI0_OUTSTANDING_COUNTER0)),
5139 region1(static_cast<uint32_t>(::memory_type::AXI0_OUTSTANDING_COUNTER0)),
5140 region2(static_cast<uint32_t>(::memory_type::AXI0_OUTSTANDING_COUNTER0)),
5141 region3(static_cast<uint32_t>(::memory_type::AXI0_OUTSTANDING_COUNTER0)),
5142 region4(static_cast<uint32_t>(::memory_type::AXI0_OUTSTANDING_COUNTER0)),
5143 region5(static_cast<uint32_t>(::memory_type::AXI0_OUTSTANDING_COUNTER0)),
5144 region6(static_cast<uint32_t>(::memory_type::AXI0_OUTSTANDING_COUNTER0)),
5145 region7(static_cast<uint32_t>(::memory_type::AXI0_OUTSTANDING_COUNTER0))
5146 {
5147 }
5148 CONSTEXPR regioncfg_r(uint32_t value) :
5149 region0(value >> 0), region1(value >> 2), region2(value >> 4), region3(value >> 6), region4(value >> 8),
5150 region5(value >> 10), region6(value >> 12), region7(value >> 14)
5151 {
5152 }
5153 CONSTEXPR void operator=(uint32_t value)
5154 {
5155 region0 = value >> 0;
5156 region1 = value >> 2;
5157 region2 = value >> 4;
5158 region3 = value >> 6;
5159 region4 = value >> 8;
5160 region5 = value >> 10;
5161 region6 = value >> 12;
5162 region7 = value >> 14;
5163 }
5164 CONSTEXPR operator uint32_t() const
5165 {
5166 return (region0 << 0) | (region1 << 2) | (region2 << 4) | (region3 << 6) | (region4 << 8) | (region5 << 10) |
5167 (region6 << 12) | (region7 << 14);
5168 }
5169 regioncfg_r copy()
5170 {
5171 return *this;
5172 }
5173#else
5174 CONSTEXPR regioncfg_r() :
5175 region0(static_cast<uint32_t>(::memory_type::AXI0_OUTSTANDING_COUNTER0)),
5176 region1(static_cast<uint32_t>(::memory_type::AXI0_OUTSTANDING_COUNTER0)),
5177 region2(static_cast<uint32_t>(::memory_type::AXI0_OUTSTANDING_COUNTER0)),
5178 region3(static_cast<uint32_t>(::memory_type::AXI0_OUTSTANDING_COUNTER0)),
5179 region4(static_cast<uint32_t>(::memory_type::AXI0_OUTSTANDING_COUNTER0)),
5180 region5(static_cast<uint32_t>(::memory_type::AXI0_OUTSTANDING_COUNTER0)),
5181 region6(static_cast<uint32_t>(::memory_type::AXI0_OUTSTANDING_COUNTER0)),
5182 region7(static_cast<uint32_t>(::memory_type::AXI0_OUTSTANDING_COUNTER0)), reserved0(static_cast<uint32_t>(0))
5183 {
5184 }
5185 CONSTEXPR regioncfg_r(uint32_t init) : word(init) {}
5186 CONSTEXPR void operator=(uint32_t value)
5187 {
5188 word = value;
5189 }
5190 void operator=(uint32_t value) volatile
5191 {
5192 word = value;
5193 }
5194 CONSTEXPR operator uint32_t()
5195 {
5196 return word;
5197 }
5198 operator uint32_t() volatile
5199 {
5200 return word;
5201 }
5202 regioncfg_r copy() volatile
5203 {
5204 return *this;
5205 }
5206#endif
5207 CONSTEXPR ::memory_type get_region0() const
5208 {
5209 ::memory_type value = static_cast<::memory_type>(region0);
5210 return value;
5211 }
5212#ifndef MODEL_REGS
5213 ::memory_type get_region0() const volatile
5214 {
5215 ::memory_type value = static_cast<::memory_type>(region0);
5216 return value;
5217 }
5218#endif
5219 CONSTEXPR regioncfg_r &set_region0(::memory_type value)
5220 {
5221 region0 = ((1u << 2) - 1) & static_cast<uint32_t>(value);
5222 return *this;
5223 }
5224 CONSTEXPR ::memory_type get_region1() const
5225 {
5226 ::memory_type value = static_cast<::memory_type>(region1);
5227 return value;
5228 }
5229#ifndef MODEL_REGS
5230 ::memory_type get_region1() const volatile
5231 {
5232 ::memory_type value = static_cast<::memory_type>(region1);
5233 return value;
5234 }
5235#endif
5236 CONSTEXPR regioncfg_r &set_region1(::memory_type value)
5237 {
5238 region1 = ((1u << 2) - 1) & static_cast<uint32_t>(value);
5239 return *this;
5240 }
5241 CONSTEXPR ::memory_type get_region2() const
5242 {
5243 ::memory_type value = static_cast<::memory_type>(region2);
5244 return value;
5245 }
5246#ifndef MODEL_REGS
5247 ::memory_type get_region2() const volatile
5248 {
5249 ::memory_type value = static_cast<::memory_type>(region2);
5250 return value;
5251 }
5252#endif
5253 CONSTEXPR regioncfg_r &set_region2(::memory_type value)
5254 {
5255 region2 = ((1u << 2) - 1) & static_cast<uint32_t>(value);
5256 return *this;
5257 }
5258 CONSTEXPR ::memory_type get_region3() const
5259 {
5260 ::memory_type value = static_cast<::memory_type>(region3);
5261 return value;
5262 }
5263#ifndef MODEL_REGS
5264 ::memory_type get_region3() const volatile
5265 {
5266 ::memory_type value = static_cast<::memory_type>(region3);
5267 return value;
5268 }
5269#endif
5270 CONSTEXPR regioncfg_r &set_region3(::memory_type value)
5271 {
5272 region3 = ((1u << 2) - 1) & static_cast<uint32_t>(value);
5273 return *this;
5274 }
5275 CONSTEXPR ::memory_type get_region4() const
5276 {
5277 ::memory_type value = static_cast<::memory_type>(region4);
5278 return value;
5279 }
5280#ifndef MODEL_REGS
5281 ::memory_type get_region4() const volatile
5282 {
5283 ::memory_type value = static_cast<::memory_type>(region4);
5284 return value;
5285 }
5286#endif
5287 CONSTEXPR regioncfg_r &set_region4(::memory_type value)
5288 {
5289 region4 = ((1u << 2) - 1) & static_cast<uint32_t>(value);
5290 return *this;
5291 }
5292 CONSTEXPR ::memory_type get_region5() const
5293 {
5294 ::memory_type value = static_cast<::memory_type>(region5);
5295 return value;
5296 }
5297#ifndef MODEL_REGS
5298 ::memory_type get_region5() const volatile
5299 {
5300 ::memory_type value = static_cast<::memory_type>(region5);
5301 return value;
5302 }
5303#endif
5304 CONSTEXPR regioncfg_r &set_region5(::memory_type value)
5305 {
5306 region5 = ((1u << 2) - 1) & static_cast<uint32_t>(value);
5307 return *this;
5308 }
5309 CONSTEXPR ::memory_type get_region6() const
5310 {
5311 ::memory_type value = static_cast<::memory_type>(region6);
5312 return value;
5313 }
5314#ifndef MODEL_REGS
5315 ::memory_type get_region6() const volatile
5316 {
5317 ::memory_type value = static_cast<::memory_type>(region6);
5318 return value;
5319 }
5320#endif
5321 CONSTEXPR regioncfg_r &set_region6(::memory_type value)
5322 {
5323 region6 = ((1u << 2) - 1) & static_cast<uint32_t>(value);
5324 return *this;
5325 }
5326 CONSTEXPR ::memory_type get_region7() const
5327 {
5328 ::memory_type value = static_cast<::memory_type>(region7);
5329 return value;
5330 }
5331#ifndef MODEL_REGS
5332 ::memory_type get_region7() const volatile
5333 {
5334 ::memory_type value = static_cast<::memory_type>(region7);
5335 return value;
5336 }
5337#endif
5338 CONSTEXPR regioncfg_r &set_region7(::memory_type value)
5339 {
5340 region7 = ((1u << 2) - 1) & static_cast<uint32_t>(value);
5341 return *this;
5342 }
5343#endif //__cplusplus
5344};
5345
5346// axi_limit0_r - AXI limits for port 0 counter 0
5347struct axi_limit0_r
5348{
5349#ifdef __cplusplus
5350 private:
5351#endif //__cplusplus
5352#ifdef MODEL_REGS
5353 ::core::dt::uint_t<2> max_beats; // Burst split alignment: 0=64 bytes, 1=128 bytes, 2=256 bytes, 3=reserved
5354 ::core::dt::uint_t<4> memtype; // Memtype
5355 ::core::dt::uint_t<8>
5356 max_outstanding_read_m1; // Maximum number of outstanding AXI read transactions - 1 in range 0 to 31
5357 ::core::dt::uint_t<8>
5358 max_outstanding_write_m1; // Maximum number of outstanding AXI write transactions - 1 in range 0 to 15
5359#else
5360 union
5361 {
5362 struct
5363 {
5364 uint32_t max_beats : 2; // Burst split alignment: 0=64 bytes, 1=128 bytes, 2=256 bytes, 3=reserved
5365 uint32_t reserved0 : 2;
5366 uint32_t memtype : 4; // Memtype
5367 uint32_t reserved1 : 8;
5368 uint32_t
5369 max_outstanding_read_m1 : 8; // Maximum number of outstanding AXI read transactions - 1 in range 0 to 31
5370 uint32_t max_outstanding_write_m1 : 8; // Maximum number of outstanding AXI write transactions - 1 in range
5371 // 0 to 15
5372 };
5373 uint32_t word;
5374 };
5375#endif
5376#ifdef __cplusplus
5377 public:
5378#ifdef MODEL_REGS
5379 CONSTEXPR axi_limit0_r() :
Diqing Zhong04118062020-04-15 01:19:12 +02005380 max_beats(static_cast<uint32_t>(0x0)), memtype(static_cast<uint32_t>(0)),
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005381 max_outstanding_read_m1(static_cast<uint32_t>(0x00)), max_outstanding_write_m1(static_cast<uint32_t>(0x000000))
5382 {
5383 }
5384 CONSTEXPR axi_limit0_r(uint32_t value) :
5385 max_beats(value >> 0), memtype(value >> 4), max_outstanding_read_m1(value >> 16),
5386 max_outstanding_write_m1(value >> 24)
5387 {
5388 }
5389 CONSTEXPR void operator=(uint32_t value)
5390 {
5391 max_beats = value >> 0;
5392 memtype = value >> 4;
5393 max_outstanding_read_m1 = value >> 16;
5394 max_outstanding_write_m1 = value >> 24;
5395 }
5396 CONSTEXPR operator uint32_t() const
5397 {
5398 return (max_beats << 0) | (memtype << 4) | (max_outstanding_read_m1 << 16) | (max_outstanding_write_m1 << 24);
5399 }
5400 axi_limit0_r copy()
5401 {
5402 return *this;
5403 }
5404#else
5405 CONSTEXPR axi_limit0_r() :
Diqing Zhong04118062020-04-15 01:19:12 +02005406 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 +02005407 reserved1(static_cast<uint32_t>(0)), max_outstanding_read_m1(static_cast<uint32_t>(0x00)),
5408 max_outstanding_write_m1(static_cast<uint32_t>(0x000000))
5409 {
5410 }
5411 CONSTEXPR axi_limit0_r(uint32_t init) : word(init) {}
5412 CONSTEXPR void operator=(uint32_t value)
5413 {
5414 word = value;
5415 }
5416 void operator=(uint32_t value) volatile
5417 {
5418 word = value;
5419 }
5420 CONSTEXPR operator uint32_t()
5421 {
5422 return word;
5423 }
5424 operator uint32_t() volatile
5425 {
5426 return word;
5427 }
5428 axi_limit0_r copy() volatile
5429 {
5430 return *this;
5431 }
5432#endif
5433 CONSTEXPR uint32_t get_max_beats() const
5434 {
5435 uint32_t value = static_cast<uint32_t>(max_beats);
5436 return value;
5437 }
5438#ifndef MODEL_REGS
5439 uint32_t get_max_beats() const volatile
5440 {
5441 uint32_t value = static_cast<uint32_t>(max_beats);
5442 return value;
5443 }
5444#endif
5445 CONSTEXPR axi_limit0_r &set_max_beats(uint32_t value)
5446 {
5447 max_beats = ((1u << 2) - 1) & static_cast<uint32_t>(value);
5448 return *this;
5449 }
5450 CONSTEXPR uint32_t get_memtype() const
5451 {
5452 uint32_t value = static_cast<uint32_t>(memtype);
5453 return value;
5454 }
5455#ifndef MODEL_REGS
5456 uint32_t get_memtype() const volatile
5457 {
5458 uint32_t value = static_cast<uint32_t>(memtype);
5459 return value;
5460 }
5461#endif
5462 CONSTEXPR axi_limit0_r &set_memtype(uint32_t value)
5463 {
5464 memtype = ((1u << 4) - 1) & static_cast<uint32_t>(value);
5465 return *this;
5466 }
5467 CONSTEXPR uint32_t get_max_outstanding_read_m1() const
5468 {
5469 uint32_t value = static_cast<uint32_t>(max_outstanding_read_m1);
5470 return value;
5471 }
5472#ifndef MODEL_REGS
5473 uint32_t get_max_outstanding_read_m1() const volatile
5474 {
5475 uint32_t value = static_cast<uint32_t>(max_outstanding_read_m1);
5476 return value;
5477 }
5478#endif
5479 CONSTEXPR axi_limit0_r &set_max_outstanding_read_m1(uint32_t value)
5480 {
5481 max_outstanding_read_m1 = ((1u << 8) - 1) & static_cast<uint32_t>(value);
5482 return *this;
5483 }
5484 CONSTEXPR uint32_t get_max_outstanding_write_m1() const
5485 {
5486 uint32_t value = static_cast<uint32_t>(max_outstanding_write_m1);
5487 return value;
5488 }
5489#ifndef MODEL_REGS
5490 uint32_t get_max_outstanding_write_m1() const volatile
5491 {
5492 uint32_t value = static_cast<uint32_t>(max_outstanding_write_m1);
5493 return value;
5494 }
5495#endif
5496 CONSTEXPR axi_limit0_r &set_max_outstanding_write_m1(uint32_t value)
5497 {
5498 max_outstanding_write_m1 = ((1u << 8) - 1) & static_cast<uint32_t>(value);
5499 return *this;
5500 }
5501#endif //__cplusplus
5502};
5503
5504// axi_limit1_r - AXI limits for port 0 counter 1
5505struct axi_limit1_r
5506{
5507#ifdef __cplusplus
5508 private:
5509#endif //__cplusplus
5510#ifdef MODEL_REGS
5511 ::core::dt::uint_t<2> max_beats; // Burst split alignment: 0=64 bytes, 1=128 bytes, 2=256 bytes, 3=reserved
5512 ::core::dt::uint_t<4> memtype; // Memtype
5513 ::core::dt::uint_t<8>
5514 max_outstanding_read_m1; // Maximum number of outstanding AXI read transactions - 1 in range 0 to 31
5515 ::core::dt::uint_t<8>
5516 max_outstanding_write_m1; // Maximum number of outstanding AXI write transactions - 1 in range 0 to 15
5517#else
5518 union
5519 {
5520 struct
5521 {
5522 uint32_t max_beats : 2; // Burst split alignment: 0=64 bytes, 1=128 bytes, 2=256 bytes, 3=reserved
5523 uint32_t reserved0 : 2;
5524 uint32_t memtype : 4; // Memtype
5525 uint32_t reserved1 : 8;
5526 uint32_t
5527 max_outstanding_read_m1 : 8; // Maximum number of outstanding AXI read transactions - 1 in range 0 to 31
5528 uint32_t max_outstanding_write_m1 : 8; // Maximum number of outstanding AXI write transactions - 1 in range
5529 // 0 to 15
5530 };
5531 uint32_t word;
5532 };
5533#endif
5534#ifdef __cplusplus
5535 public:
5536#ifdef MODEL_REGS
5537 CONSTEXPR axi_limit1_r() :
Diqing Zhong04118062020-04-15 01:19:12 +02005538 max_beats(static_cast<uint32_t>(0x0)), memtype(static_cast<uint32_t>(0)),
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005539 max_outstanding_read_m1(static_cast<uint32_t>(0x00)), max_outstanding_write_m1(static_cast<uint32_t>(0x000000))
5540 {
5541 }
5542 CONSTEXPR axi_limit1_r(uint32_t value) :
5543 max_beats(value >> 0), memtype(value >> 4), max_outstanding_read_m1(value >> 16),
5544 max_outstanding_write_m1(value >> 24)
5545 {
5546 }
5547 CONSTEXPR void operator=(uint32_t value)
5548 {
5549 max_beats = value >> 0;
5550 memtype = value >> 4;
5551 max_outstanding_read_m1 = value >> 16;
5552 max_outstanding_write_m1 = value >> 24;
5553 }
5554 CONSTEXPR operator uint32_t() const
5555 {
5556 return (max_beats << 0) | (memtype << 4) | (max_outstanding_read_m1 << 16) | (max_outstanding_write_m1 << 24);
5557 }
5558 axi_limit1_r copy()
5559 {
5560 return *this;
5561 }
5562#else
5563 CONSTEXPR axi_limit1_r() :
Diqing Zhong04118062020-04-15 01:19:12 +02005564 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 +02005565 reserved1(static_cast<uint32_t>(0)), max_outstanding_read_m1(static_cast<uint32_t>(0x00)),
5566 max_outstanding_write_m1(static_cast<uint32_t>(0x000000))
5567 {
5568 }
5569 CONSTEXPR axi_limit1_r(uint32_t init) : word(init) {}
5570 CONSTEXPR void operator=(uint32_t value)
5571 {
5572 word = value;
5573 }
5574 void operator=(uint32_t value) volatile
5575 {
5576 word = value;
5577 }
5578 CONSTEXPR operator uint32_t()
5579 {
5580 return word;
5581 }
5582 operator uint32_t() volatile
5583 {
5584 return word;
5585 }
5586 axi_limit1_r copy() volatile
5587 {
5588 return *this;
5589 }
5590#endif
5591 CONSTEXPR uint32_t get_max_beats() const
5592 {
5593 uint32_t value = static_cast<uint32_t>(max_beats);
5594 return value;
5595 }
5596#ifndef MODEL_REGS
5597 uint32_t get_max_beats() const volatile
5598 {
5599 uint32_t value = static_cast<uint32_t>(max_beats);
5600 return value;
5601 }
5602#endif
5603 CONSTEXPR axi_limit1_r &set_max_beats(uint32_t value)
5604 {
5605 max_beats = ((1u << 2) - 1) & static_cast<uint32_t>(value);
5606 return *this;
5607 }
5608 CONSTEXPR uint32_t get_memtype() const
5609 {
5610 uint32_t value = static_cast<uint32_t>(memtype);
5611 return value;
5612 }
5613#ifndef MODEL_REGS
5614 uint32_t get_memtype() const volatile
5615 {
5616 uint32_t value = static_cast<uint32_t>(memtype);
5617 return value;
5618 }
5619#endif
5620 CONSTEXPR axi_limit1_r &set_memtype(uint32_t value)
5621 {
5622 memtype = ((1u << 4) - 1) & static_cast<uint32_t>(value);
5623 return *this;
5624 }
5625 CONSTEXPR uint32_t get_max_outstanding_read_m1() const
5626 {
5627 uint32_t value = static_cast<uint32_t>(max_outstanding_read_m1);
5628 return value;
5629 }
5630#ifndef MODEL_REGS
5631 uint32_t get_max_outstanding_read_m1() const volatile
5632 {
5633 uint32_t value = static_cast<uint32_t>(max_outstanding_read_m1);
5634 return value;
5635 }
5636#endif
5637 CONSTEXPR axi_limit1_r &set_max_outstanding_read_m1(uint32_t value)
5638 {
5639 max_outstanding_read_m1 = ((1u << 8) - 1) & static_cast<uint32_t>(value);
5640 return *this;
5641 }
5642 CONSTEXPR uint32_t get_max_outstanding_write_m1() const
5643 {
5644 uint32_t value = static_cast<uint32_t>(max_outstanding_write_m1);
5645 return value;
5646 }
5647#ifndef MODEL_REGS
5648 uint32_t get_max_outstanding_write_m1() const volatile
5649 {
5650 uint32_t value = static_cast<uint32_t>(max_outstanding_write_m1);
5651 return value;
5652 }
5653#endif
5654 CONSTEXPR axi_limit1_r &set_max_outstanding_write_m1(uint32_t value)
5655 {
5656 max_outstanding_write_m1 = ((1u << 8) - 1) & static_cast<uint32_t>(value);
5657 return *this;
5658 }
5659#endif //__cplusplus
5660};
5661
5662// axi_limit2_r - AXI limits for port 1 counter 2
5663struct axi_limit2_r
5664{
5665#ifdef __cplusplus
5666 private:
5667#endif //__cplusplus
5668#ifdef MODEL_REGS
5669 ::core::dt::uint_t<2> max_beats; // Burst split alignment: 0=64 bytes, 1=128 bytes, 2=256 bytes, 3=reserved
5670 ::core::dt::uint_t<4> memtype; // Memtype
5671 ::core::dt::uint_t<8>
5672 max_outstanding_read_m1; // Maximum number of outstanding AXI read transactions - 1 in range 0 to 31
5673 ::core::dt::uint_t<8>
5674 max_outstanding_write_m1; // Maximum number of outstanding AXI write transactions - 1 in range 0 to 15
5675#else
5676 union
5677 {
5678 struct
5679 {
5680 uint32_t max_beats : 2; // Burst split alignment: 0=64 bytes, 1=128 bytes, 2=256 bytes, 3=reserved
5681 uint32_t reserved0 : 2;
5682 uint32_t memtype : 4; // Memtype
5683 uint32_t reserved1 : 8;
5684 uint32_t
5685 max_outstanding_read_m1 : 8; // Maximum number of outstanding AXI read transactions - 1 in range 0 to 31
5686 uint32_t max_outstanding_write_m1 : 8; // Maximum number of outstanding AXI write transactions - 1 in range
5687 // 0 to 15
5688 };
5689 uint32_t word;
5690 };
5691#endif
5692#ifdef __cplusplus
5693 public:
5694#ifdef MODEL_REGS
5695 CONSTEXPR axi_limit2_r() :
Diqing Zhong04118062020-04-15 01:19:12 +02005696 max_beats(static_cast<uint32_t>(0x0)), memtype(static_cast<uint32_t>(0)),
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005697 max_outstanding_read_m1(static_cast<uint32_t>(0x00)), max_outstanding_write_m1(static_cast<uint32_t>(0x000000))
5698 {
5699 }
5700 CONSTEXPR axi_limit2_r(uint32_t value) :
5701 max_beats(value >> 0), memtype(value >> 4), max_outstanding_read_m1(value >> 16),
5702 max_outstanding_write_m1(value >> 24)
5703 {
5704 }
5705 CONSTEXPR void operator=(uint32_t value)
5706 {
5707 max_beats = value >> 0;
5708 memtype = value >> 4;
5709 max_outstanding_read_m1 = value >> 16;
5710 max_outstanding_write_m1 = value >> 24;
5711 }
5712 CONSTEXPR operator uint32_t() const
5713 {
5714 return (max_beats << 0) | (memtype << 4) | (max_outstanding_read_m1 << 16) | (max_outstanding_write_m1 << 24);
5715 }
5716 axi_limit2_r copy()
5717 {
5718 return *this;
5719 }
5720#else
5721 CONSTEXPR axi_limit2_r() :
Diqing Zhong04118062020-04-15 01:19:12 +02005722 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 +02005723 reserved1(static_cast<uint32_t>(0)), max_outstanding_read_m1(static_cast<uint32_t>(0x00)),
5724 max_outstanding_write_m1(static_cast<uint32_t>(0x000000))
5725 {
5726 }
5727 CONSTEXPR axi_limit2_r(uint32_t init) : word(init) {}
5728 CONSTEXPR void operator=(uint32_t value)
5729 {
5730 word = value;
5731 }
5732 void operator=(uint32_t value) volatile
5733 {
5734 word = value;
5735 }
5736 CONSTEXPR operator uint32_t()
5737 {
5738 return word;
5739 }
5740 operator uint32_t() volatile
5741 {
5742 return word;
5743 }
5744 axi_limit2_r copy() volatile
5745 {
5746 return *this;
5747 }
5748#endif
5749 CONSTEXPR uint32_t get_max_beats() const
5750 {
5751 uint32_t value = static_cast<uint32_t>(max_beats);
5752 return value;
5753 }
5754#ifndef MODEL_REGS
5755 uint32_t get_max_beats() const volatile
5756 {
5757 uint32_t value = static_cast<uint32_t>(max_beats);
5758 return value;
5759 }
5760#endif
5761 CONSTEXPR axi_limit2_r &set_max_beats(uint32_t value)
5762 {
5763 max_beats = ((1u << 2) - 1) & static_cast<uint32_t>(value);
5764 return *this;
5765 }
5766 CONSTEXPR uint32_t get_memtype() const
5767 {
5768 uint32_t value = static_cast<uint32_t>(memtype);
5769 return value;
5770 }
5771#ifndef MODEL_REGS
5772 uint32_t get_memtype() const volatile
5773 {
5774 uint32_t value = static_cast<uint32_t>(memtype);
5775 return value;
5776 }
5777#endif
5778 CONSTEXPR axi_limit2_r &set_memtype(uint32_t value)
5779 {
5780 memtype = ((1u << 4) - 1) & static_cast<uint32_t>(value);
5781 return *this;
5782 }
5783 CONSTEXPR uint32_t get_max_outstanding_read_m1() const
5784 {
5785 uint32_t value = static_cast<uint32_t>(max_outstanding_read_m1);
5786 return value;
5787 }
5788#ifndef MODEL_REGS
5789 uint32_t get_max_outstanding_read_m1() const volatile
5790 {
5791 uint32_t value = static_cast<uint32_t>(max_outstanding_read_m1);
5792 return value;
5793 }
5794#endif
5795 CONSTEXPR axi_limit2_r &set_max_outstanding_read_m1(uint32_t value)
5796 {
5797 max_outstanding_read_m1 = ((1u << 8) - 1) & static_cast<uint32_t>(value);
5798 return *this;
5799 }
5800 CONSTEXPR uint32_t get_max_outstanding_write_m1() const
5801 {
5802 uint32_t value = static_cast<uint32_t>(max_outstanding_write_m1);
5803 return value;
5804 }
5805#ifndef MODEL_REGS
5806 uint32_t get_max_outstanding_write_m1() const volatile
5807 {
5808 uint32_t value = static_cast<uint32_t>(max_outstanding_write_m1);
5809 return value;
5810 }
5811#endif
5812 CONSTEXPR axi_limit2_r &set_max_outstanding_write_m1(uint32_t value)
5813 {
5814 max_outstanding_write_m1 = ((1u << 8) - 1) & static_cast<uint32_t>(value);
5815 return *this;
5816 }
5817#endif //__cplusplus
5818};
5819
5820// axi_limit3_r - AXI limits for port 1 counter 3
5821struct axi_limit3_r
5822{
5823#ifdef __cplusplus
5824 private:
5825#endif //__cplusplus
5826#ifdef MODEL_REGS
5827 ::core::dt::uint_t<2> max_beats; // Burst split alignment: 0=64 bytes, 1=128 bytes, 2=256 bytes, 3=reserved
5828 ::core::dt::uint_t<4> memtype; // Memtype
5829 ::core::dt::uint_t<8>
5830 max_outstanding_read_m1; // Maximum number of outstanding AXI read transactions - 1 in range 0 to 31
5831 ::core::dt::uint_t<8>
5832 max_outstanding_write_m1; // Maximum number of outstanding AXI write transactions - 1 in range 0 to 15
5833#else
5834 union
5835 {
5836 struct
5837 {
5838 uint32_t max_beats : 2; // Burst split alignment: 0=64 bytes, 1=128 bytes, 2=256 bytes, 3=reserved
5839 uint32_t reserved0 : 2;
5840 uint32_t memtype : 4; // Memtype
5841 uint32_t reserved1 : 8;
5842 uint32_t
5843 max_outstanding_read_m1 : 8; // Maximum number of outstanding AXI read transactions - 1 in range 0 to 31
5844 uint32_t max_outstanding_write_m1 : 8; // Maximum number of outstanding AXI write transactions - 1 in range
5845 // 0 to 15
5846 };
5847 uint32_t word;
5848 };
5849#endif
5850#ifdef __cplusplus
5851 public:
5852#ifdef MODEL_REGS
5853 CONSTEXPR axi_limit3_r() :
Diqing Zhong04118062020-04-15 01:19:12 +02005854 max_beats(static_cast<uint32_t>(0x0)), memtype(static_cast<uint32_t>(0)),
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005855 max_outstanding_read_m1(static_cast<uint32_t>(0x00)), max_outstanding_write_m1(static_cast<uint32_t>(0x000000))
5856 {
5857 }
5858 CONSTEXPR axi_limit3_r(uint32_t value) :
5859 max_beats(value >> 0), memtype(value >> 4), max_outstanding_read_m1(value >> 16),
5860 max_outstanding_write_m1(value >> 24)
5861 {
5862 }
5863 CONSTEXPR void operator=(uint32_t value)
5864 {
5865 max_beats = value >> 0;
5866 memtype = value >> 4;
5867 max_outstanding_read_m1 = value >> 16;
5868 max_outstanding_write_m1 = value >> 24;
5869 }
5870 CONSTEXPR operator uint32_t() const
5871 {
5872 return (max_beats << 0) | (memtype << 4) | (max_outstanding_read_m1 << 16) | (max_outstanding_write_m1 << 24);
5873 }
5874 axi_limit3_r copy()
5875 {
5876 return *this;
5877 }
5878#else
5879 CONSTEXPR axi_limit3_r() :
Diqing Zhong04118062020-04-15 01:19:12 +02005880 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 +02005881 reserved1(static_cast<uint32_t>(0)), max_outstanding_read_m1(static_cast<uint32_t>(0x00)),
5882 max_outstanding_write_m1(static_cast<uint32_t>(0x000000))
5883 {
5884 }
5885 CONSTEXPR axi_limit3_r(uint32_t init) : word(init) {}
5886 CONSTEXPR void operator=(uint32_t value)
5887 {
5888 word = value;
5889 }
5890 void operator=(uint32_t value) volatile
5891 {
5892 word = value;
5893 }
5894 CONSTEXPR operator uint32_t()
5895 {
5896 return word;
5897 }
5898 operator uint32_t() volatile
5899 {
5900 return word;
5901 }
5902 axi_limit3_r copy() volatile
5903 {
5904 return *this;
5905 }
5906#endif
5907 CONSTEXPR uint32_t get_max_beats() const
5908 {
5909 uint32_t value = static_cast<uint32_t>(max_beats);
5910 return value;
5911 }
5912#ifndef MODEL_REGS
5913 uint32_t get_max_beats() const volatile
5914 {
5915 uint32_t value = static_cast<uint32_t>(max_beats);
5916 return value;
5917 }
5918#endif
5919 CONSTEXPR axi_limit3_r &set_max_beats(uint32_t value)
5920 {
5921 max_beats = ((1u << 2) - 1) & static_cast<uint32_t>(value);
5922 return *this;
5923 }
5924 CONSTEXPR uint32_t get_memtype() const
5925 {
5926 uint32_t value = static_cast<uint32_t>(memtype);
5927 return value;
5928 }
5929#ifndef MODEL_REGS
5930 uint32_t get_memtype() const volatile
5931 {
5932 uint32_t value = static_cast<uint32_t>(memtype);
5933 return value;
5934 }
5935#endif
5936 CONSTEXPR axi_limit3_r &set_memtype(uint32_t value)
5937 {
5938 memtype = ((1u << 4) - 1) & static_cast<uint32_t>(value);
5939 return *this;
5940 }
5941 CONSTEXPR uint32_t get_max_outstanding_read_m1() const
5942 {
5943 uint32_t value = static_cast<uint32_t>(max_outstanding_read_m1);
5944 return value;
5945 }
5946#ifndef MODEL_REGS
5947 uint32_t get_max_outstanding_read_m1() const volatile
5948 {
5949 uint32_t value = static_cast<uint32_t>(max_outstanding_read_m1);
5950 return value;
5951 }
5952#endif
5953 CONSTEXPR axi_limit3_r &set_max_outstanding_read_m1(uint32_t value)
5954 {
5955 max_outstanding_read_m1 = ((1u << 8) - 1) & static_cast<uint32_t>(value);
5956 return *this;
5957 }
5958 CONSTEXPR uint32_t get_max_outstanding_write_m1() const
5959 {
5960 uint32_t value = static_cast<uint32_t>(max_outstanding_write_m1);
5961 return value;
5962 }
5963#ifndef MODEL_REGS
5964 uint32_t get_max_outstanding_write_m1() const volatile
5965 {
5966 uint32_t value = static_cast<uint32_t>(max_outstanding_write_m1);
5967 return value;
5968 }
5969#endif
5970 CONSTEXPR axi_limit3_r &set_max_outstanding_write_m1(uint32_t value)
5971 {
5972 max_outstanding_write_m1 = ((1u << 8) - 1) & static_cast<uint32_t>(value);
5973 return *this;
5974 }
5975#endif //__cplusplus
5976};
5977
5978// pmcr_r - PMU Register control
5979struct pmcr_r
5980{
5981#ifdef __cplusplus
5982 private:
5983#endif //__cplusplus
5984#ifdef MODEL_REGS
5985 ::core::dt::uint_t<1> cnt_en; // Enable counters (RW)
5986 ::core::dt::uint_t<1> event_cnt_rst; // Reset event counters (WO)
5987 ::core::dt::uint_t<1> cycle_cnt_rst; // Reset cycle counter (WO)
5988 ::core::dt::uint_t<1> mask_en; // PMU can be enabled/disabled by command stream operation NPU_OP_PMU_MASK
5989 ::core::dt::uint_t<5> num_event_cnt; // Number of event counters (RO)
5990#else
5991 union
5992 {
5993 struct
5994 {
5995 uint32_t cnt_en : 1; // Enable counters (RW)
5996 uint32_t event_cnt_rst : 1; // Reset event counters (WO)
5997 uint32_t cycle_cnt_rst : 1; // Reset cycle counter (WO)
5998 uint32_t mask_en : 1; // PMU can be enabled/disabled by command stream operation NPU_OP_PMU_MASK
5999 uint32_t reserved0 : 7;
6000 uint32_t num_event_cnt : 5; // Number of event counters (RO)
6001 uint32_t reserved1 : 16;
6002 };
6003 uint32_t word;
6004 };
6005#endif
6006#ifdef __cplusplus
6007 public:
6008#ifdef MODEL_REGS
6009 CONSTEXPR pmcr_r() :
6010 cnt_en(static_cast<uint32_t>(0)), event_cnt_rst(static_cast<uint32_t>(0)),
6011 cycle_cnt_rst(static_cast<uint32_t>(0)), mask_en(static_cast<uint32_t>(0)),
6012 num_event_cnt(static_cast<uint32_t>(4))
6013 {
6014 }
6015 CONSTEXPR pmcr_r(uint32_t value) :
6016 cnt_en(value >> 0), event_cnt_rst(value >> 1), cycle_cnt_rst(value >> 2), mask_en(value >> 3),
6017 num_event_cnt(value >> 11)
6018 {
6019 }
6020 CONSTEXPR void operator=(uint32_t value)
6021 {
6022 cnt_en = value >> 0;
6023 event_cnt_rst = value >> 1;
6024 cycle_cnt_rst = value >> 2;
6025 mask_en = value >> 3;
6026 num_event_cnt = value >> 11;
6027 }
6028 CONSTEXPR operator uint32_t() const
6029 {
6030 return (cnt_en << 0) | (event_cnt_rst << 1) | (cycle_cnt_rst << 2) | (mask_en << 3) | (num_event_cnt << 11);
6031 }
6032 pmcr_r copy()
6033 {
6034 return *this;
6035 }
6036#else
6037 CONSTEXPR pmcr_r() :
6038 cnt_en(static_cast<uint32_t>(0)), event_cnt_rst(static_cast<uint32_t>(0)),
6039 cycle_cnt_rst(static_cast<uint32_t>(0)), mask_en(static_cast<uint32_t>(0)), reserved0(static_cast<uint32_t>(0)),
6040 num_event_cnt(static_cast<uint32_t>(4)), reserved1(static_cast<uint32_t>(0))
6041 {
6042 }
6043 CONSTEXPR pmcr_r(uint32_t init) : word(init) {}
6044 CONSTEXPR void operator=(uint32_t value)
6045 {
6046 word = value;
6047 }
6048 void operator=(uint32_t value) volatile
6049 {
6050 word = value;
6051 }
6052 CONSTEXPR operator uint32_t()
6053 {
6054 return word;
6055 }
6056 operator uint32_t() volatile
6057 {
6058 return word;
6059 }
6060 pmcr_r copy() volatile
6061 {
6062 return *this;
6063 }
6064#endif
6065 CONSTEXPR uint32_t get_cnt_en() const
6066 {
6067 uint32_t value = static_cast<uint32_t>(cnt_en);
6068 return value;
6069 }
6070#ifndef MODEL_REGS
6071 uint32_t get_cnt_en() const volatile
6072 {
6073 uint32_t value = static_cast<uint32_t>(cnt_en);
6074 return value;
6075 }
6076#endif
6077 CONSTEXPR pmcr_r &set_cnt_en(uint32_t value)
6078 {
6079 cnt_en = ((1u << 1) - 1) & static_cast<uint32_t>(value);
6080 return *this;
6081 }
6082 CONSTEXPR uint32_t get_event_cnt_rst() const
6083 {
6084 uint32_t value = static_cast<uint32_t>(event_cnt_rst);
6085 return value;
6086 }
6087#ifndef MODEL_REGS
6088 uint32_t get_event_cnt_rst() const volatile
6089 {
6090 uint32_t value = static_cast<uint32_t>(event_cnt_rst);
6091 return value;
6092 }
6093#endif
6094 CONSTEXPR pmcr_r &set_event_cnt_rst(uint32_t value)
6095 {
6096 event_cnt_rst = ((1u << 1) - 1) & static_cast<uint32_t>(value);
6097 return *this;
6098 }
6099 CONSTEXPR uint32_t get_cycle_cnt_rst() const
6100 {
6101 uint32_t value = static_cast<uint32_t>(cycle_cnt_rst);
6102 return value;
6103 }
6104#ifndef MODEL_REGS
6105 uint32_t get_cycle_cnt_rst() const volatile
6106 {
6107 uint32_t value = static_cast<uint32_t>(cycle_cnt_rst);
6108 return value;
6109 }
6110#endif
6111 CONSTEXPR pmcr_r &set_cycle_cnt_rst(uint32_t value)
6112 {
6113 cycle_cnt_rst = ((1u << 1) - 1) & static_cast<uint32_t>(value);
6114 return *this;
6115 }
6116 CONSTEXPR uint32_t get_mask_en() const
6117 {
6118 uint32_t value = static_cast<uint32_t>(mask_en);
6119 return value;
6120 }
6121#ifndef MODEL_REGS
6122 uint32_t get_mask_en() const volatile
6123 {
6124 uint32_t value = static_cast<uint32_t>(mask_en);
6125 return value;
6126 }
6127#endif
6128 CONSTEXPR pmcr_r &set_mask_en(uint32_t value)
6129 {
6130 mask_en = ((1u << 1) - 1) & static_cast<uint32_t>(value);
6131 return *this;
6132 }
6133 CONSTEXPR uint32_t get_num_event_cnt() const
6134 {
6135 uint32_t value = static_cast<uint32_t>(num_event_cnt);
6136 return value;
6137 }
6138#ifndef MODEL_REGS
6139 uint32_t get_num_event_cnt() const volatile
6140 {
6141 uint32_t value = static_cast<uint32_t>(num_event_cnt);
6142 return value;
6143 }
6144#endif
6145 CONSTEXPR pmcr_r &set_num_event_cnt(uint32_t value)
6146 {
6147 num_event_cnt = ((1u << 5) - 1) & static_cast<uint32_t>(value);
6148 return *this;
6149 }
6150#endif //__cplusplus
6151};
6152
6153// pmcntenset_r - Count enable set register
6154struct pmcntenset_r
6155{
6156#ifdef __cplusplus
6157 private:
6158#endif //__cplusplus
6159#ifdef MODEL_REGS
6160 ::core::dt::uint_t<1> EVENT_CNT_0; // Event counter enable bit for PMEVCNTR0
6161 ::core::dt::uint_t<1> EVENT_CNT_1; // Event counter enable bit for PMEVCNTR1
6162 ::core::dt::uint_t<1> EVENT_CNT_2; // Event counter enable bit for PMEVCNTR2
6163 ::core::dt::uint_t<1> EVENT_CNT_3; // Event counter enable bit for PMEVCNTR3
6164 ::core::dt::uint_t<1> CYCLE_CNT; // PMCCNTR enable bit
6165#else
6166 union
6167 {
6168 struct
6169 {
6170 uint32_t EVENT_CNT_0 : 1; // Event counter enable bit for PMEVCNTR0
6171 uint32_t EVENT_CNT_1 : 1; // Event counter enable bit for PMEVCNTR1
6172 uint32_t EVENT_CNT_2 : 1; // Event counter enable bit for PMEVCNTR2
6173 uint32_t EVENT_CNT_3 : 1; // Event counter enable bit for PMEVCNTR3
6174 uint32_t reserved0 : 27;
6175 uint32_t CYCLE_CNT : 1; // PMCCNTR enable bit
6176 };
6177 uint32_t word;
6178 };
6179#endif
6180#ifdef __cplusplus
6181 public:
6182#ifdef MODEL_REGS
6183 CONSTEXPR pmcntenset_r() :
6184 EVENT_CNT_0(static_cast<uint32_t>(0)), EVENT_CNT_1(static_cast<uint32_t>(0)),
6185 EVENT_CNT_2(static_cast<uint32_t>(0)), EVENT_CNT_3(static_cast<uint32_t>(0)),
6186 CYCLE_CNT(static_cast<uint32_t>(0))
6187 {
6188 }
6189 CONSTEXPR pmcntenset_r(uint32_t value) :
6190 EVENT_CNT_0(value >> 0), EVENT_CNT_1(value >> 1), EVENT_CNT_2(value >> 2), EVENT_CNT_3(value >> 3),
6191 CYCLE_CNT(value >> 31)
6192 {
6193 }
6194 CONSTEXPR void operator=(uint32_t value)
6195 {
6196 EVENT_CNT_0 = value >> 0;
6197 EVENT_CNT_1 = value >> 1;
6198 EVENT_CNT_2 = value >> 2;
6199 EVENT_CNT_3 = value >> 3;
6200 CYCLE_CNT = value >> 31;
6201 }
6202 CONSTEXPR operator uint32_t() const
6203 {
6204 return (EVENT_CNT_0 << 0) | (EVENT_CNT_1 << 1) | (EVENT_CNT_2 << 2) | (EVENT_CNT_3 << 3) | (CYCLE_CNT << 31);
6205 }
6206 pmcntenset_r copy()
6207 {
6208 return *this;
6209 }
6210#else
6211 CONSTEXPR pmcntenset_r() :
6212 EVENT_CNT_0(static_cast<uint32_t>(0)), EVENT_CNT_1(static_cast<uint32_t>(0)),
6213 EVENT_CNT_2(static_cast<uint32_t>(0)), EVENT_CNT_3(static_cast<uint32_t>(0)),
6214 reserved0(static_cast<uint32_t>(0)), CYCLE_CNT(static_cast<uint32_t>(0))
6215 {
6216 }
6217 CONSTEXPR pmcntenset_r(uint32_t init) : word(init) {}
6218 CONSTEXPR void operator=(uint32_t value)
6219 {
6220 word = value;
6221 }
6222 void operator=(uint32_t value) volatile
6223 {
6224 word = value;
6225 }
6226 CONSTEXPR operator uint32_t()
6227 {
6228 return word;
6229 }
6230 operator uint32_t() volatile
6231 {
6232 return word;
6233 }
6234 pmcntenset_r copy() volatile
6235 {
6236 return *this;
6237 }
6238#endif
6239 CONSTEXPR uint32_t get_EVENT_CNT_0() const
6240 {
6241 uint32_t value = static_cast<uint32_t>(EVENT_CNT_0);
6242 return value;
6243 }
6244#ifndef MODEL_REGS
6245 uint32_t get_EVENT_CNT_0() const volatile
6246 {
6247 uint32_t value = static_cast<uint32_t>(EVENT_CNT_0);
6248 return value;
6249 }
6250#endif
6251 CONSTEXPR pmcntenset_r &set_EVENT_CNT_0(uint32_t value)
6252 {
6253 EVENT_CNT_0 = ((1u << 1) - 1) & static_cast<uint32_t>(value);
6254 return *this;
6255 }
6256 CONSTEXPR uint32_t get_EVENT_CNT_1() const
6257 {
6258 uint32_t value = static_cast<uint32_t>(EVENT_CNT_1);
6259 return value;
6260 }
6261#ifndef MODEL_REGS
6262 uint32_t get_EVENT_CNT_1() const volatile
6263 {
6264 uint32_t value = static_cast<uint32_t>(EVENT_CNT_1);
6265 return value;
6266 }
6267#endif
6268 CONSTEXPR pmcntenset_r &set_EVENT_CNT_1(uint32_t value)
6269 {
6270 EVENT_CNT_1 = ((1u << 1) - 1) & static_cast<uint32_t>(value);
6271 return *this;
6272 }
6273 CONSTEXPR uint32_t get_EVENT_CNT_2() const
6274 {
6275 uint32_t value = static_cast<uint32_t>(EVENT_CNT_2);
6276 return value;
6277 }
6278#ifndef MODEL_REGS
6279 uint32_t get_EVENT_CNT_2() const volatile
6280 {
6281 uint32_t value = static_cast<uint32_t>(EVENT_CNT_2);
6282 return value;
6283 }
6284#endif
6285 CONSTEXPR pmcntenset_r &set_EVENT_CNT_2(uint32_t value)
6286 {
6287 EVENT_CNT_2 = ((1u << 1) - 1) & static_cast<uint32_t>(value);
6288 return *this;
6289 }
6290 CONSTEXPR uint32_t get_EVENT_CNT_3() const
6291 {
6292 uint32_t value = static_cast<uint32_t>(EVENT_CNT_3);
6293 return value;
6294 }
6295#ifndef MODEL_REGS
6296 uint32_t get_EVENT_CNT_3() const volatile
6297 {
6298 uint32_t value = static_cast<uint32_t>(EVENT_CNT_3);
6299 return value;
6300 }
6301#endif
6302 CONSTEXPR pmcntenset_r &set_EVENT_CNT_3(uint32_t value)
6303 {
6304 EVENT_CNT_3 = ((1u << 1) - 1) & static_cast<uint32_t>(value);
6305 return *this;
6306 }
6307 CONSTEXPR uint32_t get_CYCLE_CNT() const
6308 {
6309 uint32_t value = static_cast<uint32_t>(CYCLE_CNT);
6310 return value;
6311 }
6312#ifndef MODEL_REGS
6313 uint32_t get_CYCLE_CNT() const volatile
6314 {
6315 uint32_t value = static_cast<uint32_t>(CYCLE_CNT);
6316 return value;
6317 }
6318#endif
6319 CONSTEXPR pmcntenset_r &set_CYCLE_CNT(uint32_t value)
6320 {
6321 CYCLE_CNT = ((1u << 1) - 1) & static_cast<uint32_t>(value);
6322 return *this;
6323 }
6324#endif //__cplusplus
6325};
6326
6327// pmcntenclr_r - Count enable clear register
6328struct pmcntenclr_r
6329{
6330#ifdef __cplusplus
6331 private:
6332#endif //__cplusplus
6333#ifdef MODEL_REGS
6334 ::core::dt::uint_t<1> EVENT_CNT_0; // Event counter disable bit for PMEVCNTR0
6335 ::core::dt::uint_t<1> EVENT_CNT_1; // Event counter disable bit for PMEVCNTR1
6336 ::core::dt::uint_t<1> EVENT_CNT_2; // Event counter disable bit for PMEVCNTR2
6337 ::core::dt::uint_t<1> EVENT_CNT_3; // Event counter disable bit for PMEVCNTR3
6338 ::core::dt::uint_t<1> CYCLE_CNT; // PMCCNTR disable bit
6339#else
6340 union
6341 {
6342 struct
6343 {
6344 uint32_t EVENT_CNT_0 : 1; // Event counter disable bit for PMEVCNTR0
6345 uint32_t EVENT_CNT_1 : 1; // Event counter disable bit for PMEVCNTR1
6346 uint32_t EVENT_CNT_2 : 1; // Event counter disable bit for PMEVCNTR2
6347 uint32_t EVENT_CNT_3 : 1; // Event counter disable bit for PMEVCNTR3
6348 uint32_t reserved0 : 27;
6349 uint32_t CYCLE_CNT : 1; // PMCCNTR disable bit
6350 };
6351 uint32_t word;
6352 };
6353#endif
6354#ifdef __cplusplus
6355 public:
6356#ifdef MODEL_REGS
6357 CONSTEXPR pmcntenclr_r() :
6358 EVENT_CNT_0(static_cast<uint32_t>(0)), EVENT_CNT_1(static_cast<uint32_t>(0)),
6359 EVENT_CNT_2(static_cast<uint32_t>(0)), EVENT_CNT_3(static_cast<uint32_t>(0)),
6360 CYCLE_CNT(static_cast<uint32_t>(0))
6361 {
6362 }
6363 CONSTEXPR pmcntenclr_r(uint32_t value) :
6364 EVENT_CNT_0(value >> 0), EVENT_CNT_1(value >> 1), EVENT_CNT_2(value >> 2), EVENT_CNT_3(value >> 3),
6365 CYCLE_CNT(value >> 31)
6366 {
6367 }
6368 CONSTEXPR void operator=(uint32_t value)
6369 {
6370 EVENT_CNT_0 = value >> 0;
6371 EVENT_CNT_1 = value >> 1;
6372 EVENT_CNT_2 = value >> 2;
6373 EVENT_CNT_3 = value >> 3;
6374 CYCLE_CNT = value >> 31;
6375 }
6376 CONSTEXPR operator uint32_t() const
6377 {
6378 return (EVENT_CNT_0 << 0) | (EVENT_CNT_1 << 1) | (EVENT_CNT_2 << 2) | (EVENT_CNT_3 << 3) | (CYCLE_CNT << 31);
6379 }
6380 pmcntenclr_r copy()
6381 {
6382 return *this;
6383 }
6384#else
6385 CONSTEXPR pmcntenclr_r() :
6386 EVENT_CNT_0(static_cast<uint32_t>(0)), EVENT_CNT_1(static_cast<uint32_t>(0)),
6387 EVENT_CNT_2(static_cast<uint32_t>(0)), EVENT_CNT_3(static_cast<uint32_t>(0)),
6388 reserved0(static_cast<uint32_t>(0)), CYCLE_CNT(static_cast<uint32_t>(0))
6389 {
6390 }
6391 CONSTEXPR pmcntenclr_r(uint32_t init) : word(init) {}
6392 CONSTEXPR void operator=(uint32_t value)
6393 {
6394 word = value;
6395 }
6396 void operator=(uint32_t value) volatile
6397 {
6398 word = value;
6399 }
6400 CONSTEXPR operator uint32_t()
6401 {
6402 return word;
6403 }
6404 operator uint32_t() volatile
6405 {
6406 return word;
6407 }
6408 pmcntenclr_r copy() volatile
6409 {
6410 return *this;
6411 }
6412#endif
6413 CONSTEXPR uint32_t get_EVENT_CNT_0() const
6414 {
6415 uint32_t value = static_cast<uint32_t>(EVENT_CNT_0);
6416 return value;
6417 }
6418#ifndef MODEL_REGS
6419 uint32_t get_EVENT_CNT_0() const volatile
6420 {
6421 uint32_t value = static_cast<uint32_t>(EVENT_CNT_0);
6422 return value;
6423 }
6424#endif
6425 CONSTEXPR pmcntenclr_r &set_EVENT_CNT_0(uint32_t value)
6426 {
6427 EVENT_CNT_0 = ((1u << 1) - 1) & static_cast<uint32_t>(value);
6428 return *this;
6429 }
6430 CONSTEXPR uint32_t get_EVENT_CNT_1() const
6431 {
6432 uint32_t value = static_cast<uint32_t>(EVENT_CNT_1);
6433 return value;
6434 }
6435#ifndef MODEL_REGS
6436 uint32_t get_EVENT_CNT_1() const volatile
6437 {
6438 uint32_t value = static_cast<uint32_t>(EVENT_CNT_1);
6439 return value;
6440 }
6441#endif
6442 CONSTEXPR pmcntenclr_r &set_EVENT_CNT_1(uint32_t value)
6443 {
6444 EVENT_CNT_1 = ((1u << 1) - 1) & static_cast<uint32_t>(value);
6445 return *this;
6446 }
6447 CONSTEXPR uint32_t get_EVENT_CNT_2() const
6448 {
6449 uint32_t value = static_cast<uint32_t>(EVENT_CNT_2);
6450 return value;
6451 }
6452#ifndef MODEL_REGS
6453 uint32_t get_EVENT_CNT_2() const volatile
6454 {
6455 uint32_t value = static_cast<uint32_t>(EVENT_CNT_2);
6456 return value;
6457 }
6458#endif
6459 CONSTEXPR pmcntenclr_r &set_EVENT_CNT_2(uint32_t value)
6460 {
6461 EVENT_CNT_2 = ((1u << 1) - 1) & static_cast<uint32_t>(value);
6462 return *this;
6463 }
6464 CONSTEXPR uint32_t get_EVENT_CNT_3() const
6465 {
6466 uint32_t value = static_cast<uint32_t>(EVENT_CNT_3);
6467 return value;
6468 }
6469#ifndef MODEL_REGS
6470 uint32_t get_EVENT_CNT_3() const volatile
6471 {
6472 uint32_t value = static_cast<uint32_t>(EVENT_CNT_3);
6473 return value;
6474 }
6475#endif
6476 CONSTEXPR pmcntenclr_r &set_EVENT_CNT_3(uint32_t value)
6477 {
6478 EVENT_CNT_3 = ((1u << 1) - 1) & static_cast<uint32_t>(value);
6479 return *this;
6480 }
6481 CONSTEXPR uint32_t get_CYCLE_CNT() const
6482 {
6483 uint32_t value = static_cast<uint32_t>(CYCLE_CNT);
6484 return value;
6485 }
6486#ifndef MODEL_REGS
6487 uint32_t get_CYCLE_CNT() const volatile
6488 {
6489 uint32_t value = static_cast<uint32_t>(CYCLE_CNT);
6490 return value;
6491 }
6492#endif
6493 CONSTEXPR pmcntenclr_r &set_CYCLE_CNT(uint32_t value)
6494 {
6495 CYCLE_CNT = ((1u << 1) - 1) & static_cast<uint32_t>(value);
6496 return *this;
6497 }
6498#endif //__cplusplus
6499};
6500
6501// pmovsset_r - Overflow flag status set register
6502struct pmovsset_r
6503{
6504#ifdef __cplusplus
6505 private:
6506#endif //__cplusplus
6507#ifdef MODEL_REGS
6508 ::core::dt::uint_t<1> EVENT_CNT_0_OVF; // Event counter overflow set bit for PMEVCNTR0
6509 ::core::dt::uint_t<1> EVENT_CNT_1_OVF; // Event counter overflow set bit for PMEVCNTR1
6510 ::core::dt::uint_t<1> EVENT_CNT_2_OVF; // Event counter overflow set bit for PMEVCNTR2
6511 ::core::dt::uint_t<1> EVENT_CNT_3_OVF; // Event counter overflow set bit for PMEVCNTR3
6512 ::core::dt::uint_t<1> CYCLE_CNT_OVF; // PMCCNTR overflow set bit
6513#else
6514 union
6515 {
6516 struct
6517 {
6518 uint32_t EVENT_CNT_0_OVF : 1; // Event counter overflow set bit for PMEVCNTR0
6519 uint32_t EVENT_CNT_1_OVF : 1; // Event counter overflow set bit for PMEVCNTR1
6520 uint32_t EVENT_CNT_2_OVF : 1; // Event counter overflow set bit for PMEVCNTR2
6521 uint32_t EVENT_CNT_3_OVF : 1; // Event counter overflow set bit for PMEVCNTR3
6522 uint32_t reserved0 : 27;
6523 uint32_t CYCLE_CNT_OVF : 1; // PMCCNTR overflow set bit
6524 };
6525 uint32_t word;
6526 };
6527#endif
6528#ifdef __cplusplus
6529 public:
6530#ifdef MODEL_REGS
6531 CONSTEXPR pmovsset_r() :
6532 EVENT_CNT_0_OVF(static_cast<uint32_t>(0)), EVENT_CNT_1_OVF(static_cast<uint32_t>(0)),
6533 EVENT_CNT_2_OVF(static_cast<uint32_t>(0)), EVENT_CNT_3_OVF(static_cast<uint32_t>(0)),
6534 CYCLE_CNT_OVF(static_cast<uint32_t>(0))
6535 {
6536 }
6537 CONSTEXPR pmovsset_r(uint32_t value) :
6538 EVENT_CNT_0_OVF(value >> 0), EVENT_CNT_1_OVF(value >> 1), EVENT_CNT_2_OVF(value >> 2),
6539 EVENT_CNT_3_OVF(value >> 3), CYCLE_CNT_OVF(value >> 31)
6540 {
6541 }
6542 CONSTEXPR void operator=(uint32_t value)
6543 {
6544 EVENT_CNT_0_OVF = value >> 0;
6545 EVENT_CNT_1_OVF = value >> 1;
6546 EVENT_CNT_2_OVF = value >> 2;
6547 EVENT_CNT_3_OVF = value >> 3;
6548 CYCLE_CNT_OVF = value >> 31;
6549 }
6550 CONSTEXPR operator uint32_t() const
6551 {
6552 return (EVENT_CNT_0_OVF << 0) | (EVENT_CNT_1_OVF << 1) | (EVENT_CNT_2_OVF << 2) | (EVENT_CNT_3_OVF << 3) |
6553 (CYCLE_CNT_OVF << 31);
6554 }
6555 pmovsset_r copy()
6556 {
6557 return *this;
6558 }
6559#else
6560 CONSTEXPR pmovsset_r() :
6561 EVENT_CNT_0_OVF(static_cast<uint32_t>(0)), EVENT_CNT_1_OVF(static_cast<uint32_t>(0)),
6562 EVENT_CNT_2_OVF(static_cast<uint32_t>(0)), EVENT_CNT_3_OVF(static_cast<uint32_t>(0)),
6563 reserved0(static_cast<uint32_t>(0)), CYCLE_CNT_OVF(static_cast<uint32_t>(0))
6564 {
6565 }
6566 CONSTEXPR pmovsset_r(uint32_t init) : word(init) {}
6567 CONSTEXPR void operator=(uint32_t value)
6568 {
6569 word = value;
6570 }
6571 void operator=(uint32_t value) volatile
6572 {
6573 word = value;
6574 }
6575 CONSTEXPR operator uint32_t()
6576 {
6577 return word;
6578 }
6579 operator uint32_t() volatile
6580 {
6581 return word;
6582 }
6583 pmovsset_r copy() volatile
6584 {
6585 return *this;
6586 }
6587#endif
6588 CONSTEXPR uint32_t get_EVENT_CNT_0_OVF() const
6589 {
6590 uint32_t value = static_cast<uint32_t>(EVENT_CNT_0_OVF);
6591 return value;
6592 }
6593#ifndef MODEL_REGS
6594 uint32_t get_EVENT_CNT_0_OVF() const volatile
6595 {
6596 uint32_t value = static_cast<uint32_t>(EVENT_CNT_0_OVF);
6597 return value;
6598 }
6599#endif
6600 CONSTEXPR pmovsset_r &set_EVENT_CNT_0_OVF(uint32_t value)
6601 {
6602 EVENT_CNT_0_OVF = ((1u << 1) - 1) & static_cast<uint32_t>(value);
6603 return *this;
6604 }
6605 CONSTEXPR uint32_t get_EVENT_CNT_1_OVF() const
6606 {
6607 uint32_t value = static_cast<uint32_t>(EVENT_CNT_1_OVF);
6608 return value;
6609 }
6610#ifndef MODEL_REGS
6611 uint32_t get_EVENT_CNT_1_OVF() const volatile
6612 {
6613 uint32_t value = static_cast<uint32_t>(EVENT_CNT_1_OVF);
6614 return value;
6615 }
6616#endif
6617 CONSTEXPR pmovsset_r &set_EVENT_CNT_1_OVF(uint32_t value)
6618 {
6619 EVENT_CNT_1_OVF = ((1u << 1) - 1) & static_cast<uint32_t>(value);
6620 return *this;
6621 }
6622 CONSTEXPR uint32_t get_EVENT_CNT_2_OVF() const
6623 {
6624 uint32_t value = static_cast<uint32_t>(EVENT_CNT_2_OVF);
6625 return value;
6626 }
6627#ifndef MODEL_REGS
6628 uint32_t get_EVENT_CNT_2_OVF() const volatile
6629 {
6630 uint32_t value = static_cast<uint32_t>(EVENT_CNT_2_OVF);
6631 return value;
6632 }
6633#endif
6634 CONSTEXPR pmovsset_r &set_EVENT_CNT_2_OVF(uint32_t value)
6635 {
6636 EVENT_CNT_2_OVF = ((1u << 1) - 1) & static_cast<uint32_t>(value);
6637 return *this;
6638 }
6639 CONSTEXPR uint32_t get_EVENT_CNT_3_OVF() const
6640 {
6641 uint32_t value = static_cast<uint32_t>(EVENT_CNT_3_OVF);
6642 return value;
6643 }
6644#ifndef MODEL_REGS
6645 uint32_t get_EVENT_CNT_3_OVF() const volatile
6646 {
6647 uint32_t value = static_cast<uint32_t>(EVENT_CNT_3_OVF);
6648 return value;
6649 }
6650#endif
6651 CONSTEXPR pmovsset_r &set_EVENT_CNT_3_OVF(uint32_t value)
6652 {
6653 EVENT_CNT_3_OVF = ((1u << 1) - 1) & static_cast<uint32_t>(value);
6654 return *this;
6655 }
6656 CONSTEXPR uint32_t get_CYCLE_CNT_OVF() const
6657 {
6658 uint32_t value = static_cast<uint32_t>(CYCLE_CNT_OVF);
6659 return value;
6660 }
6661#ifndef MODEL_REGS
6662 uint32_t get_CYCLE_CNT_OVF() const volatile
6663 {
6664 uint32_t value = static_cast<uint32_t>(CYCLE_CNT_OVF);
6665 return value;
6666 }
6667#endif
6668 CONSTEXPR pmovsset_r &set_CYCLE_CNT_OVF(uint32_t value)
6669 {
6670 CYCLE_CNT_OVF = ((1u << 1) - 1) & static_cast<uint32_t>(value);
6671 return *this;
6672 }
6673#endif //__cplusplus
6674};
6675
6676// pmovsclr_r - Overflow flag status clear register
6677struct pmovsclr_r
6678{
6679#ifdef __cplusplus
6680 private:
6681#endif //__cplusplus
6682#ifdef MODEL_REGS
6683 ::core::dt::uint_t<1> EVENT_CNT_0_OVF; // Event counter overflow clear bit for PMEVCNTR0
6684 ::core::dt::uint_t<1> EVENT_CNT_1_OVF; // Event counter overflow clear bit for PMEVCNTR1
6685 ::core::dt::uint_t<1> EVENT_CNT_2_OVF; // Event counter overflow clear bit for PMEVCNTR2
6686 ::core::dt::uint_t<1> EVENT_CNT_3_OVF; // Event counter overflow clear bit for PMEVCNTR3
6687 ::core::dt::uint_t<1> CYCLE_CNT_OVF; // PMCCNTR overflow clear bit
6688#else
6689 union
6690 {
6691 struct
6692 {
6693 uint32_t EVENT_CNT_0_OVF : 1; // Event counter overflow clear bit for PMEVCNTR0
6694 uint32_t EVENT_CNT_1_OVF : 1; // Event counter overflow clear bit for PMEVCNTR1
6695 uint32_t EVENT_CNT_2_OVF : 1; // Event counter overflow clear bit for PMEVCNTR2
6696 uint32_t EVENT_CNT_3_OVF : 1; // Event counter overflow clear bit for PMEVCNTR3
6697 uint32_t reserved0 : 27;
6698 uint32_t CYCLE_CNT_OVF : 1; // PMCCNTR overflow clear bit
6699 };
6700 uint32_t word;
6701 };
6702#endif
6703#ifdef __cplusplus
6704 public:
6705#ifdef MODEL_REGS
6706 CONSTEXPR pmovsclr_r() :
6707 EVENT_CNT_0_OVF(static_cast<uint32_t>(0)), EVENT_CNT_1_OVF(static_cast<uint32_t>(0)),
6708 EVENT_CNT_2_OVF(static_cast<uint32_t>(0)), EVENT_CNT_3_OVF(static_cast<uint32_t>(0)),
6709 CYCLE_CNT_OVF(static_cast<uint32_t>(0))
6710 {
6711 }
6712 CONSTEXPR pmovsclr_r(uint32_t value) :
6713 EVENT_CNT_0_OVF(value >> 0), EVENT_CNT_1_OVF(value >> 1), EVENT_CNT_2_OVF(value >> 2),
6714 EVENT_CNT_3_OVF(value >> 3), CYCLE_CNT_OVF(value >> 31)
6715 {
6716 }
6717 CONSTEXPR void operator=(uint32_t value)
6718 {
6719 EVENT_CNT_0_OVF = value >> 0;
6720 EVENT_CNT_1_OVF = value >> 1;
6721 EVENT_CNT_2_OVF = value >> 2;
6722 EVENT_CNT_3_OVF = value >> 3;
6723 CYCLE_CNT_OVF = value >> 31;
6724 }
6725 CONSTEXPR operator uint32_t() const
6726 {
6727 return (EVENT_CNT_0_OVF << 0) | (EVENT_CNT_1_OVF << 1) | (EVENT_CNT_2_OVF << 2) | (EVENT_CNT_3_OVF << 3) |
6728 (CYCLE_CNT_OVF << 31);
6729 }
6730 pmovsclr_r copy()
6731 {
6732 return *this;
6733 }
6734#else
6735 CONSTEXPR pmovsclr_r() :
6736 EVENT_CNT_0_OVF(static_cast<uint32_t>(0)), EVENT_CNT_1_OVF(static_cast<uint32_t>(0)),
6737 EVENT_CNT_2_OVF(static_cast<uint32_t>(0)), EVENT_CNT_3_OVF(static_cast<uint32_t>(0)),
6738 reserved0(static_cast<uint32_t>(0)), CYCLE_CNT_OVF(static_cast<uint32_t>(0))
6739 {
6740 }
6741 CONSTEXPR pmovsclr_r(uint32_t init) : word(init) {}
6742 CONSTEXPR void operator=(uint32_t value)
6743 {
6744 word = value;
6745 }
6746 void operator=(uint32_t value) volatile
6747 {
6748 word = value;
6749 }
6750 CONSTEXPR operator uint32_t()
6751 {
6752 return word;
6753 }
6754 operator uint32_t() volatile
6755 {
6756 return word;
6757 }
6758 pmovsclr_r copy() volatile
6759 {
6760 return *this;
6761 }
6762#endif
6763 CONSTEXPR uint32_t get_EVENT_CNT_0_OVF() const
6764 {
6765 uint32_t value = static_cast<uint32_t>(EVENT_CNT_0_OVF);
6766 return value;
6767 }
6768#ifndef MODEL_REGS
6769 uint32_t get_EVENT_CNT_0_OVF() const volatile
6770 {
6771 uint32_t value = static_cast<uint32_t>(EVENT_CNT_0_OVF);
6772 return value;
6773 }
6774#endif
6775 CONSTEXPR pmovsclr_r &set_EVENT_CNT_0_OVF(uint32_t value)
6776 {
6777 EVENT_CNT_0_OVF = ((1u << 1) - 1) & static_cast<uint32_t>(value);
6778 return *this;
6779 }
6780 CONSTEXPR uint32_t get_EVENT_CNT_1_OVF() const
6781 {
6782 uint32_t value = static_cast<uint32_t>(EVENT_CNT_1_OVF);
6783 return value;
6784 }
6785#ifndef MODEL_REGS
6786 uint32_t get_EVENT_CNT_1_OVF() const volatile
6787 {
6788 uint32_t value = static_cast<uint32_t>(EVENT_CNT_1_OVF);
6789 return value;
6790 }
6791#endif
6792 CONSTEXPR pmovsclr_r &set_EVENT_CNT_1_OVF(uint32_t value)
6793 {
6794 EVENT_CNT_1_OVF = ((1u << 1) - 1) & static_cast<uint32_t>(value);
6795 return *this;
6796 }
6797 CONSTEXPR uint32_t get_EVENT_CNT_2_OVF() const
6798 {
6799 uint32_t value = static_cast<uint32_t>(EVENT_CNT_2_OVF);
6800 return value;
6801 }
6802#ifndef MODEL_REGS
6803 uint32_t get_EVENT_CNT_2_OVF() const volatile
6804 {
6805 uint32_t value = static_cast<uint32_t>(EVENT_CNT_2_OVF);
6806 return value;
6807 }
6808#endif
6809 CONSTEXPR pmovsclr_r &set_EVENT_CNT_2_OVF(uint32_t value)
6810 {
6811 EVENT_CNT_2_OVF = ((1u << 1) - 1) & static_cast<uint32_t>(value);
6812 return *this;
6813 }
6814 CONSTEXPR uint32_t get_EVENT_CNT_3_OVF() const
6815 {
6816 uint32_t value = static_cast<uint32_t>(EVENT_CNT_3_OVF);
6817 return value;
6818 }
6819#ifndef MODEL_REGS
6820 uint32_t get_EVENT_CNT_3_OVF() const volatile
6821 {
6822 uint32_t value = static_cast<uint32_t>(EVENT_CNT_3_OVF);
6823 return value;
6824 }
6825#endif
6826 CONSTEXPR pmovsclr_r &set_EVENT_CNT_3_OVF(uint32_t value)
6827 {
6828 EVENT_CNT_3_OVF = ((1u << 1) - 1) & static_cast<uint32_t>(value);
6829 return *this;
6830 }
6831 CONSTEXPR uint32_t get_CYCLE_CNT_OVF() const
6832 {
6833 uint32_t value = static_cast<uint32_t>(CYCLE_CNT_OVF);
6834 return value;
6835 }
6836#ifndef MODEL_REGS
6837 uint32_t get_CYCLE_CNT_OVF() const volatile
6838 {
6839 uint32_t value = static_cast<uint32_t>(CYCLE_CNT_OVF);
6840 return value;
6841 }
6842#endif
6843 CONSTEXPR pmovsclr_r &set_CYCLE_CNT_OVF(uint32_t value)
6844 {
6845 CYCLE_CNT_OVF = ((1u << 1) - 1) & static_cast<uint32_t>(value);
6846 return *this;
6847 }
6848#endif //__cplusplus
6849};
6850
6851// pmintset_r - Interrupt enable set register
6852struct pmintset_r
6853{
6854#ifdef __cplusplus
6855 private:
6856#endif //__cplusplus
6857#ifdef MODEL_REGS
6858 ::core::dt::uint_t<1> EVENT_CNT_0_INT; // Event counter overflow interrupt request enable bit for PMEVCNTR0
6859 ::core::dt::uint_t<1> EVENT_CNT_1_INT; // Event counter overflow interrupt request enable bit for PMEVCNTR1
6860 ::core::dt::uint_t<1> EVENT_CNT_2_INT; // Event counter overflow interrupt request enable bit for PMEVCNTR2
6861 ::core::dt::uint_t<1> EVENT_CNT_3_INT; // Event counter overflow interrupt request enable bit for PMEVCNTR3
6862 ::core::dt::uint_t<1> CYCLE_CNT_INT; // PMCCNTR overflow interrupt request enable bit
6863#else
6864 union
6865 {
6866 struct
6867 {
6868 uint32_t EVENT_CNT_0_INT : 1; // Event counter overflow interrupt request enable bit for PMEVCNTR0
6869 uint32_t EVENT_CNT_1_INT : 1; // Event counter overflow interrupt request enable bit for PMEVCNTR1
6870 uint32_t EVENT_CNT_2_INT : 1; // Event counter overflow interrupt request enable bit for PMEVCNTR2
6871 uint32_t EVENT_CNT_3_INT : 1; // Event counter overflow interrupt request enable bit for PMEVCNTR3
6872 uint32_t reserved0 : 27;
6873 uint32_t CYCLE_CNT_INT : 1; // PMCCNTR overflow interrupt request enable bit
6874 };
6875 uint32_t word;
6876 };
6877#endif
6878#ifdef __cplusplus
6879 public:
6880#ifdef MODEL_REGS
6881 CONSTEXPR pmintset_r() :
6882 EVENT_CNT_0_INT(static_cast<uint32_t>(0)), EVENT_CNT_1_INT(static_cast<uint32_t>(0)),
6883 EVENT_CNT_2_INT(static_cast<uint32_t>(0)), EVENT_CNT_3_INT(static_cast<uint32_t>(0)),
6884 CYCLE_CNT_INT(static_cast<uint32_t>(0))
6885 {
6886 }
6887 CONSTEXPR pmintset_r(uint32_t value) :
6888 EVENT_CNT_0_INT(value >> 0), EVENT_CNT_1_INT(value >> 1), EVENT_CNT_2_INT(value >> 2),
6889 EVENT_CNT_3_INT(value >> 3), CYCLE_CNT_INT(value >> 31)
6890 {
6891 }
6892 CONSTEXPR void operator=(uint32_t value)
6893 {
6894 EVENT_CNT_0_INT = value >> 0;
6895 EVENT_CNT_1_INT = value >> 1;
6896 EVENT_CNT_2_INT = value >> 2;
6897 EVENT_CNT_3_INT = value >> 3;
6898 CYCLE_CNT_INT = value >> 31;
6899 }
6900 CONSTEXPR operator uint32_t() const
6901 {
6902 return (EVENT_CNT_0_INT << 0) | (EVENT_CNT_1_INT << 1) | (EVENT_CNT_2_INT << 2) | (EVENT_CNT_3_INT << 3) |
6903 (CYCLE_CNT_INT << 31);
6904 }
6905 pmintset_r copy()
6906 {
6907 return *this;
6908 }
6909#else
6910 CONSTEXPR pmintset_r() :
6911 EVENT_CNT_0_INT(static_cast<uint32_t>(0)), EVENT_CNT_1_INT(static_cast<uint32_t>(0)),
6912 EVENT_CNT_2_INT(static_cast<uint32_t>(0)), EVENT_CNT_3_INT(static_cast<uint32_t>(0)),
6913 reserved0(static_cast<uint32_t>(0)), CYCLE_CNT_INT(static_cast<uint32_t>(0))
6914 {
6915 }
6916 CONSTEXPR pmintset_r(uint32_t init) : word(init) {}
6917 CONSTEXPR void operator=(uint32_t value)
6918 {
6919 word = value;
6920 }
6921 void operator=(uint32_t value) volatile
6922 {
6923 word = value;
6924 }
6925 CONSTEXPR operator uint32_t()
6926 {
6927 return word;
6928 }
6929 operator uint32_t() volatile
6930 {
6931 return word;
6932 }
6933 pmintset_r copy() volatile
6934 {
6935 return *this;
6936 }
6937#endif
6938 CONSTEXPR uint32_t get_EVENT_CNT_0_INT() const
6939 {
6940 uint32_t value = static_cast<uint32_t>(EVENT_CNT_0_INT);
6941 return value;
6942 }
6943#ifndef MODEL_REGS
6944 uint32_t get_EVENT_CNT_0_INT() const volatile
6945 {
6946 uint32_t value = static_cast<uint32_t>(EVENT_CNT_0_INT);
6947 return value;
6948 }
6949#endif
6950 CONSTEXPR pmintset_r &set_EVENT_CNT_0_INT(uint32_t value)
6951 {
6952 EVENT_CNT_0_INT = ((1u << 1) - 1) & static_cast<uint32_t>(value);
6953 return *this;
6954 }
6955 CONSTEXPR uint32_t get_EVENT_CNT_1_INT() const
6956 {
6957 uint32_t value = static_cast<uint32_t>(EVENT_CNT_1_INT);
6958 return value;
6959 }
6960#ifndef MODEL_REGS
6961 uint32_t get_EVENT_CNT_1_INT() const volatile
6962 {
6963 uint32_t value = static_cast<uint32_t>(EVENT_CNT_1_INT);
6964 return value;
6965 }
6966#endif
6967 CONSTEXPR pmintset_r &set_EVENT_CNT_1_INT(uint32_t value)
6968 {
6969 EVENT_CNT_1_INT = ((1u << 1) - 1) & static_cast<uint32_t>(value);
6970 return *this;
6971 }
6972 CONSTEXPR uint32_t get_EVENT_CNT_2_INT() const
6973 {
6974 uint32_t value = static_cast<uint32_t>(EVENT_CNT_2_INT);
6975 return value;
6976 }
6977#ifndef MODEL_REGS
6978 uint32_t get_EVENT_CNT_2_INT() const volatile
6979 {
6980 uint32_t value = static_cast<uint32_t>(EVENT_CNT_2_INT);
6981 return value;
6982 }
6983#endif
6984 CONSTEXPR pmintset_r &set_EVENT_CNT_2_INT(uint32_t value)
6985 {
6986 EVENT_CNT_2_INT = ((1u << 1) - 1) & static_cast<uint32_t>(value);
6987 return *this;
6988 }
6989 CONSTEXPR uint32_t get_EVENT_CNT_3_INT() const
6990 {
6991 uint32_t value = static_cast<uint32_t>(EVENT_CNT_3_INT);
6992 return value;
6993 }
6994#ifndef MODEL_REGS
6995 uint32_t get_EVENT_CNT_3_INT() const volatile
6996 {
6997 uint32_t value = static_cast<uint32_t>(EVENT_CNT_3_INT);
6998 return value;
6999 }
7000#endif
7001 CONSTEXPR pmintset_r &set_EVENT_CNT_3_INT(uint32_t value)
7002 {
7003 EVENT_CNT_3_INT = ((1u << 1) - 1) & static_cast<uint32_t>(value);
7004 return *this;
7005 }
7006 CONSTEXPR uint32_t get_CYCLE_CNT_INT() const
7007 {
7008 uint32_t value = static_cast<uint32_t>(CYCLE_CNT_INT);
7009 return value;
7010 }
7011#ifndef MODEL_REGS
7012 uint32_t get_CYCLE_CNT_INT() const volatile
7013 {
7014 uint32_t value = static_cast<uint32_t>(CYCLE_CNT_INT);
7015 return value;
7016 }
7017#endif
7018 CONSTEXPR pmintset_r &set_CYCLE_CNT_INT(uint32_t value)
7019 {
7020 CYCLE_CNT_INT = ((1u << 1) - 1) & static_cast<uint32_t>(value);
7021 return *this;
7022 }
7023#endif //__cplusplus
7024};
7025
7026// pmintclr_r - Interrupt enable clear register
7027struct pmintclr_r
7028{
7029#ifdef __cplusplus
7030 private:
7031#endif //__cplusplus
7032#ifdef MODEL_REGS
7033 ::core::dt::uint_t<1> EVENT_CNT_0_INT; // Event counter overflow interrupt request disable bit for PMEVCNTR0
7034 ::core::dt::uint_t<1> EVENT_CNT_1_INT; // Event counter overflow interrupt request disable bit for PMEVCNTR1
7035 ::core::dt::uint_t<1> EVENT_CNT_2_INT; // Event counter overflow interrupt request disable bit for PMEVCNTR2
7036 ::core::dt::uint_t<1> EVENT_CNT_3_INT; // Event counter overflow interrupt request disable bit for PMEVCNTR3
7037 ::core::dt::uint_t<1> CYCLE_CNT_INT; // PMCCNTR overflow interrupt request disable bit
7038#else
7039 union
7040 {
7041 struct
7042 {
7043 uint32_t EVENT_CNT_0_INT : 1; // Event counter overflow interrupt request disable bit for PMEVCNTR0
7044 uint32_t EVENT_CNT_1_INT : 1; // Event counter overflow interrupt request disable bit for PMEVCNTR1
7045 uint32_t EVENT_CNT_2_INT : 1; // Event counter overflow interrupt request disable bit for PMEVCNTR2
7046 uint32_t EVENT_CNT_3_INT : 1; // Event counter overflow interrupt request disable bit for PMEVCNTR3
7047 uint32_t reserved0 : 27;
7048 uint32_t CYCLE_CNT_INT : 1; // PMCCNTR overflow interrupt request disable bit
7049 };
7050 uint32_t word;
7051 };
7052#endif
7053#ifdef __cplusplus
7054 public:
7055#ifdef MODEL_REGS
7056 CONSTEXPR pmintclr_r() :
7057 EVENT_CNT_0_INT(static_cast<uint32_t>(0)), EVENT_CNT_1_INT(static_cast<uint32_t>(0)),
7058 EVENT_CNT_2_INT(static_cast<uint32_t>(0)), EVENT_CNT_3_INT(static_cast<uint32_t>(0)),
7059 CYCLE_CNT_INT(static_cast<uint32_t>(0))
7060 {
7061 }
7062 CONSTEXPR pmintclr_r(uint32_t value) :
7063 EVENT_CNT_0_INT(value >> 0), EVENT_CNT_1_INT(value >> 1), EVENT_CNT_2_INT(value >> 2),
7064 EVENT_CNT_3_INT(value >> 3), CYCLE_CNT_INT(value >> 31)
7065 {
7066 }
7067 CONSTEXPR void operator=(uint32_t value)
7068 {
7069 EVENT_CNT_0_INT = value >> 0;
7070 EVENT_CNT_1_INT = value >> 1;
7071 EVENT_CNT_2_INT = value >> 2;
7072 EVENT_CNT_3_INT = value >> 3;
7073 CYCLE_CNT_INT = value >> 31;
7074 }
7075 CONSTEXPR operator uint32_t() const
7076 {
7077 return (EVENT_CNT_0_INT << 0) | (EVENT_CNT_1_INT << 1) | (EVENT_CNT_2_INT << 2) | (EVENT_CNT_3_INT << 3) |
7078 (CYCLE_CNT_INT << 31);
7079 }
7080 pmintclr_r copy()
7081 {
7082 return *this;
7083 }
7084#else
7085 CONSTEXPR pmintclr_r() :
7086 EVENT_CNT_0_INT(static_cast<uint32_t>(0)), EVENT_CNT_1_INT(static_cast<uint32_t>(0)),
7087 EVENT_CNT_2_INT(static_cast<uint32_t>(0)), EVENT_CNT_3_INT(static_cast<uint32_t>(0)),
7088 reserved0(static_cast<uint32_t>(0)), CYCLE_CNT_INT(static_cast<uint32_t>(0))
7089 {
7090 }
7091 CONSTEXPR pmintclr_r(uint32_t init) : word(init) {}
7092 CONSTEXPR void operator=(uint32_t value)
7093 {
7094 word = value;
7095 }
7096 void operator=(uint32_t value) volatile
7097 {
7098 word = value;
7099 }
7100 CONSTEXPR operator uint32_t()
7101 {
7102 return word;
7103 }
7104 operator uint32_t() volatile
7105 {
7106 return word;
7107 }
7108 pmintclr_r copy() volatile
7109 {
7110 return *this;
7111 }
7112#endif
7113 CONSTEXPR uint32_t get_EVENT_CNT_0_INT() const
7114 {
7115 uint32_t value = static_cast<uint32_t>(EVENT_CNT_0_INT);
7116 return value;
7117 }
7118#ifndef MODEL_REGS
7119 uint32_t get_EVENT_CNT_0_INT() const volatile
7120 {
7121 uint32_t value = static_cast<uint32_t>(EVENT_CNT_0_INT);
7122 return value;
7123 }
7124#endif
7125 CONSTEXPR pmintclr_r &set_EVENT_CNT_0_INT(uint32_t value)
7126 {
7127 EVENT_CNT_0_INT = ((1u << 1) - 1) & static_cast<uint32_t>(value);
7128 return *this;
7129 }
7130 CONSTEXPR uint32_t get_EVENT_CNT_1_INT() const
7131 {
7132 uint32_t value = static_cast<uint32_t>(EVENT_CNT_1_INT);
7133 return value;
7134 }
7135#ifndef MODEL_REGS
7136 uint32_t get_EVENT_CNT_1_INT() const volatile
7137 {
7138 uint32_t value = static_cast<uint32_t>(EVENT_CNT_1_INT);
7139 return value;
7140 }
7141#endif
7142 CONSTEXPR pmintclr_r &set_EVENT_CNT_1_INT(uint32_t value)
7143 {
7144 EVENT_CNT_1_INT = ((1u << 1) - 1) & static_cast<uint32_t>(value);
7145 return *this;
7146 }
7147 CONSTEXPR uint32_t get_EVENT_CNT_2_INT() const
7148 {
7149 uint32_t value = static_cast<uint32_t>(EVENT_CNT_2_INT);
7150 return value;
7151 }
7152#ifndef MODEL_REGS
7153 uint32_t get_EVENT_CNT_2_INT() const volatile
7154 {
7155 uint32_t value = static_cast<uint32_t>(EVENT_CNT_2_INT);
7156 return value;
7157 }
7158#endif
7159 CONSTEXPR pmintclr_r &set_EVENT_CNT_2_INT(uint32_t value)
7160 {
7161 EVENT_CNT_2_INT = ((1u << 1) - 1) & static_cast<uint32_t>(value);
7162 return *this;
7163 }
7164 CONSTEXPR uint32_t get_EVENT_CNT_3_INT() const
7165 {
7166 uint32_t value = static_cast<uint32_t>(EVENT_CNT_3_INT);
7167 return value;
7168 }
7169#ifndef MODEL_REGS
7170 uint32_t get_EVENT_CNT_3_INT() const volatile
7171 {
7172 uint32_t value = static_cast<uint32_t>(EVENT_CNT_3_INT);
7173 return value;
7174 }
7175#endif
7176 CONSTEXPR pmintclr_r &set_EVENT_CNT_3_INT(uint32_t value)
7177 {
7178 EVENT_CNT_3_INT = ((1u << 1) - 1) & static_cast<uint32_t>(value);
7179 return *this;
7180 }
7181 CONSTEXPR uint32_t get_CYCLE_CNT_INT() const
7182 {
7183 uint32_t value = static_cast<uint32_t>(CYCLE_CNT_INT);
7184 return value;
7185 }
7186#ifndef MODEL_REGS
7187 uint32_t get_CYCLE_CNT_INT() const volatile
7188 {
7189 uint32_t value = static_cast<uint32_t>(CYCLE_CNT_INT);
7190 return value;
7191 }
7192#endif
7193 CONSTEXPR pmintclr_r &set_CYCLE_CNT_INT(uint32_t value)
7194 {
7195 CYCLE_CNT_INT = ((1u << 1) - 1) & static_cast<uint32_t>(value);
7196 return *this;
7197 }
7198#endif //__cplusplus
7199};
7200
7201// pmccntr_lo_r - Performance monitor cycle count low register
7202struct pmccntr_lo_r
7203{
7204#ifdef __cplusplus
7205 private:
7206#endif //__cplusplus
7207#ifdef MODEL_REGS
7208 ::core::dt::uint_t<32> CYCLE_CNT_LO; // Cycle count low
7209#else
7210 union
7211 {
7212 uint32_t CYCLE_CNT_LO; // Cycle count low
7213 uint32_t word;
7214 };
7215#endif
7216#ifdef __cplusplus
7217 public:
7218#ifdef MODEL_REGS
7219 CONSTEXPR pmccntr_lo_r() : CYCLE_CNT_LO(static_cast<uint32_t>(0)) {}
7220 CONSTEXPR pmccntr_lo_r(uint32_t value) : CYCLE_CNT_LO(value >> 0) {}
7221 CONSTEXPR void operator=(uint32_t value)
7222 {
7223 CYCLE_CNT_LO = value >> 0;
7224 }
7225 CONSTEXPR operator uint32_t() const
7226 {
7227 return (CYCLE_CNT_LO << 0);
7228 }
7229 pmccntr_lo_r copy()
7230 {
7231 return *this;
7232 }
7233#else
7234 CONSTEXPR pmccntr_lo_r() : CYCLE_CNT_LO(static_cast<uint32_t>(0)) {}
7235 CONSTEXPR pmccntr_lo_r(uint32_t init) : word(init) {}
7236 CONSTEXPR void operator=(uint32_t value)
7237 {
7238 word = value;
7239 }
7240 void operator=(uint32_t value) volatile
7241 {
7242 word = value;
7243 }
7244 CONSTEXPR operator uint32_t()
7245 {
7246 return word;
7247 }
7248 operator uint32_t() volatile
7249 {
7250 return word;
7251 }
7252 pmccntr_lo_r copy() volatile
7253 {
7254 return *this;
7255 }
7256#endif
7257 CONSTEXPR uint32_t get_CYCLE_CNT_LO() const
7258 {
7259 uint32_t value = static_cast<uint32_t>(CYCLE_CNT_LO);
7260 return value;
7261 }
7262#ifndef MODEL_REGS
7263 uint32_t get_CYCLE_CNT_LO() const volatile
7264 {
7265 uint32_t value = static_cast<uint32_t>(CYCLE_CNT_LO);
7266 return value;
7267 }
7268#endif
7269 CONSTEXPR pmccntr_lo_r &set_CYCLE_CNT_LO(uint32_t value)
7270 {
7271 CYCLE_CNT_LO = static_cast<uint32_t>(value);
7272 return *this;
7273 }
7274#endif //__cplusplus
7275};
7276
7277// pmccntr_hi_r - Performance monitor cycle count high register
7278struct pmccntr_hi_r
7279{
7280#ifdef __cplusplus
7281 private:
7282#endif //__cplusplus
7283#ifdef MODEL_REGS
7284 ::core::dt::uint_t<16> CYCLE_CNT_HI; // Cycle count high
7285#else
7286 union
7287 {
7288 struct
7289 {
7290 uint32_t CYCLE_CNT_HI : 16; // Cycle count high
7291 uint32_t reserved0 : 16;
7292 };
7293 uint32_t word;
7294 };
7295#endif
7296#ifdef __cplusplus
7297 public:
7298#ifdef MODEL_REGS
7299 CONSTEXPR pmccntr_hi_r() : CYCLE_CNT_HI(static_cast<uint32_t>(0)) {}
7300 CONSTEXPR pmccntr_hi_r(uint32_t value) : CYCLE_CNT_HI(value >> 0) {}
7301 CONSTEXPR void operator=(uint32_t value)
7302 {
7303 CYCLE_CNT_HI = value >> 0;
7304 }
7305 CONSTEXPR operator uint32_t() const
7306 {
7307 return (CYCLE_CNT_HI << 0);
7308 }
7309 pmccntr_hi_r copy()
7310 {
7311 return *this;
7312 }
7313#else
7314 CONSTEXPR pmccntr_hi_r() : CYCLE_CNT_HI(static_cast<uint32_t>(0)), reserved0(static_cast<uint32_t>(0)) {}
7315 CONSTEXPR pmccntr_hi_r(uint32_t init) : word(init) {}
7316 CONSTEXPR void operator=(uint32_t value)
7317 {
7318 word = value;
7319 }
7320 void operator=(uint32_t value) volatile
7321 {
7322 word = value;
7323 }
7324 CONSTEXPR operator uint32_t()
7325 {
7326 return word;
7327 }
7328 operator uint32_t() volatile
7329 {
7330 return word;
7331 }
7332 pmccntr_hi_r copy() volatile
7333 {
7334 return *this;
7335 }
7336#endif
7337 CONSTEXPR uint32_t get_CYCLE_CNT_HI() const
7338 {
7339 uint32_t value = static_cast<uint32_t>(CYCLE_CNT_HI);
7340 return value;
7341 }
7342#ifndef MODEL_REGS
7343 uint32_t get_CYCLE_CNT_HI() const volatile
7344 {
7345 uint32_t value = static_cast<uint32_t>(CYCLE_CNT_HI);
7346 return value;
7347 }
7348#endif
7349 CONSTEXPR pmccntr_hi_r &set_CYCLE_CNT_HI(uint32_t value)
7350 {
7351 CYCLE_CNT_HI = ((1u << 16) - 1) & static_cast<uint32_t>(value);
7352 return *this;
7353 }
7354#endif //__cplusplus
7355};
7356
7357// pmccntr_cfg_r - Set start/stop event on the cycle counter
7358struct pmccntr_cfg_r
7359{
7360#ifdef __cplusplus
7361 private:
7362#endif //__cplusplus
7363#ifdef MODEL_REGS
7364 ::core::dt::uint_t<10> CYCLE_CNT_CFG_START; // Cycle counter start event
7365 ::core::dt::uint_t<10> CYCLE_CNT_CFG_STOP; // Cycle counter stop event
7366#else
7367 union
7368 {
7369 struct
7370 {
7371 uint32_t CYCLE_CNT_CFG_START : 10; // Cycle counter start event
7372 uint32_t reserved0 : 6;
7373 uint32_t CYCLE_CNT_CFG_STOP : 10; // Cycle counter stop event
7374 uint32_t reserved1 : 6;
7375 };
7376 uint32_t word;
7377 };
7378#endif
7379#ifdef __cplusplus
7380 public:
7381#ifdef MODEL_REGS
7382 CONSTEXPR pmccntr_cfg_r() :
7383 CYCLE_CNT_CFG_START(static_cast<uint32_t>(0)), CYCLE_CNT_CFG_STOP(static_cast<uint32_t>(0))
7384 {
7385 }
7386 CONSTEXPR pmccntr_cfg_r(uint32_t value) : CYCLE_CNT_CFG_START(value >> 0), CYCLE_CNT_CFG_STOP(value >> 16) {}
7387 CONSTEXPR void operator=(uint32_t value)
7388 {
7389 CYCLE_CNT_CFG_START = value >> 0;
7390 CYCLE_CNT_CFG_STOP = value >> 16;
7391 }
7392 CONSTEXPR operator uint32_t() const
7393 {
7394 return (CYCLE_CNT_CFG_START << 0) | (CYCLE_CNT_CFG_STOP << 16);
7395 }
7396 pmccntr_cfg_r copy()
7397 {
7398 return *this;
7399 }
7400#else
7401 CONSTEXPR pmccntr_cfg_r() :
7402 CYCLE_CNT_CFG_START(static_cast<uint32_t>(0)), reserved0(static_cast<uint32_t>(0)),
7403 CYCLE_CNT_CFG_STOP(static_cast<uint32_t>(0)), reserved1(static_cast<uint32_t>(0))
7404 {
7405 }
7406 CONSTEXPR pmccntr_cfg_r(uint32_t init) : word(init) {}
7407 CONSTEXPR void operator=(uint32_t value)
7408 {
7409 word = value;
7410 }
7411 void operator=(uint32_t value) volatile
7412 {
7413 word = value;
7414 }
7415 CONSTEXPR operator uint32_t()
7416 {
7417 return word;
7418 }
7419 operator uint32_t() volatile
7420 {
7421 return word;
7422 }
7423 pmccntr_cfg_r copy() volatile
7424 {
7425 return *this;
7426 }
7427#endif
7428 CONSTEXPR uint32_t get_CYCLE_CNT_CFG_START() const
7429 {
7430 uint32_t value = static_cast<uint32_t>(CYCLE_CNT_CFG_START);
7431 return value;
7432 }
7433#ifndef MODEL_REGS
7434 uint32_t get_CYCLE_CNT_CFG_START() const volatile
7435 {
7436 uint32_t value = static_cast<uint32_t>(CYCLE_CNT_CFG_START);
7437 return value;
7438 }
7439#endif
7440 CONSTEXPR pmccntr_cfg_r &set_CYCLE_CNT_CFG_START(uint32_t value)
7441 {
7442 CYCLE_CNT_CFG_START = ((1u << 10) - 1) & static_cast<uint32_t>(value);
7443 return *this;
7444 }
7445 CONSTEXPR uint32_t get_CYCLE_CNT_CFG_STOP() const
7446 {
7447 uint32_t value = static_cast<uint32_t>(CYCLE_CNT_CFG_STOP);
7448 return value;
7449 }
7450#ifndef MODEL_REGS
7451 uint32_t get_CYCLE_CNT_CFG_STOP() const volatile
7452 {
7453 uint32_t value = static_cast<uint32_t>(CYCLE_CNT_CFG_STOP);
7454 return value;
7455 }
7456#endif
7457 CONSTEXPR pmccntr_cfg_r &set_CYCLE_CNT_CFG_STOP(uint32_t value)
7458 {
7459 CYCLE_CNT_CFG_STOP = ((1u << 10) - 1) & static_cast<uint32_t>(value);
7460 return *this;
7461 }
7462#endif //__cplusplus
7463};
7464
7465// pmcaxi_chan_r - Set which AXI channel to monitor in PMU
7466struct pmcaxi_chan_r
7467{
7468#ifdef __cplusplus
7469 private:
7470#endif //__cplusplus
7471#ifdef MODEL_REGS
7472 ::core::dt::uint_t<4> AXI_CHAN; // Channel number to monitor (Read: 0=Cmd 1=IFM 2=Weights 3=Scale+Bias 4=Mem2Mem;
7473 // Write: 8=OFM 9=Mem2Mem)
7474 ::core::dt::uint_t<1> RW; // 0 for read, 1 for write
7475 ::core::dt::uint_t<2>
7476 AXI_CNT; // AXI counter to monitor (0=AXI0 counter0, 1=AXI0 counter1, 2=AXI1 counter 2, 3=AXI counter3)
7477#else
7478 union
7479 {
7480 struct
7481 {
7482 uint32_t AXI_CHAN : 4; // Channel number to monitor (Read: 0=Cmd 1=IFM 2=Weights 3=Scale+Bias 4=Mem2Mem;
7483 // Write: 8=OFM 9=Mem2Mem)
7484 uint32_t reserved0 : 3;
7485 uint32_t RW : 1; // 0 for read, 1 for write
7486 uint32_t AXI_CNT : 2; // AXI counter to monitor (0=AXI0 counter0, 1=AXI0 counter1, 2=AXI1 counter 2, 3=AXI
7487 // counter3)
7488 uint32_t reserved1 : 22;
7489 };
7490 uint32_t word;
7491 };
7492#endif
7493#ifdef __cplusplus
7494 public:
7495#ifdef MODEL_REGS
7496 CONSTEXPR pmcaxi_chan_r() :
7497 AXI_CHAN(static_cast<uint32_t>(0)), RW(static_cast<uint32_t>(0)), AXI_CNT(static_cast<uint32_t>(0))
7498 {
7499 }
7500 CONSTEXPR pmcaxi_chan_r(uint32_t value) : AXI_CHAN(value >> 0), RW(value >> 7), AXI_CNT(value >> 8) {}
7501 CONSTEXPR void operator=(uint32_t value)
7502 {
7503 AXI_CHAN = value >> 0;
7504 RW = value >> 7;
7505 AXI_CNT = value >> 8;
7506 }
7507 CONSTEXPR operator uint32_t() const
7508 {
7509 return (AXI_CHAN << 0) | (RW << 7) | (AXI_CNT << 8);
7510 }
7511 pmcaxi_chan_r copy()
7512 {
7513 return *this;
7514 }
7515#else
7516 CONSTEXPR pmcaxi_chan_r() :
7517 AXI_CHAN(static_cast<uint32_t>(0)), reserved0(static_cast<uint32_t>(0)), RW(static_cast<uint32_t>(0)),
7518 AXI_CNT(static_cast<uint32_t>(0)), reserved1(static_cast<uint32_t>(0))
7519 {
7520 }
7521 CONSTEXPR pmcaxi_chan_r(uint32_t init) : word(init) {}
7522 CONSTEXPR void operator=(uint32_t value)
7523 {
7524 word = value;
7525 }
7526 void operator=(uint32_t value) volatile
7527 {
7528 word = value;
7529 }
7530 CONSTEXPR operator uint32_t()
7531 {
7532 return word;
7533 }
7534 operator uint32_t() volatile
7535 {
7536 return word;
7537 }
7538 pmcaxi_chan_r copy() volatile
7539 {
7540 return *this;
7541 }
7542#endif
7543 CONSTEXPR uint32_t get_AXI_CHAN() const
7544 {
7545 uint32_t value = static_cast<uint32_t>(AXI_CHAN);
7546 return value;
7547 }
7548#ifndef MODEL_REGS
7549 uint32_t get_AXI_CHAN() const volatile
7550 {
7551 uint32_t value = static_cast<uint32_t>(AXI_CHAN);
7552 return value;
7553 }
7554#endif
7555 CONSTEXPR pmcaxi_chan_r &set_AXI_CHAN(uint32_t value)
7556 {
7557 AXI_CHAN = ((1u << 4) - 1) & static_cast<uint32_t>(value);
7558 return *this;
7559 }
7560 CONSTEXPR uint32_t get_RW() const
7561 {
7562 uint32_t value = static_cast<uint32_t>(RW);
7563 return value;
7564 }
7565#ifndef MODEL_REGS
7566 uint32_t get_RW() const volatile
7567 {
7568 uint32_t value = static_cast<uint32_t>(RW);
7569 return value;
7570 }
7571#endif
7572 CONSTEXPR pmcaxi_chan_r &set_RW(uint32_t value)
7573 {
7574 RW = ((1u << 1) - 1) & static_cast<uint32_t>(value);
7575 return *this;
7576 }
7577 CONSTEXPR uint32_t get_AXI_CNT() const
7578 {
7579 uint32_t value = static_cast<uint32_t>(AXI_CNT);
7580 return value;
7581 }
7582#ifndef MODEL_REGS
7583 uint32_t get_AXI_CNT() const volatile
7584 {
7585 uint32_t value = static_cast<uint32_t>(AXI_CNT);
7586 return value;
7587 }
7588#endif
7589 CONSTEXPR pmcaxi_chan_r &set_AXI_CNT(uint32_t value)
7590 {
7591 AXI_CNT = ((1u << 2) - 1) & static_cast<uint32_t>(value);
7592 return *this;
7593 }
7594#endif //__cplusplus
7595};
7596
7597// pmevtyper0_r - Performance monitor event type register 0
7598struct pmevtyper0_r
7599{
7600#ifdef __cplusplus
7601 private:
7602#endif //__cplusplus
7603#ifdef MODEL_REGS
7604 ::core::dt::uint_t<10> EV_TYPE; // Event Type
7605#else
7606 union
7607 {
7608 struct
7609 {
7610 uint32_t EV_TYPE : 10; // Event Type
7611 uint32_t reserved0 : 22;
7612 };
7613 uint32_t word;
7614 };
7615#endif
7616#ifdef __cplusplus
7617 public:
7618#ifdef MODEL_REGS
7619 CONSTEXPR pmevtyper0_r() : EV_TYPE(static_cast<uint32_t>(0)) {}
7620 CONSTEXPR pmevtyper0_r(uint32_t value) : EV_TYPE(value >> 0) {}
7621 CONSTEXPR void operator=(uint32_t value)
7622 {
7623 EV_TYPE = value >> 0;
7624 }
7625 CONSTEXPR operator uint32_t() const
7626 {
7627 return (EV_TYPE << 0);
7628 }
7629 pmevtyper0_r copy()
7630 {
7631 return *this;
7632 }
7633#else
7634 CONSTEXPR pmevtyper0_r() : EV_TYPE(static_cast<uint32_t>(0)), reserved0(static_cast<uint32_t>(0)) {}
7635 CONSTEXPR pmevtyper0_r(uint32_t init) : word(init) {}
7636 CONSTEXPR void operator=(uint32_t value)
7637 {
7638 word = value;
7639 }
7640 void operator=(uint32_t value) volatile
7641 {
7642 word = value;
7643 }
7644 CONSTEXPR operator uint32_t()
7645 {
7646 return word;
7647 }
7648 operator uint32_t() volatile
7649 {
7650 return word;
7651 }
7652 pmevtyper0_r copy() volatile
7653 {
7654 return *this;
7655 }
7656#endif
7657 CONSTEXPR ::pmu_event_type get_EV_TYPE() const
7658 {
7659 ::pmu_event_type value = static_cast<::pmu_event_type>(EV_TYPE);
7660 return value;
7661 }
7662#ifndef MODEL_REGS
7663 ::pmu_event_type get_EV_TYPE() const volatile
7664 {
7665 ::pmu_event_type value = static_cast<::pmu_event_type>(EV_TYPE);
7666 return value;
7667 }
7668#endif
7669 CONSTEXPR pmevtyper0_r &set_EV_TYPE(::pmu_event_type value)
7670 {
7671 EV_TYPE = ((1u << 10) - 1) & static_cast<uint32_t>(value);
7672 return *this;
7673 }
7674#endif //__cplusplus
7675};
7676
7677// pmevtyper1_r - Performance monitor event type register 1
7678struct pmevtyper1_r
7679{
7680#ifdef __cplusplus
7681 private:
7682#endif //__cplusplus
7683#ifdef MODEL_REGS
7684 ::core::dt::uint_t<10> EV_TYPE; // Event Type
7685#else
7686 union
7687 {
7688 struct
7689 {
7690 uint32_t EV_TYPE : 10; // Event Type
7691 uint32_t reserved0 : 22;
7692 };
7693 uint32_t word;
7694 };
7695#endif
7696#ifdef __cplusplus
7697 public:
7698#ifdef MODEL_REGS
7699 CONSTEXPR pmevtyper1_r() : EV_TYPE(static_cast<uint32_t>(0)) {}
7700 CONSTEXPR pmevtyper1_r(uint32_t value) : EV_TYPE(value >> 0) {}
7701 CONSTEXPR void operator=(uint32_t value)
7702 {
7703 EV_TYPE = value >> 0;
7704 }
7705 CONSTEXPR operator uint32_t() const
7706 {
7707 return (EV_TYPE << 0);
7708 }
7709 pmevtyper1_r copy()
7710 {
7711 return *this;
7712 }
7713#else
7714 CONSTEXPR pmevtyper1_r() : EV_TYPE(static_cast<uint32_t>(0)), reserved0(static_cast<uint32_t>(0)) {}
7715 CONSTEXPR pmevtyper1_r(uint32_t init) : word(init) {}
7716 CONSTEXPR void operator=(uint32_t value)
7717 {
7718 word = value;
7719 }
7720 void operator=(uint32_t value) volatile
7721 {
7722 word = value;
7723 }
7724 CONSTEXPR operator uint32_t()
7725 {
7726 return word;
7727 }
7728 operator uint32_t() volatile
7729 {
7730 return word;
7731 }
7732 pmevtyper1_r copy() volatile
7733 {
7734 return *this;
7735 }
7736#endif
7737 CONSTEXPR ::pmu_event_type get_EV_TYPE() const
7738 {
7739 ::pmu_event_type value = static_cast<::pmu_event_type>(EV_TYPE);
7740 return value;
7741 }
7742#ifndef MODEL_REGS
7743 ::pmu_event_type get_EV_TYPE() const volatile
7744 {
7745 ::pmu_event_type value = static_cast<::pmu_event_type>(EV_TYPE);
7746 return value;
7747 }
7748#endif
7749 CONSTEXPR pmevtyper1_r &set_EV_TYPE(::pmu_event_type value)
7750 {
7751 EV_TYPE = ((1u << 10) - 1) & static_cast<uint32_t>(value);
7752 return *this;
7753 }
7754#endif //__cplusplus
7755};
7756
7757// pmevtyper2_r - Performance monitor event type register 2
7758struct pmevtyper2_r
7759{
7760#ifdef __cplusplus
7761 private:
7762#endif //__cplusplus
7763#ifdef MODEL_REGS
7764 ::core::dt::uint_t<10> EV_TYPE; // Event Type
7765#else
7766 union
7767 {
7768 struct
7769 {
7770 uint32_t EV_TYPE : 10; // Event Type
7771 uint32_t reserved0 : 22;
7772 };
7773 uint32_t word;
7774 };
7775#endif
7776#ifdef __cplusplus
7777 public:
7778#ifdef MODEL_REGS
7779 CONSTEXPR pmevtyper2_r() : EV_TYPE(static_cast<uint32_t>(0)) {}
7780 CONSTEXPR pmevtyper2_r(uint32_t value) : EV_TYPE(value >> 0) {}
7781 CONSTEXPR void operator=(uint32_t value)
7782 {
7783 EV_TYPE = value >> 0;
7784 }
7785 CONSTEXPR operator uint32_t() const
7786 {
7787 return (EV_TYPE << 0);
7788 }
7789 pmevtyper2_r copy()
7790 {
7791 return *this;
7792 }
7793#else
7794 CONSTEXPR pmevtyper2_r() : EV_TYPE(static_cast<uint32_t>(0)), reserved0(static_cast<uint32_t>(0)) {}
7795 CONSTEXPR pmevtyper2_r(uint32_t init) : word(init) {}
7796 CONSTEXPR void operator=(uint32_t value)
7797 {
7798 word = value;
7799 }
7800 void operator=(uint32_t value) volatile
7801 {
7802 word = value;
7803 }
7804 CONSTEXPR operator uint32_t()
7805 {
7806 return word;
7807 }
7808 operator uint32_t() volatile
7809 {
7810 return word;
7811 }
7812 pmevtyper2_r copy() volatile
7813 {
7814 return *this;
7815 }
7816#endif
7817 CONSTEXPR ::pmu_event_type get_EV_TYPE() const
7818 {
7819 ::pmu_event_type value = static_cast<::pmu_event_type>(EV_TYPE);
7820 return value;
7821 }
7822#ifndef MODEL_REGS
7823 ::pmu_event_type get_EV_TYPE() const volatile
7824 {
7825 ::pmu_event_type value = static_cast<::pmu_event_type>(EV_TYPE);
7826 return value;
7827 }
7828#endif
7829 CONSTEXPR pmevtyper2_r &set_EV_TYPE(::pmu_event_type value)
7830 {
7831 EV_TYPE = ((1u << 10) - 1) & static_cast<uint32_t>(value);
7832 return *this;
7833 }
7834#endif //__cplusplus
7835};
7836
7837// pmevtyper3_r - Performance monitor event type register 3
7838struct pmevtyper3_r
7839{
7840#ifdef __cplusplus
7841 private:
7842#endif //__cplusplus
7843#ifdef MODEL_REGS
7844 ::core::dt::uint_t<10> EV_TYPE; // Event Type
7845#else
7846 union
7847 {
7848 struct
7849 {
7850 uint32_t EV_TYPE : 10; // Event Type
7851 uint32_t reserved0 : 22;
7852 };
7853 uint32_t word;
7854 };
7855#endif
7856#ifdef __cplusplus
7857 public:
7858#ifdef MODEL_REGS
7859 CONSTEXPR pmevtyper3_r() : EV_TYPE(static_cast<uint32_t>(0)) {}
7860 CONSTEXPR pmevtyper3_r(uint32_t value) : EV_TYPE(value >> 0) {}
7861 CONSTEXPR void operator=(uint32_t value)
7862 {
7863 EV_TYPE = value >> 0;
7864 }
7865 CONSTEXPR operator uint32_t() const
7866 {
7867 return (EV_TYPE << 0);
7868 }
7869 pmevtyper3_r copy()
7870 {
7871 return *this;
7872 }
7873#else
7874 CONSTEXPR pmevtyper3_r() : EV_TYPE(static_cast<uint32_t>(0)), reserved0(static_cast<uint32_t>(0)) {}
7875 CONSTEXPR pmevtyper3_r(uint32_t init) : word(init) {}
7876 CONSTEXPR void operator=(uint32_t value)
7877 {
7878 word = value;
7879 }
7880 void operator=(uint32_t value) volatile
7881 {
7882 word = value;
7883 }
7884 CONSTEXPR operator uint32_t()
7885 {
7886 return word;
7887 }
7888 operator uint32_t() volatile
7889 {
7890 return word;
7891 }
7892 pmevtyper3_r copy() volatile
7893 {
7894 return *this;
7895 }
7896#endif
7897 CONSTEXPR ::pmu_event_type get_EV_TYPE() const
7898 {
7899 ::pmu_event_type value = static_cast<::pmu_event_type>(EV_TYPE);
7900 return value;
7901 }
7902#ifndef MODEL_REGS
7903 ::pmu_event_type get_EV_TYPE() const volatile
7904 {
7905 ::pmu_event_type value = static_cast<::pmu_event_type>(EV_TYPE);
7906 return value;
7907 }
7908#endif
7909 CONSTEXPR pmevtyper3_r &set_EV_TYPE(::pmu_event_type value)
7910 {
7911 EV_TYPE = ((1u << 10) - 1) & static_cast<uint32_t>(value);
7912 return *this;
7913 }
7914#endif //__cplusplus
7915};
7916
7917struct NPU_REG
7918{
7919 STRUCT id_r ID; // 0x0
7920 STRUCT status_r STATUS; // 0x4
7921 STRUCT cmd_r CMD; // 0x8
7922 STRUCT reset_r RESET; // 0xc
7923 STRUCT qbase0_r QBASE0; // 0x10
7924 STRUCT qbase1_r QBASE1; // 0x14
7925 STRUCT qread_r QREAD; // 0x18
7926 STRUCT qconfig_r QCONFIG; // 0x1c
7927 STRUCT qsize_r QSIZE; // 0x20
7928 STRUCT prot_r PROT; // 0x24
7929 STRUCT config_r CONFIG; // 0x28
7930 STRUCT lock_r LOCK; // 0x2c
7931#ifndef MODEL_REGS
7932 uint32_t unused0[3];
7933#endif
7934 STRUCT regioncfg_r REGIONCFG; // 0x3c
7935 STRUCT axi_limit0_r AXI_LIMIT0; // 0x40
7936 STRUCT axi_limit1_r AXI_LIMIT1; // 0x44
7937 STRUCT axi_limit2_r AXI_LIMIT2; // 0x48
7938 STRUCT axi_limit3_r AXI_LIMIT3; // 0x4c
7939#ifndef MODEL_REGS
7940 uint32_t unused1[12];
7941#endif
7942 STRUCT basep0_r BASEP0; // 0x80
7943 STRUCT basep1_r BASEP1; // 0x84
7944 STRUCT basep2_r BASEP2; // 0x88
7945 STRUCT basep3_r BASEP3; // 0x8c
7946 STRUCT basep4_r BASEP4; // 0x90
7947 STRUCT basep5_r BASEP5; // 0x94
7948 STRUCT basep6_r BASEP6; // 0x98
7949 STRUCT basep7_r BASEP7; // 0x9c
7950 STRUCT basep8_r BASEP8; // 0xa0
7951 STRUCT basep9_r BASEP9; // 0xa4
7952 STRUCT basep10_r BASEP10; // 0xa8
7953 STRUCT basep11_r BASEP11; // 0xac
7954 STRUCT basep12_r BASEP12; // 0xb0
7955 STRUCT basep13_r BASEP13; // 0xb4
7956 STRUCT basep14_r BASEP14; // 0xb8
7957 STRUCT basep15_r BASEP15; // 0xbc
7958#ifndef MODEL_REGS
Diqing Zhong04118062020-04-15 01:19:12 +02007959 uint32_t unused2[16];
7960#endif
7961 uint32_t WD_STATUS; // 0x100
7962 uint32_t MAC_STATUS; // 0x104
7963 uint32_t DMA_STATUS; // 0x108
7964#ifndef MODEL_REGS
7965 uint32_t unused3[1];
7966#endif
7967 uint32_t AO_STATUS; // 0x110
7968#ifndef MODEL_REGS
7969 uint32_t unused4[11];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007970#endif
7971 STRUCT clkforce_r CLKFORCE; // 0x140
7972 uint32_t DEBUG; // 0x144
7973 uint32_t DEBUG2; // 0x148
7974 uint32_t DEBUGCORE; // 0x14c
7975#ifndef MODEL_REGS
Diqing Zhong04118062020-04-15 01:19:12 +02007976 uint32_t unused5[12];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007977#endif
7978 STRUCT pmcr_r PMCR; // 0x180
7979 STRUCT pmcntenset_r PMCNTENSET; // 0x184
7980 STRUCT pmcntenclr_r PMCNTENCLR; // 0x188
7981 STRUCT pmovsset_r PMOVSSET; // 0x18c
7982 STRUCT pmovsclr_r PMOVSCLR; // 0x190
7983 STRUCT pmintset_r PMINTSET; // 0x194
7984 STRUCT pmintclr_r PMINTCLR; // 0x198
7985#ifndef MODEL_REGS
Diqing Zhong04118062020-04-15 01:19:12 +02007986 uint32_t unused6[1];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007987#endif
7988 STRUCT pmccntr_lo_r PMCCNTR_LO; // 0x1a0
7989 STRUCT pmccntr_hi_r PMCCNTR_HI; // 0x1a4
7990 STRUCT pmccntr_cfg_r PMCCNTR_CFG; // 0x1a8
7991 STRUCT pmcaxi_chan_r PMCAXI_CHAN; // 0x1ac
7992#ifndef MODEL_REGS
Diqing Zhong04118062020-04-15 01:19:12 +02007993 uint32_t unused7[20];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02007994#endif
7995 uint32_t KERNEL_X; // 0x200
7996 uint32_t KERNEL_Y; // 0x204
7997 uint32_t KERNEL_W_M1; // 0x208
7998 uint32_t KERNEL_H_M1; // 0x20c
7999 uint32_t OFM_CBLK_WIDTH_M1; // 0x210
8000 uint32_t OFM_CBLK_HEIGHT_M1; // 0x214
8001 uint32_t OFM_CBLK_DEPTH_M1; // 0x218
8002 uint32_t IFM_CBLK_DEPTH_M1; // 0x21c
8003 uint32_t OFM_X; // 0x220
8004 uint32_t OFM_Y; // 0x224
8005 uint32_t OFM_Z; // 0x228
8006 uint32_t IFM_Z; // 0x22c
8007 uint32_t PAD_TOP; // 0x230
8008 uint32_t PAD_LEFT; // 0x234
8009 uint32_t IFM_CBLK_WIDTH; // 0x238
8010 uint32_t IFM_CBLK_HEIGHT; // 0x23c
8011 uint32_t DMA_IFM_SRC; // 0x240
8012 uint32_t DMA_IFM_SRC_HI; // 0x244
8013 uint32_t DMA_IFM_DST; // 0x248
8014 uint32_t DMA_OFM_SRC; // 0x24c
8015 uint32_t DMA_OFM_DST; // 0x250
8016 uint32_t DMA_OFM_DST_HI; // 0x254
8017 uint32_t DMA_WEIGHT_SRC; // 0x258
8018 uint32_t DMA_WEIGHT_SRC_HI; // 0x25c
8019 uint32_t DMA_CMD_SRC; // 0x260
8020 uint32_t DMA_CMD_SRC_HI; // 0x264
8021 uint32_t DMA_CMD_SIZE; // 0x268
8022 uint32_t DMA_M2M_SRC; // 0x26c
8023 uint32_t DMA_M2M_SRC_HI; // 0x270
8024 uint32_t DMA_M2M_DST; // 0x274
8025 uint32_t DMA_M2M_DST_HI; // 0x278
8026 uint32_t CURRENT_QREAD; // 0x27c
8027 uint32_t DMA_SCALE_SRC; // 0x280
8028 uint32_t DMA_SCALE_SRC_HI; // 0x284
8029#ifndef MODEL_REGS
Diqing Zhong04118062020-04-15 01:19:12 +02008030 uint32_t unused8[13];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008031#endif
8032 uint32_t CURRENT_CMD; // 0x2bc
8033#ifndef MODEL_REGS
Diqing Zhong04118062020-04-15 01:19:12 +02008034 uint32_t unused9[16];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008035#endif
8036 uint32_t PMEVCNTR[4]; // 0x300
8037#ifndef MODEL_REGS
Diqing Zhong04118062020-04-15 01:19:12 +02008038 uint32_t unused10[28];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008039#endif
8040 STRUCT pmevtyper0_r PMEVTYPER[4]; // 0x380
8041#ifndef MODEL_REGS
Diqing Zhong04118062020-04-15 01:19:12 +02008042 uint32_t unused11[28];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008043#endif
8044 uint32_t SHARED_BUFFER[256]; // 0x400
8045 uint32_t IFM_PAD_TOP; // 0x800
8046 uint32_t IFM_PAD_LEFT; // 0x804
8047 uint32_t IFM_PAD_RIGHT; // 0x808
8048 uint32_t IFM_PAD_BOTTOM; // 0x80c
8049 uint32_t IFM_DEPTH_M1; // 0x810
8050 uint32_t IFM_PRECISION; // 0x814
8051#ifndef MODEL_REGS
Diqing Zhong04118062020-04-15 01:19:12 +02008052 uint32_t unused12[1];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008053#endif
8054 uint32_t IFM_UPSCALE; // 0x81c
8055#ifndef MODEL_REGS
Diqing Zhong04118062020-04-15 01:19:12 +02008056 uint32_t unused13[1];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008057#endif
8058 uint32_t IFM_ZERO_POINT; // 0x824
8059 uint32_t IFM_WIDTH0_M1; // 0x828
8060 uint32_t IFM_HEIGHT0_M1; // 0x82c
8061 uint32_t IFM_HEIGHT1_M1; // 0x830
8062 uint32_t IFM_IB_END; // 0x834
8063#ifndef MODEL_REGS
Diqing Zhong04118062020-04-15 01:19:12 +02008064 uint32_t unused14[1];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008065#endif
8066 uint32_t IFM_REGION; // 0x83c
8067#ifndef MODEL_REGS
Diqing Zhong04118062020-04-15 01:19:12 +02008068 uint32_t unused15[1];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008069#endif
8070 uint32_t OFM_WIDTH_M1; // 0x844
8071 uint32_t OFM_HEIGHT_M1; // 0x848
8072 uint32_t OFM_DEPTH_M1; // 0x84c
8073 uint32_t OFM_PRECISION; // 0x850
8074 uint32_t OFM_BLK_WIDTH_M1; // 0x854
8075 uint32_t OFM_BLK_HEIGHT_M1; // 0x858
8076 uint32_t OFM_BLK_DEPTH_M1; // 0x85c
8077 uint32_t OFM_ZERO_POINT; // 0x860
8078#ifndef MODEL_REGS
Diqing Zhong04118062020-04-15 01:19:12 +02008079 uint32_t unused16[1];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008080#endif
8081 uint32_t OFM_WIDTH0_M1; // 0x868
8082 uint32_t OFM_HEIGHT0_M1; // 0x86c
8083 uint32_t OFM_HEIGHT1_M1; // 0x870
8084#ifndef MODEL_REGS
Diqing Zhong04118062020-04-15 01:19:12 +02008085 uint32_t unused17[2];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008086#endif
8087 uint32_t OFM_REGION; // 0x87c
8088 uint32_t KERNEL_WIDTH_M1; // 0x880
8089 uint32_t KERNEL_HEIGHT_M1; // 0x884
8090 uint32_t KERNEL_STRIDE; // 0x888
8091 uint32_t PARALLEL_MODE; // 0x88c
8092 uint32_t ACC_FORMAT; // 0x890
8093 uint32_t ACTIVATION; // 0x894
8094 uint32_t ACTIVATION_MIN; // 0x898
8095 uint32_t ACTIVATION_MAX; // 0x89c
8096 uint32_t WEIGHT_REGION; // 0x8a0
8097 uint32_t SCALE_REGION; // 0x8a4
8098#ifndef MODEL_REGS
Diqing Zhong04118062020-04-15 01:19:12 +02008099 uint32_t unused18[3];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008100#endif
8101 uint32_t AB_START; // 0x8b4
8102#ifndef MODEL_REGS
Diqing Zhong04118062020-04-15 01:19:12 +02008103 uint32_t unused19[1];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008104#endif
8105 uint32_t BLOCKDEP; // 0x8bc
8106 uint32_t DMA0_SRC_REGION; // 0x8c0
8107 uint32_t DMA0_DST_REGION; // 0x8c4
8108 uint32_t DMA0_SIZE0; // 0x8c8
8109 uint32_t DMA0_SIZE1; // 0x8cc
8110#ifndef MODEL_REGS
Diqing Zhong04118062020-04-15 01:19:12 +02008111 uint32_t unused20[12];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008112#endif
8113 uint32_t IFM2_BROADCAST; // 0x900
8114 uint32_t IFM2_SCALAR; // 0x904
8115#ifndef MODEL_REGS
Diqing Zhong04118062020-04-15 01:19:12 +02008116 uint32_t unused21[3];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008117#endif
8118 uint32_t IFM2_PRECISION; // 0x914
8119#ifndef MODEL_REGS
Diqing Zhong04118062020-04-15 01:19:12 +02008120 uint32_t unused22[3];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008121#endif
8122 uint32_t IFM2_ZERO_POINT; // 0x924
8123 uint32_t IFM2_WIDTH0_M1; // 0x928
8124 uint32_t IFM2_HEIGHT0_M1; // 0x92c
8125 uint32_t IFM2_HEIGHT1_M1; // 0x930
8126 uint32_t IFM2_IB_START; // 0x934
8127#ifndef MODEL_REGS
Diqing Zhong04118062020-04-15 01:19:12 +02008128 uint32_t unused23[1];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008129#endif
8130 uint32_t IFM2_REGION; // 0x93c
8131#ifndef MODEL_REGS
Diqing Zhong04118062020-04-15 01:19:12 +02008132 uint32_t unused24[48];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008133#endif
8134 uint32_t IFM_BASE0; // 0xa00
8135 uint32_t IFM_BASE0_HI; // 0xa04
8136 uint32_t IFM_BASE1; // 0xa08
8137 uint32_t IFM_BASE1_HI; // 0xa0c
8138 uint32_t IFM_BASE2; // 0xa10
8139 uint32_t IFM_BASE2_HI; // 0xa14
8140 uint32_t IFM_BASE3; // 0xa18
8141 uint32_t IFM_BASE3_HI; // 0xa1c
8142 uint32_t IFM_STRIDE_X; // 0xa20
8143 uint32_t IFM_STRIDE_X_HI; // 0xa24
8144 uint32_t IFM_STRIDE_Y; // 0xa28
8145 uint32_t IFM_STRIDE_Y_HI; // 0xa2c
8146 uint32_t IFM_STRIDE_C; // 0xa30
8147 uint32_t IFM_STRIDE_C_HI; // 0xa34
8148#ifndef MODEL_REGS
Diqing Zhong04118062020-04-15 01:19:12 +02008149 uint32_t unused25[2];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008150#endif
8151 uint32_t OFM_BASE0; // 0xa40
8152 uint32_t OFM_BASE0_HI; // 0xa44
8153 uint32_t OFM_BASE1; // 0xa48
8154 uint32_t OFM_BASE1_HI; // 0xa4c
8155 uint32_t OFM_BASE2; // 0xa50
8156 uint32_t OFM_BASE2_HI; // 0xa54
8157 uint32_t OFM_BASE3; // 0xa58
8158 uint32_t OFM_BASE3_HI; // 0xa5c
8159 uint32_t OFM_STRIDE_X; // 0xa60
8160 uint32_t OFM_STRIDE_X_HI; // 0xa64
8161 uint32_t OFM_STRIDE_Y; // 0xa68
8162 uint32_t OFM_STRIDE_Y_HI; // 0xa6c
8163 uint32_t OFM_STRIDE_C; // 0xa70
8164 uint32_t OFM_STRIDE_C_HI; // 0xa74
8165#ifndef MODEL_REGS
Diqing Zhong04118062020-04-15 01:19:12 +02008166 uint32_t unused26[2];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008167#endif
8168 uint32_t WEIGHT_BASE; // 0xa80
8169 uint32_t WEIGHT_BASE_HI; // 0xa84
8170 uint32_t WEIGHT_LENGTH; // 0xa88
8171 uint32_t WEIGHT_LENGTH_HI; // 0xa8c
8172 uint32_t SCALE_BASE; // 0xa90
8173 uint32_t SCALE_BASE_HI; // 0xa94
8174 uint32_t SCALE_LENGTH; // 0xa98
8175#ifndef MODEL_REGS
Diqing Zhong04118062020-04-15 01:19:12 +02008176 uint32_t unused27[1];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008177#endif
8178 uint32_t OFM_SCALE; // 0xaa0
8179 uint32_t OFM_SCALE_SHIFT; // 0xaa4
8180 uint32_t OPA_SCALE; // 0xaa8
8181 uint32_t OPA_SCALE_SHIFT; // 0xaac
8182 uint32_t OPB_SCALE; // 0xab0
8183#ifndef MODEL_REGS
Diqing Zhong04118062020-04-15 01:19:12 +02008184 uint32_t unused28[3];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008185#endif
8186 uint32_t DMA0_SRC; // 0xac0
8187 uint32_t DMA0_SRC_HI; // 0xac4
8188 uint32_t DMA0_DST; // 0xac8
8189 uint32_t DMA0_DST_HI; // 0xacc
8190 uint32_t DMA0_LEN; // 0xad0
8191 uint32_t DMA0_LEN_HI; // 0xad4
8192 uint32_t DMA0_SKIP0; // 0xad8
8193 uint32_t DMA0_SKIP0_HI; // 0xadc
8194 uint32_t DMA0_SKIP1; // 0xae0
8195 uint32_t DMA0_SKIP1_HI; // 0xae4
8196#ifndef MODEL_REGS
Diqing Zhong04118062020-04-15 01:19:12 +02008197 uint32_t unused29[6];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008198#endif
8199 uint32_t IFM2_BASE0; // 0xb00
8200 uint32_t IFM2_BASE0_HI; // 0xb04
8201 uint32_t IFM2_BASE1; // 0xb08
8202 uint32_t IFM2_BASE1_HI; // 0xb0c
8203 uint32_t IFM2_BASE2; // 0xb10
8204 uint32_t IFM2_BASE2_HI; // 0xb14
8205 uint32_t IFM2_BASE3; // 0xb18
8206 uint32_t IFM2_BASE3_HI; // 0xb1c
8207 uint32_t IFM2_STRIDE_X; // 0xb20
8208 uint32_t IFM2_STRIDE_X_HI; // 0xb24
8209 uint32_t IFM2_STRIDE_Y; // 0xb28
8210 uint32_t IFM2_STRIDE_Y_HI; // 0xb2c
8211 uint32_t IFM2_STRIDE_C; // 0xb30
8212 uint32_t IFM2_STRIDE_C_HI; // 0xb34
8213#ifndef MODEL_REGS
Diqing Zhong04118062020-04-15 01:19:12 +02008214 uint32_t unused30[2];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008215#endif
8216 uint32_t WEIGHT1_BASE; // 0xb40
8217 uint32_t WEIGHT1_BASE_HI; // 0xb44
8218 uint32_t WEIGHT1_LENGTH; // 0xb48
8219 uint32_t WEIGHT1_LENGTH_HI; // 0xb4c
8220 uint32_t SCALE1_BASE; // 0xb50
8221 uint32_t SCALE1_BASE_HI; // 0xb54
8222 uint32_t SCALE1_LENGTH; // 0xb58
8223#ifndef MODEL_REGS
Diqing Zhong04118062020-04-15 01:19:12 +02008224 uint32_t unused31[281];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008225#endif
8226 uint32_t REVISION; // 0xfc0
8227#ifndef MODEL_REGS
Diqing Zhong04118062020-04-15 01:19:12 +02008228 uint32_t unused32[3];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008229#endif
8230 STRUCT pid4_r PID4; // 0xfd0
8231 STRUCT pid5_r PID5; // 0xfd4
8232 STRUCT pid6_r PID6; // 0xfd8
8233 STRUCT pid7_r PID7; // 0xfdc
8234 STRUCT pid0_r PID0; // 0xfe0
8235 STRUCT pid1_r PID1; // 0xfe4
8236 STRUCT pid2_r PID2; // 0xfe8
8237 STRUCT pid3_r PID3; // 0xfec
8238 STRUCT cid0_r CID0; // 0xff0
8239 STRUCT cid1_r CID1; // 0xff4
8240 STRUCT cid2_r CID2; // 0xff8
8241 STRUCT cid3_r CID3; // 0xffc
8242#ifdef __cplusplus
8243 NPU_REG()
8244 {
8245 reset();
8246 }
8247 void reset()
8248 {
Diqing Zhong04118062020-04-15 01:19:12 +02008249 ID = 169885697;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008250 STATUS = 8;
8251 CMD = 0;
8252 RESET = 0;
8253 QBASE0 = 0;
8254 QBASE1 = 0;
8255 QREAD = 0;
8256 QCONFIG = 0;
8257 QSIZE = 0;
8258 PROT = 0;
8259 CONFIG = 0;
8260 LOCK = 0;
8261 REGIONCFG = 0;
8262 AXI_LIMIT0 = 0;
8263 AXI_LIMIT1 = 0;
8264 AXI_LIMIT2 = 0;
8265 AXI_LIMIT3 = 0;
8266 BASEP0 = 0;
8267 BASEP1 = 0;
8268 BASEP2 = 0;
8269 BASEP3 = 0;
8270 BASEP4 = 0;
8271 BASEP5 = 0;
8272 BASEP6 = 0;
8273 BASEP7 = 0;
8274 BASEP8 = 0;
8275 BASEP9 = 0;
8276 BASEP10 = 0;
8277 BASEP11 = 0;
8278 BASEP12 = 0;
8279 BASEP13 = 0;
8280 BASEP14 = 0;
8281 BASEP15 = 0;
8282 REVISION = 0;
8283 PID4 = 4;
8284 PID5 = 0;
8285 PID6 = 0;
8286 PID7 = 0;
8287 PID0 = 128;
8288 PID1 = 181;
8289 PID2 = 11;
8290 PID3 = 0;
8291 CID0 = 13;
8292 CID1 = 240;
8293 CID2 = 5;
8294 CID3 = 177;
Diqing Zhong04118062020-04-15 01:19:12 +02008295 WD_STATUS = 0;
8296 MAC_STATUS = 0;
8297 DMA_STATUS = 0;
8298 AO_STATUS = 0;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008299 CLKFORCE = 0;
8300 DEBUG = 0;
8301 DEBUG2 = 0;
8302 DEBUGCORE = 0;
8303 KERNEL_X = 0;
8304 KERNEL_Y = 0;
8305 KERNEL_W_M1 = 0;
8306 KERNEL_H_M1 = 0;
8307 OFM_CBLK_WIDTH_M1 = 0;
8308 OFM_CBLK_HEIGHT_M1 = 0;
8309 OFM_CBLK_DEPTH_M1 = 0;
8310 IFM_CBLK_DEPTH_M1 = 0;
8311 OFM_X = 0;
8312 OFM_Y = 0;
8313 OFM_Z = 0;
8314 IFM_Z = 0;
8315 PAD_TOP = 0;
8316 PAD_LEFT = 0;
8317 IFM_CBLK_WIDTH = 0;
8318 IFM_CBLK_HEIGHT = 0;
8319 DMA_IFM_SRC = 0;
8320 DMA_IFM_SRC_HI = 0;
8321 DMA_IFM_DST = 0;
8322 DMA_OFM_SRC = 0;
8323 DMA_OFM_DST = 0;
8324 DMA_OFM_DST_HI = 0;
8325 DMA_WEIGHT_SRC = 0;
8326 DMA_WEIGHT_SRC_HI = 0;
8327 DMA_CMD_SRC = 0;
8328 DMA_CMD_SRC_HI = 0;
8329 DMA_CMD_SIZE = 0;
8330 DMA_M2M_SRC = 0;
8331 DMA_M2M_SRC_HI = 0;
8332 DMA_M2M_DST = 0;
8333 DMA_M2M_DST_HI = 0;
8334 CURRENT_QREAD = 0;
8335 DMA_SCALE_SRC = 0;
8336 DMA_SCALE_SRC_HI = 0;
8337 CURRENT_CMD = 0;
8338 IFM_PAD_TOP = 0;
8339 IFM_PAD_LEFT = 0;
8340 IFM_PAD_RIGHT = 0;
8341 IFM_PAD_BOTTOM = 0;
8342 IFM_DEPTH_M1 = 0;
8343 IFM_PRECISION = 0;
8344 IFM_UPSCALE = 0;
8345 IFM_ZERO_POINT = 0;
8346 IFM_WIDTH0_M1 = 0;
8347 IFM_HEIGHT0_M1 = 0;
8348 IFM_HEIGHT1_M1 = 0;
8349 IFM_IB_END = 0;
8350 IFM_REGION = 0;
8351 OFM_WIDTH_M1 = 0;
8352 OFM_HEIGHT_M1 = 0;
8353 OFM_DEPTH_M1 = 0;
8354 OFM_PRECISION = 0;
8355 OFM_BLK_WIDTH_M1 = 0;
8356 OFM_BLK_HEIGHT_M1 = 0;
8357 OFM_BLK_DEPTH_M1 = 0;
8358 OFM_ZERO_POINT = 0;
8359 OFM_WIDTH0_M1 = 0;
8360 OFM_HEIGHT0_M1 = 0;
8361 OFM_HEIGHT1_M1 = 0;
8362 OFM_REGION = 0;
8363 KERNEL_WIDTH_M1 = 0;
8364 KERNEL_HEIGHT_M1 = 0;
8365 KERNEL_STRIDE = 0;
8366 PARALLEL_MODE = 0;
8367 ACC_FORMAT = 0;
8368 ACTIVATION = 0;
8369 ACTIVATION_MIN = 0;
8370 ACTIVATION_MAX = 0;
8371 WEIGHT_REGION = 0;
8372 SCALE_REGION = 0;
8373 AB_START = 0;
8374 BLOCKDEP = 0;
8375 DMA0_SRC_REGION = 0;
8376 DMA0_DST_REGION = 0;
8377 DMA0_SIZE0 = 0;
8378 DMA0_SIZE1 = 0;
8379 IFM2_BROADCAST = 0;
8380 IFM2_SCALAR = 0;
8381 IFM2_PRECISION = 0;
8382 IFM2_ZERO_POINT = 0;
8383 IFM2_WIDTH0_M1 = 0;
8384 IFM2_HEIGHT0_M1 = 0;
8385 IFM2_HEIGHT1_M1 = 0;
8386 IFM2_IB_START = 0;
8387 IFM2_REGION = 0;
8388 IFM_BASE0 = 0;
8389 IFM_BASE0_HI = 0;
8390 IFM_BASE1 = 0;
8391 IFM_BASE1_HI = 0;
8392 IFM_BASE2 = 0;
8393 IFM_BASE2_HI = 0;
8394 IFM_BASE3 = 0;
8395 IFM_BASE3_HI = 0;
8396 IFM_STRIDE_X = 0;
8397 IFM_STRIDE_X_HI = 0;
8398 IFM_STRIDE_Y = 0;
8399 IFM_STRIDE_Y_HI = 0;
8400 IFM_STRIDE_C = 0;
8401 IFM_STRIDE_C_HI = 0;
8402 OFM_BASE0 = 0;
8403 OFM_BASE0_HI = 0;
8404 OFM_BASE1 = 0;
8405 OFM_BASE1_HI = 0;
8406 OFM_BASE2 = 0;
8407 OFM_BASE2_HI = 0;
8408 OFM_BASE3 = 0;
8409 OFM_BASE3_HI = 0;
8410 OFM_STRIDE_X = 0;
8411 OFM_STRIDE_X_HI = 0;
8412 OFM_STRIDE_Y = 0;
8413 OFM_STRIDE_Y_HI = 0;
8414 OFM_STRIDE_C = 0;
8415 OFM_STRIDE_C_HI = 0;
8416 WEIGHT_BASE = 0;
8417 WEIGHT_BASE_HI = 0;
8418 WEIGHT_LENGTH = 0;
8419 WEIGHT_LENGTH_HI = 0;
8420 SCALE_BASE = 0;
8421 SCALE_BASE_HI = 0;
8422 SCALE_LENGTH = 0;
8423 OFM_SCALE = 0;
8424 OFM_SCALE_SHIFT = 0;
8425 OPA_SCALE = 0;
8426 OPA_SCALE_SHIFT = 0;
8427 OPB_SCALE = 0;
8428 DMA0_SRC = 0;
8429 DMA0_SRC_HI = 0;
8430 DMA0_DST = 0;
8431 DMA0_DST_HI = 0;
8432 DMA0_LEN = 0;
8433 DMA0_LEN_HI = 0;
8434 DMA0_SKIP0 = 0;
8435 DMA0_SKIP0_HI = 0;
8436 DMA0_SKIP1 = 0;
8437 DMA0_SKIP1_HI = 0;
8438 IFM2_BASE0 = 0;
8439 IFM2_BASE0_HI = 0;
8440 IFM2_BASE1 = 0;
8441 IFM2_BASE1_HI = 0;
8442 IFM2_BASE2 = 0;
8443 IFM2_BASE2_HI = 0;
8444 IFM2_BASE3 = 0;
8445 IFM2_BASE3_HI = 0;
8446 IFM2_STRIDE_X = 0;
8447 IFM2_STRIDE_X_HI = 0;
8448 IFM2_STRIDE_Y = 0;
8449 IFM2_STRIDE_Y_HI = 0;
8450 IFM2_STRIDE_C = 0;
8451 IFM2_STRIDE_C_HI = 0;
8452 WEIGHT1_BASE = 0;
8453 WEIGHT1_BASE_HI = 0;
8454 WEIGHT1_LENGTH = 0;
8455 WEIGHT1_LENGTH_HI = 0;
8456 SCALE1_BASE = 0;
8457 SCALE1_BASE_HI = 0;
8458 SCALE1_LENGTH = 0;
8459 PMCR = 8192;
8460 PMCNTENSET = 0;
8461 PMCNTENCLR = 0;
8462 PMOVSSET = 0;
8463 PMOVSCLR = 0;
8464 PMINTSET = 0;
8465 PMINTCLR = 0;
8466 PMCCNTR_LO = 0;
8467 PMCCNTR_HI = 0;
8468 PMCCNTR_CFG = 0;
8469 PMCAXI_CHAN = 0;
8470 for (size_t i = 0; i < (sizeof(PMEVCNTR) / sizeof(PMEVCNTR[0])); ++i)
8471 PMEVCNTR[i] = 0;
8472 for (size_t i = 0; i < (sizeof(PMEVTYPER) / sizeof(PMEVTYPER[0])); ++i)
8473 PMEVTYPER[i] = 0;
8474 for (size_t i = 0; i < (sizeof(SHARED_BUFFER) / sizeof(SHARED_BUFFER[0])); ++i)
8475 SHARED_BUFFER[i] = 0;
8476 }
8477#ifdef MODEL_REGS
8478 uint32_t get(size_t offset) const
8479 {
8480 switch (offset)
8481 {
8482 case 0:
8483 return ID;
8484 case 4:
8485 return STATUS;
8486 case 8:
8487 return CMD;
8488 case 12:
8489 return RESET;
8490 case 16:
8491 return QBASE0;
8492 case 20:
8493 return QBASE1;
8494 case 24:
8495 return QREAD;
8496 case 28:
8497 return QCONFIG;
8498 case 32:
8499 return QSIZE;
8500 case 36:
8501 return PROT;
8502 case 40:
8503 return CONFIG;
8504 case 44:
8505 return LOCK;
8506 case 60:
8507 return REGIONCFG;
8508 case 64:
8509 return AXI_LIMIT0;
8510 case 68:
8511 return AXI_LIMIT1;
8512 case 72:
8513 return AXI_LIMIT2;
8514 case 76:
8515 return AXI_LIMIT3;
8516 case 128:
8517 return BASEP0;
8518 case 132:
8519 return BASEP1;
8520 case 136:
8521 return BASEP2;
8522 case 140:
8523 return BASEP3;
8524 case 144:
8525 return BASEP4;
8526 case 148:
8527 return BASEP5;
8528 case 152:
8529 return BASEP6;
8530 case 156:
8531 return BASEP7;
8532 case 160:
8533 return BASEP8;
8534 case 164:
8535 return BASEP9;
8536 case 168:
8537 return BASEP10;
8538 case 172:
8539 return BASEP11;
8540 case 176:
8541 return BASEP12;
8542 case 180:
8543 return BASEP13;
8544 case 184:
8545 return BASEP14;
8546 case 188:
8547 return BASEP15;
8548 case 4032:
8549 return REVISION;
8550 case 4048:
8551 return PID4;
8552 case 4052:
8553 return PID5;
8554 case 4056:
8555 return PID6;
8556 case 4060:
8557 return PID7;
8558 case 4064:
8559 return PID0;
8560 case 4068:
8561 return PID1;
8562 case 4072:
8563 return PID2;
8564 case 4076:
8565 return PID3;
8566 case 4080:
8567 return CID0;
8568 case 4084:
8569 return CID1;
8570 case 4088:
8571 return CID2;
8572 case 4092:
8573 return CID3;
Diqing Zhong04118062020-04-15 01:19:12 +02008574 case 256:
8575 return WD_STATUS;
8576 case 260:
8577 return MAC_STATUS;
8578 case 264:
8579 return DMA_STATUS;
8580 case 272:
8581 return AO_STATUS;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008582 case 320:
8583 return CLKFORCE;
8584 case 324:
8585 return DEBUG;
8586 case 328:
8587 return DEBUG2;
8588 case 332:
8589 return DEBUGCORE;
8590 case 512:
8591 return KERNEL_X;
8592 case 516:
8593 return KERNEL_Y;
8594 case 520:
8595 return KERNEL_W_M1;
8596 case 524:
8597 return KERNEL_H_M1;
8598 case 528:
8599 return OFM_CBLK_WIDTH_M1;
8600 case 532:
8601 return OFM_CBLK_HEIGHT_M1;
8602 case 536:
8603 return OFM_CBLK_DEPTH_M1;
8604 case 540:
8605 return IFM_CBLK_DEPTH_M1;
8606 case 544:
8607 return OFM_X;
8608 case 548:
8609 return OFM_Y;
8610 case 552:
8611 return OFM_Z;
8612 case 556:
8613 return IFM_Z;
8614 case 560:
8615 return PAD_TOP;
8616 case 564:
8617 return PAD_LEFT;
8618 case 568:
8619 return IFM_CBLK_WIDTH;
8620 case 572:
8621 return IFM_CBLK_HEIGHT;
8622 case 576:
8623 return DMA_IFM_SRC;
8624 case 580:
8625 return DMA_IFM_SRC_HI;
8626 case 584:
8627 return DMA_IFM_DST;
8628 case 588:
8629 return DMA_OFM_SRC;
8630 case 592:
8631 return DMA_OFM_DST;
8632 case 596:
8633 return DMA_OFM_DST_HI;
8634 case 600:
8635 return DMA_WEIGHT_SRC;
8636 case 604:
8637 return DMA_WEIGHT_SRC_HI;
8638 case 608:
8639 return DMA_CMD_SRC;
8640 case 612:
8641 return DMA_CMD_SRC_HI;
8642 case 616:
8643 return DMA_CMD_SIZE;
8644 case 620:
8645 return DMA_M2M_SRC;
8646 case 624:
8647 return DMA_M2M_SRC_HI;
8648 case 628:
8649 return DMA_M2M_DST;
8650 case 632:
8651 return DMA_M2M_DST_HI;
8652 case 636:
8653 return CURRENT_QREAD;
8654 case 640:
8655 return DMA_SCALE_SRC;
8656 case 644:
8657 return DMA_SCALE_SRC_HI;
8658 case 700:
8659 return CURRENT_CMD;
8660 case 2048:
8661 return IFM_PAD_TOP;
8662 case 2052:
8663 return IFM_PAD_LEFT;
8664 case 2056:
8665 return IFM_PAD_RIGHT;
8666 case 2060:
8667 return IFM_PAD_BOTTOM;
8668 case 2064:
8669 return IFM_DEPTH_M1;
8670 case 2068:
8671 return IFM_PRECISION;
8672 case 2076:
8673 return IFM_UPSCALE;
8674 case 2084:
8675 return IFM_ZERO_POINT;
8676 case 2088:
8677 return IFM_WIDTH0_M1;
8678 case 2092:
8679 return IFM_HEIGHT0_M1;
8680 case 2096:
8681 return IFM_HEIGHT1_M1;
8682 case 2100:
8683 return IFM_IB_END;
8684 case 2108:
8685 return IFM_REGION;
8686 case 2116:
8687 return OFM_WIDTH_M1;
8688 case 2120:
8689 return OFM_HEIGHT_M1;
8690 case 2124:
8691 return OFM_DEPTH_M1;
8692 case 2128:
8693 return OFM_PRECISION;
8694 case 2132:
8695 return OFM_BLK_WIDTH_M1;
8696 case 2136:
8697 return OFM_BLK_HEIGHT_M1;
8698 case 2140:
8699 return OFM_BLK_DEPTH_M1;
8700 case 2144:
8701 return OFM_ZERO_POINT;
8702 case 2152:
8703 return OFM_WIDTH0_M1;
8704 case 2156:
8705 return OFM_HEIGHT0_M1;
8706 case 2160:
8707 return OFM_HEIGHT1_M1;
8708 case 2172:
8709 return OFM_REGION;
8710 case 2176:
8711 return KERNEL_WIDTH_M1;
8712 case 2180:
8713 return KERNEL_HEIGHT_M1;
8714 case 2184:
8715 return KERNEL_STRIDE;
8716 case 2188:
8717 return PARALLEL_MODE;
8718 case 2192:
8719 return ACC_FORMAT;
8720 case 2196:
8721 return ACTIVATION;
8722 case 2200:
8723 return ACTIVATION_MIN;
8724 case 2204:
8725 return ACTIVATION_MAX;
8726 case 2208:
8727 return WEIGHT_REGION;
8728 case 2212:
8729 return SCALE_REGION;
8730 case 2228:
8731 return AB_START;
8732 case 2236:
8733 return BLOCKDEP;
8734 case 2240:
8735 return DMA0_SRC_REGION;
8736 case 2244:
8737 return DMA0_DST_REGION;
8738 case 2248:
8739 return DMA0_SIZE0;
8740 case 2252:
8741 return DMA0_SIZE1;
8742 case 2304:
8743 return IFM2_BROADCAST;
8744 case 2308:
8745 return IFM2_SCALAR;
8746 case 2324:
8747 return IFM2_PRECISION;
8748 case 2340:
8749 return IFM2_ZERO_POINT;
8750 case 2344:
8751 return IFM2_WIDTH0_M1;
8752 case 2348:
8753 return IFM2_HEIGHT0_M1;
8754 case 2352:
8755 return IFM2_HEIGHT1_M1;
8756 case 2356:
8757 return IFM2_IB_START;
8758 case 2364:
8759 return IFM2_REGION;
8760 case 2560:
8761 return IFM_BASE0;
8762 case 2564:
8763 return IFM_BASE0_HI;
8764 case 2568:
8765 return IFM_BASE1;
8766 case 2572:
8767 return IFM_BASE1_HI;
8768 case 2576:
8769 return IFM_BASE2;
8770 case 2580:
8771 return IFM_BASE2_HI;
8772 case 2584:
8773 return IFM_BASE3;
8774 case 2588:
8775 return IFM_BASE3_HI;
8776 case 2592:
8777 return IFM_STRIDE_X;
8778 case 2596:
8779 return IFM_STRIDE_X_HI;
8780 case 2600:
8781 return IFM_STRIDE_Y;
8782 case 2604:
8783 return IFM_STRIDE_Y_HI;
8784 case 2608:
8785 return IFM_STRIDE_C;
8786 case 2612:
8787 return IFM_STRIDE_C_HI;
8788 case 2624:
8789 return OFM_BASE0;
8790 case 2628:
8791 return OFM_BASE0_HI;
8792 case 2632:
8793 return OFM_BASE1;
8794 case 2636:
8795 return OFM_BASE1_HI;
8796 case 2640:
8797 return OFM_BASE2;
8798 case 2644:
8799 return OFM_BASE2_HI;
8800 case 2648:
8801 return OFM_BASE3;
8802 case 2652:
8803 return OFM_BASE3_HI;
8804 case 2656:
8805 return OFM_STRIDE_X;
8806 case 2660:
8807 return OFM_STRIDE_X_HI;
8808 case 2664:
8809 return OFM_STRIDE_Y;
8810 case 2668:
8811 return OFM_STRIDE_Y_HI;
8812 case 2672:
8813 return OFM_STRIDE_C;
8814 case 2676:
8815 return OFM_STRIDE_C_HI;
8816 case 2688:
8817 return WEIGHT_BASE;
8818 case 2692:
8819 return WEIGHT_BASE_HI;
8820 case 2696:
8821 return WEIGHT_LENGTH;
8822 case 2700:
8823 return WEIGHT_LENGTH_HI;
8824 case 2704:
8825 return SCALE_BASE;
8826 case 2708:
8827 return SCALE_BASE_HI;
8828 case 2712:
8829 return SCALE_LENGTH;
8830 case 2720:
8831 return OFM_SCALE;
8832 case 2724:
8833 return OFM_SCALE_SHIFT;
8834 case 2728:
8835 return OPA_SCALE;
8836 case 2732:
8837 return OPA_SCALE_SHIFT;
8838 case 2736:
8839 return OPB_SCALE;
8840 case 2752:
8841 return DMA0_SRC;
8842 case 2756:
8843 return DMA0_SRC_HI;
8844 case 2760:
8845 return DMA0_DST;
8846 case 2764:
8847 return DMA0_DST_HI;
8848 case 2768:
8849 return DMA0_LEN;
8850 case 2772:
8851 return DMA0_LEN_HI;
8852 case 2776:
8853 return DMA0_SKIP0;
8854 case 2780:
8855 return DMA0_SKIP0_HI;
8856 case 2784:
8857 return DMA0_SKIP1;
8858 case 2788:
8859 return DMA0_SKIP1_HI;
8860 case 2816:
8861 return IFM2_BASE0;
8862 case 2820:
8863 return IFM2_BASE0_HI;
8864 case 2824:
8865 return IFM2_BASE1;
8866 case 2828:
8867 return IFM2_BASE1_HI;
8868 case 2832:
8869 return IFM2_BASE2;
8870 case 2836:
8871 return IFM2_BASE2_HI;
8872 case 2840:
8873 return IFM2_BASE3;
8874 case 2844:
8875 return IFM2_BASE3_HI;
8876 case 2848:
8877 return IFM2_STRIDE_X;
8878 case 2852:
8879 return IFM2_STRIDE_X_HI;
8880 case 2856:
8881 return IFM2_STRIDE_Y;
8882 case 2860:
8883 return IFM2_STRIDE_Y_HI;
8884 case 2864:
8885 return IFM2_STRIDE_C;
8886 case 2868:
8887 return IFM2_STRIDE_C_HI;
8888 case 2880:
8889 return WEIGHT1_BASE;
8890 case 2884:
8891 return WEIGHT1_BASE_HI;
8892 case 2888:
8893 return WEIGHT1_LENGTH;
8894 case 2892:
8895 return WEIGHT1_LENGTH_HI;
8896 case 2896:
8897 return SCALE1_BASE;
8898 case 2900:
8899 return SCALE1_BASE_HI;
8900 case 2904:
8901 return SCALE1_LENGTH;
8902 case 384:
8903 return PMCR;
8904 case 388:
8905 return PMCNTENSET;
8906 case 392:
8907 return PMCNTENCLR;
8908 case 396:
8909 return PMOVSSET;
8910 case 400:
8911 return PMOVSCLR;
8912 case 404:
8913 return PMINTSET;
8914 case 408:
8915 return PMINTCLR;
8916 case 416:
8917 return PMCCNTR_LO;
8918 case 420:
8919 return PMCCNTR_HI;
8920 case 424:
8921 return PMCCNTR_CFG;
8922 case 428:
8923 return PMCAXI_CHAN;
8924 case 768:
8925 return PMEVCNTR[0];
8926 case 772:
8927 return PMEVCNTR[1];
8928 case 776:
8929 return PMEVCNTR[2];
8930 case 780:
8931 return PMEVCNTR[3];
8932 case 896:
8933 return PMEVTYPER[0];
8934 case 900:
8935 return PMEVTYPER[1];
8936 case 904:
8937 return PMEVTYPER[2];
8938 case 908:
8939 return PMEVTYPER[3];
8940 case 1024:
8941 return SHARED_BUFFER[0];
8942 case 1028:
8943 return SHARED_BUFFER[1];
8944 case 1032:
8945 return SHARED_BUFFER[2];
8946 case 1036:
8947 return SHARED_BUFFER[3];
8948 case 1040:
8949 return SHARED_BUFFER[4];
8950 case 1044:
8951 return SHARED_BUFFER[5];
8952 case 1048:
8953 return SHARED_BUFFER[6];
8954 case 1052:
8955 return SHARED_BUFFER[7];
8956 case 1056:
8957 return SHARED_BUFFER[8];
8958 case 1060:
8959 return SHARED_BUFFER[9];
8960 case 1064:
8961 return SHARED_BUFFER[10];
8962 case 1068:
8963 return SHARED_BUFFER[11];
8964 case 1072:
8965 return SHARED_BUFFER[12];
8966 case 1076:
8967 return SHARED_BUFFER[13];
8968 case 1080:
8969 return SHARED_BUFFER[14];
8970 case 1084:
8971 return SHARED_BUFFER[15];
8972 case 1088:
8973 return SHARED_BUFFER[16];
8974 case 1092:
8975 return SHARED_BUFFER[17];
8976 case 1096:
8977 return SHARED_BUFFER[18];
8978 case 1100:
8979 return SHARED_BUFFER[19];
8980 case 1104:
8981 return SHARED_BUFFER[20];
8982 case 1108:
8983 return SHARED_BUFFER[21];
8984 case 1112:
8985 return SHARED_BUFFER[22];
8986 case 1116:
8987 return SHARED_BUFFER[23];
8988 case 1120:
8989 return SHARED_BUFFER[24];
8990 case 1124:
8991 return SHARED_BUFFER[25];
8992 case 1128:
8993 return SHARED_BUFFER[26];
8994 case 1132:
8995 return SHARED_BUFFER[27];
8996 case 1136:
8997 return SHARED_BUFFER[28];
8998 case 1140:
8999 return SHARED_BUFFER[29];
9000 case 1144:
9001 return SHARED_BUFFER[30];
9002 case 1148:
9003 return SHARED_BUFFER[31];
9004 case 1152:
9005 return SHARED_BUFFER[32];
9006 case 1156:
9007 return SHARED_BUFFER[33];
9008 case 1160:
9009 return SHARED_BUFFER[34];
9010 case 1164:
9011 return SHARED_BUFFER[35];
9012 case 1168:
9013 return SHARED_BUFFER[36];
9014 case 1172:
9015 return SHARED_BUFFER[37];
9016 case 1176:
9017 return SHARED_BUFFER[38];
9018 case 1180:
9019 return SHARED_BUFFER[39];
9020 case 1184:
9021 return SHARED_BUFFER[40];
9022 case 1188:
9023 return SHARED_BUFFER[41];
9024 case 1192:
9025 return SHARED_BUFFER[42];
9026 case 1196:
9027 return SHARED_BUFFER[43];
9028 case 1200:
9029 return SHARED_BUFFER[44];
9030 case 1204:
9031 return SHARED_BUFFER[45];
9032 case 1208:
9033 return SHARED_BUFFER[46];
9034 case 1212:
9035 return SHARED_BUFFER[47];
9036 case 1216:
9037 return SHARED_BUFFER[48];
9038 case 1220:
9039 return SHARED_BUFFER[49];
9040 case 1224:
9041 return SHARED_BUFFER[50];
9042 case 1228:
9043 return SHARED_BUFFER[51];
9044 case 1232:
9045 return SHARED_BUFFER[52];
9046 case 1236:
9047 return SHARED_BUFFER[53];
9048 case 1240:
9049 return SHARED_BUFFER[54];
9050 case 1244:
9051 return SHARED_BUFFER[55];
9052 case 1248:
9053 return SHARED_BUFFER[56];
9054 case 1252:
9055 return SHARED_BUFFER[57];
9056 case 1256:
9057 return SHARED_BUFFER[58];
9058 case 1260:
9059 return SHARED_BUFFER[59];
9060 case 1264:
9061 return SHARED_BUFFER[60];
9062 case 1268:
9063 return SHARED_BUFFER[61];
9064 case 1272:
9065 return SHARED_BUFFER[62];
9066 case 1276:
9067 return SHARED_BUFFER[63];
9068 case 1280:
9069 return SHARED_BUFFER[64];
9070 case 1284:
9071 return SHARED_BUFFER[65];
9072 case 1288:
9073 return SHARED_BUFFER[66];
9074 case 1292:
9075 return SHARED_BUFFER[67];
9076 case 1296:
9077 return SHARED_BUFFER[68];
9078 case 1300:
9079 return SHARED_BUFFER[69];
9080 case 1304:
9081 return SHARED_BUFFER[70];
9082 case 1308:
9083 return SHARED_BUFFER[71];
9084 case 1312:
9085 return SHARED_BUFFER[72];
9086 case 1316:
9087 return SHARED_BUFFER[73];
9088 case 1320:
9089 return SHARED_BUFFER[74];
9090 case 1324:
9091 return SHARED_BUFFER[75];
9092 case 1328:
9093 return SHARED_BUFFER[76];
9094 case 1332:
9095 return SHARED_BUFFER[77];
9096 case 1336:
9097 return SHARED_BUFFER[78];
9098 case 1340:
9099 return SHARED_BUFFER[79];
9100 case 1344:
9101 return SHARED_BUFFER[80];
9102 case 1348:
9103 return SHARED_BUFFER[81];
9104 case 1352:
9105 return SHARED_BUFFER[82];
9106 case 1356:
9107 return SHARED_BUFFER[83];
9108 case 1360:
9109 return SHARED_BUFFER[84];
9110 case 1364:
9111 return SHARED_BUFFER[85];
9112 case 1368:
9113 return SHARED_BUFFER[86];
9114 case 1372:
9115 return SHARED_BUFFER[87];
9116 case 1376:
9117 return SHARED_BUFFER[88];
9118 case 1380:
9119 return SHARED_BUFFER[89];
9120 case 1384:
9121 return SHARED_BUFFER[90];
9122 case 1388:
9123 return SHARED_BUFFER[91];
9124 case 1392:
9125 return SHARED_BUFFER[92];
9126 case 1396:
9127 return SHARED_BUFFER[93];
9128 case 1400:
9129 return SHARED_BUFFER[94];
9130 case 1404:
9131 return SHARED_BUFFER[95];
9132 case 1408:
9133 return SHARED_BUFFER[96];
9134 case 1412:
9135 return SHARED_BUFFER[97];
9136 case 1416:
9137 return SHARED_BUFFER[98];
9138 case 1420:
9139 return SHARED_BUFFER[99];
9140 case 1424:
9141 return SHARED_BUFFER[100];
9142 case 1428:
9143 return SHARED_BUFFER[101];
9144 case 1432:
9145 return SHARED_BUFFER[102];
9146 case 1436:
9147 return SHARED_BUFFER[103];
9148 case 1440:
9149 return SHARED_BUFFER[104];
9150 case 1444:
9151 return SHARED_BUFFER[105];
9152 case 1448:
9153 return SHARED_BUFFER[106];
9154 case 1452:
9155 return SHARED_BUFFER[107];
9156 case 1456:
9157 return SHARED_BUFFER[108];
9158 case 1460:
9159 return SHARED_BUFFER[109];
9160 case 1464:
9161 return SHARED_BUFFER[110];
9162 case 1468:
9163 return SHARED_BUFFER[111];
9164 case 1472:
9165 return SHARED_BUFFER[112];
9166 case 1476:
9167 return SHARED_BUFFER[113];
9168 case 1480:
9169 return SHARED_BUFFER[114];
9170 case 1484:
9171 return SHARED_BUFFER[115];
9172 case 1488:
9173 return SHARED_BUFFER[116];
9174 case 1492:
9175 return SHARED_BUFFER[117];
9176 case 1496:
9177 return SHARED_BUFFER[118];
9178 case 1500:
9179 return SHARED_BUFFER[119];
9180 case 1504:
9181 return SHARED_BUFFER[120];
9182 case 1508:
9183 return SHARED_BUFFER[121];
9184 case 1512:
9185 return SHARED_BUFFER[122];
9186 case 1516:
9187 return SHARED_BUFFER[123];
9188 case 1520:
9189 return SHARED_BUFFER[124];
9190 case 1524:
9191 return SHARED_BUFFER[125];
9192 case 1528:
9193 return SHARED_BUFFER[126];
9194 case 1532:
9195 return SHARED_BUFFER[127];
9196 case 1536:
9197 return SHARED_BUFFER[128];
9198 case 1540:
9199 return SHARED_BUFFER[129];
9200 case 1544:
9201 return SHARED_BUFFER[130];
9202 case 1548:
9203 return SHARED_BUFFER[131];
9204 case 1552:
9205 return SHARED_BUFFER[132];
9206 case 1556:
9207 return SHARED_BUFFER[133];
9208 case 1560:
9209 return SHARED_BUFFER[134];
9210 case 1564:
9211 return SHARED_BUFFER[135];
9212 case 1568:
9213 return SHARED_BUFFER[136];
9214 case 1572:
9215 return SHARED_BUFFER[137];
9216 case 1576:
9217 return SHARED_BUFFER[138];
9218 case 1580:
9219 return SHARED_BUFFER[139];
9220 case 1584:
9221 return SHARED_BUFFER[140];
9222 case 1588:
9223 return SHARED_BUFFER[141];
9224 case 1592:
9225 return SHARED_BUFFER[142];
9226 case 1596:
9227 return SHARED_BUFFER[143];
9228 case 1600:
9229 return SHARED_BUFFER[144];
9230 case 1604:
9231 return SHARED_BUFFER[145];
9232 case 1608:
9233 return SHARED_BUFFER[146];
9234 case 1612:
9235 return SHARED_BUFFER[147];
9236 case 1616:
9237 return SHARED_BUFFER[148];
9238 case 1620:
9239 return SHARED_BUFFER[149];
9240 case 1624:
9241 return SHARED_BUFFER[150];
9242 case 1628:
9243 return SHARED_BUFFER[151];
9244 case 1632:
9245 return SHARED_BUFFER[152];
9246 case 1636:
9247 return SHARED_BUFFER[153];
9248 case 1640:
9249 return SHARED_BUFFER[154];
9250 case 1644:
9251 return SHARED_BUFFER[155];
9252 case 1648:
9253 return SHARED_BUFFER[156];
9254 case 1652:
9255 return SHARED_BUFFER[157];
9256 case 1656:
9257 return SHARED_BUFFER[158];
9258 case 1660:
9259 return SHARED_BUFFER[159];
9260 case 1664:
9261 return SHARED_BUFFER[160];
9262 case 1668:
9263 return SHARED_BUFFER[161];
9264 case 1672:
9265 return SHARED_BUFFER[162];
9266 case 1676:
9267 return SHARED_BUFFER[163];
9268 case 1680:
9269 return SHARED_BUFFER[164];
9270 case 1684:
9271 return SHARED_BUFFER[165];
9272 case 1688:
9273 return SHARED_BUFFER[166];
9274 case 1692:
9275 return SHARED_BUFFER[167];
9276 case 1696:
9277 return SHARED_BUFFER[168];
9278 case 1700:
9279 return SHARED_BUFFER[169];
9280 case 1704:
9281 return SHARED_BUFFER[170];
9282 case 1708:
9283 return SHARED_BUFFER[171];
9284 case 1712:
9285 return SHARED_BUFFER[172];
9286 case 1716:
9287 return SHARED_BUFFER[173];
9288 case 1720:
9289 return SHARED_BUFFER[174];
9290 case 1724:
9291 return SHARED_BUFFER[175];
9292 case 1728:
9293 return SHARED_BUFFER[176];
9294 case 1732:
9295 return SHARED_BUFFER[177];
9296 case 1736:
9297 return SHARED_BUFFER[178];
9298 case 1740:
9299 return SHARED_BUFFER[179];
9300 case 1744:
9301 return SHARED_BUFFER[180];
9302 case 1748:
9303 return SHARED_BUFFER[181];
9304 case 1752:
9305 return SHARED_BUFFER[182];
9306 case 1756:
9307 return SHARED_BUFFER[183];
9308 case 1760:
9309 return SHARED_BUFFER[184];
9310 case 1764:
9311 return SHARED_BUFFER[185];
9312 case 1768:
9313 return SHARED_BUFFER[186];
9314 case 1772:
9315 return SHARED_BUFFER[187];
9316 case 1776:
9317 return SHARED_BUFFER[188];
9318 case 1780:
9319 return SHARED_BUFFER[189];
9320 case 1784:
9321 return SHARED_BUFFER[190];
9322 case 1788:
9323 return SHARED_BUFFER[191];
9324 case 1792:
9325 return SHARED_BUFFER[192];
9326 case 1796:
9327 return SHARED_BUFFER[193];
9328 case 1800:
9329 return SHARED_BUFFER[194];
9330 case 1804:
9331 return SHARED_BUFFER[195];
9332 case 1808:
9333 return SHARED_BUFFER[196];
9334 case 1812:
9335 return SHARED_BUFFER[197];
9336 case 1816:
9337 return SHARED_BUFFER[198];
9338 case 1820:
9339 return SHARED_BUFFER[199];
9340 case 1824:
9341 return SHARED_BUFFER[200];
9342 case 1828:
9343 return SHARED_BUFFER[201];
9344 case 1832:
9345 return SHARED_BUFFER[202];
9346 case 1836:
9347 return SHARED_BUFFER[203];
9348 case 1840:
9349 return SHARED_BUFFER[204];
9350 case 1844:
9351 return SHARED_BUFFER[205];
9352 case 1848:
9353 return SHARED_BUFFER[206];
9354 case 1852:
9355 return SHARED_BUFFER[207];
9356 case 1856:
9357 return SHARED_BUFFER[208];
9358 case 1860:
9359 return SHARED_BUFFER[209];
9360 case 1864:
9361 return SHARED_BUFFER[210];
9362 case 1868:
9363 return SHARED_BUFFER[211];
9364 case 1872:
9365 return SHARED_BUFFER[212];
9366 case 1876:
9367 return SHARED_BUFFER[213];
9368 case 1880:
9369 return SHARED_BUFFER[214];
9370 case 1884:
9371 return SHARED_BUFFER[215];
9372 case 1888:
9373 return SHARED_BUFFER[216];
9374 case 1892:
9375 return SHARED_BUFFER[217];
9376 case 1896:
9377 return SHARED_BUFFER[218];
9378 case 1900:
9379 return SHARED_BUFFER[219];
9380 case 1904:
9381 return SHARED_BUFFER[220];
9382 case 1908:
9383 return SHARED_BUFFER[221];
9384 case 1912:
9385 return SHARED_BUFFER[222];
9386 case 1916:
9387 return SHARED_BUFFER[223];
9388 case 1920:
9389 return SHARED_BUFFER[224];
9390 case 1924:
9391 return SHARED_BUFFER[225];
9392 case 1928:
9393 return SHARED_BUFFER[226];
9394 case 1932:
9395 return SHARED_BUFFER[227];
9396 case 1936:
9397 return SHARED_BUFFER[228];
9398 case 1940:
9399 return SHARED_BUFFER[229];
9400 case 1944:
9401 return SHARED_BUFFER[230];
9402 case 1948:
9403 return SHARED_BUFFER[231];
9404 case 1952:
9405 return SHARED_BUFFER[232];
9406 case 1956:
9407 return SHARED_BUFFER[233];
9408 case 1960:
9409 return SHARED_BUFFER[234];
9410 case 1964:
9411 return SHARED_BUFFER[235];
9412 case 1968:
9413 return SHARED_BUFFER[236];
9414 case 1972:
9415 return SHARED_BUFFER[237];
9416 case 1976:
9417 return SHARED_BUFFER[238];
9418 case 1980:
9419 return SHARED_BUFFER[239];
9420 case 1984:
9421 return SHARED_BUFFER[240];
9422 case 1988:
9423 return SHARED_BUFFER[241];
9424 case 1992:
9425 return SHARED_BUFFER[242];
9426 case 1996:
9427 return SHARED_BUFFER[243];
9428 case 2000:
9429 return SHARED_BUFFER[244];
9430 case 2004:
9431 return SHARED_BUFFER[245];
9432 case 2008:
9433 return SHARED_BUFFER[246];
9434 case 2012:
9435 return SHARED_BUFFER[247];
9436 case 2016:
9437 return SHARED_BUFFER[248];
9438 case 2020:
9439 return SHARED_BUFFER[249];
9440 case 2024:
9441 return SHARED_BUFFER[250];
9442 case 2028:
9443 return SHARED_BUFFER[251];
9444 case 2032:
9445 return SHARED_BUFFER[252];
9446 case 2036:
9447 return SHARED_BUFFER[253];
9448 case 2040:
9449 return SHARED_BUFFER[254];
9450 case 2044:
9451 return SHARED_BUFFER[255];
9452 default:
9453 throw std::runtime_error("invalid register address");
9454 }
9455 }
9456 void set(size_t offset, uint32_t value)
9457 {
9458 switch (offset)
9459 {
9460 case 0:
9461 ID = value;
9462 return;
9463 case 4:
9464 STATUS = value;
9465 return;
9466 case 8:
9467 CMD = value;
9468 return;
9469 case 12:
9470 RESET = value;
9471 return;
9472 case 16:
9473 QBASE0 = value;
9474 return;
9475 case 20:
9476 QBASE1 = value;
9477 return;
9478 case 24:
9479 QREAD = value;
9480 return;
9481 case 28:
9482 QCONFIG = value;
9483 return;
9484 case 32:
9485 QSIZE = value;
9486 return;
9487 case 36:
9488 PROT = value;
9489 return;
9490 case 40:
9491 CONFIG = value;
9492 return;
9493 case 44:
9494 LOCK = value;
9495 return;
9496 case 60:
9497 REGIONCFG = value;
9498 return;
9499 case 64:
9500 AXI_LIMIT0 = value;
9501 return;
9502 case 68:
9503 AXI_LIMIT1 = value;
9504 return;
9505 case 72:
9506 AXI_LIMIT2 = value;
9507 return;
9508 case 76:
9509 AXI_LIMIT3 = value;
9510 return;
9511 case 128:
9512 BASEP0 = value;
9513 return;
9514 case 132:
9515 BASEP1 = value;
9516 return;
9517 case 136:
9518 BASEP2 = value;
9519 return;
9520 case 140:
9521 BASEP3 = value;
9522 return;
9523 case 144:
9524 BASEP4 = value;
9525 return;
9526 case 148:
9527 BASEP5 = value;
9528 return;
9529 case 152:
9530 BASEP6 = value;
9531 return;
9532 case 156:
9533 BASEP7 = value;
9534 return;
9535 case 160:
9536 BASEP8 = value;
9537 return;
9538 case 164:
9539 BASEP9 = value;
9540 return;
9541 case 168:
9542 BASEP10 = value;
9543 return;
9544 case 172:
9545 BASEP11 = value;
9546 return;
9547 case 176:
9548 BASEP12 = value;
9549 return;
9550 case 180:
9551 BASEP13 = value;
9552 return;
9553 case 184:
9554 BASEP14 = value;
9555 return;
9556 case 188:
9557 BASEP15 = value;
9558 return;
9559 case 4032:
9560 REVISION = value;
9561 return;
9562 case 4048:
9563 PID4 = value;
9564 return;
9565 case 4052:
9566 PID5 = value;
9567 return;
9568 case 4056:
9569 PID6 = value;
9570 return;
9571 case 4060:
9572 PID7 = value;
9573 return;
9574 case 4064:
9575 PID0 = value;
9576 return;
9577 case 4068:
9578 PID1 = value;
9579 return;
9580 case 4072:
9581 PID2 = value;
9582 return;
9583 case 4076:
9584 PID3 = value;
9585 return;
9586 case 4080:
9587 CID0 = value;
9588 return;
9589 case 4084:
9590 CID1 = value;
9591 return;
9592 case 4088:
9593 CID2 = value;
9594 return;
9595 case 4092:
9596 CID3 = value;
9597 return;
Diqing Zhong04118062020-04-15 01:19:12 +02009598 case 256:
9599 WD_STATUS = value;
9600 return;
9601 case 260:
9602 MAC_STATUS = value;
9603 return;
9604 case 264:
9605 DMA_STATUS = value;
9606 return;
9607 case 272:
9608 AO_STATUS = value;
9609 return;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02009610 case 320:
9611 CLKFORCE = value;
9612 return;
9613 case 324:
9614 DEBUG = value;
9615 return;
9616 case 328:
9617 DEBUG2 = value;
9618 return;
9619 case 332:
9620 DEBUGCORE = value;
9621 return;
9622 case 512:
9623 KERNEL_X = value;
9624 return;
9625 case 516:
9626 KERNEL_Y = value;
9627 return;
9628 case 520:
9629 KERNEL_W_M1 = value;
9630 return;
9631 case 524:
9632 KERNEL_H_M1 = value;
9633 return;
9634 case 528:
9635 OFM_CBLK_WIDTH_M1 = value;
9636 return;
9637 case 532:
9638 OFM_CBLK_HEIGHT_M1 = value;
9639 return;
9640 case 536:
9641 OFM_CBLK_DEPTH_M1 = value;
9642 return;
9643 case 540:
9644 IFM_CBLK_DEPTH_M1 = value;
9645 return;
9646 case 544:
9647 OFM_X = value;
9648 return;
9649 case 548:
9650 OFM_Y = value;
9651 return;
9652 case 552:
9653 OFM_Z = value;
9654 return;
9655 case 556:
9656 IFM_Z = value;
9657 return;
9658 case 560:
9659 PAD_TOP = value;
9660 return;
9661 case 564:
9662 PAD_LEFT = value;
9663 return;
9664 case 568:
9665 IFM_CBLK_WIDTH = value;
9666 return;
9667 case 572:
9668 IFM_CBLK_HEIGHT = value;
9669 return;
9670 case 576:
9671 DMA_IFM_SRC = value;
9672 return;
9673 case 580:
9674 DMA_IFM_SRC_HI = value;
9675 return;
9676 case 584:
9677 DMA_IFM_DST = value;
9678 return;
9679 case 588:
9680 DMA_OFM_SRC = value;
9681 return;
9682 case 592:
9683 DMA_OFM_DST = value;
9684 return;
9685 case 596:
9686 DMA_OFM_DST_HI = value;
9687 return;
9688 case 600:
9689 DMA_WEIGHT_SRC = value;
9690 return;
9691 case 604:
9692 DMA_WEIGHT_SRC_HI = value;
9693 return;
9694 case 608:
9695 DMA_CMD_SRC = value;
9696 return;
9697 case 612:
9698 DMA_CMD_SRC_HI = value;
9699 return;
9700 case 616:
9701 DMA_CMD_SIZE = value;
9702 return;
9703 case 620:
9704 DMA_M2M_SRC = value;
9705 return;
9706 case 624:
9707 DMA_M2M_SRC_HI = value;
9708 return;
9709 case 628:
9710 DMA_M2M_DST = value;
9711 return;
9712 case 632:
9713 DMA_M2M_DST_HI = value;
9714 return;
9715 case 636:
9716 CURRENT_QREAD = value;
9717 return;
9718 case 640:
9719 DMA_SCALE_SRC = value;
9720 return;
9721 case 644:
9722 DMA_SCALE_SRC_HI = value;
9723 return;
9724 case 700:
9725 CURRENT_CMD = value;
9726 return;
9727 case 2048:
9728 IFM_PAD_TOP = value;
9729 return;
9730 case 2052:
9731 IFM_PAD_LEFT = value;
9732 return;
9733 case 2056:
9734 IFM_PAD_RIGHT = value;
9735 return;
9736 case 2060:
9737 IFM_PAD_BOTTOM = value;
9738 return;
9739 case 2064:
9740 IFM_DEPTH_M1 = value;
9741 return;
9742 case 2068:
9743 IFM_PRECISION = value;
9744 return;
9745 case 2076:
9746 IFM_UPSCALE = value;
9747 return;
9748 case 2084:
9749 IFM_ZERO_POINT = value;
9750 return;
9751 case 2088:
9752 IFM_WIDTH0_M1 = value;
9753 return;
9754 case 2092:
9755 IFM_HEIGHT0_M1 = value;
9756 return;
9757 case 2096:
9758 IFM_HEIGHT1_M1 = value;
9759 return;
9760 case 2100:
9761 IFM_IB_END = value;
9762 return;
9763 case 2108:
9764 IFM_REGION = value;
9765 return;
9766 case 2116:
9767 OFM_WIDTH_M1 = value;
9768 return;
9769 case 2120:
9770 OFM_HEIGHT_M1 = value;
9771 return;
9772 case 2124:
9773 OFM_DEPTH_M1 = value;
9774 return;
9775 case 2128:
9776 OFM_PRECISION = value;
9777 return;
9778 case 2132:
9779 OFM_BLK_WIDTH_M1 = value;
9780 return;
9781 case 2136:
9782 OFM_BLK_HEIGHT_M1 = value;
9783 return;
9784 case 2140:
9785 OFM_BLK_DEPTH_M1 = value;
9786 return;
9787 case 2144:
9788 OFM_ZERO_POINT = value;
9789 return;
9790 case 2152:
9791 OFM_WIDTH0_M1 = value;
9792 return;
9793 case 2156:
9794 OFM_HEIGHT0_M1 = value;
9795 return;
9796 case 2160:
9797 OFM_HEIGHT1_M1 = value;
9798 return;
9799 case 2172:
9800 OFM_REGION = value;
9801 return;
9802 case 2176:
9803 KERNEL_WIDTH_M1 = value;
9804 return;
9805 case 2180:
9806 KERNEL_HEIGHT_M1 = value;
9807 return;
9808 case 2184:
9809 KERNEL_STRIDE = value;
9810 return;
9811 case 2188:
9812 PARALLEL_MODE = value;
9813 return;
9814 case 2192:
9815 ACC_FORMAT = value;
9816 return;
9817 case 2196:
9818 ACTIVATION = value;
9819 return;
9820 case 2200:
9821 ACTIVATION_MIN = value;
9822 return;
9823 case 2204:
9824 ACTIVATION_MAX = value;
9825 return;
9826 case 2208:
9827 WEIGHT_REGION = value;
9828 return;
9829 case 2212:
9830 SCALE_REGION = value;
9831 return;
9832 case 2228:
9833 AB_START = value;
9834 return;
9835 case 2236:
9836 BLOCKDEP = value;
9837 return;
9838 case 2240:
9839 DMA0_SRC_REGION = value;
9840 return;
9841 case 2244:
9842 DMA0_DST_REGION = value;
9843 return;
9844 case 2248:
9845 DMA0_SIZE0 = value;
9846 return;
9847 case 2252:
9848 DMA0_SIZE1 = value;
9849 return;
9850 case 2304:
9851 IFM2_BROADCAST = value;
9852 return;
9853 case 2308:
9854 IFM2_SCALAR = value;
9855 return;
9856 case 2324:
9857 IFM2_PRECISION = value;
9858 return;
9859 case 2340:
9860 IFM2_ZERO_POINT = value;
9861 return;
9862 case 2344:
9863 IFM2_WIDTH0_M1 = value;
9864 return;
9865 case 2348:
9866 IFM2_HEIGHT0_M1 = value;
9867 return;
9868 case 2352:
9869 IFM2_HEIGHT1_M1 = value;
9870 return;
9871 case 2356:
9872 IFM2_IB_START = value;
9873 return;
9874 case 2364:
9875 IFM2_REGION = value;
9876 return;
9877 case 2560:
9878 IFM_BASE0 = value;
9879 return;
9880 case 2564:
9881 IFM_BASE0_HI = value;
9882 return;
9883 case 2568:
9884 IFM_BASE1 = value;
9885 return;
9886 case 2572:
9887 IFM_BASE1_HI = value;
9888 return;
9889 case 2576:
9890 IFM_BASE2 = value;
9891 return;
9892 case 2580:
9893 IFM_BASE2_HI = value;
9894 return;
9895 case 2584:
9896 IFM_BASE3 = value;
9897 return;
9898 case 2588:
9899 IFM_BASE3_HI = value;
9900 return;
9901 case 2592:
9902 IFM_STRIDE_X = value;
9903 return;
9904 case 2596:
9905 IFM_STRIDE_X_HI = value;
9906 return;
9907 case 2600:
9908 IFM_STRIDE_Y = value;
9909 return;
9910 case 2604:
9911 IFM_STRIDE_Y_HI = value;
9912 return;
9913 case 2608:
9914 IFM_STRIDE_C = value;
9915 return;
9916 case 2612:
9917 IFM_STRIDE_C_HI = value;
9918 return;
9919 case 2624:
9920 OFM_BASE0 = value;
9921 return;
9922 case 2628:
9923 OFM_BASE0_HI = value;
9924 return;
9925 case 2632:
9926 OFM_BASE1 = value;
9927 return;
9928 case 2636:
9929 OFM_BASE1_HI = value;
9930 return;
9931 case 2640:
9932 OFM_BASE2 = value;
9933 return;
9934 case 2644:
9935 OFM_BASE2_HI = value;
9936 return;
9937 case 2648:
9938 OFM_BASE3 = value;
9939 return;
9940 case 2652:
9941 OFM_BASE3_HI = value;
9942 return;
9943 case 2656:
9944 OFM_STRIDE_X = value;
9945 return;
9946 case 2660:
9947 OFM_STRIDE_X_HI = value;
9948 return;
9949 case 2664:
9950 OFM_STRIDE_Y = value;
9951 return;
9952 case 2668:
9953 OFM_STRIDE_Y_HI = value;
9954 return;
9955 case 2672:
9956 OFM_STRIDE_C = value;
9957 return;
9958 case 2676:
9959 OFM_STRIDE_C_HI = value;
9960 return;
9961 case 2688:
9962 WEIGHT_BASE = value;
9963 return;
9964 case 2692:
9965 WEIGHT_BASE_HI = value;
9966 return;
9967 case 2696:
9968 WEIGHT_LENGTH = value;
9969 return;
9970 case 2700:
9971 WEIGHT_LENGTH_HI = value;
9972 return;
9973 case 2704:
9974 SCALE_BASE = value;
9975 return;
9976 case 2708:
9977 SCALE_BASE_HI = value;
9978 return;
9979 case 2712:
9980 SCALE_LENGTH = value;
9981 return;
9982 case 2720:
9983 OFM_SCALE = value;
9984 return;
9985 case 2724:
9986 OFM_SCALE_SHIFT = value;
9987 return;
9988 case 2728:
9989 OPA_SCALE = value;
9990 return;
9991 case 2732:
9992 OPA_SCALE_SHIFT = value;
9993 return;
9994 case 2736:
9995 OPB_SCALE = value;
9996 return;
9997 case 2752:
9998 DMA0_SRC = value;
9999 return;
10000 case 2756:
10001 DMA0_SRC_HI = value;
10002 return;
10003 case 2760:
10004 DMA0_DST = value;
10005 return;
10006 case 2764:
10007 DMA0_DST_HI = value;
10008 return;
10009 case 2768:
10010 DMA0_LEN = value;
10011 return;
10012 case 2772:
10013 DMA0_LEN_HI = value;
10014 return;
10015 case 2776:
10016 DMA0_SKIP0 = value;
10017 return;
10018 case 2780:
10019 DMA0_SKIP0_HI = value;
10020 return;
10021 case 2784:
10022 DMA0_SKIP1 = value;
10023 return;
10024 case 2788:
10025 DMA0_SKIP1_HI = value;
10026 return;
10027 case 2816:
10028 IFM2_BASE0 = value;
10029 return;
10030 case 2820:
10031 IFM2_BASE0_HI = value;
10032 return;
10033 case 2824:
10034 IFM2_BASE1 = value;
10035 return;
10036 case 2828:
10037 IFM2_BASE1_HI = value;
10038 return;
10039 case 2832:
10040 IFM2_BASE2 = value;
10041 return;
10042 case 2836:
10043 IFM2_BASE2_HI = value;
10044 return;
10045 case 2840:
10046 IFM2_BASE3 = value;
10047 return;
10048 case 2844:
10049 IFM2_BASE3_HI = value;
10050 return;
10051 case 2848:
10052 IFM2_STRIDE_X = value;
10053 return;
10054 case 2852:
10055 IFM2_STRIDE_X_HI = value;
10056 return;
10057 case 2856:
10058 IFM2_STRIDE_Y = value;
10059 return;
10060 case 2860:
10061 IFM2_STRIDE_Y_HI = value;
10062 return;
10063 case 2864:
10064 IFM2_STRIDE_C = value;
10065 return;
10066 case 2868:
10067 IFM2_STRIDE_C_HI = value;
10068 return;
10069 case 2880:
10070 WEIGHT1_BASE = value;
10071 return;
10072 case 2884:
10073 WEIGHT1_BASE_HI = value;
10074 return;
10075 case 2888:
10076 WEIGHT1_LENGTH = value;
10077 return;
10078 case 2892:
10079 WEIGHT1_LENGTH_HI = value;
10080 return;
10081 case 2896:
10082 SCALE1_BASE = value;
10083 return;
10084 case 2900:
10085 SCALE1_BASE_HI = value;
10086 return;
10087 case 2904:
10088 SCALE1_LENGTH = value;
10089 return;
10090 case 384:
10091 PMCR = value;
10092 return;
10093 case 388:
10094 PMCNTENSET = value;
10095 return;
10096 case 392:
10097 PMCNTENCLR = value;
10098 return;
10099 case 396:
10100 PMOVSSET = value;
10101 return;
10102 case 400:
10103 PMOVSCLR = value;
10104 return;
10105 case 404:
10106 PMINTSET = value;
10107 return;
10108 case 408:
10109 PMINTCLR = value;
10110 return;
10111 case 416:
10112 PMCCNTR_LO = value;
10113 return;
10114 case 420:
10115 PMCCNTR_HI = value;
10116 return;
10117 case 424:
10118 PMCCNTR_CFG = value;
10119 return;
10120 case 428:
10121 PMCAXI_CHAN = value;
10122 return;
10123 case 768:
10124 PMEVCNTR[0] = value;
10125 return;
10126 case 772:
10127 PMEVCNTR[1] = value;
10128 return;
10129 case 776:
10130 PMEVCNTR[2] = value;
10131 return;
10132 case 780:
10133 PMEVCNTR[3] = value;
10134 return;
10135 case 896:
10136 PMEVTYPER[0] = value;
10137 return;
10138 case 900:
10139 PMEVTYPER[1] = value;
10140 return;
10141 case 904:
10142 PMEVTYPER[2] = value;
10143 return;
10144 case 908:
10145 PMEVTYPER[3] = value;
10146 return;
10147 case 1024:
10148 SHARED_BUFFER[0] = value;
10149 return;
10150 case 1028:
10151 SHARED_BUFFER[1] = value;
10152 return;
10153 case 1032:
10154 SHARED_BUFFER[2] = value;
10155 return;
10156 case 1036:
10157 SHARED_BUFFER[3] = value;
10158 return;
10159 case 1040:
10160 SHARED_BUFFER[4] = value;
10161 return;
10162 case 1044:
10163 SHARED_BUFFER[5] = value;
10164 return;
10165 case 1048:
10166 SHARED_BUFFER[6] = value;
10167 return;
10168 case 1052:
10169 SHARED_BUFFER[7] = value;
10170 return;
10171 case 1056:
10172 SHARED_BUFFER[8] = value;
10173 return;
10174 case 1060:
10175 SHARED_BUFFER[9] = value;
10176 return;
10177 case 1064:
10178 SHARED_BUFFER[10] = value;
10179 return;
10180 case 1068:
10181 SHARED_BUFFER[11] = value;
10182 return;
10183 case 1072:
10184 SHARED_BUFFER[12] = value;
10185 return;
10186 case 1076:
10187 SHARED_BUFFER[13] = value;
10188 return;
10189 case 1080:
10190 SHARED_BUFFER[14] = value;
10191 return;
10192 case 1084:
10193 SHARED_BUFFER[15] = value;
10194 return;
10195 case 1088:
10196 SHARED_BUFFER[16] = value;
10197 return;
10198 case 1092:
10199 SHARED_BUFFER[17] = value;
10200 return;
10201 case 1096:
10202 SHARED_BUFFER[18] = value;
10203 return;
10204 case 1100:
10205 SHARED_BUFFER[19] = value;
10206 return;
10207 case 1104:
10208 SHARED_BUFFER[20] = value;
10209 return;
10210 case 1108:
10211 SHARED_BUFFER[21] = value;
10212 return;
10213 case 1112:
10214 SHARED_BUFFER[22] = value;
10215 return;
10216 case 1116:
10217 SHARED_BUFFER[23] = value;
10218 return;
10219 case 1120:
10220 SHARED_BUFFER[24] = value;
10221 return;
10222 case 1124:
10223 SHARED_BUFFER[25] = value;
10224 return;
10225 case 1128:
10226 SHARED_BUFFER[26] = value;
10227 return;
10228 case 1132:
10229 SHARED_BUFFER[27] = value;
10230 return;
10231 case 1136:
10232 SHARED_BUFFER[28] = value;
10233 return;
10234 case 1140:
10235 SHARED_BUFFER[29] = value;
10236 return;
10237 case 1144:
10238 SHARED_BUFFER[30] = value;
10239 return;
10240 case 1148:
10241 SHARED_BUFFER[31] = value;
10242 return;
10243 case 1152:
10244 SHARED_BUFFER[32] = value;
10245 return;
10246 case 1156:
10247 SHARED_BUFFER[33] = value;
10248 return;
10249 case 1160:
10250 SHARED_BUFFER[34] = value;
10251 return;
10252 case 1164:
10253 SHARED_BUFFER[35] = value;
10254 return;
10255 case 1168:
10256 SHARED_BUFFER[36] = value;
10257 return;
10258 case 1172:
10259 SHARED_BUFFER[37] = value;
10260 return;
10261 case 1176:
10262 SHARED_BUFFER[38] = value;
10263 return;
10264 case 1180:
10265 SHARED_BUFFER[39] = value;
10266 return;
10267 case 1184:
10268 SHARED_BUFFER[40] = value;
10269 return;
10270 case 1188:
10271 SHARED_BUFFER[41] = value;
10272 return;
10273 case 1192:
10274 SHARED_BUFFER[42] = value;
10275 return;
10276 case 1196:
10277 SHARED_BUFFER[43] = value;
10278 return;
10279 case 1200:
10280 SHARED_BUFFER[44] = value;
10281 return;
10282 case 1204:
10283 SHARED_BUFFER[45] = value;
10284 return;
10285 case 1208:
10286 SHARED_BUFFER[46] = value;
10287 return;
10288 case 1212:
10289 SHARED_BUFFER[47] = value;
10290 return;
10291 case 1216:
10292 SHARED_BUFFER[48] = value;
10293 return;
10294 case 1220:
10295 SHARED_BUFFER[49] = value;
10296 return;
10297 case 1224:
10298 SHARED_BUFFER[50] = value;
10299 return;
10300 case 1228:
10301 SHARED_BUFFER[51] = value;
10302 return;
10303 case 1232:
10304 SHARED_BUFFER[52] = value;
10305 return;
10306 case 1236:
10307 SHARED_BUFFER[53] = value;
10308 return;
10309 case 1240:
10310 SHARED_BUFFER[54] = value;
10311 return;
10312 case 1244:
10313 SHARED_BUFFER[55] = value;
10314 return;
10315 case 1248:
10316 SHARED_BUFFER[56] = value;
10317 return;
10318 case 1252:
10319 SHARED_BUFFER[57] = value;
10320 return;
10321 case 1256:
10322 SHARED_BUFFER[58] = value;
10323 return;
10324 case 1260:
10325 SHARED_BUFFER[59] = value;
10326 return;
10327 case 1264:
10328 SHARED_BUFFER[60] = value;
10329 return;
10330 case 1268:
10331 SHARED_BUFFER[61] = value;
10332 return;
10333 case 1272:
10334 SHARED_BUFFER[62] = value;
10335 return;
10336 case 1276:
10337 SHARED_BUFFER[63] = value;
10338 return;
10339 case 1280:
10340 SHARED_BUFFER[64] = value;
10341 return;
10342 case 1284:
10343 SHARED_BUFFER[65] = value;
10344 return;
10345 case 1288:
10346 SHARED_BUFFER[66] = value;
10347 return;
10348 case 1292:
10349 SHARED_BUFFER[67] = value;
10350 return;
10351 case 1296:
10352 SHARED_BUFFER[68] = value;
10353 return;
10354 case 1300:
10355 SHARED_BUFFER[69] = value;
10356 return;
10357 case 1304:
10358 SHARED_BUFFER[70] = value;
10359 return;
10360 case 1308:
10361 SHARED_BUFFER[71] = value;
10362 return;
10363 case 1312:
10364 SHARED_BUFFER[72] = value;
10365 return;
10366 case 1316:
10367 SHARED_BUFFER[73] = value;
10368 return;
10369 case 1320:
10370 SHARED_BUFFER[74] = value;
10371 return;
10372 case 1324:
10373 SHARED_BUFFER[75] = value;
10374 return;
10375 case 1328:
10376 SHARED_BUFFER[76] = value;
10377 return;
10378 case 1332:
10379 SHARED_BUFFER[77] = value;
10380 return;
10381 case 1336:
10382 SHARED_BUFFER[78] = value;
10383 return;
10384 case 1340:
10385 SHARED_BUFFER[79] = value;
10386 return;
10387 case 1344:
10388 SHARED_BUFFER[80] = value;
10389 return;
10390 case 1348:
10391 SHARED_BUFFER[81] = value;
10392 return;
10393 case 1352:
10394 SHARED_BUFFER[82] = value;
10395 return;
10396 case 1356:
10397 SHARED_BUFFER[83] = value;
10398 return;
10399 case 1360:
10400 SHARED_BUFFER[84] = value;
10401 return;
10402 case 1364:
10403 SHARED_BUFFER[85] = value;
10404 return;
10405 case 1368:
10406 SHARED_BUFFER[86] = value;
10407 return;
10408 case 1372:
10409 SHARED_BUFFER[87] = value;
10410 return;
10411 case 1376:
10412 SHARED_BUFFER[88] = value;
10413 return;
10414 case 1380:
10415 SHARED_BUFFER[89] = value;
10416 return;
10417 case 1384:
10418 SHARED_BUFFER[90] = value;
10419 return;
10420 case 1388:
10421 SHARED_BUFFER[91] = value;
10422 return;
10423 case 1392:
10424 SHARED_BUFFER[92] = value;
10425 return;
10426 case 1396:
10427 SHARED_BUFFER[93] = value;
10428 return;
10429 case 1400:
10430 SHARED_BUFFER[94] = value;
10431 return;
10432 case 1404:
10433 SHARED_BUFFER[95] = value;
10434 return;
10435 case 1408:
10436 SHARED_BUFFER[96] = value;
10437 return;
10438 case 1412:
10439 SHARED_BUFFER[97] = value;
10440 return;
10441 case 1416:
10442 SHARED_BUFFER[98] = value;
10443 return;
10444 case 1420:
10445 SHARED_BUFFER[99] = value;
10446 return;
10447 case 1424:
10448 SHARED_BUFFER[100] = value;
10449 return;
10450 case 1428:
10451 SHARED_BUFFER[101] = value;
10452 return;
10453 case 1432:
10454 SHARED_BUFFER[102] = value;
10455 return;
10456 case 1436:
10457 SHARED_BUFFER[103] = value;
10458 return;
10459 case 1440:
10460 SHARED_BUFFER[104] = value;
10461 return;
10462 case 1444:
10463 SHARED_BUFFER[105] = value;
10464 return;
10465 case 1448:
10466 SHARED_BUFFER[106] = value;
10467 return;
10468 case 1452:
10469 SHARED_BUFFER[107] = value;
10470 return;
10471 case 1456:
10472 SHARED_BUFFER[108] = value;
10473 return;
10474 case 1460:
10475 SHARED_BUFFER[109] = value;
10476 return;
10477 case 1464:
10478 SHARED_BUFFER[110] = value;
10479 return;
10480 case 1468:
10481 SHARED_BUFFER[111] = value;
10482 return;
10483 case 1472:
10484 SHARED_BUFFER[112] = value;
10485 return;
10486 case 1476:
10487 SHARED_BUFFER[113] = value;
10488 return;
10489 case 1480:
10490 SHARED_BUFFER[114] = value;
10491 return;
10492 case 1484:
10493 SHARED_BUFFER[115] = value;
10494 return;
10495 case 1488:
10496 SHARED_BUFFER[116] = value;
10497 return;
10498 case 1492:
10499 SHARED_BUFFER[117] = value;
10500 return;
10501 case 1496:
10502 SHARED_BUFFER[118] = value;
10503 return;
10504 case 1500:
10505 SHARED_BUFFER[119] = value;
10506 return;
10507 case 1504:
10508 SHARED_BUFFER[120] = value;
10509 return;
10510 case 1508:
10511 SHARED_BUFFER[121] = value;
10512 return;
10513 case 1512:
10514 SHARED_BUFFER[122] = value;
10515 return;
10516 case 1516:
10517 SHARED_BUFFER[123] = value;
10518 return;
10519 case 1520:
10520 SHARED_BUFFER[124] = value;
10521 return;
10522 case 1524:
10523 SHARED_BUFFER[125] = value;
10524 return;
10525 case 1528:
10526 SHARED_BUFFER[126] = value;
10527 return;
10528 case 1532:
10529 SHARED_BUFFER[127] = value;
10530 return;
10531 case 1536:
10532 SHARED_BUFFER[128] = value;
10533 return;
10534 case 1540:
10535 SHARED_BUFFER[129] = value;
10536 return;
10537 case 1544:
10538 SHARED_BUFFER[130] = value;
10539 return;
10540 case 1548:
10541 SHARED_BUFFER[131] = value;
10542 return;
10543 case 1552:
10544 SHARED_BUFFER[132] = value;
10545 return;
10546 case 1556:
10547 SHARED_BUFFER[133] = value;
10548 return;
10549 case 1560:
10550 SHARED_BUFFER[134] = value;
10551 return;
10552 case 1564:
10553 SHARED_BUFFER[135] = value;
10554 return;
10555 case 1568:
10556 SHARED_BUFFER[136] = value;
10557 return;
10558 case 1572:
10559 SHARED_BUFFER[137] = value;
10560 return;
10561 case 1576:
10562 SHARED_BUFFER[138] = value;
10563 return;
10564 case 1580:
10565 SHARED_BUFFER[139] = value;
10566 return;
10567 case 1584:
10568 SHARED_BUFFER[140] = value;
10569 return;
10570 case 1588:
10571 SHARED_BUFFER[141] = value;
10572 return;
10573 case 1592:
10574 SHARED_BUFFER[142] = value;
10575 return;
10576 case 1596:
10577 SHARED_BUFFER[143] = value;
10578 return;
10579 case 1600:
10580 SHARED_BUFFER[144] = value;
10581 return;
10582 case 1604:
10583 SHARED_BUFFER[145] = value;
10584 return;
10585 case 1608:
10586 SHARED_BUFFER[146] = value;
10587 return;
10588 case 1612:
10589 SHARED_BUFFER[147] = value;
10590 return;
10591 case 1616:
10592 SHARED_BUFFER[148] = value;
10593 return;
10594 case 1620:
10595 SHARED_BUFFER[149] = value;
10596 return;
10597 case 1624:
10598 SHARED_BUFFER[150] = value;
10599 return;
10600 case 1628:
10601 SHARED_BUFFER[151] = value;
10602 return;
10603 case 1632:
10604 SHARED_BUFFER[152] = value;
10605 return;
10606 case 1636:
10607 SHARED_BUFFER[153] = value;
10608 return;
10609 case 1640:
10610 SHARED_BUFFER[154] = value;
10611 return;
10612 case 1644:
10613 SHARED_BUFFER[155] = value;
10614 return;
10615 case 1648:
10616 SHARED_BUFFER[156] = value;
10617 return;
10618 case 1652:
10619 SHARED_BUFFER[157] = value;
10620 return;
10621 case 1656:
10622 SHARED_BUFFER[158] = value;
10623 return;
10624 case 1660:
10625 SHARED_BUFFER[159] = value;
10626 return;
10627 case 1664:
10628 SHARED_BUFFER[160] = value;
10629 return;
10630 case 1668:
10631 SHARED_BUFFER[161] = value;
10632 return;
10633 case 1672:
10634 SHARED_BUFFER[162] = value;
10635 return;
10636 case 1676:
10637 SHARED_BUFFER[163] = value;
10638 return;
10639 case 1680:
10640 SHARED_BUFFER[164] = value;
10641 return;
10642 case 1684:
10643 SHARED_BUFFER[165] = value;
10644 return;
10645 case 1688:
10646 SHARED_BUFFER[166] = value;
10647 return;
10648 case 1692:
10649 SHARED_BUFFER[167] = value;
10650 return;
10651 case 1696:
10652 SHARED_BUFFER[168] = value;
10653 return;
10654 case 1700:
10655 SHARED_BUFFER[169] = value;
10656 return;
10657 case 1704:
10658 SHARED_BUFFER[170] = value;
10659 return;
10660 case 1708:
10661 SHARED_BUFFER[171] = value;
10662 return;
10663 case 1712:
10664 SHARED_BUFFER[172] = value;
10665 return;
10666 case 1716:
10667 SHARED_BUFFER[173] = value;
10668 return;
10669 case 1720:
10670 SHARED_BUFFER[174] = value;
10671 return;
10672 case 1724:
10673 SHARED_BUFFER[175] = value;
10674 return;
10675 case 1728:
10676 SHARED_BUFFER[176] = value;
10677 return;
10678 case 1732:
10679 SHARED_BUFFER[177] = value;
10680 return;
10681 case 1736:
10682 SHARED_BUFFER[178] = value;
10683 return;
10684 case 1740:
10685 SHARED_BUFFER[179] = value;
10686 return;
10687 case 1744:
10688 SHARED_BUFFER[180] = value;
10689 return;
10690 case 1748:
10691 SHARED_BUFFER[181] = value;
10692 return;
10693 case 1752:
10694 SHARED_BUFFER[182] = value;
10695 return;
10696 case 1756:
10697 SHARED_BUFFER[183] = value;
10698 return;
10699 case 1760:
10700 SHARED_BUFFER[184] = value;
10701 return;
10702 case 1764:
10703 SHARED_BUFFER[185] = value;
10704 return;
10705 case 1768:
10706 SHARED_BUFFER[186] = value;
10707 return;
10708 case 1772:
10709 SHARED_BUFFER[187] = value;
10710 return;
10711 case 1776:
10712 SHARED_BUFFER[188] = value;
10713 return;
10714 case 1780:
10715 SHARED_BUFFER[189] = value;
10716 return;
10717 case 1784:
10718 SHARED_BUFFER[190] = value;
10719 return;
10720 case 1788:
10721 SHARED_BUFFER[191] = value;
10722 return;
10723 case 1792:
10724 SHARED_BUFFER[192] = value;
10725 return;
10726 case 1796:
10727 SHARED_BUFFER[193] = value;
10728 return;
10729 case 1800:
10730 SHARED_BUFFER[194] = value;
10731 return;
10732 case 1804:
10733 SHARED_BUFFER[195] = value;
10734 return;
10735 case 1808:
10736 SHARED_BUFFER[196] = value;
10737 return;
10738 case 1812:
10739 SHARED_BUFFER[197] = value;
10740 return;
10741 case 1816:
10742 SHARED_BUFFER[198] = value;
10743 return;
10744 case 1820:
10745 SHARED_BUFFER[199] = value;
10746 return;
10747 case 1824:
10748 SHARED_BUFFER[200] = value;
10749 return;
10750 case 1828:
10751 SHARED_BUFFER[201] = value;
10752 return;
10753 case 1832:
10754 SHARED_BUFFER[202] = value;
10755 return;
10756 case 1836:
10757 SHARED_BUFFER[203] = value;
10758 return;
10759 case 1840:
10760 SHARED_BUFFER[204] = value;
10761 return;
10762 case 1844:
10763 SHARED_BUFFER[205] = value;
10764 return;
10765 case 1848:
10766 SHARED_BUFFER[206] = value;
10767 return;
10768 case 1852:
10769 SHARED_BUFFER[207] = value;
10770 return;
10771 case 1856:
10772 SHARED_BUFFER[208] = value;
10773 return;
10774 case 1860:
10775 SHARED_BUFFER[209] = value;
10776 return;
10777 case 1864:
10778 SHARED_BUFFER[210] = value;
10779 return;
10780 case 1868:
10781 SHARED_BUFFER[211] = value;
10782 return;
10783 case 1872:
10784 SHARED_BUFFER[212] = value;
10785 return;
10786 case 1876:
10787 SHARED_BUFFER[213] = value;
10788 return;
10789 case 1880:
10790 SHARED_BUFFER[214] = value;
10791 return;
10792 case 1884:
10793 SHARED_BUFFER[215] = value;
10794 return;
10795 case 1888:
10796 SHARED_BUFFER[216] = value;
10797 return;
10798 case 1892:
10799 SHARED_BUFFER[217] = value;
10800 return;
10801 case 1896:
10802 SHARED_BUFFER[218] = value;
10803 return;
10804 case 1900:
10805 SHARED_BUFFER[219] = value;
10806 return;
10807 case 1904:
10808 SHARED_BUFFER[220] = value;
10809 return;
10810 case 1908:
10811 SHARED_BUFFER[221] = value;
10812 return;
10813 case 1912:
10814 SHARED_BUFFER[222] = value;
10815 return;
10816 case 1916:
10817 SHARED_BUFFER[223] = value;
10818 return;
10819 case 1920:
10820 SHARED_BUFFER[224] = value;
10821 return;
10822 case 1924:
10823 SHARED_BUFFER[225] = value;
10824 return;
10825 case 1928:
10826 SHARED_BUFFER[226] = value;
10827 return;
10828 case 1932:
10829 SHARED_BUFFER[227] = value;
10830 return;
10831 case 1936:
10832 SHARED_BUFFER[228] = value;
10833 return;
10834 case 1940:
10835 SHARED_BUFFER[229] = value;
10836 return;
10837 case 1944:
10838 SHARED_BUFFER[230] = value;
10839 return;
10840 case 1948:
10841 SHARED_BUFFER[231] = value;
10842 return;
10843 case 1952:
10844 SHARED_BUFFER[232] = value;
10845 return;
10846 case 1956:
10847 SHARED_BUFFER[233] = value;
10848 return;
10849 case 1960:
10850 SHARED_BUFFER[234] = value;
10851 return;
10852 case 1964:
10853 SHARED_BUFFER[235] = value;
10854 return;
10855 case 1968:
10856 SHARED_BUFFER[236] = value;
10857 return;
10858 case 1972:
10859 SHARED_BUFFER[237] = value;
10860 return;
10861 case 1976:
10862 SHARED_BUFFER[238] = value;
10863 return;
10864 case 1980:
10865 SHARED_BUFFER[239] = value;
10866 return;
10867 case 1984:
10868 SHARED_BUFFER[240] = value;
10869 return;
10870 case 1988:
10871 SHARED_BUFFER[241] = value;
10872 return;
10873 case 1992:
10874 SHARED_BUFFER[242] = value;
10875 return;
10876 case 1996:
10877 SHARED_BUFFER[243] = value;
10878 return;
10879 case 2000:
10880 SHARED_BUFFER[244] = value;
10881 return;
10882 case 2004:
10883 SHARED_BUFFER[245] = value;
10884 return;
10885 case 2008:
10886 SHARED_BUFFER[246] = value;
10887 return;
10888 case 2012:
10889 SHARED_BUFFER[247] = value;
10890 return;
10891 case 2016:
10892 SHARED_BUFFER[248] = value;
10893 return;
10894 case 2020:
10895 SHARED_BUFFER[249] = value;
10896 return;
10897 case 2024:
10898 SHARED_BUFFER[250] = value;
10899 return;
10900 case 2028:
10901 SHARED_BUFFER[251] = value;
10902 return;
10903 case 2032:
10904 SHARED_BUFFER[252] = value;
10905 return;
10906 case 2036:
10907 SHARED_BUFFER[253] = value;
10908 return;
10909 case 2040:
10910 SHARED_BUFFER[254] = value;
10911 return;
10912 case 2044:
10913 SHARED_BUFFER[255] = value;
10914 return;
10915 default:
10916 throw std::runtime_error("invalid register address");
10917 }
10918 }
10919#else
10920 uint32_t &operator[](const int addr_offset)
10921 {
10922 return reinterpret_cast<uint32_t *>(this)[addr_offset / 4];
10923 }
10924#endif
10925 enum class access_type_t : bool
10926 {
10927 RO,
10928 RW
10929 };
10930 access_type_t get_access_type(uint32_t offset)
10931 {
10932 switch (offset)
10933 {
10934 case 0:
10935 return access_type_t::RO;
10936 case 4:
10937 return access_type_t::RO;
10938 case 8:
10939 return access_type_t::RW;
10940 case 12:
10941 return access_type_t::RW;
10942 case 16:
10943 return access_type_t::RW;
10944 case 20:
10945 return access_type_t::RW;
10946 case 24:
10947 return access_type_t::RO;
10948 case 28:
10949 return access_type_t::RW;
10950 case 32:
10951 return access_type_t::RW;
10952 case 36:
10953 return access_type_t::RO;
10954 case 40:
10955 return access_type_t::RO;
10956 case 44:
10957 return access_type_t::RW;
10958 case 60:
10959 return access_type_t::RW;
10960 case 64:
10961 return access_type_t::RW;
10962 case 68:
10963 return access_type_t::RW;
10964 case 72:
10965 return access_type_t::RW;
10966 case 76:
10967 return access_type_t::RW;
10968 case 128:
10969 return access_type_t::RW;
10970 case 132:
10971 return access_type_t::RW;
10972 case 136:
10973 return access_type_t::RW;
10974 case 140:
10975 return access_type_t::RW;
10976 case 144:
10977 return access_type_t::RW;
10978 case 148:
10979 return access_type_t::RW;
10980 case 152:
10981 return access_type_t::RW;
10982 case 156:
10983 return access_type_t::RW;
10984 case 160:
10985 return access_type_t::RW;
10986 case 164:
10987 return access_type_t::RW;
10988 case 168:
10989 return access_type_t::RW;
10990 case 172:
10991 return access_type_t::RW;
10992 case 176:
10993 return access_type_t::RW;
10994 case 180:
10995 return access_type_t::RW;
10996 case 184:
10997 return access_type_t::RW;
10998 case 188:
10999 return access_type_t::RW;
11000 case 4032:
11001 return access_type_t::RO;
11002 case 4048:
11003 return access_type_t::RO;
11004 case 4052:
11005 return access_type_t::RO;
11006 case 4056:
11007 return access_type_t::RO;
11008 case 4060:
11009 return access_type_t::RO;
11010 case 4064:
11011 return access_type_t::RO;
11012 case 4068:
11013 return access_type_t::RO;
11014 case 4072:
11015 return access_type_t::RO;
11016 case 4076:
11017 return access_type_t::RO;
11018 case 4080:
11019 return access_type_t::RO;
11020 case 4084:
11021 return access_type_t::RO;
11022 case 4088:
11023 return access_type_t::RO;
11024 case 4092:
11025 return access_type_t::RO;
Diqing Zhong04118062020-04-15 01:19:12 +020011026 case 256:
11027 return access_type_t::RO;
11028 case 260:
11029 return access_type_t::RO;
11030 case 264:
11031 return access_type_t::RO;
11032 case 272:
11033 return access_type_t::RO;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020011034 case 320:
11035 return access_type_t::RW;
11036 case 324:
11037 return access_type_t::RW;
11038 case 328:
11039 return access_type_t::RW;
11040 case 332:
11041 return access_type_t::RW;
11042 case 512:
11043 return access_type_t::RO;
11044 case 516:
11045 return access_type_t::RO;
11046 case 520:
11047 return access_type_t::RO;
11048 case 524:
11049 return access_type_t::RO;
11050 case 528:
11051 return access_type_t::RO;
11052 case 532:
11053 return access_type_t::RO;
11054 case 536:
11055 return access_type_t::RO;
11056 case 540:
11057 return access_type_t::RO;
11058 case 544:
11059 return access_type_t::RO;
11060 case 548:
11061 return access_type_t::RO;
11062 case 552:
11063 return access_type_t::RO;
11064 case 556:
11065 return access_type_t::RO;
11066 case 560:
11067 return access_type_t::RO;
11068 case 564:
11069 return access_type_t::RO;
11070 case 568:
11071 return access_type_t::RO;
11072 case 572:
11073 return access_type_t::RO;
11074 case 576:
11075 return access_type_t::RO;
11076 case 580:
11077 return access_type_t::RO;
11078 case 584:
11079 return access_type_t::RO;
11080 case 588:
11081 return access_type_t::RO;
11082 case 592:
11083 return access_type_t::RO;
11084 case 596:
11085 return access_type_t::RO;
11086 case 600:
11087 return access_type_t::RO;
11088 case 604:
11089 return access_type_t::RO;
11090 case 608:
11091 return access_type_t::RO;
11092 case 612:
11093 return access_type_t::RO;
11094 case 616:
11095 return access_type_t::RO;
11096 case 620:
11097 return access_type_t::RO;
11098 case 624:
11099 return access_type_t::RO;
11100 case 628:
11101 return access_type_t::RO;
11102 case 632:
11103 return access_type_t::RO;
11104 case 636:
11105 return access_type_t::RO;
11106 case 640:
11107 return access_type_t::RO;
11108 case 644:
11109 return access_type_t::RO;
11110 case 700:
11111 return access_type_t::RO;
11112 case 2048:
11113 return access_type_t::RW;
11114 case 2052:
11115 return access_type_t::RW;
11116 case 2056:
11117 return access_type_t::RW;
11118 case 2060:
11119 return access_type_t::RW;
11120 case 2064:
11121 return access_type_t::RW;
11122 case 2068:
11123 return access_type_t::RW;
11124 case 2076:
11125 return access_type_t::RW;
11126 case 2084:
11127 return access_type_t::RW;
11128 case 2088:
11129 return access_type_t::RW;
11130 case 2092:
11131 return access_type_t::RW;
11132 case 2096:
11133 return access_type_t::RW;
11134 case 2100:
11135 return access_type_t::RW;
11136 case 2108:
11137 return access_type_t::RW;
11138 case 2116:
11139 return access_type_t::RW;
11140 case 2120:
11141 return access_type_t::RW;
11142 case 2124:
11143 return access_type_t::RW;
11144 case 2128:
11145 return access_type_t::RW;
11146 case 2132:
11147 return access_type_t::RW;
11148 case 2136:
11149 return access_type_t::RW;
11150 case 2140:
11151 return access_type_t::RW;
11152 case 2144:
11153 return access_type_t::RW;
11154 case 2152:
11155 return access_type_t::RW;
11156 case 2156:
11157 return access_type_t::RW;
11158 case 2160:
11159 return access_type_t::RW;
11160 case 2172:
11161 return access_type_t::RW;
11162 case 2176:
11163 return access_type_t::RW;
11164 case 2180:
11165 return access_type_t::RW;
11166 case 2184:
11167 return access_type_t::RW;
11168 case 2188:
11169 return access_type_t::RW;
11170 case 2192:
11171 return access_type_t::RW;
11172 case 2196:
11173 return access_type_t::RW;
11174 case 2200:
11175 return access_type_t::RW;
11176 case 2204:
11177 return access_type_t::RW;
11178 case 2208:
11179 return access_type_t::RW;
11180 case 2212:
11181 return access_type_t::RW;
11182 case 2228:
11183 return access_type_t::RW;
11184 case 2236:
11185 return access_type_t::RW;
11186 case 2240:
11187 return access_type_t::RW;
11188 case 2244:
11189 return access_type_t::RW;
11190 case 2248:
11191 return access_type_t::RW;
11192 case 2252:
11193 return access_type_t::RW;
11194 case 2304:
11195 return access_type_t::RW;
11196 case 2308:
11197 return access_type_t::RW;
11198 case 2324:
11199 return access_type_t::RW;
11200 case 2340:
11201 return access_type_t::RW;
11202 case 2344:
11203 return access_type_t::RW;
11204 case 2348:
11205 return access_type_t::RW;
11206 case 2352:
11207 return access_type_t::RW;
11208 case 2356:
11209 return access_type_t::RW;
11210 case 2364:
11211 return access_type_t::RW;
11212 case 2560:
11213 return access_type_t::RW;
11214 case 2564:
11215 return access_type_t::RW;
11216 case 2568:
11217 return access_type_t::RW;
11218 case 2572:
11219 return access_type_t::RW;
11220 case 2576:
11221 return access_type_t::RW;
11222 case 2580:
11223 return access_type_t::RW;
11224 case 2584:
11225 return access_type_t::RW;
11226 case 2588:
11227 return access_type_t::RW;
11228 case 2592:
11229 return access_type_t::RW;
11230 case 2596:
11231 return access_type_t::RW;
11232 case 2600:
11233 return access_type_t::RW;
11234 case 2604:
11235 return access_type_t::RW;
11236 case 2608:
11237 return access_type_t::RW;
11238 case 2612:
11239 return access_type_t::RW;
11240 case 2624:
11241 return access_type_t::RW;
11242 case 2628:
11243 return access_type_t::RW;
11244 case 2632:
11245 return access_type_t::RW;
11246 case 2636:
11247 return access_type_t::RW;
11248 case 2640:
11249 return access_type_t::RW;
11250 case 2644:
11251 return access_type_t::RW;
11252 case 2648:
11253 return access_type_t::RW;
11254 case 2652:
11255 return access_type_t::RW;
11256 case 2656:
11257 return access_type_t::RW;
11258 case 2660:
11259 return access_type_t::RW;
11260 case 2664:
11261 return access_type_t::RW;
11262 case 2668:
11263 return access_type_t::RW;
11264 case 2672:
11265 return access_type_t::RW;
11266 case 2676:
11267 return access_type_t::RW;
11268 case 2688:
11269 return access_type_t::RW;
11270 case 2692:
11271 return access_type_t::RW;
11272 case 2696:
11273 return access_type_t::RW;
11274 case 2700:
11275 return access_type_t::RW;
11276 case 2704:
11277 return access_type_t::RW;
11278 case 2708:
11279 return access_type_t::RW;
11280 case 2712:
11281 return access_type_t::RW;
11282 case 2720:
11283 return access_type_t::RW;
11284 case 2724:
11285 return access_type_t::RW;
11286 case 2728:
11287 return access_type_t::RW;
11288 case 2732:
11289 return access_type_t::RW;
11290 case 2736:
11291 return access_type_t::RW;
11292 case 2752:
11293 return access_type_t::RW;
11294 case 2756:
11295 return access_type_t::RW;
11296 case 2760:
11297 return access_type_t::RW;
11298 case 2764:
11299 return access_type_t::RW;
11300 case 2768:
11301 return access_type_t::RW;
11302 case 2772:
11303 return access_type_t::RW;
11304 case 2776:
11305 return access_type_t::RW;
11306 case 2780:
11307 return access_type_t::RW;
11308 case 2784:
11309 return access_type_t::RW;
11310 case 2788:
11311 return access_type_t::RW;
11312 case 2816:
11313 return access_type_t::RW;
11314 case 2820:
11315 return access_type_t::RW;
11316 case 2824:
11317 return access_type_t::RW;
11318 case 2828:
11319 return access_type_t::RW;
11320 case 2832:
11321 return access_type_t::RW;
11322 case 2836:
11323 return access_type_t::RW;
11324 case 2840:
11325 return access_type_t::RW;
11326 case 2844:
11327 return access_type_t::RW;
11328 case 2848:
11329 return access_type_t::RW;
11330 case 2852:
11331 return access_type_t::RW;
11332 case 2856:
11333 return access_type_t::RW;
11334 case 2860:
11335 return access_type_t::RW;
11336 case 2864:
11337 return access_type_t::RW;
11338 case 2868:
11339 return access_type_t::RW;
11340 case 2880:
11341 return access_type_t::RW;
11342 case 2884:
11343 return access_type_t::RW;
11344 case 2888:
11345 return access_type_t::RW;
11346 case 2892:
11347 return access_type_t::RW;
11348 case 2896:
11349 return access_type_t::RW;
11350 case 2900:
11351 return access_type_t::RW;
11352 case 2904:
11353 return access_type_t::RW;
11354 case 384:
11355 return access_type_t::RW;
11356 case 388:
11357 return access_type_t::RW;
11358 case 392:
11359 return access_type_t::RW;
11360 case 396:
11361 return access_type_t::RW;
11362 case 400:
11363 return access_type_t::RW;
11364 case 404:
11365 return access_type_t::RW;
11366 case 408:
11367 return access_type_t::RW;
11368 case 416:
11369 return access_type_t::RW;
11370 case 420:
11371 return access_type_t::RW;
11372 case 424:
11373 return access_type_t::RW;
11374 case 428:
11375 return access_type_t::RW;
11376 case 768:
11377 return access_type_t::RW;
11378 case 772:
11379 return access_type_t::RW;
11380 case 776:
11381 return access_type_t::RW;
11382 case 780:
11383 return access_type_t::RW;
11384 case 896:
11385 return access_type_t::RW;
11386 case 900:
11387 return access_type_t::RW;
11388 case 904:
11389 return access_type_t::RW;
11390 case 908:
11391 return access_type_t::RW;
11392 case 1024:
11393 return access_type_t::RW;
11394 case 1028:
11395 return access_type_t::RW;
11396 case 1032:
11397 return access_type_t::RW;
11398 case 1036:
11399 return access_type_t::RW;
11400 case 1040:
11401 return access_type_t::RW;
11402 case 1044:
11403 return access_type_t::RW;
11404 case 1048:
11405 return access_type_t::RW;
11406 case 1052:
11407 return access_type_t::RW;
11408 case 1056:
11409 return access_type_t::RW;
11410 case 1060:
11411 return access_type_t::RW;
11412 case 1064:
11413 return access_type_t::RW;
11414 case 1068:
11415 return access_type_t::RW;
11416 case 1072:
11417 return access_type_t::RW;
11418 case 1076:
11419 return access_type_t::RW;
11420 case 1080:
11421 return access_type_t::RW;
11422 case 1084:
11423 return access_type_t::RW;
11424 case 1088:
11425 return access_type_t::RW;
11426 case 1092:
11427 return access_type_t::RW;
11428 case 1096:
11429 return access_type_t::RW;
11430 case 1100:
11431 return access_type_t::RW;
11432 case 1104:
11433 return access_type_t::RW;
11434 case 1108:
11435 return access_type_t::RW;
11436 case 1112:
11437 return access_type_t::RW;
11438 case 1116:
11439 return access_type_t::RW;
11440 case 1120:
11441 return access_type_t::RW;
11442 case 1124:
11443 return access_type_t::RW;
11444 case 1128:
11445 return access_type_t::RW;
11446 case 1132:
11447 return access_type_t::RW;
11448 case 1136:
11449 return access_type_t::RW;
11450 case 1140:
11451 return access_type_t::RW;
11452 case 1144:
11453 return access_type_t::RW;
11454 case 1148:
11455 return access_type_t::RW;
11456 case 1152:
11457 return access_type_t::RW;
11458 case 1156:
11459 return access_type_t::RW;
11460 case 1160:
11461 return access_type_t::RW;
11462 case 1164:
11463 return access_type_t::RW;
11464 case 1168:
11465 return access_type_t::RW;
11466 case 1172:
11467 return access_type_t::RW;
11468 case 1176:
11469 return access_type_t::RW;
11470 case 1180:
11471 return access_type_t::RW;
11472 case 1184:
11473 return access_type_t::RW;
11474 case 1188:
11475 return access_type_t::RW;
11476 case 1192:
11477 return access_type_t::RW;
11478 case 1196:
11479 return access_type_t::RW;
11480 case 1200:
11481 return access_type_t::RW;
11482 case 1204:
11483 return access_type_t::RW;
11484 case 1208:
11485 return access_type_t::RW;
11486 case 1212:
11487 return access_type_t::RW;
11488 case 1216:
11489 return access_type_t::RW;
11490 case 1220:
11491 return access_type_t::RW;
11492 case 1224:
11493 return access_type_t::RW;
11494 case 1228:
11495 return access_type_t::RW;
11496 case 1232:
11497 return access_type_t::RW;
11498 case 1236:
11499 return access_type_t::RW;
11500 case 1240:
11501 return access_type_t::RW;
11502 case 1244:
11503 return access_type_t::RW;
11504 case 1248:
11505 return access_type_t::RW;
11506 case 1252:
11507 return access_type_t::RW;
11508 case 1256:
11509 return access_type_t::RW;
11510 case 1260:
11511 return access_type_t::RW;
11512 case 1264:
11513 return access_type_t::RW;
11514 case 1268:
11515 return access_type_t::RW;
11516 case 1272:
11517 return access_type_t::RW;
11518 case 1276:
11519 return access_type_t::RW;
11520 case 1280:
11521 return access_type_t::RW;
11522 case 1284:
11523 return access_type_t::RW;
11524 case 1288:
11525 return access_type_t::RW;
11526 case 1292:
11527 return access_type_t::RW;
11528 case 1296:
11529 return access_type_t::RW;
11530 case 1300:
11531 return access_type_t::RW;
11532 case 1304:
11533 return access_type_t::RW;
11534 case 1308:
11535 return access_type_t::RW;
11536 case 1312:
11537 return access_type_t::RW;
11538 case 1316:
11539 return access_type_t::RW;
11540 case 1320:
11541 return access_type_t::RW;
11542 case 1324:
11543 return access_type_t::RW;
11544 case 1328:
11545 return access_type_t::RW;
11546 case 1332:
11547 return access_type_t::RW;
11548 case 1336:
11549 return access_type_t::RW;
11550 case 1340:
11551 return access_type_t::RW;
11552 case 1344:
11553 return access_type_t::RW;
11554 case 1348:
11555 return access_type_t::RW;
11556 case 1352:
11557 return access_type_t::RW;
11558 case 1356:
11559 return access_type_t::RW;
11560 case 1360:
11561 return access_type_t::RW;
11562 case 1364:
11563 return access_type_t::RW;
11564 case 1368:
11565 return access_type_t::RW;
11566 case 1372:
11567 return access_type_t::RW;
11568 case 1376:
11569 return access_type_t::RW;
11570 case 1380:
11571 return access_type_t::RW;
11572 case 1384:
11573 return access_type_t::RW;
11574 case 1388:
11575 return access_type_t::RW;
11576 case 1392:
11577 return access_type_t::RW;
11578 case 1396:
11579 return access_type_t::RW;
11580 case 1400:
11581 return access_type_t::RW;
11582 case 1404:
11583 return access_type_t::RW;
11584 case 1408:
11585 return access_type_t::RW;
11586 case 1412:
11587 return access_type_t::RW;
11588 case 1416:
11589 return access_type_t::RW;
11590 case 1420:
11591 return access_type_t::RW;
11592 case 1424:
11593 return access_type_t::RW;
11594 case 1428:
11595 return access_type_t::RW;
11596 case 1432:
11597 return access_type_t::RW;
11598 case 1436:
11599 return access_type_t::RW;
11600 case 1440:
11601 return access_type_t::RW;
11602 case 1444:
11603 return access_type_t::RW;
11604 case 1448:
11605 return access_type_t::RW;
11606 case 1452:
11607 return access_type_t::RW;
11608 case 1456:
11609 return access_type_t::RW;
11610 case 1460:
11611 return access_type_t::RW;
11612 case 1464:
11613 return access_type_t::RW;
11614 case 1468:
11615 return access_type_t::RW;
11616 case 1472:
11617 return access_type_t::RW;
11618 case 1476:
11619 return access_type_t::RW;
11620 case 1480:
11621 return access_type_t::RW;
11622 case 1484:
11623 return access_type_t::RW;
11624 case 1488:
11625 return access_type_t::RW;
11626 case 1492:
11627 return access_type_t::RW;
11628 case 1496:
11629 return access_type_t::RW;
11630 case 1500:
11631 return access_type_t::RW;
11632 case 1504:
11633 return access_type_t::RW;
11634 case 1508:
11635 return access_type_t::RW;
11636 case 1512:
11637 return access_type_t::RW;
11638 case 1516:
11639 return access_type_t::RW;
11640 case 1520:
11641 return access_type_t::RW;
11642 case 1524:
11643 return access_type_t::RW;
11644 case 1528:
11645 return access_type_t::RW;
11646 case 1532:
11647 return access_type_t::RW;
11648 case 1536:
11649 return access_type_t::RW;
11650 case 1540:
11651 return access_type_t::RW;
11652 case 1544:
11653 return access_type_t::RW;
11654 case 1548:
11655 return access_type_t::RW;
11656 case 1552:
11657 return access_type_t::RW;
11658 case 1556:
11659 return access_type_t::RW;
11660 case 1560:
11661 return access_type_t::RW;
11662 case 1564:
11663 return access_type_t::RW;
11664 case 1568:
11665 return access_type_t::RW;
11666 case 1572:
11667 return access_type_t::RW;
11668 case 1576:
11669 return access_type_t::RW;
11670 case 1580:
11671 return access_type_t::RW;
11672 case 1584:
11673 return access_type_t::RW;
11674 case 1588:
11675 return access_type_t::RW;
11676 case 1592:
11677 return access_type_t::RW;
11678 case 1596:
11679 return access_type_t::RW;
11680 case 1600:
11681 return access_type_t::RW;
11682 case 1604:
11683 return access_type_t::RW;
11684 case 1608:
11685 return access_type_t::RW;
11686 case 1612:
11687 return access_type_t::RW;
11688 case 1616:
11689 return access_type_t::RW;
11690 case 1620:
11691 return access_type_t::RW;
11692 case 1624:
11693 return access_type_t::RW;
11694 case 1628:
11695 return access_type_t::RW;
11696 case 1632:
11697 return access_type_t::RW;
11698 case 1636:
11699 return access_type_t::RW;
11700 case 1640:
11701 return access_type_t::RW;
11702 case 1644:
11703 return access_type_t::RW;
11704 case 1648:
11705 return access_type_t::RW;
11706 case 1652:
11707 return access_type_t::RW;
11708 case 1656:
11709 return access_type_t::RW;
11710 case 1660:
11711 return access_type_t::RW;
11712 case 1664:
11713 return access_type_t::RW;
11714 case 1668:
11715 return access_type_t::RW;
11716 case 1672:
11717 return access_type_t::RW;
11718 case 1676:
11719 return access_type_t::RW;
11720 case 1680:
11721 return access_type_t::RW;
11722 case 1684:
11723 return access_type_t::RW;
11724 case 1688:
11725 return access_type_t::RW;
11726 case 1692:
11727 return access_type_t::RW;
11728 case 1696:
11729 return access_type_t::RW;
11730 case 1700:
11731 return access_type_t::RW;
11732 case 1704:
11733 return access_type_t::RW;
11734 case 1708:
11735 return access_type_t::RW;
11736 case 1712:
11737 return access_type_t::RW;
11738 case 1716:
11739 return access_type_t::RW;
11740 case 1720:
11741 return access_type_t::RW;
11742 case 1724:
11743 return access_type_t::RW;
11744 case 1728:
11745 return access_type_t::RW;
11746 case 1732:
11747 return access_type_t::RW;
11748 case 1736:
11749 return access_type_t::RW;
11750 case 1740:
11751 return access_type_t::RW;
11752 case 1744:
11753 return access_type_t::RW;
11754 case 1748:
11755 return access_type_t::RW;
11756 case 1752:
11757 return access_type_t::RW;
11758 case 1756:
11759 return access_type_t::RW;
11760 case 1760:
11761 return access_type_t::RW;
11762 case 1764:
11763 return access_type_t::RW;
11764 case 1768:
11765 return access_type_t::RW;
11766 case 1772:
11767 return access_type_t::RW;
11768 case 1776:
11769 return access_type_t::RW;
11770 case 1780:
11771 return access_type_t::RW;
11772 case 1784:
11773 return access_type_t::RW;
11774 case 1788:
11775 return access_type_t::RW;
11776 case 1792:
11777 return access_type_t::RW;
11778 case 1796:
11779 return access_type_t::RW;
11780 case 1800:
11781 return access_type_t::RW;
11782 case 1804:
11783 return access_type_t::RW;
11784 case 1808:
11785 return access_type_t::RW;
11786 case 1812:
11787 return access_type_t::RW;
11788 case 1816:
11789 return access_type_t::RW;
11790 case 1820:
11791 return access_type_t::RW;
11792 case 1824:
11793 return access_type_t::RW;
11794 case 1828:
11795 return access_type_t::RW;
11796 case 1832:
11797 return access_type_t::RW;
11798 case 1836:
11799 return access_type_t::RW;
11800 case 1840:
11801 return access_type_t::RW;
11802 case 1844:
11803 return access_type_t::RW;
11804 case 1848:
11805 return access_type_t::RW;
11806 case 1852:
11807 return access_type_t::RW;
11808 case 1856:
11809 return access_type_t::RW;
11810 case 1860:
11811 return access_type_t::RW;
11812 case 1864:
11813 return access_type_t::RW;
11814 case 1868:
11815 return access_type_t::RW;
11816 case 1872:
11817 return access_type_t::RW;
11818 case 1876:
11819 return access_type_t::RW;
11820 case 1880:
11821 return access_type_t::RW;
11822 case 1884:
11823 return access_type_t::RW;
11824 case 1888:
11825 return access_type_t::RW;
11826 case 1892:
11827 return access_type_t::RW;
11828 case 1896:
11829 return access_type_t::RW;
11830 case 1900:
11831 return access_type_t::RW;
11832 case 1904:
11833 return access_type_t::RW;
11834 case 1908:
11835 return access_type_t::RW;
11836 case 1912:
11837 return access_type_t::RW;
11838 case 1916:
11839 return access_type_t::RW;
11840 case 1920:
11841 return access_type_t::RW;
11842 case 1924:
11843 return access_type_t::RW;
11844 case 1928:
11845 return access_type_t::RW;
11846 case 1932:
11847 return access_type_t::RW;
11848 case 1936:
11849 return access_type_t::RW;
11850 case 1940:
11851 return access_type_t::RW;
11852 case 1944:
11853 return access_type_t::RW;
11854 case 1948:
11855 return access_type_t::RW;
11856 case 1952:
11857 return access_type_t::RW;
11858 case 1956:
11859 return access_type_t::RW;
11860 case 1960:
11861 return access_type_t::RW;
11862 case 1964:
11863 return access_type_t::RW;
11864 case 1968:
11865 return access_type_t::RW;
11866 case 1972:
11867 return access_type_t::RW;
11868 case 1976:
11869 return access_type_t::RW;
11870 case 1980:
11871 return access_type_t::RW;
11872 case 1984:
11873 return access_type_t::RW;
11874 case 1988:
11875 return access_type_t::RW;
11876 case 1992:
11877 return access_type_t::RW;
11878 case 1996:
11879 return access_type_t::RW;
11880 case 2000:
11881 return access_type_t::RW;
11882 case 2004:
11883 return access_type_t::RW;
11884 case 2008:
11885 return access_type_t::RW;
11886 case 2012:
11887 return access_type_t::RW;
11888 case 2016:
11889 return access_type_t::RW;
11890 case 2020:
11891 return access_type_t::RW;
11892 case 2024:
11893 return access_type_t::RW;
11894 case 2028:
11895 return access_type_t::RW;
11896 case 2032:
11897 return access_type_t::RW;
11898 case 2036:
11899 return access_type_t::RW;
11900 case 2040:
11901 return access_type_t::RW;
11902 case 2044:
11903 return access_type_t::RW;
11904 default:
11905 throw std::runtime_error("invalid register address");
11906 }
11907 }
11908#endif //__cplusplus
11909};
11910
11911// Data structure for commands without payload
11912struct command_no_payload_t
11913{
11914 uint32_t cmd_code : 10;
11915 uint32_t must_be_zero0 : 6; // 0
11916 uint32_t param : 16;
11917#ifdef __cplusplus
11918 CONSTEXPR bool valid() const
11919 {
11920 return must_be_zero0 == 0;
11921 }
11922 CONSTEXPR void init()
11923 {
11924 must_be_zero0 = 0;
11925 }
11926 CONSTEXPR ::cmd0 get_cmd_code() const
11927 {
11928 return static_cast<::cmd0>(cmd_code);
11929 }
11930 CONSTEXPR command_no_payload_t &set_cmd_code(::cmd0 value)
11931 {
11932 cmd_code = static_cast<uint32_t>(value);
11933 return *this;
11934 }
11935 CONSTEXPR uint32_t get_param() const
11936 {
11937 return static_cast<uint32_t>(param);
11938 }
11939 CONSTEXPR command_no_payload_t &set_param(uint32_t value)
11940 {
11941 param = static_cast<uint32_t>(value);
11942 return *this;
11943 }
11944#endif //__cplusplus
11945};
11946
11947// Data structure for commands with payload
11948struct command_with_payload_t
11949{
11950 uint32_t cmd_code : 10;
11951 uint32_t must_be_zero : 4; // 0
11952 uint32_t payload_size : 2; // Min:1 Max:2
11953 uint32_t param : 16;
11954 uint32_t data : 32;
11955#ifdef __cplusplus
11956 CONSTEXPR bool valid() const
11957 {
11958 return must_be_zero == 0 && payload_size >= 1 && payload_size <= 2;
11959 }
11960 CONSTEXPR void init()
11961 {
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 command_with_payload_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 command_with_payload_t &set_data(uint32_t value)
11979 {
11980 data = static_cast<uint32_t>(value);
11981 return *this;
11982 }
11983 CONSTEXPR uint32_t get_param() const
11984 {
11985 return static_cast<uint32_t>(param);
11986 }
11987 CONSTEXPR command_with_payload_t &set_param(uint32_t value)
11988 {
11989 param = static_cast<uint32_t>(value);
11990 return *this;
11991 }
11992 CONSTEXPR uint32_t get_payload_size() const
11993 {
11994 return static_cast<uint32_t>(payload_size);
11995 }
11996 CONSTEXPR command_with_payload_t &set_payload_size(uint32_t value)
11997 {
11998 payload_size = static_cast<uint32_t>(value);
11999 return *this;
12000 }
12001#endif //__cplusplus
12002};
12003
12004// Move to stopped state once all commands to this point are done. Raise IRQ to the host and logically OR the mask into
12005// the status register upper 16 bits (see the status register)
12006struct npu_op_stop_t
12007{
12008 uint32_t cmd_code : 10; // NPU_OP_STOP
12009 uint32_t must_be_zero0 : 6; // 0
12010 uint32_t mask : 16;
12011#ifdef __cplusplus
12012 CONSTEXPR bool valid() const
12013 {
12014 return cmd_code == static_cast<uint32_t>(cmd0::NPU_OP_STOP) && must_be_zero0 == 0;
12015 }
12016 CONSTEXPR void init()
12017 {
12018 cmd_code = static_cast<uint32_t>(cmd0::NPU_OP_STOP);
12019 must_be_zero0 = 0;
12020 }
12021 CONSTEXPR ::cmd0 get_cmd_code() const
12022 {
12023 return static_cast<::cmd0>(cmd_code);
12024 }
12025 CONSTEXPR npu_op_stop_t &set_cmd_code(::cmd0 value)
12026 {
12027 cmd_code = static_cast<uint32_t>(value);
12028 return *this;
12029 }
12030 CONSTEXPR uint32_t get_mask() const
12031 {
12032 return static_cast<uint32_t>(mask);
12033 }
12034 CONSTEXPR npu_op_stop_t &set_mask(uint32_t value)
12035 {
12036 mask = static_cast<uint32_t>(value);
12037 return *this;
12038 }
12039#endif //__cplusplus
12040};
12041
12042// Raise IRQ to the host and logically OR the mask into the status register upper 16 bits (see the status register)
12043struct npu_op_irq_t
12044{
12045 uint32_t cmd_code : 10; // NPU_OP_IRQ
12046 uint32_t must_be_zero0 : 6; // 0
12047 uint32_t mask : 16;
12048#ifdef __cplusplus
12049 CONSTEXPR bool valid() const
12050 {
12051 return cmd_code == static_cast<uint32_t>(cmd0::NPU_OP_IRQ) && must_be_zero0 == 0;
12052 }
12053 CONSTEXPR void init()
12054 {
12055 cmd_code = static_cast<uint32_t>(cmd0::NPU_OP_IRQ);
12056 must_be_zero0 = 0;
12057 }
12058 CONSTEXPR ::cmd0 get_cmd_code() const
12059 {
12060 return static_cast<::cmd0>(cmd_code);
12061 }
12062 CONSTEXPR npu_op_irq_t &set_cmd_code(::cmd0 value)
12063 {
12064 cmd_code = static_cast<uint32_t>(value);
12065 return *this;
12066 }
12067 CONSTEXPR uint32_t get_mask() const
12068 {
12069 return static_cast<uint32_t>(mask);
12070 }
12071 CONSTEXPR npu_op_irq_t &set_mask(uint32_t value)
12072 {
12073 mask = static_cast<uint32_t>(value);
12074 return *this;
12075 }
12076#endif //__cplusplus
12077};
12078
12079// Start stripe with full convolution or deconvolution
12080struct npu_op_conv_t
12081{
12082 uint32_t cmd_code : 10; // NPU_OP_CONV
12083 uint32_t must_be_zero0 : 6; // 0
12084 uint32_t reserved0 : 16;
12085#ifdef __cplusplus
12086 CONSTEXPR bool valid() const
12087 {
12088 return cmd_code == static_cast<uint32_t>(cmd0::NPU_OP_CONV) && must_be_zero0 == 0;
12089 }
12090 CONSTEXPR void init()
12091 {
12092 cmd_code = static_cast<uint32_t>(cmd0::NPU_OP_CONV);
12093 must_be_zero0 = 0;
12094 }
12095 CONSTEXPR ::cmd0 get_cmd_code() const
12096 {
12097 return static_cast<::cmd0>(cmd_code);
12098 }
12099 CONSTEXPR npu_op_conv_t &set_cmd_code(::cmd0 value)
12100 {
12101 cmd_code = static_cast<uint32_t>(value);
12102 return *this;
12103 }
12104#endif //__cplusplus
12105};
12106
12107// Start stripe width depth-wise convolution or deconvolution operation
12108struct npu_op_depthwise_t
12109{
12110 uint32_t cmd_code : 10; // NPU_OP_DEPTHWISE
12111 uint32_t must_be_zero0 : 6; // 0
12112 uint32_t reserved0 : 16;
12113#ifdef __cplusplus
12114 CONSTEXPR bool valid() const
12115 {
12116 return cmd_code == static_cast<uint32_t>(cmd0::NPU_OP_DEPTHWISE) && must_be_zero0 == 0;
12117 }
12118 CONSTEXPR void init()
12119 {
12120 cmd_code = static_cast<uint32_t>(cmd0::NPU_OP_DEPTHWISE);
12121 must_be_zero0 = 0;
12122 }
12123 CONSTEXPR ::cmd0 get_cmd_code() const
12124 {
12125 return static_cast<::cmd0>(cmd_code);
12126 }
12127 CONSTEXPR npu_op_depthwise_t &set_cmd_code(::cmd0 value)
12128 {
12129 cmd_code = static_cast<uint32_t>(value);
12130 return *this;
12131 }
12132#endif //__cplusplus
12133};
12134
12135// Start stripe with pooling operation
12136struct npu_op_pool_t
12137{
12138 uint32_t cmd_code : 10; // NPU_OP_POOL
12139 uint32_t must_be_zero0 : 6; // 0
12140 uint32_t mode : 16;
12141#ifdef __cplusplus
12142 CONSTEXPR bool valid() const
12143 {
12144 return cmd_code == static_cast<uint32_t>(cmd0::NPU_OP_POOL) && must_be_zero0 == 0;
12145 }
12146 CONSTEXPR void init()
12147 {
12148 cmd_code = static_cast<uint32_t>(cmd0::NPU_OP_POOL);
12149 must_be_zero0 = 0;
12150 }
12151 CONSTEXPR ::cmd0 get_cmd_code() const
12152 {
12153 return static_cast<::cmd0>(cmd_code);
12154 }
12155 CONSTEXPR npu_op_pool_t &set_cmd_code(::cmd0 value)
12156 {
12157 cmd_code = static_cast<uint32_t>(value);
12158 return *this;
12159 }
12160 CONSTEXPR ::pooling_mode get_mode() const
12161 {
12162 return static_cast<::pooling_mode>(mode);
12163 }
12164 CONSTEXPR npu_op_pool_t &set_mode(::pooling_mode value)
12165 {
12166 mode = static_cast<uint32_t>(value);
12167 return *this;
12168 }
12169#endif //__cplusplus
12170};
12171
12172// Start stripe with pointwise operation
12173struct npu_op_elementwise_t
12174{
12175 uint32_t cmd_code : 10; // NPU_OP_ELEMENTWISE
12176 uint32_t must_be_zero0 : 6; // 0
12177 uint32_t mode : 16;
12178#ifdef __cplusplus
12179 CONSTEXPR bool valid() const
12180 {
12181 return cmd_code == static_cast<uint32_t>(cmd0::NPU_OP_ELEMENTWISE) && must_be_zero0 == 0;
12182 }
12183 CONSTEXPR void init()
12184 {
12185 cmd_code = static_cast<uint32_t>(cmd0::NPU_OP_ELEMENTWISE);
12186 must_be_zero0 = 0;
12187 }
12188 CONSTEXPR ::cmd0 get_cmd_code() const
12189 {
12190 return static_cast<::cmd0>(cmd_code);
12191 }
12192 CONSTEXPR npu_op_elementwise_t &set_cmd_code(::cmd0 value)
12193 {
12194 cmd_code = static_cast<uint32_t>(value);
12195 return *this;
12196 }
12197 CONSTEXPR ::elementwise_mode get_mode() const
12198 {
12199 return static_cast<::elementwise_mode>(mode);
12200 }
12201 CONSTEXPR npu_op_elementwise_t &set_mode(::elementwise_mode value)
12202 {
12203 mode = static_cast<uint32_t>(value);
12204 return *this;
12205 }
12206#endif //__cplusplus
12207};
12208
12209// Queue new DMA for the given channel with the given mode. Mode bit 0 specifies the source address type 0=external,
12210// 1=internal Mode bit 1 specifies the destination address type 0=external, 1=internal In Ethos-U55 there is only one
12211// user channel so channel=0. If the channel is fully in use then the command blocks until a new DMA can start
12212struct npu_op_dma_start_t
12213{
12214 uint32_t cmd_code : 10; // NPU_OP_DMA_START
12215 uint32_t must_be_zero0 : 6; // 0
12216 uint32_t channel_mode : 16;
12217#ifdef __cplusplus
12218 CONSTEXPR bool valid() const
12219 {
12220 return cmd_code == static_cast<uint32_t>(cmd0::NPU_OP_DMA_START) && must_be_zero0 == 0;
12221 }
12222 CONSTEXPR void init()
12223 {
12224 cmd_code = static_cast<uint32_t>(cmd0::NPU_OP_DMA_START);
12225 must_be_zero0 = 0;
12226 }
12227 CONSTEXPR uint32_t get_channel_mode() const
12228 {
12229 return static_cast<uint32_t>(channel_mode);
12230 }
12231 CONSTEXPR npu_op_dma_start_t &set_channel_mode(uint32_t value)
12232 {
12233 channel_mode = static_cast<uint32_t>(value);
12234 return *this;
12235 }
12236 CONSTEXPR ::cmd0 get_cmd_code() const
12237 {
12238 return static_cast<::cmd0>(cmd_code);
12239 }
12240 CONSTEXPR npu_op_dma_start_t &set_cmd_code(::cmd0 value)
12241 {
12242 cmd_code = static_cast<uint32_t>(value);
12243 return *this;
12244 }
12245#endif //__cplusplus
12246};
12247
12248// Wait for the DMA channel to have k or fewer active descriptors outstanding. In Ethos-U55 there is only one user
12249// channel so channel=0. In Ethos-U55 there is only one descriptor per channel so k=0 and the command waits for the
12250// single DMA to be complete.
12251struct npu_op_dma_wait_t
12252{
12253 uint32_t cmd_code : 10; // NPU_OP_DMA_WAIT
12254 uint32_t must_be_zero0 : 6; // 0
12255 uint32_t reserved0 : 16;
12256#ifdef __cplusplus
12257 CONSTEXPR bool valid() const
12258 {
12259 return cmd_code == static_cast<uint32_t>(cmd0::NPU_OP_DMA_WAIT) && must_be_zero0 == 0;
12260 }
12261 CONSTEXPR void init()
12262 {
12263 cmd_code = static_cast<uint32_t>(cmd0::NPU_OP_DMA_WAIT);
12264 must_be_zero0 = 0;
12265 }
12266 CONSTEXPR ::cmd0 get_cmd_code() const
12267 {
12268 return static_cast<::cmd0>(cmd_code);
12269 }
12270 CONSTEXPR npu_op_dma_wait_t &set_cmd_code(::cmd0 value)
12271 {
12272 cmd_code = static_cast<uint32_t>(value);
12273 return *this;
12274 }
12275#endif //__cplusplus
12276};
12277
12278// Wait for n or fewer kernel operations to be remaining (not complete) before starting the next command. A kernel
12279// operation is Conv, Depthwise, Pool, VectorProd Elementwise. This command is typically placed before an
12280// NPU_OP_DMA_START command to prevent the DMA from starting until a previous kernel operation reading the memory has
12281// completed.
12282struct npu_op_kernel_wait_t
12283{
12284 uint32_t cmd_code : 10; // NPU_OP_KERNEL_WAIT
12285 uint32_t must_be_zero0 : 6; // 0
12286 uint32_t param : 16;
12287#ifdef __cplusplus
12288 CONSTEXPR bool valid() const
12289 {
12290 return cmd_code == static_cast<uint32_t>(cmd0::NPU_OP_KERNEL_WAIT) && must_be_zero0 == 0;
12291 }
12292 CONSTEXPR void init()
12293 {
12294 cmd_code = static_cast<uint32_t>(cmd0::NPU_OP_KERNEL_WAIT);
12295 must_be_zero0 = 0;
12296 }
12297 CONSTEXPR ::cmd0 get_cmd_code() const
12298 {
12299 return static_cast<::cmd0>(cmd_code);
12300 }
12301 CONSTEXPR npu_op_kernel_wait_t &set_cmd_code(::cmd0 value)
12302 {
12303 cmd_code = static_cast<uint32_t>(value);
12304 return *this;
12305 }
12306 CONSTEXPR uint32_t get_param() const
12307 {
12308 return static_cast<uint32_t>(param);
12309 }
12310 CONSTEXPR npu_op_kernel_wait_t &set_param(uint32_t value)
12311 {
12312 param = static_cast<uint32_t>(value);
12313 return *this;
12314 }
12315#endif //__cplusplus
12316};
12317
12318// Enable or disable PMU counting (debug feature only).
12319struct npu_op_pmu_mask_t
12320{
12321 uint32_t cmd_code : 10; // NPU_OP_PMU_MASK
12322 uint32_t must_be_zero0 : 6; // 0
12323 uint32_t param : 16;
12324#ifdef __cplusplus
12325 CONSTEXPR bool valid() const
12326 {
12327 return cmd_code == static_cast<uint32_t>(cmd0::NPU_OP_PMU_MASK) && must_be_zero0 == 0;
12328 }
12329 CONSTEXPR void init()
12330 {
12331 cmd_code = static_cast<uint32_t>(cmd0::NPU_OP_PMU_MASK);
12332 must_be_zero0 = 0;
12333 }
12334 CONSTEXPR ::cmd0 get_cmd_code() const
12335 {
12336 return static_cast<::cmd0>(cmd_code);
12337 }
12338 CONSTEXPR npu_op_pmu_mask_t &set_cmd_code(::cmd0 value)
12339 {
12340 cmd_code = static_cast<uint32_t>(value);
12341 return *this;
12342 }
12343 CONSTEXPR uint32_t get_param() const
12344 {
12345 return static_cast<uint32_t>(param);
12346 }
12347 CONSTEXPR npu_op_pmu_mask_t &set_param(uint32_t value)
12348 {
12349 param = static_cast<uint32_t>(value);
12350 return *this;
12351 }
12352#endif //__cplusplus
12353};
12354
12355// IFM top pad
12356struct npu_set_ifm_pad_top_t
12357{
12358 uint32_t cmd_code : 10; // NPU_SET_IFM_PAD_TOP
12359 uint32_t must_be_zero0 : 6; // 0
12360 uint32_t param : 16;
12361#ifdef __cplusplus
12362 CONSTEXPR bool valid() const
12363 {
12364 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_IFM_PAD_TOP) && must_be_zero0 == 0;
12365 }
12366 CONSTEXPR void init()
12367 {
12368 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_IFM_PAD_TOP);
12369 must_be_zero0 = 0;
12370 }
12371 CONSTEXPR ::cmd0 get_cmd_code() const
12372 {
12373 return static_cast<::cmd0>(cmd_code);
12374 }
12375 CONSTEXPR npu_set_ifm_pad_top_t &set_cmd_code(::cmd0 value)
12376 {
12377 cmd_code = static_cast<uint32_t>(value);
12378 return *this;
12379 }
12380 CONSTEXPR uint32_t get_param() const
12381 {
12382 return static_cast<uint32_t>(param);
12383 }
12384 CONSTEXPR npu_set_ifm_pad_top_t &set_param(uint32_t value)
12385 {
12386 param = static_cast<uint32_t>(value);
12387 return *this;
12388 }
12389#endif //__cplusplus
12390};
12391
12392// IFM left pad
12393struct npu_set_ifm_pad_left_t
12394{
12395 uint32_t cmd_code : 10; // NPU_SET_IFM_PAD_LEFT
12396 uint32_t must_be_zero0 : 6; // 0
12397 uint32_t param : 16;
12398#ifdef __cplusplus
12399 CONSTEXPR bool valid() const
12400 {
12401 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_IFM_PAD_LEFT) && must_be_zero0 == 0;
12402 }
12403 CONSTEXPR void init()
12404 {
12405 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_IFM_PAD_LEFT);
12406 must_be_zero0 = 0;
12407 }
12408 CONSTEXPR ::cmd0 get_cmd_code() const
12409 {
12410 return static_cast<::cmd0>(cmd_code);
12411 }
12412 CONSTEXPR npu_set_ifm_pad_left_t &set_cmd_code(::cmd0 value)
12413 {
12414 cmd_code = static_cast<uint32_t>(value);
12415 return *this;
12416 }
12417 CONSTEXPR uint32_t get_param() const
12418 {
12419 return static_cast<uint32_t>(param);
12420 }
12421 CONSTEXPR npu_set_ifm_pad_left_t &set_param(uint32_t value)
12422 {
12423 param = static_cast<uint32_t>(value);
12424 return *this;
12425 }
12426#endif //__cplusplus
12427};
12428
12429// IFM right pad
12430struct npu_set_ifm_pad_right_t
12431{
12432 uint32_t cmd_code : 10; // NPU_SET_IFM_PAD_RIGHT
12433 uint32_t must_be_zero0 : 6; // 0
12434 uint32_t param : 16;
12435#ifdef __cplusplus
12436 CONSTEXPR bool valid() const
12437 {
12438 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_IFM_PAD_RIGHT) && must_be_zero0 == 0;
12439 }
12440 CONSTEXPR void init()
12441 {
12442 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_IFM_PAD_RIGHT);
12443 must_be_zero0 = 0;
12444 }
12445 CONSTEXPR ::cmd0 get_cmd_code() const
12446 {
12447 return static_cast<::cmd0>(cmd_code);
12448 }
12449 CONSTEXPR npu_set_ifm_pad_right_t &set_cmd_code(::cmd0 value)
12450 {
12451 cmd_code = static_cast<uint32_t>(value);
12452 return *this;
12453 }
12454 CONSTEXPR uint32_t get_param() const
12455 {
12456 return static_cast<uint32_t>(param);
12457 }
12458 CONSTEXPR npu_set_ifm_pad_right_t &set_param(uint32_t value)
12459 {
12460 param = static_cast<uint32_t>(value);
12461 return *this;
12462 }
12463#endif //__cplusplus
12464};
12465
12466// IFM bottom pad
12467struct npu_set_ifm_pad_bottom_t
12468{
12469 uint32_t cmd_code : 10; // NPU_SET_IFM_PAD_BOTTOM
12470 uint32_t must_be_zero0 : 6; // 0
12471 uint32_t param : 16;
12472#ifdef __cplusplus
12473 CONSTEXPR bool valid() const
12474 {
12475 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_IFM_PAD_BOTTOM) && must_be_zero0 == 0;
12476 }
12477 CONSTEXPR void init()
12478 {
12479 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_IFM_PAD_BOTTOM);
12480 must_be_zero0 = 0;
12481 }
12482 CONSTEXPR ::cmd0 get_cmd_code() const
12483 {
12484 return static_cast<::cmd0>(cmd_code);
12485 }
12486 CONSTEXPR npu_set_ifm_pad_bottom_t &set_cmd_code(::cmd0 value)
12487 {
12488 cmd_code = static_cast<uint32_t>(value);
12489 return *this;
12490 }
12491 CONSTEXPR uint32_t get_param() const
12492 {
12493 return static_cast<uint32_t>(param);
12494 }
12495 CONSTEXPR npu_set_ifm_pad_bottom_t &set_param(uint32_t value)
12496 {
12497 param = static_cast<uint32_t>(value);
12498 return *this;
12499 }
12500#endif //__cplusplus
12501};
12502
12503// Number of input channels - 1
12504struct npu_set_ifm_depth_m1_t
12505{
12506 uint32_t cmd_code : 10; // NPU_SET_IFM_DEPTH_M1
12507 uint32_t must_be_zero0 : 6; // 0
12508 uint32_t param : 16;
12509#ifdef __cplusplus
12510 CONSTEXPR bool valid() const
12511 {
12512 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_IFM_DEPTH_M1) && must_be_zero0 == 0;
12513 }
12514 CONSTEXPR void init()
12515 {
12516 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_IFM_DEPTH_M1);
12517 must_be_zero0 = 0;
12518 }
12519 CONSTEXPR ::cmd0 get_cmd_code() const
12520 {
12521 return static_cast<::cmd0>(cmd_code);
12522 }
12523 CONSTEXPR npu_set_ifm_depth_m1_t &set_cmd_code(::cmd0 value)
12524 {
12525 cmd_code = static_cast<uint32_t>(value);
12526 return *this;
12527 }
12528 CONSTEXPR uint32_t get_param() const
12529 {
12530 return static_cast<uint32_t>(param);
12531 }
12532 CONSTEXPR npu_set_ifm_depth_m1_t &set_param(uint32_t value)
12533 {
12534 param = static_cast<uint32_t>(value);
12535 return *this;
12536 }
12537#endif //__cplusplus
12538};
12539
12540// Set IFM precision
12541struct npu_set_ifm_precision_t
12542{
12543 uint32_t cmd_code : 10; // NPU_SET_IFM_PRECISION
12544 uint32_t must_be_zero0 : 6; // 0
12545 uint32_t param : 4;
12546 uint32_t reserved0 : 2;
12547 uint32_t format : 2;
12548 uint32_t scale_mode : 2;
12549 uint32_t reserved1 : 4;
12550 uint32_t round_mode : 2;
12551#ifdef __cplusplus
12552 CONSTEXPR bool valid() const
12553 {
12554 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_IFM_PRECISION) && must_be_zero0 == 0;
12555 }
12556 CONSTEXPR void init()
12557 {
12558 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_IFM_PRECISION);
12559 must_be_zero0 = 0;
12560 }
12561 CONSTEXPR ::cmd0 get_cmd_code() const
12562 {
12563 return static_cast<::cmd0>(cmd_code);
12564 }
12565 CONSTEXPR npu_set_ifm_precision_t &set_cmd_code(::cmd0 value)
12566 {
12567 cmd_code = static_cast<uint32_t>(value);
12568 return *this;
12569 }
12570 CONSTEXPR ::data_format get_format() const
12571 {
12572 return static_cast<::data_format>(format);
12573 }
12574 CONSTEXPR npu_set_ifm_precision_t &set_format(::data_format value)
12575 {
12576 format = static_cast<uint32_t>(value);
12577 return *this;
12578 }
12579 CONSTEXPR ::ifm_precision get_param() const
12580 {
12581 return static_cast<::ifm_precision>(param);
12582 }
12583 CONSTEXPR npu_set_ifm_precision_t &set_param(::ifm_precision value)
12584 {
12585 param = static_cast<uint32_t>(value);
12586 return *this;
12587 }
12588 CONSTEXPR ::rounding get_round_mode() const
12589 {
12590 return static_cast<::rounding>(round_mode);
12591 }
12592 CONSTEXPR npu_set_ifm_precision_t &set_round_mode(::rounding value)
12593 {
12594 round_mode = static_cast<uint32_t>(value);
12595 return *this;
12596 }
12597 CONSTEXPR ::ifm_scale_mode get_scale_mode() const
12598 {
12599 return static_cast<::ifm_scale_mode>(scale_mode);
12600 }
12601 CONSTEXPR npu_set_ifm_precision_t &set_scale_mode(::ifm_scale_mode value)
12602 {
12603 scale_mode = static_cast<uint32_t>(value);
12604 return *this;
12605 }
12606#endif //__cplusplus
12607};
12608
12609// b[1:0] = upscale mode (0=none, 1=2x2 nearest, 2=2x2 transpose)
12610struct npu_set_ifm_upscale_t
12611{
12612 uint32_t cmd_code : 10; // NPU_SET_IFM_UPSCALE
12613 uint32_t must_be_zero0 : 6; // 0
12614 uint32_t mode : 2;
12615 uint32_t reserved0 : 14;
12616#ifdef __cplusplus
12617 CONSTEXPR bool valid() const
12618 {
12619 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_IFM_UPSCALE) && must_be_zero0 == 0;
12620 }
12621 CONSTEXPR void init()
12622 {
12623 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_IFM_UPSCALE);
12624 must_be_zero0 = 0;
12625 }
12626 CONSTEXPR ::cmd0 get_cmd_code() const
12627 {
12628 return static_cast<::cmd0>(cmd_code);
12629 }
12630 CONSTEXPR npu_set_ifm_upscale_t &set_cmd_code(::cmd0 value)
12631 {
12632 cmd_code = static_cast<uint32_t>(value);
12633 return *this;
12634 }
12635 CONSTEXPR ::resampling_mode get_mode() const
12636 {
12637 return static_cast<::resampling_mode>(mode);
12638 }
12639 CONSTEXPR npu_set_ifm_upscale_t &set_mode(::resampling_mode value)
12640 {
12641 mode = static_cast<uint32_t>(value);
12642 return *this;
12643 }
12644#endif //__cplusplus
12645};
12646
12647// Zero point offset (so value that 0 is encoded as)
12648struct npu_set_ifm_zero_point_t
12649{
12650 uint32_t cmd_code : 10; // NPU_SET_IFM_ZERO_POINT
12651 uint32_t must_be_zero0 : 6; // 0
12652 uint32_t param : 16;
12653#ifdef __cplusplus
12654 CONSTEXPR bool valid() const
12655 {
12656 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_IFM_ZERO_POINT) && must_be_zero0 == 0;
12657 }
12658 CONSTEXPR void init()
12659 {
12660 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_IFM_ZERO_POINT);
12661 must_be_zero0 = 0;
12662 }
12663 CONSTEXPR ::cmd0 get_cmd_code() const
12664 {
12665 return static_cast<::cmd0>(cmd_code);
12666 }
12667 CONSTEXPR npu_set_ifm_zero_point_t &set_cmd_code(::cmd0 value)
12668 {
12669 cmd_code = static_cast<uint32_t>(value);
12670 return *this;
12671 }
12672 CONSTEXPR uint32_t get_param() const
12673 {
12674 return static_cast<uint32_t>(param);
12675 }
12676 CONSTEXPR npu_set_ifm_zero_point_t &set_param(uint32_t value)
12677 {
12678 param = static_cast<uint32_t>(value);
12679 return *this;
12680 }
12681#endif //__cplusplus
12682};
12683
12684// IFM Tile 0 and tile 2 (width-1)
12685struct npu_set_ifm_width0_m1_t
12686{
12687 uint32_t cmd_code : 10; // NPU_SET_IFM_WIDTH0_M1
12688 uint32_t must_be_zero0 : 6; // 0
12689 uint32_t param : 16;
12690#ifdef __cplusplus
12691 CONSTEXPR bool valid() const
12692 {
12693 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_IFM_WIDTH0_M1) && must_be_zero0 == 0;
12694 }
12695 CONSTEXPR void init()
12696 {
12697 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_IFM_WIDTH0_M1);
12698 must_be_zero0 = 0;
12699 }
12700 CONSTEXPR ::cmd0 get_cmd_code() const
12701 {
12702 return static_cast<::cmd0>(cmd_code);
12703 }
12704 CONSTEXPR npu_set_ifm_width0_m1_t &set_cmd_code(::cmd0 value)
12705 {
12706 cmd_code = static_cast<uint32_t>(value);
12707 return *this;
12708 }
12709 CONSTEXPR uint32_t get_param() const
12710 {
12711 return static_cast<uint32_t>(param);
12712 }
12713 CONSTEXPR npu_set_ifm_width0_m1_t &set_param(uint32_t value)
12714 {
12715 param = static_cast<uint32_t>(value);
12716 return *this;
12717 }
12718#endif //__cplusplus
12719};
12720
12721// IFM Tile 0 (height-1)
12722struct npu_set_ifm_height0_m1_t
12723{
12724 uint32_t cmd_code : 10; // NPU_SET_IFM_HEIGHT0_M1
12725 uint32_t must_be_zero0 : 6; // 0
12726 uint32_t param : 16;
12727#ifdef __cplusplus
12728 CONSTEXPR bool valid() const
12729 {
12730 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_IFM_HEIGHT0_M1) && must_be_zero0 == 0;
12731 }
12732 CONSTEXPR void init()
12733 {
12734 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_IFM_HEIGHT0_M1);
12735 must_be_zero0 = 0;
12736 }
12737 CONSTEXPR ::cmd0 get_cmd_code() const
12738 {
12739 return static_cast<::cmd0>(cmd_code);
12740 }
12741 CONSTEXPR npu_set_ifm_height0_m1_t &set_cmd_code(::cmd0 value)
12742 {
12743 cmd_code = static_cast<uint32_t>(value);
12744 return *this;
12745 }
12746 CONSTEXPR uint32_t get_param() const
12747 {
12748 return static_cast<uint32_t>(param);
12749 }
12750 CONSTEXPR npu_set_ifm_height0_m1_t &set_param(uint32_t value)
12751 {
12752 param = static_cast<uint32_t>(value);
12753 return *this;
12754 }
12755#endif //__cplusplus
12756};
12757
12758// IFM Tile 1 (height-1)
12759struct npu_set_ifm_height1_m1_t
12760{
12761 uint32_t cmd_code : 10; // NPU_SET_IFM_HEIGHT1_M1
12762 uint32_t must_be_zero0 : 6; // 0
12763 uint32_t param : 16;
12764#ifdef __cplusplus
12765 CONSTEXPR bool valid() const
12766 {
12767 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_IFM_HEIGHT1_M1) && must_be_zero0 == 0;
12768 }
12769 CONSTEXPR void init()
12770 {
12771 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_IFM_HEIGHT1_M1);
12772 must_be_zero0 = 0;
12773 }
12774 CONSTEXPR ::cmd0 get_cmd_code() const
12775 {
12776 return static_cast<::cmd0>(cmd_code);
12777 }
12778 CONSTEXPR npu_set_ifm_height1_m1_t &set_cmd_code(::cmd0 value)
12779 {
12780 cmd_code = static_cast<uint32_t>(value);
12781 return *this;
12782 }
12783 CONSTEXPR uint32_t get_param() const
12784 {
12785 return static_cast<uint32_t>(param);
12786 }
12787 CONSTEXPR npu_set_ifm_height1_m1_t &set_param(uint32_t value)
12788 {
12789 param = static_cast<uint32_t>(value);
12790 return *this;
12791 }
12792#endif //__cplusplus
12793};
12794
12795// End of IB0,IB1 buffers in the SHRAM in KB units. Multiple of 2.
12796struct npu_set_ifm_ib_end_t
12797{
12798 uint32_t cmd_code : 10; // NPU_SET_IFM_IB_END
12799 uint32_t must_be_zero0 : 6; // 0
12800 uint32_t param : 16;
12801#ifdef __cplusplus
12802 CONSTEXPR bool valid() const
12803 {
12804 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_IFM_IB_END) && must_be_zero0 == 0;
12805 }
12806 CONSTEXPR void init()
12807 {
12808 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_IFM_IB_END);
12809 must_be_zero0 = 0;
12810 }
12811 CONSTEXPR ::cmd0 get_cmd_code() const
12812 {
12813 return static_cast<::cmd0>(cmd_code);
12814 }
12815 CONSTEXPR npu_set_ifm_ib_end_t &set_cmd_code(::cmd0 value)
12816 {
12817 cmd_code = static_cast<uint32_t>(value);
12818 return *this;
12819 }
12820 CONSTEXPR uint32_t get_param() const
12821 {
12822 return static_cast<uint32_t>(param);
12823 }
12824 CONSTEXPR npu_set_ifm_ib_end_t &set_param(uint32_t value)
12825 {
12826 param = static_cast<uint32_t>(value);
12827 return *this;
12828 }
12829#endif //__cplusplus
12830};
12831
12832// Index n for IFM access: BasePointer[n] is added to all IFM offsets
12833struct npu_set_ifm_region_t
12834{
12835 uint32_t cmd_code : 10; // NPU_SET_IFM_REGION
12836 uint32_t must_be_zero0 : 6; // 0
12837 uint32_t param : 16;
12838#ifdef __cplusplus
12839 CONSTEXPR bool valid() const
12840 {
12841 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_IFM_REGION) && must_be_zero0 == 0;
12842 }
12843 CONSTEXPR void init()
12844 {
12845 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_IFM_REGION);
12846 must_be_zero0 = 0;
12847 }
12848 CONSTEXPR ::cmd0 get_cmd_code() const
12849 {
12850 return static_cast<::cmd0>(cmd_code);
12851 }
12852 CONSTEXPR npu_set_ifm_region_t &set_cmd_code(::cmd0 value)
12853 {
12854 cmd_code = static_cast<uint32_t>(value);
12855 return *this;
12856 }
12857 CONSTEXPR uint32_t get_param() const
12858 {
12859 return static_cast<uint32_t>(param);
12860 }
12861 CONSTEXPR npu_set_ifm_region_t &set_param(uint32_t value)
12862 {
12863 param = static_cast<uint32_t>(value);
12864 return *this;
12865 }
12866#endif //__cplusplus
12867};
12868
12869// Output feature map width -1 (for the stripe to process)
12870struct npu_set_ofm_width_m1_t
12871{
12872 uint32_t cmd_code : 10; // NPU_SET_OFM_WIDTH_M1
12873 uint32_t must_be_zero0 : 6; // 0
12874 uint32_t param : 16;
12875#ifdef __cplusplus
12876 CONSTEXPR bool valid() const
12877 {
12878 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_OFM_WIDTH_M1) && must_be_zero0 == 0;
12879 }
12880 CONSTEXPR void init()
12881 {
12882 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_OFM_WIDTH_M1);
12883 must_be_zero0 = 0;
12884 }
12885 CONSTEXPR ::cmd0 get_cmd_code() const
12886 {
12887 return static_cast<::cmd0>(cmd_code);
12888 }
12889 CONSTEXPR npu_set_ofm_width_m1_t &set_cmd_code(::cmd0 value)
12890 {
12891 cmd_code = static_cast<uint32_t>(value);
12892 return *this;
12893 }
12894 CONSTEXPR uint32_t get_param() const
12895 {
12896 return static_cast<uint32_t>(param);
12897 }
12898 CONSTEXPR npu_set_ofm_width_m1_t &set_param(uint32_t value)
12899 {
12900 param = static_cast<uint32_t>(value);
12901 return *this;
12902 }
12903#endif //__cplusplus
12904};
12905
12906// Output feature map height -1 (for the stripe to process)
12907struct npu_set_ofm_height_m1_t
12908{
12909 uint32_t cmd_code : 10; // NPU_SET_OFM_HEIGHT_M1
12910 uint32_t must_be_zero0 : 6; // 0
12911 uint32_t param : 16;
12912#ifdef __cplusplus
12913 CONSTEXPR bool valid() const
12914 {
12915 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_OFM_HEIGHT_M1) && must_be_zero0 == 0;
12916 }
12917 CONSTEXPR void init()
12918 {
12919 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_OFM_HEIGHT_M1);
12920 must_be_zero0 = 0;
12921 }
12922 CONSTEXPR ::cmd0 get_cmd_code() const
12923 {
12924 return static_cast<::cmd0>(cmd_code);
12925 }
12926 CONSTEXPR npu_set_ofm_height_m1_t &set_cmd_code(::cmd0 value)
12927 {
12928 cmd_code = static_cast<uint32_t>(value);
12929 return *this;
12930 }
12931 CONSTEXPR uint32_t get_param() const
12932 {
12933 return static_cast<uint32_t>(param);
12934 }
12935 CONSTEXPR npu_set_ofm_height_m1_t &set_param(uint32_t value)
12936 {
12937 param = static_cast<uint32_t>(value);
12938 return *this;
12939 }
12940#endif //__cplusplus
12941};
12942
12943// Output feature map depth -1 (for the stripe to process)
12944struct npu_set_ofm_depth_m1_t
12945{
12946 uint32_t cmd_code : 10; // NPU_SET_OFM_DEPTH_M1
12947 uint32_t must_be_zero0 : 6; // 0
12948 uint32_t param : 16;
12949#ifdef __cplusplus
12950 CONSTEXPR bool valid() const
12951 {
12952 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_OFM_DEPTH_M1) && must_be_zero0 == 0;
12953 }
12954 CONSTEXPR void init()
12955 {
12956 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_OFM_DEPTH_M1);
12957 must_be_zero0 = 0;
12958 }
12959 CONSTEXPR ::cmd0 get_cmd_code() const
12960 {
12961 return static_cast<::cmd0>(cmd_code);
12962 }
12963 CONSTEXPR npu_set_ofm_depth_m1_t &set_cmd_code(::cmd0 value)
12964 {
12965 cmd_code = static_cast<uint32_t>(value);
12966 return *this;
12967 }
12968 CONSTEXPR uint32_t get_param() const
12969 {
12970 return static_cast<uint32_t>(param);
12971 }
12972 CONSTEXPR npu_set_ofm_depth_m1_t &set_param(uint32_t value)
12973 {
12974 param = static_cast<uint32_t>(value);
12975 return *this;
12976 }
12977#endif //__cplusplus
12978};
12979
12980// Set OFM precision
12981struct npu_set_ofm_precision_t
12982{
12983 uint32_t cmd_code : 10; // NPU_SET_OFM_PRECISION
12984 uint32_t must_be_zero0 : 6; // 0
12985 uint32_t precision : 3;
12986 uint32_t reserved0 : 3;
12987 uint32_t format : 2;
12988 uint32_t scaling : 1; // 0=Per channel scale/bias 1=Global scale (SET_OFM_SCALE), no bias
12989 uint32_t reserved1 : 5;
12990 uint32_t rounding : 2; // 0=TFL rounding 1=truncate towards zero 2=natural rounding
12991#ifdef __cplusplus
12992 CONSTEXPR bool valid() const
12993 {
12994 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_OFM_PRECISION) && must_be_zero0 == 0;
12995 }
12996 CONSTEXPR void init()
12997 {
12998 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_OFM_PRECISION);
12999 must_be_zero0 = 0;
13000 }
13001 CONSTEXPR ::cmd0 get_cmd_code() const
13002 {
13003 return static_cast<::cmd0>(cmd_code);
13004 }
13005 CONSTEXPR npu_set_ofm_precision_t &set_cmd_code(::cmd0 value)
13006 {
13007 cmd_code = static_cast<uint32_t>(value);
13008 return *this;
13009 }
13010 CONSTEXPR ::data_format get_format() const
13011 {
13012 return static_cast<::data_format>(format);
13013 }
13014 CONSTEXPR npu_set_ofm_precision_t &set_format(::data_format value)
13015 {
13016 format = static_cast<uint32_t>(value);
13017 return *this;
13018 }
13019 CONSTEXPR ::ofm_precision get_precision() const
13020 {
13021 return static_cast<::ofm_precision>(precision);
13022 }
13023 CONSTEXPR npu_set_ofm_precision_t &set_precision(::ofm_precision value)
13024 {
13025 precision = static_cast<uint32_t>(value);
13026 return *this;
13027 }
13028 CONSTEXPR ::rounding get_rounding() const
13029 {
13030 return static_cast<::rounding>(rounding);
13031 }
13032 CONSTEXPR npu_set_ofm_precision_t &set_rounding(::rounding value)
13033 {
13034 rounding = static_cast<uint32_t>(value);
13035 return *this;
13036 }
13037 CONSTEXPR uint32_t get_scaling() const
13038 {
13039 return static_cast<uint32_t>(scaling);
13040 }
13041 CONSTEXPR npu_set_ofm_precision_t &set_scaling(uint32_t value)
13042 {
13043 scaling = static_cast<uint32_t>(value);
13044 return *this;
13045 }
13046#endif //__cplusplus
13047};
13048
13049// TSU block width - 1 (provided sufficient data remaining)
13050struct npu_set_ofm_blk_width_m1_t
13051{
13052 uint32_t cmd_code : 10; // NPU_SET_OFM_BLK_WIDTH_M1
13053 uint32_t must_be_zero0 : 6; // 0
13054 uint32_t param : 16;
13055#ifdef __cplusplus
13056 CONSTEXPR bool valid() const
13057 {
13058 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_OFM_BLK_WIDTH_M1) && must_be_zero0 == 0;
13059 }
13060 CONSTEXPR void init()
13061 {
13062 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_OFM_BLK_WIDTH_M1);
13063 must_be_zero0 = 0;
13064 }
13065 CONSTEXPR ::cmd0 get_cmd_code() const
13066 {
13067 return static_cast<::cmd0>(cmd_code);
13068 }
13069 CONSTEXPR npu_set_ofm_blk_width_m1_t &set_cmd_code(::cmd0 value)
13070 {
13071 cmd_code = static_cast<uint32_t>(value);
13072 return *this;
13073 }
13074 CONSTEXPR uint32_t get_param() const
13075 {
13076 return static_cast<uint32_t>(param);
13077 }
13078 CONSTEXPR npu_set_ofm_blk_width_m1_t &set_param(uint32_t value)
13079 {
13080 param = static_cast<uint32_t>(value);
13081 return *this;
13082 }
13083#endif //__cplusplus
13084};
13085
13086// TSU block height -1 (provided sufficient data remaining)
13087struct npu_set_ofm_blk_height_m1_t
13088{
13089 uint32_t cmd_code : 10; // NPU_SET_OFM_BLK_HEIGHT_M1
13090 uint32_t must_be_zero0 : 6; // 0
13091 uint32_t param : 16;
13092#ifdef __cplusplus
13093 CONSTEXPR bool valid() const
13094 {
13095 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_OFM_BLK_HEIGHT_M1) && must_be_zero0 == 0;
13096 }
13097 CONSTEXPR void init()
13098 {
13099 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_OFM_BLK_HEIGHT_M1);
13100 must_be_zero0 = 0;
13101 }
13102 CONSTEXPR ::cmd0 get_cmd_code() const
13103 {
13104 return static_cast<::cmd0>(cmd_code);
13105 }
13106 CONSTEXPR npu_set_ofm_blk_height_m1_t &set_cmd_code(::cmd0 value)
13107 {
13108 cmd_code = static_cast<uint32_t>(value);
13109 return *this;
13110 }
13111 CONSTEXPR uint32_t get_param() const
13112 {
13113 return static_cast<uint32_t>(param);
13114 }
13115 CONSTEXPR npu_set_ofm_blk_height_m1_t &set_param(uint32_t value)
13116 {
13117 param = static_cast<uint32_t>(value);
13118 return *this;
13119 }
13120#endif //__cplusplus
13121};
13122
13123// TSU block depth -1 (provided sufficient data remaining)
13124struct npu_set_ofm_blk_depth_m1_t
13125{
13126 uint32_t cmd_code : 10; // NPU_SET_OFM_BLK_DEPTH_M1
13127 uint32_t must_be_zero0 : 6; // 0
13128 uint32_t param : 16;
13129#ifdef __cplusplus
13130 CONSTEXPR bool valid() const
13131 {
13132 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_OFM_BLK_DEPTH_M1) && must_be_zero0 == 0;
13133 }
13134 CONSTEXPR void init()
13135 {
13136 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_OFM_BLK_DEPTH_M1);
13137 must_be_zero0 = 0;
13138 }
13139 CONSTEXPR ::cmd0 get_cmd_code() const
13140 {
13141 return static_cast<::cmd0>(cmd_code);
13142 }
13143 CONSTEXPR npu_set_ofm_blk_depth_m1_t &set_cmd_code(::cmd0 value)
13144 {
13145 cmd_code = static_cast<uint32_t>(value);
13146 return *this;
13147 }
13148 CONSTEXPR uint32_t get_param() const
13149 {
13150 return static_cast<uint32_t>(param);
13151 }
13152 CONSTEXPR npu_set_ofm_blk_depth_m1_t &set_param(uint32_t value)
13153 {
13154 param = static_cast<uint32_t>(value);
13155 return *this;
13156 }
13157#endif //__cplusplus
13158};
13159
13160// Zero point offset (so value that 0 is encoded as)
13161struct npu_set_ofm_zero_point_t
13162{
13163 uint32_t cmd_code : 10; // NPU_SET_OFM_ZERO_POINT
13164 uint32_t must_be_zero0 : 6; // 0
13165 uint32_t param : 16;
13166#ifdef __cplusplus
13167 CONSTEXPR bool valid() const
13168 {
13169 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_OFM_ZERO_POINT) && must_be_zero0 == 0;
13170 }
13171 CONSTEXPR void init()
13172 {
13173 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_OFM_ZERO_POINT);
13174 must_be_zero0 = 0;
13175 }
13176 CONSTEXPR ::cmd0 get_cmd_code() const
13177 {
13178 return static_cast<::cmd0>(cmd_code);
13179 }
13180 CONSTEXPR npu_set_ofm_zero_point_t &set_cmd_code(::cmd0 value)
13181 {
13182 cmd_code = static_cast<uint32_t>(value);
13183 return *this;
13184 }
13185 CONSTEXPR uint32_t get_param() const
13186 {
13187 return static_cast<uint32_t>(param);
13188 }
13189 CONSTEXPR npu_set_ofm_zero_point_t &set_param(uint32_t value)
13190 {
13191 param = static_cast<uint32_t>(value);
13192 return *this;
13193 }
13194#endif //__cplusplus
13195};
13196
13197// OFM Tile 0 and tile 2 (width-1)
13198struct npu_set_ofm_width0_m1_t
13199{
13200 uint32_t cmd_code : 10; // NPU_SET_OFM_WIDTH0_M1
13201 uint32_t must_be_zero0 : 6; // 0
13202 uint32_t param : 16;
13203#ifdef __cplusplus
13204 CONSTEXPR bool valid() const
13205 {
13206 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_OFM_WIDTH0_M1) && must_be_zero0 == 0;
13207 }
13208 CONSTEXPR void init()
13209 {
13210 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_OFM_WIDTH0_M1);
13211 must_be_zero0 = 0;
13212 }
13213 CONSTEXPR ::cmd0 get_cmd_code() const
13214 {
13215 return static_cast<::cmd0>(cmd_code);
13216 }
13217 CONSTEXPR npu_set_ofm_width0_m1_t &set_cmd_code(::cmd0 value)
13218 {
13219 cmd_code = static_cast<uint32_t>(value);
13220 return *this;
13221 }
13222 CONSTEXPR uint32_t get_param() const
13223 {
13224 return static_cast<uint32_t>(param);
13225 }
13226 CONSTEXPR npu_set_ofm_width0_m1_t &set_param(uint32_t value)
13227 {
13228 param = static_cast<uint32_t>(value);
13229 return *this;
13230 }
13231#endif //__cplusplus
13232};
13233
13234// OFM Tile 0 (height-1)
13235struct npu_set_ofm_height0_m1_t
13236{
13237 uint32_t cmd_code : 10; // NPU_SET_OFM_HEIGHT0_M1
13238 uint32_t must_be_zero0 : 6; // 0
13239 uint32_t param : 16;
13240#ifdef __cplusplus
13241 CONSTEXPR bool valid() const
13242 {
13243 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_OFM_HEIGHT0_M1) && must_be_zero0 == 0;
13244 }
13245 CONSTEXPR void init()
13246 {
13247 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_OFM_HEIGHT0_M1);
13248 must_be_zero0 = 0;
13249 }
13250 CONSTEXPR ::cmd0 get_cmd_code() const
13251 {
13252 return static_cast<::cmd0>(cmd_code);
13253 }
13254 CONSTEXPR npu_set_ofm_height0_m1_t &set_cmd_code(::cmd0 value)
13255 {
13256 cmd_code = static_cast<uint32_t>(value);
13257 return *this;
13258 }
13259 CONSTEXPR uint32_t get_param() const
13260 {
13261 return static_cast<uint32_t>(param);
13262 }
13263 CONSTEXPR npu_set_ofm_height0_m1_t &set_param(uint32_t value)
13264 {
13265 param = static_cast<uint32_t>(value);
13266 return *this;
13267 }
13268#endif //__cplusplus
13269};
13270
13271// OFM Tile 1 (height-1)
13272struct npu_set_ofm_height1_m1_t
13273{
13274 uint32_t cmd_code : 10; // NPU_SET_OFM_HEIGHT1_M1
13275 uint32_t must_be_zero0 : 6; // 0
13276 uint32_t param : 16;
13277#ifdef __cplusplus
13278 CONSTEXPR bool valid() const
13279 {
13280 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_OFM_HEIGHT1_M1) && must_be_zero0 == 0;
13281 }
13282 CONSTEXPR void init()
13283 {
13284 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_OFM_HEIGHT1_M1);
13285 must_be_zero0 = 0;
13286 }
13287 CONSTEXPR ::cmd0 get_cmd_code() const
13288 {
13289 return static_cast<::cmd0>(cmd_code);
13290 }
13291 CONSTEXPR npu_set_ofm_height1_m1_t &set_cmd_code(::cmd0 value)
13292 {
13293 cmd_code = static_cast<uint32_t>(value);
13294 return *this;
13295 }
13296 CONSTEXPR uint32_t get_param() const
13297 {
13298 return static_cast<uint32_t>(param);
13299 }
13300 CONSTEXPR npu_set_ofm_height1_m1_t &set_param(uint32_t value)
13301 {
13302 param = static_cast<uint32_t>(value);
13303 return *this;
13304 }
13305#endif //__cplusplus
13306};
13307
13308// Index n for OFM access: BasePointer[n] is added to all OFM offsets
13309struct npu_set_ofm_region_t
13310{
13311 uint32_t cmd_code : 10; // NPU_SET_OFM_REGION
13312 uint32_t must_be_zero0 : 6; // 0
13313 uint32_t param : 16;
13314#ifdef __cplusplus
13315 CONSTEXPR bool valid() const
13316 {
13317 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_OFM_REGION) && must_be_zero0 == 0;
13318 }
13319 CONSTEXPR void init()
13320 {
13321 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_OFM_REGION);
13322 must_be_zero0 = 0;
13323 }
13324 CONSTEXPR ::cmd0 get_cmd_code() const
13325 {
13326 return static_cast<::cmd0>(cmd_code);
13327 }
13328 CONSTEXPR npu_set_ofm_region_t &set_cmd_code(::cmd0 value)
13329 {
13330 cmd_code = static_cast<uint32_t>(value);
13331 return *this;
13332 }
13333 CONSTEXPR uint32_t get_param() const
13334 {
13335 return static_cast<uint32_t>(param);
13336 }
13337 CONSTEXPR npu_set_ofm_region_t &set_param(uint32_t value)
13338 {
13339 param = static_cast<uint32_t>(value);
13340 return *this;
13341 }
13342#endif //__cplusplus
13343};
13344
13345// Set kernel width - 1
13346struct npu_set_kernel_width_m1_t
13347{
13348 uint32_t cmd_code : 10; // NPU_SET_KERNEL_WIDTH_M1
13349 uint32_t must_be_zero0 : 6; // 0
13350 uint32_t param : 16;
13351#ifdef __cplusplus
13352 CONSTEXPR bool valid() const
13353 {
13354 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_KERNEL_WIDTH_M1) && must_be_zero0 == 0;
13355 }
13356 CONSTEXPR void init()
13357 {
13358 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_KERNEL_WIDTH_M1);
13359 must_be_zero0 = 0;
13360 }
13361 CONSTEXPR ::cmd0 get_cmd_code() const
13362 {
13363 return static_cast<::cmd0>(cmd_code);
13364 }
13365 CONSTEXPR npu_set_kernel_width_m1_t &set_cmd_code(::cmd0 value)
13366 {
13367 cmd_code = static_cast<uint32_t>(value);
13368 return *this;
13369 }
13370 CONSTEXPR uint32_t get_param() const
13371 {
13372 return static_cast<uint32_t>(param);
13373 }
13374 CONSTEXPR npu_set_kernel_width_m1_t &set_param(uint32_t value)
13375 {
13376 param = static_cast<uint32_t>(value);
13377 return *this;
13378 }
13379#endif //__cplusplus
13380};
13381
13382// Set kernel height - 1
13383struct npu_set_kernel_height_m1_t
13384{
13385 uint32_t cmd_code : 10; // NPU_SET_KERNEL_HEIGHT_M1
13386 uint32_t must_be_zero0 : 6; // 0
13387 uint32_t param : 16;
13388#ifdef __cplusplus
13389 CONSTEXPR bool valid() const
13390 {
13391 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_KERNEL_HEIGHT_M1) && must_be_zero0 == 0;
13392 }
13393 CONSTEXPR void init()
13394 {
13395 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_KERNEL_HEIGHT_M1);
13396 must_be_zero0 = 0;
13397 }
13398 CONSTEXPR ::cmd0 get_cmd_code() const
13399 {
13400 return static_cast<::cmd0>(cmd_code);
13401 }
13402 CONSTEXPR npu_set_kernel_height_m1_t &set_cmd_code(::cmd0 value)
13403 {
13404 cmd_code = static_cast<uint32_t>(value);
13405 return *this;
13406 }
13407 CONSTEXPR uint32_t get_param() const
13408 {
13409 return static_cast<uint32_t>(param);
13410 }
13411 CONSTEXPR npu_set_kernel_height_m1_t &set_param(uint32_t value)
13412 {
13413 param = static_cast<uint32_t>(value);
13414 return *this;
13415 }
13416#endif //__cplusplus
13417};
13418
13419// Kernel stride b0=X stride-1, b1=Y stride-1, b2=weight order (0=depth, 1=kernel) b3 = kernel_x_dilation - 1 (0=no x
13420// dilation, 1=x dilation of x2) b4 = kernel_y_dilation -1 (0=no y dilation, 1=y dilation of x2) b5 = kernel
13421// decomposition size (0 for kernel_split_size=8, 1 for kernel_split_size=4)
13422struct npu_set_kernel_stride_t
13423{
13424 uint32_t cmd_code : 10; // NPU_SET_KERNEL_STRIDE
13425 uint32_t must_be_zero0 : 6; // 0
13426 uint32_t param : 16;
13427#ifdef __cplusplus
13428 CONSTEXPR bool valid() const
13429 {
13430 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_KERNEL_STRIDE) && must_be_zero0 == 0;
13431 }
13432 CONSTEXPR void init()
13433 {
13434 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_KERNEL_STRIDE);
13435 must_be_zero0 = 0;
13436 }
13437 CONSTEXPR ::cmd0 get_cmd_code() const
13438 {
13439 return static_cast<::cmd0>(cmd_code);
13440 }
13441 CONSTEXPR npu_set_kernel_stride_t &set_cmd_code(::cmd0 value)
13442 {
13443 cmd_code = static_cast<uint32_t>(value);
13444 return *this;
13445 }
13446 CONSTEXPR uint32_t get_param() const
13447 {
13448 return static_cast<uint32_t>(param);
13449 }
13450 CONSTEXPR npu_set_kernel_stride_t &set_param(uint32_t value)
13451 {
13452 param = static_cast<uint32_t>(value);
13453 return *this;
13454 }
13455#endif //__cplusplus
13456};
13457
13458// 0=1-core, 1=2-core depth
13459struct npu_set_parallel_mode_t
13460{
13461 uint32_t cmd_code : 10; // NPU_SET_PARALLEL_MODE
13462 uint32_t must_be_zero0 : 6; // 0
13463 uint32_t param : 16;
13464#ifdef __cplusplus
13465 CONSTEXPR bool valid() const
13466 {
13467 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_PARALLEL_MODE) && must_be_zero0 == 0;
13468 }
13469 CONSTEXPR void init()
13470 {
13471 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_PARALLEL_MODE);
13472 must_be_zero0 = 0;
13473 }
13474 CONSTEXPR ::cmd0 get_cmd_code() const
13475 {
13476 return static_cast<::cmd0>(cmd_code);
13477 }
13478 CONSTEXPR npu_set_parallel_mode_t &set_cmd_code(::cmd0 value)
13479 {
13480 cmd_code = static_cast<uint32_t>(value);
13481 return *this;
13482 }
13483 CONSTEXPR uint32_t get_param() const
13484 {
13485 return static_cast<uint32_t>(param);
13486 }
13487 CONSTEXPR npu_set_parallel_mode_t &set_param(uint32_t value)
13488 {
13489 param = static_cast<uint32_t>(value);
13490 return *this;
13491 }
13492#endif //__cplusplus
13493};
13494
13495// Set accumulator format
13496struct npu_set_acc_format_t
13497{
13498 uint32_t cmd_code : 10; // NPU_SET_ACC_FORMAT
13499 uint32_t must_be_zero0 : 6; // 0
13500 uint32_t param : 16;
13501#ifdef __cplusplus
13502 CONSTEXPR bool valid() const
13503 {
13504 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_ACC_FORMAT) && must_be_zero0 == 0;
13505 }
13506 CONSTEXPR void init()
13507 {
13508 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_ACC_FORMAT);
13509 must_be_zero0 = 0;
13510 }
13511 CONSTEXPR ::cmd0 get_cmd_code() const
13512 {
13513 return static_cast<::cmd0>(cmd_code);
13514 }
13515 CONSTEXPR npu_set_acc_format_t &set_cmd_code(::cmd0 value)
13516 {
13517 cmd_code = static_cast<uint32_t>(value);
13518 return *this;
13519 }
13520 CONSTEXPR ::acc_format get_param() const
13521 {
13522 return static_cast<::acc_format>(param);
13523 }
13524 CONSTEXPR npu_set_acc_format_t &set_param(::acc_format value)
13525 {
13526 param = static_cast<uint32_t>(value);
13527 return *this;
13528 }
13529#endif //__cplusplus
13530};
13531
13532// Set activation
13533struct npu_set_activation_t
13534{
13535 uint32_t cmd_code : 10; // NPU_SET_ACTIVATION
13536 uint32_t must_be_zero0 : 6; // 0
13537 uint32_t type : 12;
13538 uint32_t act_clip_range : 4;
13539#ifdef __cplusplus
13540 CONSTEXPR bool valid() const
13541 {
13542 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_ACTIVATION) && must_be_zero0 == 0;
13543 }
13544 CONSTEXPR void init()
13545 {
13546 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_ACTIVATION);
13547 must_be_zero0 = 0;
13548 }
13549 CONSTEXPR ::clip_range get_act_clip_range() const
13550 {
13551 return static_cast<::clip_range>(act_clip_range);
13552 }
13553 CONSTEXPR npu_set_activation_t &set_act_clip_range(::clip_range value)
13554 {
13555 act_clip_range = static_cast<uint32_t>(value);
13556 return *this;
13557 }
13558 CONSTEXPR ::cmd0 get_cmd_code() const
13559 {
13560 return static_cast<::cmd0>(cmd_code);
13561 }
13562 CONSTEXPR npu_set_activation_t &set_cmd_code(::cmd0 value)
13563 {
13564 cmd_code = static_cast<uint32_t>(value);
13565 return *this;
13566 }
13567 CONSTEXPR ::activation get_type() const
13568 {
13569 return static_cast<::activation>(type);
13570 }
13571 CONSTEXPR npu_set_activation_t &set_type(::activation value)
13572 {
13573 type = static_cast<uint32_t>(value);
13574 return *this;
13575 }
13576#endif //__cplusplus
13577};
13578
13579// Lower bound clip for OFM activations – range is the OFM type range
13580struct npu_set_activation_min_t
13581{
13582 uint32_t cmd_code : 10; // NPU_SET_ACTIVATION_MIN
13583 uint32_t must_be_zero0 : 6; // 0
13584 uint32_t param : 16;
13585#ifdef __cplusplus
13586 CONSTEXPR bool valid() const
13587 {
13588 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_ACTIVATION_MIN) && must_be_zero0 == 0;
13589 }
13590 CONSTEXPR void init()
13591 {
13592 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_ACTIVATION_MIN);
13593 must_be_zero0 = 0;
13594 }
13595 CONSTEXPR ::cmd0 get_cmd_code() const
13596 {
13597 return static_cast<::cmd0>(cmd_code);
13598 }
13599 CONSTEXPR npu_set_activation_min_t &set_cmd_code(::cmd0 value)
13600 {
13601 cmd_code = static_cast<uint32_t>(value);
13602 return *this;
13603 }
13604 CONSTEXPR uint32_t get_param() const
13605 {
13606 return static_cast<uint32_t>(param);
13607 }
13608 CONSTEXPR npu_set_activation_min_t &set_param(uint32_t value)
13609 {
13610 param = static_cast<uint32_t>(value);
13611 return *this;
13612 }
13613#endif //__cplusplus
13614};
13615
13616// Upper bound clip for OFM activations – range is the OFM type range
13617struct npu_set_activation_max_t
13618{
13619 uint32_t cmd_code : 10; // NPU_SET_ACTIVATION_MAX
13620 uint32_t must_be_zero0 : 6; // 0
13621 uint32_t param : 16;
13622#ifdef __cplusplus
13623 CONSTEXPR bool valid() const
13624 {
13625 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_ACTIVATION_MAX) && must_be_zero0 == 0;
13626 }
13627 CONSTEXPR void init()
13628 {
13629 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_ACTIVATION_MAX);
13630 must_be_zero0 = 0;
13631 }
13632 CONSTEXPR ::cmd0 get_cmd_code() const
13633 {
13634 return static_cast<::cmd0>(cmd_code);
13635 }
13636 CONSTEXPR npu_set_activation_max_t &set_cmd_code(::cmd0 value)
13637 {
13638 cmd_code = static_cast<uint32_t>(value);
13639 return *this;
13640 }
13641 CONSTEXPR uint32_t get_param() const
13642 {
13643 return static_cast<uint32_t>(param);
13644 }
13645 CONSTEXPR npu_set_activation_max_t &set_param(uint32_t value)
13646 {
13647 param = static_cast<uint32_t>(value);
13648 return *this;
13649 }
13650#endif //__cplusplus
13651};
13652
13653// Index n for weight access: BasePointer[n] is added to all Weight stream offsets
13654struct npu_set_weight_region_t
13655{
13656 uint32_t cmd_code : 10; // NPU_SET_WEIGHT_REGION
13657 uint32_t must_be_zero0 : 6; // 0
13658 uint32_t param : 16;
13659#ifdef __cplusplus
13660 CONSTEXPR bool valid() const
13661 {
13662 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_WEIGHT_REGION) && must_be_zero0 == 0;
13663 }
13664 CONSTEXPR void init()
13665 {
13666 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_WEIGHT_REGION);
13667 must_be_zero0 = 0;
13668 }
13669 CONSTEXPR ::cmd0 get_cmd_code() const
13670 {
13671 return static_cast<::cmd0>(cmd_code);
13672 }
13673 CONSTEXPR npu_set_weight_region_t &set_cmd_code(::cmd0 value)
13674 {
13675 cmd_code = static_cast<uint32_t>(value);
13676 return *this;
13677 }
13678 CONSTEXPR uint32_t get_param() const
13679 {
13680 return static_cast<uint32_t>(param);
13681 }
13682 CONSTEXPR npu_set_weight_region_t &set_param(uint32_t value)
13683 {
13684 param = static_cast<uint32_t>(value);
13685 return *this;
13686 }
13687#endif //__cplusplus
13688};
13689
13690// Index n for weight access: BasePointer[n] is added to all scale stream offsets
13691struct npu_set_scale_region_t
13692{
13693 uint32_t cmd_code : 10; // NPU_SET_SCALE_REGION
13694 uint32_t must_be_zero0 : 6; // 0
13695 uint32_t param : 16;
13696#ifdef __cplusplus
13697 CONSTEXPR bool valid() const
13698 {
13699 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_SCALE_REGION) && must_be_zero0 == 0;
13700 }
13701 CONSTEXPR void init()
13702 {
13703 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_SCALE_REGION);
13704 must_be_zero0 = 0;
13705 }
13706 CONSTEXPR ::cmd0 get_cmd_code() const
13707 {
13708 return static_cast<::cmd0>(cmd_code);
13709 }
13710 CONSTEXPR npu_set_scale_region_t &set_cmd_code(::cmd0 value)
13711 {
13712 cmd_code = static_cast<uint32_t>(value);
13713 return *this;
13714 }
13715 CONSTEXPR uint32_t get_param() const
13716 {
13717 return static_cast<uint32_t>(param);
13718 }
13719 CONSTEXPR npu_set_scale_region_t &set_param(uint32_t value)
13720 {
13721 param = static_cast<uint32_t>(value);
13722 return *this;
13723 }
13724#endif //__cplusplus
13725};
13726
13727// Start of ACC0,ACC1 buffers in the SHRAM in KB units. Multiple of 4.)
13728struct npu_set_ab_start_t
13729{
13730 uint32_t cmd_code : 10; // NPU_SET_AB_START
13731 uint32_t must_be_zero0 : 6; // 0
13732 uint32_t param : 16;
13733#ifdef __cplusplus
13734 CONSTEXPR bool valid() const
13735 {
13736 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_AB_START) && must_be_zero0 == 0;
13737 }
13738 CONSTEXPR void init()
13739 {
13740 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_AB_START);
13741 must_be_zero0 = 0;
13742 }
13743 CONSTEXPR ::cmd0 get_cmd_code() const
13744 {
13745 return static_cast<::cmd0>(cmd_code);
13746 }
13747 CONSTEXPR npu_set_ab_start_t &set_cmd_code(::cmd0 value)
13748 {
13749 cmd_code = static_cast<uint32_t>(value);
13750 return *this;
13751 }
13752 CONSTEXPR uint32_t get_param() const
13753 {
13754 return static_cast<uint32_t>(param);
13755 }
13756 CONSTEXPR npu_set_ab_start_t &set_param(uint32_t value)
13757 {
13758 param = static_cast<uint32_t>(value);
13759 return *this;
13760 }
13761#endif //__cplusplus
13762};
13763
13764// Set block number of blocks dependency between kernel operations
13765struct npu_set_blockdep_t
13766{
13767 uint32_t cmd_code : 10; // NPU_SET_BLOCKDEP
13768 uint32_t must_be_zero0 : 6; // 0
13769 uint32_t param : 16;
13770#ifdef __cplusplus
13771 CONSTEXPR bool valid() const
13772 {
13773 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_BLOCKDEP) && must_be_zero0 == 0;
13774 }
13775 CONSTEXPR void init()
13776 {
13777 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_BLOCKDEP);
13778 must_be_zero0 = 0;
13779 }
13780 CONSTEXPR ::cmd0 get_cmd_code() const
13781 {
13782 return static_cast<::cmd0>(cmd_code);
13783 }
13784 CONSTEXPR npu_set_blockdep_t &set_cmd_code(::cmd0 value)
13785 {
13786 cmd_code = static_cast<uint32_t>(value);
13787 return *this;
13788 }
13789 CONSTEXPR uint32_t get_param() const
13790 {
13791 return static_cast<uint32_t>(param);
13792 }
13793 CONSTEXPR npu_set_blockdep_t &set_param(uint32_t value)
13794 {
13795 param = static_cast<uint32_t>(value);
13796 return *this;
13797 }
13798#endif //__cplusplus
13799};
13800
13801// DMA0 SRC region bitmap
13802struct npu_set_dma0_src_region_t
13803{
13804 uint32_t cmd_code : 10; // NPU_SET_DMA0_SRC_REGION
13805 uint32_t must_be_zero0 : 6; // 0
13806 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,
13807 // Bit[7:0]=Core number (0 or 1) to read.
13808 uint32_t internal : 1; // Must be 0 (external)
13809 uint32_t stride_mode : 2; // stride mode 0/1/2=1D/2D/3D
13810 uint32_t reserved0 : 5;
13811#ifdef __cplusplus
13812 CONSTEXPR bool valid() const
13813 {
13814 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_DMA0_SRC_REGION) && must_be_zero0 == 0;
13815 }
13816 CONSTEXPR void init()
13817 {
13818 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_DMA0_SRC_REGION);
13819 must_be_zero0 = 0;
13820 }
13821 CONSTEXPR ::cmd0 get_cmd_code() const
13822 {
13823 return static_cast<::cmd0>(cmd_code);
13824 }
13825 CONSTEXPR npu_set_dma0_src_region_t &set_cmd_code(::cmd0 value)
13826 {
13827 cmd_code = static_cast<uint32_t>(value);
13828 return *this;
13829 }
13830 CONSTEXPR uint32_t get_internal() const
13831 {
13832 return static_cast<uint32_t>(internal);
13833 }
13834 CONSTEXPR npu_set_dma0_src_region_t &set_internal(uint32_t value)
13835 {
13836 internal = static_cast<uint32_t>(value);
13837 return *this;
13838 }
13839 CONSTEXPR uint32_t get_region() const
13840 {
13841 return static_cast<uint32_t>(region);
13842 }
13843 CONSTEXPR npu_set_dma0_src_region_t &set_region(uint32_t value)
13844 {
13845 region = static_cast<uint32_t>(value);
13846 return *this;
13847 }
13848 CONSTEXPR ::stride_mode get_stride_mode() const
13849 {
13850 return static_cast<::stride_mode>(stride_mode);
13851 }
13852 CONSTEXPR npu_set_dma0_src_region_t &set_stride_mode(::stride_mode value)
13853 {
13854 stride_mode = static_cast<uint32_t>(value);
13855 return *this;
13856 }
13857#endif //__cplusplus
13858};
13859
13860// DMA0 DST region bitmap
13861struct npu_set_dma0_dst_region_t
13862{
13863 uint32_t cmd_code : 10; // NPU_SET_DMA0_DST_REGION
13864 uint32_t must_be_zero0 : 6; // 0
13865 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,
13866 // Bit[7:0]=Core mask to write to (bit k set for core k=0,1).
13867 uint32_t internal : 1; // Select external/internal=0/1
13868 uint32_t stride_mode : 2; // stride mode 0/1/2=1D/2D/3D
13869 uint32_t reserved0 : 5;
13870#ifdef __cplusplus
13871 CONSTEXPR bool valid() const
13872 {
13873 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_DMA0_DST_REGION) && must_be_zero0 == 0;
13874 }
13875 CONSTEXPR void init()
13876 {
13877 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_DMA0_DST_REGION);
13878 must_be_zero0 = 0;
13879 }
13880 CONSTEXPR ::cmd0 get_cmd_code() const
13881 {
13882 return static_cast<::cmd0>(cmd_code);
13883 }
13884 CONSTEXPR npu_set_dma0_dst_region_t &set_cmd_code(::cmd0 value)
13885 {
13886 cmd_code = static_cast<uint32_t>(value);
13887 return *this;
13888 }
13889 CONSTEXPR uint32_t get_internal() const
13890 {
13891 return static_cast<uint32_t>(internal);
13892 }
13893 CONSTEXPR npu_set_dma0_dst_region_t &set_internal(uint32_t value)
13894 {
13895 internal = static_cast<uint32_t>(value);
13896 return *this;
13897 }
13898 CONSTEXPR uint32_t get_region() const
13899 {
13900 return static_cast<uint32_t>(region);
13901 }
13902 CONSTEXPR npu_set_dma0_dst_region_t &set_region(uint32_t value)
13903 {
13904 region = static_cast<uint32_t>(value);
13905 return *this;
13906 }
13907 CONSTEXPR ::stride_mode get_stride_mode() const
13908 {
13909 return static_cast<::stride_mode>(stride_mode);
13910 }
13911 CONSTEXPR npu_set_dma0_dst_region_t &set_stride_mode(::stride_mode value)
13912 {
13913 stride_mode = static_cast<uint32_t>(value);
13914 return *this;
13915 }
13916#endif //__cplusplus
13917};
13918
13919// Inner size for 2D/3D mode.
13920struct npu_set_dma0_size0_t
13921{
13922 uint32_t cmd_code : 10; // NPU_SET_DMA0_SIZE0
13923 uint32_t must_be_zero0 : 6; // 0
13924 uint32_t param : 16;
13925#ifdef __cplusplus
13926 CONSTEXPR bool valid() const
13927 {
13928 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_DMA0_SIZE0) && must_be_zero0 == 0;
13929 }
13930 CONSTEXPR void init()
13931 {
13932 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_DMA0_SIZE0);
13933 must_be_zero0 = 0;
13934 }
13935 CONSTEXPR ::cmd0 get_cmd_code() const
13936 {
13937 return static_cast<::cmd0>(cmd_code);
13938 }
13939 CONSTEXPR npu_set_dma0_size0_t &set_cmd_code(::cmd0 value)
13940 {
13941 cmd_code = static_cast<uint32_t>(value);
13942 return *this;
13943 }
13944 CONSTEXPR uint32_t get_param() const
13945 {
13946 return static_cast<uint32_t>(param);
13947 }
13948 CONSTEXPR npu_set_dma0_size0_t &set_param(uint32_t value)
13949 {
13950 param = static_cast<uint32_t>(value);
13951 return *this;
13952 }
13953#endif //__cplusplus
13954};
13955
13956// Outer size for 3D mode.
13957struct npu_set_dma0_size1_t
13958{
13959 uint32_t cmd_code : 10; // NPU_SET_DMA0_SIZE1
13960 uint32_t must_be_zero0 : 6; // 0
13961 uint32_t param : 16;
13962#ifdef __cplusplus
13963 CONSTEXPR bool valid() const
13964 {
13965 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_DMA0_SIZE1) && must_be_zero0 == 0;
13966 }
13967 CONSTEXPR void init()
13968 {
13969 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_DMA0_SIZE1);
13970 must_be_zero0 = 0;
13971 }
13972 CONSTEXPR ::cmd0 get_cmd_code() const
13973 {
13974 return static_cast<::cmd0>(cmd_code);
13975 }
13976 CONSTEXPR npu_set_dma0_size1_t &set_cmd_code(::cmd0 value)
13977 {
13978 cmd_code = static_cast<uint32_t>(value);
13979 return *this;
13980 }
13981 CONSTEXPR uint32_t get_param() const
13982 {
13983 return static_cast<uint32_t>(param);
13984 }
13985 CONSTEXPR npu_set_dma0_size1_t &set_param(uint32_t value)
13986 {
13987 param = static_cast<uint32_t>(value);
13988 return *this;
13989 }
13990#endif //__cplusplus
13991};
13992
13993// Set IFM2 Broadcast mode
13994struct npu_set_ifm2_broadcast_t
13995{
13996 uint32_t cmd_code : 10; // NPU_SET_IFM2_BROADCAST
13997 uint32_t must_be_zero0 : 6; // 0
13998 uint32_t broadcast_height : 1;
13999 uint32_t broadcast_width : 1;
14000 uint32_t broadcast_depth : 1;
14001 uint32_t reserved0 : 3;
14002 uint32_t operand_order : 1;
14003 uint32_t broadcast_scalar : 1;
14004 uint32_t reserved1 : 8;
14005#ifdef __cplusplus
14006 CONSTEXPR bool valid() const
14007 {
14008 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_IFM2_BROADCAST) && must_be_zero0 == 0;
14009 }
14010 CONSTEXPR void init()
14011 {
14012 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_IFM2_BROADCAST);
14013 must_be_zero0 = 0;
14014 }
14015 CONSTEXPR uint32_t get_broadcast_depth() const
14016 {
14017 return static_cast<uint32_t>(broadcast_depth);
14018 }
14019 CONSTEXPR npu_set_ifm2_broadcast_t &set_broadcast_depth(uint32_t value)
14020 {
14021 broadcast_depth = static_cast<uint32_t>(value);
14022 return *this;
14023 }
14024 CONSTEXPR uint32_t get_broadcast_height() const
14025 {
14026 return static_cast<uint32_t>(broadcast_height);
14027 }
14028 CONSTEXPR npu_set_ifm2_broadcast_t &set_broadcast_height(uint32_t value)
14029 {
14030 broadcast_height = static_cast<uint32_t>(value);
14031 return *this;
14032 }
14033 CONSTEXPR uint32_t get_broadcast_scalar() const
14034 {
14035 return static_cast<uint32_t>(broadcast_scalar);
14036 }
14037 CONSTEXPR npu_set_ifm2_broadcast_t &set_broadcast_scalar(uint32_t value)
14038 {
14039 broadcast_scalar = static_cast<uint32_t>(value);
14040 return *this;
14041 }
14042 CONSTEXPR uint32_t get_broadcast_width() const
14043 {
14044 return static_cast<uint32_t>(broadcast_width);
14045 }
14046 CONSTEXPR npu_set_ifm2_broadcast_t &set_broadcast_width(uint32_t value)
14047 {
14048 broadcast_width = static_cast<uint32_t>(value);
14049 return *this;
14050 }
14051 CONSTEXPR ::cmd0 get_cmd_code() const
14052 {
14053 return static_cast<::cmd0>(cmd_code);
14054 }
14055 CONSTEXPR npu_set_ifm2_broadcast_t &set_cmd_code(::cmd0 value)
14056 {
14057 cmd_code = static_cast<uint32_t>(value);
14058 return *this;
14059 }
14060 CONSTEXPR uint32_t get_operand_order() const
14061 {
14062 return static_cast<uint32_t>(operand_order);
14063 }
14064 CONSTEXPR npu_set_ifm2_broadcast_t &set_operand_order(uint32_t value)
14065 {
14066 operand_order = static_cast<uint32_t>(value);
14067 return *this;
14068 }
14069#endif //__cplusplus
14070};
14071
14072// IFM2 scalar value at range IFM_PRECISION
14073struct npu_set_ifm2_scalar_t
14074{
14075 uint32_t cmd_code : 10; // NPU_SET_IFM2_SCALAR
14076 uint32_t must_be_zero0 : 6; // 0
14077 uint32_t param : 16;
14078#ifdef __cplusplus
14079 CONSTEXPR bool valid() const
14080 {
14081 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_IFM2_SCALAR) && must_be_zero0 == 0;
14082 }
14083 CONSTEXPR void init()
14084 {
14085 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_IFM2_SCALAR);
14086 must_be_zero0 = 0;
14087 }
14088 CONSTEXPR ::cmd0 get_cmd_code() const
14089 {
14090 return static_cast<::cmd0>(cmd_code);
14091 }
14092 CONSTEXPR npu_set_ifm2_scalar_t &set_cmd_code(::cmd0 value)
14093 {
14094 cmd_code = static_cast<uint32_t>(value);
14095 return *this;
14096 }
14097 CONSTEXPR uint32_t get_param() const
14098 {
14099 return static_cast<uint32_t>(param);
14100 }
14101 CONSTEXPR npu_set_ifm2_scalar_t &set_param(uint32_t value)
14102 {
14103 param = static_cast<uint32_t>(value);
14104 return *this;
14105 }
14106#endif //__cplusplus
14107};
14108
14109// Set activation
14110struct npu_set_ifm2_precision_t
14111{
14112 uint32_t cmd_code : 10; // NPU_SET_IFM2_PRECISION
14113 uint32_t must_be_zero0 : 6; // 0
14114 uint32_t param : 4;
14115 uint32_t reserved0 : 2;
14116 uint32_t format : 2;
14117 uint32_t reserved1 : 8;
14118#ifdef __cplusplus
14119 CONSTEXPR bool valid() const
14120 {
14121 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_IFM2_PRECISION) && must_be_zero0 == 0;
14122 }
14123 CONSTEXPR void init()
14124 {
14125 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_IFM2_PRECISION);
14126 must_be_zero0 = 0;
14127 }
14128 CONSTEXPR ::cmd0 get_cmd_code() const
14129 {
14130 return static_cast<::cmd0>(cmd_code);
14131 }
14132 CONSTEXPR npu_set_ifm2_precision_t &set_cmd_code(::cmd0 value)
14133 {
14134 cmd_code = static_cast<uint32_t>(value);
14135 return *this;
14136 }
14137 CONSTEXPR ::data_format get_format() const
14138 {
14139 return static_cast<::data_format>(format);
14140 }
14141 CONSTEXPR npu_set_ifm2_precision_t &set_format(::data_format value)
14142 {
14143 format = static_cast<uint32_t>(value);
14144 return *this;
14145 }
14146 CONSTEXPR ::ifm_precision get_param() const
14147 {
14148 return static_cast<::ifm_precision>(param);
14149 }
14150 CONSTEXPR npu_set_ifm2_precision_t &set_param(::ifm_precision value)
14151 {
14152 param = static_cast<uint32_t>(value);
14153 return *this;
14154 }
14155#endif //__cplusplus
14156};
14157
14158// Zero point offset (so value that 0 is encoded as) at range IFM_PRECISION
14159struct npu_set_ifm2_zero_point_t
14160{
14161 uint32_t cmd_code : 10; // NPU_SET_IFM2_ZERO_POINT
14162 uint32_t must_be_zero0 : 6; // 0
14163 uint32_t param : 16;
14164#ifdef __cplusplus
14165 CONSTEXPR bool valid() const
14166 {
14167 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_IFM2_ZERO_POINT) && must_be_zero0 == 0;
14168 }
14169 CONSTEXPR void init()
14170 {
14171 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_IFM2_ZERO_POINT);
14172 must_be_zero0 = 0;
14173 }
14174 CONSTEXPR ::cmd0 get_cmd_code() const
14175 {
14176 return static_cast<::cmd0>(cmd_code);
14177 }
14178 CONSTEXPR npu_set_ifm2_zero_point_t &set_cmd_code(::cmd0 value)
14179 {
14180 cmd_code = static_cast<uint32_t>(value);
14181 return *this;
14182 }
14183 CONSTEXPR uint32_t get_param() const
14184 {
14185 return static_cast<uint32_t>(param);
14186 }
14187 CONSTEXPR npu_set_ifm2_zero_point_t &set_param(uint32_t value)
14188 {
14189 param = static_cast<uint32_t>(value);
14190 return *this;
14191 }
14192#endif //__cplusplus
14193};
14194
14195// IFM2 Tile 0 and tile 2 (width-1)
14196struct npu_set_ifm2_width0_m1_t
14197{
14198 uint32_t cmd_code : 10; // NPU_SET_IFM2_WIDTH0_M1
14199 uint32_t must_be_zero0 : 6; // 0
14200 uint32_t param : 16;
14201#ifdef __cplusplus
14202 CONSTEXPR bool valid() const
14203 {
14204 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_IFM2_WIDTH0_M1) && must_be_zero0 == 0;
14205 }
14206 CONSTEXPR void init()
14207 {
14208 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_IFM2_WIDTH0_M1);
14209 must_be_zero0 = 0;
14210 }
14211 CONSTEXPR ::cmd0 get_cmd_code() const
14212 {
14213 return static_cast<::cmd0>(cmd_code);
14214 }
14215 CONSTEXPR npu_set_ifm2_width0_m1_t &set_cmd_code(::cmd0 value)
14216 {
14217 cmd_code = static_cast<uint32_t>(value);
14218 return *this;
14219 }
14220 CONSTEXPR uint32_t get_param() const
14221 {
14222 return static_cast<uint32_t>(param);
14223 }
14224 CONSTEXPR npu_set_ifm2_width0_m1_t &set_param(uint32_t value)
14225 {
14226 param = static_cast<uint32_t>(value);
14227 return *this;
14228 }
14229#endif //__cplusplus
14230};
14231
14232// IFM2 Tile 0 (height-1)
14233struct npu_set_ifm2_height0_m1_t
14234{
14235 uint32_t cmd_code : 10; // NPU_SET_IFM2_HEIGHT0_M1
14236 uint32_t must_be_zero0 : 6; // 0
14237 uint32_t param : 16;
14238#ifdef __cplusplus
14239 CONSTEXPR bool valid() const
14240 {
14241 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_IFM2_HEIGHT0_M1) && must_be_zero0 == 0;
14242 }
14243 CONSTEXPR void init()
14244 {
14245 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_IFM2_HEIGHT0_M1);
14246 must_be_zero0 = 0;
14247 }
14248 CONSTEXPR ::cmd0 get_cmd_code() const
14249 {
14250 return static_cast<::cmd0>(cmd_code);
14251 }
14252 CONSTEXPR npu_set_ifm2_height0_m1_t &set_cmd_code(::cmd0 value)
14253 {
14254 cmd_code = static_cast<uint32_t>(value);
14255 return *this;
14256 }
14257 CONSTEXPR uint32_t get_param() const
14258 {
14259 return static_cast<uint32_t>(param);
14260 }
14261 CONSTEXPR npu_set_ifm2_height0_m1_t &set_param(uint32_t value)
14262 {
14263 param = static_cast<uint32_t>(value);
14264 return *this;
14265 }
14266#endif //__cplusplus
14267};
14268
14269// IFM2 Tile 1 (height-1)
14270struct npu_set_ifm2_height1_m1_t
14271{
14272 uint32_t cmd_code : 10; // NPU_SET_IFM2_HEIGHT1_M1
14273 uint32_t must_be_zero0 : 6; // 0
14274 uint32_t param : 16;
14275#ifdef __cplusplus
14276 CONSTEXPR bool valid() const
14277 {
14278 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_IFM2_HEIGHT1_M1) && must_be_zero0 == 0;
14279 }
14280 CONSTEXPR void init()
14281 {
14282 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_IFM2_HEIGHT1_M1);
14283 must_be_zero0 = 0;
14284 }
14285 CONSTEXPR ::cmd0 get_cmd_code() const
14286 {
14287 return static_cast<::cmd0>(cmd_code);
14288 }
14289 CONSTEXPR npu_set_ifm2_height1_m1_t &set_cmd_code(::cmd0 value)
14290 {
14291 cmd_code = static_cast<uint32_t>(value);
14292 return *this;
14293 }
14294 CONSTEXPR uint32_t get_param() const
14295 {
14296 return static_cast<uint32_t>(param);
14297 }
14298 CONSTEXPR npu_set_ifm2_height1_m1_t &set_param(uint32_t value)
14299 {
14300 param = static_cast<uint32_t>(value);
14301 return *this;
14302 }
14303#endif //__cplusplus
14304};
14305
14306// Start of IB0, IB1 buffers for IFM2 in SHRAM. In KB units, multiple of 2.
14307struct npu_set_ifm2_ib_start_t
14308{
14309 uint32_t cmd_code : 10; // NPU_SET_IFM2_IB_START
14310 uint32_t must_be_zero0 : 6; // 0
14311 uint32_t param : 16;
14312#ifdef __cplusplus
14313 CONSTEXPR bool valid() const
14314 {
14315 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_IFM2_IB_START) && must_be_zero0 == 0;
14316 }
14317 CONSTEXPR void init()
14318 {
14319 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_IFM2_IB_START);
14320 must_be_zero0 = 0;
14321 }
14322 CONSTEXPR ::cmd0 get_cmd_code() const
14323 {
14324 return static_cast<::cmd0>(cmd_code);
14325 }
14326 CONSTEXPR npu_set_ifm2_ib_start_t &set_cmd_code(::cmd0 value)
14327 {
14328 cmd_code = static_cast<uint32_t>(value);
14329 return *this;
14330 }
14331 CONSTEXPR uint32_t get_param() const
14332 {
14333 return static_cast<uint32_t>(param);
14334 }
14335 CONSTEXPR npu_set_ifm2_ib_start_t &set_param(uint32_t value)
14336 {
14337 param = static_cast<uint32_t>(value);
14338 return *this;
14339 }
14340#endif //__cplusplus
14341};
14342
14343// Index n for IFM2 access: Region[n] is added to all IFM2 addresses
14344struct npu_set_ifm2_region_t
14345{
14346 uint32_t cmd_code : 10; // NPU_SET_IFM2_REGION
14347 uint32_t must_be_zero0 : 6; // 0
14348 uint32_t param : 16;
14349#ifdef __cplusplus
14350 CONSTEXPR bool valid() const
14351 {
14352 return cmd_code == static_cast<uint32_t>(cmd0::NPU_SET_IFM2_REGION) && must_be_zero0 == 0;
14353 }
14354 CONSTEXPR void init()
14355 {
14356 cmd_code = static_cast<uint32_t>(cmd0::NPU_SET_IFM2_REGION);
14357 must_be_zero0 = 0;
14358 }
14359 CONSTEXPR ::cmd0 get_cmd_code() const
14360 {
14361 return static_cast<::cmd0>(cmd_code);
14362 }
14363 CONSTEXPR npu_set_ifm2_region_t &set_cmd_code(::cmd0 value)
14364 {
14365 cmd_code = static_cast<uint32_t>(value);
14366 return *this;
14367 }
14368 CONSTEXPR uint32_t get_param() const
14369 {
14370 return static_cast<uint32_t>(param);
14371 }
14372 CONSTEXPR npu_set_ifm2_region_t &set_param(uint32_t value)
14373 {
14374 param = static_cast<uint32_t>(value);
14375 return *this;
14376 }
14377#endif //__cplusplus
14378};
14379
14380// Set IFM base address (top left tile)
14381struct npu_set_ifm_base0_t
14382{
14383 uint32_t cmd_code : 10; // NPU_SET_IFM_BASE0
14384 uint32_t must_be_zero : 4; // 0
14385 uint32_t payload_size : 2; // Min:1 Max:2
14386 uint32_t reserved0 : 16;
14387 uint32_t data : 32; // IFM base address (top left tile)
14388#ifdef __cplusplus
14389 CONSTEXPR bool valid() const
14390 {
14391 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_IFM_BASE0) && must_be_zero == 0 && payload_size >= 1 &&
14392 payload_size <= 2;
14393 }
14394 CONSTEXPR void init()
14395 {
14396 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_IFM_BASE0);
14397 must_be_zero = 0;
14398 payload_size = 1;
14399 }
14400 CONSTEXPR ::cmd1 get_cmd_code() const
14401 {
14402 return static_cast<::cmd1>(cmd_code);
14403 }
14404 CONSTEXPR npu_set_ifm_base0_t &set_cmd_code(::cmd1 value)
14405 {
14406 cmd_code = static_cast<uint32_t>(value);
14407 return *this;
14408 }
14409 CONSTEXPR uint32_t get_data() const
14410 {
14411 return static_cast<uint32_t>(data);
14412 }
14413 CONSTEXPR npu_set_ifm_base0_t &set_data(uint32_t value)
14414 {
14415 data = static_cast<uint32_t>(value);
14416 return *this;
14417 }
14418 CONSTEXPR uint32_t get_payload_size() const
14419 {
14420 return static_cast<uint32_t>(payload_size);
14421 }
14422 CONSTEXPR npu_set_ifm_base0_t &set_payload_size(uint32_t value)
14423 {
14424 payload_size = static_cast<uint32_t>(value);
14425 return *this;
14426 }
14427#endif //__cplusplus
14428};
14429
14430// Set IFM base address (top right tile)
14431struct npu_set_ifm_base1_t
14432{
14433 uint32_t cmd_code : 10; // NPU_SET_IFM_BASE1
14434 uint32_t must_be_zero : 4; // 0
14435 uint32_t payload_size : 2; // Min:1 Max:2
14436 uint32_t reserved0 : 16;
14437 uint32_t data : 32; // IFM base address (top right tile)
14438#ifdef __cplusplus
14439 CONSTEXPR bool valid() const
14440 {
14441 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_IFM_BASE1) && must_be_zero == 0 && payload_size >= 1 &&
14442 payload_size <= 2;
14443 }
14444 CONSTEXPR void init()
14445 {
14446 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_IFM_BASE1);
14447 must_be_zero = 0;
14448 payload_size = 1;
14449 }
14450 CONSTEXPR ::cmd1 get_cmd_code() const
14451 {
14452 return static_cast<::cmd1>(cmd_code);
14453 }
14454 CONSTEXPR npu_set_ifm_base1_t &set_cmd_code(::cmd1 value)
14455 {
14456 cmd_code = static_cast<uint32_t>(value);
14457 return *this;
14458 }
14459 CONSTEXPR uint32_t get_data() const
14460 {
14461 return static_cast<uint32_t>(data);
14462 }
14463 CONSTEXPR npu_set_ifm_base1_t &set_data(uint32_t value)
14464 {
14465 data = static_cast<uint32_t>(value);
14466 return *this;
14467 }
14468 CONSTEXPR uint32_t get_payload_size() const
14469 {
14470 return static_cast<uint32_t>(payload_size);
14471 }
14472 CONSTEXPR npu_set_ifm_base1_t &set_payload_size(uint32_t value)
14473 {
14474 payload_size = static_cast<uint32_t>(value);
14475 return *this;
14476 }
14477#endif //__cplusplus
14478};
14479
14480// Set IFM base address (bottom left tile)
14481struct npu_set_ifm_base2_t
14482{
14483 uint32_t cmd_code : 10; // NPU_SET_IFM_BASE2
14484 uint32_t must_be_zero : 4; // 0
14485 uint32_t payload_size : 2; // Min:1 Max:2
14486 uint32_t reserved0 : 16;
14487 uint32_t data : 32; // IFM base address (bottom left tile)
14488#ifdef __cplusplus
14489 CONSTEXPR bool valid() const
14490 {
14491 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_IFM_BASE2) && must_be_zero == 0 && payload_size >= 1 &&
14492 payload_size <= 2;
14493 }
14494 CONSTEXPR void init()
14495 {
14496 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_IFM_BASE2);
14497 must_be_zero = 0;
14498 payload_size = 1;
14499 }
14500 CONSTEXPR ::cmd1 get_cmd_code() const
14501 {
14502 return static_cast<::cmd1>(cmd_code);
14503 }
14504 CONSTEXPR npu_set_ifm_base2_t &set_cmd_code(::cmd1 value)
14505 {
14506 cmd_code = static_cast<uint32_t>(value);
14507 return *this;
14508 }
14509 CONSTEXPR uint32_t get_data() const
14510 {
14511 return static_cast<uint32_t>(data);
14512 }
14513 CONSTEXPR npu_set_ifm_base2_t &set_data(uint32_t value)
14514 {
14515 data = static_cast<uint32_t>(value);
14516 return *this;
14517 }
14518 CONSTEXPR uint32_t get_payload_size() const
14519 {
14520 return static_cast<uint32_t>(payload_size);
14521 }
14522 CONSTEXPR npu_set_ifm_base2_t &set_payload_size(uint32_t value)
14523 {
14524 payload_size = static_cast<uint32_t>(value);
14525 return *this;
14526 }
14527#endif //__cplusplus
14528};
14529
14530// Set IFM base address (bottom right tile)
14531struct npu_set_ifm_base3_t
14532{
14533 uint32_t cmd_code : 10; // NPU_SET_IFM_BASE3
14534 uint32_t must_be_zero : 4; // 0
14535 uint32_t payload_size : 2; // Min:1 Max:2
14536 uint32_t reserved0 : 16;
14537 uint32_t data : 32; // IFM base address (bottom right tile)
14538#ifdef __cplusplus
14539 CONSTEXPR bool valid() const
14540 {
14541 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_IFM_BASE3) && must_be_zero == 0 && payload_size >= 1 &&
14542 payload_size <= 2;
14543 }
14544 CONSTEXPR void init()
14545 {
14546 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_IFM_BASE3);
14547 must_be_zero = 0;
14548 payload_size = 1;
14549 }
14550 CONSTEXPR ::cmd1 get_cmd_code() const
14551 {
14552 return static_cast<::cmd1>(cmd_code);
14553 }
14554 CONSTEXPR npu_set_ifm_base3_t &set_cmd_code(::cmd1 value)
14555 {
14556 cmd_code = static_cast<uint32_t>(value);
14557 return *this;
14558 }
14559 CONSTEXPR uint32_t get_data() const
14560 {
14561 return static_cast<uint32_t>(data);
14562 }
14563 CONSTEXPR npu_set_ifm_base3_t &set_data(uint32_t value)
14564 {
14565 data = static_cast<uint32_t>(value);
14566 return *this;
14567 }
14568 CONSTEXPR uint32_t get_payload_size() const
14569 {
14570 return static_cast<uint32_t>(payload_size);
14571 }
14572 CONSTEXPR npu_set_ifm_base3_t &set_payload_size(uint32_t value)
14573 {
14574 payload_size = static_cast<uint32_t>(value);
14575 return *this;
14576 }
14577#endif //__cplusplus
14578};
14579
14580// Set IFM byte stride between horizontal values
14581struct npu_set_ifm_stride_x_t
14582{
14583 uint32_t cmd_code : 10; // NPU_SET_IFM_STRIDE_X
14584 uint32_t must_be_zero : 4; // 0
14585 uint32_t payload_size : 2; // Min:1 Max:2
14586 uint32_t reserved0 : 16;
14587 uint32_t data : 32; // IFM byte stride between horizontal values
14588#ifdef __cplusplus
14589 CONSTEXPR bool valid() const
14590 {
14591 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_IFM_STRIDE_X) && must_be_zero == 0 &&
14592 payload_size >= 1 && payload_size <= 2;
14593 }
14594 CONSTEXPR void init()
14595 {
14596 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_IFM_STRIDE_X);
14597 must_be_zero = 0;
14598 payload_size = 1;
14599 }
14600 CONSTEXPR ::cmd1 get_cmd_code() const
14601 {
14602 return static_cast<::cmd1>(cmd_code);
14603 }
14604 CONSTEXPR npu_set_ifm_stride_x_t &set_cmd_code(::cmd1 value)
14605 {
14606 cmd_code = static_cast<uint32_t>(value);
14607 return *this;
14608 }
14609 CONSTEXPR uint32_t get_data() const
14610 {
14611 return static_cast<uint32_t>(data);
14612 }
14613 CONSTEXPR npu_set_ifm_stride_x_t &set_data(uint32_t value)
14614 {
14615 data = static_cast<uint32_t>(value);
14616 return *this;
14617 }
14618 CONSTEXPR uint32_t get_payload_size() const
14619 {
14620 return static_cast<uint32_t>(payload_size);
14621 }
14622 CONSTEXPR npu_set_ifm_stride_x_t &set_payload_size(uint32_t value)
14623 {
14624 payload_size = static_cast<uint32_t>(value);
14625 return *this;
14626 }
14627#endif //__cplusplus
14628};
14629
14630// Set IFM byte stride between vertical values
14631struct npu_set_ifm_stride_y_t
14632{
14633 uint32_t cmd_code : 10; // NPU_SET_IFM_STRIDE_Y
14634 uint32_t must_be_zero : 4; // 0
14635 uint32_t payload_size : 2; // Min:1 Max:2
14636 uint32_t reserved0 : 16;
14637 uint32_t data : 32; // IFM byte stride between vertical values
14638#ifdef __cplusplus
14639 CONSTEXPR bool valid() const
14640 {
14641 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_IFM_STRIDE_Y) && must_be_zero == 0 &&
14642 payload_size >= 1 && payload_size <= 2;
14643 }
14644 CONSTEXPR void init()
14645 {
14646 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_IFM_STRIDE_Y);
14647 must_be_zero = 0;
14648 payload_size = 1;
14649 }
14650 CONSTEXPR ::cmd1 get_cmd_code() const
14651 {
14652 return static_cast<::cmd1>(cmd_code);
14653 }
14654 CONSTEXPR npu_set_ifm_stride_y_t &set_cmd_code(::cmd1 value)
14655 {
14656 cmd_code = static_cast<uint32_t>(value);
14657 return *this;
14658 }
14659 CONSTEXPR uint32_t get_data() const
14660 {
14661 return static_cast<uint32_t>(data);
14662 }
14663 CONSTEXPR npu_set_ifm_stride_y_t &set_data(uint32_t value)
14664 {
14665 data = static_cast<uint32_t>(value);
14666 return *this;
14667 }
14668 CONSTEXPR uint32_t get_payload_size() const
14669 {
14670 return static_cast<uint32_t>(payload_size);
14671 }
14672 CONSTEXPR npu_set_ifm_stride_y_t &set_payload_size(uint32_t value)
14673 {
14674 payload_size = static_cast<uint32_t>(value);
14675 return *this;
14676 }
14677#endif //__cplusplus
14678};
14679
14680// Set IFM byte stride between channel blocks (of 16 bytes each block)
14681struct npu_set_ifm_stride_c_t
14682{
14683 uint32_t cmd_code : 10; // NPU_SET_IFM_STRIDE_C
14684 uint32_t must_be_zero : 4; // 0
14685 uint32_t payload_size : 2; // Min:1 Max:2
14686 uint32_t reserved0 : 16;
14687 uint32_t data : 32; // IFM byte stride between channel blocks (of 16 bytes each block)
14688#ifdef __cplusplus
14689 CONSTEXPR bool valid() const
14690 {
14691 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_IFM_STRIDE_C) && must_be_zero == 0 &&
14692 payload_size >= 1 && payload_size <= 2;
14693 }
14694 CONSTEXPR void init()
14695 {
14696 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_IFM_STRIDE_C);
14697 must_be_zero = 0;
14698 payload_size = 1;
14699 }
14700 CONSTEXPR ::cmd1 get_cmd_code() const
14701 {
14702 return static_cast<::cmd1>(cmd_code);
14703 }
14704 CONSTEXPR npu_set_ifm_stride_c_t &set_cmd_code(::cmd1 value)
14705 {
14706 cmd_code = static_cast<uint32_t>(value);
14707 return *this;
14708 }
14709 CONSTEXPR uint32_t get_data() const
14710 {
14711 return static_cast<uint32_t>(data);
14712 }
14713 CONSTEXPR npu_set_ifm_stride_c_t &set_data(uint32_t value)
14714 {
14715 data = static_cast<uint32_t>(value);
14716 return *this;
14717 }
14718 CONSTEXPR uint32_t get_payload_size() const
14719 {
14720 return static_cast<uint32_t>(payload_size);
14721 }
14722 CONSTEXPR npu_set_ifm_stride_c_t &set_payload_size(uint32_t value)
14723 {
14724 payload_size = static_cast<uint32_t>(value);
14725 return *this;
14726 }
14727#endif //__cplusplus
14728};
14729
14730// Set OFM base address (top left tile)
14731struct npu_set_ofm_base0_t
14732{
14733 uint32_t cmd_code : 10; // NPU_SET_OFM_BASE0
14734 uint32_t must_be_zero : 4; // 0
14735 uint32_t payload_size : 2; // Min:1 Max:2
14736 uint32_t reserved0 : 16;
14737 uint32_t data : 32; // OFM base address (top left tile)
14738#ifdef __cplusplus
14739 CONSTEXPR bool valid() const
14740 {
14741 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_OFM_BASE0) && must_be_zero == 0 && payload_size >= 1 &&
14742 payload_size <= 2;
14743 }
14744 CONSTEXPR void init()
14745 {
14746 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_OFM_BASE0);
14747 must_be_zero = 0;
14748 payload_size = 1;
14749 }
14750 CONSTEXPR ::cmd1 get_cmd_code() const
14751 {
14752 return static_cast<::cmd1>(cmd_code);
14753 }
14754 CONSTEXPR npu_set_ofm_base0_t &set_cmd_code(::cmd1 value)
14755 {
14756 cmd_code = static_cast<uint32_t>(value);
14757 return *this;
14758 }
14759 CONSTEXPR uint32_t get_data() const
14760 {
14761 return static_cast<uint32_t>(data);
14762 }
14763 CONSTEXPR npu_set_ofm_base0_t &set_data(uint32_t value)
14764 {
14765 data = static_cast<uint32_t>(value);
14766 return *this;
14767 }
14768 CONSTEXPR uint32_t get_payload_size() const
14769 {
14770 return static_cast<uint32_t>(payload_size);
14771 }
14772 CONSTEXPR npu_set_ofm_base0_t &set_payload_size(uint32_t value)
14773 {
14774 payload_size = static_cast<uint32_t>(value);
14775 return *this;
14776 }
14777#endif //__cplusplus
14778};
14779
14780// Set OFM base address (top right tile)
14781struct npu_set_ofm_base1_t
14782{
14783 uint32_t cmd_code : 10; // NPU_SET_OFM_BASE1
14784 uint32_t must_be_zero : 4; // 0
14785 uint32_t payload_size : 2; // Min:1 Max:2
14786 uint32_t reserved0 : 16;
14787 uint32_t data : 32; // OFM base address (top right tile)
14788#ifdef __cplusplus
14789 CONSTEXPR bool valid() const
14790 {
14791 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_OFM_BASE1) && must_be_zero == 0 && payload_size >= 1 &&
14792 payload_size <= 2;
14793 }
14794 CONSTEXPR void init()
14795 {
14796 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_OFM_BASE1);
14797 must_be_zero = 0;
14798 payload_size = 1;
14799 }
14800 CONSTEXPR ::cmd1 get_cmd_code() const
14801 {
14802 return static_cast<::cmd1>(cmd_code);
14803 }
14804 CONSTEXPR npu_set_ofm_base1_t &set_cmd_code(::cmd1 value)
14805 {
14806 cmd_code = static_cast<uint32_t>(value);
14807 return *this;
14808 }
14809 CONSTEXPR uint32_t get_data() const
14810 {
14811 return static_cast<uint32_t>(data);
14812 }
14813 CONSTEXPR npu_set_ofm_base1_t &set_data(uint32_t value)
14814 {
14815 data = static_cast<uint32_t>(value);
14816 return *this;
14817 }
14818 CONSTEXPR uint32_t get_payload_size() const
14819 {
14820 return static_cast<uint32_t>(payload_size);
14821 }
14822 CONSTEXPR npu_set_ofm_base1_t &set_payload_size(uint32_t value)
14823 {
14824 payload_size = static_cast<uint32_t>(value);
14825 return *this;
14826 }
14827#endif //__cplusplus
14828};
14829
14830// Set OFM base address (bottom left tile)
14831struct npu_set_ofm_base2_t
14832{
14833 uint32_t cmd_code : 10; // NPU_SET_OFM_BASE2
14834 uint32_t must_be_zero : 4; // 0
14835 uint32_t payload_size : 2; // Min:1 Max:2
14836 uint32_t reserved0 : 16;
14837 uint32_t data : 32; // OFM base address (bottom left tile)
14838#ifdef __cplusplus
14839 CONSTEXPR bool valid() const
14840 {
14841 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_OFM_BASE2) && must_be_zero == 0 && payload_size >= 1 &&
14842 payload_size <= 2;
14843 }
14844 CONSTEXPR void init()
14845 {
14846 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_OFM_BASE2);
14847 must_be_zero = 0;
14848 payload_size = 1;
14849 }
14850 CONSTEXPR ::cmd1 get_cmd_code() const
14851 {
14852 return static_cast<::cmd1>(cmd_code);
14853 }
14854 CONSTEXPR npu_set_ofm_base2_t &set_cmd_code(::cmd1 value)
14855 {
14856 cmd_code = static_cast<uint32_t>(value);
14857 return *this;
14858 }
14859 CONSTEXPR uint32_t get_data() const
14860 {
14861 return static_cast<uint32_t>(data);
14862 }
14863 CONSTEXPR npu_set_ofm_base2_t &set_data(uint32_t value)
14864 {
14865 data = static_cast<uint32_t>(value);
14866 return *this;
14867 }
14868 CONSTEXPR uint32_t get_payload_size() const
14869 {
14870 return static_cast<uint32_t>(payload_size);
14871 }
14872 CONSTEXPR npu_set_ofm_base2_t &set_payload_size(uint32_t value)
14873 {
14874 payload_size = static_cast<uint32_t>(value);
14875 return *this;
14876 }
14877#endif //__cplusplus
14878};
14879
14880// Set OFM base address (bottom right tile)
14881struct npu_set_ofm_base3_t
14882{
14883 uint32_t cmd_code : 10; // NPU_SET_OFM_BASE3
14884 uint32_t must_be_zero : 4; // 0
14885 uint32_t payload_size : 2; // Min:1 Max:2
14886 uint32_t reserved0 : 16;
14887 uint32_t data : 32; // OFM base address (bottom right tile)
14888#ifdef __cplusplus
14889 CONSTEXPR bool valid() const
14890 {
14891 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_OFM_BASE3) && must_be_zero == 0 && payload_size >= 1 &&
14892 payload_size <= 2;
14893 }
14894 CONSTEXPR void init()
14895 {
14896 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_OFM_BASE3);
14897 must_be_zero = 0;
14898 payload_size = 1;
14899 }
14900 CONSTEXPR ::cmd1 get_cmd_code() const
14901 {
14902 return static_cast<::cmd1>(cmd_code);
14903 }
14904 CONSTEXPR npu_set_ofm_base3_t &set_cmd_code(::cmd1 value)
14905 {
14906 cmd_code = static_cast<uint32_t>(value);
14907 return *this;
14908 }
14909 CONSTEXPR uint32_t get_data() const
14910 {
14911 return static_cast<uint32_t>(data);
14912 }
14913 CONSTEXPR npu_set_ofm_base3_t &set_data(uint32_t value)
14914 {
14915 data = static_cast<uint32_t>(value);
14916 return *this;
14917 }
14918 CONSTEXPR uint32_t get_payload_size() const
14919 {
14920 return static_cast<uint32_t>(payload_size);
14921 }
14922 CONSTEXPR npu_set_ofm_base3_t &set_payload_size(uint32_t value)
14923 {
14924 payload_size = static_cast<uint32_t>(value);
14925 return *this;
14926 }
14927#endif //__cplusplus
14928};
14929
14930// Set OFM byte stride between horizontal values
14931struct npu_set_ofm_stride_x_t
14932{
14933 uint32_t cmd_code : 10; // NPU_SET_OFM_STRIDE_X
14934 uint32_t must_be_zero : 4; // 0
14935 uint32_t payload_size : 2; // Min:1 Max:2
14936 uint32_t reserved0 : 16;
14937 uint32_t data : 32; // OFM byte stride between horizontal values
14938#ifdef __cplusplus
14939 CONSTEXPR bool valid() const
14940 {
14941 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_OFM_STRIDE_X) && must_be_zero == 0 &&
14942 payload_size >= 1 && payload_size <= 2;
14943 }
14944 CONSTEXPR void init()
14945 {
14946 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_OFM_STRIDE_X);
14947 must_be_zero = 0;
14948 payload_size = 1;
14949 }
14950 CONSTEXPR ::cmd1 get_cmd_code() const
14951 {
14952 return static_cast<::cmd1>(cmd_code);
14953 }
14954 CONSTEXPR npu_set_ofm_stride_x_t &set_cmd_code(::cmd1 value)
14955 {
14956 cmd_code = static_cast<uint32_t>(value);
14957 return *this;
14958 }
14959 CONSTEXPR uint32_t get_data() const
14960 {
14961 return static_cast<uint32_t>(data);
14962 }
14963 CONSTEXPR npu_set_ofm_stride_x_t &set_data(uint32_t value)
14964 {
14965 data = static_cast<uint32_t>(value);
14966 return *this;
14967 }
14968 CONSTEXPR uint32_t get_payload_size() const
14969 {
14970 return static_cast<uint32_t>(payload_size);
14971 }
14972 CONSTEXPR npu_set_ofm_stride_x_t &set_payload_size(uint32_t value)
14973 {
14974 payload_size = static_cast<uint32_t>(value);
14975 return *this;
14976 }
14977#endif //__cplusplus
14978};
14979
14980// Set OFM byte stride between vertical values
14981struct npu_set_ofm_stride_y_t
14982{
14983 uint32_t cmd_code : 10; // NPU_SET_OFM_STRIDE_Y
14984 uint32_t must_be_zero : 4; // 0
14985 uint32_t payload_size : 2; // Min:1 Max:2
14986 uint32_t reserved0 : 16;
14987 uint32_t data : 32; // OFM byte stride between vertical values
14988#ifdef __cplusplus
14989 CONSTEXPR bool valid() const
14990 {
14991 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_OFM_STRIDE_Y) && must_be_zero == 0 &&
14992 payload_size >= 1 && payload_size <= 2;
14993 }
14994 CONSTEXPR void init()
14995 {
14996 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_OFM_STRIDE_Y);
14997 must_be_zero = 0;
14998 payload_size = 1;
14999 }
15000 CONSTEXPR ::cmd1 get_cmd_code() const
15001 {
15002 return static_cast<::cmd1>(cmd_code);
15003 }
15004 CONSTEXPR npu_set_ofm_stride_y_t &set_cmd_code(::cmd1 value)
15005 {
15006 cmd_code = static_cast<uint32_t>(value);
15007 return *this;
15008 }
15009 CONSTEXPR uint32_t get_data() const
15010 {
15011 return static_cast<uint32_t>(data);
15012 }
15013 CONSTEXPR npu_set_ofm_stride_y_t &set_data(uint32_t value)
15014 {
15015 data = static_cast<uint32_t>(value);
15016 return *this;
15017 }
15018 CONSTEXPR uint32_t get_payload_size() const
15019 {
15020 return static_cast<uint32_t>(payload_size);
15021 }
15022 CONSTEXPR npu_set_ofm_stride_y_t &set_payload_size(uint32_t value)
15023 {
15024 payload_size = static_cast<uint32_t>(value);
15025 return *this;
15026 }
15027#endif //__cplusplus
15028};
15029
15030// Set OFM byte stride between channel blocks (of 16 bytes each block)
15031struct npu_set_ofm_stride_c_t
15032{
15033 uint32_t cmd_code : 10; // NPU_SET_OFM_STRIDE_C
15034 uint32_t must_be_zero : 4; // 0
15035 uint32_t payload_size : 2; // Min:1 Max:2
15036 uint32_t reserved0 : 16;
15037 uint32_t data : 32; // OFM byte stride between channel blocks (of 16 bytes each block)
15038#ifdef __cplusplus
15039 CONSTEXPR bool valid() const
15040 {
15041 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_OFM_STRIDE_C) && must_be_zero == 0 &&
15042 payload_size >= 1 && payload_size <= 2;
15043 }
15044 CONSTEXPR void init()
15045 {
15046 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_OFM_STRIDE_C);
15047 must_be_zero = 0;
15048 payload_size = 1;
15049 }
15050 CONSTEXPR ::cmd1 get_cmd_code() const
15051 {
15052 return static_cast<::cmd1>(cmd_code);
15053 }
15054 CONSTEXPR npu_set_ofm_stride_c_t &set_cmd_code(::cmd1 value)
15055 {
15056 cmd_code = static_cast<uint32_t>(value);
15057 return *this;
15058 }
15059 CONSTEXPR uint32_t get_data() const
15060 {
15061 return static_cast<uint32_t>(data);
15062 }
15063 CONSTEXPR npu_set_ofm_stride_c_t &set_data(uint32_t value)
15064 {
15065 data = static_cast<uint32_t>(value);
15066 return *this;
15067 }
15068 CONSTEXPR uint32_t get_payload_size() const
15069 {
15070 return static_cast<uint32_t>(payload_size);
15071 }
15072 CONSTEXPR npu_set_ofm_stride_c_t &set_payload_size(uint32_t value)
15073 {
15074 payload_size = static_cast<uint32_t>(value);
15075 return *this;
15076 }
15077#endif //__cplusplus
15078};
15079
15080// Set Weight stream input base address
15081struct npu_set_weight_base_t
15082{
15083 uint32_t cmd_code : 10; // NPU_SET_WEIGHT_BASE
15084 uint32_t must_be_zero : 4; // 0
15085 uint32_t payload_size : 2; // Min:1 Max:2
15086 uint32_t reserved0 : 16;
15087 uint32_t data : 32; // Weight stream input base address
15088#ifdef __cplusplus
15089 CONSTEXPR bool valid() const
15090 {
15091 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_WEIGHT_BASE) && must_be_zero == 0 && payload_size >= 1 &&
15092 payload_size <= 2;
15093 }
15094 CONSTEXPR void init()
15095 {
15096 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_WEIGHT_BASE);
15097 must_be_zero = 0;
15098 payload_size = 1;
15099 }
15100 CONSTEXPR ::cmd1 get_cmd_code() const
15101 {
15102 return static_cast<::cmd1>(cmd_code);
15103 }
15104 CONSTEXPR npu_set_weight_base_t &set_cmd_code(::cmd1 value)
15105 {
15106 cmd_code = static_cast<uint32_t>(value);
15107 return *this;
15108 }
15109 CONSTEXPR uint32_t get_data() const
15110 {
15111 return static_cast<uint32_t>(data);
15112 }
15113 CONSTEXPR npu_set_weight_base_t &set_data(uint32_t value)
15114 {
15115 data = static_cast<uint32_t>(value);
15116 return *this;
15117 }
15118 CONSTEXPR uint32_t get_payload_size() const
15119 {
15120 return static_cast<uint32_t>(payload_size);
15121 }
15122 CONSTEXPR npu_set_weight_base_t &set_payload_size(uint32_t value)
15123 {
15124 payload_size = static_cast<uint32_t>(value);
15125 return *this;
15126 }
15127#endif //__cplusplus
15128};
15129
15130// Set Weight stream length
15131struct npu_set_weight_length_t
15132{
15133 uint32_t cmd_code : 10; // NPU_SET_WEIGHT_LENGTH
15134 uint32_t must_be_zero : 4; // 0
15135 uint32_t payload_size : 2; // Min:1 Max:2
15136 uint32_t reserved0 : 16;
15137 uint32_t data : 32; // Weight stream length
15138#ifdef __cplusplus
15139 CONSTEXPR bool valid() const
15140 {
15141 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_WEIGHT_LENGTH) && must_be_zero == 0 &&
15142 payload_size >= 1 && payload_size <= 2;
15143 }
15144 CONSTEXPR void init()
15145 {
15146 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_WEIGHT_LENGTH);
15147 must_be_zero = 0;
15148 payload_size = 1;
15149 }
15150 CONSTEXPR ::cmd1 get_cmd_code() const
15151 {
15152 return static_cast<::cmd1>(cmd_code);
15153 }
15154 CONSTEXPR npu_set_weight_length_t &set_cmd_code(::cmd1 value)
15155 {
15156 cmd_code = static_cast<uint32_t>(value);
15157 return *this;
15158 }
15159 CONSTEXPR uint32_t get_data() const
15160 {
15161 return static_cast<uint32_t>(data);
15162 }
15163 CONSTEXPR npu_set_weight_length_t &set_data(uint32_t value)
15164 {
15165 data = static_cast<uint32_t>(value);
15166 return *this;
15167 }
15168 CONSTEXPR uint32_t get_payload_size() const
15169 {
15170 return static_cast<uint32_t>(payload_size);
15171 }
15172 CONSTEXPR npu_set_weight_length_t &set_payload_size(uint32_t value)
15173 {
15174 payload_size = static_cast<uint32_t>(value);
15175 return *this;
15176 }
15177#endif //__cplusplus
15178};
15179
15180// Set Scale and bias stream input base address
15181struct npu_set_scale_base_t
15182{
15183 uint32_t cmd_code : 10; // NPU_SET_SCALE_BASE
15184 uint32_t must_be_zero : 4; // 0
15185 uint32_t payload_size : 2; // Min:1 Max:2
15186 uint32_t reserved0 : 16;
15187 uint32_t data : 32; // Scale and bias stream input base address
15188#ifdef __cplusplus
15189 CONSTEXPR bool valid() const
15190 {
15191 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_SCALE_BASE) && must_be_zero == 0 && payload_size >= 1 &&
15192 payload_size <= 2;
15193 }
15194 CONSTEXPR void init()
15195 {
15196 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_SCALE_BASE);
15197 must_be_zero = 0;
15198 payload_size = 1;
15199 }
15200 CONSTEXPR ::cmd1 get_cmd_code() const
15201 {
15202 return static_cast<::cmd1>(cmd_code);
15203 }
15204 CONSTEXPR npu_set_scale_base_t &set_cmd_code(::cmd1 value)
15205 {
15206 cmd_code = static_cast<uint32_t>(value);
15207 return *this;
15208 }
15209 CONSTEXPR uint32_t get_data() const
15210 {
15211 return static_cast<uint32_t>(data);
15212 }
15213 CONSTEXPR npu_set_scale_base_t &set_data(uint32_t value)
15214 {
15215 data = static_cast<uint32_t>(value);
15216 return *this;
15217 }
15218 CONSTEXPR uint32_t get_payload_size() const
15219 {
15220 return static_cast<uint32_t>(payload_size);
15221 }
15222 CONSTEXPR npu_set_scale_base_t &set_payload_size(uint32_t value)
15223 {
15224 payload_size = static_cast<uint32_t>(value);
15225 return *this;
15226 }
15227#endif //__cplusplus
15228};
15229
15230// Set Scale and bias stream input length
15231struct npu_set_scale_length_t
15232{
15233 uint32_t cmd_code : 10; // NPU_SET_SCALE_LENGTH
15234 uint32_t must_be_zero : 4; // 0
15235 uint32_t payload_size : 2; // Min:1 Max:2
15236 uint32_t reserved0 : 16;
15237 uint32_t data : 32; // Scale and bias stream input length
15238#ifdef __cplusplus
15239 CONSTEXPR bool valid() const
15240 {
15241 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_SCALE_LENGTH) && must_be_zero == 0 &&
15242 payload_size >= 1 && payload_size <= 2;
15243 }
15244 CONSTEXPR void init()
15245 {
15246 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_SCALE_LENGTH);
15247 must_be_zero = 0;
15248 payload_size = 1;
15249 }
15250 CONSTEXPR ::cmd1 get_cmd_code() const
15251 {
15252 return static_cast<::cmd1>(cmd_code);
15253 }
15254 CONSTEXPR npu_set_scale_length_t &set_cmd_code(::cmd1 value)
15255 {
15256 cmd_code = static_cast<uint32_t>(value);
15257 return *this;
15258 }
15259 CONSTEXPR uint32_t get_data() const
15260 {
15261 return static_cast<uint32_t>(data);
15262 }
15263 CONSTEXPR npu_set_scale_length_t &set_data(uint32_t value)
15264 {
15265 data = static_cast<uint32_t>(value);
15266 return *this;
15267 }
15268 CONSTEXPR uint32_t get_payload_size() const
15269 {
15270 return static_cast<uint32_t>(payload_size);
15271 }
15272 CONSTEXPR npu_set_scale_length_t &set_payload_size(uint32_t value)
15273 {
15274 payload_size = static_cast<uint32_t>(value);
15275 return *this;
15276 }
15277#endif //__cplusplus
15278};
15279
15280// Set scale (32-bit). Used by average pool with pad=0, elementwise MUL, ADD, SUB
15281struct npu_set_ofm_scale_t
15282{
15283 uint32_t cmd_code : 10; // NPU_SET_OFM_SCALE
15284 uint32_t must_be_zero : 4; // 0
15285 uint32_t payload_size : 2; // Min:1 Max:2
15286 uint32_t shift : 16;
15287 uint32_t data : 32; // scale (32-bit). Used by average pool with pad=0, elementwise MUL, ADD, SUB
15288#ifdef __cplusplus
15289 CONSTEXPR bool valid() const
15290 {
15291 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_OFM_SCALE) && must_be_zero == 0 && payload_size >= 1 &&
15292 payload_size <= 2;
15293 }
15294 CONSTEXPR void init()
15295 {
15296 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_OFM_SCALE);
15297 must_be_zero = 0;
15298 payload_size = 1;
15299 }
15300 CONSTEXPR ::cmd1 get_cmd_code() const
15301 {
15302 return static_cast<::cmd1>(cmd_code);
15303 }
15304 CONSTEXPR npu_set_ofm_scale_t &set_cmd_code(::cmd1 value)
15305 {
15306 cmd_code = static_cast<uint32_t>(value);
15307 return *this;
15308 }
15309 CONSTEXPR uint32_t get_data() const
15310 {
15311 return static_cast<uint32_t>(data);
15312 }
15313 CONSTEXPR npu_set_ofm_scale_t &set_data(uint32_t value)
15314 {
15315 data = static_cast<uint32_t>(value);
15316 return *this;
15317 }
15318 CONSTEXPR uint32_t get_payload_size() const
15319 {
15320 return static_cast<uint32_t>(payload_size);
15321 }
15322 CONSTEXPR npu_set_ofm_scale_t &set_payload_size(uint32_t value)
15323 {
15324 payload_size = static_cast<uint32_t>(value);
15325 return *this;
15326 }
15327 CONSTEXPR uint32_t get_shift() const
15328 {
15329 return static_cast<uint32_t>(shift);
15330 }
15331 CONSTEXPR npu_set_ofm_scale_t &set_shift(uint32_t value)
15332 {
15333 shift = static_cast<uint32_t>(value);
15334 return *this;
15335 }
15336#endif //__cplusplus
15337};
15338
15339// Set scale (32-bit) used for elementwise ADD/SUB OPA prescale. If IFM scale mode is 0 then shift is ignored and scale
15340// is 16-bit. If IFM scale mode is 1 or 2 then shift is 6-bit and scale is 32-bit
15341struct npu_set_opa_scale_t
15342{
15343 uint32_t cmd_code : 10; // NPU_SET_OPA_SCALE
15344 uint32_t must_be_zero : 4; // 0
15345 uint32_t payload_size : 2; // Min:1 Max:2
15346 uint32_t shift : 16;
15347 uint32_t
15348 data : 32; // scale (32-bit) used for elementwise ADD/SUB OPA prescale. If IFM scale mode is 0 then shift is
15349 // ignored and scale is 16-bit. If IFM scale mode is 1 or 2 then shift is 6-bit and scale is 32-bit
15350#ifdef __cplusplus
15351 CONSTEXPR bool valid() const
15352 {
15353 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_OPA_SCALE) && must_be_zero == 0 && payload_size >= 1 &&
15354 payload_size <= 2;
15355 }
15356 CONSTEXPR void init()
15357 {
15358 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_OPA_SCALE);
15359 must_be_zero = 0;
15360 payload_size = 1;
15361 }
15362 CONSTEXPR ::cmd1 get_cmd_code() const
15363 {
15364 return static_cast<::cmd1>(cmd_code);
15365 }
15366 CONSTEXPR npu_set_opa_scale_t &set_cmd_code(::cmd1 value)
15367 {
15368 cmd_code = static_cast<uint32_t>(value);
15369 return *this;
15370 }
15371 CONSTEXPR uint32_t get_data() const
15372 {
15373 return static_cast<uint32_t>(data);
15374 }
15375 CONSTEXPR npu_set_opa_scale_t &set_data(uint32_t value)
15376 {
15377 data = static_cast<uint32_t>(value);
15378 return *this;
15379 }
15380 CONSTEXPR uint32_t get_payload_size() const
15381 {
15382 return static_cast<uint32_t>(payload_size);
15383 }
15384 CONSTEXPR npu_set_opa_scale_t &set_payload_size(uint32_t value)
15385 {
15386 payload_size = static_cast<uint32_t>(value);
15387 return *this;
15388 }
15389 CONSTEXPR uint32_t get_shift() const
15390 {
15391 return static_cast<uint32_t>(shift);
15392 }
15393 CONSTEXPR npu_set_opa_scale_t &set_shift(uint32_t value)
15394 {
15395 shift = static_cast<uint32_t>(value);
15396 return *this;
15397 }
15398#endif //__cplusplus
15399};
15400
15401// Set scale (16-bit) used for elementwise ADD/SUB OPB prescale. If IFM scale mode is 0 then scale is 16-bit. If IFM
15402// scale mode is 1 or 2 then this register is not used
15403struct npu_set_opb_scale_t
15404{
15405 uint32_t cmd_code : 10; // NPU_SET_OPB_SCALE
15406 uint32_t must_be_zero : 4; // 0
15407 uint32_t payload_size : 2; // Min:1 Max:2
15408 uint32_t reserved0 : 16;
15409 uint32_t data : 32; // scale (16-bit) used for elementwise ADD/SUB OPB prescale. If IFM scale mode is 0 then scale
15410 // is 16-bit. If IFM scale mode is 1 or 2 then this register is not used
15411#ifdef __cplusplus
15412 CONSTEXPR bool valid() const
15413 {
15414 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_OPB_SCALE) && must_be_zero == 0 && payload_size >= 1 &&
15415 payload_size <= 2;
15416 }
15417 CONSTEXPR void init()
15418 {
15419 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_OPB_SCALE);
15420 must_be_zero = 0;
15421 payload_size = 1;
15422 }
15423 CONSTEXPR ::cmd1 get_cmd_code() const
15424 {
15425 return static_cast<::cmd1>(cmd_code);
15426 }
15427 CONSTEXPR npu_set_opb_scale_t &set_cmd_code(::cmd1 value)
15428 {
15429 cmd_code = static_cast<uint32_t>(value);
15430 return *this;
15431 }
15432 CONSTEXPR uint32_t get_data() const
15433 {
15434 return static_cast<uint32_t>(data);
15435 }
15436 CONSTEXPR npu_set_opb_scale_t &set_data(uint32_t value)
15437 {
15438 data = static_cast<uint32_t>(value);
15439 return *this;
15440 }
15441 CONSTEXPR uint32_t get_payload_size() const
15442 {
15443 return static_cast<uint32_t>(payload_size);
15444 }
15445 CONSTEXPR npu_set_opb_scale_t &set_payload_size(uint32_t value)
15446 {
15447 payload_size = static_cast<uint32_t>(value);
15448 return *this;
15449 }
15450#endif //__cplusplus
15451};
15452
15453// Set DMA source address
15454struct npu_set_dma0_src_t
15455{
15456 uint32_t cmd_code : 10; // NPU_SET_DMA0_SRC
15457 uint32_t must_be_zero : 4; // 0
15458 uint32_t payload_size : 2; // Min:1 Max:2
15459 uint32_t reserved0 : 16;
15460 uint32_t data : 32;
15461#ifdef __cplusplus
15462 CONSTEXPR bool valid() const
15463 {
15464 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_DMA0_SRC) && must_be_zero == 0 && payload_size >= 1 &&
15465 payload_size <= 2;
15466 }
15467 CONSTEXPR void init()
15468 {
15469 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_DMA0_SRC);
15470 must_be_zero = 0;
15471 payload_size = 1;
15472 }
15473 CONSTEXPR ::cmd1 get_cmd_code() const
15474 {
15475 return static_cast<::cmd1>(cmd_code);
15476 }
15477 CONSTEXPR npu_set_dma0_src_t &set_cmd_code(::cmd1 value)
15478 {
15479 cmd_code = static_cast<uint32_t>(value);
15480 return *this;
15481 }
15482 CONSTEXPR uint32_t get_data() const
15483 {
15484 return static_cast<uint32_t>(data);
15485 }
15486 CONSTEXPR npu_set_dma0_src_t &set_data(uint32_t value)
15487 {
15488 data = static_cast<uint32_t>(value);
15489 return *this;
15490 }
15491 CONSTEXPR uint32_t get_payload_size() const
15492 {
15493 return static_cast<uint32_t>(payload_size);
15494 }
15495 CONSTEXPR npu_set_dma0_src_t &set_payload_size(uint32_t value)
15496 {
15497 payload_size = static_cast<uint32_t>(value);
15498 return *this;
15499 }
15500#endif //__cplusplus
15501};
15502
15503// Set DMA destination address
15504struct npu_set_dma0_dst_t
15505{
15506 uint32_t cmd_code : 10; // NPU_SET_DMA0_DST
15507 uint32_t must_be_zero : 4; // 0
15508 uint32_t payload_size : 2; // Min:1 Max:2
15509 uint32_t reserved0 : 16;
15510 uint32_t data : 32;
15511#ifdef __cplusplus
15512 CONSTEXPR bool valid() const
15513 {
15514 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_DMA0_DST) && must_be_zero == 0 && payload_size >= 1 &&
15515 payload_size <= 2;
15516 }
15517 CONSTEXPR void init()
15518 {
15519 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_DMA0_DST);
15520 must_be_zero = 0;
15521 payload_size = 1;
15522 }
15523 CONSTEXPR ::cmd1 get_cmd_code() const
15524 {
15525 return static_cast<::cmd1>(cmd_code);
15526 }
15527 CONSTEXPR npu_set_dma0_dst_t &set_cmd_code(::cmd1 value)
15528 {
15529 cmd_code = static_cast<uint32_t>(value);
15530 return *this;
15531 }
15532 CONSTEXPR uint32_t get_data() const
15533 {
15534 return static_cast<uint32_t>(data);
15535 }
15536 CONSTEXPR npu_set_dma0_dst_t &set_data(uint32_t value)
15537 {
15538 data = static_cast<uint32_t>(value);
15539 return *this;
15540 }
15541 CONSTEXPR uint32_t get_payload_size() const
15542 {
15543 return static_cast<uint32_t>(payload_size);
15544 }
15545 CONSTEXPR npu_set_dma0_dst_t &set_payload_size(uint32_t value)
15546 {
15547 payload_size = static_cast<uint32_t>(value);
15548 return *this;
15549 }
15550#endif //__cplusplus
15551};
15552
15553// Set DMA length
15554struct npu_set_dma0_len_t
15555{
15556 uint32_t cmd_code : 10; // NPU_SET_DMA0_LEN
15557 uint32_t must_be_zero : 4; // 0
15558 uint32_t payload_size : 2; // Min:1 Max:2
15559 uint32_t reserved0 : 16;
15560 uint32_t data : 32; // DMA length
15561#ifdef __cplusplus
15562 CONSTEXPR bool valid() const
15563 {
15564 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_DMA0_LEN) && must_be_zero == 0 && payload_size >= 1 &&
15565 payload_size <= 2;
15566 }
15567 CONSTEXPR void init()
15568 {
15569 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_DMA0_LEN);
15570 must_be_zero = 0;
15571 payload_size = 1;
15572 }
15573 CONSTEXPR ::cmd1 get_cmd_code() const
15574 {
15575 return static_cast<::cmd1>(cmd_code);
15576 }
15577 CONSTEXPR npu_set_dma0_len_t &set_cmd_code(::cmd1 value)
15578 {
15579 cmd_code = static_cast<uint32_t>(value);
15580 return *this;
15581 }
15582 CONSTEXPR uint32_t get_data() const
15583 {
15584 return static_cast<uint32_t>(data);
15585 }
15586 CONSTEXPR npu_set_dma0_len_t &set_data(uint32_t value)
15587 {
15588 data = static_cast<uint32_t>(value);
15589 return *this;
15590 }
15591 CONSTEXPR uint32_t get_payload_size() const
15592 {
15593 return static_cast<uint32_t>(payload_size);
15594 }
15595 CONSTEXPR npu_set_dma0_len_t &set_payload_size(uint32_t value)
15596 {
15597 payload_size = static_cast<uint32_t>(value);
15598 return *this;
15599 }
15600#endif //__cplusplus
15601};
15602
15603// Set Byte distance to skip after inner size (2D/3D mode)
15604struct npu_set_dma0_skip0_t
15605{
15606 uint32_t cmd_code : 10; // NPU_SET_DMA0_SKIP0
15607 uint32_t must_be_zero : 4; // 0
15608 uint32_t payload_size : 2; // Min:1 Max:2
15609 uint32_t param : 16;
15610 uint32_t data : 32; // Byte distance to skip after inner size (2D/3D mode)
15611#ifdef __cplusplus
15612 CONSTEXPR bool valid() const
15613 {
15614 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_DMA0_SKIP0) && must_be_zero == 0 && payload_size >= 1 &&
15615 payload_size <= 2;
15616 }
15617 CONSTEXPR void init()
15618 {
15619 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_DMA0_SKIP0);
15620 must_be_zero = 0;
15621 payload_size = 1;
15622 }
15623 CONSTEXPR ::cmd1 get_cmd_code() const
15624 {
15625 return static_cast<::cmd1>(cmd_code);
15626 }
15627 CONSTEXPR npu_set_dma0_skip0_t &set_cmd_code(::cmd1 value)
15628 {
15629 cmd_code = static_cast<uint32_t>(value);
15630 return *this;
15631 }
15632 CONSTEXPR uint32_t get_data() const
15633 {
15634 return static_cast<uint32_t>(data);
15635 }
15636 CONSTEXPR npu_set_dma0_skip0_t &set_data(uint32_t value)
15637 {
15638 data = static_cast<uint32_t>(value);
15639 return *this;
15640 }
15641 CONSTEXPR uint32_t get_param() const
15642 {
15643 return static_cast<uint32_t>(param);
15644 }
15645 CONSTEXPR npu_set_dma0_skip0_t &set_param(uint32_t value)
15646 {
15647 param = static_cast<uint32_t>(value);
15648 return *this;
15649 }
15650 CONSTEXPR uint32_t get_payload_size() const
15651 {
15652 return static_cast<uint32_t>(payload_size);
15653 }
15654 CONSTEXPR npu_set_dma0_skip0_t &set_payload_size(uint32_t value)
15655 {
15656 payload_size = static_cast<uint32_t>(value);
15657 return *this;
15658 }
15659#endif //__cplusplus
15660};
15661
15662// Set Byte distance to skip after outer size (3D mode)
15663struct npu_set_dma0_skip1_t
15664{
15665 uint32_t cmd_code : 10; // NPU_SET_DMA0_SKIP1
15666 uint32_t must_be_zero : 4; // 0
15667 uint32_t payload_size : 2; // Min:1 Max:2
15668 uint32_t param : 16;
15669 uint32_t data : 32; // Byte distance to skip after outer size (3D mode)
15670#ifdef __cplusplus
15671 CONSTEXPR bool valid() const
15672 {
15673 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_DMA0_SKIP1) && must_be_zero == 0 && payload_size >= 1 &&
15674 payload_size <= 2;
15675 }
15676 CONSTEXPR void init()
15677 {
15678 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_DMA0_SKIP1);
15679 must_be_zero = 0;
15680 payload_size = 1;
15681 }
15682 CONSTEXPR ::cmd1 get_cmd_code() const
15683 {
15684 return static_cast<::cmd1>(cmd_code);
15685 }
15686 CONSTEXPR npu_set_dma0_skip1_t &set_cmd_code(::cmd1 value)
15687 {
15688 cmd_code = static_cast<uint32_t>(value);
15689 return *this;
15690 }
15691 CONSTEXPR uint32_t get_data() const
15692 {
15693 return static_cast<uint32_t>(data);
15694 }
15695 CONSTEXPR npu_set_dma0_skip1_t &set_data(uint32_t value)
15696 {
15697 data = static_cast<uint32_t>(value);
15698 return *this;
15699 }
15700 CONSTEXPR uint32_t get_param() const
15701 {
15702 return static_cast<uint32_t>(param);
15703 }
15704 CONSTEXPR npu_set_dma0_skip1_t &set_param(uint32_t value)
15705 {
15706 param = static_cast<uint32_t>(value);
15707 return *this;
15708 }
15709 CONSTEXPR uint32_t get_payload_size() const
15710 {
15711 return static_cast<uint32_t>(payload_size);
15712 }
15713 CONSTEXPR npu_set_dma0_skip1_t &set_payload_size(uint32_t value)
15714 {
15715 payload_size = static_cast<uint32_t>(value);
15716 return *this;
15717 }
15718#endif //__cplusplus
15719};
15720
15721// Set IFM2 tile0 offset (top left tile) from IFM_REGION start
15722struct npu_set_ifm2_base0_t
15723{
15724 uint32_t cmd_code : 10; // NPU_SET_IFM2_BASE0
15725 uint32_t must_be_zero : 4; // 0
15726 uint32_t payload_size : 2; // Min:1 Max:2
15727 uint32_t reserved0 : 16;
15728 uint32_t data : 32; // IFM2 tile0 offset (top left tile) from IFM_REGION start
15729#ifdef __cplusplus
15730 CONSTEXPR bool valid() const
15731 {
15732 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_IFM2_BASE0) && must_be_zero == 0 && payload_size >= 1 &&
15733 payload_size <= 2;
15734 }
15735 CONSTEXPR void init()
15736 {
15737 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_IFM2_BASE0);
15738 must_be_zero = 0;
15739 payload_size = 1;
15740 }
15741 CONSTEXPR ::cmd1 get_cmd_code() const
15742 {
15743 return static_cast<::cmd1>(cmd_code);
15744 }
15745 CONSTEXPR npu_set_ifm2_base0_t &set_cmd_code(::cmd1 value)
15746 {
15747 cmd_code = static_cast<uint32_t>(value);
15748 return *this;
15749 }
15750 CONSTEXPR uint32_t get_data() const
15751 {
15752 return static_cast<uint32_t>(data);
15753 }
15754 CONSTEXPR npu_set_ifm2_base0_t &set_data(uint32_t value)
15755 {
15756 data = static_cast<uint32_t>(value);
15757 return *this;
15758 }
15759 CONSTEXPR uint32_t get_payload_size() const
15760 {
15761 return static_cast<uint32_t>(payload_size);
15762 }
15763 CONSTEXPR npu_set_ifm2_base0_t &set_payload_size(uint32_t value)
15764 {
15765 payload_size = static_cast<uint32_t>(value);
15766 return *this;
15767 }
15768#endif //__cplusplus
15769};
15770
15771// Set IFM2 tile1 offset (top right tile) from IFM_REGION start
15772struct npu_set_ifm2_base1_t
15773{
15774 uint32_t cmd_code : 10; // NPU_SET_IFM2_BASE1
15775 uint32_t must_be_zero : 4; // 0
15776 uint32_t payload_size : 2; // Min:1 Max:2
15777 uint32_t reserved0 : 16;
15778 uint32_t data : 32; // IFM2 tile1 offset (top right tile) from IFM_REGION start
15779#ifdef __cplusplus
15780 CONSTEXPR bool valid() const
15781 {
15782 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_IFM2_BASE1) && must_be_zero == 0 && payload_size >= 1 &&
15783 payload_size <= 2;
15784 }
15785 CONSTEXPR void init()
15786 {
15787 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_IFM2_BASE1);
15788 must_be_zero = 0;
15789 payload_size = 1;
15790 }
15791 CONSTEXPR ::cmd1 get_cmd_code() const
15792 {
15793 return static_cast<::cmd1>(cmd_code);
15794 }
15795 CONSTEXPR npu_set_ifm2_base1_t &set_cmd_code(::cmd1 value)
15796 {
15797 cmd_code = static_cast<uint32_t>(value);
15798 return *this;
15799 }
15800 CONSTEXPR uint32_t get_data() const
15801 {
15802 return static_cast<uint32_t>(data);
15803 }
15804 CONSTEXPR npu_set_ifm2_base1_t &set_data(uint32_t value)
15805 {
15806 data = static_cast<uint32_t>(value);
15807 return *this;
15808 }
15809 CONSTEXPR uint32_t get_payload_size() const
15810 {
15811 return static_cast<uint32_t>(payload_size);
15812 }
15813 CONSTEXPR npu_set_ifm2_base1_t &set_payload_size(uint32_t value)
15814 {
15815 payload_size = static_cast<uint32_t>(value);
15816 return *this;
15817 }
15818#endif //__cplusplus
15819};
15820
15821// Set IFM2 tile2 offset (bottom left tile) from IFM_REGION start
15822struct npu_set_ifm2_base2_t
15823{
15824 uint32_t cmd_code : 10; // NPU_SET_IFM2_BASE2
15825 uint32_t must_be_zero : 4; // 0
15826 uint32_t payload_size : 2; // Min:1 Max:2
15827 uint32_t reserved0 : 16;
15828 uint32_t data : 32; // IFM2 tile2 offset (bottom left tile) from IFM_REGION start
15829#ifdef __cplusplus
15830 CONSTEXPR bool valid() const
15831 {
15832 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_IFM2_BASE2) && must_be_zero == 0 && payload_size >= 1 &&
15833 payload_size <= 2;
15834 }
15835 CONSTEXPR void init()
15836 {
15837 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_IFM2_BASE2);
15838 must_be_zero = 0;
15839 payload_size = 1;
15840 }
15841 CONSTEXPR ::cmd1 get_cmd_code() const
15842 {
15843 return static_cast<::cmd1>(cmd_code);
15844 }
15845 CONSTEXPR npu_set_ifm2_base2_t &set_cmd_code(::cmd1 value)
15846 {
15847 cmd_code = static_cast<uint32_t>(value);
15848 return *this;
15849 }
15850 CONSTEXPR uint32_t get_data() const
15851 {
15852 return static_cast<uint32_t>(data);
15853 }
15854 CONSTEXPR npu_set_ifm2_base2_t &set_data(uint32_t value)
15855 {
15856 data = static_cast<uint32_t>(value);
15857 return *this;
15858 }
15859 CONSTEXPR uint32_t get_payload_size() const
15860 {
15861 return static_cast<uint32_t>(payload_size);
15862 }
15863 CONSTEXPR npu_set_ifm2_base2_t &set_payload_size(uint32_t value)
15864 {
15865 payload_size = static_cast<uint32_t>(value);
15866 return *this;
15867 }
15868#endif //__cplusplus
15869};
15870
15871// Set IFM2 tile3 offset (bottom right tile) from IFM_REGION start
15872struct npu_set_ifm2_base3_t
15873{
15874 uint32_t cmd_code : 10; // NPU_SET_IFM2_BASE3
15875 uint32_t must_be_zero : 4; // 0
15876 uint32_t payload_size : 2; // Min:1 Max:2
15877 uint32_t reserved0 : 16;
15878 uint32_t data : 32; // IFM2 tile3 offset (bottom right tile) from IFM_REGION start
15879#ifdef __cplusplus
15880 CONSTEXPR bool valid() const
15881 {
15882 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_IFM2_BASE3) && must_be_zero == 0 && payload_size >= 1 &&
15883 payload_size <= 2;
15884 }
15885 CONSTEXPR void init()
15886 {
15887 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_IFM2_BASE3);
15888 must_be_zero = 0;
15889 payload_size = 1;
15890 }
15891 CONSTEXPR ::cmd1 get_cmd_code() const
15892 {
15893 return static_cast<::cmd1>(cmd_code);
15894 }
15895 CONSTEXPR npu_set_ifm2_base3_t &set_cmd_code(::cmd1 value)
15896 {
15897 cmd_code = static_cast<uint32_t>(value);
15898 return *this;
15899 }
15900 CONSTEXPR uint32_t get_data() const
15901 {
15902 return static_cast<uint32_t>(data);
15903 }
15904 CONSTEXPR npu_set_ifm2_base3_t &set_data(uint32_t value)
15905 {
15906 data = static_cast<uint32_t>(value);
15907 return *this;
15908 }
15909 CONSTEXPR uint32_t get_payload_size() const
15910 {
15911 return static_cast<uint32_t>(payload_size);
15912 }
15913 CONSTEXPR npu_set_ifm2_base3_t &set_payload_size(uint32_t value)
15914 {
15915 payload_size = static_cast<uint32_t>(value);
15916 return *this;
15917 }
15918#endif //__cplusplus
15919};
15920
15921// Set IFM2 byte stride between horizontal values
15922struct npu_set_ifm2_stride_x_t
15923{
15924 uint32_t cmd_code : 10; // NPU_SET_IFM2_STRIDE_X
15925 uint32_t must_be_zero : 4; // 0
15926 uint32_t payload_size : 2; // Min:1 Max:2
15927 uint32_t reserved0 : 16;
15928 uint32_t data : 32; // IFM2 byte stride between horizontal values
15929#ifdef __cplusplus
15930 CONSTEXPR bool valid() const
15931 {
15932 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_IFM2_STRIDE_X) && must_be_zero == 0 &&
15933 payload_size >= 1 && payload_size <= 2;
15934 }
15935 CONSTEXPR void init()
15936 {
15937 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_IFM2_STRIDE_X);
15938 must_be_zero = 0;
15939 payload_size = 1;
15940 }
15941 CONSTEXPR ::cmd1 get_cmd_code() const
15942 {
15943 return static_cast<::cmd1>(cmd_code);
15944 }
15945 CONSTEXPR npu_set_ifm2_stride_x_t &set_cmd_code(::cmd1 value)
15946 {
15947 cmd_code = static_cast<uint32_t>(value);
15948 return *this;
15949 }
15950 CONSTEXPR uint32_t get_data() const
15951 {
15952 return static_cast<uint32_t>(data);
15953 }
15954 CONSTEXPR npu_set_ifm2_stride_x_t &set_data(uint32_t value)
15955 {
15956 data = static_cast<uint32_t>(value);
15957 return *this;
15958 }
15959 CONSTEXPR uint32_t get_payload_size() const
15960 {
15961 return static_cast<uint32_t>(payload_size);
15962 }
15963 CONSTEXPR npu_set_ifm2_stride_x_t &set_payload_size(uint32_t value)
15964 {
15965 payload_size = static_cast<uint32_t>(value);
15966 return *this;
15967 }
15968#endif //__cplusplus
15969};
15970
15971// Set IFM2 byte stride between vertical values
15972struct npu_set_ifm2_stride_y_t
15973{
15974 uint32_t cmd_code : 10; // NPU_SET_IFM2_STRIDE_Y
15975 uint32_t must_be_zero : 4; // 0
15976 uint32_t payload_size : 2; // Min:1 Max:2
15977 uint32_t reserved0 : 16;
15978 uint32_t data : 32; // IFM2 byte stride between vertical values
15979#ifdef __cplusplus
15980 CONSTEXPR bool valid() const
15981 {
15982 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_IFM2_STRIDE_Y) && must_be_zero == 0 &&
15983 payload_size >= 1 && payload_size <= 2;
15984 }
15985 CONSTEXPR void init()
15986 {
15987 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_IFM2_STRIDE_Y);
15988 must_be_zero = 0;
15989 payload_size = 1;
15990 }
15991 CONSTEXPR ::cmd1 get_cmd_code() const
15992 {
15993 return static_cast<::cmd1>(cmd_code);
15994 }
15995 CONSTEXPR npu_set_ifm2_stride_y_t &set_cmd_code(::cmd1 value)
15996 {
15997 cmd_code = static_cast<uint32_t>(value);
15998 return *this;
15999 }
16000 CONSTEXPR uint32_t get_data() const
16001 {
16002 return static_cast<uint32_t>(data);
16003 }
16004 CONSTEXPR npu_set_ifm2_stride_y_t &set_data(uint32_t value)
16005 {
16006 data = static_cast<uint32_t>(value);
16007 return *this;
16008 }
16009 CONSTEXPR uint32_t get_payload_size() const
16010 {
16011 return static_cast<uint32_t>(payload_size);
16012 }
16013 CONSTEXPR npu_set_ifm2_stride_y_t &set_payload_size(uint32_t value)
16014 {
16015 payload_size = static_cast<uint32_t>(value);
16016 return *this;
16017 }
16018#endif //__cplusplus
16019};
16020
16021// Set IFM2 byte stride between channel blocks (of 16 bytes each block)
16022struct npu_set_ifm2_stride_c_t
16023{
16024 uint32_t cmd_code : 10; // NPU_SET_IFM2_STRIDE_C
16025 uint32_t must_be_zero : 4; // 0
16026 uint32_t payload_size : 2; // Min:1 Max:2
16027 uint32_t reserved0 : 16;
16028 uint32_t data : 32; // IFM2 byte stride between channel blocks (of 16 bytes each block)
16029#ifdef __cplusplus
16030 CONSTEXPR bool valid() const
16031 {
16032 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_IFM2_STRIDE_C) && must_be_zero == 0 &&
16033 payload_size >= 1 && payload_size <= 2;
16034 }
16035 CONSTEXPR void init()
16036 {
16037 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_IFM2_STRIDE_C);
16038 must_be_zero = 0;
16039 payload_size = 1;
16040 }
16041 CONSTEXPR ::cmd1 get_cmd_code() const
16042 {
16043 return static_cast<::cmd1>(cmd_code);
16044 }
16045 CONSTEXPR npu_set_ifm2_stride_c_t &set_cmd_code(::cmd1 value)
16046 {
16047 cmd_code = static_cast<uint32_t>(value);
16048 return *this;
16049 }
16050 CONSTEXPR uint32_t get_data() const
16051 {
16052 return static_cast<uint32_t>(data);
16053 }
16054 CONSTEXPR npu_set_ifm2_stride_c_t &set_data(uint32_t value)
16055 {
16056 data = static_cast<uint32_t>(value);
16057 return *this;
16058 }
16059 CONSTEXPR uint32_t get_payload_size() const
16060 {
16061 return static_cast<uint32_t>(payload_size);
16062 }
16063 CONSTEXPR npu_set_ifm2_stride_c_t &set_payload_size(uint32_t value)
16064 {
16065 payload_size = static_cast<uint32_t>(value);
16066 return *this;
16067 }
16068#endif //__cplusplus
16069};
16070
16071// Set Weight stream byte offset in WEIGHT_REGION
16072struct npu_set_weight1_base_t
16073{
16074 uint32_t cmd_code : 10; // NPU_SET_WEIGHT1_BASE
16075 uint32_t must_be_zero : 4; // 0
16076 uint32_t payload_size : 2; // Min:1 Max:2
16077 uint32_t param : 16;
16078 uint32_t data : 32; // Weight stream byte offset in WEIGHT_REGION
16079#ifdef __cplusplus
16080 CONSTEXPR bool valid() const
16081 {
16082 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_WEIGHT1_BASE) && must_be_zero == 0 &&
16083 payload_size >= 1 && payload_size <= 2;
16084 }
16085 CONSTEXPR void init()
16086 {
16087 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_WEIGHT1_BASE);
16088 must_be_zero = 0;
16089 payload_size = 1;
16090 }
16091 CONSTEXPR ::cmd1 get_cmd_code() const
16092 {
16093 return static_cast<::cmd1>(cmd_code);
16094 }
16095 CONSTEXPR npu_set_weight1_base_t &set_cmd_code(::cmd1 value)
16096 {
16097 cmd_code = static_cast<uint32_t>(value);
16098 return *this;
16099 }
16100 CONSTEXPR uint32_t get_data() const
16101 {
16102 return static_cast<uint32_t>(data);
16103 }
16104 CONSTEXPR npu_set_weight1_base_t &set_data(uint32_t value)
16105 {
16106 data = static_cast<uint32_t>(value);
16107 return *this;
16108 }
16109 CONSTEXPR uint32_t get_param() const
16110 {
16111 return static_cast<uint32_t>(param);
16112 }
16113 CONSTEXPR npu_set_weight1_base_t &set_param(uint32_t value)
16114 {
16115 param = static_cast<uint32_t>(value);
16116 return *this;
16117 }
16118 CONSTEXPR uint32_t get_payload_size() const
16119 {
16120 return static_cast<uint32_t>(payload_size);
16121 }
16122 CONSTEXPR npu_set_weight1_base_t &set_payload_size(uint32_t value)
16123 {
16124 payload_size = static_cast<uint32_t>(value);
16125 return *this;
16126 }
16127#endif //__cplusplus
16128};
16129
16130// Set Weight stream byte length (unsigned 32 bits)
16131struct npu_set_weight1_length_t
16132{
16133 uint32_t cmd_code : 10; // NPU_SET_WEIGHT1_LENGTH
16134 uint32_t must_be_zero : 4; // 0
16135 uint32_t payload_size : 2; // Min:1 Max:2
16136 uint32_t reserved0 : 16;
16137 uint32_t data : 32; // Weight stream byte length (unsigned 32 bits)
16138#ifdef __cplusplus
16139 CONSTEXPR bool valid() const
16140 {
16141 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_WEIGHT1_LENGTH) && must_be_zero == 0 &&
16142 payload_size >= 1 && payload_size <= 2;
16143 }
16144 CONSTEXPR void init()
16145 {
16146 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_WEIGHT1_LENGTH);
16147 must_be_zero = 0;
16148 payload_size = 1;
16149 }
16150 CONSTEXPR ::cmd1 get_cmd_code() const
16151 {
16152 return static_cast<::cmd1>(cmd_code);
16153 }
16154 CONSTEXPR npu_set_weight1_length_t &set_cmd_code(::cmd1 value)
16155 {
16156 cmd_code = static_cast<uint32_t>(value);
16157 return *this;
16158 }
16159 CONSTEXPR uint32_t get_data() const
16160 {
16161 return static_cast<uint32_t>(data);
16162 }
16163 CONSTEXPR npu_set_weight1_length_t &set_data(uint32_t value)
16164 {
16165 data = static_cast<uint32_t>(value);
16166 return *this;
16167 }
16168 CONSTEXPR uint32_t get_payload_size() const
16169 {
16170 return static_cast<uint32_t>(payload_size);
16171 }
16172 CONSTEXPR npu_set_weight1_length_t &set_payload_size(uint32_t value)
16173 {
16174 payload_size = static_cast<uint32_t>(value);
16175 return *this;
16176 }
16177#endif //__cplusplus
16178};
16179
16180// Set Scale and bias stream input byte offset from SCALE_REGION
16181struct npu_set_scale1_base_t
16182{
16183 uint32_t cmd_code : 10; // NPU_SET_SCALE1_BASE
16184 uint32_t must_be_zero : 4; // 0
16185 uint32_t payload_size : 2; // Min:1 Max:2
16186 uint32_t param : 16;
16187 uint32_t data : 32; // Scale and bias stream input byte offset from SCALE_REGION
16188#ifdef __cplusplus
16189 CONSTEXPR bool valid() const
16190 {
16191 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_SCALE1_BASE) && must_be_zero == 0 && payload_size >= 1 &&
16192 payload_size <= 2;
16193 }
16194 CONSTEXPR void init()
16195 {
16196 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_SCALE1_BASE);
16197 must_be_zero = 0;
16198 payload_size = 1;
16199 }
16200 CONSTEXPR ::cmd1 get_cmd_code() const
16201 {
16202 return static_cast<::cmd1>(cmd_code);
16203 }
16204 CONSTEXPR npu_set_scale1_base_t &set_cmd_code(::cmd1 value)
16205 {
16206 cmd_code = static_cast<uint32_t>(value);
16207 return *this;
16208 }
16209 CONSTEXPR uint32_t get_data() const
16210 {
16211 return static_cast<uint32_t>(data);
16212 }
16213 CONSTEXPR npu_set_scale1_base_t &set_data(uint32_t value)
16214 {
16215 data = static_cast<uint32_t>(value);
16216 return *this;
16217 }
16218 CONSTEXPR uint32_t get_param() const
16219 {
16220 return static_cast<uint32_t>(param);
16221 }
16222 CONSTEXPR npu_set_scale1_base_t &set_param(uint32_t value)
16223 {
16224 param = static_cast<uint32_t>(value);
16225 return *this;
16226 }
16227 CONSTEXPR uint32_t get_payload_size() const
16228 {
16229 return static_cast<uint32_t>(payload_size);
16230 }
16231 CONSTEXPR npu_set_scale1_base_t &set_payload_size(uint32_t value)
16232 {
16233 payload_size = static_cast<uint32_t>(value);
16234 return *this;
16235 }
16236#endif //__cplusplus
16237};
16238
16239// Set Scale and bias stream input byte length (unsigned 20 bits)
16240struct npu_set_scale1_length_t
16241{
16242 uint32_t cmd_code : 10; // NPU_SET_SCALE1_LENGTH
16243 uint32_t must_be_zero : 4; // 0
16244 uint32_t payload_size : 2; // Min:1 Max:2
16245 uint32_t reserved0 : 16;
16246 uint32_t data : 32; // Scale and bias stream input byte length (unsigned 20 bits)
16247#ifdef __cplusplus
16248 CONSTEXPR bool valid() const
16249 {
16250 return cmd_code == static_cast<uint32_t>(cmd1::NPU_SET_SCALE1_LENGTH) && must_be_zero == 0 &&
16251 payload_size >= 1 && payload_size <= 2;
16252 }
16253 CONSTEXPR void init()
16254 {
16255 cmd_code = static_cast<uint32_t>(cmd1::NPU_SET_SCALE1_LENGTH);
16256 must_be_zero = 0;
16257 payload_size = 1;
16258 }
16259 CONSTEXPR ::cmd1 get_cmd_code() const
16260 {
16261 return static_cast<::cmd1>(cmd_code);
16262 }
16263 CONSTEXPR npu_set_scale1_length_t &set_cmd_code(::cmd1 value)
16264 {
16265 cmd_code = static_cast<uint32_t>(value);
16266 return *this;
16267 }
16268 CONSTEXPR uint32_t get_data() const
16269 {
16270 return static_cast<uint32_t>(data);
16271 }
16272 CONSTEXPR npu_set_scale1_length_t &set_data(uint32_t value)
16273 {
16274 data = static_cast<uint32_t>(value);
16275 return *this;
16276 }
16277 CONSTEXPR uint32_t get_payload_size() const
16278 {
16279 return static_cast<uint32_t>(payload_size);
16280 }
16281 CONSTEXPR npu_set_scale1_length_t &set_payload_size(uint32_t value)
16282 {
16283 payload_size = static_cast<uint32_t>(value);
16284 return *this;
16285 }
16286#endif //__cplusplus
16287};
16288
16289#define NPU_DATA_STRUCTS \
16290 NPU_STRUCT(command_no_payload) \
16291 NPU_STRUCT(command_with_payload) \
16292 NPU_STRUCT(npu_op_stop) \
16293 NPU_STRUCT(npu_op_irq) \
16294 NPU_STRUCT(npu_op_conv) \
16295 NPU_STRUCT(npu_op_depthwise) \
16296 NPU_STRUCT(npu_op_pool) \
16297 NPU_STRUCT(npu_op_elementwise) \
16298 NPU_STRUCT(npu_op_dma_start) \
16299 NPU_STRUCT(npu_op_dma_wait) \
16300 NPU_STRUCT(npu_op_kernel_wait) \
16301 NPU_STRUCT(npu_op_pmu_mask) \
16302 NPU_STRUCT(npu_set_ifm_pad_top) \
16303 NPU_STRUCT(npu_set_ifm_pad_left) \
16304 NPU_STRUCT(npu_set_ifm_pad_right) \
16305 NPU_STRUCT(npu_set_ifm_pad_bottom) \
16306 NPU_STRUCT(npu_set_ifm_depth_m1) \
16307 NPU_STRUCT(npu_set_ifm_precision) \
16308 NPU_STRUCT(npu_set_ifm_upscale) \
16309 NPU_STRUCT(npu_set_ifm_zero_point) \
16310 NPU_STRUCT(npu_set_ifm_width0_m1) \
16311 NPU_STRUCT(npu_set_ifm_height0_m1) \
16312 NPU_STRUCT(npu_set_ifm_height1_m1) \
16313 NPU_STRUCT(npu_set_ifm_ib_end) \
16314 NPU_STRUCT(npu_set_ifm_region) \
16315 NPU_STRUCT(npu_set_ofm_width_m1) \
16316 NPU_STRUCT(npu_set_ofm_height_m1) \
16317 NPU_STRUCT(npu_set_ofm_depth_m1) \
16318 NPU_STRUCT(npu_set_ofm_precision) \
16319 NPU_STRUCT(npu_set_ofm_blk_width_m1) \
16320 NPU_STRUCT(npu_set_ofm_blk_height_m1) \
16321 NPU_STRUCT(npu_set_ofm_blk_depth_m1) \
16322 NPU_STRUCT(npu_set_ofm_zero_point) \
16323 NPU_STRUCT(npu_set_ofm_width0_m1) \
16324 NPU_STRUCT(npu_set_ofm_height0_m1) \
16325 NPU_STRUCT(npu_set_ofm_height1_m1) \
16326 NPU_STRUCT(npu_set_ofm_region) \
16327 NPU_STRUCT(npu_set_kernel_width_m1) \
16328 NPU_STRUCT(npu_set_kernel_height_m1) \
16329 NPU_STRUCT(npu_set_kernel_stride) \
16330 NPU_STRUCT(npu_set_parallel_mode) \
16331 NPU_STRUCT(npu_set_acc_format) \
16332 NPU_STRUCT(npu_set_activation) \
16333 NPU_STRUCT(npu_set_activation_min) \
16334 NPU_STRUCT(npu_set_activation_max) \
16335 NPU_STRUCT(npu_set_weight_region) \
16336 NPU_STRUCT(npu_set_scale_region) \
16337 NPU_STRUCT(npu_set_ab_start) \
16338 NPU_STRUCT(npu_set_blockdep) \
16339 NPU_STRUCT(npu_set_dma0_src_region) \
16340 NPU_STRUCT(npu_set_dma0_dst_region) \
16341 NPU_STRUCT(npu_set_dma0_size0) \
16342 NPU_STRUCT(npu_set_dma0_size1) \
16343 NPU_STRUCT(npu_set_ifm2_broadcast) \
16344 NPU_STRUCT(npu_set_ifm2_scalar) \
16345 NPU_STRUCT(npu_set_ifm2_precision) \
16346 NPU_STRUCT(npu_set_ifm2_zero_point) \
16347 NPU_STRUCT(npu_set_ifm2_width0_m1) \
16348 NPU_STRUCT(npu_set_ifm2_height0_m1) \
16349 NPU_STRUCT(npu_set_ifm2_height1_m1) \
16350 NPU_STRUCT(npu_set_ifm2_ib_start) \
16351 NPU_STRUCT(npu_set_ifm2_region) \
16352 NPU_STRUCT(npu_set_ifm_base0) \
16353 NPU_STRUCT(npu_set_ifm_base1) \
16354 NPU_STRUCT(npu_set_ifm_base2) \
16355 NPU_STRUCT(npu_set_ifm_base3) \
16356 NPU_STRUCT(npu_set_ifm_stride_x) \
16357 NPU_STRUCT(npu_set_ifm_stride_y) \
16358 NPU_STRUCT(npu_set_ifm_stride_c) \
16359 NPU_STRUCT(npu_set_ofm_base0) \
16360 NPU_STRUCT(npu_set_ofm_base1) \
16361 NPU_STRUCT(npu_set_ofm_base2) \
16362 NPU_STRUCT(npu_set_ofm_base3) \
16363 NPU_STRUCT(npu_set_ofm_stride_x) \
16364 NPU_STRUCT(npu_set_ofm_stride_y) \
16365 NPU_STRUCT(npu_set_ofm_stride_c) \
16366 NPU_STRUCT(npu_set_weight_base) \
16367 NPU_STRUCT(npu_set_weight_length) \
16368 NPU_STRUCT(npu_set_scale_base) \
16369 NPU_STRUCT(npu_set_scale_length) \
16370 NPU_STRUCT(npu_set_ofm_scale) \
16371 NPU_STRUCT(npu_set_opa_scale) \
16372 NPU_STRUCT(npu_set_opb_scale) \
16373 NPU_STRUCT(npu_set_dma0_src) \
16374 NPU_STRUCT(npu_set_dma0_dst) \
16375 NPU_STRUCT(npu_set_dma0_len) \
16376 NPU_STRUCT(npu_set_dma0_skip0) \
16377 NPU_STRUCT(npu_set_dma0_skip1) \
16378 NPU_STRUCT(npu_set_ifm2_base0) \
16379 NPU_STRUCT(npu_set_ifm2_base1) \
16380 NPU_STRUCT(npu_set_ifm2_base2) \
16381 NPU_STRUCT(npu_set_ifm2_base3) \
16382 NPU_STRUCT(npu_set_ifm2_stride_x) \
16383 NPU_STRUCT(npu_set_ifm2_stride_y) \
16384 NPU_STRUCT(npu_set_ifm2_stride_c) \
16385 NPU_STRUCT(npu_set_weight1_base) \
16386 NPU_STRUCT(npu_set_weight1_length) \
16387 NPU_STRUCT(npu_set_scale1_base) \
16388 NPU_STRUCT(npu_set_scale1_length)
16389#define NPU_OP_STRUCTS \
16390 NPU_OP_(stop) \
16391 NPU_OP_(irq) \
16392 NPU_OP_(conv) \
16393 NPU_OP_(depthwise) \
16394 NPU_OP_(pool) \
16395 NPU_OP_(elementwise) \
16396 NPU_OP_(dma_start) \
16397 NPU_OP_(dma_wait) \
16398 NPU_OP_(kernel_wait) \
16399 NPU_OP_(pmu_mask)
16400#define NPU_SET_STRUCTS \
16401 NPU_SET_(ifm_pad_top) \
16402 NPU_SET_(ifm_pad_left) \
16403 NPU_SET_(ifm_pad_right) \
16404 NPU_SET_(ifm_pad_bottom) \
16405 NPU_SET_(ifm_depth_m1) \
16406 NPU_SET_(ifm_precision) \
16407 NPU_SET_(ifm_upscale) \
16408 NPU_SET_(ifm_zero_point) \
16409 NPU_SET_(ifm_width0_m1) \
16410 NPU_SET_(ifm_height0_m1) \
16411 NPU_SET_(ifm_height1_m1) \
16412 NPU_SET_(ifm_ib_end) \
16413 NPU_SET_(ifm_region) \
16414 NPU_SET_(ofm_width_m1) \
16415 NPU_SET_(ofm_height_m1) \
16416 NPU_SET_(ofm_depth_m1) \
16417 NPU_SET_(ofm_precision) \
16418 NPU_SET_(ofm_blk_width_m1) \
16419 NPU_SET_(ofm_blk_height_m1) \
16420 NPU_SET_(ofm_blk_depth_m1) \
16421 NPU_SET_(ofm_zero_point) \
16422 NPU_SET_(ofm_width0_m1) \
16423 NPU_SET_(ofm_height0_m1) \
16424 NPU_SET_(ofm_height1_m1) \
16425 NPU_SET_(ofm_region) \
16426 NPU_SET_(kernel_width_m1) \
16427 NPU_SET_(kernel_height_m1) \
16428 NPU_SET_(kernel_stride) \
16429 NPU_SET_(parallel_mode) \
16430 NPU_SET_(acc_format) \
16431 NPU_SET_(activation) \
16432 NPU_SET_(activation_min) \
16433 NPU_SET_(activation_max) \
16434 NPU_SET_(weight_region) \
16435 NPU_SET_(scale_region) \
16436 NPU_SET_(ab_start) \
16437 NPU_SET_(blockdep) \
16438 NPU_SET_(dma0_src_region) \
16439 NPU_SET_(dma0_dst_region) \
16440 NPU_SET_(dma0_size0) \
16441 NPU_SET_(dma0_size1) \
16442 NPU_SET_(ifm2_broadcast) \
16443 NPU_SET_(ifm2_scalar) \
16444 NPU_SET_(ifm2_precision) \
16445 NPU_SET_(ifm2_zero_point) \
16446 NPU_SET_(ifm2_width0_m1) \
16447 NPU_SET_(ifm2_height0_m1) \
16448 NPU_SET_(ifm2_height1_m1) \
16449 NPU_SET_(ifm2_ib_start) \
16450 NPU_SET_(ifm2_region) \
16451 NPU_SET_(ifm_base0) \
16452 NPU_SET_(ifm_base1) \
16453 NPU_SET_(ifm_base2) \
16454 NPU_SET_(ifm_base3) \
16455 NPU_SET_(ifm_stride_x) \
16456 NPU_SET_(ifm_stride_y) \
16457 NPU_SET_(ifm_stride_c) \
16458 NPU_SET_(ofm_base0) \
16459 NPU_SET_(ofm_base1) \
16460 NPU_SET_(ofm_base2) \
16461 NPU_SET_(ofm_base3) \
16462 NPU_SET_(ofm_stride_x) \
16463 NPU_SET_(ofm_stride_y) \
16464 NPU_SET_(ofm_stride_c) \
16465 NPU_SET_(weight_base) \
16466 NPU_SET_(weight_length) \
16467 NPU_SET_(scale_base) \
16468 NPU_SET_(scale_length) \
16469 NPU_SET_(ofm_scale) \
16470 NPU_SET_(opa_scale) \
16471 NPU_SET_(opb_scale) \
16472 NPU_SET_(dma0_src) \
16473 NPU_SET_(dma0_dst) \
16474 NPU_SET_(dma0_len) \
16475 NPU_SET_(dma0_skip0) \
16476 NPU_SET_(dma0_skip1) \
16477 NPU_SET_(ifm2_base0) \
16478 NPU_SET_(ifm2_base1) \
16479 NPU_SET_(ifm2_base2) \
16480 NPU_SET_(ifm2_base3) \
16481 NPU_SET_(ifm2_stride_x) \
16482 NPU_SET_(ifm2_stride_y) \
16483 NPU_SET_(ifm2_stride_c) \
16484 NPU_SET_(weight1_base) \
16485 NPU_SET_(weight1_length) \
16486 NPU_SET_(scale1_base) \
16487 NPU_SET_(scale1_length)
16488#define COMMAND_STRUCTS \
16489 COMMAND_(no_payload) \
16490 COMMAND_(with_payload)
16491
16492#define EXPAND_ACC_FORMAT(FUNC, SEP) \
16493 FUNC(acc_format, INT_32BIT) SEP FUNC(acc_format, INT_40BIT) SEP FUNC(acc_format, FP_S5_10)
16494
16495#define EXPAND_ACTIVATION(FUNC, SEP) \
16496 FUNC(activation, NONE) \
16497 SEP FUNC(activation, TANH) SEP FUNC(activation, SIGMOID) SEP FUNC(activation, LUT_START) \
16498 SEP FUNC(activation, LUT_END)
16499
16500#define EXPAND_CLIP_RANGE(FUNC, SEP) \
16501 FUNC(clip_range, OFM_PRECISION) \
16502 SEP FUNC(clip_range, FORCE_UINT8) SEP FUNC(clip_range, FORCE_INT8) SEP FUNC(clip_range, FORCE_INT16)
16503
16504#define EXPAND_CMD0(FUNC, SEP) \
16505 FUNC(cmd0, NPU_OP_STOP) \
16506 SEP FUNC(cmd0, NPU_OP_IRQ) SEP FUNC(cmd0, NPU_OP_CONV) SEP FUNC(cmd0, NPU_OP_DEPTHWISE) SEP FUNC( \
16507 cmd0, NPU_OP_POOL) SEP FUNC(cmd0, NPU_OP_ELEMENTWISE) SEP FUNC(cmd0, NPU_OP_DMA_START) \
16508 SEP FUNC(cmd0, NPU_OP_DMA_WAIT) SEP FUNC(cmd0, NPU_OP_KERNEL_WAIT) SEP FUNC(cmd0, NPU_OP_PMU_MASK) SEP FUNC( \
16509 cmd0, NPU_SET_IFM_PAD_TOP) SEP FUNC(cmd0, NPU_SET_IFM_PAD_LEFT) SEP FUNC(cmd0, NPU_SET_IFM_PAD_RIGHT) \
16510 SEP FUNC(cmd0, NPU_SET_IFM_PAD_BOTTOM) SEP FUNC(cmd0, NPU_SET_IFM_DEPTH_M1) SEP FUNC( \
16511 cmd0, NPU_SET_IFM_PRECISION) SEP FUNC(cmd0, NPU_SET_IFM_UPSCALE) \
16512 SEP FUNC(cmd0, NPU_SET_IFM_ZERO_POINT) SEP FUNC(cmd0, NPU_SET_IFM_WIDTH0_M1) SEP FUNC( \
16513 cmd0, NPU_SET_IFM_HEIGHT0_M1) SEP FUNC(cmd0, NPU_SET_IFM_HEIGHT1_M1) SEP FUNC(cmd0, \
16514 NPU_SET_IFM_IB_END) \
16515 SEP FUNC(cmd0, NPU_SET_IFM_REGION) SEP FUNC(cmd0, NPU_SET_OFM_WIDTH_M1) SEP FUNC( \
16516 cmd0, NPU_SET_OFM_HEIGHT_M1) SEP FUNC(cmd0, NPU_SET_OFM_DEPTH_M1) \
16517 SEP FUNC(cmd0, NPU_SET_OFM_PRECISION) SEP FUNC(cmd0, NPU_SET_OFM_BLK_WIDTH_M1) SEP FUNC( \
16518 cmd0, NPU_SET_OFM_BLK_HEIGHT_M1) SEP FUNC(cmd0, NPU_SET_OFM_BLK_DEPTH_M1) \
16519 SEP FUNC(cmd0, NPU_SET_OFM_ZERO_POINT) SEP FUNC(cmd0, NPU_SET_OFM_WIDTH0_M1) SEP FUNC( \
16520 cmd0, NPU_SET_OFM_HEIGHT0_M1) SEP FUNC(cmd0, NPU_SET_OFM_HEIGHT1_M1) \
16521 SEP FUNC(cmd0, NPU_SET_OFM_REGION) SEP FUNC(cmd0, NPU_SET_KERNEL_WIDTH_M1) SEP FUNC( \
16522 cmd0, NPU_SET_KERNEL_HEIGHT_M1) SEP FUNC(cmd0, NPU_SET_KERNEL_STRIDE) \
16523 SEP FUNC(cmd0, NPU_SET_PARALLEL_MODE) SEP FUNC(cmd0, NPU_SET_ACC_FORMAT) SEP FUNC( \
16524 cmd0, NPU_SET_ACTIVATION) SEP FUNC(cmd0, NPU_SET_ACTIVATION_MIN) \
16525 SEP FUNC(cmd0, NPU_SET_ACTIVATION_MAX) SEP FUNC(cmd0, NPU_SET_WEIGHT_REGION) \
16526 SEP FUNC(cmd0, NPU_SET_SCALE_REGION) SEP FUNC(cmd0, NPU_SET_AB_START) \
16527 SEP FUNC(cmd0, \
16528 NPU_SET_BLOCKDEP) SEP FUNC(cmd0, NPU_SET_DMA0_SRC_REGION) \
16529 SEP FUNC(cmd0, NPU_SET_DMA0_DST_REGION) SEP FUNC( \
16530 cmd0, NPU_SET_DMA0_SIZE0) SEP FUNC(cmd0, NPU_SET_DMA0_SIZE1) \
16531 SEP FUNC(cmd0, NPU_SET_IFM2_BROADCAST) \
16532 SEP FUNC(cmd0, NPU_SET_IFM2_SCALAR) \
16533 SEP FUNC(cmd0, NPU_SET_IFM2_PRECISION) SEP FUNC( \
16534 cmd0, NPU_SET_IFM2_ZERO_POINT) \
16535 SEP FUNC(cmd0, NPU_SET_IFM2_WIDTH0_M1) SEP FUNC( \
16536 cmd0, NPU_SET_IFM2_HEIGHT0_M1) \
16537 SEP FUNC(cmd0, NPU_SET_IFM2_HEIGHT1_M1) \
16538 SEP FUNC(cmd0, NPU_SET_IFM2_IB_START) \
16539 SEP FUNC(cmd0, NPU_SET_IFM2_REGION)
16540
16541#define EXPAND_CMD1(FUNC, SEP) \
16542 FUNC(cmd1, NPU_SET_IFM_BASE0) \
16543 SEP FUNC(cmd1, NPU_SET_IFM_BASE1) SEP FUNC(cmd1, NPU_SET_IFM_BASE2) SEP FUNC(cmd1, NPU_SET_IFM_BASE3) \
16544 SEP FUNC(cmd1, NPU_SET_IFM_STRIDE_X) SEP FUNC(cmd1, NPU_SET_IFM_STRIDE_Y) SEP FUNC(cmd1, NPU_SET_IFM_STRIDE_C) \
16545 SEP FUNC(cmd1, NPU_SET_OFM_BASE0) SEP FUNC(cmd1, NPU_SET_OFM_BASE1) SEP FUNC(cmd1, NPU_SET_OFM_BASE2) \
16546 SEP FUNC(cmd1, NPU_SET_OFM_BASE3) SEP FUNC(cmd1, NPU_SET_OFM_STRIDE_X) \
16547 SEP FUNC(cmd1, NPU_SET_OFM_STRIDE_Y) SEP FUNC(cmd1, NPU_SET_OFM_STRIDE_C) \
16548 SEP FUNC(cmd1, NPU_SET_WEIGHT_BASE) SEP FUNC(cmd1, NPU_SET_WEIGHT_LENGTH) \
16549 SEP FUNC(cmd1, NPU_SET_SCALE_BASE) SEP FUNC(cmd1, NPU_SET_SCALE_LENGTH) \
16550 SEP FUNC(cmd1, NPU_SET_OFM_SCALE) SEP FUNC(cmd1, NPU_SET_OPA_SCALE) \
16551 SEP FUNC(cmd1, NPU_SET_OPB_SCALE) SEP FUNC(cmd1, NPU_SET_DMA0_SRC) \
16552 SEP FUNC(cmd1, NPU_SET_DMA0_DST) SEP FUNC(cmd1, NPU_SET_DMA0_LEN) SEP FUNC( \
16553 cmd1, NPU_SET_DMA0_SKIP0) SEP FUNC(cmd1, NPU_SET_DMA0_SKIP1) \
16554 SEP FUNC(cmd1, NPU_SET_IFM2_BASE0) SEP FUNC(cmd1, NPU_SET_IFM2_BASE1) \
16555 SEP FUNC(cmd1, NPU_SET_IFM2_BASE2) SEP FUNC(cmd1, NPU_SET_IFM2_BASE3) \
16556 SEP FUNC(cmd1, NPU_SET_IFM2_STRIDE_X) \
16557 SEP FUNC(cmd1, NPU_SET_IFM2_STRIDE_Y) \
16558 SEP FUNC(cmd1, NPU_SET_IFM2_STRIDE_C) \
16559 SEP FUNC(cmd1, NPU_SET_WEIGHT1_BASE) \
16560 SEP FUNC(cmd1, NPU_SET_WEIGHT1_LENGTH) \
16561 SEP FUNC(cmd1, NPU_SET_SCALE1_BASE) \
16562 SEP FUNC(cmd1, NPU_SET_SCALE1_LENGTH)
16563
16564#define EXPAND_DATA_FORMAT(FUNC, SEP) FUNC(data_format, NHWC) SEP FUNC(data_format, NHCWB16)
16565
16566#define EXPAND_ELEMENTWISE_MODE(FUNC, SEP) \
16567 FUNC(elementwise_mode, MUL) \
16568 SEP FUNC(elementwise_mode, ADD) SEP FUNC(elementwise_mode, SUB) SEP FUNC(elementwise_mode, MIN) \
16569 SEP FUNC(elementwise_mode, MAX) SEP FUNC(elementwise_mode, LRELU) SEP FUNC(elementwise_mode, ABS) \
16570 SEP FUNC(elementwise_mode, CLZ) SEP FUNC(elementwise_mode, SHR) SEP FUNC(elementwise_mode, SHL)
16571
16572#define EXPAND_IFM_PRECISION(FUNC, SEP) \
16573 FUNC(ifm_precision, W8_U8) \
16574 SEP FUNC(ifm_precision, W8_S8) SEP FUNC(ifm_precision, W8_U16) SEP FUNC(ifm_precision, W8_S16) \
16575 SEP FUNC(ifm_precision, W8_S32)
16576
16577#define EXPAND_IFM_SCALE_MODE(FUNC, SEP) \
16578 FUNC(ifm_scale_mode, SCALE_16BIT) \
16579 SEP FUNC(ifm_scale_mode, SCALE_OPA_32BIT) SEP FUNC(ifm_scale_mode, SCALE_OPB_32BIT)
16580
Diqing Zhong04118062020-04-15 01:19:12 +020016581#define EXPAND_MACS_PER_CC(FUNC, SEP) \
16582 FUNC(macs_per_cc, MACS_PER_CC_IS_5) \
16583 SEP FUNC(macs_per_cc, MACS_PER_CC_IS_6) SEP FUNC(macs_per_cc, MACS_PER_CC_IS_7) \
16584 SEP FUNC(macs_per_cc, MACS_PER_CC_IS_8)
16585
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020016586#define EXPAND_MEMORY_TYPE(FUNC, SEP) \
16587 FUNC(memory_type, AXI0_OUTSTANDING_COUNTER0) \
16588 SEP FUNC(memory_type, AXI0_OUTSTANDING_COUNTER1) SEP FUNC(memory_type, AXI1_OUTSTANDING_COUNTER2) \
16589 SEP FUNC(memory_type, AXI1_OUTSTANDING_COUNTER3)
16590
16591#define EXPAND_OFM_PRECISION(FUNC, SEP) \
16592 FUNC(ofm_precision, U8) \
16593 SEP FUNC(ofm_precision, S8) SEP FUNC(ofm_precision, U16) SEP FUNC(ofm_precision, S16) SEP FUNC(ofm_precision, S32)
16594
16595#define EXPAND_PMU_EVENT_TYPE(FUNC, SEP) \
Diqing Zhong04118062020-04-15 01:19:12 +020016596 FUNC(pmu_event_type, NO_EVENT) \
16597 SEP FUNC(pmu_event_type, CYCLE) SEP FUNC(pmu_event_type, NPU_IDLE) SEP FUNC(pmu_event_type, MAC_ACTIVE) SEP FUNC( \
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020016598 pmu_event_type, MAC_ACTIVE_8BIT) SEP FUNC(pmu_event_type, MAC_ACTIVE_16BIT) SEP FUNC(pmu_event_type, \
16599 MAC_DPU_ACTIVE) \
16600 SEP FUNC(pmu_event_type, MAC_STALLED_BY_WD_ACC) SEP FUNC(pmu_event_type, MAC_STALLED_BY_WD) SEP FUNC( \
16601 pmu_event_type, MAC_STALLED_BY_ACC) SEP FUNC(pmu_event_type, MAC_STALLED_BY_IB) SEP FUNC(pmu_event_type, \
Diqing Zhong04118062020-04-15 01:19:12 +020016602 MAC_ACTIVE_32BIT) \
16603 SEP FUNC(pmu_event_type, AO_ACTIVE) SEP FUNC(pmu_event_type, AO_ACTIVE_8BIT) SEP FUNC( \
16604 pmu_event_type, AO_ACTIVE_16BIT) SEP FUNC(pmu_event_type, AO_STALLED_BY_OFMP_OB) \
16605 SEP FUNC(pmu_event_type, AO_STALLED_BY_OFMP) SEP FUNC(pmu_event_type, AO_STALLED_BY_OB) SEP FUNC( \
16606 pmu_event_type, AO_STALLED_BY_ACC_IB) SEP FUNC(pmu_event_type, AO_STALLED_BY_ACC) \
16607 SEP FUNC(pmu_event_type, AO_STALLED_BY_IB) SEP FUNC(pmu_event_type, WD_ACTIVE) SEP FUNC( \
16608 pmu_event_type, WD_STALLED) SEP FUNC(pmu_event_type, \
16609 WD_STALLED_BY_WS) SEP FUNC(pmu_event_type, \
16610 WD_STALLED_BY_WD_BUF) \
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020016611 SEP FUNC(pmu_event_type, WD_PARSE_ACTIVE) SEP FUNC(pmu_event_type, WD_PARSE_STALLED) SEP FUNC( \
Diqing Zhong04118062020-04-15 01:19:12 +020016612 pmu_event_type, \
16613 WD_PARSE_STALLED_IN) SEP FUNC(pmu_event_type, \
16614 WD_PARSE_STALLED_OUT) SEP FUNC(pmu_event_type, WD_TRANS_WS) \
16615 SEP FUNC(pmu_event_type, WD_TRANS_WB) SEP FUNC(pmu_event_type, WD_TRANS_DW0) SEP FUNC( \
16616 pmu_event_type, \
16617 WD_TRANS_DW1) SEP FUNC(pmu_event_type, AXI0_RD_TRANS_ACCEPTED) \
16618 SEP FUNC(pmu_event_type, AXI0_RD_TRANS_COMPLETED) SEP FUNC( \
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020016619 pmu_event_type, \
Diqing Zhong04118062020-04-15 01:19:12 +020016620 AXI0_RD_DATA_BEAT_RECEIVED) SEP FUNC(pmu_event_type, AXI0_RD_TRAN_REQ_STALLED) \
16621 SEP FUNC(pmu_event_type, AXI0_WR_TRANS_ACCEPTED) SEP FUNC( \
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020016622 pmu_event_type, \
Diqing Zhong04118062020-04-15 01:19:12 +020016623 AXI0_WR_TRANS_COMPLETED_M) SEP FUNC(pmu_event_type, AXI0_WR_TRANS_COMPLETED_S) \
16624 SEP FUNC(pmu_event_type, AXI0_WR_DATA_BEAT_WRITTEN) SEP FUNC( \
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020016625 pmu_event_type, \
Diqing Zhong04118062020-04-15 01:19:12 +020016626 AXI0_WR_TRAN_REQ_STALLED) SEP FUNC(pmu_event_type, \
16627 AXI0_WR_DATA_BEAT_STALLED) \
16628 SEP FUNC(pmu_event_type, AXI0_ENABLED_CYCLES) SEP FUNC( \
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020016629 pmu_event_type, \
Diqing Zhong04118062020-04-15 01:19:12 +020016630 AXI0_RD_STALL_LIMIT) SEP FUNC(pmu_event_type, AXI0_WR_STALL_LIMIT) \
16631 SEP FUNC(pmu_event_type, \
16632 AXI1_RD_TRANS_ACCEPTED) SEP FUNC(pmu_event_type, \
16633 AXI1_RD_TRANS_COMPLETED) \
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020016634 SEP FUNC(pmu_event_type, AXI1_RD_DATA_BEAT_RECEIVED) SEP FUNC( \
16635 pmu_event_type, \
16636 AXI1_RD_TRAN_REQ_STALLED) SEP FUNC(pmu_event_type, \
16637 AXI1_WR_TRANS_ACCEPTED) \
16638 SEP FUNC(pmu_event_type, AXI1_WR_TRANS_COMPLETED_M) SEP FUNC( \
16639 pmu_event_type, \
16640 AXI1_WR_TRANS_COMPLETED_S) SEP \
16641 FUNC(pmu_event_type, AXI1_WR_DATA_BEAT_WRITTEN) SEP FUNC( \
16642 pmu_event_type, \
16643 AXI1_WR_TRAN_REQ_STALLED) SEP \
16644 FUNC(pmu_event_type, AXI1_WR_DATA_BEAT_STALLED) SEP FUNC( \
16645 pmu_event_type, \
16646 AXI1_ENABLED_CYCLES) SEP \
16647 FUNC(pmu_event_type, AXI1_RD_STALL_LIMIT) SEP FUNC( \
16648 pmu_event_type, \
16649 AXI1_WR_STALL_LIMIT) SEP FUNC(pmu_event_type, \
16650 AXI_LATENCY_ANY) \
16651 SEP FUNC(pmu_event_type, AXI_LATENCY_32) \
16652 SEP FUNC(pmu_event_type, AXI_LATENCY_64) \
16653 SEP FUNC(pmu_event_type, \
16654 AXI_LATENCY_128) \
16655 SEP FUNC(pmu_event_type, \
16656 AXI_LATENCY_256) \
16657 SEP FUNC(pmu_event_type, \
16658 AXI_LATENCY_512) \
16659 SEP FUNC(pmu_event_type, \
16660 AXI_LATENCY_1024)
16661
16662#define EXPAND_POOLING_MODE(FUNC, SEP) \
16663 FUNC(pooling_mode, MAX) SEP FUNC(pooling_mode, AVERAGE) SEP FUNC(pooling_mode, REDUCE_SUM)
16664
16665#define EXPAND_PRIVILEGE_LEVEL(FUNC, SEP) FUNC(privilege_level, USER) SEP FUNC(privilege_level, PRIVILEGED)
16666
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020016667#define EXPAND_RESAMPLING_MODE(FUNC, SEP) \
16668 FUNC(resampling_mode, NONE) SEP FUNC(resampling_mode, NEAREST) SEP FUNC(resampling_mode, TRANSPOSE)
16669
16670#define EXPAND_ROUNDING(FUNC, SEP) FUNC(rounding, TFL) SEP FUNC(rounding, TRUNCATE) SEP FUNC(rounding, NATURAL)
16671
16672#define EXPAND_SECURITY_LEVEL(FUNC, SEP) FUNC(security_level, SECURE) SEP FUNC(security_level, NON_SECURE)
16673
Diqing Zhong04118062020-04-15 01:19:12 +020016674#define EXPAND_SHRAM_SIZE(FUNC, SEP) \
16675 FUNC(shram_size, SHRAM_48KB) SEP FUNC(shram_size, SHRAM_24KB) SEP FUNC(shram_size, SHRAM_16KB)
16676
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020016677#define EXPAND_STATE(FUNC, SEP) FUNC(state, STOPPED) SEP FUNC(state, RUNNING)
16678
16679#define EXPAND_STRIDE_MODE(FUNC, SEP) \
16680 FUNC(stride_mode, STRIDE_MODE_1D) SEP FUNC(stride_mode, STRIDE_MODE_2D) SEP FUNC(stride_mode, STRIDE_MODE_3D)