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