blob: 2d6d4fc63b6f9c909f0dcc23170fdc05d4ba04be [file] [log] [blame]
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001/*
Jonny Svärd136810f2021-10-13 16:04:26 +02002 * Copyright (c) 2020-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
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020038#endif
39
Jonny Svärd136810f2021-10-13 16:04:26 +020040#if defined(__cplusplus) && defined(NPU_DISASSEMBLE)
41#include <iomanip>
42#include <sstream>
43#include <vector>
44#endif
45
46#if defined(__cplusplus) && !defined(NPU_NAMESPACE)
47#define NPU_NAMESPACE npu
48#endif
49
50#ifdef __cplusplus
51#include <cstring>
52#include <limits>
53#endif
54
55#ifdef __cplusplus
56namespace NPU_NAMESPACE
57{
58#endif
Douglas Trohaf6a85da2020-05-11 11:45:28 +020059#define NNX_ARCH_VERSION_MAJOR 1
Jonny Svärd136810f2021-10-13 16:04:26 +020060#define NNX_ARCH_VERSION_MINOR 1
61#define NNX_ARCH_VERSION_PATCH 0
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020062
63// Register offsets
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020064//
Douglas Troha2e7e3b72020-05-14 20:28:31 +020065// Register subpage BASE
66//
67#define NPU_REG_ID 0x0000
68#define NPU_REG_STATUS 0x0004
69#define NPU_REG_CMD 0x0008
70#define NPU_REG_RESET 0x000C
Jonny Svärd136810f2021-10-13 16:04:26 +020071#define NPU_REG_QBASE 0x0010
72#define NPU_REG_QBASE_HI 0x0014
Douglas Troha2e7e3b72020-05-14 20:28:31 +020073#define NPU_REG_QREAD 0x0018
74#define NPU_REG_QCONFIG 0x001C
75#define NPU_REG_QSIZE 0x0020
76#define NPU_REG_PROT 0x0024
77#define NPU_REG_CONFIG 0x0028
78#define NPU_REG_LOCK 0x002C
79#define NPU_REG_REGIONCFG 0x003C
80#define NPU_REG_AXI_LIMIT0 0x0040
81#define NPU_REG_AXI_LIMIT1 0x0044
82#define NPU_REG_AXI_LIMIT2 0x0048
83#define NPU_REG_AXI_LIMIT3 0x004C
Jonny Svärd136810f2021-10-13 16:04:26 +020084#define BASE_REGISTERS_SIZE 0x0080
Douglas Troha2e7e3b72020-05-14 20:28:31 +020085
86//
87// Register subpage BASE_POINTERS
88//
Jonny Svärd136810f2021-10-13 16:04:26 +020089#define NPU_REG_BASEP_BASE 0x0080
90#define NPU_REG_BASEP_ARRLEN 0x0008
91#define BASE_POINTERS_REGISTERS_SIZE 0x0100
Douglas Troha2e7e3b72020-05-14 20:28:31 +020092
93//
94// Register subpage DEBUG
95//
96#define NPU_REG_WD_STATUS 0x0100
97#define NPU_REG_MAC_STATUS 0x0104
98#define NPU_REG_AO_STATUS 0x0108
99#define NPU_REG_DMA_STATUS0 0x0110
100#define NPU_REG_DMA_STATUS1 0x0114
101#define NPU_REG_CLKFORCE 0x0140
102#define NPU_REG_DEBUG_ADDRESS 0x0144
103#define NPU_REG_DEBUG_MISC 0x0148
Stefan Nannessone2e70242020-08-19 16:01:29 +0200104#define NPU_REG_DEBUG_BLOCK 0x0150
Jonny Svärd136810f2021-10-13 16:04:26 +0200105#define DEBUG_REGISTERS_SIZE 0x0180
Douglas Troha2e7e3b72020-05-14 20:28:31 +0200106
107//
108// Register subpage PMU
109//
110#define NPU_REG_PMCR 0x0180
111#define NPU_REG_PMCNTENSET 0x0184
112#define NPU_REG_PMCNTENCLR 0x0188
113#define NPU_REG_PMOVSSET 0x018C
114#define NPU_REG_PMOVSCLR 0x0190
115#define NPU_REG_PMINTSET 0x0194
116#define NPU_REG_PMINTCLR 0x0198
Jonny Svärd136810f2021-10-13 16:04:26 +0200117#define NPU_REG_PMCCNTR 0x01A0
Douglas Troha2e7e3b72020-05-14 20:28:31 +0200118#define NPU_REG_PMCCNTR_HI 0x01A4
119#define NPU_REG_PMCCNTR_CFG 0x01A8
120#define NPU_REG_PMCAXI_CHAN 0x01AC
Jonny Svärd136810f2021-10-13 16:04:26 +0200121#define PMU_REGISTERS_SIZE 0x0200
Kristofer Jonsson49bdee82020-04-06 13:21:21 +0200122
123//
Douglas Troha2e7e3b72020-05-14 20:28:31 +0200124// Register subpage TSU_DEBUG
Kristofer Jonsson49bdee82020-04-06 13:21:21 +0200125//
126#define NPU_REG_KERNEL_X 0x0200
127#define NPU_REG_KERNEL_Y 0x0204
128#define NPU_REG_KERNEL_W_M1 0x0208
129#define NPU_REG_KERNEL_H_M1 0x020C
130#define NPU_REG_OFM_CBLK_WIDTH_M1 0x0210
131#define NPU_REG_OFM_CBLK_HEIGHT_M1 0x0214
132#define NPU_REG_OFM_CBLK_DEPTH_M1 0x0218
133#define NPU_REG_IFM_CBLK_DEPTH_M1 0x021C
134#define NPU_REG_OFM_X 0x0220
135#define NPU_REG_OFM_Y 0x0224
136#define NPU_REG_OFM_Z 0x0228
137#define NPU_REG_IFM_Z 0x022C
138#define NPU_REG_PAD_TOP 0x0230
139#define NPU_REG_PAD_LEFT 0x0234
140#define NPU_REG_IFM_CBLK_WIDTH 0x0238
141#define NPU_REG_IFM_CBLK_HEIGHT 0x023C
142#define NPU_REG_DMA_IFM_SRC 0x0240
143#define NPU_REG_DMA_IFM_SRC_HI 0x0244
144#define NPU_REG_DMA_IFM_DST 0x0248
145#define NPU_REG_DMA_OFM_SRC 0x024C
146#define NPU_REG_DMA_OFM_DST 0x0250
147#define NPU_REG_DMA_OFM_DST_HI 0x0254
148#define NPU_REG_DMA_WEIGHT_SRC 0x0258
149#define NPU_REG_DMA_WEIGHT_SRC_HI 0x025C
150#define NPU_REG_DMA_CMD_SRC 0x0260
151#define NPU_REG_DMA_CMD_SRC_HI 0x0264
152#define NPU_REG_DMA_CMD_SIZE 0x0268
153#define NPU_REG_DMA_M2M_SRC 0x026C
154#define NPU_REG_DMA_M2M_SRC_HI 0x0270
155#define NPU_REG_DMA_M2M_DST 0x0274
156#define NPU_REG_DMA_M2M_DST_HI 0x0278
157#define NPU_REG_CURRENT_QREAD 0x027C
158#define NPU_REG_DMA_SCALE_SRC 0x0280
159#define NPU_REG_DMA_SCALE_SRC_HI 0x0284
Stefan Nannessone2e70242020-08-19 16:01:29 +0200160#define NPU_REG_CURRENT_BLOCK 0x02B4
161#define NPU_REG_CURRENT_OP 0x02B8
Kristofer Jonsson49bdee82020-04-06 13:21:21 +0200162#define NPU_REG_CURRENT_CMD 0x02BC
Douglas Troha2e7e3b72020-05-14 20:28:31 +0200163#define TSU_DEBUG_REGISTERS_SIZE 0x02C0
Kristofer Jonsson49bdee82020-04-06 13:21:21 +0200164
Jonny Svärd136810f2021-10-13 16:04:26 +0200165//
166// Register subpage PMU_COUNTERS
167//
168#define NPU_REG_PMEVCNTR_BASE 0x0300
169#define NPU_REG_PMEVCNTR_ARRLEN 0x0004
170#define NPU_REG_PMEVTYPER_BASE 0x0380
171#define NPU_REG_PMEVTYPER_ARRLEN 0x0004
172#define PMU_COUNTERS_REGISTERS_SIZE 0x0400
173
174//
175// Register subpage SHARED_BUFFER
176//
177#define NPU_REG_SHARED_BUFFER_BASE 0x0400
178#define NPU_REG_SHARED_BUFFER_ARRLEN 0x0100
179#define SHARED_BUFFER_REGISTERS_SIZE 0x0800
180
181//
182// Register subpage TSU_IFM
183//
184#define NPU_REG_IFM_PAD_TOP 0x0800
185#define NPU_REG_IFM_PAD_LEFT 0x0804
186#define NPU_REG_IFM_PAD_RIGHT 0x0808
187#define NPU_REG_IFM_PAD_BOTTOM 0x080C
188#define NPU_REG_IFM_DEPTH_M1 0x0810
189#define NPU_REG_IFM_PRECISION 0x0814
190#define NPU_REG_IFM_UPSCALE 0x081C
191#define NPU_REG_IFM_ZERO_POINT 0x0824
192#define NPU_REG_IFM_WIDTH0_M1 0x0828
193#define NPU_REG_IFM_HEIGHT0_M1 0x082C
194#define NPU_REG_IFM_HEIGHT1_M1 0x0830
195#define NPU_REG_IFM_IB_END 0x0834
196#define NPU_REG_IFM_REGION 0x083C
197#define TSU_IFM_REGISTERS_SIZE 0x0840
198
199//
200// Register subpage TSU_OFM
201//
202#define NPU_REG_OFM_WIDTH_M1 0x0844
203#define NPU_REG_OFM_HEIGHT_M1 0x0848
204#define NPU_REG_OFM_DEPTH_M1 0x084C
205#define NPU_REG_OFM_PRECISION 0x0850
206#define NPU_REG_OFM_BLK_WIDTH_M1 0x0854
207#define NPU_REG_OFM_BLK_HEIGHT_M1 0x0858
208#define NPU_REG_OFM_BLK_DEPTH_M1 0x085C
209#define NPU_REG_OFM_ZERO_POINT 0x0860
210#define NPU_REG_OFM_WIDTH0_M1 0x0868
211#define NPU_REG_OFM_HEIGHT0_M1 0x086C
212#define NPU_REG_OFM_HEIGHT1_M1 0x0870
213#define NPU_REG_OFM_REGION 0x087C
214#define TSU_OFM_REGISTERS_SIZE 0x0880
215
216//
217// Register subpage TSU_KERNEL
218//
219#define NPU_REG_KERNEL_WIDTH_M1 0x0880
220#define NPU_REG_KERNEL_HEIGHT_M1 0x0884
221#define NPU_REG_KERNEL_STRIDE 0x0888
222#define NPU_REG_ACC_FORMAT 0x0890
223#define NPU_REG_ACTIVATION 0x0894
224#define NPU_REG_ACTIVATION_MIN 0x0898
225#define NPU_REG_ACTIVATION_MAX 0x089C
226#define NPU_REG_WEIGHT_REGION 0x08A0
227#define NPU_REG_SCALE_REGION 0x08A4
228#define NPU_REG_AB_START 0x08B4
229#define NPU_REG_BLOCKDEP 0x08BC
230#define TSU_KERNEL_REGISTERS_SIZE 0x08C0
231
232//
233// Register subpage TSU_DMA
234//
235#define NPU_REG_DMA0_SRC_REGION 0x08C0
236#define NPU_REG_DMA0_DST_REGION 0x08C4
237#define NPU_REG_DMA0_SIZE0 0x08C8
238#define NPU_REG_DMA0_SIZE1 0x08CC
239#define TSU_DMA_REGISTERS_SIZE 0x0900
240
241//
242// Register subpage TSU_IFM2
243//
244#define NPU_REG_IFM2_BROADCAST 0x0900
245#define NPU_REG_IFM2_SCALAR 0x0904
246#define NPU_REG_IFM2_PRECISION 0x0914
247#define NPU_REG_IFM2_ZERO_POINT 0x0924
248#define NPU_REG_IFM2_WIDTH0_M1 0x0928
249#define NPU_REG_IFM2_HEIGHT0_M1 0x092C
250#define NPU_REG_IFM2_HEIGHT1_M1 0x0930
251#define NPU_REG_IFM2_IB_START 0x0934
252#define NPU_REG_IFM2_REGION 0x093C
253#define TSU_IFM2_REGISTERS_SIZE 0x0940
254
255//
256// Register subpage TSU_IFM_BASE
257//
258#define NPU_REG_IFM_BASE0 0x0A00
259#define NPU_REG_IFM_BASE0_HI 0x0A04
260#define NPU_REG_IFM_BASE1 0x0A08
261#define NPU_REG_IFM_BASE1_HI 0x0A0C
262#define NPU_REG_IFM_BASE2 0x0A10
263#define NPU_REG_IFM_BASE2_HI 0x0A14
264#define NPU_REG_IFM_BASE3 0x0A18
265#define NPU_REG_IFM_BASE3_HI 0x0A1C
266#define NPU_REG_IFM_STRIDE_X 0x0A20
267#define NPU_REG_IFM_STRIDE_X_HI 0x0A24
268#define NPU_REG_IFM_STRIDE_Y 0x0A28
269#define NPU_REG_IFM_STRIDE_Y_HI 0x0A2C
270#define NPU_REG_IFM_STRIDE_C 0x0A30
271#define NPU_REG_IFM_STRIDE_C_HI 0x0A34
272#define TSU_IFM_BASE_REGISTERS_SIZE 0x0A40
273
274//
275// Register subpage TSU_OFM_BASE
276//
277#define NPU_REG_OFM_BASE0 0x0A40
278#define NPU_REG_OFM_BASE0_HI 0x0A44
279#define NPU_REG_OFM_BASE1 0x0A48
280#define NPU_REG_OFM_BASE1_HI 0x0A4C
281#define NPU_REG_OFM_BASE2 0x0A50
282#define NPU_REG_OFM_BASE2_HI 0x0A54
283#define NPU_REG_OFM_BASE3 0x0A58
284#define NPU_REG_OFM_BASE3_HI 0x0A5C
285#define NPU_REG_OFM_STRIDE_X 0x0A60
286#define NPU_REG_OFM_STRIDE_X_HI 0x0A64
287#define NPU_REG_OFM_STRIDE_Y 0x0A68
288#define NPU_REG_OFM_STRIDE_Y_HI 0x0A6C
289#define NPU_REG_OFM_STRIDE_C 0x0A70
290#define NPU_REG_OFM_STRIDE_C_HI 0x0A74
291#define TSU_OFM_BASE_REGISTERS_SIZE 0x0A80
292
293//
294// Register subpage TSU_WS_BASE
295//
296#define NPU_REG_WEIGHT_BASE 0x0A80
297#define NPU_REG_WEIGHT_BASE_HI 0x0A84
298#define NPU_REG_WEIGHT_LENGTH 0x0A88
299#define NPU_REG_SCALE_BASE 0x0A90
300#define NPU_REG_SCALE_BASE_HI 0x0A94
301#define NPU_REG_SCALE_LENGTH 0x0A98
302#define NPU_REG_OFM_SCALE 0x0AA0
303#define NPU_REG_OFM_SCALE_SHIFT 0x0AA4
304#define NPU_REG_OPA_SCALE 0x0AA8
305#define NPU_REG_OPA_SCALE_SHIFT 0x0AAC
306#define NPU_REG_OPB_SCALE 0x0AB0
307#define TSU_WS_BASE_REGISTERS_SIZE 0x0AC0
308
309//
310// Register subpage TSU_DMA_BASE
311//
312#define NPU_REG_DMA0_SRC 0x0AC0
313#define NPU_REG_DMA0_SRC_HI 0x0AC4
314#define NPU_REG_DMA0_DST 0x0AC8
315#define NPU_REG_DMA0_DST_HI 0x0ACC
316#define NPU_REG_DMA0_LEN 0x0AD0
317#define NPU_REG_DMA0_LEN_HI 0x0AD4
318#define TSU_DMA_BASE_REGISTERS_SIZE 0x0B00
319
320//
321// Register subpage TSU_IFM2_BASE
322//
323#define NPU_REG_IFM2_BASE0 0x0B00
324#define NPU_REG_IFM2_BASE0_HI 0x0B04
325#define NPU_REG_IFM2_BASE1 0x0B08
326#define NPU_REG_IFM2_BASE1_HI 0x0B0C
327#define NPU_REG_IFM2_BASE2 0x0B10
328#define NPU_REG_IFM2_BASE2_HI 0x0B14
329#define NPU_REG_IFM2_BASE3 0x0B18
330#define NPU_REG_IFM2_BASE3_HI 0x0B1C
331#define NPU_REG_IFM2_STRIDE_X 0x0B20
332#define NPU_REG_IFM2_STRIDE_X_HI 0x0B24
333#define NPU_REG_IFM2_STRIDE_Y 0x0B28
334#define NPU_REG_IFM2_STRIDE_Y_HI 0x0B2C
335#define NPU_REG_IFM2_STRIDE_C 0x0B30
336#define NPU_REG_IFM2_STRIDE_C_HI 0x0B34
337#define TSU_IFM2_BASE_REGISTERS_SIZE 0x0B40
338
339//
340// Register subpage TSU_WS1_BASE
341//
342#define TSU_WS1_BASE_REGISTERS_SIZE 0x0B80
343
344//
345// Register subpage TSU_USER_BASE
346//
347#define NPU_REG_USER_DEFINED_BASE 0x0B80
348#define NPU_REG_USER_DEFINED_ARRLEN 0x0008
349#define TSU_USER_BASE_REGISTERS_SIZE 0x0BC0
350
351//
352// Register subpage TSU_DMA_EBASE
353//
354#define TSU_DMA_EBASE_REGISTERS_SIZE 0x0C00
355
356//
357// Register subpage ID
358//
359#define NPU_REG_REVISION 0x0FC0
360#define NPU_REG_PID4 0x0FD0
361#define NPU_REG_PID5 0x0FD4
362#define NPU_REG_PID6 0x0FD8
363#define NPU_REG_PID7 0x0FDC
364#define NPU_REG_PID0 0x0FE0
365#define NPU_REG_PID1 0x0FE4
366#define NPU_REG_PID2 0x0FE8
367#define NPU_REG_PID3 0x0FEC
368#define NPU_REG_CID0 0x0FF0
369#define NPU_REG_CID1 0x0FF4
370#define NPU_REG_CID2 0x0FF8
371#define NPU_REG_CID3 0x0FFC
372#define ID_REGISTERS_SIZE 0x1000
373
Kristofer Jonsson49bdee82020-04-06 13:21:21 +0200374#ifdef __cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +0200375// Enum types
Jonny Svärd136810f2021-10-13 16:04:26 +0200376enum class acc_format : uint8_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +0200377{
Jonny Svärd136810f2021-10-13 16:04:26 +0200378 I32 = 0,
379 I40 = 1,
380 F16 = 2,
Kristofer Jonsson49bdee82020-04-06 13:21:21 +0200381};
382
Jonny Svärd136810f2021-10-13 16:04:26 +0200383enum class activation_clip_range : uint8_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +0200384{
385 OFM_PRECISION = 0,
386 FORCE_UINT8 = 2,
387 FORCE_INT8 = 3,
388 FORCE_INT16 = 5,
389};
390
Jonny Svärd136810f2021-10-13 16:04:26 +0200391enum class activation_format : uint8_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +0200392{
393 NHWC = 0,
394 NHCWB16 = 1,
395};
396
Jonny Svärd136810f2021-10-13 16:04:26 +0200397enum class activation_function : uint8_t
398{
399 RELU = 0,
400 TANH = 3,
401 SIGMOID = 4,
402 TABLE_0 = 16,
403 TABLE_1 = 17,
404 TABLE_2 = 18,
405 TABLE_3 = 19,
406 TABLE_4 = 20,
407 TABLE_5 = 21,
408 TABLE_6 = 22,
409 TABLE_7 = 23,
410};
411
412enum class activation_precision : uint8_t
413{
414 B8 = 0,
415 B16 = 1,
416 B32 = 2,
417 B64 = 3,
418};
419
420enum class activation_type : uint8_t
421{
422 UNSIGNED = 0,
423 SIGNED = 1,
424};
425
426enum class axi_mem_encoding : uint8_t
427{
428 DEVICE_NON_BUFFERABLE = 0,
429 DEVICE_BUFFERABLE = 1,
430 NORMAL_NON_CACHEABLE_NON_BUFFERABLE = 2,
431 NORMAL_NON_CACHEABLE_BUFFERABLE = 3,
432 WRITE_THROUGH_NO_ALLOCATE = 4,
433 WRITE_THROUGH_READ_ALLOCATE = 5,
434 WRITE_THROUGH_WRITE_ALLOCATE = 6,
435 WRITE_THROUGH_READ_AND_WRITE_ALLOCATE = 7,
436 WRITE_BACK_NO_ALLOCATE = 8,
437 WRITE_BACK_READ_ALLOCATE = 9,
438 WRITE_BACK_WRITE_ALLOCATE = 10,
439 WRITE_BACK_READ_AND_WRITE_ALLOCATE = 11,
440};
441
442enum class broadcast_mode : uint8_t
443{
444 DISABLE = 0,
445 ENABLE = 1,
446};
447
448enum class cmd0_opcode : uint16_t
449{
450 NPU_OP_STOP = 0,
451 NPU_OP_IRQ = 1,
452 NPU_OP_CONV = 2,
453 NPU_OP_DEPTHWISE = 3,
454 NPU_OP_POOL = 5,
455 NPU_OP_ELEMENTWISE = 6,
456 NPU_OP_DMA_START = 16,
457 NPU_OP_DMA_WAIT = 17,
458 NPU_OP_KERNEL_WAIT = 18,
459 NPU_OP_PMU_MASK = 19,
460 NPU_SET_IFM_PAD_TOP = 256,
461 NPU_SET_IFM_PAD_LEFT = 257,
462 NPU_SET_IFM_PAD_RIGHT = 258,
463 NPU_SET_IFM_PAD_BOTTOM = 259,
464 NPU_SET_IFM_DEPTH_M1 = 260,
465 NPU_SET_IFM_PRECISION = 261,
466 NPU_SET_IFM_UPSCALE = 263,
467 NPU_SET_IFM_ZERO_POINT = 265,
468 NPU_SET_IFM_WIDTH0_M1 = 266,
469 NPU_SET_IFM_HEIGHT0_M1 = 267,
470 NPU_SET_IFM_HEIGHT1_M1 = 268,
471 NPU_SET_IFM_IB_END = 269,
472 NPU_SET_IFM_REGION = 271,
473 NPU_SET_OFM_WIDTH_M1 = 273,
474 NPU_SET_OFM_HEIGHT_M1 = 274,
475 NPU_SET_OFM_DEPTH_M1 = 275,
476 NPU_SET_OFM_PRECISION = 276,
477 NPU_SET_OFM_BLK_WIDTH_M1 = 277,
478 NPU_SET_OFM_BLK_HEIGHT_M1 = 278,
479 NPU_SET_OFM_BLK_DEPTH_M1 = 279,
480 NPU_SET_OFM_ZERO_POINT = 280,
481 NPU_SET_OFM_WIDTH0_M1 = 282,
482 NPU_SET_OFM_HEIGHT0_M1 = 283,
483 NPU_SET_OFM_HEIGHT1_M1 = 284,
484 NPU_SET_OFM_REGION = 287,
485 NPU_SET_KERNEL_WIDTH_M1 = 288,
486 NPU_SET_KERNEL_HEIGHT_M1 = 289,
487 NPU_SET_KERNEL_STRIDE = 290,
488 NPU_SET_ACC_FORMAT = 292,
489 NPU_SET_ACTIVATION = 293,
490 NPU_SET_ACTIVATION_MIN = 294,
491 NPU_SET_ACTIVATION_MAX = 295,
492 NPU_SET_WEIGHT_REGION = 296,
493 NPU_SET_SCALE_REGION = 297,
494 NPU_SET_AB_START = 301,
495 NPU_SET_BLOCKDEP = 303,
496 NPU_SET_DMA0_SRC_REGION = 304,
497 NPU_SET_DMA0_DST_REGION = 305,
498 NPU_SET_DMA0_SIZE0 = 306,
499 NPU_SET_DMA0_SIZE1 = 307,
500 NPU_SET_IFM2_BROADCAST = 384,
501 NPU_SET_IFM2_SCALAR = 385,
502 NPU_SET_IFM2_PRECISION = 389,
503 NPU_SET_IFM2_ZERO_POINT = 393,
504 NPU_SET_IFM2_WIDTH0_M1 = 394,
505 NPU_SET_IFM2_HEIGHT0_M1 = 395,
506 NPU_SET_IFM2_HEIGHT1_M1 = 396,
507 NPU_SET_IFM2_IB_START = 397,
508 NPU_SET_IFM2_REGION = 399,
509};
510
511enum class cmd1_opcode : uint16_t
512{
513 NPU_SET_IFM_BASE0 = 0,
514 NPU_SET_IFM_BASE1 = 1,
515 NPU_SET_IFM_BASE2 = 2,
516 NPU_SET_IFM_BASE3 = 3,
517 NPU_SET_IFM_STRIDE_X = 4,
518 NPU_SET_IFM_STRIDE_Y = 5,
519 NPU_SET_IFM_STRIDE_C = 6,
520 NPU_SET_OFM_BASE0 = 16,
521 NPU_SET_OFM_BASE1 = 17,
522 NPU_SET_OFM_BASE2 = 18,
523 NPU_SET_OFM_BASE3 = 19,
524 NPU_SET_OFM_STRIDE_X = 20,
525 NPU_SET_OFM_STRIDE_Y = 21,
526 NPU_SET_OFM_STRIDE_C = 22,
527 NPU_SET_WEIGHT_BASE = 32,
528 NPU_SET_WEIGHT_LENGTH = 33,
529 NPU_SET_SCALE_BASE = 34,
530 NPU_SET_SCALE_LENGTH = 35,
531 NPU_SET_OFM_SCALE = 36,
532 NPU_SET_OPA_SCALE = 37,
533 NPU_SET_OPB_SCALE = 38,
534 NPU_SET_DMA0_SRC = 48,
535 NPU_SET_DMA0_DST = 49,
536 NPU_SET_DMA0_LEN = 50,
537 NPU_SET_IFM2_BASE0 = 128,
538 NPU_SET_IFM2_BASE1 = 129,
539 NPU_SET_IFM2_BASE2 = 130,
540 NPU_SET_IFM2_BASE3 = 131,
541 NPU_SET_IFM2_STRIDE_X = 132,
542 NPU_SET_IFM2_STRIDE_Y = 133,
543 NPU_SET_IFM2_STRIDE_C = 134,
544 NPU_SET_USER_DEFINED0 = 160,
545 NPU_SET_USER_DEFINED1 = 161,
546 NPU_SET_USER_DEFINED2 = 162,
547 NPU_SET_USER_DEFINED3 = 163,
548 NPU_SET_USER_DEFINED4 = 164,
549 NPU_SET_USER_DEFINED5 = 165,
550 NPU_SET_USER_DEFINED6 = 166,
551 NPU_SET_USER_DEFINED7 = 167,
552};
553
554enum class cmd_ctrl : uint8_t
555{
556 CMD0_CTRL = 0,
557 CMD1_CTRL = 1,
558};
559
560enum class custom_dma_cs : uint8_t
561{
562 DISABLE = 0,
563 ENABLE = 1,
564};
565
566enum class custom_dma : uint8_t
567{
568 NOT_IMPLEMENTED = 0,
569 IMPLEMENTED = 1,
570};
571
572enum class dma_fault_src : uint8_t
573{
574 AXI_M0 = 0,
575 AXI_M1 = 1,
576};
577
578enum class dma_region_mode : uint8_t
579{
580 EXTERNAL = 0,
581 INTERNAL = 1,
582};
583
584enum class dma_stride_mode : uint8_t
585{
586 D1 = 0,
587};
588
589enum class elementwise_mode : uint8_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +0200590{
591 MUL = 0,
592 ADD = 1,
593 SUB = 2,
594 MIN = 3,
595 MAX = 4,
596 LRELU = 5,
597 ABS = 6,
598 CLZ = 7,
599 SHR = 8,
600 SHL = 9,
601};
602
Jonny Svärd136810f2021-10-13 16:04:26 +0200603enum class functional_safety : uint8_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +0200604{
Jonny Svärd136810f2021-10-13 16:04:26 +0200605 NOT_IMPLEMENTED = 0,
606 IMPLEMENTED = 1,
607};
608
609enum class ifm2_operand_order : uint8_t
610{
611 ORDER_B = 0,
612 ORDER_A = 1,
Kristofer Jonsson49bdee82020-04-06 13:21:21 +0200613};
614
615enum class ifm_scale_mode : uint8_t
616{
Jonny Svärd136810f2021-10-13 16:04:26 +0200617 OPA_OPB_16 = 0,
618 OPA_32 = 1,
619 OPB_32 = 2,
Kristofer Jonsson49bdee82020-04-06 13:21:21 +0200620};
621
Jonny Svärd136810f2021-10-13 16:04:26 +0200622enum class ifm_upscale_mode : uint8_t
Diqing Zhong04118062020-04-15 01:19:12 +0200623{
Jonny Svärd136810f2021-10-13 16:04:26 +0200624 NONE = 0,
625 NEAREST = 1,
626 ZEROS = 2,
Diqing Zhong04118062020-04-15 01:19:12 +0200627};
628
Jonny Svärd136810f2021-10-13 16:04:26 +0200629enum class kernel_decomposition : uint8_t
630{
631 D8X8 = 0,
632 D4X4 = 1,
633};
634
635enum class kernel_dilation : uint8_t
636{
637 NONE = 0,
638 X2 = 1,
639};
640
641enum class max_beats : uint8_t
642{
643 B64 = 0,
644 B128 = 1,
645 B256 = 2,
646};
647
648enum class mem_attr : uint8_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +0200649{
650 AXI0_OUTSTANDING_COUNTER0 = 0,
651 AXI0_OUTSTANDING_COUNTER1 = 1,
652 AXI1_OUTSTANDING_COUNTER2 = 2,
653 AXI1_OUTSTANDING_COUNTER3 = 3,
654};
655
Jonny Svärd136810f2021-10-13 16:04:26 +0200656enum class ofm_scale_mode : uint8_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +0200657{
Jonny Svärd136810f2021-10-13 16:04:26 +0200658 PER_CHANNEL = 0,
659 GLOBAL = 1,
Kristofer Jonsson49bdee82020-04-06 13:21:21 +0200660};
661
Jonny Svärd136810f2021-10-13 16:04:26 +0200662enum class pmu_axi_channel : uint8_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +0200663{
Jonny Svärd136810f2021-10-13 16:04:26 +0200664 RD_CMD = 0,
665 RD_IFM = 1,
666 RD_WEIGHTS = 2,
667 RD_SCALE_BIAS = 3,
668 RD_MEM2MEM = 4,
669 WR_OFM = 8,
670 WR_MEM2MEM = 9,
Kristofer Jonsson49bdee82020-04-06 13:21:21 +0200671};
672
Jonny Svärd136810f2021-10-13 16:04:26 +0200673enum class pmu_event : uint16_t
674{
675 NO_EVENT = 0,
676 CYCLE = 17,
677 NPU_IDLE = 32,
678 CC_STALLED_ON_BLOCKDEP = 33,
679 CC_STALLED_ON_SHRAM_RECONFIG = 34,
680 NPU_ACTIVE = 35,
681 MAC_ACTIVE = 48,
682 MAC_ACTIVE_8BIT = 49,
683 MAC_ACTIVE_16BIT = 50,
684 MAC_DPU_ACTIVE = 51,
685 MAC_STALLED_BY_WD_ACC = 52,
686 MAC_STALLED_BY_WD = 53,
687 MAC_STALLED_BY_ACC = 54,
688 MAC_STALLED_BY_IB = 55,
689 MAC_ACTIVE_32BIT = 56,
690 MAC_STALLED_BY_INT_W = 57,
691 MAC_STALLED_BY_INT_ACC = 58,
692 AO_ACTIVE = 64,
693 AO_ACTIVE_8BIT = 65,
694 AO_ACTIVE_16BIT = 66,
695 AO_STALLED_BY_OFMP_OB = 67,
696 AO_STALLED_BY_OFMP = 68,
697 AO_STALLED_BY_OB = 69,
698 AO_STALLED_BY_ACC_IB = 70,
699 AO_STALLED_BY_ACC = 71,
700 AO_STALLED_BY_IB = 72,
701 WD_ACTIVE = 80,
702 WD_STALLED = 81,
703 WD_STALLED_BY_WS = 82,
704 WD_STALLED_BY_WD_BUF = 83,
705 WD_PARSE_ACTIVE = 84,
706 WD_PARSE_STALLED = 85,
707 WD_PARSE_STALLED_IN = 86,
708 WD_PARSE_STALLED_OUT = 87,
709 WD_TRANS_WS = 88,
710 WD_TRANS_WB = 89,
711 WD_TRANS_DW0 = 90,
712 WD_TRANS_DW1 = 91,
713 AXI0_RD_TRANS_ACCEPTED = 128,
714 AXI0_RD_TRANS_COMPLETED = 129,
715 AXI0_RD_DATA_BEAT_RECEIVED = 130,
716 AXI0_RD_TRAN_REQ_STALLED = 131,
717 AXI0_WR_TRANS_ACCEPTED = 132,
718 AXI0_WR_TRANS_COMPLETED_M = 133,
719 AXI0_WR_TRANS_COMPLETED_S = 134,
720 AXI0_WR_DATA_BEAT_WRITTEN = 135,
721 AXI0_WR_TRAN_REQ_STALLED = 136,
722 AXI0_WR_DATA_BEAT_STALLED = 137,
723 AXI0_ENABLED_CYCLES = 140,
724 AXI0_RD_STALL_LIMIT = 142,
725 AXI0_WR_STALL_LIMIT = 143,
726 AXI_LATENCY_ANY = 160,
727 AXI_LATENCY_32 = 161,
728 AXI_LATENCY_64 = 162,
729 AXI_LATENCY_128 = 163,
730 AXI_LATENCY_256 = 164,
731 AXI_LATENCY_512 = 165,
732 AXI_LATENCY_1024 = 166,
733 ECC_DMA = 176,
734 ECC_SB0 = 177,
735 AXI1_RD_TRANS_ACCEPTED = 384,
736 AXI1_RD_TRANS_COMPLETED = 385,
737 AXI1_RD_DATA_BEAT_RECEIVED = 386,
738 AXI1_RD_TRAN_REQ_STALLED = 387,
739 AXI1_WR_TRANS_ACCEPTED = 388,
740 AXI1_WR_TRANS_COMPLETED_M = 389,
741 AXI1_WR_TRANS_COMPLETED_S = 390,
742 AXI1_WR_DATA_BEAT_WRITTEN = 391,
743 AXI1_WR_TRAN_REQ_STALLED = 392,
744 AXI1_WR_DATA_BEAT_STALLED = 393,
745 AXI1_ENABLED_CYCLES = 396,
746 AXI1_RD_STALL_LIMIT = 398,
747 AXI1_WR_STALL_LIMIT = 399,
748 ECC_SB1 = 433,
749};
750
751enum class pooling_mode : uint8_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +0200752{
753 MAX = 0,
754 AVERAGE = 1,
755 REDUCE_SUM = 2,
756};
757
758enum class privilege_level : uint8_t
759{
760 USER = 0,
761 PRIVILEGED = 1,
762};
763
Jonny Svärd136810f2021-10-13 16:04:26 +0200764enum class round_mode : uint8_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +0200765{
Jonny Svärd136810f2021-10-13 16:04:26 +0200766 DBL = 0,
Kristofer Jonsson49bdee82020-04-06 13:21:21 +0200767 TRUNCATE = 1,
768 NATURAL = 2,
769};
770
771enum class security_level : uint8_t
772{
773 SECURE = 0,
774 NON_SECURE = 1,
775};
776
777enum class state : uint8_t
778{
779 STOPPED = 0,
780 RUNNING = 1,
781};
782
Jonny Svärd136810f2021-10-13 16:04:26 +0200783enum class wd_core_slice_state : uint8_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +0200784{
Jonny Svärd136810f2021-10-13 16:04:26 +0200785 HEADER = 0,
786 PALETTE = 1,
787 WEIGHTS = 2,
788};
789
790enum class wd_ctrl_state : uint8_t
791{
792 IDLE = 0,
793 DRAIN = 1,
794 OFD_INIT = 2,
795 OFD_RUN = 3,
796};
797
798enum class weight_order : uint8_t
799{
800 DEPTH_FIRST = 0,
801 PART_KERNEL_FIRST = 1,
Kristofer Jonsson49bdee82020-04-06 13:21:21 +0200802};
803
804#else
805
806enum acc_format
807{
Jonny Svärd136810f2021-10-13 16:04:26 +0200808 ACC_FORMAT_I32 = 0,
809 ACC_FORMAT_I40 = 1,
810 ACC_FORMAT_F16 = 2,
Kristofer Jonsson49bdee82020-04-06 13:21:21 +0200811};
812
Jonny Svärd136810f2021-10-13 16:04:26 +0200813enum activation_clip_range
Kristofer Jonsson49bdee82020-04-06 13:21:21 +0200814{
Jonny Svärd136810f2021-10-13 16:04:26 +0200815 ACTIVATION_CLIP_RANGE_OFM_PRECISION = 0,
816 ACTIVATION_CLIP_RANGE_FORCE_UINT8 = 2,
817 ACTIVATION_CLIP_RANGE_FORCE_INT8 = 3,
818 ACTIVATION_CLIP_RANGE_FORCE_INT16 = 5,
Kristofer Jonsson49bdee82020-04-06 13:21:21 +0200819};
820
Jonny Svärd136810f2021-10-13 16:04:26 +0200821enum activation_format
Stefan Nannessone2e70242020-08-19 16:01:29 +0200822{
Jonny Svärd136810f2021-10-13 16:04:26 +0200823 ACTIVATION_FORMAT_NHWC = 0,
824 ACTIVATION_FORMAT_NHCWB16 = 1,
Stefan Nannessone2e70242020-08-19 16:01:29 +0200825};
826
Jonny Svärd136810f2021-10-13 16:04:26 +0200827enum activation_function
Kristofer Jonsson49bdee82020-04-06 13:21:21 +0200828{
Jonny Svärd136810f2021-10-13 16:04:26 +0200829 ACTIVATION_FUNCTION_RELU = 0,
830 ACTIVATION_FUNCTION_TANH = 3,
831 ACTIVATION_FUNCTION_SIGMOID = 4,
832 ACTIVATION_FUNCTION_TABLE_0 = 16,
833 ACTIVATION_FUNCTION_TABLE_1 = 17,
834 ACTIVATION_FUNCTION_TABLE_2 = 18,
835 ACTIVATION_FUNCTION_TABLE_3 = 19,
836 ACTIVATION_FUNCTION_TABLE_4 = 20,
837 ACTIVATION_FUNCTION_TABLE_5 = 21,
838 ACTIVATION_FUNCTION_TABLE_6 = 22,
839 ACTIVATION_FUNCTION_TABLE_7 = 23,
Kristofer Jonsson49bdee82020-04-06 13:21:21 +0200840};
841
Jonny Svärd136810f2021-10-13 16:04:26 +0200842enum activation_precision
Kristofer Jonsson49bdee82020-04-06 13:21:21 +0200843{
Jonny Svärd136810f2021-10-13 16:04:26 +0200844 ACTIVATION_PRECISION_B8 = 0,
845 ACTIVATION_PRECISION_B16 = 1,
846 ACTIVATION_PRECISION_B32 = 2,
847 ACTIVATION_PRECISION_B64 = 3,
Kristofer Jonsson49bdee82020-04-06 13:21:21 +0200848};
849
Jonny Svärd136810f2021-10-13 16:04:26 +0200850enum activation_type
Kristofer Jonsson49bdee82020-04-06 13:21:21 +0200851{
Jonny Svärd136810f2021-10-13 16:04:26 +0200852 ACTIVATION_TYPE_UNSIGNED = 0,
853 ACTIVATION_TYPE_SIGNED = 1,
Kristofer Jonsson49bdee82020-04-06 13:21:21 +0200854};
855
Jonny Svärd136810f2021-10-13 16:04:26 +0200856enum axi_mem_encoding
Kristofer Jonsson49bdee82020-04-06 13:21:21 +0200857{
Jonny Svärd136810f2021-10-13 16:04:26 +0200858 AXI_MEM_ENCODING_DEVICE_NON_BUFFERABLE = 0,
859 AXI_MEM_ENCODING_DEVICE_BUFFERABLE = 1,
860 AXI_MEM_ENCODING_NORMAL_NON_CACHEABLE_NON_BUFFERABLE = 2,
861 AXI_MEM_ENCODING_NORMAL_NON_CACHEABLE_BUFFERABLE = 3,
862 AXI_MEM_ENCODING_WRITE_THROUGH_NO_ALLOCATE = 4,
863 AXI_MEM_ENCODING_WRITE_THROUGH_READ_ALLOCATE = 5,
864 AXI_MEM_ENCODING_WRITE_THROUGH_WRITE_ALLOCATE = 6,
865 AXI_MEM_ENCODING_WRITE_THROUGH_READ_AND_WRITE_ALLOCATE = 7,
866 AXI_MEM_ENCODING_WRITE_BACK_NO_ALLOCATE = 8,
867 AXI_MEM_ENCODING_WRITE_BACK_READ_ALLOCATE = 9,
868 AXI_MEM_ENCODING_WRITE_BACK_WRITE_ALLOCATE = 10,
869 AXI_MEM_ENCODING_WRITE_BACK_READ_AND_WRITE_ALLOCATE = 11,
870};
871
872enum broadcast_mode
873{
874 BROADCAST_MODE_DISABLE = 0,
875 BROADCAST_MODE_ENABLE = 1,
876};
877
878enum cmd0_opcode
879{
880 CMD0_OPCODE_NPU_OP_STOP = 0,
881 CMD0_OPCODE_NPU_OP_IRQ = 1,
882 CMD0_OPCODE_NPU_OP_CONV = 2,
883 CMD0_OPCODE_NPU_OP_DEPTHWISE = 3,
884 CMD0_OPCODE_NPU_OP_POOL = 5,
885 CMD0_OPCODE_NPU_OP_ELEMENTWISE = 6,
886 CMD0_OPCODE_NPU_OP_DMA_START = 16,
887 CMD0_OPCODE_NPU_OP_DMA_WAIT = 17,
888 CMD0_OPCODE_NPU_OP_KERNEL_WAIT = 18,
889 CMD0_OPCODE_NPU_OP_PMU_MASK = 19,
890 CMD0_OPCODE_NPU_SET_IFM_PAD_TOP = 256,
891 CMD0_OPCODE_NPU_SET_IFM_PAD_LEFT = 257,
892 CMD0_OPCODE_NPU_SET_IFM_PAD_RIGHT = 258,
893 CMD0_OPCODE_NPU_SET_IFM_PAD_BOTTOM = 259,
894 CMD0_OPCODE_NPU_SET_IFM_DEPTH_M1 = 260,
895 CMD0_OPCODE_NPU_SET_IFM_PRECISION = 261,
896 CMD0_OPCODE_NPU_SET_IFM_UPSCALE = 263,
897 CMD0_OPCODE_NPU_SET_IFM_ZERO_POINT = 265,
898 CMD0_OPCODE_NPU_SET_IFM_WIDTH0_M1 = 266,
899 CMD0_OPCODE_NPU_SET_IFM_HEIGHT0_M1 = 267,
900 CMD0_OPCODE_NPU_SET_IFM_HEIGHT1_M1 = 268,
901 CMD0_OPCODE_NPU_SET_IFM_IB_END = 269,
902 CMD0_OPCODE_NPU_SET_IFM_REGION = 271,
903 CMD0_OPCODE_NPU_SET_OFM_WIDTH_M1 = 273,
904 CMD0_OPCODE_NPU_SET_OFM_HEIGHT_M1 = 274,
905 CMD0_OPCODE_NPU_SET_OFM_DEPTH_M1 = 275,
906 CMD0_OPCODE_NPU_SET_OFM_PRECISION = 276,
907 CMD0_OPCODE_NPU_SET_OFM_BLK_WIDTH_M1 = 277,
908 CMD0_OPCODE_NPU_SET_OFM_BLK_HEIGHT_M1 = 278,
909 CMD0_OPCODE_NPU_SET_OFM_BLK_DEPTH_M1 = 279,
910 CMD0_OPCODE_NPU_SET_OFM_ZERO_POINT = 280,
911 CMD0_OPCODE_NPU_SET_OFM_WIDTH0_M1 = 282,
912 CMD0_OPCODE_NPU_SET_OFM_HEIGHT0_M1 = 283,
913 CMD0_OPCODE_NPU_SET_OFM_HEIGHT1_M1 = 284,
914 CMD0_OPCODE_NPU_SET_OFM_REGION = 287,
915 CMD0_OPCODE_NPU_SET_KERNEL_WIDTH_M1 = 288,
916 CMD0_OPCODE_NPU_SET_KERNEL_HEIGHT_M1 = 289,
917 CMD0_OPCODE_NPU_SET_KERNEL_STRIDE = 290,
918 CMD0_OPCODE_NPU_SET_ACC_FORMAT = 292,
919 CMD0_OPCODE_NPU_SET_ACTIVATION = 293,
920 CMD0_OPCODE_NPU_SET_ACTIVATION_MIN = 294,
921 CMD0_OPCODE_NPU_SET_ACTIVATION_MAX = 295,
922 CMD0_OPCODE_NPU_SET_WEIGHT_REGION = 296,
923 CMD0_OPCODE_NPU_SET_SCALE_REGION = 297,
924 CMD0_OPCODE_NPU_SET_AB_START = 301,
925 CMD0_OPCODE_NPU_SET_BLOCKDEP = 303,
926 CMD0_OPCODE_NPU_SET_DMA0_SRC_REGION = 304,
927 CMD0_OPCODE_NPU_SET_DMA0_DST_REGION = 305,
928 CMD0_OPCODE_NPU_SET_DMA0_SIZE0 = 306,
929 CMD0_OPCODE_NPU_SET_DMA0_SIZE1 = 307,
930 CMD0_OPCODE_NPU_SET_IFM2_BROADCAST = 384,
931 CMD0_OPCODE_NPU_SET_IFM2_SCALAR = 385,
932 CMD0_OPCODE_NPU_SET_IFM2_PRECISION = 389,
933 CMD0_OPCODE_NPU_SET_IFM2_ZERO_POINT = 393,
934 CMD0_OPCODE_NPU_SET_IFM2_WIDTH0_M1 = 394,
935 CMD0_OPCODE_NPU_SET_IFM2_HEIGHT0_M1 = 395,
936 CMD0_OPCODE_NPU_SET_IFM2_HEIGHT1_M1 = 396,
937 CMD0_OPCODE_NPU_SET_IFM2_IB_START = 397,
938 CMD0_OPCODE_NPU_SET_IFM2_REGION = 399,
939};
940
941enum cmd1_opcode
942{
943 CMD1_OPCODE_NPU_SET_IFM_BASE0 = 0,
944 CMD1_OPCODE_NPU_SET_IFM_BASE1 = 1,
945 CMD1_OPCODE_NPU_SET_IFM_BASE2 = 2,
946 CMD1_OPCODE_NPU_SET_IFM_BASE3 = 3,
947 CMD1_OPCODE_NPU_SET_IFM_STRIDE_X = 4,
948 CMD1_OPCODE_NPU_SET_IFM_STRIDE_Y = 5,
949 CMD1_OPCODE_NPU_SET_IFM_STRIDE_C = 6,
950 CMD1_OPCODE_NPU_SET_OFM_BASE0 = 16,
951 CMD1_OPCODE_NPU_SET_OFM_BASE1 = 17,
952 CMD1_OPCODE_NPU_SET_OFM_BASE2 = 18,
953 CMD1_OPCODE_NPU_SET_OFM_BASE3 = 19,
954 CMD1_OPCODE_NPU_SET_OFM_STRIDE_X = 20,
955 CMD1_OPCODE_NPU_SET_OFM_STRIDE_Y = 21,
956 CMD1_OPCODE_NPU_SET_OFM_STRIDE_C = 22,
957 CMD1_OPCODE_NPU_SET_WEIGHT_BASE = 32,
958 CMD1_OPCODE_NPU_SET_WEIGHT_LENGTH = 33,
959 CMD1_OPCODE_NPU_SET_SCALE_BASE = 34,
960 CMD1_OPCODE_NPU_SET_SCALE_LENGTH = 35,
961 CMD1_OPCODE_NPU_SET_OFM_SCALE = 36,
962 CMD1_OPCODE_NPU_SET_OPA_SCALE = 37,
963 CMD1_OPCODE_NPU_SET_OPB_SCALE = 38,
964 CMD1_OPCODE_NPU_SET_DMA0_SRC = 48,
965 CMD1_OPCODE_NPU_SET_DMA0_DST = 49,
966 CMD1_OPCODE_NPU_SET_DMA0_LEN = 50,
967 CMD1_OPCODE_NPU_SET_IFM2_BASE0 = 128,
968 CMD1_OPCODE_NPU_SET_IFM2_BASE1 = 129,
969 CMD1_OPCODE_NPU_SET_IFM2_BASE2 = 130,
970 CMD1_OPCODE_NPU_SET_IFM2_BASE3 = 131,
971 CMD1_OPCODE_NPU_SET_IFM2_STRIDE_X = 132,
972 CMD1_OPCODE_NPU_SET_IFM2_STRIDE_Y = 133,
973 CMD1_OPCODE_NPU_SET_IFM2_STRIDE_C = 134,
974 CMD1_OPCODE_NPU_SET_USER_DEFINED0 = 160,
975 CMD1_OPCODE_NPU_SET_USER_DEFINED1 = 161,
976 CMD1_OPCODE_NPU_SET_USER_DEFINED2 = 162,
977 CMD1_OPCODE_NPU_SET_USER_DEFINED3 = 163,
978 CMD1_OPCODE_NPU_SET_USER_DEFINED4 = 164,
979 CMD1_OPCODE_NPU_SET_USER_DEFINED5 = 165,
980 CMD1_OPCODE_NPU_SET_USER_DEFINED6 = 166,
981 CMD1_OPCODE_NPU_SET_USER_DEFINED7 = 167,
982};
983
984enum cmd_ctrl
985{
986 CMD_CTRL_CMD0_CTRL = 0,
987 CMD_CTRL_CMD1_CTRL = 1,
988};
989
990enum custom_dma_cs
991{
992 CUSTOM_DMA_CS_DISABLE = 0,
993 CUSTOM_DMA_CS_ENABLE = 1,
994};
995
996enum custom_dma
997{
998 CUSTOM_DMA_NOT_IMPLEMENTED = 0,
999 CUSTOM_DMA_IMPLEMENTED = 1,
1000};
1001
1002enum dma_fault_src
1003{
1004 DMA_FAULT_SRC_AXI_M0 = 0,
1005 DMA_FAULT_SRC_AXI_M1 = 1,
1006};
1007
1008enum dma_region_mode
1009{
1010 DMA_REGION_MODE_EXTERNAL = 0,
1011 DMA_REGION_MODE_INTERNAL = 1,
1012};
1013
1014enum dma_stride_mode
1015{
1016 DMA_STRIDE_MODE_D1 = 0,
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001017};
1018
1019enum elementwise_mode
1020{
1021 ELEMENTWISE_MODE_MUL = 0,
1022 ELEMENTWISE_MODE_ADD = 1,
1023 ELEMENTWISE_MODE_SUB = 2,
1024 ELEMENTWISE_MODE_MIN = 3,
1025 ELEMENTWISE_MODE_MAX = 4,
1026 ELEMENTWISE_MODE_LRELU = 5,
1027 ELEMENTWISE_MODE_ABS = 6,
1028 ELEMENTWISE_MODE_CLZ = 7,
1029 ELEMENTWISE_MODE_SHR = 8,
1030 ELEMENTWISE_MODE_SHL = 9,
1031};
1032
Jonny Svärd136810f2021-10-13 16:04:26 +02001033enum functional_safety
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001034{
Jonny Svärd136810f2021-10-13 16:04:26 +02001035 FUNCTIONAL_SAFETY_NOT_IMPLEMENTED = 0,
1036 FUNCTIONAL_SAFETY_IMPLEMENTED = 1,
1037};
1038
1039enum ifm2_operand_order
1040{
1041 IFM2_OPERAND_ORDER_ORDER_B = 0,
1042 IFM2_OPERAND_ORDER_ORDER_A = 1,
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001043};
1044
1045enum ifm_scale_mode
1046{
Jonny Svärd136810f2021-10-13 16:04:26 +02001047 IFM_SCALE_MODE_OPA_OPB_16 = 0,
1048 IFM_SCALE_MODE_OPA_32 = 1,
1049 IFM_SCALE_MODE_OPB_32 = 2,
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001050};
1051
Jonny Svärd136810f2021-10-13 16:04:26 +02001052enum ifm_upscale_mode
Diqing Zhong04118062020-04-15 01:19:12 +02001053{
Jonny Svärd136810f2021-10-13 16:04:26 +02001054 IFM_UPSCALE_MODE_NONE = 0,
1055 IFM_UPSCALE_MODE_NEAREST = 1,
1056 IFM_UPSCALE_MODE_ZEROS = 2,
Diqing Zhong04118062020-04-15 01:19:12 +02001057};
1058
Jonny Svärd136810f2021-10-13 16:04:26 +02001059enum kernel_decomposition
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001060{
Jonny Svärd136810f2021-10-13 16:04:26 +02001061 KERNEL_DECOMPOSITION_D8X8 = 0,
1062 KERNEL_DECOMPOSITION_D4X4 = 1,
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001063};
1064
Jonny Svärd136810f2021-10-13 16:04:26 +02001065enum kernel_dilation
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001066{
Jonny Svärd136810f2021-10-13 16:04:26 +02001067 KERNEL_DILATION_NONE = 0,
1068 KERNEL_DILATION_X2 = 1,
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001069};
1070
Jonny Svärd136810f2021-10-13 16:04:26 +02001071enum max_beats
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001072{
Jonny Svärd136810f2021-10-13 16:04:26 +02001073 MAX_BEATS_B64 = 0,
1074 MAX_BEATS_B128 = 1,
1075 MAX_BEATS_B256 = 2,
1076};
1077
1078enum mem_attr
1079{
1080 MEM_ATTR_AXI0_OUTSTANDING_COUNTER0 = 0,
1081 MEM_ATTR_AXI0_OUTSTANDING_COUNTER1 = 1,
1082 MEM_ATTR_AXI1_OUTSTANDING_COUNTER2 = 2,
1083 MEM_ATTR_AXI1_OUTSTANDING_COUNTER3 = 3,
1084};
1085
1086enum ofm_scale_mode
1087{
1088 OFM_SCALE_MODE_PER_CHANNEL = 0,
1089 OFM_SCALE_MODE_GLOBAL = 1,
1090};
1091
1092enum pmu_axi_channel
1093{
1094 PMU_AXI_CHANNEL_RD_CMD = 0,
1095 PMU_AXI_CHANNEL_RD_IFM = 1,
1096 PMU_AXI_CHANNEL_RD_WEIGHTS = 2,
1097 PMU_AXI_CHANNEL_RD_SCALE_BIAS = 3,
1098 PMU_AXI_CHANNEL_RD_MEM2MEM = 4,
1099 PMU_AXI_CHANNEL_WR_OFM = 8,
1100 PMU_AXI_CHANNEL_WR_MEM2MEM = 9,
1101};
1102
1103enum pmu_event
1104{
1105 PMU_EVENT_NO_EVENT = 0,
1106 PMU_EVENT_CYCLE = 17,
1107 PMU_EVENT_NPU_IDLE = 32,
1108 PMU_EVENT_CC_STALLED_ON_BLOCKDEP = 33,
1109 PMU_EVENT_CC_STALLED_ON_SHRAM_RECONFIG = 34,
1110 PMU_EVENT_NPU_ACTIVE = 35,
1111 PMU_EVENT_MAC_ACTIVE = 48,
1112 PMU_EVENT_MAC_ACTIVE_8BIT = 49,
1113 PMU_EVENT_MAC_ACTIVE_16BIT = 50,
1114 PMU_EVENT_MAC_DPU_ACTIVE = 51,
1115 PMU_EVENT_MAC_STALLED_BY_WD_ACC = 52,
1116 PMU_EVENT_MAC_STALLED_BY_WD = 53,
1117 PMU_EVENT_MAC_STALLED_BY_ACC = 54,
1118 PMU_EVENT_MAC_STALLED_BY_IB = 55,
1119 PMU_EVENT_MAC_ACTIVE_32BIT = 56,
1120 PMU_EVENT_MAC_STALLED_BY_INT_W = 57,
1121 PMU_EVENT_MAC_STALLED_BY_INT_ACC = 58,
1122 PMU_EVENT_AO_ACTIVE = 64,
1123 PMU_EVENT_AO_ACTIVE_8BIT = 65,
1124 PMU_EVENT_AO_ACTIVE_16BIT = 66,
1125 PMU_EVENT_AO_STALLED_BY_OFMP_OB = 67,
1126 PMU_EVENT_AO_STALLED_BY_OFMP = 68,
1127 PMU_EVENT_AO_STALLED_BY_OB = 69,
1128 PMU_EVENT_AO_STALLED_BY_ACC_IB = 70,
1129 PMU_EVENT_AO_STALLED_BY_ACC = 71,
1130 PMU_EVENT_AO_STALLED_BY_IB = 72,
1131 PMU_EVENT_WD_ACTIVE = 80,
1132 PMU_EVENT_WD_STALLED = 81,
1133 PMU_EVENT_WD_STALLED_BY_WS = 82,
1134 PMU_EVENT_WD_STALLED_BY_WD_BUF = 83,
1135 PMU_EVENT_WD_PARSE_ACTIVE = 84,
1136 PMU_EVENT_WD_PARSE_STALLED = 85,
1137 PMU_EVENT_WD_PARSE_STALLED_IN = 86,
1138 PMU_EVENT_WD_PARSE_STALLED_OUT = 87,
1139 PMU_EVENT_WD_TRANS_WS = 88,
1140 PMU_EVENT_WD_TRANS_WB = 89,
1141 PMU_EVENT_WD_TRANS_DW0 = 90,
1142 PMU_EVENT_WD_TRANS_DW1 = 91,
1143 PMU_EVENT_AXI0_RD_TRANS_ACCEPTED = 128,
1144 PMU_EVENT_AXI0_RD_TRANS_COMPLETED = 129,
1145 PMU_EVENT_AXI0_RD_DATA_BEAT_RECEIVED = 130,
1146 PMU_EVENT_AXI0_RD_TRAN_REQ_STALLED = 131,
1147 PMU_EVENT_AXI0_WR_TRANS_ACCEPTED = 132,
1148 PMU_EVENT_AXI0_WR_TRANS_COMPLETED_M = 133,
1149 PMU_EVENT_AXI0_WR_TRANS_COMPLETED_S = 134,
1150 PMU_EVENT_AXI0_WR_DATA_BEAT_WRITTEN = 135,
1151 PMU_EVENT_AXI0_WR_TRAN_REQ_STALLED = 136,
1152 PMU_EVENT_AXI0_WR_DATA_BEAT_STALLED = 137,
1153 PMU_EVENT_AXI0_ENABLED_CYCLES = 140,
1154 PMU_EVENT_AXI0_RD_STALL_LIMIT = 142,
1155 PMU_EVENT_AXI0_WR_STALL_LIMIT = 143,
1156 PMU_EVENT_AXI_LATENCY_ANY = 160,
1157 PMU_EVENT_AXI_LATENCY_32 = 161,
1158 PMU_EVENT_AXI_LATENCY_64 = 162,
1159 PMU_EVENT_AXI_LATENCY_128 = 163,
1160 PMU_EVENT_AXI_LATENCY_256 = 164,
1161 PMU_EVENT_AXI_LATENCY_512 = 165,
1162 PMU_EVENT_AXI_LATENCY_1024 = 166,
1163 PMU_EVENT_ECC_DMA = 176,
1164 PMU_EVENT_ECC_SB0 = 177,
1165 PMU_EVENT_AXI1_RD_TRANS_ACCEPTED = 384,
1166 PMU_EVENT_AXI1_RD_TRANS_COMPLETED = 385,
1167 PMU_EVENT_AXI1_RD_DATA_BEAT_RECEIVED = 386,
1168 PMU_EVENT_AXI1_RD_TRAN_REQ_STALLED = 387,
1169 PMU_EVENT_AXI1_WR_TRANS_ACCEPTED = 388,
1170 PMU_EVENT_AXI1_WR_TRANS_COMPLETED_M = 389,
1171 PMU_EVENT_AXI1_WR_TRANS_COMPLETED_S = 390,
1172 PMU_EVENT_AXI1_WR_DATA_BEAT_WRITTEN = 391,
1173 PMU_EVENT_AXI1_WR_TRAN_REQ_STALLED = 392,
1174 PMU_EVENT_AXI1_WR_DATA_BEAT_STALLED = 393,
1175 PMU_EVENT_AXI1_ENABLED_CYCLES = 396,
1176 PMU_EVENT_AXI1_RD_STALL_LIMIT = 398,
1177 PMU_EVENT_AXI1_WR_STALL_LIMIT = 399,
1178 PMU_EVENT_ECC_SB1 = 433,
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001179};
1180
1181enum pooling_mode
1182{
1183 POOLING_MODE_MAX = 0,
1184 POOLING_MODE_AVERAGE = 1,
1185 POOLING_MODE_REDUCE_SUM = 2,
1186};
1187
1188enum privilege_level
1189{
1190 PRIVILEGE_LEVEL_USER = 0,
1191 PRIVILEGE_LEVEL_PRIVILEGED = 1,
1192};
1193
Jonny Svärd136810f2021-10-13 16:04:26 +02001194enum round_mode
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001195{
Jonny Svärd136810f2021-10-13 16:04:26 +02001196 ROUND_MODE_DBL = 0,
1197 ROUND_MODE_TRUNCATE = 1,
1198 ROUND_MODE_NATURAL = 2,
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001199};
1200
1201enum security_level
1202{
1203 SECURITY_LEVEL_SECURE = 0,
1204 SECURITY_LEVEL_NON_SECURE = 1,
1205};
1206
1207enum state
1208{
1209 STATE_STOPPED = 0,
1210 STATE_RUNNING = 1,
1211};
1212
Jonny Svärd136810f2021-10-13 16:04:26 +02001213enum wd_core_slice_state
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001214{
Jonny Svärd136810f2021-10-13 16:04:26 +02001215 WD_CORE_SLICE_STATE_HEADER = 0,
1216 WD_CORE_SLICE_STATE_PALETTE = 1,
1217 WD_CORE_SLICE_STATE_WEIGHTS = 2,
1218};
1219
1220enum wd_ctrl_state
1221{
1222 WD_CTRL_STATE_IDLE = 0,
1223 WD_CTRL_STATE_DRAIN = 1,
1224 WD_CTRL_STATE_OFD_INIT = 2,
1225 WD_CTRL_STATE_OFD_RUN = 3,
1226};
1227
1228enum weight_order
1229{
1230 WEIGHT_ORDER_DEPTH_FIRST = 0,
1231 WEIGHT_ORDER_PART_KERNEL_FIRST = 1,
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02001232};
1233
1234#endif
1235
Jonny Svärd136810f2021-10-13 16:04:26 +02001236#ifdef NPU_DISASSEMBLE
1237
1238static const char *acc_format_str[] = {
1239 "ACC_FORMAT_I32",
1240 "ACC_FORMAT_I40",
1241 "ACC_FORMAT_F16",
1242};
1243
1244static const char *activation_clip_range_str[] = {
1245 "ACTIVATION_CLIP_RANGE_OFM_PRECISION",
1246 "ACTIVATION_CLIP_RANGE_FORCE_UINT8",
1247 "ACTIVATION_CLIP_RANGE_FORCE_INT8",
1248 "ACTIVATION_CLIP_RANGE_FORCE_INT16",
1249};
1250
1251static const char *activation_format_str[] = {
1252 "ACTIVATION_FORMAT_NHWC",
1253 "ACTIVATION_FORMAT_NHCWB16",
1254};
1255
1256static const char *activation_function_str[] = {
1257 "ACTIVATION_FUNCTION_RELU",
1258 "ACTIVATION_FUNCTION_TANH",
1259 "ACTIVATION_FUNCTION_SIGMOID",
1260 "ACTIVATION_FUNCTION_TABLE_0",
1261 "ACTIVATION_FUNCTION_TABLE_1",
1262 "ACTIVATION_FUNCTION_TABLE_2",
1263 "ACTIVATION_FUNCTION_TABLE_3",
1264 "ACTIVATION_FUNCTION_TABLE_4",
1265 "ACTIVATION_FUNCTION_TABLE_5",
1266 "ACTIVATION_FUNCTION_TABLE_6",
1267 "ACTIVATION_FUNCTION_TABLE_7",
1268};
1269
1270static const char *activation_precision_str[] = {
1271 "ACTIVATION_PRECISION_B8",
1272 "ACTIVATION_PRECISION_B16",
1273 "ACTIVATION_PRECISION_B32",
1274 "ACTIVATION_PRECISION_B64",
1275};
1276
1277static const char *activation_type_str[] = {
1278 "ACTIVATION_TYPE_UNSIGNED",
1279 "ACTIVATION_TYPE_SIGNED",
1280};
1281
1282static const char *axi_mem_encoding_str[] = {
1283 "AXI_MEM_ENCODING_DEVICE_NON_BUFFERABLE",
1284 "AXI_MEM_ENCODING_DEVICE_BUFFERABLE",
1285 "AXI_MEM_ENCODING_NORMAL_NON_CACHEABLE_NON_BUFFERABLE",
1286 "AXI_MEM_ENCODING_NORMAL_NON_CACHEABLE_BUFFERABLE",
1287 "AXI_MEM_ENCODING_WRITE_THROUGH_NO_ALLOCATE",
1288 "AXI_MEM_ENCODING_WRITE_THROUGH_READ_ALLOCATE",
1289 "AXI_MEM_ENCODING_WRITE_THROUGH_WRITE_ALLOCATE",
1290 "AXI_MEM_ENCODING_WRITE_THROUGH_READ_AND_WRITE_ALLOCATE",
1291 "AXI_MEM_ENCODING_WRITE_BACK_NO_ALLOCATE",
1292 "AXI_MEM_ENCODING_WRITE_BACK_READ_ALLOCATE",
1293 "AXI_MEM_ENCODING_WRITE_BACK_WRITE_ALLOCATE",
1294 "AXI_MEM_ENCODING_WRITE_BACK_READ_AND_WRITE_ALLOCATE",
1295};
1296
1297static const char *broadcast_mode_str[] = {
1298 "BROADCAST_MODE_DISABLE",
1299 "BROADCAST_MODE_ENABLE",
1300};
1301
1302static const char *cmd0_opcode_str[] = {
1303 "CMD0_OPCODE_NPU_OP_STOP",
1304 "CMD0_OPCODE_NPU_OP_IRQ",
1305 "CMD0_OPCODE_NPU_OP_CONV",
1306 "CMD0_OPCODE_NPU_OP_DEPTHWISE",
1307 "CMD0_OPCODE_NPU_OP_POOL",
1308 "CMD0_OPCODE_NPU_OP_ELEMENTWISE",
1309 "CMD0_OPCODE_NPU_OP_DMA_START",
1310 "CMD0_OPCODE_NPU_OP_DMA_WAIT",
1311 "CMD0_OPCODE_NPU_OP_KERNEL_WAIT",
1312 "CMD0_OPCODE_NPU_OP_PMU_MASK",
1313 "CMD0_OPCODE_NPU_SET_IFM_PAD_TOP",
1314 "CMD0_OPCODE_NPU_SET_IFM_PAD_LEFT",
1315 "CMD0_OPCODE_NPU_SET_IFM_PAD_RIGHT",
1316 "CMD0_OPCODE_NPU_SET_IFM_PAD_BOTTOM",
1317 "CMD0_OPCODE_NPU_SET_IFM_DEPTH_M1",
1318 "CMD0_OPCODE_NPU_SET_IFM_PRECISION",
1319 "CMD0_OPCODE_NPU_SET_IFM_UPSCALE",
1320 "CMD0_OPCODE_NPU_SET_IFM_ZERO_POINT",
1321 "CMD0_OPCODE_NPU_SET_IFM_WIDTH0_M1",
1322 "CMD0_OPCODE_NPU_SET_IFM_HEIGHT0_M1",
1323 "CMD0_OPCODE_NPU_SET_IFM_HEIGHT1_M1",
1324 "CMD0_OPCODE_NPU_SET_IFM_IB_END",
1325 "CMD0_OPCODE_NPU_SET_IFM_REGION",
1326 "CMD0_OPCODE_NPU_SET_OFM_WIDTH_M1",
1327 "CMD0_OPCODE_NPU_SET_OFM_HEIGHT_M1",
1328 "CMD0_OPCODE_NPU_SET_OFM_DEPTH_M1",
1329 "CMD0_OPCODE_NPU_SET_OFM_PRECISION",
1330 "CMD0_OPCODE_NPU_SET_OFM_BLK_WIDTH_M1",
1331 "CMD0_OPCODE_NPU_SET_OFM_BLK_HEIGHT_M1",
1332 "CMD0_OPCODE_NPU_SET_OFM_BLK_DEPTH_M1",
1333 "CMD0_OPCODE_NPU_SET_OFM_ZERO_POINT",
1334 "CMD0_OPCODE_NPU_SET_OFM_WIDTH0_M1",
1335 "CMD0_OPCODE_NPU_SET_OFM_HEIGHT0_M1",
1336 "CMD0_OPCODE_NPU_SET_OFM_HEIGHT1_M1",
1337 "CMD0_OPCODE_NPU_SET_OFM_REGION",
1338 "CMD0_OPCODE_NPU_SET_KERNEL_WIDTH_M1",
1339 "CMD0_OPCODE_NPU_SET_KERNEL_HEIGHT_M1",
1340 "CMD0_OPCODE_NPU_SET_KERNEL_STRIDE",
1341 "CMD0_OPCODE_NPU_SET_ACC_FORMAT",
1342 "CMD0_OPCODE_NPU_SET_ACTIVATION",
1343 "CMD0_OPCODE_NPU_SET_ACTIVATION_MIN",
1344 "CMD0_OPCODE_NPU_SET_ACTIVATION_MAX",
1345 "CMD0_OPCODE_NPU_SET_WEIGHT_REGION",
1346 "CMD0_OPCODE_NPU_SET_SCALE_REGION",
1347 "CMD0_OPCODE_NPU_SET_AB_START",
1348 "CMD0_OPCODE_NPU_SET_BLOCKDEP",
1349 "CMD0_OPCODE_NPU_SET_DMA0_SRC_REGION",
1350 "CMD0_OPCODE_NPU_SET_DMA0_DST_REGION",
1351 "CMD0_OPCODE_NPU_SET_DMA0_SIZE0",
1352 "CMD0_OPCODE_NPU_SET_DMA0_SIZE1",
1353 "CMD0_OPCODE_NPU_SET_IFM2_BROADCAST",
1354 "CMD0_OPCODE_NPU_SET_IFM2_SCALAR",
1355 "CMD0_OPCODE_NPU_SET_IFM2_PRECISION",
1356 "CMD0_OPCODE_NPU_SET_IFM2_ZERO_POINT",
1357 "CMD0_OPCODE_NPU_SET_IFM2_WIDTH0_M1",
1358 "CMD0_OPCODE_NPU_SET_IFM2_HEIGHT0_M1",
1359 "CMD0_OPCODE_NPU_SET_IFM2_HEIGHT1_M1",
1360 "CMD0_OPCODE_NPU_SET_IFM2_IB_START",
1361 "CMD0_OPCODE_NPU_SET_IFM2_REGION",
1362};
1363
1364static const char *cmd1_opcode_str[] = {
1365 "CMD1_OPCODE_NPU_SET_IFM_BASE0", "CMD1_OPCODE_NPU_SET_IFM_BASE1", "CMD1_OPCODE_NPU_SET_IFM_BASE2",
1366 "CMD1_OPCODE_NPU_SET_IFM_BASE3", "CMD1_OPCODE_NPU_SET_IFM_STRIDE_X", "CMD1_OPCODE_NPU_SET_IFM_STRIDE_Y",
1367 "CMD1_OPCODE_NPU_SET_IFM_STRIDE_C", "CMD1_OPCODE_NPU_SET_OFM_BASE0", "CMD1_OPCODE_NPU_SET_OFM_BASE1",
1368 "CMD1_OPCODE_NPU_SET_OFM_BASE2", "CMD1_OPCODE_NPU_SET_OFM_BASE3", "CMD1_OPCODE_NPU_SET_OFM_STRIDE_X",
1369 "CMD1_OPCODE_NPU_SET_OFM_STRIDE_Y", "CMD1_OPCODE_NPU_SET_OFM_STRIDE_C", "CMD1_OPCODE_NPU_SET_WEIGHT_BASE",
1370 "CMD1_OPCODE_NPU_SET_WEIGHT_LENGTH", "CMD1_OPCODE_NPU_SET_SCALE_BASE", "CMD1_OPCODE_NPU_SET_SCALE_LENGTH",
1371 "CMD1_OPCODE_NPU_SET_OFM_SCALE", "CMD1_OPCODE_NPU_SET_OPA_SCALE", "CMD1_OPCODE_NPU_SET_OPB_SCALE",
1372 "CMD1_OPCODE_NPU_SET_DMA0_SRC", "CMD1_OPCODE_NPU_SET_DMA0_DST", "CMD1_OPCODE_NPU_SET_DMA0_LEN",
1373 "CMD1_OPCODE_NPU_SET_IFM2_BASE0", "CMD1_OPCODE_NPU_SET_IFM2_BASE1", "CMD1_OPCODE_NPU_SET_IFM2_BASE2",
1374 "CMD1_OPCODE_NPU_SET_IFM2_BASE3", "CMD1_OPCODE_NPU_SET_IFM2_STRIDE_X", "CMD1_OPCODE_NPU_SET_IFM2_STRIDE_Y",
1375 "CMD1_OPCODE_NPU_SET_IFM2_STRIDE_C", "CMD1_OPCODE_NPU_SET_USER_DEFINED0", "CMD1_OPCODE_NPU_SET_USER_DEFINED1",
1376 "CMD1_OPCODE_NPU_SET_USER_DEFINED2", "CMD1_OPCODE_NPU_SET_USER_DEFINED3", "CMD1_OPCODE_NPU_SET_USER_DEFINED4",
1377 "CMD1_OPCODE_NPU_SET_USER_DEFINED5", "CMD1_OPCODE_NPU_SET_USER_DEFINED6", "CMD1_OPCODE_NPU_SET_USER_DEFINED7",
1378};
1379
1380static const char *cmd_ctrl_str[] = {
1381 "CMD_CTRL_CMD0_CTRL",
1382 "CMD_CTRL_CMD1_CTRL",
1383};
1384
1385static const char *custom_dma_cs_str[] = {
1386 "CUSTOM_DMA_CS_DISABLE",
1387 "CUSTOM_DMA_CS_ENABLE",
1388};
1389
1390static const char *custom_dma_str[] = {
1391 "CUSTOM_DMA_NOT_IMPLEMENTED",
1392 "CUSTOM_DMA_IMPLEMENTED",
1393};
1394
1395static const char *dma_fault_src_str[] = {
1396 "DMA_FAULT_SRC_AXI_M0",
1397 "DMA_FAULT_SRC_AXI_M1",
1398};
1399
1400static const char *dma_region_mode_str[] = {
1401 "DMA_REGION_MODE_EXTERNAL",
1402 "DMA_REGION_MODE_INTERNAL",
1403};
1404
1405static const char *dma_stride_mode_str[] = {
1406 "DMA_STRIDE_MODE_D1",
1407};
1408
1409static const char *elementwise_mode_str[] = {
1410 "ELEMENTWISE_MODE_MUL",
1411 "ELEMENTWISE_MODE_ADD",
1412 "ELEMENTWISE_MODE_SUB",
1413 "ELEMENTWISE_MODE_MIN",
1414 "ELEMENTWISE_MODE_MAX",
1415 "ELEMENTWISE_MODE_LRELU",
1416 "ELEMENTWISE_MODE_ABS",
1417 "ELEMENTWISE_MODE_CLZ",
1418 "ELEMENTWISE_MODE_SHR",
1419 "ELEMENTWISE_MODE_SHL",
1420};
1421
1422static const char *functional_safety_str[] = {
1423 "FUNCTIONAL_SAFETY_NOT_IMPLEMENTED",
1424 "FUNCTIONAL_SAFETY_IMPLEMENTED",
1425};
1426
1427static const char *ifm2_operand_order_str[] = {
1428 "IFM2_OPERAND_ORDER_ORDER_B",
1429 "IFM2_OPERAND_ORDER_ORDER_A",
1430};
1431
1432static const char *ifm_scale_mode_str[] = {
1433 "IFM_SCALE_MODE_OPA_OPB_16",
1434 "IFM_SCALE_MODE_OPA_32",
1435 "IFM_SCALE_MODE_OPB_32",
1436};
1437
1438static const char *ifm_upscale_mode_str[] = {
1439 "IFM_UPSCALE_MODE_NONE",
1440 "IFM_UPSCALE_MODE_NEAREST",
1441 "IFM_UPSCALE_MODE_ZEROS",
1442};
1443
1444static const char *kernel_decomposition_str[] = {
1445 "KERNEL_DECOMPOSITION_D8X8",
1446 "KERNEL_DECOMPOSITION_D4X4",
1447};
1448
1449static const char *kernel_dilation_str[] = {
1450 "KERNEL_DILATION_NONE",
1451 "KERNEL_DILATION_X2",
1452};
1453
1454static const char *max_beats_str[] = {
1455 "MAX_BEATS_B64",
1456 "MAX_BEATS_B128",
1457 "MAX_BEATS_B256",
1458};
1459
1460static const char *mem_attr_str[] = {
1461 "MEM_ATTR_AXI0_OUTSTANDING_COUNTER0",
1462 "MEM_ATTR_AXI0_OUTSTANDING_COUNTER1",
1463 "MEM_ATTR_AXI1_OUTSTANDING_COUNTER2",
1464 "MEM_ATTR_AXI1_OUTSTANDING_COUNTER3",
1465};
1466
1467static const char *ofm_scale_mode_str[] = {
1468 "OFM_SCALE_MODE_PER_CHANNEL",
1469 "OFM_SCALE_MODE_GLOBAL",
1470};
1471
1472static const char *pmu_axi_channel_str[] = {
1473 "PMU_AXI_CHANNEL_RD_CMD",
1474 "PMU_AXI_CHANNEL_RD_IFM",
1475 "PMU_AXI_CHANNEL_RD_WEIGHTS",
1476 "PMU_AXI_CHANNEL_RD_SCALE_BIAS",
1477 "PMU_AXI_CHANNEL_RD_MEM2MEM",
1478 "PMU_AXI_CHANNEL_WR_OFM",
1479 "PMU_AXI_CHANNEL_WR_MEM2MEM",
1480};
1481
1482static const char *pmu_event_str[] = {
1483 "PMU_EVENT_NO_EVENT",
1484 "PMU_EVENT_CYCLE",
1485 "PMU_EVENT_NPU_IDLE",
1486 "PMU_EVENT_CC_STALLED_ON_BLOCKDEP",
1487 "PMU_EVENT_CC_STALLED_ON_SHRAM_RECONFIG",
1488 "PMU_EVENT_NPU_ACTIVE",
1489 "PMU_EVENT_MAC_ACTIVE",
1490 "PMU_EVENT_MAC_ACTIVE_8BIT",
1491 "PMU_EVENT_MAC_ACTIVE_16BIT",
1492 "PMU_EVENT_MAC_DPU_ACTIVE",
1493 "PMU_EVENT_MAC_STALLED_BY_WD_ACC",
1494 "PMU_EVENT_MAC_STALLED_BY_WD",
1495 "PMU_EVENT_MAC_STALLED_BY_ACC",
1496 "PMU_EVENT_MAC_STALLED_BY_IB",
1497 "PMU_EVENT_MAC_ACTIVE_32BIT",
1498 "PMU_EVENT_MAC_STALLED_BY_INT_W",
1499 "PMU_EVENT_MAC_STALLED_BY_INT_ACC",
1500 "PMU_EVENT_AO_ACTIVE",
1501 "PMU_EVENT_AO_ACTIVE_8BIT",
1502 "PMU_EVENT_AO_ACTIVE_16BIT",
1503 "PMU_EVENT_AO_STALLED_BY_OFMP_OB",
1504 "PMU_EVENT_AO_STALLED_BY_OFMP",
1505 "PMU_EVENT_AO_STALLED_BY_OB",
1506 "PMU_EVENT_AO_STALLED_BY_ACC_IB",
1507 "PMU_EVENT_AO_STALLED_BY_ACC",
1508 "PMU_EVENT_AO_STALLED_BY_IB",
1509 "PMU_EVENT_WD_ACTIVE",
1510 "PMU_EVENT_WD_STALLED",
1511 "PMU_EVENT_WD_STALLED_BY_WS",
1512 "PMU_EVENT_WD_STALLED_BY_WD_BUF",
1513 "PMU_EVENT_WD_PARSE_ACTIVE",
1514 "PMU_EVENT_WD_PARSE_STALLED",
1515 "PMU_EVENT_WD_PARSE_STALLED_IN",
1516 "PMU_EVENT_WD_PARSE_STALLED_OUT",
1517 "PMU_EVENT_WD_TRANS_WS",
1518 "PMU_EVENT_WD_TRANS_WB",
1519 "PMU_EVENT_WD_TRANS_DW0",
1520 "PMU_EVENT_WD_TRANS_DW1",
1521 "PMU_EVENT_AXI0_RD_TRANS_ACCEPTED",
1522 "PMU_EVENT_AXI0_RD_TRANS_COMPLETED",
1523 "PMU_EVENT_AXI0_RD_DATA_BEAT_RECEIVED",
1524 "PMU_EVENT_AXI0_RD_TRAN_REQ_STALLED",
1525 "PMU_EVENT_AXI0_WR_TRANS_ACCEPTED",
1526 "PMU_EVENT_AXI0_WR_TRANS_COMPLETED_M",
1527 "PMU_EVENT_AXI0_WR_TRANS_COMPLETED_S",
1528 "PMU_EVENT_AXI0_WR_DATA_BEAT_WRITTEN",
1529 "PMU_EVENT_AXI0_WR_TRAN_REQ_STALLED",
1530 "PMU_EVENT_AXI0_WR_DATA_BEAT_STALLED",
1531 "PMU_EVENT_AXI0_ENABLED_CYCLES",
1532 "PMU_EVENT_AXI0_RD_STALL_LIMIT",
1533 "PMU_EVENT_AXI0_WR_STALL_LIMIT",
1534 "PMU_EVENT_AXI_LATENCY_ANY",
1535 "PMU_EVENT_AXI_LATENCY_32",
1536 "PMU_EVENT_AXI_LATENCY_64",
1537 "PMU_EVENT_AXI_LATENCY_128",
1538 "PMU_EVENT_AXI_LATENCY_256",
1539 "PMU_EVENT_AXI_LATENCY_512",
1540 "PMU_EVENT_AXI_LATENCY_1024",
1541 "PMU_EVENT_ECC_DMA",
1542 "PMU_EVENT_ECC_SB0",
1543 "PMU_EVENT_AXI1_RD_TRANS_ACCEPTED",
1544 "PMU_EVENT_AXI1_RD_TRANS_COMPLETED",
1545 "PMU_EVENT_AXI1_RD_DATA_BEAT_RECEIVED",
1546 "PMU_EVENT_AXI1_RD_TRAN_REQ_STALLED",
1547 "PMU_EVENT_AXI1_WR_TRANS_ACCEPTED",
1548 "PMU_EVENT_AXI1_WR_TRANS_COMPLETED_M",
1549 "PMU_EVENT_AXI1_WR_TRANS_COMPLETED_S",
1550 "PMU_EVENT_AXI1_WR_DATA_BEAT_WRITTEN",
1551 "PMU_EVENT_AXI1_WR_TRAN_REQ_STALLED",
1552 "PMU_EVENT_AXI1_WR_DATA_BEAT_STALLED",
1553 "PMU_EVENT_AXI1_ENABLED_CYCLES",
1554 "PMU_EVENT_AXI1_RD_STALL_LIMIT",
1555 "PMU_EVENT_AXI1_WR_STALL_LIMIT",
1556 "PMU_EVENT_ECC_SB1",
1557};
1558
1559static const char *pooling_mode_str[] = {
1560 "POOLING_MODE_MAX",
1561 "POOLING_MODE_AVERAGE",
1562 "POOLING_MODE_REDUCE_SUM",
1563};
1564
1565static const char *privilege_level_str[] = {
1566 "PRIVILEGE_LEVEL_USER",
1567 "PRIVILEGE_LEVEL_PRIVILEGED",
1568};
1569
1570static const char *round_mode_str[] = {
1571 "ROUND_MODE_DBL",
1572 "ROUND_MODE_TRUNCATE",
1573 "ROUND_MODE_NATURAL",
1574};
1575
1576static const char *security_level_str[] = {
1577 "SECURITY_LEVEL_SECURE",
1578 "SECURITY_LEVEL_NON_SECURE",
1579};
1580
1581static const char *state_str[] = {
1582 "STATE_STOPPED",
1583 "STATE_RUNNING",
1584};
1585
1586static const char *wd_core_slice_state_str[] = {
1587 "WD_CORE_SLICE_STATE_HEADER",
1588 "WD_CORE_SLICE_STATE_PALETTE",
1589 "WD_CORE_SLICE_STATE_WEIGHTS",
1590};
1591
1592static const char *wd_ctrl_state_str[] = {
1593 "WD_CTRL_STATE_IDLE",
1594 "WD_CTRL_STATE_DRAIN",
1595 "WD_CTRL_STATE_OFD_INIT",
1596 "WD_CTRL_STATE_OFD_RUN",
1597};
1598
1599static const char *weight_order_str[] = {
1600 "WEIGHT_ORDER_DEPTH_FIRST",
1601 "WEIGHT_ORDER_PART_KERNEL_FIRST",
1602};
1603
1604#endif
1605
1606// Register type structs
Douglas Troha2e7e3b72020-05-14 20:28:31 +02001607// id_r - ID register
1608struct id_r
1609{
Jonny Svärd136810f2021-10-13 16:04:26 +02001610#ifndef __cplusplus
Douglas Troha2e7e3b72020-05-14 20:28:31 +02001611 union
1612 {
1613 struct
1614 {
1615 uint32_t version_status : 4; // This is the version of the product
1616 uint32_t version_minor : 4; // This is the n for the P part of an RnPn release number
1617 uint32_t version_major : 4; // This is the n for the R part of an RnPn release number
Jonny Svärd136810f2021-10-13 16:04:26 +02001618 uint32_t product_major : 4; // Product major ID number (unique per base product)
Douglas Troha2e7e3b72020-05-14 20:28:31 +02001619 uint32_t arch_patch_rev : 4; // This is the patch number of the architecture version a.b
1620 uint32_t
1621 arch_minor_rev : 8; // This is the minor architecture version number, b in the architecture version a.b
1622 uint32_t
1623 arch_major_rev : 4; // This is the major architecture version number, a in the architecture version a.b
1624 };
1625 uint32_t word;
1626 };
Jonny Svärd136810f2021-10-13 16:04:26 +02001627#else
1628 private:
1629 uint32_t word0;
1630
Douglas Troha2e7e3b72020-05-14 20:28:31 +02001631 public:
Jonny Svärd136810f2021-10-13 16:04:26 +02001632 CONSTEXPR id_r() : word0(269500929) {}
1633 CONSTEXPR id_r(uint32_t init) : word0(init) {}
Douglas Troha2e7e3b72020-05-14 20:28:31 +02001634 CONSTEXPR void operator=(uint32_t value)
1635 {
Jonny Svärd136810f2021-10-13 16:04:26 +02001636 word0 = value;
Douglas Troha2e7e3b72020-05-14 20:28:31 +02001637 }
1638 void operator=(uint32_t value) volatile
1639 {
Jonny Svärd136810f2021-10-13 16:04:26 +02001640 word0 = value;
Douglas Troha2e7e3b72020-05-14 20:28:31 +02001641 }
1642 CONSTEXPR operator uint32_t()
1643 {
Jonny Svärd136810f2021-10-13 16:04:26 +02001644 return word0;
Douglas Troha2e7e3b72020-05-14 20:28:31 +02001645 }
1646 operator uint32_t() volatile
1647 {
Jonny Svärd136810f2021-10-13 16:04:26 +02001648 return word0;
Douglas Troha2e7e3b72020-05-14 20:28:31 +02001649 }
1650 id_r copy() volatile
1651 {
1652 return *this;
1653 }
1654 CONSTEXPR uint32_t get_version_status() const
1655 {
Jonny Svärd136810f2021-10-13 16:04:26 +02001656 uint32_t value = static_cast<uint32_t>(((1U << 4) - 1) & (word0 >> 0));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02001657 return value;
1658 }
1659 uint32_t get_version_status() const volatile
1660 {
Jonny Svärd136810f2021-10-13 16:04:26 +02001661 uint32_t value = static_cast<uint32_t>(((1U << 4) - 1) & (word0 >> 0));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02001662 return value;
1663 }
1664 CONSTEXPR id_r &set_version_status(uint32_t value)
1665 {
Jonny Svärd136810f2021-10-13 16:04:26 +02001666 word0 = (((~((1U << 4) - 1)) << 0) & word0) | ((((1U << 4) - 1) & static_cast<uint32_t>(value)) << 0);
Douglas Troha2e7e3b72020-05-14 20:28:31 +02001667 return *this;
1668 }
1669 CONSTEXPR uint32_t get_version_minor() const
1670 {
Jonny Svärd136810f2021-10-13 16:04:26 +02001671 uint32_t value = static_cast<uint32_t>(((1U << 4) - 1) & (word0 >> 4));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02001672 return value;
1673 }
1674 uint32_t get_version_minor() const volatile
1675 {
Jonny Svärd136810f2021-10-13 16:04:26 +02001676 uint32_t value = static_cast<uint32_t>(((1U << 4) - 1) & (word0 >> 4));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02001677 return value;
1678 }
1679 CONSTEXPR id_r &set_version_minor(uint32_t value)
1680 {
Jonny Svärd136810f2021-10-13 16:04:26 +02001681 word0 = (((~((1U << 4) - 1)) << 4) & word0) | ((((1U << 4) - 1) & static_cast<uint32_t>(value)) << 4);
Douglas Troha2e7e3b72020-05-14 20:28:31 +02001682 return *this;
1683 }
1684 CONSTEXPR uint32_t get_version_major() const
1685 {
Jonny Svärd136810f2021-10-13 16:04:26 +02001686 uint32_t value = static_cast<uint32_t>(((1U << 4) - 1) & (word0 >> 8));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02001687 return value;
1688 }
1689 uint32_t get_version_major() const volatile
1690 {
Jonny Svärd136810f2021-10-13 16:04:26 +02001691 uint32_t value = static_cast<uint32_t>(((1U << 4) - 1) & (word0 >> 8));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02001692 return value;
1693 }
1694 CONSTEXPR id_r &set_version_major(uint32_t value)
1695 {
Jonny Svärd136810f2021-10-13 16:04:26 +02001696 word0 = (((~((1U << 4) - 1)) << 8) & word0) | ((((1U << 4) - 1) & static_cast<uint32_t>(value)) << 8);
Douglas Troha2e7e3b72020-05-14 20:28:31 +02001697 return *this;
1698 }
1699 CONSTEXPR uint32_t get_product_major() const
1700 {
Jonny Svärd136810f2021-10-13 16:04:26 +02001701 uint32_t value = static_cast<uint32_t>(((1U << 4) - 1) & (word0 >> 12));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02001702 return value;
1703 }
1704 uint32_t get_product_major() const volatile
1705 {
Jonny Svärd136810f2021-10-13 16:04:26 +02001706 uint32_t value = static_cast<uint32_t>(((1U << 4) - 1) & (word0 >> 12));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02001707 return value;
1708 }
1709 CONSTEXPR id_r &set_product_major(uint32_t value)
1710 {
Jonny Svärd136810f2021-10-13 16:04:26 +02001711 word0 = (((~((1U << 4) - 1)) << 12) & word0) | ((((1U << 4) - 1) & static_cast<uint32_t>(value)) << 12);
Douglas Troha2e7e3b72020-05-14 20:28:31 +02001712 return *this;
1713 }
1714 CONSTEXPR uint32_t get_arch_patch_rev() const
1715 {
Jonny Svärd136810f2021-10-13 16:04:26 +02001716 uint32_t value = static_cast<uint32_t>(((1U << 4) - 1) & (word0 >> 16));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02001717 return value;
1718 }
1719 uint32_t get_arch_patch_rev() const volatile
1720 {
Jonny Svärd136810f2021-10-13 16:04:26 +02001721 uint32_t value = static_cast<uint32_t>(((1U << 4) - 1) & (word0 >> 16));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02001722 return value;
1723 }
1724 CONSTEXPR id_r &set_arch_patch_rev(uint32_t value)
1725 {
Jonny Svärd136810f2021-10-13 16:04:26 +02001726 word0 = (((~((1U << 4) - 1)) << 16) & word0) | ((((1U << 4) - 1) & static_cast<uint32_t>(value)) << 16);
Douglas Troha2e7e3b72020-05-14 20:28:31 +02001727 return *this;
1728 }
1729 CONSTEXPR uint32_t get_arch_minor_rev() const
1730 {
Jonny Svärd136810f2021-10-13 16:04:26 +02001731 uint32_t value = static_cast<uint32_t>(((1U << 8) - 1) & (word0 >> 20));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02001732 return value;
1733 }
1734 uint32_t get_arch_minor_rev() const volatile
1735 {
Jonny Svärd136810f2021-10-13 16:04:26 +02001736 uint32_t value = static_cast<uint32_t>(((1U << 8) - 1) & (word0 >> 20));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02001737 return value;
1738 }
1739 CONSTEXPR id_r &set_arch_minor_rev(uint32_t value)
1740 {
Jonny Svärd136810f2021-10-13 16:04:26 +02001741 word0 = (((~((1U << 8) - 1)) << 20) & word0) | ((((1U << 8) - 1) & static_cast<uint32_t>(value)) << 20);
Douglas Troha2e7e3b72020-05-14 20:28:31 +02001742 return *this;
1743 }
1744 CONSTEXPR uint32_t get_arch_major_rev() const
1745 {
Jonny Svärd136810f2021-10-13 16:04:26 +02001746 uint32_t value = static_cast<uint32_t>(((1U << 4) - 1) & (word0 >> 28));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02001747 return value;
1748 }
1749 uint32_t get_arch_major_rev() const volatile
1750 {
Jonny Svärd136810f2021-10-13 16:04:26 +02001751 uint32_t value = static_cast<uint32_t>(((1U << 4) - 1) & (word0 >> 28));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02001752 return value;
1753 }
1754 CONSTEXPR id_r &set_arch_major_rev(uint32_t value)
1755 {
Jonny Svärd136810f2021-10-13 16:04:26 +02001756 word0 = (((~((1U << 4) - 1)) << 28) & word0) | ((((1U << 4) - 1) & static_cast<uint32_t>(value)) << 28);
Douglas Troha2e7e3b72020-05-14 20:28:31 +02001757 return *this;
1758 }
Jonny Svärd136810f2021-10-13 16:04:26 +02001759#endif
Douglas Troha2e7e3b72020-05-14 20:28:31 +02001760};
1761
1762// status_r - Register describes the current operating status of the NPU
1763struct status_r
1764{
Jonny Svärd136810f2021-10-13 16:04:26 +02001765#ifndef __cplusplus
Douglas Troha2e7e3b72020-05-14 20:28:31 +02001766 union
1767 {
1768 struct
1769 {
1770 uint32_t state : 1; // NPU state, 0 = Stopped, 1 = Running
1771 uint32_t irq_raised : 1; // Raw IRQ status, 0 = IRQ not raised, 1 = IRQ raised. IRQ is cleared using command
1772 // register bit 1
1773 uint32_t
1774 bus_status : 1; // 0=OK, 1=Bus abort detected and processing halted (NPU will reach IDLE state and not
1775 // to start process any more commands/AXI transactions). Can only be cleared by a reset
1776 uint32_t reset_status : 1; // Reset is ongoing and only this register can be read (other registers read as 0
1777 // and writes are ignored.) A value of 0 means NPU is not being reset and can be
1778 // accessed as normal
1779 uint32_t
1780 cmd_parse_error : 1; // 0=No error 1=Command stream parsing error detected. Can only be cleared by reset
1781 uint32_t cmd_end_reached : 1; // 0=Not reached, 1=Reached. Cleared by writing QBASE or QSIZE when NPU is in
1782 // stopped state
1783 uint32_t pmu_irq_raised : 1; // 0=No PMU IRQ, 1=PMU IRQ raised. Cleared by using command register bit 1
1784 uint32_t wd_fault : 1; // Weight decoder state: 0=no fault 1=weight decoder decompression fault. Can only be
1785 // cleared by reset
Stefan Nannessone2e70242020-08-19 16:01:29 +02001786 uint32_t ecc_fault : 1; // ECC state for internal RAMs: 0=no fault 1=ECC fault signalled. Can only be
1787 // cleared by reset
1788 uint32_t reserved0 : 2;
Jonny Svärd136810f2021-10-13 16:04:26 +02001789 uint32_t faulting_interface : 1; // Faulting interface on bus abort
Douglas Troha2e7e3b72020-05-14 20:28:31 +02001790 uint32_t faulting_channel : 4; // Faulting channel on a bus abort. Read: 0=Cmd 1=IFM 2=Weights 3=Scale+Bias
1791 // 4=Mem2Mem; Write: 8=OFM 9=Mem2Mem
1792 uint32_t irq_history_mask : 16; // IRQ History mask
1793 };
1794 uint32_t word;
1795 };
Jonny Svärd136810f2021-10-13 16:04:26 +02001796#else
1797 private:
1798 uint32_t word0;
1799
Douglas Troha2e7e3b72020-05-14 20:28:31 +02001800 public:
Jonny Svärd136810f2021-10-13 16:04:26 +02001801 CONSTEXPR status_r() : word0(8) {}
1802 CONSTEXPR status_r(uint32_t init) : word0(init) {}
Douglas Troha2e7e3b72020-05-14 20:28:31 +02001803 CONSTEXPR void operator=(uint32_t value)
1804 {
Jonny Svärd136810f2021-10-13 16:04:26 +02001805 word0 = value;
Douglas Troha2e7e3b72020-05-14 20:28:31 +02001806 }
1807 void operator=(uint32_t value) volatile
1808 {
Jonny Svärd136810f2021-10-13 16:04:26 +02001809 word0 = value;
Douglas Troha2e7e3b72020-05-14 20:28:31 +02001810 }
1811 CONSTEXPR operator uint32_t()
1812 {
Jonny Svärd136810f2021-10-13 16:04:26 +02001813 return word0;
Douglas Troha2e7e3b72020-05-14 20:28:31 +02001814 }
1815 operator uint32_t() volatile
1816 {
Jonny Svärd136810f2021-10-13 16:04:26 +02001817 return word0;
Douglas Troha2e7e3b72020-05-14 20:28:31 +02001818 }
1819 status_r copy() volatile
1820 {
1821 return *this;
1822 }
Jonny Svärd136810f2021-10-13 16:04:26 +02001823 CONSTEXPR NPU_NAMESPACE::state get_state() const
Douglas Troha2e7e3b72020-05-14 20:28:31 +02001824 {
Jonny Svärd136810f2021-10-13 16:04:26 +02001825 NPU_NAMESPACE::state value = static_cast<NPU_NAMESPACE::state>(((1U << 1) - 1) & (word0 >> 0));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02001826 return value;
1827 }
Jonny Svärd136810f2021-10-13 16:04:26 +02001828 NPU_NAMESPACE::state get_state() const volatile
Douglas Troha2e7e3b72020-05-14 20:28:31 +02001829 {
Jonny Svärd136810f2021-10-13 16:04:26 +02001830 NPU_NAMESPACE::state value = static_cast<NPU_NAMESPACE::state>(((1U << 1) - 1) & (word0 >> 0));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02001831 return value;
1832 }
Jonny Svärd136810f2021-10-13 16:04:26 +02001833 CONSTEXPR status_r &set_state(NPU_NAMESPACE::state value)
Douglas Troha2e7e3b72020-05-14 20:28:31 +02001834 {
Jonny Svärd136810f2021-10-13 16:04:26 +02001835 word0 = (((~((1U << 1) - 1)) << 0) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 0);
Douglas Troha2e7e3b72020-05-14 20:28:31 +02001836 return *this;
1837 }
1838 CONSTEXPR uint32_t get_irq_raised() const
1839 {
Jonny Svärd136810f2021-10-13 16:04:26 +02001840 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 1));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02001841 return value;
1842 }
1843 uint32_t get_irq_raised() const volatile
1844 {
Jonny Svärd136810f2021-10-13 16:04:26 +02001845 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 1));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02001846 return value;
1847 }
1848 CONSTEXPR status_r &set_irq_raised(uint32_t value)
1849 {
Jonny Svärd136810f2021-10-13 16:04:26 +02001850 word0 = (((~((1U << 1) - 1)) << 1) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 1);
Douglas Troha2e7e3b72020-05-14 20:28:31 +02001851 return *this;
1852 }
1853 CONSTEXPR uint32_t get_bus_status() const
1854 {
Jonny Svärd136810f2021-10-13 16:04:26 +02001855 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 2));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02001856 return value;
1857 }
1858 uint32_t get_bus_status() const volatile
1859 {
Jonny Svärd136810f2021-10-13 16:04:26 +02001860 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 2));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02001861 return value;
1862 }
1863 CONSTEXPR status_r &set_bus_status(uint32_t value)
1864 {
Jonny Svärd136810f2021-10-13 16:04:26 +02001865 word0 = (((~((1U << 1) - 1)) << 2) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 2);
Douglas Troha2e7e3b72020-05-14 20:28:31 +02001866 return *this;
1867 }
1868 CONSTEXPR uint32_t get_reset_status() const
1869 {
Jonny Svärd136810f2021-10-13 16:04:26 +02001870 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 3));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02001871 return value;
1872 }
1873 uint32_t get_reset_status() const volatile
1874 {
Jonny Svärd136810f2021-10-13 16:04:26 +02001875 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 3));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02001876 return value;
1877 }
1878 CONSTEXPR status_r &set_reset_status(uint32_t value)
1879 {
Jonny Svärd136810f2021-10-13 16:04:26 +02001880 word0 = (((~((1U << 1) - 1)) << 3) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 3);
Douglas Troha2e7e3b72020-05-14 20:28:31 +02001881 return *this;
1882 }
1883 CONSTEXPR uint32_t get_cmd_parse_error() const
1884 {
Jonny Svärd136810f2021-10-13 16:04:26 +02001885 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 4));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02001886 return value;
1887 }
1888 uint32_t get_cmd_parse_error() const volatile
1889 {
Jonny Svärd136810f2021-10-13 16:04:26 +02001890 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 4));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02001891 return value;
1892 }
1893 CONSTEXPR status_r &set_cmd_parse_error(uint32_t value)
1894 {
Jonny Svärd136810f2021-10-13 16:04:26 +02001895 word0 = (((~((1U << 1) - 1)) << 4) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 4);
Douglas Troha2e7e3b72020-05-14 20:28:31 +02001896 return *this;
1897 }
1898 CONSTEXPR uint32_t get_cmd_end_reached() const
1899 {
Jonny Svärd136810f2021-10-13 16:04:26 +02001900 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 5));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02001901 return value;
1902 }
1903 uint32_t get_cmd_end_reached() const volatile
1904 {
Jonny Svärd136810f2021-10-13 16:04:26 +02001905 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 5));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02001906 return value;
1907 }
1908 CONSTEXPR status_r &set_cmd_end_reached(uint32_t value)
1909 {
Jonny Svärd136810f2021-10-13 16:04:26 +02001910 word0 = (((~((1U << 1) - 1)) << 5) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 5);
Douglas Troha2e7e3b72020-05-14 20:28:31 +02001911 return *this;
1912 }
1913 CONSTEXPR uint32_t get_pmu_irq_raised() const
1914 {
Jonny Svärd136810f2021-10-13 16:04:26 +02001915 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 6));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02001916 return value;
1917 }
1918 uint32_t get_pmu_irq_raised() const volatile
1919 {
Jonny Svärd136810f2021-10-13 16:04:26 +02001920 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 6));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02001921 return value;
1922 }
1923 CONSTEXPR status_r &set_pmu_irq_raised(uint32_t value)
1924 {
Jonny Svärd136810f2021-10-13 16:04:26 +02001925 word0 = (((~((1U << 1) - 1)) << 6) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 6);
Douglas Troha2e7e3b72020-05-14 20:28:31 +02001926 return *this;
1927 }
1928 CONSTEXPR uint32_t get_wd_fault() const
1929 {
Jonny Svärd136810f2021-10-13 16:04:26 +02001930 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 7));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02001931 return value;
1932 }
1933 uint32_t get_wd_fault() const volatile
1934 {
Jonny Svärd136810f2021-10-13 16:04:26 +02001935 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 7));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02001936 return value;
1937 }
1938 CONSTEXPR status_r &set_wd_fault(uint32_t value)
1939 {
Jonny Svärd136810f2021-10-13 16:04:26 +02001940 word0 = (((~((1U << 1) - 1)) << 7) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 7);
Douglas Troha2e7e3b72020-05-14 20:28:31 +02001941 return *this;
1942 }
Stefan Nannessone2e70242020-08-19 16:01:29 +02001943 CONSTEXPR uint32_t get_ecc_fault() const
1944 {
Jonny Svärd136810f2021-10-13 16:04:26 +02001945 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 8));
Stefan Nannessone2e70242020-08-19 16:01:29 +02001946 return value;
1947 }
1948 uint32_t get_ecc_fault() const volatile
1949 {
Jonny Svärd136810f2021-10-13 16:04:26 +02001950 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 8));
Stefan Nannessone2e70242020-08-19 16:01:29 +02001951 return value;
1952 }
1953 CONSTEXPR status_r &set_ecc_fault(uint32_t value)
1954 {
Jonny Svärd136810f2021-10-13 16:04:26 +02001955 word0 = (((~((1U << 1) - 1)) << 8) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 8);
Stefan Nannessone2e70242020-08-19 16:01:29 +02001956 return *this;
1957 }
Jonny Svärd136810f2021-10-13 16:04:26 +02001958 CONSTEXPR NPU_NAMESPACE::dma_fault_src get_faulting_interface() const
Douglas Troha2e7e3b72020-05-14 20:28:31 +02001959 {
Jonny Svärd136810f2021-10-13 16:04:26 +02001960 NPU_NAMESPACE::dma_fault_src value = static_cast<NPU_NAMESPACE::dma_fault_src>(((1U << 1) - 1) & (word0 >> 11));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02001961 return value;
1962 }
Jonny Svärd136810f2021-10-13 16:04:26 +02001963 NPU_NAMESPACE::dma_fault_src get_faulting_interface() const volatile
Douglas Troha2e7e3b72020-05-14 20:28:31 +02001964 {
Jonny Svärd136810f2021-10-13 16:04:26 +02001965 NPU_NAMESPACE::dma_fault_src value = static_cast<NPU_NAMESPACE::dma_fault_src>(((1U << 1) - 1) & (word0 >> 11));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02001966 return value;
1967 }
Jonny Svärd136810f2021-10-13 16:04:26 +02001968 CONSTEXPR status_r &set_faulting_interface(NPU_NAMESPACE::dma_fault_src value)
Douglas Troha2e7e3b72020-05-14 20:28:31 +02001969 {
Jonny Svärd136810f2021-10-13 16:04:26 +02001970 word0 = (((~((1U << 1) - 1)) << 11) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 11);
Douglas Troha2e7e3b72020-05-14 20:28:31 +02001971 return *this;
1972 }
1973 CONSTEXPR uint32_t get_faulting_channel() const
1974 {
Jonny Svärd136810f2021-10-13 16:04:26 +02001975 uint32_t value = static_cast<uint32_t>(((1U << 4) - 1) & (word0 >> 12));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02001976 return value;
1977 }
1978 uint32_t get_faulting_channel() const volatile
1979 {
Jonny Svärd136810f2021-10-13 16:04:26 +02001980 uint32_t value = static_cast<uint32_t>(((1U << 4) - 1) & (word0 >> 12));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02001981 return value;
1982 }
1983 CONSTEXPR status_r &set_faulting_channel(uint32_t value)
1984 {
Jonny Svärd136810f2021-10-13 16:04:26 +02001985 word0 = (((~((1U << 4) - 1)) << 12) & word0) | ((((1U << 4) - 1) & static_cast<uint32_t>(value)) << 12);
Douglas Troha2e7e3b72020-05-14 20:28:31 +02001986 return *this;
1987 }
1988 CONSTEXPR uint32_t get_irq_history_mask() const
1989 {
Jonny Svärd136810f2021-10-13 16:04:26 +02001990 uint32_t value = static_cast<uint32_t>(((1U << 16) - 1) & (word0 >> 16));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02001991 return value;
1992 }
1993 uint32_t get_irq_history_mask() const volatile
1994 {
Jonny Svärd136810f2021-10-13 16:04:26 +02001995 uint32_t value = static_cast<uint32_t>(((1U << 16) - 1) & (word0 >> 16));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02001996 return value;
1997 }
1998 CONSTEXPR status_r &set_irq_history_mask(uint32_t value)
1999 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002000 word0 = (((~((1U << 16) - 1)) << 16) & word0) | ((((1U << 16) - 1) & static_cast<uint32_t>(value)) << 16);
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002001 return *this;
2002 }
Jonny Svärd136810f2021-10-13 16:04:26 +02002003#endif
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002004};
2005
2006// cmd_r - Command register, reads as last written command
2007struct cmd_r
2008{
Jonny Svärd136810f2021-10-13 16:04:26 +02002009#ifndef __cplusplus
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002010 union
2011 {
2012 struct
2013 {
2014 uint32_t transition_to_running_state : 1; // Write 1 to transition the NPU to running state. Writing 0 has
2015 // no effect
2016 uint32_t clear_irq : 1; // Write 1 to clear the IRQ status in the STATUS register. Writing 0 has no effect
2017 uint32_t clock_q_enable : 1; // Write 1 to this bit to enable clock off using clock q-interface and enable
Jonny Svärd136810f2021-10-13 16:04:26 +02002018 // the requester clock gate
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002019 uint32_t power_q_enable : 1; // Write 1 to this bit to enable power off using power q-interface
2020 uint32_t
2021 stop_request : 1; // Write 1 to this bit to request STOP after completing any already-started commands
2022 uint32_t reserved0 : 11;
2023 uint32_t clear_irq_history : 16; // Clears the IRQ history mask
2024 };
2025 uint32_t word;
2026 };
Jonny Svärd136810f2021-10-13 16:04:26 +02002027#else
2028 private:
2029 uint32_t word0;
2030
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002031 public:
Jonny Svärd136810f2021-10-13 16:04:26 +02002032 CONSTEXPR cmd_r() : word0(12) {}
2033 CONSTEXPR cmd_r(uint32_t init) : word0(init) {}
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002034 CONSTEXPR void operator=(uint32_t value)
2035 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002036 word0 = value;
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002037 }
2038 void operator=(uint32_t value) volatile
2039 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002040 word0 = value;
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002041 }
2042 CONSTEXPR operator uint32_t()
2043 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002044 return word0;
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002045 }
2046 operator uint32_t() volatile
2047 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002048 return word0;
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002049 }
2050 cmd_r copy() volatile
2051 {
2052 return *this;
2053 }
2054 CONSTEXPR uint32_t get_transition_to_running_state() const
2055 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002056 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 0));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002057 return value;
2058 }
2059 uint32_t get_transition_to_running_state() const volatile
2060 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002061 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 0));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002062 return value;
2063 }
2064 CONSTEXPR cmd_r &set_transition_to_running_state(uint32_t value)
2065 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002066 word0 = (((~((1U << 1) - 1)) << 0) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 0);
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002067 return *this;
2068 }
2069 CONSTEXPR uint32_t get_clear_irq() const
2070 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002071 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 1));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002072 return value;
2073 }
2074 uint32_t get_clear_irq() const volatile
2075 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002076 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 1));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002077 return value;
2078 }
2079 CONSTEXPR cmd_r &set_clear_irq(uint32_t value)
2080 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002081 word0 = (((~((1U << 1) - 1)) << 1) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 1);
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002082 return *this;
2083 }
2084 CONSTEXPR uint32_t get_clock_q_enable() const
2085 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002086 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 2));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002087 return value;
2088 }
2089 uint32_t get_clock_q_enable() const volatile
2090 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002091 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 2));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002092 return value;
2093 }
2094 CONSTEXPR cmd_r &set_clock_q_enable(uint32_t value)
2095 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002096 word0 = (((~((1U << 1) - 1)) << 2) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 2);
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002097 return *this;
2098 }
2099 CONSTEXPR uint32_t get_power_q_enable() const
2100 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002101 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 3));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002102 return value;
2103 }
2104 uint32_t get_power_q_enable() const volatile
2105 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002106 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 3));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002107 return value;
2108 }
2109 CONSTEXPR cmd_r &set_power_q_enable(uint32_t value)
2110 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002111 word0 = (((~((1U << 1) - 1)) << 3) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 3);
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002112 return *this;
2113 }
2114 CONSTEXPR uint32_t get_stop_request() const
2115 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002116 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 4));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002117 return value;
2118 }
2119 uint32_t get_stop_request() const volatile
2120 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002121 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 4));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002122 return value;
2123 }
2124 CONSTEXPR cmd_r &set_stop_request(uint32_t value)
2125 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002126 word0 = (((~((1U << 1) - 1)) << 4) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 4);
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002127 return *this;
2128 }
2129 CONSTEXPR uint32_t get_clear_irq_history() const
2130 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002131 uint32_t value = static_cast<uint32_t>(((1U << 16) - 1) & (word0 >> 16));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002132 return value;
2133 }
2134 uint32_t get_clear_irq_history() const volatile
2135 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002136 uint32_t value = static_cast<uint32_t>(((1U << 16) - 1) & (word0 >> 16));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002137 return value;
2138 }
2139 CONSTEXPR cmd_r &set_clear_irq_history(uint32_t value)
2140 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002141 word0 = (((~((1U << 16) - 1)) << 16) & word0) | ((((1U << 16) - 1) & static_cast<uint32_t>(value)) << 16);
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002142 return *this;
2143 }
Jonny Svärd136810f2021-10-13 16:04:26 +02002144#endif
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002145};
2146
2147// reset_r - Request Reset and new security mode
2148struct reset_r
2149{
Jonny Svärd136810f2021-10-13 16:04:26 +02002150#ifndef __cplusplus
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002151 union
2152 {
2153 struct
2154 {
2155 uint32_t pending_CPL : 1; // Current privilege level 0=User 1=Privileged
2156 uint32_t pending_CSL : 1; // Current security level 0=Secure 1=Non secure
2157 uint32_t reserved0 : 30;
2158 };
2159 uint32_t word;
2160 };
Jonny Svärd136810f2021-10-13 16:04:26 +02002161#else
2162 private:
2163 uint32_t word0;
2164
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002165 public:
Jonny Svärd136810f2021-10-13 16:04:26 +02002166 CONSTEXPR reset_r() : word0(0) {}
2167 CONSTEXPR reset_r(uint32_t init) : word0(init) {}
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002168 CONSTEXPR void operator=(uint32_t value)
2169 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002170 word0 = value;
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002171 }
2172 void operator=(uint32_t value) volatile
2173 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002174 word0 = value;
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002175 }
2176 CONSTEXPR operator uint32_t()
2177 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002178 return word0;
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002179 }
2180 operator uint32_t() volatile
2181 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002182 return word0;
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002183 }
2184 reset_r copy() volatile
2185 {
2186 return *this;
2187 }
Jonny Svärd136810f2021-10-13 16:04:26 +02002188 CONSTEXPR NPU_NAMESPACE::privilege_level get_pending_CPL() const
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002189 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002190 NPU_NAMESPACE::privilege_level value =
2191 static_cast<NPU_NAMESPACE::privilege_level>(((1U << 1) - 1) & (word0 >> 0));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002192 return value;
2193 }
Jonny Svärd136810f2021-10-13 16:04:26 +02002194 NPU_NAMESPACE::privilege_level get_pending_CPL() const volatile
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002195 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002196 NPU_NAMESPACE::privilege_level value =
2197 static_cast<NPU_NAMESPACE::privilege_level>(((1U << 1) - 1) & (word0 >> 0));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002198 return value;
2199 }
Jonny Svärd136810f2021-10-13 16:04:26 +02002200 CONSTEXPR reset_r &set_pending_CPL(NPU_NAMESPACE::privilege_level value)
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002201 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002202 word0 = (((~((1U << 1) - 1)) << 0) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 0);
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002203 return *this;
2204 }
Jonny Svärd136810f2021-10-13 16:04:26 +02002205 CONSTEXPR NPU_NAMESPACE::security_level get_pending_CSL() const
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002206 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002207 NPU_NAMESPACE::security_level value =
2208 static_cast<NPU_NAMESPACE::security_level>(((1U << 1) - 1) & (word0 >> 1));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002209 return value;
2210 }
Jonny Svärd136810f2021-10-13 16:04:26 +02002211 NPU_NAMESPACE::security_level get_pending_CSL() const volatile
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002212 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002213 NPU_NAMESPACE::security_level value =
2214 static_cast<NPU_NAMESPACE::security_level>(((1U << 1) - 1) & (word0 >> 1));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002215 return value;
2216 }
Jonny Svärd136810f2021-10-13 16:04:26 +02002217 CONSTEXPR reset_r &set_pending_CSL(NPU_NAMESPACE::security_level value)
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002218 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002219 word0 = (((~((1U << 1) - 1)) << 1) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 1);
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002220 return *this;
2221 }
Jonny Svärd136810f2021-10-13 16:04:26 +02002222#endif
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002223};
2224
Jonny Svärd136810f2021-10-13 16:04:26 +02002225// qbase_r - Base address of command queue. The address is 4 byte aligned
2226struct qbase_r
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002227{
Jonny Svärd136810f2021-10-13 16:04:26 +02002228#ifndef __cplusplus
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002229 union
2230 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002231 struct
2232 {
2233 uint32_t offset : 32; // Offset
2234 uint32_t reserved0 : 32;
2235 };
2236 uint32_t word[2];
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002237 };
Jonny Svärd136810f2021-10-13 16:04:26 +02002238#else
2239 private:
2240 uint32_t word0;
2241 uint32_t word1;
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002242
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002243 public:
Jonny Svärd136810f2021-10-13 16:04:26 +02002244 CONSTEXPR qbase_r() : word0(0), word1(0) {}
2245 CONSTEXPR qbase_r(uint64_t init) :
2246 word0(static_cast<uint32_t>((init) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()))),
2247 word1(static_cast<uint32_t>((init >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max())))
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002248 {
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002249 }
Jonny Svärd136810f2021-10-13 16:04:26 +02002250 CONSTEXPR void operator=(uint64_t value)
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002251 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002252 word0 = static_cast<uint32_t>((value) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
2253 word1 = static_cast<uint32_t>((value >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002254 }
Jonny Svärd136810f2021-10-13 16:04:26 +02002255 void operator=(uint64_t value) volatile
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002256 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002257 word0 = static_cast<uint32_t>((value) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
2258 word1 = static_cast<uint32_t>((value >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002259 }
Jonny Svärd136810f2021-10-13 16:04:26 +02002260 CONSTEXPR operator uint64_t()
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002261 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002262 return (static_cast<uint64_t>(word1) << 32) | word0;
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002263 }
Jonny Svärd136810f2021-10-13 16:04:26 +02002264 operator uint64_t() volatile
2265 {
2266 return (static_cast<uint64_t>(word1) << 32) | word0;
2267 }
2268 qbase_r copy() volatile
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002269 {
2270 return *this;
2271 }
Jonny Svärd136810f2021-10-13 16:04:26 +02002272#endif
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002273};
2274
2275// qread_r - Read offset in the command stream in bytes. Multiple of 4 in the range 0 to 16 MB
2276struct qread_r
2277{
Jonny Svärd136810f2021-10-13 16:04:26 +02002278#ifndef __cplusplus
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002279 union
2280 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002281 struct
2282 {
2283 uint32_t QREAD : 32; // The read offset of the current command under execution
2284 };
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002285 uint32_t word;
2286 };
Jonny Svärd136810f2021-10-13 16:04:26 +02002287#else
2288 private:
2289 uint32_t word0;
2290
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002291 public:
Jonny Svärd136810f2021-10-13 16:04:26 +02002292 CONSTEXPR qread_r() : word0(0) {}
2293 CONSTEXPR qread_r(uint32_t init) : word0(init) {}
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002294 CONSTEXPR void operator=(uint32_t value)
2295 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002296 word0 = value;
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002297 }
2298 void operator=(uint32_t value) volatile
2299 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002300 word0 = value;
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002301 }
2302 CONSTEXPR operator uint32_t()
2303 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002304 return word0;
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002305 }
2306 operator uint32_t() volatile
2307 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002308 return word0;
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002309 }
2310 qread_r copy() volatile
2311 {
2312 return *this;
2313 }
2314 CONSTEXPR uint32_t get_QREAD() const
2315 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002316 uint32_t value = static_cast<uint32_t>(word0);
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002317 return value;
2318 }
2319 uint32_t get_QREAD() const volatile
2320 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002321 uint32_t value = static_cast<uint32_t>(word0);
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002322 return value;
2323 }
2324 CONSTEXPR qread_r &set_QREAD(uint32_t value)
2325 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002326 word0 = static_cast<uint32_t>(value);
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002327 return *this;
2328 }
Jonny Svärd136810f2021-10-13 16:04:26 +02002329#endif
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002330};
2331
2332// qconfig_r - AXI configuration for the command stream in the range 0-3. Same encoding as for REGIONCFG
2333struct qconfig_r
2334{
Jonny Svärd136810f2021-10-13 16:04:26 +02002335#ifndef __cplusplus
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002336 union
2337 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002338 struct
2339 {
2340 uint32_t cmd_region0 : 2; // Command region configuration
2341 uint32_t reserved0 : 30;
2342 };
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002343 uint32_t word;
2344 };
Jonny Svärd136810f2021-10-13 16:04:26 +02002345#else
2346 private:
2347 uint32_t word0;
2348
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002349 public:
Jonny Svärd136810f2021-10-13 16:04:26 +02002350 CONSTEXPR qconfig_r() : word0(0) {}
2351 CONSTEXPR qconfig_r(uint32_t init) : word0(init) {}
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002352 CONSTEXPR void operator=(uint32_t value)
2353 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002354 word0 = value;
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002355 }
2356 void operator=(uint32_t value) volatile
2357 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002358 word0 = value;
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002359 }
2360 CONSTEXPR operator uint32_t()
2361 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002362 return word0;
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002363 }
2364 operator uint32_t() volatile
2365 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002366 return word0;
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002367 }
2368 qconfig_r copy() volatile
2369 {
2370 return *this;
2371 }
Jonny Svärd136810f2021-10-13 16:04:26 +02002372 CONSTEXPR NPU_NAMESPACE::mem_attr get_cmd_region0() const
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002373 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002374 NPU_NAMESPACE::mem_attr value = static_cast<NPU_NAMESPACE::mem_attr>(((1U << 2) - 1) & (word0 >> 0));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002375 return value;
2376 }
Jonny Svärd136810f2021-10-13 16:04:26 +02002377 NPU_NAMESPACE::mem_attr get_cmd_region0() const volatile
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002378 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002379 NPU_NAMESPACE::mem_attr value = static_cast<NPU_NAMESPACE::mem_attr>(((1U << 2) - 1) & (word0 >> 0));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002380 return value;
2381 }
Jonny Svärd136810f2021-10-13 16:04:26 +02002382 CONSTEXPR qconfig_r &set_cmd_region0(NPU_NAMESPACE::mem_attr value)
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002383 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002384 word0 = (((~((1U << 2) - 1)) << 0) & word0) | ((((1U << 2) - 1) & static_cast<uint32_t>(value)) << 0);
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002385 return *this;
2386 }
Jonny Svärd136810f2021-10-13 16:04:26 +02002387#endif
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002388};
2389
2390// qsize_r - Size of the command stream in bytes. Multiple of 4 in the range 0 to 16 MB
2391struct qsize_r
2392{
Jonny Svärd136810f2021-10-13 16:04:26 +02002393#ifndef __cplusplus
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002394 union
2395 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002396 struct
2397 {
2398 uint32_t QSIZE : 32; // Size of the next command stream to be executed by the NPU
2399 };
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002400 uint32_t word;
2401 };
Jonny Svärd136810f2021-10-13 16:04:26 +02002402#else
2403 private:
2404 uint32_t word0;
2405
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002406 public:
Jonny Svärd136810f2021-10-13 16:04:26 +02002407 CONSTEXPR qsize_r() : word0(0) {}
2408 CONSTEXPR qsize_r(uint32_t init) : word0(init) {}
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002409 CONSTEXPR void operator=(uint32_t value)
2410 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002411 word0 = value;
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002412 }
2413 void operator=(uint32_t value) volatile
2414 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002415 word0 = value;
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002416 }
2417 CONSTEXPR operator uint32_t()
2418 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002419 return word0;
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002420 }
2421 operator uint32_t() volatile
2422 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002423 return word0;
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002424 }
2425 qsize_r copy() volatile
2426 {
2427 return *this;
2428 }
2429 CONSTEXPR uint32_t get_QSIZE() const
2430 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002431 uint32_t value = static_cast<uint32_t>(word0);
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002432 return value;
2433 }
2434 uint32_t get_QSIZE() const volatile
2435 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002436 uint32_t value = static_cast<uint32_t>(word0);
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002437 return value;
2438 }
2439 CONSTEXPR qsize_r &set_QSIZE(uint32_t value)
2440 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002441 word0 = static_cast<uint32_t>(value);
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002442 return *this;
2443 }
Jonny Svärd136810f2021-10-13 16:04:26 +02002444#endif
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002445};
2446
Jonny Svärd136810f2021-10-13 16:04:26 +02002447// prot_r - Protection level configured for the NPU when acting as an AXI requester
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002448struct prot_r
2449{
Jonny Svärd136810f2021-10-13 16:04:26 +02002450#ifndef __cplusplus
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002451 union
2452 {
2453 struct
2454 {
2455 uint32_t active_CPL : 1; // Current privilege level 0=User 1=Privileged
2456 uint32_t active_CSL : 1; // Current security level 0=Secure 1=Non secure
2457 uint32_t reserved0 : 30;
2458 };
2459 uint32_t word;
2460 };
Jonny Svärd136810f2021-10-13 16:04:26 +02002461#else
2462 private:
2463 uint32_t word0;
2464
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002465 public:
Jonny Svärd136810f2021-10-13 16:04:26 +02002466 CONSTEXPR prot_r() : word0(0) {}
2467 CONSTEXPR prot_r(uint32_t init) : word0(init) {}
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002468 CONSTEXPR void operator=(uint32_t value)
2469 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002470 word0 = value;
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002471 }
2472 void operator=(uint32_t value) volatile
2473 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002474 word0 = value;
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002475 }
2476 CONSTEXPR operator uint32_t()
2477 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002478 return word0;
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002479 }
2480 operator uint32_t() volatile
2481 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002482 return word0;
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002483 }
2484 prot_r copy() volatile
2485 {
2486 return *this;
2487 }
Jonny Svärd136810f2021-10-13 16:04:26 +02002488 CONSTEXPR NPU_NAMESPACE::privilege_level get_active_CPL() const
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002489 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002490 NPU_NAMESPACE::privilege_level value =
2491 static_cast<NPU_NAMESPACE::privilege_level>(((1U << 1) - 1) & (word0 >> 0));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002492 return value;
2493 }
Jonny Svärd136810f2021-10-13 16:04:26 +02002494 NPU_NAMESPACE::privilege_level get_active_CPL() const volatile
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002495 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002496 NPU_NAMESPACE::privilege_level value =
2497 static_cast<NPU_NAMESPACE::privilege_level>(((1U << 1) - 1) & (word0 >> 0));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002498 return value;
2499 }
Jonny Svärd136810f2021-10-13 16:04:26 +02002500 CONSTEXPR prot_r &set_active_CPL(NPU_NAMESPACE::privilege_level value)
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002501 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002502 word0 = (((~((1U << 1) - 1)) << 0) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 0);
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002503 return *this;
2504 }
Jonny Svärd136810f2021-10-13 16:04:26 +02002505 CONSTEXPR NPU_NAMESPACE::security_level get_active_CSL() const
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002506 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002507 NPU_NAMESPACE::security_level value =
2508 static_cast<NPU_NAMESPACE::security_level>(((1U << 1) - 1) & (word0 >> 1));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002509 return value;
2510 }
Jonny Svärd136810f2021-10-13 16:04:26 +02002511 NPU_NAMESPACE::security_level get_active_CSL() const volatile
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002512 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002513 NPU_NAMESPACE::security_level value =
2514 static_cast<NPU_NAMESPACE::security_level>(((1U << 1) - 1) & (word0 >> 1));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002515 return value;
2516 }
Jonny Svärd136810f2021-10-13 16:04:26 +02002517 CONSTEXPR prot_r &set_active_CSL(NPU_NAMESPACE::security_level value)
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002518 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002519 word0 = (((~((1U << 1) - 1)) << 1) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 1);
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002520 return *this;
2521 }
Jonny Svärd136810f2021-10-13 16:04:26 +02002522#endif
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002523};
2524
2525// config_r - RTL configuration
2526struct config_r
2527{
Jonny Svärd136810f2021-10-13 16:04:26 +02002528#ifndef __cplusplus
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002529 union
2530 {
2531 struct
2532 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002533 uint32_t macs_per_cc : 4; // The log2(macs/clock cycle)
2534 uint32_t cmd_stream_version : 4; // command stream version accepted by this NPU
2535 uint32_t shram_size : 8; // Total size in KB of internal SHRAM
2536 uint32_t reserved0 : 10;
2537 uint32_t functional_safety : 1; // Functional safety configuration
2538 uint32_t custom_dma : 1; // Custom DMA configuration
2539 uint32_t product : 4; // Product configuration
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002540 };
2541 uint32_t word;
2542 };
Jonny Svärd136810f2021-10-13 16:04:26 +02002543#else
2544 private:
2545 uint32_t word0;
2546
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002547 public:
Jonny Svärd136810f2021-10-13 16:04:26 +02002548 CONSTEXPR config_r() : word0(0) {}
2549 CONSTEXPR config_r(uint32_t init) : word0(init) {}
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002550 CONSTEXPR void operator=(uint32_t value)
2551 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002552 word0 = value;
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002553 }
2554 void operator=(uint32_t value) volatile
2555 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002556 word0 = value;
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002557 }
2558 CONSTEXPR operator uint32_t()
2559 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002560 return word0;
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002561 }
2562 operator uint32_t() volatile
2563 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002564 return word0;
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002565 }
2566 config_r copy() volatile
2567 {
2568 return *this;
2569 }
Jonny Svärd136810f2021-10-13 16:04:26 +02002570 CONSTEXPR uint32_t get_macs_per_cc() const
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002571 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002572 uint32_t value = static_cast<uint32_t>(((1U << 4) - 1) & (word0 >> 0));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002573 return value;
2574 }
Jonny Svärd136810f2021-10-13 16:04:26 +02002575 uint32_t get_macs_per_cc() const volatile
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002576 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002577 uint32_t value = static_cast<uint32_t>(((1U << 4) - 1) & (word0 >> 0));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002578 return value;
2579 }
Jonny Svärd136810f2021-10-13 16:04:26 +02002580 CONSTEXPR config_r &set_macs_per_cc(uint32_t value)
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002581 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002582 word0 = (((~((1U << 4) - 1)) << 0) & word0) | ((((1U << 4) - 1) & static_cast<uint32_t>(value)) << 0);
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002583 return *this;
2584 }
2585 CONSTEXPR uint32_t get_cmd_stream_version() const
2586 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002587 uint32_t value = static_cast<uint32_t>(((1U << 4) - 1) & (word0 >> 4));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002588 return value;
2589 }
2590 uint32_t get_cmd_stream_version() const volatile
2591 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002592 uint32_t value = static_cast<uint32_t>(((1U << 4) - 1) & (word0 >> 4));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002593 return value;
2594 }
2595 CONSTEXPR config_r &set_cmd_stream_version(uint32_t value)
2596 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002597 word0 = (((~((1U << 4) - 1)) << 4) & word0) | ((((1U << 4) - 1) & static_cast<uint32_t>(value)) << 4);
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002598 return *this;
2599 }
Jonny Svärd136810f2021-10-13 16:04:26 +02002600 CONSTEXPR uint32_t get_shram_size() const
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002601 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002602 uint32_t value = static_cast<uint32_t>(((1U << 8) - 1) & (word0 >> 8));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002603 return value;
2604 }
Jonny Svärd136810f2021-10-13 16:04:26 +02002605 uint32_t get_shram_size() const volatile
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002606 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002607 uint32_t value = static_cast<uint32_t>(((1U << 8) - 1) & (word0 >> 8));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002608 return value;
2609 }
Jonny Svärd136810f2021-10-13 16:04:26 +02002610 CONSTEXPR config_r &set_shram_size(uint32_t value)
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002611 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002612 word0 = (((~((1U << 8) - 1)) << 8) & word0) | ((((1U << 8) - 1) & static_cast<uint32_t>(value)) << 8);
2613 return *this;
2614 }
2615 CONSTEXPR NPU_NAMESPACE::functional_safety get_functional_safety() const
2616 {
2617 NPU_NAMESPACE::functional_safety value =
2618 static_cast<NPU_NAMESPACE::functional_safety>(((1U << 1) - 1) & (word0 >> 26));
2619 return value;
2620 }
2621 NPU_NAMESPACE::functional_safety get_functional_safety() const volatile
2622 {
2623 NPU_NAMESPACE::functional_safety value =
2624 static_cast<NPU_NAMESPACE::functional_safety>(((1U << 1) - 1) & (word0 >> 26));
2625 return value;
2626 }
2627 CONSTEXPR config_r &set_functional_safety(NPU_NAMESPACE::functional_safety value)
2628 {
2629 word0 = (((~((1U << 1) - 1)) << 26) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 26);
2630 return *this;
2631 }
2632 CONSTEXPR NPU_NAMESPACE::custom_dma get_custom_dma() const
2633 {
2634 NPU_NAMESPACE::custom_dma value = static_cast<NPU_NAMESPACE::custom_dma>(((1U << 1) - 1) & (word0 >> 27));
2635 return value;
2636 }
2637 NPU_NAMESPACE::custom_dma get_custom_dma() const volatile
2638 {
2639 NPU_NAMESPACE::custom_dma value = static_cast<NPU_NAMESPACE::custom_dma>(((1U << 1) - 1) & (word0 >> 27));
2640 return value;
2641 }
2642 CONSTEXPR config_r &set_custom_dma(NPU_NAMESPACE::custom_dma value)
2643 {
2644 word0 = (((~((1U << 1) - 1)) << 27) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 27);
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002645 return *this;
2646 }
2647 CONSTEXPR uint32_t get_product() const
2648 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002649 uint32_t value = static_cast<uint32_t>(((1U << 4) - 1) & (word0 >> 28));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002650 return value;
2651 }
2652 uint32_t get_product() const volatile
2653 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002654 uint32_t value = static_cast<uint32_t>(((1U << 4) - 1) & (word0 >> 28));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002655 return value;
2656 }
2657 CONSTEXPR config_r &set_product(uint32_t value)
2658 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002659 word0 = (((~((1U << 4) - 1)) << 28) & word0) | ((((1U << 4) - 1) & static_cast<uint32_t>(value)) << 28);
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002660 return *this;
2661 }
Jonny Svärd136810f2021-10-13 16:04:26 +02002662#endif
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002663};
2664
2665// lock_r - Lock register. This register is designed for driver use and does not affect NPU functionality
2666struct lock_r
2667{
Jonny Svärd136810f2021-10-13 16:04:26 +02002668#ifndef __cplusplus
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002669 union
2670 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002671 struct
2672 {
2673 uint32_t LOCK : 32; // 32 bit value for LOCK configuration
2674 };
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002675 uint32_t word;
2676 };
Jonny Svärd136810f2021-10-13 16:04:26 +02002677#else
2678 private:
2679 uint32_t word0;
2680
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002681 public:
Jonny Svärd136810f2021-10-13 16:04:26 +02002682 CONSTEXPR lock_r() : word0(0) {}
2683 CONSTEXPR lock_r(uint32_t init) : word0(init) {}
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002684 CONSTEXPR void operator=(uint32_t value)
2685 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002686 word0 = value;
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002687 }
2688 void operator=(uint32_t value) volatile
2689 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002690 word0 = value;
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002691 }
2692 CONSTEXPR operator uint32_t()
2693 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002694 return word0;
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002695 }
2696 operator uint32_t() volatile
2697 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002698 return word0;
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002699 }
2700 lock_r copy() volatile
2701 {
2702 return *this;
2703 }
2704 CONSTEXPR uint32_t get_LOCK() const
2705 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002706 uint32_t value = static_cast<uint32_t>(word0);
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002707 return value;
2708 }
2709 uint32_t get_LOCK() const volatile
2710 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002711 uint32_t value = static_cast<uint32_t>(word0);
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002712 return value;
2713 }
2714 CONSTEXPR lock_r &set_LOCK(uint32_t value)
2715 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002716 word0 = static_cast<uint32_t>(value);
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002717 return *this;
2718 }
Jonny Svärd136810f2021-10-13 16:04:26 +02002719#endif
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002720};
2721
Stefan Nannessone2e70242020-08-19 16:01:29 +02002722// 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 +02002723struct regioncfg_r
2724{
Jonny Svärd136810f2021-10-13 16:04:26 +02002725#ifndef __cplusplus
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002726 union
2727 {
2728 struct
2729 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002730 uint32_t region0 : 2; // Bits for Region0 Configuration
2731 uint32_t region1 : 2; // Bits for Region1 Configuration
2732 uint32_t region2 : 2; // Bits for Region2 Configuration
2733 uint32_t region3 : 2; // Bits for Region3 Configuration
2734 uint32_t region4 : 2; // Bits for Region4 Configuration
2735 uint32_t region5 : 2; // Bits for Region5 Configuration
2736 uint32_t region6 : 2; // Bits for Region6 Configuration
2737 uint32_t region7 : 2; // Bits for Region7 Configuration
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002738 uint32_t reserved0 : 16;
2739 };
2740 uint32_t word;
2741 };
Jonny Svärd136810f2021-10-13 16:04:26 +02002742#else
2743 private:
2744 uint32_t word0;
2745
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002746 public:
Jonny Svärd136810f2021-10-13 16:04:26 +02002747 CONSTEXPR regioncfg_r() : word0(0) {}
2748 CONSTEXPR regioncfg_r(uint32_t init) : word0(init) {}
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002749 CONSTEXPR void operator=(uint32_t value)
2750 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002751 word0 = value;
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002752 }
2753 void operator=(uint32_t value) volatile
2754 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002755 word0 = value;
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002756 }
2757 CONSTEXPR operator uint32_t()
2758 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002759 return word0;
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002760 }
2761 operator uint32_t() volatile
2762 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002763 return word0;
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002764 }
2765 regioncfg_r copy() volatile
2766 {
2767 return *this;
2768 }
Jonny Svärd136810f2021-10-13 16:04:26 +02002769 CONSTEXPR NPU_NAMESPACE::mem_attr get_region0() const
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002770 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002771 NPU_NAMESPACE::mem_attr value = static_cast<NPU_NAMESPACE::mem_attr>(((1U << 2) - 1) & (word0 >> 0));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002772 return value;
2773 }
Jonny Svärd136810f2021-10-13 16:04:26 +02002774 NPU_NAMESPACE::mem_attr get_region0() const volatile
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002775 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002776 NPU_NAMESPACE::mem_attr value = static_cast<NPU_NAMESPACE::mem_attr>(((1U << 2) - 1) & (word0 >> 0));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002777 return value;
2778 }
Jonny Svärd136810f2021-10-13 16:04:26 +02002779 CONSTEXPR regioncfg_r &set_region0(NPU_NAMESPACE::mem_attr value)
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002780 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002781 word0 = (((~((1U << 2) - 1)) << 0) & word0) | ((((1U << 2) - 1) & static_cast<uint32_t>(value)) << 0);
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002782 return *this;
2783 }
Jonny Svärd136810f2021-10-13 16:04:26 +02002784 CONSTEXPR NPU_NAMESPACE::mem_attr get_region1() const
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002785 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002786 NPU_NAMESPACE::mem_attr value = static_cast<NPU_NAMESPACE::mem_attr>(((1U << 2) - 1) & (word0 >> 2));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002787 return value;
2788 }
Jonny Svärd136810f2021-10-13 16:04:26 +02002789 NPU_NAMESPACE::mem_attr get_region1() const volatile
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002790 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002791 NPU_NAMESPACE::mem_attr value = static_cast<NPU_NAMESPACE::mem_attr>(((1U << 2) - 1) & (word0 >> 2));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002792 return value;
2793 }
Jonny Svärd136810f2021-10-13 16:04:26 +02002794 CONSTEXPR regioncfg_r &set_region1(NPU_NAMESPACE::mem_attr value)
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002795 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002796 word0 = (((~((1U << 2) - 1)) << 2) & word0) | ((((1U << 2) - 1) & static_cast<uint32_t>(value)) << 2);
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002797 return *this;
2798 }
Jonny Svärd136810f2021-10-13 16:04:26 +02002799 CONSTEXPR NPU_NAMESPACE::mem_attr get_region2() const
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002800 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002801 NPU_NAMESPACE::mem_attr value = static_cast<NPU_NAMESPACE::mem_attr>(((1U << 2) - 1) & (word0 >> 4));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002802 return value;
2803 }
Jonny Svärd136810f2021-10-13 16:04:26 +02002804 NPU_NAMESPACE::mem_attr get_region2() const volatile
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002805 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002806 NPU_NAMESPACE::mem_attr value = static_cast<NPU_NAMESPACE::mem_attr>(((1U << 2) - 1) & (word0 >> 4));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002807 return value;
2808 }
Jonny Svärd136810f2021-10-13 16:04:26 +02002809 CONSTEXPR regioncfg_r &set_region2(NPU_NAMESPACE::mem_attr value)
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002810 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002811 word0 = (((~((1U << 2) - 1)) << 4) & word0) | ((((1U << 2) - 1) & static_cast<uint32_t>(value)) << 4);
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002812 return *this;
2813 }
Jonny Svärd136810f2021-10-13 16:04:26 +02002814 CONSTEXPR NPU_NAMESPACE::mem_attr get_region3() const
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002815 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002816 NPU_NAMESPACE::mem_attr value = static_cast<NPU_NAMESPACE::mem_attr>(((1U << 2) - 1) & (word0 >> 6));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002817 return value;
2818 }
Jonny Svärd136810f2021-10-13 16:04:26 +02002819 NPU_NAMESPACE::mem_attr get_region3() const volatile
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002820 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002821 NPU_NAMESPACE::mem_attr value = static_cast<NPU_NAMESPACE::mem_attr>(((1U << 2) - 1) & (word0 >> 6));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002822 return value;
2823 }
Jonny Svärd136810f2021-10-13 16:04:26 +02002824 CONSTEXPR regioncfg_r &set_region3(NPU_NAMESPACE::mem_attr value)
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002825 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002826 word0 = (((~((1U << 2) - 1)) << 6) & word0) | ((((1U << 2) - 1) & static_cast<uint32_t>(value)) << 6);
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002827 return *this;
2828 }
Jonny Svärd136810f2021-10-13 16:04:26 +02002829 CONSTEXPR NPU_NAMESPACE::mem_attr get_region4() const
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002830 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002831 NPU_NAMESPACE::mem_attr value = static_cast<NPU_NAMESPACE::mem_attr>(((1U << 2) - 1) & (word0 >> 8));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002832 return value;
2833 }
Jonny Svärd136810f2021-10-13 16:04:26 +02002834 NPU_NAMESPACE::mem_attr get_region4() const volatile
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002835 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002836 NPU_NAMESPACE::mem_attr value = static_cast<NPU_NAMESPACE::mem_attr>(((1U << 2) - 1) & (word0 >> 8));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002837 return value;
2838 }
Jonny Svärd136810f2021-10-13 16:04:26 +02002839 CONSTEXPR regioncfg_r &set_region4(NPU_NAMESPACE::mem_attr value)
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002840 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002841 word0 = (((~((1U << 2) - 1)) << 8) & word0) | ((((1U << 2) - 1) & static_cast<uint32_t>(value)) << 8);
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002842 return *this;
2843 }
Jonny Svärd136810f2021-10-13 16:04:26 +02002844 CONSTEXPR NPU_NAMESPACE::mem_attr get_region5() const
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002845 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002846 NPU_NAMESPACE::mem_attr value = static_cast<NPU_NAMESPACE::mem_attr>(((1U << 2) - 1) & (word0 >> 10));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002847 return value;
2848 }
Jonny Svärd136810f2021-10-13 16:04:26 +02002849 NPU_NAMESPACE::mem_attr get_region5() const volatile
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002850 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002851 NPU_NAMESPACE::mem_attr value = static_cast<NPU_NAMESPACE::mem_attr>(((1U << 2) - 1) & (word0 >> 10));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002852 return value;
2853 }
Jonny Svärd136810f2021-10-13 16:04:26 +02002854 CONSTEXPR regioncfg_r &set_region5(NPU_NAMESPACE::mem_attr value)
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002855 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002856 word0 = (((~((1U << 2) - 1)) << 10) & word0) | ((((1U << 2) - 1) & static_cast<uint32_t>(value)) << 10);
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002857 return *this;
2858 }
Jonny Svärd136810f2021-10-13 16:04:26 +02002859 CONSTEXPR NPU_NAMESPACE::mem_attr get_region6() const
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002860 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002861 NPU_NAMESPACE::mem_attr value = static_cast<NPU_NAMESPACE::mem_attr>(((1U << 2) - 1) & (word0 >> 12));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002862 return value;
2863 }
Jonny Svärd136810f2021-10-13 16:04:26 +02002864 NPU_NAMESPACE::mem_attr get_region6() const volatile
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002865 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002866 NPU_NAMESPACE::mem_attr value = static_cast<NPU_NAMESPACE::mem_attr>(((1U << 2) - 1) & (word0 >> 12));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002867 return value;
2868 }
Jonny Svärd136810f2021-10-13 16:04:26 +02002869 CONSTEXPR regioncfg_r &set_region6(NPU_NAMESPACE::mem_attr value)
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002870 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002871 word0 = (((~((1U << 2) - 1)) << 12) & word0) | ((((1U << 2) - 1) & static_cast<uint32_t>(value)) << 12);
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002872 return *this;
2873 }
Jonny Svärd136810f2021-10-13 16:04:26 +02002874 CONSTEXPR NPU_NAMESPACE::mem_attr get_region7() const
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002875 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002876 NPU_NAMESPACE::mem_attr value = static_cast<NPU_NAMESPACE::mem_attr>(((1U << 2) - 1) & (word0 >> 14));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002877 return value;
2878 }
Jonny Svärd136810f2021-10-13 16:04:26 +02002879 NPU_NAMESPACE::mem_attr get_region7() const volatile
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002880 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002881 NPU_NAMESPACE::mem_attr value = static_cast<NPU_NAMESPACE::mem_attr>(((1U << 2) - 1) & (word0 >> 14));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002882 return value;
2883 }
Jonny Svärd136810f2021-10-13 16:04:26 +02002884 CONSTEXPR regioncfg_r &set_region7(NPU_NAMESPACE::mem_attr value)
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002885 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002886 word0 = (((~((1U << 2) - 1)) << 14) & word0) | ((((1U << 2) - 1) & static_cast<uint32_t>(value)) << 14);
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002887 return *this;
2888 }
Jonny Svärd136810f2021-10-13 16:04:26 +02002889#endif
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002890};
2891
2892// axi_limit0_r - AXI limits for port 0 counter 0
2893struct axi_limit0_r
2894{
Jonny Svärd136810f2021-10-13 16:04:26 +02002895#ifndef __cplusplus
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002896 union
2897 {
2898 struct
2899 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002900 uint32_t max_beats : 2; // Burst split alignment
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002901 uint32_t reserved0 : 2;
Stefan Nannessone2e70242020-08-19 16:01:29 +02002902 uint32_t memtype : 4; // Memtype to be used to encode AxCACHE signals
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002903 uint32_t reserved1 : 8;
2904 uint32_t
Jonny Svärd136810f2021-10-13 16:04:26 +02002905 max_outstanding_read_m1 : 5; // Maximum number of outstanding AXI read transactions - 1 in range 0 to 31
2906 uint32_t reserved2 : 3;
2907 uint32_t max_outstanding_write_m1 : 4; // Maximum number of outstanding AXI write transactions - 1 in range
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002908 // 0 to 15
Jonny Svärd136810f2021-10-13 16:04:26 +02002909 uint32_t reserved3 : 4;
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002910 };
2911 uint32_t word;
2912 };
Jonny Svärd136810f2021-10-13 16:04:26 +02002913#else
2914 private:
2915 uint32_t word0;
2916
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002917 public:
Jonny Svärd136810f2021-10-13 16:04:26 +02002918 CONSTEXPR axi_limit0_r() : word0(0) {}
2919 CONSTEXPR axi_limit0_r(uint32_t init) : word0(init) {}
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002920 CONSTEXPR void operator=(uint32_t value)
2921 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002922 word0 = value;
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002923 }
2924 void operator=(uint32_t value) volatile
2925 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002926 word0 = value;
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002927 }
2928 CONSTEXPR operator uint32_t()
2929 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002930 return word0;
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002931 }
2932 operator uint32_t() volatile
2933 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002934 return word0;
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002935 }
2936 axi_limit0_r copy() volatile
2937 {
2938 return *this;
2939 }
Jonny Svärd136810f2021-10-13 16:04:26 +02002940 CONSTEXPR NPU_NAMESPACE::max_beats get_max_beats() const
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002941 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002942 NPU_NAMESPACE::max_beats value = static_cast<NPU_NAMESPACE::max_beats>(((1U << 2) - 1) & (word0 >> 0));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002943 return value;
2944 }
Jonny Svärd136810f2021-10-13 16:04:26 +02002945 NPU_NAMESPACE::max_beats get_max_beats() const volatile
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002946 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002947 NPU_NAMESPACE::max_beats value = static_cast<NPU_NAMESPACE::max_beats>(((1U << 2) - 1) & (word0 >> 0));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002948 return value;
2949 }
Jonny Svärd136810f2021-10-13 16:04:26 +02002950 CONSTEXPR axi_limit0_r &set_max_beats(NPU_NAMESPACE::max_beats value)
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002951 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002952 word0 = (((~((1U << 2) - 1)) << 0) & word0) | ((((1U << 2) - 1) & static_cast<uint32_t>(value)) << 0);
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002953 return *this;
2954 }
Jonny Svärd136810f2021-10-13 16:04:26 +02002955 CONSTEXPR NPU_NAMESPACE::axi_mem_encoding get_memtype() const
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002956 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002957 NPU_NAMESPACE::axi_mem_encoding value =
2958 static_cast<NPU_NAMESPACE::axi_mem_encoding>(((1U << 4) - 1) & (word0 >> 4));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002959 return value;
2960 }
Jonny Svärd136810f2021-10-13 16:04:26 +02002961 NPU_NAMESPACE::axi_mem_encoding get_memtype() const volatile
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002962 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002963 NPU_NAMESPACE::axi_mem_encoding value =
2964 static_cast<NPU_NAMESPACE::axi_mem_encoding>(((1U << 4) - 1) & (word0 >> 4));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002965 return value;
2966 }
Jonny Svärd136810f2021-10-13 16:04:26 +02002967 CONSTEXPR axi_limit0_r &set_memtype(NPU_NAMESPACE::axi_mem_encoding value)
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002968 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002969 word0 = (((~((1U << 4) - 1)) << 4) & word0) | ((((1U << 4) - 1) & static_cast<uint32_t>(value)) << 4);
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002970 return *this;
2971 }
2972 CONSTEXPR uint32_t get_max_outstanding_read_m1() const
2973 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002974 uint32_t value = static_cast<uint32_t>(((1U << 5) - 1) & (word0 >> 16));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002975 return value;
2976 }
2977 uint32_t get_max_outstanding_read_m1() const volatile
2978 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002979 uint32_t value = static_cast<uint32_t>(((1U << 5) - 1) & (word0 >> 16));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002980 return value;
2981 }
2982 CONSTEXPR axi_limit0_r &set_max_outstanding_read_m1(uint32_t value)
2983 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002984 word0 = (((~((1U << 5) - 1)) << 16) & word0) | ((((1U << 5) - 1) & static_cast<uint32_t>(value)) << 16);
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002985 return *this;
2986 }
2987 CONSTEXPR uint32_t get_max_outstanding_write_m1() const
2988 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002989 uint32_t value = static_cast<uint32_t>(((1U << 4) - 1) & (word0 >> 24));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002990 return value;
2991 }
2992 uint32_t get_max_outstanding_write_m1() const volatile
2993 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002994 uint32_t value = static_cast<uint32_t>(((1U << 4) - 1) & (word0 >> 24));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02002995 return value;
2996 }
2997 CONSTEXPR axi_limit0_r &set_max_outstanding_write_m1(uint32_t value)
2998 {
Jonny Svärd136810f2021-10-13 16:04:26 +02002999 word0 = (((~((1U << 4) - 1)) << 24) & word0) | ((((1U << 4) - 1) & static_cast<uint32_t>(value)) << 24);
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003000 return *this;
3001 }
Jonny Svärd136810f2021-10-13 16:04:26 +02003002#endif
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003003};
3004
3005// axi_limit1_r - AXI limits for port 0 counter 1
3006struct axi_limit1_r
3007{
Jonny Svärd136810f2021-10-13 16:04:26 +02003008#ifndef __cplusplus
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003009 union
3010 {
3011 struct
3012 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003013 uint32_t max_beats : 2; // Burst split alignment
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003014 uint32_t reserved0 : 2;
Stefan Nannessone2e70242020-08-19 16:01:29 +02003015 uint32_t memtype : 4; // Memtype to be used to encode AxCACHE signals
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003016 uint32_t reserved1 : 8;
3017 uint32_t
Jonny Svärd136810f2021-10-13 16:04:26 +02003018 max_outstanding_read_m1 : 5; // Maximum number of outstanding AXI read transactions - 1 in range 0 to 31
3019 uint32_t reserved2 : 3;
3020 uint32_t max_outstanding_write_m1 : 4; // Maximum number of outstanding AXI write transactions - 1 in range
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003021 // 0 to 15
Jonny Svärd136810f2021-10-13 16:04:26 +02003022 uint32_t reserved3 : 4;
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003023 };
3024 uint32_t word;
3025 };
Jonny Svärd136810f2021-10-13 16:04:26 +02003026#else
3027 private:
3028 uint32_t word0;
3029
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003030 public:
Jonny Svärd136810f2021-10-13 16:04:26 +02003031 CONSTEXPR axi_limit1_r() : word0(0) {}
3032 CONSTEXPR axi_limit1_r(uint32_t init) : word0(init) {}
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003033 CONSTEXPR void operator=(uint32_t value)
3034 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003035 word0 = value;
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003036 }
3037 void operator=(uint32_t value) volatile
3038 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003039 word0 = value;
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003040 }
3041 CONSTEXPR operator uint32_t()
3042 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003043 return word0;
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003044 }
3045 operator uint32_t() volatile
3046 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003047 return word0;
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003048 }
3049 axi_limit1_r copy() volatile
3050 {
3051 return *this;
3052 }
Jonny Svärd136810f2021-10-13 16:04:26 +02003053 CONSTEXPR NPU_NAMESPACE::max_beats get_max_beats() const
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003054 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003055 NPU_NAMESPACE::max_beats value = static_cast<NPU_NAMESPACE::max_beats>(((1U << 2) - 1) & (word0 >> 0));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003056 return value;
3057 }
Jonny Svärd136810f2021-10-13 16:04:26 +02003058 NPU_NAMESPACE::max_beats get_max_beats() const volatile
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003059 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003060 NPU_NAMESPACE::max_beats value = static_cast<NPU_NAMESPACE::max_beats>(((1U << 2) - 1) & (word0 >> 0));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003061 return value;
3062 }
Jonny Svärd136810f2021-10-13 16:04:26 +02003063 CONSTEXPR axi_limit1_r &set_max_beats(NPU_NAMESPACE::max_beats value)
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003064 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003065 word0 = (((~((1U << 2) - 1)) << 0) & word0) | ((((1U << 2) - 1) & static_cast<uint32_t>(value)) << 0);
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003066 return *this;
3067 }
Jonny Svärd136810f2021-10-13 16:04:26 +02003068 CONSTEXPR NPU_NAMESPACE::axi_mem_encoding get_memtype() const
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003069 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003070 NPU_NAMESPACE::axi_mem_encoding value =
3071 static_cast<NPU_NAMESPACE::axi_mem_encoding>(((1U << 4) - 1) & (word0 >> 4));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003072 return value;
3073 }
Jonny Svärd136810f2021-10-13 16:04:26 +02003074 NPU_NAMESPACE::axi_mem_encoding get_memtype() const volatile
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003075 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003076 NPU_NAMESPACE::axi_mem_encoding value =
3077 static_cast<NPU_NAMESPACE::axi_mem_encoding>(((1U << 4) - 1) & (word0 >> 4));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003078 return value;
3079 }
Jonny Svärd136810f2021-10-13 16:04:26 +02003080 CONSTEXPR axi_limit1_r &set_memtype(NPU_NAMESPACE::axi_mem_encoding value)
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003081 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003082 word0 = (((~((1U << 4) - 1)) << 4) & word0) | ((((1U << 4) - 1) & static_cast<uint32_t>(value)) << 4);
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003083 return *this;
3084 }
3085 CONSTEXPR uint32_t get_max_outstanding_read_m1() const
3086 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003087 uint32_t value = static_cast<uint32_t>(((1U << 5) - 1) & (word0 >> 16));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003088 return value;
3089 }
3090 uint32_t get_max_outstanding_read_m1() const volatile
3091 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003092 uint32_t value = static_cast<uint32_t>(((1U << 5) - 1) & (word0 >> 16));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003093 return value;
3094 }
3095 CONSTEXPR axi_limit1_r &set_max_outstanding_read_m1(uint32_t value)
3096 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003097 word0 = (((~((1U << 5) - 1)) << 16) & word0) | ((((1U << 5) - 1) & static_cast<uint32_t>(value)) << 16);
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003098 return *this;
3099 }
3100 CONSTEXPR uint32_t get_max_outstanding_write_m1() const
3101 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003102 uint32_t value = static_cast<uint32_t>(((1U << 4) - 1) & (word0 >> 24));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003103 return value;
3104 }
3105 uint32_t get_max_outstanding_write_m1() const volatile
3106 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003107 uint32_t value = static_cast<uint32_t>(((1U << 4) - 1) & (word0 >> 24));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003108 return value;
3109 }
3110 CONSTEXPR axi_limit1_r &set_max_outstanding_write_m1(uint32_t value)
3111 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003112 word0 = (((~((1U << 4) - 1)) << 24) & word0) | ((((1U << 4) - 1) & static_cast<uint32_t>(value)) << 24);
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003113 return *this;
3114 }
Jonny Svärd136810f2021-10-13 16:04:26 +02003115#endif
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003116};
3117
3118// axi_limit2_r - AXI limits for port 1 counter 2
3119struct axi_limit2_r
3120{
Jonny Svärd136810f2021-10-13 16:04:26 +02003121#ifndef __cplusplus
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003122 union
3123 {
3124 struct
3125 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003126 uint32_t max_beats : 2; // Burst split alignment
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003127 uint32_t reserved0 : 2;
Stefan Nannessone2e70242020-08-19 16:01:29 +02003128 uint32_t memtype : 4; // Memtype to be used to encode AxCACHE signals
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003129 uint32_t reserved1 : 8;
3130 uint32_t
Jonny Svärd136810f2021-10-13 16:04:26 +02003131 max_outstanding_read_m1 : 5; // Maximum number of outstanding AXI read transactions - 1 in range 0 to 31
3132 uint32_t reserved2 : 3;
3133 uint32_t max_outstanding_write_m1 : 4; // Maximum number of outstanding AXI write transactions - 1 in range
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003134 // 0 to 15
Jonny Svärd136810f2021-10-13 16:04:26 +02003135 uint32_t reserved3 : 4;
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003136 };
3137 uint32_t word;
3138 };
Jonny Svärd136810f2021-10-13 16:04:26 +02003139#else
3140 private:
3141 uint32_t word0;
3142
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003143 public:
Jonny Svärd136810f2021-10-13 16:04:26 +02003144 CONSTEXPR axi_limit2_r() : word0(0) {}
3145 CONSTEXPR axi_limit2_r(uint32_t init) : word0(init) {}
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003146 CONSTEXPR void operator=(uint32_t value)
3147 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003148 word0 = value;
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003149 }
3150 void operator=(uint32_t value) volatile
3151 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003152 word0 = value;
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003153 }
3154 CONSTEXPR operator uint32_t()
3155 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003156 return word0;
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003157 }
3158 operator uint32_t() volatile
3159 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003160 return word0;
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003161 }
3162 axi_limit2_r copy() volatile
3163 {
3164 return *this;
3165 }
Jonny Svärd136810f2021-10-13 16:04:26 +02003166 CONSTEXPR NPU_NAMESPACE::max_beats get_max_beats() const
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003167 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003168 NPU_NAMESPACE::max_beats value = static_cast<NPU_NAMESPACE::max_beats>(((1U << 2) - 1) & (word0 >> 0));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003169 return value;
3170 }
Jonny Svärd136810f2021-10-13 16:04:26 +02003171 NPU_NAMESPACE::max_beats get_max_beats() const volatile
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003172 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003173 NPU_NAMESPACE::max_beats value = static_cast<NPU_NAMESPACE::max_beats>(((1U << 2) - 1) & (word0 >> 0));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003174 return value;
3175 }
Jonny Svärd136810f2021-10-13 16:04:26 +02003176 CONSTEXPR axi_limit2_r &set_max_beats(NPU_NAMESPACE::max_beats value)
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003177 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003178 word0 = (((~((1U << 2) - 1)) << 0) & word0) | ((((1U << 2) - 1) & static_cast<uint32_t>(value)) << 0);
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003179 return *this;
3180 }
Jonny Svärd136810f2021-10-13 16:04:26 +02003181 CONSTEXPR NPU_NAMESPACE::axi_mem_encoding get_memtype() const
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003182 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003183 NPU_NAMESPACE::axi_mem_encoding value =
3184 static_cast<NPU_NAMESPACE::axi_mem_encoding>(((1U << 4) - 1) & (word0 >> 4));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003185 return value;
3186 }
Jonny Svärd136810f2021-10-13 16:04:26 +02003187 NPU_NAMESPACE::axi_mem_encoding get_memtype() const volatile
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003188 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003189 NPU_NAMESPACE::axi_mem_encoding value =
3190 static_cast<NPU_NAMESPACE::axi_mem_encoding>(((1U << 4) - 1) & (word0 >> 4));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003191 return value;
3192 }
Jonny Svärd136810f2021-10-13 16:04:26 +02003193 CONSTEXPR axi_limit2_r &set_memtype(NPU_NAMESPACE::axi_mem_encoding value)
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003194 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003195 word0 = (((~((1U << 4) - 1)) << 4) & word0) | ((((1U << 4) - 1) & static_cast<uint32_t>(value)) << 4);
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003196 return *this;
3197 }
3198 CONSTEXPR uint32_t get_max_outstanding_read_m1() const
3199 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003200 uint32_t value = static_cast<uint32_t>(((1U << 5) - 1) & (word0 >> 16));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003201 return value;
3202 }
3203 uint32_t get_max_outstanding_read_m1() const volatile
3204 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003205 uint32_t value = static_cast<uint32_t>(((1U << 5) - 1) & (word0 >> 16));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003206 return value;
3207 }
3208 CONSTEXPR axi_limit2_r &set_max_outstanding_read_m1(uint32_t value)
3209 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003210 word0 = (((~((1U << 5) - 1)) << 16) & word0) | ((((1U << 5) - 1) & static_cast<uint32_t>(value)) << 16);
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003211 return *this;
3212 }
3213 CONSTEXPR uint32_t get_max_outstanding_write_m1() const
3214 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003215 uint32_t value = static_cast<uint32_t>(((1U << 4) - 1) & (word0 >> 24));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003216 return value;
3217 }
3218 uint32_t get_max_outstanding_write_m1() const volatile
3219 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003220 uint32_t value = static_cast<uint32_t>(((1U << 4) - 1) & (word0 >> 24));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003221 return value;
3222 }
3223 CONSTEXPR axi_limit2_r &set_max_outstanding_write_m1(uint32_t value)
3224 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003225 word0 = (((~((1U << 4) - 1)) << 24) & word0) | ((((1U << 4) - 1) & static_cast<uint32_t>(value)) << 24);
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003226 return *this;
3227 }
Jonny Svärd136810f2021-10-13 16:04:26 +02003228#endif
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003229};
3230
3231// axi_limit3_r - AXI limits for port 1 counter 3
3232struct axi_limit3_r
3233{
Jonny Svärd136810f2021-10-13 16:04:26 +02003234#ifndef __cplusplus
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003235 union
3236 {
3237 struct
3238 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003239 uint32_t max_beats : 2; // Burst split alignment
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003240 uint32_t reserved0 : 2;
Stefan Nannessone2e70242020-08-19 16:01:29 +02003241 uint32_t memtype : 4; // Memtype to be used to encode AxCACHE signals
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003242 uint32_t reserved1 : 8;
3243 uint32_t
Jonny Svärd136810f2021-10-13 16:04:26 +02003244 max_outstanding_read_m1 : 5; // Maximum number of outstanding AXI read transactions - 1 in range 0 to 31
3245 uint32_t reserved2 : 3;
3246 uint32_t max_outstanding_write_m1 : 4; // Maximum number of outstanding AXI write transactions - 1 in range
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003247 // 0 to 15
Jonny Svärd136810f2021-10-13 16:04:26 +02003248 uint32_t reserved3 : 4;
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003249 };
3250 uint32_t word;
3251 };
Jonny Svärd136810f2021-10-13 16:04:26 +02003252#else
3253 private:
3254 uint32_t word0;
3255
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003256 public:
Jonny Svärd136810f2021-10-13 16:04:26 +02003257 CONSTEXPR axi_limit3_r() : word0(0) {}
3258 CONSTEXPR axi_limit3_r(uint32_t init) : word0(init) {}
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003259 CONSTEXPR void operator=(uint32_t value)
3260 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003261 word0 = value;
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003262 }
3263 void operator=(uint32_t value) volatile
3264 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003265 word0 = value;
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003266 }
3267 CONSTEXPR operator uint32_t()
3268 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003269 return word0;
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003270 }
3271 operator uint32_t() volatile
3272 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003273 return word0;
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003274 }
3275 axi_limit3_r copy() volatile
3276 {
3277 return *this;
3278 }
Jonny Svärd136810f2021-10-13 16:04:26 +02003279 CONSTEXPR NPU_NAMESPACE::max_beats get_max_beats() const
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003280 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003281 NPU_NAMESPACE::max_beats value = static_cast<NPU_NAMESPACE::max_beats>(((1U << 2) - 1) & (word0 >> 0));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003282 return value;
3283 }
Jonny Svärd136810f2021-10-13 16:04:26 +02003284 NPU_NAMESPACE::max_beats get_max_beats() const volatile
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003285 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003286 NPU_NAMESPACE::max_beats value = static_cast<NPU_NAMESPACE::max_beats>(((1U << 2) - 1) & (word0 >> 0));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003287 return value;
3288 }
Jonny Svärd136810f2021-10-13 16:04:26 +02003289 CONSTEXPR axi_limit3_r &set_max_beats(NPU_NAMESPACE::max_beats value)
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003290 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003291 word0 = (((~((1U << 2) - 1)) << 0) & word0) | ((((1U << 2) - 1) & static_cast<uint32_t>(value)) << 0);
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003292 return *this;
3293 }
Jonny Svärd136810f2021-10-13 16:04:26 +02003294 CONSTEXPR NPU_NAMESPACE::axi_mem_encoding get_memtype() const
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003295 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003296 NPU_NAMESPACE::axi_mem_encoding value =
3297 static_cast<NPU_NAMESPACE::axi_mem_encoding>(((1U << 4) - 1) & (word0 >> 4));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003298 return value;
3299 }
Jonny Svärd136810f2021-10-13 16:04:26 +02003300 NPU_NAMESPACE::axi_mem_encoding get_memtype() const volatile
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003301 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003302 NPU_NAMESPACE::axi_mem_encoding value =
3303 static_cast<NPU_NAMESPACE::axi_mem_encoding>(((1U << 4) - 1) & (word0 >> 4));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003304 return value;
3305 }
Jonny Svärd136810f2021-10-13 16:04:26 +02003306 CONSTEXPR axi_limit3_r &set_memtype(NPU_NAMESPACE::axi_mem_encoding value)
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003307 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003308 word0 = (((~((1U << 4) - 1)) << 4) & word0) | ((((1U << 4) - 1) & static_cast<uint32_t>(value)) << 4);
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003309 return *this;
3310 }
3311 CONSTEXPR uint32_t get_max_outstanding_read_m1() const
3312 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003313 uint32_t value = static_cast<uint32_t>(((1U << 5) - 1) & (word0 >> 16));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003314 return value;
3315 }
3316 uint32_t get_max_outstanding_read_m1() const volatile
3317 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003318 uint32_t value = static_cast<uint32_t>(((1U << 5) - 1) & (word0 >> 16));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003319 return value;
3320 }
3321 CONSTEXPR axi_limit3_r &set_max_outstanding_read_m1(uint32_t value)
3322 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003323 word0 = (((~((1U << 5) - 1)) << 16) & word0) | ((((1U << 5) - 1) & static_cast<uint32_t>(value)) << 16);
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003324 return *this;
3325 }
3326 CONSTEXPR uint32_t get_max_outstanding_write_m1() const
3327 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003328 uint32_t value = static_cast<uint32_t>(((1U << 4) - 1) & (word0 >> 24));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003329 return value;
3330 }
3331 uint32_t get_max_outstanding_write_m1() const volatile
3332 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003333 uint32_t value = static_cast<uint32_t>(((1U << 4) - 1) & (word0 >> 24));
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003334 return value;
3335 }
3336 CONSTEXPR axi_limit3_r &set_max_outstanding_write_m1(uint32_t value)
3337 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003338 word0 = (((~((1U << 4) - 1)) << 24) & word0) | ((((1U << 4) - 1) & static_cast<uint32_t>(value)) << 24);
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003339 return *this;
3340 }
Jonny Svärd136810f2021-10-13 16:04:26 +02003341#endif
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003342};
3343
Jonny Svärd136810f2021-10-13 16:04:26 +02003344// basep_r - The driver can use this address to relocate the command stream on region 0
3345struct basep_r
Douglas Troha2e7e3b72020-05-14 20:28:31 +02003346{
Jonny Svärd136810f2021-10-13 16:04:26 +02003347#ifndef __cplusplus
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003348 union
3349 {
3350 struct
3351 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003352 uint32_t offset : 32; // Offset
3353 uint32_t reserved0 : 32;
3354 };
3355 uint32_t word[2];
3356 };
3357#else
3358 private:
3359 uint32_t word0;
3360 uint32_t word1;
3361
3362 public:
3363 CONSTEXPR basep_r() : word0(0), word1(0) {}
3364 CONSTEXPR basep_r(uint64_t init) :
3365 word0(static_cast<uint32_t>((init) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()))),
3366 word1(static_cast<uint32_t>((init >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max())))
3367 {
3368 }
3369 CONSTEXPR void operator=(uint64_t value)
3370 {
3371 word0 = static_cast<uint32_t>((value) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
3372 word1 = static_cast<uint32_t>((value >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
3373 }
3374 void operator=(uint64_t value) volatile
3375 {
3376 word0 = static_cast<uint32_t>((value) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
3377 word1 = static_cast<uint32_t>((value >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
3378 }
3379 CONSTEXPR operator uint64_t()
3380 {
3381 return (static_cast<uint64_t>(word1) << 32) | word0;
3382 }
3383 operator uint64_t() volatile
3384 {
3385 return (static_cast<uint64_t>(word1) << 32) | word0;
3386 }
3387 basep_r copy() volatile
3388 {
3389 return *this;
3390 }
3391#endif
3392};
3393
3394// wd_status_r - WD_STATUS
3395struct wd_status_r
3396{
3397#ifndef __cplusplus
3398 union
3399 {
3400 struct
3401 {
3402 uint32_t core_slice_state : 2; // WD core slice parser state
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003403 uint32_t core_idle : 1; // Core idle
Jonny Svärd136810f2021-10-13 16:04:26 +02003404 uint32_t ctrl_state : 2; // WD control state
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003405 uint32_t ctrl_idle : 1; // All stripe jobs idle (all weights consumed)
3406 uint32_t write_buf_index0 : 3; // current write index for next data from core
3407 uint32_t write_buf_valid0 : 1; // write buf valid (full)
3408 uint32_t write_buf_idle0 : 1; // write buf idle (empty)
3409 uint32_t write_buf_index1 : 3; // current write index for next data from core
3410 uint32_t write_buf_valid1 : 1; // write buf valid (full)
3411 uint32_t write_buf_idle1 : 1; // write buf idle (empty)
3412 uint32_t events : 12; // WD events mapped as appendix A
3413 uint32_t reserved0 : 4;
3414 };
3415 uint32_t word;
3416 };
Jonny Svärd136810f2021-10-13 16:04:26 +02003417#else
3418 private:
3419 uint32_t word0;
3420
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003421 public:
Jonny Svärd136810f2021-10-13 16:04:26 +02003422 CONSTEXPR wd_status_r() : word0(0) {}
3423 CONSTEXPR wd_status_r(uint32_t init) : word0(init) {}
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003424 CONSTEXPR void operator=(uint32_t value)
3425 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003426 word0 = value;
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003427 }
3428 void operator=(uint32_t value) volatile
3429 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003430 word0 = value;
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003431 }
3432 CONSTEXPR operator uint32_t()
3433 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003434 return word0;
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003435 }
3436 operator uint32_t() volatile
3437 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003438 return word0;
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003439 }
3440 wd_status_r copy() volatile
3441 {
3442 return *this;
3443 }
Jonny Svärd136810f2021-10-13 16:04:26 +02003444 CONSTEXPR NPU_NAMESPACE::wd_core_slice_state get_core_slice_state() const
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003445 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003446 NPU_NAMESPACE::wd_core_slice_state value =
3447 static_cast<NPU_NAMESPACE::wd_core_slice_state>(((1U << 2) - 1) & (word0 >> 0));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003448 return value;
3449 }
Jonny Svärd136810f2021-10-13 16:04:26 +02003450 NPU_NAMESPACE::wd_core_slice_state get_core_slice_state() const volatile
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003451 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003452 NPU_NAMESPACE::wd_core_slice_state value =
3453 static_cast<NPU_NAMESPACE::wd_core_slice_state>(((1U << 2) - 1) & (word0 >> 0));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003454 return value;
3455 }
Jonny Svärd136810f2021-10-13 16:04:26 +02003456 CONSTEXPR wd_status_r &set_core_slice_state(NPU_NAMESPACE::wd_core_slice_state value)
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003457 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003458 word0 = (((~((1U << 2) - 1)) << 0) & word0) | ((((1U << 2) - 1) & static_cast<uint32_t>(value)) << 0);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003459 return *this;
3460 }
3461 CONSTEXPR uint32_t get_core_idle() const
3462 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003463 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 2));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003464 return value;
3465 }
3466 uint32_t get_core_idle() const volatile
3467 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003468 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 2));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003469 return value;
3470 }
3471 CONSTEXPR wd_status_r &set_core_idle(uint32_t value)
3472 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003473 word0 = (((~((1U << 1) - 1)) << 2) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 2);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003474 return *this;
3475 }
Jonny Svärd136810f2021-10-13 16:04:26 +02003476 CONSTEXPR NPU_NAMESPACE::wd_ctrl_state get_ctrl_state() const
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003477 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003478 NPU_NAMESPACE::wd_ctrl_state value = static_cast<NPU_NAMESPACE::wd_ctrl_state>(((1U << 2) - 1) & (word0 >> 3));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003479 return value;
3480 }
Jonny Svärd136810f2021-10-13 16:04:26 +02003481 NPU_NAMESPACE::wd_ctrl_state get_ctrl_state() const volatile
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003482 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003483 NPU_NAMESPACE::wd_ctrl_state value = static_cast<NPU_NAMESPACE::wd_ctrl_state>(((1U << 2) - 1) & (word0 >> 3));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003484 return value;
3485 }
Jonny Svärd136810f2021-10-13 16:04:26 +02003486 CONSTEXPR wd_status_r &set_ctrl_state(NPU_NAMESPACE::wd_ctrl_state value)
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003487 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003488 word0 = (((~((1U << 2) - 1)) << 3) & word0) | ((((1U << 2) - 1) & static_cast<uint32_t>(value)) << 3);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003489 return *this;
3490 }
3491 CONSTEXPR uint32_t get_ctrl_idle() const
3492 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003493 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 5));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003494 return value;
3495 }
3496 uint32_t get_ctrl_idle() const volatile
3497 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003498 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 5));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003499 return value;
3500 }
3501 CONSTEXPR wd_status_r &set_ctrl_idle(uint32_t value)
3502 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003503 word0 = (((~((1U << 1) - 1)) << 5) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 5);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003504 return *this;
3505 }
3506 CONSTEXPR uint32_t get_write_buf_index0() const
3507 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003508 uint32_t value = static_cast<uint32_t>(((1U << 3) - 1) & (word0 >> 6));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003509 return value;
3510 }
3511 uint32_t get_write_buf_index0() const volatile
3512 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003513 uint32_t value = static_cast<uint32_t>(((1U << 3) - 1) & (word0 >> 6));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003514 return value;
3515 }
3516 CONSTEXPR wd_status_r &set_write_buf_index0(uint32_t value)
3517 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003518 word0 = (((~((1U << 3) - 1)) << 6) & word0) | ((((1U << 3) - 1) & static_cast<uint32_t>(value)) << 6);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003519 return *this;
3520 }
3521 CONSTEXPR uint32_t get_write_buf_valid0() const
3522 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003523 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 9));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003524 return value;
3525 }
3526 uint32_t get_write_buf_valid0() const volatile
3527 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003528 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 9));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003529 return value;
3530 }
3531 CONSTEXPR wd_status_r &set_write_buf_valid0(uint32_t value)
3532 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003533 word0 = (((~((1U << 1) - 1)) << 9) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 9);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003534 return *this;
3535 }
3536 CONSTEXPR uint32_t get_write_buf_idle0() const
3537 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003538 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 10));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003539 return value;
3540 }
3541 uint32_t get_write_buf_idle0() const volatile
3542 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003543 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 10));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003544 return value;
3545 }
3546 CONSTEXPR wd_status_r &set_write_buf_idle0(uint32_t value)
3547 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003548 word0 = (((~((1U << 1) - 1)) << 10) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 10);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003549 return *this;
3550 }
3551 CONSTEXPR uint32_t get_write_buf_index1() const
3552 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003553 uint32_t value = static_cast<uint32_t>(((1U << 3) - 1) & (word0 >> 11));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003554 return value;
3555 }
3556 uint32_t get_write_buf_index1() const volatile
3557 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003558 uint32_t value = static_cast<uint32_t>(((1U << 3) - 1) & (word0 >> 11));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003559 return value;
3560 }
3561 CONSTEXPR wd_status_r &set_write_buf_index1(uint32_t value)
3562 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003563 word0 = (((~((1U << 3) - 1)) << 11) & word0) | ((((1U << 3) - 1) & static_cast<uint32_t>(value)) << 11);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003564 return *this;
3565 }
3566 CONSTEXPR uint32_t get_write_buf_valid1() const
3567 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003568 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 14));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003569 return value;
3570 }
3571 uint32_t get_write_buf_valid1() const volatile
3572 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003573 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 14));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003574 return value;
3575 }
3576 CONSTEXPR wd_status_r &set_write_buf_valid1(uint32_t value)
3577 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003578 word0 = (((~((1U << 1) - 1)) << 14) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 14);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003579 return *this;
3580 }
3581 CONSTEXPR uint32_t get_write_buf_idle1() const
3582 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003583 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 15));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003584 return value;
3585 }
3586 uint32_t get_write_buf_idle1() const volatile
3587 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003588 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 15));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003589 return value;
3590 }
3591 CONSTEXPR wd_status_r &set_write_buf_idle1(uint32_t value)
3592 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003593 word0 = (((~((1U << 1) - 1)) << 15) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 15);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003594 return *this;
3595 }
3596 CONSTEXPR uint32_t get_events() const
3597 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003598 uint32_t value = static_cast<uint32_t>(((1U << 12) - 1) & (word0 >> 16));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003599 return value;
3600 }
3601 uint32_t get_events() const volatile
3602 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003603 uint32_t value = static_cast<uint32_t>(((1U << 12) - 1) & (word0 >> 16));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003604 return value;
3605 }
3606 CONSTEXPR wd_status_r &set_events(uint32_t value)
3607 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003608 word0 = (((~((1U << 12) - 1)) << 16) & word0) | ((((1U << 12) - 1) & static_cast<uint32_t>(value)) << 16);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003609 return *this;
3610 }
Jonny Svärd136810f2021-10-13 16:04:26 +02003611#endif
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003612};
3613
Jonny Svärd136810f2021-10-13 16:04:26 +02003614// mac_status_r - MAC_STATUS
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003615struct mac_status_r
3616{
Jonny Svärd136810f2021-10-13 16:04:26 +02003617#ifndef __cplusplus
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003618 union
3619 {
3620 struct
3621 {
3622 uint32_t block_cfg_valid : 1; // MAC has a valid block configuration
3623 uint32_t trav_en : 1; // MAC is doing block traversal
3624 uint32_t wait_for_ib : 1; // MAC is waiting for an Input Buffer to become available
3625 uint32_t wait_for_acc_buf : 1; // MAC is waiting for an Accumulator Buffer to become available
3626 uint32_t wait_for_weights : 1; // MAC is waiting for a Weight Block to become available
3627 uint32_t stall_stripe : 1; // MAC is stalling between two stripes
3628 uint32_t dw_sel : 1; // Currently used weight interface in MAC AI
3629 uint32_t wait_for_dw0_ready : 1; // MAC AI is waiting for MAC DPU to send dw0_ready to WD
3630 uint32_t wait_for_dw1_ready : 1; // MAC AI is waiting for MAC DPU to send dw1_ready to WD
3631 uint32_t acc_buf_sel_ai : 1; // Currently used AccBuf interface in MAC AI
3632 uint32_t wait_for_acc0_ready : 1; // MAC AI is waiting for acc0_ready from AO
3633 uint32_t wait_for_acc1_ready : 1; // MAC AI is waiting for acc1_ready from AO
3634 uint32_t acc_buf_sel_aa : 1; // Currently used AccBuf interface in MAC ADDER_ARRAY
3635 uint32_t acc0_valid : 1; // MAC outgoing value of acc0_valid
3636 uint32_t acc1_valid : 1; // MAC outgoing value of acc1_valid
3637 uint32_t reserved0 : 1;
3638 uint32_t events : 11; // Mapped to MAC events described in Appendix A
3639 uint32_t reserved1 : 5;
3640 };
3641 uint32_t word;
3642 };
Jonny Svärd136810f2021-10-13 16:04:26 +02003643#else
3644 private:
3645 uint32_t word0;
3646
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003647 public:
Jonny Svärd136810f2021-10-13 16:04:26 +02003648 CONSTEXPR mac_status_r() : word0(0) {}
3649 CONSTEXPR mac_status_r(uint32_t init) : word0(init) {}
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003650 CONSTEXPR void operator=(uint32_t value)
3651 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003652 word0 = value;
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003653 }
3654 void operator=(uint32_t value) volatile
3655 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003656 word0 = value;
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003657 }
3658 CONSTEXPR operator uint32_t()
3659 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003660 return word0;
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003661 }
3662 operator uint32_t() volatile
3663 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003664 return word0;
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003665 }
3666 mac_status_r copy() volatile
3667 {
3668 return *this;
3669 }
3670 CONSTEXPR uint32_t get_block_cfg_valid() const
3671 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003672 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 0));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003673 return value;
3674 }
3675 uint32_t get_block_cfg_valid() const volatile
3676 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003677 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 0));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003678 return value;
3679 }
3680 CONSTEXPR mac_status_r &set_block_cfg_valid(uint32_t value)
3681 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003682 word0 = (((~((1U << 1) - 1)) << 0) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 0);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003683 return *this;
3684 }
3685 CONSTEXPR uint32_t get_trav_en() const
3686 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003687 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 1));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003688 return value;
3689 }
3690 uint32_t get_trav_en() const volatile
3691 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003692 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 1));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003693 return value;
3694 }
3695 CONSTEXPR mac_status_r &set_trav_en(uint32_t value)
3696 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003697 word0 = (((~((1U << 1) - 1)) << 1) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 1);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003698 return *this;
3699 }
3700 CONSTEXPR uint32_t get_wait_for_ib() const
3701 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003702 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 2));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003703 return value;
3704 }
3705 uint32_t get_wait_for_ib() const volatile
3706 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003707 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 2));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003708 return value;
3709 }
3710 CONSTEXPR mac_status_r &set_wait_for_ib(uint32_t value)
3711 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003712 word0 = (((~((1U << 1) - 1)) << 2) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 2);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003713 return *this;
3714 }
3715 CONSTEXPR uint32_t get_wait_for_acc_buf() const
3716 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003717 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 3));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003718 return value;
3719 }
3720 uint32_t get_wait_for_acc_buf() const volatile
3721 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003722 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 3));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003723 return value;
3724 }
3725 CONSTEXPR mac_status_r &set_wait_for_acc_buf(uint32_t value)
3726 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003727 word0 = (((~((1U << 1) - 1)) << 3) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 3);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003728 return *this;
3729 }
3730 CONSTEXPR uint32_t get_wait_for_weights() const
3731 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003732 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 4));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003733 return value;
3734 }
3735 uint32_t get_wait_for_weights() const volatile
3736 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003737 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 4));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003738 return value;
3739 }
3740 CONSTEXPR mac_status_r &set_wait_for_weights(uint32_t value)
3741 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003742 word0 = (((~((1U << 1) - 1)) << 4) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 4);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003743 return *this;
3744 }
3745 CONSTEXPR uint32_t get_stall_stripe() const
3746 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003747 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 5));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003748 return value;
3749 }
3750 uint32_t get_stall_stripe() const volatile
3751 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003752 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 5));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003753 return value;
3754 }
3755 CONSTEXPR mac_status_r &set_stall_stripe(uint32_t value)
3756 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003757 word0 = (((~((1U << 1) - 1)) << 5) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 5);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003758 return *this;
3759 }
3760 CONSTEXPR uint32_t get_dw_sel() const
3761 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003762 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 6));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003763 return value;
3764 }
3765 uint32_t get_dw_sel() const volatile
3766 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003767 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 6));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003768 return value;
3769 }
3770 CONSTEXPR mac_status_r &set_dw_sel(uint32_t value)
3771 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003772 word0 = (((~((1U << 1) - 1)) << 6) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 6);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003773 return *this;
3774 }
3775 CONSTEXPR uint32_t get_wait_for_dw0_ready() const
3776 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003777 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 7));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003778 return value;
3779 }
3780 uint32_t get_wait_for_dw0_ready() const volatile
3781 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003782 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 7));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003783 return value;
3784 }
3785 CONSTEXPR mac_status_r &set_wait_for_dw0_ready(uint32_t value)
3786 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003787 word0 = (((~((1U << 1) - 1)) << 7) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 7);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003788 return *this;
3789 }
3790 CONSTEXPR uint32_t get_wait_for_dw1_ready() const
3791 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003792 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 8));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003793 return value;
3794 }
3795 uint32_t get_wait_for_dw1_ready() const volatile
3796 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003797 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 8));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003798 return value;
3799 }
3800 CONSTEXPR mac_status_r &set_wait_for_dw1_ready(uint32_t value)
3801 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003802 word0 = (((~((1U << 1) - 1)) << 8) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 8);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003803 return *this;
3804 }
3805 CONSTEXPR uint32_t get_acc_buf_sel_ai() const
3806 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003807 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 9));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003808 return value;
3809 }
3810 uint32_t get_acc_buf_sel_ai() const volatile
3811 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003812 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 9));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003813 return value;
3814 }
3815 CONSTEXPR mac_status_r &set_acc_buf_sel_ai(uint32_t value)
3816 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003817 word0 = (((~((1U << 1) - 1)) << 9) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 9);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003818 return *this;
3819 }
3820 CONSTEXPR uint32_t get_wait_for_acc0_ready() const
3821 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003822 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 10));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003823 return value;
3824 }
3825 uint32_t get_wait_for_acc0_ready() const volatile
3826 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003827 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 10));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003828 return value;
3829 }
3830 CONSTEXPR mac_status_r &set_wait_for_acc0_ready(uint32_t value)
3831 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003832 word0 = (((~((1U << 1) - 1)) << 10) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 10);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003833 return *this;
3834 }
3835 CONSTEXPR uint32_t get_wait_for_acc1_ready() const
3836 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003837 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 11));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003838 return value;
3839 }
3840 uint32_t get_wait_for_acc1_ready() const volatile
3841 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003842 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 11));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003843 return value;
3844 }
3845 CONSTEXPR mac_status_r &set_wait_for_acc1_ready(uint32_t value)
3846 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003847 word0 = (((~((1U << 1) - 1)) << 11) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 11);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003848 return *this;
3849 }
3850 CONSTEXPR uint32_t get_acc_buf_sel_aa() const
3851 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003852 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 12));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003853 return value;
3854 }
3855 uint32_t get_acc_buf_sel_aa() const volatile
3856 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003857 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 12));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003858 return value;
3859 }
3860 CONSTEXPR mac_status_r &set_acc_buf_sel_aa(uint32_t value)
3861 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003862 word0 = (((~((1U << 1) - 1)) << 12) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 12);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003863 return *this;
3864 }
3865 CONSTEXPR uint32_t get_acc0_valid() const
3866 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003867 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 13));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003868 return value;
3869 }
3870 uint32_t get_acc0_valid() const volatile
3871 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003872 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 13));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003873 return value;
3874 }
3875 CONSTEXPR mac_status_r &set_acc0_valid(uint32_t value)
3876 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003877 word0 = (((~((1U << 1) - 1)) << 13) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 13);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003878 return *this;
3879 }
3880 CONSTEXPR uint32_t get_acc1_valid() const
3881 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003882 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 14));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003883 return value;
3884 }
3885 uint32_t get_acc1_valid() const volatile
3886 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003887 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 14));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003888 return value;
3889 }
3890 CONSTEXPR mac_status_r &set_acc1_valid(uint32_t value)
3891 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003892 word0 = (((~((1U << 1) - 1)) << 14) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 14);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003893 return *this;
3894 }
3895 CONSTEXPR uint32_t get_events() const
3896 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003897 uint32_t value = static_cast<uint32_t>(((1U << 11) - 1) & (word0 >> 16));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003898 return value;
3899 }
3900 uint32_t get_events() const volatile
3901 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003902 uint32_t value = static_cast<uint32_t>(((1U << 11) - 1) & (word0 >> 16));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003903 return value;
3904 }
3905 CONSTEXPR mac_status_r &set_events(uint32_t value)
3906 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003907 word0 = (((~((1U << 11) - 1)) << 16) & word0) | ((((1U << 11) - 1) & static_cast<uint32_t>(value)) << 16);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003908 return *this;
3909 }
Jonny Svärd136810f2021-10-13 16:04:26 +02003910#endif
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003911};
3912
Jonny Svärd136810f2021-10-13 16:04:26 +02003913// ao_status_r - AO_STATUS
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003914struct ao_status_r
3915{
Jonny Svärd136810f2021-10-13 16:04:26 +02003916#ifndef __cplusplus
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003917 union
3918 {
3919 struct
3920 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003921 uint32_t cmd_sbw_valid : 1; // Block command to shared buffer write module is valid
3922 uint32_t cmd_act_valid : 1; // Block command to activation function module is valid
3923 uint32_t cmd_ctl_valid : 1; // Block command to control module is valid
3924 uint32_t cmd_scl_valid : 1; // Block command to scale module is valid
3925 uint32_t cmd_sbr_valid : 1; // Block command to shared buffer read module is valid
3926 uint32_t cmd_ofm_valid : 1; // Block command to ofm parameter module is valid
3927 uint32_t blk_cmd_ready : 1; // Ready to accept block command
3928 uint32_t blk_cmd_valid : 1; // Block command from CC is valid
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003929 uint32_t reserved0 : 8;
Jonny Svärd136810f2021-10-13 16:04:26 +02003930 uint32_t events : 8; // Mapped to AO events described in Appendix A
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003931 uint32_t reserved1 : 8;
3932 };
3933 uint32_t word;
3934 };
Jonny Svärd136810f2021-10-13 16:04:26 +02003935#else
3936 private:
3937 uint32_t word0;
3938
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003939 public:
Jonny Svärd136810f2021-10-13 16:04:26 +02003940 CONSTEXPR ao_status_r() : word0(0) {}
3941 CONSTEXPR ao_status_r(uint32_t init) : word0(init) {}
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003942 CONSTEXPR void operator=(uint32_t value)
3943 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003944 word0 = value;
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003945 }
3946 void operator=(uint32_t value) volatile
3947 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003948 word0 = value;
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003949 }
3950 CONSTEXPR operator uint32_t()
3951 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003952 return word0;
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003953 }
3954 operator uint32_t() volatile
3955 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003956 return word0;
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003957 }
3958 ao_status_r copy() volatile
3959 {
3960 return *this;
3961 }
3962 CONSTEXPR uint32_t get_cmd_sbw_valid() const
3963 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003964 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 0));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003965 return value;
3966 }
3967 uint32_t get_cmd_sbw_valid() const volatile
3968 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003969 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 0));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003970 return value;
3971 }
3972 CONSTEXPR ao_status_r &set_cmd_sbw_valid(uint32_t value)
3973 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003974 word0 = (((~((1U << 1) - 1)) << 0) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 0);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003975 return *this;
3976 }
3977 CONSTEXPR uint32_t get_cmd_act_valid() const
3978 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003979 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 1));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003980 return value;
3981 }
3982 uint32_t get_cmd_act_valid() const volatile
3983 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003984 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 1));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003985 return value;
3986 }
3987 CONSTEXPR ao_status_r &set_cmd_act_valid(uint32_t value)
3988 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003989 word0 = (((~((1U << 1) - 1)) << 1) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 1);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003990 return *this;
3991 }
3992 CONSTEXPR uint32_t get_cmd_ctl_valid() const
3993 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003994 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 2));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02003995 return value;
3996 }
3997 uint32_t get_cmd_ctl_valid() const volatile
3998 {
Jonny Svärd136810f2021-10-13 16:04:26 +02003999 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 2));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004000 return value;
4001 }
4002 CONSTEXPR ao_status_r &set_cmd_ctl_valid(uint32_t value)
4003 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004004 word0 = (((~((1U << 1) - 1)) << 2) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 2);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004005 return *this;
4006 }
4007 CONSTEXPR uint32_t get_cmd_scl_valid() const
4008 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004009 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 3));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004010 return value;
4011 }
4012 uint32_t get_cmd_scl_valid() const volatile
4013 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004014 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 3));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004015 return value;
4016 }
4017 CONSTEXPR ao_status_r &set_cmd_scl_valid(uint32_t value)
4018 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004019 word0 = (((~((1U << 1) - 1)) << 3) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 3);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004020 return *this;
4021 }
4022 CONSTEXPR uint32_t get_cmd_sbr_valid() const
4023 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004024 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 4));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004025 return value;
4026 }
4027 uint32_t get_cmd_sbr_valid() const volatile
4028 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004029 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 4));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004030 return value;
4031 }
4032 CONSTEXPR ao_status_r &set_cmd_sbr_valid(uint32_t value)
4033 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004034 word0 = (((~((1U << 1) - 1)) << 4) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 4);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004035 return *this;
4036 }
4037 CONSTEXPR uint32_t get_cmd_ofm_valid() const
4038 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004039 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 5));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004040 return value;
4041 }
4042 uint32_t get_cmd_ofm_valid() const volatile
4043 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004044 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 5));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004045 return value;
4046 }
4047 CONSTEXPR ao_status_r &set_cmd_ofm_valid(uint32_t value)
4048 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004049 word0 = (((~((1U << 1) - 1)) << 5) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 5);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004050 return *this;
4051 }
4052 CONSTEXPR uint32_t get_blk_cmd_ready() const
4053 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004054 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 6));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004055 return value;
4056 }
4057 uint32_t get_blk_cmd_ready() const volatile
4058 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004059 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 6));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004060 return value;
4061 }
4062 CONSTEXPR ao_status_r &set_blk_cmd_ready(uint32_t value)
4063 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004064 word0 = (((~((1U << 1) - 1)) << 6) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 6);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004065 return *this;
4066 }
4067 CONSTEXPR uint32_t get_blk_cmd_valid() const
4068 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004069 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 7));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004070 return value;
4071 }
4072 uint32_t get_blk_cmd_valid() const volatile
4073 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004074 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 7));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004075 return value;
4076 }
4077 CONSTEXPR ao_status_r &set_blk_cmd_valid(uint32_t value)
4078 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004079 word0 = (((~((1U << 1) - 1)) << 7) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 7);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004080 return *this;
4081 }
4082 CONSTEXPR uint32_t get_events() const
4083 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004084 uint32_t value = static_cast<uint32_t>(((1U << 8) - 1) & (word0 >> 16));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004085 return value;
4086 }
4087 uint32_t get_events() const volatile
4088 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004089 uint32_t value = static_cast<uint32_t>(((1U << 8) - 1) & (word0 >> 16));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004090 return value;
4091 }
4092 CONSTEXPR ao_status_r &set_events(uint32_t value)
4093 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004094 word0 = (((~((1U << 8) - 1)) << 16) & word0) | ((((1U << 8) - 1) & static_cast<uint32_t>(value)) << 16);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004095 return *this;
4096 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004097#endif
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004098};
4099
Jonny Svärd136810f2021-10-13 16:04:26 +02004100// dma_status0_r - DMA_STATUS0
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004101struct dma_status0_r
4102{
Jonny Svärd136810f2021-10-13 16:04:26 +02004103#ifndef __cplusplus
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004104 union
4105 {
4106 struct
4107 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004108 uint32_t cmd_idle : 1; // When this bit is high means that the CMD block is not busy in generating addresses
4109 // for a CMD job
4110 uint32_t ifm_idle : 1; // When this bit is high means that there are no ongoing IFM jobs
4111 uint32_t wgt_idle_c0 : 1; // When this bit is high means that the WGT block is not busy in generating
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004112 // addresses for a WGT job
Jonny Svärd136810f2021-10-13 16:04:26 +02004113 uint32_t bas_idle_c0 : 1; // When this bit is high means that the BAS block is not busy in generating
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004114 // addresses for a BAS job
Jonny Svärd136810f2021-10-13 16:04:26 +02004115 uint32_t m2m_idle : 1; // When this bit is high means that there are no ongoing M2M jobs
4116 uint32_t ofm_idle : 1; // When this bit is high means that there are no ongoing OFM jobs
4117 uint32_t halt_req : 1; // CPM has requested to HALT AXI bus before soft reset
4118 uint32_t halt_ack : 1; // DMA is in condition to halt the AXI bus since there are no pending transactions
4119 uint32_t pause_req : 1; // CC has requested to pause the AXI
4120 uint32_t pause_ack : 1; // DMA is in condition to pause the AXI bus since there are no pending transactions
4121 uint32_t ib0_ai_valid_c0 : 1; // Data for AI to be read in IFM input buffer 0 - Core 0
4122 uint32_t ib0_ai_ready_c0 : 1; // Data consumed from AI in IFM input buffer 0 - Core 0
4123 uint32_t ib1_ai_valid_c0 : 1; // Data for AI to be read in IFM input buffer 1 - Core 0
4124 uint32_t ib1_ai_ready_c0 : 1; // Data consumed from AI in IFM input buffer 1 - Core 0
4125 uint32_t ib0_ao_valid_c0 : 1; // Data for AO to be read in IFM input buffer 0 - Core 0
4126 uint32_t ib0_ao_ready_c0 : 1; // Data consumed from AO in IFM input buffer 0 - Core 0
4127 uint32_t ib1_ao_valid_c0 : 1; // Data for AO to be read in IFM input buffer 0 - Core 0
4128 uint32_t ib1_ao_ready_c0 : 1; // Data consumed from AO in IFM input buffer 1 - Core 0
4129 uint32_t ob0_valid_c0 : 1; // Data for DMA ready to be consumed in OFM output buffer 0 - Core 0
4130 uint32_t ob0_ready_c0 : 1; // Data consumed from DMA in OFM output buffer 0 - Core 0
4131 uint32_t ob1_valid_c0 : 1; // Data for DMA ready to be consumed in OFM output buffer 1 - Core 0
4132 uint32_t ob1_ready_c0 : 1; // Data consumed from DMA in OFM output buffer 1 - Core 0
4133 uint32_t cmd_valid : 1; // New command word for CC to be consumed
4134 uint32_t cmd_ready : 1; // command word consumed by CC
4135 uint32_t wd_bitstream_valid_c0 : 1; // New weight word for WD to be consumed - Core 0
4136 uint32_t wd_bitstream_ready_c0 : 1; // Weight word consumed by WD - Core 0
4137 uint32_t bs_bitstream_valid_c0 : 1; // New BaS word for AO to be consumed - Core 0
4138 uint32_t bs_bitstream_ready_c0 : 1; // BaS word consumed by AO - Core 0
4139 uint32_t axi0_ar_stalled : 1; // Read transfer request stalled on arready low AXI0 (due to memory system)
4140 uint32_t axi0_rd_limit_stall : 1; // Read stalled due to one AXI0 limit counter being reached
4141 uint32_t axi0_aw_stalled : 1; // Write transfer request stalled on awready low AXI0 (due to memory system)
4142 uint32_t axi0_w_stalled : 1; // Write transfer stalled on awready low AXI0 (due to memory system)
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004143 };
4144 uint32_t word;
4145 };
Jonny Svärd136810f2021-10-13 16:04:26 +02004146#else
4147 private:
4148 uint32_t word0;
4149
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004150 public:
Jonny Svärd136810f2021-10-13 16:04:26 +02004151 CONSTEXPR dma_status0_r() : word0(0) {}
4152 CONSTEXPR dma_status0_r(uint32_t init) : word0(init) {}
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004153 CONSTEXPR void operator=(uint32_t value)
4154 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004155 word0 = value;
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004156 }
4157 void operator=(uint32_t value) volatile
4158 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004159 word0 = value;
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004160 }
4161 CONSTEXPR operator uint32_t()
4162 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004163 return word0;
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004164 }
4165 operator uint32_t() volatile
4166 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004167 return word0;
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004168 }
4169 dma_status0_r copy() volatile
4170 {
4171 return *this;
4172 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004173 CONSTEXPR uint32_t get_cmd_idle() const
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004174 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004175 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 0));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004176 return value;
4177 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004178 uint32_t get_cmd_idle() const volatile
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004179 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004180 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 0));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004181 return value;
4182 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004183 CONSTEXPR dma_status0_r &set_cmd_idle(uint32_t value)
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004184 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004185 word0 = (((~((1U << 1) - 1)) << 0) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 0);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004186 return *this;
4187 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004188 CONSTEXPR uint32_t get_ifm_idle() const
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004189 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004190 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 1));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004191 return value;
4192 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004193 uint32_t get_ifm_idle() const volatile
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004194 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004195 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 1));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004196 return value;
4197 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004198 CONSTEXPR dma_status0_r &set_ifm_idle(uint32_t value)
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004199 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004200 word0 = (((~((1U << 1) - 1)) << 1) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 1);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004201 return *this;
4202 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004203 CONSTEXPR uint32_t get_wgt_idle_c0() const
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004204 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004205 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 2));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004206 return value;
4207 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004208 uint32_t get_wgt_idle_c0() const volatile
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004209 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004210 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 2));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004211 return value;
4212 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004213 CONSTEXPR dma_status0_r &set_wgt_idle_c0(uint32_t value)
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004214 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004215 word0 = (((~((1U << 1) - 1)) << 2) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 2);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004216 return *this;
4217 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004218 CONSTEXPR uint32_t get_bas_idle_c0() const
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004219 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004220 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 3));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004221 return value;
4222 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004223 uint32_t get_bas_idle_c0() const volatile
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004224 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004225 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 3));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004226 return value;
4227 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004228 CONSTEXPR dma_status0_r &set_bas_idle_c0(uint32_t value)
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004229 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004230 word0 = (((~((1U << 1) - 1)) << 3) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 3);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004231 return *this;
4232 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004233 CONSTEXPR uint32_t get_m2m_idle() const
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004234 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004235 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 4));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004236 return value;
4237 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004238 uint32_t get_m2m_idle() const volatile
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004239 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004240 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 4));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004241 return value;
4242 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004243 CONSTEXPR dma_status0_r &set_m2m_idle(uint32_t value)
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004244 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004245 word0 = (((~((1U << 1) - 1)) << 4) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 4);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004246 return *this;
4247 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004248 CONSTEXPR uint32_t get_ofm_idle() const
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004249 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004250 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 5));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004251 return value;
4252 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004253 uint32_t get_ofm_idle() const volatile
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004254 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004255 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 5));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004256 return value;
4257 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004258 CONSTEXPR dma_status0_r &set_ofm_idle(uint32_t value)
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004259 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004260 word0 = (((~((1U << 1) - 1)) << 5) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 5);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004261 return *this;
4262 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004263 CONSTEXPR uint32_t get_halt_req() const
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004264 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004265 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 6));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004266 return value;
4267 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004268 uint32_t get_halt_req() const volatile
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004269 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004270 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 6));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004271 return value;
4272 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004273 CONSTEXPR dma_status0_r &set_halt_req(uint32_t value)
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004274 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004275 word0 = (((~((1U << 1) - 1)) << 6) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 6);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004276 return *this;
4277 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004278 CONSTEXPR uint32_t get_halt_ack() const
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004279 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004280 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 7));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004281 return value;
4282 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004283 uint32_t get_halt_ack() const volatile
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004284 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004285 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 7));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004286 return value;
4287 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004288 CONSTEXPR dma_status0_r &set_halt_ack(uint32_t value)
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004289 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004290 word0 = (((~((1U << 1) - 1)) << 7) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 7);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004291 return *this;
4292 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004293 CONSTEXPR uint32_t get_pause_req() const
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004294 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004295 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 8));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004296 return value;
4297 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004298 uint32_t get_pause_req() const volatile
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004299 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004300 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 8));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004301 return value;
4302 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004303 CONSTEXPR dma_status0_r &set_pause_req(uint32_t value)
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004304 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004305 word0 = (((~((1U << 1) - 1)) << 8) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 8);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004306 return *this;
4307 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004308 CONSTEXPR uint32_t get_pause_ack() const
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004309 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004310 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 9));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004311 return value;
4312 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004313 uint32_t get_pause_ack() const volatile
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004314 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004315 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 9));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004316 return value;
4317 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004318 CONSTEXPR dma_status0_r &set_pause_ack(uint32_t value)
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004319 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004320 word0 = (((~((1U << 1) - 1)) << 9) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 9);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004321 return *this;
4322 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004323 CONSTEXPR uint32_t get_ib0_ai_valid_c0() const
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004324 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004325 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 10));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004326 return value;
4327 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004328 uint32_t get_ib0_ai_valid_c0() const volatile
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004329 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004330 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 10));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004331 return value;
4332 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004333 CONSTEXPR dma_status0_r &set_ib0_ai_valid_c0(uint32_t value)
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004334 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004335 word0 = (((~((1U << 1) - 1)) << 10) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 10);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004336 return *this;
4337 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004338 CONSTEXPR uint32_t get_ib0_ai_ready_c0() const
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004339 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004340 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 11));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004341 return value;
4342 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004343 uint32_t get_ib0_ai_ready_c0() const volatile
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004344 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004345 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 11));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004346 return value;
4347 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004348 CONSTEXPR dma_status0_r &set_ib0_ai_ready_c0(uint32_t value)
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004349 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004350 word0 = (((~((1U << 1) - 1)) << 11) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 11);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004351 return *this;
4352 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004353 CONSTEXPR uint32_t get_ib1_ai_valid_c0() const
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004354 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004355 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 12));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004356 return value;
4357 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004358 uint32_t get_ib1_ai_valid_c0() const volatile
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004359 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004360 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 12));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004361 return value;
4362 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004363 CONSTEXPR dma_status0_r &set_ib1_ai_valid_c0(uint32_t value)
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004364 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004365 word0 = (((~((1U << 1) - 1)) << 12) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 12);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004366 return *this;
4367 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004368 CONSTEXPR uint32_t get_ib1_ai_ready_c0() const
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004369 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004370 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 13));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004371 return value;
4372 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004373 uint32_t get_ib1_ai_ready_c0() const volatile
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004374 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004375 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 13));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004376 return value;
4377 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004378 CONSTEXPR dma_status0_r &set_ib1_ai_ready_c0(uint32_t value)
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004379 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004380 word0 = (((~((1U << 1) - 1)) << 13) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 13);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004381 return *this;
4382 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004383 CONSTEXPR uint32_t get_ib0_ao_valid_c0() const
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004384 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004385 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 14));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004386 return value;
4387 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004388 uint32_t get_ib0_ao_valid_c0() const volatile
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004389 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004390 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 14));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004391 return value;
4392 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004393 CONSTEXPR dma_status0_r &set_ib0_ao_valid_c0(uint32_t value)
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004394 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004395 word0 = (((~((1U << 1) - 1)) << 14) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 14);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004396 return *this;
4397 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004398 CONSTEXPR uint32_t get_ib0_ao_ready_c0() const
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004399 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004400 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 15));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004401 return value;
4402 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004403 uint32_t get_ib0_ao_ready_c0() const volatile
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004404 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004405 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 15));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004406 return value;
4407 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004408 CONSTEXPR dma_status0_r &set_ib0_ao_ready_c0(uint32_t value)
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004409 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004410 word0 = (((~((1U << 1) - 1)) << 15) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 15);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004411 return *this;
4412 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004413 CONSTEXPR uint32_t get_ib1_ao_valid_c0() const
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004414 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004415 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 16));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004416 return value;
4417 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004418 uint32_t get_ib1_ao_valid_c0() const volatile
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004419 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004420 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 16));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004421 return value;
4422 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004423 CONSTEXPR dma_status0_r &set_ib1_ao_valid_c0(uint32_t value)
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004424 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004425 word0 = (((~((1U << 1) - 1)) << 16) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 16);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004426 return *this;
4427 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004428 CONSTEXPR uint32_t get_ib1_ao_ready_c0() const
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004429 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004430 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 17));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004431 return value;
4432 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004433 uint32_t get_ib1_ao_ready_c0() const volatile
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004434 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004435 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 17));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004436 return value;
4437 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004438 CONSTEXPR dma_status0_r &set_ib1_ao_ready_c0(uint32_t value)
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004439 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004440 word0 = (((~((1U << 1) - 1)) << 17) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 17);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004441 return *this;
4442 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004443 CONSTEXPR uint32_t get_ob0_valid_c0() const
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004444 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004445 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 18));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004446 return value;
4447 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004448 uint32_t get_ob0_valid_c0() const volatile
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004449 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004450 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 18));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004451 return value;
4452 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004453 CONSTEXPR dma_status0_r &set_ob0_valid_c0(uint32_t value)
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004454 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004455 word0 = (((~((1U << 1) - 1)) << 18) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 18);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004456 return *this;
4457 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004458 CONSTEXPR uint32_t get_ob0_ready_c0() const
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004459 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004460 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 19));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004461 return value;
4462 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004463 uint32_t get_ob0_ready_c0() const volatile
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004464 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004465 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 19));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004466 return value;
4467 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004468 CONSTEXPR dma_status0_r &set_ob0_ready_c0(uint32_t value)
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004469 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004470 word0 = (((~((1U << 1) - 1)) << 19) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 19);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004471 return *this;
4472 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004473 CONSTEXPR uint32_t get_ob1_valid_c0() const
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004474 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004475 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 20));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004476 return value;
4477 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004478 uint32_t get_ob1_valid_c0() const volatile
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004479 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004480 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 20));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004481 return value;
4482 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004483 CONSTEXPR dma_status0_r &set_ob1_valid_c0(uint32_t value)
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004484 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004485 word0 = (((~((1U << 1) - 1)) << 20) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 20);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004486 return *this;
4487 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004488 CONSTEXPR uint32_t get_ob1_ready_c0() const
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004489 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004490 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 21));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004491 return value;
4492 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004493 uint32_t get_ob1_ready_c0() const volatile
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004494 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004495 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 21));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004496 return value;
4497 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004498 CONSTEXPR dma_status0_r &set_ob1_ready_c0(uint32_t value)
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004499 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004500 word0 = (((~((1U << 1) - 1)) << 21) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 21);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004501 return *this;
4502 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004503 CONSTEXPR uint32_t get_cmd_valid() const
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004504 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004505 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 22));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004506 return value;
4507 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004508 uint32_t get_cmd_valid() const volatile
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004509 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004510 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 22));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004511 return value;
4512 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004513 CONSTEXPR dma_status0_r &set_cmd_valid(uint32_t value)
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004514 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004515 word0 = (((~((1U << 1) - 1)) << 22) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 22);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004516 return *this;
4517 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004518 CONSTEXPR uint32_t get_cmd_ready() const
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004519 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004520 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 23));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004521 return value;
4522 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004523 uint32_t get_cmd_ready() const volatile
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004524 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004525 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 23));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004526 return value;
4527 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004528 CONSTEXPR dma_status0_r &set_cmd_ready(uint32_t value)
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004529 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004530 word0 = (((~((1U << 1) - 1)) << 23) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 23);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004531 return *this;
4532 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004533 CONSTEXPR uint32_t get_wd_bitstream_valid_c0() const
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004534 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004535 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 24));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004536 return value;
4537 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004538 uint32_t get_wd_bitstream_valid_c0() const volatile
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004539 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004540 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 24));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004541 return value;
4542 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004543 CONSTEXPR dma_status0_r &set_wd_bitstream_valid_c0(uint32_t value)
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004544 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004545 word0 = (((~((1U << 1) - 1)) << 24) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 24);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004546 return *this;
4547 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004548 CONSTEXPR uint32_t get_wd_bitstream_ready_c0() const
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004549 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004550 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 25));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004551 return value;
4552 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004553 uint32_t get_wd_bitstream_ready_c0() const volatile
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004554 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004555 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 25));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004556 return value;
4557 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004558 CONSTEXPR dma_status0_r &set_wd_bitstream_ready_c0(uint32_t value)
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004559 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004560 word0 = (((~((1U << 1) - 1)) << 25) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 25);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004561 return *this;
4562 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004563 CONSTEXPR uint32_t get_bs_bitstream_valid_c0() const
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004564 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004565 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 26));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004566 return value;
4567 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004568 uint32_t get_bs_bitstream_valid_c0() const volatile
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004569 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004570 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 26));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004571 return value;
4572 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004573 CONSTEXPR dma_status0_r &set_bs_bitstream_valid_c0(uint32_t value)
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004574 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004575 word0 = (((~((1U << 1) - 1)) << 26) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 26);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004576 return *this;
4577 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004578 CONSTEXPR uint32_t get_bs_bitstream_ready_c0() const
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004579 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004580 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 27));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004581 return value;
4582 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004583 uint32_t get_bs_bitstream_ready_c0() const volatile
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004584 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004585 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 27));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004586 return value;
4587 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004588 CONSTEXPR dma_status0_r &set_bs_bitstream_ready_c0(uint32_t value)
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004589 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004590 word0 = (((~((1U << 1) - 1)) << 27) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 27);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004591 return *this;
4592 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004593 CONSTEXPR uint32_t get_axi0_ar_stalled() const
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004594 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004595 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 28));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004596 return value;
4597 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004598 uint32_t get_axi0_ar_stalled() const volatile
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004599 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004600 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 28));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004601 return value;
4602 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004603 CONSTEXPR dma_status0_r &set_axi0_ar_stalled(uint32_t value)
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004604 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004605 word0 = (((~((1U << 1) - 1)) << 28) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 28);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004606 return *this;
4607 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004608 CONSTEXPR uint32_t get_axi0_rd_limit_stall() const
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004609 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004610 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 29));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004611 return value;
4612 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004613 uint32_t get_axi0_rd_limit_stall() const volatile
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004614 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004615 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 29));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004616 return value;
4617 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004618 CONSTEXPR dma_status0_r &set_axi0_rd_limit_stall(uint32_t value)
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004619 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004620 word0 = (((~((1U << 1) - 1)) << 29) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 29);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004621 return *this;
4622 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004623 CONSTEXPR uint32_t get_axi0_aw_stalled() const
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004624 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004625 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 30));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004626 return value;
4627 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004628 uint32_t get_axi0_aw_stalled() const volatile
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004629 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004630 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 30));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004631 return value;
4632 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004633 CONSTEXPR dma_status0_r &set_axi0_aw_stalled(uint32_t value)
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004634 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004635 word0 = (((~((1U << 1) - 1)) << 30) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 30);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004636 return *this;
4637 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004638 CONSTEXPR uint32_t get_axi0_w_stalled() const
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004639 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004640 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 31));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004641 return value;
4642 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004643 uint32_t get_axi0_w_stalled() const volatile
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004644 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004645 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 31));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004646 return value;
4647 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004648 CONSTEXPR dma_status0_r &set_axi0_w_stalled(uint32_t value)
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004649 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004650 word0 = (((~((1U << 1) - 1)) << 31) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 31);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004651 return *this;
4652 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004653#endif
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004654};
4655
Jonny Svärd136810f2021-10-13 16:04:26 +02004656// dma_status1_r - DMA_STATUS1
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004657struct dma_status1_r
4658{
Jonny Svärd136810f2021-10-13 16:04:26 +02004659#ifndef __cplusplus
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004660 union
4661 {
4662 struct
4663 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004664 uint32_t axi0_wr_limit_stall : 1; // Write stalled due to one AXI0 limit counter being reached
4665 uint32_t axi1_ar_stalled : 1; // Read transfer request stalled on arready low AXI1 (due to memory system)
4666 uint32_t axi1_rd_limit_stall : 1; // Read stalled due to one AXI1 limit counter being reached
4667 uint32_t axi1_wr_stalled : 1; // Write transfer request stalled on awready low AXI1 (due to memory system)
4668 uint32_t axi1_w_stalled : 1; // Write transfer stalled on wready low AXI1 (due to memory system)
4669 uint32_t axi1_wr_limit_stall : 1; // Write stalled due to one AXI1 limit counter being reached
4670 uint32_t wgt_idle_c1 : 1; // When this bit is high means that the WGT block is not busy in generating
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004671 // addresses for a WGT job
Jonny Svärd136810f2021-10-13 16:04:26 +02004672 uint32_t bas_idle_c1 : 1; // When this bit is high means that the BAS block is not busy in generating
4673 // addresses for a BAS job
4674 uint32_t ib0_ai_valid_c1 : 1; // Data for AI to be read in IFM input buffer 0 - Core 1
4675 uint32_t ib0_ai_ready_c1 : 1; // Data consumed from AI in IFM input buffer 0 - Core 1
4676 uint32_t ib1_ai_valid_c1 : 1; // Data for AI to be read in IFM input buffer 1 - Core 1
4677 uint32_t ib1_ai_ready_c1 : 1; // Data consumed from AI in IFM input buffer 1 - Core 1
4678 uint32_t ib0_ao_valid_c1 : 1; // Data for AO to be read in IFM input buffer 0 - Core 1
4679 uint32_t ib0_ao_ready_c1 : 1; // Data consumed from AO in IFM input buffer 0 - Core 1
4680 uint32_t ib1_ao_valid_c1 : 1; // Data for AO to be read in IFM input buffer 0 - Core 1
4681 uint32_t ib1_ao_ready_c1 : 1; // Data consumed from AO in IFM input buffer 1 - Core 1
4682 uint32_t ob0_valid_c1 : 1; // Data for DMA ready to be consumed in OFM output buffer 0 - Core 1
4683 uint32_t ob0_ready_c1 : 1; // Data consumed from DMA in OFM output buffer 0 - Core 1
4684 uint32_t ob1_valid_c1 : 1; // Data for DMA ready to be consumed in OFM output buffer 1 - Core 1
4685 uint32_t ob1_ready_c1 : 1; // Data consumed from DMA in OFM output buffer 1 - Core 1
4686 uint32_t wd_bitstream_valid_c1 : 1; // New weight word for WD to be consumed - Core 1
4687 uint32_t wd_bitstream_ready_c1 : 1; // Weight word consumed by WD - Core 1
4688 uint32_t bs_bitstream_valid_c1 : 1; // New BaS word for AO to be consumed - Core 1
4689 uint32_t bs_bitstream_ready_c1 : 1; // BaS word consumed by AO - Core 1
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004690 uint32_t reserved0 : 8;
4691 };
4692 uint32_t word;
4693 };
Jonny Svärd136810f2021-10-13 16:04:26 +02004694#else
4695 private:
4696 uint32_t word0;
4697
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004698 public:
Jonny Svärd136810f2021-10-13 16:04:26 +02004699 CONSTEXPR dma_status1_r() : word0(0) {}
4700 CONSTEXPR dma_status1_r(uint32_t init) : word0(init) {}
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004701 CONSTEXPR void operator=(uint32_t value)
4702 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004703 word0 = value;
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004704 }
4705 void operator=(uint32_t value) volatile
4706 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004707 word0 = value;
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004708 }
4709 CONSTEXPR operator uint32_t()
4710 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004711 return word0;
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004712 }
4713 operator uint32_t() volatile
4714 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004715 return word0;
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004716 }
4717 dma_status1_r copy() volatile
4718 {
4719 return *this;
4720 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004721 CONSTEXPR uint32_t get_axi0_wr_limit_stall() const
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004722 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004723 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 0));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004724 return value;
4725 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004726 uint32_t get_axi0_wr_limit_stall() const volatile
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004727 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004728 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 0));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004729 return value;
4730 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004731 CONSTEXPR dma_status1_r &set_axi0_wr_limit_stall(uint32_t value)
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004732 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004733 word0 = (((~((1U << 1) - 1)) << 0) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 0);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004734 return *this;
4735 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004736 CONSTEXPR uint32_t get_axi1_ar_stalled() const
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004737 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004738 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 1));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004739 return value;
4740 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004741 uint32_t get_axi1_ar_stalled() const volatile
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004742 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004743 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 1));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004744 return value;
4745 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004746 CONSTEXPR dma_status1_r &set_axi1_ar_stalled(uint32_t value)
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004747 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004748 word0 = (((~((1U << 1) - 1)) << 1) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 1);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004749 return *this;
4750 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004751 CONSTEXPR uint32_t get_axi1_rd_limit_stall() const
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004752 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004753 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 2));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004754 return value;
4755 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004756 uint32_t get_axi1_rd_limit_stall() const volatile
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004757 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004758 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 2));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004759 return value;
4760 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004761 CONSTEXPR dma_status1_r &set_axi1_rd_limit_stall(uint32_t value)
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004762 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004763 word0 = (((~((1U << 1) - 1)) << 2) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 2);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004764 return *this;
4765 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004766 CONSTEXPR uint32_t get_axi1_wr_stalled() const
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004767 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004768 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 3));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004769 return value;
4770 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004771 uint32_t get_axi1_wr_stalled() const volatile
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004772 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004773 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 3));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004774 return value;
4775 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004776 CONSTEXPR dma_status1_r &set_axi1_wr_stalled(uint32_t value)
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004777 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004778 word0 = (((~((1U << 1) - 1)) << 3) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 3);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004779 return *this;
4780 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004781 CONSTEXPR uint32_t get_axi1_w_stalled() const
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004782 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004783 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 4));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004784 return value;
4785 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004786 uint32_t get_axi1_w_stalled() const volatile
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004787 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004788 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 4));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004789 return value;
4790 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004791 CONSTEXPR dma_status1_r &set_axi1_w_stalled(uint32_t value)
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004792 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004793 word0 = (((~((1U << 1) - 1)) << 4) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 4);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004794 return *this;
4795 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004796 CONSTEXPR uint32_t get_axi1_wr_limit_stall() const
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004797 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004798 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 5));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004799 return value;
4800 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004801 uint32_t get_axi1_wr_limit_stall() const volatile
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004802 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004803 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 5));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004804 return value;
4805 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004806 CONSTEXPR dma_status1_r &set_axi1_wr_limit_stall(uint32_t value)
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004807 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004808 word0 = (((~((1U << 1) - 1)) << 5) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 5);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004809 return *this;
4810 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004811 CONSTEXPR uint32_t get_wgt_idle_c1() const
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004812 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004813 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 6));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004814 return value;
4815 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004816 uint32_t get_wgt_idle_c1() const volatile
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004817 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004818 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 6));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004819 return value;
4820 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004821 CONSTEXPR dma_status1_r &set_wgt_idle_c1(uint32_t value)
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004822 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004823 word0 = (((~((1U << 1) - 1)) << 6) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 6);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004824 return *this;
4825 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004826 CONSTEXPR uint32_t get_bas_idle_c1() const
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004827 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004828 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 7));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004829 return value;
4830 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004831 uint32_t get_bas_idle_c1() const volatile
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004832 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004833 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 7));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004834 return value;
4835 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004836 CONSTEXPR dma_status1_r &set_bas_idle_c1(uint32_t value)
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004837 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004838 word0 = (((~((1U << 1) - 1)) << 7) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 7);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004839 return *this;
4840 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004841 CONSTEXPR uint32_t get_ib0_ai_valid_c1() const
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004842 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004843 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 8));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004844 return value;
4845 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004846 uint32_t get_ib0_ai_valid_c1() const volatile
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004847 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004848 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 8));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004849 return value;
4850 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004851 CONSTEXPR dma_status1_r &set_ib0_ai_valid_c1(uint32_t value)
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004852 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004853 word0 = (((~((1U << 1) - 1)) << 8) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 8);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004854 return *this;
4855 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004856 CONSTEXPR uint32_t get_ib0_ai_ready_c1() const
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004857 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004858 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 9));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004859 return value;
4860 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004861 uint32_t get_ib0_ai_ready_c1() const volatile
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004862 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004863 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 9));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004864 return value;
4865 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004866 CONSTEXPR dma_status1_r &set_ib0_ai_ready_c1(uint32_t value)
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004867 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004868 word0 = (((~((1U << 1) - 1)) << 9) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 9);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004869 return *this;
4870 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004871 CONSTEXPR uint32_t get_ib1_ai_valid_c1() const
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004872 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004873 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 10));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004874 return value;
4875 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004876 uint32_t get_ib1_ai_valid_c1() const volatile
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004877 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004878 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 10));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004879 return value;
4880 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004881 CONSTEXPR dma_status1_r &set_ib1_ai_valid_c1(uint32_t value)
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004882 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004883 word0 = (((~((1U << 1) - 1)) << 10) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 10);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004884 return *this;
4885 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004886 CONSTEXPR uint32_t get_ib1_ai_ready_c1() const
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004887 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004888 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 11));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004889 return value;
4890 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004891 uint32_t get_ib1_ai_ready_c1() const volatile
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004892 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004893 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 11));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004894 return value;
4895 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004896 CONSTEXPR dma_status1_r &set_ib1_ai_ready_c1(uint32_t value)
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004897 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004898 word0 = (((~((1U << 1) - 1)) << 11) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 11);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004899 return *this;
4900 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004901 CONSTEXPR uint32_t get_ib0_ao_valid_c1() const
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004902 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004903 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 12));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004904 return value;
4905 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004906 uint32_t get_ib0_ao_valid_c1() const volatile
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004907 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004908 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 12));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004909 return value;
4910 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004911 CONSTEXPR dma_status1_r &set_ib0_ao_valid_c1(uint32_t value)
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004912 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004913 word0 = (((~((1U << 1) - 1)) << 12) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 12);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004914 return *this;
4915 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004916 CONSTEXPR uint32_t get_ib0_ao_ready_c1() const
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004917 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004918 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 13));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004919 return value;
4920 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004921 uint32_t get_ib0_ao_ready_c1() const volatile
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004922 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004923 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 13));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004924 return value;
4925 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004926 CONSTEXPR dma_status1_r &set_ib0_ao_ready_c1(uint32_t value)
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004927 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004928 word0 = (((~((1U << 1) - 1)) << 13) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 13);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004929 return *this;
4930 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004931 CONSTEXPR uint32_t get_ib1_ao_valid_c1() const
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004932 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004933 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 14));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004934 return value;
4935 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004936 uint32_t get_ib1_ao_valid_c1() const volatile
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004937 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004938 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 14));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004939 return value;
4940 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004941 CONSTEXPR dma_status1_r &set_ib1_ao_valid_c1(uint32_t value)
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004942 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004943 word0 = (((~((1U << 1) - 1)) << 14) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 14);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004944 return *this;
4945 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004946 CONSTEXPR uint32_t get_ib1_ao_ready_c1() const
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004947 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004948 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 15));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004949 return value;
4950 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004951 uint32_t get_ib1_ao_ready_c1() const volatile
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004952 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004953 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 15));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004954 return value;
4955 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004956 CONSTEXPR dma_status1_r &set_ib1_ao_ready_c1(uint32_t value)
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004957 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004958 word0 = (((~((1U << 1) - 1)) << 15) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 15);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004959 return *this;
4960 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004961 CONSTEXPR uint32_t get_ob0_valid_c1() const
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004962 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004963 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 16));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004964 return value;
4965 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004966 uint32_t get_ob0_valid_c1() const volatile
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004967 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004968 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 16));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004969 return value;
4970 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004971 CONSTEXPR dma_status1_r &set_ob0_valid_c1(uint32_t value)
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004972 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004973 word0 = (((~((1U << 1) - 1)) << 16) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 16);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004974 return *this;
4975 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004976 CONSTEXPR uint32_t get_ob0_ready_c1() const
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004977 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004978 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 17));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004979 return value;
4980 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004981 uint32_t get_ob0_ready_c1() const volatile
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004982 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004983 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 17));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004984 return value;
4985 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004986 CONSTEXPR dma_status1_r &set_ob0_ready_c1(uint32_t value)
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004987 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004988 word0 = (((~((1U << 1) - 1)) << 17) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 17);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004989 return *this;
4990 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004991 CONSTEXPR uint32_t get_ob1_valid_c1() const
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004992 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004993 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 18));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004994 return value;
4995 }
Jonny Svärd136810f2021-10-13 16:04:26 +02004996 uint32_t get_ob1_valid_c1() const volatile
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004997 {
Jonny Svärd136810f2021-10-13 16:04:26 +02004998 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 18));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02004999 return value;
5000 }
Jonny Svärd136810f2021-10-13 16:04:26 +02005001 CONSTEXPR dma_status1_r &set_ob1_valid_c1(uint32_t value)
Douglas Trohaf6a85da2020-05-11 11:45:28 +02005002 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005003 word0 = (((~((1U << 1) - 1)) << 18) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 18);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02005004 return *this;
5005 }
Jonny Svärd136810f2021-10-13 16:04:26 +02005006 CONSTEXPR uint32_t get_ob1_ready_c1() const
Douglas Trohaf6a85da2020-05-11 11:45:28 +02005007 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005008 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 19));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02005009 return value;
5010 }
Jonny Svärd136810f2021-10-13 16:04:26 +02005011 uint32_t get_ob1_ready_c1() const volatile
Douglas Trohaf6a85da2020-05-11 11:45:28 +02005012 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005013 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 19));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02005014 return value;
5015 }
Jonny Svärd136810f2021-10-13 16:04:26 +02005016 CONSTEXPR dma_status1_r &set_ob1_ready_c1(uint32_t value)
Douglas Trohaf6a85da2020-05-11 11:45:28 +02005017 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005018 word0 = (((~((1U << 1) - 1)) << 19) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 19);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02005019 return *this;
5020 }
Jonny Svärd136810f2021-10-13 16:04:26 +02005021 CONSTEXPR uint32_t get_wd_bitstream_valid_c1() const
Douglas Trohaf6a85da2020-05-11 11:45:28 +02005022 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005023 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 20));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02005024 return value;
5025 }
Jonny Svärd136810f2021-10-13 16:04:26 +02005026 uint32_t get_wd_bitstream_valid_c1() const volatile
Douglas Trohaf6a85da2020-05-11 11:45:28 +02005027 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005028 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 20));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02005029 return value;
5030 }
Jonny Svärd136810f2021-10-13 16:04:26 +02005031 CONSTEXPR dma_status1_r &set_wd_bitstream_valid_c1(uint32_t value)
Douglas Trohaf6a85da2020-05-11 11:45:28 +02005032 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005033 word0 = (((~((1U << 1) - 1)) << 20) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 20);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02005034 return *this;
5035 }
Jonny Svärd136810f2021-10-13 16:04:26 +02005036 CONSTEXPR uint32_t get_wd_bitstream_ready_c1() const
Douglas Trohaf6a85da2020-05-11 11:45:28 +02005037 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005038 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 21));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02005039 return value;
5040 }
Jonny Svärd136810f2021-10-13 16:04:26 +02005041 uint32_t get_wd_bitstream_ready_c1() const volatile
Douglas Trohaf6a85da2020-05-11 11:45:28 +02005042 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005043 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 21));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02005044 return value;
5045 }
Jonny Svärd136810f2021-10-13 16:04:26 +02005046 CONSTEXPR dma_status1_r &set_wd_bitstream_ready_c1(uint32_t value)
Douglas Trohaf6a85da2020-05-11 11:45:28 +02005047 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005048 word0 = (((~((1U << 1) - 1)) << 21) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 21);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02005049 return *this;
5050 }
Jonny Svärd136810f2021-10-13 16:04:26 +02005051 CONSTEXPR uint32_t get_bs_bitstream_valid_c1() const
Douglas Trohaf6a85da2020-05-11 11:45:28 +02005052 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005053 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 22));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02005054 return value;
5055 }
Jonny Svärd136810f2021-10-13 16:04:26 +02005056 uint32_t get_bs_bitstream_valid_c1() const volatile
Douglas Trohaf6a85da2020-05-11 11:45:28 +02005057 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005058 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 22));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02005059 return value;
5060 }
Jonny Svärd136810f2021-10-13 16:04:26 +02005061 CONSTEXPR dma_status1_r &set_bs_bitstream_valid_c1(uint32_t value)
Douglas Trohaf6a85da2020-05-11 11:45:28 +02005062 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005063 word0 = (((~((1U << 1) - 1)) << 22) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 22);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02005064 return *this;
5065 }
Jonny Svärd136810f2021-10-13 16:04:26 +02005066 CONSTEXPR uint32_t get_bs_bitstream_ready_c1() const
Douglas Trohaf6a85da2020-05-11 11:45:28 +02005067 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005068 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 23));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02005069 return value;
5070 }
Jonny Svärd136810f2021-10-13 16:04:26 +02005071 uint32_t get_bs_bitstream_ready_c1() const volatile
Douglas Trohaf6a85da2020-05-11 11:45:28 +02005072 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005073 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 23));
Douglas Trohaf6a85da2020-05-11 11:45:28 +02005074 return value;
5075 }
Jonny Svärd136810f2021-10-13 16:04:26 +02005076 CONSTEXPR dma_status1_r &set_bs_bitstream_ready_c1(uint32_t value)
Douglas Trohaf6a85da2020-05-11 11:45:28 +02005077 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005078 word0 = (((~((1U << 1) - 1)) << 23) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 23);
Douglas Trohaf6a85da2020-05-11 11:45:28 +02005079 return *this;
5080 }
Jonny Svärd136810f2021-10-13 16:04:26 +02005081#endif
Douglas Trohaf6a85da2020-05-11 11:45:28 +02005082};
5083
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005084// clkforce_r - Force clocks on for clock gating
5085struct clkforce_r
5086{
Jonny Svärd136810f2021-10-13 16:04:26 +02005087#ifndef __cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005088 union
5089 {
5090 struct
5091 {
5092 uint32_t top_level_clk : 1; // set to 1 to force on TOP level clock
5093 uint32_t cc_clk : 1; // set to 1 to force on CC clock
5094 uint32_t dma_clk : 1; // set to 1 to force on DMA clock
5095 uint32_t mac_clk : 1; // set to 1 to force on MAC clock
5096 uint32_t ao_clk : 1; // set to 1 to force on AO clock
5097 uint32_t wd_clk : 1; // set to 1 to force on WD clock
5098 uint32_t reserved0 : 26;
5099 };
5100 uint32_t word;
5101 };
Jonny Svärd136810f2021-10-13 16:04:26 +02005102#else
5103 private:
5104 uint32_t word0;
5105
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005106 public:
Jonny Svärd136810f2021-10-13 16:04:26 +02005107 CONSTEXPR clkforce_r() : word0(0) {}
5108 CONSTEXPR clkforce_r(uint32_t init) : word0(init) {}
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005109 CONSTEXPR void operator=(uint32_t value)
5110 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005111 word0 = value;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005112 }
5113 void operator=(uint32_t value) volatile
5114 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005115 word0 = value;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005116 }
5117 CONSTEXPR operator uint32_t()
5118 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005119 return word0;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005120 }
5121 operator uint32_t() volatile
5122 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005123 return word0;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005124 }
5125 clkforce_r copy() volatile
5126 {
5127 return *this;
5128 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005129 CONSTEXPR uint32_t get_top_level_clk() const
5130 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005131 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 0));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005132 return value;
5133 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005134 uint32_t get_top_level_clk() const volatile
5135 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005136 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 0));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005137 return value;
5138 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005139 CONSTEXPR clkforce_r &set_top_level_clk(uint32_t value)
5140 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005141 word0 = (((~((1U << 1) - 1)) << 0) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 0);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005142 return *this;
5143 }
5144 CONSTEXPR uint32_t get_cc_clk() const
5145 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005146 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 1));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005147 return value;
5148 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005149 uint32_t get_cc_clk() const volatile
5150 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005151 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 1));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005152 return value;
5153 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005154 CONSTEXPR clkforce_r &set_cc_clk(uint32_t value)
5155 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005156 word0 = (((~((1U << 1) - 1)) << 1) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 1);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005157 return *this;
5158 }
5159 CONSTEXPR uint32_t get_dma_clk() const
5160 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005161 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 2));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005162 return value;
5163 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005164 uint32_t get_dma_clk() const volatile
5165 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005166 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 2));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005167 return value;
5168 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005169 CONSTEXPR clkforce_r &set_dma_clk(uint32_t value)
5170 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005171 word0 = (((~((1U << 1) - 1)) << 2) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 2);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005172 return *this;
5173 }
5174 CONSTEXPR uint32_t get_mac_clk() const
5175 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005176 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 3));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005177 return value;
5178 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005179 uint32_t get_mac_clk() const volatile
5180 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005181 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 3));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005182 return value;
5183 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005184 CONSTEXPR clkforce_r &set_mac_clk(uint32_t value)
5185 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005186 word0 = (((~((1U << 1) - 1)) << 3) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 3);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005187 return *this;
5188 }
5189 CONSTEXPR uint32_t get_ao_clk() const
5190 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005191 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 4));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005192 return value;
5193 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005194 uint32_t get_ao_clk() const volatile
5195 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005196 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 4));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005197 return value;
5198 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005199 CONSTEXPR clkforce_r &set_ao_clk(uint32_t value)
5200 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005201 word0 = (((~((1U << 1) - 1)) << 4) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 4);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005202 return *this;
5203 }
5204 CONSTEXPR uint32_t get_wd_clk() const
5205 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005206 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 5));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005207 return value;
5208 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005209 uint32_t get_wd_clk() const volatile
5210 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005211 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 5));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005212 return value;
5213 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005214 CONSTEXPR clkforce_r &set_wd_clk(uint32_t value)
5215 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005216 word0 = (((~((1U << 1) - 1)) << 5) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 5);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005217 return *this;
5218 }
Jonny Svärd136810f2021-10-13 16:04:26 +02005219#endif
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005220};
5221
Jonny Svärd136810f2021-10-13 16:04:26 +02005222// debug_address_r - Set debug address for register reads 0x400-0x7FF. The address must be 1KB aligned
5223struct debug_address_r
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005224{
Jonny Svärd136810f2021-10-13 16:04:26 +02005225#ifndef __cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005226 union
5227 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005228 struct
5229 {
5230 uint32_t addr : 32; // Register address
5231 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005232 uint32_t word;
5233 };
Jonny Svärd136810f2021-10-13 16:04:26 +02005234#else
5235 private:
5236 uint32_t word0;
5237
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005238 public:
Jonny Svärd136810f2021-10-13 16:04:26 +02005239 CONSTEXPR debug_address_r() : word0(0) {}
5240 CONSTEXPR debug_address_r(uint32_t init) : word0(init) {}
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005241 CONSTEXPR void operator=(uint32_t value)
5242 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005243 word0 = value;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005244 }
5245 void operator=(uint32_t value) volatile
5246 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005247 word0 = value;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005248 }
5249 CONSTEXPR operator uint32_t()
5250 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005251 return word0;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005252 }
5253 operator uint32_t() volatile
5254 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005255 return word0;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005256 }
Jonny Svärd136810f2021-10-13 16:04:26 +02005257 debug_address_r copy() volatile
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005258 {
5259 return *this;
5260 }
Jonny Svärd136810f2021-10-13 16:04:26 +02005261 CONSTEXPR uint32_t get_addr() const
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005262 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005263 uint32_t value = static_cast<uint32_t>(word0);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005264 return value;
5265 }
Jonny Svärd136810f2021-10-13 16:04:26 +02005266 uint32_t get_addr() const volatile
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005267 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005268 uint32_t value = static_cast<uint32_t>(word0);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005269 return value;
5270 }
Jonny Svärd136810f2021-10-13 16:04:26 +02005271 CONSTEXPR debug_address_r &set_addr(uint32_t value)
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005272 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005273 word0 = static_cast<uint32_t>(value);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005274 return *this;
5275 }
Jonny Svärd136810f2021-10-13 16:04:26 +02005276#endif
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005277};
5278
Jonny Svärd136810f2021-10-13 16:04:26 +02005279// debug_misc_r - 32-bit read/write register for driver debug use. This does not affect NPU function
5280struct debug_misc_r
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005281{
Jonny Svärd136810f2021-10-13 16:04:26 +02005282#ifndef __cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005283 union
5284 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005285 struct
5286 {
5287 uint32_t misc : 32; // Debug misc
5288 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005289 uint32_t word;
5290 };
Jonny Svärd136810f2021-10-13 16:04:26 +02005291#else
5292 private:
5293 uint32_t word0;
5294
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005295 public:
Jonny Svärd136810f2021-10-13 16:04:26 +02005296 CONSTEXPR debug_misc_r() : word0(0) {}
5297 CONSTEXPR debug_misc_r(uint32_t init) : word0(init) {}
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005298 CONSTEXPR void operator=(uint32_t value)
5299 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005300 word0 = value;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005301 }
5302 void operator=(uint32_t value) volatile
5303 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005304 word0 = value;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005305 }
5306 CONSTEXPR operator uint32_t()
5307 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005308 return word0;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005309 }
5310 operator uint32_t() volatile
5311 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005312 return word0;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005313 }
Jonny Svärd136810f2021-10-13 16:04:26 +02005314 debug_misc_r copy() volatile
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005315 {
5316 return *this;
5317 }
Jonny Svärd136810f2021-10-13 16:04:26 +02005318 CONSTEXPR uint32_t get_misc() const
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005319 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005320 uint32_t value = static_cast<uint32_t>(word0);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005321 return value;
5322 }
Jonny Svärd136810f2021-10-13 16:04:26 +02005323 uint32_t get_misc() const volatile
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005324 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005325 uint32_t value = static_cast<uint32_t>(word0);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005326 return value;
5327 }
Jonny Svärd136810f2021-10-13 16:04:26 +02005328 CONSTEXPR debug_misc_r &set_misc(uint32_t value)
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005329 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005330 word0 = static_cast<uint32_t>(value);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005331 return *this;
5332 }
Jonny Svärd136810f2021-10-13 16:04:26 +02005333#endif
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005334};
5335
Jonny Svärd136810f2021-10-13 16:04:26 +02005336// debug_block_r - Set from which of four block banks the TSU registers are read. 0 = read from the current bank 256+n =
5337// force to read from bank n where n is in the range 0 to 3
5338struct debug_block_r
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005339{
Jonny Svärd136810f2021-10-13 16:04:26 +02005340#ifndef __cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005341 union
5342 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005343 struct
5344 {
5345 uint32_t block : 32; // Debug block
5346 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005347 uint32_t word;
5348 };
Jonny Svärd136810f2021-10-13 16:04:26 +02005349#else
5350 private:
5351 uint32_t word0;
5352
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005353 public:
Jonny Svärd136810f2021-10-13 16:04:26 +02005354 CONSTEXPR debug_block_r() : word0(0) {}
5355 CONSTEXPR debug_block_r(uint32_t init) : word0(init) {}
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005356 CONSTEXPR void operator=(uint32_t value)
5357 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005358 word0 = value;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005359 }
5360 void operator=(uint32_t value) volatile
5361 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005362 word0 = value;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005363 }
5364 CONSTEXPR operator uint32_t()
5365 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005366 return word0;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005367 }
5368 operator uint32_t() volatile
5369 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005370 return word0;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005371 }
Jonny Svärd136810f2021-10-13 16:04:26 +02005372 debug_block_r copy() volatile
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005373 {
5374 return *this;
5375 }
Jonny Svärd136810f2021-10-13 16:04:26 +02005376 CONSTEXPR uint32_t get_block() const
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005377 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005378 uint32_t value = static_cast<uint32_t>(word0);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005379 return value;
5380 }
Jonny Svärd136810f2021-10-13 16:04:26 +02005381 uint32_t get_block() const volatile
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005382 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005383 uint32_t value = static_cast<uint32_t>(word0);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005384 return value;
5385 }
Jonny Svärd136810f2021-10-13 16:04:26 +02005386 CONSTEXPR debug_block_r &set_block(uint32_t value)
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005387 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005388 word0 = static_cast<uint32_t>(value);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005389 return *this;
5390 }
Jonny Svärd136810f2021-10-13 16:04:26 +02005391#endif
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005392};
5393
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005394// pmcr_r - PMU Register control
5395struct pmcr_r
5396{
Jonny Svärd136810f2021-10-13 16:04:26 +02005397#ifndef __cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005398 union
5399 {
5400 struct
5401 {
Douglas Trohaf6a85da2020-05-11 11:45:28 +02005402 uint32_t cnt_en : 1; // Enable counter
5403 uint32_t event_cnt_rst : 1; // Reset event counter
5404 uint32_t cycle_cnt_rst : 1; // Reset cycle counter
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005405 uint32_t mask_en : 1; // PMU can be enabled/disabled by command stream operation NPU_OP_PMU_MASK
5406 uint32_t reserved0 : 7;
Douglas Trohaf6a85da2020-05-11 11:45:28 +02005407 uint32_t num_event_cnt : 5; // Number of event counters
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005408 uint32_t reserved1 : 16;
5409 };
5410 uint32_t word;
5411 };
Jonny Svärd136810f2021-10-13 16:04:26 +02005412#else
5413 private:
5414 uint32_t word0;
5415
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005416 public:
Jonny Svärd136810f2021-10-13 16:04:26 +02005417 CONSTEXPR pmcr_r() : word0(8192) {}
5418 CONSTEXPR pmcr_r(uint32_t init) : word0(init) {}
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005419 CONSTEXPR void operator=(uint32_t value)
5420 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005421 word0 = value;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005422 }
5423 void operator=(uint32_t value) volatile
5424 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005425 word0 = value;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005426 }
5427 CONSTEXPR operator uint32_t()
5428 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005429 return word0;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005430 }
5431 operator uint32_t() volatile
5432 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005433 return word0;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005434 }
5435 pmcr_r copy() volatile
5436 {
5437 return *this;
5438 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005439 CONSTEXPR uint32_t get_cnt_en() const
5440 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005441 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 0));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005442 return value;
5443 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005444 uint32_t get_cnt_en() const volatile
5445 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005446 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 0));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005447 return value;
5448 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005449 CONSTEXPR pmcr_r &set_cnt_en(uint32_t value)
5450 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005451 word0 = (((~((1U << 1) - 1)) << 0) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 0);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005452 return *this;
5453 }
5454 CONSTEXPR uint32_t get_event_cnt_rst() const
5455 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005456 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 1));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005457 return value;
5458 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005459 uint32_t get_event_cnt_rst() const volatile
5460 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005461 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 1));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005462 return value;
5463 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005464 CONSTEXPR pmcr_r &set_event_cnt_rst(uint32_t value)
5465 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005466 word0 = (((~((1U << 1) - 1)) << 1) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 1);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005467 return *this;
5468 }
5469 CONSTEXPR uint32_t get_cycle_cnt_rst() const
5470 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005471 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 2));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005472 return value;
5473 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005474 uint32_t get_cycle_cnt_rst() const volatile
5475 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005476 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 2));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005477 return value;
5478 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005479 CONSTEXPR pmcr_r &set_cycle_cnt_rst(uint32_t value)
5480 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005481 word0 = (((~((1U << 1) - 1)) << 2) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 2);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005482 return *this;
5483 }
5484 CONSTEXPR uint32_t get_mask_en() const
5485 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005486 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 3));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005487 return value;
5488 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005489 uint32_t get_mask_en() const volatile
5490 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005491 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 3));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005492 return value;
5493 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005494 CONSTEXPR pmcr_r &set_mask_en(uint32_t value)
5495 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005496 word0 = (((~((1U << 1) - 1)) << 3) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 3);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005497 return *this;
5498 }
5499 CONSTEXPR uint32_t get_num_event_cnt() const
5500 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005501 uint32_t value = static_cast<uint32_t>(((1U << 5) - 1) & (word0 >> 11));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005502 return value;
5503 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005504 uint32_t get_num_event_cnt() const volatile
5505 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005506 uint32_t value = static_cast<uint32_t>(((1U << 5) - 1) & (word0 >> 11));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005507 return value;
5508 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005509 CONSTEXPR pmcr_r &set_num_event_cnt(uint32_t value)
5510 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005511 word0 = (((~((1U << 5) - 1)) << 11) & word0) | ((((1U << 5) - 1) & static_cast<uint32_t>(value)) << 11);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005512 return *this;
5513 }
Jonny Svärd136810f2021-10-13 16:04:26 +02005514#endif
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005515};
5516
5517// pmcntenset_r - Count enable set register
5518struct pmcntenset_r
5519{
Jonny Svärd136810f2021-10-13 16:04:26 +02005520#ifndef __cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005521 union
5522 {
5523 struct
5524 {
5525 uint32_t EVENT_CNT_0 : 1; // Event counter enable bit for PMEVCNTR0
5526 uint32_t EVENT_CNT_1 : 1; // Event counter enable bit for PMEVCNTR1
5527 uint32_t EVENT_CNT_2 : 1; // Event counter enable bit for PMEVCNTR2
5528 uint32_t EVENT_CNT_3 : 1; // Event counter enable bit for PMEVCNTR3
5529 uint32_t reserved0 : 27;
5530 uint32_t CYCLE_CNT : 1; // PMCCNTR enable bit
5531 };
5532 uint32_t word;
5533 };
Jonny Svärd136810f2021-10-13 16:04:26 +02005534#else
5535 private:
5536 uint32_t word0;
5537
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005538 public:
Jonny Svärd136810f2021-10-13 16:04:26 +02005539 CONSTEXPR pmcntenset_r() : word0(0) {}
5540 CONSTEXPR pmcntenset_r(uint32_t init) : word0(init) {}
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005541 CONSTEXPR void operator=(uint32_t value)
5542 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005543 word0 = value;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005544 }
5545 void operator=(uint32_t value) volatile
5546 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005547 word0 = value;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005548 }
5549 CONSTEXPR operator uint32_t()
5550 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005551 return word0;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005552 }
5553 operator uint32_t() volatile
5554 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005555 return word0;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005556 }
5557 pmcntenset_r copy() volatile
5558 {
5559 return *this;
5560 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005561 CONSTEXPR uint32_t get_EVENT_CNT_0() const
5562 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005563 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 0));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005564 return value;
5565 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005566 uint32_t get_EVENT_CNT_0() const volatile
5567 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005568 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 0));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005569 return value;
5570 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005571 CONSTEXPR pmcntenset_r &set_EVENT_CNT_0(uint32_t value)
5572 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005573 word0 = (((~((1U << 1) - 1)) << 0) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 0);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005574 return *this;
5575 }
5576 CONSTEXPR uint32_t get_EVENT_CNT_1() const
5577 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005578 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 1));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005579 return value;
5580 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005581 uint32_t get_EVENT_CNT_1() const volatile
5582 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005583 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 1));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005584 return value;
5585 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005586 CONSTEXPR pmcntenset_r &set_EVENT_CNT_1(uint32_t value)
5587 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005588 word0 = (((~((1U << 1) - 1)) << 1) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 1);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005589 return *this;
5590 }
5591 CONSTEXPR uint32_t get_EVENT_CNT_2() const
5592 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005593 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 2));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005594 return value;
5595 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005596 uint32_t get_EVENT_CNT_2() const volatile
5597 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005598 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 2));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005599 return value;
5600 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005601 CONSTEXPR pmcntenset_r &set_EVENT_CNT_2(uint32_t value)
5602 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005603 word0 = (((~((1U << 1) - 1)) << 2) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 2);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005604 return *this;
5605 }
5606 CONSTEXPR uint32_t get_EVENT_CNT_3() const
5607 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005608 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 3));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005609 return value;
5610 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005611 uint32_t get_EVENT_CNT_3() const volatile
5612 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005613 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 3));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005614 return value;
5615 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005616 CONSTEXPR pmcntenset_r &set_EVENT_CNT_3(uint32_t value)
5617 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005618 word0 = (((~((1U << 1) - 1)) << 3) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 3);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005619 return *this;
5620 }
5621 CONSTEXPR uint32_t get_CYCLE_CNT() const
5622 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005623 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 31));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005624 return value;
5625 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005626 uint32_t get_CYCLE_CNT() const volatile
5627 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005628 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 31));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005629 return value;
5630 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005631 CONSTEXPR pmcntenset_r &set_CYCLE_CNT(uint32_t value)
5632 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005633 word0 = (((~((1U << 1) - 1)) << 31) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 31);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005634 return *this;
5635 }
Jonny Svärd136810f2021-10-13 16:04:26 +02005636#endif
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005637};
5638
5639// pmcntenclr_r - Count enable clear register
5640struct pmcntenclr_r
5641{
Jonny Svärd136810f2021-10-13 16:04:26 +02005642#ifndef __cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005643 union
5644 {
5645 struct
5646 {
5647 uint32_t EVENT_CNT_0 : 1; // Event counter disable bit for PMEVCNTR0
5648 uint32_t EVENT_CNT_1 : 1; // Event counter disable bit for PMEVCNTR1
5649 uint32_t EVENT_CNT_2 : 1; // Event counter disable bit for PMEVCNTR2
5650 uint32_t EVENT_CNT_3 : 1; // Event counter disable bit for PMEVCNTR3
5651 uint32_t reserved0 : 27;
5652 uint32_t CYCLE_CNT : 1; // PMCCNTR disable bit
5653 };
5654 uint32_t word;
5655 };
Jonny Svärd136810f2021-10-13 16:04:26 +02005656#else
5657 private:
5658 uint32_t word0;
5659
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005660 public:
Jonny Svärd136810f2021-10-13 16:04:26 +02005661 CONSTEXPR pmcntenclr_r() : word0(0) {}
5662 CONSTEXPR pmcntenclr_r(uint32_t init) : word0(init) {}
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005663 CONSTEXPR void operator=(uint32_t value)
5664 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005665 word0 = value;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005666 }
5667 void operator=(uint32_t value) volatile
5668 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005669 word0 = value;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005670 }
5671 CONSTEXPR operator uint32_t()
5672 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005673 return word0;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005674 }
5675 operator uint32_t() volatile
5676 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005677 return word0;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005678 }
5679 pmcntenclr_r copy() volatile
5680 {
5681 return *this;
5682 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005683 CONSTEXPR uint32_t get_EVENT_CNT_0() const
5684 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005685 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 0));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005686 return value;
5687 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005688 uint32_t get_EVENT_CNT_0() const volatile
5689 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005690 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 0));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005691 return value;
5692 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005693 CONSTEXPR pmcntenclr_r &set_EVENT_CNT_0(uint32_t value)
5694 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005695 word0 = (((~((1U << 1) - 1)) << 0) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 0);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005696 return *this;
5697 }
5698 CONSTEXPR uint32_t get_EVENT_CNT_1() const
5699 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005700 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 1));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005701 return value;
5702 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005703 uint32_t get_EVENT_CNT_1() const volatile
5704 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005705 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 1));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005706 return value;
5707 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005708 CONSTEXPR pmcntenclr_r &set_EVENT_CNT_1(uint32_t value)
5709 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005710 word0 = (((~((1U << 1) - 1)) << 1) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 1);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005711 return *this;
5712 }
5713 CONSTEXPR uint32_t get_EVENT_CNT_2() const
5714 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005715 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 2));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005716 return value;
5717 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005718 uint32_t get_EVENT_CNT_2() const volatile
5719 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005720 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 2));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005721 return value;
5722 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005723 CONSTEXPR pmcntenclr_r &set_EVENT_CNT_2(uint32_t value)
5724 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005725 word0 = (((~((1U << 1) - 1)) << 2) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 2);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005726 return *this;
5727 }
5728 CONSTEXPR uint32_t get_EVENT_CNT_3() const
5729 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005730 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 3));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005731 return value;
5732 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005733 uint32_t get_EVENT_CNT_3() const volatile
5734 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005735 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 3));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005736 return value;
5737 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005738 CONSTEXPR pmcntenclr_r &set_EVENT_CNT_3(uint32_t value)
5739 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005740 word0 = (((~((1U << 1) - 1)) << 3) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 3);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005741 return *this;
5742 }
5743 CONSTEXPR uint32_t get_CYCLE_CNT() const
5744 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005745 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 31));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005746 return value;
5747 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005748 uint32_t get_CYCLE_CNT() const volatile
5749 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005750 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 31));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005751 return value;
5752 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005753 CONSTEXPR pmcntenclr_r &set_CYCLE_CNT(uint32_t value)
5754 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005755 word0 = (((~((1U << 1) - 1)) << 31) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 31);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005756 return *this;
5757 }
Jonny Svärd136810f2021-10-13 16:04:26 +02005758#endif
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005759};
5760
5761// pmovsset_r - Overflow flag status set register
5762struct pmovsset_r
5763{
Jonny Svärd136810f2021-10-13 16:04:26 +02005764#ifndef __cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005765 union
5766 {
5767 struct
5768 {
5769 uint32_t EVENT_CNT_0_OVF : 1; // Event counter overflow set bit for PMEVCNTR0
5770 uint32_t EVENT_CNT_1_OVF : 1; // Event counter overflow set bit for PMEVCNTR1
5771 uint32_t EVENT_CNT_2_OVF : 1; // Event counter overflow set bit for PMEVCNTR2
5772 uint32_t EVENT_CNT_3_OVF : 1; // Event counter overflow set bit for PMEVCNTR3
5773 uint32_t reserved0 : 27;
5774 uint32_t CYCLE_CNT_OVF : 1; // PMCCNTR overflow set bit
5775 };
5776 uint32_t word;
5777 };
Jonny Svärd136810f2021-10-13 16:04:26 +02005778#else
5779 private:
5780 uint32_t word0;
5781
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005782 public:
Jonny Svärd136810f2021-10-13 16:04:26 +02005783 CONSTEXPR pmovsset_r() : word0(0) {}
5784 CONSTEXPR pmovsset_r(uint32_t init) : word0(init) {}
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005785 CONSTEXPR void operator=(uint32_t value)
5786 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005787 word0 = value;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005788 }
5789 void operator=(uint32_t value) volatile
5790 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005791 word0 = value;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005792 }
5793 CONSTEXPR operator uint32_t()
5794 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005795 return word0;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005796 }
5797 operator uint32_t() volatile
5798 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005799 return word0;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005800 }
5801 pmovsset_r copy() volatile
5802 {
5803 return *this;
5804 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005805 CONSTEXPR uint32_t get_EVENT_CNT_0_OVF() const
5806 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005807 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 0));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005808 return value;
5809 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005810 uint32_t get_EVENT_CNT_0_OVF() const volatile
5811 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005812 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 0));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005813 return value;
5814 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005815 CONSTEXPR pmovsset_r &set_EVENT_CNT_0_OVF(uint32_t value)
5816 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005817 word0 = (((~((1U << 1) - 1)) << 0) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 0);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005818 return *this;
5819 }
5820 CONSTEXPR uint32_t get_EVENT_CNT_1_OVF() const
5821 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005822 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 1));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005823 return value;
5824 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005825 uint32_t get_EVENT_CNT_1_OVF() const volatile
5826 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005827 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 1));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005828 return value;
5829 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005830 CONSTEXPR pmovsset_r &set_EVENT_CNT_1_OVF(uint32_t value)
5831 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005832 word0 = (((~((1U << 1) - 1)) << 1) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 1);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005833 return *this;
5834 }
5835 CONSTEXPR uint32_t get_EVENT_CNT_2_OVF() const
5836 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005837 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 2));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005838 return value;
5839 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005840 uint32_t get_EVENT_CNT_2_OVF() const volatile
5841 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005842 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 2));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005843 return value;
5844 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005845 CONSTEXPR pmovsset_r &set_EVENT_CNT_2_OVF(uint32_t value)
5846 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005847 word0 = (((~((1U << 1) - 1)) << 2) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 2);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005848 return *this;
5849 }
5850 CONSTEXPR uint32_t get_EVENT_CNT_3_OVF() const
5851 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005852 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 3));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005853 return value;
5854 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005855 uint32_t get_EVENT_CNT_3_OVF() const volatile
5856 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005857 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 3));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005858 return value;
5859 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005860 CONSTEXPR pmovsset_r &set_EVENT_CNT_3_OVF(uint32_t value)
5861 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005862 word0 = (((~((1U << 1) - 1)) << 3) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 3);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005863 return *this;
5864 }
5865 CONSTEXPR uint32_t get_CYCLE_CNT_OVF() const
5866 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005867 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 31));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005868 return value;
5869 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005870 uint32_t get_CYCLE_CNT_OVF() const volatile
5871 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005872 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 31));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005873 return value;
5874 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005875 CONSTEXPR pmovsset_r &set_CYCLE_CNT_OVF(uint32_t value)
5876 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005877 word0 = (((~((1U << 1) - 1)) << 31) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 31);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005878 return *this;
5879 }
Jonny Svärd136810f2021-10-13 16:04:26 +02005880#endif
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005881};
5882
5883// pmovsclr_r - Overflow flag status clear register
5884struct pmovsclr_r
5885{
Jonny Svärd136810f2021-10-13 16:04:26 +02005886#ifndef __cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005887 union
5888 {
5889 struct
5890 {
5891 uint32_t EVENT_CNT_0_OVF : 1; // Event counter overflow clear bit for PMEVCNTR0
5892 uint32_t EVENT_CNT_1_OVF : 1; // Event counter overflow clear bit for PMEVCNTR1
5893 uint32_t EVENT_CNT_2_OVF : 1; // Event counter overflow clear bit for PMEVCNTR2
5894 uint32_t EVENT_CNT_3_OVF : 1; // Event counter overflow clear bit for PMEVCNTR3
5895 uint32_t reserved0 : 27;
5896 uint32_t CYCLE_CNT_OVF : 1; // PMCCNTR overflow clear bit
5897 };
5898 uint32_t word;
5899 };
Jonny Svärd136810f2021-10-13 16:04:26 +02005900#else
5901 private:
5902 uint32_t word0;
5903
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005904 public:
Jonny Svärd136810f2021-10-13 16:04:26 +02005905 CONSTEXPR pmovsclr_r() : word0(0) {}
5906 CONSTEXPR pmovsclr_r(uint32_t init) : word0(init) {}
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005907 CONSTEXPR void operator=(uint32_t value)
5908 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005909 word0 = value;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005910 }
5911 void operator=(uint32_t value) volatile
5912 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005913 word0 = value;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005914 }
5915 CONSTEXPR operator uint32_t()
5916 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005917 return word0;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005918 }
5919 operator uint32_t() volatile
5920 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005921 return word0;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005922 }
5923 pmovsclr_r copy() volatile
5924 {
5925 return *this;
5926 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005927 CONSTEXPR uint32_t get_EVENT_CNT_0_OVF() const
5928 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005929 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 0));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005930 return value;
5931 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005932 uint32_t get_EVENT_CNT_0_OVF() const volatile
5933 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005934 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 0));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005935 return value;
5936 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005937 CONSTEXPR pmovsclr_r &set_EVENT_CNT_0_OVF(uint32_t value)
5938 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005939 word0 = (((~((1U << 1) - 1)) << 0) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 0);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005940 return *this;
5941 }
5942 CONSTEXPR uint32_t get_EVENT_CNT_1_OVF() const
5943 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005944 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 1));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005945 return value;
5946 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005947 uint32_t get_EVENT_CNT_1_OVF() const volatile
5948 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005949 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 1));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005950 return value;
5951 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005952 CONSTEXPR pmovsclr_r &set_EVENT_CNT_1_OVF(uint32_t value)
5953 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005954 word0 = (((~((1U << 1) - 1)) << 1) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 1);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005955 return *this;
5956 }
5957 CONSTEXPR uint32_t get_EVENT_CNT_2_OVF() const
5958 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005959 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 2));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005960 return value;
5961 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005962 uint32_t get_EVENT_CNT_2_OVF() const volatile
5963 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005964 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 2));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005965 return value;
5966 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005967 CONSTEXPR pmovsclr_r &set_EVENT_CNT_2_OVF(uint32_t value)
5968 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005969 word0 = (((~((1U << 1) - 1)) << 2) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 2);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005970 return *this;
5971 }
5972 CONSTEXPR uint32_t get_EVENT_CNT_3_OVF() const
5973 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005974 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 3));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005975 return value;
5976 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005977 uint32_t get_EVENT_CNT_3_OVF() const volatile
5978 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005979 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 3));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005980 return value;
5981 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005982 CONSTEXPR pmovsclr_r &set_EVENT_CNT_3_OVF(uint32_t value)
5983 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005984 word0 = (((~((1U << 1) - 1)) << 3) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 3);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005985 return *this;
5986 }
5987 CONSTEXPR uint32_t get_CYCLE_CNT_OVF() const
5988 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005989 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 31));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005990 return value;
5991 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005992 uint32_t get_CYCLE_CNT_OVF() const volatile
5993 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005994 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 31));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005995 return value;
5996 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02005997 CONSTEXPR pmovsclr_r &set_CYCLE_CNT_OVF(uint32_t value)
5998 {
Jonny Svärd136810f2021-10-13 16:04:26 +02005999 word0 = (((~((1U << 1) - 1)) << 31) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 31);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006000 return *this;
6001 }
Jonny Svärd136810f2021-10-13 16:04:26 +02006002#endif
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006003};
6004
6005// pmintset_r - Interrupt enable set register
6006struct pmintset_r
6007{
Jonny Svärd136810f2021-10-13 16:04:26 +02006008#ifndef __cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006009 union
6010 {
6011 struct
6012 {
6013 uint32_t EVENT_CNT_0_INT : 1; // Event counter overflow interrupt request enable bit for PMEVCNTR0
6014 uint32_t EVENT_CNT_1_INT : 1; // Event counter overflow interrupt request enable bit for PMEVCNTR1
6015 uint32_t EVENT_CNT_2_INT : 1; // Event counter overflow interrupt request enable bit for PMEVCNTR2
6016 uint32_t EVENT_CNT_3_INT : 1; // Event counter overflow interrupt request enable bit for PMEVCNTR3
6017 uint32_t reserved0 : 27;
6018 uint32_t CYCLE_CNT_INT : 1; // PMCCNTR overflow interrupt request enable bit
6019 };
6020 uint32_t word;
6021 };
Jonny Svärd136810f2021-10-13 16:04:26 +02006022#else
6023 private:
6024 uint32_t word0;
6025
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006026 public:
Jonny Svärd136810f2021-10-13 16:04:26 +02006027 CONSTEXPR pmintset_r() : word0(0) {}
6028 CONSTEXPR pmintset_r(uint32_t init) : word0(init) {}
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006029 CONSTEXPR void operator=(uint32_t value)
6030 {
Jonny Svärd136810f2021-10-13 16:04:26 +02006031 word0 = value;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006032 }
6033 void operator=(uint32_t value) volatile
6034 {
Jonny Svärd136810f2021-10-13 16:04:26 +02006035 word0 = value;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006036 }
6037 CONSTEXPR operator uint32_t()
6038 {
Jonny Svärd136810f2021-10-13 16:04:26 +02006039 return word0;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006040 }
6041 operator uint32_t() volatile
6042 {
Jonny Svärd136810f2021-10-13 16:04:26 +02006043 return word0;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006044 }
6045 pmintset_r copy() volatile
6046 {
6047 return *this;
6048 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006049 CONSTEXPR uint32_t get_EVENT_CNT_0_INT() const
6050 {
Jonny Svärd136810f2021-10-13 16:04:26 +02006051 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 0));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006052 return value;
6053 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006054 uint32_t get_EVENT_CNT_0_INT() const volatile
6055 {
Jonny Svärd136810f2021-10-13 16:04:26 +02006056 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 0));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006057 return value;
6058 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006059 CONSTEXPR pmintset_r &set_EVENT_CNT_0_INT(uint32_t value)
6060 {
Jonny Svärd136810f2021-10-13 16:04:26 +02006061 word0 = (((~((1U << 1) - 1)) << 0) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 0);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006062 return *this;
6063 }
6064 CONSTEXPR uint32_t get_EVENT_CNT_1_INT() const
6065 {
Jonny Svärd136810f2021-10-13 16:04:26 +02006066 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 1));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006067 return value;
6068 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006069 uint32_t get_EVENT_CNT_1_INT() const volatile
6070 {
Jonny Svärd136810f2021-10-13 16:04:26 +02006071 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 1));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006072 return value;
6073 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006074 CONSTEXPR pmintset_r &set_EVENT_CNT_1_INT(uint32_t value)
6075 {
Jonny Svärd136810f2021-10-13 16:04:26 +02006076 word0 = (((~((1U << 1) - 1)) << 1) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 1);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006077 return *this;
6078 }
6079 CONSTEXPR uint32_t get_EVENT_CNT_2_INT() const
6080 {
Jonny Svärd136810f2021-10-13 16:04:26 +02006081 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 2));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006082 return value;
6083 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006084 uint32_t get_EVENT_CNT_2_INT() const volatile
6085 {
Jonny Svärd136810f2021-10-13 16:04:26 +02006086 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 2));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006087 return value;
6088 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006089 CONSTEXPR pmintset_r &set_EVENT_CNT_2_INT(uint32_t value)
6090 {
Jonny Svärd136810f2021-10-13 16:04:26 +02006091 word0 = (((~((1U << 1) - 1)) << 2) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 2);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006092 return *this;
6093 }
6094 CONSTEXPR uint32_t get_EVENT_CNT_3_INT() const
6095 {
Jonny Svärd136810f2021-10-13 16:04:26 +02006096 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 3));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006097 return value;
6098 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006099 uint32_t get_EVENT_CNT_3_INT() const volatile
6100 {
Jonny Svärd136810f2021-10-13 16:04:26 +02006101 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 3));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006102 return value;
6103 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006104 CONSTEXPR pmintset_r &set_EVENT_CNT_3_INT(uint32_t value)
6105 {
Jonny Svärd136810f2021-10-13 16:04:26 +02006106 word0 = (((~((1U << 1) - 1)) << 3) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 3);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006107 return *this;
6108 }
6109 CONSTEXPR uint32_t get_CYCLE_CNT_INT() const
6110 {
Jonny Svärd136810f2021-10-13 16:04:26 +02006111 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 31));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006112 return value;
6113 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006114 uint32_t get_CYCLE_CNT_INT() const volatile
6115 {
Jonny Svärd136810f2021-10-13 16:04:26 +02006116 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 31));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006117 return value;
6118 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006119 CONSTEXPR pmintset_r &set_CYCLE_CNT_INT(uint32_t value)
6120 {
Jonny Svärd136810f2021-10-13 16:04:26 +02006121 word0 = (((~((1U << 1) - 1)) << 31) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 31);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006122 return *this;
6123 }
Jonny Svärd136810f2021-10-13 16:04:26 +02006124#endif
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006125};
6126
6127// pmintclr_r - Interrupt enable clear register
6128struct pmintclr_r
6129{
Jonny Svärd136810f2021-10-13 16:04:26 +02006130#ifndef __cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006131 union
6132 {
6133 struct
6134 {
6135 uint32_t EVENT_CNT_0_INT : 1; // Event counter overflow interrupt request disable bit for PMEVCNTR0
6136 uint32_t EVENT_CNT_1_INT : 1; // Event counter overflow interrupt request disable bit for PMEVCNTR1
6137 uint32_t EVENT_CNT_2_INT : 1; // Event counter overflow interrupt request disable bit for PMEVCNTR2
6138 uint32_t EVENT_CNT_3_INT : 1; // Event counter overflow interrupt request disable bit for PMEVCNTR3
6139 uint32_t reserved0 : 27;
6140 uint32_t CYCLE_CNT_INT : 1; // PMCCNTR overflow interrupt request disable bit
6141 };
6142 uint32_t word;
6143 };
Jonny Svärd136810f2021-10-13 16:04:26 +02006144#else
6145 private:
6146 uint32_t word0;
6147
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006148 public:
Jonny Svärd136810f2021-10-13 16:04:26 +02006149 CONSTEXPR pmintclr_r() : word0(0) {}
6150 CONSTEXPR pmintclr_r(uint32_t init) : word0(init) {}
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006151 CONSTEXPR void operator=(uint32_t value)
6152 {
Jonny Svärd136810f2021-10-13 16:04:26 +02006153 word0 = value;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006154 }
6155 void operator=(uint32_t value) volatile
6156 {
Jonny Svärd136810f2021-10-13 16:04:26 +02006157 word0 = value;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006158 }
6159 CONSTEXPR operator uint32_t()
6160 {
Jonny Svärd136810f2021-10-13 16:04:26 +02006161 return word0;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006162 }
6163 operator uint32_t() volatile
6164 {
Jonny Svärd136810f2021-10-13 16:04:26 +02006165 return word0;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006166 }
6167 pmintclr_r copy() volatile
6168 {
6169 return *this;
6170 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006171 CONSTEXPR uint32_t get_EVENT_CNT_0_INT() const
6172 {
Jonny Svärd136810f2021-10-13 16:04:26 +02006173 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 0));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006174 return value;
6175 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006176 uint32_t get_EVENT_CNT_0_INT() const volatile
6177 {
Jonny Svärd136810f2021-10-13 16:04:26 +02006178 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 0));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006179 return value;
6180 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006181 CONSTEXPR pmintclr_r &set_EVENT_CNT_0_INT(uint32_t value)
6182 {
Jonny Svärd136810f2021-10-13 16:04:26 +02006183 word0 = (((~((1U << 1) - 1)) << 0) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 0);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006184 return *this;
6185 }
6186 CONSTEXPR uint32_t get_EVENT_CNT_1_INT() const
6187 {
Jonny Svärd136810f2021-10-13 16:04:26 +02006188 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 1));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006189 return value;
6190 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006191 uint32_t get_EVENT_CNT_1_INT() const volatile
6192 {
Jonny Svärd136810f2021-10-13 16:04:26 +02006193 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 1));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006194 return value;
6195 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006196 CONSTEXPR pmintclr_r &set_EVENT_CNT_1_INT(uint32_t value)
6197 {
Jonny Svärd136810f2021-10-13 16:04:26 +02006198 word0 = (((~((1U << 1) - 1)) << 1) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 1);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006199 return *this;
6200 }
6201 CONSTEXPR uint32_t get_EVENT_CNT_2_INT() const
6202 {
Jonny Svärd136810f2021-10-13 16:04:26 +02006203 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 2));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006204 return value;
6205 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006206 uint32_t get_EVENT_CNT_2_INT() const volatile
6207 {
Jonny Svärd136810f2021-10-13 16:04:26 +02006208 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 2));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006209 return value;
6210 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006211 CONSTEXPR pmintclr_r &set_EVENT_CNT_2_INT(uint32_t value)
6212 {
Jonny Svärd136810f2021-10-13 16:04:26 +02006213 word0 = (((~((1U << 1) - 1)) << 2) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 2);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006214 return *this;
6215 }
6216 CONSTEXPR uint32_t get_EVENT_CNT_3_INT() const
6217 {
Jonny Svärd136810f2021-10-13 16:04:26 +02006218 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 3));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006219 return value;
6220 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006221 uint32_t get_EVENT_CNT_3_INT() const volatile
6222 {
Jonny Svärd136810f2021-10-13 16:04:26 +02006223 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 3));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006224 return value;
6225 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006226 CONSTEXPR pmintclr_r &set_EVENT_CNT_3_INT(uint32_t value)
6227 {
Jonny Svärd136810f2021-10-13 16:04:26 +02006228 word0 = (((~((1U << 1) - 1)) << 3) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 3);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006229 return *this;
6230 }
6231 CONSTEXPR uint32_t get_CYCLE_CNT_INT() const
6232 {
Jonny Svärd136810f2021-10-13 16:04:26 +02006233 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 31));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006234 return value;
6235 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006236 uint32_t get_CYCLE_CNT_INT() const volatile
6237 {
Jonny Svärd136810f2021-10-13 16:04:26 +02006238 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 31));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006239 return value;
6240 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006241 CONSTEXPR pmintclr_r &set_CYCLE_CNT_INT(uint32_t value)
6242 {
Jonny Svärd136810f2021-10-13 16:04:26 +02006243 word0 = (((~((1U << 1) - 1)) << 31) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 31);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006244 return *this;
6245 }
Jonny Svärd136810f2021-10-13 16:04:26 +02006246#endif
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006247};
6248
Jonny Svärd136810f2021-10-13 16:04:26 +02006249// pmccntr_r - Performance monitor cycle count register
6250struct pmccntr_r
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006251{
Jonny Svärd136810f2021-10-13 16:04:26 +02006252#ifndef __cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006253 union
6254 {
6255 struct
6256 {
Jonny Svärd136810f2021-10-13 16:04:26 +02006257 uint32_t CYCLE_CNT_LO : 32; // Cycle count - LSB
6258 uint32_t CYCLE_CNT_HI : 16; // Cycle count - MSB
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006259 uint32_t reserved0 : 16;
6260 };
Jonny Svärd136810f2021-10-13 16:04:26 +02006261 uint32_t word[2];
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006262 };
Jonny Svärd136810f2021-10-13 16:04:26 +02006263#else
6264 private:
6265 uint32_t word0;
6266 uint32_t word1;
6267
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006268 public:
Jonny Svärd136810f2021-10-13 16:04:26 +02006269 CONSTEXPR pmccntr_r() : word0(0), word1(0) {}
6270 CONSTEXPR pmccntr_r(uint64_t init) :
6271 word0(static_cast<uint32_t>((init) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()))),
6272 word1(static_cast<uint32_t>((init >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max())))
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006273 {
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006274 }
Jonny Svärd136810f2021-10-13 16:04:26 +02006275 CONSTEXPR void operator=(uint64_t value)
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006276 {
Jonny Svärd136810f2021-10-13 16:04:26 +02006277 word0 = static_cast<uint32_t>((value) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
6278 word1 = static_cast<uint32_t>((value >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006279 }
Jonny Svärd136810f2021-10-13 16:04:26 +02006280 void operator=(uint64_t value) volatile
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006281 {
Jonny Svärd136810f2021-10-13 16:04:26 +02006282 word0 = static_cast<uint32_t>((value) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
6283 word1 = static_cast<uint32_t>((value >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006284 }
Jonny Svärd136810f2021-10-13 16:04:26 +02006285 CONSTEXPR operator uint64_t()
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006286 {
Jonny Svärd136810f2021-10-13 16:04:26 +02006287 return (static_cast<uint64_t>(word1) << 32) | word0;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006288 }
Jonny Svärd136810f2021-10-13 16:04:26 +02006289 operator uint64_t() volatile
6290 {
6291 return (static_cast<uint64_t>(word1) << 32) | word0;
6292 }
6293 pmccntr_r copy() volatile
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006294 {
6295 return *this;
6296 }
Jonny Svärd136810f2021-10-13 16:04:26 +02006297#endif
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006298};
6299
6300// pmccntr_cfg_r - Set start/stop event on the cycle counter
6301struct pmccntr_cfg_r
6302{
Jonny Svärd136810f2021-10-13 16:04:26 +02006303#ifndef __cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006304 union
6305 {
6306 struct
6307 {
6308 uint32_t CYCLE_CNT_CFG_START : 10; // Cycle counter start event
6309 uint32_t reserved0 : 6;
6310 uint32_t CYCLE_CNT_CFG_STOP : 10; // Cycle counter stop event
6311 uint32_t reserved1 : 6;
6312 };
6313 uint32_t word;
6314 };
Jonny Svärd136810f2021-10-13 16:04:26 +02006315#else
6316 private:
6317 uint32_t word0;
6318
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006319 public:
Jonny Svärd136810f2021-10-13 16:04:26 +02006320 CONSTEXPR pmccntr_cfg_r() : word0(0) {}
6321 CONSTEXPR pmccntr_cfg_r(uint32_t init) : word0(init) {}
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006322 CONSTEXPR void operator=(uint32_t value)
6323 {
Jonny Svärd136810f2021-10-13 16:04:26 +02006324 word0 = value;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006325 }
6326 void operator=(uint32_t value) volatile
6327 {
Jonny Svärd136810f2021-10-13 16:04:26 +02006328 word0 = value;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006329 }
6330 CONSTEXPR operator uint32_t()
6331 {
Jonny Svärd136810f2021-10-13 16:04:26 +02006332 return word0;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006333 }
6334 operator uint32_t() volatile
6335 {
Jonny Svärd136810f2021-10-13 16:04:26 +02006336 return word0;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006337 }
6338 pmccntr_cfg_r copy() volatile
6339 {
6340 return *this;
6341 }
Jonny Svärd136810f2021-10-13 16:04:26 +02006342 CONSTEXPR NPU_NAMESPACE::pmu_event get_CYCLE_CNT_CFG_START() const
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006343 {
Jonny Svärd136810f2021-10-13 16:04:26 +02006344 NPU_NAMESPACE::pmu_event value = static_cast<NPU_NAMESPACE::pmu_event>(((1U << 10) - 1) & (word0 >> 0));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006345 return value;
6346 }
Jonny Svärd136810f2021-10-13 16:04:26 +02006347 NPU_NAMESPACE::pmu_event get_CYCLE_CNT_CFG_START() const volatile
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006348 {
Jonny Svärd136810f2021-10-13 16:04:26 +02006349 NPU_NAMESPACE::pmu_event value = static_cast<NPU_NAMESPACE::pmu_event>(((1U << 10) - 1) & (word0 >> 0));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006350 return value;
6351 }
Jonny Svärd136810f2021-10-13 16:04:26 +02006352 CONSTEXPR pmccntr_cfg_r &set_CYCLE_CNT_CFG_START(NPU_NAMESPACE::pmu_event value)
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006353 {
Jonny Svärd136810f2021-10-13 16:04:26 +02006354 word0 = (((~((1U << 10) - 1)) << 0) & word0) | ((((1U << 10) - 1) & static_cast<uint32_t>(value)) << 0);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006355 return *this;
6356 }
Jonny Svärd136810f2021-10-13 16:04:26 +02006357 CONSTEXPR NPU_NAMESPACE::pmu_event get_CYCLE_CNT_CFG_STOP() const
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006358 {
Jonny Svärd136810f2021-10-13 16:04:26 +02006359 NPU_NAMESPACE::pmu_event value = static_cast<NPU_NAMESPACE::pmu_event>(((1U << 10) - 1) & (word0 >> 16));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006360 return value;
6361 }
Jonny Svärd136810f2021-10-13 16:04:26 +02006362 NPU_NAMESPACE::pmu_event get_CYCLE_CNT_CFG_STOP() const volatile
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006363 {
Jonny Svärd136810f2021-10-13 16:04:26 +02006364 NPU_NAMESPACE::pmu_event value = static_cast<NPU_NAMESPACE::pmu_event>(((1U << 10) - 1) & (word0 >> 16));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006365 return value;
6366 }
Jonny Svärd136810f2021-10-13 16:04:26 +02006367 CONSTEXPR pmccntr_cfg_r &set_CYCLE_CNT_CFG_STOP(NPU_NAMESPACE::pmu_event value)
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006368 {
Jonny Svärd136810f2021-10-13 16:04:26 +02006369 word0 = (((~((1U << 10) - 1)) << 16) & word0) | ((((1U << 10) - 1) & static_cast<uint32_t>(value)) << 16);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006370 return *this;
6371 }
Jonny Svärd136810f2021-10-13 16:04:26 +02006372#endif
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006373};
6374
Douglas Trohaf6a85da2020-05-11 11:45:28 +02006375// pmcaxi_chan_r - Set which AXI channel to monitor for latency measurements in PMU
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006376struct pmcaxi_chan_r
6377{
Jonny Svärd136810f2021-10-13 16:04:26 +02006378#ifndef __cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006379 union
6380 {
6381 struct
6382 {
Jonny Svärd136810f2021-10-13 16:04:26 +02006383 uint32_t CH_SEL : 4; // Channel select for latency measurements
Douglas Trohaf6a85da2020-05-11 11:45:28 +02006384 uint32_t reserved0 : 4;
Jonny Svärd136810f2021-10-13 16:04:26 +02006385 uint32_t AXI_CNT_SEL : 2; // AXI counter to monitor for latency measurements
6386 uint32_t BW_CH_SEL_EN : 1; // Bandwidth channel selector
Douglas Trohaf6a85da2020-05-11 11:45:28 +02006387 uint32_t reserved1 : 21;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006388 };
6389 uint32_t word;
6390 };
Jonny Svärd136810f2021-10-13 16:04:26 +02006391#else
6392 private:
6393 uint32_t word0;
6394
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006395 public:
Jonny Svärd136810f2021-10-13 16:04:26 +02006396 CONSTEXPR pmcaxi_chan_r() : word0(0) {}
6397 CONSTEXPR pmcaxi_chan_r(uint32_t init) : word0(init) {}
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006398 CONSTEXPR void operator=(uint32_t value)
6399 {
Jonny Svärd136810f2021-10-13 16:04:26 +02006400 word0 = value;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006401 }
6402 void operator=(uint32_t value) volatile
6403 {
Jonny Svärd136810f2021-10-13 16:04:26 +02006404 word0 = value;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006405 }
6406 CONSTEXPR operator uint32_t()
6407 {
Jonny Svärd136810f2021-10-13 16:04:26 +02006408 return word0;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006409 }
6410 operator uint32_t() volatile
6411 {
Jonny Svärd136810f2021-10-13 16:04:26 +02006412 return word0;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006413 }
6414 pmcaxi_chan_r copy() volatile
6415 {
6416 return *this;
6417 }
Jonny Svärd136810f2021-10-13 16:04:26 +02006418 CONSTEXPR NPU_NAMESPACE::pmu_axi_channel get_CH_SEL() const
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006419 {
Jonny Svärd136810f2021-10-13 16:04:26 +02006420 NPU_NAMESPACE::pmu_axi_channel value =
6421 static_cast<NPU_NAMESPACE::pmu_axi_channel>(((1U << 4) - 1) & (word0 >> 0));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006422 return value;
6423 }
Jonny Svärd136810f2021-10-13 16:04:26 +02006424 NPU_NAMESPACE::pmu_axi_channel get_CH_SEL() const volatile
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006425 {
Jonny Svärd136810f2021-10-13 16:04:26 +02006426 NPU_NAMESPACE::pmu_axi_channel value =
6427 static_cast<NPU_NAMESPACE::pmu_axi_channel>(((1U << 4) - 1) & (word0 >> 0));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006428 return value;
6429 }
Jonny Svärd136810f2021-10-13 16:04:26 +02006430 CONSTEXPR pmcaxi_chan_r &set_CH_SEL(NPU_NAMESPACE::pmu_axi_channel value)
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006431 {
Jonny Svärd136810f2021-10-13 16:04:26 +02006432 word0 = (((~((1U << 4) - 1)) << 0) & word0) | ((((1U << 4) - 1) & static_cast<uint32_t>(value)) << 0);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006433 return *this;
6434 }
Douglas Trohaf6a85da2020-05-11 11:45:28 +02006435 CONSTEXPR uint32_t get_AXI_CNT_SEL() const
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006436 {
Jonny Svärd136810f2021-10-13 16:04:26 +02006437 uint32_t value = static_cast<uint32_t>(((1U << 2) - 1) & (word0 >> 8));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006438 return value;
6439 }
Douglas Trohaf6a85da2020-05-11 11:45:28 +02006440 uint32_t get_AXI_CNT_SEL() const volatile
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006441 {
Jonny Svärd136810f2021-10-13 16:04:26 +02006442 uint32_t value = static_cast<uint32_t>(((1U << 2) - 1) & (word0 >> 8));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006443 return value;
6444 }
Douglas Trohaf6a85da2020-05-11 11:45:28 +02006445 CONSTEXPR pmcaxi_chan_r &set_AXI_CNT_SEL(uint32_t value)
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006446 {
Jonny Svärd136810f2021-10-13 16:04:26 +02006447 word0 = (((~((1U << 2) - 1)) << 8) & word0) | ((((1U << 2) - 1) & static_cast<uint32_t>(value)) << 8);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006448 return *this;
6449 }
Douglas Trohaf6a85da2020-05-11 11:45:28 +02006450 CONSTEXPR uint32_t get_BW_CH_SEL_EN() const
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006451 {
Jonny Svärd136810f2021-10-13 16:04:26 +02006452 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 10));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006453 return value;
6454 }
Douglas Trohaf6a85da2020-05-11 11:45:28 +02006455 uint32_t get_BW_CH_SEL_EN() const volatile
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006456 {
Jonny Svärd136810f2021-10-13 16:04:26 +02006457 uint32_t value = static_cast<uint32_t>(((1U << 1) - 1) & (word0 >> 10));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006458 return value;
6459 }
Douglas Trohaf6a85da2020-05-11 11:45:28 +02006460 CONSTEXPR pmcaxi_chan_r &set_BW_CH_SEL_EN(uint32_t value)
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006461 {
Jonny Svärd136810f2021-10-13 16:04:26 +02006462 word0 = (((~((1U << 1) - 1)) << 10) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 10);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006463 return *this;
6464 }
Jonny Svärd136810f2021-10-13 16:04:26 +02006465#endif
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006466};
6467
Jonny Svärd136810f2021-10-13 16:04:26 +02006468// kernel_x_r - Kernel X offset of in kernel decomposition
6469struct kernel_x_r
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006470{
Jonny Svärd136810f2021-10-13 16:04:26 +02006471#ifndef __cplusplus
6472 union
6473 {
6474 struct
6475 {
6476 uint32_t value : 32; // 32-bit register value
6477 };
6478 uint32_t word;
6479 };
6480#else
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02006481 private:
Jonny Svärd136810f2021-10-13 16:04:26 +02006482 uint32_t word0;
6483
6484 public:
6485 CONSTEXPR kernel_x_r() : word0(0) {}
6486 CONSTEXPR kernel_x_r(uint32_t init) : word0(init) {}
6487 CONSTEXPR void operator=(uint32_t value)
6488 {
6489 word0 = value;
6490 }
6491 void operator=(uint32_t value) volatile
6492 {
6493 word0 = value;
6494 }
6495 CONSTEXPR operator uint32_t()
6496 {
6497 return word0;
6498 }
6499 operator uint32_t() volatile
6500 {
6501 return word0;
6502 }
6503 kernel_x_r copy() volatile
6504 {
6505 return *this;
6506 }
6507 CONSTEXPR uint32_t get_value() const
6508 {
6509 uint32_t value = static_cast<uint32_t>(word0);
6510 return value;
6511 }
6512 uint32_t get_value() const volatile
6513 {
6514 uint32_t value = static_cast<uint32_t>(word0);
6515 return value;
6516 }
6517 CONSTEXPR kernel_x_r &set_value(uint32_t value)
6518 {
6519 word0 = static_cast<uint32_t>(value);
6520 return *this;
6521 }
6522#endif
6523};
6524
6525// kernel_y_r - Kernel Y offset of in kernel decomposition
6526struct kernel_y_r
6527{
6528#ifndef __cplusplus
6529 union
6530 {
6531 struct
6532 {
6533 uint32_t value : 32; // 32-bit register value
6534 };
6535 uint32_t word;
6536 };
6537#else
6538 private:
6539 uint32_t word0;
6540
6541 public:
6542 CONSTEXPR kernel_y_r() : word0(0) {}
6543 CONSTEXPR kernel_y_r(uint32_t init) : word0(init) {}
6544 CONSTEXPR void operator=(uint32_t value)
6545 {
6546 word0 = value;
6547 }
6548 void operator=(uint32_t value) volatile
6549 {
6550 word0 = value;
6551 }
6552 CONSTEXPR operator uint32_t()
6553 {
6554 return word0;
6555 }
6556 operator uint32_t() volatile
6557 {
6558 return word0;
6559 }
6560 kernel_y_r copy() volatile
6561 {
6562 return *this;
6563 }
6564 CONSTEXPR uint32_t get_value() const
6565 {
6566 uint32_t value = static_cast<uint32_t>(word0);
6567 return value;
6568 }
6569 uint32_t get_value() const volatile
6570 {
6571 uint32_t value = static_cast<uint32_t>(word0);
6572 return value;
6573 }
6574 CONSTEXPR kernel_y_r &set_value(uint32_t value)
6575 {
6576 word0 = static_cast<uint32_t>(value);
6577 return *this;
6578 }
6579#endif
6580};
6581
6582// kernel_w_m1_r - Kernel (width-1) of current block
6583struct kernel_w_m1_r
6584{
6585#ifndef __cplusplus
6586 union
6587 {
6588 struct
6589 {
6590 uint32_t value : 32; // 32-bit register value
6591 };
6592 uint32_t word;
6593 };
6594#else
6595 private:
6596 uint32_t word0;
6597
6598 public:
6599 CONSTEXPR kernel_w_m1_r() : word0(0) {}
6600 CONSTEXPR kernel_w_m1_r(uint32_t init) : word0(init) {}
6601 CONSTEXPR void operator=(uint32_t value)
6602 {
6603 word0 = value;
6604 }
6605 void operator=(uint32_t value) volatile
6606 {
6607 word0 = value;
6608 }
6609 CONSTEXPR operator uint32_t()
6610 {
6611 return word0;
6612 }
6613 operator uint32_t() volatile
6614 {
6615 return word0;
6616 }
6617 kernel_w_m1_r copy() volatile
6618 {
6619 return *this;
6620 }
6621 CONSTEXPR uint32_t get_value() const
6622 {
6623 uint32_t value = static_cast<uint32_t>(word0);
6624 return value;
6625 }
6626 uint32_t get_value() const volatile
6627 {
6628 uint32_t value = static_cast<uint32_t>(word0);
6629 return value;
6630 }
6631 CONSTEXPR kernel_w_m1_r &set_value(uint32_t value)
6632 {
6633 word0 = static_cast<uint32_t>(value);
6634 return *this;
6635 }
6636#endif
6637};
6638
6639// kernel_h_m1_r - Kernel (height-1) of current block
6640struct kernel_h_m1_r
6641{
6642#ifndef __cplusplus
6643 union
6644 {
6645 struct
6646 {
6647 uint32_t value : 32; // 32-bit register value
6648 };
6649 uint32_t word;
6650 };
6651#else
6652 private:
6653 uint32_t word0;
6654
6655 public:
6656 CONSTEXPR kernel_h_m1_r() : word0(0) {}
6657 CONSTEXPR kernel_h_m1_r(uint32_t init) : word0(init) {}
6658 CONSTEXPR void operator=(uint32_t value)
6659 {
6660 word0 = value;
6661 }
6662 void operator=(uint32_t value) volatile
6663 {
6664 word0 = value;
6665 }
6666 CONSTEXPR operator uint32_t()
6667 {
6668 return word0;
6669 }
6670 operator uint32_t() volatile
6671 {
6672 return word0;
6673 }
6674 kernel_h_m1_r copy() volatile
6675 {
6676 return *this;
6677 }
6678 CONSTEXPR uint32_t get_value() const
6679 {
6680 uint32_t value = static_cast<uint32_t>(word0);
6681 return value;
6682 }
6683 uint32_t get_value() const volatile
6684 {
6685 uint32_t value = static_cast<uint32_t>(word0);
6686 return value;
6687 }
6688 CONSTEXPR kernel_h_m1_r &set_value(uint32_t value)
6689 {
6690 word0 = static_cast<uint32_t>(value);
6691 return *this;
6692 }
6693#endif
6694};
6695
6696// ofm_cblk_width_m1_r - OFM current block (width-1)
6697struct ofm_cblk_width_m1_r
6698{
6699#ifndef __cplusplus
6700 union
6701 {
6702 struct
6703 {
6704 uint32_t value : 32; // 32-bit register value
6705 };
6706 uint32_t word;
6707 };
6708#else
6709 private:
6710 uint32_t word0;
6711
6712 public:
6713 CONSTEXPR ofm_cblk_width_m1_r() : word0(0) {}
6714 CONSTEXPR ofm_cblk_width_m1_r(uint32_t init) : word0(init) {}
6715 CONSTEXPR void operator=(uint32_t value)
6716 {
6717 word0 = value;
6718 }
6719 void operator=(uint32_t value) volatile
6720 {
6721 word0 = value;
6722 }
6723 CONSTEXPR operator uint32_t()
6724 {
6725 return word0;
6726 }
6727 operator uint32_t() volatile
6728 {
6729 return word0;
6730 }
6731 ofm_cblk_width_m1_r copy() volatile
6732 {
6733 return *this;
6734 }
6735 CONSTEXPR uint32_t get_value() const
6736 {
6737 uint32_t value = static_cast<uint32_t>(word0);
6738 return value;
6739 }
6740 uint32_t get_value() const volatile
6741 {
6742 uint32_t value = static_cast<uint32_t>(word0);
6743 return value;
6744 }
6745 CONSTEXPR ofm_cblk_width_m1_r &set_value(uint32_t value)
6746 {
6747 word0 = static_cast<uint32_t>(value);
6748 return *this;
6749 }
6750#endif
6751};
6752
6753// ofm_cblk_height_m1_r - OFM current block (height-1)
6754struct ofm_cblk_height_m1_r
6755{
6756#ifndef __cplusplus
6757 union
6758 {
6759 struct
6760 {
6761 uint32_t value : 32; // 32-bit register value
6762 };
6763 uint32_t word;
6764 };
6765#else
6766 private:
6767 uint32_t word0;
6768
6769 public:
6770 CONSTEXPR ofm_cblk_height_m1_r() : word0(0) {}
6771 CONSTEXPR ofm_cblk_height_m1_r(uint32_t init) : word0(init) {}
6772 CONSTEXPR void operator=(uint32_t value)
6773 {
6774 word0 = value;
6775 }
6776 void operator=(uint32_t value) volatile
6777 {
6778 word0 = value;
6779 }
6780 CONSTEXPR operator uint32_t()
6781 {
6782 return word0;
6783 }
6784 operator uint32_t() volatile
6785 {
6786 return word0;
6787 }
6788 ofm_cblk_height_m1_r copy() volatile
6789 {
6790 return *this;
6791 }
6792 CONSTEXPR uint32_t get_value() const
6793 {
6794 uint32_t value = static_cast<uint32_t>(word0);
6795 return value;
6796 }
6797 uint32_t get_value() const volatile
6798 {
6799 uint32_t value = static_cast<uint32_t>(word0);
6800 return value;
6801 }
6802 CONSTEXPR ofm_cblk_height_m1_r &set_value(uint32_t value)
6803 {
6804 word0 = static_cast<uint32_t>(value);
6805 return *this;
6806 }
6807#endif
6808};
6809
6810// ofm_cblk_depth_m1_r - OFM current block (depth-1)
6811struct ofm_cblk_depth_m1_r
6812{
6813#ifndef __cplusplus
6814 union
6815 {
6816 struct
6817 {
6818 uint32_t value : 32; // 32-bit register value
6819 };
6820 uint32_t word;
6821 };
6822#else
6823 private:
6824 uint32_t word0;
6825
6826 public:
6827 CONSTEXPR ofm_cblk_depth_m1_r() : word0(0) {}
6828 CONSTEXPR ofm_cblk_depth_m1_r(uint32_t init) : word0(init) {}
6829 CONSTEXPR void operator=(uint32_t value)
6830 {
6831 word0 = value;
6832 }
6833 void operator=(uint32_t value) volatile
6834 {
6835 word0 = value;
6836 }
6837 CONSTEXPR operator uint32_t()
6838 {
6839 return word0;
6840 }
6841 operator uint32_t() volatile
6842 {
6843 return word0;
6844 }
6845 ofm_cblk_depth_m1_r copy() volatile
6846 {
6847 return *this;
6848 }
6849 CONSTEXPR uint32_t get_value() const
6850 {
6851 uint32_t value = static_cast<uint32_t>(word0);
6852 return value;
6853 }
6854 uint32_t get_value() const volatile
6855 {
6856 uint32_t value = static_cast<uint32_t>(word0);
6857 return value;
6858 }
6859 CONSTEXPR ofm_cblk_depth_m1_r &set_value(uint32_t value)
6860 {
6861 word0 = static_cast<uint32_t>(value);
6862 return *this;
6863 }
6864#endif
6865};
6866
6867// ifm_cblk_depth_m1_r - IFM current block (depth-1)
6868struct ifm_cblk_depth_m1_r
6869{
6870#ifndef __cplusplus
6871 union
6872 {
6873 struct
6874 {
6875 uint32_t value : 32; // 32-bit register value
6876 };
6877 uint32_t word;
6878 };
6879#else
6880 private:
6881 uint32_t word0;
6882
6883 public:
6884 CONSTEXPR ifm_cblk_depth_m1_r() : word0(0) {}
6885 CONSTEXPR ifm_cblk_depth_m1_r(uint32_t init) : word0(init) {}
6886 CONSTEXPR void operator=(uint32_t value)
6887 {
6888 word0 = value;
6889 }
6890 void operator=(uint32_t value) volatile
6891 {
6892 word0 = value;
6893 }
6894 CONSTEXPR operator uint32_t()
6895 {
6896 return word0;
6897 }
6898 operator uint32_t() volatile
6899 {
6900 return word0;
6901 }
6902 ifm_cblk_depth_m1_r copy() volatile
6903 {
6904 return *this;
6905 }
6906 CONSTEXPR uint32_t get_value() const
6907 {
6908 uint32_t value = static_cast<uint32_t>(word0);
6909 return value;
6910 }
6911 uint32_t get_value() const volatile
6912 {
6913 uint32_t value = static_cast<uint32_t>(word0);
6914 return value;
6915 }
6916 CONSTEXPR ifm_cblk_depth_m1_r &set_value(uint32_t value)
6917 {
6918 word0 = static_cast<uint32_t>(value);
6919 return *this;
6920 }
6921#endif
6922};
6923
6924// ofm_x_r - Block X coordinate in OFM
6925struct ofm_x_r
6926{
6927#ifndef __cplusplus
6928 union
6929 {
6930 struct
6931 {
6932 uint32_t value : 32; // 32-bit register value
6933 };
6934 uint32_t word;
6935 };
6936#else
6937 private:
6938 uint32_t word0;
6939
6940 public:
6941 CONSTEXPR ofm_x_r() : word0(0) {}
6942 CONSTEXPR ofm_x_r(uint32_t init) : word0(init) {}
6943 CONSTEXPR void operator=(uint32_t value)
6944 {
6945 word0 = value;
6946 }
6947 void operator=(uint32_t value) volatile
6948 {
6949 word0 = value;
6950 }
6951 CONSTEXPR operator uint32_t()
6952 {
6953 return word0;
6954 }
6955 operator uint32_t() volatile
6956 {
6957 return word0;
6958 }
6959 ofm_x_r copy() volatile
6960 {
6961 return *this;
6962 }
6963 CONSTEXPR uint32_t get_value() const
6964 {
6965 uint32_t value = static_cast<uint32_t>(word0);
6966 return value;
6967 }
6968 uint32_t get_value() const volatile
6969 {
6970 uint32_t value = static_cast<uint32_t>(word0);
6971 return value;
6972 }
6973 CONSTEXPR ofm_x_r &set_value(uint32_t value)
6974 {
6975 word0 = static_cast<uint32_t>(value);
6976 return *this;
6977 }
6978#endif
6979};
6980
6981// ofm_y_r - Block Y coordinate in OFM
6982struct ofm_y_r
6983{
6984#ifndef __cplusplus
6985 union
6986 {
6987 struct
6988 {
6989 uint32_t value : 32; // 32-bit register value
6990 };
6991 uint32_t word;
6992 };
6993#else
6994 private:
6995 uint32_t word0;
6996
6997 public:
6998 CONSTEXPR ofm_y_r() : word0(0) {}
6999 CONSTEXPR ofm_y_r(uint32_t init) : word0(init) {}
7000 CONSTEXPR void operator=(uint32_t value)
7001 {
7002 word0 = value;
7003 }
7004 void operator=(uint32_t value) volatile
7005 {
7006 word0 = value;
7007 }
7008 CONSTEXPR operator uint32_t()
7009 {
7010 return word0;
7011 }
7012 operator uint32_t() volatile
7013 {
7014 return word0;
7015 }
7016 ofm_y_r copy() volatile
7017 {
7018 return *this;
7019 }
7020 CONSTEXPR uint32_t get_value() const
7021 {
7022 uint32_t value = static_cast<uint32_t>(word0);
7023 return value;
7024 }
7025 uint32_t get_value() const volatile
7026 {
7027 uint32_t value = static_cast<uint32_t>(word0);
7028 return value;
7029 }
7030 CONSTEXPR ofm_y_r &set_value(uint32_t value)
7031 {
7032 word0 = static_cast<uint32_t>(value);
7033 return *this;
7034 }
7035#endif
7036};
7037
7038// ofm_z_r - Block Z (channel) coordinate in OFM
7039struct ofm_z_r
7040{
7041#ifndef __cplusplus
7042 union
7043 {
7044 struct
7045 {
7046 uint32_t value : 32; // 32-bit register value
7047 };
7048 uint32_t word;
7049 };
7050#else
7051 private:
7052 uint32_t word0;
7053
7054 public:
7055 CONSTEXPR ofm_z_r() : word0(0) {}
7056 CONSTEXPR ofm_z_r(uint32_t init) : word0(init) {}
7057 CONSTEXPR void operator=(uint32_t value)
7058 {
7059 word0 = value;
7060 }
7061 void operator=(uint32_t value) volatile
7062 {
7063 word0 = value;
7064 }
7065 CONSTEXPR operator uint32_t()
7066 {
7067 return word0;
7068 }
7069 operator uint32_t() volatile
7070 {
7071 return word0;
7072 }
7073 ofm_z_r copy() volatile
7074 {
7075 return *this;
7076 }
7077 CONSTEXPR uint32_t get_value() const
7078 {
7079 uint32_t value = static_cast<uint32_t>(word0);
7080 return value;
7081 }
7082 uint32_t get_value() const volatile
7083 {
7084 uint32_t value = static_cast<uint32_t>(word0);
7085 return value;
7086 }
7087 CONSTEXPR ofm_z_r &set_value(uint32_t value)
7088 {
7089 word0 = static_cast<uint32_t>(value);
7090 return *this;
7091 }
7092#endif
7093};
7094
7095// ifm_z_r - Block Z (channel) coordinate in IFM
7096struct ifm_z_r
7097{
7098#ifndef __cplusplus
7099 union
7100 {
7101 struct
7102 {
7103 uint32_t value : 32; // 32-bit register value
7104 };
7105 uint32_t word;
7106 };
7107#else
7108 private:
7109 uint32_t word0;
7110
7111 public:
7112 CONSTEXPR ifm_z_r() : word0(0) {}
7113 CONSTEXPR ifm_z_r(uint32_t init) : word0(init) {}
7114 CONSTEXPR void operator=(uint32_t value)
7115 {
7116 word0 = value;
7117 }
7118 void operator=(uint32_t value) volatile
7119 {
7120 word0 = value;
7121 }
7122 CONSTEXPR operator uint32_t()
7123 {
7124 return word0;
7125 }
7126 operator uint32_t() volatile
7127 {
7128 return word0;
7129 }
7130 ifm_z_r copy() volatile
7131 {
7132 return *this;
7133 }
7134 CONSTEXPR uint32_t get_value() const
7135 {
7136 uint32_t value = static_cast<uint32_t>(word0);
7137 return value;
7138 }
7139 uint32_t get_value() const volatile
7140 {
7141 uint32_t value = static_cast<uint32_t>(word0);
7142 return value;
7143 }
7144 CONSTEXPR ifm_z_r &set_value(uint32_t value)
7145 {
7146 word0 = static_cast<uint32_t>(value);
7147 return *this;
7148 }
7149#endif
7150};
7151
7152// pad_top_r - Block top pad
7153struct pad_top_r
7154{
7155#ifndef __cplusplus
7156 union
7157 {
7158 struct
7159 {
7160 uint32_t value : 32; // 32-bit register value
7161 };
7162 uint32_t word;
7163 };
7164#else
7165 private:
7166 uint32_t word0;
7167
7168 public:
7169 CONSTEXPR pad_top_r() : word0(0) {}
7170 CONSTEXPR pad_top_r(uint32_t init) : word0(init) {}
7171 CONSTEXPR void operator=(uint32_t value)
7172 {
7173 word0 = value;
7174 }
7175 void operator=(uint32_t value) volatile
7176 {
7177 word0 = value;
7178 }
7179 CONSTEXPR operator uint32_t()
7180 {
7181 return word0;
7182 }
7183 operator uint32_t() volatile
7184 {
7185 return word0;
7186 }
7187 pad_top_r copy() volatile
7188 {
7189 return *this;
7190 }
7191 CONSTEXPR uint32_t get_value() const
7192 {
7193 uint32_t value = static_cast<uint32_t>(word0);
7194 return value;
7195 }
7196 uint32_t get_value() const volatile
7197 {
7198 uint32_t value = static_cast<uint32_t>(word0);
7199 return value;
7200 }
7201 CONSTEXPR pad_top_r &set_value(uint32_t value)
7202 {
7203 word0 = static_cast<uint32_t>(value);
7204 return *this;
7205 }
7206#endif
7207};
7208
7209// pad_left_r - Block left pad
7210struct pad_left_r
7211{
7212#ifndef __cplusplus
7213 union
7214 {
7215 struct
7216 {
7217 uint32_t value : 32; // 32-bit register value
7218 };
7219 uint32_t word;
7220 };
7221#else
7222 private:
7223 uint32_t word0;
7224
7225 public:
7226 CONSTEXPR pad_left_r() : word0(0) {}
7227 CONSTEXPR pad_left_r(uint32_t init) : word0(init) {}
7228 CONSTEXPR void operator=(uint32_t value)
7229 {
7230 word0 = value;
7231 }
7232 void operator=(uint32_t value) volatile
7233 {
7234 word0 = value;
7235 }
7236 CONSTEXPR operator uint32_t()
7237 {
7238 return word0;
7239 }
7240 operator uint32_t() volatile
7241 {
7242 return word0;
7243 }
7244 pad_left_r copy() volatile
7245 {
7246 return *this;
7247 }
7248 CONSTEXPR uint32_t get_value() const
7249 {
7250 uint32_t value = static_cast<uint32_t>(word0);
7251 return value;
7252 }
7253 uint32_t get_value() const volatile
7254 {
7255 uint32_t value = static_cast<uint32_t>(word0);
7256 return value;
7257 }
7258 CONSTEXPR pad_left_r &set_value(uint32_t value)
7259 {
7260 word0 = static_cast<uint32_t>(value);
7261 return *this;
7262 }
7263#endif
7264};
7265
7266// ifm_cblk_width_r - IFM current block derived width
7267struct ifm_cblk_width_r
7268{
7269#ifndef __cplusplus
7270 union
7271 {
7272 struct
7273 {
7274 uint32_t value : 32; // 32-bit register value
7275 };
7276 uint32_t word;
7277 };
7278#else
7279 private:
7280 uint32_t word0;
7281
7282 public:
7283 CONSTEXPR ifm_cblk_width_r() : word0(0) {}
7284 CONSTEXPR ifm_cblk_width_r(uint32_t init) : word0(init) {}
7285 CONSTEXPR void operator=(uint32_t value)
7286 {
7287 word0 = value;
7288 }
7289 void operator=(uint32_t value) volatile
7290 {
7291 word0 = value;
7292 }
7293 CONSTEXPR operator uint32_t()
7294 {
7295 return word0;
7296 }
7297 operator uint32_t() volatile
7298 {
7299 return word0;
7300 }
7301 ifm_cblk_width_r copy() volatile
7302 {
7303 return *this;
7304 }
7305 CONSTEXPR uint32_t get_value() const
7306 {
7307 uint32_t value = static_cast<uint32_t>(word0);
7308 return value;
7309 }
7310 uint32_t get_value() const volatile
7311 {
7312 uint32_t value = static_cast<uint32_t>(word0);
7313 return value;
7314 }
7315 CONSTEXPR ifm_cblk_width_r &set_value(uint32_t value)
7316 {
7317 word0 = static_cast<uint32_t>(value);
7318 return *this;
7319 }
7320#endif
7321};
7322
7323// ifm_cblk_height_r - IFM current block derived height
7324struct ifm_cblk_height_r
7325{
7326#ifndef __cplusplus
7327 union
7328 {
7329 struct
7330 {
7331 uint32_t value : 32; // 32-bit register value
7332 };
7333 uint32_t word;
7334 };
7335#else
7336 private:
7337 uint32_t word0;
7338
7339 public:
7340 CONSTEXPR ifm_cblk_height_r() : word0(0) {}
7341 CONSTEXPR ifm_cblk_height_r(uint32_t init) : word0(init) {}
7342 CONSTEXPR void operator=(uint32_t value)
7343 {
7344 word0 = value;
7345 }
7346 void operator=(uint32_t value) volatile
7347 {
7348 word0 = value;
7349 }
7350 CONSTEXPR operator uint32_t()
7351 {
7352 return word0;
7353 }
7354 operator uint32_t() volatile
7355 {
7356 return word0;
7357 }
7358 ifm_cblk_height_r copy() volatile
7359 {
7360 return *this;
7361 }
7362 CONSTEXPR uint32_t get_value() const
7363 {
7364 uint32_t value = static_cast<uint32_t>(word0);
7365 return value;
7366 }
7367 uint32_t get_value() const volatile
7368 {
7369 uint32_t value = static_cast<uint32_t>(word0);
7370 return value;
7371 }
7372 CONSTEXPR ifm_cblk_height_r &set_value(uint32_t value)
7373 {
7374 word0 = static_cast<uint32_t>(value);
7375 return *this;
7376 }
7377#endif
7378};
7379
7380// dma_ifm_src_r - DMA IFM channel source position on AXI
7381struct dma_ifm_src_r
7382{
7383#ifndef __cplusplus
7384 union
7385 {
7386 struct
7387 {
7388 uint32_t offset : 32; // Offset
7389 uint32_t reserved0 : 32;
7390 };
7391 uint32_t word[2];
7392 };
7393#else
7394 private:
7395 uint32_t word0;
7396 uint32_t word1;
7397
7398 public:
7399 CONSTEXPR dma_ifm_src_r() : word0(0), word1(0) {}
7400 CONSTEXPR dma_ifm_src_r(uint64_t init) :
7401 word0(static_cast<uint32_t>((init) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()))),
7402 word1(static_cast<uint32_t>((init >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max())))
7403 {
7404 }
7405 CONSTEXPR void operator=(uint64_t value)
7406 {
7407 word0 = static_cast<uint32_t>((value) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
7408 word1 = static_cast<uint32_t>((value >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
7409 }
7410 void operator=(uint64_t value) volatile
7411 {
7412 word0 = static_cast<uint32_t>((value) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
7413 word1 = static_cast<uint32_t>((value >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
7414 }
7415 CONSTEXPR operator uint64_t()
7416 {
7417 return (static_cast<uint64_t>(word1) << 32) | word0;
7418 }
7419 operator uint64_t() volatile
7420 {
7421 return (static_cast<uint64_t>(word1) << 32) | word0;
7422 }
7423 dma_ifm_src_r copy() volatile
7424 {
7425 return *this;
7426 }
7427#endif
7428};
7429
7430// dma_ifm_dst_r - DMA IFM channel destination position in SHRAM
7431struct dma_ifm_dst_r
7432{
7433#ifndef __cplusplus
7434 union
7435 {
7436 struct
7437 {
7438 uint32_t value : 32; // 32-bit register value
7439 };
7440 uint32_t word;
7441 };
7442#else
7443 private:
7444 uint32_t word0;
7445
7446 public:
7447 CONSTEXPR dma_ifm_dst_r() : word0(0) {}
7448 CONSTEXPR dma_ifm_dst_r(uint32_t init) : word0(init) {}
7449 CONSTEXPR void operator=(uint32_t value)
7450 {
7451 word0 = value;
7452 }
7453 void operator=(uint32_t value) volatile
7454 {
7455 word0 = value;
7456 }
7457 CONSTEXPR operator uint32_t()
7458 {
7459 return word0;
7460 }
7461 operator uint32_t() volatile
7462 {
7463 return word0;
7464 }
7465 dma_ifm_dst_r copy() volatile
7466 {
7467 return *this;
7468 }
7469 CONSTEXPR uint32_t get_value() const
7470 {
7471 uint32_t value = static_cast<uint32_t>(word0);
7472 return value;
7473 }
7474 uint32_t get_value() const volatile
7475 {
7476 uint32_t value = static_cast<uint32_t>(word0);
7477 return value;
7478 }
7479 CONSTEXPR dma_ifm_dst_r &set_value(uint32_t value)
7480 {
7481 word0 = static_cast<uint32_t>(value);
7482 return *this;
7483 }
7484#endif
7485};
7486
7487// dma_ofm_src_r - DMA OFM channel source position in SHRAM
7488struct dma_ofm_src_r
7489{
7490#ifndef __cplusplus
7491 union
7492 {
7493 struct
7494 {
7495 uint32_t value : 32; // 32-bit register value
7496 };
7497 uint32_t word;
7498 };
7499#else
7500 private:
7501 uint32_t word0;
7502
7503 public:
7504 CONSTEXPR dma_ofm_src_r() : word0(0) {}
7505 CONSTEXPR dma_ofm_src_r(uint32_t init) : word0(init) {}
7506 CONSTEXPR void operator=(uint32_t value)
7507 {
7508 word0 = value;
7509 }
7510 void operator=(uint32_t value) volatile
7511 {
7512 word0 = value;
7513 }
7514 CONSTEXPR operator uint32_t()
7515 {
7516 return word0;
7517 }
7518 operator uint32_t() volatile
7519 {
7520 return word0;
7521 }
7522 dma_ofm_src_r copy() volatile
7523 {
7524 return *this;
7525 }
7526 CONSTEXPR uint32_t get_value() const
7527 {
7528 uint32_t value = static_cast<uint32_t>(word0);
7529 return value;
7530 }
7531 uint32_t get_value() const volatile
7532 {
7533 uint32_t value = static_cast<uint32_t>(word0);
7534 return value;
7535 }
7536 CONSTEXPR dma_ofm_src_r &set_value(uint32_t value)
7537 {
7538 word0 = static_cast<uint32_t>(value);
7539 return *this;
7540 }
7541#endif
7542};
7543
7544// dma_ofm_dst_r - DMA OFM channel destination position on AXI
7545struct dma_ofm_dst_r
7546{
7547#ifndef __cplusplus
7548 union
7549 {
7550 struct
7551 {
7552 uint32_t offset : 32; // Offset
7553 uint32_t reserved0 : 32;
7554 };
7555 uint32_t word[2];
7556 };
7557#else
7558 private:
7559 uint32_t word0;
7560 uint32_t word1;
7561
7562 public:
7563 CONSTEXPR dma_ofm_dst_r() : word0(0), word1(0) {}
7564 CONSTEXPR dma_ofm_dst_r(uint64_t init) :
7565 word0(static_cast<uint32_t>((init) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()))),
7566 word1(static_cast<uint32_t>((init >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max())))
7567 {
7568 }
7569 CONSTEXPR void operator=(uint64_t value)
7570 {
7571 word0 = static_cast<uint32_t>((value) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
7572 word1 = static_cast<uint32_t>((value >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
7573 }
7574 void operator=(uint64_t value) volatile
7575 {
7576 word0 = static_cast<uint32_t>((value) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
7577 word1 = static_cast<uint32_t>((value >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
7578 }
7579 CONSTEXPR operator uint64_t()
7580 {
7581 return (static_cast<uint64_t>(word1) << 32) | word0;
7582 }
7583 operator uint64_t() volatile
7584 {
7585 return (static_cast<uint64_t>(word1) << 32) | word0;
7586 }
7587 dma_ofm_dst_r copy() volatile
7588 {
7589 return *this;
7590 }
7591#endif
7592};
7593
7594// dma_weight_src_r - DMA weight channel source position on AXI
7595struct dma_weight_src_r
7596{
7597#ifndef __cplusplus
7598 union
7599 {
7600 struct
7601 {
7602 uint32_t offset : 32; // Offset
7603 uint32_t reserved0 : 32;
7604 };
7605 uint32_t word[2];
7606 };
7607#else
7608 private:
7609 uint32_t word0;
7610 uint32_t word1;
7611
7612 public:
7613 CONSTEXPR dma_weight_src_r() : word0(0), word1(0) {}
7614 CONSTEXPR dma_weight_src_r(uint64_t init) :
7615 word0(static_cast<uint32_t>((init) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()))),
7616 word1(static_cast<uint32_t>((init >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max())))
7617 {
7618 }
7619 CONSTEXPR void operator=(uint64_t value)
7620 {
7621 word0 = static_cast<uint32_t>((value) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
7622 word1 = static_cast<uint32_t>((value >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
7623 }
7624 void operator=(uint64_t value) volatile
7625 {
7626 word0 = static_cast<uint32_t>((value) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
7627 word1 = static_cast<uint32_t>((value >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
7628 }
7629 CONSTEXPR operator uint64_t()
7630 {
7631 return (static_cast<uint64_t>(word1) << 32) | word0;
7632 }
7633 operator uint64_t() volatile
7634 {
7635 return (static_cast<uint64_t>(word1) << 32) | word0;
7636 }
7637 dma_weight_src_r copy() volatile
7638 {
7639 return *this;
7640 }
7641#endif
7642};
7643
7644// dma_cmd_src_r - DMA command channel source position on AXI
7645struct dma_cmd_src_r
7646{
7647#ifndef __cplusplus
7648 union
7649 {
7650 struct
7651 {
7652 uint32_t offset : 32; // Offset
7653 uint32_t reserved0 : 32;
7654 };
7655 uint32_t word[2];
7656 };
7657#else
7658 private:
7659 uint32_t word0;
7660 uint32_t word1;
7661
7662 public:
7663 CONSTEXPR dma_cmd_src_r() : word0(0), word1(0) {}
7664 CONSTEXPR dma_cmd_src_r(uint64_t init) :
7665 word0(static_cast<uint32_t>((init) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()))),
7666 word1(static_cast<uint32_t>((init >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max())))
7667 {
7668 }
7669 CONSTEXPR void operator=(uint64_t value)
7670 {
7671 word0 = static_cast<uint32_t>((value) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
7672 word1 = static_cast<uint32_t>((value >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
7673 }
7674 void operator=(uint64_t value) volatile
7675 {
7676 word0 = static_cast<uint32_t>((value) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
7677 word1 = static_cast<uint32_t>((value >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
7678 }
7679 CONSTEXPR operator uint64_t()
7680 {
7681 return (static_cast<uint64_t>(word1) << 32) | word0;
7682 }
7683 operator uint64_t() volatile
7684 {
7685 return (static_cast<uint64_t>(word1) << 32) | word0;
7686 }
7687 dma_cmd_src_r copy() volatile
7688 {
7689 return *this;
7690 }
7691#endif
7692};
7693
7694// dma_cmd_size_r - DMA command channel number of bytes buffered
7695struct dma_cmd_size_r
7696{
7697#ifndef __cplusplus
7698 union
7699 {
7700 struct
7701 {
7702 uint32_t value : 32; // 32-bit register value
7703 };
7704 uint32_t word;
7705 };
7706#else
7707 private:
7708 uint32_t word0;
7709
7710 public:
7711 CONSTEXPR dma_cmd_size_r() : word0(0) {}
7712 CONSTEXPR dma_cmd_size_r(uint32_t init) : word0(init) {}
7713 CONSTEXPR void operator=(uint32_t value)
7714 {
7715 word0 = value;
7716 }
7717 void operator=(uint32_t value) volatile
7718 {
7719 word0 = value;
7720 }
7721 CONSTEXPR operator uint32_t()
7722 {
7723 return word0;
7724 }
7725 operator uint32_t() volatile
7726 {
7727 return word0;
7728 }
7729 dma_cmd_size_r copy() volatile
7730 {
7731 return *this;
7732 }
7733 CONSTEXPR uint32_t get_value() const
7734 {
7735 uint32_t value = static_cast<uint32_t>(word0);
7736 return value;
7737 }
7738 uint32_t get_value() const volatile
7739 {
7740 uint32_t value = static_cast<uint32_t>(word0);
7741 return value;
7742 }
7743 CONSTEXPR dma_cmd_size_r &set_value(uint32_t value)
7744 {
7745 word0 = static_cast<uint32_t>(value);
7746 return *this;
7747 }
7748#endif
7749};
7750
7751// dma_m2m_src_r - DMA memory to memory source position on AXI
7752struct dma_m2m_src_r
7753{
7754#ifndef __cplusplus
7755 union
7756 {
7757 struct
7758 {
7759 uint32_t offset : 32; // Offset
7760 uint32_t reserved0 : 32;
7761 };
7762 uint32_t word[2];
7763 };
7764#else
7765 private:
7766 uint32_t word0;
7767 uint32_t word1;
7768
7769 public:
7770 CONSTEXPR dma_m2m_src_r() : word0(0), word1(0) {}
7771 CONSTEXPR dma_m2m_src_r(uint64_t init) :
7772 word0(static_cast<uint32_t>((init) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()))),
7773 word1(static_cast<uint32_t>((init >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max())))
7774 {
7775 }
7776 CONSTEXPR void operator=(uint64_t value)
7777 {
7778 word0 = static_cast<uint32_t>((value) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
7779 word1 = static_cast<uint32_t>((value >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
7780 }
7781 void operator=(uint64_t value) volatile
7782 {
7783 word0 = static_cast<uint32_t>((value) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
7784 word1 = static_cast<uint32_t>((value >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
7785 }
7786 CONSTEXPR operator uint64_t()
7787 {
7788 return (static_cast<uint64_t>(word1) << 32) | word0;
7789 }
7790 operator uint64_t() volatile
7791 {
7792 return (static_cast<uint64_t>(word1) << 32) | word0;
7793 }
7794 dma_m2m_src_r copy() volatile
7795 {
7796 return *this;
7797 }
7798#endif
7799};
7800
7801// dma_m2m_dst_r - DMA memory to memory destination position on AXI
7802struct dma_m2m_dst_r
7803{
7804#ifndef __cplusplus
7805 union
7806 {
7807 struct
7808 {
7809 uint32_t offset : 32; // Offset
7810 uint32_t reserved0 : 32;
7811 };
7812 uint32_t word[2];
7813 };
7814#else
7815 private:
7816 uint32_t word0;
7817 uint32_t word1;
7818
7819 public:
7820 CONSTEXPR dma_m2m_dst_r() : word0(0), word1(0) {}
7821 CONSTEXPR dma_m2m_dst_r(uint64_t init) :
7822 word0(static_cast<uint32_t>((init) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()))),
7823 word1(static_cast<uint32_t>((init >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max())))
7824 {
7825 }
7826 CONSTEXPR void operator=(uint64_t value)
7827 {
7828 word0 = static_cast<uint32_t>((value) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
7829 word1 = static_cast<uint32_t>((value >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
7830 }
7831 void operator=(uint64_t value) volatile
7832 {
7833 word0 = static_cast<uint32_t>((value) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
7834 word1 = static_cast<uint32_t>((value >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
7835 }
7836 CONSTEXPR operator uint64_t()
7837 {
7838 return (static_cast<uint64_t>(word1) << 32) | word0;
7839 }
7840 operator uint64_t() volatile
7841 {
7842 return (static_cast<uint64_t>(word1) << 32) | word0;
7843 }
7844 dma_m2m_dst_r copy() volatile
7845 {
7846 return *this;
7847 }
7848#endif
7849};
7850
7851// current_qread_r - QREAD position being issued (rather than completed)
7852struct current_qread_r
7853{
7854#ifndef __cplusplus
7855 union
7856 {
7857 struct
7858 {
7859 uint32_t value : 32; // 32-bit register value
7860 };
7861 uint32_t word;
7862 };
7863#else
7864 private:
7865 uint32_t word0;
7866
7867 public:
7868 CONSTEXPR current_qread_r() : word0(0) {}
7869 CONSTEXPR current_qread_r(uint32_t init) : word0(init) {}
7870 CONSTEXPR void operator=(uint32_t value)
7871 {
7872 word0 = value;
7873 }
7874 void operator=(uint32_t value) volatile
7875 {
7876 word0 = value;
7877 }
7878 CONSTEXPR operator uint32_t()
7879 {
7880 return word0;
7881 }
7882 operator uint32_t() volatile
7883 {
7884 return word0;
7885 }
7886 current_qread_r copy() volatile
7887 {
7888 return *this;
7889 }
7890 CONSTEXPR uint32_t get_value() const
7891 {
7892 uint32_t value = static_cast<uint32_t>(word0);
7893 return value;
7894 }
7895 uint32_t get_value() const volatile
7896 {
7897 uint32_t value = static_cast<uint32_t>(word0);
7898 return value;
7899 }
7900 CONSTEXPR current_qread_r &set_value(uint32_t value)
7901 {
7902 word0 = static_cast<uint32_t>(value);
7903 return *this;
7904 }
7905#endif
7906};
7907
7908// dma_scale_src_r - DMA scale and bias channel source position on AXI
7909struct dma_scale_src_r
7910{
7911#ifndef __cplusplus
7912 union
7913 {
7914 struct
7915 {
7916 uint32_t offset : 32; // Offset
7917 uint32_t reserved0 : 32;
7918 };
7919 uint32_t word[2];
7920 };
7921#else
7922 private:
7923 uint32_t word0;
7924 uint32_t word1;
7925
7926 public:
7927 CONSTEXPR dma_scale_src_r() : word0(0), word1(0) {}
7928 CONSTEXPR dma_scale_src_r(uint64_t init) :
7929 word0(static_cast<uint32_t>((init) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()))),
7930 word1(static_cast<uint32_t>((init >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max())))
7931 {
7932 }
7933 CONSTEXPR void operator=(uint64_t value)
7934 {
7935 word0 = static_cast<uint32_t>((value) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
7936 word1 = static_cast<uint32_t>((value >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
7937 }
7938 void operator=(uint64_t value) volatile
7939 {
7940 word0 = static_cast<uint32_t>((value) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
7941 word1 = static_cast<uint32_t>((value >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
7942 }
7943 CONSTEXPR operator uint64_t()
7944 {
7945 return (static_cast<uint64_t>(word1) << 32) | word0;
7946 }
7947 operator uint64_t() volatile
7948 {
7949 return (static_cast<uint64_t>(word1) << 32) | word0;
7950 }
7951 dma_scale_src_r copy() volatile
7952 {
7953 return *this;
7954 }
7955#endif
7956};
7957
7958// current_block_r - 0-3. Current block bank being executed by the TSU or last one executed if TSU is stopped
7959struct current_block_r
7960{
7961#ifndef __cplusplus
7962 union
7963 {
7964 struct
7965 {
7966 uint32_t value : 32; // 32-bit register value
7967 };
7968 uint32_t word;
7969 };
7970#else
7971 private:
7972 uint32_t word0;
7973
7974 public:
7975 CONSTEXPR current_block_r() : word0(0) {}
7976 CONSTEXPR current_block_r(uint32_t init) : word0(init) {}
7977 CONSTEXPR void operator=(uint32_t value)
7978 {
7979 word0 = value;
7980 }
7981 void operator=(uint32_t value) volatile
7982 {
7983 word0 = value;
7984 }
7985 CONSTEXPR operator uint32_t()
7986 {
7987 return word0;
7988 }
7989 operator uint32_t() volatile
7990 {
7991 return word0;
7992 }
7993 current_block_r copy() volatile
7994 {
7995 return *this;
7996 }
7997 CONSTEXPR uint32_t get_value() const
7998 {
7999 uint32_t value = static_cast<uint32_t>(word0);
8000 return value;
8001 }
8002 uint32_t get_value() const volatile
8003 {
8004 uint32_t value = static_cast<uint32_t>(word0);
8005 return value;
8006 }
8007 CONSTEXPR current_block_r &set_value(uint32_t value)
8008 {
8009 word0 = static_cast<uint32_t>(value);
8010 return *this;
8011 }
8012#endif
8013};
8014
8015// current_op_r - Current NPU OP command being executed by the TSU
8016struct current_op_r
8017{
8018#ifndef __cplusplus
8019 union
8020 {
8021 struct
8022 {
8023 uint32_t value : 32; // 32-bit register value
8024 };
8025 uint32_t word;
8026 };
8027#else
8028 private:
8029 uint32_t word0;
8030
8031 public:
8032 CONSTEXPR current_op_r() : word0(0) {}
8033 CONSTEXPR current_op_r(uint32_t init) : word0(init) {}
8034 CONSTEXPR void operator=(uint32_t value)
8035 {
8036 word0 = value;
8037 }
8038 void operator=(uint32_t value) volatile
8039 {
8040 word0 = value;
8041 }
8042 CONSTEXPR operator uint32_t()
8043 {
8044 return word0;
8045 }
8046 operator uint32_t() volatile
8047 {
8048 return word0;
8049 }
8050 current_op_r copy() volatile
8051 {
8052 return *this;
8053 }
8054 CONSTEXPR uint32_t get_value() const
8055 {
8056 uint32_t value = static_cast<uint32_t>(word0);
8057 return value;
8058 }
8059 uint32_t get_value() const volatile
8060 {
8061 uint32_t value = static_cast<uint32_t>(word0);
8062 return value;
8063 }
8064 CONSTEXPR current_op_r &set_value(uint32_t value)
8065 {
8066 word0 = static_cast<uint32_t>(value);
8067 return *this;
8068 }
8069#endif
8070};
8071
8072// current_cmd_r - Current 32-bit command being parsed by the command stream parser
8073struct current_cmd_r
8074{
8075#ifndef __cplusplus
8076 union
8077 {
8078 struct
8079 {
8080 uint32_t value : 32; // 32-bit register value
8081 };
8082 uint32_t word;
8083 };
8084#else
8085 private:
8086 uint32_t word0;
8087
8088 public:
8089 CONSTEXPR current_cmd_r() : word0(0) {}
8090 CONSTEXPR current_cmd_r(uint32_t init) : word0(init) {}
8091 CONSTEXPR void operator=(uint32_t value)
8092 {
8093 word0 = value;
8094 }
8095 void operator=(uint32_t value) volatile
8096 {
8097 word0 = value;
8098 }
8099 CONSTEXPR operator uint32_t()
8100 {
8101 return word0;
8102 }
8103 operator uint32_t() volatile
8104 {
8105 return word0;
8106 }
8107 current_cmd_r copy() volatile
8108 {
8109 return *this;
8110 }
8111 CONSTEXPR uint32_t get_value() const
8112 {
8113 uint32_t value = static_cast<uint32_t>(word0);
8114 return value;
8115 }
8116 uint32_t get_value() const volatile
8117 {
8118 uint32_t value = static_cast<uint32_t>(word0);
8119 return value;
8120 }
8121 CONSTEXPR current_cmd_r &set_value(uint32_t value)
8122 {
8123 word0 = static_cast<uint32_t>(value);
8124 return *this;
8125 }
8126#endif
8127};
8128
8129// pmevcntr_r - Performance monitor event 0 count register
8130struct pmevcntr_r
8131{
8132#ifndef __cplusplus
8133 union
8134 {
8135 struct
8136 {
8137 uint32_t count : 32; // Count word
8138 };
8139 uint32_t word;
8140 };
8141#else
8142 private:
8143 uint32_t word0;
8144
8145 public:
8146 CONSTEXPR pmevcntr_r() : word0(0) {}
8147 CONSTEXPR pmevcntr_r(uint32_t init) : word0(init) {}
8148 CONSTEXPR void operator=(uint32_t value)
8149 {
8150 word0 = value;
8151 }
8152 void operator=(uint32_t value) volatile
8153 {
8154 word0 = value;
8155 }
8156 CONSTEXPR operator uint32_t()
8157 {
8158 return word0;
8159 }
8160 operator uint32_t() volatile
8161 {
8162 return word0;
8163 }
8164 pmevcntr_r copy() volatile
8165 {
8166 return *this;
8167 }
8168 CONSTEXPR uint32_t get_count() const
8169 {
8170 uint32_t value = static_cast<uint32_t>(word0);
8171 return value;
8172 }
8173 uint32_t get_count() const volatile
8174 {
8175 uint32_t value = static_cast<uint32_t>(word0);
8176 return value;
8177 }
8178 CONSTEXPR pmevcntr_r &set_count(uint32_t value)
8179 {
8180 word0 = static_cast<uint32_t>(value);
8181 return *this;
8182 }
8183#endif
8184};
8185
8186// pmevtyper_r - Performance monitor event type register 0
8187struct pmevtyper_r
8188{
8189#ifndef __cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008190 union
8191 {
8192 struct
8193 {
8194 uint32_t EV_TYPE : 10; // Event Type
8195 uint32_t reserved0 : 22;
8196 };
8197 uint32_t word;
8198 };
Jonny Svärd136810f2021-10-13 16:04:26 +02008199#else
8200 private:
8201 uint32_t word0;
8202
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008203 public:
Jonny Svärd136810f2021-10-13 16:04:26 +02008204 CONSTEXPR pmevtyper_r() : word0(0) {}
8205 CONSTEXPR pmevtyper_r(uint32_t init) : word0(init) {}
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008206 CONSTEXPR void operator=(uint32_t value)
8207 {
Jonny Svärd136810f2021-10-13 16:04:26 +02008208 word0 = value;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008209 }
8210 void operator=(uint32_t value) volatile
8211 {
Jonny Svärd136810f2021-10-13 16:04:26 +02008212 word0 = value;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008213 }
8214 CONSTEXPR operator uint32_t()
8215 {
Jonny Svärd136810f2021-10-13 16:04:26 +02008216 return word0;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008217 }
8218 operator uint32_t() volatile
8219 {
Jonny Svärd136810f2021-10-13 16:04:26 +02008220 return word0;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008221 }
Jonny Svärd136810f2021-10-13 16:04:26 +02008222 pmevtyper_r copy() volatile
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008223 {
8224 return *this;
8225 }
Jonny Svärd136810f2021-10-13 16:04:26 +02008226 CONSTEXPR NPU_NAMESPACE::pmu_event get_EV_TYPE() const
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008227 {
Jonny Svärd136810f2021-10-13 16:04:26 +02008228 NPU_NAMESPACE::pmu_event value = static_cast<NPU_NAMESPACE::pmu_event>(((1U << 10) - 1) & (word0 >> 0));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008229 return value;
8230 }
Jonny Svärd136810f2021-10-13 16:04:26 +02008231 NPU_NAMESPACE::pmu_event get_EV_TYPE() const volatile
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008232 {
Jonny Svärd136810f2021-10-13 16:04:26 +02008233 NPU_NAMESPACE::pmu_event value = static_cast<NPU_NAMESPACE::pmu_event>(((1U << 10) - 1) & (word0 >> 0));
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008234 return value;
8235 }
Jonny Svärd136810f2021-10-13 16:04:26 +02008236 CONSTEXPR pmevtyper_r &set_EV_TYPE(NPU_NAMESPACE::pmu_event value)
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008237 {
Jonny Svärd136810f2021-10-13 16:04:26 +02008238 word0 = (((~((1U << 10) - 1)) << 0) & word0) | ((((1U << 10) - 1) & static_cast<uint32_t>(value)) << 0);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008239 return *this;
8240 }
Jonny Svärd136810f2021-10-13 16:04:26 +02008241#endif
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008242};
8243
Jonny Svärd136810f2021-10-13 16:04:26 +02008244// shared_buffer_r - Shared buffer debug access. Only valid in STOPPED state
8245struct shared_buffer_r
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008246{
Jonny Svärd136810f2021-10-13 16:04:26 +02008247#ifndef __cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008248 union
8249 {
8250 struct
8251 {
Jonny Svärd136810f2021-10-13 16:04:26 +02008252 uint32_t mem_word : 32; // Memory word
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008253 };
8254 uint32_t word;
8255 };
Jonny Svärd136810f2021-10-13 16:04:26 +02008256#else
8257 private:
8258 uint32_t word0;
8259
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008260 public:
Jonny Svärd136810f2021-10-13 16:04:26 +02008261 CONSTEXPR shared_buffer_r() : word0(0) {}
8262 CONSTEXPR shared_buffer_r(uint32_t init) : word0(init) {}
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008263 CONSTEXPR void operator=(uint32_t value)
8264 {
Jonny Svärd136810f2021-10-13 16:04:26 +02008265 word0 = value;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008266 }
8267 void operator=(uint32_t value) volatile
8268 {
Jonny Svärd136810f2021-10-13 16:04:26 +02008269 word0 = value;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008270 }
8271 CONSTEXPR operator uint32_t()
8272 {
Jonny Svärd136810f2021-10-13 16:04:26 +02008273 return word0;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008274 }
8275 operator uint32_t() volatile
8276 {
Jonny Svärd136810f2021-10-13 16:04:26 +02008277 return word0;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008278 }
Jonny Svärd136810f2021-10-13 16:04:26 +02008279 shared_buffer_r copy() volatile
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008280 {
8281 return *this;
8282 }
Jonny Svärd136810f2021-10-13 16:04:26 +02008283 CONSTEXPR uint32_t get_mem_word() const
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008284 {
Jonny Svärd136810f2021-10-13 16:04:26 +02008285 uint32_t value = static_cast<uint32_t>(word0);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008286 return value;
8287 }
Jonny Svärd136810f2021-10-13 16:04:26 +02008288 uint32_t get_mem_word() const volatile
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008289 {
Jonny Svärd136810f2021-10-13 16:04:26 +02008290 uint32_t value = static_cast<uint32_t>(word0);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008291 return value;
8292 }
Jonny Svärd136810f2021-10-13 16:04:26 +02008293 CONSTEXPR shared_buffer_r &set_mem_word(uint32_t value)
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008294 {
Jonny Svärd136810f2021-10-13 16:04:26 +02008295 word0 = static_cast<uint32_t>(value);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008296 return *this;
8297 }
Jonny Svärd136810f2021-10-13 16:04:26 +02008298#endif
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008299};
8300
Jonny Svärd136810f2021-10-13 16:04:26 +02008301// ifm_pad_top_r - None
8302struct ifm_pad_top_r
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008303{
Jonny Svärd136810f2021-10-13 16:04:26 +02008304#ifndef __cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008305 union
8306 {
8307 struct
8308 {
Jonny Svärd136810f2021-10-13 16:04:26 +02008309 uint32_t value : 32; // 32-bit register value
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008310 };
8311 uint32_t word;
8312 };
Jonny Svärd136810f2021-10-13 16:04:26 +02008313#else
8314 private:
8315 uint32_t word0;
8316
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008317 public:
Jonny Svärd136810f2021-10-13 16:04:26 +02008318 CONSTEXPR ifm_pad_top_r() : word0(0) {}
8319 CONSTEXPR ifm_pad_top_r(uint32_t init) : word0(init) {}
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008320 CONSTEXPR void operator=(uint32_t value)
8321 {
Jonny Svärd136810f2021-10-13 16:04:26 +02008322 word0 = value;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008323 }
8324 void operator=(uint32_t value) volatile
8325 {
Jonny Svärd136810f2021-10-13 16:04:26 +02008326 word0 = value;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008327 }
8328 CONSTEXPR operator uint32_t()
8329 {
Jonny Svärd136810f2021-10-13 16:04:26 +02008330 return word0;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008331 }
8332 operator uint32_t() volatile
8333 {
Jonny Svärd136810f2021-10-13 16:04:26 +02008334 return word0;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008335 }
Jonny Svärd136810f2021-10-13 16:04:26 +02008336 ifm_pad_top_r copy() volatile
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008337 {
8338 return *this;
8339 }
Jonny Svärd136810f2021-10-13 16:04:26 +02008340 CONSTEXPR uint32_t get_value() const
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008341 {
Jonny Svärd136810f2021-10-13 16:04:26 +02008342 uint32_t value = static_cast<uint32_t>(word0);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008343 return value;
8344 }
Jonny Svärd136810f2021-10-13 16:04:26 +02008345 uint32_t get_value() const volatile
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008346 {
Jonny Svärd136810f2021-10-13 16:04:26 +02008347 uint32_t value = static_cast<uint32_t>(word0);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008348 return value;
8349 }
Jonny Svärd136810f2021-10-13 16:04:26 +02008350 CONSTEXPR ifm_pad_top_r &set_value(uint32_t value)
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008351 {
Jonny Svärd136810f2021-10-13 16:04:26 +02008352 word0 = static_cast<uint32_t>(value);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008353 return *this;
8354 }
Jonny Svärd136810f2021-10-13 16:04:26 +02008355#endif
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008356};
8357
Jonny Svärd136810f2021-10-13 16:04:26 +02008358// ifm_pad_left_r - None
8359struct ifm_pad_left_r
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008360{
Jonny Svärd136810f2021-10-13 16:04:26 +02008361#ifndef __cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008362 union
8363 {
8364 struct
8365 {
Jonny Svärd136810f2021-10-13 16:04:26 +02008366 uint32_t value : 32; // 32-bit register value
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008367 };
8368 uint32_t word;
8369 };
Jonny Svärd136810f2021-10-13 16:04:26 +02008370#else
8371 private:
8372 uint32_t word0;
8373
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008374 public:
Jonny Svärd136810f2021-10-13 16:04:26 +02008375 CONSTEXPR ifm_pad_left_r() : word0(0) {}
8376 CONSTEXPR ifm_pad_left_r(uint32_t init) : word0(init) {}
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008377 CONSTEXPR void operator=(uint32_t value)
8378 {
Jonny Svärd136810f2021-10-13 16:04:26 +02008379 word0 = value;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008380 }
8381 void operator=(uint32_t value) volatile
8382 {
Jonny Svärd136810f2021-10-13 16:04:26 +02008383 word0 = value;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008384 }
8385 CONSTEXPR operator uint32_t()
8386 {
Jonny Svärd136810f2021-10-13 16:04:26 +02008387 return word0;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008388 }
8389 operator uint32_t() volatile
8390 {
Jonny Svärd136810f2021-10-13 16:04:26 +02008391 return word0;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008392 }
Jonny Svärd136810f2021-10-13 16:04:26 +02008393 ifm_pad_left_r copy() volatile
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008394 {
8395 return *this;
8396 }
Jonny Svärd136810f2021-10-13 16:04:26 +02008397 CONSTEXPR uint32_t get_value() const
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008398 {
Jonny Svärd136810f2021-10-13 16:04:26 +02008399 uint32_t value = static_cast<uint32_t>(word0);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008400 return value;
8401 }
Jonny Svärd136810f2021-10-13 16:04:26 +02008402 uint32_t get_value() const volatile
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008403 {
Jonny Svärd136810f2021-10-13 16:04:26 +02008404 uint32_t value = static_cast<uint32_t>(word0);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008405 return value;
8406 }
Jonny Svärd136810f2021-10-13 16:04:26 +02008407 CONSTEXPR ifm_pad_left_r &set_value(uint32_t value)
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008408 {
Jonny Svärd136810f2021-10-13 16:04:26 +02008409 word0 = static_cast<uint32_t>(value);
Kristofer Jonsson49bdee82020-04-06 13:21:21 +02008410 return *this;
8411 }
Jonny Svärd136810f2021-10-13 16:04:26 +02008412#endif
8413};
8414
8415// ifm_pad_right_r - None
8416struct ifm_pad_right_r
8417{
8418#ifndef __cplusplus
8419 union
8420 {
8421 struct
8422 {
8423 uint32_t value : 32; // 32-bit register value
8424 };
8425 uint32_t word;
8426 };
8427#else
8428 private:
8429 uint32_t word0;
8430
8431 public:
8432 CONSTEXPR ifm_pad_right_r() : word0(0) {}
8433 CONSTEXPR ifm_pad_right_r(uint32_t init) : word0(init) {}
8434 CONSTEXPR void operator=(uint32_t value)
8435 {
8436 word0 = value;
8437 }
8438 void operator=(uint32_t value) volatile
8439 {
8440 word0 = value;
8441 }
8442 CONSTEXPR operator uint32_t()
8443 {
8444 return word0;
8445 }
8446 operator uint32_t() volatile
8447 {
8448 return word0;
8449 }
8450 ifm_pad_right_r copy() volatile
8451 {
8452 return *this;
8453 }
8454 CONSTEXPR uint32_t get_value() const
8455 {
8456 uint32_t value = static_cast<uint32_t>(word0);
8457 return value;
8458 }
8459 uint32_t get_value() const volatile
8460 {
8461 uint32_t value = static_cast<uint32_t>(word0);
8462 return value;
8463 }
8464 CONSTEXPR ifm_pad_right_r &set_value(uint32_t value)
8465 {
8466 word0 = static_cast<uint32_t>(value);
8467 return *this;
8468 }
8469#endif
8470};
8471
8472// ifm_pad_bottom_r - None
8473struct ifm_pad_bottom_r
8474{
8475#ifndef __cplusplus
8476 union
8477 {
8478 struct
8479 {
8480 uint32_t value : 32; // 32-bit register value
8481 };
8482 uint32_t word;
8483 };
8484#else
8485 private:
8486 uint32_t word0;
8487
8488 public:
8489 CONSTEXPR ifm_pad_bottom_r() : word0(0) {}
8490 CONSTEXPR ifm_pad_bottom_r(uint32_t init) : word0(init) {}
8491 CONSTEXPR void operator=(uint32_t value)
8492 {
8493 word0 = value;
8494 }
8495 void operator=(uint32_t value) volatile
8496 {
8497 word0 = value;
8498 }
8499 CONSTEXPR operator uint32_t()
8500 {
8501 return word0;
8502 }
8503 operator uint32_t() volatile
8504 {
8505 return word0;
8506 }
8507 ifm_pad_bottom_r copy() volatile
8508 {
8509 return *this;
8510 }
8511 CONSTEXPR uint32_t get_value() const
8512 {
8513 uint32_t value = static_cast<uint32_t>(word0);
8514 return value;
8515 }
8516 uint32_t get_value() const volatile
8517 {
8518 uint32_t value = static_cast<uint32_t>(word0);
8519 return value;
8520 }
8521 CONSTEXPR ifm_pad_bottom_r &set_value(uint32_t value)
8522 {
8523 word0 = static_cast<uint32_t>(value);
8524 return *this;
8525 }
8526#endif
8527};
8528
8529// ifm_depth_m1_r - None
8530struct ifm_depth_m1_r
8531{
8532#ifndef __cplusplus
8533 union
8534 {
8535 struct
8536 {
8537 uint32_t value : 32; // 32-bit register value
8538 };
8539 uint32_t word;
8540 };
8541#else
8542 private:
8543 uint32_t word0;
8544
8545 public:
8546 CONSTEXPR ifm_depth_m1_r() : word0(0) {}
8547 CONSTEXPR ifm_depth_m1_r(uint32_t init) : word0(init) {}
8548 CONSTEXPR void operator=(uint32_t value)
8549 {
8550 word0 = value;
8551 }
8552 void operator=(uint32_t value) volatile
8553 {
8554 word0 = value;
8555 }
8556 CONSTEXPR operator uint32_t()
8557 {
8558 return word0;
8559 }
8560 operator uint32_t() volatile
8561 {
8562 return word0;
8563 }
8564 ifm_depth_m1_r copy() volatile
8565 {
8566 return *this;
8567 }
8568 CONSTEXPR uint32_t get_value() const
8569 {
8570 uint32_t value = static_cast<uint32_t>(word0);
8571 return value;
8572 }
8573 uint32_t get_value() const volatile
8574 {
8575 uint32_t value = static_cast<uint32_t>(word0);
8576 return value;
8577 }
8578 CONSTEXPR ifm_depth_m1_r &set_value(uint32_t value)
8579 {
8580 word0 = static_cast<uint32_t>(value);
8581 return *this;
8582 }
8583#endif
8584};
8585
8586// ifm_precision_r - None
8587struct ifm_precision_r
8588{
8589#ifndef __cplusplus
8590 union
8591 {
8592 struct
8593 {
8594 uint32_t value : 32; // 32-bit register value
8595 };
8596 uint32_t word;
8597 };
8598#else
8599 private:
8600 uint32_t word0;
8601
8602 public:
8603 CONSTEXPR ifm_precision_r() : word0(0) {}
8604 CONSTEXPR ifm_precision_r(uint32_t init) : word0(init) {}
8605 CONSTEXPR void operator=(uint32_t value)
8606 {
8607 word0 = value;
8608 }
8609 void operator=(uint32_t value) volatile
8610 {
8611 word0 = value;
8612 }
8613 CONSTEXPR operator uint32_t()
8614 {
8615 return word0;
8616 }
8617 operator uint32_t() volatile
8618 {
8619 return word0;
8620 }
8621 ifm_precision_r copy() volatile
8622 {
8623 return *this;
8624 }
8625 CONSTEXPR uint32_t get_value() const
8626 {
8627 uint32_t value = static_cast<uint32_t>(word0);
8628 return value;
8629 }
8630 uint32_t get_value() const volatile
8631 {
8632 uint32_t value = static_cast<uint32_t>(word0);
8633 return value;
8634 }
8635 CONSTEXPR ifm_precision_r &set_value(uint32_t value)
8636 {
8637 word0 = static_cast<uint32_t>(value);
8638 return *this;
8639 }
8640#endif
8641};
8642
8643// ifm_upscale_r - None
8644struct ifm_upscale_r
8645{
8646#ifndef __cplusplus
8647 union
8648 {
8649 struct
8650 {
8651 uint32_t value : 32; // 32-bit register value
8652 };
8653 uint32_t word;
8654 };
8655#else
8656 private:
8657 uint32_t word0;
8658
8659 public:
8660 CONSTEXPR ifm_upscale_r() : word0(0) {}
8661 CONSTEXPR ifm_upscale_r(uint32_t init) : word0(init) {}
8662 CONSTEXPR void operator=(uint32_t value)
8663 {
8664 word0 = value;
8665 }
8666 void operator=(uint32_t value) volatile
8667 {
8668 word0 = value;
8669 }
8670 CONSTEXPR operator uint32_t()
8671 {
8672 return word0;
8673 }
8674 operator uint32_t() volatile
8675 {
8676 return word0;
8677 }
8678 ifm_upscale_r copy() volatile
8679 {
8680 return *this;
8681 }
8682 CONSTEXPR uint32_t get_value() const
8683 {
8684 uint32_t value = static_cast<uint32_t>(word0);
8685 return value;
8686 }
8687 uint32_t get_value() const volatile
8688 {
8689 uint32_t value = static_cast<uint32_t>(word0);
8690 return value;
8691 }
8692 CONSTEXPR ifm_upscale_r &set_value(uint32_t value)
8693 {
8694 word0 = static_cast<uint32_t>(value);
8695 return *this;
8696 }
8697#endif
8698};
8699
8700// ifm_zero_point_r - None
8701struct ifm_zero_point_r
8702{
8703#ifndef __cplusplus
8704 union
8705 {
8706 struct
8707 {
8708 uint32_t value : 32; // 32-bit register value
8709 };
8710 uint32_t word;
8711 };
8712#else
8713 private:
8714 uint32_t word0;
8715
8716 public:
8717 CONSTEXPR ifm_zero_point_r() : word0(0) {}
8718 CONSTEXPR ifm_zero_point_r(uint32_t init) : word0(init) {}
8719 CONSTEXPR void operator=(uint32_t value)
8720 {
8721 word0 = value;
8722 }
8723 void operator=(uint32_t value) volatile
8724 {
8725 word0 = value;
8726 }
8727 CONSTEXPR operator uint32_t()
8728 {
8729 return word0;
8730 }
8731 operator uint32_t() volatile
8732 {
8733 return word0;
8734 }
8735 ifm_zero_point_r copy() volatile
8736 {
8737 return *this;
8738 }
8739 CONSTEXPR uint32_t get_value() const
8740 {
8741 uint32_t value = static_cast<uint32_t>(word0);
8742 return value;
8743 }
8744 uint32_t get_value() const volatile
8745 {
8746 uint32_t value = static_cast<uint32_t>(word0);
8747 return value;
8748 }
8749 CONSTEXPR ifm_zero_point_r &set_value(uint32_t value)
8750 {
8751 word0 = static_cast<uint32_t>(value);
8752 return *this;
8753 }
8754#endif
8755};
8756
8757// ifm_width0_m1_r - None
8758struct ifm_width0_m1_r
8759{
8760#ifndef __cplusplus
8761 union
8762 {
8763 struct
8764 {
8765 uint32_t value : 32; // 32-bit register value
8766 };
8767 uint32_t word;
8768 };
8769#else
8770 private:
8771 uint32_t word0;
8772
8773 public:
8774 CONSTEXPR ifm_width0_m1_r() : word0(0) {}
8775 CONSTEXPR ifm_width0_m1_r(uint32_t init) : word0(init) {}
8776 CONSTEXPR void operator=(uint32_t value)
8777 {
8778 word0 = value;
8779 }
8780 void operator=(uint32_t value) volatile
8781 {
8782 word0 = value;
8783 }
8784 CONSTEXPR operator uint32_t()
8785 {
8786 return word0;
8787 }
8788 operator uint32_t() volatile
8789 {
8790 return word0;
8791 }
8792 ifm_width0_m1_r copy() volatile
8793 {
8794 return *this;
8795 }
8796 CONSTEXPR uint32_t get_value() const
8797 {
8798 uint32_t value = static_cast<uint32_t>(word0);
8799 return value;
8800 }
8801 uint32_t get_value() const volatile
8802 {
8803 uint32_t value = static_cast<uint32_t>(word0);
8804 return value;
8805 }
8806 CONSTEXPR ifm_width0_m1_r &set_value(uint32_t value)
8807 {
8808 word0 = static_cast<uint32_t>(value);
8809 return *this;
8810 }
8811#endif
8812};
8813
8814// ifm_height0_m1_r - None
8815struct ifm_height0_m1_r
8816{
8817#ifndef __cplusplus
8818 union
8819 {
8820 struct
8821 {
8822 uint32_t value : 32; // 32-bit register value
8823 };
8824 uint32_t word;
8825 };
8826#else
8827 private:
8828 uint32_t word0;
8829
8830 public:
8831 CONSTEXPR ifm_height0_m1_r() : word0(0) {}
8832 CONSTEXPR ifm_height0_m1_r(uint32_t init) : word0(init) {}
8833 CONSTEXPR void operator=(uint32_t value)
8834 {
8835 word0 = value;
8836 }
8837 void operator=(uint32_t value) volatile
8838 {
8839 word0 = value;
8840 }
8841 CONSTEXPR operator uint32_t()
8842 {
8843 return word0;
8844 }
8845 operator uint32_t() volatile
8846 {
8847 return word0;
8848 }
8849 ifm_height0_m1_r copy() volatile
8850 {
8851 return *this;
8852 }
8853 CONSTEXPR uint32_t get_value() const
8854 {
8855 uint32_t value = static_cast<uint32_t>(word0);
8856 return value;
8857 }
8858 uint32_t get_value() const volatile
8859 {
8860 uint32_t value = static_cast<uint32_t>(word0);
8861 return value;
8862 }
8863 CONSTEXPR ifm_height0_m1_r &set_value(uint32_t value)
8864 {
8865 word0 = static_cast<uint32_t>(value);
8866 return *this;
8867 }
8868#endif
8869};
8870
8871// ifm_height1_m1_r - None
8872struct ifm_height1_m1_r
8873{
8874#ifndef __cplusplus
8875 union
8876 {
8877 struct
8878 {
8879 uint32_t value : 32; // 32-bit register value
8880 };
8881 uint32_t word;
8882 };
8883#else
8884 private:
8885 uint32_t word0;
8886
8887 public:
8888 CONSTEXPR ifm_height1_m1_r() : word0(0) {}
8889 CONSTEXPR ifm_height1_m1_r(uint32_t init) : word0(init) {}
8890 CONSTEXPR void operator=(uint32_t value)
8891 {
8892 word0 = value;
8893 }
8894 void operator=(uint32_t value) volatile
8895 {
8896 word0 = value;
8897 }
8898 CONSTEXPR operator uint32_t()
8899 {
8900 return word0;
8901 }
8902 operator uint32_t() volatile
8903 {
8904 return word0;
8905 }
8906 ifm_height1_m1_r copy() volatile
8907 {
8908 return *this;
8909 }
8910 CONSTEXPR uint32_t get_value() const
8911 {
8912 uint32_t value = static_cast<uint32_t>(word0);
8913 return value;
8914 }
8915 uint32_t get_value() const volatile
8916 {
8917 uint32_t value = static_cast<uint32_t>(word0);
8918 return value;
8919 }
8920 CONSTEXPR ifm_height1_m1_r &set_value(uint32_t value)
8921 {
8922 word0 = static_cast<uint32_t>(value);
8923 return *this;
8924 }
8925#endif
8926};
8927
8928// ifm_ib_end_r - None
8929struct ifm_ib_end_r
8930{
8931#ifndef __cplusplus
8932 union
8933 {
8934 struct
8935 {
8936 uint32_t value : 32; // 32-bit register value
8937 };
8938 uint32_t word;
8939 };
8940#else
8941 private:
8942 uint32_t word0;
8943
8944 public:
8945 CONSTEXPR ifm_ib_end_r() : word0(0) {}
8946 CONSTEXPR ifm_ib_end_r(uint32_t init) : word0(init) {}
8947 CONSTEXPR void operator=(uint32_t value)
8948 {
8949 word0 = value;
8950 }
8951 void operator=(uint32_t value) volatile
8952 {
8953 word0 = value;
8954 }
8955 CONSTEXPR operator uint32_t()
8956 {
8957 return word0;
8958 }
8959 operator uint32_t() volatile
8960 {
8961 return word0;
8962 }
8963 ifm_ib_end_r copy() volatile
8964 {
8965 return *this;
8966 }
8967 CONSTEXPR uint32_t get_value() const
8968 {
8969 uint32_t value = static_cast<uint32_t>(word0);
8970 return value;
8971 }
8972 uint32_t get_value() const volatile
8973 {
8974 uint32_t value = static_cast<uint32_t>(word0);
8975 return value;
8976 }
8977 CONSTEXPR ifm_ib_end_r &set_value(uint32_t value)
8978 {
8979 word0 = static_cast<uint32_t>(value);
8980 return *this;
8981 }
8982#endif
8983};
8984
8985// ifm_region_r - None
8986struct ifm_region_r
8987{
8988#ifndef __cplusplus
8989 union
8990 {
8991 struct
8992 {
8993 uint32_t value : 32; // 32-bit register value
8994 };
8995 uint32_t word;
8996 };
8997#else
8998 private:
8999 uint32_t word0;
9000
9001 public:
9002 CONSTEXPR ifm_region_r() : word0(0) {}
9003 CONSTEXPR ifm_region_r(uint32_t init) : word0(init) {}
9004 CONSTEXPR void operator=(uint32_t value)
9005 {
9006 word0 = value;
9007 }
9008 void operator=(uint32_t value) volatile
9009 {
9010 word0 = value;
9011 }
9012 CONSTEXPR operator uint32_t()
9013 {
9014 return word0;
9015 }
9016 operator uint32_t() volatile
9017 {
9018 return word0;
9019 }
9020 ifm_region_r copy() volatile
9021 {
9022 return *this;
9023 }
9024 CONSTEXPR uint32_t get_value() const
9025 {
9026 uint32_t value = static_cast<uint32_t>(word0);
9027 return value;
9028 }
9029 uint32_t get_value() const volatile
9030 {
9031 uint32_t value = static_cast<uint32_t>(word0);
9032 return value;
9033 }
9034 CONSTEXPR ifm_region_r &set_value(uint32_t value)
9035 {
9036 word0 = static_cast<uint32_t>(value);
9037 return *this;
9038 }
9039#endif
9040};
9041
9042// ofm_width_m1_r - None
9043struct ofm_width_m1_r
9044{
9045#ifndef __cplusplus
9046 union
9047 {
9048 struct
9049 {
9050 uint32_t value : 32; // 32-bit register value
9051 };
9052 uint32_t word;
9053 };
9054#else
9055 private:
9056 uint32_t word0;
9057
9058 public:
9059 CONSTEXPR ofm_width_m1_r() : word0(0) {}
9060 CONSTEXPR ofm_width_m1_r(uint32_t init) : word0(init) {}
9061 CONSTEXPR void operator=(uint32_t value)
9062 {
9063 word0 = value;
9064 }
9065 void operator=(uint32_t value) volatile
9066 {
9067 word0 = value;
9068 }
9069 CONSTEXPR operator uint32_t()
9070 {
9071 return word0;
9072 }
9073 operator uint32_t() volatile
9074 {
9075 return word0;
9076 }
9077 ofm_width_m1_r copy() volatile
9078 {
9079 return *this;
9080 }
9081 CONSTEXPR uint32_t get_value() const
9082 {
9083 uint32_t value = static_cast<uint32_t>(word0);
9084 return value;
9085 }
9086 uint32_t get_value() const volatile
9087 {
9088 uint32_t value = static_cast<uint32_t>(word0);
9089 return value;
9090 }
9091 CONSTEXPR ofm_width_m1_r &set_value(uint32_t value)
9092 {
9093 word0 = static_cast<uint32_t>(value);
9094 return *this;
9095 }
9096#endif
9097};
9098
9099// ofm_height_m1_r - None
9100struct ofm_height_m1_r
9101{
9102#ifndef __cplusplus
9103 union
9104 {
9105 struct
9106 {
9107 uint32_t value : 32; // 32-bit register value
9108 };
9109 uint32_t word;
9110 };
9111#else
9112 private:
9113 uint32_t word0;
9114
9115 public:
9116 CONSTEXPR ofm_height_m1_r() : word0(0) {}
9117 CONSTEXPR ofm_height_m1_r(uint32_t init) : word0(init) {}
9118 CONSTEXPR void operator=(uint32_t value)
9119 {
9120 word0 = value;
9121 }
9122 void operator=(uint32_t value) volatile
9123 {
9124 word0 = value;
9125 }
9126 CONSTEXPR operator uint32_t()
9127 {
9128 return word0;
9129 }
9130 operator uint32_t() volatile
9131 {
9132 return word0;
9133 }
9134 ofm_height_m1_r copy() volatile
9135 {
9136 return *this;
9137 }
9138 CONSTEXPR uint32_t get_value() const
9139 {
9140 uint32_t value = static_cast<uint32_t>(word0);
9141 return value;
9142 }
9143 uint32_t get_value() const volatile
9144 {
9145 uint32_t value = static_cast<uint32_t>(word0);
9146 return value;
9147 }
9148 CONSTEXPR ofm_height_m1_r &set_value(uint32_t value)
9149 {
9150 word0 = static_cast<uint32_t>(value);
9151 return *this;
9152 }
9153#endif
9154};
9155
9156// ofm_depth_m1_r - None
9157struct ofm_depth_m1_r
9158{
9159#ifndef __cplusplus
9160 union
9161 {
9162 struct
9163 {
9164 uint32_t value : 32; // 32-bit register value
9165 };
9166 uint32_t word;
9167 };
9168#else
9169 private:
9170 uint32_t word0;
9171
9172 public:
9173 CONSTEXPR ofm_depth_m1_r() : word0(0) {}
9174 CONSTEXPR ofm_depth_m1_r(uint32_t init) : word0(init) {}
9175 CONSTEXPR void operator=(uint32_t value)
9176 {
9177 word0 = value;
9178 }
9179 void operator=(uint32_t value) volatile
9180 {
9181 word0 = value;
9182 }
9183 CONSTEXPR operator uint32_t()
9184 {
9185 return word0;
9186 }
9187 operator uint32_t() volatile
9188 {
9189 return word0;
9190 }
9191 ofm_depth_m1_r copy() volatile
9192 {
9193 return *this;
9194 }
9195 CONSTEXPR uint32_t get_value() const
9196 {
9197 uint32_t value = static_cast<uint32_t>(word0);
9198 return value;
9199 }
9200 uint32_t get_value() const volatile
9201 {
9202 uint32_t value = static_cast<uint32_t>(word0);
9203 return value;
9204 }
9205 CONSTEXPR ofm_depth_m1_r &set_value(uint32_t value)
9206 {
9207 word0 = static_cast<uint32_t>(value);
9208 return *this;
9209 }
9210#endif
9211};
9212
9213// ofm_precision_r - None
9214struct ofm_precision_r
9215{
9216#ifndef __cplusplus
9217 union
9218 {
9219 struct
9220 {
9221 uint32_t value : 32; // 32-bit register value
9222 };
9223 uint32_t word;
9224 };
9225#else
9226 private:
9227 uint32_t word0;
9228
9229 public:
9230 CONSTEXPR ofm_precision_r() : word0(0) {}
9231 CONSTEXPR ofm_precision_r(uint32_t init) : word0(init) {}
9232 CONSTEXPR void operator=(uint32_t value)
9233 {
9234 word0 = value;
9235 }
9236 void operator=(uint32_t value) volatile
9237 {
9238 word0 = value;
9239 }
9240 CONSTEXPR operator uint32_t()
9241 {
9242 return word0;
9243 }
9244 operator uint32_t() volatile
9245 {
9246 return word0;
9247 }
9248 ofm_precision_r copy() volatile
9249 {
9250 return *this;
9251 }
9252 CONSTEXPR uint32_t get_value() const
9253 {
9254 uint32_t value = static_cast<uint32_t>(word0);
9255 return value;
9256 }
9257 uint32_t get_value() const volatile
9258 {
9259 uint32_t value = static_cast<uint32_t>(word0);
9260 return value;
9261 }
9262 CONSTEXPR ofm_precision_r &set_value(uint32_t value)
9263 {
9264 word0 = static_cast<uint32_t>(value);
9265 return *this;
9266 }
9267#endif
9268};
9269
9270// ofm_blk_width_m1_r - None
9271struct ofm_blk_width_m1_r
9272{
9273#ifndef __cplusplus
9274 union
9275 {
9276 struct
9277 {
9278 uint32_t value : 32; // 32-bit register value
9279 };
9280 uint32_t word;
9281 };
9282#else
9283 private:
9284 uint32_t word0;
9285
9286 public:
9287 CONSTEXPR ofm_blk_width_m1_r() : word0(0) {}
9288 CONSTEXPR ofm_blk_width_m1_r(uint32_t init) : word0(init) {}
9289 CONSTEXPR void operator=(uint32_t value)
9290 {
9291 word0 = value;
9292 }
9293 void operator=(uint32_t value) volatile
9294 {
9295 word0 = value;
9296 }
9297 CONSTEXPR operator uint32_t()
9298 {
9299 return word0;
9300 }
9301 operator uint32_t() volatile
9302 {
9303 return word0;
9304 }
9305 ofm_blk_width_m1_r copy() volatile
9306 {
9307 return *this;
9308 }
9309 CONSTEXPR uint32_t get_value() const
9310 {
9311 uint32_t value = static_cast<uint32_t>(word0);
9312 return value;
9313 }
9314 uint32_t get_value() const volatile
9315 {
9316 uint32_t value = static_cast<uint32_t>(word0);
9317 return value;
9318 }
9319 CONSTEXPR ofm_blk_width_m1_r &set_value(uint32_t value)
9320 {
9321 word0 = static_cast<uint32_t>(value);
9322 return *this;
9323 }
9324#endif
9325};
9326
9327// ofm_blk_height_m1_r - None
9328struct ofm_blk_height_m1_r
9329{
9330#ifndef __cplusplus
9331 union
9332 {
9333 struct
9334 {
9335 uint32_t value : 32; // 32-bit register value
9336 };
9337 uint32_t word;
9338 };
9339#else
9340 private:
9341 uint32_t word0;
9342
9343 public:
9344 CONSTEXPR ofm_blk_height_m1_r() : word0(0) {}
9345 CONSTEXPR ofm_blk_height_m1_r(uint32_t init) : word0(init) {}
9346 CONSTEXPR void operator=(uint32_t value)
9347 {
9348 word0 = value;
9349 }
9350 void operator=(uint32_t value) volatile
9351 {
9352 word0 = value;
9353 }
9354 CONSTEXPR operator uint32_t()
9355 {
9356 return word0;
9357 }
9358 operator uint32_t() volatile
9359 {
9360 return word0;
9361 }
9362 ofm_blk_height_m1_r copy() volatile
9363 {
9364 return *this;
9365 }
9366 CONSTEXPR uint32_t get_value() const
9367 {
9368 uint32_t value = static_cast<uint32_t>(word0);
9369 return value;
9370 }
9371 uint32_t get_value() const volatile
9372 {
9373 uint32_t value = static_cast<uint32_t>(word0);
9374 return value;
9375 }
9376 CONSTEXPR ofm_blk_height_m1_r &set_value(uint32_t value)
9377 {
9378 word0 = static_cast<uint32_t>(value);
9379 return *this;
9380 }
9381#endif
9382};
9383
9384// ofm_blk_depth_m1_r - None
9385struct ofm_blk_depth_m1_r
9386{
9387#ifndef __cplusplus
9388 union
9389 {
9390 struct
9391 {
9392 uint32_t value : 32; // 32-bit register value
9393 };
9394 uint32_t word;
9395 };
9396#else
9397 private:
9398 uint32_t word0;
9399
9400 public:
9401 CONSTEXPR ofm_blk_depth_m1_r() : word0(0) {}
9402 CONSTEXPR ofm_blk_depth_m1_r(uint32_t init) : word0(init) {}
9403 CONSTEXPR void operator=(uint32_t value)
9404 {
9405 word0 = value;
9406 }
9407 void operator=(uint32_t value) volatile
9408 {
9409 word0 = value;
9410 }
9411 CONSTEXPR operator uint32_t()
9412 {
9413 return word0;
9414 }
9415 operator uint32_t() volatile
9416 {
9417 return word0;
9418 }
9419 ofm_blk_depth_m1_r copy() volatile
9420 {
9421 return *this;
9422 }
9423 CONSTEXPR uint32_t get_value() const
9424 {
9425 uint32_t value = static_cast<uint32_t>(word0);
9426 return value;
9427 }
9428 uint32_t get_value() const volatile
9429 {
9430 uint32_t value = static_cast<uint32_t>(word0);
9431 return value;
9432 }
9433 CONSTEXPR ofm_blk_depth_m1_r &set_value(uint32_t value)
9434 {
9435 word0 = static_cast<uint32_t>(value);
9436 return *this;
9437 }
9438#endif
9439};
9440
9441// ofm_zero_point_r - None
9442struct ofm_zero_point_r
9443{
9444#ifndef __cplusplus
9445 union
9446 {
9447 struct
9448 {
9449 uint32_t value : 32; // 32-bit register value
9450 };
9451 uint32_t word;
9452 };
9453#else
9454 private:
9455 uint32_t word0;
9456
9457 public:
9458 CONSTEXPR ofm_zero_point_r() : word0(0) {}
9459 CONSTEXPR ofm_zero_point_r(uint32_t init) : word0(init) {}
9460 CONSTEXPR void operator=(uint32_t value)
9461 {
9462 word0 = value;
9463 }
9464 void operator=(uint32_t value) volatile
9465 {
9466 word0 = value;
9467 }
9468 CONSTEXPR operator uint32_t()
9469 {
9470 return word0;
9471 }
9472 operator uint32_t() volatile
9473 {
9474 return word0;
9475 }
9476 ofm_zero_point_r copy() volatile
9477 {
9478 return *this;
9479 }
9480 CONSTEXPR uint32_t get_value() const
9481 {
9482 uint32_t value = static_cast<uint32_t>(word0);
9483 return value;
9484 }
9485 uint32_t get_value() const volatile
9486 {
9487 uint32_t value = static_cast<uint32_t>(word0);
9488 return value;
9489 }
9490 CONSTEXPR ofm_zero_point_r &set_value(uint32_t value)
9491 {
9492 word0 = static_cast<uint32_t>(value);
9493 return *this;
9494 }
9495#endif
9496};
9497
9498// ofm_width0_m1_r - None
9499struct ofm_width0_m1_r
9500{
9501#ifndef __cplusplus
9502 union
9503 {
9504 struct
9505 {
9506 uint32_t value : 32; // 32-bit register value
9507 };
9508 uint32_t word;
9509 };
9510#else
9511 private:
9512 uint32_t word0;
9513
9514 public:
9515 CONSTEXPR ofm_width0_m1_r() : word0(0) {}
9516 CONSTEXPR ofm_width0_m1_r(uint32_t init) : word0(init) {}
9517 CONSTEXPR void operator=(uint32_t value)
9518 {
9519 word0 = value;
9520 }
9521 void operator=(uint32_t value) volatile
9522 {
9523 word0 = value;
9524 }
9525 CONSTEXPR operator uint32_t()
9526 {
9527 return word0;
9528 }
9529 operator uint32_t() volatile
9530 {
9531 return word0;
9532 }
9533 ofm_width0_m1_r copy() volatile
9534 {
9535 return *this;
9536 }
9537 CONSTEXPR uint32_t get_value() const
9538 {
9539 uint32_t value = static_cast<uint32_t>(word0);
9540 return value;
9541 }
9542 uint32_t get_value() const volatile
9543 {
9544 uint32_t value = static_cast<uint32_t>(word0);
9545 return value;
9546 }
9547 CONSTEXPR ofm_width0_m1_r &set_value(uint32_t value)
9548 {
9549 word0 = static_cast<uint32_t>(value);
9550 return *this;
9551 }
9552#endif
9553};
9554
9555// ofm_height0_m1_r - None
9556struct ofm_height0_m1_r
9557{
9558#ifndef __cplusplus
9559 union
9560 {
9561 struct
9562 {
9563 uint32_t value : 32; // 32-bit register value
9564 };
9565 uint32_t word;
9566 };
9567#else
9568 private:
9569 uint32_t word0;
9570
9571 public:
9572 CONSTEXPR ofm_height0_m1_r() : word0(0) {}
9573 CONSTEXPR ofm_height0_m1_r(uint32_t init) : word0(init) {}
9574 CONSTEXPR void operator=(uint32_t value)
9575 {
9576 word0 = value;
9577 }
9578 void operator=(uint32_t value) volatile
9579 {
9580 word0 = value;
9581 }
9582 CONSTEXPR operator uint32_t()
9583 {
9584 return word0;
9585 }
9586 operator uint32_t() volatile
9587 {
9588 return word0;
9589 }
9590 ofm_height0_m1_r copy() volatile
9591 {
9592 return *this;
9593 }
9594 CONSTEXPR uint32_t get_value() const
9595 {
9596 uint32_t value = static_cast<uint32_t>(word0);
9597 return value;
9598 }
9599 uint32_t get_value() const volatile
9600 {
9601 uint32_t value = static_cast<uint32_t>(word0);
9602 return value;
9603 }
9604 CONSTEXPR ofm_height0_m1_r &set_value(uint32_t value)
9605 {
9606 word0 = static_cast<uint32_t>(value);
9607 return *this;
9608 }
9609#endif
9610};
9611
9612// ofm_height1_m1_r - None
9613struct ofm_height1_m1_r
9614{
9615#ifndef __cplusplus
9616 union
9617 {
9618 struct
9619 {
9620 uint32_t value : 32; // 32-bit register value
9621 };
9622 uint32_t word;
9623 };
9624#else
9625 private:
9626 uint32_t word0;
9627
9628 public:
9629 CONSTEXPR ofm_height1_m1_r() : word0(0) {}
9630 CONSTEXPR ofm_height1_m1_r(uint32_t init) : word0(init) {}
9631 CONSTEXPR void operator=(uint32_t value)
9632 {
9633 word0 = value;
9634 }
9635 void operator=(uint32_t value) volatile
9636 {
9637 word0 = value;
9638 }
9639 CONSTEXPR operator uint32_t()
9640 {
9641 return word0;
9642 }
9643 operator uint32_t() volatile
9644 {
9645 return word0;
9646 }
9647 ofm_height1_m1_r copy() volatile
9648 {
9649 return *this;
9650 }
9651 CONSTEXPR uint32_t get_value() const
9652 {
9653 uint32_t value = static_cast<uint32_t>(word0);
9654 return value;
9655 }
9656 uint32_t get_value() const volatile
9657 {
9658 uint32_t value = static_cast<uint32_t>(word0);
9659 return value;
9660 }
9661 CONSTEXPR ofm_height1_m1_r &set_value(uint32_t value)
9662 {
9663 word0 = static_cast<uint32_t>(value);
9664 return *this;
9665 }
9666#endif
9667};
9668
9669// ofm_region_r - None
9670struct ofm_region_r
9671{
9672#ifndef __cplusplus
9673 union
9674 {
9675 struct
9676 {
9677 uint32_t value : 32; // 32-bit register value
9678 };
9679 uint32_t word;
9680 };
9681#else
9682 private:
9683 uint32_t word0;
9684
9685 public:
9686 CONSTEXPR ofm_region_r() : word0(0) {}
9687 CONSTEXPR ofm_region_r(uint32_t init) : word0(init) {}
9688 CONSTEXPR void operator=(uint32_t value)
9689 {
9690 word0 = value;
9691 }
9692 void operator=(uint32_t value) volatile
9693 {
9694 word0 = value;
9695 }
9696 CONSTEXPR operator uint32_t()
9697 {
9698 return word0;
9699 }
9700 operator uint32_t() volatile
9701 {
9702 return word0;
9703 }
9704 ofm_region_r copy() volatile
9705 {
9706 return *this;
9707 }
9708 CONSTEXPR uint32_t get_value() const
9709 {
9710 uint32_t value = static_cast<uint32_t>(word0);
9711 return value;
9712 }
9713 uint32_t get_value() const volatile
9714 {
9715 uint32_t value = static_cast<uint32_t>(word0);
9716 return value;
9717 }
9718 CONSTEXPR ofm_region_r &set_value(uint32_t value)
9719 {
9720 word0 = static_cast<uint32_t>(value);
9721 return *this;
9722 }
9723#endif
9724};
9725
9726// kernel_width_m1_r - None
9727struct kernel_width_m1_r
9728{
9729#ifndef __cplusplus
9730 union
9731 {
9732 struct
9733 {
9734 uint32_t value : 32; // 32-bit register value
9735 };
9736 uint32_t word;
9737 };
9738#else
9739 private:
9740 uint32_t word0;
9741
9742 public:
9743 CONSTEXPR kernel_width_m1_r() : word0(0) {}
9744 CONSTEXPR kernel_width_m1_r(uint32_t init) : word0(init) {}
9745 CONSTEXPR void operator=(uint32_t value)
9746 {
9747 word0 = value;
9748 }
9749 void operator=(uint32_t value) volatile
9750 {
9751 word0 = value;
9752 }
9753 CONSTEXPR operator uint32_t()
9754 {
9755 return word0;
9756 }
9757 operator uint32_t() volatile
9758 {
9759 return word0;
9760 }
9761 kernel_width_m1_r copy() volatile
9762 {
9763 return *this;
9764 }
9765 CONSTEXPR uint32_t get_value() const
9766 {
9767 uint32_t value = static_cast<uint32_t>(word0);
9768 return value;
9769 }
9770 uint32_t get_value() const volatile
9771 {
9772 uint32_t value = static_cast<uint32_t>(word0);
9773 return value;
9774 }
9775 CONSTEXPR kernel_width_m1_r &set_value(uint32_t value)
9776 {
9777 word0 = static_cast<uint32_t>(value);
9778 return *this;
9779 }
9780#endif
9781};
9782
9783// kernel_height_m1_r - None
9784struct kernel_height_m1_r
9785{
9786#ifndef __cplusplus
9787 union
9788 {
9789 struct
9790 {
9791 uint32_t value : 32; // 32-bit register value
9792 };
9793 uint32_t word;
9794 };
9795#else
9796 private:
9797 uint32_t word0;
9798
9799 public:
9800 CONSTEXPR kernel_height_m1_r() : word0(0) {}
9801 CONSTEXPR kernel_height_m1_r(uint32_t init) : word0(init) {}
9802 CONSTEXPR void operator=(uint32_t value)
9803 {
9804 word0 = value;
9805 }
9806 void operator=(uint32_t value) volatile
9807 {
9808 word0 = value;
9809 }
9810 CONSTEXPR operator uint32_t()
9811 {
9812 return word0;
9813 }
9814 operator uint32_t() volatile
9815 {
9816 return word0;
9817 }
9818 kernel_height_m1_r copy() volatile
9819 {
9820 return *this;
9821 }
9822 CONSTEXPR uint32_t get_value() const
9823 {
9824 uint32_t value = static_cast<uint32_t>(word0);
9825 return value;
9826 }
9827 uint32_t get_value() const volatile
9828 {
9829 uint32_t value = static_cast<uint32_t>(word0);
9830 return value;
9831 }
9832 CONSTEXPR kernel_height_m1_r &set_value(uint32_t value)
9833 {
9834 word0 = static_cast<uint32_t>(value);
9835 return *this;
9836 }
9837#endif
9838};
9839
9840// kernel_stride_r - None
9841struct kernel_stride_r
9842{
9843#ifndef __cplusplus
9844 union
9845 {
9846 struct
9847 {
9848 uint32_t value : 32; // 32-bit register value
9849 };
9850 uint32_t word;
9851 };
9852#else
9853 private:
9854 uint32_t word0;
9855
9856 public:
9857 CONSTEXPR kernel_stride_r() : word0(0) {}
9858 CONSTEXPR kernel_stride_r(uint32_t init) : word0(init) {}
9859 CONSTEXPR void operator=(uint32_t value)
9860 {
9861 word0 = value;
9862 }
9863 void operator=(uint32_t value) volatile
9864 {
9865 word0 = value;
9866 }
9867 CONSTEXPR operator uint32_t()
9868 {
9869 return word0;
9870 }
9871 operator uint32_t() volatile
9872 {
9873 return word0;
9874 }
9875 kernel_stride_r copy() volatile
9876 {
9877 return *this;
9878 }
9879 CONSTEXPR uint32_t get_value() const
9880 {
9881 uint32_t value = static_cast<uint32_t>(word0);
9882 return value;
9883 }
9884 uint32_t get_value() const volatile
9885 {
9886 uint32_t value = static_cast<uint32_t>(word0);
9887 return value;
9888 }
9889 CONSTEXPR kernel_stride_r &set_value(uint32_t value)
9890 {
9891 word0 = static_cast<uint32_t>(value);
9892 return *this;
9893 }
9894#endif
9895};
9896
9897// acc_format_r - None
9898struct acc_format_r
9899{
9900#ifndef __cplusplus
9901 union
9902 {
9903 struct
9904 {
9905 uint32_t value : 32; // 32-bit register value
9906 };
9907 uint32_t word;
9908 };
9909#else
9910 private:
9911 uint32_t word0;
9912
9913 public:
9914 CONSTEXPR acc_format_r() : word0(0) {}
9915 CONSTEXPR acc_format_r(uint32_t init) : word0(init) {}
9916 CONSTEXPR void operator=(uint32_t value)
9917 {
9918 word0 = value;
9919 }
9920 void operator=(uint32_t value) volatile
9921 {
9922 word0 = value;
9923 }
9924 CONSTEXPR operator uint32_t()
9925 {
9926 return word0;
9927 }
9928 operator uint32_t() volatile
9929 {
9930 return word0;
9931 }
9932 acc_format_r copy() volatile
9933 {
9934 return *this;
9935 }
9936 CONSTEXPR uint32_t get_value() const
9937 {
9938 uint32_t value = static_cast<uint32_t>(word0);
9939 return value;
9940 }
9941 uint32_t get_value() const volatile
9942 {
9943 uint32_t value = static_cast<uint32_t>(word0);
9944 return value;
9945 }
9946 CONSTEXPR acc_format_r &set_value(uint32_t value)
9947 {
9948 word0 = static_cast<uint32_t>(value);
9949 return *this;
9950 }
9951#endif
9952};
9953
9954// activation_r - None
9955struct activation_r
9956{
9957#ifndef __cplusplus
9958 union
9959 {
9960 struct
9961 {
9962 uint32_t value : 32; // 32-bit register value
9963 };
9964 uint32_t word;
9965 };
9966#else
9967 private:
9968 uint32_t word0;
9969
9970 public:
9971 CONSTEXPR activation_r() : word0(0) {}
9972 CONSTEXPR activation_r(uint32_t init) : word0(init) {}
9973 CONSTEXPR void operator=(uint32_t value)
9974 {
9975 word0 = value;
9976 }
9977 void operator=(uint32_t value) volatile
9978 {
9979 word0 = value;
9980 }
9981 CONSTEXPR operator uint32_t()
9982 {
9983 return word0;
9984 }
9985 operator uint32_t() volatile
9986 {
9987 return word0;
9988 }
9989 activation_r copy() volatile
9990 {
9991 return *this;
9992 }
9993 CONSTEXPR uint32_t get_value() const
9994 {
9995 uint32_t value = static_cast<uint32_t>(word0);
9996 return value;
9997 }
9998 uint32_t get_value() const volatile
9999 {
10000 uint32_t value = static_cast<uint32_t>(word0);
10001 return value;
10002 }
10003 CONSTEXPR activation_r &set_value(uint32_t value)
10004 {
10005 word0 = static_cast<uint32_t>(value);
10006 return *this;
10007 }
10008#endif
10009};
10010
10011// activation_min_r - None
10012struct activation_min_r
10013{
10014#ifndef __cplusplus
10015 union
10016 {
10017 struct
10018 {
10019 uint32_t value : 32; // 32-bit register value
10020 };
10021 uint32_t word;
10022 };
10023#else
10024 private:
10025 uint32_t word0;
10026
10027 public:
10028 CONSTEXPR activation_min_r() : word0(0) {}
10029 CONSTEXPR activation_min_r(uint32_t init) : word0(init) {}
10030 CONSTEXPR void operator=(uint32_t value)
10031 {
10032 word0 = value;
10033 }
10034 void operator=(uint32_t value) volatile
10035 {
10036 word0 = value;
10037 }
10038 CONSTEXPR operator uint32_t()
10039 {
10040 return word0;
10041 }
10042 operator uint32_t() volatile
10043 {
10044 return word0;
10045 }
10046 activation_min_r copy() volatile
10047 {
10048 return *this;
10049 }
10050 CONSTEXPR uint32_t get_value() const
10051 {
10052 uint32_t value = static_cast<uint32_t>(word0);
10053 return value;
10054 }
10055 uint32_t get_value() const volatile
10056 {
10057 uint32_t value = static_cast<uint32_t>(word0);
10058 return value;
10059 }
10060 CONSTEXPR activation_min_r &set_value(uint32_t value)
10061 {
10062 word0 = static_cast<uint32_t>(value);
10063 return *this;
10064 }
10065#endif
10066};
10067
10068// activation_max_r - None
10069struct activation_max_r
10070{
10071#ifndef __cplusplus
10072 union
10073 {
10074 struct
10075 {
10076 uint32_t value : 32; // 32-bit register value
10077 };
10078 uint32_t word;
10079 };
10080#else
10081 private:
10082 uint32_t word0;
10083
10084 public:
10085 CONSTEXPR activation_max_r() : word0(0) {}
10086 CONSTEXPR activation_max_r(uint32_t init) : word0(init) {}
10087 CONSTEXPR void operator=(uint32_t value)
10088 {
10089 word0 = value;
10090 }
10091 void operator=(uint32_t value) volatile
10092 {
10093 word0 = value;
10094 }
10095 CONSTEXPR operator uint32_t()
10096 {
10097 return word0;
10098 }
10099 operator uint32_t() volatile
10100 {
10101 return word0;
10102 }
10103 activation_max_r copy() volatile
10104 {
10105 return *this;
10106 }
10107 CONSTEXPR uint32_t get_value() const
10108 {
10109 uint32_t value = static_cast<uint32_t>(word0);
10110 return value;
10111 }
10112 uint32_t get_value() const volatile
10113 {
10114 uint32_t value = static_cast<uint32_t>(word0);
10115 return value;
10116 }
10117 CONSTEXPR activation_max_r &set_value(uint32_t value)
10118 {
10119 word0 = static_cast<uint32_t>(value);
10120 return *this;
10121 }
10122#endif
10123};
10124
10125// weight_region_r - None
10126struct weight_region_r
10127{
10128#ifndef __cplusplus
10129 union
10130 {
10131 struct
10132 {
10133 uint32_t value : 32; // 32-bit register value
10134 };
10135 uint32_t word;
10136 };
10137#else
10138 private:
10139 uint32_t word0;
10140
10141 public:
10142 CONSTEXPR weight_region_r() : word0(0) {}
10143 CONSTEXPR weight_region_r(uint32_t init) : word0(init) {}
10144 CONSTEXPR void operator=(uint32_t value)
10145 {
10146 word0 = value;
10147 }
10148 void operator=(uint32_t value) volatile
10149 {
10150 word0 = value;
10151 }
10152 CONSTEXPR operator uint32_t()
10153 {
10154 return word0;
10155 }
10156 operator uint32_t() volatile
10157 {
10158 return word0;
10159 }
10160 weight_region_r copy() volatile
10161 {
10162 return *this;
10163 }
10164 CONSTEXPR uint32_t get_value() const
10165 {
10166 uint32_t value = static_cast<uint32_t>(word0);
10167 return value;
10168 }
10169 uint32_t get_value() const volatile
10170 {
10171 uint32_t value = static_cast<uint32_t>(word0);
10172 return value;
10173 }
10174 CONSTEXPR weight_region_r &set_value(uint32_t value)
10175 {
10176 word0 = static_cast<uint32_t>(value);
10177 return *this;
10178 }
10179#endif
10180};
10181
10182// scale_region_r - None
10183struct scale_region_r
10184{
10185#ifndef __cplusplus
10186 union
10187 {
10188 struct
10189 {
10190 uint32_t value : 32; // 32-bit register value
10191 };
10192 uint32_t word;
10193 };
10194#else
10195 private:
10196 uint32_t word0;
10197
10198 public:
10199 CONSTEXPR scale_region_r() : word0(0) {}
10200 CONSTEXPR scale_region_r(uint32_t init) : word0(init) {}
10201 CONSTEXPR void operator=(uint32_t value)
10202 {
10203 word0 = value;
10204 }
10205 void operator=(uint32_t value) volatile
10206 {
10207 word0 = value;
10208 }
10209 CONSTEXPR operator uint32_t()
10210 {
10211 return word0;
10212 }
10213 operator uint32_t() volatile
10214 {
10215 return word0;
10216 }
10217 scale_region_r copy() volatile
10218 {
10219 return *this;
10220 }
10221 CONSTEXPR uint32_t get_value() const
10222 {
10223 uint32_t value = static_cast<uint32_t>(word0);
10224 return value;
10225 }
10226 uint32_t get_value() const volatile
10227 {
10228 uint32_t value = static_cast<uint32_t>(word0);
10229 return value;
10230 }
10231 CONSTEXPR scale_region_r &set_value(uint32_t value)
10232 {
10233 word0 = static_cast<uint32_t>(value);
10234 return *this;
10235 }
10236#endif
10237};
10238
10239// ab_start_r - None
10240struct ab_start_r
10241{
10242#ifndef __cplusplus
10243 union
10244 {
10245 struct
10246 {
10247 uint32_t value : 32; // 32-bit register value
10248 };
10249 uint32_t word;
10250 };
10251#else
10252 private:
10253 uint32_t word0;
10254
10255 public:
10256 CONSTEXPR ab_start_r() : word0(0) {}
10257 CONSTEXPR ab_start_r(uint32_t init) : word0(init) {}
10258 CONSTEXPR void operator=(uint32_t value)
10259 {
10260 word0 = value;
10261 }
10262 void operator=(uint32_t value) volatile
10263 {
10264 word0 = value;
10265 }
10266 CONSTEXPR operator uint32_t()
10267 {
10268 return word0;
10269 }
10270 operator uint32_t() volatile
10271 {
10272 return word0;
10273 }
10274 ab_start_r copy() volatile
10275 {
10276 return *this;
10277 }
10278 CONSTEXPR uint32_t get_value() const
10279 {
10280 uint32_t value = static_cast<uint32_t>(word0);
10281 return value;
10282 }
10283 uint32_t get_value() const volatile
10284 {
10285 uint32_t value = static_cast<uint32_t>(word0);
10286 return value;
10287 }
10288 CONSTEXPR ab_start_r &set_value(uint32_t value)
10289 {
10290 word0 = static_cast<uint32_t>(value);
10291 return *this;
10292 }
10293#endif
10294};
10295
10296// blockdep_r - None
10297struct blockdep_r
10298{
10299#ifndef __cplusplus
10300 union
10301 {
10302 struct
10303 {
10304 uint32_t value : 32; // 32-bit register value
10305 };
10306 uint32_t word;
10307 };
10308#else
10309 private:
10310 uint32_t word0;
10311
10312 public:
10313 CONSTEXPR blockdep_r() : word0(0) {}
10314 CONSTEXPR blockdep_r(uint32_t init) : word0(init) {}
10315 CONSTEXPR void operator=(uint32_t value)
10316 {
10317 word0 = value;
10318 }
10319 void operator=(uint32_t value) volatile
10320 {
10321 word0 = value;
10322 }
10323 CONSTEXPR operator uint32_t()
10324 {
10325 return word0;
10326 }
10327 operator uint32_t() volatile
10328 {
10329 return word0;
10330 }
10331 blockdep_r copy() volatile
10332 {
10333 return *this;
10334 }
10335 CONSTEXPR uint32_t get_value() const
10336 {
10337 uint32_t value = static_cast<uint32_t>(word0);
10338 return value;
10339 }
10340 uint32_t get_value() const volatile
10341 {
10342 uint32_t value = static_cast<uint32_t>(word0);
10343 return value;
10344 }
10345 CONSTEXPR blockdep_r &set_value(uint32_t value)
10346 {
10347 word0 = static_cast<uint32_t>(value);
10348 return *this;
10349 }
10350#endif
10351};
10352
10353// dma0_src_region_r - None
10354struct dma0_src_region_r
10355{
10356#ifndef __cplusplus
10357 union
10358 {
10359 struct
10360 {
10361 uint32_t value : 32; // 32-bit register value
10362 };
10363 uint32_t word;
10364 };
10365#else
10366 private:
10367 uint32_t word0;
10368
10369 public:
10370 CONSTEXPR dma0_src_region_r() : word0(0) {}
10371 CONSTEXPR dma0_src_region_r(uint32_t init) : word0(init) {}
10372 CONSTEXPR void operator=(uint32_t value)
10373 {
10374 word0 = value;
10375 }
10376 void operator=(uint32_t value) volatile
10377 {
10378 word0 = value;
10379 }
10380 CONSTEXPR operator uint32_t()
10381 {
10382 return word0;
10383 }
10384 operator uint32_t() volatile
10385 {
10386 return word0;
10387 }
10388 dma0_src_region_r copy() volatile
10389 {
10390 return *this;
10391 }
10392 CONSTEXPR uint32_t get_value() const
10393 {
10394 uint32_t value = static_cast<uint32_t>(word0);
10395 return value;
10396 }
10397 uint32_t get_value() const volatile
10398 {
10399 uint32_t value = static_cast<uint32_t>(word0);
10400 return value;
10401 }
10402 CONSTEXPR dma0_src_region_r &set_value(uint32_t value)
10403 {
10404 word0 = static_cast<uint32_t>(value);
10405 return *this;
10406 }
10407#endif
10408};
10409
10410// dma0_dst_region_r - None
10411struct dma0_dst_region_r
10412{
10413#ifndef __cplusplus
10414 union
10415 {
10416 struct
10417 {
10418 uint32_t value : 32; // 32-bit register value
10419 };
10420 uint32_t word;
10421 };
10422#else
10423 private:
10424 uint32_t word0;
10425
10426 public:
10427 CONSTEXPR dma0_dst_region_r() : word0(0) {}
10428 CONSTEXPR dma0_dst_region_r(uint32_t init) : word0(init) {}
10429 CONSTEXPR void operator=(uint32_t value)
10430 {
10431 word0 = value;
10432 }
10433 void operator=(uint32_t value) volatile
10434 {
10435 word0 = value;
10436 }
10437 CONSTEXPR operator uint32_t()
10438 {
10439 return word0;
10440 }
10441 operator uint32_t() volatile
10442 {
10443 return word0;
10444 }
10445 dma0_dst_region_r copy() volatile
10446 {
10447 return *this;
10448 }
10449 CONSTEXPR uint32_t get_value() const
10450 {
10451 uint32_t value = static_cast<uint32_t>(word0);
10452 return value;
10453 }
10454 uint32_t get_value() const volatile
10455 {
10456 uint32_t value = static_cast<uint32_t>(word0);
10457 return value;
10458 }
10459 CONSTEXPR dma0_dst_region_r &set_value(uint32_t value)
10460 {
10461 word0 = static_cast<uint32_t>(value);
10462 return *this;
10463 }
10464#endif
10465};
10466
10467// dma0_size0_r - None
10468struct dma0_size0_r
10469{
10470#ifndef __cplusplus
10471 union
10472 {
10473 struct
10474 {
10475 uint32_t value : 32; // 32-bit register value
10476 };
10477 uint32_t word;
10478 };
10479#else
10480 private:
10481 uint32_t word0;
10482
10483 public:
10484 CONSTEXPR dma0_size0_r() : word0(0) {}
10485 CONSTEXPR dma0_size0_r(uint32_t init) : word0(init) {}
10486 CONSTEXPR void operator=(uint32_t value)
10487 {
10488 word0 = value;
10489 }
10490 void operator=(uint32_t value) volatile
10491 {
10492 word0 = value;
10493 }
10494 CONSTEXPR operator uint32_t()
10495 {
10496 return word0;
10497 }
10498 operator uint32_t() volatile
10499 {
10500 return word0;
10501 }
10502 dma0_size0_r copy() volatile
10503 {
10504 return *this;
10505 }
10506 CONSTEXPR uint32_t get_value() const
10507 {
10508 uint32_t value = static_cast<uint32_t>(word0);
10509 return value;
10510 }
10511 uint32_t get_value() const volatile
10512 {
10513 uint32_t value = static_cast<uint32_t>(word0);
10514 return value;
10515 }
10516 CONSTEXPR dma0_size0_r &set_value(uint32_t value)
10517 {
10518 word0 = static_cast<uint32_t>(value);
10519 return *this;
10520 }
10521#endif
10522};
10523
10524// dma0_size1_r - None
10525struct dma0_size1_r
10526{
10527#ifndef __cplusplus
10528 union
10529 {
10530 struct
10531 {
10532 uint32_t value : 32; // 32-bit register value
10533 };
10534 uint32_t word;
10535 };
10536#else
10537 private:
10538 uint32_t word0;
10539
10540 public:
10541 CONSTEXPR dma0_size1_r() : word0(0) {}
10542 CONSTEXPR dma0_size1_r(uint32_t init) : word0(init) {}
10543 CONSTEXPR void operator=(uint32_t value)
10544 {
10545 word0 = value;
10546 }
10547 void operator=(uint32_t value) volatile
10548 {
10549 word0 = value;
10550 }
10551 CONSTEXPR operator uint32_t()
10552 {
10553 return word0;
10554 }
10555 operator uint32_t() volatile
10556 {
10557 return word0;
10558 }
10559 dma0_size1_r copy() volatile
10560 {
10561 return *this;
10562 }
10563 CONSTEXPR uint32_t get_value() const
10564 {
10565 uint32_t value = static_cast<uint32_t>(word0);
10566 return value;
10567 }
10568 uint32_t get_value() const volatile
10569 {
10570 uint32_t value = static_cast<uint32_t>(word0);
10571 return value;
10572 }
10573 CONSTEXPR dma0_size1_r &set_value(uint32_t value)
10574 {
10575 word0 = static_cast<uint32_t>(value);
10576 return *this;
10577 }
10578#endif
10579};
10580
10581// ifm2_broadcast_r - None
10582struct ifm2_broadcast_r
10583{
10584#ifndef __cplusplus
10585 union
10586 {
10587 struct
10588 {
10589 uint32_t value : 32; // 32-bit register value
10590 };
10591 uint32_t word;
10592 };
10593#else
10594 private:
10595 uint32_t word0;
10596
10597 public:
10598 CONSTEXPR ifm2_broadcast_r() : word0(0) {}
10599 CONSTEXPR ifm2_broadcast_r(uint32_t init) : word0(init) {}
10600 CONSTEXPR void operator=(uint32_t value)
10601 {
10602 word0 = value;
10603 }
10604 void operator=(uint32_t value) volatile
10605 {
10606 word0 = value;
10607 }
10608 CONSTEXPR operator uint32_t()
10609 {
10610 return word0;
10611 }
10612 operator uint32_t() volatile
10613 {
10614 return word0;
10615 }
10616 ifm2_broadcast_r copy() volatile
10617 {
10618 return *this;
10619 }
10620 CONSTEXPR uint32_t get_value() const
10621 {
10622 uint32_t value = static_cast<uint32_t>(word0);
10623 return value;
10624 }
10625 uint32_t get_value() const volatile
10626 {
10627 uint32_t value = static_cast<uint32_t>(word0);
10628 return value;
10629 }
10630 CONSTEXPR ifm2_broadcast_r &set_value(uint32_t value)
10631 {
10632 word0 = static_cast<uint32_t>(value);
10633 return *this;
10634 }
10635#endif
10636};
10637
10638// ifm2_scalar_r - None
10639struct ifm2_scalar_r
10640{
10641#ifndef __cplusplus
10642 union
10643 {
10644 struct
10645 {
10646 uint32_t value : 32; // 32-bit register value
10647 };
10648 uint32_t word;
10649 };
10650#else
10651 private:
10652 uint32_t word0;
10653
10654 public:
10655 CONSTEXPR ifm2_scalar_r() : word0(0) {}
10656 CONSTEXPR ifm2_scalar_r(uint32_t init) : word0(init) {}
10657 CONSTEXPR void operator=(uint32_t value)
10658 {
10659 word0 = value;
10660 }
10661 void operator=(uint32_t value) volatile
10662 {
10663 word0 = value;
10664 }
10665 CONSTEXPR operator uint32_t()
10666 {
10667 return word0;
10668 }
10669 operator uint32_t() volatile
10670 {
10671 return word0;
10672 }
10673 ifm2_scalar_r copy() volatile
10674 {
10675 return *this;
10676 }
10677 CONSTEXPR uint32_t get_value() const
10678 {
10679 uint32_t value = static_cast<uint32_t>(word0);
10680 return value;
10681 }
10682 uint32_t get_value() const volatile
10683 {
10684 uint32_t value = static_cast<uint32_t>(word0);
10685 return value;
10686 }
10687 CONSTEXPR ifm2_scalar_r &set_value(uint32_t value)
10688 {
10689 word0 = static_cast<uint32_t>(value);
10690 return *this;
10691 }
10692#endif
10693};
10694
10695// ifm2_precision_r - None
10696struct ifm2_precision_r
10697{
10698#ifndef __cplusplus
10699 union
10700 {
10701 struct
10702 {
10703 uint32_t value : 32; // 32-bit register value
10704 };
10705 uint32_t word;
10706 };
10707#else
10708 private:
10709 uint32_t word0;
10710
10711 public:
10712 CONSTEXPR ifm2_precision_r() : word0(0) {}
10713 CONSTEXPR ifm2_precision_r(uint32_t init) : word0(init) {}
10714 CONSTEXPR void operator=(uint32_t value)
10715 {
10716 word0 = value;
10717 }
10718 void operator=(uint32_t value) volatile
10719 {
10720 word0 = value;
10721 }
10722 CONSTEXPR operator uint32_t()
10723 {
10724 return word0;
10725 }
10726 operator uint32_t() volatile
10727 {
10728 return word0;
10729 }
10730 ifm2_precision_r copy() volatile
10731 {
10732 return *this;
10733 }
10734 CONSTEXPR uint32_t get_value() const
10735 {
10736 uint32_t value = static_cast<uint32_t>(word0);
10737 return value;
10738 }
10739 uint32_t get_value() const volatile
10740 {
10741 uint32_t value = static_cast<uint32_t>(word0);
10742 return value;
10743 }
10744 CONSTEXPR ifm2_precision_r &set_value(uint32_t value)
10745 {
10746 word0 = static_cast<uint32_t>(value);
10747 return *this;
10748 }
10749#endif
10750};
10751
10752// ifm2_zero_point_r - None
10753struct ifm2_zero_point_r
10754{
10755#ifndef __cplusplus
10756 union
10757 {
10758 struct
10759 {
10760 uint32_t value : 32; // 32-bit register value
10761 };
10762 uint32_t word;
10763 };
10764#else
10765 private:
10766 uint32_t word0;
10767
10768 public:
10769 CONSTEXPR ifm2_zero_point_r() : word0(0) {}
10770 CONSTEXPR ifm2_zero_point_r(uint32_t init) : word0(init) {}
10771 CONSTEXPR void operator=(uint32_t value)
10772 {
10773 word0 = value;
10774 }
10775 void operator=(uint32_t value) volatile
10776 {
10777 word0 = value;
10778 }
10779 CONSTEXPR operator uint32_t()
10780 {
10781 return word0;
10782 }
10783 operator uint32_t() volatile
10784 {
10785 return word0;
10786 }
10787 ifm2_zero_point_r copy() volatile
10788 {
10789 return *this;
10790 }
10791 CONSTEXPR uint32_t get_value() const
10792 {
10793 uint32_t value = static_cast<uint32_t>(word0);
10794 return value;
10795 }
10796 uint32_t get_value() const volatile
10797 {
10798 uint32_t value = static_cast<uint32_t>(word0);
10799 return value;
10800 }
10801 CONSTEXPR ifm2_zero_point_r &set_value(uint32_t value)
10802 {
10803 word0 = static_cast<uint32_t>(value);
10804 return *this;
10805 }
10806#endif
10807};
10808
10809// ifm2_width0_m1_r - None
10810struct ifm2_width0_m1_r
10811{
10812#ifndef __cplusplus
10813 union
10814 {
10815 struct
10816 {
10817 uint32_t value : 32; // 32-bit register value
10818 };
10819 uint32_t word;
10820 };
10821#else
10822 private:
10823 uint32_t word0;
10824
10825 public:
10826 CONSTEXPR ifm2_width0_m1_r() : word0(0) {}
10827 CONSTEXPR ifm2_width0_m1_r(uint32_t init) : word0(init) {}
10828 CONSTEXPR void operator=(uint32_t value)
10829 {
10830 word0 = value;
10831 }
10832 void operator=(uint32_t value) volatile
10833 {
10834 word0 = value;
10835 }
10836 CONSTEXPR operator uint32_t()
10837 {
10838 return word0;
10839 }
10840 operator uint32_t() volatile
10841 {
10842 return word0;
10843 }
10844 ifm2_width0_m1_r copy() volatile
10845 {
10846 return *this;
10847 }
10848 CONSTEXPR uint32_t get_value() const
10849 {
10850 uint32_t value = static_cast<uint32_t>(word0);
10851 return value;
10852 }
10853 uint32_t get_value() const volatile
10854 {
10855 uint32_t value = static_cast<uint32_t>(word0);
10856 return value;
10857 }
10858 CONSTEXPR ifm2_width0_m1_r &set_value(uint32_t value)
10859 {
10860 word0 = static_cast<uint32_t>(value);
10861 return *this;
10862 }
10863#endif
10864};
10865
10866// ifm2_height0_m1_r - None
10867struct ifm2_height0_m1_r
10868{
10869#ifndef __cplusplus
10870 union
10871 {
10872 struct
10873 {
10874 uint32_t value : 32; // 32-bit register value
10875 };
10876 uint32_t word;
10877 };
10878#else
10879 private:
10880 uint32_t word0;
10881
10882 public:
10883 CONSTEXPR ifm2_height0_m1_r() : word0(0) {}
10884 CONSTEXPR ifm2_height0_m1_r(uint32_t init) : word0(init) {}
10885 CONSTEXPR void operator=(uint32_t value)
10886 {
10887 word0 = value;
10888 }
10889 void operator=(uint32_t value) volatile
10890 {
10891 word0 = value;
10892 }
10893 CONSTEXPR operator uint32_t()
10894 {
10895 return word0;
10896 }
10897 operator uint32_t() volatile
10898 {
10899 return word0;
10900 }
10901 ifm2_height0_m1_r copy() volatile
10902 {
10903 return *this;
10904 }
10905 CONSTEXPR uint32_t get_value() const
10906 {
10907 uint32_t value = static_cast<uint32_t>(word0);
10908 return value;
10909 }
10910 uint32_t get_value() const volatile
10911 {
10912 uint32_t value = static_cast<uint32_t>(word0);
10913 return value;
10914 }
10915 CONSTEXPR ifm2_height0_m1_r &set_value(uint32_t value)
10916 {
10917 word0 = static_cast<uint32_t>(value);
10918 return *this;
10919 }
10920#endif
10921};
10922
10923// ifm2_height1_m1_r - None
10924struct ifm2_height1_m1_r
10925{
10926#ifndef __cplusplus
10927 union
10928 {
10929 struct
10930 {
10931 uint32_t value : 32; // 32-bit register value
10932 };
10933 uint32_t word;
10934 };
10935#else
10936 private:
10937 uint32_t word0;
10938
10939 public:
10940 CONSTEXPR ifm2_height1_m1_r() : word0(0) {}
10941 CONSTEXPR ifm2_height1_m1_r(uint32_t init) : word0(init) {}
10942 CONSTEXPR void operator=(uint32_t value)
10943 {
10944 word0 = value;
10945 }
10946 void operator=(uint32_t value) volatile
10947 {
10948 word0 = value;
10949 }
10950 CONSTEXPR operator uint32_t()
10951 {
10952 return word0;
10953 }
10954 operator uint32_t() volatile
10955 {
10956 return word0;
10957 }
10958 ifm2_height1_m1_r copy() volatile
10959 {
10960 return *this;
10961 }
10962 CONSTEXPR uint32_t get_value() const
10963 {
10964 uint32_t value = static_cast<uint32_t>(word0);
10965 return value;
10966 }
10967 uint32_t get_value() const volatile
10968 {
10969 uint32_t value = static_cast<uint32_t>(word0);
10970 return value;
10971 }
10972 CONSTEXPR ifm2_height1_m1_r &set_value(uint32_t value)
10973 {
10974 word0 = static_cast<uint32_t>(value);
10975 return *this;
10976 }
10977#endif
10978};
10979
10980// ifm2_ib_start_r - None
10981struct ifm2_ib_start_r
10982{
10983#ifndef __cplusplus
10984 union
10985 {
10986 struct
10987 {
10988 uint32_t value : 32; // 32-bit register value
10989 };
10990 uint32_t word;
10991 };
10992#else
10993 private:
10994 uint32_t word0;
10995
10996 public:
10997 CONSTEXPR ifm2_ib_start_r() : word0(0) {}
10998 CONSTEXPR ifm2_ib_start_r(uint32_t init) : word0(init) {}
10999 CONSTEXPR void operator=(uint32_t value)
11000 {
11001 word0 = value;
11002 }
11003 void operator=(uint32_t value) volatile
11004 {
11005 word0 = value;
11006 }
11007 CONSTEXPR operator uint32_t()
11008 {
11009 return word0;
11010 }
11011 operator uint32_t() volatile
11012 {
11013 return word0;
11014 }
11015 ifm2_ib_start_r copy() volatile
11016 {
11017 return *this;
11018 }
11019 CONSTEXPR uint32_t get_value() const
11020 {
11021 uint32_t value = static_cast<uint32_t>(word0);
11022 return value;
11023 }
11024 uint32_t get_value() const volatile
11025 {
11026 uint32_t value = static_cast<uint32_t>(word0);
11027 return value;
11028 }
11029 CONSTEXPR ifm2_ib_start_r &set_value(uint32_t value)
11030 {
11031 word0 = static_cast<uint32_t>(value);
11032 return *this;
11033 }
11034#endif
11035};
11036
11037// ifm2_region_r - None
11038struct ifm2_region_r
11039{
11040#ifndef __cplusplus
11041 union
11042 {
11043 struct
11044 {
11045 uint32_t value : 32; // 32-bit register value
11046 };
11047 uint32_t word;
11048 };
11049#else
11050 private:
11051 uint32_t word0;
11052
11053 public:
11054 CONSTEXPR ifm2_region_r() : word0(0) {}
11055 CONSTEXPR ifm2_region_r(uint32_t init) : word0(init) {}
11056 CONSTEXPR void operator=(uint32_t value)
11057 {
11058 word0 = value;
11059 }
11060 void operator=(uint32_t value) volatile
11061 {
11062 word0 = value;
11063 }
11064 CONSTEXPR operator uint32_t()
11065 {
11066 return word0;
11067 }
11068 operator uint32_t() volatile
11069 {
11070 return word0;
11071 }
11072 ifm2_region_r copy() volatile
11073 {
11074 return *this;
11075 }
11076 CONSTEXPR uint32_t get_value() const
11077 {
11078 uint32_t value = static_cast<uint32_t>(word0);
11079 return value;
11080 }
11081 uint32_t get_value() const volatile
11082 {
11083 uint32_t value = static_cast<uint32_t>(word0);
11084 return value;
11085 }
11086 CONSTEXPR ifm2_region_r &set_value(uint32_t value)
11087 {
11088 word0 = static_cast<uint32_t>(value);
11089 return *this;
11090 }
11091#endif
11092};
11093
11094// ifm_base0_r - None
11095struct ifm_base0_r
11096{
11097#ifndef __cplusplus
11098 union
11099 {
11100 struct
11101 {
11102 uint32_t value_LO : 32; // 64-bit register value - LSB
11103 uint32_t value_HI : 32; // 64-bit register value - MSB
11104 };
11105 uint32_t word[2];
11106 };
11107#else
11108 private:
11109 uint32_t word0;
11110 uint32_t word1;
11111
11112 public:
11113 CONSTEXPR ifm_base0_r() : word0(0), word1(0) {}
11114 CONSTEXPR ifm_base0_r(uint64_t init) :
11115 word0(static_cast<uint32_t>((init) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()))),
11116 word1(static_cast<uint32_t>((init >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max())))
11117 {
11118 }
11119 CONSTEXPR void operator=(uint64_t value)
11120 {
11121 word0 = static_cast<uint32_t>((value) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
11122 word1 = static_cast<uint32_t>((value >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
11123 }
11124 void operator=(uint64_t value) volatile
11125 {
11126 word0 = static_cast<uint32_t>((value) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
11127 word1 = static_cast<uint32_t>((value >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
11128 }
11129 CONSTEXPR operator uint64_t()
11130 {
11131 return (static_cast<uint64_t>(word1) << 32) | word0;
11132 }
11133 operator uint64_t() volatile
11134 {
11135 return (static_cast<uint64_t>(word1) << 32) | word0;
11136 }
11137 ifm_base0_r copy() volatile
11138 {
11139 return *this;
11140 }
11141#endif
11142};
11143
11144// ifm_base1_r - None
11145struct ifm_base1_r
11146{
11147#ifndef __cplusplus
11148 union
11149 {
11150 struct
11151 {
11152 uint32_t value_LO : 32; // 64-bit register value - LSB
11153 uint32_t value_HI : 32; // 64-bit register value - MSB
11154 };
11155 uint32_t word[2];
11156 };
11157#else
11158 private:
11159 uint32_t word0;
11160 uint32_t word1;
11161
11162 public:
11163 CONSTEXPR ifm_base1_r() : word0(0), word1(0) {}
11164 CONSTEXPR ifm_base1_r(uint64_t init) :
11165 word0(static_cast<uint32_t>((init) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()))),
11166 word1(static_cast<uint32_t>((init >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max())))
11167 {
11168 }
11169 CONSTEXPR void operator=(uint64_t value)
11170 {
11171 word0 = static_cast<uint32_t>((value) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
11172 word1 = static_cast<uint32_t>((value >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
11173 }
11174 void operator=(uint64_t value) volatile
11175 {
11176 word0 = static_cast<uint32_t>((value) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
11177 word1 = static_cast<uint32_t>((value >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
11178 }
11179 CONSTEXPR operator uint64_t()
11180 {
11181 return (static_cast<uint64_t>(word1) << 32) | word0;
11182 }
11183 operator uint64_t() volatile
11184 {
11185 return (static_cast<uint64_t>(word1) << 32) | word0;
11186 }
11187 ifm_base1_r copy() volatile
11188 {
11189 return *this;
11190 }
11191#endif
11192};
11193
11194// ifm_base2_r - None
11195struct ifm_base2_r
11196{
11197#ifndef __cplusplus
11198 union
11199 {
11200 struct
11201 {
11202 uint32_t value_LO : 32; // 64-bit register value - LSB
11203 uint32_t value_HI : 32; // 64-bit register value - MSB
11204 };
11205 uint32_t word[2];
11206 };
11207#else
11208 private:
11209 uint32_t word0;
11210 uint32_t word1;
11211
11212 public:
11213 CONSTEXPR ifm_base2_r() : word0(0), word1(0) {}
11214 CONSTEXPR ifm_base2_r(uint64_t init) :
11215 word0(static_cast<uint32_t>((init) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()))),
11216 word1(static_cast<uint32_t>((init >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max())))
11217 {
11218 }
11219 CONSTEXPR void operator=(uint64_t value)
11220 {
11221 word0 = static_cast<uint32_t>((value) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
11222 word1 = static_cast<uint32_t>((value >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
11223 }
11224 void operator=(uint64_t value) volatile
11225 {
11226 word0 = static_cast<uint32_t>((value) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
11227 word1 = static_cast<uint32_t>((value >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
11228 }
11229 CONSTEXPR operator uint64_t()
11230 {
11231 return (static_cast<uint64_t>(word1) << 32) | word0;
11232 }
11233 operator uint64_t() volatile
11234 {
11235 return (static_cast<uint64_t>(word1) << 32) | word0;
11236 }
11237 ifm_base2_r copy() volatile
11238 {
11239 return *this;
11240 }
11241#endif
11242};
11243
11244// ifm_base3_r - None
11245struct ifm_base3_r
11246{
11247#ifndef __cplusplus
11248 union
11249 {
11250 struct
11251 {
11252 uint32_t value_LO : 32; // 64-bit register value - LSB
11253 uint32_t value_HI : 32; // 64-bit register value - MSB
11254 };
11255 uint32_t word[2];
11256 };
11257#else
11258 private:
11259 uint32_t word0;
11260 uint32_t word1;
11261
11262 public:
11263 CONSTEXPR ifm_base3_r() : word0(0), word1(0) {}
11264 CONSTEXPR ifm_base3_r(uint64_t init) :
11265 word0(static_cast<uint32_t>((init) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()))),
11266 word1(static_cast<uint32_t>((init >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max())))
11267 {
11268 }
11269 CONSTEXPR void operator=(uint64_t value)
11270 {
11271 word0 = static_cast<uint32_t>((value) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
11272 word1 = static_cast<uint32_t>((value >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
11273 }
11274 void operator=(uint64_t value) volatile
11275 {
11276 word0 = static_cast<uint32_t>((value) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
11277 word1 = static_cast<uint32_t>((value >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
11278 }
11279 CONSTEXPR operator uint64_t()
11280 {
11281 return (static_cast<uint64_t>(word1) << 32) | word0;
11282 }
11283 operator uint64_t() volatile
11284 {
11285 return (static_cast<uint64_t>(word1) << 32) | word0;
11286 }
11287 ifm_base3_r copy() volatile
11288 {
11289 return *this;
11290 }
11291#endif
11292};
11293
11294// ifm_stride_x_r - None
11295struct ifm_stride_x_r
11296{
11297#ifndef __cplusplus
11298 union
11299 {
11300 struct
11301 {
11302 uint32_t value_LO : 32; // 64-bit register value - LSB
11303 uint32_t value_HI : 32; // 64-bit register value - MSB
11304 };
11305 uint32_t word[2];
11306 };
11307#else
11308 private:
11309 uint32_t word0;
11310 uint32_t word1;
11311
11312 public:
11313 CONSTEXPR ifm_stride_x_r() : word0(0), word1(0) {}
11314 CONSTEXPR ifm_stride_x_r(uint64_t init) :
11315 word0(static_cast<uint32_t>((init) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()))),
11316 word1(static_cast<uint32_t>((init >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max())))
11317 {
11318 }
11319 CONSTEXPR void operator=(uint64_t value)
11320 {
11321 word0 = static_cast<uint32_t>((value) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
11322 word1 = static_cast<uint32_t>((value >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
11323 }
11324 void operator=(uint64_t value) volatile
11325 {
11326 word0 = static_cast<uint32_t>((value) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
11327 word1 = static_cast<uint32_t>((value >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
11328 }
11329 CONSTEXPR operator uint64_t()
11330 {
11331 return (static_cast<uint64_t>(word1) << 32) | word0;
11332 }
11333 operator uint64_t() volatile
11334 {
11335 return (static_cast<uint64_t>(word1) << 32) | word0;
11336 }
11337 ifm_stride_x_r copy() volatile
11338 {
11339 return *this;
11340 }
11341#endif
11342};
11343
11344// ifm_stride_y_r - None
11345struct ifm_stride_y_r
11346{
11347#ifndef __cplusplus
11348 union
11349 {
11350 struct
11351 {
11352 uint32_t value_LO : 32; // 64-bit register value - LSB
11353 uint32_t value_HI : 32; // 64-bit register value - MSB
11354 };
11355 uint32_t word[2];
11356 };
11357#else
11358 private:
11359 uint32_t word0;
11360 uint32_t word1;
11361
11362 public:
11363 CONSTEXPR ifm_stride_y_r() : word0(0), word1(0) {}
11364 CONSTEXPR ifm_stride_y_r(uint64_t init) :
11365 word0(static_cast<uint32_t>((init) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()))),
11366 word1(static_cast<uint32_t>((init >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max())))
11367 {
11368 }
11369 CONSTEXPR void operator=(uint64_t value)
11370 {
11371 word0 = static_cast<uint32_t>((value) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
11372 word1 = static_cast<uint32_t>((value >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
11373 }
11374 void operator=(uint64_t value) volatile
11375 {
11376 word0 = static_cast<uint32_t>((value) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
11377 word1 = static_cast<uint32_t>((value >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
11378 }
11379 CONSTEXPR operator uint64_t()
11380 {
11381 return (static_cast<uint64_t>(word1) << 32) | word0;
11382 }
11383 operator uint64_t() volatile
11384 {
11385 return (static_cast<uint64_t>(word1) << 32) | word0;
11386 }
11387 ifm_stride_y_r copy() volatile
11388 {
11389 return *this;
11390 }
11391#endif
11392};
11393
11394// ifm_stride_c_r - None
11395struct ifm_stride_c_r
11396{
11397#ifndef __cplusplus
11398 union
11399 {
11400 struct
11401 {
11402 uint32_t value_LO : 32; // 64-bit register value - LSB
11403 uint32_t value_HI : 32; // 64-bit register value - MSB
11404 };
11405 uint32_t word[2];
11406 };
11407#else
11408 private:
11409 uint32_t word0;
11410 uint32_t word1;
11411
11412 public:
11413 CONSTEXPR ifm_stride_c_r() : word0(0), word1(0) {}
11414 CONSTEXPR ifm_stride_c_r(uint64_t init) :
11415 word0(static_cast<uint32_t>((init) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()))),
11416 word1(static_cast<uint32_t>((init >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max())))
11417 {
11418 }
11419 CONSTEXPR void operator=(uint64_t value)
11420 {
11421 word0 = static_cast<uint32_t>((value) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
11422 word1 = static_cast<uint32_t>((value >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
11423 }
11424 void operator=(uint64_t value) volatile
11425 {
11426 word0 = static_cast<uint32_t>((value) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
11427 word1 = static_cast<uint32_t>((value >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
11428 }
11429 CONSTEXPR operator uint64_t()
11430 {
11431 return (static_cast<uint64_t>(word1) << 32) | word0;
11432 }
11433 operator uint64_t() volatile
11434 {
11435 return (static_cast<uint64_t>(word1) << 32) | word0;
11436 }
11437 ifm_stride_c_r copy() volatile
11438 {
11439 return *this;
11440 }
11441#endif
11442};
11443
11444// ofm_base0_r - None
11445struct ofm_base0_r
11446{
11447#ifndef __cplusplus
11448 union
11449 {
11450 struct
11451 {
11452 uint32_t value_LO : 32; // 64-bit register value - LSB
11453 uint32_t value_HI : 32; // 64-bit register value - MSB
11454 };
11455 uint32_t word[2];
11456 };
11457#else
11458 private:
11459 uint32_t word0;
11460 uint32_t word1;
11461
11462 public:
11463 CONSTEXPR ofm_base0_r() : word0(0), word1(0) {}
11464 CONSTEXPR ofm_base0_r(uint64_t init) :
11465 word0(static_cast<uint32_t>((init) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()))),
11466 word1(static_cast<uint32_t>((init >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max())))
11467 {
11468 }
11469 CONSTEXPR void operator=(uint64_t value)
11470 {
11471 word0 = static_cast<uint32_t>((value) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
11472 word1 = static_cast<uint32_t>((value >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
11473 }
11474 void operator=(uint64_t value) volatile
11475 {
11476 word0 = static_cast<uint32_t>((value) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
11477 word1 = static_cast<uint32_t>((value >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
11478 }
11479 CONSTEXPR operator uint64_t()
11480 {
11481 return (static_cast<uint64_t>(word1) << 32) | word0;
11482 }
11483 operator uint64_t() volatile
11484 {
11485 return (static_cast<uint64_t>(word1) << 32) | word0;
11486 }
11487 ofm_base0_r copy() volatile
11488 {
11489 return *this;
11490 }
11491#endif
11492};
11493
11494// ofm_base1_r - None
11495struct ofm_base1_r
11496{
11497#ifndef __cplusplus
11498 union
11499 {
11500 struct
11501 {
11502 uint32_t value_LO : 32; // 64-bit register value - LSB
11503 uint32_t value_HI : 32; // 64-bit register value - MSB
11504 };
11505 uint32_t word[2];
11506 };
11507#else
11508 private:
11509 uint32_t word0;
11510 uint32_t word1;
11511
11512 public:
11513 CONSTEXPR ofm_base1_r() : word0(0), word1(0) {}
11514 CONSTEXPR ofm_base1_r(uint64_t init) :
11515 word0(static_cast<uint32_t>((init) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()))),
11516 word1(static_cast<uint32_t>((init >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max())))
11517 {
11518 }
11519 CONSTEXPR void operator=(uint64_t value)
11520 {
11521 word0 = static_cast<uint32_t>((value) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
11522 word1 = static_cast<uint32_t>((value >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
11523 }
11524 void operator=(uint64_t value) volatile
11525 {
11526 word0 = static_cast<uint32_t>((value) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
11527 word1 = static_cast<uint32_t>((value >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
11528 }
11529 CONSTEXPR operator uint64_t()
11530 {
11531 return (static_cast<uint64_t>(word1) << 32) | word0;
11532 }
11533 operator uint64_t() volatile
11534 {
11535 return (static_cast<uint64_t>(word1) << 32) | word0;
11536 }
11537 ofm_base1_r copy() volatile
11538 {
11539 return *this;
11540 }
11541#endif
11542};
11543
11544// ofm_base2_r - None
11545struct ofm_base2_r
11546{
11547#ifndef __cplusplus
11548 union
11549 {
11550 struct
11551 {
11552 uint32_t value_LO : 32; // 64-bit register value - LSB
11553 uint32_t value_HI : 32; // 64-bit register value - MSB
11554 };
11555 uint32_t word[2];
11556 };
11557#else
11558 private:
11559 uint32_t word0;
11560 uint32_t word1;
11561
11562 public:
11563 CONSTEXPR ofm_base2_r() : word0(0), word1(0) {}
11564 CONSTEXPR ofm_base2_r(uint64_t init) :
11565 word0(static_cast<uint32_t>((init) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()))),
11566 word1(static_cast<uint32_t>((init >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max())))
11567 {
11568 }
11569 CONSTEXPR void operator=(uint64_t value)
11570 {
11571 word0 = static_cast<uint32_t>((value) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
11572 word1 = static_cast<uint32_t>((value >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
11573 }
11574 void operator=(uint64_t value) volatile
11575 {
11576 word0 = static_cast<uint32_t>((value) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
11577 word1 = static_cast<uint32_t>((value >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
11578 }
11579 CONSTEXPR operator uint64_t()
11580 {
11581 return (static_cast<uint64_t>(word1) << 32) | word0;
11582 }
11583 operator uint64_t() volatile
11584 {
11585 return (static_cast<uint64_t>(word1) << 32) | word0;
11586 }
11587 ofm_base2_r copy() volatile
11588 {
11589 return *this;
11590 }
11591#endif
11592};
11593
11594// ofm_base3_r - None
11595struct ofm_base3_r
11596{
11597#ifndef __cplusplus
11598 union
11599 {
11600 struct
11601 {
11602 uint32_t value_LO : 32; // 64-bit register value - LSB
11603 uint32_t value_HI : 32; // 64-bit register value - MSB
11604 };
11605 uint32_t word[2];
11606 };
11607#else
11608 private:
11609 uint32_t word0;
11610 uint32_t word1;
11611
11612 public:
11613 CONSTEXPR ofm_base3_r() : word0(0), word1(0) {}
11614 CONSTEXPR ofm_base3_r(uint64_t init) :
11615 word0(static_cast<uint32_t>((init) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()))),
11616 word1(static_cast<uint32_t>((init >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max())))
11617 {
11618 }
11619 CONSTEXPR void operator=(uint64_t value)
11620 {
11621 word0 = static_cast<uint32_t>((value) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
11622 word1 = static_cast<uint32_t>((value >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
11623 }
11624 void operator=(uint64_t value) volatile
11625 {
11626 word0 = static_cast<uint32_t>((value) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
11627 word1 = static_cast<uint32_t>((value >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
11628 }
11629 CONSTEXPR operator uint64_t()
11630 {
11631 return (static_cast<uint64_t>(word1) << 32) | word0;
11632 }
11633 operator uint64_t() volatile
11634 {
11635 return (static_cast<uint64_t>(word1) << 32) | word0;
11636 }
11637 ofm_base3_r copy() volatile
11638 {
11639 return *this;
11640 }
11641#endif
11642};
11643
11644// ofm_stride_x_r - None
11645struct ofm_stride_x_r
11646{
11647#ifndef __cplusplus
11648 union
11649 {
11650 struct
11651 {
11652 uint32_t value_LO : 32; // 64-bit register value - LSB
11653 uint32_t value_HI : 32; // 64-bit register value - MSB
11654 };
11655 uint32_t word[2];
11656 };
11657#else
11658 private:
11659 uint32_t word0;
11660 uint32_t word1;
11661
11662 public:
11663 CONSTEXPR ofm_stride_x_r() : word0(0), word1(0) {}
11664 CONSTEXPR ofm_stride_x_r(uint64_t init) :
11665 word0(static_cast<uint32_t>((init) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()))),
11666 word1(static_cast<uint32_t>((init >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max())))
11667 {
11668 }
11669 CONSTEXPR void operator=(uint64_t value)
11670 {
11671 word0 = static_cast<uint32_t>((value) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
11672 word1 = static_cast<uint32_t>((value >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
11673 }
11674 void operator=(uint64_t value) volatile
11675 {
11676 word0 = static_cast<uint32_t>((value) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
11677 word1 = static_cast<uint32_t>((value >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
11678 }
11679 CONSTEXPR operator uint64_t()
11680 {
11681 return (static_cast<uint64_t>(word1) << 32) | word0;
11682 }
11683 operator uint64_t() volatile
11684 {
11685 return (static_cast<uint64_t>(word1) << 32) | word0;
11686 }
11687 ofm_stride_x_r copy() volatile
11688 {
11689 return *this;
11690 }
11691#endif
11692};
11693
11694// ofm_stride_y_r - None
11695struct ofm_stride_y_r
11696{
11697#ifndef __cplusplus
11698 union
11699 {
11700 struct
11701 {
11702 uint32_t value_LO : 32; // 64-bit register value - LSB
11703 uint32_t value_HI : 32; // 64-bit register value - MSB
11704 };
11705 uint32_t word[2];
11706 };
11707#else
11708 private:
11709 uint32_t word0;
11710 uint32_t word1;
11711
11712 public:
11713 CONSTEXPR ofm_stride_y_r() : word0(0), word1(0) {}
11714 CONSTEXPR ofm_stride_y_r(uint64_t init) :
11715 word0(static_cast<uint32_t>((init) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()))),
11716 word1(static_cast<uint32_t>((init >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max())))
11717 {
11718 }
11719 CONSTEXPR void operator=(uint64_t value)
11720 {
11721 word0 = static_cast<uint32_t>((value) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
11722 word1 = static_cast<uint32_t>((value >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
11723 }
11724 void operator=(uint64_t value) volatile
11725 {
11726 word0 = static_cast<uint32_t>((value) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
11727 word1 = static_cast<uint32_t>((value >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
11728 }
11729 CONSTEXPR operator uint64_t()
11730 {
11731 return (static_cast<uint64_t>(word1) << 32) | word0;
11732 }
11733 operator uint64_t() volatile
11734 {
11735 return (static_cast<uint64_t>(word1) << 32) | word0;
11736 }
11737 ofm_stride_y_r copy() volatile
11738 {
11739 return *this;
11740 }
11741#endif
11742};
11743
11744// ofm_stride_c_r - None
11745struct ofm_stride_c_r
11746{
11747#ifndef __cplusplus
11748 union
11749 {
11750 struct
11751 {
11752 uint32_t value_LO : 32; // 64-bit register value - LSB
11753 uint32_t value_HI : 32; // 64-bit register value - MSB
11754 };
11755 uint32_t word[2];
11756 };
11757#else
11758 private:
11759 uint32_t word0;
11760 uint32_t word1;
11761
11762 public:
11763 CONSTEXPR ofm_stride_c_r() : word0(0), word1(0) {}
11764 CONSTEXPR ofm_stride_c_r(uint64_t init) :
11765 word0(static_cast<uint32_t>((init) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()))),
11766 word1(static_cast<uint32_t>((init >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max())))
11767 {
11768 }
11769 CONSTEXPR void operator=(uint64_t value)
11770 {
11771 word0 = static_cast<uint32_t>((value) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
11772 word1 = static_cast<uint32_t>((value >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
11773 }
11774 void operator=(uint64_t value) volatile
11775 {
11776 word0 = static_cast<uint32_t>((value) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
11777 word1 = static_cast<uint32_t>((value >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
11778 }
11779 CONSTEXPR operator uint64_t()
11780 {
11781 return (static_cast<uint64_t>(word1) << 32) | word0;
11782 }
11783 operator uint64_t() volatile
11784 {
11785 return (static_cast<uint64_t>(word1) << 32) | word0;
11786 }
11787 ofm_stride_c_r copy() volatile
11788 {
11789 return *this;
11790 }
11791#endif
11792};
11793
11794// weight_base_r - None
11795struct weight_base_r
11796{
11797#ifndef __cplusplus
11798 union
11799 {
11800 struct
11801 {
11802 uint32_t value_LO : 32; // 64-bit register value - LSB
11803 uint32_t value_HI : 32; // 64-bit register value - MSB
11804 };
11805 uint32_t word[2];
11806 };
11807#else
11808 private:
11809 uint32_t word0;
11810 uint32_t word1;
11811
11812 public:
11813 CONSTEXPR weight_base_r() : word0(0), word1(0) {}
11814 CONSTEXPR weight_base_r(uint64_t init) :
11815 word0(static_cast<uint32_t>((init) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()))),
11816 word1(static_cast<uint32_t>((init >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max())))
11817 {
11818 }
11819 CONSTEXPR void operator=(uint64_t value)
11820 {
11821 word0 = static_cast<uint32_t>((value) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
11822 word1 = static_cast<uint32_t>((value >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
11823 }
11824 void operator=(uint64_t value) volatile
11825 {
11826 word0 = static_cast<uint32_t>((value) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
11827 word1 = static_cast<uint32_t>((value >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
11828 }
11829 CONSTEXPR operator uint64_t()
11830 {
11831 return (static_cast<uint64_t>(word1) << 32) | word0;
11832 }
11833 operator uint64_t() volatile
11834 {
11835 return (static_cast<uint64_t>(word1) << 32) | word0;
11836 }
11837 weight_base_r copy() volatile
11838 {
11839 return *this;
11840 }
11841#endif
11842};
11843
11844// weight_length_r - None
11845struct weight_length_r
11846{
11847#ifndef __cplusplus
11848 union
11849 {
11850 struct
11851 {
11852 uint32_t value : 32; // 32-bit register value
11853 };
11854 uint32_t word;
11855 };
11856#else
11857 private:
11858 uint32_t word0;
11859
11860 public:
11861 CONSTEXPR weight_length_r() : word0(0) {}
11862 CONSTEXPR weight_length_r(uint32_t init) : word0(init) {}
11863 CONSTEXPR void operator=(uint32_t value)
11864 {
11865 word0 = value;
11866 }
11867 void operator=(uint32_t value) volatile
11868 {
11869 word0 = value;
11870 }
11871 CONSTEXPR operator uint32_t()
11872 {
11873 return word0;
11874 }
11875 operator uint32_t() volatile
11876 {
11877 return word0;
11878 }
11879 weight_length_r copy() volatile
11880 {
11881 return *this;
11882 }
11883 CONSTEXPR uint32_t get_value() const
11884 {
11885 uint32_t value = static_cast<uint32_t>(word0);
11886 return value;
11887 }
11888 uint32_t get_value() const volatile
11889 {
11890 uint32_t value = static_cast<uint32_t>(word0);
11891 return value;
11892 }
11893 CONSTEXPR weight_length_r &set_value(uint32_t value)
11894 {
11895 word0 = static_cast<uint32_t>(value);
11896 return *this;
11897 }
11898#endif
11899};
11900
11901// scale_base_r - None
11902struct scale_base_r
11903{
11904#ifndef __cplusplus
11905 union
11906 {
11907 struct
11908 {
11909 uint32_t value_LO : 32; // 64-bit register value - LSB
11910 uint32_t value_HI : 32; // 64-bit register value - MSB
11911 };
11912 uint32_t word[2];
11913 };
11914#else
11915 private:
11916 uint32_t word0;
11917 uint32_t word1;
11918
11919 public:
11920 CONSTEXPR scale_base_r() : word0(0), word1(0) {}
11921 CONSTEXPR scale_base_r(uint64_t init) :
11922 word0(static_cast<uint32_t>((init) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()))),
11923 word1(static_cast<uint32_t>((init >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max())))
11924 {
11925 }
11926 CONSTEXPR void operator=(uint64_t value)
11927 {
11928 word0 = static_cast<uint32_t>((value) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
11929 word1 = static_cast<uint32_t>((value >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
11930 }
11931 void operator=(uint64_t value) volatile
11932 {
11933 word0 = static_cast<uint32_t>((value) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
11934 word1 = static_cast<uint32_t>((value >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
11935 }
11936 CONSTEXPR operator uint64_t()
11937 {
11938 return (static_cast<uint64_t>(word1) << 32) | word0;
11939 }
11940 operator uint64_t() volatile
11941 {
11942 return (static_cast<uint64_t>(word1) << 32) | word0;
11943 }
11944 scale_base_r copy() volatile
11945 {
11946 return *this;
11947 }
11948#endif
11949};
11950
11951// scale_length_r - None
11952struct scale_length_r
11953{
11954#ifndef __cplusplus
11955 union
11956 {
11957 struct
11958 {
11959 uint32_t value : 32; // 32-bit register value
11960 };
11961 uint32_t word;
11962 };
11963#else
11964 private:
11965 uint32_t word0;
11966
11967 public:
11968 CONSTEXPR scale_length_r() : word0(0) {}
11969 CONSTEXPR scale_length_r(uint32_t init) : word0(init) {}
11970 CONSTEXPR void operator=(uint32_t value)
11971 {
11972 word0 = value;
11973 }
11974 void operator=(uint32_t value) volatile
11975 {
11976 word0 = value;
11977 }
11978 CONSTEXPR operator uint32_t()
11979 {
11980 return word0;
11981 }
11982 operator uint32_t() volatile
11983 {
11984 return word0;
11985 }
11986 scale_length_r copy() volatile
11987 {
11988 return *this;
11989 }
11990 CONSTEXPR uint32_t get_value() const
11991 {
11992 uint32_t value = static_cast<uint32_t>(word0);
11993 return value;
11994 }
11995 uint32_t get_value() const volatile
11996 {
11997 uint32_t value = static_cast<uint32_t>(word0);
11998 return value;
11999 }
12000 CONSTEXPR scale_length_r &set_value(uint32_t value)
12001 {
12002 word0 = static_cast<uint32_t>(value);
12003 return *this;
12004 }
12005#endif
12006};
12007
12008// ofm_scale_r - None
12009struct ofm_scale_r
12010{
12011#ifndef __cplusplus
12012 union
12013 {
12014 struct
12015 {
12016 uint32_t value : 32; // 32-bit register value
12017 };
12018 uint32_t word;
12019 };
12020#else
12021 private:
12022 uint32_t word0;
12023
12024 public:
12025 CONSTEXPR ofm_scale_r() : word0(0) {}
12026 CONSTEXPR ofm_scale_r(uint32_t init) : word0(init) {}
12027 CONSTEXPR void operator=(uint32_t value)
12028 {
12029 word0 = value;
12030 }
12031 void operator=(uint32_t value) volatile
12032 {
12033 word0 = value;
12034 }
12035 CONSTEXPR operator uint32_t()
12036 {
12037 return word0;
12038 }
12039 operator uint32_t() volatile
12040 {
12041 return word0;
12042 }
12043 ofm_scale_r copy() volatile
12044 {
12045 return *this;
12046 }
12047 CONSTEXPR uint32_t get_value() const
12048 {
12049 uint32_t value = static_cast<uint32_t>(word0);
12050 return value;
12051 }
12052 uint32_t get_value() const volatile
12053 {
12054 uint32_t value = static_cast<uint32_t>(word0);
12055 return value;
12056 }
12057 CONSTEXPR ofm_scale_r &set_value(uint32_t value)
12058 {
12059 word0 = static_cast<uint32_t>(value);
12060 return *this;
12061 }
12062#endif
12063};
12064
12065// ofm_scale_shift_r - None
12066struct ofm_scale_shift_r
12067{
12068#ifndef __cplusplus
12069 union
12070 {
12071 struct
12072 {
12073 uint32_t value : 32; // 32-bit register value
12074 };
12075 uint32_t word;
12076 };
12077#else
12078 private:
12079 uint32_t word0;
12080
12081 public:
12082 CONSTEXPR ofm_scale_shift_r() : word0(0) {}
12083 CONSTEXPR ofm_scale_shift_r(uint32_t init) : word0(init) {}
12084 CONSTEXPR void operator=(uint32_t value)
12085 {
12086 word0 = value;
12087 }
12088 void operator=(uint32_t value) volatile
12089 {
12090 word0 = value;
12091 }
12092 CONSTEXPR operator uint32_t()
12093 {
12094 return word0;
12095 }
12096 operator uint32_t() volatile
12097 {
12098 return word0;
12099 }
12100 ofm_scale_shift_r copy() volatile
12101 {
12102 return *this;
12103 }
12104 CONSTEXPR uint32_t get_value() const
12105 {
12106 uint32_t value = static_cast<uint32_t>(word0);
12107 return value;
12108 }
12109 uint32_t get_value() const volatile
12110 {
12111 uint32_t value = static_cast<uint32_t>(word0);
12112 return value;
12113 }
12114 CONSTEXPR ofm_scale_shift_r &set_value(uint32_t value)
12115 {
12116 word0 = static_cast<uint32_t>(value);
12117 return *this;
12118 }
12119#endif
12120};
12121
12122// opa_scale_r - None
12123struct opa_scale_r
12124{
12125#ifndef __cplusplus
12126 union
12127 {
12128 struct
12129 {
12130 uint32_t value : 32; // 32-bit register value
12131 };
12132 uint32_t word;
12133 };
12134#else
12135 private:
12136 uint32_t word0;
12137
12138 public:
12139 CONSTEXPR opa_scale_r() : word0(0) {}
12140 CONSTEXPR opa_scale_r(uint32_t init) : word0(init) {}
12141 CONSTEXPR void operator=(uint32_t value)
12142 {
12143 word0 = value;
12144 }
12145 void operator=(uint32_t value) volatile
12146 {
12147 word0 = value;
12148 }
12149 CONSTEXPR operator uint32_t()
12150 {
12151 return word0;
12152 }
12153 operator uint32_t() volatile
12154 {
12155 return word0;
12156 }
12157 opa_scale_r copy() volatile
12158 {
12159 return *this;
12160 }
12161 CONSTEXPR uint32_t get_value() const
12162 {
12163 uint32_t value = static_cast<uint32_t>(word0);
12164 return value;
12165 }
12166 uint32_t get_value() const volatile
12167 {
12168 uint32_t value = static_cast<uint32_t>(word0);
12169 return value;
12170 }
12171 CONSTEXPR opa_scale_r &set_value(uint32_t value)
12172 {
12173 word0 = static_cast<uint32_t>(value);
12174 return *this;
12175 }
12176#endif
12177};
12178
12179// opa_scale_shift_r - None
12180struct opa_scale_shift_r
12181{
12182#ifndef __cplusplus
12183 union
12184 {
12185 struct
12186 {
12187 uint32_t value : 32; // 32-bit register value
12188 };
12189 uint32_t word;
12190 };
12191#else
12192 private:
12193 uint32_t word0;
12194
12195 public:
12196 CONSTEXPR opa_scale_shift_r() : word0(0) {}
12197 CONSTEXPR opa_scale_shift_r(uint32_t init) : word0(init) {}
12198 CONSTEXPR void operator=(uint32_t value)
12199 {
12200 word0 = value;
12201 }
12202 void operator=(uint32_t value) volatile
12203 {
12204 word0 = value;
12205 }
12206 CONSTEXPR operator uint32_t()
12207 {
12208 return word0;
12209 }
12210 operator uint32_t() volatile
12211 {
12212 return word0;
12213 }
12214 opa_scale_shift_r copy() volatile
12215 {
12216 return *this;
12217 }
12218 CONSTEXPR uint32_t get_value() const
12219 {
12220 uint32_t value = static_cast<uint32_t>(word0);
12221 return value;
12222 }
12223 uint32_t get_value() const volatile
12224 {
12225 uint32_t value = static_cast<uint32_t>(word0);
12226 return value;
12227 }
12228 CONSTEXPR opa_scale_shift_r &set_value(uint32_t value)
12229 {
12230 word0 = static_cast<uint32_t>(value);
12231 return *this;
12232 }
12233#endif
12234};
12235
12236// opb_scale_r - None
12237struct opb_scale_r
12238{
12239#ifndef __cplusplus
12240 union
12241 {
12242 struct
12243 {
12244 uint32_t value : 32; // 32-bit register value
12245 };
12246 uint32_t word;
12247 };
12248#else
12249 private:
12250 uint32_t word0;
12251
12252 public:
12253 CONSTEXPR opb_scale_r() : word0(0) {}
12254 CONSTEXPR opb_scale_r(uint32_t init) : word0(init) {}
12255 CONSTEXPR void operator=(uint32_t value)
12256 {
12257 word0 = value;
12258 }
12259 void operator=(uint32_t value) volatile
12260 {
12261 word0 = value;
12262 }
12263 CONSTEXPR operator uint32_t()
12264 {
12265 return word0;
12266 }
12267 operator uint32_t() volatile
12268 {
12269 return word0;
12270 }
12271 opb_scale_r copy() volatile
12272 {
12273 return *this;
12274 }
12275 CONSTEXPR uint32_t get_value() const
12276 {
12277 uint32_t value = static_cast<uint32_t>(word0);
12278 return value;
12279 }
12280 uint32_t get_value() const volatile
12281 {
12282 uint32_t value = static_cast<uint32_t>(word0);
12283 return value;
12284 }
12285 CONSTEXPR opb_scale_r &set_value(uint32_t value)
12286 {
12287 word0 = static_cast<uint32_t>(value);
12288 return *this;
12289 }
12290#endif
12291};
12292
12293// dma0_src_r - None
12294struct dma0_src_r
12295{
12296#ifndef __cplusplus
12297 union
12298 {
12299 struct
12300 {
12301 uint32_t value_LO : 32; // 64-bit register value - LSB
12302 uint32_t value_HI : 32; // 64-bit register value - MSB
12303 };
12304 uint32_t word[2];
12305 };
12306#else
12307 private:
12308 uint32_t word0;
12309 uint32_t word1;
12310
12311 public:
12312 CONSTEXPR dma0_src_r() : word0(0), word1(0) {}
12313 CONSTEXPR dma0_src_r(uint64_t init) :
12314 word0(static_cast<uint32_t>((init) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()))),
12315 word1(static_cast<uint32_t>((init >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max())))
12316 {
12317 }
12318 CONSTEXPR void operator=(uint64_t value)
12319 {
12320 word0 = static_cast<uint32_t>((value) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
12321 word1 = static_cast<uint32_t>((value >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
12322 }
12323 void operator=(uint64_t value) volatile
12324 {
12325 word0 = static_cast<uint32_t>((value) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
12326 word1 = static_cast<uint32_t>((value >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
12327 }
12328 CONSTEXPR operator uint64_t()
12329 {
12330 return (static_cast<uint64_t>(word1) << 32) | word0;
12331 }
12332 operator uint64_t() volatile
12333 {
12334 return (static_cast<uint64_t>(word1) << 32) | word0;
12335 }
12336 dma0_src_r copy() volatile
12337 {
12338 return *this;
12339 }
12340#endif
12341};
12342
12343// dma0_dst_r - None
12344struct dma0_dst_r
12345{
12346#ifndef __cplusplus
12347 union
12348 {
12349 struct
12350 {
12351 uint32_t value_LO : 32; // 64-bit register value - LSB
12352 uint32_t value_HI : 32; // 64-bit register value - MSB
12353 };
12354 uint32_t word[2];
12355 };
12356#else
12357 private:
12358 uint32_t word0;
12359 uint32_t word1;
12360
12361 public:
12362 CONSTEXPR dma0_dst_r() : word0(0), word1(0) {}
12363 CONSTEXPR dma0_dst_r(uint64_t init) :
12364 word0(static_cast<uint32_t>((init) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()))),
12365 word1(static_cast<uint32_t>((init >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max())))
12366 {
12367 }
12368 CONSTEXPR void operator=(uint64_t value)
12369 {
12370 word0 = static_cast<uint32_t>((value) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
12371 word1 = static_cast<uint32_t>((value >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
12372 }
12373 void operator=(uint64_t value) volatile
12374 {
12375 word0 = static_cast<uint32_t>((value) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
12376 word1 = static_cast<uint32_t>((value >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
12377 }
12378 CONSTEXPR operator uint64_t()
12379 {
12380 return (static_cast<uint64_t>(word1) << 32) | word0;
12381 }
12382 operator uint64_t() volatile
12383 {
12384 return (static_cast<uint64_t>(word1) << 32) | word0;
12385 }
12386 dma0_dst_r copy() volatile
12387 {
12388 return *this;
12389 }
12390#endif
12391};
12392
12393// dma0_len_r - None
12394struct dma0_len_r
12395{
12396#ifndef __cplusplus
12397 union
12398 {
12399 struct
12400 {
12401 uint32_t value_LO : 32; // 64-bit register value - LSB
12402 uint32_t value_HI : 32; // 64-bit register value - MSB
12403 };
12404 uint32_t word[2];
12405 };
12406#else
12407 private:
12408 uint32_t word0;
12409 uint32_t word1;
12410
12411 public:
12412 CONSTEXPR dma0_len_r() : word0(0), word1(0) {}
12413 CONSTEXPR dma0_len_r(uint64_t init) :
12414 word0(static_cast<uint32_t>((init) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()))),
12415 word1(static_cast<uint32_t>((init >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max())))
12416 {
12417 }
12418 CONSTEXPR void operator=(uint64_t value)
12419 {
12420 word0 = static_cast<uint32_t>((value) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
12421 word1 = static_cast<uint32_t>((value >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
12422 }
12423 void operator=(uint64_t value) volatile
12424 {
12425 word0 = static_cast<uint32_t>((value) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
12426 word1 = static_cast<uint32_t>((value >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
12427 }
12428 CONSTEXPR operator uint64_t()
12429 {
12430 return (static_cast<uint64_t>(word1) << 32) | word0;
12431 }
12432 operator uint64_t() volatile
12433 {
12434 return (static_cast<uint64_t>(word1) << 32) | word0;
12435 }
12436 dma0_len_r copy() volatile
12437 {
12438 return *this;
12439 }
12440#endif
12441};
12442
12443// ifm2_base0_r - None
12444struct ifm2_base0_r
12445{
12446#ifndef __cplusplus
12447 union
12448 {
12449 struct
12450 {
12451 uint32_t value_LO : 32; // 64-bit register value - LSB
12452 uint32_t value_HI : 32; // 64-bit register value - MSB
12453 };
12454 uint32_t word[2];
12455 };
12456#else
12457 private:
12458 uint32_t word0;
12459 uint32_t word1;
12460
12461 public:
12462 CONSTEXPR ifm2_base0_r() : word0(0), word1(0) {}
12463 CONSTEXPR ifm2_base0_r(uint64_t init) :
12464 word0(static_cast<uint32_t>((init) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()))),
12465 word1(static_cast<uint32_t>((init >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max())))
12466 {
12467 }
12468 CONSTEXPR void operator=(uint64_t value)
12469 {
12470 word0 = static_cast<uint32_t>((value) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
12471 word1 = static_cast<uint32_t>((value >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
12472 }
12473 void operator=(uint64_t value) volatile
12474 {
12475 word0 = static_cast<uint32_t>((value) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
12476 word1 = static_cast<uint32_t>((value >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
12477 }
12478 CONSTEXPR operator uint64_t()
12479 {
12480 return (static_cast<uint64_t>(word1) << 32) | word0;
12481 }
12482 operator uint64_t() volatile
12483 {
12484 return (static_cast<uint64_t>(word1) << 32) | word0;
12485 }
12486 ifm2_base0_r copy() volatile
12487 {
12488 return *this;
12489 }
12490#endif
12491};
12492
12493// ifm2_base1_r - None
12494struct ifm2_base1_r
12495{
12496#ifndef __cplusplus
12497 union
12498 {
12499 struct
12500 {
12501 uint32_t value_LO : 32; // 64-bit register value - LSB
12502 uint32_t value_HI : 32; // 64-bit register value - MSB
12503 };
12504 uint32_t word[2];
12505 };
12506#else
12507 private:
12508 uint32_t word0;
12509 uint32_t word1;
12510
12511 public:
12512 CONSTEXPR ifm2_base1_r() : word0(0), word1(0) {}
12513 CONSTEXPR ifm2_base1_r(uint64_t init) :
12514 word0(static_cast<uint32_t>((init) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()))),
12515 word1(static_cast<uint32_t>((init >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max())))
12516 {
12517 }
12518 CONSTEXPR void operator=(uint64_t value)
12519 {
12520 word0 = static_cast<uint32_t>((value) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
12521 word1 = static_cast<uint32_t>((value >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
12522 }
12523 void operator=(uint64_t value) volatile
12524 {
12525 word0 = static_cast<uint32_t>((value) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
12526 word1 = static_cast<uint32_t>((value >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
12527 }
12528 CONSTEXPR operator uint64_t()
12529 {
12530 return (static_cast<uint64_t>(word1) << 32) | word0;
12531 }
12532 operator uint64_t() volatile
12533 {
12534 return (static_cast<uint64_t>(word1) << 32) | word0;
12535 }
12536 ifm2_base1_r copy() volatile
12537 {
12538 return *this;
12539 }
12540#endif
12541};
12542
12543// ifm2_base2_r - None
12544struct ifm2_base2_r
12545{
12546#ifndef __cplusplus
12547 union
12548 {
12549 struct
12550 {
12551 uint32_t value_LO : 32; // 64-bit register value - LSB
12552 uint32_t value_HI : 32; // 64-bit register value - MSB
12553 };
12554 uint32_t word[2];
12555 };
12556#else
12557 private:
12558 uint32_t word0;
12559 uint32_t word1;
12560
12561 public:
12562 CONSTEXPR ifm2_base2_r() : word0(0), word1(0) {}
12563 CONSTEXPR ifm2_base2_r(uint64_t init) :
12564 word0(static_cast<uint32_t>((init) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()))),
12565 word1(static_cast<uint32_t>((init >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max())))
12566 {
12567 }
12568 CONSTEXPR void operator=(uint64_t value)
12569 {
12570 word0 = static_cast<uint32_t>((value) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
12571 word1 = static_cast<uint32_t>((value >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
12572 }
12573 void operator=(uint64_t value) volatile
12574 {
12575 word0 = static_cast<uint32_t>((value) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
12576 word1 = static_cast<uint32_t>((value >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
12577 }
12578 CONSTEXPR operator uint64_t()
12579 {
12580 return (static_cast<uint64_t>(word1) << 32) | word0;
12581 }
12582 operator uint64_t() volatile
12583 {
12584 return (static_cast<uint64_t>(word1) << 32) | word0;
12585 }
12586 ifm2_base2_r copy() volatile
12587 {
12588 return *this;
12589 }
12590#endif
12591};
12592
12593// ifm2_base3_r - None
12594struct ifm2_base3_r
12595{
12596#ifndef __cplusplus
12597 union
12598 {
12599 struct
12600 {
12601 uint32_t value_LO : 32; // 64-bit register value - LSB
12602 uint32_t value_HI : 32; // 64-bit register value - MSB
12603 };
12604 uint32_t word[2];
12605 };
12606#else
12607 private:
12608 uint32_t word0;
12609 uint32_t word1;
12610
12611 public:
12612 CONSTEXPR ifm2_base3_r() : word0(0), word1(0) {}
12613 CONSTEXPR ifm2_base3_r(uint64_t init) :
12614 word0(static_cast<uint32_t>((init) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()))),
12615 word1(static_cast<uint32_t>((init >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max())))
12616 {
12617 }
12618 CONSTEXPR void operator=(uint64_t value)
12619 {
12620 word0 = static_cast<uint32_t>((value) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
12621 word1 = static_cast<uint32_t>((value >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
12622 }
12623 void operator=(uint64_t value) volatile
12624 {
12625 word0 = static_cast<uint32_t>((value) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
12626 word1 = static_cast<uint32_t>((value >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
12627 }
12628 CONSTEXPR operator uint64_t()
12629 {
12630 return (static_cast<uint64_t>(word1) << 32) | word0;
12631 }
12632 operator uint64_t() volatile
12633 {
12634 return (static_cast<uint64_t>(word1) << 32) | word0;
12635 }
12636 ifm2_base3_r copy() volatile
12637 {
12638 return *this;
12639 }
12640#endif
12641};
12642
12643// ifm2_stride_x_r - None
12644struct ifm2_stride_x_r
12645{
12646#ifndef __cplusplus
12647 union
12648 {
12649 struct
12650 {
12651 uint32_t value_LO : 32; // 64-bit register value - LSB
12652 uint32_t value_HI : 32; // 64-bit register value - MSB
12653 };
12654 uint32_t word[2];
12655 };
12656#else
12657 private:
12658 uint32_t word0;
12659 uint32_t word1;
12660
12661 public:
12662 CONSTEXPR ifm2_stride_x_r() : word0(0), word1(0) {}
12663 CONSTEXPR ifm2_stride_x_r(uint64_t init) :
12664 word0(static_cast<uint32_t>((init) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()))),
12665 word1(static_cast<uint32_t>((init >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max())))
12666 {
12667 }
12668 CONSTEXPR void operator=(uint64_t value)
12669 {
12670 word0 = static_cast<uint32_t>((value) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
12671 word1 = static_cast<uint32_t>((value >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
12672 }
12673 void operator=(uint64_t value) volatile
12674 {
12675 word0 = static_cast<uint32_t>((value) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
12676 word1 = static_cast<uint32_t>((value >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
12677 }
12678 CONSTEXPR operator uint64_t()
12679 {
12680 return (static_cast<uint64_t>(word1) << 32) | word0;
12681 }
12682 operator uint64_t() volatile
12683 {
12684 return (static_cast<uint64_t>(word1) << 32) | word0;
12685 }
12686 ifm2_stride_x_r copy() volatile
12687 {
12688 return *this;
12689 }
12690#endif
12691};
12692
12693// ifm2_stride_y_r - None
12694struct ifm2_stride_y_r
12695{
12696#ifndef __cplusplus
12697 union
12698 {
12699 struct
12700 {
12701 uint32_t value_LO : 32; // 64-bit register value - LSB
12702 uint32_t value_HI : 32; // 64-bit register value - MSB
12703 };
12704 uint32_t word[2];
12705 };
12706#else
12707 private:
12708 uint32_t word0;
12709 uint32_t word1;
12710
12711 public:
12712 CONSTEXPR ifm2_stride_y_r() : word0(0), word1(0) {}
12713 CONSTEXPR ifm2_stride_y_r(uint64_t init) :
12714 word0(static_cast<uint32_t>((init) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()))),
12715 word1(static_cast<uint32_t>((init >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max())))
12716 {
12717 }
12718 CONSTEXPR void operator=(uint64_t value)
12719 {
12720 word0 = static_cast<uint32_t>((value) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
12721 word1 = static_cast<uint32_t>((value >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
12722 }
12723 void operator=(uint64_t value) volatile
12724 {
12725 word0 = static_cast<uint32_t>((value) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
12726 word1 = static_cast<uint32_t>((value >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
12727 }
12728 CONSTEXPR operator uint64_t()
12729 {
12730 return (static_cast<uint64_t>(word1) << 32) | word0;
12731 }
12732 operator uint64_t() volatile
12733 {
12734 return (static_cast<uint64_t>(word1) << 32) | word0;
12735 }
12736 ifm2_stride_y_r copy() volatile
12737 {
12738 return *this;
12739 }
12740#endif
12741};
12742
12743// ifm2_stride_c_r - None
12744struct ifm2_stride_c_r
12745{
12746#ifndef __cplusplus
12747 union
12748 {
12749 struct
12750 {
12751 uint32_t value_LO : 32; // 64-bit register value - LSB
12752 uint32_t value_HI : 32; // 64-bit register value - MSB
12753 };
12754 uint32_t word[2];
12755 };
12756#else
12757 private:
12758 uint32_t word0;
12759 uint32_t word1;
12760
12761 public:
12762 CONSTEXPR ifm2_stride_c_r() : word0(0), word1(0) {}
12763 CONSTEXPR ifm2_stride_c_r(uint64_t init) :
12764 word0(static_cast<uint32_t>((init) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()))),
12765 word1(static_cast<uint32_t>((init >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max())))
12766 {
12767 }
12768 CONSTEXPR void operator=(uint64_t value)
12769 {
12770 word0 = static_cast<uint32_t>((value) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
12771 word1 = static_cast<uint32_t>((value >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
12772 }
12773 void operator=(uint64_t value) volatile
12774 {
12775 word0 = static_cast<uint32_t>((value) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
12776 word1 = static_cast<uint32_t>((value >> 32) & static_cast<uint64_t>(std::numeric_limits<uint64_t>::max()));
12777 }
12778 CONSTEXPR operator uint64_t()
12779 {
12780 return (static_cast<uint64_t>(word1) << 32) | word0;
12781 }
12782 operator uint64_t() volatile
12783 {
12784 return (static_cast<uint64_t>(word1) << 32) | word0;
12785 }
12786 ifm2_stride_c_r copy() volatile
12787 {
12788 return *this;
12789 }
12790#endif
12791};
12792
12793// revision_r - Internal FPGA build revision: first 32-bits of the Ultan Git hash used for the build
12794struct revision_r
12795{
12796#ifndef __cplusplus
12797 union
12798 {
12799 struct
12800 {
12801 uint32_t value : 32; // 32-bit register value
12802 };
12803 uint32_t word;
12804 };
12805#else
12806 private:
12807 uint32_t word0;
12808
12809 public:
12810 CONSTEXPR revision_r() : word0(0) {}
12811 CONSTEXPR revision_r(uint32_t init) : word0(init) {}
12812 CONSTEXPR void operator=(uint32_t value)
12813 {
12814 word0 = value;
12815 }
12816 void operator=(uint32_t value) volatile
12817 {
12818 word0 = value;
12819 }
12820 CONSTEXPR operator uint32_t()
12821 {
12822 return word0;
12823 }
12824 operator uint32_t() volatile
12825 {
12826 return word0;
12827 }
12828 revision_r copy() volatile
12829 {
12830 return *this;
12831 }
12832 CONSTEXPR uint32_t get_value() const
12833 {
12834 uint32_t value = static_cast<uint32_t>(word0);
12835 return value;
12836 }
12837 uint32_t get_value() const volatile
12838 {
12839 uint32_t value = static_cast<uint32_t>(word0);
12840 return value;
12841 }
12842 CONSTEXPR revision_r &set_value(uint32_t value)
12843 {
12844 word0 = static_cast<uint32_t>(value);
12845 return *this;
12846 }
12847#endif
12848};
12849
12850// pid4_r - Peripheral ID byte 4 (Arm=code 4)
12851struct pid4_r
12852{
12853#ifndef __cplusplus
12854 union
12855 {
12856 struct
12857 {
12858 uint32_t PID4 : 32; // Byte 4 of Peripheral ID (Lower 8 bits valid)
12859 };
12860 uint32_t word;
12861 };
12862#else
12863 private:
12864 uint32_t word0;
12865
12866 public:
12867 CONSTEXPR pid4_r() : word0(4) {}
12868 CONSTEXPR pid4_r(uint32_t init) : word0(init) {}
12869 CONSTEXPR void operator=(uint32_t value)
12870 {
12871 word0 = value;
12872 }
12873 void operator=(uint32_t value) volatile
12874 {
12875 word0 = value;
12876 }
12877 CONSTEXPR operator uint32_t()
12878 {
12879 return word0;
12880 }
12881 operator uint32_t() volatile
12882 {
12883 return word0;
12884 }
12885 pid4_r copy() volatile
12886 {
12887 return *this;
12888 }
12889 CONSTEXPR uint32_t get_PID4() const
12890 {
12891 uint32_t value = static_cast<uint32_t>(word0);
12892 return value;
12893 }
12894 uint32_t get_PID4() const volatile
12895 {
12896 uint32_t value = static_cast<uint32_t>(word0);
12897 return value;
12898 }
12899 CONSTEXPR pid4_r &set_PID4(uint32_t value)
12900 {
12901 word0 = static_cast<uint32_t>(value);
12902 return *this;
12903 }
12904#endif
12905};
12906
12907// pid5_r - Peripheral ID byte 5 (reserved)
12908struct pid5_r
12909{
12910#ifndef __cplusplus
12911 union
12912 {
12913 struct
12914 {
12915 uint32_t PID5 : 32; // Byte 5 of Peripheral ID (Lower 8 bits valid)
12916 };
12917 uint32_t word;
12918 };
12919#else
12920 private:
12921 uint32_t word0;
12922
12923 public:
12924 CONSTEXPR pid5_r() : word0(0) {}
12925 CONSTEXPR pid5_r(uint32_t init) : word0(init) {}
12926 CONSTEXPR void operator=(uint32_t value)
12927 {
12928 word0 = value;
12929 }
12930 void operator=(uint32_t value) volatile
12931 {
12932 word0 = value;
12933 }
12934 CONSTEXPR operator uint32_t()
12935 {
12936 return word0;
12937 }
12938 operator uint32_t() volatile
12939 {
12940 return word0;
12941 }
12942 pid5_r copy() volatile
12943 {
12944 return *this;
12945 }
12946 CONSTEXPR uint32_t get_PID5() const
12947 {
12948 uint32_t value = static_cast<uint32_t>(word0);
12949 return value;
12950 }
12951 uint32_t get_PID5() const volatile
12952 {
12953 uint32_t value = static_cast<uint32_t>(word0);
12954 return value;
12955 }
12956 CONSTEXPR pid5_r &set_PID5(uint32_t value)
12957 {
12958 word0 = static_cast<uint32_t>(value);
12959 return *this;
12960 }
12961#endif
12962};
12963
12964// pid6_r - Peripheral ID byte 6 (reserved)
12965struct pid6_r
12966{
12967#ifndef __cplusplus
12968 union
12969 {
12970 struct
12971 {
12972 uint32_t PID6 : 32; // Byte 6 of Peripheral ID (Lower 8 bits valid)
12973 };
12974 uint32_t word;
12975 };
12976#else
12977 private:
12978 uint32_t word0;
12979
12980 public:
12981 CONSTEXPR pid6_r() : word0(0) {}
12982 CONSTEXPR pid6_r(uint32_t init) : word0(init) {}
12983 CONSTEXPR void operator=(uint32_t value)
12984 {
12985 word0 = value;
12986 }
12987 void operator=(uint32_t value) volatile
12988 {
12989 word0 = value;
12990 }
12991 CONSTEXPR operator uint32_t()
12992 {
12993 return word0;
12994 }
12995 operator uint32_t() volatile
12996 {
12997 return word0;
12998 }
12999 pid6_r copy() volatile
13000 {
13001 return *this;
13002 }
13003 CONSTEXPR uint32_t get_PID6() const
13004 {
13005 uint32_t value = static_cast<uint32_t>(word0);
13006 return value;
13007 }
13008 uint32_t get_PID6() const volatile
13009 {
13010 uint32_t value = static_cast<uint32_t>(word0);
13011 return value;
13012 }
13013 CONSTEXPR pid6_r &set_PID6(uint32_t value)
13014 {
13015 word0 = static_cast<uint32_t>(value);
13016 return *this;
13017 }
13018#endif
13019};
13020
13021// pid7_r - Peripheral ID byte 7 (reserved)
13022struct pid7_r
13023{
13024#ifndef __cplusplus
13025 union
13026 {
13027 struct
13028 {
13029 uint32_t PID7 : 32; // Byte 7 of Peripheral ID (Lower 8 bits valid)
13030 };
13031 uint32_t word;
13032 };
13033#else
13034 private:
13035 uint32_t word0;
13036
13037 public:
13038 CONSTEXPR pid7_r() : word0(0) {}
13039 CONSTEXPR pid7_r(uint32_t init) : word0(init) {}
13040 CONSTEXPR void operator=(uint32_t value)
13041 {
13042 word0 = value;
13043 }
13044 void operator=(uint32_t value) volatile
13045 {
13046 word0 = value;
13047 }
13048 CONSTEXPR operator uint32_t()
13049 {
13050 return word0;
13051 }
13052 operator uint32_t() volatile
13053 {
13054 return word0;
13055 }
13056 pid7_r copy() volatile
13057 {
13058 return *this;
13059 }
13060 CONSTEXPR uint32_t get_PID7() const
13061 {
13062 uint32_t value = static_cast<uint32_t>(word0);
13063 return value;
13064 }
13065 uint32_t get_PID7() const volatile
13066 {
13067 uint32_t value = static_cast<uint32_t>(word0);
13068 return value;
13069 }
13070 CONSTEXPR pid7_r &set_PID7(uint32_t value)
13071 {
13072 word0 = static_cast<uint32_t>(value);
13073 return *this;
13074 }
13075#endif
13076};
13077
13078// pid0_r - Peripheral ID byte 0. This is bits[7:0] of the part number
13079struct pid0_r
13080{
13081#ifndef __cplusplus
13082 union
13083 {
13084 struct
13085 {
13086 uint32_t PID0 : 32; // Byte 0 of Peripheral ID (Lower 8 bits valid)
13087 };
13088 uint32_t word;
13089 };
13090#else
13091 private:
13092 uint32_t word0;
13093
13094 public:
13095 CONSTEXPR pid0_r() : word0(128) {}
13096 CONSTEXPR pid0_r(uint32_t init) : word0(init) {}
13097 CONSTEXPR void operator=(uint32_t value)
13098 {
13099 word0 = value;
13100 }
13101 void operator=(uint32_t value) volatile
13102 {
13103 word0 = value;
13104 }
13105 CONSTEXPR operator uint32_t()
13106 {
13107 return word0;
13108 }
13109 operator uint32_t() volatile
13110 {
13111 return word0;
13112 }
13113 pid0_r copy() volatile
13114 {
13115 return *this;
13116 }
13117 CONSTEXPR uint32_t get_PID0() const
13118 {
13119 uint32_t value = static_cast<uint32_t>(word0);
13120 return value;
13121 }
13122 uint32_t get_PID0() const volatile
13123 {
13124 uint32_t value = static_cast<uint32_t>(word0);
13125 return value;
13126 }
13127 CONSTEXPR pid0_r &set_PID0(uint32_t value)
13128 {
13129 word0 = static_cast<uint32_t>(value);
13130 return *this;
13131 }
13132#endif
13133};
13134
13135// 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
13136// bits[7:4]
13137struct pid1_r
13138{
13139#ifndef __cplusplus
13140 union
13141 {
13142 struct
13143 {
13144 uint32_t PID1 : 32; // Byte 1 of Peripheral ID (Lower 8 bits valid)
13145 };
13146 uint32_t word;
13147 };
13148#else
13149 private:
13150 uint32_t word0;
13151
13152 public:
13153 CONSTEXPR pid1_r() : word0(181) {}
13154 CONSTEXPR pid1_r(uint32_t init) : word0(init) {}
13155 CONSTEXPR void operator=(uint32_t value)
13156 {
13157 word0 = value;
13158 }
13159 void operator=(uint32_t value) volatile
13160 {
13161 word0 = value;
13162 }
13163 CONSTEXPR operator uint32_t()
13164 {
13165 return word0;
13166 }
13167 operator uint32_t() volatile
13168 {
13169 return word0;
13170 }
13171 pid1_r copy() volatile
13172 {
13173 return *this;
13174 }
13175 CONSTEXPR uint32_t get_PID1() const
13176 {
13177 uint32_t value = static_cast<uint32_t>(word0);
13178 return value;
13179 }
13180 uint32_t get_PID1() const volatile
13181 {
13182 uint32_t value = static_cast<uint32_t>(word0);
13183 return value;
13184 }
13185 CONSTEXPR pid1_r &set_PID1(uint32_t value)
13186 {
13187 word0 = static_cast<uint32_t>(value);
13188 return *this;
13189 }
13190#endif
13191};
13192
13193// 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
13194struct pid2_r
13195{
13196#ifndef __cplusplus
13197 union
13198 {
13199 struct
13200 {
13201 uint32_t PID2 : 32; // Byte 2 of Peripheral ID (Lower 8 bits valid)
13202 };
13203 uint32_t word;
13204 };
13205#else
13206 private:
13207 uint32_t word0;
13208
13209 public:
13210 CONSTEXPR pid2_r() : word0(11) {}
13211 CONSTEXPR pid2_r(uint32_t init) : word0(init) {}
13212 CONSTEXPR void operator=(uint32_t value)
13213 {
13214 word0 = value;
13215 }
13216 void operator=(uint32_t value) volatile
13217 {
13218 word0 = value;
13219 }
13220 CONSTEXPR operator uint32_t()
13221 {
13222 return word0;
13223 }
13224 operator uint32_t() volatile
13225 {
13226 return word0;
13227 }
13228 pid2_r copy() volatile
13229 {
13230 return *this;
13231 }
13232 CONSTEXPR uint32_t get_PID2() const
13233 {
13234 uint32_t value = static_cast<uint32_t>(word0);
13235 return value;
13236 }
13237 uint32_t get_PID2() const volatile
13238 {
13239 uint32_t value = static_cast<uint32_t>(word0);
13240 return value;
13241 }
13242 CONSTEXPR pid2_r &set_PID2(uint32_t value)
13243 {
13244 word0 = static_cast<uint32_t>(value);
13245 return *this;
13246 }
13247#endif
13248};
13249
13250// pid3_r - Peripheral ID byte 3
13251struct pid3_r
13252{
13253#ifndef __cplusplus
13254 union
13255 {
13256 struct
13257 {
13258 uint32_t PID3 : 32; // Byte 1 of Peripheral ID (Lower 8 bits valid)
13259 };
13260 uint32_t word;
13261 };
13262#else
13263 private:
13264 uint32_t word0;
13265
13266 public:
13267 CONSTEXPR pid3_r() : word0(0) {}
13268 CONSTEXPR pid3_r(uint32_t init) : word0(init) {}
13269 CONSTEXPR void operator=(uint32_t value)
13270 {
13271 word0 = value;
13272 }
13273 void operator=(uint32_t value) volatile
13274 {
13275 word0 = value;
13276 }
13277 CONSTEXPR operator uint32_t()
13278 {
13279 return word0;
13280 }
13281 operator uint32_t() volatile
13282 {
13283 return word0;
13284 }
13285 pid3_r copy() volatile
13286 {
13287 return *this;
13288 }
13289 CONSTEXPR uint32_t get_PID3() const
13290 {
13291 uint32_t value = static_cast<uint32_t>(word0);
13292 return value;
13293 }
13294 uint32_t get_PID3() const volatile
13295 {
13296 uint32_t value = static_cast<uint32_t>(word0);
13297 return value;
13298 }
13299 CONSTEXPR pid3_r &set_PID3(uint32_t value)
13300 {
13301 word0 = static_cast<uint32_t>(value);
13302 return *this;
13303 }
13304#endif
13305};
13306
13307// cid0_r - Component ID byte 0
13308struct cid0_r
13309{
13310#ifndef __cplusplus
13311 union
13312 {
13313 struct
13314 {
13315 uint32_t CID0 : 32; // Byte 0 of Component ID (Lower 8 bits valid)
13316 };
13317 uint32_t word;
13318 };
13319#else
13320 private:
13321 uint32_t word0;
13322
13323 public:
13324 CONSTEXPR cid0_r() : word0(13) {}
13325 CONSTEXPR cid0_r(uint32_t init) : word0(init) {}
13326 CONSTEXPR void operator=(uint32_t value)
13327 {
13328 word0 = value;
13329 }
13330 void operator=(uint32_t value) volatile
13331 {
13332 word0 = value;
13333 }
13334 CONSTEXPR operator uint32_t()
13335 {
13336 return word0;
13337 }
13338 operator uint32_t() volatile
13339 {
13340 return word0;
13341 }
13342 cid0_r copy() volatile
13343 {
13344 return *this;
13345 }
13346 CONSTEXPR uint32_t get_CID0() const
13347 {
13348 uint32_t value = static_cast<uint32_t>(word0);
13349 return value;
13350 }
13351 uint32_t get_CID0() const volatile
13352 {
13353 uint32_t value = static_cast<uint32_t>(word0);
13354 return value;
13355 }
13356 CONSTEXPR cid0_r &set_CID0(uint32_t value)
13357 {
13358 word0 = static_cast<uint32_t>(value);
13359 return *this;
13360 }
13361#endif
13362};
13363
13364// cid1_r - Component ID byte 1
13365struct cid1_r
13366{
13367#ifndef __cplusplus
13368 union
13369 {
13370 struct
13371 {
13372 uint32_t CID1 : 32; // Byte 1 of Component ID (Lower 8 bits valid)
13373 };
13374 uint32_t word;
13375 };
13376#else
13377 private:
13378 uint32_t word0;
13379
13380 public:
13381 CONSTEXPR cid1_r() : word0(240) {}
13382 CONSTEXPR cid1_r(uint32_t init) : word0(init) {}
13383 CONSTEXPR void operator=(uint32_t value)
13384 {
13385 word0 = value;
13386 }
13387 void operator=(uint32_t value) volatile
13388 {
13389 word0 = value;
13390 }
13391 CONSTEXPR operator uint32_t()
13392 {
13393 return word0;
13394 }
13395 operator uint32_t() volatile
13396 {
13397 return word0;
13398 }
13399 cid1_r copy() volatile
13400 {
13401 return *this;
13402 }
13403 CONSTEXPR uint32_t get_CID1() const
13404 {
13405 uint32_t value = static_cast<uint32_t>(word0);
13406 return value;
13407 }
13408 uint32_t get_CID1() const volatile
13409 {
13410 uint32_t value = static_cast<uint32_t>(word0);
13411 return value;
13412 }
13413 CONSTEXPR cid1_r &set_CID1(uint32_t value)
13414 {
13415 word0 = static_cast<uint32_t>(value);
13416 return *this;
13417 }
13418#endif
13419};
13420
13421// cid2_r - Component ID byte 2
13422struct cid2_r
13423{
13424#ifndef __cplusplus
13425 union
13426 {
13427 struct
13428 {
13429 uint32_t CID2 : 32; // Byte 2 of Component ID (Lower 8 bits valid)
13430 };
13431 uint32_t word;
13432 };
13433#else
13434 private:
13435 uint32_t word0;
13436
13437 public:
13438 CONSTEXPR cid2_r() : word0(5) {}
13439 CONSTEXPR cid2_r(uint32_t init) : word0(init) {}
13440 CONSTEXPR void operator=(uint32_t value)
13441 {
13442 word0 = value;
13443 }
13444 void operator=(uint32_t value) volatile
13445 {
13446 word0 = value;
13447 }
13448 CONSTEXPR operator uint32_t()
13449 {
13450 return word0;
13451 }
13452 operator uint32_t() volatile
13453 {
13454 return word0;
13455 }
13456 cid2_r copy() volatile
13457 {
13458 return *this;
13459 }
13460 CONSTEXPR uint32_t get_CID2() const
13461 {
13462 uint32_t value = static_cast<uint32_t>(word0);
13463 return value;
13464 }
13465 uint32_t get_CID2() const volatile
13466 {
13467 uint32_t value = static_cast<uint32_t>(word0);
13468 return value;
13469 }
13470 CONSTEXPR cid2_r &set_CID2(uint32_t value)
13471 {
13472 word0 = static_cast<uint32_t>(value);
13473 return *this;
13474 }
13475#endif
13476};
13477
13478// cid3_r - Component ID byte 3
13479struct cid3_r
13480{
13481#ifndef __cplusplus
13482 union
13483 {
13484 struct
13485 {
13486 uint32_t CID3 : 32; // Byte 3 of Component ID (Lower 8 bits valid)
13487 };
13488 uint32_t word;
13489 };
13490#else
13491 private:
13492 uint32_t word0;
13493
13494 public:
13495 CONSTEXPR cid3_r() : word0(177) {}
13496 CONSTEXPR cid3_r(uint32_t init) : word0(init) {}
13497 CONSTEXPR void operator=(uint32_t value)
13498 {
13499 word0 = value;
13500 }
13501 void operator=(uint32_t value) volatile
13502 {
13503 word0 = value;
13504 }
13505 CONSTEXPR operator uint32_t()
13506 {
13507 return word0;
13508 }
13509 operator uint32_t() volatile
13510 {
13511 return word0;
13512 }
13513 cid3_r copy() volatile
13514 {
13515 return *this;
13516 }
13517 CONSTEXPR uint32_t get_CID3() const
13518 {
13519 uint32_t value = static_cast<uint32_t>(word0);
13520 return value;
13521 }
13522 uint32_t get_CID3() const volatile
13523 {
13524 uint32_t value = static_cast<uint32_t>(word0);
13525 return value;
13526 }
13527 CONSTEXPR cid3_r &set_CID3(uint32_t value)
13528 {
13529 word0 = static_cast<uint32_t>(value);
13530 return *this;
13531 }
13532#endif
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020013533};
13534
13535struct NPU_REG
13536{
Jonny Svärd136810f2021-10-13 16:04:26 +020013537 STRUCT id_r ID; // 0x0000
13538 STRUCT status_r STATUS; // 0x0004
13539 STRUCT cmd_r CMD; // 0x0008
13540 STRUCT reset_r RESET; // 0x000C
13541 STRUCT qbase_r QBASE; // 0x0010
13542 STRUCT qread_r QREAD; // 0x0018
13543 STRUCT qconfig_r QCONFIG; // 0x001C
13544 STRUCT qsize_r QSIZE; // 0x0020
13545 STRUCT prot_r PROT; // 0x0024
13546 STRUCT config_r CONFIG; // 0x0028
13547 STRUCT lock_r LOCK; // 0x002C
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020013548 uint32_t unused0[3];
Jonny Svärd136810f2021-10-13 16:04:26 +020013549 STRUCT regioncfg_r REGIONCFG; // 0x003C
13550 STRUCT axi_limit0_r AXI_LIMIT0; // 0x0040
13551 STRUCT axi_limit1_r AXI_LIMIT1; // 0x0044
13552 STRUCT axi_limit2_r AXI_LIMIT2; // 0x0048
13553 STRUCT axi_limit3_r AXI_LIMIT3; // 0x004C
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020013554 uint32_t unused1[12];
Jonny Svärd136810f2021-10-13 16:04:26 +020013555 STRUCT basep_r BASEP[8]; // 0x0080
Diqing Zhong04118062020-04-15 01:19:12 +020013556 uint32_t unused2[16];
Jonny Svärd136810f2021-10-13 16:04:26 +020013557 STRUCT wd_status_r WD_STATUS; // 0x0100
13558 STRUCT mac_status_r MAC_STATUS; // 0x0104
13559 STRUCT ao_status_r AO_STATUS; // 0x0108
Diqing Zhong04118062020-04-15 01:19:12 +020013560 uint32_t unused3[1];
Jonny Svärd136810f2021-10-13 16:04:26 +020013561 STRUCT dma_status0_r DMA_STATUS0; // 0x0110
13562 STRUCT dma_status1_r DMA_STATUS1; // 0x0114
Douglas Trohaf6a85da2020-05-11 11:45:28 +020013563 uint32_t unused4[10];
Jonny Svärd136810f2021-10-13 16:04:26 +020013564 STRUCT clkforce_r CLKFORCE; // 0x0140
13565 STRUCT debug_address_r DEBUG_ADDRESS; // 0x0144
13566 STRUCT debug_misc_r DEBUG_MISC; // 0x0148
13567 uint32_t unused5[1];
13568 STRUCT debug_block_r DEBUG_BLOCK; // 0x0150
13569 uint32_t unused6[11];
13570 STRUCT pmcr_r PMCR; // 0x0180
13571 STRUCT pmcntenset_r PMCNTENSET; // 0x0184
13572 STRUCT pmcntenclr_r PMCNTENCLR; // 0x0188
13573 STRUCT pmovsset_r PMOVSSET; // 0x018C
13574 STRUCT pmovsclr_r PMOVSCLR; // 0x0190
13575 STRUCT pmintset_r PMINTSET; // 0x0194
13576 STRUCT pmintclr_r PMINTCLR; // 0x0198
13577 uint32_t unused7[1];
13578 STRUCT pmccntr_r PMCCNTR; // 0x01A0
13579 STRUCT pmccntr_cfg_r PMCCNTR_CFG; // 0x01A8
13580 STRUCT pmcaxi_chan_r PMCAXI_CHAN; // 0x01AC
13581 uint32_t unused8[20];
13582 STRUCT kernel_x_r KERNEL_X; // 0x0200
13583 STRUCT kernel_y_r KERNEL_Y; // 0x0204
13584 STRUCT kernel_w_m1_r KERNEL_W_M1; // 0x0208
13585 STRUCT kernel_h_m1_r KERNEL_H_M1; // 0x020C
13586 STRUCT ofm_cblk_width_m1_r OFM_CBLK_WIDTH_M1; // 0x0210
13587 STRUCT ofm_cblk_height_m1_r OFM_CBLK_HEIGHT_M1; // 0x0214
13588 STRUCT ofm_cblk_depth_m1_r OFM_CBLK_DEPTH_M1; // 0x0218
13589 STRUCT ifm_cblk_depth_m1_r IFM_CBLK_DEPTH_M1; // 0x021C
13590 STRUCT ofm_x_r OFM_X; // 0x0220
13591 STRUCT ofm_y_r OFM_Y; // 0x0224
13592 STRUCT ofm_z_r OFM_Z; // 0x0228
13593 STRUCT ifm_z_r IFM_Z; // 0x022C
13594 STRUCT pad_top_r PAD_TOP; // 0x0230
13595 STRUCT pad_left_r PAD_LEFT; // 0x0234
13596 STRUCT ifm_cblk_width_r IFM_CBLK_WIDTH; // 0x0238
13597 STRUCT ifm_cblk_height_r IFM_CBLK_HEIGHT; // 0x023C
13598 STRUCT dma_ifm_src_r DMA_IFM_SRC; // 0x0240
13599 STRUCT dma_ifm_dst_r DMA_IFM_DST; // 0x0248
13600 STRUCT dma_ofm_src_r DMA_OFM_SRC; // 0x024C
13601 STRUCT dma_ofm_dst_r DMA_OFM_DST; // 0x0250
13602 STRUCT dma_weight_src_r DMA_WEIGHT_SRC; // 0x0258
13603 STRUCT dma_cmd_src_r DMA_CMD_SRC; // 0x0260
13604 STRUCT dma_cmd_size_r DMA_CMD_SIZE; // 0x0268
13605 STRUCT dma_m2m_src_r DMA_M2M_SRC; // 0x026C
13606 STRUCT dma_m2m_dst_r DMA_M2M_DST; // 0x0274
13607 STRUCT current_qread_r CURRENT_QREAD; // 0x027C
13608 STRUCT dma_scale_src_r DMA_SCALE_SRC; // 0x0280
13609 uint32_t unused9[11];
13610 STRUCT current_block_r CURRENT_BLOCK; // 0x02B4
13611 STRUCT current_op_r CURRENT_OP; // 0x02B8
13612 STRUCT current_cmd_r CURRENT_CMD; // 0x02BC
13613 uint32_t unused10[16];
13614 STRUCT pmevcntr_r PMEVCNTR[4]; // 0x0300
Diqing Zhong04118062020-04-15 01:19:12 +020013615 uint32_t unused11[28];
Jonny Svärd136810f2021-10-13 16:04:26 +020013616 STRUCT pmevtyper_r PMEVTYPER[4]; // 0x0380
13617 uint32_t unused12[28];
13618 STRUCT shared_buffer_r SHARED_BUFFER[256]; // 0x0400
13619 STRUCT ifm_pad_top_r IFM_PAD_TOP; // 0x0800
13620 STRUCT ifm_pad_left_r IFM_PAD_LEFT; // 0x0804
13621 STRUCT ifm_pad_right_r IFM_PAD_RIGHT; // 0x0808
13622 STRUCT ifm_pad_bottom_r IFM_PAD_BOTTOM; // 0x080C
13623 STRUCT ifm_depth_m1_r IFM_DEPTH_M1; // 0x0810
13624 STRUCT ifm_precision_r IFM_PRECISION; // 0x0814
Diqing Zhong04118062020-04-15 01:19:12 +020013625 uint32_t unused13[1];
Jonny Svärd136810f2021-10-13 16:04:26 +020013626 STRUCT ifm_upscale_r IFM_UPSCALE; // 0x081C
Diqing Zhong04118062020-04-15 01:19:12 +020013627 uint32_t unused14[1];
Jonny Svärd136810f2021-10-13 16:04:26 +020013628 STRUCT ifm_zero_point_r IFM_ZERO_POINT; // 0x0824
13629 STRUCT ifm_width0_m1_r IFM_WIDTH0_M1; // 0x0828
13630 STRUCT ifm_height0_m1_r IFM_HEIGHT0_M1; // 0x082C
13631 STRUCT ifm_height1_m1_r IFM_HEIGHT1_M1; // 0x0830
13632 STRUCT ifm_ib_end_r IFM_IB_END; // 0x0834
Diqing Zhong04118062020-04-15 01:19:12 +020013633 uint32_t unused15[1];
Jonny Svärd136810f2021-10-13 16:04:26 +020013634 STRUCT ifm_region_r IFM_REGION; // 0x083C
Diqing Zhong04118062020-04-15 01:19:12 +020013635 uint32_t unused16[1];
Jonny Svärd136810f2021-10-13 16:04:26 +020013636 STRUCT ofm_width_m1_r OFM_WIDTH_M1; // 0x0844
13637 STRUCT ofm_height_m1_r OFM_HEIGHT_M1; // 0x0848
13638 STRUCT ofm_depth_m1_r OFM_DEPTH_M1; // 0x084C
13639 STRUCT ofm_precision_r OFM_PRECISION; // 0x0850
13640 STRUCT ofm_blk_width_m1_r OFM_BLK_WIDTH_M1; // 0x0854
13641 STRUCT ofm_blk_height_m1_r OFM_BLK_HEIGHT_M1; // 0x0858
13642 STRUCT ofm_blk_depth_m1_r OFM_BLK_DEPTH_M1; // 0x085C
13643 STRUCT ofm_zero_point_r OFM_ZERO_POINT; // 0x0860
13644 uint32_t unused17[1];
13645 STRUCT ofm_width0_m1_r OFM_WIDTH0_M1; // 0x0868
13646 STRUCT ofm_height0_m1_r OFM_HEIGHT0_M1; // 0x086C
13647 STRUCT ofm_height1_m1_r OFM_HEIGHT1_M1; // 0x0870
13648 uint32_t unused18[2];
13649 STRUCT ofm_region_r OFM_REGION; // 0x087C
13650 STRUCT kernel_width_m1_r KERNEL_WIDTH_M1; // 0x0880
13651 STRUCT kernel_height_m1_r KERNEL_HEIGHT_M1; // 0x0884
13652 STRUCT kernel_stride_r KERNEL_STRIDE; // 0x0888
Diqing Zhong04118062020-04-15 01:19:12 +020013653 uint32_t unused19[1];
Jonny Svärd136810f2021-10-13 16:04:26 +020013654 STRUCT acc_format_r ACC_FORMAT; // 0x0890
13655 STRUCT activation_r ACTIVATION; // 0x0894
13656 STRUCT activation_min_r ACTIVATION_MIN; // 0x0898
13657 STRUCT activation_max_r ACTIVATION_MAX; // 0x089C
13658 STRUCT weight_region_r WEIGHT_REGION; // 0x08A0
13659 STRUCT scale_region_r SCALE_REGION; // 0x08A4
13660 uint32_t unused20[3];
13661 STRUCT ab_start_r AB_START; // 0x08B4
13662 uint32_t unused21[1];
13663 STRUCT blockdep_r BLOCKDEP; // 0x08BC
13664 STRUCT dma0_src_region_r DMA0_SRC_REGION; // 0x08C0
13665 STRUCT dma0_dst_region_r DMA0_DST_REGION; // 0x08C4
13666 STRUCT dma0_size0_r DMA0_SIZE0; // 0x08C8
13667 STRUCT dma0_size1_r DMA0_SIZE1; // 0x08CC
13668 uint32_t unused22[12];
13669 STRUCT ifm2_broadcast_r IFM2_BROADCAST; // 0x0900
13670 STRUCT ifm2_scalar_r IFM2_SCALAR; // 0x0904
13671 uint32_t unused23[3];
13672 STRUCT ifm2_precision_r IFM2_PRECISION; // 0x0914
13673 uint32_t unused24[3];
13674 STRUCT ifm2_zero_point_r IFM2_ZERO_POINT; // 0x0924
13675 STRUCT ifm2_width0_m1_r IFM2_WIDTH0_M1; // 0x0928
13676 STRUCT ifm2_height0_m1_r IFM2_HEIGHT0_M1; // 0x092C
13677 STRUCT ifm2_height1_m1_r IFM2_HEIGHT1_M1; // 0x0930
13678 STRUCT ifm2_ib_start_r IFM2_IB_START; // 0x0934
13679 uint32_t unused25[1];
13680 STRUCT ifm2_region_r IFM2_REGION; // 0x093C
13681 uint32_t unused26[48];
13682 STRUCT ifm_base0_r IFM_BASE0; // 0x0A00
13683 STRUCT ifm_base1_r IFM_BASE1; // 0x0A08
13684 STRUCT ifm_base2_r IFM_BASE2; // 0x0A10
13685 STRUCT ifm_base3_r IFM_BASE3; // 0x0A18
13686 STRUCT ifm_stride_x_r IFM_STRIDE_X; // 0x0A20
13687 STRUCT ifm_stride_y_r IFM_STRIDE_Y; // 0x0A28
13688 STRUCT ifm_stride_c_r IFM_STRIDE_C; // 0x0A30
13689 uint32_t unused27[2];
13690 STRUCT ofm_base0_r OFM_BASE0; // 0x0A40
13691 STRUCT ofm_base1_r OFM_BASE1; // 0x0A48
13692 STRUCT ofm_base2_r OFM_BASE2; // 0x0A50
13693 STRUCT ofm_base3_r OFM_BASE3; // 0x0A58
13694 STRUCT ofm_stride_x_r OFM_STRIDE_X; // 0x0A60
13695 STRUCT ofm_stride_y_r OFM_STRIDE_Y; // 0x0A68
13696 STRUCT ofm_stride_c_r OFM_STRIDE_C; // 0x0A70
13697 uint32_t unused28[2];
13698 STRUCT weight_base_r WEIGHT_BASE; // 0x0A80
13699 STRUCT weight_length_r WEIGHT_LENGTH; // 0x0A88
13700 uint32_t unused29[1];
13701 STRUCT scale_base_r SCALE_BASE; // 0x0A90
13702 STRUCT scale_length_r SCALE_LENGTH; // 0x0A98
13703 uint32_t unused30[1];
13704 STRUCT ofm_scale_r OFM_SCALE; // 0x0AA0
13705 STRUCT ofm_scale_shift_r OFM_SCALE_SHIFT; // 0x0AA4
13706 STRUCT opa_scale_r OPA_SCALE; // 0x0AA8
13707 STRUCT opa_scale_shift_r OPA_SCALE_SHIFT; // 0x0AAC
13708 STRUCT opb_scale_r OPB_SCALE; // 0x0AB0
13709 uint32_t unused31[3];
13710 STRUCT dma0_src_r DMA0_SRC; // 0x0AC0
13711 STRUCT dma0_dst_r DMA0_DST; // 0x0AC8
13712 STRUCT dma0_len_r DMA0_LEN; // 0x0AD0
13713 uint32_t unused32[10];
13714 STRUCT ifm2_base0_r IFM2_BASE0; // 0x0B00
13715 STRUCT ifm2_base1_r IFM2_BASE1; // 0x0B08
13716 STRUCT ifm2_base2_r IFM2_BASE2; // 0x0B10
13717 STRUCT ifm2_base3_r IFM2_BASE3; // 0x0B18
13718 STRUCT ifm2_stride_x_r IFM2_STRIDE_X; // 0x0B20
13719 STRUCT ifm2_stride_y_r IFM2_STRIDE_Y; // 0x0B28
13720 STRUCT ifm2_stride_c_r IFM2_STRIDE_C; // 0x0B30
13721 uint32_t unused33[18];
13722 uint32_t USER_DEFINED[16]; // 0x0B80
13723 uint32_t unused34[256];
13724 STRUCT revision_r REVISION; // 0x0FC0
13725 uint32_t unused35[3];
13726 STRUCT pid4_r PID4; // 0x0FD0
13727 STRUCT pid5_r PID5; // 0x0FD4
13728 STRUCT pid6_r PID6; // 0x0FD8
13729 STRUCT pid7_r PID7; // 0x0FDC
13730 STRUCT pid0_r PID0; // 0x0FE0
13731 STRUCT pid1_r PID1; // 0x0FE4
13732 STRUCT pid2_r PID2; // 0x0FE8
13733 STRUCT pid3_r PID3; // 0x0FEC
13734 STRUCT cid0_r CID0; // 0x0FF0
13735 STRUCT cid1_r CID1; // 0x0FF4
13736 STRUCT cid2_r CID2; // 0x0FF8
13737 STRUCT cid3_r CID3; // 0x0FFC
13738
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020013739#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020013740 enum class access_type_t : uint8_t
13741 {
13742 RW,
13743 RO,
13744 WO
13745 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020013746 NPU_REG()
13747 {
13748 reset();
13749 }
13750 void reset()
13751 {
Jonny Svärd136810f2021-10-13 16:04:26 +020013752 ID = 269500929;
13753 STATUS = 8;
13754 CMD = 12;
13755 RESET = 0;
13756 QBASE = 0;
13757 QREAD = 0;
13758 QCONFIG = 0;
13759 QSIZE = 0;
13760 PROT = 0;
13761 CONFIG = 0;
13762 LOCK = 0;
13763 REGIONCFG = 0;
13764 AXI_LIMIT0 = 0;
13765 AXI_LIMIT1 = 0;
13766 AXI_LIMIT2 = 0;
13767 AXI_LIMIT3 = 0;
13768 for (size_t i = 0; i < (sizeof(BASEP) / sizeof(BASEP[0])); ++i)
13769 BASEP[i] = 0;
Diqing Zhong04118062020-04-15 01:19:12 +020013770 WD_STATUS = 0;
13771 MAC_STATUS = 0;
Diqing Zhong04118062020-04-15 01:19:12 +020013772 AO_STATUS = 0;
Douglas Trohaf6a85da2020-05-11 11:45:28 +020013773 DMA_STATUS0 = 0;
13774 DMA_STATUS1 = 0;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020013775 CLKFORCE = 0;
Douglas Troha2e7e3b72020-05-14 20:28:31 +020013776 DEBUG_ADDRESS = 0;
Douglas Trohaf6a85da2020-05-11 11:45:28 +020013777 DEBUG_MISC = 0;
Stefan Nannessone2e70242020-08-19 16:01:29 +020013778 DEBUG_BLOCK = 0;
Jonny Svärd136810f2021-10-13 16:04:26 +020013779 PMCR = 8192;
13780 PMCNTENSET = 0;
13781 PMCNTENCLR = 0;
13782 PMOVSSET = 0;
13783 PMOVSCLR = 0;
13784 PMINTSET = 0;
13785 PMINTCLR = 0;
13786 PMCCNTR = 0;
13787 PMCCNTR_CFG = 0;
13788 PMCAXI_CHAN = 0;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020013789 KERNEL_X = 0;
13790 KERNEL_Y = 0;
13791 KERNEL_W_M1 = 0;
13792 KERNEL_H_M1 = 0;
13793 OFM_CBLK_WIDTH_M1 = 0;
13794 OFM_CBLK_HEIGHT_M1 = 0;
13795 OFM_CBLK_DEPTH_M1 = 0;
13796 IFM_CBLK_DEPTH_M1 = 0;
13797 OFM_X = 0;
13798 OFM_Y = 0;
13799 OFM_Z = 0;
13800 IFM_Z = 0;
13801 PAD_TOP = 0;
13802 PAD_LEFT = 0;
13803 IFM_CBLK_WIDTH = 0;
13804 IFM_CBLK_HEIGHT = 0;
13805 DMA_IFM_SRC = 0;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020013806 DMA_IFM_DST = 0;
13807 DMA_OFM_SRC = 0;
13808 DMA_OFM_DST = 0;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020013809 DMA_WEIGHT_SRC = 0;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020013810 DMA_CMD_SRC = 0;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020013811 DMA_CMD_SIZE = 0;
13812 DMA_M2M_SRC = 0;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020013813 DMA_M2M_DST = 0;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020013814 CURRENT_QREAD = 0;
13815 DMA_SCALE_SRC = 0;
Stefan Nannessone2e70242020-08-19 16:01:29 +020013816 CURRENT_BLOCK = 0;
13817 CURRENT_OP = 0;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020013818 CURRENT_CMD = 0;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020013819 for (size_t i = 0; i < (sizeof(PMEVCNTR) / sizeof(PMEVCNTR[0])); ++i)
13820 PMEVCNTR[i] = 0;
13821 for (size_t i = 0; i < (sizeof(PMEVTYPER) / sizeof(PMEVTYPER[0])); ++i)
13822 PMEVTYPER[i] = 0;
13823 for (size_t i = 0; i < (sizeof(SHARED_BUFFER) / sizeof(SHARED_BUFFER[0])); ++i)
13824 SHARED_BUFFER[i] = 0;
Jonny Svärd136810f2021-10-13 16:04:26 +020013825 IFM_PAD_TOP = 0;
13826 IFM_PAD_LEFT = 0;
13827 IFM_PAD_RIGHT = 0;
13828 IFM_PAD_BOTTOM = 0;
13829 IFM_DEPTH_M1 = 0;
13830 IFM_PRECISION = 0;
13831 IFM_UPSCALE = 0;
13832 IFM_ZERO_POINT = 0;
13833 IFM_WIDTH0_M1 = 0;
13834 IFM_HEIGHT0_M1 = 0;
13835 IFM_HEIGHT1_M1 = 0;
13836 IFM_IB_END = 0;
13837 IFM_REGION = 0;
13838 OFM_WIDTH_M1 = 0;
13839 OFM_HEIGHT_M1 = 0;
13840 OFM_DEPTH_M1 = 0;
13841 OFM_PRECISION = 0;
13842 OFM_BLK_WIDTH_M1 = 0;
13843 OFM_BLK_HEIGHT_M1 = 0;
13844 OFM_BLK_DEPTH_M1 = 0;
13845 OFM_ZERO_POINT = 0;
13846 OFM_WIDTH0_M1 = 0;
13847 OFM_HEIGHT0_M1 = 0;
13848 OFM_HEIGHT1_M1 = 0;
13849 OFM_REGION = 0;
13850 KERNEL_WIDTH_M1 = 0;
13851 KERNEL_HEIGHT_M1 = 0;
13852 KERNEL_STRIDE = 0;
13853 ACC_FORMAT = 0;
13854 ACTIVATION = 0;
13855 ACTIVATION_MIN = 0;
13856 ACTIVATION_MAX = 0;
13857 WEIGHT_REGION = 0;
13858 SCALE_REGION = 0;
13859 AB_START = 0;
13860 BLOCKDEP = 0;
13861 DMA0_SRC_REGION = 0;
13862 DMA0_DST_REGION = 0;
13863 DMA0_SIZE0 = 0;
13864 DMA0_SIZE1 = 0;
13865 IFM2_BROADCAST = 0;
13866 IFM2_SCALAR = 0;
13867 IFM2_PRECISION = 0;
13868 IFM2_ZERO_POINT = 0;
13869 IFM2_WIDTH0_M1 = 0;
13870 IFM2_HEIGHT0_M1 = 0;
13871 IFM2_HEIGHT1_M1 = 0;
13872 IFM2_IB_START = 0;
13873 IFM2_REGION = 0;
13874 IFM_BASE0 = 0;
13875 IFM_BASE1 = 0;
13876 IFM_BASE2 = 0;
13877 IFM_BASE3 = 0;
13878 IFM_STRIDE_X = 0;
13879 IFM_STRIDE_Y = 0;
13880 IFM_STRIDE_C = 0;
13881 OFM_BASE0 = 0;
13882 OFM_BASE1 = 0;
13883 OFM_BASE2 = 0;
13884 OFM_BASE3 = 0;
13885 OFM_STRIDE_X = 0;
13886 OFM_STRIDE_Y = 0;
13887 OFM_STRIDE_C = 0;
13888 WEIGHT_BASE = 0;
13889 WEIGHT_LENGTH = 0;
13890 SCALE_BASE = 0;
13891 SCALE_LENGTH = 0;
13892 OFM_SCALE = 0;
13893 OFM_SCALE_SHIFT = 0;
13894 OPA_SCALE = 0;
13895 OPA_SCALE_SHIFT = 0;
13896 OPB_SCALE = 0;
13897 DMA0_SRC = 0;
13898 DMA0_DST = 0;
13899 DMA0_LEN = 0;
13900 IFM2_BASE0 = 0;
13901 IFM2_BASE1 = 0;
13902 IFM2_BASE2 = 0;
13903 IFM2_BASE3 = 0;
13904 IFM2_STRIDE_X = 0;
13905 IFM2_STRIDE_Y = 0;
13906 IFM2_STRIDE_C = 0;
13907 for (size_t i = 0; i < (sizeof(USER_DEFINED) / sizeof(USER_DEFINED[0])); ++i)
13908 USER_DEFINED[i] = 0;
13909 REVISION = 0;
13910 PID4 = 4;
13911 PID5 = 0;
13912 PID6 = 0;
13913 PID7 = 0;
13914 PID0 = 128;
13915 PID1 = 181;
13916 PID2 = 11;
13917 PID3 = 0;
13918 CID0 = 13;
13919 CID1 = 240;
13920 CID2 = 5;
13921 CID3 = 177;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020013922 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020013923 uint32_t &operator[](const int addr_offset)
13924 {
13925 return reinterpret_cast<uint32_t *>(this)[addr_offset / 4];
13926 }
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020013927 access_type_t get_access_type(uint32_t offset)
13928 {
13929 switch (offset)
13930 {
13931 case 0:
13932 return access_type_t::RO;
13933 case 4:
13934 return access_type_t::RO;
13935 case 8:
13936 return access_type_t::RW;
13937 case 12:
13938 return access_type_t::RW;
13939 case 16:
13940 return access_type_t::RW;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020013941 case 24:
13942 return access_type_t::RO;
13943 case 28:
13944 return access_type_t::RW;
13945 case 32:
13946 return access_type_t::RW;
13947 case 36:
13948 return access_type_t::RO;
13949 case 40:
13950 return access_type_t::RO;
13951 case 44:
13952 return access_type_t::RW;
13953 case 60:
13954 return access_type_t::RW;
13955 case 64:
13956 return access_type_t::RW;
13957 case 68:
13958 return access_type_t::RW;
13959 case 72:
13960 return access_type_t::RW;
13961 case 76:
13962 return access_type_t::RW;
13963 case 128:
13964 return access_type_t::RW;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020013965 case 136:
13966 return access_type_t::RW;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020013967 case 144:
13968 return access_type_t::RW;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020013969 case 152:
13970 return access_type_t::RW;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020013971 case 160:
13972 return access_type_t::RW;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020013973 case 168:
13974 return access_type_t::RW;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020013975 case 176:
13976 return access_type_t::RW;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020013977 case 184:
13978 return access_type_t::RW;
Diqing Zhong04118062020-04-15 01:19:12 +020013979 case 256:
13980 return access_type_t::RO;
13981 case 260:
13982 return access_type_t::RO;
13983 case 264:
13984 return access_type_t::RO;
13985 case 272:
13986 return access_type_t::RO;
Douglas Trohaf6a85da2020-05-11 11:45:28 +020013987 case 276:
13988 return access_type_t::RO;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020013989 case 320:
13990 return access_type_t::RW;
13991 case 324:
13992 return access_type_t::RW;
13993 case 328:
13994 return access_type_t::RW;
Stefan Nannessone2e70242020-08-19 16:01:29 +020013995 case 336:
13996 return access_type_t::RW;
Jonny Svärd136810f2021-10-13 16:04:26 +020013997 case 384:
13998 return access_type_t::RW;
13999 case 388:
14000 return access_type_t::RW;
14001 case 392:
14002 return access_type_t::RW;
14003 case 396:
14004 return access_type_t::RW;
14005 case 400:
14006 return access_type_t::RW;
14007 case 404:
14008 return access_type_t::RW;
14009 case 408:
14010 return access_type_t::RW;
14011 case 416:
14012 return access_type_t::RW;
14013 case 424:
14014 return access_type_t::RW;
14015 case 428:
14016 return access_type_t::RW;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020014017 case 512:
14018 return access_type_t::RO;
14019 case 516:
14020 return access_type_t::RO;
14021 case 520:
14022 return access_type_t::RO;
14023 case 524:
14024 return access_type_t::RO;
14025 case 528:
14026 return access_type_t::RO;
14027 case 532:
14028 return access_type_t::RO;
14029 case 536:
14030 return access_type_t::RO;
14031 case 540:
14032 return access_type_t::RO;
14033 case 544:
14034 return access_type_t::RO;
14035 case 548:
14036 return access_type_t::RO;
14037 case 552:
14038 return access_type_t::RO;
14039 case 556:
14040 return access_type_t::RO;
14041 case 560:
14042 return access_type_t::RO;
14043 case 564:
14044 return access_type_t::RO;
14045 case 568:
14046 return access_type_t::RO;
14047 case 572:
14048 return access_type_t::RO;
14049 case 576:
14050 return access_type_t::RO;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020014051 case 584:
14052 return access_type_t::RO;
14053 case 588:
14054 return access_type_t::RO;
14055 case 592:
14056 return access_type_t::RO;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020014057 case 600:
14058 return access_type_t::RO;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020014059 case 608:
14060 return access_type_t::RO;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020014061 case 616:
14062 return access_type_t::RO;
14063 case 620:
14064 return access_type_t::RO;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020014065 case 628:
14066 return access_type_t::RO;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020014067 case 636:
14068 return access_type_t::RO;
14069 case 640:
14070 return access_type_t::RO;
Stefan Nannessone2e70242020-08-19 16:01:29 +020014071 case 692:
14072 return access_type_t::RO;
14073 case 696:
14074 return access_type_t::RO;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020014075 case 700:
14076 return access_type_t::RO;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020014077 case 768:
14078 return access_type_t::RW;
14079 case 772:
14080 return access_type_t::RW;
14081 case 776:
14082 return access_type_t::RW;
14083 case 780:
14084 return access_type_t::RW;
14085 case 896:
14086 return access_type_t::RW;
14087 case 900:
14088 return access_type_t::RW;
14089 case 904:
14090 return access_type_t::RW;
14091 case 908:
14092 return access_type_t::RW;
14093 case 1024:
14094 return access_type_t::RW;
14095 case 1028:
14096 return access_type_t::RW;
14097 case 1032:
14098 return access_type_t::RW;
14099 case 1036:
14100 return access_type_t::RW;
14101 case 1040:
14102 return access_type_t::RW;
14103 case 1044:
14104 return access_type_t::RW;
14105 case 1048:
14106 return access_type_t::RW;
14107 case 1052:
14108 return access_type_t::RW;
14109 case 1056:
14110 return access_type_t::RW;
14111 case 1060:
14112 return access_type_t::RW;
14113 case 1064:
14114 return access_type_t::RW;
14115 case 1068:
14116 return access_type_t::RW;
14117 case 1072:
14118 return access_type_t::RW;
14119 case 1076:
14120 return access_type_t::RW;
14121 case 1080:
14122 return access_type_t::RW;
14123 case 1084:
14124 return access_type_t::RW;
14125 case 1088:
14126 return access_type_t::RW;
14127 case 1092:
14128 return access_type_t::RW;
14129 case 1096:
14130 return access_type_t::RW;
14131 case 1100:
14132 return access_type_t::RW;
14133 case 1104:
14134 return access_type_t::RW;
14135 case 1108:
14136 return access_type_t::RW;
14137 case 1112:
14138 return access_type_t::RW;
14139 case 1116:
14140 return access_type_t::RW;
14141 case 1120:
14142 return access_type_t::RW;
14143 case 1124:
14144 return access_type_t::RW;
14145 case 1128:
14146 return access_type_t::RW;
14147 case 1132:
14148 return access_type_t::RW;
14149 case 1136:
14150 return access_type_t::RW;
14151 case 1140:
14152 return access_type_t::RW;
14153 case 1144:
14154 return access_type_t::RW;
14155 case 1148:
14156 return access_type_t::RW;
14157 case 1152:
14158 return access_type_t::RW;
14159 case 1156:
14160 return access_type_t::RW;
14161 case 1160:
14162 return access_type_t::RW;
14163 case 1164:
14164 return access_type_t::RW;
14165 case 1168:
14166 return access_type_t::RW;
14167 case 1172:
14168 return access_type_t::RW;
14169 case 1176:
14170 return access_type_t::RW;
14171 case 1180:
14172 return access_type_t::RW;
14173 case 1184:
14174 return access_type_t::RW;
14175 case 1188:
14176 return access_type_t::RW;
14177 case 1192:
14178 return access_type_t::RW;
14179 case 1196:
14180 return access_type_t::RW;
14181 case 1200:
14182 return access_type_t::RW;
14183 case 1204:
14184 return access_type_t::RW;
14185 case 1208:
14186 return access_type_t::RW;
14187 case 1212:
14188 return access_type_t::RW;
14189 case 1216:
14190 return access_type_t::RW;
14191 case 1220:
14192 return access_type_t::RW;
14193 case 1224:
14194 return access_type_t::RW;
14195 case 1228:
14196 return access_type_t::RW;
14197 case 1232:
14198 return access_type_t::RW;
14199 case 1236:
14200 return access_type_t::RW;
14201 case 1240:
14202 return access_type_t::RW;
14203 case 1244:
14204 return access_type_t::RW;
14205 case 1248:
14206 return access_type_t::RW;
14207 case 1252:
14208 return access_type_t::RW;
14209 case 1256:
14210 return access_type_t::RW;
14211 case 1260:
14212 return access_type_t::RW;
14213 case 1264:
14214 return access_type_t::RW;
14215 case 1268:
14216 return access_type_t::RW;
14217 case 1272:
14218 return access_type_t::RW;
14219 case 1276:
14220 return access_type_t::RW;
14221 case 1280:
14222 return access_type_t::RW;
14223 case 1284:
14224 return access_type_t::RW;
14225 case 1288:
14226 return access_type_t::RW;
14227 case 1292:
14228 return access_type_t::RW;
14229 case 1296:
14230 return access_type_t::RW;
14231 case 1300:
14232 return access_type_t::RW;
14233 case 1304:
14234 return access_type_t::RW;
14235 case 1308:
14236 return access_type_t::RW;
14237 case 1312:
14238 return access_type_t::RW;
14239 case 1316:
14240 return access_type_t::RW;
14241 case 1320:
14242 return access_type_t::RW;
14243 case 1324:
14244 return access_type_t::RW;
14245 case 1328:
14246 return access_type_t::RW;
14247 case 1332:
14248 return access_type_t::RW;
14249 case 1336:
14250 return access_type_t::RW;
14251 case 1340:
14252 return access_type_t::RW;
14253 case 1344:
14254 return access_type_t::RW;
14255 case 1348:
14256 return access_type_t::RW;
14257 case 1352:
14258 return access_type_t::RW;
14259 case 1356:
14260 return access_type_t::RW;
14261 case 1360:
14262 return access_type_t::RW;
14263 case 1364:
14264 return access_type_t::RW;
14265 case 1368:
14266 return access_type_t::RW;
14267 case 1372:
14268 return access_type_t::RW;
14269 case 1376:
14270 return access_type_t::RW;
14271 case 1380:
14272 return access_type_t::RW;
14273 case 1384:
14274 return access_type_t::RW;
14275 case 1388:
14276 return access_type_t::RW;
14277 case 1392:
14278 return access_type_t::RW;
14279 case 1396:
14280 return access_type_t::RW;
14281 case 1400:
14282 return access_type_t::RW;
14283 case 1404:
14284 return access_type_t::RW;
14285 case 1408:
14286 return access_type_t::RW;
14287 case 1412:
14288 return access_type_t::RW;
14289 case 1416:
14290 return access_type_t::RW;
14291 case 1420:
14292 return access_type_t::RW;
14293 case 1424:
14294 return access_type_t::RW;
14295 case 1428:
14296 return access_type_t::RW;
14297 case 1432:
14298 return access_type_t::RW;
14299 case 1436:
14300 return access_type_t::RW;
14301 case 1440:
14302 return access_type_t::RW;
14303 case 1444:
14304 return access_type_t::RW;
14305 case 1448:
14306 return access_type_t::RW;
14307 case 1452:
14308 return access_type_t::RW;
14309 case 1456:
14310 return access_type_t::RW;
14311 case 1460:
14312 return access_type_t::RW;
14313 case 1464:
14314 return access_type_t::RW;
14315 case 1468:
14316 return access_type_t::RW;
14317 case 1472:
14318 return access_type_t::RW;
14319 case 1476:
14320 return access_type_t::RW;
14321 case 1480:
14322 return access_type_t::RW;
14323 case 1484:
14324 return access_type_t::RW;
14325 case 1488:
14326 return access_type_t::RW;
14327 case 1492:
14328 return access_type_t::RW;
14329 case 1496:
14330 return access_type_t::RW;
14331 case 1500:
14332 return access_type_t::RW;
14333 case 1504:
14334 return access_type_t::RW;
14335 case 1508:
14336 return access_type_t::RW;
14337 case 1512:
14338 return access_type_t::RW;
14339 case 1516:
14340 return access_type_t::RW;
14341 case 1520:
14342 return access_type_t::RW;
14343 case 1524:
14344 return access_type_t::RW;
14345 case 1528:
14346 return access_type_t::RW;
14347 case 1532:
14348 return access_type_t::RW;
14349 case 1536:
14350 return access_type_t::RW;
14351 case 1540:
14352 return access_type_t::RW;
14353 case 1544:
14354 return access_type_t::RW;
14355 case 1548:
14356 return access_type_t::RW;
14357 case 1552:
14358 return access_type_t::RW;
14359 case 1556:
14360 return access_type_t::RW;
14361 case 1560:
14362 return access_type_t::RW;
14363 case 1564:
14364 return access_type_t::RW;
14365 case 1568:
14366 return access_type_t::RW;
14367 case 1572:
14368 return access_type_t::RW;
14369 case 1576:
14370 return access_type_t::RW;
14371 case 1580:
14372 return access_type_t::RW;
14373 case 1584:
14374 return access_type_t::RW;
14375 case 1588:
14376 return access_type_t::RW;
14377 case 1592:
14378 return access_type_t::RW;
14379 case 1596:
14380 return access_type_t::RW;
14381 case 1600:
14382 return access_type_t::RW;
14383 case 1604:
14384 return access_type_t::RW;
14385 case 1608:
14386 return access_type_t::RW;
14387 case 1612:
14388 return access_type_t::RW;
14389 case 1616:
14390 return access_type_t::RW;
14391 case 1620:
14392 return access_type_t::RW;
14393 case 1624:
14394 return access_type_t::RW;
14395 case 1628:
14396 return access_type_t::RW;
14397 case 1632:
14398 return access_type_t::RW;
14399 case 1636:
14400 return access_type_t::RW;
14401 case 1640:
14402 return access_type_t::RW;
14403 case 1644:
14404 return access_type_t::RW;
14405 case 1648:
14406 return access_type_t::RW;
14407 case 1652:
14408 return access_type_t::RW;
14409 case 1656:
14410 return access_type_t::RW;
14411 case 1660:
14412 return access_type_t::RW;
14413 case 1664:
14414 return access_type_t::RW;
14415 case 1668:
14416 return access_type_t::RW;
14417 case 1672:
14418 return access_type_t::RW;
14419 case 1676:
14420 return access_type_t::RW;
14421 case 1680:
14422 return access_type_t::RW;
14423 case 1684:
14424 return access_type_t::RW;
14425 case 1688:
14426 return access_type_t::RW;
14427 case 1692:
14428 return access_type_t::RW;
14429 case 1696:
14430 return access_type_t::RW;
14431 case 1700:
14432 return access_type_t::RW;
14433 case 1704:
14434 return access_type_t::RW;
14435 case 1708:
14436 return access_type_t::RW;
14437 case 1712:
14438 return access_type_t::RW;
14439 case 1716:
14440 return access_type_t::RW;
14441 case 1720:
14442 return access_type_t::RW;
14443 case 1724:
14444 return access_type_t::RW;
14445 case 1728:
14446 return access_type_t::RW;
14447 case 1732:
14448 return access_type_t::RW;
14449 case 1736:
14450 return access_type_t::RW;
14451 case 1740:
14452 return access_type_t::RW;
14453 case 1744:
14454 return access_type_t::RW;
14455 case 1748:
14456 return access_type_t::RW;
14457 case 1752:
14458 return access_type_t::RW;
14459 case 1756:
14460 return access_type_t::RW;
14461 case 1760:
14462 return access_type_t::RW;
14463 case 1764:
14464 return access_type_t::RW;
14465 case 1768:
14466 return access_type_t::RW;
14467 case 1772:
14468 return access_type_t::RW;
14469 case 1776:
14470 return access_type_t::RW;
14471 case 1780:
14472 return access_type_t::RW;
14473 case 1784:
14474 return access_type_t::RW;
14475 case 1788:
14476 return access_type_t::RW;
14477 case 1792:
14478 return access_type_t::RW;
14479 case 1796:
14480 return access_type_t::RW;
14481 case 1800:
14482 return access_type_t::RW;
14483 case 1804:
14484 return access_type_t::RW;
14485 case 1808:
14486 return access_type_t::RW;
14487 case 1812:
14488 return access_type_t::RW;
14489 case 1816:
14490 return access_type_t::RW;
14491 case 1820:
14492 return access_type_t::RW;
14493 case 1824:
14494 return access_type_t::RW;
14495 case 1828:
14496 return access_type_t::RW;
14497 case 1832:
14498 return access_type_t::RW;
14499 case 1836:
14500 return access_type_t::RW;
14501 case 1840:
14502 return access_type_t::RW;
14503 case 1844:
14504 return access_type_t::RW;
14505 case 1848:
14506 return access_type_t::RW;
14507 case 1852:
14508 return access_type_t::RW;
14509 case 1856:
14510 return access_type_t::RW;
14511 case 1860:
14512 return access_type_t::RW;
14513 case 1864:
14514 return access_type_t::RW;
14515 case 1868:
14516 return access_type_t::RW;
14517 case 1872:
14518 return access_type_t::RW;
14519 case 1876:
14520 return access_type_t::RW;
14521 case 1880:
14522 return access_type_t::RW;
14523 case 1884:
14524 return access_type_t::RW;
14525 case 1888:
14526 return access_type_t::RW;
14527 case 1892:
14528 return access_type_t::RW;
14529 case 1896:
14530 return access_type_t::RW;
14531 case 1900:
14532 return access_type_t::RW;
14533 case 1904:
14534 return access_type_t::RW;
14535 case 1908:
14536 return access_type_t::RW;
14537 case 1912:
14538 return access_type_t::RW;
14539 case 1916:
14540 return access_type_t::RW;
14541 case 1920:
14542 return access_type_t::RW;
14543 case 1924:
14544 return access_type_t::RW;
14545 case 1928:
14546 return access_type_t::RW;
14547 case 1932:
14548 return access_type_t::RW;
14549 case 1936:
14550 return access_type_t::RW;
14551 case 1940:
14552 return access_type_t::RW;
14553 case 1944:
14554 return access_type_t::RW;
14555 case 1948:
14556 return access_type_t::RW;
14557 case 1952:
14558 return access_type_t::RW;
14559 case 1956:
14560 return access_type_t::RW;
14561 case 1960:
14562 return access_type_t::RW;
14563 case 1964:
14564 return access_type_t::RW;
14565 case 1968:
14566 return access_type_t::RW;
14567 case 1972:
14568 return access_type_t::RW;
14569 case 1976:
14570 return access_type_t::RW;
14571 case 1980:
14572 return access_type_t::RW;
14573 case 1984:
14574 return access_type_t::RW;
14575 case 1988:
14576 return access_type_t::RW;
14577 case 1992:
14578 return access_type_t::RW;
14579 case 1996:
14580 return access_type_t::RW;
14581 case 2000:
14582 return access_type_t::RW;
14583 case 2004:
14584 return access_type_t::RW;
14585 case 2008:
14586 return access_type_t::RW;
14587 case 2012:
14588 return access_type_t::RW;
14589 case 2016:
14590 return access_type_t::RW;
14591 case 2020:
14592 return access_type_t::RW;
14593 case 2024:
14594 return access_type_t::RW;
14595 case 2028:
14596 return access_type_t::RW;
14597 case 2032:
14598 return access_type_t::RW;
14599 case 2036:
14600 return access_type_t::RW;
14601 case 2040:
14602 return access_type_t::RW;
14603 case 2044:
14604 return access_type_t::RW;
Jonny Svärd136810f2021-10-13 16:04:26 +020014605 case 2048:
14606 return access_type_t::RW;
14607 case 2052:
14608 return access_type_t::RW;
14609 case 2056:
14610 return access_type_t::RW;
14611 case 2060:
14612 return access_type_t::RW;
14613 case 2064:
14614 return access_type_t::RW;
14615 case 2068:
14616 return access_type_t::RW;
14617 case 2076:
14618 return access_type_t::RW;
14619 case 2084:
14620 return access_type_t::RW;
14621 case 2088:
14622 return access_type_t::RW;
14623 case 2092:
14624 return access_type_t::RW;
14625 case 2096:
14626 return access_type_t::RW;
14627 case 2100:
14628 return access_type_t::RW;
14629 case 2108:
14630 return access_type_t::RW;
14631 case 2116:
14632 return access_type_t::RW;
14633 case 2120:
14634 return access_type_t::RW;
14635 case 2124:
14636 return access_type_t::RW;
14637 case 2128:
14638 return access_type_t::RW;
14639 case 2132:
14640 return access_type_t::RW;
14641 case 2136:
14642 return access_type_t::RW;
14643 case 2140:
14644 return access_type_t::RW;
14645 case 2144:
14646 return access_type_t::RW;
14647 case 2152:
14648 return access_type_t::RW;
14649 case 2156:
14650 return access_type_t::RW;
14651 case 2160:
14652 return access_type_t::RW;
14653 case 2172:
14654 return access_type_t::RW;
14655 case 2176:
14656 return access_type_t::RW;
14657 case 2180:
14658 return access_type_t::RW;
14659 case 2184:
14660 return access_type_t::RW;
14661 case 2192:
14662 return access_type_t::RW;
14663 case 2196:
14664 return access_type_t::RW;
14665 case 2200:
14666 return access_type_t::RW;
14667 case 2204:
14668 return access_type_t::RW;
14669 case 2208:
14670 return access_type_t::RW;
14671 case 2212:
14672 return access_type_t::RW;
14673 case 2228:
14674 return access_type_t::RW;
14675 case 2236:
14676 return access_type_t::RW;
14677 case 2240:
14678 return access_type_t::RW;
14679 case 2244:
14680 return access_type_t::RW;
14681 case 2248:
14682 return access_type_t::RW;
14683 case 2252:
14684 return access_type_t::RW;
14685 case 2304:
14686 return access_type_t::RW;
14687 case 2308:
14688 return access_type_t::RW;
14689 case 2324:
14690 return access_type_t::RW;
14691 case 2340:
14692 return access_type_t::RW;
14693 case 2344:
14694 return access_type_t::RW;
14695 case 2348:
14696 return access_type_t::RW;
14697 case 2352:
14698 return access_type_t::RW;
14699 case 2356:
14700 return access_type_t::RW;
14701 case 2364:
14702 return access_type_t::RW;
14703 case 2560:
14704 return access_type_t::RW;
14705 case 2568:
14706 return access_type_t::RW;
14707 case 2576:
14708 return access_type_t::RW;
14709 case 2584:
14710 return access_type_t::RW;
14711 case 2592:
14712 return access_type_t::RW;
14713 case 2600:
14714 return access_type_t::RW;
14715 case 2608:
14716 return access_type_t::RW;
14717 case 2624:
14718 return access_type_t::RW;
14719 case 2632:
14720 return access_type_t::RW;
14721 case 2640:
14722 return access_type_t::RW;
14723 case 2648:
14724 return access_type_t::RW;
14725 case 2656:
14726 return access_type_t::RW;
14727 case 2664:
14728 return access_type_t::RW;
14729 case 2672:
14730 return access_type_t::RW;
14731 case 2688:
14732 return access_type_t::RW;
14733 case 2696:
14734 return access_type_t::RW;
14735 case 2704:
14736 return access_type_t::RW;
14737 case 2712:
14738 return access_type_t::RW;
14739 case 2720:
14740 return access_type_t::RW;
14741 case 2724:
14742 return access_type_t::RW;
14743 case 2728:
14744 return access_type_t::RW;
14745 case 2732:
14746 return access_type_t::RW;
14747 case 2736:
14748 return access_type_t::RW;
14749 case 2752:
14750 return access_type_t::RW;
14751 case 2760:
14752 return access_type_t::RW;
14753 case 2768:
14754 return access_type_t::RW;
14755 case 2816:
14756 return access_type_t::RW;
14757 case 2824:
14758 return access_type_t::RW;
14759 case 2832:
14760 return access_type_t::RW;
14761 case 2840:
14762 return access_type_t::RW;
14763 case 2848:
14764 return access_type_t::RW;
14765 case 2856:
14766 return access_type_t::RW;
14767 case 2864:
14768 return access_type_t::RW;
14769 case 2944:
14770 return access_type_t::RW;
14771 case 2952:
14772 return access_type_t::RW;
14773 case 2960:
14774 return access_type_t::RW;
14775 case 2968:
14776 return access_type_t::RW;
14777 case 2976:
14778 return access_type_t::RW;
14779 case 2984:
14780 return access_type_t::RW;
14781 case 2992:
14782 return access_type_t::RW;
14783 case 3000:
14784 return access_type_t::RW;
14785 case 4032:
14786 return access_type_t::RO;
14787 case 4048:
14788 return access_type_t::RO;
14789 case 4052:
14790 return access_type_t::RO;
14791 case 4056:
14792 return access_type_t::RO;
14793 case 4060:
14794 return access_type_t::RO;
14795 case 4064:
14796 return access_type_t::RO;
14797 case 4068:
14798 return access_type_t::RO;
14799 case 4072:
14800 return access_type_t::RO;
14801 case 4076:
14802 return access_type_t::RO;
14803 case 4080:
14804 return access_type_t::RO;
14805 case 4084:
14806 return access_type_t::RO;
14807 case 4088:
14808 return access_type_t::RO;
14809 case 4092:
14810 return access_type_t::RO;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020014811 default:
Jonny Svärd136810f2021-10-13 16:04:26 +020014812 return access_type_t::RO;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020014813 }
14814 }
Jonny Svärd136810f2021-10-13 16:04:26 +020014815#endif
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020014816};
14817
Jonny Svärd136810f2021-10-13 16:04:26 +020014818#ifdef __cplusplus
14819struct isa
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020014820{
Jonny Svärd136810f2021-10-13 16:04:26 +020014821#ifdef NPU_DISASSEMBLE
14822 static int disassemble(const uint32_t *in,
14823 std::string &op,
14824 std::vector<std::pair<std::string, std::string>> &fields)
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020014825 {
Jonny Svärd136810f2021-10-13 16:04:26 +020014826 switch (*in & 0xffff)
14827 {
14828 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) |
14829 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_STOP):
14830 {
14831 const npu_op_stop_t &v = *reinterpret_cast<const npu_op_stop_t *>(in);
14832 op = "NPU_OP_STOP";
14833 v.disassemble(fields);
14834 break;
14835 }
14836 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) |
14837 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_IRQ):
14838 {
14839 const npu_op_irq_t &v = *reinterpret_cast<const npu_op_irq_t *>(in);
14840 op = "NPU_OP_IRQ";
14841 v.disassemble(fields);
14842 break;
14843 }
14844 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) |
14845 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_CONV):
14846 {
14847 const npu_op_conv_t &v = *reinterpret_cast<const npu_op_conv_t *>(in);
14848 op = "NPU_OP_CONV";
14849 v.disassemble(fields);
14850 break;
14851 }
14852 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) |
14853 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_DEPTHWISE):
14854 {
14855 const npu_op_depthwise_t &v = *reinterpret_cast<const npu_op_depthwise_t *>(in);
14856 op = "NPU_OP_DEPTHWISE";
14857 v.disassemble(fields);
14858 break;
14859 }
14860 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) |
14861 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_POOL):
14862 {
14863 const npu_op_pool_t &v = *reinterpret_cast<const npu_op_pool_t *>(in);
14864 op = "NPU_OP_POOL";
14865 v.disassemble(fields);
14866 break;
14867 }
14868 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) |
14869 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_ELEMENTWISE):
14870 {
14871 const npu_op_elementwise_t &v = *reinterpret_cast<const npu_op_elementwise_t *>(in);
14872 op = "NPU_OP_ELEMENTWISE";
14873 v.disassemble(fields);
14874 break;
14875 }
14876 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) |
14877 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_DMA_START):
14878 {
14879 const npu_op_dma_start_t &v = *reinterpret_cast<const npu_op_dma_start_t *>(in);
14880 op = "NPU_OP_DMA_START";
14881 v.disassemble(fields);
14882 break;
14883 }
14884 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) |
14885 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_DMA_WAIT):
14886 {
14887 const npu_op_dma_wait_t &v = *reinterpret_cast<const npu_op_dma_wait_t *>(in);
14888 op = "NPU_OP_DMA_WAIT";
14889 v.disassemble(fields);
14890 break;
14891 }
14892 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) |
14893 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_KERNEL_WAIT):
14894 {
14895 const npu_op_kernel_wait_t &v = *reinterpret_cast<const npu_op_kernel_wait_t *>(in);
14896 op = "NPU_OP_KERNEL_WAIT";
14897 v.disassemble(fields);
14898 break;
14899 }
14900 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) |
14901 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_PMU_MASK):
14902 {
14903 const npu_op_pmu_mask_t &v = *reinterpret_cast<const npu_op_pmu_mask_t *>(in);
14904 op = "NPU_OP_PMU_MASK";
14905 v.disassemble(fields);
14906 break;
14907 }
14908 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) |
14909 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_PAD_TOP):
14910 {
14911 const npu_set_ifm_pad_top_t &v = *reinterpret_cast<const npu_set_ifm_pad_top_t *>(in);
14912 op = "NPU_SET_IFM_PAD_TOP";
14913 v.disassemble(fields);
14914 break;
14915 }
14916 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) |
14917 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_PAD_LEFT):
14918 {
14919 const npu_set_ifm_pad_left_t &v = *reinterpret_cast<const npu_set_ifm_pad_left_t *>(in);
14920 op = "NPU_SET_IFM_PAD_LEFT";
14921 v.disassemble(fields);
14922 break;
14923 }
14924 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) |
14925 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_PAD_RIGHT):
14926 {
14927 const npu_set_ifm_pad_right_t &v = *reinterpret_cast<const npu_set_ifm_pad_right_t *>(in);
14928 op = "NPU_SET_IFM_PAD_RIGHT";
14929 v.disassemble(fields);
14930 break;
14931 }
14932 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) |
14933 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_PAD_BOTTOM):
14934 {
14935 const npu_set_ifm_pad_bottom_t &v = *reinterpret_cast<const npu_set_ifm_pad_bottom_t *>(in);
14936 op = "NPU_SET_IFM_PAD_BOTTOM";
14937 v.disassemble(fields);
14938 break;
14939 }
14940 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) |
14941 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_DEPTH_M1):
14942 {
14943 const npu_set_ifm_depth_m1_t &v = *reinterpret_cast<const npu_set_ifm_depth_m1_t *>(in);
14944 op = "NPU_SET_IFM_DEPTH_M1";
14945 v.disassemble(fields);
14946 break;
14947 }
14948 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) |
14949 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_PRECISION):
14950 {
14951 const npu_set_ifm_precision_t &v = *reinterpret_cast<const npu_set_ifm_precision_t *>(in);
14952 op = "NPU_SET_IFM_PRECISION";
14953 v.disassemble(fields);
14954 break;
14955 }
14956 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) |
14957 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_UPSCALE):
14958 {
14959 const npu_set_ifm_upscale_t &v = *reinterpret_cast<const npu_set_ifm_upscale_t *>(in);
14960 op = "NPU_SET_IFM_UPSCALE";
14961 v.disassemble(fields);
14962 break;
14963 }
14964 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) |
14965 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_ZERO_POINT):
14966 {
14967 const npu_set_ifm_zero_point_t &v = *reinterpret_cast<const npu_set_ifm_zero_point_t *>(in);
14968 op = "NPU_SET_IFM_ZERO_POINT";
14969 v.disassemble(fields);
14970 break;
14971 }
14972 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) |
14973 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_WIDTH0_M1):
14974 {
14975 const npu_set_ifm_width0_m1_t &v = *reinterpret_cast<const npu_set_ifm_width0_m1_t *>(in);
14976 op = "NPU_SET_IFM_WIDTH0_M1";
14977 v.disassemble(fields);
14978 break;
14979 }
14980 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) |
14981 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_HEIGHT0_M1):
14982 {
14983 const npu_set_ifm_height0_m1_t &v = *reinterpret_cast<const npu_set_ifm_height0_m1_t *>(in);
14984 op = "NPU_SET_IFM_HEIGHT0_M1";
14985 v.disassemble(fields);
14986 break;
14987 }
14988 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) |
14989 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_HEIGHT1_M1):
14990 {
14991 const npu_set_ifm_height1_m1_t &v = *reinterpret_cast<const npu_set_ifm_height1_m1_t *>(in);
14992 op = "NPU_SET_IFM_HEIGHT1_M1";
14993 v.disassemble(fields);
14994 break;
14995 }
14996 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) |
14997 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_IB_END):
14998 {
14999 const npu_set_ifm_ib_end_t &v = *reinterpret_cast<const npu_set_ifm_ib_end_t *>(in);
15000 op = "NPU_SET_IFM_IB_END";
15001 v.disassemble(fields);
15002 break;
15003 }
15004 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) |
15005 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_REGION):
15006 {
15007 const npu_set_ifm_region_t &v = *reinterpret_cast<const npu_set_ifm_region_t *>(in);
15008 op = "NPU_SET_IFM_REGION";
15009 v.disassemble(fields);
15010 break;
15011 }
15012 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) |
15013 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_OFM_WIDTH_M1):
15014 {
15015 const npu_set_ofm_width_m1_t &v = *reinterpret_cast<const npu_set_ofm_width_m1_t *>(in);
15016 op = "NPU_SET_OFM_WIDTH_M1";
15017 v.disassemble(fields);
15018 break;
15019 }
15020 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) |
15021 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_OFM_HEIGHT_M1):
15022 {
15023 const npu_set_ofm_height_m1_t &v = *reinterpret_cast<const npu_set_ofm_height_m1_t *>(in);
15024 op = "NPU_SET_OFM_HEIGHT_M1";
15025 v.disassemble(fields);
15026 break;
15027 }
15028 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) |
15029 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_OFM_DEPTH_M1):
15030 {
15031 const npu_set_ofm_depth_m1_t &v = *reinterpret_cast<const npu_set_ofm_depth_m1_t *>(in);
15032 op = "NPU_SET_OFM_DEPTH_M1";
15033 v.disassemble(fields);
15034 break;
15035 }
15036 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) |
15037 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_OFM_PRECISION):
15038 {
15039 const npu_set_ofm_precision_t &v = *reinterpret_cast<const npu_set_ofm_precision_t *>(in);
15040 op = "NPU_SET_OFM_PRECISION";
15041 v.disassemble(fields);
15042 break;
15043 }
15044 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) |
15045 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_OFM_BLK_WIDTH_M1):
15046 {
15047 const npu_set_ofm_blk_width_m1_t &v = *reinterpret_cast<const npu_set_ofm_blk_width_m1_t *>(in);
15048 op = "NPU_SET_OFM_BLK_WIDTH_M1";
15049 v.disassemble(fields);
15050 break;
15051 }
15052 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) |
15053 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_OFM_BLK_HEIGHT_M1):
15054 {
15055 const npu_set_ofm_blk_height_m1_t &v = *reinterpret_cast<const npu_set_ofm_blk_height_m1_t *>(in);
15056 op = "NPU_SET_OFM_BLK_HEIGHT_M1";
15057 v.disassemble(fields);
15058 break;
15059 }
15060 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) |
15061 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_OFM_BLK_DEPTH_M1):
15062 {
15063 const npu_set_ofm_blk_depth_m1_t &v = *reinterpret_cast<const npu_set_ofm_blk_depth_m1_t *>(in);
15064 op = "NPU_SET_OFM_BLK_DEPTH_M1";
15065 v.disassemble(fields);
15066 break;
15067 }
15068 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) |
15069 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_OFM_ZERO_POINT):
15070 {
15071 const npu_set_ofm_zero_point_t &v = *reinterpret_cast<const npu_set_ofm_zero_point_t *>(in);
15072 op = "NPU_SET_OFM_ZERO_POINT";
15073 v.disassemble(fields);
15074 break;
15075 }
15076 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) |
15077 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_OFM_WIDTH0_M1):
15078 {
15079 const npu_set_ofm_width0_m1_t &v = *reinterpret_cast<const npu_set_ofm_width0_m1_t *>(in);
15080 op = "NPU_SET_OFM_WIDTH0_M1";
15081 v.disassemble(fields);
15082 break;
15083 }
15084 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) |
15085 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_OFM_HEIGHT0_M1):
15086 {
15087 const npu_set_ofm_height0_m1_t &v = *reinterpret_cast<const npu_set_ofm_height0_m1_t *>(in);
15088 op = "NPU_SET_OFM_HEIGHT0_M1";
15089 v.disassemble(fields);
15090 break;
15091 }
15092 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) |
15093 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_OFM_HEIGHT1_M1):
15094 {
15095 const npu_set_ofm_height1_m1_t &v = *reinterpret_cast<const npu_set_ofm_height1_m1_t *>(in);
15096 op = "NPU_SET_OFM_HEIGHT1_M1";
15097 v.disassemble(fields);
15098 break;
15099 }
15100 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) |
15101 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_OFM_REGION):
15102 {
15103 const npu_set_ofm_region_t &v = *reinterpret_cast<const npu_set_ofm_region_t *>(in);
15104 op = "NPU_SET_OFM_REGION";
15105 v.disassemble(fields);
15106 break;
15107 }
15108 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) |
15109 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_KERNEL_WIDTH_M1):
15110 {
15111 const npu_set_kernel_width_m1_t &v = *reinterpret_cast<const npu_set_kernel_width_m1_t *>(in);
15112 op = "NPU_SET_KERNEL_WIDTH_M1";
15113 v.disassemble(fields);
15114 break;
15115 }
15116 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) |
15117 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_KERNEL_HEIGHT_M1):
15118 {
15119 const npu_set_kernel_height_m1_t &v = *reinterpret_cast<const npu_set_kernel_height_m1_t *>(in);
15120 op = "NPU_SET_KERNEL_HEIGHT_M1";
15121 v.disassemble(fields);
15122 break;
15123 }
15124 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) |
15125 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_KERNEL_STRIDE):
15126 {
15127 const npu_set_kernel_stride_t &v = *reinterpret_cast<const npu_set_kernel_stride_t *>(in);
15128 op = "NPU_SET_KERNEL_STRIDE";
15129 v.disassemble(fields);
15130 break;
15131 }
15132 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) |
15133 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_ACC_FORMAT):
15134 {
15135 const npu_set_acc_format_t &v = *reinterpret_cast<const npu_set_acc_format_t *>(in);
15136 op = "NPU_SET_ACC_FORMAT";
15137 v.disassemble(fields);
15138 break;
15139 }
15140 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) |
15141 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_ACTIVATION):
15142 {
15143 const npu_set_activation_t &v = *reinterpret_cast<const npu_set_activation_t *>(in);
15144 op = "NPU_SET_ACTIVATION";
15145 v.disassemble(fields);
15146 break;
15147 }
15148 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) |
15149 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_ACTIVATION_MIN):
15150 {
15151 const npu_set_activation_min_t &v = *reinterpret_cast<const npu_set_activation_min_t *>(in);
15152 op = "NPU_SET_ACTIVATION_MIN";
15153 v.disassemble(fields);
15154 break;
15155 }
15156 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) |
15157 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_ACTIVATION_MAX):
15158 {
15159 const npu_set_activation_max_t &v = *reinterpret_cast<const npu_set_activation_max_t *>(in);
15160 op = "NPU_SET_ACTIVATION_MAX";
15161 v.disassemble(fields);
15162 break;
15163 }
15164 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) |
15165 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_WEIGHT_REGION):
15166 {
15167 const npu_set_weight_region_t &v = *reinterpret_cast<const npu_set_weight_region_t *>(in);
15168 op = "NPU_SET_WEIGHT_REGION";
15169 v.disassemble(fields);
15170 break;
15171 }
15172 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) |
15173 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_SCALE_REGION):
15174 {
15175 const npu_set_scale_region_t &v = *reinterpret_cast<const npu_set_scale_region_t *>(in);
15176 op = "NPU_SET_SCALE_REGION";
15177 v.disassemble(fields);
15178 break;
15179 }
15180 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) |
15181 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_AB_START):
15182 {
15183 const npu_set_ab_start_t &v = *reinterpret_cast<const npu_set_ab_start_t *>(in);
15184 op = "NPU_SET_AB_START";
15185 v.disassemble(fields);
15186 break;
15187 }
15188 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) |
15189 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_BLOCKDEP):
15190 {
15191 const npu_set_blockdep_t &v = *reinterpret_cast<const npu_set_blockdep_t *>(in);
15192 op = "NPU_SET_BLOCKDEP";
15193 v.disassemble(fields);
15194 break;
15195 }
15196 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) |
15197 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_DMA0_SRC_REGION):
15198 {
15199 const npu_set_dma0_src_region_t &v = *reinterpret_cast<const npu_set_dma0_src_region_t *>(in);
15200 op = "NPU_SET_DMA0_SRC_REGION";
15201 v.disassemble(fields);
15202 break;
15203 }
15204 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) |
15205 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_DMA0_DST_REGION):
15206 {
15207 const npu_set_dma0_dst_region_t &v = *reinterpret_cast<const npu_set_dma0_dst_region_t *>(in);
15208 op = "NPU_SET_DMA0_DST_REGION";
15209 v.disassemble(fields);
15210 break;
15211 }
15212 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) |
15213 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_DMA0_SIZE0):
15214 {
15215 const npu_set_dma0_size0_t &v = *reinterpret_cast<const npu_set_dma0_size0_t *>(in);
15216 op = "NPU_SET_DMA0_SIZE0";
15217 v.disassemble(fields);
15218 break;
15219 }
15220 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) |
15221 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_DMA0_SIZE1):
15222 {
15223 const npu_set_dma0_size1_t &v = *reinterpret_cast<const npu_set_dma0_size1_t *>(in);
15224 op = "NPU_SET_DMA0_SIZE1";
15225 v.disassemble(fields);
15226 break;
15227 }
15228 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) |
15229 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM2_BROADCAST):
15230 {
15231 const npu_set_ifm2_broadcast_t &v = *reinterpret_cast<const npu_set_ifm2_broadcast_t *>(in);
15232 op = "NPU_SET_IFM2_BROADCAST";
15233 v.disassemble(fields);
15234 break;
15235 }
15236 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) |
15237 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM2_SCALAR):
15238 {
15239 const npu_set_ifm2_scalar_t &v = *reinterpret_cast<const npu_set_ifm2_scalar_t *>(in);
15240 op = "NPU_SET_IFM2_SCALAR";
15241 v.disassemble(fields);
15242 break;
15243 }
15244 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) |
15245 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM2_PRECISION):
15246 {
15247 const npu_set_ifm2_precision_t &v = *reinterpret_cast<const npu_set_ifm2_precision_t *>(in);
15248 op = "NPU_SET_IFM2_PRECISION";
15249 v.disassemble(fields);
15250 break;
15251 }
15252 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) |
15253 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM2_ZERO_POINT):
15254 {
15255 const npu_set_ifm2_zero_point_t &v = *reinterpret_cast<const npu_set_ifm2_zero_point_t *>(in);
15256 op = "NPU_SET_IFM2_ZERO_POINT";
15257 v.disassemble(fields);
15258 break;
15259 }
15260 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) |
15261 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM2_WIDTH0_M1):
15262 {
15263 const npu_set_ifm2_width0_m1_t &v = *reinterpret_cast<const npu_set_ifm2_width0_m1_t *>(in);
15264 op = "NPU_SET_IFM2_WIDTH0_M1";
15265 v.disassemble(fields);
15266 break;
15267 }
15268 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) |
15269 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM2_HEIGHT0_M1):
15270 {
15271 const npu_set_ifm2_height0_m1_t &v = *reinterpret_cast<const npu_set_ifm2_height0_m1_t *>(in);
15272 op = "NPU_SET_IFM2_HEIGHT0_M1";
15273 v.disassemble(fields);
15274 break;
15275 }
15276 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) |
15277 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM2_HEIGHT1_M1):
15278 {
15279 const npu_set_ifm2_height1_m1_t &v = *reinterpret_cast<const npu_set_ifm2_height1_m1_t *>(in);
15280 op = "NPU_SET_IFM2_HEIGHT1_M1";
15281 v.disassemble(fields);
15282 break;
15283 }
15284 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) |
15285 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM2_IB_START):
15286 {
15287 const npu_set_ifm2_ib_start_t &v = *reinterpret_cast<const npu_set_ifm2_ib_start_t *>(in);
15288 op = "NPU_SET_IFM2_IB_START";
15289 v.disassemble(fields);
15290 break;
15291 }
15292 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) |
15293 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM2_REGION):
15294 {
15295 const npu_set_ifm2_region_t &v = *reinterpret_cast<const npu_set_ifm2_region_t *>(in);
15296 op = "NPU_SET_IFM2_REGION";
15297 v.disassemble(fields);
15298 break;
15299 }
15300 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL) << 14) |
15301 static_cast<uint32_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM_BASE0):
15302 {
15303 const npu_set_ifm_base0_t &v = *reinterpret_cast<const npu_set_ifm_base0_t *>(in);
15304 op = "NPU_SET_IFM_BASE0";
15305 v.disassemble(fields);
15306 break;
15307 }
15308 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL) << 14) |
15309 static_cast<uint32_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM_BASE1):
15310 {
15311 const npu_set_ifm_base1_t &v = *reinterpret_cast<const npu_set_ifm_base1_t *>(in);
15312 op = "NPU_SET_IFM_BASE1";
15313 v.disassemble(fields);
15314 break;
15315 }
15316 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL) << 14) |
15317 static_cast<uint32_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM_BASE2):
15318 {
15319 const npu_set_ifm_base2_t &v = *reinterpret_cast<const npu_set_ifm_base2_t *>(in);
15320 op = "NPU_SET_IFM_BASE2";
15321 v.disassemble(fields);
15322 break;
15323 }
15324 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL) << 14) |
15325 static_cast<uint32_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM_BASE3):
15326 {
15327 const npu_set_ifm_base3_t &v = *reinterpret_cast<const npu_set_ifm_base3_t *>(in);
15328 op = "NPU_SET_IFM_BASE3";
15329 v.disassemble(fields);
15330 break;
15331 }
15332 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL) << 14) |
15333 static_cast<uint32_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM_STRIDE_X):
15334 {
15335 const npu_set_ifm_stride_x_t &v = *reinterpret_cast<const npu_set_ifm_stride_x_t *>(in);
15336 op = "NPU_SET_IFM_STRIDE_X";
15337 v.disassemble(fields);
15338 break;
15339 }
15340 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL) << 14) |
15341 static_cast<uint32_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM_STRIDE_Y):
15342 {
15343 const npu_set_ifm_stride_y_t &v = *reinterpret_cast<const npu_set_ifm_stride_y_t *>(in);
15344 op = "NPU_SET_IFM_STRIDE_Y";
15345 v.disassemble(fields);
15346 break;
15347 }
15348 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL) << 14) |
15349 static_cast<uint32_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM_STRIDE_C):
15350 {
15351 const npu_set_ifm_stride_c_t &v = *reinterpret_cast<const npu_set_ifm_stride_c_t *>(in);
15352 op = "NPU_SET_IFM_STRIDE_C";
15353 v.disassemble(fields);
15354 break;
15355 }
15356 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL) << 14) |
15357 static_cast<uint32_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_OFM_BASE0):
15358 {
15359 const npu_set_ofm_base0_t &v = *reinterpret_cast<const npu_set_ofm_base0_t *>(in);
15360 op = "NPU_SET_OFM_BASE0";
15361 v.disassemble(fields);
15362 break;
15363 }
15364 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL) << 14) |
15365 static_cast<uint32_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_OFM_BASE1):
15366 {
15367 const npu_set_ofm_base1_t &v = *reinterpret_cast<const npu_set_ofm_base1_t *>(in);
15368 op = "NPU_SET_OFM_BASE1";
15369 v.disassemble(fields);
15370 break;
15371 }
15372 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL) << 14) |
15373 static_cast<uint32_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_OFM_BASE2):
15374 {
15375 const npu_set_ofm_base2_t &v = *reinterpret_cast<const npu_set_ofm_base2_t *>(in);
15376 op = "NPU_SET_OFM_BASE2";
15377 v.disassemble(fields);
15378 break;
15379 }
15380 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL) << 14) |
15381 static_cast<uint32_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_OFM_BASE3):
15382 {
15383 const npu_set_ofm_base3_t &v = *reinterpret_cast<const npu_set_ofm_base3_t *>(in);
15384 op = "NPU_SET_OFM_BASE3";
15385 v.disassemble(fields);
15386 break;
15387 }
15388 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL) << 14) |
15389 static_cast<uint32_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_OFM_STRIDE_X):
15390 {
15391 const npu_set_ofm_stride_x_t &v = *reinterpret_cast<const npu_set_ofm_stride_x_t *>(in);
15392 op = "NPU_SET_OFM_STRIDE_X";
15393 v.disassemble(fields);
15394 break;
15395 }
15396 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL) << 14) |
15397 static_cast<uint32_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_OFM_STRIDE_Y):
15398 {
15399 const npu_set_ofm_stride_y_t &v = *reinterpret_cast<const npu_set_ofm_stride_y_t *>(in);
15400 op = "NPU_SET_OFM_STRIDE_Y";
15401 v.disassemble(fields);
15402 break;
15403 }
15404 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL) << 14) |
15405 static_cast<uint32_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_OFM_STRIDE_C):
15406 {
15407 const npu_set_ofm_stride_c_t &v = *reinterpret_cast<const npu_set_ofm_stride_c_t *>(in);
15408 op = "NPU_SET_OFM_STRIDE_C";
15409 v.disassemble(fields);
15410 break;
15411 }
15412 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL) << 14) |
15413 static_cast<uint32_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_WEIGHT_BASE):
15414 {
15415 const npu_set_weight_base_t &v = *reinterpret_cast<const npu_set_weight_base_t *>(in);
15416 op = "NPU_SET_WEIGHT_BASE";
15417 v.disassemble(fields);
15418 break;
15419 }
15420 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL) << 14) |
15421 static_cast<uint32_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_WEIGHT_LENGTH):
15422 {
15423 const npu_set_weight_length_t &v = *reinterpret_cast<const npu_set_weight_length_t *>(in);
15424 op = "NPU_SET_WEIGHT_LENGTH";
15425 v.disassemble(fields);
15426 break;
15427 }
15428 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL) << 14) |
15429 static_cast<uint32_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_SCALE_BASE):
15430 {
15431 const npu_set_scale_base_t &v = *reinterpret_cast<const npu_set_scale_base_t *>(in);
15432 op = "NPU_SET_SCALE_BASE";
15433 v.disassemble(fields);
15434 break;
15435 }
15436 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL) << 14) |
15437 static_cast<uint32_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_SCALE_LENGTH):
15438 {
15439 const npu_set_scale_length_t &v = *reinterpret_cast<const npu_set_scale_length_t *>(in);
15440 op = "NPU_SET_SCALE_LENGTH";
15441 v.disassemble(fields);
15442 break;
15443 }
15444 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL) << 14) |
15445 static_cast<uint32_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_OFM_SCALE):
15446 {
15447 const npu_set_ofm_scale_t &v = *reinterpret_cast<const npu_set_ofm_scale_t *>(in);
15448 op = "NPU_SET_OFM_SCALE";
15449 v.disassemble(fields);
15450 break;
15451 }
15452 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL) << 14) |
15453 static_cast<uint32_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_OPA_SCALE):
15454 {
15455 const npu_set_opa_scale_t &v = *reinterpret_cast<const npu_set_opa_scale_t *>(in);
15456 op = "NPU_SET_OPA_SCALE";
15457 v.disassemble(fields);
15458 break;
15459 }
15460 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL) << 14) |
15461 static_cast<uint32_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_OPB_SCALE):
15462 {
15463 const npu_set_opb_scale_t &v = *reinterpret_cast<const npu_set_opb_scale_t *>(in);
15464 op = "NPU_SET_OPB_SCALE";
15465 v.disassemble(fields);
15466 break;
15467 }
15468 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL) << 14) |
15469 static_cast<uint32_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_DMA0_SRC):
15470 {
15471 const npu_set_dma0_src_t &v = *reinterpret_cast<const npu_set_dma0_src_t *>(in);
15472 op = "NPU_SET_DMA0_SRC";
15473 v.disassemble(fields);
15474 break;
15475 }
15476 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL) << 14) |
15477 static_cast<uint32_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_DMA0_DST):
15478 {
15479 const npu_set_dma0_dst_t &v = *reinterpret_cast<const npu_set_dma0_dst_t *>(in);
15480 op = "NPU_SET_DMA0_DST";
15481 v.disassemble(fields);
15482 break;
15483 }
15484 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL) << 14) |
15485 static_cast<uint32_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_DMA0_LEN):
15486 {
15487 const npu_set_dma0_len_t &v = *reinterpret_cast<const npu_set_dma0_len_t *>(in);
15488 op = "NPU_SET_DMA0_LEN";
15489 v.disassemble(fields);
15490 break;
15491 }
15492 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL) << 14) |
15493 static_cast<uint32_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM2_BASE0):
15494 {
15495 const npu_set_ifm2_base0_t &v = *reinterpret_cast<const npu_set_ifm2_base0_t *>(in);
15496 op = "NPU_SET_IFM2_BASE0";
15497 v.disassemble(fields);
15498 break;
15499 }
15500 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL) << 14) |
15501 static_cast<uint32_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM2_BASE1):
15502 {
15503 const npu_set_ifm2_base1_t &v = *reinterpret_cast<const npu_set_ifm2_base1_t *>(in);
15504 op = "NPU_SET_IFM2_BASE1";
15505 v.disassemble(fields);
15506 break;
15507 }
15508 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL) << 14) |
15509 static_cast<uint32_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM2_BASE2):
15510 {
15511 const npu_set_ifm2_base2_t &v = *reinterpret_cast<const npu_set_ifm2_base2_t *>(in);
15512 op = "NPU_SET_IFM2_BASE2";
15513 v.disassemble(fields);
15514 break;
15515 }
15516 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL) << 14) |
15517 static_cast<uint32_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM2_BASE3):
15518 {
15519 const npu_set_ifm2_base3_t &v = *reinterpret_cast<const npu_set_ifm2_base3_t *>(in);
15520 op = "NPU_SET_IFM2_BASE3";
15521 v.disassemble(fields);
15522 break;
15523 }
15524 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL) << 14) |
15525 static_cast<uint32_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM2_STRIDE_X):
15526 {
15527 const npu_set_ifm2_stride_x_t &v = *reinterpret_cast<const npu_set_ifm2_stride_x_t *>(in);
15528 op = "NPU_SET_IFM2_STRIDE_X";
15529 v.disassemble(fields);
15530 break;
15531 }
15532 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL) << 14) |
15533 static_cast<uint32_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM2_STRIDE_Y):
15534 {
15535 const npu_set_ifm2_stride_y_t &v = *reinterpret_cast<const npu_set_ifm2_stride_y_t *>(in);
15536 op = "NPU_SET_IFM2_STRIDE_Y";
15537 v.disassemble(fields);
15538 break;
15539 }
15540 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL) << 14) |
15541 static_cast<uint32_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM2_STRIDE_C):
15542 {
15543 const npu_set_ifm2_stride_c_t &v = *reinterpret_cast<const npu_set_ifm2_stride_c_t *>(in);
15544 op = "NPU_SET_IFM2_STRIDE_C";
15545 v.disassemble(fields);
15546 break;
15547 }
15548 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL) << 14) |
15549 static_cast<uint32_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_USER_DEFINED0):
15550 {
15551 const npu_set_user_defined0_t &v = *reinterpret_cast<const npu_set_user_defined0_t *>(in);
15552 op = "NPU_SET_USER_DEFINED0";
15553 v.disassemble(fields);
15554 break;
15555 }
15556 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL) << 14) |
15557 static_cast<uint32_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_USER_DEFINED1):
15558 {
15559 const npu_set_user_defined1_t &v = *reinterpret_cast<const npu_set_user_defined1_t *>(in);
15560 op = "NPU_SET_USER_DEFINED1";
15561 v.disassemble(fields);
15562 break;
15563 }
15564 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL) << 14) |
15565 static_cast<uint32_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_USER_DEFINED2):
15566 {
15567 const npu_set_user_defined2_t &v = *reinterpret_cast<const npu_set_user_defined2_t *>(in);
15568 op = "NPU_SET_USER_DEFINED2";
15569 v.disassemble(fields);
15570 break;
15571 }
15572 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL) << 14) |
15573 static_cast<uint32_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_USER_DEFINED3):
15574 {
15575 const npu_set_user_defined3_t &v = *reinterpret_cast<const npu_set_user_defined3_t *>(in);
15576 op = "NPU_SET_USER_DEFINED3";
15577 v.disassemble(fields);
15578 break;
15579 }
15580 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL) << 14) |
15581 static_cast<uint32_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_USER_DEFINED4):
15582 {
15583 const npu_set_user_defined4_t &v = *reinterpret_cast<const npu_set_user_defined4_t *>(in);
15584 op = "NPU_SET_USER_DEFINED4";
15585 v.disassemble(fields);
15586 break;
15587 }
15588 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL) << 14) |
15589 static_cast<uint32_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_USER_DEFINED5):
15590 {
15591 const npu_set_user_defined5_t &v = *reinterpret_cast<const npu_set_user_defined5_t *>(in);
15592 op = "NPU_SET_USER_DEFINED5";
15593 v.disassemble(fields);
15594 break;
15595 }
15596 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL) << 14) |
15597 static_cast<uint32_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_USER_DEFINED6):
15598 {
15599 const npu_set_user_defined6_t &v = *reinterpret_cast<const npu_set_user_defined6_t *>(in);
15600 op = "NPU_SET_USER_DEFINED6";
15601 v.disassemble(fields);
15602 break;
15603 }
15604 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL) << 14) |
15605 static_cast<uint32_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_USER_DEFINED7):
15606 {
15607 const npu_set_user_defined7_t &v = *reinterpret_cast<const npu_set_user_defined7_t *>(in);
15608 op = "NPU_SET_USER_DEFINED7";
15609 v.disassemble(fields);
15610 break;
15611 }
15612 }
15613 return (*in & (3 << 14)) != 0 ? 2 : 1;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020015614 }
Jonny Svärd136810f2021-10-13 16:04:26 +020015615#endif
15616#endif
15617 // Signal the end of command stream
15618 struct npu_op_stop_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020015619 {
Jonny Svärd136810f2021-10-13 16:04:26 +020015620#ifdef __cplusplus
15621 private:
15622#endif
15623 uint32_t opcode : 10; // opcode
15624 uint32_t reserved0 : 4;
15625 uint32_t control : 2; // control
15626 uint32_t mask : 16; // Encoding for 16-bit mask value
15627#ifdef __cplusplus
15628 public:
15629 npu_op_stop_t(uint32_t _mask) :
15630 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_STOP)), reserved0(0),
15631 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)),
15632 mask(static_cast<uint16_t>(_mask) & ((1U << 16) - 1))
15633 {
15634 }
15635 CONSTEXPR npu_op_stop_t() :
15636 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_STOP)), reserved0(0),
15637 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), mask(0)
15638 {
15639 }
15640 CONSTEXPR bool valid() const
15641 {
15642 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_STOP) &&
15643 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
15644 }
15645 CONSTEXPR void init()
15646 {
15647 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_STOP);
15648 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
15649 }
15650 operator uint32_t()
15651 {
15652 uint32_t word;
15653 std::memcpy(&word, this, sizeof(word));
15654 return word;
15655 }
15656 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const
15657 {
15658 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode);
15659 }
15660 CONSTEXPR npu_op_stop_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value)
15661 {
15662 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
15663 return *this;
15664 }
15665 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
15666 {
15667 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
15668 }
15669 CONSTEXPR npu_op_stop_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
15670 {
15671 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
15672 return *this;
15673 }
15674 CONSTEXPR uint32_t get_mask() const
15675 {
15676 return static_cast<uint32_t>(mask);
15677 }
15678 CONSTEXPR npu_op_stop_t &set_mask(uint32_t value)
15679 {
15680 mask = static_cast<uint16_t>(value) & ((1U << 16) - 1);
15681 return *this;
15682 }
15683#ifdef NPU_DISASSEMBLE
15684 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
15685 {
15686 fields.push_back(std::make_pair<std::string, std::string>("mask", std::to_string(mask)));
15687 }
15688#endif
15689#endif
15690 };
15691 // Raises an IRQ to the host
15692 struct npu_op_irq_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020015693 {
Jonny Svärd136810f2021-10-13 16:04:26 +020015694#ifdef __cplusplus
15695 private:
15696#endif
15697 uint32_t opcode : 10; // opcode
15698 uint32_t reserved0 : 4;
15699 uint32_t control : 2; // control
15700 uint32_t mask : 16; // Encoding for 16-bit mask value
15701#ifdef __cplusplus
15702 public:
15703 npu_op_irq_t(uint32_t _mask) :
15704 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_IRQ)), reserved0(0),
15705 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)),
15706 mask(static_cast<uint16_t>(_mask) & ((1U << 16) - 1))
15707 {
15708 }
15709 CONSTEXPR npu_op_irq_t() :
15710 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_IRQ)), reserved0(0),
15711 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), mask(0)
15712 {
15713 }
15714 CONSTEXPR bool valid() const
15715 {
15716 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_IRQ) &&
15717 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
15718 }
15719 CONSTEXPR void init()
15720 {
15721 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_IRQ);
15722 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
15723 }
15724 operator uint32_t()
15725 {
15726 uint32_t word;
15727 std::memcpy(&word, this, sizeof(word));
15728 return word;
15729 }
15730 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const
15731 {
15732 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode);
15733 }
15734 CONSTEXPR npu_op_irq_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value)
15735 {
15736 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
15737 return *this;
15738 }
15739 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
15740 {
15741 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
15742 }
15743 CONSTEXPR npu_op_irq_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
15744 {
15745 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
15746 return *this;
15747 }
15748 CONSTEXPR uint32_t get_mask() const
15749 {
15750 return static_cast<uint32_t>(mask);
15751 }
15752 CONSTEXPR npu_op_irq_t &set_mask(uint32_t value)
15753 {
15754 mask = static_cast<uint16_t>(value) & ((1U << 16) - 1);
15755 return *this;
15756 }
15757#ifdef NPU_DISASSEMBLE
15758 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
15759 {
15760 fields.push_back(std::make_pair<std::string, std::string>("mask", std::to_string(mask)));
15761 }
15762#endif
15763#endif
15764 };
15765 // 2D convolution
15766 struct npu_op_conv_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020015767 {
Jonny Svärd136810f2021-10-13 16:04:26 +020015768#ifdef __cplusplus
15769 private:
15770#endif
15771 uint32_t opcode : 10; // opcode
15772 uint32_t reserved0 : 4;
15773 uint32_t control : 2; // control
15774 uint32_t reserved1 : 16;
15775#ifdef __cplusplus
15776 public:
15777 CONSTEXPR npu_op_conv_t() :
15778 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_CONV)), reserved0(0),
15779 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), reserved1(0)
15780 {
15781 }
15782 CONSTEXPR bool valid() const
15783 {
15784 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_CONV) &&
15785 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
15786 }
15787 CONSTEXPR void init()
15788 {
15789 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_CONV);
15790 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
15791 }
15792 operator uint32_t()
15793 {
15794 uint32_t word;
15795 std::memcpy(&word, this, sizeof(word));
15796 return word;
15797 }
15798 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const
15799 {
15800 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode);
15801 }
15802 CONSTEXPR npu_op_conv_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value)
15803 {
15804 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
15805 return *this;
15806 }
15807 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
15808 {
15809 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
15810 }
15811 CONSTEXPR npu_op_conv_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
15812 {
15813 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
15814 return *this;
15815 }
15816#ifdef NPU_DISASSEMBLE
15817 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const {}
15818#endif
15819#endif
15820 };
15821 // Depth-wise 2D convolution
15822 struct npu_op_depthwise_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020015823 {
Jonny Svärd136810f2021-10-13 16:04:26 +020015824#ifdef __cplusplus
15825 private:
15826#endif
15827 uint32_t opcode : 10; // opcode
15828 uint32_t reserved0 : 4;
15829 uint32_t control : 2; // control
15830 uint32_t reserved1 : 16;
15831#ifdef __cplusplus
15832 public:
15833 CONSTEXPR npu_op_depthwise_t() :
15834 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_DEPTHWISE)), reserved0(0),
15835 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), reserved1(0)
15836 {
15837 }
15838 CONSTEXPR bool valid() const
15839 {
15840 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_DEPTHWISE) &&
15841 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
15842 }
15843 CONSTEXPR void init()
15844 {
15845 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_DEPTHWISE);
15846 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
15847 }
15848 operator uint32_t()
15849 {
15850 uint32_t word;
15851 std::memcpy(&word, this, sizeof(word));
15852 return word;
15853 }
15854 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const
15855 {
15856 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode);
15857 }
15858 CONSTEXPR npu_op_depthwise_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value)
15859 {
15860 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
15861 return *this;
15862 }
15863 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
15864 {
15865 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
15866 }
15867 CONSTEXPR npu_op_depthwise_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
15868 {
15869 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
15870 return *this;
15871 }
15872#ifdef NPU_DISASSEMBLE
15873 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const {}
15874#endif
15875#endif
15876 };
15877 // Pooling
15878 struct npu_op_pool_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020015879 {
Jonny Svärd136810f2021-10-13 16:04:26 +020015880#ifdef __cplusplus
15881 private:
15882#endif
15883 uint32_t opcode : 10; // opcode
15884 uint32_t reserved0 : 4;
15885 uint32_t control : 2; // control
15886 uint32_t pooling_mode : 3; // Pooling mode
15887 uint32_t reserved1 : 13;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020015888#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020015889 public:
15890 npu_op_pool_t(NPU_NAMESPACE::pooling_mode _pooling_mode) :
15891 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_POOL)), reserved0(0),
15892 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)),
15893 pooling_mode(static_cast<uint8_t>(_pooling_mode) & ((1U << 3) - 1)), reserved1(0)
15894 {
15895 }
15896 CONSTEXPR npu_op_pool_t() :
15897 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_POOL)), reserved0(0),
15898 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), pooling_mode(0), reserved1(0)
15899 {
15900 }
15901 CONSTEXPR bool valid() const
15902 {
15903 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_POOL) &&
15904 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
15905 }
15906 CONSTEXPR void init()
15907 {
15908 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_POOL);
15909 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
15910 }
15911 operator uint32_t()
15912 {
15913 uint32_t word;
15914 std::memcpy(&word, this, sizeof(word));
15915 return word;
15916 }
15917 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const
15918 {
15919 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode);
15920 }
15921 CONSTEXPR npu_op_pool_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value)
15922 {
15923 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
15924 return *this;
15925 }
15926 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
15927 {
15928 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
15929 }
15930 CONSTEXPR npu_op_pool_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
15931 {
15932 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
15933 return *this;
15934 }
15935 CONSTEXPR NPU_NAMESPACE::pooling_mode get_pooling_mode() const
15936 {
15937 return static_cast<NPU_NAMESPACE::pooling_mode>(pooling_mode);
15938 }
15939 CONSTEXPR npu_op_pool_t &set_pooling_mode(NPU_NAMESPACE::pooling_mode value)
15940 {
15941 pooling_mode = static_cast<uint8_t>(value) & ((1U << 3) - 1);
15942 return *this;
15943 }
15944#ifdef NPU_DISASSEMBLE
15945 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
15946 {
15947 fields.push_back(std::make_pair<std::string, std::string>(
15948 "pooling_mode",
15949 (pooling_mode < (sizeof(pooling_mode_str) / sizeof(pooling_mode_str[0])) ?
15950 pooling_mode_str[pooling_mode] :
15951 "****")));
15952 }
15953#endif
15954#endif
15955 };
15956 // Elementwise operation
15957 struct npu_op_elementwise_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020015958 {
Jonny Svärd136810f2021-10-13 16:04:26 +020015959#ifdef __cplusplus
15960 private:
15961#endif
15962 uint32_t opcode : 10; // opcode
15963 uint32_t reserved0 : 4;
15964 uint32_t control : 2; // control
15965 uint32_t elementwise_mode : 6; // Elementwise mode
15966 uint32_t reserved1 : 10;
15967#ifdef __cplusplus
15968 public:
15969 npu_op_elementwise_t(NPU_NAMESPACE::elementwise_mode _elementwise_mode) :
15970 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_ELEMENTWISE)), reserved0(0),
15971 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)),
15972 elementwise_mode(static_cast<uint8_t>(_elementwise_mode) & ((1U << 6) - 1)), reserved1(0)
15973 {
15974 }
15975 CONSTEXPR npu_op_elementwise_t() :
15976 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_ELEMENTWISE)), reserved0(0),
15977 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), elementwise_mode(0), reserved1(0)
15978 {
15979 }
15980 CONSTEXPR bool valid() const
15981 {
15982 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_ELEMENTWISE) &&
15983 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
15984 }
15985 CONSTEXPR void init()
15986 {
15987 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_ELEMENTWISE);
15988 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
15989 }
15990 operator uint32_t()
15991 {
15992 uint32_t word;
15993 std::memcpy(&word, this, sizeof(word));
15994 return word;
15995 }
15996 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const
15997 {
15998 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode);
15999 }
16000 CONSTEXPR npu_op_elementwise_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value)
16001 {
16002 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
16003 return *this;
16004 }
16005 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
16006 {
16007 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
16008 }
16009 CONSTEXPR npu_op_elementwise_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
16010 {
16011 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
16012 return *this;
16013 }
16014 CONSTEXPR NPU_NAMESPACE::elementwise_mode get_elementwise_mode() const
16015 {
16016 return static_cast<NPU_NAMESPACE::elementwise_mode>(elementwise_mode);
16017 }
16018 CONSTEXPR npu_op_elementwise_t &set_elementwise_mode(NPU_NAMESPACE::elementwise_mode value)
16019 {
16020 elementwise_mode = static_cast<uint8_t>(value) & ((1U << 6) - 1);
16021 return *this;
16022 }
16023#ifdef NPU_DISASSEMBLE
16024 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
16025 {
16026 fields.push_back(std::make_pair<std::string, std::string>(
16027 "elementwise_mode",
16028 (elementwise_mode < (sizeof(elementwise_mode_str) / sizeof(elementwise_mode_str[0])) ?
16029 elementwise_mode_str[elementwise_mode] :
16030 "****")));
16031 }
16032#endif
16033#endif
16034 };
16035 // Queue new DMA for the given channel
16036 struct npu_op_dma_start_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020016037 {
Jonny Svärd136810f2021-10-13 16:04:26 +020016038#ifdef __cplusplus
16039 private:
16040#endif
16041 uint32_t opcode : 10; // opcode
16042 uint32_t reserved0 : 4;
16043 uint32_t control : 2; // control
16044 uint32_t reserved1 : 16;
16045#ifdef __cplusplus
16046 public:
16047 CONSTEXPR npu_op_dma_start_t() :
16048 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_DMA_START)), reserved0(0),
16049 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), reserved1(0)
16050 {
16051 }
16052 CONSTEXPR bool valid() const
16053 {
16054 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_DMA_START) &&
16055 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
16056 }
16057 CONSTEXPR void init()
16058 {
16059 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_DMA_START);
16060 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
16061 }
16062 operator uint32_t()
16063 {
16064 uint32_t word;
16065 std::memcpy(&word, this, sizeof(word));
16066 return word;
16067 }
16068 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const
16069 {
16070 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode);
16071 }
16072 CONSTEXPR npu_op_dma_start_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value)
16073 {
16074 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
16075 return *this;
16076 }
16077 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
16078 {
16079 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
16080 }
16081 CONSTEXPR npu_op_dma_start_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
16082 {
16083 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
16084 return *this;
16085 }
16086#ifdef NPU_DISASSEMBLE
16087 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const {}
16088#endif
16089#endif
16090 };
16091 // Wait for the DMA channel to have k or fewer active descriptors outstanding
16092 struct npu_op_dma_wait_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020016093 {
Jonny Svärd136810f2021-10-13 16:04:26 +020016094#ifdef __cplusplus
16095 private:
16096#endif
16097 uint32_t opcode : 10; // opcode
16098 uint32_t reserved0 : 4;
16099 uint32_t control : 2; // control
16100 uint32_t k : 4; // Number of outstanding descriptors
16101 uint32_t reserved1 : 12;
16102#ifdef __cplusplus
16103 public:
16104 npu_op_dma_wait_t(uint32_t _k) :
16105 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_DMA_WAIT)), reserved0(0),
16106 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)),
16107 k(static_cast<uint8_t>(_k) & ((1U << 4) - 1)), reserved1(0)
16108 {
16109 }
16110 CONSTEXPR npu_op_dma_wait_t() :
16111 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_DMA_WAIT)), reserved0(0),
16112 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), k(0), reserved1(0)
16113 {
16114 }
16115 CONSTEXPR bool valid() const
16116 {
16117 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_DMA_WAIT) &&
16118 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
16119 }
16120 CONSTEXPR void init()
16121 {
16122 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_DMA_WAIT);
16123 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
16124 }
16125 operator uint32_t()
16126 {
16127 uint32_t word;
16128 std::memcpy(&word, this, sizeof(word));
16129 return word;
16130 }
16131 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const
16132 {
16133 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode);
16134 }
16135 CONSTEXPR npu_op_dma_wait_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value)
16136 {
16137 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
16138 return *this;
16139 }
16140 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
16141 {
16142 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
16143 }
16144 CONSTEXPR npu_op_dma_wait_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
16145 {
16146 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
16147 return *this;
16148 }
16149 CONSTEXPR uint32_t get_k() const
16150 {
16151 return static_cast<uint32_t>(k);
16152 }
16153 CONSTEXPR npu_op_dma_wait_t &set_k(uint32_t value)
16154 {
16155 k = static_cast<uint8_t>(value) & ((1U << 4) - 1);
16156 return *this;
16157 }
16158#ifdef NPU_DISASSEMBLE
16159 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
16160 {
16161 fields.push_back(std::make_pair<std::string, std::string>("k", std::to_string(k)));
16162 }
16163#endif
16164#endif
16165 };
16166 // Wait for n or fewer kernel operations to be remaining
16167 struct npu_op_kernel_wait_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020016168 {
Jonny Svärd136810f2021-10-13 16:04:26 +020016169#ifdef __cplusplus
16170 private:
16171#endif
16172 uint32_t opcode : 10; // opcode
16173 uint32_t reserved0 : 4;
16174 uint32_t control : 2; // control
16175 uint32_t n : 2; // Number of kernel operations in range 0-3
16176 uint32_t reserved1 : 14;
16177#ifdef __cplusplus
16178 public:
16179 npu_op_kernel_wait_t(uint32_t _n) :
16180 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_KERNEL_WAIT)), reserved0(0),
16181 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)),
16182 n(static_cast<uint8_t>(_n) & ((1U << 2) - 1)), reserved1(0)
16183 {
16184 }
16185 CONSTEXPR npu_op_kernel_wait_t() :
16186 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_KERNEL_WAIT)), reserved0(0),
16187 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), n(0), reserved1(0)
16188 {
16189 }
16190 CONSTEXPR bool valid() const
16191 {
16192 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_KERNEL_WAIT) &&
16193 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
16194 }
16195 CONSTEXPR void init()
16196 {
16197 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_KERNEL_WAIT);
16198 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
16199 }
16200 operator uint32_t()
16201 {
16202 uint32_t word;
16203 std::memcpy(&word, this, sizeof(word));
16204 return word;
16205 }
16206 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const
16207 {
16208 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode);
16209 }
16210 CONSTEXPR npu_op_kernel_wait_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value)
16211 {
16212 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
16213 return *this;
16214 }
16215 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
16216 {
16217 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
16218 }
16219 CONSTEXPR npu_op_kernel_wait_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
16220 {
16221 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
16222 return *this;
16223 }
16224 CONSTEXPR uint32_t get_n() const
16225 {
16226 return static_cast<uint32_t>(n);
16227 }
16228 CONSTEXPR npu_op_kernel_wait_t &set_n(uint32_t value)
16229 {
16230 n = static_cast<uint8_t>(value) & ((1U << 2) - 1);
16231 return *this;
16232 }
16233#ifdef NPU_DISASSEMBLE
16234 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
16235 {
16236 fields.push_back(std::make_pair<std::string, std::string>("n", std::to_string(n)));
16237 }
16238#endif
16239#endif
16240 };
16241 // Enable or disable PMU counting (debug feature only)
16242 struct npu_op_pmu_mask_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020016243 {
Jonny Svärd136810f2021-10-13 16:04:26 +020016244#ifdef __cplusplus
16245 private:
16246#endif
16247 uint32_t opcode : 10; // opcode
16248 uint32_t reserved0 : 4;
16249 uint32_t control : 2; // control
16250 uint32_t enable : 1; // Enable or disable PMU mask
16251 uint32_t reserved1 : 15;
16252#ifdef __cplusplus
16253 public:
16254 npu_op_pmu_mask_t(uint32_t _enable) :
16255 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_PMU_MASK)), reserved0(0),
16256 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)),
16257 enable(static_cast<uint8_t>(_enable) & ((1U << 1) - 1)), reserved1(0)
16258 {
16259 }
16260 CONSTEXPR npu_op_pmu_mask_t() :
16261 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_PMU_MASK)), reserved0(0),
16262 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), enable(0), reserved1(0)
16263 {
16264 }
16265 CONSTEXPR bool valid() const
16266 {
16267 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_PMU_MASK) &&
16268 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
16269 }
16270 CONSTEXPR void init()
16271 {
16272 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_PMU_MASK);
16273 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
16274 }
16275 operator uint32_t()
16276 {
16277 uint32_t word;
16278 std::memcpy(&word, this, sizeof(word));
16279 return word;
16280 }
16281 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const
16282 {
16283 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode);
16284 }
16285 CONSTEXPR npu_op_pmu_mask_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value)
16286 {
16287 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
16288 return *this;
16289 }
16290 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
16291 {
16292 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
16293 }
16294 CONSTEXPR npu_op_pmu_mask_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
16295 {
16296 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
16297 return *this;
16298 }
16299 CONSTEXPR uint32_t get_enable() const
16300 {
16301 return static_cast<uint32_t>(enable);
16302 }
16303 CONSTEXPR npu_op_pmu_mask_t &set_enable(uint32_t value)
16304 {
16305 enable = static_cast<uint8_t>(value) & ((1U << 1) - 1);
16306 return *this;
16307 }
16308#ifdef NPU_DISASSEMBLE
16309 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
16310 {
16311 fields.push_back(std::make_pair<std::string, std::string>("enable", std::to_string(enable)));
16312 }
16313#endif
16314#endif
16315 };
16316 // IFM top pad
16317 struct npu_set_ifm_pad_top_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020016318 {
Jonny Svärd136810f2021-10-13 16:04:26 +020016319#ifdef __cplusplus
16320 private:
16321#endif
16322 uint32_t opcode : 10; // opcode
16323 uint32_t reserved0 : 4;
16324 uint32_t control : 2; // control
16325 uint32_t pad : 7; // IFM top pad
16326 uint32_t reserved1 : 9;
16327#ifdef __cplusplus
16328 public:
16329 npu_set_ifm_pad_top_t(uint32_t _pad) :
16330 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_PAD_TOP)), reserved0(0),
16331 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)),
16332 pad(static_cast<uint8_t>(_pad) & ((1U << 7) - 1)), reserved1(0)
16333 {
16334 }
16335 CONSTEXPR npu_set_ifm_pad_top_t() :
16336 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_PAD_TOP)), reserved0(0),
16337 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), pad(0), reserved1(0)
16338 {
16339 }
16340 CONSTEXPR bool valid() const
16341 {
16342 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_PAD_TOP) &&
16343 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
16344 }
16345 CONSTEXPR void init()
16346 {
16347 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_PAD_TOP);
16348 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
16349 }
16350 operator uint32_t()
16351 {
16352 uint32_t word;
16353 std::memcpy(&word, this, sizeof(word));
16354 return word;
16355 }
16356 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const
16357 {
16358 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode);
16359 }
16360 CONSTEXPR npu_set_ifm_pad_top_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value)
16361 {
16362 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
16363 return *this;
16364 }
16365 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
16366 {
16367 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
16368 }
16369 CONSTEXPR npu_set_ifm_pad_top_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
16370 {
16371 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
16372 return *this;
16373 }
16374 CONSTEXPR uint32_t get_pad() const
16375 {
16376 return static_cast<uint32_t>(pad);
16377 }
16378 CONSTEXPR npu_set_ifm_pad_top_t &set_pad(uint32_t value)
16379 {
16380 pad = static_cast<uint8_t>(value) & ((1U << 7) - 1);
16381 return *this;
16382 }
16383#ifdef NPU_DISASSEMBLE
16384 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
16385 {
16386 fields.push_back(std::make_pair<std::string, std::string>("pad", std::to_string(pad)));
16387 }
16388#endif
16389#endif
16390 };
16391 // IFM left pad
16392 struct npu_set_ifm_pad_left_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020016393 {
Jonny Svärd136810f2021-10-13 16:04:26 +020016394#ifdef __cplusplus
16395 private:
16396#endif
16397 uint32_t opcode : 10; // opcode
16398 uint32_t reserved0 : 4;
16399 uint32_t control : 2; // control
16400 uint32_t pad : 7; // IFM left pad
16401 uint32_t reserved1 : 9;
16402#ifdef __cplusplus
16403 public:
16404 npu_set_ifm_pad_left_t(uint32_t _pad) :
16405 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_PAD_LEFT)), reserved0(0),
16406 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)),
16407 pad(static_cast<uint8_t>(_pad) & ((1U << 7) - 1)), reserved1(0)
16408 {
16409 }
16410 CONSTEXPR npu_set_ifm_pad_left_t() :
16411 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_PAD_LEFT)), reserved0(0),
16412 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), pad(0), reserved1(0)
16413 {
16414 }
16415 CONSTEXPR bool valid() const
16416 {
16417 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_PAD_LEFT) &&
16418 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
16419 }
16420 CONSTEXPR void init()
16421 {
16422 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_PAD_LEFT);
16423 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
16424 }
16425 operator uint32_t()
16426 {
16427 uint32_t word;
16428 std::memcpy(&word, this, sizeof(word));
16429 return word;
16430 }
16431 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const
16432 {
16433 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode);
16434 }
16435 CONSTEXPR npu_set_ifm_pad_left_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value)
16436 {
16437 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
16438 return *this;
16439 }
16440 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
16441 {
16442 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
16443 }
16444 CONSTEXPR npu_set_ifm_pad_left_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
16445 {
16446 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
16447 return *this;
16448 }
16449 CONSTEXPR uint32_t get_pad() const
16450 {
16451 return static_cast<uint32_t>(pad);
16452 }
16453 CONSTEXPR npu_set_ifm_pad_left_t &set_pad(uint32_t value)
16454 {
16455 pad = static_cast<uint8_t>(value) & ((1U << 7) - 1);
16456 return *this;
16457 }
16458#ifdef NPU_DISASSEMBLE
16459 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
16460 {
16461 fields.push_back(std::make_pair<std::string, std::string>("pad", std::to_string(pad)));
16462 }
16463#endif
16464#endif
16465 };
16466 // IFM right pad
16467 struct npu_set_ifm_pad_right_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020016468 {
Jonny Svärd136810f2021-10-13 16:04:26 +020016469#ifdef __cplusplus
16470 private:
16471#endif
16472 uint32_t opcode : 10; // opcode
16473 uint32_t reserved0 : 4;
16474 uint32_t control : 2; // control
16475 uint32_t pad : 8; // IFM right pad. Max value is 128
16476 uint32_t reserved1 : 8;
16477#ifdef __cplusplus
16478 public:
16479 npu_set_ifm_pad_right_t(uint32_t _pad) :
16480 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_PAD_RIGHT)), reserved0(0),
16481 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)),
16482 pad(static_cast<uint8_t>(_pad) & ((1U << 8) - 1)), reserved1(0)
16483 {
16484 }
16485 CONSTEXPR npu_set_ifm_pad_right_t() :
16486 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_PAD_RIGHT)), reserved0(0),
16487 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), pad(0), reserved1(0)
16488 {
16489 }
16490 CONSTEXPR bool valid() const
16491 {
16492 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_PAD_RIGHT) &&
16493 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
16494 }
16495 CONSTEXPR void init()
16496 {
16497 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_PAD_RIGHT);
16498 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
16499 }
16500 operator uint32_t()
16501 {
16502 uint32_t word;
16503 std::memcpy(&word, this, sizeof(word));
16504 return word;
16505 }
16506 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const
16507 {
16508 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode);
16509 }
16510 CONSTEXPR npu_set_ifm_pad_right_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value)
16511 {
16512 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
16513 return *this;
16514 }
16515 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
16516 {
16517 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
16518 }
16519 CONSTEXPR npu_set_ifm_pad_right_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
16520 {
16521 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
16522 return *this;
16523 }
16524 CONSTEXPR uint32_t get_pad() const
16525 {
16526 return static_cast<uint32_t>(pad);
16527 }
16528 CONSTEXPR npu_set_ifm_pad_right_t &set_pad(uint32_t value)
16529 {
16530 pad = static_cast<uint8_t>(value) & ((1U << 8) - 1);
16531 return *this;
16532 }
16533#ifdef NPU_DISASSEMBLE
16534 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
16535 {
16536 fields.push_back(std::make_pair<std::string, std::string>("pad", std::to_string(pad)));
16537 }
16538#endif
16539#endif
16540 };
16541 // IFM bottom pad
16542 struct npu_set_ifm_pad_bottom_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020016543 {
Jonny Svärd136810f2021-10-13 16:04:26 +020016544#ifdef __cplusplus
16545 private:
16546#endif
16547 uint32_t opcode : 10; // opcode
16548 uint32_t reserved0 : 4;
16549 uint32_t control : 2; // control
16550 uint32_t pad : 8; // IFM bottom pad. Max value is 128
16551 uint32_t reserved1 : 8;
16552#ifdef __cplusplus
16553 public:
16554 npu_set_ifm_pad_bottom_t(uint32_t _pad) :
16555 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_PAD_BOTTOM)), reserved0(0),
16556 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)),
16557 pad(static_cast<uint8_t>(_pad) & ((1U << 8) - 1)), reserved1(0)
16558 {
16559 }
16560 CONSTEXPR npu_set_ifm_pad_bottom_t() :
16561 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_PAD_BOTTOM)), reserved0(0),
16562 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), pad(0), reserved1(0)
16563 {
16564 }
16565 CONSTEXPR bool valid() const
16566 {
16567 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_PAD_BOTTOM) &&
16568 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
16569 }
16570 CONSTEXPR void init()
16571 {
16572 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_PAD_BOTTOM);
16573 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
16574 }
16575 operator uint32_t()
16576 {
16577 uint32_t word;
16578 std::memcpy(&word, this, sizeof(word));
16579 return word;
16580 }
16581 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const
16582 {
16583 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode);
16584 }
16585 CONSTEXPR npu_set_ifm_pad_bottom_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value)
16586 {
16587 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
16588 return *this;
16589 }
16590 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
16591 {
16592 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
16593 }
16594 CONSTEXPR npu_set_ifm_pad_bottom_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
16595 {
16596 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
16597 return *this;
16598 }
16599 CONSTEXPR uint32_t get_pad() const
16600 {
16601 return static_cast<uint32_t>(pad);
16602 }
16603 CONSTEXPR npu_set_ifm_pad_bottom_t &set_pad(uint32_t value)
16604 {
16605 pad = static_cast<uint8_t>(value) & ((1U << 8) - 1);
16606 return *this;
16607 }
16608#ifdef NPU_DISASSEMBLE
16609 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
16610 {
16611 fields.push_back(std::make_pair<std::string, std::string>("pad", std::to_string(pad)));
16612 }
16613#endif
16614#endif
16615 };
16616 // Number of input channels for convolution
16617 struct npu_set_ifm_depth_m1_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020016618 {
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020016619#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020016620 private:
16621#endif
16622 uint32_t opcode : 10; // opcode
16623 uint32_t reserved0 : 4;
16624 uint32_t control : 2; // control
16625 uint32_t depth_m1 : 16; // Number of input channels for convolution
16626#ifdef __cplusplus
16627 public:
16628 npu_set_ifm_depth_m1_t(uint32_t _depth_m1) :
16629 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_DEPTH_M1)), reserved0(0),
16630 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)),
16631 depth_m1(static_cast<uint16_t>(_depth_m1) & ((1U << 16) - 1))
16632 {
16633 }
16634 CONSTEXPR npu_set_ifm_depth_m1_t() :
16635 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_DEPTH_M1)), reserved0(0),
16636 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), depth_m1(0)
16637 {
16638 }
16639 CONSTEXPR bool valid() const
16640 {
16641 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_DEPTH_M1) &&
16642 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
16643 }
16644 CONSTEXPR void init()
16645 {
16646 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_DEPTH_M1);
16647 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
16648 }
16649 operator uint32_t()
16650 {
16651 uint32_t word;
16652 std::memcpy(&word, this, sizeof(word));
16653 return word;
16654 }
16655 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const
16656 {
16657 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode);
16658 }
16659 CONSTEXPR npu_set_ifm_depth_m1_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value)
16660 {
16661 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
16662 return *this;
16663 }
16664 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
16665 {
16666 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
16667 }
16668 CONSTEXPR npu_set_ifm_depth_m1_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
16669 {
16670 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
16671 return *this;
16672 }
16673 CONSTEXPR uint32_t get_depth_m1() const
16674 {
16675 return static_cast<uint32_t>(depth_m1);
16676 }
16677 CONSTEXPR npu_set_ifm_depth_m1_t &set_depth_m1(uint32_t value)
16678 {
16679 depth_m1 = static_cast<uint16_t>(value) & ((1U << 16) - 1);
16680 return *this;
16681 }
16682#ifdef NPU_DISASSEMBLE
16683 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
16684 {
16685 fields.push_back(std::make_pair<std::string, std::string>("depth_m1", std::to_string(depth_m1)));
16686 }
16687#endif
16688#endif
16689 };
16690 // IFM Precision
16691 struct npu_set_ifm_precision_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020016692 {
Jonny Svärd136810f2021-10-13 16:04:26 +020016693#ifdef __cplusplus
16694 private:
16695#endif
16696 uint32_t opcode : 10; // opcode
16697 uint32_t reserved0 : 4;
16698 uint32_t control : 2; // control
16699 uint32_t activation_type : 1; // IFM type
16700 uint32_t reserved1 : 1;
16701 uint32_t activation_precision : 2; // IFM precision
16702 uint32_t reserved2 : 2;
16703 uint32_t activation_format : 2; // IFM format
16704 uint32_t scale_mode : 2; // IFM scale mode
16705 uint32_t reserved3 : 4;
16706 uint32_t round_mode : 2; // IFM round mode
16707#ifdef __cplusplus
16708 public:
16709 npu_set_ifm_precision_t(NPU_NAMESPACE::activation_type _activation_type,
16710 NPU_NAMESPACE::activation_precision _activation_precision,
16711 NPU_NAMESPACE::activation_format _activation_format,
16712 NPU_NAMESPACE::ifm_scale_mode _scale_mode,
16713 NPU_NAMESPACE::round_mode _round_mode) :
16714 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_PRECISION)),
16715 reserved0(0), control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)),
16716 activation_type(static_cast<uint8_t>(_activation_type) & ((1U << 1) - 1)), reserved1(0),
16717 activation_precision(static_cast<uint8_t>(_activation_precision) & ((1U << 2) - 1)), reserved2(0),
16718 activation_format(static_cast<uint8_t>(_activation_format) & ((1U << 2) - 1)),
16719 scale_mode(static_cast<uint8_t>(_scale_mode) & ((1U << 2) - 1)), reserved3(0),
16720 round_mode(static_cast<uint8_t>(_round_mode) & ((1U << 2) - 1))
16721 {
16722 }
16723 CONSTEXPR npu_set_ifm_precision_t() :
16724 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_PRECISION)), reserved0(0),
16725 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), activation_type(0), reserved1(0),
16726 activation_precision(0), reserved2(0), activation_format(0), scale_mode(0), reserved3(0), round_mode(0)
16727 {
16728 }
16729 CONSTEXPR bool valid() const
16730 {
16731 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_PRECISION) &&
16732 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
16733 }
16734 CONSTEXPR void init()
16735 {
16736 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_PRECISION);
16737 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
16738 }
16739 operator uint32_t()
16740 {
16741 uint32_t word;
16742 std::memcpy(&word, this, sizeof(word));
16743 return word;
16744 }
16745 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const
16746 {
16747 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode);
16748 }
16749 CONSTEXPR npu_set_ifm_precision_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value)
16750 {
16751 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
16752 return *this;
16753 }
16754 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
16755 {
16756 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
16757 }
16758 CONSTEXPR npu_set_ifm_precision_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
16759 {
16760 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
16761 return *this;
16762 }
16763 CONSTEXPR NPU_NAMESPACE::activation_type get_activation_type() const
16764 {
16765 return static_cast<NPU_NAMESPACE::activation_type>(activation_type);
16766 }
16767 CONSTEXPR npu_set_ifm_precision_t &set_activation_type(NPU_NAMESPACE::activation_type value)
16768 {
16769 activation_type = static_cast<uint8_t>(value) & ((1U << 1) - 1);
16770 return *this;
16771 }
16772 CONSTEXPR NPU_NAMESPACE::activation_precision get_activation_precision() const
16773 {
16774 return static_cast<NPU_NAMESPACE::activation_precision>(activation_precision);
16775 }
16776 CONSTEXPR npu_set_ifm_precision_t &set_activation_precision(NPU_NAMESPACE::activation_precision value)
16777 {
16778 activation_precision = static_cast<uint8_t>(value) & ((1U << 2) - 1);
16779 return *this;
16780 }
16781 CONSTEXPR NPU_NAMESPACE::activation_format get_activation_format() const
16782 {
16783 return static_cast<NPU_NAMESPACE::activation_format>(activation_format);
16784 }
16785 CONSTEXPR npu_set_ifm_precision_t &set_activation_format(NPU_NAMESPACE::activation_format value)
16786 {
16787 activation_format = static_cast<uint8_t>(value) & ((1U << 2) - 1);
16788 return *this;
16789 }
16790 CONSTEXPR NPU_NAMESPACE::ifm_scale_mode get_scale_mode() const
16791 {
16792 return static_cast<NPU_NAMESPACE::ifm_scale_mode>(scale_mode);
16793 }
16794 CONSTEXPR npu_set_ifm_precision_t &set_scale_mode(NPU_NAMESPACE::ifm_scale_mode value)
16795 {
16796 scale_mode = static_cast<uint8_t>(value) & ((1U << 2) - 1);
16797 return *this;
16798 }
16799 CONSTEXPR NPU_NAMESPACE::round_mode get_round_mode() const
16800 {
16801 return static_cast<NPU_NAMESPACE::round_mode>(round_mode);
16802 }
16803 CONSTEXPR npu_set_ifm_precision_t &set_round_mode(NPU_NAMESPACE::round_mode value)
16804 {
16805 round_mode = static_cast<uint8_t>(value) & ((1U << 2) - 1);
16806 return *this;
16807 }
16808#ifdef NPU_DISASSEMBLE
16809 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
16810 {
16811 fields.push_back(std::make_pair<std::string, std::string>(
16812 "activation_type",
16813 (activation_type < (sizeof(activation_type_str) / sizeof(activation_type_str[0])) ?
16814 activation_type_str[activation_type] :
16815 "****")));
16816 fields.push_back(std::make_pair<std::string, std::string>(
16817 "activation_precision",
16818 (activation_precision < (sizeof(activation_precision_str) / sizeof(activation_precision_str[0])) ?
16819 activation_precision_str[activation_precision] :
16820 "****")));
16821 fields.push_back(std::make_pair<std::string, std::string>(
16822 "activation_format",
16823 (activation_format < (sizeof(activation_format_str) / sizeof(activation_format_str[0])) ?
16824 activation_format_str[activation_format] :
16825 "****")));
16826 fields.push_back(std::make_pair<std::string, std::string>(
16827 "scale_mode",
16828 (scale_mode < (sizeof(ifm_scale_mode_str) / sizeof(ifm_scale_mode_str[0])) ?
16829 ifm_scale_mode_str[scale_mode] :
16830 "****")));
16831 fields.push_back(std::make_pair<std::string, std::string>(
16832 "round_mode",
16833 (round_mode < (sizeof(round_mode_str) / sizeof(round_mode_str[0])) ? round_mode_str[round_mode] :
16834 "****")));
16835 }
16836#endif
16837#endif
16838 };
16839 // IFM upscale mode
16840 struct npu_set_ifm_upscale_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020016841 {
Jonny Svärd136810f2021-10-13 16:04:26 +020016842#ifdef __cplusplus
16843 private:
16844#endif
16845 uint32_t opcode : 10; // opcode
16846 uint32_t reserved0 : 4;
16847 uint32_t control : 2; // control
16848 uint32_t mode : 2; // IFM upscale mode
16849 uint32_t reserved1 : 14;
16850#ifdef __cplusplus
16851 public:
16852 npu_set_ifm_upscale_t(NPU_NAMESPACE::ifm_upscale_mode _mode) :
16853 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_UPSCALE)), reserved0(0),
16854 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)),
16855 mode(static_cast<uint8_t>(_mode) & ((1U << 2) - 1)), reserved1(0)
16856 {
16857 }
16858 CONSTEXPR npu_set_ifm_upscale_t() :
16859 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_UPSCALE)), reserved0(0),
16860 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), mode(0), reserved1(0)
16861 {
16862 }
16863 CONSTEXPR bool valid() const
16864 {
16865 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_UPSCALE) &&
16866 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
16867 }
16868 CONSTEXPR void init()
16869 {
16870 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_UPSCALE);
16871 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
16872 }
16873 operator uint32_t()
16874 {
16875 uint32_t word;
16876 std::memcpy(&word, this, sizeof(word));
16877 return word;
16878 }
16879 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const
16880 {
16881 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode);
16882 }
16883 CONSTEXPR npu_set_ifm_upscale_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value)
16884 {
16885 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
16886 return *this;
16887 }
16888 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
16889 {
16890 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
16891 }
16892 CONSTEXPR npu_set_ifm_upscale_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
16893 {
16894 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
16895 return *this;
16896 }
16897 CONSTEXPR NPU_NAMESPACE::ifm_upscale_mode get_mode() const
16898 {
16899 return static_cast<NPU_NAMESPACE::ifm_upscale_mode>(mode);
16900 }
16901 CONSTEXPR npu_set_ifm_upscale_t &set_mode(NPU_NAMESPACE::ifm_upscale_mode value)
16902 {
16903 mode = static_cast<uint8_t>(value) & ((1U << 2) - 1);
16904 return *this;
16905 }
16906#ifdef NPU_DISASSEMBLE
16907 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
16908 {
16909 fields.push_back(std::make_pair<std::string, std::string>(
16910 "mode",
16911 (mode < (sizeof(ifm_upscale_mode_str) / sizeof(ifm_upscale_mode_str[0])) ? ifm_upscale_mode_str[mode] :
16912 "****")));
16913 }
16914#endif
16915#endif
16916 };
16917 // IFM zero point
16918 struct npu_set_ifm_zero_point_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020016919 {
Jonny Svärd136810f2021-10-13 16:04:26 +020016920#ifdef __cplusplus
16921 private:
16922#endif
16923 uint32_t opcode : 10; // opcode
16924 uint32_t reserved0 : 4;
16925 uint32_t control : 2; // control
16926 uint32_t zero_point : 16; // Zero point offset
16927#ifdef __cplusplus
16928 public:
16929 npu_set_ifm_zero_point_t(uint32_t _zero_point) :
16930 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_ZERO_POINT)), reserved0(0),
16931 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)),
16932 zero_point(static_cast<uint16_t>(_zero_point) & ((1U << 16) - 1))
16933 {
16934 }
16935 CONSTEXPR npu_set_ifm_zero_point_t() :
16936 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_ZERO_POINT)), reserved0(0),
16937 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), zero_point(0)
16938 {
16939 }
16940 CONSTEXPR bool valid() const
16941 {
16942 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_ZERO_POINT) &&
16943 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
16944 }
16945 CONSTEXPR void init()
16946 {
16947 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_ZERO_POINT);
16948 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
16949 }
16950 operator uint32_t()
16951 {
16952 uint32_t word;
16953 std::memcpy(&word, this, sizeof(word));
16954 return word;
16955 }
16956 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const
16957 {
16958 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode);
16959 }
16960 CONSTEXPR npu_set_ifm_zero_point_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value)
16961 {
16962 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
16963 return *this;
16964 }
16965 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
16966 {
16967 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
16968 }
16969 CONSTEXPR npu_set_ifm_zero_point_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
16970 {
16971 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
16972 return *this;
16973 }
16974 CONSTEXPR uint32_t get_zero_point() const
16975 {
16976 return static_cast<uint32_t>(zero_point);
16977 }
16978 CONSTEXPR npu_set_ifm_zero_point_t &set_zero_point(uint32_t value)
16979 {
16980 zero_point = static_cast<uint16_t>(value) & ((1U << 16) - 1);
16981 return *this;
16982 }
16983#ifdef NPU_DISASSEMBLE
16984 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
16985 {
16986 fields.push_back(std::make_pair<std::string, std::string>("zero_point", std::to_string(zero_point)));
16987 }
16988#endif
16989#endif
16990 };
16991 // IFM Tile 0 and tile 2 width
16992 struct npu_set_ifm_width0_m1_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020016993 {
Jonny Svärd136810f2021-10-13 16:04:26 +020016994#ifdef __cplusplus
16995 private:
16996#endif
16997 uint32_t opcode : 10; // opcode
16998 uint32_t reserved0 : 4;
16999 uint32_t control : 2; // control
17000 uint32_t width_m1 : 16; // IFM Tile 0 and tile 2 width
17001#ifdef __cplusplus
17002 public:
17003 npu_set_ifm_width0_m1_t(uint32_t _width_m1) :
17004 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_WIDTH0_M1)), reserved0(0),
17005 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)),
17006 width_m1(static_cast<uint16_t>(_width_m1) & ((1U << 16) - 1))
17007 {
17008 }
17009 CONSTEXPR npu_set_ifm_width0_m1_t() :
17010 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_WIDTH0_M1)), reserved0(0),
17011 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), width_m1(0)
17012 {
17013 }
17014 CONSTEXPR bool valid() const
17015 {
17016 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_WIDTH0_M1) &&
17017 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
17018 }
17019 CONSTEXPR void init()
17020 {
17021 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_WIDTH0_M1);
17022 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
17023 }
17024 operator uint32_t()
17025 {
17026 uint32_t word;
17027 std::memcpy(&word, this, sizeof(word));
17028 return word;
17029 }
17030 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const
17031 {
17032 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode);
17033 }
17034 CONSTEXPR npu_set_ifm_width0_m1_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value)
17035 {
17036 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
17037 return *this;
17038 }
17039 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
17040 {
17041 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
17042 }
17043 CONSTEXPR npu_set_ifm_width0_m1_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
17044 {
17045 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
17046 return *this;
17047 }
17048 CONSTEXPR uint32_t get_width_m1() const
17049 {
17050 return static_cast<uint32_t>(width_m1);
17051 }
17052 CONSTEXPR npu_set_ifm_width0_m1_t &set_width_m1(uint32_t value)
17053 {
17054 width_m1 = static_cast<uint16_t>(value) & ((1U << 16) - 1);
17055 return *this;
17056 }
17057#ifdef NPU_DISASSEMBLE
17058 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
17059 {
17060 fields.push_back(std::make_pair<std::string, std::string>("width_m1", std::to_string(width_m1)));
17061 }
17062#endif
17063#endif
17064 };
17065 // IFM Tile 0 height
17066 struct npu_set_ifm_height0_m1_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020017067 {
Jonny Svärd136810f2021-10-13 16:04:26 +020017068#ifdef __cplusplus
17069 private:
17070#endif
17071 uint32_t opcode : 10; // opcode
17072 uint32_t reserved0 : 4;
17073 uint32_t control : 2; // control
17074 uint32_t height_m1 : 16; // IFM Tile 0 height
17075#ifdef __cplusplus
17076 public:
17077 npu_set_ifm_height0_m1_t(uint32_t _height_m1) :
17078 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_HEIGHT0_M1)), reserved0(0),
17079 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)),
17080 height_m1(static_cast<uint16_t>(_height_m1) & ((1U << 16) - 1))
17081 {
17082 }
17083 CONSTEXPR npu_set_ifm_height0_m1_t() :
17084 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_HEIGHT0_M1)), reserved0(0),
17085 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), height_m1(0)
17086 {
17087 }
17088 CONSTEXPR bool valid() const
17089 {
17090 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_HEIGHT0_M1) &&
17091 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
17092 }
17093 CONSTEXPR void init()
17094 {
17095 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_HEIGHT0_M1);
17096 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
17097 }
17098 operator uint32_t()
17099 {
17100 uint32_t word;
17101 std::memcpy(&word, this, sizeof(word));
17102 return word;
17103 }
17104 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const
17105 {
17106 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode);
17107 }
17108 CONSTEXPR npu_set_ifm_height0_m1_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value)
17109 {
17110 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
17111 return *this;
17112 }
17113 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
17114 {
17115 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
17116 }
17117 CONSTEXPR npu_set_ifm_height0_m1_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
17118 {
17119 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
17120 return *this;
17121 }
17122 CONSTEXPR uint32_t get_height_m1() const
17123 {
17124 return static_cast<uint32_t>(height_m1);
17125 }
17126 CONSTEXPR npu_set_ifm_height0_m1_t &set_height_m1(uint32_t value)
17127 {
17128 height_m1 = static_cast<uint16_t>(value) & ((1U << 16) - 1);
17129 return *this;
17130 }
17131#ifdef NPU_DISASSEMBLE
17132 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
17133 {
17134 fields.push_back(std::make_pair<std::string, std::string>("height_m1", std::to_string(height_m1)));
17135 }
17136#endif
17137#endif
17138 };
17139 // IFM Tile 1 height
17140 struct npu_set_ifm_height1_m1_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020017141 {
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020017142#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020017143 private:
17144#endif
17145 uint32_t opcode : 10; // opcode
17146 uint32_t reserved0 : 4;
17147 uint32_t control : 2; // control
17148 uint32_t height_m1 : 16; // IFM Tile 1 height
17149#ifdef __cplusplus
17150 public:
17151 npu_set_ifm_height1_m1_t(uint32_t _height_m1) :
17152 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_HEIGHT1_M1)), reserved0(0),
17153 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)),
17154 height_m1(static_cast<uint16_t>(_height_m1) & ((1U << 16) - 1))
17155 {
17156 }
17157 CONSTEXPR npu_set_ifm_height1_m1_t() :
17158 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_HEIGHT1_M1)), reserved0(0),
17159 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), height_m1(0)
17160 {
17161 }
17162 CONSTEXPR bool valid() const
17163 {
17164 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_HEIGHT1_M1) &&
17165 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
17166 }
17167 CONSTEXPR void init()
17168 {
17169 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_HEIGHT1_M1);
17170 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
17171 }
17172 operator uint32_t()
17173 {
17174 uint32_t word;
17175 std::memcpy(&word, this, sizeof(word));
17176 return word;
17177 }
17178 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const
17179 {
17180 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode);
17181 }
17182 CONSTEXPR npu_set_ifm_height1_m1_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value)
17183 {
17184 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
17185 return *this;
17186 }
17187 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
17188 {
17189 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
17190 }
17191 CONSTEXPR npu_set_ifm_height1_m1_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
17192 {
17193 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
17194 return *this;
17195 }
17196 CONSTEXPR uint32_t get_height_m1() const
17197 {
17198 return static_cast<uint32_t>(height_m1);
17199 }
17200 CONSTEXPR npu_set_ifm_height1_m1_t &set_height_m1(uint32_t value)
17201 {
17202 height_m1 = static_cast<uint16_t>(value) & ((1U << 16) - 1);
17203 return *this;
17204 }
17205#ifdef NPU_DISASSEMBLE
17206 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
17207 {
17208 fields.push_back(std::make_pair<std::string, std::string>("height_m1", std::to_string(height_m1)));
17209 }
17210#endif
17211#endif
17212 };
17213 // End of IB0,IB1 buffers
17214 struct npu_set_ifm_ib_end_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020017215 {
Jonny Svärd136810f2021-10-13 16:04:26 +020017216#ifdef __cplusplus
17217 private:
17218#endif
17219 uint32_t opcode : 10; // opcode
17220 uint32_t reserved0 : 4;
17221 uint32_t control : 2; // control
17222 uint32_t ib_end : 6; // End of IB0,IB1 buffers in the SHRAM in KB units. Multiple of 2
17223 uint32_t reserved1 : 10;
17224#ifdef __cplusplus
17225 public:
17226 npu_set_ifm_ib_end_t(uint32_t _ib_end) :
17227 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_IB_END)), reserved0(0),
17228 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)),
17229 ib_end(static_cast<uint8_t>(_ib_end) & ((1U << 6) - 1)), reserved1(0)
17230 {
17231 }
17232 CONSTEXPR npu_set_ifm_ib_end_t() :
17233 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_IB_END)), reserved0(0),
17234 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), ib_end(0), reserved1(0)
17235 {
17236 }
17237 CONSTEXPR bool valid() const
17238 {
17239 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_IB_END) &&
17240 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
17241 }
17242 CONSTEXPR void init()
17243 {
17244 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_IB_END);
17245 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
17246 }
17247 operator uint32_t()
17248 {
17249 uint32_t word;
17250 std::memcpy(&word, this, sizeof(word));
17251 return word;
17252 }
17253 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const
17254 {
17255 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode);
17256 }
17257 CONSTEXPR npu_set_ifm_ib_end_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value)
17258 {
17259 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
17260 return *this;
17261 }
17262 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
17263 {
17264 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
17265 }
17266 CONSTEXPR npu_set_ifm_ib_end_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
17267 {
17268 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
17269 return *this;
17270 }
17271 CONSTEXPR uint32_t get_ib_end() const
17272 {
17273 return static_cast<uint32_t>(ib_end);
17274 }
17275 CONSTEXPR npu_set_ifm_ib_end_t &set_ib_end(uint32_t value)
17276 {
17277 ib_end = static_cast<uint8_t>(value) & ((1U << 6) - 1);
17278 return *this;
17279 }
17280#ifdef NPU_DISASSEMBLE
17281 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
17282 {
17283 fields.push_back(std::make_pair<std::string, std::string>("ib_end", std::to_string(ib_end)));
17284 }
17285#endif
17286#endif
17287 };
17288 // Index n for IFM access
17289 struct npu_set_ifm_region_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020017290 {
Jonny Svärd136810f2021-10-13 16:04:26 +020017291#ifdef __cplusplus
17292 private:
17293#endif
17294 uint32_t opcode : 10; // opcode
17295 uint32_t reserved0 : 4;
17296 uint32_t control : 2; // control
17297 uint32_t region : 3; // Region number n
17298 uint32_t reserved1 : 12;
17299 uint32_t custom_dma_cs : 1; // Custom DMA select
17300#ifdef __cplusplus
17301 public:
17302 npu_set_ifm_region_t(uint32_t _region, NPU_NAMESPACE::custom_dma_cs _custom_dma_cs) :
17303 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_REGION)), reserved0(0),
17304 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)),
17305 region(static_cast<uint8_t>(_region) & ((1U << 3) - 1)), reserved1(0),
17306 custom_dma_cs(static_cast<uint8_t>(_custom_dma_cs) & ((1U << 1) - 1))
17307 {
17308 }
17309 CONSTEXPR npu_set_ifm_region_t() :
17310 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_REGION)), reserved0(0),
17311 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), region(0), reserved1(0), custom_dma_cs(0)
17312 {
17313 }
17314 CONSTEXPR bool valid() const
17315 {
17316 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_REGION) &&
17317 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
17318 }
17319 CONSTEXPR void init()
17320 {
17321 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_REGION);
17322 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
17323 }
17324 operator uint32_t()
17325 {
17326 uint32_t word;
17327 std::memcpy(&word, this, sizeof(word));
17328 return word;
17329 }
17330 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const
17331 {
17332 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode);
17333 }
17334 CONSTEXPR npu_set_ifm_region_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value)
17335 {
17336 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
17337 return *this;
17338 }
17339 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
17340 {
17341 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
17342 }
17343 CONSTEXPR npu_set_ifm_region_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
17344 {
17345 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
17346 return *this;
17347 }
17348 CONSTEXPR uint32_t get_region() const
17349 {
17350 return static_cast<uint32_t>(region);
17351 }
17352 CONSTEXPR npu_set_ifm_region_t &set_region(uint32_t value)
17353 {
17354 region = static_cast<uint8_t>(value) & ((1U << 3) - 1);
17355 return *this;
17356 }
17357 CONSTEXPR NPU_NAMESPACE::custom_dma_cs get_custom_dma_cs() const
17358 {
17359 return static_cast<NPU_NAMESPACE::custom_dma_cs>(custom_dma_cs);
17360 }
17361 CONSTEXPR npu_set_ifm_region_t &set_custom_dma_cs(NPU_NAMESPACE::custom_dma_cs value)
17362 {
17363 custom_dma_cs = static_cast<uint8_t>(value) & ((1U << 1) - 1);
17364 return *this;
17365 }
17366#ifdef NPU_DISASSEMBLE
17367 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
17368 {
17369 fields.push_back(std::make_pair<std::string, std::string>("region", std::to_string(region)));
17370 fields.push_back(std::make_pair<std::string, std::string>(
17371 "custom_dma_cs",
17372 (custom_dma_cs < (sizeof(custom_dma_cs_str) / sizeof(custom_dma_cs_str[0])) ?
17373 custom_dma_cs_str[custom_dma_cs] :
17374 "****")));
17375 }
17376#endif
17377#endif
17378 };
17379 // Output feature map width
17380 struct npu_set_ofm_width_m1_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020017381 {
Jonny Svärd136810f2021-10-13 16:04:26 +020017382#ifdef __cplusplus
17383 private:
17384#endif
17385 uint32_t opcode : 10; // opcode
17386 uint32_t reserved0 : 4;
17387 uint32_t control : 2; // control
17388 uint32_t width_m1 : 16; // Output feature map width
17389#ifdef __cplusplus
17390 public:
17391 npu_set_ofm_width_m1_t(uint32_t _width_m1) :
17392 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_OFM_WIDTH_M1)), reserved0(0),
17393 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)),
17394 width_m1(static_cast<uint16_t>(_width_m1) & ((1U << 16) - 1))
17395 {
17396 }
17397 CONSTEXPR npu_set_ofm_width_m1_t() :
17398 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_OFM_WIDTH_M1)), reserved0(0),
17399 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), width_m1(0)
17400 {
17401 }
17402 CONSTEXPR bool valid() const
17403 {
17404 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_OFM_WIDTH_M1) &&
17405 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
17406 }
17407 CONSTEXPR void init()
17408 {
17409 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_OFM_WIDTH_M1);
17410 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
17411 }
17412 operator uint32_t()
17413 {
17414 uint32_t word;
17415 std::memcpy(&word, this, sizeof(word));
17416 return word;
17417 }
17418 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const
17419 {
17420 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode);
17421 }
17422 CONSTEXPR npu_set_ofm_width_m1_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value)
17423 {
17424 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
17425 return *this;
17426 }
17427 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
17428 {
17429 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
17430 }
17431 CONSTEXPR npu_set_ofm_width_m1_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
17432 {
17433 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
17434 return *this;
17435 }
17436 CONSTEXPR uint32_t get_width_m1() const
17437 {
17438 return static_cast<uint32_t>(width_m1);
17439 }
17440 CONSTEXPR npu_set_ofm_width_m1_t &set_width_m1(uint32_t value)
17441 {
17442 width_m1 = static_cast<uint16_t>(value) & ((1U << 16) - 1);
17443 return *this;
17444 }
17445#ifdef NPU_DISASSEMBLE
17446 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
17447 {
17448 fields.push_back(std::make_pair<std::string, std::string>("width_m1", std::to_string(width_m1)));
17449 }
17450#endif
17451#endif
17452 };
17453 // Output feature map height
17454 struct npu_set_ofm_height_m1_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020017455 {
Jonny Svärd136810f2021-10-13 16:04:26 +020017456#ifdef __cplusplus
17457 private:
17458#endif
17459 uint32_t opcode : 10; // opcode
17460 uint32_t reserved0 : 4;
17461 uint32_t control : 2; // control
17462 uint32_t height_m1 : 16; // Output feature map height
17463#ifdef __cplusplus
17464 public:
17465 npu_set_ofm_height_m1_t(uint32_t _height_m1) :
17466 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_OFM_HEIGHT_M1)), reserved0(0),
17467 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)),
17468 height_m1(static_cast<uint16_t>(_height_m1) & ((1U << 16) - 1))
17469 {
17470 }
17471 CONSTEXPR npu_set_ofm_height_m1_t() :
17472 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_OFM_HEIGHT_M1)), reserved0(0),
17473 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), height_m1(0)
17474 {
17475 }
17476 CONSTEXPR bool valid() const
17477 {
17478 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_OFM_HEIGHT_M1) &&
17479 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
17480 }
17481 CONSTEXPR void init()
17482 {
17483 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_OFM_HEIGHT_M1);
17484 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
17485 }
17486 operator uint32_t()
17487 {
17488 uint32_t word;
17489 std::memcpy(&word, this, sizeof(word));
17490 return word;
17491 }
17492 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const
17493 {
17494 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode);
17495 }
17496 CONSTEXPR npu_set_ofm_height_m1_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value)
17497 {
17498 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
17499 return *this;
17500 }
17501 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
17502 {
17503 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
17504 }
17505 CONSTEXPR npu_set_ofm_height_m1_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
17506 {
17507 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
17508 return *this;
17509 }
17510 CONSTEXPR uint32_t get_height_m1() const
17511 {
17512 return static_cast<uint32_t>(height_m1);
17513 }
17514 CONSTEXPR npu_set_ofm_height_m1_t &set_height_m1(uint32_t value)
17515 {
17516 height_m1 = static_cast<uint16_t>(value) & ((1U << 16) - 1);
17517 return *this;
17518 }
17519#ifdef NPU_DISASSEMBLE
17520 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
17521 {
17522 fields.push_back(std::make_pair<std::string, std::string>("height_m1", std::to_string(height_m1)));
17523 }
17524#endif
17525#endif
17526 };
17527 // Output feature map depth
17528 struct npu_set_ofm_depth_m1_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020017529 {
Jonny Svärd136810f2021-10-13 16:04:26 +020017530#ifdef __cplusplus
17531 private:
17532#endif
17533 uint32_t opcode : 10; // opcode
17534 uint32_t reserved0 : 4;
17535 uint32_t control : 2; // control
17536 uint32_t depth_m1 : 16; // Output feature map depth
17537#ifdef __cplusplus
17538 public:
17539 npu_set_ofm_depth_m1_t(uint32_t _depth_m1) :
17540 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_OFM_DEPTH_M1)), reserved0(0),
17541 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)),
17542 depth_m1(static_cast<uint16_t>(_depth_m1) & ((1U << 16) - 1))
17543 {
17544 }
17545 CONSTEXPR npu_set_ofm_depth_m1_t() :
17546 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_OFM_DEPTH_M1)), reserved0(0),
17547 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), depth_m1(0)
17548 {
17549 }
17550 CONSTEXPR bool valid() const
17551 {
17552 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_OFM_DEPTH_M1) &&
17553 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
17554 }
17555 CONSTEXPR void init()
17556 {
17557 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_OFM_DEPTH_M1);
17558 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
17559 }
17560 operator uint32_t()
17561 {
17562 uint32_t word;
17563 std::memcpy(&word, this, sizeof(word));
17564 return word;
17565 }
17566 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const
17567 {
17568 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode);
17569 }
17570 CONSTEXPR npu_set_ofm_depth_m1_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value)
17571 {
17572 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
17573 return *this;
17574 }
17575 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
17576 {
17577 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
17578 }
17579 CONSTEXPR npu_set_ofm_depth_m1_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
17580 {
17581 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
17582 return *this;
17583 }
17584 CONSTEXPR uint32_t get_depth_m1() const
17585 {
17586 return static_cast<uint32_t>(depth_m1);
17587 }
17588 CONSTEXPR npu_set_ofm_depth_m1_t &set_depth_m1(uint32_t value)
17589 {
17590 depth_m1 = static_cast<uint16_t>(value) & ((1U << 16) - 1);
17591 return *this;
17592 }
17593#ifdef NPU_DISASSEMBLE
17594 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
17595 {
17596 fields.push_back(std::make_pair<std::string, std::string>("depth_m1", std::to_string(depth_m1)));
17597 }
17598#endif
17599#endif
17600 };
17601 // OFM Precision
17602 struct npu_set_ofm_precision_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020017603 {
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020017604#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020017605 private:
17606#endif
17607 uint32_t opcode : 10; // opcode
17608 uint32_t reserved0 : 4;
17609 uint32_t control : 2; // control
17610 uint32_t activation_type : 1; // OFM type
17611 uint32_t activation_precision : 2; // OFM precision
17612 uint32_t reserved1 : 3;
17613 uint32_t activation_format : 2; // OFM format
17614 uint32_t scale_mode : 1; // OFM scale mode
17615 uint32_t reserved2 : 5;
17616 uint32_t round_mode : 2; // OFM round mode
17617#ifdef __cplusplus
17618 public:
17619 npu_set_ofm_precision_t(NPU_NAMESPACE::activation_type _activation_type,
17620 NPU_NAMESPACE::activation_precision _activation_precision,
17621 NPU_NAMESPACE::activation_format _activation_format,
17622 NPU_NAMESPACE::ofm_scale_mode _scale_mode,
17623 NPU_NAMESPACE::round_mode _round_mode) :
17624 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_OFM_PRECISION)),
17625 reserved0(0), control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)),
17626 activation_type(static_cast<uint8_t>(_activation_type) & ((1U << 1) - 1)),
17627 activation_precision(static_cast<uint8_t>(_activation_precision) & ((1U << 2) - 1)), reserved1(0),
17628 activation_format(static_cast<uint8_t>(_activation_format) & ((1U << 2) - 1)),
17629 scale_mode(static_cast<uint8_t>(_scale_mode) & ((1U << 1) - 1)), reserved2(0),
17630 round_mode(static_cast<uint8_t>(_round_mode) & ((1U << 2) - 1))
17631 {
17632 }
17633 CONSTEXPR npu_set_ofm_precision_t() :
17634 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_OFM_PRECISION)), reserved0(0),
17635 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), activation_type(0),
17636 activation_precision(0), reserved1(0), activation_format(0), scale_mode(0), reserved2(0), round_mode(0)
17637 {
17638 }
17639 CONSTEXPR bool valid() const
17640 {
17641 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_OFM_PRECISION) &&
17642 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
17643 }
17644 CONSTEXPR void init()
17645 {
17646 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_OFM_PRECISION);
17647 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
17648 }
17649 operator uint32_t()
17650 {
17651 uint32_t word;
17652 std::memcpy(&word, this, sizeof(word));
17653 return word;
17654 }
17655 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const
17656 {
17657 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode);
17658 }
17659 CONSTEXPR npu_set_ofm_precision_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value)
17660 {
17661 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
17662 return *this;
17663 }
17664 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
17665 {
17666 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
17667 }
17668 CONSTEXPR npu_set_ofm_precision_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
17669 {
17670 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
17671 return *this;
17672 }
17673 CONSTEXPR NPU_NAMESPACE::activation_type get_activation_type() const
17674 {
17675 return static_cast<NPU_NAMESPACE::activation_type>(activation_type);
17676 }
17677 CONSTEXPR npu_set_ofm_precision_t &set_activation_type(NPU_NAMESPACE::activation_type value)
17678 {
17679 activation_type = static_cast<uint8_t>(value) & ((1U << 1) - 1);
17680 return *this;
17681 }
17682 CONSTEXPR NPU_NAMESPACE::activation_precision get_activation_precision() const
17683 {
17684 return static_cast<NPU_NAMESPACE::activation_precision>(activation_precision);
17685 }
17686 CONSTEXPR npu_set_ofm_precision_t &set_activation_precision(NPU_NAMESPACE::activation_precision value)
17687 {
17688 activation_precision = static_cast<uint8_t>(value) & ((1U << 2) - 1);
17689 return *this;
17690 }
17691 CONSTEXPR NPU_NAMESPACE::activation_format get_activation_format() const
17692 {
17693 return static_cast<NPU_NAMESPACE::activation_format>(activation_format);
17694 }
17695 CONSTEXPR npu_set_ofm_precision_t &set_activation_format(NPU_NAMESPACE::activation_format value)
17696 {
17697 activation_format = static_cast<uint8_t>(value) & ((1U << 2) - 1);
17698 return *this;
17699 }
17700 CONSTEXPR NPU_NAMESPACE::ofm_scale_mode get_scale_mode() const
17701 {
17702 return static_cast<NPU_NAMESPACE::ofm_scale_mode>(scale_mode);
17703 }
17704 CONSTEXPR npu_set_ofm_precision_t &set_scale_mode(NPU_NAMESPACE::ofm_scale_mode value)
17705 {
17706 scale_mode = static_cast<uint8_t>(value) & ((1U << 1) - 1);
17707 return *this;
17708 }
17709 CONSTEXPR NPU_NAMESPACE::round_mode get_round_mode() const
17710 {
17711 return static_cast<NPU_NAMESPACE::round_mode>(round_mode);
17712 }
17713 CONSTEXPR npu_set_ofm_precision_t &set_round_mode(NPU_NAMESPACE::round_mode value)
17714 {
17715 round_mode = static_cast<uint8_t>(value) & ((1U << 2) - 1);
17716 return *this;
17717 }
17718#ifdef NPU_DISASSEMBLE
17719 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
17720 {
17721 fields.push_back(std::make_pair<std::string, std::string>(
17722 "activation_type",
17723 (activation_type < (sizeof(activation_type_str) / sizeof(activation_type_str[0])) ?
17724 activation_type_str[activation_type] :
17725 "****")));
17726 fields.push_back(std::make_pair<std::string, std::string>(
17727 "activation_precision",
17728 (activation_precision < (sizeof(activation_precision_str) / sizeof(activation_precision_str[0])) ?
17729 activation_precision_str[activation_precision] :
17730 "****")));
17731 fields.push_back(std::make_pair<std::string, std::string>(
17732 "activation_format",
17733 (activation_format < (sizeof(activation_format_str) / sizeof(activation_format_str[0])) ?
17734 activation_format_str[activation_format] :
17735 "****")));
17736 fields.push_back(std::make_pair<std::string, std::string>(
17737 "scale_mode",
17738 (scale_mode < (sizeof(ofm_scale_mode_str) / sizeof(ofm_scale_mode_str[0])) ?
17739 ofm_scale_mode_str[scale_mode] :
17740 "****")));
17741 fields.push_back(std::make_pair<std::string, std::string>(
17742 "round_mode",
17743 (round_mode < (sizeof(round_mode_str) / sizeof(round_mode_str[0])) ? round_mode_str[round_mode] :
17744 "****")));
17745 }
17746#endif
17747#endif
17748 };
17749 // OFM block width
17750 struct npu_set_ofm_blk_width_m1_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020017751 {
Jonny Svärd136810f2021-10-13 16:04:26 +020017752#ifdef __cplusplus
17753 private:
17754#endif
17755 uint32_t opcode : 10; // opcode
17756 uint32_t reserved0 : 4;
17757 uint32_t control : 2; // control
17758 uint32_t width_m1 : 6; // OFM block width
17759 uint32_t reserved1 : 10;
17760#ifdef __cplusplus
17761 public:
17762 npu_set_ofm_blk_width_m1_t(uint32_t _width_m1) :
17763 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_OFM_BLK_WIDTH_M1)), reserved0(0),
17764 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)),
17765 width_m1(static_cast<uint8_t>(_width_m1) & ((1U << 6) - 1)), reserved1(0)
17766 {
17767 }
17768 CONSTEXPR npu_set_ofm_blk_width_m1_t() :
17769 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_OFM_BLK_WIDTH_M1)), reserved0(0),
17770 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), width_m1(0), reserved1(0)
17771 {
17772 }
17773 CONSTEXPR bool valid() const
17774 {
17775 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_OFM_BLK_WIDTH_M1) &&
17776 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
17777 }
17778 CONSTEXPR void init()
17779 {
17780 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_OFM_BLK_WIDTH_M1);
17781 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
17782 }
17783 operator uint32_t()
17784 {
17785 uint32_t word;
17786 std::memcpy(&word, this, sizeof(word));
17787 return word;
17788 }
17789 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const
17790 {
17791 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode);
17792 }
17793 CONSTEXPR npu_set_ofm_blk_width_m1_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value)
17794 {
17795 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
17796 return *this;
17797 }
17798 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
17799 {
17800 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
17801 }
17802 CONSTEXPR npu_set_ofm_blk_width_m1_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
17803 {
17804 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
17805 return *this;
17806 }
17807 CONSTEXPR uint32_t get_width_m1() const
17808 {
17809 return static_cast<uint32_t>(width_m1);
17810 }
17811 CONSTEXPR npu_set_ofm_blk_width_m1_t &set_width_m1(uint32_t value)
17812 {
17813 width_m1 = static_cast<uint8_t>(value) & ((1U << 6) - 1);
17814 return *this;
17815 }
17816#ifdef NPU_DISASSEMBLE
17817 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
17818 {
17819 fields.push_back(std::make_pair<std::string, std::string>("width_m1", std::to_string(width_m1)));
17820 }
17821#endif
17822#endif
17823 };
17824 // OFM block height
17825 struct npu_set_ofm_blk_height_m1_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020017826 {
Jonny Svärd136810f2021-10-13 16:04:26 +020017827#ifdef __cplusplus
17828 private:
17829#endif
17830 uint32_t opcode : 10; // opcode
17831 uint32_t reserved0 : 4;
17832 uint32_t control : 2; // control
17833 uint32_t height_m1 : 5; // OFM block height
17834 uint32_t reserved1 : 11;
17835#ifdef __cplusplus
17836 public:
17837 npu_set_ofm_blk_height_m1_t(uint32_t _height_m1) :
17838 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_OFM_BLK_HEIGHT_M1)), reserved0(0),
17839 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)),
17840 height_m1(static_cast<uint8_t>(_height_m1) & ((1U << 5) - 1)), reserved1(0)
17841 {
17842 }
17843 CONSTEXPR npu_set_ofm_blk_height_m1_t() :
17844 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_OFM_BLK_HEIGHT_M1)), reserved0(0),
17845 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), height_m1(0), reserved1(0)
17846 {
17847 }
17848 CONSTEXPR bool valid() const
17849 {
17850 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_OFM_BLK_HEIGHT_M1) &&
17851 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
17852 }
17853 CONSTEXPR void init()
17854 {
17855 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_OFM_BLK_HEIGHT_M1);
17856 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
17857 }
17858 operator uint32_t()
17859 {
17860 uint32_t word;
17861 std::memcpy(&word, this, sizeof(word));
17862 return word;
17863 }
17864 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const
17865 {
17866 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode);
17867 }
17868 CONSTEXPR npu_set_ofm_blk_height_m1_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value)
17869 {
17870 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
17871 return *this;
17872 }
17873 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
17874 {
17875 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
17876 }
17877 CONSTEXPR npu_set_ofm_blk_height_m1_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
17878 {
17879 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
17880 return *this;
17881 }
17882 CONSTEXPR uint32_t get_height_m1() const
17883 {
17884 return static_cast<uint32_t>(height_m1);
17885 }
17886 CONSTEXPR npu_set_ofm_blk_height_m1_t &set_height_m1(uint32_t value)
17887 {
17888 height_m1 = static_cast<uint8_t>(value) & ((1U << 5) - 1);
17889 return *this;
17890 }
17891#ifdef NPU_DISASSEMBLE
17892 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
17893 {
17894 fields.push_back(std::make_pair<std::string, std::string>("height_m1", std::to_string(height_m1)));
17895 }
17896#endif
17897#endif
17898 };
17899 // OFM block depth
17900 struct npu_set_ofm_blk_depth_m1_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020017901 {
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020017902#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020017903 private:
17904#endif
17905 uint32_t opcode : 10; // opcode
17906 uint32_t reserved0 : 4;
17907 uint32_t control : 2; // control
17908 uint32_t depth_m1 : 7; // OFM block depth
17909 uint32_t reserved1 : 9;
17910#ifdef __cplusplus
17911 public:
17912 npu_set_ofm_blk_depth_m1_t(uint32_t _depth_m1) :
17913 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_OFM_BLK_DEPTH_M1)), reserved0(0),
17914 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)),
17915 depth_m1(static_cast<uint8_t>(_depth_m1) & ((1U << 7) - 1)), reserved1(0)
17916 {
17917 }
17918 CONSTEXPR npu_set_ofm_blk_depth_m1_t() :
17919 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_OFM_BLK_DEPTH_M1)), reserved0(0),
17920 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), depth_m1(0), reserved1(0)
17921 {
17922 }
17923 CONSTEXPR bool valid() const
17924 {
17925 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_OFM_BLK_DEPTH_M1) &&
17926 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
17927 }
17928 CONSTEXPR void init()
17929 {
17930 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_OFM_BLK_DEPTH_M1);
17931 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
17932 }
17933 operator uint32_t()
17934 {
17935 uint32_t word;
17936 std::memcpy(&word, this, sizeof(word));
17937 return word;
17938 }
17939 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const
17940 {
17941 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode);
17942 }
17943 CONSTEXPR npu_set_ofm_blk_depth_m1_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value)
17944 {
17945 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
17946 return *this;
17947 }
17948 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
17949 {
17950 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
17951 }
17952 CONSTEXPR npu_set_ofm_blk_depth_m1_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
17953 {
17954 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
17955 return *this;
17956 }
17957 CONSTEXPR uint32_t get_depth_m1() const
17958 {
17959 return static_cast<uint32_t>(depth_m1);
17960 }
17961 CONSTEXPR npu_set_ofm_blk_depth_m1_t &set_depth_m1(uint32_t value)
17962 {
17963 depth_m1 = static_cast<uint8_t>(value) & ((1U << 7) - 1);
17964 return *this;
17965 }
17966#ifdef NPU_DISASSEMBLE
17967 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
17968 {
17969 fields.push_back(std::make_pair<std::string, std::string>("depth_m1", std::to_string(depth_m1)));
17970 }
17971#endif
17972#endif
17973 };
17974 // OFM zero point
17975 struct npu_set_ofm_zero_point_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020017976 {
Jonny Svärd136810f2021-10-13 16:04:26 +020017977#ifdef __cplusplus
17978 private:
17979#endif
17980 uint32_t opcode : 10; // opcode
17981 uint32_t reserved0 : 4;
17982 uint32_t control : 2; // control
17983 uint32_t zero_point : 16; // Zero point offset
17984#ifdef __cplusplus
17985 public:
17986 npu_set_ofm_zero_point_t(uint32_t _zero_point) :
17987 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_OFM_ZERO_POINT)), reserved0(0),
17988 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)),
17989 zero_point(static_cast<uint16_t>(_zero_point) & ((1U << 16) - 1))
17990 {
17991 }
17992 CONSTEXPR npu_set_ofm_zero_point_t() :
17993 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_OFM_ZERO_POINT)), reserved0(0),
17994 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), zero_point(0)
17995 {
17996 }
17997 CONSTEXPR bool valid() const
17998 {
17999 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_OFM_ZERO_POINT) &&
18000 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
18001 }
18002 CONSTEXPR void init()
18003 {
18004 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_OFM_ZERO_POINT);
18005 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
18006 }
18007 operator uint32_t()
18008 {
18009 uint32_t word;
18010 std::memcpy(&word, this, sizeof(word));
18011 return word;
18012 }
18013 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const
18014 {
18015 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode);
18016 }
18017 CONSTEXPR npu_set_ofm_zero_point_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value)
18018 {
18019 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
18020 return *this;
18021 }
18022 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
18023 {
18024 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
18025 }
18026 CONSTEXPR npu_set_ofm_zero_point_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
18027 {
18028 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
18029 return *this;
18030 }
18031 CONSTEXPR uint32_t get_zero_point() const
18032 {
18033 return static_cast<uint32_t>(zero_point);
18034 }
18035 CONSTEXPR npu_set_ofm_zero_point_t &set_zero_point(uint32_t value)
18036 {
18037 zero_point = static_cast<uint16_t>(value) & ((1U << 16) - 1);
18038 return *this;
18039 }
18040#ifdef NPU_DISASSEMBLE
18041 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
18042 {
18043 fields.push_back(std::make_pair<std::string, std::string>("zero_point", std::to_string(zero_point)));
18044 }
18045#endif
18046#endif
18047 };
18048 // OFM Tile 0 and tile 2 width
18049 struct npu_set_ofm_width0_m1_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020018050 {
Jonny Svärd136810f2021-10-13 16:04:26 +020018051#ifdef __cplusplus
18052 private:
18053#endif
18054 uint32_t opcode : 10; // opcode
18055 uint32_t reserved0 : 4;
18056 uint32_t control : 2; // control
18057 uint32_t width_m1 : 16; // OFM Tile 0 and tile 2 width
18058#ifdef __cplusplus
18059 public:
18060 npu_set_ofm_width0_m1_t(uint32_t _width_m1) :
18061 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_OFM_WIDTH0_M1)), reserved0(0),
18062 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)),
18063 width_m1(static_cast<uint16_t>(_width_m1) & ((1U << 16) - 1))
18064 {
18065 }
18066 CONSTEXPR npu_set_ofm_width0_m1_t() :
18067 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_OFM_WIDTH0_M1)), reserved0(0),
18068 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), width_m1(0)
18069 {
18070 }
18071 CONSTEXPR bool valid() const
18072 {
18073 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_OFM_WIDTH0_M1) &&
18074 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
18075 }
18076 CONSTEXPR void init()
18077 {
18078 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_OFM_WIDTH0_M1);
18079 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
18080 }
18081 operator uint32_t()
18082 {
18083 uint32_t word;
18084 std::memcpy(&word, this, sizeof(word));
18085 return word;
18086 }
18087 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const
18088 {
18089 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode);
18090 }
18091 CONSTEXPR npu_set_ofm_width0_m1_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value)
18092 {
18093 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
18094 return *this;
18095 }
18096 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
18097 {
18098 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
18099 }
18100 CONSTEXPR npu_set_ofm_width0_m1_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
18101 {
18102 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
18103 return *this;
18104 }
18105 CONSTEXPR uint32_t get_width_m1() const
18106 {
18107 return static_cast<uint32_t>(width_m1);
18108 }
18109 CONSTEXPR npu_set_ofm_width0_m1_t &set_width_m1(uint32_t value)
18110 {
18111 width_m1 = static_cast<uint16_t>(value) & ((1U << 16) - 1);
18112 return *this;
18113 }
18114#ifdef NPU_DISASSEMBLE
18115 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
18116 {
18117 fields.push_back(std::make_pair<std::string, std::string>("width_m1", std::to_string(width_m1)));
18118 }
18119#endif
18120#endif
18121 };
18122 // OFM Tile 0 height
18123 struct npu_set_ofm_height0_m1_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020018124 {
Jonny Svärd136810f2021-10-13 16:04:26 +020018125#ifdef __cplusplus
18126 private:
18127#endif
18128 uint32_t opcode : 10; // opcode
18129 uint32_t reserved0 : 4;
18130 uint32_t control : 2; // control
18131 uint32_t height_m1 : 16; // OFM Tile 0 height
18132#ifdef __cplusplus
18133 public:
18134 npu_set_ofm_height0_m1_t(uint32_t _height_m1) :
18135 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_OFM_HEIGHT0_M1)), reserved0(0),
18136 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)),
18137 height_m1(static_cast<uint16_t>(_height_m1) & ((1U << 16) - 1))
18138 {
18139 }
18140 CONSTEXPR npu_set_ofm_height0_m1_t() :
18141 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_OFM_HEIGHT0_M1)), reserved0(0),
18142 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), height_m1(0)
18143 {
18144 }
18145 CONSTEXPR bool valid() const
18146 {
18147 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_OFM_HEIGHT0_M1) &&
18148 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
18149 }
18150 CONSTEXPR void init()
18151 {
18152 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_OFM_HEIGHT0_M1);
18153 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
18154 }
18155 operator uint32_t()
18156 {
18157 uint32_t word;
18158 std::memcpy(&word, this, sizeof(word));
18159 return word;
18160 }
18161 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const
18162 {
18163 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode);
18164 }
18165 CONSTEXPR npu_set_ofm_height0_m1_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value)
18166 {
18167 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
18168 return *this;
18169 }
18170 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
18171 {
18172 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
18173 }
18174 CONSTEXPR npu_set_ofm_height0_m1_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
18175 {
18176 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
18177 return *this;
18178 }
18179 CONSTEXPR uint32_t get_height_m1() const
18180 {
18181 return static_cast<uint32_t>(height_m1);
18182 }
18183 CONSTEXPR npu_set_ofm_height0_m1_t &set_height_m1(uint32_t value)
18184 {
18185 height_m1 = static_cast<uint16_t>(value) & ((1U << 16) - 1);
18186 return *this;
18187 }
18188#ifdef NPU_DISASSEMBLE
18189 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
18190 {
18191 fields.push_back(std::make_pair<std::string, std::string>("height_m1", std::to_string(height_m1)));
18192 }
18193#endif
18194#endif
18195 };
18196 // OFM Tile 1 height
18197 struct npu_set_ofm_height1_m1_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020018198 {
Jonny Svärd136810f2021-10-13 16:04:26 +020018199#ifdef __cplusplus
18200 private:
18201#endif
18202 uint32_t opcode : 10; // opcode
18203 uint32_t reserved0 : 4;
18204 uint32_t control : 2; // control
18205 uint32_t height_m1 : 16; // OFM Tile 1 height
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020018206#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020018207 public:
18208 npu_set_ofm_height1_m1_t(uint32_t _height_m1) :
18209 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_OFM_HEIGHT1_M1)), reserved0(0),
18210 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)),
18211 height_m1(static_cast<uint16_t>(_height_m1) & ((1U << 16) - 1))
18212 {
18213 }
18214 CONSTEXPR npu_set_ofm_height1_m1_t() :
18215 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_OFM_HEIGHT1_M1)), reserved0(0),
18216 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), height_m1(0)
18217 {
18218 }
18219 CONSTEXPR bool valid() const
18220 {
18221 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_OFM_HEIGHT1_M1) &&
18222 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
18223 }
18224 CONSTEXPR void init()
18225 {
18226 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_OFM_HEIGHT1_M1);
18227 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
18228 }
18229 operator uint32_t()
18230 {
18231 uint32_t word;
18232 std::memcpy(&word, this, sizeof(word));
18233 return word;
18234 }
18235 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const
18236 {
18237 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode);
18238 }
18239 CONSTEXPR npu_set_ofm_height1_m1_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value)
18240 {
18241 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
18242 return *this;
18243 }
18244 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
18245 {
18246 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
18247 }
18248 CONSTEXPR npu_set_ofm_height1_m1_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
18249 {
18250 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
18251 return *this;
18252 }
18253 CONSTEXPR uint32_t get_height_m1() const
18254 {
18255 return static_cast<uint32_t>(height_m1);
18256 }
18257 CONSTEXPR npu_set_ofm_height1_m1_t &set_height_m1(uint32_t value)
18258 {
18259 height_m1 = static_cast<uint16_t>(value) & ((1U << 16) - 1);
18260 return *this;
18261 }
18262#ifdef NPU_DISASSEMBLE
18263 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
18264 {
18265 fields.push_back(std::make_pair<std::string, std::string>("height_m1", std::to_string(height_m1)));
18266 }
18267#endif
18268#endif
18269 };
18270 // Index n for OFM access
18271 struct npu_set_ofm_region_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020018272 {
Jonny Svärd136810f2021-10-13 16:04:26 +020018273#ifdef __cplusplus
18274 private:
18275#endif
18276 uint32_t opcode : 10; // opcode
18277 uint32_t reserved0 : 4;
18278 uint32_t control : 2; // control
18279 uint32_t region : 3; // Index n for OFM access
18280 uint32_t reserved1 : 12;
18281 uint32_t custom_dma_cs : 1; // Custom DMA select
18282#ifdef __cplusplus
18283 public:
18284 npu_set_ofm_region_t(uint32_t _region, NPU_NAMESPACE::custom_dma_cs _custom_dma_cs) :
18285 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_OFM_REGION)), reserved0(0),
18286 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)),
18287 region(static_cast<uint8_t>(_region) & ((1U << 3) - 1)), reserved1(0),
18288 custom_dma_cs(static_cast<uint8_t>(_custom_dma_cs) & ((1U << 1) - 1))
18289 {
18290 }
18291 CONSTEXPR npu_set_ofm_region_t() :
18292 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_OFM_REGION)), reserved0(0),
18293 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), region(0), reserved1(0), custom_dma_cs(0)
18294 {
18295 }
18296 CONSTEXPR bool valid() const
18297 {
18298 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_OFM_REGION) &&
18299 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
18300 }
18301 CONSTEXPR void init()
18302 {
18303 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_OFM_REGION);
18304 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
18305 }
18306 operator uint32_t()
18307 {
18308 uint32_t word;
18309 std::memcpy(&word, this, sizeof(word));
18310 return word;
18311 }
18312 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const
18313 {
18314 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode);
18315 }
18316 CONSTEXPR npu_set_ofm_region_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value)
18317 {
18318 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
18319 return *this;
18320 }
18321 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
18322 {
18323 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
18324 }
18325 CONSTEXPR npu_set_ofm_region_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
18326 {
18327 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
18328 return *this;
18329 }
18330 CONSTEXPR uint32_t get_region() const
18331 {
18332 return static_cast<uint32_t>(region);
18333 }
18334 CONSTEXPR npu_set_ofm_region_t &set_region(uint32_t value)
18335 {
18336 region = static_cast<uint8_t>(value) & ((1U << 3) - 1);
18337 return *this;
18338 }
18339 CONSTEXPR NPU_NAMESPACE::custom_dma_cs get_custom_dma_cs() const
18340 {
18341 return static_cast<NPU_NAMESPACE::custom_dma_cs>(custom_dma_cs);
18342 }
18343 CONSTEXPR npu_set_ofm_region_t &set_custom_dma_cs(NPU_NAMESPACE::custom_dma_cs value)
18344 {
18345 custom_dma_cs = static_cast<uint8_t>(value) & ((1U << 1) - 1);
18346 return *this;
18347 }
18348#ifdef NPU_DISASSEMBLE
18349 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
18350 {
18351 fields.push_back(std::make_pair<std::string, std::string>("region", std::to_string(region)));
18352 fields.push_back(std::make_pair<std::string, std::string>(
18353 "custom_dma_cs",
18354 (custom_dma_cs < (sizeof(custom_dma_cs_str) / sizeof(custom_dma_cs_str[0])) ?
18355 custom_dma_cs_str[custom_dma_cs] :
18356 "****")));
18357 }
18358#endif
18359#endif
18360 };
18361 // Kernel width
18362 struct npu_set_kernel_width_m1_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020018363 {
Jonny Svärd136810f2021-10-13 16:04:26 +020018364#ifdef __cplusplus
18365 private:
18366#endif
18367 uint32_t opcode : 10; // opcode
18368 uint32_t reserved0 : 4;
18369 uint32_t control : 2; // control
18370 uint32_t width_m1 : 16; // Kernel width
18371#ifdef __cplusplus
18372 public:
18373 npu_set_kernel_width_m1_t(uint32_t _width_m1) :
18374 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_KERNEL_WIDTH_M1)), reserved0(0),
18375 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)),
18376 width_m1(static_cast<uint16_t>(_width_m1) & ((1U << 16) - 1))
18377 {
18378 }
18379 CONSTEXPR npu_set_kernel_width_m1_t() :
18380 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_KERNEL_WIDTH_M1)), reserved0(0),
18381 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), width_m1(0)
18382 {
18383 }
18384 CONSTEXPR bool valid() const
18385 {
18386 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_KERNEL_WIDTH_M1) &&
18387 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
18388 }
18389 CONSTEXPR void init()
18390 {
18391 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_KERNEL_WIDTH_M1);
18392 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
18393 }
18394 operator uint32_t()
18395 {
18396 uint32_t word;
18397 std::memcpy(&word, this, sizeof(word));
18398 return word;
18399 }
18400 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const
18401 {
18402 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode);
18403 }
18404 CONSTEXPR npu_set_kernel_width_m1_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value)
18405 {
18406 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
18407 return *this;
18408 }
18409 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
18410 {
18411 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
18412 }
18413 CONSTEXPR npu_set_kernel_width_m1_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
18414 {
18415 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
18416 return *this;
18417 }
18418 CONSTEXPR uint32_t get_width_m1() const
18419 {
18420 return static_cast<uint32_t>(width_m1);
18421 }
18422 CONSTEXPR npu_set_kernel_width_m1_t &set_width_m1(uint32_t value)
18423 {
18424 width_m1 = static_cast<uint16_t>(value) & ((1U << 16) - 1);
18425 return *this;
18426 }
18427#ifdef NPU_DISASSEMBLE
18428 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
18429 {
18430 fields.push_back(std::make_pair<std::string, std::string>("width_m1", std::to_string(width_m1)));
18431 }
18432#endif
18433#endif
18434 };
18435 // Kernel height
18436 struct npu_set_kernel_height_m1_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020018437 {
Jonny Svärd136810f2021-10-13 16:04:26 +020018438#ifdef __cplusplus
18439 private:
18440#endif
18441 uint32_t opcode : 10; // opcode
18442 uint32_t reserved0 : 4;
18443 uint32_t control : 2; // control
18444 uint32_t height_m1 : 16; // Kernel height
18445#ifdef __cplusplus
18446 public:
18447 npu_set_kernel_height_m1_t(uint32_t _height_m1) :
18448 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_KERNEL_HEIGHT_M1)), reserved0(0),
18449 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)),
18450 height_m1(static_cast<uint16_t>(_height_m1) & ((1U << 16) - 1))
18451 {
18452 }
18453 CONSTEXPR npu_set_kernel_height_m1_t() :
18454 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_KERNEL_HEIGHT_M1)), reserved0(0),
18455 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), height_m1(0)
18456 {
18457 }
18458 CONSTEXPR bool valid() const
18459 {
18460 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_KERNEL_HEIGHT_M1) &&
18461 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
18462 }
18463 CONSTEXPR void init()
18464 {
18465 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_KERNEL_HEIGHT_M1);
18466 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
18467 }
18468 operator uint32_t()
18469 {
18470 uint32_t word;
18471 std::memcpy(&word, this, sizeof(word));
18472 return word;
18473 }
18474 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const
18475 {
18476 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode);
18477 }
18478 CONSTEXPR npu_set_kernel_height_m1_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value)
18479 {
18480 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
18481 return *this;
18482 }
18483 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
18484 {
18485 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
18486 }
18487 CONSTEXPR npu_set_kernel_height_m1_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
18488 {
18489 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
18490 return *this;
18491 }
18492 CONSTEXPR uint32_t get_height_m1() const
18493 {
18494 return static_cast<uint32_t>(height_m1);
18495 }
18496 CONSTEXPR npu_set_kernel_height_m1_t &set_height_m1(uint32_t value)
18497 {
18498 height_m1 = static_cast<uint16_t>(value) & ((1U << 16) - 1);
18499 return *this;
18500 }
18501#ifdef NPU_DISASSEMBLE
18502 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
18503 {
18504 fields.push_back(std::make_pair<std::string, std::string>("height_m1", std::to_string(height_m1)));
18505 }
18506#endif
18507#endif
18508 };
18509 // Kernel stride
18510 struct npu_set_kernel_stride_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020018511 {
Jonny Svärd136810f2021-10-13 16:04:26 +020018512#ifdef __cplusplus
18513 private:
18514#endif
18515 uint32_t opcode : 10; // opcode
18516 uint32_t reserved0 : 4;
18517 uint32_t control : 2; // control
18518 uint32_t stride_x_lsb : 1; // Stride x LSB. (kernel_x_stride - 1)[0]
18519 uint32_t stride_y_lsb : 1; // Stride y LSB. (kernel_y_stride - 1)[0]
18520 uint32_t weight_order : 1; // Weight ordering mode
18521 uint32_t dilation_x : 1; // Kernel x dilation
18522 uint32_t dilation_y : 1; // Kernel y dilation
18523 uint32_t decomposition : 1; // Kernel decomposition
18524 uint32_t stride_x_msb : 1; // Stride x MSB. (kernel_x_stride - 1) >> 1
18525 uint32_t reserved1 : 2;
18526 uint32_t stride_y_msb : 1; // Stride y MSB. (kernel_y_stride - 1) >> 1
18527 uint32_t reserved2 : 6;
18528#ifdef __cplusplus
18529 public:
18530 npu_set_kernel_stride_t(uint32_t _stride_x_lsb,
18531 uint32_t _stride_y_lsb,
18532 NPU_NAMESPACE::weight_order _weight_order,
18533 NPU_NAMESPACE::kernel_dilation _dilation_x,
18534 NPU_NAMESPACE::kernel_dilation _dilation_y,
18535 NPU_NAMESPACE::kernel_decomposition _decomposition,
18536 uint32_t _stride_x_msb,
18537 uint32_t _stride_y_msb) :
18538 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_KERNEL_STRIDE)),
18539 reserved0(0), control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)),
18540 stride_x_lsb(static_cast<uint8_t>(_stride_x_lsb) & ((1U << 1) - 1)),
18541 stride_y_lsb(static_cast<uint8_t>(_stride_y_lsb) & ((1U << 1) - 1)),
18542 weight_order(static_cast<uint8_t>(_weight_order) & ((1U << 1) - 1)),
18543 dilation_x(static_cast<uint8_t>(_dilation_x) & ((1U << 1) - 1)),
18544 dilation_y(static_cast<uint8_t>(_dilation_y) & ((1U << 1) - 1)),
18545 decomposition(static_cast<uint8_t>(_decomposition) & ((1U << 1) - 1)),
18546 stride_x_msb(static_cast<uint8_t>(_stride_x_msb) & ((1U << 1) - 1)), reserved1(0),
18547 stride_y_msb(static_cast<uint8_t>(_stride_y_msb) & ((1U << 1) - 1)), reserved2(0)
18548 {
18549 }
18550 CONSTEXPR npu_set_kernel_stride_t() :
18551 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_KERNEL_STRIDE)), reserved0(0),
18552 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), stride_x_lsb(0), stride_y_lsb(0),
18553 weight_order(0), dilation_x(0), dilation_y(0), decomposition(0), stride_x_msb(0), reserved1(0),
18554 stride_y_msb(0), reserved2(0)
18555 {
18556 }
18557 CONSTEXPR bool valid() const
18558 {
18559 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_KERNEL_STRIDE) &&
18560 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
18561 }
18562 CONSTEXPR void init()
18563 {
18564 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_KERNEL_STRIDE);
18565 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
18566 }
18567 operator uint32_t()
18568 {
18569 uint32_t word;
18570 std::memcpy(&word, this, sizeof(word));
18571 return word;
18572 }
18573 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const
18574 {
18575 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode);
18576 }
18577 CONSTEXPR npu_set_kernel_stride_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value)
18578 {
18579 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
18580 return *this;
18581 }
18582 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
18583 {
18584 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
18585 }
18586 CONSTEXPR npu_set_kernel_stride_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
18587 {
18588 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
18589 return *this;
18590 }
18591 CONSTEXPR uint32_t get_stride_x_lsb() const
18592 {
18593 return static_cast<uint32_t>(stride_x_lsb);
18594 }
18595 CONSTEXPR npu_set_kernel_stride_t &set_stride_x_lsb(uint32_t value)
18596 {
18597 stride_x_lsb = static_cast<uint8_t>(value) & ((1U << 1) - 1);
18598 return *this;
18599 }
18600 CONSTEXPR uint32_t get_stride_y_lsb() const
18601 {
18602 return static_cast<uint32_t>(stride_y_lsb);
18603 }
18604 CONSTEXPR npu_set_kernel_stride_t &set_stride_y_lsb(uint32_t value)
18605 {
18606 stride_y_lsb = static_cast<uint8_t>(value) & ((1U << 1) - 1);
18607 return *this;
18608 }
18609 CONSTEXPR NPU_NAMESPACE::weight_order get_weight_order() const
18610 {
18611 return static_cast<NPU_NAMESPACE::weight_order>(weight_order);
18612 }
18613 CONSTEXPR npu_set_kernel_stride_t &set_weight_order(NPU_NAMESPACE::weight_order value)
18614 {
18615 weight_order = static_cast<uint8_t>(value) & ((1U << 1) - 1);
18616 return *this;
18617 }
18618 CONSTEXPR NPU_NAMESPACE::kernel_dilation get_dilation_x() const
18619 {
18620 return static_cast<NPU_NAMESPACE::kernel_dilation>(dilation_x);
18621 }
18622 CONSTEXPR npu_set_kernel_stride_t &set_dilation_x(NPU_NAMESPACE::kernel_dilation value)
18623 {
18624 dilation_x = static_cast<uint8_t>(value) & ((1U << 1) - 1);
18625 return *this;
18626 }
18627 CONSTEXPR NPU_NAMESPACE::kernel_dilation get_dilation_y() const
18628 {
18629 return static_cast<NPU_NAMESPACE::kernel_dilation>(dilation_y);
18630 }
18631 CONSTEXPR npu_set_kernel_stride_t &set_dilation_y(NPU_NAMESPACE::kernel_dilation value)
18632 {
18633 dilation_y = static_cast<uint8_t>(value) & ((1U << 1) - 1);
18634 return *this;
18635 }
18636 CONSTEXPR NPU_NAMESPACE::kernel_decomposition get_decomposition() const
18637 {
18638 return static_cast<NPU_NAMESPACE::kernel_decomposition>(decomposition);
18639 }
18640 CONSTEXPR npu_set_kernel_stride_t &set_decomposition(NPU_NAMESPACE::kernel_decomposition value)
18641 {
18642 decomposition = static_cast<uint8_t>(value) & ((1U << 1) - 1);
18643 return *this;
18644 }
18645 CONSTEXPR uint32_t get_stride_x_msb() const
18646 {
18647 return static_cast<uint32_t>(stride_x_msb);
18648 }
18649 CONSTEXPR npu_set_kernel_stride_t &set_stride_x_msb(uint32_t value)
18650 {
18651 stride_x_msb = static_cast<uint8_t>(value) & ((1U << 1) - 1);
18652 return *this;
18653 }
18654 CONSTEXPR uint32_t get_stride_y_msb() const
18655 {
18656 return static_cast<uint32_t>(stride_y_msb);
18657 }
18658 CONSTEXPR npu_set_kernel_stride_t &set_stride_y_msb(uint32_t value)
18659 {
18660 stride_y_msb = static_cast<uint8_t>(value) & ((1U << 1) - 1);
18661 return *this;
18662 }
18663#ifdef NPU_DISASSEMBLE
18664 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
18665 {
18666 fields.push_back(std::make_pair<std::string, std::string>("stride_x_lsb", std::to_string(stride_x_lsb)));
18667 fields.push_back(std::make_pair<std::string, std::string>("stride_y_lsb", std::to_string(stride_y_lsb)));
18668 fields.push_back(std::make_pair<std::string, std::string>(
18669 "weight_order",
18670 (weight_order < (sizeof(weight_order_str) / sizeof(weight_order_str[0])) ?
18671 weight_order_str[weight_order] :
18672 "****")));
18673 fields.push_back(std::make_pair<std::string, std::string>(
18674 "dilation_x",
18675 (dilation_x < (sizeof(kernel_dilation_str) / sizeof(kernel_dilation_str[0])) ?
18676 kernel_dilation_str[dilation_x] :
18677 "****")));
18678 fields.push_back(std::make_pair<std::string, std::string>(
18679 "dilation_y",
18680 (dilation_y < (sizeof(kernel_dilation_str) / sizeof(kernel_dilation_str[0])) ?
18681 kernel_dilation_str[dilation_y] :
18682 "****")));
18683 fields.push_back(std::make_pair<std::string, std::string>(
18684 "decomposition",
18685 (decomposition < (sizeof(kernel_decomposition_str) / sizeof(kernel_decomposition_str[0])) ?
18686 kernel_decomposition_str[decomposition] :
18687 "****")));
18688 fields.push_back(std::make_pair<std::string, std::string>("stride_x_msb", std::to_string(stride_x_msb)));
18689 fields.push_back(std::make_pair<std::string, std::string>("stride_y_msb", std::to_string(stride_y_msb)));
18690 }
18691#endif
18692#endif
18693 };
18694 // Accumulator format
18695 struct npu_set_acc_format_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020018696 {
Jonny Svärd136810f2021-10-13 16:04:26 +020018697#ifdef __cplusplus
18698 private:
18699#endif
18700 uint32_t opcode : 10; // opcode
18701 uint32_t reserved0 : 4;
18702 uint32_t control : 2; // control
18703 uint32_t acc_format : 2; // Accumulator format
18704 uint32_t reserved1 : 14;
18705#ifdef __cplusplus
18706 public:
18707 npu_set_acc_format_t(NPU_NAMESPACE::acc_format _acc_format) :
18708 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_ACC_FORMAT)), reserved0(0),
18709 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)),
18710 acc_format(static_cast<uint8_t>(_acc_format) & ((1U << 2) - 1)), reserved1(0)
18711 {
18712 }
18713 CONSTEXPR npu_set_acc_format_t() :
18714 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_ACC_FORMAT)), reserved0(0),
18715 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), acc_format(0), reserved1(0)
18716 {
18717 }
18718 CONSTEXPR bool valid() const
18719 {
18720 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_ACC_FORMAT) &&
18721 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
18722 }
18723 CONSTEXPR void init()
18724 {
18725 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_ACC_FORMAT);
18726 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
18727 }
18728 operator uint32_t()
18729 {
18730 uint32_t word;
18731 std::memcpy(&word, this, sizeof(word));
18732 return word;
18733 }
18734 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const
18735 {
18736 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode);
18737 }
18738 CONSTEXPR npu_set_acc_format_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value)
18739 {
18740 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
18741 return *this;
18742 }
18743 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
18744 {
18745 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
18746 }
18747 CONSTEXPR npu_set_acc_format_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
18748 {
18749 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
18750 return *this;
18751 }
18752 CONSTEXPR NPU_NAMESPACE::acc_format get_acc_format() const
18753 {
18754 return static_cast<NPU_NAMESPACE::acc_format>(acc_format);
18755 }
18756 CONSTEXPR npu_set_acc_format_t &set_acc_format(NPU_NAMESPACE::acc_format value)
18757 {
18758 acc_format = static_cast<uint8_t>(value) & ((1U << 2) - 1);
18759 return *this;
18760 }
18761#ifdef NPU_DISASSEMBLE
18762 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
18763 {
18764 fields.push_back(std::make_pair<std::string, std::string>(
18765 "acc_format",
18766 (acc_format < (sizeof(acc_format_str) / sizeof(acc_format_str[0])) ? acc_format_str[acc_format] :
18767 "****")));
18768 }
18769#endif
18770#endif
18771 };
18772 // Activation function and clip range
18773 struct npu_set_activation_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020018774 {
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020018775#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020018776 private:
18777#endif
18778 uint32_t opcode : 10; // opcode
18779 uint32_t reserved0 : 4;
18780 uint32_t control : 2; // control
18781 uint32_t activation_function : 5; // Activation function (before table lookup)
18782 uint32_t reserved1 : 7;
18783 uint32_t activation_clip_range : 3; // Activation clip range. This must be set to 0 if table lookup is not used
18784 uint32_t reserved2 : 1;
18785#ifdef __cplusplus
18786 public:
18787 npu_set_activation_t(NPU_NAMESPACE::activation_function _activation_function,
18788 NPU_NAMESPACE::activation_clip_range _activation_clip_range) :
18789 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_ACTIVATION)),
18790 reserved0(0), control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)),
18791 activation_function(static_cast<uint8_t>(_activation_function) & ((1U << 5) - 1)), reserved1(0),
18792 activation_clip_range(static_cast<uint8_t>(_activation_clip_range) & ((1U << 3) - 1)), reserved2(0)
18793 {
18794 }
18795 CONSTEXPR npu_set_activation_t() :
18796 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_ACTIVATION)), reserved0(0),
18797 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), activation_function(0), reserved1(0),
18798 activation_clip_range(0), reserved2(0)
18799 {
18800 }
18801 CONSTEXPR bool valid() const
18802 {
18803 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_ACTIVATION) &&
18804 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
18805 }
18806 CONSTEXPR void init()
18807 {
18808 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_ACTIVATION);
18809 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
18810 }
18811 operator uint32_t()
18812 {
18813 uint32_t word;
18814 std::memcpy(&word, this, sizeof(word));
18815 return word;
18816 }
18817 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const
18818 {
18819 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode);
18820 }
18821 CONSTEXPR npu_set_activation_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value)
18822 {
18823 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
18824 return *this;
18825 }
18826 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
18827 {
18828 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
18829 }
18830 CONSTEXPR npu_set_activation_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
18831 {
18832 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
18833 return *this;
18834 }
18835 CONSTEXPR NPU_NAMESPACE::activation_function get_activation_function() const
18836 {
18837 return static_cast<NPU_NAMESPACE::activation_function>(activation_function);
18838 }
18839 CONSTEXPR npu_set_activation_t &set_activation_function(NPU_NAMESPACE::activation_function value)
18840 {
18841 activation_function = static_cast<uint8_t>(value) & ((1U << 5) - 1);
18842 return *this;
18843 }
18844 CONSTEXPR NPU_NAMESPACE::activation_clip_range get_activation_clip_range() const
18845 {
18846 return static_cast<NPU_NAMESPACE::activation_clip_range>(activation_clip_range);
18847 }
18848 CONSTEXPR npu_set_activation_t &set_activation_clip_range(NPU_NAMESPACE::activation_clip_range value)
18849 {
18850 activation_clip_range = static_cast<uint8_t>(value) & ((1U << 3) - 1);
18851 return *this;
18852 }
18853#ifdef NPU_DISASSEMBLE
18854 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
18855 {
18856 fields.push_back(std::make_pair<std::string, std::string>(
18857 "activation_function",
18858 (activation_function < (sizeof(activation_function_str) / sizeof(activation_function_str[0])) ?
18859 activation_function_str[activation_function] :
18860 "****")));
18861 fields.push_back(std::make_pair<std::string, std::string>(
18862 "activation_clip_range",
18863 (activation_clip_range < (sizeof(activation_clip_range_str) / sizeof(activation_clip_range_str[0])) ?
18864 activation_clip_range_str[activation_clip_range] :
18865 "****")));
18866 }
18867#endif
18868#endif
18869 };
18870 // Lower bound clip
18871 struct npu_set_activation_min_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020018872 {
Jonny Svärd136810f2021-10-13 16:04:26 +020018873#ifdef __cplusplus
18874 private:
18875#endif
18876 uint32_t opcode : 10; // opcode
18877 uint32_t reserved0 : 4;
18878 uint32_t control : 2; // control
18879 uint32_t clip_boundary : 16; // Clip boundary for OFM activations
18880#ifdef __cplusplus
18881 public:
18882 npu_set_activation_min_t(uint32_t _clip_boundary) :
18883 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_ACTIVATION_MIN)), reserved0(0),
18884 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)),
18885 clip_boundary(static_cast<uint16_t>(_clip_boundary) & ((1U << 16) - 1))
18886 {
18887 }
18888 CONSTEXPR npu_set_activation_min_t() :
18889 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_ACTIVATION_MIN)), reserved0(0),
18890 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), clip_boundary(0)
18891 {
18892 }
18893 CONSTEXPR bool valid() const
18894 {
18895 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_ACTIVATION_MIN) &&
18896 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
18897 }
18898 CONSTEXPR void init()
18899 {
18900 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_ACTIVATION_MIN);
18901 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
18902 }
18903 operator uint32_t()
18904 {
18905 uint32_t word;
18906 std::memcpy(&word, this, sizeof(word));
18907 return word;
18908 }
18909 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const
18910 {
18911 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode);
18912 }
18913 CONSTEXPR npu_set_activation_min_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value)
18914 {
18915 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
18916 return *this;
18917 }
18918 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
18919 {
18920 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
18921 }
18922 CONSTEXPR npu_set_activation_min_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
18923 {
18924 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
18925 return *this;
18926 }
18927 CONSTEXPR uint32_t get_clip_boundary() const
18928 {
18929 return static_cast<uint32_t>(clip_boundary);
18930 }
18931 CONSTEXPR npu_set_activation_min_t &set_clip_boundary(uint32_t value)
18932 {
18933 clip_boundary = static_cast<uint16_t>(value) & ((1U << 16) - 1);
18934 return *this;
18935 }
18936#ifdef NPU_DISASSEMBLE
18937 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
18938 {
18939 fields.push_back(std::make_pair<std::string, std::string>("clip_boundary", std::to_string(clip_boundary)));
18940 }
18941#endif
18942#endif
18943 };
18944 // Upper bound clip
18945 struct npu_set_activation_max_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020018946 {
Jonny Svärd136810f2021-10-13 16:04:26 +020018947#ifdef __cplusplus
18948 private:
18949#endif
18950 uint32_t opcode : 10; // opcode
18951 uint32_t reserved0 : 4;
18952 uint32_t control : 2; // control
18953 uint32_t clip_boundary : 16; // Clip boundary for OFM activations
18954#ifdef __cplusplus
18955 public:
18956 npu_set_activation_max_t(uint32_t _clip_boundary) :
18957 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_ACTIVATION_MAX)), reserved0(0),
18958 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)),
18959 clip_boundary(static_cast<uint16_t>(_clip_boundary) & ((1U << 16) - 1))
18960 {
18961 }
18962 CONSTEXPR npu_set_activation_max_t() :
18963 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_ACTIVATION_MAX)), reserved0(0),
18964 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), clip_boundary(0)
18965 {
18966 }
18967 CONSTEXPR bool valid() const
18968 {
18969 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_ACTIVATION_MAX) &&
18970 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
18971 }
18972 CONSTEXPR void init()
18973 {
18974 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_ACTIVATION_MAX);
18975 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
18976 }
18977 operator uint32_t()
18978 {
18979 uint32_t word;
18980 std::memcpy(&word, this, sizeof(word));
18981 return word;
18982 }
18983 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const
18984 {
18985 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode);
18986 }
18987 CONSTEXPR npu_set_activation_max_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value)
18988 {
18989 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
18990 return *this;
18991 }
18992 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
18993 {
18994 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
18995 }
18996 CONSTEXPR npu_set_activation_max_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
18997 {
18998 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
18999 return *this;
19000 }
19001 CONSTEXPR uint32_t get_clip_boundary() const
19002 {
19003 return static_cast<uint32_t>(clip_boundary);
19004 }
19005 CONSTEXPR npu_set_activation_max_t &set_clip_boundary(uint32_t value)
19006 {
19007 clip_boundary = static_cast<uint16_t>(value) & ((1U << 16) - 1);
19008 return *this;
19009 }
19010#ifdef NPU_DISASSEMBLE
19011 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
19012 {
19013 fields.push_back(std::make_pair<std::string, std::string>("clip_boundary", std::to_string(clip_boundary)));
19014 }
19015#endif
19016#endif
19017 };
19018 // Index n for weight stream access
19019 struct npu_set_weight_region_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020019020 {
Jonny Svärd136810f2021-10-13 16:04:26 +020019021#ifdef __cplusplus
19022 private:
19023#endif
19024 uint32_t opcode : 10; // opcode
19025 uint32_t reserved0 : 4;
19026 uint32_t control : 2; // control
19027 uint32_t region : 3; // Index n for weight stream access
19028 uint32_t reserved1 : 12;
19029 uint32_t custom_dma_cs : 1; // Custom DMA select
19030#ifdef __cplusplus
19031 public:
19032 npu_set_weight_region_t(uint32_t _region, NPU_NAMESPACE::custom_dma_cs _custom_dma_cs) :
19033 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_WEIGHT_REGION)), reserved0(0),
19034 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)),
19035 region(static_cast<uint8_t>(_region) & ((1U << 3) - 1)), reserved1(0),
19036 custom_dma_cs(static_cast<uint8_t>(_custom_dma_cs) & ((1U << 1) - 1))
19037 {
19038 }
19039 CONSTEXPR npu_set_weight_region_t() :
19040 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_WEIGHT_REGION)), reserved0(0),
19041 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), region(0), reserved1(0), custom_dma_cs(0)
19042 {
19043 }
19044 CONSTEXPR bool valid() const
19045 {
19046 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_WEIGHT_REGION) &&
19047 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
19048 }
19049 CONSTEXPR void init()
19050 {
19051 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_WEIGHT_REGION);
19052 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
19053 }
19054 operator uint32_t()
19055 {
19056 uint32_t word;
19057 std::memcpy(&word, this, sizeof(word));
19058 return word;
19059 }
19060 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const
19061 {
19062 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode);
19063 }
19064 CONSTEXPR npu_set_weight_region_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value)
19065 {
19066 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
19067 return *this;
19068 }
19069 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
19070 {
19071 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
19072 }
19073 CONSTEXPR npu_set_weight_region_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
19074 {
19075 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
19076 return *this;
19077 }
19078 CONSTEXPR uint32_t get_region() const
19079 {
19080 return static_cast<uint32_t>(region);
19081 }
19082 CONSTEXPR npu_set_weight_region_t &set_region(uint32_t value)
19083 {
19084 region = static_cast<uint8_t>(value) & ((1U << 3) - 1);
19085 return *this;
19086 }
19087 CONSTEXPR NPU_NAMESPACE::custom_dma_cs get_custom_dma_cs() const
19088 {
19089 return static_cast<NPU_NAMESPACE::custom_dma_cs>(custom_dma_cs);
19090 }
19091 CONSTEXPR npu_set_weight_region_t &set_custom_dma_cs(NPU_NAMESPACE::custom_dma_cs value)
19092 {
19093 custom_dma_cs = static_cast<uint8_t>(value) & ((1U << 1) - 1);
19094 return *this;
19095 }
19096#ifdef NPU_DISASSEMBLE
19097 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
19098 {
19099 fields.push_back(std::make_pair<std::string, std::string>("region", std::to_string(region)));
19100 fields.push_back(std::make_pair<std::string, std::string>(
19101 "custom_dma_cs",
19102 (custom_dma_cs < (sizeof(custom_dma_cs_str) / sizeof(custom_dma_cs_str[0])) ?
19103 custom_dma_cs_str[custom_dma_cs] :
19104 "****")));
19105 }
19106#endif
19107#endif
19108 };
19109 // Index n for scale stream access
19110 struct npu_set_scale_region_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020019111 {
Jonny Svärd136810f2021-10-13 16:04:26 +020019112#ifdef __cplusplus
19113 private:
19114#endif
19115 uint32_t opcode : 10; // opcode
19116 uint32_t reserved0 : 4;
19117 uint32_t control : 2; // control
19118 uint32_t region : 3; // Index n for scale stream access
19119 uint32_t reserved1 : 12;
19120 uint32_t custom_dma_cs : 1; // Custom DMA select
19121#ifdef __cplusplus
19122 public:
19123 npu_set_scale_region_t(uint32_t _region, NPU_NAMESPACE::custom_dma_cs _custom_dma_cs) :
19124 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_SCALE_REGION)), reserved0(0),
19125 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)),
19126 region(static_cast<uint8_t>(_region) & ((1U << 3) - 1)), reserved1(0),
19127 custom_dma_cs(static_cast<uint8_t>(_custom_dma_cs) & ((1U << 1) - 1))
19128 {
19129 }
19130 CONSTEXPR npu_set_scale_region_t() :
19131 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_SCALE_REGION)), reserved0(0),
19132 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), region(0), reserved1(0), custom_dma_cs(0)
19133 {
19134 }
19135 CONSTEXPR bool valid() const
19136 {
19137 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_SCALE_REGION) &&
19138 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
19139 }
19140 CONSTEXPR void init()
19141 {
19142 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_SCALE_REGION);
19143 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
19144 }
19145 operator uint32_t()
19146 {
19147 uint32_t word;
19148 std::memcpy(&word, this, sizeof(word));
19149 return word;
19150 }
19151 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const
19152 {
19153 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode);
19154 }
19155 CONSTEXPR npu_set_scale_region_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value)
19156 {
19157 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
19158 return *this;
19159 }
19160 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
19161 {
19162 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
19163 }
19164 CONSTEXPR npu_set_scale_region_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
19165 {
19166 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
19167 return *this;
19168 }
19169 CONSTEXPR uint32_t get_region() const
19170 {
19171 return static_cast<uint32_t>(region);
19172 }
19173 CONSTEXPR npu_set_scale_region_t &set_region(uint32_t value)
19174 {
19175 region = static_cast<uint8_t>(value) & ((1U << 3) - 1);
19176 return *this;
19177 }
19178 CONSTEXPR NPU_NAMESPACE::custom_dma_cs get_custom_dma_cs() const
19179 {
19180 return static_cast<NPU_NAMESPACE::custom_dma_cs>(custom_dma_cs);
19181 }
19182 CONSTEXPR npu_set_scale_region_t &set_custom_dma_cs(NPU_NAMESPACE::custom_dma_cs value)
19183 {
19184 custom_dma_cs = static_cast<uint8_t>(value) & ((1U << 1) - 1);
19185 return *this;
19186 }
19187#ifdef NPU_DISASSEMBLE
19188 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
19189 {
19190 fields.push_back(std::make_pair<std::string, std::string>("region", std::to_string(region)));
19191 fields.push_back(std::make_pair<std::string, std::string>(
19192 "custom_dma_cs",
19193 (custom_dma_cs < (sizeof(custom_dma_cs_str) / sizeof(custom_dma_cs_str[0])) ?
19194 custom_dma_cs_str[custom_dma_cs] :
19195 "****")));
19196 }
19197#endif
19198#endif
19199 };
19200 // Start of ACC0,ACC1 buffers
19201 struct npu_set_ab_start_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020019202 {
Jonny Svärd136810f2021-10-13 16:04:26 +020019203#ifdef __cplusplus
19204 private:
19205#endif
19206 uint32_t opcode : 10; // opcode
19207 uint32_t reserved0 : 4;
19208 uint32_t control : 2; // control
19209 uint32_t ab_start : 6; // Start of ACC0,ACC1 buffers in the SHRAM in KB units. Multiple of 2
19210 uint32_t reserved1 : 10;
19211#ifdef __cplusplus
19212 public:
19213 npu_set_ab_start_t(uint32_t _ab_start) :
19214 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_AB_START)), reserved0(0),
19215 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)),
19216 ab_start(static_cast<uint8_t>(_ab_start) & ((1U << 6) - 1)), reserved1(0)
19217 {
19218 }
19219 CONSTEXPR npu_set_ab_start_t() :
19220 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_AB_START)), reserved0(0),
19221 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), ab_start(0), reserved1(0)
19222 {
19223 }
19224 CONSTEXPR bool valid() const
19225 {
19226 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_AB_START) &&
19227 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
19228 }
19229 CONSTEXPR void init()
19230 {
19231 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_AB_START);
19232 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
19233 }
19234 operator uint32_t()
19235 {
19236 uint32_t word;
19237 std::memcpy(&word, this, sizeof(word));
19238 return word;
19239 }
19240 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const
19241 {
19242 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode);
19243 }
19244 CONSTEXPR npu_set_ab_start_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value)
19245 {
19246 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
19247 return *this;
19248 }
19249 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
19250 {
19251 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
19252 }
19253 CONSTEXPR npu_set_ab_start_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
19254 {
19255 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
19256 return *this;
19257 }
19258 CONSTEXPR uint32_t get_ab_start() const
19259 {
19260 return static_cast<uint32_t>(ab_start);
19261 }
19262 CONSTEXPR npu_set_ab_start_t &set_ab_start(uint32_t value)
19263 {
19264 ab_start = static_cast<uint8_t>(value) & ((1U << 6) - 1);
19265 return *this;
19266 }
19267#ifdef NPU_DISASSEMBLE
19268 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
19269 {
19270 fields.push_back(std::make_pair<std::string, std::string>("ab_start", std::to_string(ab_start)));
19271 }
19272#endif
19273#endif
19274 };
19275 // Block number of blocks dependency
19276 struct npu_set_blockdep_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020019277 {
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020019278#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020019279 private:
19280#endif
19281 uint32_t opcode : 10; // opcode
19282 uint32_t reserved0 : 4;
19283 uint32_t control : 2; // control
19284 uint32_t blockdep : 2; // Block number of blocks dependency between kernel operations
19285 uint32_t reserved1 : 14;
19286#ifdef __cplusplus
19287 public:
19288 npu_set_blockdep_t(uint32_t _blockdep) :
19289 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_BLOCKDEP)), reserved0(0),
19290 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)),
19291 blockdep(static_cast<uint8_t>(_blockdep) & ((1U << 2) - 1)), reserved1(0)
19292 {
19293 }
19294 CONSTEXPR npu_set_blockdep_t() :
19295 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_BLOCKDEP)), reserved0(0),
19296 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), blockdep(0), reserved1(0)
19297 {
19298 }
19299 CONSTEXPR bool valid() const
19300 {
19301 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_BLOCKDEP) &&
19302 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
19303 }
19304 CONSTEXPR void init()
19305 {
19306 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_BLOCKDEP);
19307 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
19308 }
19309 operator uint32_t()
19310 {
19311 uint32_t word;
19312 std::memcpy(&word, this, sizeof(word));
19313 return word;
19314 }
19315 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const
19316 {
19317 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode);
19318 }
19319 CONSTEXPR npu_set_blockdep_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value)
19320 {
19321 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
19322 return *this;
19323 }
19324 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
19325 {
19326 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
19327 }
19328 CONSTEXPR npu_set_blockdep_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
19329 {
19330 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
19331 return *this;
19332 }
19333 CONSTEXPR uint32_t get_blockdep() const
19334 {
19335 return static_cast<uint32_t>(blockdep);
19336 }
19337 CONSTEXPR npu_set_blockdep_t &set_blockdep(uint32_t value)
19338 {
19339 blockdep = static_cast<uint8_t>(value) & ((1U << 2) - 1);
19340 return *this;
19341 }
19342#ifdef NPU_DISASSEMBLE
19343 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
19344 {
19345 fields.push_back(std::make_pair<std::string, std::string>("blockdep", std::to_string(blockdep)));
19346 }
19347#endif
19348#endif
19349 };
19350 // DMA0 source region
19351 struct npu_set_dma0_src_region_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020019352 {
Jonny Svärd136810f2021-10-13 16:04:26 +020019353#ifdef __cplusplus
19354 private:
19355#endif
19356 uint32_t opcode : 10; // opcode
19357 uint32_t reserved0 : 4;
19358 uint32_t control : 2; // control
19359 uint32_t region : 3; // Region number
19360 uint32_t reserved1 : 5;
19361 uint32_t region_mode : 1; // Region mode
19362 uint32_t stride_mode : 2; // Stride mode
19363 uint32_t reserved2 : 4;
19364 uint32_t custom_dma_cs : 1; // Custom DMA select
19365#ifdef __cplusplus
19366 public:
19367 npu_set_dma0_src_region_t(uint32_t _region,
19368 NPU_NAMESPACE::dma_region_mode _region_mode,
19369 NPU_NAMESPACE::dma_stride_mode _stride_mode,
19370 NPU_NAMESPACE::custom_dma_cs _custom_dma_cs) :
19371 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_DMA0_SRC_REGION)),
19372 reserved0(0), control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)),
19373 region(static_cast<uint8_t>(_region) & ((1U << 3) - 1)), reserved1(0),
19374 region_mode(static_cast<uint8_t>(_region_mode) & ((1U << 1) - 1)),
19375 stride_mode(static_cast<uint8_t>(_stride_mode) & ((1U << 2) - 1)), reserved2(0),
19376 custom_dma_cs(static_cast<uint8_t>(_custom_dma_cs) & ((1U << 1) - 1))
19377 {
19378 }
19379 CONSTEXPR npu_set_dma0_src_region_t() :
19380 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_DMA0_SRC_REGION)), reserved0(0),
19381 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), region(0), reserved1(0), region_mode(0),
19382 stride_mode(0), reserved2(0), custom_dma_cs(0)
19383 {
19384 }
19385 CONSTEXPR bool valid() const
19386 {
19387 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_DMA0_SRC_REGION) &&
19388 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
19389 }
19390 CONSTEXPR void init()
19391 {
19392 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_DMA0_SRC_REGION);
19393 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
19394 }
19395 operator uint32_t()
19396 {
19397 uint32_t word;
19398 std::memcpy(&word, this, sizeof(word));
19399 return word;
19400 }
19401 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const
19402 {
19403 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode);
19404 }
19405 CONSTEXPR npu_set_dma0_src_region_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value)
19406 {
19407 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
19408 return *this;
19409 }
19410 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
19411 {
19412 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
19413 }
19414 CONSTEXPR npu_set_dma0_src_region_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
19415 {
19416 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
19417 return *this;
19418 }
19419 CONSTEXPR uint32_t get_region() const
19420 {
19421 return static_cast<uint32_t>(region);
19422 }
19423 CONSTEXPR npu_set_dma0_src_region_t &set_region(uint32_t value)
19424 {
19425 region = static_cast<uint8_t>(value) & ((1U << 3) - 1);
19426 return *this;
19427 }
19428 CONSTEXPR NPU_NAMESPACE::dma_region_mode get_region_mode() const
19429 {
19430 return static_cast<NPU_NAMESPACE::dma_region_mode>(region_mode);
19431 }
19432 CONSTEXPR npu_set_dma0_src_region_t &set_region_mode(NPU_NAMESPACE::dma_region_mode value)
19433 {
19434 region_mode = static_cast<uint8_t>(value) & ((1U << 1) - 1);
19435 return *this;
19436 }
19437 CONSTEXPR NPU_NAMESPACE::dma_stride_mode get_stride_mode() const
19438 {
19439 return static_cast<NPU_NAMESPACE::dma_stride_mode>(stride_mode);
19440 }
19441 CONSTEXPR npu_set_dma0_src_region_t &set_stride_mode(NPU_NAMESPACE::dma_stride_mode value)
19442 {
19443 stride_mode = static_cast<uint8_t>(value) & ((1U << 2) - 1);
19444 return *this;
19445 }
19446 CONSTEXPR NPU_NAMESPACE::custom_dma_cs get_custom_dma_cs() const
19447 {
19448 return static_cast<NPU_NAMESPACE::custom_dma_cs>(custom_dma_cs);
19449 }
19450 CONSTEXPR npu_set_dma0_src_region_t &set_custom_dma_cs(NPU_NAMESPACE::custom_dma_cs value)
19451 {
19452 custom_dma_cs = static_cast<uint8_t>(value) & ((1U << 1) - 1);
19453 return *this;
19454 }
19455#ifdef NPU_DISASSEMBLE
19456 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
19457 {
19458 fields.push_back(std::make_pair<std::string, std::string>("region", std::to_string(region)));
19459 fields.push_back(std::make_pair<std::string, std::string>(
19460 "region_mode",
19461 (region_mode < (sizeof(dma_region_mode_str) / sizeof(dma_region_mode_str[0])) ?
19462 dma_region_mode_str[region_mode] :
19463 "****")));
19464 fields.push_back(std::make_pair<std::string, std::string>(
19465 "stride_mode",
19466 (stride_mode < (sizeof(dma_stride_mode_str) / sizeof(dma_stride_mode_str[0])) ?
19467 dma_stride_mode_str[stride_mode] :
19468 "****")));
19469 fields.push_back(std::make_pair<std::string, std::string>(
19470 "custom_dma_cs",
19471 (custom_dma_cs < (sizeof(custom_dma_cs_str) / sizeof(custom_dma_cs_str[0])) ?
19472 custom_dma_cs_str[custom_dma_cs] :
19473 "****")));
19474 }
19475#endif
19476#endif
19477 };
19478 // DMA0 destination region
19479 struct npu_set_dma0_dst_region_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020019480 {
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020019481#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020019482 private:
19483#endif
19484 uint32_t opcode : 10; // opcode
19485 uint32_t reserved0 : 4;
19486 uint32_t control : 2; // control
19487 uint32_t region : 3; // Region number if region_mode is region_mode_external. Else core mask to write to (bit k
19488 // set for core k=0,1)
19489 uint32_t reserved1 : 5;
19490 uint32_t region_mode : 1; // Region mode
19491 uint32_t stride_mode : 2; // Stride mode
19492 uint32_t reserved2 : 4;
19493 uint32_t custom_dma_cs : 1; // Custom DMA select
19494#ifdef __cplusplus
19495 public:
19496 npu_set_dma0_dst_region_t(uint32_t _region,
19497 NPU_NAMESPACE::dma_region_mode _region_mode,
19498 NPU_NAMESPACE::dma_stride_mode _stride_mode,
19499 NPU_NAMESPACE::custom_dma_cs _custom_dma_cs) :
19500 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_DMA0_DST_REGION)),
19501 reserved0(0), control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)),
19502 region(static_cast<uint8_t>(_region) & ((1U << 3) - 1)), reserved1(0),
19503 region_mode(static_cast<uint8_t>(_region_mode) & ((1U << 1) - 1)),
19504 stride_mode(static_cast<uint8_t>(_stride_mode) & ((1U << 2) - 1)), reserved2(0),
19505 custom_dma_cs(static_cast<uint8_t>(_custom_dma_cs) & ((1U << 1) - 1))
19506 {
19507 }
19508 CONSTEXPR npu_set_dma0_dst_region_t() :
19509 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_DMA0_DST_REGION)), reserved0(0),
19510 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), region(0), reserved1(0), region_mode(0),
19511 stride_mode(0), reserved2(0), custom_dma_cs(0)
19512 {
19513 }
19514 CONSTEXPR bool valid() const
19515 {
19516 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_DMA0_DST_REGION) &&
19517 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
19518 }
19519 CONSTEXPR void init()
19520 {
19521 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_DMA0_DST_REGION);
19522 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
19523 }
19524 operator uint32_t()
19525 {
19526 uint32_t word;
19527 std::memcpy(&word, this, sizeof(word));
19528 return word;
19529 }
19530 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const
19531 {
19532 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode);
19533 }
19534 CONSTEXPR npu_set_dma0_dst_region_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value)
19535 {
19536 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
19537 return *this;
19538 }
19539 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
19540 {
19541 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
19542 }
19543 CONSTEXPR npu_set_dma0_dst_region_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
19544 {
19545 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
19546 return *this;
19547 }
19548 CONSTEXPR uint32_t get_region() const
19549 {
19550 return static_cast<uint32_t>(region);
19551 }
19552 CONSTEXPR npu_set_dma0_dst_region_t &set_region(uint32_t value)
19553 {
19554 region = static_cast<uint8_t>(value) & ((1U << 3) - 1);
19555 return *this;
19556 }
19557 CONSTEXPR NPU_NAMESPACE::dma_region_mode get_region_mode() const
19558 {
19559 return static_cast<NPU_NAMESPACE::dma_region_mode>(region_mode);
19560 }
19561 CONSTEXPR npu_set_dma0_dst_region_t &set_region_mode(NPU_NAMESPACE::dma_region_mode value)
19562 {
19563 region_mode = static_cast<uint8_t>(value) & ((1U << 1) - 1);
19564 return *this;
19565 }
19566 CONSTEXPR NPU_NAMESPACE::dma_stride_mode get_stride_mode() const
19567 {
19568 return static_cast<NPU_NAMESPACE::dma_stride_mode>(stride_mode);
19569 }
19570 CONSTEXPR npu_set_dma0_dst_region_t &set_stride_mode(NPU_NAMESPACE::dma_stride_mode value)
19571 {
19572 stride_mode = static_cast<uint8_t>(value) & ((1U << 2) - 1);
19573 return *this;
19574 }
19575 CONSTEXPR NPU_NAMESPACE::custom_dma_cs get_custom_dma_cs() const
19576 {
19577 return static_cast<NPU_NAMESPACE::custom_dma_cs>(custom_dma_cs);
19578 }
19579 CONSTEXPR npu_set_dma0_dst_region_t &set_custom_dma_cs(NPU_NAMESPACE::custom_dma_cs value)
19580 {
19581 custom_dma_cs = static_cast<uint8_t>(value) & ((1U << 1) - 1);
19582 return *this;
19583 }
19584#ifdef NPU_DISASSEMBLE
19585 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
19586 {
19587 fields.push_back(std::make_pair<std::string, std::string>("region", std::to_string(region)));
19588 fields.push_back(std::make_pair<std::string, std::string>(
19589 "region_mode",
19590 (region_mode < (sizeof(dma_region_mode_str) / sizeof(dma_region_mode_str[0])) ?
19591 dma_region_mode_str[region_mode] :
19592 "****")));
19593 fields.push_back(std::make_pair<std::string, std::string>(
19594 "stride_mode",
19595 (stride_mode < (sizeof(dma_stride_mode_str) / sizeof(dma_stride_mode_str[0])) ?
19596 dma_stride_mode_str[stride_mode] :
19597 "****")));
19598 fields.push_back(std::make_pair<std::string, std::string>(
19599 "custom_dma_cs",
19600 (custom_dma_cs < (sizeof(custom_dma_cs_str) / sizeof(custom_dma_cs_str[0])) ?
19601 custom_dma_cs_str[custom_dma_cs] :
19602 "****")));
19603 }
19604#endif
19605#endif
19606 };
19607 // Size of second dimension for 2D/3D transfers
19608 struct npu_set_dma0_size0_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020019609 {
Jonny Svärd136810f2021-10-13 16:04:26 +020019610#ifdef __cplusplus
19611 private:
19612#endif
19613 uint32_t opcode : 10; // opcode
19614 uint32_t reserved0 : 4;
19615 uint32_t control : 2; // control
19616 uint32_t size : 16; // Size of second dimension for 2D/3D transfers
19617#ifdef __cplusplus
19618 public:
19619 npu_set_dma0_size0_t(uint32_t _size) :
19620 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_DMA0_SIZE0)), reserved0(0),
19621 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)),
19622 size(static_cast<uint16_t>(_size) & ((1U << 16) - 1))
19623 {
19624 }
19625 CONSTEXPR npu_set_dma0_size0_t() :
19626 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_DMA0_SIZE0)), reserved0(0),
19627 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), size(0)
19628 {
19629 }
19630 CONSTEXPR bool valid() const
19631 {
19632 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_DMA0_SIZE0) &&
19633 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
19634 }
19635 CONSTEXPR void init()
19636 {
19637 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_DMA0_SIZE0);
19638 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
19639 }
19640 operator uint32_t()
19641 {
19642 uint32_t word;
19643 std::memcpy(&word, this, sizeof(word));
19644 return word;
19645 }
19646 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const
19647 {
19648 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode);
19649 }
19650 CONSTEXPR npu_set_dma0_size0_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value)
19651 {
19652 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
19653 return *this;
19654 }
19655 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
19656 {
19657 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
19658 }
19659 CONSTEXPR npu_set_dma0_size0_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
19660 {
19661 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
19662 return *this;
19663 }
19664 CONSTEXPR uint32_t get_size() const
19665 {
19666 return static_cast<uint32_t>(size);
19667 }
19668 CONSTEXPR npu_set_dma0_size0_t &set_size(uint32_t value)
19669 {
19670 size = static_cast<uint16_t>(value) & ((1U << 16) - 1);
19671 return *this;
19672 }
19673#ifdef NPU_DISASSEMBLE
19674 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
19675 {
19676 fields.push_back(std::make_pair<std::string, std::string>("size", std::to_string(size)));
19677 }
19678#endif
19679#endif
19680 };
19681 // Size of third dimension for 3D transfers
19682 struct npu_set_dma0_size1_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020019683 {
Jonny Svärd136810f2021-10-13 16:04:26 +020019684#ifdef __cplusplus
19685 private:
19686#endif
19687 uint32_t opcode : 10; // opcode
19688 uint32_t reserved0 : 4;
19689 uint32_t control : 2; // control
19690 uint32_t size : 16; // Size of third dimension for 3D transfers
19691#ifdef __cplusplus
19692 public:
19693 npu_set_dma0_size1_t(uint32_t _size) :
19694 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_DMA0_SIZE1)), reserved0(0),
19695 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)),
19696 size(static_cast<uint16_t>(_size) & ((1U << 16) - 1))
19697 {
19698 }
19699 CONSTEXPR npu_set_dma0_size1_t() :
19700 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_DMA0_SIZE1)), reserved0(0),
19701 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), size(0)
19702 {
19703 }
19704 CONSTEXPR bool valid() const
19705 {
19706 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_DMA0_SIZE1) &&
19707 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
19708 }
19709 CONSTEXPR void init()
19710 {
19711 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_DMA0_SIZE1);
19712 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
19713 }
19714 operator uint32_t()
19715 {
19716 uint32_t word;
19717 std::memcpy(&word, this, sizeof(word));
19718 return word;
19719 }
19720 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const
19721 {
19722 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode);
19723 }
19724 CONSTEXPR npu_set_dma0_size1_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value)
19725 {
19726 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
19727 return *this;
19728 }
19729 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
19730 {
19731 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
19732 }
19733 CONSTEXPR npu_set_dma0_size1_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
19734 {
19735 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
19736 return *this;
19737 }
19738 CONSTEXPR uint32_t get_size() const
19739 {
19740 return static_cast<uint32_t>(size);
19741 }
19742 CONSTEXPR npu_set_dma0_size1_t &set_size(uint32_t value)
19743 {
19744 size = static_cast<uint16_t>(value) & ((1U << 16) - 1);
19745 return *this;
19746 }
19747#ifdef NPU_DISASSEMBLE
19748 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
19749 {
19750 fields.push_back(std::make_pair<std::string, std::string>("size", std::to_string(size)));
19751 }
19752#endif
19753#endif
19754 };
19755 // IFM2 broadcast configuration
19756 struct npu_set_ifm2_broadcast_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020019757 {
Jonny Svärd136810f2021-10-13 16:04:26 +020019758#ifdef __cplusplus
19759 private:
19760#endif
19761 uint32_t opcode : 10; // opcode
19762 uint32_t reserved0 : 4;
19763 uint32_t control : 2; // control
19764 uint32_t
19765 broadcast_h : 1; // Broadcast H dimension (if set then any accesses to IFM2 sets y=0 and IFM2 height=1)
19766 uint32_t broadcast_w : 1; // Broadcast W dimension (if set then any accesses to IFM2 sets x=0 and IFM2 width=1)
19767 uint32_t broadcast_c : 1; // Broadcast C dimension (if set then any accesses to IFM2 sets c=0 and IFM2 depth=1)
19768 uint32_t reserved1 : 3;
19769 uint32_t operand_order : 1; // Operand order
19770 uint32_t broadcast_constant : 1; // Broadcast constant given by NPU_SET_IFM2_SCALAR and so ignore BH, BW and BC
19771 uint32_t reserved2 : 8;
19772#ifdef __cplusplus
19773 public:
19774 npu_set_ifm2_broadcast_t(NPU_NAMESPACE::broadcast_mode _broadcast_h,
19775 NPU_NAMESPACE::broadcast_mode _broadcast_w,
19776 NPU_NAMESPACE::broadcast_mode _broadcast_c,
19777 NPU_NAMESPACE::ifm2_operand_order _operand_order,
19778 NPU_NAMESPACE::broadcast_mode _broadcast_constant) :
19779 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM2_BROADCAST)),
19780 reserved0(0), control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)),
19781 broadcast_h(static_cast<uint8_t>(_broadcast_h) & ((1U << 1) - 1)),
19782 broadcast_w(static_cast<uint8_t>(_broadcast_w) & ((1U << 1) - 1)),
19783 broadcast_c(static_cast<uint8_t>(_broadcast_c) & ((1U << 1) - 1)), reserved1(0),
19784 operand_order(static_cast<uint8_t>(_operand_order) & ((1U << 1) - 1)),
19785 broadcast_constant(static_cast<uint8_t>(_broadcast_constant) & ((1U << 1) - 1)), reserved2(0)
19786 {
19787 }
19788 CONSTEXPR npu_set_ifm2_broadcast_t() :
19789 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM2_BROADCAST)), reserved0(0),
19790 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), broadcast_h(0), broadcast_w(0),
19791 broadcast_c(0), reserved1(0), operand_order(0), broadcast_constant(0), reserved2(0)
19792 {
19793 }
19794 CONSTEXPR bool valid() const
19795 {
19796 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM2_BROADCAST) &&
19797 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
19798 }
19799 CONSTEXPR void init()
19800 {
19801 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM2_BROADCAST);
19802 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
19803 }
19804 operator uint32_t()
19805 {
19806 uint32_t word;
19807 std::memcpy(&word, this, sizeof(word));
19808 return word;
19809 }
19810 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const
19811 {
19812 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode);
19813 }
19814 CONSTEXPR npu_set_ifm2_broadcast_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value)
19815 {
19816 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
19817 return *this;
19818 }
19819 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
19820 {
19821 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
19822 }
19823 CONSTEXPR npu_set_ifm2_broadcast_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
19824 {
19825 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
19826 return *this;
19827 }
19828 CONSTEXPR NPU_NAMESPACE::broadcast_mode get_broadcast_h() const
19829 {
19830 return static_cast<NPU_NAMESPACE::broadcast_mode>(broadcast_h);
19831 }
19832 CONSTEXPR npu_set_ifm2_broadcast_t &set_broadcast_h(NPU_NAMESPACE::broadcast_mode value)
19833 {
19834 broadcast_h = static_cast<uint8_t>(value) & ((1U << 1) - 1);
19835 return *this;
19836 }
19837 CONSTEXPR NPU_NAMESPACE::broadcast_mode get_broadcast_w() const
19838 {
19839 return static_cast<NPU_NAMESPACE::broadcast_mode>(broadcast_w);
19840 }
19841 CONSTEXPR npu_set_ifm2_broadcast_t &set_broadcast_w(NPU_NAMESPACE::broadcast_mode value)
19842 {
19843 broadcast_w = static_cast<uint8_t>(value) & ((1U << 1) - 1);
19844 return *this;
19845 }
19846 CONSTEXPR NPU_NAMESPACE::broadcast_mode get_broadcast_c() const
19847 {
19848 return static_cast<NPU_NAMESPACE::broadcast_mode>(broadcast_c);
19849 }
19850 CONSTEXPR npu_set_ifm2_broadcast_t &set_broadcast_c(NPU_NAMESPACE::broadcast_mode value)
19851 {
19852 broadcast_c = static_cast<uint8_t>(value) & ((1U << 1) - 1);
19853 return *this;
19854 }
19855 CONSTEXPR NPU_NAMESPACE::ifm2_operand_order get_operand_order() const
19856 {
19857 return static_cast<NPU_NAMESPACE::ifm2_operand_order>(operand_order);
19858 }
19859 CONSTEXPR npu_set_ifm2_broadcast_t &set_operand_order(NPU_NAMESPACE::ifm2_operand_order value)
19860 {
19861 operand_order = static_cast<uint8_t>(value) & ((1U << 1) - 1);
19862 return *this;
19863 }
19864 CONSTEXPR NPU_NAMESPACE::broadcast_mode get_broadcast_constant() const
19865 {
19866 return static_cast<NPU_NAMESPACE::broadcast_mode>(broadcast_constant);
19867 }
19868 CONSTEXPR npu_set_ifm2_broadcast_t &set_broadcast_constant(NPU_NAMESPACE::broadcast_mode value)
19869 {
19870 broadcast_constant = static_cast<uint8_t>(value) & ((1U << 1) - 1);
19871 return *this;
19872 }
19873#ifdef NPU_DISASSEMBLE
19874 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
19875 {
19876 fields.push_back(std::make_pair<std::string, std::string>(
19877 "broadcast_h",
19878 (broadcast_h < (sizeof(broadcast_mode_str) / sizeof(broadcast_mode_str[0])) ?
19879 broadcast_mode_str[broadcast_h] :
19880 "****")));
19881 fields.push_back(std::make_pair<std::string, std::string>(
19882 "broadcast_w",
19883 (broadcast_w < (sizeof(broadcast_mode_str) / sizeof(broadcast_mode_str[0])) ?
19884 broadcast_mode_str[broadcast_w] :
19885 "****")));
19886 fields.push_back(std::make_pair<std::string, std::string>(
19887 "broadcast_c",
19888 (broadcast_c < (sizeof(broadcast_mode_str) / sizeof(broadcast_mode_str[0])) ?
19889 broadcast_mode_str[broadcast_c] :
19890 "****")));
19891 fields.push_back(std::make_pair<std::string, std::string>(
19892 "operand_order",
19893 (operand_order < (sizeof(ifm2_operand_order_str) / sizeof(ifm2_operand_order_str[0])) ?
19894 ifm2_operand_order_str[operand_order] :
19895 "****")));
19896 fields.push_back(std::make_pair<std::string, std::string>(
19897 "broadcast_constant",
19898 (broadcast_constant < (sizeof(broadcast_mode_str) / sizeof(broadcast_mode_str[0])) ?
19899 broadcast_mode_str[broadcast_constant] :
19900 "****")));
19901 }
19902#endif
19903#endif
19904 };
19905 // IFM2 scalar value
19906 struct npu_set_ifm2_scalar_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020019907 {
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020019908#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020019909 private:
19910#endif
19911 uint32_t opcode : 10; // opcode
19912 uint32_t reserved0 : 4;
19913 uint32_t control : 2; // control
19914 uint32_t scalar : 16; // int16 or uint16 depending on ifm2_precision.type
19915#ifdef __cplusplus
19916 public:
19917 npu_set_ifm2_scalar_t(uint32_t _scalar) :
19918 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM2_SCALAR)), reserved0(0),
19919 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)),
19920 scalar(static_cast<uint16_t>(_scalar) & ((1U << 16) - 1))
19921 {
19922 }
19923 CONSTEXPR npu_set_ifm2_scalar_t() :
19924 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM2_SCALAR)), reserved0(0),
19925 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), scalar(0)
19926 {
19927 }
19928 CONSTEXPR bool valid() const
19929 {
19930 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM2_SCALAR) &&
19931 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
19932 }
19933 CONSTEXPR void init()
19934 {
19935 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM2_SCALAR);
19936 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
19937 }
19938 operator uint32_t()
19939 {
19940 uint32_t word;
19941 std::memcpy(&word, this, sizeof(word));
19942 return word;
19943 }
19944 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const
19945 {
19946 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode);
19947 }
19948 CONSTEXPR npu_set_ifm2_scalar_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value)
19949 {
19950 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
19951 return *this;
19952 }
19953 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
19954 {
19955 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
19956 }
19957 CONSTEXPR npu_set_ifm2_scalar_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
19958 {
19959 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
19960 return *this;
19961 }
19962 CONSTEXPR uint32_t get_scalar() const
19963 {
19964 return static_cast<uint32_t>(scalar);
19965 }
19966 CONSTEXPR npu_set_ifm2_scalar_t &set_scalar(uint32_t value)
19967 {
19968 scalar = static_cast<uint16_t>(value) & ((1U << 16) - 1);
19969 return *this;
19970 }
19971#ifdef NPU_DISASSEMBLE
19972 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
19973 {
19974 fields.push_back(std::make_pair<std::string, std::string>("scalar", std::to_string(scalar)));
19975 }
19976#endif
19977#endif
19978 };
19979 // IFM2 Precision
19980 struct npu_set_ifm2_precision_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020019981 {
Jonny Svärd136810f2021-10-13 16:04:26 +020019982#ifdef __cplusplus
19983 private:
19984#endif
19985 uint32_t opcode : 10; // opcode
19986 uint32_t reserved0 : 4;
19987 uint32_t control : 2; // control
19988 uint32_t activation_type : 1; // IFM type - MUST MATCH IFM
19989 uint32_t reserved1 : 1;
19990 uint32_t activation_precision : 2; // IFM precision - MUST MATCH IFM
19991 uint32_t reserved2 : 2;
19992 uint32_t activation_format : 2; // IFM format
19993 uint32_t reserved3 : 8;
19994#ifdef __cplusplus
19995 public:
19996 npu_set_ifm2_precision_t(NPU_NAMESPACE::activation_type _activation_type,
19997 NPU_NAMESPACE::activation_precision _activation_precision,
19998 NPU_NAMESPACE::activation_format _activation_format) :
19999 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM2_PRECISION)),
20000 reserved0(0), control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)),
20001 activation_type(static_cast<uint8_t>(_activation_type) & ((1U << 1) - 1)), reserved1(0),
20002 activation_precision(static_cast<uint8_t>(_activation_precision) & ((1U << 2) - 1)), reserved2(0),
20003 activation_format(static_cast<uint8_t>(_activation_format) & ((1U << 2) - 1)), reserved3(0)
20004 {
20005 }
20006 CONSTEXPR npu_set_ifm2_precision_t() :
20007 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM2_PRECISION)), reserved0(0),
20008 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), activation_type(0), reserved1(0),
20009 activation_precision(0), reserved2(0), activation_format(0), reserved3(0)
20010 {
20011 }
20012 CONSTEXPR bool valid() const
20013 {
20014 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM2_PRECISION) &&
20015 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
20016 }
20017 CONSTEXPR void init()
20018 {
20019 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM2_PRECISION);
20020 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
20021 }
20022 operator uint32_t()
20023 {
20024 uint32_t word;
20025 std::memcpy(&word, this, sizeof(word));
20026 return word;
20027 }
20028 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const
20029 {
20030 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode);
20031 }
20032 CONSTEXPR npu_set_ifm2_precision_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value)
20033 {
20034 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
20035 return *this;
20036 }
20037 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
20038 {
20039 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
20040 }
20041 CONSTEXPR npu_set_ifm2_precision_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
20042 {
20043 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
20044 return *this;
20045 }
20046 CONSTEXPR NPU_NAMESPACE::activation_type get_activation_type() const
20047 {
20048 return static_cast<NPU_NAMESPACE::activation_type>(activation_type);
20049 }
20050 CONSTEXPR npu_set_ifm2_precision_t &set_activation_type(NPU_NAMESPACE::activation_type value)
20051 {
20052 activation_type = static_cast<uint8_t>(value) & ((1U << 1) - 1);
20053 return *this;
20054 }
20055 CONSTEXPR NPU_NAMESPACE::activation_precision get_activation_precision() const
20056 {
20057 return static_cast<NPU_NAMESPACE::activation_precision>(activation_precision);
20058 }
20059 CONSTEXPR npu_set_ifm2_precision_t &set_activation_precision(NPU_NAMESPACE::activation_precision value)
20060 {
20061 activation_precision = static_cast<uint8_t>(value) & ((1U << 2) - 1);
20062 return *this;
20063 }
20064 CONSTEXPR NPU_NAMESPACE::activation_format get_activation_format() const
20065 {
20066 return static_cast<NPU_NAMESPACE::activation_format>(activation_format);
20067 }
20068 CONSTEXPR npu_set_ifm2_precision_t &set_activation_format(NPU_NAMESPACE::activation_format value)
20069 {
20070 activation_format = static_cast<uint8_t>(value) & ((1U << 2) - 1);
20071 return *this;
20072 }
20073#ifdef NPU_DISASSEMBLE
20074 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
20075 {
20076 fields.push_back(std::make_pair<std::string, std::string>(
20077 "activation_type",
20078 (activation_type < (sizeof(activation_type_str) / sizeof(activation_type_str[0])) ?
20079 activation_type_str[activation_type] :
20080 "****")));
20081 fields.push_back(std::make_pair<std::string, std::string>(
20082 "activation_precision",
20083 (activation_precision < (sizeof(activation_precision_str) / sizeof(activation_precision_str[0])) ?
20084 activation_precision_str[activation_precision] :
20085 "****")));
20086 fields.push_back(std::make_pair<std::string, std::string>(
20087 "activation_format",
20088 (activation_format < (sizeof(activation_format_str) / sizeof(activation_format_str[0])) ?
20089 activation_format_str[activation_format] :
20090 "****")));
20091 }
20092#endif
20093#endif
20094 };
20095 // IFM2 zero point
20096 struct npu_set_ifm2_zero_point_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020020097 {
Jonny Svärd136810f2021-10-13 16:04:26 +020020098#ifdef __cplusplus
20099 private:
20100#endif
20101 uint32_t opcode : 10; // opcode
20102 uint32_t reserved0 : 4;
20103 uint32_t control : 2; // control
20104 uint32_t zero_point : 16; // Zero point offset
20105#ifdef __cplusplus
20106 public:
20107 npu_set_ifm2_zero_point_t(uint32_t _zero_point) :
20108 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM2_ZERO_POINT)), reserved0(0),
20109 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)),
20110 zero_point(static_cast<uint16_t>(_zero_point) & ((1U << 16) - 1))
20111 {
20112 }
20113 CONSTEXPR npu_set_ifm2_zero_point_t() :
20114 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM2_ZERO_POINT)), reserved0(0),
20115 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), zero_point(0)
20116 {
20117 }
20118 CONSTEXPR bool valid() const
20119 {
20120 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM2_ZERO_POINT) &&
20121 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
20122 }
20123 CONSTEXPR void init()
20124 {
20125 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM2_ZERO_POINT);
20126 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
20127 }
20128 operator uint32_t()
20129 {
20130 uint32_t word;
20131 std::memcpy(&word, this, sizeof(word));
20132 return word;
20133 }
20134 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const
20135 {
20136 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode);
20137 }
20138 CONSTEXPR npu_set_ifm2_zero_point_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value)
20139 {
20140 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
20141 return *this;
20142 }
20143 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
20144 {
20145 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
20146 }
20147 CONSTEXPR npu_set_ifm2_zero_point_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
20148 {
20149 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
20150 return *this;
20151 }
20152 CONSTEXPR uint32_t get_zero_point() const
20153 {
20154 return static_cast<uint32_t>(zero_point);
20155 }
20156 CONSTEXPR npu_set_ifm2_zero_point_t &set_zero_point(uint32_t value)
20157 {
20158 zero_point = static_cast<uint16_t>(value) & ((1U << 16) - 1);
20159 return *this;
20160 }
20161#ifdef NPU_DISASSEMBLE
20162 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
20163 {
20164 fields.push_back(std::make_pair<std::string, std::string>("zero_point", std::to_string(zero_point)));
20165 }
20166#endif
20167#endif
20168 };
20169 // IFM2 Tile 0 and tile 2 width
20170 struct npu_set_ifm2_width0_m1_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020020171 {
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020020172#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020020173 private:
20174#endif
20175 uint32_t opcode : 10; // opcode
20176 uint32_t reserved0 : 4;
20177 uint32_t control : 2; // control
20178 uint32_t width_m1 : 16; // IFM2 Tile 0 and tile 2 width
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020020179#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020020180 public:
20181 npu_set_ifm2_width0_m1_t(uint32_t _width_m1) :
20182 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM2_WIDTH0_M1)), reserved0(0),
20183 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)),
20184 width_m1(static_cast<uint16_t>(_width_m1) & ((1U << 16) - 1))
20185 {
20186 }
20187 CONSTEXPR npu_set_ifm2_width0_m1_t() :
20188 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM2_WIDTH0_M1)), reserved0(0),
20189 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), width_m1(0)
20190 {
20191 }
20192 CONSTEXPR bool valid() const
20193 {
20194 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM2_WIDTH0_M1) &&
20195 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
20196 }
20197 CONSTEXPR void init()
20198 {
20199 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM2_WIDTH0_M1);
20200 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
20201 }
20202 operator uint32_t()
20203 {
20204 uint32_t word;
20205 std::memcpy(&word, this, sizeof(word));
20206 return word;
20207 }
20208 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const
20209 {
20210 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode);
20211 }
20212 CONSTEXPR npu_set_ifm2_width0_m1_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value)
20213 {
20214 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
20215 return *this;
20216 }
20217 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
20218 {
20219 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
20220 }
20221 CONSTEXPR npu_set_ifm2_width0_m1_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
20222 {
20223 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
20224 return *this;
20225 }
20226 CONSTEXPR uint32_t get_width_m1() const
20227 {
20228 return static_cast<uint32_t>(width_m1);
20229 }
20230 CONSTEXPR npu_set_ifm2_width0_m1_t &set_width_m1(uint32_t value)
20231 {
20232 width_m1 = static_cast<uint16_t>(value) & ((1U << 16) - 1);
20233 return *this;
20234 }
20235#ifdef NPU_DISASSEMBLE
20236 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
20237 {
20238 fields.push_back(std::make_pair<std::string, std::string>("width_m1", std::to_string(width_m1)));
20239 }
20240#endif
20241#endif
20242 };
20243 // IFM2 Tile 0 height
20244 struct npu_set_ifm2_height0_m1_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020020245 {
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020020246#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020020247 private:
20248#endif
20249 uint32_t opcode : 10; // opcode
20250 uint32_t reserved0 : 4;
20251 uint32_t control : 2; // control
20252 uint32_t height_m1 : 16; // IFM2 Tile 0 height
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020020253#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020020254 public:
20255 npu_set_ifm2_height0_m1_t(uint32_t _height_m1) :
20256 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM2_HEIGHT0_M1)), reserved0(0),
20257 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)),
20258 height_m1(static_cast<uint16_t>(_height_m1) & ((1U << 16) - 1))
20259 {
20260 }
20261 CONSTEXPR npu_set_ifm2_height0_m1_t() :
20262 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM2_HEIGHT0_M1)), reserved0(0),
20263 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), height_m1(0)
20264 {
20265 }
20266 CONSTEXPR bool valid() const
20267 {
20268 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM2_HEIGHT0_M1) &&
20269 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
20270 }
20271 CONSTEXPR void init()
20272 {
20273 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM2_HEIGHT0_M1);
20274 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
20275 }
20276 operator uint32_t()
20277 {
20278 uint32_t word;
20279 std::memcpy(&word, this, sizeof(word));
20280 return word;
20281 }
20282 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const
20283 {
20284 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode);
20285 }
20286 CONSTEXPR npu_set_ifm2_height0_m1_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value)
20287 {
20288 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
20289 return *this;
20290 }
20291 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
20292 {
20293 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
20294 }
20295 CONSTEXPR npu_set_ifm2_height0_m1_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
20296 {
20297 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
20298 return *this;
20299 }
20300 CONSTEXPR uint32_t get_height_m1() const
20301 {
20302 return static_cast<uint32_t>(height_m1);
20303 }
20304 CONSTEXPR npu_set_ifm2_height0_m1_t &set_height_m1(uint32_t value)
20305 {
20306 height_m1 = static_cast<uint16_t>(value) & ((1U << 16) - 1);
20307 return *this;
20308 }
20309#ifdef NPU_DISASSEMBLE
20310 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
20311 {
20312 fields.push_back(std::make_pair<std::string, std::string>("height_m1", std::to_string(height_m1)));
20313 }
20314#endif
20315#endif
20316 };
20317 // IFM2 Tile 1 height
20318 struct npu_set_ifm2_height1_m1_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020020319 {
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020020320#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020020321 private:
20322#endif
20323 uint32_t opcode : 10; // opcode
20324 uint32_t reserved0 : 4;
20325 uint32_t control : 2; // control
20326 uint32_t height_m1 : 16; // IFM2 Tile 1 height
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020020327#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020020328 public:
20329 npu_set_ifm2_height1_m1_t(uint32_t _height_m1) :
20330 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM2_HEIGHT1_M1)), reserved0(0),
20331 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)),
20332 height_m1(static_cast<uint16_t>(_height_m1) & ((1U << 16) - 1))
20333 {
20334 }
20335 CONSTEXPR npu_set_ifm2_height1_m1_t() :
20336 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM2_HEIGHT1_M1)), reserved0(0),
20337 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), height_m1(0)
20338 {
20339 }
20340 CONSTEXPR bool valid() const
20341 {
20342 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM2_HEIGHT1_M1) &&
20343 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
20344 }
20345 CONSTEXPR void init()
20346 {
20347 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM2_HEIGHT1_M1);
20348 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
20349 }
20350 operator uint32_t()
20351 {
20352 uint32_t word;
20353 std::memcpy(&word, this, sizeof(word));
20354 return word;
20355 }
20356 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const
20357 {
20358 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode);
20359 }
20360 CONSTEXPR npu_set_ifm2_height1_m1_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value)
20361 {
20362 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
20363 return *this;
20364 }
20365 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
20366 {
20367 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
20368 }
20369 CONSTEXPR npu_set_ifm2_height1_m1_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
20370 {
20371 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
20372 return *this;
20373 }
20374 CONSTEXPR uint32_t get_height_m1() const
20375 {
20376 return static_cast<uint32_t>(height_m1);
20377 }
20378 CONSTEXPR npu_set_ifm2_height1_m1_t &set_height_m1(uint32_t value)
20379 {
20380 height_m1 = static_cast<uint16_t>(value) & ((1U << 16) - 1);
20381 return *this;
20382 }
20383#ifdef NPU_DISASSEMBLE
20384 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
20385 {
20386 fields.push_back(std::make_pair<std::string, std::string>("height_m1", std::to_string(height_m1)));
20387 }
20388#endif
20389#endif
20390 };
20391 // Start of IB0,IB1 buffers for IFM2
20392 struct npu_set_ifm2_ib_start_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020020393 {
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020020394#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020020395 private:
20396#endif
20397 uint32_t opcode : 10; // opcode
20398 uint32_t reserved0 : 4;
20399 uint32_t control : 2; // control
20400 uint32_t ib_start : 6; // Start of IB0,IB1 buffers for IFM2 in the SHRAM in KB units. Multiple of 2
20401 uint32_t reserved1 : 10;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020020402#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020020403 public:
20404 npu_set_ifm2_ib_start_t(uint32_t _ib_start) :
20405 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM2_IB_START)), reserved0(0),
20406 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)),
20407 ib_start(static_cast<uint8_t>(_ib_start) & ((1U << 6) - 1)), reserved1(0)
20408 {
20409 }
20410 CONSTEXPR npu_set_ifm2_ib_start_t() :
20411 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM2_IB_START)), reserved0(0),
20412 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), ib_start(0), reserved1(0)
20413 {
20414 }
20415 CONSTEXPR bool valid() const
20416 {
20417 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM2_IB_START) &&
20418 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
20419 }
20420 CONSTEXPR void init()
20421 {
20422 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM2_IB_START);
20423 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
20424 }
20425 operator uint32_t()
20426 {
20427 uint32_t word;
20428 std::memcpy(&word, this, sizeof(word));
20429 return word;
20430 }
20431 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const
20432 {
20433 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode);
20434 }
20435 CONSTEXPR npu_set_ifm2_ib_start_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value)
20436 {
20437 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
20438 return *this;
20439 }
20440 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
20441 {
20442 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
20443 }
20444 CONSTEXPR npu_set_ifm2_ib_start_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
20445 {
20446 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
20447 return *this;
20448 }
20449 CONSTEXPR uint32_t get_ib_start() const
20450 {
20451 return static_cast<uint32_t>(ib_start);
20452 }
20453 CONSTEXPR npu_set_ifm2_ib_start_t &set_ib_start(uint32_t value)
20454 {
20455 ib_start = static_cast<uint8_t>(value) & ((1U << 6) - 1);
20456 return *this;
20457 }
20458#ifdef NPU_DISASSEMBLE
20459 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
20460 {
20461 fields.push_back(std::make_pair<std::string, std::string>("ib_start", std::to_string(ib_start)));
20462 }
20463#endif
20464#endif
20465 };
20466 // Index n for IFM2 access
20467 struct npu_set_ifm2_region_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020020468 {
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020020469#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020020470 private:
20471#endif
20472 uint32_t opcode : 10; // opcode
20473 uint32_t reserved0 : 4;
20474 uint32_t control : 2; // control
20475 uint32_t region : 3; // Index n for IFM2 access
20476 uint32_t reserved1 : 13;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020020477#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020020478 public:
20479 npu_set_ifm2_region_t(uint32_t _region) :
20480 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM2_REGION)), reserved0(0),
20481 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)),
20482 region(static_cast<uint8_t>(_region) & ((1U << 3) - 1)), reserved1(0)
20483 {
20484 }
20485 CONSTEXPR npu_set_ifm2_region_t() :
20486 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM2_REGION)), reserved0(0),
20487 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), region(0), reserved1(0)
20488 {
20489 }
20490 CONSTEXPR bool valid() const
20491 {
20492 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM2_REGION) &&
20493 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
20494 }
20495 CONSTEXPR void init()
20496 {
20497 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM2_REGION);
20498 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL);
20499 }
20500 operator uint32_t()
20501 {
20502 uint32_t word;
20503 std::memcpy(&word, this, sizeof(word));
20504 return word;
20505 }
20506 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const
20507 {
20508 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode);
20509 }
20510 CONSTEXPR npu_set_ifm2_region_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value)
20511 {
20512 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
20513 return *this;
20514 }
20515 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
20516 {
20517 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
20518 }
20519 CONSTEXPR npu_set_ifm2_region_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
20520 {
20521 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
20522 return *this;
20523 }
20524 CONSTEXPR uint32_t get_region() const
20525 {
20526 return static_cast<uint32_t>(region);
20527 }
20528 CONSTEXPR npu_set_ifm2_region_t &set_region(uint32_t value)
20529 {
20530 region = static_cast<uint8_t>(value) & ((1U << 3) - 1);
20531 return *this;
20532 }
20533#ifdef NPU_DISASSEMBLE
20534 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
20535 {
20536 fields.push_back(std::make_pair<std::string, std::string>("region", std::to_string(region)));
20537 }
20538#endif
20539#endif
20540 };
20541 // IFM Tile 0 address
20542 struct npu_set_ifm_base0_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020020543 {
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020020544#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020020545 private:
20546#endif
20547 uint32_t opcode : 10; // opcode
20548 uint32_t reserved0 : 4;
20549 uint32_t control : 2; // control
20550 uint32_t reserved1 : 16;
20551 uint32_t addr : 32; // address offset
20552#ifdef __cplusplus
20553 public:
20554 npu_set_ifm_base0_t(uint32_t _addr) :
20555 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM_BASE0)), reserved0(0),
20556 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL)), reserved1(0),
20557 addr(static_cast<uint32_t>(_addr))
20558 {
20559 }
20560 CONSTEXPR npu_set_ifm_base0_t() :
20561 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM_BASE0)), reserved0(0),
20562 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL)), reserved1(0), addr(0)
20563 {
20564 }
20565 CONSTEXPR bool valid() const
20566 {
20567 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM_BASE0) && control >= 1 &&
20568 control <= 2;
20569 }
20570 CONSTEXPR void init()
20571 {
20572 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM_BASE0);
20573 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL);
20574 }
20575 operator uint64_t()
20576 {
20577 uint64_t word;
20578 std::memcpy(&word, this, sizeof(word));
20579 return word;
20580 }
20581 CONSTEXPR NPU_NAMESPACE::cmd1_opcode get_opcode() const
20582 {
20583 return static_cast<NPU_NAMESPACE::cmd1_opcode>(opcode);
20584 }
20585 CONSTEXPR npu_set_ifm_base0_t &set_opcode(NPU_NAMESPACE::cmd1_opcode value)
20586 {
20587 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
20588 return *this;
20589 }
20590 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
20591 {
20592 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
20593 }
20594 CONSTEXPR npu_set_ifm_base0_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
20595 {
20596 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
20597 return *this;
20598 }
20599 CONSTEXPR uint32_t get_addr() const
20600 {
20601 return static_cast<uint32_t>(addr);
20602 }
20603 CONSTEXPR npu_set_ifm_base0_t &set_addr(uint32_t value)
20604 {
20605 addr = static_cast<uint32_t>(value);
20606 return *this;
20607 }
20608#ifdef NPU_DISASSEMBLE
20609 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
20610 {
20611 std::stringstream saddr;
20612 saddr << std::hex << "0x" << get_addr();
20613 fields.push_back(std::make_pair<std::string, std::string>("addr", saddr.str()));
20614 }
20615#endif
20616#endif
20617 };
20618 // IFM Tile 1 address
20619 struct npu_set_ifm_base1_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020020620 {
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020020621#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020020622 private:
20623#endif
20624 uint32_t opcode : 10; // opcode
20625 uint32_t reserved0 : 4;
20626 uint32_t control : 2; // control
20627 uint32_t reserved1 : 16;
20628 uint32_t addr : 32; // address offset
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020020629#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020020630 public:
20631 npu_set_ifm_base1_t(uint32_t _addr) :
20632 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM_BASE1)), reserved0(0),
20633 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL)), reserved1(0),
20634 addr(static_cast<uint32_t>(_addr))
20635 {
20636 }
20637 CONSTEXPR npu_set_ifm_base1_t() :
20638 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM_BASE1)), reserved0(0),
20639 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL)), reserved1(0), addr(0)
20640 {
20641 }
20642 CONSTEXPR bool valid() const
20643 {
20644 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM_BASE1) && control >= 1 &&
20645 control <= 2;
20646 }
20647 CONSTEXPR void init()
20648 {
20649 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM_BASE1);
20650 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL);
20651 }
20652 operator uint64_t()
20653 {
20654 uint64_t word;
20655 std::memcpy(&word, this, sizeof(word));
20656 return word;
20657 }
20658 CONSTEXPR NPU_NAMESPACE::cmd1_opcode get_opcode() const
20659 {
20660 return static_cast<NPU_NAMESPACE::cmd1_opcode>(opcode);
20661 }
20662 CONSTEXPR npu_set_ifm_base1_t &set_opcode(NPU_NAMESPACE::cmd1_opcode value)
20663 {
20664 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
20665 return *this;
20666 }
20667 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
20668 {
20669 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
20670 }
20671 CONSTEXPR npu_set_ifm_base1_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
20672 {
20673 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
20674 return *this;
20675 }
20676 CONSTEXPR uint32_t get_addr() const
20677 {
20678 return static_cast<uint32_t>(addr);
20679 }
20680 CONSTEXPR npu_set_ifm_base1_t &set_addr(uint32_t value)
20681 {
20682 addr = static_cast<uint32_t>(value);
20683 return *this;
20684 }
20685#ifdef NPU_DISASSEMBLE
20686 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
20687 {
20688 std::stringstream saddr;
20689 saddr << std::hex << "0x" << get_addr();
20690 fields.push_back(std::make_pair<std::string, std::string>("addr", saddr.str()));
20691 }
20692#endif
20693#endif
20694 };
20695 // IFM Tile 2 address
20696 struct npu_set_ifm_base2_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020020697 {
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020020698#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020020699 private:
20700#endif
20701 uint32_t opcode : 10; // opcode
20702 uint32_t reserved0 : 4;
20703 uint32_t control : 2; // control
20704 uint32_t reserved1 : 16;
20705 uint32_t addr : 32; // address offset
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020020706#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020020707 public:
20708 npu_set_ifm_base2_t(uint32_t _addr) :
20709 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM_BASE2)), reserved0(0),
20710 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL)), reserved1(0),
20711 addr(static_cast<uint32_t>(_addr))
20712 {
20713 }
20714 CONSTEXPR npu_set_ifm_base2_t() :
20715 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM_BASE2)), reserved0(0),
20716 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL)), reserved1(0), addr(0)
20717 {
20718 }
20719 CONSTEXPR bool valid() const
20720 {
20721 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM_BASE2) && control >= 1 &&
20722 control <= 2;
20723 }
20724 CONSTEXPR void init()
20725 {
20726 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM_BASE2);
20727 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL);
20728 }
20729 operator uint64_t()
20730 {
20731 uint64_t word;
20732 std::memcpy(&word, this, sizeof(word));
20733 return word;
20734 }
20735 CONSTEXPR NPU_NAMESPACE::cmd1_opcode get_opcode() const
20736 {
20737 return static_cast<NPU_NAMESPACE::cmd1_opcode>(opcode);
20738 }
20739 CONSTEXPR npu_set_ifm_base2_t &set_opcode(NPU_NAMESPACE::cmd1_opcode value)
20740 {
20741 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
20742 return *this;
20743 }
20744 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
20745 {
20746 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
20747 }
20748 CONSTEXPR npu_set_ifm_base2_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
20749 {
20750 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
20751 return *this;
20752 }
20753 CONSTEXPR uint32_t get_addr() const
20754 {
20755 return static_cast<uint32_t>(addr);
20756 }
20757 CONSTEXPR npu_set_ifm_base2_t &set_addr(uint32_t value)
20758 {
20759 addr = static_cast<uint32_t>(value);
20760 return *this;
20761 }
20762#ifdef NPU_DISASSEMBLE
20763 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
20764 {
20765 std::stringstream saddr;
20766 saddr << std::hex << "0x" << get_addr();
20767 fields.push_back(std::make_pair<std::string, std::string>("addr", saddr.str()));
20768 }
20769#endif
20770#endif
20771 };
20772 // IFM Tile 3 address
20773 struct npu_set_ifm_base3_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020020774 {
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020020775#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020020776 private:
20777#endif
20778 uint32_t opcode : 10; // opcode
20779 uint32_t reserved0 : 4;
20780 uint32_t control : 2; // control
20781 uint32_t reserved1 : 16;
20782 uint32_t addr : 32; // address offset
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020020783#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020020784 public:
20785 npu_set_ifm_base3_t(uint32_t _addr) :
20786 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM_BASE3)), reserved0(0),
20787 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL)), reserved1(0),
20788 addr(static_cast<uint32_t>(_addr))
20789 {
20790 }
20791 CONSTEXPR npu_set_ifm_base3_t() :
20792 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM_BASE3)), reserved0(0),
20793 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL)), reserved1(0), addr(0)
20794 {
20795 }
20796 CONSTEXPR bool valid() const
20797 {
20798 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM_BASE3) && control >= 1 &&
20799 control <= 2;
20800 }
20801 CONSTEXPR void init()
20802 {
20803 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM_BASE3);
20804 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL);
20805 }
20806 operator uint64_t()
20807 {
20808 uint64_t word;
20809 std::memcpy(&word, this, sizeof(word));
20810 return word;
20811 }
20812 CONSTEXPR NPU_NAMESPACE::cmd1_opcode get_opcode() const
20813 {
20814 return static_cast<NPU_NAMESPACE::cmd1_opcode>(opcode);
20815 }
20816 CONSTEXPR npu_set_ifm_base3_t &set_opcode(NPU_NAMESPACE::cmd1_opcode value)
20817 {
20818 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
20819 return *this;
20820 }
20821 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
20822 {
20823 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
20824 }
20825 CONSTEXPR npu_set_ifm_base3_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
20826 {
20827 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
20828 return *this;
20829 }
20830 CONSTEXPR uint32_t get_addr() const
20831 {
20832 return static_cast<uint32_t>(addr);
20833 }
20834 CONSTEXPR npu_set_ifm_base3_t &set_addr(uint32_t value)
20835 {
20836 addr = static_cast<uint32_t>(value);
20837 return *this;
20838 }
20839#ifdef NPU_DISASSEMBLE
20840 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
20841 {
20842 std::stringstream saddr;
20843 saddr << std::hex << "0x" << get_addr();
20844 fields.push_back(std::make_pair<std::string, std::string>("addr", saddr.str()));
20845 }
20846#endif
20847#endif
20848 };
20849 // IFM byte stride between horizontal values
20850 struct npu_set_ifm_stride_x_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020020851 {
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020020852#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020020853 private:
20854#endif
20855 uint32_t opcode : 10; // opcode
20856 uint32_t reserved0 : 4;
20857 uint32_t control : 2; // control
20858 uint32_t reserved1 : 16;
20859 uint32_t addr : 32; // address offset
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020020860#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020020861 public:
20862 npu_set_ifm_stride_x_t(uint32_t _addr) :
20863 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM_STRIDE_X)), reserved0(0),
20864 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL)), reserved1(0),
20865 addr(static_cast<uint32_t>(_addr))
20866 {
20867 }
20868 CONSTEXPR npu_set_ifm_stride_x_t() :
20869 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM_STRIDE_X)), reserved0(0),
20870 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL)), reserved1(0), addr(0)
20871 {
20872 }
20873 CONSTEXPR bool valid() const
20874 {
20875 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM_STRIDE_X) && control >= 1 &&
20876 control <= 2;
20877 }
20878 CONSTEXPR void init()
20879 {
20880 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM_STRIDE_X);
20881 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL);
20882 }
20883 operator uint64_t()
20884 {
20885 uint64_t word;
20886 std::memcpy(&word, this, sizeof(word));
20887 return word;
20888 }
20889 CONSTEXPR NPU_NAMESPACE::cmd1_opcode get_opcode() const
20890 {
20891 return static_cast<NPU_NAMESPACE::cmd1_opcode>(opcode);
20892 }
20893 CONSTEXPR npu_set_ifm_stride_x_t &set_opcode(NPU_NAMESPACE::cmd1_opcode value)
20894 {
20895 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
20896 return *this;
20897 }
20898 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
20899 {
20900 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
20901 }
20902 CONSTEXPR npu_set_ifm_stride_x_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
20903 {
20904 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
20905 return *this;
20906 }
20907 CONSTEXPR uint32_t get_addr() const
20908 {
20909 return static_cast<uint32_t>(addr);
20910 }
20911 CONSTEXPR npu_set_ifm_stride_x_t &set_addr(uint32_t value)
20912 {
20913 addr = static_cast<uint32_t>(value);
20914 return *this;
20915 }
20916#ifdef NPU_DISASSEMBLE
20917 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
20918 {
20919 std::stringstream saddr;
20920 saddr << std::hex << "0x" << get_addr();
20921 fields.push_back(std::make_pair<std::string, std::string>("addr", saddr.str()));
20922 }
20923#endif
20924#endif
20925 };
20926 // IFM byte stride between vertical values
20927 struct npu_set_ifm_stride_y_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020020928 {
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020020929#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020020930 private:
20931#endif
20932 uint32_t opcode : 10; // opcode
20933 uint32_t reserved0 : 4;
20934 uint32_t control : 2; // control
20935 uint32_t reserved1 : 16;
20936 uint32_t addr : 32; // address offset
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020020937#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020020938 public:
20939 npu_set_ifm_stride_y_t(uint32_t _addr) :
20940 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM_STRIDE_Y)), reserved0(0),
20941 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL)), reserved1(0),
20942 addr(static_cast<uint32_t>(_addr))
20943 {
20944 }
20945 CONSTEXPR npu_set_ifm_stride_y_t() :
20946 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM_STRIDE_Y)), reserved0(0),
20947 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL)), reserved1(0), addr(0)
20948 {
20949 }
20950 CONSTEXPR bool valid() const
20951 {
20952 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM_STRIDE_Y) && control >= 1 &&
20953 control <= 2;
20954 }
20955 CONSTEXPR void init()
20956 {
20957 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM_STRIDE_Y);
20958 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL);
20959 }
20960 operator uint64_t()
20961 {
20962 uint64_t word;
20963 std::memcpy(&word, this, sizeof(word));
20964 return word;
20965 }
20966 CONSTEXPR NPU_NAMESPACE::cmd1_opcode get_opcode() const
20967 {
20968 return static_cast<NPU_NAMESPACE::cmd1_opcode>(opcode);
20969 }
20970 CONSTEXPR npu_set_ifm_stride_y_t &set_opcode(NPU_NAMESPACE::cmd1_opcode value)
20971 {
20972 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
20973 return *this;
20974 }
20975 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
20976 {
20977 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
20978 }
20979 CONSTEXPR npu_set_ifm_stride_y_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
20980 {
20981 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
20982 return *this;
20983 }
20984 CONSTEXPR uint32_t get_addr() const
20985 {
20986 return static_cast<uint32_t>(addr);
20987 }
20988 CONSTEXPR npu_set_ifm_stride_y_t &set_addr(uint32_t value)
20989 {
20990 addr = static_cast<uint32_t>(value);
20991 return *this;
20992 }
20993#ifdef NPU_DISASSEMBLE
20994 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
20995 {
20996 std::stringstream saddr;
20997 saddr << std::hex << "0x" << get_addr();
20998 fields.push_back(std::make_pair<std::string, std::string>("addr", saddr.str()));
20999 }
21000#endif
21001#endif
21002 };
21003 // IFM byte stride between channel blocks (of 16 bytes each block)
21004 struct npu_set_ifm_stride_c_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020021005 {
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020021006#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020021007 private:
21008#endif
21009 uint32_t opcode : 10; // opcode
21010 uint32_t reserved0 : 4;
21011 uint32_t control : 2; // control
21012 uint32_t reserved1 : 16;
21013 uint32_t addr : 32; // address offset
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020021014#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020021015 public:
21016 npu_set_ifm_stride_c_t(uint32_t _addr) :
21017 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM_STRIDE_C)), reserved0(0),
21018 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL)), reserved1(0),
21019 addr(static_cast<uint32_t>(_addr))
21020 {
21021 }
21022 CONSTEXPR npu_set_ifm_stride_c_t() :
21023 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM_STRIDE_C)), reserved0(0),
21024 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL)), reserved1(0), addr(0)
21025 {
21026 }
21027 CONSTEXPR bool valid() const
21028 {
21029 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM_STRIDE_C) && control >= 1 &&
21030 control <= 2;
21031 }
21032 CONSTEXPR void init()
21033 {
21034 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM_STRIDE_C);
21035 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL);
21036 }
21037 operator uint64_t()
21038 {
21039 uint64_t word;
21040 std::memcpy(&word, this, sizeof(word));
21041 return word;
21042 }
21043 CONSTEXPR NPU_NAMESPACE::cmd1_opcode get_opcode() const
21044 {
21045 return static_cast<NPU_NAMESPACE::cmd1_opcode>(opcode);
21046 }
21047 CONSTEXPR npu_set_ifm_stride_c_t &set_opcode(NPU_NAMESPACE::cmd1_opcode value)
21048 {
21049 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
21050 return *this;
21051 }
21052 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
21053 {
21054 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
21055 }
21056 CONSTEXPR npu_set_ifm_stride_c_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
21057 {
21058 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
21059 return *this;
21060 }
21061 CONSTEXPR uint32_t get_addr() const
21062 {
21063 return static_cast<uint32_t>(addr);
21064 }
21065 CONSTEXPR npu_set_ifm_stride_c_t &set_addr(uint32_t value)
21066 {
21067 addr = static_cast<uint32_t>(value);
21068 return *this;
21069 }
21070#ifdef NPU_DISASSEMBLE
21071 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
21072 {
21073 std::stringstream saddr;
21074 saddr << std::hex << "0x" << get_addr();
21075 fields.push_back(std::make_pair<std::string, std::string>("addr", saddr.str()));
21076 }
21077#endif
21078#endif
21079 };
21080 // OFM Tile 0 address
21081 struct npu_set_ofm_base0_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020021082 {
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020021083#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020021084 private:
21085#endif
21086 uint32_t opcode : 10; // opcode
21087 uint32_t reserved0 : 4;
21088 uint32_t control : 2; // control
21089 uint32_t reserved1 : 16;
21090 uint32_t addr : 32; // address offset
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020021091#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020021092 public:
21093 npu_set_ofm_base0_t(uint32_t _addr) :
21094 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_OFM_BASE0)), reserved0(0),
21095 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL)), reserved1(0),
21096 addr(static_cast<uint32_t>(_addr))
21097 {
21098 }
21099 CONSTEXPR npu_set_ofm_base0_t() :
21100 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_OFM_BASE0)), reserved0(0),
21101 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL)), reserved1(0), addr(0)
21102 {
21103 }
21104 CONSTEXPR bool valid() const
21105 {
21106 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_OFM_BASE0) && control >= 1 &&
21107 control <= 2;
21108 }
21109 CONSTEXPR void init()
21110 {
21111 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_OFM_BASE0);
21112 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL);
21113 }
21114 operator uint64_t()
21115 {
21116 uint64_t word;
21117 std::memcpy(&word, this, sizeof(word));
21118 return word;
21119 }
21120 CONSTEXPR NPU_NAMESPACE::cmd1_opcode get_opcode() const
21121 {
21122 return static_cast<NPU_NAMESPACE::cmd1_opcode>(opcode);
21123 }
21124 CONSTEXPR npu_set_ofm_base0_t &set_opcode(NPU_NAMESPACE::cmd1_opcode value)
21125 {
21126 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
21127 return *this;
21128 }
21129 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
21130 {
21131 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
21132 }
21133 CONSTEXPR npu_set_ofm_base0_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
21134 {
21135 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
21136 return *this;
21137 }
21138 CONSTEXPR uint32_t get_addr() const
21139 {
21140 return static_cast<uint32_t>(addr);
21141 }
21142 CONSTEXPR npu_set_ofm_base0_t &set_addr(uint32_t value)
21143 {
21144 addr = static_cast<uint32_t>(value);
21145 return *this;
21146 }
21147#ifdef NPU_DISASSEMBLE
21148 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
21149 {
21150 std::stringstream saddr;
21151 saddr << std::hex << "0x" << get_addr();
21152 fields.push_back(std::make_pair<std::string, std::string>("addr", saddr.str()));
21153 }
21154#endif
21155#endif
21156 };
21157 // OFM Tile 1 address
21158 struct npu_set_ofm_base1_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020021159 {
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020021160#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020021161 private:
21162#endif
21163 uint32_t opcode : 10; // opcode
21164 uint32_t reserved0 : 4;
21165 uint32_t control : 2; // control
21166 uint32_t reserved1 : 16;
21167 uint32_t addr : 32; // address offset
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020021168#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020021169 public:
21170 npu_set_ofm_base1_t(uint32_t _addr) :
21171 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_OFM_BASE1)), reserved0(0),
21172 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL)), reserved1(0),
21173 addr(static_cast<uint32_t>(_addr))
21174 {
21175 }
21176 CONSTEXPR npu_set_ofm_base1_t() :
21177 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_OFM_BASE1)), reserved0(0),
21178 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL)), reserved1(0), addr(0)
21179 {
21180 }
21181 CONSTEXPR bool valid() const
21182 {
21183 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_OFM_BASE1) && control >= 1 &&
21184 control <= 2;
21185 }
21186 CONSTEXPR void init()
21187 {
21188 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_OFM_BASE1);
21189 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL);
21190 }
21191 operator uint64_t()
21192 {
21193 uint64_t word;
21194 std::memcpy(&word, this, sizeof(word));
21195 return word;
21196 }
21197 CONSTEXPR NPU_NAMESPACE::cmd1_opcode get_opcode() const
21198 {
21199 return static_cast<NPU_NAMESPACE::cmd1_opcode>(opcode);
21200 }
21201 CONSTEXPR npu_set_ofm_base1_t &set_opcode(NPU_NAMESPACE::cmd1_opcode value)
21202 {
21203 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
21204 return *this;
21205 }
21206 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
21207 {
21208 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
21209 }
21210 CONSTEXPR npu_set_ofm_base1_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
21211 {
21212 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
21213 return *this;
21214 }
21215 CONSTEXPR uint32_t get_addr() const
21216 {
21217 return static_cast<uint32_t>(addr);
21218 }
21219 CONSTEXPR npu_set_ofm_base1_t &set_addr(uint32_t value)
21220 {
21221 addr = static_cast<uint32_t>(value);
21222 return *this;
21223 }
21224#ifdef NPU_DISASSEMBLE
21225 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
21226 {
21227 std::stringstream saddr;
21228 saddr << std::hex << "0x" << get_addr();
21229 fields.push_back(std::make_pair<std::string, std::string>("addr", saddr.str()));
21230 }
21231#endif
21232#endif
21233 };
21234 // OFM Tile 2 address
21235 struct npu_set_ofm_base2_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020021236 {
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020021237#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020021238 private:
21239#endif
21240 uint32_t opcode : 10; // opcode
21241 uint32_t reserved0 : 4;
21242 uint32_t control : 2; // control
21243 uint32_t reserved1 : 16;
21244 uint32_t addr : 32; // address offset
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020021245#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020021246 public:
21247 npu_set_ofm_base2_t(uint32_t _addr) :
21248 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_OFM_BASE2)), reserved0(0),
21249 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL)), reserved1(0),
21250 addr(static_cast<uint32_t>(_addr))
21251 {
21252 }
21253 CONSTEXPR npu_set_ofm_base2_t() :
21254 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_OFM_BASE2)), reserved0(0),
21255 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL)), reserved1(0), addr(0)
21256 {
21257 }
21258 CONSTEXPR bool valid() const
21259 {
21260 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_OFM_BASE2) && control >= 1 &&
21261 control <= 2;
21262 }
21263 CONSTEXPR void init()
21264 {
21265 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_OFM_BASE2);
21266 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL);
21267 }
21268 operator uint64_t()
21269 {
21270 uint64_t word;
21271 std::memcpy(&word, this, sizeof(word));
21272 return word;
21273 }
21274 CONSTEXPR NPU_NAMESPACE::cmd1_opcode get_opcode() const
21275 {
21276 return static_cast<NPU_NAMESPACE::cmd1_opcode>(opcode);
21277 }
21278 CONSTEXPR npu_set_ofm_base2_t &set_opcode(NPU_NAMESPACE::cmd1_opcode value)
21279 {
21280 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
21281 return *this;
21282 }
21283 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
21284 {
21285 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
21286 }
21287 CONSTEXPR npu_set_ofm_base2_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
21288 {
21289 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
21290 return *this;
21291 }
21292 CONSTEXPR uint32_t get_addr() const
21293 {
21294 return static_cast<uint32_t>(addr);
21295 }
21296 CONSTEXPR npu_set_ofm_base2_t &set_addr(uint32_t value)
21297 {
21298 addr = static_cast<uint32_t>(value);
21299 return *this;
21300 }
21301#ifdef NPU_DISASSEMBLE
21302 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
21303 {
21304 std::stringstream saddr;
21305 saddr << std::hex << "0x" << get_addr();
21306 fields.push_back(std::make_pair<std::string, std::string>("addr", saddr.str()));
21307 }
21308#endif
21309#endif
21310 };
21311 // OFM Tile 3 address
21312 struct npu_set_ofm_base3_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020021313 {
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020021314#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020021315 private:
21316#endif
21317 uint32_t opcode : 10; // opcode
21318 uint32_t reserved0 : 4;
21319 uint32_t control : 2; // control
21320 uint32_t reserved1 : 16;
21321 uint32_t addr : 32; // address offset
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020021322#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020021323 public:
21324 npu_set_ofm_base3_t(uint32_t _addr) :
21325 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_OFM_BASE3)), reserved0(0),
21326 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL)), reserved1(0),
21327 addr(static_cast<uint32_t>(_addr))
21328 {
21329 }
21330 CONSTEXPR npu_set_ofm_base3_t() :
21331 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_OFM_BASE3)), reserved0(0),
21332 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL)), reserved1(0), addr(0)
21333 {
21334 }
21335 CONSTEXPR bool valid() const
21336 {
21337 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_OFM_BASE3) && control >= 1 &&
21338 control <= 2;
21339 }
21340 CONSTEXPR void init()
21341 {
21342 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_OFM_BASE3);
21343 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL);
21344 }
21345 operator uint64_t()
21346 {
21347 uint64_t word;
21348 std::memcpy(&word, this, sizeof(word));
21349 return word;
21350 }
21351 CONSTEXPR NPU_NAMESPACE::cmd1_opcode get_opcode() const
21352 {
21353 return static_cast<NPU_NAMESPACE::cmd1_opcode>(opcode);
21354 }
21355 CONSTEXPR npu_set_ofm_base3_t &set_opcode(NPU_NAMESPACE::cmd1_opcode value)
21356 {
21357 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
21358 return *this;
21359 }
21360 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
21361 {
21362 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
21363 }
21364 CONSTEXPR npu_set_ofm_base3_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
21365 {
21366 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
21367 return *this;
21368 }
21369 CONSTEXPR uint32_t get_addr() const
21370 {
21371 return static_cast<uint32_t>(addr);
21372 }
21373 CONSTEXPR npu_set_ofm_base3_t &set_addr(uint32_t value)
21374 {
21375 addr = static_cast<uint32_t>(value);
21376 return *this;
21377 }
21378#ifdef NPU_DISASSEMBLE
21379 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
21380 {
21381 std::stringstream saddr;
21382 saddr << std::hex << "0x" << get_addr();
21383 fields.push_back(std::make_pair<std::string, std::string>("addr", saddr.str()));
21384 }
21385#endif
21386#endif
21387 };
21388 // OFM byte stride between horizontal values
21389 struct npu_set_ofm_stride_x_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020021390 {
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020021391#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020021392 private:
21393#endif
21394 uint32_t opcode : 10; // opcode
21395 uint32_t reserved0 : 4;
21396 uint32_t control : 2; // control
21397 uint32_t reserved1 : 16;
21398 uint32_t addr : 32; // address offset
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020021399#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020021400 public:
21401 npu_set_ofm_stride_x_t(uint32_t _addr) :
21402 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_OFM_STRIDE_X)), reserved0(0),
21403 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL)), reserved1(0),
21404 addr(static_cast<uint32_t>(_addr))
21405 {
21406 }
21407 CONSTEXPR npu_set_ofm_stride_x_t() :
21408 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_OFM_STRIDE_X)), reserved0(0),
21409 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL)), reserved1(0), addr(0)
21410 {
21411 }
21412 CONSTEXPR bool valid() const
21413 {
21414 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_OFM_STRIDE_X) && control >= 1 &&
21415 control <= 2;
21416 }
21417 CONSTEXPR void init()
21418 {
21419 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_OFM_STRIDE_X);
21420 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL);
21421 }
21422 operator uint64_t()
21423 {
21424 uint64_t word;
21425 std::memcpy(&word, this, sizeof(word));
21426 return word;
21427 }
21428 CONSTEXPR NPU_NAMESPACE::cmd1_opcode get_opcode() const
21429 {
21430 return static_cast<NPU_NAMESPACE::cmd1_opcode>(opcode);
21431 }
21432 CONSTEXPR npu_set_ofm_stride_x_t &set_opcode(NPU_NAMESPACE::cmd1_opcode value)
21433 {
21434 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
21435 return *this;
21436 }
21437 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
21438 {
21439 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
21440 }
21441 CONSTEXPR npu_set_ofm_stride_x_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
21442 {
21443 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
21444 return *this;
21445 }
21446 CONSTEXPR uint32_t get_addr() const
21447 {
21448 return static_cast<uint32_t>(addr);
21449 }
21450 CONSTEXPR npu_set_ofm_stride_x_t &set_addr(uint32_t value)
21451 {
21452 addr = static_cast<uint32_t>(value);
21453 return *this;
21454 }
21455#ifdef NPU_DISASSEMBLE
21456 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
21457 {
21458 std::stringstream saddr;
21459 saddr << std::hex << "0x" << get_addr();
21460 fields.push_back(std::make_pair<std::string, std::string>("addr", saddr.str()));
21461 }
21462#endif
21463#endif
21464 };
21465 // OFM byte stride between vertical values
21466 struct npu_set_ofm_stride_y_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020021467 {
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020021468#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020021469 private:
21470#endif
21471 uint32_t opcode : 10; // opcode
21472 uint32_t reserved0 : 4;
21473 uint32_t control : 2; // control
21474 uint32_t reserved1 : 16;
21475 uint32_t addr : 32; // address offset
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020021476#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020021477 public:
21478 npu_set_ofm_stride_y_t(uint32_t _addr) :
21479 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_OFM_STRIDE_Y)), reserved0(0),
21480 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL)), reserved1(0),
21481 addr(static_cast<uint32_t>(_addr))
21482 {
21483 }
21484 CONSTEXPR npu_set_ofm_stride_y_t() :
21485 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_OFM_STRIDE_Y)), reserved0(0),
21486 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL)), reserved1(0), addr(0)
21487 {
21488 }
21489 CONSTEXPR bool valid() const
21490 {
21491 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_OFM_STRIDE_Y) && control >= 1 &&
21492 control <= 2;
21493 }
21494 CONSTEXPR void init()
21495 {
21496 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_OFM_STRIDE_Y);
21497 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL);
21498 }
21499 operator uint64_t()
21500 {
21501 uint64_t word;
21502 std::memcpy(&word, this, sizeof(word));
21503 return word;
21504 }
21505 CONSTEXPR NPU_NAMESPACE::cmd1_opcode get_opcode() const
21506 {
21507 return static_cast<NPU_NAMESPACE::cmd1_opcode>(opcode);
21508 }
21509 CONSTEXPR npu_set_ofm_stride_y_t &set_opcode(NPU_NAMESPACE::cmd1_opcode value)
21510 {
21511 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
21512 return *this;
21513 }
21514 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
21515 {
21516 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
21517 }
21518 CONSTEXPR npu_set_ofm_stride_y_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
21519 {
21520 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
21521 return *this;
21522 }
21523 CONSTEXPR uint32_t get_addr() const
21524 {
21525 return static_cast<uint32_t>(addr);
21526 }
21527 CONSTEXPR npu_set_ofm_stride_y_t &set_addr(uint32_t value)
21528 {
21529 addr = static_cast<uint32_t>(value);
21530 return *this;
21531 }
21532#ifdef NPU_DISASSEMBLE
21533 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
21534 {
21535 std::stringstream saddr;
21536 saddr << std::hex << "0x" << get_addr();
21537 fields.push_back(std::make_pair<std::string, std::string>("addr", saddr.str()));
21538 }
21539#endif
21540#endif
21541 };
21542 // OFM byte stride between channel blocks (of 16 bytes each block)
21543 struct npu_set_ofm_stride_c_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020021544 {
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020021545#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020021546 private:
21547#endif
21548 uint32_t opcode : 10; // opcode
21549 uint32_t reserved0 : 4;
21550 uint32_t control : 2; // control
21551 uint32_t reserved1 : 16;
21552 uint32_t addr : 32; // address offset
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020021553#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020021554 public:
21555 npu_set_ofm_stride_c_t(uint32_t _addr) :
21556 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_OFM_STRIDE_C)), reserved0(0),
21557 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL)), reserved1(0),
21558 addr(static_cast<uint32_t>(_addr))
21559 {
21560 }
21561 CONSTEXPR npu_set_ofm_stride_c_t() :
21562 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_OFM_STRIDE_C)), reserved0(0),
21563 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL)), reserved1(0), addr(0)
21564 {
21565 }
21566 CONSTEXPR bool valid() const
21567 {
21568 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_OFM_STRIDE_C) && control >= 1 &&
21569 control <= 2;
21570 }
21571 CONSTEXPR void init()
21572 {
21573 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_OFM_STRIDE_C);
21574 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL);
21575 }
21576 operator uint64_t()
21577 {
21578 uint64_t word;
21579 std::memcpy(&word, this, sizeof(word));
21580 return word;
21581 }
21582 CONSTEXPR NPU_NAMESPACE::cmd1_opcode get_opcode() const
21583 {
21584 return static_cast<NPU_NAMESPACE::cmd1_opcode>(opcode);
21585 }
21586 CONSTEXPR npu_set_ofm_stride_c_t &set_opcode(NPU_NAMESPACE::cmd1_opcode value)
21587 {
21588 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
21589 return *this;
21590 }
21591 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
21592 {
21593 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
21594 }
21595 CONSTEXPR npu_set_ofm_stride_c_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
21596 {
21597 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
21598 return *this;
21599 }
21600 CONSTEXPR uint32_t get_addr() const
21601 {
21602 return static_cast<uint32_t>(addr);
21603 }
21604 CONSTEXPR npu_set_ofm_stride_c_t &set_addr(uint32_t value)
21605 {
21606 addr = static_cast<uint32_t>(value);
21607 return *this;
21608 }
21609#ifdef NPU_DISASSEMBLE
21610 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
21611 {
21612 std::stringstream saddr;
21613 saddr << std::hex << "0x" << get_addr();
21614 fields.push_back(std::make_pair<std::string, std::string>("addr", saddr.str()));
21615 }
21616#endif
21617#endif
21618 };
21619 // Weight stream byte offset in WEIGHT_REGION
21620 struct npu_set_weight_base_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020021621 {
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020021622#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020021623 private:
21624#endif
21625 uint32_t opcode : 10; // opcode
21626 uint32_t reserved0 : 4;
21627 uint32_t control : 2; // control
21628 uint32_t reserved1 : 16;
21629 uint32_t addr : 32; // address offset
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020021630#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020021631 public:
21632 npu_set_weight_base_t(uint32_t _addr) :
21633 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_WEIGHT_BASE)), reserved0(0),
21634 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL)), reserved1(0),
21635 addr(static_cast<uint32_t>(_addr))
21636 {
21637 }
21638 CONSTEXPR npu_set_weight_base_t() :
21639 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_WEIGHT_BASE)), reserved0(0),
21640 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL)), reserved1(0), addr(0)
21641 {
21642 }
21643 CONSTEXPR bool valid() const
21644 {
21645 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_WEIGHT_BASE) && control >= 1 &&
21646 control <= 2;
21647 }
21648 CONSTEXPR void init()
21649 {
21650 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_WEIGHT_BASE);
21651 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL);
21652 }
21653 operator uint64_t()
21654 {
21655 uint64_t word;
21656 std::memcpy(&word, this, sizeof(word));
21657 return word;
21658 }
21659 CONSTEXPR NPU_NAMESPACE::cmd1_opcode get_opcode() const
21660 {
21661 return static_cast<NPU_NAMESPACE::cmd1_opcode>(opcode);
21662 }
21663 CONSTEXPR npu_set_weight_base_t &set_opcode(NPU_NAMESPACE::cmd1_opcode value)
21664 {
21665 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
21666 return *this;
21667 }
21668 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
21669 {
21670 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
21671 }
21672 CONSTEXPR npu_set_weight_base_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
21673 {
21674 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
21675 return *this;
21676 }
21677 CONSTEXPR uint32_t get_addr() const
21678 {
21679 return static_cast<uint32_t>(addr);
21680 }
21681 CONSTEXPR npu_set_weight_base_t &set_addr(uint32_t value)
21682 {
21683 addr = static_cast<uint32_t>(value);
21684 return *this;
21685 }
21686#ifdef NPU_DISASSEMBLE
21687 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
21688 {
21689 std::stringstream saddr;
21690 saddr << std::hex << "0x" << get_addr();
21691 fields.push_back(std::make_pair<std::string, std::string>("addr", saddr.str()));
21692 }
21693#endif
21694#endif
21695 };
21696 // Weight stream byte length
21697 struct npu_set_weight_length_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020021698 {
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020021699#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020021700 private:
21701#endif
21702 uint32_t opcode : 10; // opcode
21703 uint32_t reserved0 : 4;
21704 uint32_t control : 2; // control
21705 uint32_t reserved1 : 16;
21706 uint32_t length : 32; // Weight stream byte length
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020021707#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020021708 public:
21709 npu_set_weight_length_t(uint32_t _length) :
21710 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_WEIGHT_LENGTH)), reserved0(0),
21711 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL)), reserved1(0),
21712 length(static_cast<uint32_t>(_length))
21713 {
21714 }
21715 CONSTEXPR npu_set_weight_length_t() :
21716 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_WEIGHT_LENGTH)), reserved0(0),
21717 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL)), reserved1(0), length(0)
21718 {
21719 }
21720 CONSTEXPR bool valid() const
21721 {
21722 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_WEIGHT_LENGTH) && control >= 1 &&
21723 control <= 2;
21724 }
21725 CONSTEXPR void init()
21726 {
21727 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_WEIGHT_LENGTH);
21728 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL);
21729 }
21730 operator uint64_t()
21731 {
21732 uint64_t word;
21733 std::memcpy(&word, this, sizeof(word));
21734 return word;
21735 }
21736 CONSTEXPR NPU_NAMESPACE::cmd1_opcode get_opcode() const
21737 {
21738 return static_cast<NPU_NAMESPACE::cmd1_opcode>(opcode);
21739 }
21740 CONSTEXPR npu_set_weight_length_t &set_opcode(NPU_NAMESPACE::cmd1_opcode value)
21741 {
21742 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
21743 return *this;
21744 }
21745 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
21746 {
21747 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
21748 }
21749 CONSTEXPR npu_set_weight_length_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
21750 {
21751 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
21752 return *this;
21753 }
21754 CONSTEXPR uint32_t get_length() const
21755 {
21756 return static_cast<uint32_t>(length);
21757 }
21758 CONSTEXPR npu_set_weight_length_t &set_length(uint32_t value)
21759 {
21760 length = static_cast<uint32_t>(value);
21761 return *this;
21762 }
21763#ifdef NPU_DISASSEMBLE
21764 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
21765 {
21766 fields.push_back(std::make_pair<std::string, std::string>("length", std::to_string(length)));
21767 }
21768#endif
21769#endif
21770 };
21771 // Scale and bias stream input byte offset from SCALE_REGION
21772 struct npu_set_scale_base_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020021773 {
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020021774#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020021775 private:
21776#endif
21777 uint32_t opcode : 10; // opcode
21778 uint32_t reserved0 : 4;
21779 uint32_t control : 2; // control
21780 uint32_t reserved1 : 16;
21781 uint32_t addr : 32; // address offset
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020021782#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020021783 public:
21784 npu_set_scale_base_t(uint32_t _addr) :
21785 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_SCALE_BASE)), reserved0(0),
21786 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL)), reserved1(0),
21787 addr(static_cast<uint32_t>(_addr))
21788 {
21789 }
21790 CONSTEXPR npu_set_scale_base_t() :
21791 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_SCALE_BASE)), reserved0(0),
21792 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL)), reserved1(0), addr(0)
21793 {
21794 }
21795 CONSTEXPR bool valid() const
21796 {
21797 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_SCALE_BASE) && control >= 1 &&
21798 control <= 2;
21799 }
21800 CONSTEXPR void init()
21801 {
21802 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_SCALE_BASE);
21803 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL);
21804 }
21805 operator uint64_t()
21806 {
21807 uint64_t word;
21808 std::memcpy(&word, this, sizeof(word));
21809 return word;
21810 }
21811 CONSTEXPR NPU_NAMESPACE::cmd1_opcode get_opcode() const
21812 {
21813 return static_cast<NPU_NAMESPACE::cmd1_opcode>(opcode);
21814 }
21815 CONSTEXPR npu_set_scale_base_t &set_opcode(NPU_NAMESPACE::cmd1_opcode value)
21816 {
21817 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
21818 return *this;
21819 }
21820 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
21821 {
21822 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
21823 }
21824 CONSTEXPR npu_set_scale_base_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
21825 {
21826 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
21827 return *this;
21828 }
21829 CONSTEXPR uint32_t get_addr() const
21830 {
21831 return static_cast<uint32_t>(addr);
21832 }
21833 CONSTEXPR npu_set_scale_base_t &set_addr(uint32_t value)
21834 {
21835 addr = static_cast<uint32_t>(value);
21836 return *this;
21837 }
21838#ifdef NPU_DISASSEMBLE
21839 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
21840 {
21841 std::stringstream saddr;
21842 saddr << std::hex << "0x" << get_addr();
21843 fields.push_back(std::make_pair<std::string, std::string>("addr", saddr.str()));
21844 }
21845#endif
21846#endif
21847 };
21848 // Scale and bias stream input byte length
21849 struct npu_set_scale_length_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020021850 {
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020021851#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020021852 private:
21853#endif
21854 uint32_t opcode : 10; // opcode
21855 uint32_t reserved0 : 4;
21856 uint32_t control : 2; // control
21857 uint32_t reserved1 : 16;
21858 uint32_t length : 20; // Scale and bias stream byte length
21859 uint32_t reserved2 : 12;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020021860#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020021861 public:
21862 npu_set_scale_length_t(uint32_t _length) :
21863 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_SCALE_LENGTH)), reserved0(0),
21864 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL)), reserved1(0),
21865 length(static_cast<uint32_t>(_length) & ((1U << 20) - 1)), reserved2(0)
21866 {
21867 }
21868 CONSTEXPR npu_set_scale_length_t() :
21869 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_SCALE_LENGTH)), reserved0(0),
21870 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL)), reserved1(0), length(0), reserved2(0)
21871 {
21872 }
21873 CONSTEXPR bool valid() const
21874 {
21875 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_SCALE_LENGTH) && control >= 1 &&
21876 control <= 2;
21877 }
21878 CONSTEXPR void init()
21879 {
21880 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_SCALE_LENGTH);
21881 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL);
21882 }
21883 operator uint64_t()
21884 {
21885 uint64_t word;
21886 std::memcpy(&word, this, sizeof(word));
21887 return word;
21888 }
21889 CONSTEXPR NPU_NAMESPACE::cmd1_opcode get_opcode() const
21890 {
21891 return static_cast<NPU_NAMESPACE::cmd1_opcode>(opcode);
21892 }
21893 CONSTEXPR npu_set_scale_length_t &set_opcode(NPU_NAMESPACE::cmd1_opcode value)
21894 {
21895 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
21896 return *this;
21897 }
21898 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
21899 {
21900 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
21901 }
21902 CONSTEXPR npu_set_scale_length_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
21903 {
21904 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
21905 return *this;
21906 }
21907 CONSTEXPR uint32_t get_length() const
21908 {
21909 return static_cast<uint32_t>(length);
21910 }
21911 CONSTEXPR npu_set_scale_length_t &set_length(uint32_t value)
21912 {
21913 length = static_cast<uint32_t>(value) & ((1U << 20) - 1);
21914 return *this;
21915 }
21916#ifdef NPU_DISASSEMBLE
21917 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
21918 {
21919 fields.push_back(std::make_pair<std::string, std::string>("length", std::to_string(length)));
21920 }
21921#endif
21922#endif
21923 };
21924 // OFM scale
21925 struct npu_set_ofm_scale_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020021926 {
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020021927#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020021928 private:
21929#endif
21930 uint32_t opcode : 10; // opcode
21931 uint32_t reserved0 : 4;
21932 uint32_t control : 2; // control
21933 uint32_t shift : 6; // Shift
21934 uint32_t reserved1 : 10;
21935 uint32_t scale : 32; // Scale. Not applied for 32-bit operations
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020021936#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020021937 public:
21938 npu_set_ofm_scale_t(uint32_t _shift, uint32_t _scale) :
21939 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_OFM_SCALE)), reserved0(0),
21940 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL)),
21941 shift(static_cast<uint8_t>(_shift) & ((1U << 6) - 1)), reserved1(0), scale(static_cast<uint32_t>(_scale))
21942 {
21943 }
21944 CONSTEXPR npu_set_ofm_scale_t() :
21945 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_OFM_SCALE)), reserved0(0),
21946 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL)), shift(0), reserved1(0), scale(0)
21947 {
21948 }
21949 CONSTEXPR bool valid() const
21950 {
21951 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_OFM_SCALE) && control >= 1 &&
21952 control <= 2;
21953 }
21954 CONSTEXPR void init()
21955 {
21956 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_OFM_SCALE);
21957 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL);
21958 }
21959 operator uint64_t()
21960 {
21961 uint64_t word;
21962 std::memcpy(&word, this, sizeof(word));
21963 return word;
21964 }
21965 CONSTEXPR NPU_NAMESPACE::cmd1_opcode get_opcode() const
21966 {
21967 return static_cast<NPU_NAMESPACE::cmd1_opcode>(opcode);
21968 }
21969 CONSTEXPR npu_set_ofm_scale_t &set_opcode(NPU_NAMESPACE::cmd1_opcode value)
21970 {
21971 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
21972 return *this;
21973 }
21974 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
21975 {
21976 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
21977 }
21978 CONSTEXPR npu_set_ofm_scale_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
21979 {
21980 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
21981 return *this;
21982 }
21983 CONSTEXPR uint32_t get_shift() const
21984 {
21985 return static_cast<uint32_t>(shift);
21986 }
21987 CONSTEXPR npu_set_ofm_scale_t &set_shift(uint32_t value)
21988 {
21989 shift = static_cast<uint8_t>(value) & ((1U << 6) - 1);
21990 return *this;
21991 }
21992 CONSTEXPR uint32_t get_scale() const
21993 {
21994 return static_cast<uint32_t>(scale);
21995 }
21996 CONSTEXPR npu_set_ofm_scale_t &set_scale(uint32_t value)
21997 {
21998 scale = static_cast<uint32_t>(value);
21999 return *this;
22000 }
22001#ifdef NPU_DISASSEMBLE
22002 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
22003 {
22004 fields.push_back(std::make_pair<std::string, std::string>("shift", std::to_string(shift)));
22005 fields.push_back(std::make_pair<std::string, std::string>("scale", std::to_string(scale)));
22006 }
22007#endif
22008#endif
22009 };
22010 // Input operand A scale
22011 struct npu_set_opa_scale_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020022012 {
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020022013#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020022014 private:
22015#endif
22016 uint32_t opcode : 10; // opcode
22017 uint32_t reserved0 : 4;
22018 uint32_t control : 2; // control
22019 uint32_t shift : 6; // Shift. Ignored if IFM scale mode is 0
22020 uint32_t reserved1 : 10;
22021 uint32_t scale : 32; // Scale. 16-bit if IFM scale mode is 0
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020022022#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020022023 public:
22024 npu_set_opa_scale_t(uint32_t _shift, uint32_t _scale) :
22025 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_OPA_SCALE)), reserved0(0),
22026 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL)),
22027 shift(static_cast<uint8_t>(_shift) & ((1U << 6) - 1)), reserved1(0), scale(static_cast<uint32_t>(_scale))
22028 {
22029 }
22030 CONSTEXPR npu_set_opa_scale_t() :
22031 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_OPA_SCALE)), reserved0(0),
22032 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL)), shift(0), reserved1(0), scale(0)
22033 {
22034 }
22035 CONSTEXPR bool valid() const
22036 {
22037 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_OPA_SCALE) && control >= 1 &&
22038 control <= 2;
22039 }
22040 CONSTEXPR void init()
22041 {
22042 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_OPA_SCALE);
22043 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL);
22044 }
22045 operator uint64_t()
22046 {
22047 uint64_t word;
22048 std::memcpy(&word, this, sizeof(word));
22049 return word;
22050 }
22051 CONSTEXPR NPU_NAMESPACE::cmd1_opcode get_opcode() const
22052 {
22053 return static_cast<NPU_NAMESPACE::cmd1_opcode>(opcode);
22054 }
22055 CONSTEXPR npu_set_opa_scale_t &set_opcode(NPU_NAMESPACE::cmd1_opcode value)
22056 {
22057 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
22058 return *this;
22059 }
22060 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
22061 {
22062 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
22063 }
22064 CONSTEXPR npu_set_opa_scale_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
22065 {
22066 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
22067 return *this;
22068 }
22069 CONSTEXPR uint32_t get_shift() const
22070 {
22071 return static_cast<uint32_t>(shift);
22072 }
22073 CONSTEXPR npu_set_opa_scale_t &set_shift(uint32_t value)
22074 {
22075 shift = static_cast<uint8_t>(value) & ((1U << 6) - 1);
22076 return *this;
22077 }
22078 CONSTEXPR uint32_t get_scale() const
22079 {
22080 return static_cast<uint32_t>(scale);
22081 }
22082 CONSTEXPR npu_set_opa_scale_t &set_scale(uint32_t value)
22083 {
22084 scale = static_cast<uint32_t>(value);
22085 return *this;
22086 }
22087#ifdef NPU_DISASSEMBLE
22088 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
22089 {
22090 fields.push_back(std::make_pair<std::string, std::string>("shift", std::to_string(shift)));
22091 fields.push_back(std::make_pair<std::string, std::string>("scale", std::to_string(scale)));
22092 }
22093#endif
22094#endif
22095 };
22096 // Input operand B scale
22097 struct npu_set_opb_scale_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020022098 {
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020022099#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020022100 private:
22101#endif
22102 uint32_t opcode : 10; // opcode
22103 uint32_t reserved0 : 4;
22104 uint32_t control : 2; // control
22105 uint32_t reserved1 : 16;
22106 uint32_t scale : 16; // Scale. Not used if IFM scale mode is 1 or 2
22107 uint32_t reserved2 : 16;
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020022108#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020022109 public:
22110 npu_set_opb_scale_t(uint32_t _scale) :
22111 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_OPB_SCALE)), reserved0(0),
22112 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL)), reserved1(0),
22113 scale(static_cast<uint16_t>(_scale) & ((1U << 16) - 1)), reserved2(0)
22114 {
22115 }
22116 CONSTEXPR npu_set_opb_scale_t() :
22117 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_OPB_SCALE)), reserved0(0),
22118 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL)), reserved1(0), scale(0), reserved2(0)
22119 {
22120 }
22121 CONSTEXPR bool valid() const
22122 {
22123 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_OPB_SCALE) && control >= 1 &&
22124 control <= 2;
22125 }
22126 CONSTEXPR void init()
22127 {
22128 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_OPB_SCALE);
22129 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL);
22130 }
22131 operator uint64_t()
22132 {
22133 uint64_t word;
22134 std::memcpy(&word, this, sizeof(word));
22135 return word;
22136 }
22137 CONSTEXPR NPU_NAMESPACE::cmd1_opcode get_opcode() const
22138 {
22139 return static_cast<NPU_NAMESPACE::cmd1_opcode>(opcode);
22140 }
22141 CONSTEXPR npu_set_opb_scale_t &set_opcode(NPU_NAMESPACE::cmd1_opcode value)
22142 {
22143 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
22144 return *this;
22145 }
22146 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
22147 {
22148 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
22149 }
22150 CONSTEXPR npu_set_opb_scale_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
22151 {
22152 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
22153 return *this;
22154 }
22155 CONSTEXPR uint32_t get_scale() const
22156 {
22157 return static_cast<uint32_t>(scale);
22158 }
22159 CONSTEXPR npu_set_opb_scale_t &set_scale(uint32_t value)
22160 {
22161 scale = static_cast<uint16_t>(value) & ((1U << 16) - 1);
22162 return *this;
22163 }
22164#ifdef NPU_DISASSEMBLE
22165 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
22166 {
22167 fields.push_back(std::make_pair<std::string, std::string>("scale", std::to_string(scale)));
22168 }
22169#endif
22170#endif
22171 };
22172 // DMA user channel 0 source byte offset from DMA0_SRC_REGION
22173 struct npu_set_dma0_src_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020022174 {
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020022175#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020022176 private:
22177#endif
22178 uint32_t opcode : 10; // opcode
22179 uint32_t reserved0 : 4;
22180 uint32_t control : 2; // control
22181 uint32_t reserved1 : 16;
22182 uint32_t addr : 32; // address offset
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020022183#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020022184 public:
22185 npu_set_dma0_src_t(uint32_t _addr) :
22186 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_DMA0_SRC)), reserved0(0),
22187 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL)), reserved1(0),
22188 addr(static_cast<uint32_t>(_addr))
22189 {
22190 }
22191 CONSTEXPR npu_set_dma0_src_t() :
22192 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_DMA0_SRC)), reserved0(0),
22193 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL)), reserved1(0), addr(0)
22194 {
22195 }
22196 CONSTEXPR bool valid() const
22197 {
22198 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_DMA0_SRC) && control >= 1 &&
22199 control <= 2;
22200 }
22201 CONSTEXPR void init()
22202 {
22203 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_DMA0_SRC);
22204 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL);
22205 }
22206 operator uint64_t()
22207 {
22208 uint64_t word;
22209 std::memcpy(&word, this, sizeof(word));
22210 return word;
22211 }
22212 CONSTEXPR NPU_NAMESPACE::cmd1_opcode get_opcode() const
22213 {
22214 return static_cast<NPU_NAMESPACE::cmd1_opcode>(opcode);
22215 }
22216 CONSTEXPR npu_set_dma0_src_t &set_opcode(NPU_NAMESPACE::cmd1_opcode value)
22217 {
22218 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
22219 return *this;
22220 }
22221 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
22222 {
22223 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
22224 }
22225 CONSTEXPR npu_set_dma0_src_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
22226 {
22227 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
22228 return *this;
22229 }
22230 CONSTEXPR uint32_t get_addr() const
22231 {
22232 return static_cast<uint32_t>(addr);
22233 }
22234 CONSTEXPR npu_set_dma0_src_t &set_addr(uint32_t value)
22235 {
22236 addr = static_cast<uint32_t>(value);
22237 return *this;
22238 }
22239#ifdef NPU_DISASSEMBLE
22240 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
22241 {
22242 std::stringstream saddr;
22243 saddr << std::hex << "0x" << get_addr();
22244 fields.push_back(std::make_pair<std::string, std::string>("addr", saddr.str()));
22245 }
22246#endif
22247#endif
22248 };
22249 // DMA user channel 0 destination byte offset from DMA0_DST_REGION
22250 struct npu_set_dma0_dst_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020022251 {
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020022252#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020022253 private:
22254#endif
22255 uint32_t opcode : 10; // opcode
22256 uint32_t reserved0 : 4;
22257 uint32_t control : 2; // control
22258 uint32_t reserved1 : 16;
22259 uint32_t addr : 32; // address offset
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020022260#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020022261 public:
22262 npu_set_dma0_dst_t(uint32_t _addr) :
22263 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_DMA0_DST)), reserved0(0),
22264 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL)), reserved1(0),
22265 addr(static_cast<uint32_t>(_addr))
22266 {
22267 }
22268 CONSTEXPR npu_set_dma0_dst_t() :
22269 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_DMA0_DST)), reserved0(0),
22270 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL)), reserved1(0), addr(0)
22271 {
22272 }
22273 CONSTEXPR bool valid() const
22274 {
22275 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_DMA0_DST) && control >= 1 &&
22276 control <= 2;
22277 }
22278 CONSTEXPR void init()
22279 {
22280 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_DMA0_DST);
22281 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL);
22282 }
22283 operator uint64_t()
22284 {
22285 uint64_t word;
22286 std::memcpy(&word, this, sizeof(word));
22287 return word;
22288 }
22289 CONSTEXPR NPU_NAMESPACE::cmd1_opcode get_opcode() const
22290 {
22291 return static_cast<NPU_NAMESPACE::cmd1_opcode>(opcode);
22292 }
22293 CONSTEXPR npu_set_dma0_dst_t &set_opcode(NPU_NAMESPACE::cmd1_opcode value)
22294 {
22295 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
22296 return *this;
22297 }
22298 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
22299 {
22300 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
22301 }
22302 CONSTEXPR npu_set_dma0_dst_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
22303 {
22304 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
22305 return *this;
22306 }
22307 CONSTEXPR uint32_t get_addr() const
22308 {
22309 return static_cast<uint32_t>(addr);
22310 }
22311 CONSTEXPR npu_set_dma0_dst_t &set_addr(uint32_t value)
22312 {
22313 addr = static_cast<uint32_t>(value);
22314 return *this;
22315 }
22316#ifdef NPU_DISASSEMBLE
22317 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
22318 {
22319 std::stringstream saddr;
22320 saddr << std::hex << "0x" << get_addr();
22321 fields.push_back(std::make_pair<std::string, std::string>("addr", saddr.str()));
22322 }
22323#endif
22324#endif
22325 };
22326 // DMA user channel 0 transfer length in bytes for 1D mode
22327 struct npu_set_dma0_len_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020022328 {
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020022329#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020022330 private:
22331#endif
22332 uint32_t opcode : 10; // opcode
22333 uint32_t reserved0 : 4;
22334 uint32_t control : 2; // control
22335 uint32_t reserved1 : 16;
22336 uint32_t addr : 32; // address offset
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020022337#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020022338 public:
22339 npu_set_dma0_len_t(uint32_t _addr) :
22340 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_DMA0_LEN)), reserved0(0),
22341 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL)), reserved1(0),
22342 addr(static_cast<uint32_t>(_addr))
22343 {
22344 }
22345 CONSTEXPR npu_set_dma0_len_t() :
22346 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_DMA0_LEN)), reserved0(0),
22347 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL)), reserved1(0), addr(0)
22348 {
22349 }
22350 CONSTEXPR bool valid() const
22351 {
22352 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_DMA0_LEN) && control >= 1 &&
22353 control <= 2;
22354 }
22355 CONSTEXPR void init()
22356 {
22357 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_DMA0_LEN);
22358 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL);
22359 }
22360 operator uint64_t()
22361 {
22362 uint64_t word;
22363 std::memcpy(&word, this, sizeof(word));
22364 return word;
22365 }
22366 CONSTEXPR NPU_NAMESPACE::cmd1_opcode get_opcode() const
22367 {
22368 return static_cast<NPU_NAMESPACE::cmd1_opcode>(opcode);
22369 }
22370 CONSTEXPR npu_set_dma0_len_t &set_opcode(NPU_NAMESPACE::cmd1_opcode value)
22371 {
22372 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
22373 return *this;
22374 }
22375 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
22376 {
22377 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
22378 }
22379 CONSTEXPR npu_set_dma0_len_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
22380 {
22381 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
22382 return *this;
22383 }
22384 CONSTEXPR uint32_t get_addr() const
22385 {
22386 return static_cast<uint32_t>(addr);
22387 }
22388 CONSTEXPR npu_set_dma0_len_t &set_addr(uint32_t value)
22389 {
22390 addr = static_cast<uint32_t>(value);
22391 return *this;
22392 }
22393#ifdef NPU_DISASSEMBLE
22394 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
22395 {
22396 std::stringstream saddr;
22397 saddr << std::hex << "0x" << get_addr();
22398 fields.push_back(std::make_pair<std::string, std::string>("addr", saddr.str()));
22399 }
22400#endif
22401#endif
22402 };
22403 // IFM2 Tile 0 address
22404 struct npu_set_ifm2_base0_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020022405 {
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020022406#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020022407 private:
22408#endif
22409 uint32_t opcode : 10; // opcode
22410 uint32_t reserved0 : 4;
22411 uint32_t control : 2; // control
22412 uint32_t reserved1 : 16;
22413 uint32_t addr : 32; // address offset
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020022414#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020022415 public:
22416 npu_set_ifm2_base0_t(uint32_t _addr) :
22417 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM2_BASE0)), reserved0(0),
22418 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL)), reserved1(0),
22419 addr(static_cast<uint32_t>(_addr))
22420 {
22421 }
22422 CONSTEXPR npu_set_ifm2_base0_t() :
22423 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM2_BASE0)), reserved0(0),
22424 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL)), reserved1(0), addr(0)
22425 {
22426 }
22427 CONSTEXPR bool valid() const
22428 {
22429 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM2_BASE0) && control >= 1 &&
22430 control <= 2;
22431 }
22432 CONSTEXPR void init()
22433 {
22434 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM2_BASE0);
22435 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL);
22436 }
22437 operator uint64_t()
22438 {
22439 uint64_t word;
22440 std::memcpy(&word, this, sizeof(word));
22441 return word;
22442 }
22443 CONSTEXPR NPU_NAMESPACE::cmd1_opcode get_opcode() const
22444 {
22445 return static_cast<NPU_NAMESPACE::cmd1_opcode>(opcode);
22446 }
22447 CONSTEXPR npu_set_ifm2_base0_t &set_opcode(NPU_NAMESPACE::cmd1_opcode value)
22448 {
22449 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
22450 return *this;
22451 }
22452 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
22453 {
22454 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
22455 }
22456 CONSTEXPR npu_set_ifm2_base0_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
22457 {
22458 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
22459 return *this;
22460 }
22461 CONSTEXPR uint32_t get_addr() const
22462 {
22463 return static_cast<uint32_t>(addr);
22464 }
22465 CONSTEXPR npu_set_ifm2_base0_t &set_addr(uint32_t value)
22466 {
22467 addr = static_cast<uint32_t>(value);
22468 return *this;
22469 }
22470#ifdef NPU_DISASSEMBLE
22471 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
22472 {
22473 std::stringstream saddr;
22474 saddr << std::hex << "0x" << get_addr();
22475 fields.push_back(std::make_pair<std::string, std::string>("addr", saddr.str()));
22476 }
22477#endif
22478#endif
22479 };
22480 // IFM2 Tile 1 address
22481 struct npu_set_ifm2_base1_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020022482 {
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020022483#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020022484 private:
22485#endif
22486 uint32_t opcode : 10; // opcode
22487 uint32_t reserved0 : 4;
22488 uint32_t control : 2; // control
22489 uint32_t reserved1 : 16;
22490 uint32_t addr : 32; // address offset
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020022491#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020022492 public:
22493 npu_set_ifm2_base1_t(uint32_t _addr) :
22494 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM2_BASE1)), reserved0(0),
22495 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL)), reserved1(0),
22496 addr(static_cast<uint32_t>(_addr))
22497 {
22498 }
22499 CONSTEXPR npu_set_ifm2_base1_t() :
22500 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM2_BASE1)), reserved0(0),
22501 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL)), reserved1(0), addr(0)
22502 {
22503 }
22504 CONSTEXPR bool valid() const
22505 {
22506 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM2_BASE1) && control >= 1 &&
22507 control <= 2;
22508 }
22509 CONSTEXPR void init()
22510 {
22511 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM2_BASE1);
22512 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL);
22513 }
22514 operator uint64_t()
22515 {
22516 uint64_t word;
22517 std::memcpy(&word, this, sizeof(word));
22518 return word;
22519 }
22520 CONSTEXPR NPU_NAMESPACE::cmd1_opcode get_opcode() const
22521 {
22522 return static_cast<NPU_NAMESPACE::cmd1_opcode>(opcode);
22523 }
22524 CONSTEXPR npu_set_ifm2_base1_t &set_opcode(NPU_NAMESPACE::cmd1_opcode value)
22525 {
22526 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
22527 return *this;
22528 }
22529 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
22530 {
22531 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
22532 }
22533 CONSTEXPR npu_set_ifm2_base1_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
22534 {
22535 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
22536 return *this;
22537 }
22538 CONSTEXPR uint32_t get_addr() const
22539 {
22540 return static_cast<uint32_t>(addr);
22541 }
22542 CONSTEXPR npu_set_ifm2_base1_t &set_addr(uint32_t value)
22543 {
22544 addr = static_cast<uint32_t>(value);
22545 return *this;
22546 }
22547#ifdef NPU_DISASSEMBLE
22548 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
22549 {
22550 std::stringstream saddr;
22551 saddr << std::hex << "0x" << get_addr();
22552 fields.push_back(std::make_pair<std::string, std::string>("addr", saddr.str()));
22553 }
22554#endif
22555#endif
22556 };
22557 // IFM2 Tile 2 address
22558 struct npu_set_ifm2_base2_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020022559 {
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020022560#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020022561 private:
22562#endif
22563 uint32_t opcode : 10; // opcode
22564 uint32_t reserved0 : 4;
22565 uint32_t control : 2; // control
22566 uint32_t reserved1 : 16;
22567 uint32_t addr : 32; // address offset
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020022568#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020022569 public:
22570 npu_set_ifm2_base2_t(uint32_t _addr) :
22571 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM2_BASE2)), reserved0(0),
22572 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL)), reserved1(0),
22573 addr(static_cast<uint32_t>(_addr))
22574 {
22575 }
22576 CONSTEXPR npu_set_ifm2_base2_t() :
22577 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM2_BASE2)), reserved0(0),
22578 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL)), reserved1(0), addr(0)
22579 {
22580 }
22581 CONSTEXPR bool valid() const
22582 {
22583 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM2_BASE2) && control >= 1 &&
22584 control <= 2;
22585 }
22586 CONSTEXPR void init()
22587 {
22588 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM2_BASE2);
22589 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL);
22590 }
22591 operator uint64_t()
22592 {
22593 uint64_t word;
22594 std::memcpy(&word, this, sizeof(word));
22595 return word;
22596 }
22597 CONSTEXPR NPU_NAMESPACE::cmd1_opcode get_opcode() const
22598 {
22599 return static_cast<NPU_NAMESPACE::cmd1_opcode>(opcode);
22600 }
22601 CONSTEXPR npu_set_ifm2_base2_t &set_opcode(NPU_NAMESPACE::cmd1_opcode value)
22602 {
22603 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
22604 return *this;
22605 }
22606 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
22607 {
22608 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
22609 }
22610 CONSTEXPR npu_set_ifm2_base2_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
22611 {
22612 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
22613 return *this;
22614 }
22615 CONSTEXPR uint32_t get_addr() const
22616 {
22617 return static_cast<uint32_t>(addr);
22618 }
22619 CONSTEXPR npu_set_ifm2_base2_t &set_addr(uint32_t value)
22620 {
22621 addr = static_cast<uint32_t>(value);
22622 return *this;
22623 }
22624#ifdef NPU_DISASSEMBLE
22625 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
22626 {
22627 std::stringstream saddr;
22628 saddr << std::hex << "0x" << get_addr();
22629 fields.push_back(std::make_pair<std::string, std::string>("addr", saddr.str()));
22630 }
22631#endif
22632#endif
22633 };
22634 // IFM2 Tile 3 address
22635 struct npu_set_ifm2_base3_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020022636 {
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020022637#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020022638 private:
22639#endif
22640 uint32_t opcode : 10; // opcode
22641 uint32_t reserved0 : 4;
22642 uint32_t control : 2; // control
22643 uint32_t reserved1 : 16;
22644 uint32_t addr : 32; // address offset
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020022645#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020022646 public:
22647 npu_set_ifm2_base3_t(uint32_t _addr) :
22648 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM2_BASE3)), reserved0(0),
22649 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL)), reserved1(0),
22650 addr(static_cast<uint32_t>(_addr))
22651 {
22652 }
22653 CONSTEXPR npu_set_ifm2_base3_t() :
22654 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM2_BASE3)), reserved0(0),
22655 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL)), reserved1(0), addr(0)
22656 {
22657 }
22658 CONSTEXPR bool valid() const
22659 {
22660 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM2_BASE3) && control >= 1 &&
22661 control <= 2;
22662 }
22663 CONSTEXPR void init()
22664 {
22665 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM2_BASE3);
22666 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL);
22667 }
22668 operator uint64_t()
22669 {
22670 uint64_t word;
22671 std::memcpy(&word, this, sizeof(word));
22672 return word;
22673 }
22674 CONSTEXPR NPU_NAMESPACE::cmd1_opcode get_opcode() const
22675 {
22676 return static_cast<NPU_NAMESPACE::cmd1_opcode>(opcode);
22677 }
22678 CONSTEXPR npu_set_ifm2_base3_t &set_opcode(NPU_NAMESPACE::cmd1_opcode value)
22679 {
22680 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
22681 return *this;
22682 }
22683 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
22684 {
22685 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
22686 }
22687 CONSTEXPR npu_set_ifm2_base3_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
22688 {
22689 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
22690 return *this;
22691 }
22692 CONSTEXPR uint32_t get_addr() const
22693 {
22694 return static_cast<uint32_t>(addr);
22695 }
22696 CONSTEXPR npu_set_ifm2_base3_t &set_addr(uint32_t value)
22697 {
22698 addr = static_cast<uint32_t>(value);
22699 return *this;
22700 }
22701#ifdef NPU_DISASSEMBLE
22702 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
22703 {
22704 std::stringstream saddr;
22705 saddr << std::hex << "0x" << get_addr();
22706 fields.push_back(std::make_pair<std::string, std::string>("addr", saddr.str()));
22707 }
22708#endif
22709#endif
22710 };
22711 // IFM2 byte stride between horizontal values
22712 struct npu_set_ifm2_stride_x_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020022713 {
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020022714#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020022715 private:
22716#endif
22717 uint32_t opcode : 10; // opcode
22718 uint32_t reserved0 : 4;
22719 uint32_t control : 2; // control
22720 uint32_t reserved1 : 16;
22721 uint32_t addr : 32; // address offset
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020022722#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020022723 public:
22724 npu_set_ifm2_stride_x_t(uint32_t _addr) :
22725 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM2_STRIDE_X)), reserved0(0),
22726 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL)), reserved1(0),
22727 addr(static_cast<uint32_t>(_addr))
22728 {
22729 }
22730 CONSTEXPR npu_set_ifm2_stride_x_t() :
22731 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM2_STRIDE_X)), reserved0(0),
22732 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL)), reserved1(0), addr(0)
22733 {
22734 }
22735 CONSTEXPR bool valid() const
22736 {
22737 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM2_STRIDE_X) && control >= 1 &&
22738 control <= 2;
22739 }
22740 CONSTEXPR void init()
22741 {
22742 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM2_STRIDE_X);
22743 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL);
22744 }
22745 operator uint64_t()
22746 {
22747 uint64_t word;
22748 std::memcpy(&word, this, sizeof(word));
22749 return word;
22750 }
22751 CONSTEXPR NPU_NAMESPACE::cmd1_opcode get_opcode() const
22752 {
22753 return static_cast<NPU_NAMESPACE::cmd1_opcode>(opcode);
22754 }
22755 CONSTEXPR npu_set_ifm2_stride_x_t &set_opcode(NPU_NAMESPACE::cmd1_opcode value)
22756 {
22757 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
22758 return *this;
22759 }
22760 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
22761 {
22762 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
22763 }
22764 CONSTEXPR npu_set_ifm2_stride_x_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
22765 {
22766 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
22767 return *this;
22768 }
22769 CONSTEXPR uint32_t get_addr() const
22770 {
22771 return static_cast<uint32_t>(addr);
22772 }
22773 CONSTEXPR npu_set_ifm2_stride_x_t &set_addr(uint32_t value)
22774 {
22775 addr = static_cast<uint32_t>(value);
22776 return *this;
22777 }
22778#ifdef NPU_DISASSEMBLE
22779 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
22780 {
22781 std::stringstream saddr;
22782 saddr << std::hex << "0x" << get_addr();
22783 fields.push_back(std::make_pair<std::string, std::string>("addr", saddr.str()));
22784 }
22785#endif
22786#endif
22787 };
22788 // IFM2 byte stride between vertical values
22789 struct npu_set_ifm2_stride_y_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020022790 {
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020022791#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020022792 private:
22793#endif
22794 uint32_t opcode : 10; // opcode
22795 uint32_t reserved0 : 4;
22796 uint32_t control : 2; // control
22797 uint32_t reserved1 : 16;
22798 uint32_t addr : 32; // address offset
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020022799#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020022800 public:
22801 npu_set_ifm2_stride_y_t(uint32_t _addr) :
22802 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM2_STRIDE_Y)), reserved0(0),
22803 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL)), reserved1(0),
22804 addr(static_cast<uint32_t>(_addr))
22805 {
22806 }
22807 CONSTEXPR npu_set_ifm2_stride_y_t() :
22808 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM2_STRIDE_Y)), reserved0(0),
22809 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL)), reserved1(0), addr(0)
22810 {
22811 }
22812 CONSTEXPR bool valid() const
22813 {
22814 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM2_STRIDE_Y) && control >= 1 &&
22815 control <= 2;
22816 }
22817 CONSTEXPR void init()
22818 {
22819 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM2_STRIDE_Y);
22820 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL);
22821 }
22822 operator uint64_t()
22823 {
22824 uint64_t word;
22825 std::memcpy(&word, this, sizeof(word));
22826 return word;
22827 }
22828 CONSTEXPR NPU_NAMESPACE::cmd1_opcode get_opcode() const
22829 {
22830 return static_cast<NPU_NAMESPACE::cmd1_opcode>(opcode);
22831 }
22832 CONSTEXPR npu_set_ifm2_stride_y_t &set_opcode(NPU_NAMESPACE::cmd1_opcode value)
22833 {
22834 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
22835 return *this;
22836 }
22837 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
22838 {
22839 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
22840 }
22841 CONSTEXPR npu_set_ifm2_stride_y_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
22842 {
22843 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
22844 return *this;
22845 }
22846 CONSTEXPR uint32_t get_addr() const
22847 {
22848 return static_cast<uint32_t>(addr);
22849 }
22850 CONSTEXPR npu_set_ifm2_stride_y_t &set_addr(uint32_t value)
22851 {
22852 addr = static_cast<uint32_t>(value);
22853 return *this;
22854 }
22855#ifdef NPU_DISASSEMBLE
22856 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
22857 {
22858 std::stringstream saddr;
22859 saddr << std::hex << "0x" << get_addr();
22860 fields.push_back(std::make_pair<std::string, std::string>("addr", saddr.str()));
22861 }
22862#endif
22863#endif
22864 };
22865 // IFM2 byte stride between channel blocks (of 16 bytes each block)
22866 struct npu_set_ifm2_stride_c_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020022867 {
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020022868#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020022869 private:
22870#endif
22871 uint32_t opcode : 10; // opcode
22872 uint32_t reserved0 : 4;
22873 uint32_t control : 2; // control
22874 uint32_t reserved1 : 16;
22875 uint32_t addr : 32; // address offset
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020022876#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020022877 public:
22878 npu_set_ifm2_stride_c_t(uint32_t _addr) :
22879 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM2_STRIDE_C)), reserved0(0),
22880 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL)), reserved1(0),
22881 addr(static_cast<uint32_t>(_addr))
22882 {
22883 }
22884 CONSTEXPR npu_set_ifm2_stride_c_t() :
22885 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM2_STRIDE_C)), reserved0(0),
22886 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL)), reserved1(0), addr(0)
22887 {
22888 }
22889 CONSTEXPR bool valid() const
22890 {
22891 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM2_STRIDE_C) && control >= 1 &&
22892 control <= 2;
22893 }
22894 CONSTEXPR void init()
22895 {
22896 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM2_STRIDE_C);
22897 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL);
22898 }
22899 operator uint64_t()
22900 {
22901 uint64_t word;
22902 std::memcpy(&word, this, sizeof(word));
22903 return word;
22904 }
22905 CONSTEXPR NPU_NAMESPACE::cmd1_opcode get_opcode() const
22906 {
22907 return static_cast<NPU_NAMESPACE::cmd1_opcode>(opcode);
22908 }
22909 CONSTEXPR npu_set_ifm2_stride_c_t &set_opcode(NPU_NAMESPACE::cmd1_opcode value)
22910 {
22911 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
22912 return *this;
22913 }
22914 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
22915 {
22916 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
22917 }
22918 CONSTEXPR npu_set_ifm2_stride_c_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
22919 {
22920 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
22921 return *this;
22922 }
22923 CONSTEXPR uint32_t get_addr() const
22924 {
22925 return static_cast<uint32_t>(addr);
22926 }
22927 CONSTEXPR npu_set_ifm2_stride_c_t &set_addr(uint32_t value)
22928 {
22929 addr = static_cast<uint32_t>(value);
22930 return *this;
22931 }
22932#ifdef NPU_DISASSEMBLE
22933 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
22934 {
22935 std::stringstream saddr;
22936 saddr << std::hex << "0x" << get_addr();
22937 fields.push_back(std::make_pair<std::string, std::string>("addr", saddr.str()));
22938 }
22939#endif
22940#endif
22941 };
22942 // User defined register 0
22943 struct npu_set_user_defined0_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020022944 {
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020022945#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020022946 private:
22947#endif
22948 uint32_t opcode : 10; // opcode
22949 uint32_t reserved0 : 4;
22950 uint32_t control : 2; // control
22951 uint32_t reserved1 : 16;
22952 uint32_t user_reg : 32; // User defined register
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020022953#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020022954 public:
22955 npu_set_user_defined0_t(uint32_t _user_reg) :
22956 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_USER_DEFINED0)), reserved0(0),
22957 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL)), reserved1(0),
22958 user_reg(static_cast<uint32_t>(_user_reg))
22959 {
22960 }
22961 CONSTEXPR npu_set_user_defined0_t() :
22962 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_USER_DEFINED0)), reserved0(0),
22963 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL)), reserved1(0), user_reg(0)
22964 {
22965 }
22966 CONSTEXPR bool valid() const
22967 {
22968 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_USER_DEFINED0) && control >= 1 &&
22969 control <= 2;
22970 }
22971 CONSTEXPR void init()
22972 {
22973 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_USER_DEFINED0);
22974 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL);
22975 }
22976 operator uint64_t()
22977 {
22978 uint64_t word;
22979 std::memcpy(&word, this, sizeof(word));
22980 return word;
22981 }
22982 CONSTEXPR NPU_NAMESPACE::cmd1_opcode get_opcode() const
22983 {
22984 return static_cast<NPU_NAMESPACE::cmd1_opcode>(opcode);
22985 }
22986 CONSTEXPR npu_set_user_defined0_t &set_opcode(NPU_NAMESPACE::cmd1_opcode value)
22987 {
22988 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
22989 return *this;
22990 }
22991 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
22992 {
22993 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
22994 }
22995 CONSTEXPR npu_set_user_defined0_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
22996 {
22997 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
22998 return *this;
22999 }
23000 CONSTEXPR uint32_t get_user_reg() const
23001 {
23002 return static_cast<uint32_t>(user_reg);
23003 }
23004 CONSTEXPR npu_set_user_defined0_t &set_user_reg(uint32_t value)
23005 {
23006 user_reg = static_cast<uint32_t>(value);
23007 return *this;
23008 }
23009#ifdef NPU_DISASSEMBLE
23010 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
23011 {
23012 fields.push_back(std::make_pair<std::string, std::string>("user_reg", std::to_string(user_reg)));
23013 }
23014#endif
23015#endif
23016 };
23017 // User defined register 1
23018 struct npu_set_user_defined1_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020023019 {
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020023020#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020023021 private:
23022#endif
23023 uint32_t opcode : 10; // opcode
23024 uint32_t reserved0 : 4;
23025 uint32_t control : 2; // control
23026 uint32_t reserved1 : 16;
23027 uint32_t user_reg : 32; // User defined register
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020023028#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020023029 public:
23030 npu_set_user_defined1_t(uint32_t _user_reg) :
23031 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_USER_DEFINED1)), reserved0(0),
23032 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL)), reserved1(0),
23033 user_reg(static_cast<uint32_t>(_user_reg))
23034 {
23035 }
23036 CONSTEXPR npu_set_user_defined1_t() :
23037 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_USER_DEFINED1)), reserved0(0),
23038 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL)), reserved1(0), user_reg(0)
23039 {
23040 }
23041 CONSTEXPR bool valid() const
23042 {
23043 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_USER_DEFINED1) && control >= 1 &&
23044 control <= 2;
23045 }
23046 CONSTEXPR void init()
23047 {
23048 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_USER_DEFINED1);
23049 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL);
23050 }
23051 operator uint64_t()
23052 {
23053 uint64_t word;
23054 std::memcpy(&word, this, sizeof(word));
23055 return word;
23056 }
23057 CONSTEXPR NPU_NAMESPACE::cmd1_opcode get_opcode() const
23058 {
23059 return static_cast<NPU_NAMESPACE::cmd1_opcode>(opcode);
23060 }
23061 CONSTEXPR npu_set_user_defined1_t &set_opcode(NPU_NAMESPACE::cmd1_opcode value)
23062 {
23063 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
23064 return *this;
23065 }
23066 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
23067 {
23068 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
23069 }
23070 CONSTEXPR npu_set_user_defined1_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
23071 {
23072 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
23073 return *this;
23074 }
23075 CONSTEXPR uint32_t get_user_reg() const
23076 {
23077 return static_cast<uint32_t>(user_reg);
23078 }
23079 CONSTEXPR npu_set_user_defined1_t &set_user_reg(uint32_t value)
23080 {
23081 user_reg = static_cast<uint32_t>(value);
23082 return *this;
23083 }
23084#ifdef NPU_DISASSEMBLE
23085 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
23086 {
23087 fields.push_back(std::make_pair<std::string, std::string>("user_reg", std::to_string(user_reg)));
23088 }
23089#endif
23090#endif
23091 };
23092 // User defined register 2
23093 struct npu_set_user_defined2_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020023094 {
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020023095#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020023096 private:
23097#endif
23098 uint32_t opcode : 10; // opcode
23099 uint32_t reserved0 : 4;
23100 uint32_t control : 2; // control
23101 uint32_t reserved1 : 16;
23102 uint32_t user_reg : 32; // User defined register
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020023103#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020023104 public:
23105 npu_set_user_defined2_t(uint32_t _user_reg) :
23106 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_USER_DEFINED2)), reserved0(0),
23107 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL)), reserved1(0),
23108 user_reg(static_cast<uint32_t>(_user_reg))
23109 {
23110 }
23111 CONSTEXPR npu_set_user_defined2_t() :
23112 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_USER_DEFINED2)), reserved0(0),
23113 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL)), reserved1(0), user_reg(0)
23114 {
23115 }
23116 CONSTEXPR bool valid() const
23117 {
23118 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_USER_DEFINED2) && control >= 1 &&
23119 control <= 2;
23120 }
23121 CONSTEXPR void init()
23122 {
23123 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_USER_DEFINED2);
23124 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL);
23125 }
23126 operator uint64_t()
23127 {
23128 uint64_t word;
23129 std::memcpy(&word, this, sizeof(word));
23130 return word;
23131 }
23132 CONSTEXPR NPU_NAMESPACE::cmd1_opcode get_opcode() const
23133 {
23134 return static_cast<NPU_NAMESPACE::cmd1_opcode>(opcode);
23135 }
23136 CONSTEXPR npu_set_user_defined2_t &set_opcode(NPU_NAMESPACE::cmd1_opcode value)
23137 {
23138 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
23139 return *this;
23140 }
23141 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
23142 {
23143 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
23144 }
23145 CONSTEXPR npu_set_user_defined2_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
23146 {
23147 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
23148 return *this;
23149 }
23150 CONSTEXPR uint32_t get_user_reg() const
23151 {
23152 return static_cast<uint32_t>(user_reg);
23153 }
23154 CONSTEXPR npu_set_user_defined2_t &set_user_reg(uint32_t value)
23155 {
23156 user_reg = static_cast<uint32_t>(value);
23157 return *this;
23158 }
23159#ifdef NPU_DISASSEMBLE
23160 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
23161 {
23162 fields.push_back(std::make_pair<std::string, std::string>("user_reg", std::to_string(user_reg)));
23163 }
23164#endif
23165#endif
23166 };
23167 // User defined register 3
23168 struct npu_set_user_defined3_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020023169 {
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020023170#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020023171 private:
23172#endif
23173 uint32_t opcode : 10; // opcode
23174 uint32_t reserved0 : 4;
23175 uint32_t control : 2; // control
23176 uint32_t reserved1 : 16;
23177 uint32_t user_reg : 32; // User defined register
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020023178#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020023179 public:
23180 npu_set_user_defined3_t(uint32_t _user_reg) :
23181 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_USER_DEFINED3)), reserved0(0),
23182 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL)), reserved1(0),
23183 user_reg(static_cast<uint32_t>(_user_reg))
23184 {
23185 }
23186 CONSTEXPR npu_set_user_defined3_t() :
23187 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_USER_DEFINED3)), reserved0(0),
23188 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL)), reserved1(0), user_reg(0)
23189 {
23190 }
23191 CONSTEXPR bool valid() const
23192 {
23193 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_USER_DEFINED3) && control >= 1 &&
23194 control <= 2;
23195 }
23196 CONSTEXPR void init()
23197 {
23198 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_USER_DEFINED3);
23199 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL);
23200 }
23201 operator uint64_t()
23202 {
23203 uint64_t word;
23204 std::memcpy(&word, this, sizeof(word));
23205 return word;
23206 }
23207 CONSTEXPR NPU_NAMESPACE::cmd1_opcode get_opcode() const
23208 {
23209 return static_cast<NPU_NAMESPACE::cmd1_opcode>(opcode);
23210 }
23211 CONSTEXPR npu_set_user_defined3_t &set_opcode(NPU_NAMESPACE::cmd1_opcode value)
23212 {
23213 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
23214 return *this;
23215 }
23216 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
23217 {
23218 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
23219 }
23220 CONSTEXPR npu_set_user_defined3_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
23221 {
23222 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
23223 return *this;
23224 }
23225 CONSTEXPR uint32_t get_user_reg() const
23226 {
23227 return static_cast<uint32_t>(user_reg);
23228 }
23229 CONSTEXPR npu_set_user_defined3_t &set_user_reg(uint32_t value)
23230 {
23231 user_reg = static_cast<uint32_t>(value);
23232 return *this;
23233 }
23234#ifdef NPU_DISASSEMBLE
23235 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
23236 {
23237 fields.push_back(std::make_pair<std::string, std::string>("user_reg", std::to_string(user_reg)));
23238 }
23239#endif
23240#endif
23241 };
23242 // User defined register 4
23243 struct npu_set_user_defined4_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020023244 {
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020023245#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020023246 private:
23247#endif
23248 uint32_t opcode : 10; // opcode
23249 uint32_t reserved0 : 4;
23250 uint32_t control : 2; // control
23251 uint32_t reserved1 : 16;
23252 uint32_t user_reg : 32; // User defined register
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020023253#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020023254 public:
23255 npu_set_user_defined4_t(uint32_t _user_reg) :
23256 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_USER_DEFINED4)), reserved0(0),
23257 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL)), reserved1(0),
23258 user_reg(static_cast<uint32_t>(_user_reg))
23259 {
23260 }
23261 CONSTEXPR npu_set_user_defined4_t() :
23262 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_USER_DEFINED4)), reserved0(0),
23263 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL)), reserved1(0), user_reg(0)
23264 {
23265 }
23266 CONSTEXPR bool valid() const
23267 {
23268 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_USER_DEFINED4) && control >= 1 &&
23269 control <= 2;
23270 }
23271 CONSTEXPR void init()
23272 {
23273 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_USER_DEFINED4);
23274 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL);
23275 }
23276 operator uint64_t()
23277 {
23278 uint64_t word;
23279 std::memcpy(&word, this, sizeof(word));
23280 return word;
23281 }
23282 CONSTEXPR NPU_NAMESPACE::cmd1_opcode get_opcode() const
23283 {
23284 return static_cast<NPU_NAMESPACE::cmd1_opcode>(opcode);
23285 }
23286 CONSTEXPR npu_set_user_defined4_t &set_opcode(NPU_NAMESPACE::cmd1_opcode value)
23287 {
23288 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
23289 return *this;
23290 }
23291 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
23292 {
23293 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
23294 }
23295 CONSTEXPR npu_set_user_defined4_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
23296 {
23297 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
23298 return *this;
23299 }
23300 CONSTEXPR uint32_t get_user_reg() const
23301 {
23302 return static_cast<uint32_t>(user_reg);
23303 }
23304 CONSTEXPR npu_set_user_defined4_t &set_user_reg(uint32_t value)
23305 {
23306 user_reg = static_cast<uint32_t>(value);
23307 return *this;
23308 }
23309#ifdef NPU_DISASSEMBLE
23310 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
23311 {
23312 fields.push_back(std::make_pair<std::string, std::string>("user_reg", std::to_string(user_reg)));
23313 }
23314#endif
23315#endif
23316 };
23317 // User defined register 5
23318 struct npu_set_user_defined5_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020023319 {
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020023320#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020023321 private:
23322#endif
23323 uint32_t opcode : 10; // opcode
23324 uint32_t reserved0 : 4;
23325 uint32_t control : 2; // control
23326 uint32_t reserved1 : 16;
23327 uint32_t user_reg : 32; // User defined register
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020023328#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020023329 public:
23330 npu_set_user_defined5_t(uint32_t _user_reg) :
23331 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_USER_DEFINED5)), reserved0(0),
23332 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL)), reserved1(0),
23333 user_reg(static_cast<uint32_t>(_user_reg))
23334 {
23335 }
23336 CONSTEXPR npu_set_user_defined5_t() :
23337 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_USER_DEFINED5)), reserved0(0),
23338 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL)), reserved1(0), user_reg(0)
23339 {
23340 }
23341 CONSTEXPR bool valid() const
23342 {
23343 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_USER_DEFINED5) && control >= 1 &&
23344 control <= 2;
23345 }
23346 CONSTEXPR void init()
23347 {
23348 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_USER_DEFINED5);
23349 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL);
23350 }
23351 operator uint64_t()
23352 {
23353 uint64_t word;
23354 std::memcpy(&word, this, sizeof(word));
23355 return word;
23356 }
23357 CONSTEXPR NPU_NAMESPACE::cmd1_opcode get_opcode() const
23358 {
23359 return static_cast<NPU_NAMESPACE::cmd1_opcode>(opcode);
23360 }
23361 CONSTEXPR npu_set_user_defined5_t &set_opcode(NPU_NAMESPACE::cmd1_opcode value)
23362 {
23363 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
23364 return *this;
23365 }
23366 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
23367 {
23368 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
23369 }
23370 CONSTEXPR npu_set_user_defined5_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
23371 {
23372 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
23373 return *this;
23374 }
23375 CONSTEXPR uint32_t get_user_reg() const
23376 {
23377 return static_cast<uint32_t>(user_reg);
23378 }
23379 CONSTEXPR npu_set_user_defined5_t &set_user_reg(uint32_t value)
23380 {
23381 user_reg = static_cast<uint32_t>(value);
23382 return *this;
23383 }
23384#ifdef NPU_DISASSEMBLE
23385 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
23386 {
23387 fields.push_back(std::make_pair<std::string, std::string>("user_reg", std::to_string(user_reg)));
23388 }
23389#endif
23390#endif
23391 };
23392 // User defined register 6
23393 struct npu_set_user_defined6_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020023394 {
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020023395#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020023396 private:
23397#endif
23398 uint32_t opcode : 10; // opcode
23399 uint32_t reserved0 : 4;
23400 uint32_t control : 2; // control
23401 uint32_t reserved1 : 16;
23402 uint32_t user_reg : 32; // User defined register
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020023403#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020023404 public:
23405 npu_set_user_defined6_t(uint32_t _user_reg) :
23406 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_USER_DEFINED6)), reserved0(0),
23407 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL)), reserved1(0),
23408 user_reg(static_cast<uint32_t>(_user_reg))
23409 {
23410 }
23411 CONSTEXPR npu_set_user_defined6_t() :
23412 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_USER_DEFINED6)), reserved0(0),
23413 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL)), reserved1(0), user_reg(0)
23414 {
23415 }
23416 CONSTEXPR bool valid() const
23417 {
23418 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_USER_DEFINED6) && control >= 1 &&
23419 control <= 2;
23420 }
23421 CONSTEXPR void init()
23422 {
23423 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_USER_DEFINED6);
23424 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL);
23425 }
23426 operator uint64_t()
23427 {
23428 uint64_t word;
23429 std::memcpy(&word, this, sizeof(word));
23430 return word;
23431 }
23432 CONSTEXPR NPU_NAMESPACE::cmd1_opcode get_opcode() const
23433 {
23434 return static_cast<NPU_NAMESPACE::cmd1_opcode>(opcode);
23435 }
23436 CONSTEXPR npu_set_user_defined6_t &set_opcode(NPU_NAMESPACE::cmd1_opcode value)
23437 {
23438 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
23439 return *this;
23440 }
23441 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
23442 {
23443 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
23444 }
23445 CONSTEXPR npu_set_user_defined6_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
23446 {
23447 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
23448 return *this;
23449 }
23450 CONSTEXPR uint32_t get_user_reg() const
23451 {
23452 return static_cast<uint32_t>(user_reg);
23453 }
23454 CONSTEXPR npu_set_user_defined6_t &set_user_reg(uint32_t value)
23455 {
23456 user_reg = static_cast<uint32_t>(value);
23457 return *this;
23458 }
23459#ifdef NPU_DISASSEMBLE
23460 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
23461 {
23462 fields.push_back(std::make_pair<std::string, std::string>("user_reg", std::to_string(user_reg)));
23463 }
23464#endif
23465#endif
23466 };
23467 // User defined register 7
23468 struct npu_set_user_defined7_t
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020023469 {
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020023470#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020023471 private:
23472#endif
23473 uint32_t opcode : 10; // opcode
23474 uint32_t reserved0 : 4;
23475 uint32_t control : 2; // control
23476 uint32_t reserved1 : 16;
23477 uint32_t user_reg : 32; // User defined register
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020023478#ifdef __cplusplus
Jonny Svärd136810f2021-10-13 16:04:26 +020023479 public:
23480 npu_set_user_defined7_t(uint32_t _user_reg) :
23481 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_USER_DEFINED7)), reserved0(0),
23482 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL)), reserved1(0),
23483 user_reg(static_cast<uint32_t>(_user_reg))
23484 {
23485 }
23486 CONSTEXPR npu_set_user_defined7_t() :
23487 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_USER_DEFINED7)), reserved0(0),
23488 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL)), reserved1(0), user_reg(0)
23489 {
23490 }
23491 CONSTEXPR bool valid() const
23492 {
23493 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_USER_DEFINED7) && control >= 1 &&
23494 control <= 2;
23495 }
23496 CONSTEXPR void init()
23497 {
23498 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_USER_DEFINED7);
23499 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL);
23500 }
23501 operator uint64_t()
23502 {
23503 uint64_t word;
23504 std::memcpy(&word, this, sizeof(word));
23505 return word;
23506 }
23507 CONSTEXPR NPU_NAMESPACE::cmd1_opcode get_opcode() const
23508 {
23509 return static_cast<NPU_NAMESPACE::cmd1_opcode>(opcode);
23510 }
23511 CONSTEXPR npu_set_user_defined7_t &set_opcode(NPU_NAMESPACE::cmd1_opcode value)
23512 {
23513 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1);
23514 return *this;
23515 }
23516 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const
23517 {
23518 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control);
23519 }
23520 CONSTEXPR npu_set_user_defined7_t &set_control(NPU_NAMESPACE::cmd_ctrl value)
23521 {
23522 control = static_cast<uint8_t>(value) & ((1U << 2) - 1);
23523 return *this;
23524 }
23525 CONSTEXPR uint32_t get_user_reg() const
23526 {
23527 return static_cast<uint32_t>(user_reg);
23528 }
23529 CONSTEXPR npu_set_user_defined7_t &set_user_reg(uint32_t value)
23530 {
23531 user_reg = static_cast<uint32_t>(value);
23532 return *this;
23533 }
23534#ifdef NPU_DISASSEMBLE
23535 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const
23536 {
23537 fields.push_back(std::make_pair<std::string, std::string>("user_reg", std::to_string(user_reg)));
23538 }
23539#endif
23540#endif
23541 };
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020023542#ifdef __cplusplus
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020023543};
Jonny Svärd136810f2021-10-13 16:04:26 +020023544#endif
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020023545#define NPU_OP_STRUCTS \
23546 NPU_OP_(stop) \
23547 NPU_OP_(irq) \
23548 NPU_OP_(conv) \
23549 NPU_OP_(depthwise) \
23550 NPU_OP_(pool) \
23551 NPU_OP_(elementwise) \
23552 NPU_OP_(dma_start) \
23553 NPU_OP_(dma_wait) \
23554 NPU_OP_(kernel_wait) \
23555 NPU_OP_(pmu_mask)
Jonny Svärd136810f2021-10-13 16:04:26 +020023556
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020023557#define NPU_SET_STRUCTS \
23558 NPU_SET_(ifm_pad_top) \
23559 NPU_SET_(ifm_pad_left) \
23560 NPU_SET_(ifm_pad_right) \
23561 NPU_SET_(ifm_pad_bottom) \
23562 NPU_SET_(ifm_depth_m1) \
23563 NPU_SET_(ifm_precision) \
23564 NPU_SET_(ifm_upscale) \
23565 NPU_SET_(ifm_zero_point) \
23566 NPU_SET_(ifm_width0_m1) \
23567 NPU_SET_(ifm_height0_m1) \
23568 NPU_SET_(ifm_height1_m1) \
23569 NPU_SET_(ifm_ib_end) \
23570 NPU_SET_(ifm_region) \
23571 NPU_SET_(ofm_width_m1) \
23572 NPU_SET_(ofm_height_m1) \
23573 NPU_SET_(ofm_depth_m1) \
23574 NPU_SET_(ofm_precision) \
23575 NPU_SET_(ofm_blk_width_m1) \
23576 NPU_SET_(ofm_blk_height_m1) \
23577 NPU_SET_(ofm_blk_depth_m1) \
23578 NPU_SET_(ofm_zero_point) \
23579 NPU_SET_(ofm_width0_m1) \
23580 NPU_SET_(ofm_height0_m1) \
23581 NPU_SET_(ofm_height1_m1) \
23582 NPU_SET_(ofm_region) \
23583 NPU_SET_(kernel_width_m1) \
23584 NPU_SET_(kernel_height_m1) \
23585 NPU_SET_(kernel_stride) \
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020023586 NPU_SET_(acc_format) \
23587 NPU_SET_(activation) \
23588 NPU_SET_(activation_min) \
23589 NPU_SET_(activation_max) \
23590 NPU_SET_(weight_region) \
23591 NPU_SET_(scale_region) \
23592 NPU_SET_(ab_start) \
23593 NPU_SET_(blockdep) \
23594 NPU_SET_(dma0_src_region) \
23595 NPU_SET_(dma0_dst_region) \
23596 NPU_SET_(dma0_size0) \
23597 NPU_SET_(dma0_size1) \
23598 NPU_SET_(ifm2_broadcast) \
23599 NPU_SET_(ifm2_scalar) \
23600 NPU_SET_(ifm2_precision) \
23601 NPU_SET_(ifm2_zero_point) \
23602 NPU_SET_(ifm2_width0_m1) \
23603 NPU_SET_(ifm2_height0_m1) \
23604 NPU_SET_(ifm2_height1_m1) \
23605 NPU_SET_(ifm2_ib_start) \
23606 NPU_SET_(ifm2_region) \
23607 NPU_SET_(ifm_base0) \
23608 NPU_SET_(ifm_base1) \
23609 NPU_SET_(ifm_base2) \
23610 NPU_SET_(ifm_base3) \
23611 NPU_SET_(ifm_stride_x) \
23612 NPU_SET_(ifm_stride_y) \
23613 NPU_SET_(ifm_stride_c) \
23614 NPU_SET_(ofm_base0) \
23615 NPU_SET_(ofm_base1) \
23616 NPU_SET_(ofm_base2) \
23617 NPU_SET_(ofm_base3) \
23618 NPU_SET_(ofm_stride_x) \
23619 NPU_SET_(ofm_stride_y) \
23620 NPU_SET_(ofm_stride_c) \
23621 NPU_SET_(weight_base) \
23622 NPU_SET_(weight_length) \
23623 NPU_SET_(scale_base) \
23624 NPU_SET_(scale_length) \
23625 NPU_SET_(ofm_scale) \
23626 NPU_SET_(opa_scale) \
23627 NPU_SET_(opb_scale) \
23628 NPU_SET_(dma0_src) \
23629 NPU_SET_(dma0_dst) \
23630 NPU_SET_(dma0_len) \
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020023631 NPU_SET_(ifm2_base0) \
23632 NPU_SET_(ifm2_base1) \
23633 NPU_SET_(ifm2_base2) \
23634 NPU_SET_(ifm2_base3) \
23635 NPU_SET_(ifm2_stride_x) \
23636 NPU_SET_(ifm2_stride_y) \
23637 NPU_SET_(ifm2_stride_c) \
Jonny Svärd136810f2021-10-13 16:04:26 +020023638 NPU_SET_(user_defined0) \
23639 NPU_SET_(user_defined1) \
23640 NPU_SET_(user_defined2) \
23641 NPU_SET_(user_defined3) \
23642 NPU_SET_(user_defined4) \
23643 NPU_SET_(user_defined5) \
23644 NPU_SET_(user_defined6) \
23645 NPU_SET_(user_defined7)
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020023646
Jonny Svärd136810f2021-10-13 16:04:26 +020023647#define EXPAND_ACC_FORMAT(FUNC, SEP) FUNC(acc_format, I32) SEP FUNC(acc_format, I40) SEP FUNC(acc_format, F16)
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020023648
Jonny Svärd136810f2021-10-13 16:04:26 +020023649#define EXPAND_ACTIVATION_CLIP_RANGE(FUNC, SEP) \
23650 FUNC(activation_clip_range, OFM_PRECISION) \
23651 SEP FUNC(activation_clip_range, FORCE_UINT8) SEP FUNC(activation_clip_range, FORCE_INT8) \
23652 SEP FUNC(activation_clip_range, FORCE_INT16)
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020023653
Jonny Svärd136810f2021-10-13 16:04:26 +020023654#define EXPAND_ACTIVATION_FORMAT(FUNC, SEP) FUNC(activation_format, NHWC) SEP FUNC(activation_format, NHCWB16)
Stefan Nannessone2e70242020-08-19 16:01:29 +020023655
Jonny Svärd136810f2021-10-13 16:04:26 +020023656#define EXPAND_ACTIVATION_FUNCTION(FUNC, SEP) \
23657 FUNC(activation_function, RELU) \
23658 SEP FUNC(activation_function, TANH) SEP FUNC(activation_function, SIGMOID) SEP FUNC(activation_function, TABLE_0) \
23659 SEP FUNC(activation_function, TABLE_1) SEP FUNC(activation_function, TABLE_2) \
23660 SEP FUNC(activation_function, TABLE_3) SEP FUNC(activation_function, TABLE_4) \
23661 SEP FUNC(activation_function, TABLE_5) SEP FUNC(activation_function, TABLE_6) \
23662 SEP FUNC(activation_function, TABLE_7)
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020023663
Jonny Svärd136810f2021-10-13 16:04:26 +020023664#define EXPAND_ACTIVATION_PRECISION(FUNC, SEP) \
23665 FUNC(activation_precision, B8) \
23666 SEP FUNC(activation_precision, B16) SEP FUNC(activation_precision, B32) SEP FUNC(activation_precision, B64)
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020023667
Jonny Svärd136810f2021-10-13 16:04:26 +020023668#define EXPAND_ACTIVATION_TYPE(FUNC, SEP) FUNC(activation_type, UNSIGNED) SEP FUNC(activation_type, SIGNED)
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020023669
Jonny Svärd136810f2021-10-13 16:04:26 +020023670#define EXPAND_AXI_MEM_ENCODING(FUNC, SEP) \
23671 FUNC(axi_mem_encoding, DEVICE_NON_BUFFERABLE) \
23672 SEP FUNC(axi_mem_encoding, DEVICE_BUFFERABLE) SEP FUNC(axi_mem_encoding, NORMAL_NON_CACHEABLE_NON_BUFFERABLE) \
23673 SEP FUNC(axi_mem_encoding, NORMAL_NON_CACHEABLE_BUFFERABLE) \
23674 SEP FUNC(axi_mem_encoding, WRITE_THROUGH_NO_ALLOCATE) \
23675 SEP FUNC(axi_mem_encoding, WRITE_THROUGH_READ_ALLOCATE) \
23676 SEP FUNC(axi_mem_encoding, WRITE_THROUGH_WRITE_ALLOCATE) \
23677 SEP FUNC(axi_mem_encoding, WRITE_THROUGH_READ_AND_WRITE_ALLOCATE) \
23678 SEP FUNC(axi_mem_encoding, WRITE_BACK_NO_ALLOCATE) \
23679 SEP FUNC(axi_mem_encoding, WRITE_BACK_READ_ALLOCATE) \
23680 SEP FUNC(axi_mem_encoding, WRITE_BACK_WRITE_ALLOCATE) \
23681 SEP FUNC(axi_mem_encoding, WRITE_BACK_READ_AND_WRITE_ALLOCATE)
23682
23683#define EXPAND_BROADCAST_MODE(FUNC, SEP) FUNC(broadcast_mode, DISABLE) SEP FUNC(broadcast_mode, ENABLE)
23684
23685#define EXPAND_CMD0_OPCODE(FUNC, SEP) \
23686 FUNC(cmd0_opcode, NPU_OP_STOP) \
23687 SEP FUNC(cmd0_opcode, NPU_OP_IRQ) SEP FUNC(cmd0_opcode, NPU_OP_CONV) SEP FUNC( \
23688 cmd0_opcode, NPU_OP_DEPTHWISE) SEP FUNC(cmd0_opcode, NPU_OP_POOL) SEP FUNC(cmd0_opcode, NPU_OP_ELEMENTWISE) \
23689 SEP FUNC(cmd0_opcode, NPU_OP_DMA_START) SEP FUNC(cmd0_opcode, NPU_OP_DMA_WAIT) SEP FUNC( \
23690 cmd0_opcode, NPU_OP_KERNEL_WAIT) SEP FUNC(cmd0_opcode, NPU_OP_PMU_MASK) SEP FUNC(cmd0_opcode, \
23691 NPU_SET_IFM_PAD_TOP) \
23692 SEP FUNC(cmd0_opcode, NPU_SET_IFM_PAD_LEFT) SEP FUNC(cmd0_opcode, NPU_SET_IFM_PAD_RIGHT) SEP FUNC( \
23693 cmd0_opcode, NPU_SET_IFM_PAD_BOTTOM) SEP FUNC(cmd0_opcode, \
23694 NPU_SET_IFM_DEPTH_M1) SEP FUNC(cmd0_opcode, \
23695 NPU_SET_IFM_PRECISION) \
23696 SEP FUNC(cmd0_opcode, NPU_SET_IFM_UPSCALE) SEP FUNC(cmd0_opcode, NPU_SET_IFM_ZERO_POINT) SEP FUNC( \
23697 cmd0_opcode, NPU_SET_IFM_WIDTH0_M1) SEP FUNC(cmd0_opcode, NPU_SET_IFM_HEIGHT0_M1) \
23698 SEP FUNC(cmd0_opcode, NPU_SET_IFM_HEIGHT1_M1) SEP FUNC(cmd0_opcode, NPU_SET_IFM_IB_END) SEP FUNC( \
23699 cmd0_opcode, NPU_SET_IFM_REGION) SEP FUNC(cmd0_opcode, NPU_SET_OFM_WIDTH_M1) \
23700 SEP FUNC(cmd0_opcode, NPU_SET_OFM_HEIGHT_M1) SEP FUNC(cmd0_opcode, NPU_SET_OFM_DEPTH_M1) \
23701 SEP FUNC(cmd0_opcode, NPU_SET_OFM_PRECISION) SEP FUNC( \
23702 cmd0_opcode, NPU_SET_OFM_BLK_WIDTH_M1) SEP FUNC(cmd0_opcode, \
23703 NPU_SET_OFM_BLK_HEIGHT_M1) \
23704 SEP FUNC(cmd0_opcode, NPU_SET_OFM_BLK_DEPTH_M1) SEP FUNC( \
23705 cmd0_opcode, NPU_SET_OFM_ZERO_POINT) SEP FUNC(cmd0_opcode, NPU_SET_OFM_WIDTH0_M1) \
23706 SEP FUNC(cmd0_opcode, NPU_SET_OFM_HEIGHT0_M1) SEP FUNC( \
23707 cmd0_opcode, \
23708 NPU_SET_OFM_HEIGHT1_M1) SEP FUNC(cmd0_opcode, NPU_SET_OFM_REGION) \
23709 SEP FUNC(cmd0_opcode, NPU_SET_KERNEL_WIDTH_M1) SEP FUNC( \
23710 cmd0_opcode, \
23711 NPU_SET_KERNEL_HEIGHT_M1) SEP FUNC(cmd0_opcode, NPU_SET_KERNEL_STRIDE) \
23712 SEP FUNC(cmd0_opcode, NPU_SET_ACC_FORMAT) SEP FUNC( \
23713 cmd0_opcode, \
23714 NPU_SET_ACTIVATION) SEP FUNC(cmd0_opcode, NPU_SET_ACTIVATION_MIN) \
23715 SEP FUNC(cmd0_opcode, NPU_SET_ACTIVATION_MAX) SEP FUNC( \
23716 cmd0_opcode, \
23717 NPU_SET_WEIGHT_REGION) SEP FUNC(cmd0_opcode, NPU_SET_SCALE_REGION) \
23718 SEP FUNC(cmd0_opcode, \
23719 NPU_SET_AB_START) SEP FUNC(cmd0_opcode, NPU_SET_BLOCKDEP) \
23720 SEP FUNC(cmd0_opcode, NPU_SET_DMA0_SRC_REGION) SEP FUNC( \
23721 cmd0_opcode, \
23722 NPU_SET_DMA0_DST_REGION) SEP FUNC(cmd0_opcode, \
23723 NPU_SET_DMA0_SIZE0) \
23724 SEP FUNC(cmd0_opcode, NPU_SET_DMA0_SIZE1) SEP FUNC( \
23725 cmd0_opcode, \
23726 NPU_SET_IFM2_BROADCAST) \
23727 SEP FUNC(cmd0_opcode, NPU_SET_IFM2_SCALAR) SEP FUNC( \
23728 cmd0_opcode, \
23729 NPU_SET_IFM2_PRECISION) \
23730 SEP FUNC(cmd0_opcode, NPU_SET_IFM2_ZERO_POINT) \
23731 SEP FUNC(cmd0_opcode, NPU_SET_IFM2_WIDTH0_M1) \
23732 SEP FUNC(cmd0_opcode, \
23733 NPU_SET_IFM2_HEIGHT0_M1) \
23734 SEP FUNC(cmd0_opcode, \
23735 NPU_SET_IFM2_HEIGHT1_M1) \
23736 SEP FUNC(cmd0_opcode, \
23737 NPU_SET_IFM2_IB_START) \
23738 SEP FUNC(cmd0_opcode, \
23739 NPU_SET_IFM2_REGION)
23740
23741#define EXPAND_CMD1_OPCODE(FUNC, SEP) \
23742 FUNC(cmd1_opcode, NPU_SET_IFM_BASE0) \
23743 SEP FUNC(cmd1_opcode, NPU_SET_IFM_BASE1) SEP FUNC(cmd1_opcode, NPU_SET_IFM_BASE2) SEP FUNC( \
23744 cmd1_opcode, NPU_SET_IFM_BASE3) SEP FUNC(cmd1_opcode, NPU_SET_IFM_STRIDE_X) \
23745 SEP FUNC(cmd1_opcode, NPU_SET_IFM_STRIDE_Y) SEP FUNC(cmd1_opcode, NPU_SET_IFM_STRIDE_C) SEP FUNC( \
23746 cmd1_opcode, NPU_SET_OFM_BASE0) SEP FUNC(cmd1_opcode, NPU_SET_OFM_BASE1) \
23747 SEP FUNC(cmd1_opcode, NPU_SET_OFM_BASE2) SEP FUNC(cmd1_opcode, NPU_SET_OFM_BASE3) SEP FUNC( \
23748 cmd1_opcode, NPU_SET_OFM_STRIDE_X) SEP FUNC(cmd1_opcode, NPU_SET_OFM_STRIDE_Y) \
23749 SEP FUNC(cmd1_opcode, NPU_SET_OFM_STRIDE_C) SEP FUNC(cmd1_opcode, NPU_SET_WEIGHT_BASE) SEP FUNC( \
23750 cmd1_opcode, NPU_SET_WEIGHT_LENGTH) SEP FUNC(cmd1_opcode, NPU_SET_SCALE_BASE) \
23751 SEP FUNC(cmd1_opcode, NPU_SET_SCALE_LENGTH) SEP FUNC(cmd1_opcode, NPU_SET_OFM_SCALE) SEP FUNC( \
23752 cmd1_opcode, NPU_SET_OPA_SCALE) SEP FUNC(cmd1_opcode, NPU_SET_OPB_SCALE) \
23753 SEP FUNC(cmd1_opcode, NPU_SET_DMA0_SRC) SEP FUNC(cmd1_opcode, NPU_SET_DMA0_DST) SEP FUNC( \
23754 cmd1_opcode, NPU_SET_DMA0_LEN) SEP FUNC(cmd1_opcode, NPU_SET_IFM2_BASE0) \
23755 SEP FUNC(cmd1_opcode, NPU_SET_IFM2_BASE1) SEP FUNC(cmd1_opcode, NPU_SET_IFM2_BASE2) \
23756 SEP FUNC(cmd1_opcode, NPU_SET_IFM2_BASE3) SEP FUNC(cmd1_opcode, NPU_SET_IFM2_STRIDE_X) \
23757 SEP FUNC(cmd1_opcode, NPU_SET_IFM2_STRIDE_Y) \
23758 SEP FUNC(cmd1_opcode, NPU_SET_IFM2_STRIDE_C) \
23759 SEP FUNC(cmd1_opcode, NPU_SET_USER_DEFINED0) \
23760 SEP FUNC(cmd1_opcode, NPU_SET_USER_DEFINED1) \
23761 SEP FUNC(cmd1_opcode, NPU_SET_USER_DEFINED2) \
23762 SEP FUNC(cmd1_opcode, NPU_SET_USER_DEFINED3) \
23763 SEP FUNC(cmd1_opcode, NPU_SET_USER_DEFINED4) \
23764 SEP FUNC(cmd1_opcode, NPU_SET_USER_DEFINED5) \
23765 SEP FUNC(cmd1_opcode, NPU_SET_USER_DEFINED6) \
23766 SEP FUNC(cmd1_opcode, NPU_SET_USER_DEFINED7)
23767
23768#define EXPAND_CMD_CTRL(FUNC, SEP) FUNC(cmd_ctrl, CMD0_CTRL) SEP FUNC(cmd_ctrl, CMD1_CTRL)
23769
23770#define EXPAND_CUSTOM_DMA_CS(FUNC, SEP) FUNC(custom_dma_cs, DISABLE) SEP FUNC(custom_dma_cs, ENABLE)
23771
23772#define EXPAND_CUSTOM_DMA(FUNC, SEP) FUNC(custom_dma, NOT_IMPLEMENTED) SEP FUNC(custom_dma, IMPLEMENTED)
23773
23774#define EXPAND_DMA_FAULT_SRC(FUNC, SEP) FUNC(dma_fault_src, AXI_M0) SEP FUNC(dma_fault_src, AXI_M1)
23775
23776#define EXPAND_DMA_REGION_MODE(FUNC, SEP) FUNC(dma_region_mode, EXTERNAL) SEP FUNC(dma_region_mode, INTERNAL)
23777
23778#define EXPAND_DMA_STRIDE_MODE(FUNC, SEP) FUNC(dma_stride_mode, D1)
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020023779
23780#define EXPAND_ELEMENTWISE_MODE(FUNC, SEP) \
23781 FUNC(elementwise_mode, MUL) \
23782 SEP FUNC(elementwise_mode, ADD) SEP FUNC(elementwise_mode, SUB) SEP FUNC(elementwise_mode, MIN) \
23783 SEP FUNC(elementwise_mode, MAX) SEP FUNC(elementwise_mode, LRELU) SEP FUNC(elementwise_mode, ABS) \
23784 SEP FUNC(elementwise_mode, CLZ) SEP FUNC(elementwise_mode, SHR) SEP FUNC(elementwise_mode, SHL)
23785
Jonny Svärd136810f2021-10-13 16:04:26 +020023786#define EXPAND_FUNCTIONAL_SAFETY(FUNC, SEP) \
23787 FUNC(functional_safety, NOT_IMPLEMENTED) SEP FUNC(functional_safety, IMPLEMENTED)
23788
23789#define EXPAND_IFM2_OPERAND_ORDER(FUNC, SEP) FUNC(ifm2_operand_order, ORDER_B) SEP FUNC(ifm2_operand_order, ORDER_A)
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020023790
23791#define EXPAND_IFM_SCALE_MODE(FUNC, SEP) \
Jonny Svärd136810f2021-10-13 16:04:26 +020023792 FUNC(ifm_scale_mode, OPA_OPB_16) SEP FUNC(ifm_scale_mode, OPA_32) SEP FUNC(ifm_scale_mode, OPB_32)
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020023793
Jonny Svärd136810f2021-10-13 16:04:26 +020023794#define EXPAND_IFM_UPSCALE_MODE(FUNC, SEP) \
23795 FUNC(ifm_upscale_mode, NONE) SEP FUNC(ifm_upscale_mode, NEAREST) SEP FUNC(ifm_upscale_mode, ZEROS)
Diqing Zhong04118062020-04-15 01:19:12 +020023796
Jonny Svärd136810f2021-10-13 16:04:26 +020023797#define EXPAND_KERNEL_DECOMPOSITION(FUNC, SEP) FUNC(kernel_decomposition, D8X8) SEP FUNC(kernel_decomposition, D4X4)
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020023798
Jonny Svärd136810f2021-10-13 16:04:26 +020023799#define EXPAND_KERNEL_DILATION(FUNC, SEP) FUNC(kernel_dilation, NONE) SEP FUNC(kernel_dilation, X2)
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020023800
Jonny Svärd136810f2021-10-13 16:04:26 +020023801#define EXPAND_MAX_BEATS(FUNC, SEP) FUNC(max_beats, B64) SEP FUNC(max_beats, B128) SEP FUNC(max_beats, B256)
23802
23803#define EXPAND_MEM_ATTR(FUNC, SEP) \
23804 FUNC(mem_attr, AXI0_OUTSTANDING_COUNTER0) \
23805 SEP FUNC(mem_attr, AXI0_OUTSTANDING_COUNTER1) SEP FUNC(mem_attr, AXI1_OUTSTANDING_COUNTER2) \
23806 SEP FUNC(mem_attr, AXI1_OUTSTANDING_COUNTER3)
23807
23808#define EXPAND_OFM_SCALE_MODE(FUNC, SEP) FUNC(ofm_scale_mode, PER_CHANNEL) SEP FUNC(ofm_scale_mode, GLOBAL)
23809
23810#define EXPAND_PMU_AXI_CHANNEL(FUNC, SEP) \
23811 FUNC(pmu_axi_channel, RD_CMD) \
23812 SEP FUNC(pmu_axi_channel, RD_IFM) SEP FUNC(pmu_axi_channel, RD_WEIGHTS) SEP FUNC(pmu_axi_channel, RD_SCALE_BIAS) \
23813 SEP FUNC(pmu_axi_channel, RD_MEM2MEM) SEP FUNC(pmu_axi_channel, WR_OFM) SEP FUNC(pmu_axi_channel, WR_MEM2MEM)
23814
23815#define EXPAND_PMU_EVENT(FUNC, SEP) \
23816 FUNC(pmu_event, NO_EVENT) \
23817 SEP FUNC(pmu_event, CYCLE) SEP FUNC(pmu_event, NPU_IDLE) SEP FUNC(pmu_event, CC_STALLED_ON_BLOCKDEP) SEP FUNC( \
23818 pmu_event, CC_STALLED_ON_SHRAM_RECONFIG) SEP FUNC(pmu_event, NPU_ACTIVE) SEP FUNC(pmu_event, MAC_ACTIVE) \
23819 SEP FUNC(pmu_event, MAC_ACTIVE_8BIT) SEP FUNC(pmu_event, MAC_ACTIVE_16BIT) SEP FUNC( \
23820 pmu_event, MAC_DPU_ACTIVE) SEP FUNC(pmu_event, MAC_STALLED_BY_WD_ACC) SEP FUNC(pmu_event, \
23821 MAC_STALLED_BY_WD) \
23822 SEP FUNC(pmu_event, MAC_STALLED_BY_ACC) SEP FUNC(pmu_event, MAC_STALLED_BY_IB) SEP FUNC( \
23823 pmu_event, \
23824 MAC_ACTIVE_32BIT) SEP FUNC(pmu_event, \
23825 MAC_STALLED_BY_INT_W) SEP FUNC(pmu_event, \
23826 MAC_STALLED_BY_INT_ACC) SEP FUNC(pmu_event, \
23827 AO_ACTIVE) \
23828 SEP FUNC(pmu_event, AO_ACTIVE_8BIT) SEP FUNC(pmu_event, AO_ACTIVE_16BIT) SEP FUNC( \
23829 pmu_event, AO_STALLED_BY_OFMP_OB) SEP FUNC(pmu_event, AO_STALLED_BY_OFMP) SEP \
23830 FUNC(pmu_event, AO_STALLED_BY_OB) SEP FUNC(pmu_event, AO_STALLED_BY_ACC_IB) SEP FUNC( \
23831 pmu_event, AO_STALLED_BY_ACC) SEP FUNC(pmu_event, AO_STALLED_BY_IB) SEP \
23832 FUNC(pmu_event, WD_ACTIVE) SEP FUNC(pmu_event, WD_STALLED) SEP FUNC(pmu_event, WD_STALLED_BY_WS) SEP FUNC( \
23833 pmu_event, WD_STALLED_BY_WD_BUF) SEP FUNC(pmu_event, \
23834 WD_PARSE_ACTIVE) SEP \
23835 FUNC(pmu_event, WD_PARSE_STALLED) SEP FUNC(pmu_event, WD_PARSE_STALLED_IN) SEP FUNC( \
23836 pmu_event, WD_PARSE_STALLED_OUT) SEP FUNC(pmu_event, \
23837 WD_TRANS_WS) SEP \
23838 FUNC(pmu_event, WD_TRANS_WB) SEP FUNC(pmu_event, WD_TRANS_DW0) SEP FUNC( \
23839 pmu_event, WD_TRANS_DW1) SEP FUNC(pmu_event, \
23840 AXI0_RD_TRANS_ACCEPTED) SEP \
23841 FUNC(pmu_event, AXI0_RD_TRANS_COMPLETED) SEP FUNC(pmu_event, AXI0_RD_DATA_BEAT_RECEIVED) SEP FUNC( \
23842 pmu_event, AXI0_RD_TRAN_REQ_STALLED) SEP FUNC(pmu_event, \
23843 AXI0_WR_TRANS_ACCEPTED) SEP \
23844 FUNC(pmu_event, AXI0_WR_TRANS_COMPLETED_M) SEP FUNC( \
23845 pmu_event, AXI0_WR_TRANS_COMPLETED_S) SEP \
23846 FUNC(pmu_event, AXI0_WR_DATA_BEAT_WRITTEN) SEP FUNC( \
23847 pmu_event, AXI0_WR_TRAN_REQ_STALLED) SEP \
23848 FUNC(pmu_event, AXI0_WR_DATA_BEAT_STALLED) SEP FUNC( \
23849 pmu_event, \
23850 AXI0_ENABLED_CYCLES) SEP FUNC(pmu_event, \
23851 AXI0_RD_STALL_LIMIT) SEP \
23852 FUNC(pmu_event, AXI0_WR_STALL_LIMIT) SEP FUNC( \
23853 pmu_event, \
23854 AXI_LATENCY_ANY) SEP FUNC(pmu_event, \
23855 AXI_LATENCY_32) SEP \
23856 FUNC(pmu_event, \
23857 AXI_LATENCY_64) SEP FUNC(pmu_event, \
23858 AXI_LATENCY_128) SEP \
23859 FUNC(pmu_event, AXI_LATENCY_256) SEP FUNC( \
23860 pmu_event, \
23861 AXI_LATENCY_512) SEP FUNC(pmu_event, \
23862 AXI_LATENCY_1024) SEP \
23863 FUNC(pmu_event, ECC_DMA) SEP FUNC( \
23864 pmu_event, \
23865 ECC_SB0) SEP FUNC(pmu_event, \
23866 AXI1_RD_TRANS_ACCEPTED) SEP \
23867 FUNC(pmu_event, AXI1_RD_TRANS_COMPLETED) SEP FUNC( \
23868 pmu_event, AXI1_RD_DATA_BEAT_RECEIVED) SEP \
23869 FUNC(pmu_event, AXI1_RD_TRAN_REQ_STALLED) SEP FUNC( \
23870 pmu_event, AXI1_WR_TRANS_ACCEPTED) SEP \
23871 FUNC(pmu_event, AXI1_WR_TRANS_COMPLETED_M) SEP FUNC( \
23872 pmu_event, \
23873 AXI1_WR_TRANS_COMPLETED_S) SEP \
23874 FUNC(pmu_event, \
23875 AXI1_WR_DATA_BEAT_WRITTEN) SEP \
23876 FUNC(pmu_event, \
23877 AXI1_WR_TRAN_REQ_STALLED) SEP \
23878 FUNC( \
23879 pmu_event, \
23880 AXI1_WR_DATA_BEAT_STALLED) SEP \
23881 FUNC( \
23882 pmu_event, \
23883 AXI1_ENABLED_CYCLES) SEP \
23884 FUNC( \
23885 pmu_event, \
23886 AXI1_RD_STALL_LIMIT) SEP \
23887 FUNC( \
23888 pmu_event, \
23889 AXI1_WR_STALL_LIMIT) \
23890 SEP FUNC( \
23891 pmu_event, \
Stefan Nannessone2e70242020-08-19 16:01:29 +020023892 ECC_SB1)
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020023893
23894#define EXPAND_POOLING_MODE(FUNC, SEP) \
23895 FUNC(pooling_mode, MAX) SEP FUNC(pooling_mode, AVERAGE) SEP FUNC(pooling_mode, REDUCE_SUM)
23896
23897#define EXPAND_PRIVILEGE_LEVEL(FUNC, SEP) FUNC(privilege_level, USER) SEP FUNC(privilege_level, PRIVILEGED)
23898
Jonny Svärd136810f2021-10-13 16:04:26 +020023899#define EXPAND_ROUND_MODE(FUNC, SEP) FUNC(round_mode, DBL) SEP FUNC(round_mode, TRUNCATE) SEP FUNC(round_mode, NATURAL)
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020023900
23901#define EXPAND_SECURITY_LEVEL(FUNC, SEP) FUNC(security_level, SECURE) SEP FUNC(security_level, NON_SECURE)
23902
Kristofer Jonsson49bdee82020-04-06 13:21:21 +020023903#define EXPAND_STATE(FUNC, SEP) FUNC(state, STOPPED) SEP FUNC(state, RUNNING)
23904
Jonny Svärd136810f2021-10-13 16:04:26 +020023905#define EXPAND_WD_CORE_SLICE_STATE(FUNC, SEP) \
23906 FUNC(wd_core_slice_state, HEADER) SEP FUNC(wd_core_slice_state, PALETTE) SEP FUNC(wd_core_slice_state, WEIGHTS)
23907
23908#define EXPAND_WD_CTRL_STATE(FUNC, SEP) \
23909 FUNC(wd_ctrl_state, IDLE) \
23910 SEP FUNC(wd_ctrl_state, DRAIN) SEP FUNC(wd_ctrl_state, OFD_INIT) SEP FUNC(wd_ctrl_state, OFD_RUN)
23911
23912#define EXPAND_WEIGHT_ORDER(FUNC, SEP) FUNC(weight_order, DEPTH_FIRST) SEP FUNC(weight_order, PART_KERNEL_FIRST)
23913
23914#ifdef __cplusplus
23915}
23916#endif
23917#endif