1 /* 2 * Copyright (c) 2020-2021 Arm Limited. All rights reserved. 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 * 6 * Licensed under the Apache License, Version 2.0 (the License); you may 7 * not use this file except in compliance with the License. 8 * You may obtain a copy of the License at 9 * 10 * www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, software 13 * distributed under the License is distributed on an AS IS BASIS, WITHOUT 14 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 * See the License for the specific language governing permissions and 16 * limitations under the License. 17 */ 18 19 #ifndef ETHOSU55_INTERFACE_H 20 #define ETHOSU55_INTERFACE_H 21 22 #ifdef __KERNEL__ 23 #include <linux/types.h> 24 #else 25 #include <stdint.h> 26 #endif 27 28 #if !defined(__cplusplus) || __cplusplus < 201402L 29 #define CONSTEXPR 30 #else 31 #define CONSTEXPR constexpr 32 #endif 33 34 #ifndef __cplusplus 35 #define STRUCT struct 36 #else 37 #define STRUCT 38 #endif 39 40 #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 56 namespace NPU_NAMESPACE 57 { 58 #endif 59 #define NNX_ARCH_VERSION_MAJOR 1 60 #define NNX_ARCH_VERSION_MINOR 1 61 #define NNX_ARCH_VERSION_PATCH 0 62 63 // Register offsets 64 // 65 // 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 71 #define NPU_REG_QBASE 0x0010 72 #define NPU_REG_QBASE_HI 0x0014 73 #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 84 #define BASE_REGISTERS_SIZE 0x0080 85 86 // 87 // Register subpage BASE_POINTERS 88 // 89 #define NPU_REG_BASEP_BASE 0x0080 90 #define NPU_REG_BASEP_ARRLEN 0x0008 91 #define BASE_POINTERS_REGISTERS_SIZE 0x0100 92 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 104 #define NPU_REG_DEBUG_BLOCK 0x0150 105 #define DEBUG_REGISTERS_SIZE 0x0180 106 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 117 #define NPU_REG_PMCCNTR 0x01A0 118 #define NPU_REG_PMCCNTR_HI 0x01A4 119 #define NPU_REG_PMCCNTR_CFG 0x01A8 120 #define NPU_REG_PMCAXI_CHAN 0x01AC 121 #define PMU_REGISTERS_SIZE 0x0200 122 123 // 124 // Register subpage TSU_DEBUG 125 // 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 160 #define NPU_REG_CURRENT_BLOCK 0x02B4 161 #define NPU_REG_CURRENT_OP 0x02B8 162 #define NPU_REG_CURRENT_CMD 0x02BC 163 #define TSU_DEBUG_REGISTERS_SIZE 0x02C0 164 165 // 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_WEIGHT_LENGTH_HI 0x0A8C 300 #define NPU_REG_SCALE_BASE 0x0A90 301 #define NPU_REG_SCALE_BASE_HI 0x0A94 302 #define NPU_REG_SCALE_LENGTH 0x0A98 303 #define NPU_REG_SCALE_LENGTH_HI 0x0A9C 304 #define NPU_REG_OFM_SCALE 0x0AA0 305 #define NPU_REG_OFM_SCALE_SHIFT 0x0AA4 306 #define NPU_REG_OPA_SCALE 0x0AA8 307 #define NPU_REG_OPA_SCALE_SHIFT 0x0AAC 308 #define NPU_REG_OPB_SCALE 0x0AB0 309 #define TSU_WS_BASE_REGISTERS_SIZE 0x0AC0 310 311 // 312 // Register subpage TSU_DMA_BASE 313 // 314 #define NPU_REG_DMA0_SRC 0x0AC0 315 #define NPU_REG_DMA0_SRC_HI 0x0AC4 316 #define NPU_REG_DMA0_DST 0x0AC8 317 #define NPU_REG_DMA0_DST_HI 0x0ACC 318 #define NPU_REG_DMA0_LEN 0x0AD0 319 #define NPU_REG_DMA0_LEN_HI 0x0AD4 320 #define TSU_DMA_BASE_REGISTERS_SIZE 0x0B00 321 322 // 323 // Register subpage TSU_IFM2_BASE 324 // 325 #define NPU_REG_IFM2_BASE0 0x0B00 326 #define NPU_REG_IFM2_BASE0_HI 0x0B04 327 #define NPU_REG_IFM2_BASE1 0x0B08 328 #define NPU_REG_IFM2_BASE1_HI 0x0B0C 329 #define NPU_REG_IFM2_BASE2 0x0B10 330 #define NPU_REG_IFM2_BASE2_HI 0x0B14 331 #define NPU_REG_IFM2_BASE3 0x0B18 332 #define NPU_REG_IFM2_BASE3_HI 0x0B1C 333 #define NPU_REG_IFM2_STRIDE_X 0x0B20 334 #define NPU_REG_IFM2_STRIDE_X_HI 0x0B24 335 #define NPU_REG_IFM2_STRIDE_Y 0x0B28 336 #define NPU_REG_IFM2_STRIDE_Y_HI 0x0B2C 337 #define NPU_REG_IFM2_STRIDE_C 0x0B30 338 #define NPU_REG_IFM2_STRIDE_C_HI 0x0B34 339 #define TSU_IFM2_BASE_REGISTERS_SIZE 0x0B40 340 341 // 342 // Register subpage TSU_WS1_BASE 343 // 344 #define TSU_WS1_BASE_REGISTERS_SIZE 0x0B80 345 346 // 347 // Register subpage TSU_USER_BASE 348 // 349 #define NPU_REG_USER_DEFINED_BASE 0x0B80 350 #define NPU_REG_USER_DEFINED_ARRLEN 0x0008 351 #define TSU_USER_BASE_REGISTERS_SIZE 0x0BC0 352 353 // 354 // Register subpage TSU_DMA_EBASE 355 // 356 #define TSU_DMA_EBASE_REGISTERS_SIZE 0x0C00 357 358 // 359 // Register subpage ID 360 // 361 #define NPU_REG_REVISION 0x0FC0 362 #define NPU_REG_PID4 0x0FD0 363 #define NPU_REG_PID5 0x0FD4 364 #define NPU_REG_PID6 0x0FD8 365 #define NPU_REG_PID7 0x0FDC 366 #define NPU_REG_PID0 0x0FE0 367 #define NPU_REG_PID1 0x0FE4 368 #define NPU_REG_PID2 0x0FE8 369 #define NPU_REG_PID3 0x0FEC 370 #define NPU_REG_CID0 0x0FF0 371 #define NPU_REG_CID1 0x0FF4 372 #define NPU_REG_CID2 0x0FF8 373 #define NPU_REG_CID3 0x0FFC 374 #define ID_REGISTERS_SIZE 0x1000 375 376 #ifdef __cplusplus 377 // Enum types 378 enum class acc_format : uint8_t 379 { 380 I32 = 0, 381 I40 = 1, 382 F16 = 2, 383 }; 384 385 enum class activation_clip_range : uint8_t 386 { 387 OFM_PRECISION = 0, 388 FORCE_UINT8 = 2, 389 FORCE_INT8 = 3, 390 FORCE_INT16 = 5, 391 }; 392 393 enum class activation_format : uint8_t 394 { 395 NHWC = 0, 396 NHCWB16 = 1, 397 }; 398 399 enum class activation_function : uint8_t 400 { 401 RELU = 0, 402 TANH = 3, 403 SIGMOID = 4, 404 TABLE_0 = 16, 405 TABLE_1 = 17, 406 TABLE_2 = 18, 407 TABLE_3 = 19, 408 TABLE_4 = 20, 409 TABLE_5 = 21, 410 TABLE_6 = 22, 411 TABLE_7 = 23, 412 }; 413 414 enum class activation_precision : uint8_t 415 { 416 B8 = 0, 417 B16 = 1, 418 B32 = 2, 419 B64 = 3, 420 }; 421 422 enum class activation_type : uint8_t 423 { 424 UNSIGNED = 0, 425 SIGNED = 1, 426 }; 427 428 enum class axi_mem_encoding : uint8_t 429 { 430 DEVICE_NON_BUFFERABLE = 0, 431 DEVICE_BUFFERABLE = 1, 432 NORMAL_NON_CACHEABLE_NON_BUFFERABLE = 2, 433 NORMAL_NON_CACHEABLE_BUFFERABLE = 3, 434 WRITE_THROUGH_NO_ALLOCATE = 4, 435 WRITE_THROUGH_READ_ALLOCATE = 5, 436 WRITE_THROUGH_WRITE_ALLOCATE = 6, 437 WRITE_THROUGH_READ_AND_WRITE_ALLOCATE = 7, 438 WRITE_BACK_NO_ALLOCATE = 8, 439 WRITE_BACK_READ_ALLOCATE = 9, 440 WRITE_BACK_WRITE_ALLOCATE = 10, 441 WRITE_BACK_READ_AND_WRITE_ALLOCATE = 11, 442 }; 443 444 enum class broadcast_mode : uint8_t 445 { 446 DISABLE = 0, 447 ENABLE = 1, 448 }; 449 450 enum class cmd0_opcode : uint16_t 451 { 452 NPU_OP_STOP = 0, 453 NPU_OP_IRQ = 1, 454 NPU_OP_CONV = 2, 455 NPU_OP_DEPTHWISE = 3, 456 NPU_OP_POOL = 5, 457 NPU_OP_ELEMENTWISE = 6, 458 NPU_OP_DMA_START = 16, 459 NPU_OP_DMA_WAIT = 17, 460 NPU_OP_KERNEL_WAIT = 18, 461 NPU_OP_PMU_MASK = 19, 462 NPU_SET_IFM_PAD_TOP = 256, 463 NPU_SET_IFM_PAD_LEFT = 257, 464 NPU_SET_IFM_PAD_RIGHT = 258, 465 NPU_SET_IFM_PAD_BOTTOM = 259, 466 NPU_SET_IFM_DEPTH_M1 = 260, 467 NPU_SET_IFM_PRECISION = 261, 468 NPU_SET_IFM_UPSCALE = 263, 469 NPU_SET_IFM_ZERO_POINT = 265, 470 NPU_SET_IFM_WIDTH0_M1 = 266, 471 NPU_SET_IFM_HEIGHT0_M1 = 267, 472 NPU_SET_IFM_HEIGHT1_M1 = 268, 473 NPU_SET_IFM_IB_END = 269, 474 NPU_SET_IFM_REGION = 271, 475 NPU_SET_OFM_WIDTH_M1 = 273, 476 NPU_SET_OFM_HEIGHT_M1 = 274, 477 NPU_SET_OFM_DEPTH_M1 = 275, 478 NPU_SET_OFM_PRECISION = 276, 479 NPU_SET_OFM_BLK_WIDTH_M1 = 277, 480 NPU_SET_OFM_BLK_HEIGHT_M1 = 278, 481 NPU_SET_OFM_BLK_DEPTH_M1 = 279, 482 NPU_SET_OFM_ZERO_POINT = 280, 483 NPU_SET_OFM_WIDTH0_M1 = 282, 484 NPU_SET_OFM_HEIGHT0_M1 = 283, 485 NPU_SET_OFM_HEIGHT1_M1 = 284, 486 NPU_SET_OFM_REGION = 287, 487 NPU_SET_KERNEL_WIDTH_M1 = 288, 488 NPU_SET_KERNEL_HEIGHT_M1 = 289, 489 NPU_SET_KERNEL_STRIDE = 290, 490 NPU_SET_ACC_FORMAT = 292, 491 NPU_SET_ACTIVATION = 293, 492 NPU_SET_ACTIVATION_MIN = 294, 493 NPU_SET_ACTIVATION_MAX = 295, 494 NPU_SET_WEIGHT_REGION = 296, 495 NPU_SET_SCALE_REGION = 297, 496 NPU_SET_AB_START = 301, 497 NPU_SET_BLOCKDEP = 303, 498 NPU_SET_DMA0_SRC_REGION = 304, 499 NPU_SET_DMA0_DST_REGION = 305, 500 NPU_SET_DMA0_SIZE0 = 306, 501 NPU_SET_DMA0_SIZE1 = 307, 502 NPU_SET_IFM2_BROADCAST = 384, 503 NPU_SET_IFM2_SCALAR = 385, 504 NPU_SET_IFM2_PRECISION = 389, 505 NPU_SET_IFM2_ZERO_POINT = 393, 506 NPU_SET_IFM2_WIDTH0_M1 = 394, 507 NPU_SET_IFM2_HEIGHT0_M1 = 395, 508 NPU_SET_IFM2_HEIGHT1_M1 = 396, 509 NPU_SET_IFM2_IB_START = 397, 510 NPU_SET_IFM2_REGION = 399, 511 }; 512 513 enum class cmd1_opcode : uint16_t 514 { 515 NPU_SET_IFM_BASE0 = 0, 516 NPU_SET_IFM_BASE1 = 1, 517 NPU_SET_IFM_BASE2 = 2, 518 NPU_SET_IFM_BASE3 = 3, 519 NPU_SET_IFM_STRIDE_X = 4, 520 NPU_SET_IFM_STRIDE_Y = 5, 521 NPU_SET_IFM_STRIDE_C = 6, 522 NPU_SET_OFM_BASE0 = 16, 523 NPU_SET_OFM_BASE1 = 17, 524 NPU_SET_OFM_BASE2 = 18, 525 NPU_SET_OFM_BASE3 = 19, 526 NPU_SET_OFM_STRIDE_X = 20, 527 NPU_SET_OFM_STRIDE_Y = 21, 528 NPU_SET_OFM_STRIDE_C = 22, 529 NPU_SET_WEIGHT_BASE = 32, 530 NPU_SET_WEIGHT_LENGTH = 33, 531 NPU_SET_SCALE_BASE = 34, 532 NPU_SET_SCALE_LENGTH = 35, 533 NPU_SET_OFM_SCALE = 36, 534 NPU_SET_OPA_SCALE = 37, 535 NPU_SET_OPB_SCALE = 38, 536 NPU_SET_DMA0_SRC = 48, 537 NPU_SET_DMA0_DST = 49, 538 NPU_SET_DMA0_LEN = 50, 539 NPU_SET_IFM2_BASE0 = 128, 540 NPU_SET_IFM2_BASE1 = 129, 541 NPU_SET_IFM2_BASE2 = 130, 542 NPU_SET_IFM2_BASE3 = 131, 543 NPU_SET_IFM2_STRIDE_X = 132, 544 NPU_SET_IFM2_STRIDE_Y = 133, 545 NPU_SET_IFM2_STRIDE_C = 134, 546 NPU_SET_USER_DEFINED0 = 160, 547 NPU_SET_USER_DEFINED1 = 161, 548 NPU_SET_USER_DEFINED2 = 162, 549 NPU_SET_USER_DEFINED3 = 163, 550 NPU_SET_USER_DEFINED4 = 164, 551 NPU_SET_USER_DEFINED5 = 165, 552 NPU_SET_USER_DEFINED6 = 166, 553 NPU_SET_USER_DEFINED7 = 167, 554 }; 555 556 enum class cmd_ctrl : uint8_t 557 { 558 CMD0_CTRL = 0, 559 CMD1_CTRL = 1, 560 }; 561 562 enum class custom_dma_cs : uint8_t 563 { 564 DISABLE = 0, 565 ENABLE = 1, 566 }; 567 568 enum class custom_dma : uint8_t 569 { 570 NOT_IMPLEMENTED = 0, 571 IMPLEMENTED = 1, 572 }; 573 574 enum class dma_fault_src : uint8_t 575 { 576 AXI_M0 = 0, 577 AXI_M1 = 1, 578 }; 579 580 enum class dma_region_mode : uint8_t 581 { 582 EXTERNAL = 0, 583 INTERNAL = 1, 584 }; 585 586 enum class dma_stride_mode : uint8_t 587 { 588 D1 = 0, 589 }; 590 591 enum class elementwise_mode : uint8_t 592 { 593 MUL = 0, 594 ADD = 1, 595 SUB = 2, 596 MIN = 3, 597 MAX = 4, 598 LRELU = 5, 599 ABS = 6, 600 CLZ = 7, 601 SHR = 8, 602 SHL = 9, 603 }; 604 605 enum class functional_safety : uint8_t 606 { 607 NOT_IMPLEMENTED = 0, 608 IMPLEMENTED = 1, 609 }; 610 611 enum class ifm2_operand_order : uint8_t 612 { 613 ORDER_B = 0, 614 ORDER_A = 1, 615 }; 616 617 enum class ifm_scale_mode : uint8_t 618 { 619 OPA_OPB_16 = 0, 620 OPA_32 = 1, 621 OPB_32 = 2, 622 }; 623 624 enum class ifm_upscale_mode : uint8_t 625 { 626 NONE = 0, 627 NEAREST = 1, 628 ZEROS = 2, 629 }; 630 631 enum class kernel_decomposition : uint8_t 632 { 633 D8X8 = 0, 634 D4X4 = 1, 635 }; 636 637 enum class kernel_dilation : uint8_t 638 { 639 NONE = 0, 640 X2 = 1, 641 }; 642 643 enum class max_beats : uint8_t 644 { 645 B64 = 0, 646 B128 = 1, 647 B256 = 2, 648 }; 649 650 enum class mem_attr : uint8_t 651 { 652 AXI0_OUTSTANDING_COUNTER0 = 0, 653 AXI0_OUTSTANDING_COUNTER1 = 1, 654 AXI1_OUTSTANDING_COUNTER2 = 2, 655 AXI1_OUTSTANDING_COUNTER3 = 3, 656 }; 657 658 enum class ofm_scale_mode : uint8_t 659 { 660 PER_CHANNEL = 0, 661 GLOBAL = 1, 662 }; 663 664 enum class pmu_axi_channel : uint8_t 665 { 666 RD_CMD = 0, 667 RD_IFM = 1, 668 RD_WEIGHTS = 2, 669 RD_SCALE_BIAS = 3, 670 RD_MEM2MEM = 4, 671 WR_OFM = 8, 672 WR_MEM2MEM = 9, 673 }; 674 675 enum class pmu_event : uint16_t 676 { 677 NO_EVENT = 0, 678 CYCLE = 17, 679 NPU_IDLE = 32, 680 CC_STALLED_ON_BLOCKDEP = 33, 681 CC_STALLED_ON_SHRAM_RECONFIG = 34, 682 NPU_ACTIVE = 35, 683 MAC_ACTIVE = 48, 684 MAC_ACTIVE_8BIT = 49, 685 MAC_ACTIVE_16BIT = 50, 686 MAC_DPU_ACTIVE = 51, 687 MAC_STALLED_BY_WD_ACC = 52, 688 MAC_STALLED_BY_WD = 53, 689 MAC_STALLED_BY_ACC = 54, 690 MAC_STALLED_BY_IB = 55, 691 MAC_ACTIVE_32BIT = 56, 692 MAC_STALLED_BY_INT_W = 57, 693 MAC_STALLED_BY_INT_ACC = 58, 694 AO_ACTIVE = 64, 695 AO_ACTIVE_8BIT = 65, 696 AO_ACTIVE_16BIT = 66, 697 AO_STALLED_BY_OFMP_OB = 67, 698 AO_STALLED_BY_OFMP = 68, 699 AO_STALLED_BY_OB = 69, 700 AO_STALLED_BY_ACC_IB = 70, 701 AO_STALLED_BY_ACC = 71, 702 AO_STALLED_BY_IB = 72, 703 WD_ACTIVE = 80, 704 WD_STALLED = 81, 705 WD_STALLED_BY_WS = 82, 706 WD_STALLED_BY_WD_BUF = 83, 707 WD_PARSE_ACTIVE = 84, 708 WD_PARSE_STALLED = 85, 709 WD_PARSE_STALLED_IN = 86, 710 WD_PARSE_STALLED_OUT = 87, 711 WD_TRANS_WS = 88, 712 WD_TRANS_WB = 89, 713 WD_TRANS_DW0 = 90, 714 WD_TRANS_DW1 = 91, 715 AXI0_RD_TRANS_ACCEPTED = 128, 716 AXI0_RD_TRANS_COMPLETED = 129, 717 AXI0_RD_DATA_BEAT_RECEIVED = 130, 718 AXI0_RD_TRAN_REQ_STALLED = 131, 719 AXI0_WR_TRANS_ACCEPTED = 132, 720 AXI0_WR_TRANS_COMPLETED_M = 133, 721 AXI0_WR_TRANS_COMPLETED_S = 134, 722 AXI0_WR_DATA_BEAT_WRITTEN = 135, 723 AXI0_WR_TRAN_REQ_STALLED = 136, 724 AXI0_WR_DATA_BEAT_STALLED = 137, 725 AXI0_ENABLED_CYCLES = 140, 726 AXI0_RD_STALL_LIMIT = 142, 727 AXI0_WR_STALL_LIMIT = 143, 728 AXI_LATENCY_ANY = 160, 729 AXI_LATENCY_32 = 161, 730 AXI_LATENCY_64 = 162, 731 AXI_LATENCY_128 = 163, 732 AXI_LATENCY_256 = 164, 733 AXI_LATENCY_512 = 165, 734 AXI_LATENCY_1024 = 166, 735 ECC_DMA = 176, 736 ECC_SB0 = 177, 737 AXI1_RD_TRANS_ACCEPTED = 384, 738 AXI1_RD_TRANS_COMPLETED = 385, 739 AXI1_RD_DATA_BEAT_RECEIVED = 386, 740 AXI1_RD_TRAN_REQ_STALLED = 387, 741 AXI1_WR_TRANS_ACCEPTED = 388, 742 AXI1_WR_TRANS_COMPLETED_M = 389, 743 AXI1_WR_TRANS_COMPLETED_S = 390, 744 AXI1_WR_DATA_BEAT_WRITTEN = 391, 745 AXI1_WR_TRAN_REQ_STALLED = 392, 746 AXI1_WR_DATA_BEAT_STALLED = 393, 747 AXI1_ENABLED_CYCLES = 396, 748 AXI1_RD_STALL_LIMIT = 398, 749 AXI1_WR_STALL_LIMIT = 399, 750 ECC_SB1 = 433, 751 }; 752 753 enum class pooling_mode : uint8_t 754 { 755 MAX = 0, 756 AVERAGE = 1, 757 REDUCE_SUM = 2, 758 }; 759 760 enum class privilege_level : uint8_t 761 { 762 USER = 0, 763 PRIVILEGED = 1, 764 }; 765 766 enum class round_mode : uint8_t 767 { 768 DBL = 0, 769 TRUNCATE = 1, 770 NATURAL = 2, 771 }; 772 773 enum class security_level : uint8_t 774 { 775 SECURE = 0, 776 NON_SECURE = 1, 777 }; 778 779 enum class state : uint8_t 780 { 781 STOPPED = 0, 782 RUNNING = 1, 783 }; 784 785 enum class wd_core_slice_state : uint8_t 786 { 787 HEADER = 0, 788 PALETTE = 1, 789 WEIGHTS = 2, 790 }; 791 792 enum class wd_ctrl_state : uint8_t 793 { 794 IDLE = 0, 795 DRAIN = 1, 796 OFD_INIT = 2, 797 OFD_RUN = 3, 798 }; 799 800 enum class weight_order : uint8_t 801 { 802 DEPTH_FIRST = 0, 803 PART_KERNEL_FIRST = 1, 804 }; 805 806 #else 807 808 enum acc_format 809 { 810 ACC_FORMAT_I32 = 0, 811 ACC_FORMAT_I40 = 1, 812 ACC_FORMAT_F16 = 2, 813 }; 814 815 enum activation_clip_range 816 { 817 ACTIVATION_CLIP_RANGE_OFM_PRECISION = 0, 818 ACTIVATION_CLIP_RANGE_FORCE_UINT8 = 2, 819 ACTIVATION_CLIP_RANGE_FORCE_INT8 = 3, 820 ACTIVATION_CLIP_RANGE_FORCE_INT16 = 5, 821 }; 822 823 enum activation_format 824 { 825 ACTIVATION_FORMAT_NHWC = 0, 826 ACTIVATION_FORMAT_NHCWB16 = 1, 827 }; 828 829 enum activation_function 830 { 831 ACTIVATION_FUNCTION_RELU = 0, 832 ACTIVATION_FUNCTION_TANH = 3, 833 ACTIVATION_FUNCTION_SIGMOID = 4, 834 ACTIVATION_FUNCTION_TABLE_0 = 16, 835 ACTIVATION_FUNCTION_TABLE_1 = 17, 836 ACTIVATION_FUNCTION_TABLE_2 = 18, 837 ACTIVATION_FUNCTION_TABLE_3 = 19, 838 ACTIVATION_FUNCTION_TABLE_4 = 20, 839 ACTIVATION_FUNCTION_TABLE_5 = 21, 840 ACTIVATION_FUNCTION_TABLE_6 = 22, 841 ACTIVATION_FUNCTION_TABLE_7 = 23, 842 }; 843 844 enum activation_precision 845 { 846 ACTIVATION_PRECISION_B8 = 0, 847 ACTIVATION_PRECISION_B16 = 1, 848 ACTIVATION_PRECISION_B32 = 2, 849 ACTIVATION_PRECISION_B64 = 3, 850 }; 851 852 enum activation_type 853 { 854 ACTIVATION_TYPE_UNSIGNED = 0, 855 ACTIVATION_TYPE_SIGNED = 1, 856 }; 857 858 enum axi_mem_encoding 859 { 860 AXI_MEM_ENCODING_DEVICE_NON_BUFFERABLE = 0, 861 AXI_MEM_ENCODING_DEVICE_BUFFERABLE = 1, 862 AXI_MEM_ENCODING_NORMAL_NON_CACHEABLE_NON_BUFFERABLE = 2, 863 AXI_MEM_ENCODING_NORMAL_NON_CACHEABLE_BUFFERABLE = 3, 864 AXI_MEM_ENCODING_WRITE_THROUGH_NO_ALLOCATE = 4, 865 AXI_MEM_ENCODING_WRITE_THROUGH_READ_ALLOCATE = 5, 866 AXI_MEM_ENCODING_WRITE_THROUGH_WRITE_ALLOCATE = 6, 867 AXI_MEM_ENCODING_WRITE_THROUGH_READ_AND_WRITE_ALLOCATE = 7, 868 AXI_MEM_ENCODING_WRITE_BACK_NO_ALLOCATE = 8, 869 AXI_MEM_ENCODING_WRITE_BACK_READ_ALLOCATE = 9, 870 AXI_MEM_ENCODING_WRITE_BACK_WRITE_ALLOCATE = 10, 871 AXI_MEM_ENCODING_WRITE_BACK_READ_AND_WRITE_ALLOCATE = 11, 872 }; 873 874 enum broadcast_mode 875 { 876 BROADCAST_MODE_DISABLE = 0, 877 BROADCAST_MODE_ENABLE = 1, 878 }; 879 880 enum cmd0_opcode 881 { 882 CMD0_OPCODE_NPU_OP_STOP = 0, 883 CMD0_OPCODE_NPU_OP_IRQ = 1, 884 CMD0_OPCODE_NPU_OP_CONV = 2, 885 CMD0_OPCODE_NPU_OP_DEPTHWISE = 3, 886 CMD0_OPCODE_NPU_OP_POOL = 5, 887 CMD0_OPCODE_NPU_OP_ELEMENTWISE = 6, 888 CMD0_OPCODE_NPU_OP_DMA_START = 16, 889 CMD0_OPCODE_NPU_OP_DMA_WAIT = 17, 890 CMD0_OPCODE_NPU_OP_KERNEL_WAIT = 18, 891 CMD0_OPCODE_NPU_OP_PMU_MASK = 19, 892 CMD0_OPCODE_NPU_SET_IFM_PAD_TOP = 256, 893 CMD0_OPCODE_NPU_SET_IFM_PAD_LEFT = 257, 894 CMD0_OPCODE_NPU_SET_IFM_PAD_RIGHT = 258, 895 CMD0_OPCODE_NPU_SET_IFM_PAD_BOTTOM = 259, 896 CMD0_OPCODE_NPU_SET_IFM_DEPTH_M1 = 260, 897 CMD0_OPCODE_NPU_SET_IFM_PRECISION = 261, 898 CMD0_OPCODE_NPU_SET_IFM_UPSCALE = 263, 899 CMD0_OPCODE_NPU_SET_IFM_ZERO_POINT = 265, 900 CMD0_OPCODE_NPU_SET_IFM_WIDTH0_M1 = 266, 901 CMD0_OPCODE_NPU_SET_IFM_HEIGHT0_M1 = 267, 902 CMD0_OPCODE_NPU_SET_IFM_HEIGHT1_M1 = 268, 903 CMD0_OPCODE_NPU_SET_IFM_IB_END = 269, 904 CMD0_OPCODE_NPU_SET_IFM_REGION = 271, 905 CMD0_OPCODE_NPU_SET_OFM_WIDTH_M1 = 273, 906 CMD0_OPCODE_NPU_SET_OFM_HEIGHT_M1 = 274, 907 CMD0_OPCODE_NPU_SET_OFM_DEPTH_M1 = 275, 908 CMD0_OPCODE_NPU_SET_OFM_PRECISION = 276, 909 CMD0_OPCODE_NPU_SET_OFM_BLK_WIDTH_M1 = 277, 910 CMD0_OPCODE_NPU_SET_OFM_BLK_HEIGHT_M1 = 278, 911 CMD0_OPCODE_NPU_SET_OFM_BLK_DEPTH_M1 = 279, 912 CMD0_OPCODE_NPU_SET_OFM_ZERO_POINT = 280, 913 CMD0_OPCODE_NPU_SET_OFM_WIDTH0_M1 = 282, 914 CMD0_OPCODE_NPU_SET_OFM_HEIGHT0_M1 = 283, 915 CMD0_OPCODE_NPU_SET_OFM_HEIGHT1_M1 = 284, 916 CMD0_OPCODE_NPU_SET_OFM_REGION = 287, 917 CMD0_OPCODE_NPU_SET_KERNEL_WIDTH_M1 = 288, 918 CMD0_OPCODE_NPU_SET_KERNEL_HEIGHT_M1 = 289, 919 CMD0_OPCODE_NPU_SET_KERNEL_STRIDE = 290, 920 CMD0_OPCODE_NPU_SET_ACC_FORMAT = 292, 921 CMD0_OPCODE_NPU_SET_ACTIVATION = 293, 922 CMD0_OPCODE_NPU_SET_ACTIVATION_MIN = 294, 923 CMD0_OPCODE_NPU_SET_ACTIVATION_MAX = 295, 924 CMD0_OPCODE_NPU_SET_WEIGHT_REGION = 296, 925 CMD0_OPCODE_NPU_SET_SCALE_REGION = 297, 926 CMD0_OPCODE_NPU_SET_AB_START = 301, 927 CMD0_OPCODE_NPU_SET_BLOCKDEP = 303, 928 CMD0_OPCODE_NPU_SET_DMA0_SRC_REGION = 304, 929 CMD0_OPCODE_NPU_SET_DMA0_DST_REGION = 305, 930 CMD0_OPCODE_NPU_SET_DMA0_SIZE0 = 306, 931 CMD0_OPCODE_NPU_SET_DMA0_SIZE1 = 307, 932 CMD0_OPCODE_NPU_SET_IFM2_BROADCAST = 384, 933 CMD0_OPCODE_NPU_SET_IFM2_SCALAR = 385, 934 CMD0_OPCODE_NPU_SET_IFM2_PRECISION = 389, 935 CMD0_OPCODE_NPU_SET_IFM2_ZERO_POINT = 393, 936 CMD0_OPCODE_NPU_SET_IFM2_WIDTH0_M1 = 394, 937 CMD0_OPCODE_NPU_SET_IFM2_HEIGHT0_M1 = 395, 938 CMD0_OPCODE_NPU_SET_IFM2_HEIGHT1_M1 = 396, 939 CMD0_OPCODE_NPU_SET_IFM2_IB_START = 397, 940 CMD0_OPCODE_NPU_SET_IFM2_REGION = 399, 941 }; 942 943 enum cmd1_opcode 944 { 945 CMD1_OPCODE_NPU_SET_IFM_BASE0 = 0, 946 CMD1_OPCODE_NPU_SET_IFM_BASE1 = 1, 947 CMD1_OPCODE_NPU_SET_IFM_BASE2 = 2, 948 CMD1_OPCODE_NPU_SET_IFM_BASE3 = 3, 949 CMD1_OPCODE_NPU_SET_IFM_STRIDE_X = 4, 950 CMD1_OPCODE_NPU_SET_IFM_STRIDE_Y = 5, 951 CMD1_OPCODE_NPU_SET_IFM_STRIDE_C = 6, 952 CMD1_OPCODE_NPU_SET_OFM_BASE0 = 16, 953 CMD1_OPCODE_NPU_SET_OFM_BASE1 = 17, 954 CMD1_OPCODE_NPU_SET_OFM_BASE2 = 18, 955 CMD1_OPCODE_NPU_SET_OFM_BASE3 = 19, 956 CMD1_OPCODE_NPU_SET_OFM_STRIDE_X = 20, 957 CMD1_OPCODE_NPU_SET_OFM_STRIDE_Y = 21, 958 CMD1_OPCODE_NPU_SET_OFM_STRIDE_C = 22, 959 CMD1_OPCODE_NPU_SET_WEIGHT_BASE = 32, 960 CMD1_OPCODE_NPU_SET_WEIGHT_LENGTH = 33, 961 CMD1_OPCODE_NPU_SET_SCALE_BASE = 34, 962 CMD1_OPCODE_NPU_SET_SCALE_LENGTH = 35, 963 CMD1_OPCODE_NPU_SET_OFM_SCALE = 36, 964 CMD1_OPCODE_NPU_SET_OPA_SCALE = 37, 965 CMD1_OPCODE_NPU_SET_OPB_SCALE = 38, 966 CMD1_OPCODE_NPU_SET_DMA0_SRC = 48, 967 CMD1_OPCODE_NPU_SET_DMA0_DST = 49, 968 CMD1_OPCODE_NPU_SET_DMA0_LEN = 50, 969 CMD1_OPCODE_NPU_SET_IFM2_BASE0 = 128, 970 CMD1_OPCODE_NPU_SET_IFM2_BASE1 = 129, 971 CMD1_OPCODE_NPU_SET_IFM2_BASE2 = 130, 972 CMD1_OPCODE_NPU_SET_IFM2_BASE3 = 131, 973 CMD1_OPCODE_NPU_SET_IFM2_STRIDE_X = 132, 974 CMD1_OPCODE_NPU_SET_IFM2_STRIDE_Y = 133, 975 CMD1_OPCODE_NPU_SET_IFM2_STRIDE_C = 134, 976 CMD1_OPCODE_NPU_SET_USER_DEFINED0 = 160, 977 CMD1_OPCODE_NPU_SET_USER_DEFINED1 = 161, 978 CMD1_OPCODE_NPU_SET_USER_DEFINED2 = 162, 979 CMD1_OPCODE_NPU_SET_USER_DEFINED3 = 163, 980 CMD1_OPCODE_NPU_SET_USER_DEFINED4 = 164, 981 CMD1_OPCODE_NPU_SET_USER_DEFINED5 = 165, 982 CMD1_OPCODE_NPU_SET_USER_DEFINED6 = 166, 983 CMD1_OPCODE_NPU_SET_USER_DEFINED7 = 167, 984 }; 985 986 enum cmd_ctrl 987 { 988 CMD_CTRL_CMD0_CTRL = 0, 989 CMD_CTRL_CMD1_CTRL = 1, 990 }; 991 992 enum custom_dma_cs 993 { 994 CUSTOM_DMA_CS_DISABLE = 0, 995 CUSTOM_DMA_CS_ENABLE = 1, 996 }; 997 998 enum custom_dma 999 { 1000 CUSTOM_DMA_NOT_IMPLEMENTED = 0, 1001 CUSTOM_DMA_IMPLEMENTED = 1, 1002 }; 1003 1004 enum dma_fault_src 1005 { 1006 DMA_FAULT_SRC_AXI_M0 = 0, 1007 DMA_FAULT_SRC_AXI_M1 = 1, 1008 }; 1009 1010 enum dma_region_mode 1011 { 1012 DMA_REGION_MODE_EXTERNAL = 0, 1013 DMA_REGION_MODE_INTERNAL = 1, 1014 }; 1015 1016 enum dma_stride_mode 1017 { 1018 DMA_STRIDE_MODE_D1 = 0, 1019 }; 1020 1021 enum elementwise_mode 1022 { 1023 ELEMENTWISE_MODE_MUL = 0, 1024 ELEMENTWISE_MODE_ADD = 1, 1025 ELEMENTWISE_MODE_SUB = 2, 1026 ELEMENTWISE_MODE_MIN = 3, 1027 ELEMENTWISE_MODE_MAX = 4, 1028 ELEMENTWISE_MODE_LRELU = 5, 1029 ELEMENTWISE_MODE_ABS = 6, 1030 ELEMENTWISE_MODE_CLZ = 7, 1031 ELEMENTWISE_MODE_SHR = 8, 1032 ELEMENTWISE_MODE_SHL = 9, 1033 }; 1034 1035 enum functional_safety 1036 { 1037 FUNCTIONAL_SAFETY_NOT_IMPLEMENTED = 0, 1038 FUNCTIONAL_SAFETY_IMPLEMENTED = 1, 1039 }; 1040 1041 enum ifm2_operand_order 1042 { 1043 IFM2_OPERAND_ORDER_ORDER_B = 0, 1044 IFM2_OPERAND_ORDER_ORDER_A = 1, 1045 }; 1046 1047 enum ifm_scale_mode 1048 { 1049 IFM_SCALE_MODE_OPA_OPB_16 = 0, 1050 IFM_SCALE_MODE_OPA_32 = 1, 1051 IFM_SCALE_MODE_OPB_32 = 2, 1052 }; 1053 1054 enum ifm_upscale_mode 1055 { 1056 IFM_UPSCALE_MODE_NONE = 0, 1057 IFM_UPSCALE_MODE_NEAREST = 1, 1058 IFM_UPSCALE_MODE_ZEROS = 2, 1059 }; 1060 1061 enum kernel_decomposition 1062 { 1063 KERNEL_DECOMPOSITION_D8X8 = 0, 1064 KERNEL_DECOMPOSITION_D4X4 = 1, 1065 }; 1066 1067 enum kernel_dilation 1068 { 1069 KERNEL_DILATION_NONE = 0, 1070 KERNEL_DILATION_X2 = 1, 1071 }; 1072 1073 enum max_beats 1074 { 1075 MAX_BEATS_B64 = 0, 1076 MAX_BEATS_B128 = 1, 1077 MAX_BEATS_B256 = 2, 1078 }; 1079 1080 enum mem_attr 1081 { 1082 MEM_ATTR_AXI0_OUTSTANDING_COUNTER0 = 0, 1083 MEM_ATTR_AXI0_OUTSTANDING_COUNTER1 = 1, 1084 MEM_ATTR_AXI1_OUTSTANDING_COUNTER2 = 2, 1085 MEM_ATTR_AXI1_OUTSTANDING_COUNTER3 = 3, 1086 }; 1087 1088 enum ofm_scale_mode 1089 { 1090 OFM_SCALE_MODE_PER_CHANNEL = 0, 1091 OFM_SCALE_MODE_GLOBAL = 1, 1092 }; 1093 1094 enum pmu_axi_channel 1095 { 1096 PMU_AXI_CHANNEL_RD_CMD = 0, 1097 PMU_AXI_CHANNEL_RD_IFM = 1, 1098 PMU_AXI_CHANNEL_RD_WEIGHTS = 2, 1099 PMU_AXI_CHANNEL_RD_SCALE_BIAS = 3, 1100 PMU_AXI_CHANNEL_RD_MEM2MEM = 4, 1101 PMU_AXI_CHANNEL_WR_OFM = 8, 1102 PMU_AXI_CHANNEL_WR_MEM2MEM = 9, 1103 }; 1104 1105 enum pmu_event 1106 { 1107 PMU_EVENT_NO_EVENT = 0, 1108 PMU_EVENT_CYCLE = 17, 1109 PMU_EVENT_NPU_IDLE = 32, 1110 PMU_EVENT_CC_STALLED_ON_BLOCKDEP = 33, 1111 PMU_EVENT_CC_STALLED_ON_SHRAM_RECONFIG = 34, 1112 PMU_EVENT_NPU_ACTIVE = 35, 1113 PMU_EVENT_MAC_ACTIVE = 48, 1114 PMU_EVENT_MAC_ACTIVE_8BIT = 49, 1115 PMU_EVENT_MAC_ACTIVE_16BIT = 50, 1116 PMU_EVENT_MAC_DPU_ACTIVE = 51, 1117 PMU_EVENT_MAC_STALLED_BY_WD_ACC = 52, 1118 PMU_EVENT_MAC_STALLED_BY_WD = 53, 1119 PMU_EVENT_MAC_STALLED_BY_ACC = 54, 1120 PMU_EVENT_MAC_STALLED_BY_IB = 55, 1121 PMU_EVENT_MAC_ACTIVE_32BIT = 56, 1122 PMU_EVENT_MAC_STALLED_BY_INT_W = 57, 1123 PMU_EVENT_MAC_STALLED_BY_INT_ACC = 58, 1124 PMU_EVENT_AO_ACTIVE = 64, 1125 PMU_EVENT_AO_ACTIVE_8BIT = 65, 1126 PMU_EVENT_AO_ACTIVE_16BIT = 66, 1127 PMU_EVENT_AO_STALLED_BY_OFMP_OB = 67, 1128 PMU_EVENT_AO_STALLED_BY_OFMP = 68, 1129 PMU_EVENT_AO_STALLED_BY_OB = 69, 1130 PMU_EVENT_AO_STALLED_BY_ACC_IB = 70, 1131 PMU_EVENT_AO_STALLED_BY_ACC = 71, 1132 PMU_EVENT_AO_STALLED_BY_IB = 72, 1133 PMU_EVENT_WD_ACTIVE = 80, 1134 PMU_EVENT_WD_STALLED = 81, 1135 PMU_EVENT_WD_STALLED_BY_WS = 82, 1136 PMU_EVENT_WD_STALLED_BY_WD_BUF = 83, 1137 PMU_EVENT_WD_PARSE_ACTIVE = 84, 1138 PMU_EVENT_WD_PARSE_STALLED = 85, 1139 PMU_EVENT_WD_PARSE_STALLED_IN = 86, 1140 PMU_EVENT_WD_PARSE_STALLED_OUT = 87, 1141 PMU_EVENT_WD_TRANS_WS = 88, 1142 PMU_EVENT_WD_TRANS_WB = 89, 1143 PMU_EVENT_WD_TRANS_DW0 = 90, 1144 PMU_EVENT_WD_TRANS_DW1 = 91, 1145 PMU_EVENT_AXI0_RD_TRANS_ACCEPTED = 128, 1146 PMU_EVENT_AXI0_RD_TRANS_COMPLETED = 129, 1147 PMU_EVENT_AXI0_RD_DATA_BEAT_RECEIVED = 130, 1148 PMU_EVENT_AXI0_RD_TRAN_REQ_STALLED = 131, 1149 PMU_EVENT_AXI0_WR_TRANS_ACCEPTED = 132, 1150 PMU_EVENT_AXI0_WR_TRANS_COMPLETED_M = 133, 1151 PMU_EVENT_AXI0_WR_TRANS_COMPLETED_S = 134, 1152 PMU_EVENT_AXI0_WR_DATA_BEAT_WRITTEN = 135, 1153 PMU_EVENT_AXI0_WR_TRAN_REQ_STALLED = 136, 1154 PMU_EVENT_AXI0_WR_DATA_BEAT_STALLED = 137, 1155 PMU_EVENT_AXI0_ENABLED_CYCLES = 140, 1156 PMU_EVENT_AXI0_RD_STALL_LIMIT = 142, 1157 PMU_EVENT_AXI0_WR_STALL_LIMIT = 143, 1158 PMU_EVENT_AXI_LATENCY_ANY = 160, 1159 PMU_EVENT_AXI_LATENCY_32 = 161, 1160 PMU_EVENT_AXI_LATENCY_64 = 162, 1161 PMU_EVENT_AXI_LATENCY_128 = 163, 1162 PMU_EVENT_AXI_LATENCY_256 = 164, 1163 PMU_EVENT_AXI_LATENCY_512 = 165, 1164 PMU_EVENT_AXI_LATENCY_1024 = 166, 1165 PMU_EVENT_ECC_DMA = 176, 1166 PMU_EVENT_ECC_SB0 = 177, 1167 PMU_EVENT_AXI1_RD_TRANS_ACCEPTED = 384, 1168 PMU_EVENT_AXI1_RD_TRANS_COMPLETED = 385, 1169 PMU_EVENT_AXI1_RD_DATA_BEAT_RECEIVED = 386, 1170 PMU_EVENT_AXI1_RD_TRAN_REQ_STALLED = 387, 1171 PMU_EVENT_AXI1_WR_TRANS_ACCEPTED = 388, 1172 PMU_EVENT_AXI1_WR_TRANS_COMPLETED_M = 389, 1173 PMU_EVENT_AXI1_WR_TRANS_COMPLETED_S = 390, 1174 PMU_EVENT_AXI1_WR_DATA_BEAT_WRITTEN = 391, 1175 PMU_EVENT_AXI1_WR_TRAN_REQ_STALLED = 392, 1176 PMU_EVENT_AXI1_WR_DATA_BEAT_STALLED = 393, 1177 PMU_EVENT_AXI1_ENABLED_CYCLES = 396, 1178 PMU_EVENT_AXI1_RD_STALL_LIMIT = 398, 1179 PMU_EVENT_AXI1_WR_STALL_LIMIT = 399, 1180 PMU_EVENT_ECC_SB1 = 433, 1181 }; 1182 1183 enum pooling_mode 1184 { 1185 POOLING_MODE_MAX = 0, 1186 POOLING_MODE_AVERAGE = 1, 1187 POOLING_MODE_REDUCE_SUM = 2, 1188 }; 1189 1190 enum privilege_level 1191 { 1192 PRIVILEGE_LEVEL_USER = 0, 1193 PRIVILEGE_LEVEL_PRIVILEGED = 1, 1194 }; 1195 1196 enum round_mode 1197 { 1198 ROUND_MODE_DBL = 0, 1199 ROUND_MODE_TRUNCATE = 1, 1200 ROUND_MODE_NATURAL = 2, 1201 }; 1202 1203 enum security_level 1204 { 1205 SECURITY_LEVEL_SECURE = 0, 1206 SECURITY_LEVEL_NON_SECURE = 1, 1207 }; 1208 1209 enum state 1210 { 1211 STATE_STOPPED = 0, 1212 STATE_RUNNING = 1, 1213 }; 1214 1215 enum wd_core_slice_state 1216 { 1217 WD_CORE_SLICE_STATE_HEADER = 0, 1218 WD_CORE_SLICE_STATE_PALETTE = 1, 1219 WD_CORE_SLICE_STATE_WEIGHTS = 2, 1220 }; 1221 1222 enum wd_ctrl_state 1223 { 1224 WD_CTRL_STATE_IDLE = 0, 1225 WD_CTRL_STATE_DRAIN = 1, 1226 WD_CTRL_STATE_OFD_INIT = 2, 1227 WD_CTRL_STATE_OFD_RUN = 3, 1228 }; 1229 1230 enum weight_order 1231 { 1232 WEIGHT_ORDER_DEPTH_FIRST = 0, 1233 WEIGHT_ORDER_PART_KERNEL_FIRST = 1, 1234 }; 1235 1236 #endif 1237 1238 #ifdef NPU_DISASSEMBLE 1239 1240 static const char *acc_format_str[] = { 1241 "ACC_FORMAT_I32", 1242 "ACC_FORMAT_I40", 1243 "ACC_FORMAT_F16", 1244 }; 1245 1246 static const char *activation_clip_range_str[] = { 1247 "ACTIVATION_CLIP_RANGE_OFM_PRECISION", 1248 "****", 1249 "ACTIVATION_CLIP_RANGE_FORCE_UINT8", 1250 "ACTIVATION_CLIP_RANGE_FORCE_INT8", 1251 "****", 1252 "ACTIVATION_CLIP_RANGE_FORCE_INT16", 1253 }; 1254 1255 static const char *activation_format_str[] = { 1256 "ACTIVATION_FORMAT_NHWC", 1257 "ACTIVATION_FORMAT_NHCWB16", 1258 }; 1259 1260 static const char *activation_function_str[] = { 1261 "ACTIVATION_FUNCTION_RELU", 1262 "****", 1263 "****", 1264 "ACTIVATION_FUNCTION_TANH", 1265 "ACTIVATION_FUNCTION_SIGMOID", 1266 "****", 1267 "****", 1268 "****", 1269 "****", 1270 "****", 1271 "****", 1272 "****", 1273 "****", 1274 "****", 1275 "****", 1276 "****", 1277 "ACTIVATION_FUNCTION_TABLE_0", 1278 "ACTIVATION_FUNCTION_TABLE_1", 1279 "ACTIVATION_FUNCTION_TABLE_2", 1280 "ACTIVATION_FUNCTION_TABLE_3", 1281 "ACTIVATION_FUNCTION_TABLE_4", 1282 "ACTIVATION_FUNCTION_TABLE_5", 1283 "ACTIVATION_FUNCTION_TABLE_6", 1284 "ACTIVATION_FUNCTION_TABLE_7", 1285 }; 1286 1287 static const char *activation_precision_str[] = { 1288 "ACTIVATION_PRECISION_B8", 1289 "ACTIVATION_PRECISION_B16", 1290 "ACTIVATION_PRECISION_B32", 1291 "ACTIVATION_PRECISION_B64", 1292 }; 1293 1294 static const char *activation_type_str[] = { 1295 "ACTIVATION_TYPE_UNSIGNED", 1296 "ACTIVATION_TYPE_SIGNED", 1297 }; 1298 1299 static const char *axi_mem_encoding_str[] = { 1300 "AXI_MEM_ENCODING_DEVICE_NON_BUFFERABLE", 1301 "AXI_MEM_ENCODING_DEVICE_BUFFERABLE", 1302 "AXI_MEM_ENCODING_NORMAL_NON_CACHEABLE_NON_BUFFERABLE", 1303 "AXI_MEM_ENCODING_NORMAL_NON_CACHEABLE_BUFFERABLE", 1304 "AXI_MEM_ENCODING_WRITE_THROUGH_NO_ALLOCATE", 1305 "AXI_MEM_ENCODING_WRITE_THROUGH_READ_ALLOCATE", 1306 "AXI_MEM_ENCODING_WRITE_THROUGH_WRITE_ALLOCATE", 1307 "AXI_MEM_ENCODING_WRITE_THROUGH_READ_AND_WRITE_ALLOCATE", 1308 "AXI_MEM_ENCODING_WRITE_BACK_NO_ALLOCATE", 1309 "AXI_MEM_ENCODING_WRITE_BACK_READ_ALLOCATE", 1310 "AXI_MEM_ENCODING_WRITE_BACK_WRITE_ALLOCATE", 1311 "AXI_MEM_ENCODING_WRITE_BACK_READ_AND_WRITE_ALLOCATE", 1312 }; 1313 1314 static const char *broadcast_mode_str[] = { 1315 "BROADCAST_MODE_DISABLE", 1316 "BROADCAST_MODE_ENABLE", 1317 }; 1318 1319 static const char *cmd0_opcode_str[] = { 1320 "CMD0_OPCODE_NPU_OP_STOP", 1321 "CMD0_OPCODE_NPU_OP_IRQ", 1322 "CMD0_OPCODE_NPU_OP_CONV", 1323 "CMD0_OPCODE_NPU_OP_DEPTHWISE", 1324 "****", 1325 "CMD0_OPCODE_NPU_OP_POOL", 1326 "CMD0_OPCODE_NPU_OP_ELEMENTWISE", 1327 "****", 1328 "****", 1329 "****", 1330 "****", 1331 "****", 1332 "****", 1333 "****", 1334 "****", 1335 "****", 1336 "CMD0_OPCODE_NPU_OP_DMA_START", 1337 "CMD0_OPCODE_NPU_OP_DMA_WAIT", 1338 "CMD0_OPCODE_NPU_OP_KERNEL_WAIT", 1339 "CMD0_OPCODE_NPU_OP_PMU_MASK", 1340 "****", 1341 "****", 1342 "****", 1343 "****", 1344 "****", 1345 "****", 1346 "****", 1347 "****", 1348 "****", 1349 "****", 1350 "****", 1351 "****", 1352 "****", 1353 "****", 1354 "****", 1355 "****", 1356 "****", 1357 "****", 1358 "****", 1359 "****", 1360 "****", 1361 "****", 1362 "****", 1363 "****", 1364 "****", 1365 "****", 1366 "****", 1367 "****", 1368 "****", 1369 "****", 1370 "****", 1371 "****", 1372 "****", 1373 "****", 1374 "****", 1375 "****", 1376 "****", 1377 "****", 1378 "****", 1379 "****", 1380 "****", 1381 "****", 1382 "****", 1383 "****", 1384 "****", 1385 "****", 1386 "****", 1387 "****", 1388 "****", 1389 "****", 1390 "****", 1391 "****", 1392 "****", 1393 "****", 1394 "****", 1395 "****", 1396 "****", 1397 "****", 1398 "****", 1399 "****", 1400 "****", 1401 "****", 1402 "****", 1403 "****", 1404 "****", 1405 "****", 1406 "****", 1407 "****", 1408 "****", 1409 "****", 1410 "****", 1411 "****", 1412 "****", 1413 "****", 1414 "****", 1415 "****", 1416 "****", 1417 "****", 1418 "****", 1419 "****", 1420 "****", 1421 "****", 1422 "****", 1423 "****", 1424 "****", 1425 "****", 1426 "****", 1427 "****", 1428 "****", 1429 "****", 1430 "****", 1431 "****", 1432 "****", 1433 "****", 1434 "****", 1435 "****", 1436 "****", 1437 "****", 1438 "****", 1439 "****", 1440 "****", 1441 "****", 1442 "****", 1443 "****", 1444 "****", 1445 "****", 1446 "****", 1447 "****", 1448 "****", 1449 "****", 1450 "****", 1451 "****", 1452 "****", 1453 "****", 1454 "****", 1455 "****", 1456 "****", 1457 "****", 1458 "****", 1459 "****", 1460 "****", 1461 "****", 1462 "****", 1463 "****", 1464 "****", 1465 "****", 1466 "****", 1467 "****", 1468 "****", 1469 "****", 1470 "****", 1471 "****", 1472 "****", 1473 "****", 1474 "****", 1475 "****", 1476 "****", 1477 "****", 1478 "****", 1479 "****", 1480 "****", 1481 "****", 1482 "****", 1483 "****", 1484 "****", 1485 "****", 1486 "****", 1487 "****", 1488 "****", 1489 "****", 1490 "****", 1491 "****", 1492 "****", 1493 "****", 1494 "****", 1495 "****", 1496 "****", 1497 "****", 1498 "****", 1499 "****", 1500 "****", 1501 "****", 1502 "****", 1503 "****", 1504 "****", 1505 "****", 1506 "****", 1507 "****", 1508 "****", 1509 "****", 1510 "****", 1511 "****", 1512 "****", 1513 "****", 1514 "****", 1515 "****", 1516 "****", 1517 "****", 1518 "****", 1519 "****", 1520 "****", 1521 "****", 1522 "****", 1523 "****", 1524 "****", 1525 "****", 1526 "****", 1527 "****", 1528 "****", 1529 "****", 1530 "****", 1531 "****", 1532 "****", 1533 "****", 1534 "****", 1535 "****", 1536 "****", 1537 "****", 1538 "****", 1539 "****", 1540 "****", 1541 "****", 1542 "****", 1543 "****", 1544 "****", 1545 "****", 1546 "****", 1547 "****", 1548 "****", 1549 "****", 1550 "****", 1551 "****", 1552 "****", 1553 "****", 1554 "****", 1555 "****", 1556 "****", 1557 "****", 1558 "****", 1559 "****", 1560 "****", 1561 "****", 1562 "****", 1563 "****", 1564 "****", 1565 "****", 1566 "****", 1567 "****", 1568 "****", 1569 "****", 1570 "****", 1571 "****", 1572 "****", 1573 "****", 1574 "****", 1575 "****", 1576 "CMD0_OPCODE_NPU_SET_IFM_PAD_TOP", 1577 "CMD0_OPCODE_NPU_SET_IFM_PAD_LEFT", 1578 "CMD0_OPCODE_NPU_SET_IFM_PAD_RIGHT", 1579 "CMD0_OPCODE_NPU_SET_IFM_PAD_BOTTOM", 1580 "CMD0_OPCODE_NPU_SET_IFM_DEPTH_M1", 1581 "CMD0_OPCODE_NPU_SET_IFM_PRECISION", 1582 "****", 1583 "CMD0_OPCODE_NPU_SET_IFM_UPSCALE", 1584 "****", 1585 "CMD0_OPCODE_NPU_SET_IFM_ZERO_POINT", 1586 "CMD0_OPCODE_NPU_SET_IFM_WIDTH0_M1", 1587 "CMD0_OPCODE_NPU_SET_IFM_HEIGHT0_M1", 1588 "CMD0_OPCODE_NPU_SET_IFM_HEIGHT1_M1", 1589 "CMD0_OPCODE_NPU_SET_IFM_IB_END", 1590 "****", 1591 "CMD0_OPCODE_NPU_SET_IFM_REGION", 1592 "****", 1593 "CMD0_OPCODE_NPU_SET_OFM_WIDTH_M1", 1594 "CMD0_OPCODE_NPU_SET_OFM_HEIGHT_M1", 1595 "CMD0_OPCODE_NPU_SET_OFM_DEPTH_M1", 1596 "CMD0_OPCODE_NPU_SET_OFM_PRECISION", 1597 "CMD0_OPCODE_NPU_SET_OFM_BLK_WIDTH_M1", 1598 "CMD0_OPCODE_NPU_SET_OFM_BLK_HEIGHT_M1", 1599 "CMD0_OPCODE_NPU_SET_OFM_BLK_DEPTH_M1", 1600 "CMD0_OPCODE_NPU_SET_OFM_ZERO_POINT", 1601 "****", 1602 "CMD0_OPCODE_NPU_SET_OFM_WIDTH0_M1", 1603 "CMD0_OPCODE_NPU_SET_OFM_HEIGHT0_M1", 1604 "CMD0_OPCODE_NPU_SET_OFM_HEIGHT1_M1", 1605 "****", 1606 "****", 1607 "CMD0_OPCODE_NPU_SET_OFM_REGION", 1608 "CMD0_OPCODE_NPU_SET_KERNEL_WIDTH_M1", 1609 "CMD0_OPCODE_NPU_SET_KERNEL_HEIGHT_M1", 1610 "CMD0_OPCODE_NPU_SET_KERNEL_STRIDE", 1611 "****", 1612 "CMD0_OPCODE_NPU_SET_ACC_FORMAT", 1613 "CMD0_OPCODE_NPU_SET_ACTIVATION", 1614 "CMD0_OPCODE_NPU_SET_ACTIVATION_MIN", 1615 "CMD0_OPCODE_NPU_SET_ACTIVATION_MAX", 1616 "CMD0_OPCODE_NPU_SET_WEIGHT_REGION", 1617 "CMD0_OPCODE_NPU_SET_SCALE_REGION", 1618 "****", 1619 "****", 1620 "****", 1621 "CMD0_OPCODE_NPU_SET_AB_START", 1622 "****", 1623 "CMD0_OPCODE_NPU_SET_BLOCKDEP", 1624 "CMD0_OPCODE_NPU_SET_DMA0_SRC_REGION", 1625 "CMD0_OPCODE_NPU_SET_DMA0_DST_REGION", 1626 "CMD0_OPCODE_NPU_SET_DMA0_SIZE0", 1627 "CMD0_OPCODE_NPU_SET_DMA0_SIZE1", 1628 "****", 1629 "****", 1630 "****", 1631 "****", 1632 "****", 1633 "****", 1634 "****", 1635 "****", 1636 "****", 1637 "****", 1638 "****", 1639 "****", 1640 "****", 1641 "****", 1642 "****", 1643 "****", 1644 "****", 1645 "****", 1646 "****", 1647 "****", 1648 "****", 1649 "****", 1650 "****", 1651 "****", 1652 "****", 1653 "****", 1654 "****", 1655 "****", 1656 "****", 1657 "****", 1658 "****", 1659 "****", 1660 "****", 1661 "****", 1662 "****", 1663 "****", 1664 "****", 1665 "****", 1666 "****", 1667 "****", 1668 "****", 1669 "****", 1670 "****", 1671 "****", 1672 "****", 1673 "****", 1674 "****", 1675 "****", 1676 "****", 1677 "****", 1678 "****", 1679 "****", 1680 "****", 1681 "****", 1682 "****", 1683 "****", 1684 "****", 1685 "****", 1686 "****", 1687 "****", 1688 "****", 1689 "****", 1690 "****", 1691 "****", 1692 "****", 1693 "****", 1694 "****", 1695 "****", 1696 "****", 1697 "****", 1698 "****", 1699 "****", 1700 "****", 1701 "****", 1702 "****", 1703 "****", 1704 "CMD0_OPCODE_NPU_SET_IFM2_BROADCAST", 1705 "CMD0_OPCODE_NPU_SET_IFM2_SCALAR", 1706 "****", 1707 "****", 1708 "****", 1709 "CMD0_OPCODE_NPU_SET_IFM2_PRECISION", 1710 "****", 1711 "****", 1712 "****", 1713 "CMD0_OPCODE_NPU_SET_IFM2_ZERO_POINT", 1714 "CMD0_OPCODE_NPU_SET_IFM2_WIDTH0_M1", 1715 "CMD0_OPCODE_NPU_SET_IFM2_HEIGHT0_M1", 1716 "CMD0_OPCODE_NPU_SET_IFM2_HEIGHT1_M1", 1717 "CMD0_OPCODE_NPU_SET_IFM2_IB_START", 1718 "****", 1719 "CMD0_OPCODE_NPU_SET_IFM2_REGION", 1720 }; 1721 1722 static const char *cmd1_opcode_str[] = { 1723 "CMD1_OPCODE_NPU_SET_IFM_BASE0", 1724 "CMD1_OPCODE_NPU_SET_IFM_BASE1", 1725 "CMD1_OPCODE_NPU_SET_IFM_BASE2", 1726 "CMD1_OPCODE_NPU_SET_IFM_BASE3", 1727 "CMD1_OPCODE_NPU_SET_IFM_STRIDE_X", 1728 "CMD1_OPCODE_NPU_SET_IFM_STRIDE_Y", 1729 "CMD1_OPCODE_NPU_SET_IFM_STRIDE_C", 1730 "****", 1731 "****", 1732 "****", 1733 "****", 1734 "****", 1735 "****", 1736 "****", 1737 "****", 1738 "****", 1739 "CMD1_OPCODE_NPU_SET_OFM_BASE0", 1740 "CMD1_OPCODE_NPU_SET_OFM_BASE1", 1741 "CMD1_OPCODE_NPU_SET_OFM_BASE2", 1742 "CMD1_OPCODE_NPU_SET_OFM_BASE3", 1743 "CMD1_OPCODE_NPU_SET_OFM_STRIDE_X", 1744 "CMD1_OPCODE_NPU_SET_OFM_STRIDE_Y", 1745 "CMD1_OPCODE_NPU_SET_OFM_STRIDE_C", 1746 "****", 1747 "****", 1748 "****", 1749 "****", 1750 "****", 1751 "****", 1752 "****", 1753 "****", 1754 "****", 1755 "CMD1_OPCODE_NPU_SET_WEIGHT_BASE", 1756 "CMD1_OPCODE_NPU_SET_WEIGHT_LENGTH", 1757 "CMD1_OPCODE_NPU_SET_SCALE_BASE", 1758 "CMD1_OPCODE_NPU_SET_SCALE_LENGTH", 1759 "CMD1_OPCODE_NPU_SET_OFM_SCALE", 1760 "CMD1_OPCODE_NPU_SET_OPA_SCALE", 1761 "CMD1_OPCODE_NPU_SET_OPB_SCALE", 1762 "****", 1763 "****", 1764 "****", 1765 "****", 1766 "****", 1767 "****", 1768 "****", 1769 "****", 1770 "****", 1771 "CMD1_OPCODE_NPU_SET_DMA0_SRC", 1772 "CMD1_OPCODE_NPU_SET_DMA0_DST", 1773 "CMD1_OPCODE_NPU_SET_DMA0_LEN", 1774 "****", 1775 "****", 1776 "****", 1777 "****", 1778 "****", 1779 "****", 1780 "****", 1781 "****", 1782 "****", 1783 "****", 1784 "****", 1785 "****", 1786 "****", 1787 "****", 1788 "****", 1789 "****", 1790 "****", 1791 "****", 1792 "****", 1793 "****", 1794 "****", 1795 "****", 1796 "****", 1797 "****", 1798 "****", 1799 "****", 1800 "****", 1801 "****", 1802 "****", 1803 "****", 1804 "****", 1805 "****", 1806 "****", 1807 "****", 1808 "****", 1809 "****", 1810 "****", 1811 "****", 1812 "****", 1813 "****", 1814 "****", 1815 "****", 1816 "****", 1817 "****", 1818 "****", 1819 "****", 1820 "****", 1821 "****", 1822 "****", 1823 "****", 1824 "****", 1825 "****", 1826 "****", 1827 "****", 1828 "****", 1829 "****", 1830 "****", 1831 "****", 1832 "****", 1833 "****", 1834 "****", 1835 "****", 1836 "****", 1837 "****", 1838 "****", 1839 "****", 1840 "****", 1841 "****", 1842 "****", 1843 "****", 1844 "****", 1845 "****", 1846 "****", 1847 "****", 1848 "****", 1849 "****", 1850 "****", 1851 "CMD1_OPCODE_NPU_SET_IFM2_BASE0", 1852 "CMD1_OPCODE_NPU_SET_IFM2_BASE1", 1853 "CMD1_OPCODE_NPU_SET_IFM2_BASE2", 1854 "CMD1_OPCODE_NPU_SET_IFM2_BASE3", 1855 "CMD1_OPCODE_NPU_SET_IFM2_STRIDE_X", 1856 "CMD1_OPCODE_NPU_SET_IFM2_STRIDE_Y", 1857 "CMD1_OPCODE_NPU_SET_IFM2_STRIDE_C", 1858 "****", 1859 "****", 1860 "****", 1861 "****", 1862 "****", 1863 "****", 1864 "****", 1865 "****", 1866 "****", 1867 "****", 1868 "****", 1869 "****", 1870 "****", 1871 "****", 1872 "****", 1873 "****", 1874 "****", 1875 "****", 1876 "****", 1877 "****", 1878 "****", 1879 "****", 1880 "****", 1881 "****", 1882 "****", 1883 "CMD1_OPCODE_NPU_SET_USER_DEFINED0", 1884 "CMD1_OPCODE_NPU_SET_USER_DEFINED1", 1885 "CMD1_OPCODE_NPU_SET_USER_DEFINED2", 1886 "CMD1_OPCODE_NPU_SET_USER_DEFINED3", 1887 "CMD1_OPCODE_NPU_SET_USER_DEFINED4", 1888 "CMD1_OPCODE_NPU_SET_USER_DEFINED5", 1889 "CMD1_OPCODE_NPU_SET_USER_DEFINED6", 1890 "CMD1_OPCODE_NPU_SET_USER_DEFINED7", 1891 }; 1892 1893 static const char *cmd_ctrl_str[] = { 1894 "CMD_CTRL_CMD0_CTRL", 1895 "CMD_CTRL_CMD1_CTRL", 1896 }; 1897 1898 static const char *custom_dma_cs_str[] = { 1899 "CUSTOM_DMA_CS_DISABLE", 1900 "CUSTOM_DMA_CS_ENABLE", 1901 }; 1902 1903 static const char *custom_dma_str[] = { 1904 "CUSTOM_DMA_NOT_IMPLEMENTED", 1905 "CUSTOM_DMA_IMPLEMENTED", 1906 }; 1907 1908 static const char *dma_fault_src_str[] = { 1909 "DMA_FAULT_SRC_AXI_M0", 1910 "DMA_FAULT_SRC_AXI_M1", 1911 }; 1912 1913 static const char *dma_region_mode_str[] = { 1914 "DMA_REGION_MODE_EXTERNAL", 1915 "DMA_REGION_MODE_INTERNAL", 1916 }; 1917 1918 static const char *dma_stride_mode_str[] = { 1919 "DMA_STRIDE_MODE_D1", 1920 }; 1921 1922 static const char *elementwise_mode_str[] = { 1923 "ELEMENTWISE_MODE_MUL", 1924 "ELEMENTWISE_MODE_ADD", 1925 "ELEMENTWISE_MODE_SUB", 1926 "ELEMENTWISE_MODE_MIN", 1927 "ELEMENTWISE_MODE_MAX", 1928 "ELEMENTWISE_MODE_LRELU", 1929 "ELEMENTWISE_MODE_ABS", 1930 "ELEMENTWISE_MODE_CLZ", 1931 "ELEMENTWISE_MODE_SHR", 1932 "ELEMENTWISE_MODE_SHL", 1933 }; 1934 1935 static const char *functional_safety_str[] = { 1936 "FUNCTIONAL_SAFETY_NOT_IMPLEMENTED", 1937 "FUNCTIONAL_SAFETY_IMPLEMENTED", 1938 }; 1939 1940 static const char *ifm2_operand_order_str[] = { 1941 "IFM2_OPERAND_ORDER_ORDER_B", 1942 "IFM2_OPERAND_ORDER_ORDER_A", 1943 }; 1944 1945 static const char *ifm_scale_mode_str[] = { 1946 "IFM_SCALE_MODE_OPA_OPB_16", 1947 "IFM_SCALE_MODE_OPA_32", 1948 "IFM_SCALE_MODE_OPB_32", 1949 }; 1950 1951 static const char *ifm_upscale_mode_str[] = { 1952 "IFM_UPSCALE_MODE_NONE", 1953 "IFM_UPSCALE_MODE_NEAREST", 1954 "IFM_UPSCALE_MODE_ZEROS", 1955 }; 1956 1957 static const char *kernel_decomposition_str[] = { 1958 "KERNEL_DECOMPOSITION_D8X8", 1959 "KERNEL_DECOMPOSITION_D4X4", 1960 }; 1961 1962 static const char *kernel_dilation_str[] = { 1963 "KERNEL_DILATION_NONE", 1964 "KERNEL_DILATION_X2", 1965 }; 1966 1967 static const char *max_beats_str[] = { 1968 "MAX_BEATS_B64", 1969 "MAX_BEATS_B128", 1970 "MAX_BEATS_B256", 1971 }; 1972 1973 static const char *mem_attr_str[] = { 1974 "MEM_ATTR_AXI0_OUTSTANDING_COUNTER0", 1975 "MEM_ATTR_AXI0_OUTSTANDING_COUNTER1", 1976 "MEM_ATTR_AXI1_OUTSTANDING_COUNTER2", 1977 "MEM_ATTR_AXI1_OUTSTANDING_COUNTER3", 1978 }; 1979 1980 static const char *ofm_scale_mode_str[] = { 1981 "OFM_SCALE_MODE_PER_CHANNEL", 1982 "OFM_SCALE_MODE_GLOBAL", 1983 }; 1984 1985 static const char *pmu_axi_channel_str[] = { 1986 "PMU_AXI_CHANNEL_RD_CMD", 1987 "PMU_AXI_CHANNEL_RD_IFM", 1988 "PMU_AXI_CHANNEL_RD_WEIGHTS", 1989 "PMU_AXI_CHANNEL_RD_SCALE_BIAS", 1990 "PMU_AXI_CHANNEL_RD_MEM2MEM", 1991 "****", 1992 "****", 1993 "****", 1994 "PMU_AXI_CHANNEL_WR_OFM", 1995 "PMU_AXI_CHANNEL_WR_MEM2MEM", 1996 }; 1997 1998 static const char *pmu_event_str[] = { 1999 "PMU_EVENT_NO_EVENT", 2000 "****", 2001 "****", 2002 "****", 2003 "****", 2004 "****", 2005 "****", 2006 "****", 2007 "****", 2008 "****", 2009 "****", 2010 "****", 2011 "****", 2012 "****", 2013 "****", 2014 "****", 2015 "****", 2016 "PMU_EVENT_CYCLE", 2017 "****", 2018 "****", 2019 "****", 2020 "****", 2021 "****", 2022 "****", 2023 "****", 2024 "****", 2025 "****", 2026 "****", 2027 "****", 2028 "****", 2029 "****", 2030 "****", 2031 "PMU_EVENT_NPU_IDLE", 2032 "PMU_EVENT_CC_STALLED_ON_BLOCKDEP", 2033 "PMU_EVENT_CC_STALLED_ON_SHRAM_RECONFIG", 2034 "PMU_EVENT_NPU_ACTIVE", 2035 "****", 2036 "****", 2037 "****", 2038 "****", 2039 "****", 2040 "****", 2041 "****", 2042 "****", 2043 "****", 2044 "****", 2045 "****", 2046 "****", 2047 "PMU_EVENT_MAC_ACTIVE", 2048 "PMU_EVENT_MAC_ACTIVE_8BIT", 2049 "PMU_EVENT_MAC_ACTIVE_16BIT", 2050 "PMU_EVENT_MAC_DPU_ACTIVE", 2051 "PMU_EVENT_MAC_STALLED_BY_WD_ACC", 2052 "PMU_EVENT_MAC_STALLED_BY_WD", 2053 "PMU_EVENT_MAC_STALLED_BY_ACC", 2054 "PMU_EVENT_MAC_STALLED_BY_IB", 2055 "PMU_EVENT_MAC_ACTIVE_32BIT", 2056 "PMU_EVENT_MAC_STALLED_BY_INT_W", 2057 "PMU_EVENT_MAC_STALLED_BY_INT_ACC", 2058 "****", 2059 "****", 2060 "****", 2061 "****", 2062 "****", 2063 "PMU_EVENT_AO_ACTIVE", 2064 "PMU_EVENT_AO_ACTIVE_8BIT", 2065 "PMU_EVENT_AO_ACTIVE_16BIT", 2066 "PMU_EVENT_AO_STALLED_BY_OFMP_OB", 2067 "PMU_EVENT_AO_STALLED_BY_OFMP", 2068 "PMU_EVENT_AO_STALLED_BY_OB", 2069 "PMU_EVENT_AO_STALLED_BY_ACC_IB", 2070 "PMU_EVENT_AO_STALLED_BY_ACC", 2071 "PMU_EVENT_AO_STALLED_BY_IB", 2072 "****", 2073 "****", 2074 "****", 2075 "****", 2076 "****", 2077 "****", 2078 "****", 2079 "PMU_EVENT_WD_ACTIVE", 2080 "PMU_EVENT_WD_STALLED", 2081 "PMU_EVENT_WD_STALLED_BY_WS", 2082 "PMU_EVENT_WD_STALLED_BY_WD_BUF", 2083 "PMU_EVENT_WD_PARSE_ACTIVE", 2084 "PMU_EVENT_WD_PARSE_STALLED", 2085 "PMU_EVENT_WD_PARSE_STALLED_IN", 2086 "PMU_EVENT_WD_PARSE_STALLED_OUT", 2087 "PMU_EVENT_WD_TRANS_WS", 2088 "PMU_EVENT_WD_TRANS_WB", 2089 "PMU_EVENT_WD_TRANS_DW0", 2090 "PMU_EVENT_WD_TRANS_DW1", 2091 "****", 2092 "****", 2093 "****", 2094 "****", 2095 "****", 2096 "****", 2097 "****", 2098 "****", 2099 "****", 2100 "****", 2101 "****", 2102 "****", 2103 "****", 2104 "****", 2105 "****", 2106 "****", 2107 "****", 2108 "****", 2109 "****", 2110 "****", 2111 "****", 2112 "****", 2113 "****", 2114 "****", 2115 "****", 2116 "****", 2117 "****", 2118 "****", 2119 "****", 2120 "****", 2121 "****", 2122 "****", 2123 "****", 2124 "****", 2125 "****", 2126 "****", 2127 "PMU_EVENT_AXI0_RD_TRANS_ACCEPTED", 2128 "PMU_EVENT_AXI0_RD_TRANS_COMPLETED", 2129 "PMU_EVENT_AXI0_RD_DATA_BEAT_RECEIVED", 2130 "PMU_EVENT_AXI0_RD_TRAN_REQ_STALLED", 2131 "PMU_EVENT_AXI0_WR_TRANS_ACCEPTED", 2132 "PMU_EVENT_AXI0_WR_TRANS_COMPLETED_M", 2133 "PMU_EVENT_AXI0_WR_TRANS_COMPLETED_S", 2134 "PMU_EVENT_AXI0_WR_DATA_BEAT_WRITTEN", 2135 "PMU_EVENT_AXI0_WR_TRAN_REQ_STALLED", 2136 "PMU_EVENT_AXI0_WR_DATA_BEAT_STALLED", 2137 "****", 2138 "****", 2139 "PMU_EVENT_AXI0_ENABLED_CYCLES", 2140 "****", 2141 "PMU_EVENT_AXI0_RD_STALL_LIMIT", 2142 "PMU_EVENT_AXI0_WR_STALL_LIMIT", 2143 "****", 2144 "****", 2145 "****", 2146 "****", 2147 "****", 2148 "****", 2149 "****", 2150 "****", 2151 "****", 2152 "****", 2153 "****", 2154 "****", 2155 "****", 2156 "****", 2157 "****", 2158 "****", 2159 "PMU_EVENT_AXI_LATENCY_ANY", 2160 "PMU_EVENT_AXI_LATENCY_32", 2161 "PMU_EVENT_AXI_LATENCY_64", 2162 "PMU_EVENT_AXI_LATENCY_128", 2163 "PMU_EVENT_AXI_LATENCY_256", 2164 "PMU_EVENT_AXI_LATENCY_512", 2165 "PMU_EVENT_AXI_LATENCY_1024", 2166 "****", 2167 "****", 2168 "****", 2169 "****", 2170 "****", 2171 "****", 2172 "****", 2173 "****", 2174 "****", 2175 "PMU_EVENT_ECC_DMA", 2176 "PMU_EVENT_ECC_SB0", 2177 "****", 2178 "****", 2179 "****", 2180 "****", 2181 "****", 2182 "****", 2183 "****", 2184 "****", 2185 "****", 2186 "****", 2187 "****", 2188 "****", 2189 "****", 2190 "****", 2191 "****", 2192 "****", 2193 "****", 2194 "****", 2195 "****", 2196 "****", 2197 "****", 2198 "****", 2199 "****", 2200 "****", 2201 "****", 2202 "****", 2203 "****", 2204 "****", 2205 "****", 2206 "****", 2207 "****", 2208 "****", 2209 "****", 2210 "****", 2211 "****", 2212 "****", 2213 "****", 2214 "****", 2215 "****", 2216 "****", 2217 "****", 2218 "****", 2219 "****", 2220 "****", 2221 "****", 2222 "****", 2223 "****", 2224 "****", 2225 "****", 2226 "****", 2227 "****", 2228 "****", 2229 "****", 2230 "****", 2231 "****", 2232 "****", 2233 "****", 2234 "****", 2235 "****", 2236 "****", 2237 "****", 2238 "****", 2239 "****", 2240 "****", 2241 "****", 2242 "****", 2243 "****", 2244 "****", 2245 "****", 2246 "****", 2247 "****", 2248 "****", 2249 "****", 2250 "****", 2251 "****", 2252 "****", 2253 "****", 2254 "****", 2255 "****", 2256 "****", 2257 "****", 2258 "****", 2259 "****", 2260 "****", 2261 "****", 2262 "****", 2263 "****", 2264 "****", 2265 "****", 2266 "****", 2267 "****", 2268 "****", 2269 "****", 2270 "****", 2271 "****", 2272 "****", 2273 "****", 2274 "****", 2275 "****", 2276 "****", 2277 "****", 2278 "****", 2279 "****", 2280 "****", 2281 "****", 2282 "****", 2283 "****", 2284 "****", 2285 "****", 2286 "****", 2287 "****", 2288 "****", 2289 "****", 2290 "****", 2291 "****", 2292 "****", 2293 "****", 2294 "****", 2295 "****", 2296 "****", 2297 "****", 2298 "****", 2299 "****", 2300 "****", 2301 "****", 2302 "****", 2303 "****", 2304 "****", 2305 "****", 2306 "****", 2307 "****", 2308 "****", 2309 "****", 2310 "****", 2311 "****", 2312 "****", 2313 "****", 2314 "****", 2315 "****", 2316 "****", 2317 "****", 2318 "****", 2319 "****", 2320 "****", 2321 "****", 2322 "****", 2323 "****", 2324 "****", 2325 "****", 2326 "****", 2327 "****", 2328 "****", 2329 "****", 2330 "****", 2331 "****", 2332 "****", 2333 "****", 2334 "****", 2335 "****", 2336 "****", 2337 "****", 2338 "****", 2339 "****", 2340 "****", 2341 "****", 2342 "****", 2343 "****", 2344 "****", 2345 "****", 2346 "****", 2347 "****", 2348 "****", 2349 "****", 2350 "****", 2351 "****", 2352 "****", 2353 "****", 2354 "****", 2355 "****", 2356 "****", 2357 "****", 2358 "****", 2359 "****", 2360 "****", 2361 "****", 2362 "****", 2363 "****", 2364 "****", 2365 "****", 2366 "****", 2367 "****", 2368 "****", 2369 "****", 2370 "****", 2371 "****", 2372 "****", 2373 "****", 2374 "****", 2375 "****", 2376 "****", 2377 "****", 2378 "****", 2379 "****", 2380 "****", 2381 "****", 2382 "****", 2383 "PMU_EVENT_AXI1_RD_TRANS_ACCEPTED", 2384 "PMU_EVENT_AXI1_RD_TRANS_COMPLETED", 2385 "PMU_EVENT_AXI1_RD_DATA_BEAT_RECEIVED", 2386 "PMU_EVENT_AXI1_RD_TRAN_REQ_STALLED", 2387 "PMU_EVENT_AXI1_WR_TRANS_ACCEPTED", 2388 "PMU_EVENT_AXI1_WR_TRANS_COMPLETED_M", 2389 "PMU_EVENT_AXI1_WR_TRANS_COMPLETED_S", 2390 "PMU_EVENT_AXI1_WR_DATA_BEAT_WRITTEN", 2391 "PMU_EVENT_AXI1_WR_TRAN_REQ_STALLED", 2392 "PMU_EVENT_AXI1_WR_DATA_BEAT_STALLED", 2393 "****", 2394 "****", 2395 "PMU_EVENT_AXI1_ENABLED_CYCLES", 2396 "****", 2397 "PMU_EVENT_AXI1_RD_STALL_LIMIT", 2398 "PMU_EVENT_AXI1_WR_STALL_LIMIT", 2399 "****", 2400 "****", 2401 "****", 2402 "****", 2403 "****", 2404 "****", 2405 "****", 2406 "****", 2407 "****", 2408 "****", 2409 "****", 2410 "****", 2411 "****", 2412 "****", 2413 "****", 2414 "****", 2415 "****", 2416 "****", 2417 "****", 2418 "****", 2419 "****", 2420 "****", 2421 "****", 2422 "****", 2423 "****", 2424 "****", 2425 "****", 2426 "****", 2427 "****", 2428 "****", 2429 "****", 2430 "****", 2431 "****", 2432 "PMU_EVENT_ECC_SB1", 2433 }; 2434 2435 static const char *pooling_mode_str[] = { 2436 "POOLING_MODE_MAX", 2437 "POOLING_MODE_AVERAGE", 2438 "POOLING_MODE_REDUCE_SUM", 2439 }; 2440 2441 static const char *privilege_level_str[] = { 2442 "PRIVILEGE_LEVEL_USER", 2443 "PRIVILEGE_LEVEL_PRIVILEGED", 2444 }; 2445 2446 static const char *round_mode_str[] = { 2447 "ROUND_MODE_DBL", 2448 "ROUND_MODE_TRUNCATE", 2449 "ROUND_MODE_NATURAL", 2450 }; 2451 2452 static const char *security_level_str[] = { 2453 "SECURITY_LEVEL_SECURE", 2454 "SECURITY_LEVEL_NON_SECURE", 2455 }; 2456 2457 static const char *state_str[] = { 2458 "STATE_STOPPED", 2459 "STATE_RUNNING", 2460 }; 2461 2462 static const char *wd_core_slice_state_str[] = { 2463 "WD_CORE_SLICE_STATE_HEADER", 2464 "WD_CORE_SLICE_STATE_PALETTE", 2465 "WD_CORE_SLICE_STATE_WEIGHTS", 2466 }; 2467 2468 static const char *wd_ctrl_state_str[] = { 2469 "WD_CTRL_STATE_IDLE", 2470 "WD_CTRL_STATE_DRAIN", 2471 "WD_CTRL_STATE_OFD_INIT", 2472 "WD_CTRL_STATE_OFD_RUN", 2473 }; 2474 2475 static const char *weight_order_str[] = { 2476 "WEIGHT_ORDER_DEPTH_FIRST", 2477 "WEIGHT_ORDER_PART_KERNEL_FIRST", 2478 }; 2479 2480 #endif 2481 2482 // Register type structs 2483 // id_r - ID register 2484 struct id_r 2485 { 2486 #ifndef __cplusplus 2487 union 2488 { 2489 struct 2490 { 2491 uint32_t version_status : 4; // This is the version of the product 2492 uint32_t version_minor : 4; // This is the n for the P part of an RnPn release number 2493 uint32_t version_major : 4; // This is the n for the R part of an RnPn release number 2494 uint32_t product_major : 4; // Product major ID number (unique per base product) 2495 uint32_t arch_patch_rev : 4; // This is the patch number of the architecture version a.b 2496 uint32_t 2497 arch_minor_rev : 8; // This is the minor architecture version number, b in the architecture version a.b 2498 uint32_t 2499 arch_major_rev : 4; // This is the major architecture version number, a in the architecture version a.b 2500 }; 2501 uint32_t word; 2502 }; 2503 #else 2504 private: 2505 uint32_t word0; 2506 2507 public: 2508 CONSTEXPR id_r() : word0(269500929) {} 2509 CONSTEXPR id_r(uint32_t init) : word0(init) {} 2510 CONSTEXPR void operator=(uint32_t value) 2511 { 2512 word0 = value; 2513 } 2514 void operator=(uint32_t value) volatile 2515 { 2516 word0 = value; 2517 } 2518 CONSTEXPR operator uint32_t() 2519 { 2520 return word0; 2521 } 2522 operator uint32_t() volatile 2523 { 2524 return word0; 2525 } 2526 id_r copy() volatile 2527 { 2528 return *this; 2529 } 2530 CONSTEXPR uint32_t get_version_status() const 2531 { 2532 uint32_t value = ((1U << 4) - 1) & (word0 >> 0); 2533 return value; 2534 } 2535 uint32_t get_version_status() const volatile 2536 { 2537 uint32_t value = ((1U << 4) - 1) & (word0 >> 0); 2538 return value; 2539 } 2540 CONSTEXPR id_r &set_version_status(uint32_t value) 2541 { 2542 word0 = (((~((1U << 4) - 1)) << 0) & word0) | ((((1U << 4) - 1) & value) << 0); 2543 return *this; 2544 } 2545 volatile id_r &set_version_status(uint32_t value) volatile 2546 { 2547 word0 = (((~((1U << 4) - 1)) << 0) & word0) | ((((1U << 4) - 1) & value) << 0); 2548 return *this; 2549 } 2550 CONSTEXPR uint32_t get_version_minor() const 2551 { 2552 uint32_t value = ((1U << 4) - 1) & (word0 >> 4); 2553 return value; 2554 } 2555 uint32_t get_version_minor() const volatile 2556 { 2557 uint32_t value = ((1U << 4) - 1) & (word0 >> 4); 2558 return value; 2559 } 2560 CONSTEXPR id_r &set_version_minor(uint32_t value) 2561 { 2562 word0 = (((~((1U << 4) - 1)) << 4) & word0) | ((((1U << 4) - 1) & value) << 4); 2563 return *this; 2564 } 2565 volatile id_r &set_version_minor(uint32_t value) volatile 2566 { 2567 word0 = (((~((1U << 4) - 1)) << 4) & word0) | ((((1U << 4) - 1) & value) << 4); 2568 return *this; 2569 } 2570 CONSTEXPR uint32_t get_version_major() const 2571 { 2572 uint32_t value = ((1U << 4) - 1) & (word0 >> 8); 2573 return value; 2574 } 2575 uint32_t get_version_major() const volatile 2576 { 2577 uint32_t value = ((1U << 4) - 1) & (word0 >> 8); 2578 return value; 2579 } 2580 CONSTEXPR id_r &set_version_major(uint32_t value) 2581 { 2582 word0 = (((~((1U << 4) - 1)) << 8) & word0) | ((((1U << 4) - 1) & value) << 8); 2583 return *this; 2584 } 2585 volatile id_r &set_version_major(uint32_t value) volatile 2586 { 2587 word0 = (((~((1U << 4) - 1)) << 8) & word0) | ((((1U << 4) - 1) & value) << 8); 2588 return *this; 2589 } 2590 CONSTEXPR uint32_t get_product_major() const 2591 { 2592 uint32_t value = ((1U << 4) - 1) & (word0 >> 12); 2593 return value; 2594 } 2595 uint32_t get_product_major() const volatile 2596 { 2597 uint32_t value = ((1U << 4) - 1) & (word0 >> 12); 2598 return value; 2599 } 2600 CONSTEXPR id_r &set_product_major(uint32_t value) 2601 { 2602 word0 = (((~((1U << 4) - 1)) << 12) & word0) | ((((1U << 4) - 1) & value) << 12); 2603 return *this; 2604 } 2605 volatile id_r &set_product_major(uint32_t value) volatile 2606 { 2607 word0 = (((~((1U << 4) - 1)) << 12) & word0) | ((((1U << 4) - 1) & value) << 12); 2608 return *this; 2609 } 2610 CONSTEXPR uint32_t get_arch_patch_rev() const 2611 { 2612 uint32_t value = ((1U << 4) - 1) & (word0 >> 16); 2613 return value; 2614 } 2615 uint32_t get_arch_patch_rev() const volatile 2616 { 2617 uint32_t value = ((1U << 4) - 1) & (word0 >> 16); 2618 return value; 2619 } 2620 CONSTEXPR id_r &set_arch_patch_rev(uint32_t value) 2621 { 2622 word0 = (((~((1U << 4) - 1)) << 16) & word0) | ((((1U << 4) - 1) & value) << 16); 2623 return *this; 2624 } 2625 volatile id_r &set_arch_patch_rev(uint32_t value) volatile 2626 { 2627 word0 = (((~((1U << 4) - 1)) << 16) & word0) | ((((1U << 4) - 1) & value) << 16); 2628 return *this; 2629 } 2630 CONSTEXPR uint32_t get_arch_minor_rev() const 2631 { 2632 uint32_t value = ((1U << 8) - 1) & (word0 >> 20); 2633 return value; 2634 } 2635 uint32_t get_arch_minor_rev() const volatile 2636 { 2637 uint32_t value = ((1U << 8) - 1) & (word0 >> 20); 2638 return value; 2639 } 2640 CONSTEXPR id_r &set_arch_minor_rev(uint32_t value) 2641 { 2642 word0 = (((~((1U << 8) - 1)) << 20) & word0) | ((((1U << 8) - 1) & value) << 20); 2643 return *this; 2644 } 2645 volatile id_r &set_arch_minor_rev(uint32_t value) volatile 2646 { 2647 word0 = (((~((1U << 8) - 1)) << 20) & word0) | ((((1U << 8) - 1) & value) << 20); 2648 return *this; 2649 } 2650 CONSTEXPR uint32_t get_arch_major_rev() const 2651 { 2652 uint32_t value = ((1U << 4) - 1) & (word0 >> 28); 2653 return value; 2654 } 2655 uint32_t get_arch_major_rev() const volatile 2656 { 2657 uint32_t value = ((1U << 4) - 1) & (word0 >> 28); 2658 return value; 2659 } 2660 CONSTEXPR id_r &set_arch_major_rev(uint32_t value) 2661 { 2662 word0 = (((~((1U << 4) - 1)) << 28) & word0) | ((((1U << 4) - 1) & value) << 28); 2663 return *this; 2664 } 2665 volatile id_r &set_arch_major_rev(uint32_t value) volatile 2666 { 2667 word0 = (((~((1U << 4) - 1)) << 28) & word0) | ((((1U << 4) - 1) & value) << 28); 2668 return *this; 2669 } 2670 #endif 2671 }; 2672 2673 // status_r - Register describes the current operating status of the NPU 2674 struct status_r 2675 { 2676 #ifndef __cplusplus 2677 union 2678 { 2679 struct 2680 { 2681 uint32_t state : 1; // NPU state, 0 = Stopped, 1 = Running 2682 uint32_t irq_raised : 1; // Raw IRQ status, 0 = IRQ not raised, 1 = IRQ raised. IRQ is cleared using command 2683 // register bit 1 2684 uint32_t 2685 bus_status : 1; // 0=OK, 1=Bus abort detected and processing halted (NPU will reach IDLE state and not 2686 // to start process any more commands/AXI transactions). Can only be cleared by a reset 2687 uint32_t reset_status : 1; // Reset is ongoing and only this register can be read (other registers read as 0 2688 // and writes are ignored.) A value of 0 means NPU is not being reset and can be 2689 // accessed as normal 2690 uint32_t 2691 cmd_parse_error : 1; // 0=No error 1=Command stream parsing error detected. Can only be cleared by reset 2692 uint32_t cmd_end_reached : 1; // 0=Not reached, 1=Reached. Cleared by writing QBASE or QSIZE when NPU is in 2693 // stopped state 2694 uint32_t pmu_irq_raised : 1; // 0=No PMU IRQ, 1=PMU IRQ raised. Cleared by using command register bit 1 2695 uint32_t wd_fault : 1; // Weight decoder state: 0=no fault 1=weight decoder decompression fault. Can only be 2696 // cleared by reset 2697 uint32_t ecc_fault : 1; // ECC state for internal RAMs: 0=no fault 1=ECC fault signalled. Can only be 2698 // cleared by reset 2699 uint32_t reserved0 : 2; 2700 uint32_t faulting_interface : 1; // Faulting interface on bus abort 2701 uint32_t faulting_channel : 4; // Faulting channel on a bus abort. Read: 0=Cmd 1=IFM 2=Weights 3=Scale+Bias 2702 // 4=Mem2Mem; Write: 8=OFM 9=Mem2Mem 2703 uint32_t irq_history_mask : 16; // IRQ History mask 2704 }; 2705 uint32_t word; 2706 }; 2707 #else 2708 private: 2709 uint32_t word0; 2710 2711 public: 2712 CONSTEXPR status_r() : word0(8) {} 2713 CONSTEXPR status_r(uint32_t init) : word0(init) {} 2714 CONSTEXPR void operator=(uint32_t value) 2715 { 2716 word0 = value; 2717 } 2718 void operator=(uint32_t value) volatile 2719 { 2720 word0 = value; 2721 } 2722 CONSTEXPR operator uint32_t() 2723 { 2724 return word0; 2725 } 2726 operator uint32_t() volatile 2727 { 2728 return word0; 2729 } 2730 status_r copy() volatile 2731 { 2732 return *this; 2733 } 2734 CONSTEXPR NPU_NAMESPACE::state get_state() const 2735 { 2736 NPU_NAMESPACE::state value = static_cast<NPU_NAMESPACE::state>(((1U << 1) - 1) & (word0 >> 0)); 2737 return value; 2738 } 2739 NPU_NAMESPACE::state get_state() const volatile 2740 { 2741 NPU_NAMESPACE::state value = static_cast<NPU_NAMESPACE::state>(((1U << 1) - 1) & (word0 >> 0)); 2742 return value; 2743 } 2744 CONSTEXPR status_r &set_state(NPU_NAMESPACE::state value) 2745 { 2746 word0 = (((~((1U << 1) - 1)) << 0) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 0); 2747 return *this; 2748 } 2749 volatile status_r &set_state(NPU_NAMESPACE::state value) volatile 2750 { 2751 word0 = (((~((1U << 1) - 1)) << 0) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 0); 2752 return *this; 2753 } 2754 CONSTEXPR uint32_t get_irq_raised() const 2755 { 2756 uint32_t value = ((1U << 1) - 1) & (word0 >> 1); 2757 return value; 2758 } 2759 uint32_t get_irq_raised() const volatile 2760 { 2761 uint32_t value = ((1U << 1) - 1) & (word0 >> 1); 2762 return value; 2763 } 2764 CONSTEXPR status_r &set_irq_raised(uint32_t value) 2765 { 2766 word0 = (((~((1U << 1) - 1)) << 1) & word0) | ((((1U << 1) - 1) & value) << 1); 2767 return *this; 2768 } 2769 volatile status_r &set_irq_raised(uint32_t value) volatile 2770 { 2771 word0 = (((~((1U << 1) - 1)) << 1) & word0) | ((((1U << 1) - 1) & value) << 1); 2772 return *this; 2773 } 2774 CONSTEXPR uint32_t get_bus_status() const 2775 { 2776 uint32_t value = ((1U << 1) - 1) & (word0 >> 2); 2777 return value; 2778 } 2779 uint32_t get_bus_status() const volatile 2780 { 2781 uint32_t value = ((1U << 1) - 1) & (word0 >> 2); 2782 return value; 2783 } 2784 CONSTEXPR status_r &set_bus_status(uint32_t value) 2785 { 2786 word0 = (((~((1U << 1) - 1)) << 2) & word0) | ((((1U << 1) - 1) & value) << 2); 2787 return *this; 2788 } 2789 volatile status_r &set_bus_status(uint32_t value) volatile 2790 { 2791 word0 = (((~((1U << 1) - 1)) << 2) & word0) | ((((1U << 1) - 1) & value) << 2); 2792 return *this; 2793 } 2794 CONSTEXPR uint32_t get_reset_status() const 2795 { 2796 uint32_t value = ((1U << 1) - 1) & (word0 >> 3); 2797 return value; 2798 } 2799 uint32_t get_reset_status() const volatile 2800 { 2801 uint32_t value = ((1U << 1) - 1) & (word0 >> 3); 2802 return value; 2803 } 2804 CONSTEXPR status_r &set_reset_status(uint32_t value) 2805 { 2806 word0 = (((~((1U << 1) - 1)) << 3) & word0) | ((((1U << 1) - 1) & value) << 3); 2807 return *this; 2808 } 2809 volatile status_r &set_reset_status(uint32_t value) volatile 2810 { 2811 word0 = (((~((1U << 1) - 1)) << 3) & word0) | ((((1U << 1) - 1) & value) << 3); 2812 return *this; 2813 } 2814 CONSTEXPR uint32_t get_cmd_parse_error() const 2815 { 2816 uint32_t value = ((1U << 1) - 1) & (word0 >> 4); 2817 return value; 2818 } 2819 uint32_t get_cmd_parse_error() const volatile 2820 { 2821 uint32_t value = ((1U << 1) - 1) & (word0 >> 4); 2822 return value; 2823 } 2824 CONSTEXPR status_r &set_cmd_parse_error(uint32_t value) 2825 { 2826 word0 = (((~((1U << 1) - 1)) << 4) & word0) | ((((1U << 1) - 1) & value) << 4); 2827 return *this; 2828 } 2829 volatile status_r &set_cmd_parse_error(uint32_t value) volatile 2830 { 2831 word0 = (((~((1U << 1) - 1)) << 4) & word0) | ((((1U << 1) - 1) & value) << 4); 2832 return *this; 2833 } 2834 CONSTEXPR uint32_t get_cmd_end_reached() const 2835 { 2836 uint32_t value = ((1U << 1) - 1) & (word0 >> 5); 2837 return value; 2838 } 2839 uint32_t get_cmd_end_reached() const volatile 2840 { 2841 uint32_t value = ((1U << 1) - 1) & (word0 >> 5); 2842 return value; 2843 } 2844 CONSTEXPR status_r &set_cmd_end_reached(uint32_t value) 2845 { 2846 word0 = (((~((1U << 1) - 1)) << 5) & word0) | ((((1U << 1) - 1) & value) << 5); 2847 return *this; 2848 } 2849 volatile status_r &set_cmd_end_reached(uint32_t value) volatile 2850 { 2851 word0 = (((~((1U << 1) - 1)) << 5) & word0) | ((((1U << 1) - 1) & value) << 5); 2852 return *this; 2853 } 2854 CONSTEXPR uint32_t get_pmu_irq_raised() const 2855 { 2856 uint32_t value = ((1U << 1) - 1) & (word0 >> 6); 2857 return value; 2858 } 2859 uint32_t get_pmu_irq_raised() const volatile 2860 { 2861 uint32_t value = ((1U << 1) - 1) & (word0 >> 6); 2862 return value; 2863 } 2864 CONSTEXPR status_r &set_pmu_irq_raised(uint32_t value) 2865 { 2866 word0 = (((~((1U << 1) - 1)) << 6) & word0) | ((((1U << 1) - 1) & value) << 6); 2867 return *this; 2868 } 2869 volatile status_r &set_pmu_irq_raised(uint32_t value) volatile 2870 { 2871 word0 = (((~((1U << 1) - 1)) << 6) & word0) | ((((1U << 1) - 1) & value) << 6); 2872 return *this; 2873 } 2874 CONSTEXPR uint32_t get_wd_fault() const 2875 { 2876 uint32_t value = ((1U << 1) - 1) & (word0 >> 7); 2877 return value; 2878 } 2879 uint32_t get_wd_fault() const volatile 2880 { 2881 uint32_t value = ((1U << 1) - 1) & (word0 >> 7); 2882 return value; 2883 } 2884 CONSTEXPR status_r &set_wd_fault(uint32_t value) 2885 { 2886 word0 = (((~((1U << 1) - 1)) << 7) & word0) | ((((1U << 1) - 1) & value) << 7); 2887 return *this; 2888 } 2889 volatile status_r &set_wd_fault(uint32_t value) volatile 2890 { 2891 word0 = (((~((1U << 1) - 1)) << 7) & word0) | ((((1U << 1) - 1) & value) << 7); 2892 return *this; 2893 } 2894 CONSTEXPR uint32_t get_ecc_fault() const 2895 { 2896 uint32_t value = ((1U << 1) - 1) & (word0 >> 8); 2897 return value; 2898 } 2899 uint32_t get_ecc_fault() const volatile 2900 { 2901 uint32_t value = ((1U << 1) - 1) & (word0 >> 8); 2902 return value; 2903 } 2904 CONSTEXPR status_r &set_ecc_fault(uint32_t value) 2905 { 2906 word0 = (((~((1U << 1) - 1)) << 8) & word0) | ((((1U << 1) - 1) & value) << 8); 2907 return *this; 2908 } 2909 volatile status_r &set_ecc_fault(uint32_t value) volatile 2910 { 2911 word0 = (((~((1U << 1) - 1)) << 8) & word0) | ((((1U << 1) - 1) & value) << 8); 2912 return *this; 2913 } 2914 CONSTEXPR NPU_NAMESPACE::dma_fault_src get_faulting_interface() const 2915 { 2916 NPU_NAMESPACE::dma_fault_src value = static_cast<NPU_NAMESPACE::dma_fault_src>(((1U << 1) - 1) & (word0 >> 11)); 2917 return value; 2918 } 2919 NPU_NAMESPACE::dma_fault_src get_faulting_interface() const volatile 2920 { 2921 NPU_NAMESPACE::dma_fault_src value = static_cast<NPU_NAMESPACE::dma_fault_src>(((1U << 1) - 1) & (word0 >> 11)); 2922 return value; 2923 } 2924 CONSTEXPR status_r &set_faulting_interface(NPU_NAMESPACE::dma_fault_src value) 2925 { 2926 word0 = (((~((1U << 1) - 1)) << 11) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 11); 2927 return *this; 2928 } 2929 volatile status_r &set_faulting_interface(NPU_NAMESPACE::dma_fault_src value) volatile 2930 { 2931 word0 = (((~((1U << 1) - 1)) << 11) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 11); 2932 return *this; 2933 } 2934 CONSTEXPR uint32_t get_faulting_channel() const 2935 { 2936 uint32_t value = ((1U << 4) - 1) & (word0 >> 12); 2937 return value; 2938 } 2939 uint32_t get_faulting_channel() const volatile 2940 { 2941 uint32_t value = ((1U << 4) - 1) & (word0 >> 12); 2942 return value; 2943 } 2944 CONSTEXPR status_r &set_faulting_channel(uint32_t value) 2945 { 2946 word0 = (((~((1U << 4) - 1)) << 12) & word0) | ((((1U << 4) - 1) & value) << 12); 2947 return *this; 2948 } 2949 volatile status_r &set_faulting_channel(uint32_t value) volatile 2950 { 2951 word0 = (((~((1U << 4) - 1)) << 12) & word0) | ((((1U << 4) - 1) & value) << 12); 2952 return *this; 2953 } 2954 CONSTEXPR uint32_t get_irq_history_mask() const 2955 { 2956 uint32_t value = ((1U << 16) - 1) & (word0 >> 16); 2957 return value; 2958 } 2959 uint32_t get_irq_history_mask() const volatile 2960 { 2961 uint32_t value = ((1U << 16) - 1) & (word0 >> 16); 2962 return value; 2963 } 2964 CONSTEXPR status_r &set_irq_history_mask(uint32_t value) 2965 { 2966 word0 = (((~((1U << 16) - 1)) << 16) & word0) | ((((1U << 16) - 1) & value) << 16); 2967 return *this; 2968 } 2969 volatile status_r &set_irq_history_mask(uint32_t value) volatile 2970 { 2971 word0 = (((~((1U << 16) - 1)) << 16) & word0) | ((((1U << 16) - 1) & value) << 16); 2972 return *this; 2973 } 2974 #endif 2975 }; 2976 2977 // cmd_r - Command register, reads as last written command 2978 struct cmd_r 2979 { 2980 #ifndef __cplusplus 2981 union 2982 { 2983 struct 2984 { 2985 uint32_t transition_to_running_state : 1; // Write 1 to transition the NPU to running state. Writing 0 has 2986 // no effect 2987 uint32_t clear_irq : 1; // Write 1 to clear the IRQ status in the STATUS register. Writing 0 has no effect 2988 uint32_t clock_q_enable : 1; // Write 1 to this bit to enable clock off using clock q-interface and enable 2989 // the requester clock gate 2990 uint32_t power_q_enable : 1; // Write 1 to this bit to enable power off using power q-interface 2991 uint32_t 2992 stop_request : 1; // Write 1 to this bit to request STOP after completing any already-started commands 2993 uint32_t reserved0 : 11; 2994 uint32_t clear_irq_history : 16; // Clears the IRQ history mask 2995 }; 2996 uint32_t word; 2997 }; 2998 #else 2999 private: 3000 uint32_t word0; 3001 3002 public: 3003 CONSTEXPR cmd_r() : word0(12) {} 3004 CONSTEXPR cmd_r(uint32_t init) : word0(init) {} 3005 CONSTEXPR void operator=(uint32_t value) 3006 { 3007 word0 = value; 3008 } 3009 void operator=(uint32_t value) volatile 3010 { 3011 word0 = value; 3012 } 3013 CONSTEXPR operator uint32_t() 3014 { 3015 return word0; 3016 } 3017 operator uint32_t() volatile 3018 { 3019 return word0; 3020 } 3021 cmd_r copy() volatile 3022 { 3023 return *this; 3024 } 3025 CONSTEXPR uint32_t get_transition_to_running_state() const 3026 { 3027 uint32_t value = ((1U << 1) - 1) & (word0 >> 0); 3028 return value; 3029 } 3030 uint32_t get_transition_to_running_state() const volatile 3031 { 3032 uint32_t value = ((1U << 1) - 1) & (word0 >> 0); 3033 return value; 3034 } 3035 CONSTEXPR cmd_r &set_transition_to_running_state(uint32_t value) 3036 { 3037 word0 = (((~((1U << 1) - 1)) << 0) & word0) | ((((1U << 1) - 1) & value) << 0); 3038 return *this; 3039 } 3040 volatile cmd_r &set_transition_to_running_state(uint32_t value) volatile 3041 { 3042 word0 = (((~((1U << 1) - 1)) << 0) & word0) | ((((1U << 1) - 1) & value) << 0); 3043 return *this; 3044 } 3045 CONSTEXPR uint32_t get_clear_irq() const 3046 { 3047 uint32_t value = ((1U << 1) - 1) & (word0 >> 1); 3048 return value; 3049 } 3050 uint32_t get_clear_irq() const volatile 3051 { 3052 uint32_t value = ((1U << 1) - 1) & (word0 >> 1); 3053 return value; 3054 } 3055 CONSTEXPR cmd_r &set_clear_irq(uint32_t value) 3056 { 3057 word0 = (((~((1U << 1) - 1)) << 1) & word0) | ((((1U << 1) - 1) & value) << 1); 3058 return *this; 3059 } 3060 volatile cmd_r &set_clear_irq(uint32_t value) volatile 3061 { 3062 word0 = (((~((1U << 1) - 1)) << 1) & word0) | ((((1U << 1) - 1) & value) << 1); 3063 return *this; 3064 } 3065 CONSTEXPR uint32_t get_clock_q_enable() const 3066 { 3067 uint32_t value = ((1U << 1) - 1) & (word0 >> 2); 3068 return value; 3069 } 3070 uint32_t get_clock_q_enable() const volatile 3071 { 3072 uint32_t value = ((1U << 1) - 1) & (word0 >> 2); 3073 return value; 3074 } 3075 CONSTEXPR cmd_r &set_clock_q_enable(uint32_t value) 3076 { 3077 word0 = (((~((1U << 1) - 1)) << 2) & word0) | ((((1U << 1) - 1) & value) << 2); 3078 return *this; 3079 } 3080 volatile cmd_r &set_clock_q_enable(uint32_t value) volatile 3081 { 3082 word0 = (((~((1U << 1) - 1)) << 2) & word0) | ((((1U << 1) - 1) & value) << 2); 3083 return *this; 3084 } 3085 CONSTEXPR uint32_t get_power_q_enable() const 3086 { 3087 uint32_t value = ((1U << 1) - 1) & (word0 >> 3); 3088 return value; 3089 } 3090 uint32_t get_power_q_enable() const volatile 3091 { 3092 uint32_t value = ((1U << 1) - 1) & (word0 >> 3); 3093 return value; 3094 } 3095 CONSTEXPR cmd_r &set_power_q_enable(uint32_t value) 3096 { 3097 word0 = (((~((1U << 1) - 1)) << 3) & word0) | ((((1U << 1) - 1) & value) << 3); 3098 return *this; 3099 } 3100 volatile cmd_r &set_power_q_enable(uint32_t value) volatile 3101 { 3102 word0 = (((~((1U << 1) - 1)) << 3) & word0) | ((((1U << 1) - 1) & value) << 3); 3103 return *this; 3104 } 3105 CONSTEXPR uint32_t get_stop_request() const 3106 { 3107 uint32_t value = ((1U << 1) - 1) & (word0 >> 4); 3108 return value; 3109 } 3110 uint32_t get_stop_request() const volatile 3111 { 3112 uint32_t value = ((1U << 1) - 1) & (word0 >> 4); 3113 return value; 3114 } 3115 CONSTEXPR cmd_r &set_stop_request(uint32_t value) 3116 { 3117 word0 = (((~((1U << 1) - 1)) << 4) & word0) | ((((1U << 1) - 1) & value) << 4); 3118 return *this; 3119 } 3120 volatile cmd_r &set_stop_request(uint32_t value) volatile 3121 { 3122 word0 = (((~((1U << 1) - 1)) << 4) & word0) | ((((1U << 1) - 1) & value) << 4); 3123 return *this; 3124 } 3125 CONSTEXPR uint32_t get_clear_irq_history() const 3126 { 3127 uint32_t value = ((1U << 16) - 1) & (word0 >> 16); 3128 return value; 3129 } 3130 uint32_t get_clear_irq_history() const volatile 3131 { 3132 uint32_t value = ((1U << 16) - 1) & (word0 >> 16); 3133 return value; 3134 } 3135 CONSTEXPR cmd_r &set_clear_irq_history(uint32_t value) 3136 { 3137 word0 = (((~((1U << 16) - 1)) << 16) & word0) | ((((1U << 16) - 1) & value) << 16); 3138 return *this; 3139 } 3140 volatile cmd_r &set_clear_irq_history(uint32_t value) volatile 3141 { 3142 word0 = (((~((1U << 16) - 1)) << 16) & word0) | ((((1U << 16) - 1) & value) << 16); 3143 return *this; 3144 } 3145 #endif 3146 }; 3147 3148 // reset_r - Request Reset and new security mode 3149 struct reset_r 3150 { 3151 #ifndef __cplusplus 3152 union 3153 { 3154 struct 3155 { 3156 uint32_t pending_CPL : 1; // Current privilege level 0=User 1=Privileged 3157 uint32_t pending_CSL : 1; // Current security level 0=Secure 1=Non secure 3158 uint32_t reserved0 : 30; 3159 }; 3160 uint32_t word; 3161 }; 3162 #else 3163 private: 3164 uint32_t word0; 3165 3166 public: 3167 CONSTEXPR reset_r() : word0(0) {} 3168 CONSTEXPR reset_r(uint32_t init) : word0(init) {} 3169 CONSTEXPR void operator=(uint32_t value) 3170 { 3171 word0 = value; 3172 } 3173 void operator=(uint32_t value) volatile 3174 { 3175 word0 = value; 3176 } 3177 CONSTEXPR operator uint32_t() 3178 { 3179 return word0; 3180 } 3181 operator uint32_t() volatile 3182 { 3183 return word0; 3184 } 3185 reset_r copy() volatile 3186 { 3187 return *this; 3188 } 3189 CONSTEXPR NPU_NAMESPACE::privilege_level get_pending_CPL() const 3190 { 3191 NPU_NAMESPACE::privilege_level value = 3192 static_cast<NPU_NAMESPACE::privilege_level>(((1U << 1) - 1) & (word0 >> 0)); 3193 return value; 3194 } 3195 NPU_NAMESPACE::privilege_level get_pending_CPL() const volatile 3196 { 3197 NPU_NAMESPACE::privilege_level value = 3198 static_cast<NPU_NAMESPACE::privilege_level>(((1U << 1) - 1) & (word0 >> 0)); 3199 return value; 3200 } 3201 CONSTEXPR reset_r &set_pending_CPL(NPU_NAMESPACE::privilege_level value) 3202 { 3203 word0 = (((~((1U << 1) - 1)) << 0) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 0); 3204 return *this; 3205 } 3206 volatile reset_r &set_pending_CPL(NPU_NAMESPACE::privilege_level value) volatile 3207 { 3208 word0 = (((~((1U << 1) - 1)) << 0) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 0); 3209 return *this; 3210 } 3211 CONSTEXPR NPU_NAMESPACE::security_level get_pending_CSL() const 3212 { 3213 NPU_NAMESPACE::security_level value = 3214 static_cast<NPU_NAMESPACE::security_level>(((1U << 1) - 1) & (word0 >> 1)); 3215 return value; 3216 } 3217 NPU_NAMESPACE::security_level get_pending_CSL() const volatile 3218 { 3219 NPU_NAMESPACE::security_level value = 3220 static_cast<NPU_NAMESPACE::security_level>(((1U << 1) - 1) & (word0 >> 1)); 3221 return value; 3222 } 3223 CONSTEXPR reset_r &set_pending_CSL(NPU_NAMESPACE::security_level value) 3224 { 3225 word0 = (((~((1U << 1) - 1)) << 1) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 1); 3226 return *this; 3227 } 3228 volatile reset_r &set_pending_CSL(NPU_NAMESPACE::security_level value) volatile 3229 { 3230 word0 = (((~((1U << 1) - 1)) << 1) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 1); 3231 return *this; 3232 } 3233 #endif 3234 }; 3235 3236 // qbase_r - Base address of the command stream in bytes 3237 struct qbase_r 3238 { 3239 #ifndef __cplusplus 3240 union 3241 { 3242 struct 3243 { 3244 uint32_t offset : 32; // Offset 3245 uint32_t reserved0 : 32; 3246 }; 3247 uint32_t word[2]; 3248 }; 3249 #else 3250 private: 3251 uint32_t word0; 3252 uint32_t word1; 3253 3254 public: 3255 CONSTEXPR qbase_r() : word0(0), word1(0) {} 3256 CONSTEXPR qbase_r(uint64_t init) : 3257 word0(static_cast<uint32_t>((init)&std::numeric_limits<uint64_t>::max())), 3258 word1(static_cast<uint32_t>((init >> 32) & std::numeric_limits<uint64_t>::max())) 3259 { 3260 } 3261 CONSTEXPR void operator=(uint64_t value) 3262 { 3263 word0 = static_cast<uint32_t>((value)&std::numeric_limits<uint64_t>::max()); 3264 word1 = static_cast<uint32_t>((value >> 32) & std::numeric_limits<uint64_t>::max()); 3265 } 3266 void operator=(uint64_t value) volatile 3267 { 3268 word0 = static_cast<uint32_t>((value)&std::numeric_limits<uint64_t>::max()); 3269 word1 = static_cast<uint32_t>((value >> 32) & std::numeric_limits<uint64_t>::max()); 3270 } 3271 CONSTEXPR operator uint64_t() 3272 { 3273 return (static_cast<uint64_t>(word1) << 32) | word0; 3274 } 3275 operator uint64_t() volatile 3276 { 3277 return (static_cast<uint64_t>(word1) << 32) | word0; 3278 } 3279 qbase_r copy() volatile 3280 { 3281 return *this; 3282 } 3283 #endif 3284 }; 3285 3286 // qread_r - Read offset in the command stream in bytes. Multiple of 4 in the range 0 to 16 MB 3287 struct qread_r 3288 { 3289 #ifndef __cplusplus 3290 union 3291 { 3292 struct 3293 { 3294 uint32_t QREAD : 32; // The read offset of the current command under execution 3295 }; 3296 uint32_t word; 3297 }; 3298 #else 3299 private: 3300 uint32_t word0; 3301 3302 public: 3303 CONSTEXPR qread_r() : word0(0) {} 3304 CONSTEXPR qread_r(uint32_t init) : word0(init) {} 3305 CONSTEXPR void operator=(uint32_t value) 3306 { 3307 word0 = value; 3308 } 3309 void operator=(uint32_t value) volatile 3310 { 3311 word0 = value; 3312 } 3313 CONSTEXPR operator uint32_t() 3314 { 3315 return word0; 3316 } 3317 operator uint32_t() volatile 3318 { 3319 return word0; 3320 } 3321 qread_r copy() volatile 3322 { 3323 return *this; 3324 } 3325 CONSTEXPR uint32_t get_QREAD() const 3326 { 3327 uint32_t value = word0; 3328 return value; 3329 } 3330 uint32_t get_QREAD() const volatile 3331 { 3332 uint32_t value = word0; 3333 return value; 3334 } 3335 CONSTEXPR qread_r &set_QREAD(uint32_t value) 3336 { 3337 word0 = value; 3338 return *this; 3339 } 3340 volatile qread_r &set_QREAD(uint32_t value) volatile 3341 { 3342 word0 = value; 3343 return *this; 3344 } 3345 #endif 3346 }; 3347 3348 // qconfig_r - AXI configuration for the command stream in the range 0-3. Same encoding as for REGIONCFG 3349 struct qconfig_r 3350 { 3351 #ifndef __cplusplus 3352 union 3353 { 3354 struct 3355 { 3356 uint32_t cmd_region0 : 2; // Command region configuration 3357 uint32_t reserved0 : 30; 3358 }; 3359 uint32_t word; 3360 }; 3361 #else 3362 private: 3363 uint32_t word0; 3364 3365 public: 3366 CONSTEXPR qconfig_r() : word0(0) {} 3367 CONSTEXPR qconfig_r(uint32_t init) : word0(init) {} 3368 CONSTEXPR void operator=(uint32_t value) 3369 { 3370 word0 = value; 3371 } 3372 void operator=(uint32_t value) volatile 3373 { 3374 word0 = value; 3375 } 3376 CONSTEXPR operator uint32_t() 3377 { 3378 return word0; 3379 } 3380 operator uint32_t() volatile 3381 { 3382 return word0; 3383 } 3384 qconfig_r copy() volatile 3385 { 3386 return *this; 3387 } 3388 CONSTEXPR NPU_NAMESPACE::mem_attr get_cmd_region0() const 3389 { 3390 NPU_NAMESPACE::mem_attr value = static_cast<NPU_NAMESPACE::mem_attr>(((1U << 2) - 1) & (word0 >> 0)); 3391 return value; 3392 } 3393 NPU_NAMESPACE::mem_attr get_cmd_region0() const volatile 3394 { 3395 NPU_NAMESPACE::mem_attr value = static_cast<NPU_NAMESPACE::mem_attr>(((1U << 2) - 1) & (word0 >> 0)); 3396 return value; 3397 } 3398 CONSTEXPR qconfig_r &set_cmd_region0(NPU_NAMESPACE::mem_attr value) 3399 { 3400 word0 = (((~((1U << 2) - 1)) << 0) & word0) | ((((1U << 2) - 1) & static_cast<uint32_t>(value)) << 0); 3401 return *this; 3402 } 3403 volatile qconfig_r &set_cmd_region0(NPU_NAMESPACE::mem_attr value) volatile 3404 { 3405 word0 = (((~((1U << 2) - 1)) << 0) & word0) | ((((1U << 2) - 1) & static_cast<uint32_t>(value)) << 0); 3406 return *this; 3407 } 3408 #endif 3409 }; 3410 3411 // qsize_r - Size of the command stream in bytes. Multiple of 4 in the range 0 to 16 MB 3412 struct qsize_r 3413 { 3414 #ifndef __cplusplus 3415 union 3416 { 3417 struct 3418 { 3419 uint32_t QSIZE : 32; // Size of the next command stream to be executed by the NPU 3420 }; 3421 uint32_t word; 3422 }; 3423 #else 3424 private: 3425 uint32_t word0; 3426 3427 public: 3428 CONSTEXPR qsize_r() : word0(0) {} 3429 CONSTEXPR qsize_r(uint32_t init) : word0(init) {} 3430 CONSTEXPR void operator=(uint32_t value) 3431 { 3432 word0 = value; 3433 } 3434 void operator=(uint32_t value) volatile 3435 { 3436 word0 = value; 3437 } 3438 CONSTEXPR operator uint32_t() 3439 { 3440 return word0; 3441 } 3442 operator uint32_t() volatile 3443 { 3444 return word0; 3445 } 3446 qsize_r copy() volatile 3447 { 3448 return *this; 3449 } 3450 CONSTEXPR uint32_t get_QSIZE() const 3451 { 3452 uint32_t value = word0; 3453 return value; 3454 } 3455 uint32_t get_QSIZE() const volatile 3456 { 3457 uint32_t value = word0; 3458 return value; 3459 } 3460 CONSTEXPR qsize_r &set_QSIZE(uint32_t value) 3461 { 3462 word0 = value; 3463 return *this; 3464 } 3465 volatile qsize_r &set_QSIZE(uint32_t value) volatile 3466 { 3467 word0 = value; 3468 return *this; 3469 } 3470 #endif 3471 }; 3472 3473 // prot_r - Protection level configured for the NPU when acting as an AXI requester 3474 struct prot_r 3475 { 3476 #ifndef __cplusplus 3477 union 3478 { 3479 struct 3480 { 3481 uint32_t active_CPL : 1; // Current privilege level 0=User 1=Privileged 3482 uint32_t active_CSL : 1; // Current security level 0=Secure 1=Non secure 3483 uint32_t reserved0 : 30; 3484 }; 3485 uint32_t word; 3486 }; 3487 #else 3488 private: 3489 uint32_t word0; 3490 3491 public: 3492 CONSTEXPR prot_r() : word0(0) {} 3493 CONSTEXPR prot_r(uint32_t init) : word0(init) {} 3494 CONSTEXPR void operator=(uint32_t value) 3495 { 3496 word0 = value; 3497 } 3498 void operator=(uint32_t value) volatile 3499 { 3500 word0 = value; 3501 } 3502 CONSTEXPR operator uint32_t() 3503 { 3504 return word0; 3505 } 3506 operator uint32_t() volatile 3507 { 3508 return word0; 3509 } 3510 prot_r copy() volatile 3511 { 3512 return *this; 3513 } 3514 CONSTEXPR NPU_NAMESPACE::privilege_level get_active_CPL() const 3515 { 3516 NPU_NAMESPACE::privilege_level value = 3517 static_cast<NPU_NAMESPACE::privilege_level>(((1U << 1) - 1) & (word0 >> 0)); 3518 return value; 3519 } 3520 NPU_NAMESPACE::privilege_level get_active_CPL() const volatile 3521 { 3522 NPU_NAMESPACE::privilege_level value = 3523 static_cast<NPU_NAMESPACE::privilege_level>(((1U << 1) - 1) & (word0 >> 0)); 3524 return value; 3525 } 3526 CONSTEXPR prot_r &set_active_CPL(NPU_NAMESPACE::privilege_level value) 3527 { 3528 word0 = (((~((1U << 1) - 1)) << 0) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 0); 3529 return *this; 3530 } 3531 volatile prot_r &set_active_CPL(NPU_NAMESPACE::privilege_level value) volatile 3532 { 3533 word0 = (((~((1U << 1) - 1)) << 0) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 0); 3534 return *this; 3535 } 3536 CONSTEXPR NPU_NAMESPACE::security_level get_active_CSL() const 3537 { 3538 NPU_NAMESPACE::security_level value = 3539 static_cast<NPU_NAMESPACE::security_level>(((1U << 1) - 1) & (word0 >> 1)); 3540 return value; 3541 } 3542 NPU_NAMESPACE::security_level get_active_CSL() const volatile 3543 { 3544 NPU_NAMESPACE::security_level value = 3545 static_cast<NPU_NAMESPACE::security_level>(((1U << 1) - 1) & (word0 >> 1)); 3546 return value; 3547 } 3548 CONSTEXPR prot_r &set_active_CSL(NPU_NAMESPACE::security_level value) 3549 { 3550 word0 = (((~((1U << 1) - 1)) << 1) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 1); 3551 return *this; 3552 } 3553 volatile prot_r &set_active_CSL(NPU_NAMESPACE::security_level value) volatile 3554 { 3555 word0 = (((~((1U << 1) - 1)) << 1) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 1); 3556 return *this; 3557 } 3558 #endif 3559 }; 3560 3561 // config_r - RTL configuration 3562 struct config_r 3563 { 3564 #ifndef __cplusplus 3565 union 3566 { 3567 struct 3568 { 3569 uint32_t macs_per_cc : 4; // The log2(macs/clock cycle) 3570 uint32_t cmd_stream_version : 4; // command stream version accepted by this NPU 3571 uint32_t shram_size : 8; // Total size in KB of internal SHRAM 3572 uint32_t reserved0 : 10; 3573 uint32_t functional_safety : 1; // Functional safety configuration 3574 uint32_t custom_dma : 1; // Custom DMA configuration 3575 uint32_t product : 4; // Product configuration 3576 }; 3577 uint32_t word; 3578 }; 3579 #else 3580 private: 3581 uint32_t word0; 3582 3583 public: 3584 CONSTEXPR config_r() : word0(0) {} 3585 CONSTEXPR config_r(uint32_t init) : word0(init) {} 3586 CONSTEXPR void operator=(uint32_t value) 3587 { 3588 word0 = value; 3589 } 3590 void operator=(uint32_t value) volatile 3591 { 3592 word0 = value; 3593 } 3594 CONSTEXPR operator uint32_t() 3595 { 3596 return word0; 3597 } 3598 operator uint32_t() volatile 3599 { 3600 return word0; 3601 } 3602 config_r copy() volatile 3603 { 3604 return *this; 3605 } 3606 CONSTEXPR uint32_t get_macs_per_cc() const 3607 { 3608 uint32_t value = ((1U << 4) - 1) & (word0 >> 0); 3609 return value; 3610 } 3611 uint32_t get_macs_per_cc() const volatile 3612 { 3613 uint32_t value = ((1U << 4) - 1) & (word0 >> 0); 3614 return value; 3615 } 3616 CONSTEXPR config_r &set_macs_per_cc(uint32_t value) 3617 { 3618 word0 = (((~((1U << 4) - 1)) << 0) & word0) | ((((1U << 4) - 1) & value) << 0); 3619 return *this; 3620 } 3621 volatile config_r &set_macs_per_cc(uint32_t value) volatile 3622 { 3623 word0 = (((~((1U << 4) - 1)) << 0) & word0) | ((((1U << 4) - 1) & value) << 0); 3624 return *this; 3625 } 3626 CONSTEXPR uint32_t get_cmd_stream_version() const 3627 { 3628 uint32_t value = ((1U << 4) - 1) & (word0 >> 4); 3629 return value; 3630 } 3631 uint32_t get_cmd_stream_version() const volatile 3632 { 3633 uint32_t value = ((1U << 4) - 1) & (word0 >> 4); 3634 return value; 3635 } 3636 CONSTEXPR config_r &set_cmd_stream_version(uint32_t value) 3637 { 3638 word0 = (((~((1U << 4) - 1)) << 4) & word0) | ((((1U << 4) - 1) & value) << 4); 3639 return *this; 3640 } 3641 volatile config_r &set_cmd_stream_version(uint32_t value) volatile 3642 { 3643 word0 = (((~((1U << 4) - 1)) << 4) & word0) | ((((1U << 4) - 1) & value) << 4); 3644 return *this; 3645 } 3646 CONSTEXPR uint32_t get_shram_size() const 3647 { 3648 uint32_t value = ((1U << 8) - 1) & (word0 >> 8); 3649 return value; 3650 } 3651 uint32_t get_shram_size() const volatile 3652 { 3653 uint32_t value = ((1U << 8) - 1) & (word0 >> 8); 3654 return value; 3655 } 3656 CONSTEXPR config_r &set_shram_size(uint32_t value) 3657 { 3658 word0 = (((~((1U << 8) - 1)) << 8) & word0) | ((((1U << 8) - 1) & value) << 8); 3659 return *this; 3660 } 3661 volatile config_r &set_shram_size(uint32_t value) volatile 3662 { 3663 word0 = (((~((1U << 8) - 1)) << 8) & word0) | ((((1U << 8) - 1) & value) << 8); 3664 return *this; 3665 } 3666 CONSTEXPR NPU_NAMESPACE::functional_safety get_functional_safety() const 3667 { 3668 NPU_NAMESPACE::functional_safety value = 3669 static_cast<NPU_NAMESPACE::functional_safety>(((1U << 1) - 1) & (word0 >> 26)); 3670 return value; 3671 } 3672 NPU_NAMESPACE::functional_safety get_functional_safety() const volatile 3673 { 3674 NPU_NAMESPACE::functional_safety value = 3675 static_cast<NPU_NAMESPACE::functional_safety>(((1U << 1) - 1) & (word0 >> 26)); 3676 return value; 3677 } 3678 CONSTEXPR config_r &set_functional_safety(NPU_NAMESPACE::functional_safety value) 3679 { 3680 word0 = (((~((1U << 1) - 1)) << 26) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 26); 3681 return *this; 3682 } 3683 volatile config_r &set_functional_safety(NPU_NAMESPACE::functional_safety value) volatile 3684 { 3685 word0 = (((~((1U << 1) - 1)) << 26) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 26); 3686 return *this; 3687 } 3688 CONSTEXPR NPU_NAMESPACE::custom_dma get_custom_dma() const 3689 { 3690 NPU_NAMESPACE::custom_dma value = static_cast<NPU_NAMESPACE::custom_dma>(((1U << 1) - 1) & (word0 >> 27)); 3691 return value; 3692 } 3693 NPU_NAMESPACE::custom_dma get_custom_dma() const volatile 3694 { 3695 NPU_NAMESPACE::custom_dma value = static_cast<NPU_NAMESPACE::custom_dma>(((1U << 1) - 1) & (word0 >> 27)); 3696 return value; 3697 } 3698 CONSTEXPR config_r &set_custom_dma(NPU_NAMESPACE::custom_dma value) 3699 { 3700 word0 = (((~((1U << 1) - 1)) << 27) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 27); 3701 return *this; 3702 } 3703 volatile config_r &set_custom_dma(NPU_NAMESPACE::custom_dma value) volatile 3704 { 3705 word0 = (((~((1U << 1) - 1)) << 27) & word0) | ((((1U << 1) - 1) & static_cast<uint32_t>(value)) << 27); 3706 return *this; 3707 } 3708 CONSTEXPR uint32_t get_product() const 3709 { 3710 uint32_t value = ((1U << 4) - 1) & (word0 >> 28); 3711 return value; 3712 } 3713 uint32_t get_product() const volatile 3714 { 3715 uint32_t value = ((1U << 4) - 1) & (word0 >> 28); 3716 return value; 3717 } 3718 CONSTEXPR config_r &set_product(uint32_t value) 3719 { 3720 word0 = (((~((1U << 4) - 1)) << 28) & word0) | ((((1U << 4) - 1) & value) << 28); 3721 return *this; 3722 } 3723 volatile config_r &set_product(uint32_t value) volatile 3724 { 3725 word0 = (((~((1U << 4) - 1)) << 28) & word0) | ((((1U << 4) - 1) & value) << 28); 3726 return *this; 3727 } 3728 #endif 3729 }; 3730 3731 // lock_r - Lock register. This register is designed for driver use and does not affect NPU functionality 3732 struct lock_r 3733 { 3734 #ifndef __cplusplus 3735 union 3736 { 3737 struct 3738 { 3739 uint32_t LOCK : 32; // 32 bit value for LOCK configuration 3740 }; 3741 uint32_t word; 3742 }; 3743 #else 3744 private: 3745 uint32_t word0; 3746 3747 public: 3748 CONSTEXPR lock_r() : word0(0) {} 3749 CONSTEXPR lock_r(uint32_t init) : word0(init) {} 3750 CONSTEXPR void operator=(uint32_t value) 3751 { 3752 word0 = value; 3753 } 3754 void operator=(uint32_t value) volatile 3755 { 3756 word0 = value; 3757 } 3758 CONSTEXPR operator uint32_t() 3759 { 3760 return word0; 3761 } 3762 operator uint32_t() volatile 3763 { 3764 return word0; 3765 } 3766 lock_r copy() volatile 3767 { 3768 return *this; 3769 } 3770 CONSTEXPR uint32_t get_LOCK() const 3771 { 3772 uint32_t value = word0; 3773 return value; 3774 } 3775 uint32_t get_LOCK() const volatile 3776 { 3777 uint32_t value = word0; 3778 return value; 3779 } 3780 CONSTEXPR lock_r &set_LOCK(uint32_t value) 3781 { 3782 word0 = value; 3783 return *this; 3784 } 3785 volatile lock_r &set_LOCK(uint32_t value) volatile 3786 { 3787 word0 = value; 3788 return *this; 3789 } 3790 #endif 3791 }; 3792 3793 // regioncfg_r - Region memory type configuration. Bits[2*k+1:2*k] give the memory type for REGION[k] 3794 struct regioncfg_r 3795 { 3796 #ifndef __cplusplus 3797 union 3798 { 3799 struct 3800 { 3801 uint32_t region0 : 2; // Bits for Region0 Configuration 3802 uint32_t region1 : 2; // Bits for Region1 Configuration 3803 uint32_t region2 : 2; // Bits for Region2 Configuration 3804 uint32_t region3 : 2; // Bits for Region3 Configuration 3805 uint32_t region4 : 2; // Bits for Region4 Configuration 3806 uint32_t region5 : 2; // Bits for Region5 Configuration 3807 uint32_t region6 : 2; // Bits for Region6 Configuration 3808 uint32_t region7 : 2; // Bits for Region7 Configuration 3809 uint32_t reserved0 : 16; 3810 }; 3811 uint32_t word; 3812 }; 3813 #else 3814 private: 3815 uint32_t word0; 3816 3817 public: 3818 CONSTEXPR regioncfg_r() : word0(0) {} 3819 CONSTEXPR regioncfg_r(uint32_t init) : word0(init) {} 3820 CONSTEXPR void operator=(uint32_t value) 3821 { 3822 word0 = value; 3823 } 3824 void operator=(uint32_t value) volatile 3825 { 3826 word0 = value; 3827 } 3828 CONSTEXPR operator uint32_t() 3829 { 3830 return word0; 3831 } 3832 operator uint32_t() volatile 3833 { 3834 return word0; 3835 } 3836 regioncfg_r copy() volatile 3837 { 3838 return *this; 3839 } 3840 CONSTEXPR NPU_NAMESPACE::mem_attr get_region0() const 3841 { 3842 NPU_NAMESPACE::mem_attr value = static_cast<NPU_NAMESPACE::mem_attr>(((1U << 2) - 1) & (word0 >> 0)); 3843 return value; 3844 } 3845 NPU_NAMESPACE::mem_attr get_region0() const volatile 3846 { 3847 NPU_NAMESPACE::mem_attr value = static_cast<NPU_NAMESPACE::mem_attr>(((1U << 2) - 1) & (word0 >> 0)); 3848 return value; 3849 } 3850 CONSTEXPR regioncfg_r &set_region0(NPU_NAMESPACE::mem_attr value) 3851 { 3852 word0 = (((~((1U << 2) - 1)) << 0) & word0) | ((((1U << 2) - 1) & static_cast<uint32_t>(value)) << 0); 3853 return *this; 3854 } 3855 volatile regioncfg_r &set_region0(NPU_NAMESPACE::mem_attr value) volatile 3856 { 3857 word0 = (((~((1U << 2) - 1)) << 0) & word0) | ((((1U << 2) - 1) & static_cast<uint32_t>(value)) << 0); 3858 return *this; 3859 } 3860 CONSTEXPR NPU_NAMESPACE::mem_attr get_region1() const 3861 { 3862 NPU_NAMESPACE::mem_attr value = static_cast<NPU_NAMESPACE::mem_attr>(((1U << 2) - 1) & (word0 >> 2)); 3863 return value; 3864 } 3865 NPU_NAMESPACE::mem_attr get_region1() const volatile 3866 { 3867 NPU_NAMESPACE::mem_attr value = static_cast<NPU_NAMESPACE::mem_attr>(((1U << 2) - 1) & (word0 >> 2)); 3868 return value; 3869 } 3870 CONSTEXPR regioncfg_r &set_region1(NPU_NAMESPACE::mem_attr value) 3871 { 3872 word0 = (((~((1U << 2) - 1)) << 2) & word0) | ((((1U << 2) - 1) & static_cast<uint32_t>(value)) << 2); 3873 return *this; 3874 } 3875 volatile regioncfg_r &set_region1(NPU_NAMESPACE::mem_attr value) volatile 3876 { 3877 word0 = (((~((1U << 2) - 1)) << 2) & word0) | ((((1U << 2) - 1) & static_cast<uint32_t>(value)) << 2); 3878 return *this; 3879 } 3880 CONSTEXPR NPU_NAMESPACE::mem_attr get_region2() const 3881 { 3882 NPU_NAMESPACE::mem_attr value = static_cast<NPU_NAMESPACE::mem_attr>(((1U << 2) - 1) & (word0 >> 4)); 3883 return value; 3884 } 3885 NPU_NAMESPACE::mem_attr get_region2() const volatile 3886 { 3887 NPU_NAMESPACE::mem_attr value = static_cast<NPU_NAMESPACE::mem_attr>(((1U << 2) - 1) & (word0 >> 4)); 3888 return value; 3889 } 3890 CONSTEXPR regioncfg_r &set_region2(NPU_NAMESPACE::mem_attr value) 3891 { 3892 word0 = (((~((1U << 2) - 1)) << 4) & word0) | ((((1U << 2) - 1) & static_cast<uint32_t>(value)) << 4); 3893 return *this; 3894 } 3895 volatile regioncfg_r &set_region2(NPU_NAMESPACE::mem_attr value) volatile 3896 { 3897 word0 = (((~((1U << 2) - 1)) << 4) & word0) | ((((1U << 2) - 1) & static_cast<uint32_t>(value)) << 4); 3898 return *this; 3899 } 3900 CONSTEXPR NPU_NAMESPACE::mem_attr get_region3() const 3901 { 3902 NPU_NAMESPACE::mem_attr value = static_cast<NPU_NAMESPACE::mem_attr>(((1U << 2) - 1) & (word0 >> 6)); 3903 return value; 3904 } 3905 NPU_NAMESPACE::mem_attr get_region3() const volatile 3906 { 3907 NPU_NAMESPACE::mem_attr value = static_cast<NPU_NAMESPACE::mem_attr>(((1U << 2) - 1) & (word0 >> 6)); 3908 return value; 3909 } 3910 CONSTEXPR regioncfg_r &set_region3(NPU_NAMESPACE::mem_attr value) 3911 { 3912 word0 = (((~((1U << 2) - 1)) << 6) & word0) | ((((1U << 2) - 1) & static_cast<uint32_t>(value)) << 6); 3913 return *this; 3914 } 3915 volatile regioncfg_r &set_region3(NPU_NAMESPACE::mem_attr value) volatile 3916 { 3917 word0 = (((~((1U << 2) - 1)) << 6) & word0) | ((((1U << 2) - 1) & static_cast<uint32_t>(value)) << 6); 3918 return *this; 3919 } 3920 CONSTEXPR NPU_NAMESPACE::mem_attr get_region4() const 3921 { 3922 NPU_NAMESPACE::mem_attr value = static_cast<NPU_NAMESPACE::mem_attr>(((1U << 2) - 1) & (word0 >> 8)); 3923 return value; 3924 } 3925 NPU_NAMESPACE::mem_attr get_region4() const volatile 3926 { 3927 NPU_NAMESPACE::mem_attr value = static_cast<NPU_NAMESPACE::mem_attr>(((1U << 2) - 1) & (word0 >> 8)); 3928 return value; 3929 } 3930 CONSTEXPR regioncfg_r &set_region4(NPU_NAMESPACE::mem_attr value) 3931 { 3932 word0 = (((~((1U << 2) - 1)) << 8) & word0) | ((((1U << 2) - 1) & static_cast<uint32_t>(value)) << 8); 3933 return *this; 3934 } 3935 volatile regioncfg_r &set_region4(NPU_NAMESPACE::mem_attr value) volatile 3936 { 3937 word0 = (((~((1U << 2) - 1)) << 8) & word0) | ((((1U << 2) - 1) & static_cast<uint32_t>(value)) << 8); 3938 return *this; 3939 } 3940 CONSTEXPR NPU_NAMESPACE::mem_attr get_region5() const 3941 { 3942 NPU_NAMESPACE::mem_attr value = static_cast<NPU_NAMESPACE::mem_attr>(((1U << 2) - 1) & (word0 >> 10)); 3943 return value; 3944 } 3945 NPU_NAMESPACE::mem_attr get_region5() const volatile 3946 { 3947 NPU_NAMESPACE::mem_attr value = static_cast<NPU_NAMESPACE::mem_attr>(((1U << 2) - 1) & (word0 >> 10)); 3948 return value; 3949 } 3950 CONSTEXPR regioncfg_r &set_region5(NPU_NAMESPACE::mem_attr value) 3951 { 3952 word0 = (((~((1U << 2) - 1)) << 10) & word0) | ((((1U << 2) - 1) & static_cast<uint32_t>(value)) << 10); 3953 return *this; 3954 } 3955 volatile regioncfg_r &set_region5(NPU_NAMESPACE::mem_attr value) volatile 3956 { 3957 word0 = (((~((1U << 2) - 1)) << 10) & word0) | ((((1U << 2) - 1) & static_cast<uint32_t>(value)) << 10); 3958 return *this; 3959 } 3960 CONSTEXPR NPU_NAMESPACE::mem_attr get_region6() const 3961 { 3962 NPU_NAMESPACE::mem_attr value = static_cast<NPU_NAMESPACE::mem_attr>(((1U << 2) - 1) & (word0 >> 12)); 3963 return value; 3964 } 3965 NPU_NAMESPACE::mem_attr get_region6() const volatile 3966 { 3967 NPU_NAMESPACE::mem_attr value = static_cast<NPU_NAMESPACE::mem_attr>(((1U << 2) - 1) & (word0 >> 12)); 3968 return value; 3969 } 3970 CONSTEXPR regioncfg_r &set_region6(NPU_NAMESPACE::mem_attr value) 3971 { 3972 word0 = (((~((1U << 2) - 1)) << 12) & word0) | ((((1U << 2) - 1) & static_cast<uint32_t>(value)) << 12); 3973 return *this; 3974 } 3975 volatile regioncfg_r &set_region6(NPU_NAMESPACE::mem_attr value) volatile 3976 { 3977 word0 = (((~((1U << 2) - 1)) << 12) & word0) | ((((1U << 2) - 1) & static_cast<uint32_t>(value)) << 12); 3978 return *this; 3979 } 3980 CONSTEXPR NPU_NAMESPACE::mem_attr get_region7() const 3981 { 3982 NPU_NAMESPACE::mem_attr value = static_cast<NPU_NAMESPACE::mem_attr>(((1U << 2) - 1) & (word0 >> 14)); 3983 return value; 3984 } 3985 NPU_NAMESPACE::mem_attr get_region7() const volatile 3986 { 3987 NPU_NAMESPACE::mem_attr value = static_cast<NPU_NAMESPACE::mem_attr>(((1U << 2) - 1) & (word0 >> 14)); 3988 return value; 3989 } 3990 CONSTEXPR regioncfg_r &set_region7(NPU_NAMESPACE::mem_attr value) 3991 { 3992 word0 = (((~((1U << 2) - 1)) << 14) & word0) | ((((1U << 2) - 1) & static_cast<uint32_t>(value)) << 14); 3993 return *this; 3994 } 3995 volatile regioncfg_r &set_region7(NPU_NAMESPACE::mem_attr value) volatile 3996 { 3997 word0 = (((~((1U << 2) - 1)) << 14) & word0) | ((((1U << 2) - 1) & static_cast<uint32_t>(value)) << 14); 3998 return *this; 3999 } 4000 #endif 4001 }; 4002 4003 // axi_limit0_r - AXI limits for port 0 counter 0 4004 struct axi_limit0_r 4005 { 4006 #ifndef __cplusplus 4007 union 4008 { 4009 struct 4010 { 4011 uint32_t max_beats : 2; // Burst split alignment 4012 uint32_t reserved0 : 2; 4013 uint32_t memtype : 4; // Memtype to be used to encode AxCACHE signals 4014 uint32_t reserved1 : 8; 4015 uint32_t 4016 max_outstanding_read_m1 : 5; // Maximum number of outstanding AXI read transactions - 1 in range 0 to 31 4017 uint32_t reserved2 : 3; 4018 uint32_t max_outstanding_write_m1 : 4; // Maximum number of outstanding AXI write transactions - 1 in range 4019 // 0 to 15 4020 uint32_t reserved3 : 4; 4021 }; 4022 uint32_t word; 4023 }; 4024 #else 4025 private: 4026 uint32_t word0; 4027 4028 public: 4029 CONSTEXPR axi_limit0_r() : word0(0) {} 4030 CONSTEXPR axi_limit0_r(uint32_t init) : word0(init) {} 4031 CONSTEXPR void operator=(uint32_t value) 4032 { 4033 word0 = value; 4034 } 4035 void operator=(uint32_t value) volatile 4036 { 4037 word0 = value; 4038 } 4039 CONSTEXPR operator uint32_t() 4040 { 4041 return word0; 4042 } 4043 operator uint32_t() volatile 4044 { 4045 return word0; 4046 } 4047 axi_limit0_r copy() volatile 4048 { 4049 return *this; 4050 } 4051 CONSTEXPR NPU_NAMESPACE::max_beats get_max_beats() const 4052 { 4053 NPU_NAMESPACE::max_beats value = static_cast<NPU_NAMESPACE::max_beats>(((1U << 2) - 1) & (word0 >> 0)); 4054 return value; 4055 } 4056 NPU_NAMESPACE::max_beats get_max_beats() const volatile 4057 { 4058 NPU_NAMESPACE::max_beats value = static_cast<NPU_NAMESPACE::max_beats>(((1U << 2) - 1) & (word0 >> 0)); 4059 return value; 4060 } 4061 CONSTEXPR axi_limit0_r &set_max_beats(NPU_NAMESPACE::max_beats value) 4062 { 4063 word0 = (((~((1U << 2) - 1)) << 0) & word0) | ((((1U << 2) - 1) & static_cast<uint32_t>(value)) << 0); 4064 return *this; 4065 } 4066 volatile axi_limit0_r &set_max_beats(NPU_NAMESPACE::max_beats value) volatile 4067 { 4068 word0 = (((~((1U << 2) - 1)) << 0) & word0) | ((((1U << 2) - 1) & static_cast<uint32_t>(value)) << 0); 4069 return *this; 4070 } 4071 CONSTEXPR NPU_NAMESPACE::axi_mem_encoding get_memtype() const 4072 { 4073 NPU_NAMESPACE::axi_mem_encoding value = 4074 static_cast<NPU_NAMESPACE::axi_mem_encoding>(((1U << 4) - 1) & (word0 >> 4)); 4075 return value; 4076 } 4077 NPU_NAMESPACE::axi_mem_encoding get_memtype() const volatile 4078 { 4079 NPU_NAMESPACE::axi_mem_encoding value = 4080 static_cast<NPU_NAMESPACE::axi_mem_encoding>(((1U << 4) - 1) & (word0 >> 4)); 4081 return value; 4082 } 4083 CONSTEXPR axi_limit0_r &set_memtype(NPU_NAMESPACE::axi_mem_encoding value) 4084 { 4085 word0 = (((~((1U << 4) - 1)) << 4) & word0) | ((((1U << 4) - 1) & static_cast<uint32_t>(value)) << 4); 4086 return *this; 4087 } 4088 volatile axi_limit0_r &set_memtype(NPU_NAMESPACE::axi_mem_encoding value) volatile 4089 { 4090 word0 = (((~((1U << 4) - 1)) << 4) & word0) | ((((1U << 4) - 1) & static_cast<uint32_t>(value)) << 4); 4091 return *this; 4092 } 4093 CONSTEXPR uint32_t get_max_outstanding_read_m1() const 4094 { 4095 uint32_t value = ((1U << 5) - 1) & (word0 >> 16); 4096 return value; 4097 } 4098 uint32_t get_max_outstanding_read_m1() const volatile 4099 { 4100 uint32_t value = ((1U << 5) - 1) & (word0 >> 16); 4101 return value; 4102 } 4103 CONSTEXPR axi_limit0_r &set_max_outstanding_read_m1(uint32_t value) 4104 { 4105 word0 = (((~((1U << 5) - 1)) << 16) & word0) | ((((1U << 5) - 1) & value) << 16); 4106 return *this; 4107 } 4108 volatile axi_limit0_r &set_max_outstanding_read_m1(uint32_t value) volatile 4109 { 4110 word0 = (((~((1U << 5) - 1)) << 16) & word0) | ((((1U << 5) - 1) & value) << 16); 4111 return *this; 4112 } 4113 CONSTEXPR uint32_t get_max_outstanding_write_m1() const 4114 { 4115 uint32_t value = ((1U << 4) - 1) & (word0 >> 24); 4116 return value; 4117 } 4118 uint32_t get_max_outstanding_write_m1() const volatile 4119 { 4120 uint32_t value = ((1U << 4) - 1) & (word0 >> 24); 4121 return value; 4122 } 4123 CONSTEXPR axi_limit0_r &set_max_outstanding_write_m1(uint32_t value) 4124 { 4125 word0 = (((~((1U << 4) - 1)) << 24) & word0) | ((((1U << 4) - 1) & value) << 24); 4126 return *this; 4127 } 4128 volatile axi_limit0_r &set_max_outstanding_write_m1(uint32_t value) volatile 4129 { 4130 word0 = (((~((1U << 4) - 1)) << 24) & word0) | ((((1U << 4) - 1) & value) << 24); 4131 return *this; 4132 } 4133 #endif 4134 }; 4135 4136 // axi_limit1_r - AXI limits for port 0 counter 1 4137 struct axi_limit1_r 4138 { 4139 #ifndef __cplusplus 4140 union 4141 { 4142 struct 4143 { 4144 uint32_t max_beats : 2; // Burst split alignment 4145 uint32_t reserved0 : 2; 4146 uint32_t memtype : 4; // Memtype to be used to encode AxCACHE signals 4147 uint32_t reserved1 : 8; 4148 uint32_t 4149 max_outstanding_read_m1 : 5; // Maximum number of outstanding AXI read transactions - 1 in range 0 to 31 4150 uint32_t reserved2 : 3; 4151 uint32_t max_outstanding_write_m1 : 4; // Maximum number of outstanding AXI write transactions - 1 in range 4152 // 0 to 15 4153 uint32_t reserved3 : 4; 4154 }; 4155 uint32_t word; 4156 }; 4157 #else 4158 private: 4159 uint32_t word0; 4160 4161 public: 4162 CONSTEXPR axi_limit1_r() : word0(0) {} 4163 CONSTEXPR axi_limit1_r(uint32_t init) : word0(init) {} 4164 CONSTEXPR void operator=(uint32_t value) 4165 { 4166 word0 = value; 4167 } 4168 void operator=(uint32_t value) volatile 4169 { 4170 word0 = value; 4171 } 4172 CONSTEXPR operator uint32_t() 4173 { 4174 return word0; 4175 } 4176 operator uint32_t() volatile 4177 { 4178 return word0; 4179 } 4180 axi_limit1_r copy() volatile 4181 { 4182 return *this; 4183 } 4184 CONSTEXPR NPU_NAMESPACE::max_beats get_max_beats() const 4185 { 4186 NPU_NAMESPACE::max_beats value = static_cast<NPU_NAMESPACE::max_beats>(((1U << 2) - 1) & (word0 >> 0)); 4187 return value; 4188 } 4189 NPU_NAMESPACE::max_beats get_max_beats() const volatile 4190 { 4191 NPU_NAMESPACE::max_beats value = static_cast<NPU_NAMESPACE::max_beats>(((1U << 2) - 1) & (word0 >> 0)); 4192 return value; 4193 } 4194 CONSTEXPR axi_limit1_r &set_max_beats(NPU_NAMESPACE::max_beats value) 4195 { 4196 word0 = (((~((1U << 2) - 1)) << 0) & word0) | ((((1U << 2) - 1) & static_cast<uint32_t>(value)) << 0); 4197 return *this; 4198 } 4199 volatile axi_limit1_r &set_max_beats(NPU_NAMESPACE::max_beats value) volatile 4200 { 4201 word0 = (((~((1U << 2) - 1)) << 0) & word0) | ((((1U << 2) - 1) & static_cast<uint32_t>(value)) << 0); 4202 return *this; 4203 } 4204 CONSTEXPR NPU_NAMESPACE::axi_mem_encoding get_memtype() const 4205 { 4206 NPU_NAMESPACE::axi_mem_encoding value = 4207 static_cast<NPU_NAMESPACE::axi_mem_encoding>(((1U << 4) - 1) & (word0 >> 4)); 4208 return value; 4209 } 4210 NPU_NAMESPACE::axi_mem_encoding get_memtype() const volatile 4211 { 4212 NPU_NAMESPACE::axi_mem_encoding value = 4213 static_cast<NPU_NAMESPACE::axi_mem_encoding>(((1U << 4) - 1) & (word0 >> 4)); 4214 return value; 4215 } 4216 CONSTEXPR axi_limit1_r &set_memtype(NPU_NAMESPACE::axi_mem_encoding value) 4217 { 4218 word0 = (((~((1U << 4) - 1)) << 4) & word0) | ((((1U << 4) - 1) & static_cast<uint32_t>(value)) << 4); 4219 return *this; 4220 } 4221 volatile axi_limit1_r &set_memtype(NPU_NAMESPACE::axi_mem_encoding value) volatile 4222 { 4223 word0 = (((~((1U << 4) - 1)) << 4) & word0) | ((((1U << 4) - 1) & static_cast<uint32_t>(value)) << 4); 4224 return *this; 4225 } 4226 CONSTEXPR uint32_t get_max_outstanding_read_m1() const 4227 { 4228 uint32_t value = ((1U << 5) - 1) & (word0 >> 16); 4229 return value; 4230 } 4231 uint32_t get_max_outstanding_read_m1() const volatile 4232 { 4233 uint32_t value = ((1U << 5) - 1) & (word0 >> 16); 4234 return value; 4235 } 4236 CONSTEXPR axi_limit1_r &set_max_outstanding_read_m1(uint32_t value) 4237 { 4238 word0 = (((~((1U << 5) - 1)) << 16) & word0) | ((((1U << 5) - 1) & value) << 16); 4239 return *this; 4240 } 4241 volatile axi_limit1_r &set_max_outstanding_read_m1(uint32_t value) volatile 4242 { 4243 word0 = (((~((1U << 5) - 1)) << 16) & word0) | ((((1U << 5) - 1) & value) << 16); 4244 return *this; 4245 } 4246 CONSTEXPR uint32_t get_max_outstanding_write_m1() const 4247 { 4248 uint32_t value = ((1U << 4) - 1) & (word0 >> 24); 4249 return value; 4250 } 4251 uint32_t get_max_outstanding_write_m1() const volatile 4252 { 4253 uint32_t value = ((1U << 4) - 1) & (word0 >> 24); 4254 return value; 4255 } 4256 CONSTEXPR axi_limit1_r &set_max_outstanding_write_m1(uint32_t value) 4257 { 4258 word0 = (((~((1U << 4) - 1)) << 24) & word0) | ((((1U << 4) - 1) & value) << 24); 4259 return *this; 4260 } 4261 volatile axi_limit1_r &set_max_outstanding_write_m1(uint32_t value) volatile 4262 { 4263 word0 = (((~((1U << 4) - 1)) << 24) & word0) | ((((1U << 4) - 1) & value) << 24); 4264 return *this; 4265 } 4266 #endif 4267 }; 4268 4269 // axi_limit2_r - AXI limits for port 1 counter 2 4270 struct axi_limit2_r 4271 { 4272 #ifndef __cplusplus 4273 union 4274 { 4275 struct 4276 { 4277 uint32_t max_beats : 2; // Burst split alignment 4278 uint32_t reserved0 : 2; 4279 uint32_t memtype : 4; // Memtype to be used to encode AxCACHE signals 4280 uint32_t reserved1 : 8; 4281 uint32_t 4282 max_outstanding_read_m1 : 5; // Maximum number of outstanding AXI read transactions - 1 in range 0 to 31 4283 uint32_t reserved2 : 3; 4284 uint32_t max_outstanding_write_m1 : 4; // Maximum number of outstanding AXI write transactions - 1 in range 4285 // 0 to 15 4286 uint32_t reserved3 : 4; 4287 }; 4288 uint32_t word; 4289 }; 4290 #else 4291 private: 4292 uint32_t word0; 4293 4294 public: 4295 CONSTEXPR axi_limit2_r() : word0(0) {} 4296 CONSTEXPR axi_limit2_r(uint32_t init) : word0(init) {} 4297 CONSTEXPR void operator=(uint32_t value) 4298 { 4299 word0 = value; 4300 } 4301 void operator=(uint32_t value) volatile 4302 { 4303 word0 = value; 4304 } 4305 CONSTEXPR operator uint32_t() 4306 { 4307 return word0; 4308 } 4309 operator uint32_t() volatile 4310 { 4311 return word0; 4312 } 4313 axi_limit2_r copy() volatile 4314 { 4315 return *this; 4316 } 4317 CONSTEXPR NPU_NAMESPACE::max_beats get_max_beats() const 4318 { 4319 NPU_NAMESPACE::max_beats value = static_cast<NPU_NAMESPACE::max_beats>(((1U << 2) - 1) & (word0 >> 0)); 4320 return value; 4321 } 4322 NPU_NAMESPACE::max_beats get_max_beats() const volatile 4323 { 4324 NPU_NAMESPACE::max_beats value = static_cast<NPU_NAMESPACE::max_beats>(((1U << 2) - 1) & (word0 >> 0)); 4325 return value; 4326 } 4327 CONSTEXPR axi_limit2_r &set_max_beats(NPU_NAMESPACE::max_beats value) 4328 { 4329 word0 = (((~((1U << 2) - 1)) << 0) & word0) | ((((1U << 2) - 1) & static_cast<uint32_t>(value)) << 0); 4330 return *this; 4331 } 4332 volatile axi_limit2_r &set_max_beats(NPU_NAMESPACE::max_beats value) volatile 4333 { 4334 word0 = (((~((1U << 2) - 1)) << 0) & word0) | ((((1U << 2) - 1) & static_cast<uint32_t>(value)) << 0); 4335 return *this; 4336 } 4337 CONSTEXPR NPU_NAMESPACE::axi_mem_encoding get_memtype() const 4338 { 4339 NPU_NAMESPACE::axi_mem_encoding value = 4340 static_cast<NPU_NAMESPACE::axi_mem_encoding>(((1U << 4) - 1) & (word0 >> 4)); 4341 return value; 4342 } 4343 NPU_NAMESPACE::axi_mem_encoding get_memtype() const volatile 4344 { 4345 NPU_NAMESPACE::axi_mem_encoding value = 4346 static_cast<NPU_NAMESPACE::axi_mem_encoding>(((1U << 4) - 1) & (word0 >> 4)); 4347 return value; 4348 } 4349 CONSTEXPR axi_limit2_r &set_memtype(NPU_NAMESPACE::axi_mem_encoding value) 4350 { 4351 word0 = (((~((1U << 4) - 1)) << 4) & word0) | ((((1U << 4) - 1) & static_cast<uint32_t>(value)) << 4); 4352 return *this; 4353 } 4354 volatile axi_limit2_r &set_memtype(NPU_NAMESPACE::axi_mem_encoding value) volatile 4355 { 4356 word0 = (((~((1U << 4) - 1)) << 4) & word0) | ((((1U << 4) - 1) & static_cast<uint32_t>(value)) << 4); 4357 return *this; 4358 } 4359 CONSTEXPR uint32_t get_max_outstanding_read_m1() const 4360 { 4361 uint32_t value = ((1U << 5) - 1) & (word0 >> 16); 4362 return value; 4363 } 4364 uint32_t get_max_outstanding_read_m1() const volatile 4365 { 4366 uint32_t value = ((1U << 5) - 1) & (word0 >> 16); 4367 return value; 4368 } 4369 CONSTEXPR axi_limit2_r &set_max_outstanding_read_m1(uint32_t value) 4370 { 4371 word0 = (((~((1U << 5) - 1)) << 16) & word0) | ((((1U << 5) - 1) & value) << 16); 4372 return *this; 4373 } 4374 volatile axi_limit2_r &set_max_outstanding_read_m1(uint32_t value) volatile 4375 { 4376 word0 = (((~((1U << 5) - 1)) << 16) & word0) | ((((1U << 5) - 1) & value) << 16); 4377 return *this; 4378 } 4379 CONSTEXPR uint32_t get_max_outstanding_write_m1() const 4380 { 4381 uint32_t value = ((1U << 4) - 1) & (word0 >> 24); 4382 return value; 4383 } 4384 uint32_t get_max_outstanding_write_m1() const volatile 4385 { 4386 uint32_t value = ((1U << 4) - 1) & (word0 >> 24); 4387 return value; 4388 } 4389 CONSTEXPR axi_limit2_r &set_max_outstanding_write_m1(uint32_t value) 4390 { 4391 word0 = (((~((1U << 4) - 1)) << 24) & word0) | ((((1U << 4) - 1) & value) << 24); 4392 return *this; 4393 } 4394 volatile axi_limit2_r &set_max_outstanding_write_m1(uint32_t value) volatile 4395 { 4396 word0 = (((~((1U << 4) - 1)) << 24) & word0) | ((((1U << 4) - 1) & value) << 24); 4397 return *this; 4398 } 4399 #endif 4400 }; 4401 4402 // axi_limit3_r - AXI limits for port 1 counter 3 4403 struct axi_limit3_r 4404 { 4405 #ifndef __cplusplus 4406 union 4407 { 4408 struct 4409 { 4410 uint32_t max_beats : 2; // Burst split alignment 4411 uint32_t reserved0 : 2; 4412 uint32_t memtype : 4; // Memtype to be used to encode AxCACHE signals 4413 uint32_t reserved1 : 8; 4414 uint32_t 4415 max_outstanding_read_m1 : 5; // Maximum number of outstanding AXI read transactions - 1 in range 0 to 31 4416 uint32_t reserved2 : 3; 4417 uint32_t max_outstanding_write_m1 : 4; // Maximum number of outstanding AXI write transactions - 1 in range 4418 // 0 to 15 4419 uint32_t reserved3 : 4; 4420 }; 4421 uint32_t word; 4422 }; 4423 #else 4424 private: 4425 uint32_t word0; 4426 4427 public: 4428 CONSTEXPR axi_limit3_r() : word0(0) {} 4429 CONSTEXPR axi_limit3_r(uint32_t init) : word0(init) {} 4430 CONSTEXPR void operator=(uint32_t value) 4431 { 4432 word0 = value; 4433 } 4434 void operator=(uint32_t value) volatile 4435 { 4436 word0 = value; 4437 } 4438 CONSTEXPR operator uint32_t() 4439 { 4440 return word0; 4441 } 4442 operator uint32_t() volatile 4443 { 4444 return word0; 4445 } 4446 axi_limit3_r copy() volatile 4447 { 4448 return *this; 4449 } 4450 CONSTEXPR NPU_NAMESPACE::max_beats get_max_beats() const 4451 { 4452 NPU_NAMESPACE::max_beats value = static_cast<NPU_NAMESPACE::max_beats>(((1U << 2) - 1) & (word0 >> 0)); 4453 return value; 4454 } 4455 NPU_NAMESPACE::max_beats get_max_beats() const volatile 4456 { 4457 NPU_NAMESPACE::max_beats value = static_cast<NPU_NAMESPACE::max_beats>(((1U << 2) - 1) & (word0 >> 0)); 4458 return value; 4459 } 4460 CONSTEXPR axi_limit3_r &set_max_beats(NPU_NAMESPACE::max_beats value) 4461 { 4462 word0 = (((~((1U << 2) - 1)) << 0) & word0) | ((((1U << 2) - 1) & static_cast<uint32_t>(value)) << 0); 4463 return *this; 4464 } 4465 volatile axi_limit3_r &set_max_beats(NPU_NAMESPACE::max_beats value) volatile 4466 { 4467 word0 = (((~((1U << 2) - 1)) << 0) & word0) | ((((1U << 2) - 1) & static_cast<uint32_t>(value)) << 0); 4468 return *this; 4469 } 4470 CONSTEXPR NPU_NAMESPACE::axi_mem_encoding get_memtype() const 4471 { 4472 NPU_NAMESPACE::axi_mem_encoding value = 4473 static_cast<NPU_NAMESPACE::axi_mem_encoding>(((1U << 4) - 1) & (word0 >> 4)); 4474 return value; 4475 } 4476 NPU_NAMESPACE::axi_mem_encoding get_memtype() const volatile 4477 { 4478 NPU_NAMESPACE::axi_mem_encoding value = 4479 static_cast<NPU_NAMESPACE::axi_mem_encoding>(((1U << 4) - 1) & (word0 >> 4)); 4480 return value; 4481 } 4482 CONSTEXPR axi_limit3_r &set_memtype(NPU_NAMESPACE::axi_mem_encoding value) 4483 { 4484 word0 = (((~((1U << 4) - 1)) << 4) & word0) | ((((1U << 4) - 1) & static_cast<uint32_t>(value)) << 4); 4485 return *this; 4486 } 4487 volatile axi_limit3_r &set_memtype(NPU_NAMESPACE::axi_mem_encoding value) volatile 4488 { 4489 word0 = (((~((1U << 4) - 1)) << 4) & word0) | ((((1U << 4) - 1) & static_cast<uint32_t>(value)) << 4); 4490 return *this; 4491 } 4492 CONSTEXPR uint32_t get_max_outstanding_read_m1() const 4493 { 4494 uint32_t value = ((1U << 5) - 1) & (word0 >> 16); 4495 return value; 4496 } 4497 uint32_t get_max_outstanding_read_m1() const volatile 4498 { 4499 uint32_t value = ((1U << 5) - 1) & (word0 >> 16); 4500 return value; 4501 } 4502 CONSTEXPR axi_limit3_r &set_max_outstanding_read_m1(uint32_t value) 4503 { 4504 word0 = (((~((1U << 5) - 1)) << 16) & word0) | ((((1U << 5) - 1) & value) << 16); 4505 return *this; 4506 } 4507 volatile axi_limit3_r &set_max_outstanding_read_m1(uint32_t value) volatile 4508 { 4509 word0 = (((~((1U << 5) - 1)) << 16) & word0) | ((((1U << 5) - 1) & value) << 16); 4510 return *this; 4511 } 4512 CONSTEXPR uint32_t get_max_outstanding_write_m1() const 4513 { 4514 uint32_t value = ((1U << 4) - 1) & (word0 >> 24); 4515 return value; 4516 } 4517 uint32_t get_max_outstanding_write_m1() const volatile 4518 { 4519 uint32_t value = ((1U << 4) - 1) & (word0 >> 24); 4520 return value; 4521 } 4522 CONSTEXPR axi_limit3_r &set_max_outstanding_write_m1(uint32_t value) 4523 { 4524 word0 = (((~((1U << 4) - 1)) << 24) & word0) | ((((1U << 4) - 1) & value) << 24); 4525 return *this; 4526 } 4527 volatile axi_limit3_r &set_max_outstanding_write_m1(uint32_t value) volatile 4528 { 4529 word0 = (((~((1U << 4) - 1)) << 24) & word0) | ((((1U << 4) - 1) & value) << 24); 4530 return *this; 4531 } 4532 #endif 4533 }; 4534 4535 // basep_r - The driver can use this address to relocate the command stream on region 0. If the region contains data 4536 // requiring A-byte alignment then the base must be a multiple of A 4537 struct basep_r 4538 { 4539 #ifndef __cplusplus 4540 union 4541 { 4542 struct 4543 { 4544 uint32_t offset : 32; // Offset 4545 uint32_t reserved0 : 32; 4546 }; 4547 uint32_t word[2]; 4548 }; 4549 #else 4550 private: 4551 uint32_t word0; 4552 uint32_t word1; 4553 4554 public: 4555 CONSTEXPR basep_r() : word0(0), word1(0) {} 4556 CONSTEXPR basep_r(uint64_t init) : 4557 word0(static_cast<uint32_t>((init)&std::numeric_limits<uint64_t>::max())), 4558 word1(static_cast<uint32_t>((init >> 32) & std::numeric_limits<uint64_t>::max())) 4559 { 4560 } 4561 CONSTEXPR void operator=(uint64_t value) 4562 { 4563 word0 = static_cast<uint32_t>((value)&std::numeric_limits<uint64_t>::max()); 4564 word1 = static_cast<uint32_t>((value >> 32) & std::numeric_limits<uint64_t>::max()); 4565 } 4566 void operator=(uint64_t value) volatile 4567 { 4568 word0 = static_cast<uint32_t>((value)&std::numeric_limits<uint64_t>::max()); 4569 word1 = static_cast<uint32_t>((value >> 32) & std::numeric_limits<uint64_t>::max()); 4570 } 4571 CONSTEXPR operator uint64_t() 4572 { 4573 return (static_cast<uint64_t>(word1) << 32) | word0; 4574 } 4575 operator uint64_t() volatile 4576 { 4577 return (static_cast<uint64_t>(word1) << 32) | word0; 4578 } 4579 basep_r copy() volatile 4580 { 4581 return *this; 4582 } 4583 #endif 4584 }; 4585 4586 // wd_status_r - WD_STATUS 4587 struct wd_status_r 4588 { 4589 #ifndef __cplusplus 4590 union 4591 { 4592 struct 4593 { 4594 uint32_t core_slice_state : 2; // WD core slice parser state 4595 uint32_t core_idle : 1; // Core idle 4596 uint32_t ctrl_state : 2; // WD control state 4597 uint32_t ctrl_idle : 1; // All stripe jobs idle (all weights consumed) 4598 uint32_t write_buf_index0 : 3; // current write index for next data from core 4599 uint32_t write_buf_valid0 : 1; // write buf valid (full) 4600 uint32_t write_buf_idle0 : 1; // write buf idle (empty) 4601 uint32_t write_buf_index1 : 3; // current write index for next data from core 4602 uint32_t write_buf_valid1 : 1; // write buf valid (full) 4603 uint32_t write_buf_idle1 : 1; // write buf idle (empty) 4604 uint32_t events : 12; // WD events mapped as appendix A 4605 uint32_t reserved0 : 4; 4606 }; 4607 uint32_t word; 4608 }; 4609 #else 4610 private: 4611 uint32_t word0; 4612 4613 public: 4614 CONSTEXPR wd_status_r() : word0(0) {} 4615 CONSTEXPR wd_status_r(uint32_t init) : word0(init) {} 4616 CONSTEXPR void operator=(uint32_t value) 4617 { 4618 word0 = value; 4619 } 4620 void operator=(uint32_t value) volatile 4621 { 4622 word0 = value; 4623 } 4624 CONSTEXPR operator uint32_t() 4625 { 4626 return word0; 4627 } 4628 operator uint32_t() volatile 4629 { 4630 return word0; 4631 } 4632 wd_status_r copy() volatile 4633 { 4634 return *this; 4635 } 4636 CONSTEXPR NPU_NAMESPACE::wd_core_slice_state get_core_slice_state() const 4637 { 4638 NPU_NAMESPACE::wd_core_slice_state value = 4639 static_cast<NPU_NAMESPACE::wd_core_slice_state>(((1U << 2) - 1) & (word0 >> 0)); 4640 return value; 4641 } 4642 NPU_NAMESPACE::wd_core_slice_state get_core_slice_state() const volatile 4643 { 4644 NPU_NAMESPACE::wd_core_slice_state value = 4645 static_cast<NPU_NAMESPACE::wd_core_slice_state>(((1U << 2) - 1) & (word0 >> 0)); 4646 return value; 4647 } 4648 CONSTEXPR wd_status_r &set_core_slice_state(NPU_NAMESPACE::wd_core_slice_state value) 4649 { 4650 word0 = (((~((1U << 2) - 1)) << 0) & word0) | ((((1U << 2) - 1) & static_cast<uint32_t>(value)) << 0); 4651 return *this; 4652 } 4653 volatile wd_status_r &set_core_slice_state(NPU_NAMESPACE::wd_core_slice_state value) volatile 4654 { 4655 word0 = (((~((1U << 2) - 1)) << 0) & word0) | ((((1U << 2) - 1) & static_cast<uint32_t>(value)) << 0); 4656 return *this; 4657 } 4658 CONSTEXPR uint32_t get_core_idle() const 4659 { 4660 uint32_t value = ((1U << 1) - 1) & (word0 >> 2); 4661 return value; 4662 } 4663 uint32_t get_core_idle() const volatile 4664 { 4665 uint32_t value = ((1U << 1) - 1) & (word0 >> 2); 4666 return value; 4667 } 4668 CONSTEXPR wd_status_r &set_core_idle(uint32_t value) 4669 { 4670 word0 = (((~((1U << 1) - 1)) << 2) & word0) | ((((1U << 1) - 1) & value) << 2); 4671 return *this; 4672 } 4673 volatile wd_status_r &set_core_idle(uint32_t value) volatile 4674 { 4675 word0 = (((~((1U << 1) - 1)) << 2) & word0) | ((((1U << 1) - 1) & value) << 2); 4676 return *this; 4677 } 4678 CONSTEXPR NPU_NAMESPACE::wd_ctrl_state get_ctrl_state() const 4679 { 4680 NPU_NAMESPACE::wd_ctrl_state value = static_cast<NPU_NAMESPACE::wd_ctrl_state>(((1U << 2) - 1) & (word0 >> 3)); 4681 return value; 4682 } 4683 NPU_NAMESPACE::wd_ctrl_state get_ctrl_state() const volatile 4684 { 4685 NPU_NAMESPACE::wd_ctrl_state value = static_cast<NPU_NAMESPACE::wd_ctrl_state>(((1U << 2) - 1) & (word0 >> 3)); 4686 return value; 4687 } 4688 CONSTEXPR wd_status_r &set_ctrl_state(NPU_NAMESPACE::wd_ctrl_state value) 4689 { 4690 word0 = (((~((1U << 2) - 1)) << 3) & word0) | ((((1U << 2) - 1) & static_cast<uint32_t>(value)) << 3); 4691 return *this; 4692 } 4693 volatile wd_status_r &set_ctrl_state(NPU_NAMESPACE::wd_ctrl_state value) volatile 4694 { 4695 word0 = (((~((1U << 2) - 1)) << 3) & word0) | ((((1U << 2) - 1) & static_cast<uint32_t>(value)) << 3); 4696 return *this; 4697 } 4698 CONSTEXPR uint32_t get_ctrl_idle() const 4699 { 4700 uint32_t value = ((1U << 1) - 1) & (word0 >> 5); 4701 return value; 4702 } 4703 uint32_t get_ctrl_idle() const volatile 4704 { 4705 uint32_t value = ((1U << 1) - 1) & (word0 >> 5); 4706 return value; 4707 } 4708 CONSTEXPR wd_status_r &set_ctrl_idle(uint32_t value) 4709 { 4710 word0 = (((~((1U << 1) - 1)) << 5) & word0) | ((((1U << 1) - 1) & value) << 5); 4711 return *this; 4712 } 4713 volatile wd_status_r &set_ctrl_idle(uint32_t value) volatile 4714 { 4715 word0 = (((~((1U << 1) - 1)) << 5) & word0) | ((((1U << 1) - 1) & value) << 5); 4716 return *this; 4717 } 4718 CONSTEXPR uint32_t get_write_buf_index0() const 4719 { 4720 uint32_t value = ((1U << 3) - 1) & (word0 >> 6); 4721 return value; 4722 } 4723 uint32_t get_write_buf_index0() const volatile 4724 { 4725 uint32_t value = ((1U << 3) - 1) & (word0 >> 6); 4726 return value; 4727 } 4728 CONSTEXPR wd_status_r &set_write_buf_index0(uint32_t value) 4729 { 4730 word0 = (((~((1U << 3) - 1)) << 6) & word0) | ((((1U << 3) - 1) & value) << 6); 4731 return *this; 4732 } 4733 volatile wd_status_r &set_write_buf_index0(uint32_t value) volatile 4734 { 4735 word0 = (((~((1U << 3) - 1)) << 6) & word0) | ((((1U << 3) - 1) & value) << 6); 4736 return *this; 4737 } 4738 CONSTEXPR uint32_t get_write_buf_valid0() const 4739 { 4740 uint32_t value = ((1U << 1) - 1) & (word0 >> 9); 4741 return value; 4742 } 4743 uint32_t get_write_buf_valid0() const volatile 4744 { 4745 uint32_t value = ((1U << 1) - 1) & (word0 >> 9); 4746 return value; 4747 } 4748 CONSTEXPR wd_status_r &set_write_buf_valid0(uint32_t value) 4749 { 4750 word0 = (((~((1U << 1) - 1)) << 9) & word0) | ((((1U << 1) - 1) & value) << 9); 4751 return *this; 4752 } 4753 volatile wd_status_r &set_write_buf_valid0(uint32_t value) volatile 4754 { 4755 word0 = (((~((1U << 1) - 1)) << 9) & word0) | ((((1U << 1) - 1) & value) << 9); 4756 return *this; 4757 } 4758 CONSTEXPR uint32_t get_write_buf_idle0() const 4759 { 4760 uint32_t value = ((1U << 1) - 1) & (word0 >> 10); 4761 return value; 4762 } 4763 uint32_t get_write_buf_idle0() const volatile 4764 { 4765 uint32_t value = ((1U << 1) - 1) & (word0 >> 10); 4766 return value; 4767 } 4768 CONSTEXPR wd_status_r &set_write_buf_idle0(uint32_t value) 4769 { 4770 word0 = (((~((1U << 1) - 1)) << 10) & word0) | ((((1U << 1) - 1) & value) << 10); 4771 return *this; 4772 } 4773 volatile wd_status_r &set_write_buf_idle0(uint32_t value) volatile 4774 { 4775 word0 = (((~((1U << 1) - 1)) << 10) & word0) | ((((1U << 1) - 1) & value) << 10); 4776 return *this; 4777 } 4778 CONSTEXPR uint32_t get_write_buf_index1() const 4779 { 4780 uint32_t value = ((1U << 3) - 1) & (word0 >> 11); 4781 return value; 4782 } 4783 uint32_t get_write_buf_index1() const volatile 4784 { 4785 uint32_t value = ((1U << 3) - 1) & (word0 >> 11); 4786 return value; 4787 } 4788 CONSTEXPR wd_status_r &set_write_buf_index1(uint32_t value) 4789 { 4790 word0 = (((~((1U << 3) - 1)) << 11) & word0) | ((((1U << 3) - 1) & value) << 11); 4791 return *this; 4792 } 4793 volatile wd_status_r &set_write_buf_index1(uint32_t value) volatile 4794 { 4795 word0 = (((~((1U << 3) - 1)) << 11) & word0) | ((((1U << 3) - 1) & value) << 11); 4796 return *this; 4797 } 4798 CONSTEXPR uint32_t get_write_buf_valid1() const 4799 { 4800 uint32_t value = ((1U << 1) - 1) & (word0 >> 14); 4801 return value; 4802 } 4803 uint32_t get_write_buf_valid1() const volatile 4804 { 4805 uint32_t value = ((1U << 1) - 1) & (word0 >> 14); 4806 return value; 4807 } 4808 CONSTEXPR wd_status_r &set_write_buf_valid1(uint32_t value) 4809 { 4810 word0 = (((~((1U << 1) - 1)) << 14) & word0) | ((((1U << 1) - 1) & value) << 14); 4811 return *this; 4812 } 4813 volatile wd_status_r &set_write_buf_valid1(uint32_t value) volatile 4814 { 4815 word0 = (((~((1U << 1) - 1)) << 14) & word0) | ((((1U << 1) - 1) & value) << 14); 4816 return *this; 4817 } 4818 CONSTEXPR uint32_t get_write_buf_idle1() const 4819 { 4820 uint32_t value = ((1U << 1) - 1) & (word0 >> 15); 4821 return value; 4822 } 4823 uint32_t get_write_buf_idle1() const volatile 4824 { 4825 uint32_t value = ((1U << 1) - 1) & (word0 >> 15); 4826 return value; 4827 } 4828 CONSTEXPR wd_status_r &set_write_buf_idle1(uint32_t value) 4829 { 4830 word0 = (((~((1U << 1) - 1)) << 15) & word0) | ((((1U << 1) - 1) & value) << 15); 4831 return *this; 4832 } 4833 volatile wd_status_r &set_write_buf_idle1(uint32_t value) volatile 4834 { 4835 word0 = (((~((1U << 1) - 1)) << 15) & word0) | ((((1U << 1) - 1) & value) << 15); 4836 return *this; 4837 } 4838 CONSTEXPR uint32_t get_events() const 4839 { 4840 uint32_t value = ((1U << 12) - 1) & (word0 >> 16); 4841 return value; 4842 } 4843 uint32_t get_events() const volatile 4844 { 4845 uint32_t value = ((1U << 12) - 1) & (word0 >> 16); 4846 return value; 4847 } 4848 CONSTEXPR wd_status_r &set_events(uint32_t value) 4849 { 4850 word0 = (((~((1U << 12) - 1)) << 16) & word0) | ((((1U << 12) - 1) & value) << 16); 4851 return *this; 4852 } 4853 volatile wd_status_r &set_events(uint32_t value) volatile 4854 { 4855 word0 = (((~((1U << 12) - 1)) << 16) & word0) | ((((1U << 12) - 1) & value) << 16); 4856 return *this; 4857 } 4858 #endif 4859 }; 4860 4861 // mac_status_r - MAC_STATUS 4862 struct mac_status_r 4863 { 4864 #ifndef __cplusplus 4865 union 4866 { 4867 struct 4868 { 4869 uint32_t block_cfg_valid : 1; // MAC has a valid block configuration 4870 uint32_t trav_en : 1; // MAC is doing block traversal 4871 uint32_t wait_for_ib : 1; // MAC is waiting for an Input Buffer to become available 4872 uint32_t wait_for_acc_buf : 1; // MAC is waiting for an Accumulator Buffer to become available 4873 uint32_t wait_for_weights : 1; // MAC is waiting for a Weight Block to become available 4874 uint32_t stall_stripe : 1; // MAC is stalling between two stripes 4875 uint32_t dw_sel : 1; // Currently used weight interface in MAC AI 4876 uint32_t wait_for_dw0_ready : 1; // MAC AI is waiting for MAC DPU to send dw0_ready to WD 4877 uint32_t wait_for_dw1_ready : 1; // MAC AI is waiting for MAC DPU to send dw1_ready to WD 4878 uint32_t acc_buf_sel_ai : 1; // Currently used AccBuf interface in MAC AI 4879 uint32_t wait_for_acc0_ready : 1; // MAC AI is waiting for acc0_ready from AO 4880 uint32_t wait_for_acc1_ready : 1; // MAC AI is waiting for acc1_ready from AO 4881 uint32_t acc_buf_sel_aa : 1; // Currently used AccBuf interface in MAC ADDER_ARRAY 4882 uint32_t acc0_valid : 1; // MAC outgoing value of acc0_valid 4883 uint32_t acc1_valid : 1; // MAC outgoing value of acc1_valid 4884 uint32_t reserved0 : 1; 4885 uint32_t events : 11; // Mapped to MAC events described in Appendix A 4886 uint32_t reserved1 : 5; 4887 }; 4888 uint32_t word; 4889 }; 4890 #else 4891 private: 4892 uint32_t word0; 4893 4894 public: 4895 CONSTEXPR mac_status_r() : word0(0) {} 4896 CONSTEXPR mac_status_r(uint32_t init) : word0(init) {} 4897 CONSTEXPR void operator=(uint32_t value) 4898 { 4899 word0 = value; 4900 } 4901 void operator=(uint32_t value) volatile 4902 { 4903 word0 = value; 4904 } 4905 CONSTEXPR operator uint32_t() 4906 { 4907 return word0; 4908 } 4909 operator uint32_t() volatile 4910 { 4911 return word0; 4912 } 4913 mac_status_r copy() volatile 4914 { 4915 return *this; 4916 } 4917 CONSTEXPR uint32_t get_block_cfg_valid() const 4918 { 4919 uint32_t value = ((1U << 1) - 1) & (word0 >> 0); 4920 return value; 4921 } 4922 uint32_t get_block_cfg_valid() const volatile 4923 { 4924 uint32_t value = ((1U << 1) - 1) & (word0 >> 0); 4925 return value; 4926 } 4927 CONSTEXPR mac_status_r &set_block_cfg_valid(uint32_t value) 4928 { 4929 word0 = (((~((1U << 1) - 1)) << 0) & word0) | ((((1U << 1) - 1) & value) << 0); 4930 return *this; 4931 } 4932 volatile mac_status_r &set_block_cfg_valid(uint32_t value) volatile 4933 { 4934 word0 = (((~((1U << 1) - 1)) << 0) & word0) | ((((1U << 1) - 1) & value) << 0); 4935 return *this; 4936 } 4937 CONSTEXPR uint32_t get_trav_en() const 4938 { 4939 uint32_t value = ((1U << 1) - 1) & (word0 >> 1); 4940 return value; 4941 } 4942 uint32_t get_trav_en() const volatile 4943 { 4944 uint32_t value = ((1U << 1) - 1) & (word0 >> 1); 4945 return value; 4946 } 4947 CONSTEXPR mac_status_r &set_trav_en(uint32_t value) 4948 { 4949 word0 = (((~((1U << 1) - 1)) << 1) & word0) | ((((1U << 1) - 1) & value) << 1); 4950 return *this; 4951 } 4952 volatile mac_status_r &set_trav_en(uint32_t value) volatile 4953 { 4954 word0 = (((~((1U << 1) - 1)) << 1) & word0) | ((((1U << 1) - 1) & value) << 1); 4955 return *this; 4956 } 4957 CONSTEXPR uint32_t get_wait_for_ib() const 4958 { 4959 uint32_t value = ((1U << 1) - 1) & (word0 >> 2); 4960 return value; 4961 } 4962 uint32_t get_wait_for_ib() const volatile 4963 { 4964 uint32_t value = ((1U << 1) - 1) & (word0 >> 2); 4965 return value; 4966 } 4967 CONSTEXPR mac_status_r &set_wait_for_ib(uint32_t value) 4968 { 4969 word0 = (((~((1U << 1) - 1)) << 2) & word0) | ((((1U << 1) - 1) & value) << 2); 4970 return *this; 4971 } 4972 volatile mac_status_r &set_wait_for_ib(uint32_t value) volatile 4973 { 4974 word0 = (((~((1U << 1) - 1)) << 2) & word0) | ((((1U << 1) - 1) & value) << 2); 4975 return *this; 4976 } 4977 CONSTEXPR uint32_t get_wait_for_acc_buf() const 4978 { 4979 uint32_t value = ((1U << 1) - 1) & (word0 >> 3); 4980 return value; 4981 } 4982 uint32_t get_wait_for_acc_buf() const volatile 4983 { 4984 uint32_t value = ((1U << 1) - 1) & (word0 >> 3); 4985 return value; 4986 } 4987 CONSTEXPR mac_status_r &set_wait_for_acc_buf(uint32_t value) 4988 { 4989 word0 = (((~((1U << 1) - 1)) << 3) & word0) | ((((1U << 1) - 1) & value) << 3); 4990 return *this; 4991 } 4992 volatile mac_status_r &set_wait_for_acc_buf(uint32_t value) volatile 4993 { 4994 word0 = (((~((1U << 1) - 1)) << 3) & word0) | ((((1U << 1) - 1) & value) << 3); 4995 return *this; 4996 } 4997 CONSTEXPR uint32_t get_wait_for_weights() const 4998 { 4999 uint32_t value = ((1U << 1) - 1) & (word0 >> 4); 5000 return value; 5001 } 5002 uint32_t get_wait_for_weights() const volatile 5003 { 5004 uint32_t value = ((1U << 1) - 1) & (word0 >> 4); 5005 return value; 5006 } 5007 CONSTEXPR mac_status_r &set_wait_for_weights(uint32_t value) 5008 { 5009 word0 = (((~((1U << 1) - 1)) << 4) & word0) | ((((1U << 1) - 1) & value) << 4); 5010 return *this; 5011 } 5012 volatile mac_status_r &set_wait_for_weights(uint32_t value) volatile 5013 { 5014 word0 = (((~((1U << 1) - 1)) << 4) & word0) | ((((1U << 1) - 1) & value) << 4); 5015 return *this; 5016 } 5017 CONSTEXPR uint32_t get_stall_stripe() const 5018 { 5019 uint32_t value = ((1U << 1) - 1) & (word0 >> 5); 5020 return value; 5021 } 5022 uint32_t get_stall_stripe() const volatile 5023 { 5024 uint32_t value = ((1U << 1) - 1) & (word0 >> 5); 5025 return value; 5026 } 5027 CONSTEXPR mac_status_r &set_stall_stripe(uint32_t value) 5028 { 5029 word0 = (((~((1U << 1) - 1)) << 5) & word0) | ((((1U << 1) - 1) & value) << 5); 5030 return *this; 5031 } 5032 volatile mac_status_r &set_stall_stripe(uint32_t value) volatile 5033 { 5034 word0 = (((~((1U << 1) - 1)) << 5) & word0) | ((((1U << 1) - 1) & value) << 5); 5035 return *this; 5036 } 5037 CONSTEXPR uint32_t get_dw_sel() const 5038 { 5039 uint32_t value = ((1U << 1) - 1) & (word0 >> 6); 5040 return value; 5041 } 5042 uint32_t get_dw_sel() const volatile 5043 { 5044 uint32_t value = ((1U << 1) - 1) & (word0 >> 6); 5045 return value; 5046 } 5047 CONSTEXPR mac_status_r &set_dw_sel(uint32_t value) 5048 { 5049 word0 = (((~((1U << 1) - 1)) << 6) & word0) | ((((1U << 1) - 1) & value) << 6); 5050 return *this; 5051 } 5052 volatile mac_status_r &set_dw_sel(uint32_t value) volatile 5053 { 5054 word0 = (((~((1U << 1) - 1)) << 6) & word0) | ((((1U << 1) - 1) & value) << 6); 5055 return *this; 5056 } 5057 CONSTEXPR uint32_t get_wait_for_dw0_ready() const 5058 { 5059 uint32_t value = ((1U << 1) - 1) & (word0 >> 7); 5060 return value; 5061 } 5062 uint32_t get_wait_for_dw0_ready() const volatile 5063 { 5064 uint32_t value = ((1U << 1) - 1) & (word0 >> 7); 5065 return value; 5066 } 5067 CONSTEXPR mac_status_r &set_wait_for_dw0_ready(uint32_t value) 5068 { 5069 word0 = (((~((1U << 1) - 1)) << 7) & word0) | ((((1U << 1) - 1) & value) << 7); 5070 return *this; 5071 } 5072 volatile mac_status_r &set_wait_for_dw0_ready(uint32_t value) volatile 5073 { 5074 word0 = (((~((1U << 1) - 1)) << 7) & word0) | ((((1U << 1) - 1) & value) << 7); 5075 return *this; 5076 } 5077 CONSTEXPR uint32_t get_wait_for_dw1_ready() const 5078 { 5079 uint32_t value = ((1U << 1) - 1) & (word0 >> 8); 5080 return value; 5081 } 5082 uint32_t get_wait_for_dw1_ready() const volatile 5083 { 5084 uint32_t value = ((1U << 1) - 1) & (word0 >> 8); 5085 return value; 5086 } 5087 CONSTEXPR mac_status_r &set_wait_for_dw1_ready(uint32_t value) 5088 { 5089 word0 = (((~((1U << 1) - 1)) << 8) & word0) | ((((1U << 1) - 1) & value) << 8); 5090 return *this; 5091 } 5092 volatile mac_status_r &set_wait_for_dw1_ready(uint32_t value) volatile 5093 { 5094 word0 = (((~((1U << 1) - 1)) << 8) & word0) | ((((1U << 1) - 1) & value) << 8); 5095 return *this; 5096 } 5097 CONSTEXPR uint32_t get_acc_buf_sel_ai() const 5098 { 5099 uint32_t value = ((1U << 1) - 1) & (word0 >> 9); 5100 return value; 5101 } 5102 uint32_t get_acc_buf_sel_ai() const volatile 5103 { 5104 uint32_t value = ((1U << 1) - 1) & (word0 >> 9); 5105 return value; 5106 } 5107 CONSTEXPR mac_status_r &set_acc_buf_sel_ai(uint32_t value) 5108 { 5109 word0 = (((~((1U << 1) - 1)) << 9) & word0) | ((((1U << 1) - 1) & value) << 9); 5110 return *this; 5111 } 5112 volatile mac_status_r &set_acc_buf_sel_ai(uint32_t value) volatile 5113 { 5114 word0 = (((~((1U << 1) - 1)) << 9) & word0) | ((((1U << 1) - 1) & value) << 9); 5115 return *this; 5116 } 5117 CONSTEXPR uint32_t get_wait_for_acc0_ready() const 5118 { 5119 uint32_t value = ((1U << 1) - 1) & (word0 >> 10); 5120 return value; 5121 } 5122 uint32_t get_wait_for_acc0_ready() const volatile 5123 { 5124 uint32_t value = ((1U << 1) - 1) & (word0 >> 10); 5125 return value; 5126 } 5127 CONSTEXPR mac_status_r &set_wait_for_acc0_ready(uint32_t value) 5128 { 5129 word0 = (((~((1U << 1) - 1)) << 10) & word0) | ((((1U << 1) - 1) & value) << 10); 5130 return *this; 5131 } 5132 volatile mac_status_r &set_wait_for_acc0_ready(uint32_t value) volatile 5133 { 5134 word0 = (((~((1U << 1) - 1)) << 10) & word0) | ((((1U << 1) - 1) & value) << 10); 5135 return *this; 5136 } 5137 CONSTEXPR uint32_t get_wait_for_acc1_ready() const 5138 { 5139 uint32_t value = ((1U << 1) - 1) & (word0 >> 11); 5140 return value; 5141 } 5142 uint32_t get_wait_for_acc1_ready() const volatile 5143 { 5144 uint32_t value = ((1U << 1) - 1) & (word0 >> 11); 5145 return value; 5146 } 5147 CONSTEXPR mac_status_r &set_wait_for_acc1_ready(uint32_t value) 5148 { 5149 word0 = (((~((1U << 1) - 1)) << 11) & word0) | ((((1U << 1) - 1) & value) << 11); 5150 return *this; 5151 } 5152 volatile mac_status_r &set_wait_for_acc1_ready(uint32_t value) volatile 5153 { 5154 word0 = (((~((1U << 1) - 1)) << 11) & word0) | ((((1U << 1) - 1) & value) << 11); 5155 return *this; 5156 } 5157 CONSTEXPR uint32_t get_acc_buf_sel_aa() const 5158 { 5159 uint32_t value = ((1U << 1) - 1) & (word0 >> 12); 5160 return value; 5161 } 5162 uint32_t get_acc_buf_sel_aa() const volatile 5163 { 5164 uint32_t value = ((1U << 1) - 1) & (word0 >> 12); 5165 return value; 5166 } 5167 CONSTEXPR mac_status_r &set_acc_buf_sel_aa(uint32_t value) 5168 { 5169 word0 = (((~((1U << 1) - 1)) << 12) & word0) | ((((1U << 1) - 1) & value) << 12); 5170 return *this; 5171 } 5172 volatile mac_status_r &set_acc_buf_sel_aa(uint32_t value) volatile 5173 { 5174 word0 = (((~((1U << 1) - 1)) << 12) & word0) | ((((1U << 1) - 1) & value) << 12); 5175 return *this; 5176 } 5177 CONSTEXPR uint32_t get_acc0_valid() const 5178 { 5179 uint32_t value = ((1U << 1) - 1) & (word0 >> 13); 5180 return value; 5181 } 5182 uint32_t get_acc0_valid() const volatile 5183 { 5184 uint32_t value = ((1U << 1) - 1) & (word0 >> 13); 5185 return value; 5186 } 5187 CONSTEXPR mac_status_r &set_acc0_valid(uint32_t value) 5188 { 5189 word0 = (((~((1U << 1) - 1)) << 13) & word0) | ((((1U << 1) - 1) & value) << 13); 5190 return *this; 5191 } 5192 volatile mac_status_r &set_acc0_valid(uint32_t value) volatile 5193 { 5194 word0 = (((~((1U << 1) - 1)) << 13) & word0) | ((((1U << 1) - 1) & value) << 13); 5195 return *this; 5196 } 5197 CONSTEXPR uint32_t get_acc1_valid() const 5198 { 5199 uint32_t value = ((1U << 1) - 1) & (word0 >> 14); 5200 return value; 5201 } 5202 uint32_t get_acc1_valid() const volatile 5203 { 5204 uint32_t value = ((1U << 1) - 1) & (word0 >> 14); 5205 return value; 5206 } 5207 CONSTEXPR mac_status_r &set_acc1_valid(uint32_t value) 5208 { 5209 word0 = (((~((1U << 1) - 1)) << 14) & word0) | ((((1U << 1) - 1) & value) << 14); 5210 return *this; 5211 } 5212 volatile mac_status_r &set_acc1_valid(uint32_t value) volatile 5213 { 5214 word0 = (((~((1U << 1) - 1)) << 14) & word0) | ((((1U << 1) - 1) & value) << 14); 5215 return *this; 5216 } 5217 CONSTEXPR uint32_t get_events() const 5218 { 5219 uint32_t value = ((1U << 11) - 1) & (word0 >> 16); 5220 return value; 5221 } 5222 uint32_t get_events() const volatile 5223 { 5224 uint32_t value = ((1U << 11) - 1) & (word0 >> 16); 5225 return value; 5226 } 5227 CONSTEXPR mac_status_r &set_events(uint32_t value) 5228 { 5229 word0 = (((~((1U << 11) - 1)) << 16) & word0) | ((((1U << 11) - 1) & value) << 16); 5230 return *this; 5231 } 5232 volatile mac_status_r &set_events(uint32_t value) volatile 5233 { 5234 word0 = (((~((1U << 11) - 1)) << 16) & word0) | ((((1U << 11) - 1) & value) << 16); 5235 return *this; 5236 } 5237 #endif 5238 }; 5239 5240 // ao_status_r - AO_STATUS 5241 struct ao_status_r 5242 { 5243 #ifndef __cplusplus 5244 union 5245 { 5246 struct 5247 { 5248 uint32_t cmd_sbw_valid : 1; // Block command to shared buffer write module is valid 5249 uint32_t cmd_act_valid : 1; // Block command to activation function module is valid 5250 uint32_t cmd_ctl_valid : 1; // Block command to control module is valid 5251 uint32_t cmd_scl_valid : 1; // Block command to scale module is valid 5252 uint32_t cmd_sbr_valid : 1; // Block command to shared buffer read module is valid 5253 uint32_t cmd_ofm_valid : 1; // Block command to ofm parameter module is valid 5254 uint32_t blk_cmd_ready : 1; // Ready to accept block command 5255 uint32_t blk_cmd_valid : 1; // Block command from CC is valid 5256 uint32_t reserved0 : 8; 5257 uint32_t events : 8; // Mapped to AO events described in Appendix A 5258 uint32_t reserved1 : 8; 5259 }; 5260 uint32_t word; 5261 }; 5262 #else 5263 private: 5264 uint32_t word0; 5265 5266 public: 5267 CONSTEXPR ao_status_r() : word0(0) {} 5268 CONSTEXPR ao_status_r(uint32_t init) : word0(init) {} 5269 CONSTEXPR void operator=(uint32_t value) 5270 { 5271 word0 = value; 5272 } 5273 void operator=(uint32_t value) volatile 5274 { 5275 word0 = value; 5276 } 5277 CONSTEXPR operator uint32_t() 5278 { 5279 return word0; 5280 } 5281 operator uint32_t() volatile 5282 { 5283 return word0; 5284 } 5285 ao_status_r copy() volatile 5286 { 5287 return *this; 5288 } 5289 CONSTEXPR uint32_t get_cmd_sbw_valid() const 5290 { 5291 uint32_t value = ((1U << 1) - 1) & (word0 >> 0); 5292 return value; 5293 } 5294 uint32_t get_cmd_sbw_valid() const volatile 5295 { 5296 uint32_t value = ((1U << 1) - 1) & (word0 >> 0); 5297 return value; 5298 } 5299 CONSTEXPR ao_status_r &set_cmd_sbw_valid(uint32_t value) 5300 { 5301 word0 = (((~((1U << 1) - 1)) << 0) & word0) | ((((1U << 1) - 1) & value) << 0); 5302 return *this; 5303 } 5304 volatile ao_status_r &set_cmd_sbw_valid(uint32_t value) volatile 5305 { 5306 word0 = (((~((1U << 1) - 1)) << 0) & word0) | ((((1U << 1) - 1) & value) << 0); 5307 return *this; 5308 } 5309 CONSTEXPR uint32_t get_cmd_act_valid() const 5310 { 5311 uint32_t value = ((1U << 1) - 1) & (word0 >> 1); 5312 return value; 5313 } 5314 uint32_t get_cmd_act_valid() const volatile 5315 { 5316 uint32_t value = ((1U << 1) - 1) & (word0 >> 1); 5317 return value; 5318 } 5319 CONSTEXPR ao_status_r &set_cmd_act_valid(uint32_t value) 5320 { 5321 word0 = (((~((1U << 1) - 1)) << 1) & word0) | ((((1U << 1) - 1) & value) << 1); 5322 return *this; 5323 } 5324 volatile ao_status_r &set_cmd_act_valid(uint32_t value) volatile 5325 { 5326 word0 = (((~((1U << 1) - 1)) << 1) & word0) | ((((1U << 1) - 1) & value) << 1); 5327 return *this; 5328 } 5329 CONSTEXPR uint32_t get_cmd_ctl_valid() const 5330 { 5331 uint32_t value = ((1U << 1) - 1) & (word0 >> 2); 5332 return value; 5333 } 5334 uint32_t get_cmd_ctl_valid() const volatile 5335 { 5336 uint32_t value = ((1U << 1) - 1) & (word0 >> 2); 5337 return value; 5338 } 5339 CONSTEXPR ao_status_r &set_cmd_ctl_valid(uint32_t value) 5340 { 5341 word0 = (((~((1U << 1) - 1)) << 2) & word0) | ((((1U << 1) - 1) & value) << 2); 5342 return *this; 5343 } 5344 volatile ao_status_r &set_cmd_ctl_valid(uint32_t value) volatile 5345 { 5346 word0 = (((~((1U << 1) - 1)) << 2) & word0) | ((((1U << 1) - 1) & value) << 2); 5347 return *this; 5348 } 5349 CONSTEXPR uint32_t get_cmd_scl_valid() const 5350 { 5351 uint32_t value = ((1U << 1) - 1) & (word0 >> 3); 5352 return value; 5353 } 5354 uint32_t get_cmd_scl_valid() const volatile 5355 { 5356 uint32_t value = ((1U << 1) - 1) & (word0 >> 3); 5357 return value; 5358 } 5359 CONSTEXPR ao_status_r &set_cmd_scl_valid(uint32_t value) 5360 { 5361 word0 = (((~((1U << 1) - 1)) << 3) & word0) | ((((1U << 1) - 1) & value) << 3); 5362 return *this; 5363 } 5364 volatile ao_status_r &set_cmd_scl_valid(uint32_t value) volatile 5365 { 5366 word0 = (((~((1U << 1) - 1)) << 3) & word0) | ((((1U << 1) - 1) & value) << 3); 5367 return *this; 5368 } 5369 CONSTEXPR uint32_t get_cmd_sbr_valid() const 5370 { 5371 uint32_t value = ((1U << 1) - 1) & (word0 >> 4); 5372 return value; 5373 } 5374 uint32_t get_cmd_sbr_valid() const volatile 5375 { 5376 uint32_t value = ((1U << 1) - 1) & (word0 >> 4); 5377 return value; 5378 } 5379 CONSTEXPR ao_status_r &set_cmd_sbr_valid(uint32_t value) 5380 { 5381 word0 = (((~((1U << 1) - 1)) << 4) & word0) | ((((1U << 1) - 1) & value) << 4); 5382 return *this; 5383 } 5384 volatile ao_status_r &set_cmd_sbr_valid(uint32_t value) volatile 5385 { 5386 word0 = (((~((1U << 1) - 1)) << 4) & word0) | ((((1U << 1) - 1) & value) << 4); 5387 return *this; 5388 } 5389 CONSTEXPR uint32_t get_cmd_ofm_valid() const 5390 { 5391 uint32_t value = ((1U << 1) - 1) & (word0 >> 5); 5392 return value; 5393 } 5394 uint32_t get_cmd_ofm_valid() const volatile 5395 { 5396 uint32_t value = ((1U << 1) - 1) & (word0 >> 5); 5397 return value; 5398 } 5399 CONSTEXPR ao_status_r &set_cmd_ofm_valid(uint32_t value) 5400 { 5401 word0 = (((~((1U << 1) - 1)) << 5) & word0) | ((((1U << 1) - 1) & value) << 5); 5402 return *this; 5403 } 5404 volatile ao_status_r &set_cmd_ofm_valid(uint32_t value) volatile 5405 { 5406 word0 = (((~((1U << 1) - 1)) << 5) & word0) | ((((1U << 1) - 1) & value) << 5); 5407 return *this; 5408 } 5409 CONSTEXPR uint32_t get_blk_cmd_ready() const 5410 { 5411 uint32_t value = ((1U << 1) - 1) & (word0 >> 6); 5412 return value; 5413 } 5414 uint32_t get_blk_cmd_ready() const volatile 5415 { 5416 uint32_t value = ((1U << 1) - 1) & (word0 >> 6); 5417 return value; 5418 } 5419 CONSTEXPR ao_status_r &set_blk_cmd_ready(uint32_t value) 5420 { 5421 word0 = (((~((1U << 1) - 1)) << 6) & word0) | ((((1U << 1) - 1) & value) << 6); 5422 return *this; 5423 } 5424 volatile ao_status_r &set_blk_cmd_ready(uint32_t value) volatile 5425 { 5426 word0 = (((~((1U << 1) - 1)) << 6) & word0) | ((((1U << 1) - 1) & value) << 6); 5427 return *this; 5428 } 5429 CONSTEXPR uint32_t get_blk_cmd_valid() const 5430 { 5431 uint32_t value = ((1U << 1) - 1) & (word0 >> 7); 5432 return value; 5433 } 5434 uint32_t get_blk_cmd_valid() const volatile 5435 { 5436 uint32_t value = ((1U << 1) - 1) & (word0 >> 7); 5437 return value; 5438 } 5439 CONSTEXPR ao_status_r &set_blk_cmd_valid(uint32_t value) 5440 { 5441 word0 = (((~((1U << 1) - 1)) << 7) & word0) | ((((1U << 1) - 1) & value) << 7); 5442 return *this; 5443 } 5444 volatile ao_status_r &set_blk_cmd_valid(uint32_t value) volatile 5445 { 5446 word0 = (((~((1U << 1) - 1)) << 7) & word0) | ((((1U << 1) - 1) & value) << 7); 5447 return *this; 5448 } 5449 CONSTEXPR uint32_t get_events() const 5450 { 5451 uint32_t value = ((1U << 8) - 1) & (word0 >> 16); 5452 return value; 5453 } 5454 uint32_t get_events() const volatile 5455 { 5456 uint32_t value = ((1U << 8) - 1) & (word0 >> 16); 5457 return value; 5458 } 5459 CONSTEXPR ao_status_r &set_events(uint32_t value) 5460 { 5461 word0 = (((~((1U << 8) - 1)) << 16) & word0) | ((((1U << 8) - 1) & value) << 16); 5462 return *this; 5463 } 5464 volatile ao_status_r &set_events(uint32_t value) volatile 5465 { 5466 word0 = (((~((1U << 8) - 1)) << 16) & word0) | ((((1U << 8) - 1) & value) << 16); 5467 return *this; 5468 } 5469 #endif 5470 }; 5471 5472 // dma_status0_r - DMA_STATUS0 5473 struct dma_status0_r 5474 { 5475 #ifndef __cplusplus 5476 union 5477 { 5478 struct 5479 { 5480 uint32_t cmd_idle : 1; // When this bit is high means that the CMD block is not busy in generating addresses 5481 // for a CMD job 5482 uint32_t ifm_idle : 1; // When this bit is high means that there are no ongoing IFM jobs 5483 uint32_t wgt_idle_c0 : 1; // When this bit is high means that the WGT block is not busy in generating 5484 // addresses for a WGT job 5485 uint32_t bas_idle_c0 : 1; // When this bit is high means that the BAS block is not busy in generating 5486 // addresses for a BAS job 5487 uint32_t m2m_idle : 1; // When this bit is high means that there are no ongoing M2M jobs 5488 uint32_t ofm_idle : 1; // When this bit is high means that there are no ongoing OFM jobs 5489 uint32_t halt_req : 1; // CPM has requested to HALT AXI bus before soft reset 5490 uint32_t halt_ack : 1; // DMA is in condition to halt the AXI bus since there are no pending transactions 5491 uint32_t pause_req : 1; // CC has requested to pause the AXI 5492 uint32_t pause_ack : 1; // DMA is in condition to pause the AXI bus since there are no pending transactions 5493 uint32_t ib0_ai_valid_c0 : 1; // Data for AI to be read in IFM input buffer 0 - Core 0 5494 uint32_t ib0_ai_ready_c0 : 1; // Data consumed from AI in IFM input buffer 0 - Core 0 5495 uint32_t ib1_ai_valid_c0 : 1; // Data for AI to be read in IFM input buffer 1 - Core 0 5496 uint32_t ib1_ai_ready_c0 : 1; // Data consumed from AI in IFM input buffer 1 - Core 0 5497 uint32_t ib0_ao_valid_c0 : 1; // Data for AO to be read in IFM input buffer 0 - Core 0 5498 uint32_t ib0_ao_ready_c0 : 1; // Data consumed from AO in IFM input buffer 0 - Core 0 5499 uint32_t ib1_ao_valid_c0 : 1; // Data for AO to be read in IFM input buffer 0 - Core 0 5500 uint32_t ib1_ao_ready_c0 : 1; // Data consumed from AO in IFM input buffer 1 - Core 0 5501 uint32_t ob0_valid_c0 : 1; // Data for DMA ready to be consumed in OFM output buffer 0 - Core 0 5502 uint32_t ob0_ready_c0 : 1; // Data consumed from DMA in OFM output buffer 0 - Core 0 5503 uint32_t ob1_valid_c0 : 1; // Data for DMA ready to be consumed in OFM output buffer 1 - Core 0 5504 uint32_t ob1_ready_c0 : 1; // Data consumed from DMA in OFM output buffer 1 - Core 0 5505 uint32_t cmd_valid : 1; // New command word for CC to be consumed 5506 uint32_t cmd_ready : 1; // command word consumed by CC 5507 uint32_t wd_bitstream_valid_c0 : 1; // New weight word for WD to be consumed - Core 0 5508 uint32_t wd_bitstream_ready_c0 : 1; // Weight word consumed by WD - Core 0 5509 uint32_t bs_bitstream_valid_c0 : 1; // New BaS word for AO to be consumed - Core 0 5510 uint32_t bs_bitstream_ready_c0 : 1; // BaS word consumed by AO - Core 0 5511 uint32_t axi0_ar_stalled : 1; // Read transfer request stalled on arready low AXI0 (due to memory system) 5512 uint32_t axi0_rd_limit_stall : 1; // Read stalled due to one AXI0 limit counter being reached 5513 uint32_t axi0_aw_stalled : 1; // Write transfer request stalled on awready low AXI0 (due to memory system) 5514 uint32_t axi0_w_stalled : 1; // Write transfer stalled on awready low AXI0 (due to memory system) 5515 }; 5516 uint32_t word; 5517 }; 5518 #else 5519 private: 5520 uint32_t word0; 5521 5522 public: 5523 CONSTEXPR dma_status0_r() : word0(0) {} 5524 CONSTEXPR dma_status0_r(uint32_t init) : word0(init) {} 5525 CONSTEXPR void operator=(uint32_t value) 5526 { 5527 word0 = value; 5528 } 5529 void operator=(uint32_t value) volatile 5530 { 5531 word0 = value; 5532 } 5533 CONSTEXPR operator uint32_t() 5534 { 5535 return word0; 5536 } 5537 operator uint32_t() volatile 5538 { 5539 return word0; 5540 } 5541 dma_status0_r copy() volatile 5542 { 5543 return *this; 5544 } 5545 CONSTEXPR uint32_t get_cmd_idle() const 5546 { 5547 uint32_t value = ((1U << 1) - 1) & (word0 >> 0); 5548 return value; 5549 } 5550 uint32_t get_cmd_idle() const volatile 5551 { 5552 uint32_t value = ((1U << 1) - 1) & (word0 >> 0); 5553 return value; 5554 } 5555 CONSTEXPR dma_status0_r &set_cmd_idle(uint32_t value) 5556 { 5557 word0 = (((~((1U << 1) - 1)) << 0) & word0) | ((((1U << 1) - 1) & value) << 0); 5558 return *this; 5559 } 5560 volatile dma_status0_r &set_cmd_idle(uint32_t value) volatile 5561 { 5562 word0 = (((~((1U << 1) - 1)) << 0) & word0) | ((((1U << 1) - 1) & value) << 0); 5563 return *this; 5564 } 5565 CONSTEXPR uint32_t get_ifm_idle() const 5566 { 5567 uint32_t value = ((1U << 1) - 1) & (word0 >> 1); 5568 return value; 5569 } 5570 uint32_t get_ifm_idle() const volatile 5571 { 5572 uint32_t value = ((1U << 1) - 1) & (word0 >> 1); 5573 return value; 5574 } 5575 CONSTEXPR dma_status0_r &set_ifm_idle(uint32_t value) 5576 { 5577 word0 = (((~((1U << 1) - 1)) << 1) & word0) | ((((1U << 1) - 1) & value) << 1); 5578 return *this; 5579 } 5580 volatile dma_status0_r &set_ifm_idle(uint32_t value) volatile 5581 { 5582 word0 = (((~((1U << 1) - 1)) << 1) & word0) | ((((1U << 1) - 1) & value) << 1); 5583 return *this; 5584 } 5585 CONSTEXPR uint32_t get_wgt_idle_c0() const 5586 { 5587 uint32_t value = ((1U << 1) - 1) & (word0 >> 2); 5588 return value; 5589 } 5590 uint32_t get_wgt_idle_c0() const volatile 5591 { 5592 uint32_t value = ((1U << 1) - 1) & (word0 >> 2); 5593 return value; 5594 } 5595 CONSTEXPR dma_status0_r &set_wgt_idle_c0(uint32_t value) 5596 { 5597 word0 = (((~((1U << 1) - 1)) << 2) & word0) | ((((1U << 1) - 1) & value) << 2); 5598 return *this; 5599 } 5600 volatile dma_status0_r &set_wgt_idle_c0(uint32_t value) volatile 5601 { 5602 word0 = (((~((1U << 1) - 1)) << 2) & word0) | ((((1U << 1) - 1) & value) << 2); 5603 return *this; 5604 } 5605 CONSTEXPR uint32_t get_bas_idle_c0() const 5606 { 5607 uint32_t value = ((1U << 1) - 1) & (word0 >> 3); 5608 return value; 5609 } 5610 uint32_t get_bas_idle_c0() const volatile 5611 { 5612 uint32_t value = ((1U << 1) - 1) & (word0 >> 3); 5613 return value; 5614 } 5615 CONSTEXPR dma_status0_r &set_bas_idle_c0(uint32_t value) 5616 { 5617 word0 = (((~((1U << 1) - 1)) << 3) & word0) | ((((1U << 1) - 1) & value) << 3); 5618 return *this; 5619 } 5620 volatile dma_status0_r &set_bas_idle_c0(uint32_t value) volatile 5621 { 5622 word0 = (((~((1U << 1) - 1)) << 3) & word0) | ((((1U << 1) - 1) & value) << 3); 5623 return *this; 5624 } 5625 CONSTEXPR uint32_t get_m2m_idle() const 5626 { 5627 uint32_t value = ((1U << 1) - 1) & (word0 >> 4); 5628 return value; 5629 } 5630 uint32_t get_m2m_idle() const volatile 5631 { 5632 uint32_t value = ((1U << 1) - 1) & (word0 >> 4); 5633 return value; 5634 } 5635 CONSTEXPR dma_status0_r &set_m2m_idle(uint32_t value) 5636 { 5637 word0 = (((~((1U << 1) - 1)) << 4) & word0) | ((((1U << 1) - 1) & value) << 4); 5638 return *this; 5639 } 5640 volatile dma_status0_r &set_m2m_idle(uint32_t value) volatile 5641 { 5642 word0 = (((~((1U << 1) - 1)) << 4) & word0) | ((((1U << 1) - 1) & value) << 4); 5643 return *this; 5644 } 5645 CONSTEXPR uint32_t get_ofm_idle() const 5646 { 5647 uint32_t value = ((1U << 1) - 1) & (word0 >> 5); 5648 return value; 5649 } 5650 uint32_t get_ofm_idle() const volatile 5651 { 5652 uint32_t value = ((1U << 1) - 1) & (word0 >> 5); 5653 return value; 5654 } 5655 CONSTEXPR dma_status0_r &set_ofm_idle(uint32_t value) 5656 { 5657 word0 = (((~((1U << 1) - 1)) << 5) & word0) | ((((1U << 1) - 1) & value) << 5); 5658 return *this; 5659 } 5660 volatile dma_status0_r &set_ofm_idle(uint32_t value) volatile 5661 { 5662 word0 = (((~((1U << 1) - 1)) << 5) & word0) | ((((1U << 1) - 1) & value) << 5); 5663 return *this; 5664 } 5665 CONSTEXPR uint32_t get_halt_req() const 5666 { 5667 uint32_t value = ((1U << 1) - 1) & (word0 >> 6); 5668 return value; 5669 } 5670 uint32_t get_halt_req() const volatile 5671 { 5672 uint32_t value = ((1U << 1) - 1) & (word0 >> 6); 5673 return value; 5674 } 5675 CONSTEXPR dma_status0_r &set_halt_req(uint32_t value) 5676 { 5677 word0 = (((~((1U << 1) - 1)) << 6) & word0) | ((((1U << 1) - 1) & value) << 6); 5678 return *this; 5679 } 5680 volatile dma_status0_r &set_halt_req(uint32_t value) volatile 5681 { 5682 word0 = (((~((1U << 1) - 1)) << 6) & word0) | ((((1U << 1) - 1) & value) << 6); 5683 return *this; 5684 } 5685 CONSTEXPR uint32_t get_halt_ack() const 5686 { 5687 uint32_t value = ((1U << 1) - 1) & (word0 >> 7); 5688 return value; 5689 } 5690 uint32_t get_halt_ack() const volatile 5691 { 5692 uint32_t value = ((1U << 1) - 1) & (word0 >> 7); 5693 return value; 5694 } 5695 CONSTEXPR dma_status0_r &set_halt_ack(uint32_t value) 5696 { 5697 word0 = (((~((1U << 1) - 1)) << 7) & word0) | ((((1U << 1) - 1) & value) << 7); 5698 return *this; 5699 } 5700 volatile dma_status0_r &set_halt_ack(uint32_t value) volatile 5701 { 5702 word0 = (((~((1U << 1) - 1)) << 7) & word0) | ((((1U << 1) - 1) & value) << 7); 5703 return *this; 5704 } 5705 CONSTEXPR uint32_t get_pause_req() const 5706 { 5707 uint32_t value = ((1U << 1) - 1) & (word0 >> 8); 5708 return value; 5709 } 5710 uint32_t get_pause_req() const volatile 5711 { 5712 uint32_t value = ((1U << 1) - 1) & (word0 >> 8); 5713 return value; 5714 } 5715 CONSTEXPR dma_status0_r &set_pause_req(uint32_t value) 5716 { 5717 word0 = (((~((1U << 1) - 1)) << 8) & word0) | ((((1U << 1) - 1) & value) << 8); 5718 return *this; 5719 } 5720 volatile dma_status0_r &set_pause_req(uint32_t value) volatile 5721 { 5722 word0 = (((~((1U << 1) - 1)) << 8) & word0) | ((((1U << 1) - 1) & value) << 8); 5723 return *this; 5724 } 5725 CONSTEXPR uint32_t get_pause_ack() const 5726 { 5727 uint32_t value = ((1U << 1) - 1) & (word0 >> 9); 5728 return value; 5729 } 5730 uint32_t get_pause_ack() const volatile 5731 { 5732 uint32_t value = ((1U << 1) - 1) & (word0 >> 9); 5733 return value; 5734 } 5735 CONSTEXPR dma_status0_r &set_pause_ack(uint32_t value) 5736 { 5737 word0 = (((~((1U << 1) - 1)) << 9) & word0) | ((((1U << 1) - 1) & value) << 9); 5738 return *this; 5739 } 5740 volatile dma_status0_r &set_pause_ack(uint32_t value) volatile 5741 { 5742 word0 = (((~((1U << 1) - 1)) << 9) & word0) | ((((1U << 1) - 1) & value) << 9); 5743 return *this; 5744 } 5745 CONSTEXPR uint32_t get_ib0_ai_valid_c0() const 5746 { 5747 uint32_t value = ((1U << 1) - 1) & (word0 >> 10); 5748 return value; 5749 } 5750 uint32_t get_ib0_ai_valid_c0() const volatile 5751 { 5752 uint32_t value = ((1U << 1) - 1) & (word0 >> 10); 5753 return value; 5754 } 5755 CONSTEXPR dma_status0_r &set_ib0_ai_valid_c0(uint32_t value) 5756 { 5757 word0 = (((~((1U << 1) - 1)) << 10) & word0) | ((((1U << 1) - 1) & value) << 10); 5758 return *this; 5759 } 5760 volatile dma_status0_r &set_ib0_ai_valid_c0(uint32_t value) volatile 5761 { 5762 word0 = (((~((1U << 1) - 1)) << 10) & word0) | ((((1U << 1) - 1) & value) << 10); 5763 return *this; 5764 } 5765 CONSTEXPR uint32_t get_ib0_ai_ready_c0() const 5766 { 5767 uint32_t value = ((1U << 1) - 1) & (word0 >> 11); 5768 return value; 5769 } 5770 uint32_t get_ib0_ai_ready_c0() const volatile 5771 { 5772 uint32_t value = ((1U << 1) - 1) & (word0 >> 11); 5773 return value; 5774 } 5775 CONSTEXPR dma_status0_r &set_ib0_ai_ready_c0(uint32_t value) 5776 { 5777 word0 = (((~((1U << 1) - 1)) << 11) & word0) | ((((1U << 1) - 1) & value) << 11); 5778 return *this; 5779 } 5780 volatile dma_status0_r &set_ib0_ai_ready_c0(uint32_t value) volatile 5781 { 5782 word0 = (((~((1U << 1) - 1)) << 11) & word0) | ((((1U << 1) - 1) & value) << 11); 5783 return *this; 5784 } 5785 CONSTEXPR uint32_t get_ib1_ai_valid_c0() const 5786 { 5787 uint32_t value = ((1U << 1) - 1) & (word0 >> 12); 5788 return value; 5789 } 5790 uint32_t get_ib1_ai_valid_c0() const volatile 5791 { 5792 uint32_t value = ((1U << 1) - 1) & (word0 >> 12); 5793 return value; 5794 } 5795 CONSTEXPR dma_status0_r &set_ib1_ai_valid_c0(uint32_t value) 5796 { 5797 word0 = (((~((1U << 1) - 1)) << 12) & word0) | ((((1U << 1) - 1) & value) << 12); 5798 return *this; 5799 } 5800 volatile dma_status0_r &set_ib1_ai_valid_c0(uint32_t value) volatile 5801 { 5802 word0 = (((~((1U << 1) - 1)) << 12) & word0) | ((((1U << 1) - 1) & value) << 12); 5803 return *this; 5804 } 5805 CONSTEXPR uint32_t get_ib1_ai_ready_c0() const 5806 { 5807 uint32_t value = ((1U << 1) - 1) & (word0 >> 13); 5808 return value; 5809 } 5810 uint32_t get_ib1_ai_ready_c0() const volatile 5811 { 5812 uint32_t value = ((1U << 1) - 1) & (word0 >> 13); 5813 return value; 5814 } 5815 CONSTEXPR dma_status0_r &set_ib1_ai_ready_c0(uint32_t value) 5816 { 5817 word0 = (((~((1U << 1) - 1)) << 13) & word0) | ((((1U << 1) - 1) & value) << 13); 5818 return *this; 5819 } 5820 volatile dma_status0_r &set_ib1_ai_ready_c0(uint32_t value) volatile 5821 { 5822 word0 = (((~((1U << 1) - 1)) << 13) & word0) | ((((1U << 1) - 1) & value) << 13); 5823 return *this; 5824 } 5825 CONSTEXPR uint32_t get_ib0_ao_valid_c0() const 5826 { 5827 uint32_t value = ((1U << 1) - 1) & (word0 >> 14); 5828 return value; 5829 } 5830 uint32_t get_ib0_ao_valid_c0() const volatile 5831 { 5832 uint32_t value = ((1U << 1) - 1) & (word0 >> 14); 5833 return value; 5834 } 5835 CONSTEXPR dma_status0_r &set_ib0_ao_valid_c0(uint32_t value) 5836 { 5837 word0 = (((~((1U << 1) - 1)) << 14) & word0) | ((((1U << 1) - 1) & value) << 14); 5838 return *this; 5839 } 5840 volatile dma_status0_r &set_ib0_ao_valid_c0(uint32_t value) volatile 5841 { 5842 word0 = (((~((1U << 1) - 1)) << 14) & word0) | ((((1U << 1) - 1) & value) << 14); 5843 return *this; 5844 } 5845 CONSTEXPR uint32_t get_ib0_ao_ready_c0() const 5846 { 5847 uint32_t value = ((1U << 1) - 1) & (word0 >> 15); 5848 return value; 5849 } 5850 uint32_t get_ib0_ao_ready_c0() const volatile 5851 { 5852 uint32_t value = ((1U << 1) - 1) & (word0 >> 15); 5853 return value; 5854 } 5855 CONSTEXPR dma_status0_r &set_ib0_ao_ready_c0(uint32_t value) 5856 { 5857 word0 = (((~((1U << 1) - 1)) << 15) & word0) | ((((1U << 1) - 1) & value) << 15); 5858 return *this; 5859 } 5860 volatile dma_status0_r &set_ib0_ao_ready_c0(uint32_t value) volatile 5861 { 5862 word0 = (((~((1U << 1) - 1)) << 15) & word0) | ((((1U << 1) - 1) & value) << 15); 5863 return *this; 5864 } 5865 CONSTEXPR uint32_t get_ib1_ao_valid_c0() const 5866 { 5867 uint32_t value = ((1U << 1) - 1) & (word0 >> 16); 5868 return value; 5869 } 5870 uint32_t get_ib1_ao_valid_c0() const volatile 5871 { 5872 uint32_t value = ((1U << 1) - 1) & (word0 >> 16); 5873 return value; 5874 } 5875 CONSTEXPR dma_status0_r &set_ib1_ao_valid_c0(uint32_t value) 5876 { 5877 word0 = (((~((1U << 1) - 1)) << 16) & word0) | ((((1U << 1) - 1) & value) << 16); 5878 return *this; 5879 } 5880 volatile dma_status0_r &set_ib1_ao_valid_c0(uint32_t value) volatile 5881 { 5882 word0 = (((~((1U << 1) - 1)) << 16) & word0) | ((((1U << 1) - 1) & value) << 16); 5883 return *this; 5884 } 5885 CONSTEXPR uint32_t get_ib1_ao_ready_c0() const 5886 { 5887 uint32_t value = ((1U << 1) - 1) & (word0 >> 17); 5888 return value; 5889 } 5890 uint32_t get_ib1_ao_ready_c0() const volatile 5891 { 5892 uint32_t value = ((1U << 1) - 1) & (word0 >> 17); 5893 return value; 5894 } 5895 CONSTEXPR dma_status0_r &set_ib1_ao_ready_c0(uint32_t value) 5896 { 5897 word0 = (((~((1U << 1) - 1)) << 17) & word0) | ((((1U << 1) - 1) & value) << 17); 5898 return *this; 5899 } 5900 volatile dma_status0_r &set_ib1_ao_ready_c0(uint32_t value) volatile 5901 { 5902 word0 = (((~((1U << 1) - 1)) << 17) & word0) | ((((1U << 1) - 1) & value) << 17); 5903 return *this; 5904 } 5905 CONSTEXPR uint32_t get_ob0_valid_c0() const 5906 { 5907 uint32_t value = ((1U << 1) - 1) & (word0 >> 18); 5908 return value; 5909 } 5910 uint32_t get_ob0_valid_c0() const volatile 5911 { 5912 uint32_t value = ((1U << 1) - 1) & (word0 >> 18); 5913 return value; 5914 } 5915 CONSTEXPR dma_status0_r &set_ob0_valid_c0(uint32_t value) 5916 { 5917 word0 = (((~((1U << 1) - 1)) << 18) & word0) | ((((1U << 1) - 1) & value) << 18); 5918 return *this; 5919 } 5920 volatile dma_status0_r &set_ob0_valid_c0(uint32_t value) volatile 5921 { 5922 word0 = (((~((1U << 1) - 1)) << 18) & word0) | ((((1U << 1) - 1) & value) << 18); 5923 return *this; 5924 } 5925 CONSTEXPR uint32_t get_ob0_ready_c0() const 5926 { 5927 uint32_t value = ((1U << 1) - 1) & (word0 >> 19); 5928 return value; 5929 } 5930 uint32_t get_ob0_ready_c0() const volatile 5931 { 5932 uint32_t value = ((1U << 1) - 1) & (word0 >> 19); 5933 return value; 5934 } 5935 CONSTEXPR dma_status0_r &set_ob0_ready_c0(uint32_t value) 5936 { 5937 word0 = (((~((1U << 1) - 1)) << 19) & word0) | ((((1U << 1) - 1) & value) << 19); 5938 return *this; 5939 } 5940 volatile dma_status0_r &set_ob0_ready_c0(uint32_t value) volatile 5941 { 5942 word0 = (((~((1U << 1) - 1)) << 19) & word0) | ((((1U << 1) - 1) & value) << 19); 5943 return *this; 5944 } 5945 CONSTEXPR uint32_t get_ob1_valid_c0() const 5946 { 5947 uint32_t value = ((1U << 1) - 1) & (word0 >> 20); 5948 return value; 5949 } 5950 uint32_t get_ob1_valid_c0() const volatile 5951 { 5952 uint32_t value = ((1U << 1) - 1) & (word0 >> 20); 5953 return value; 5954 } 5955 CONSTEXPR dma_status0_r &set_ob1_valid_c0(uint32_t value) 5956 { 5957 word0 = (((~((1U << 1) - 1)) << 20) & word0) | ((((1U << 1) - 1) & value) << 20); 5958 return *this; 5959 } 5960 volatile dma_status0_r &set_ob1_valid_c0(uint32_t value) volatile 5961 { 5962 word0 = (((~((1U << 1) - 1)) << 20) & word0) | ((((1U << 1) - 1) & value) << 20); 5963 return *this; 5964 } 5965 CONSTEXPR uint32_t get_ob1_ready_c0() const 5966 { 5967 uint32_t value = ((1U << 1) - 1) & (word0 >> 21); 5968 return value; 5969 } 5970 uint32_t get_ob1_ready_c0() const volatile 5971 { 5972 uint32_t value = ((1U << 1) - 1) & (word0 >> 21); 5973 return value; 5974 } 5975 CONSTEXPR dma_status0_r &set_ob1_ready_c0(uint32_t value) 5976 { 5977 word0 = (((~((1U << 1) - 1)) << 21) & word0) | ((((1U << 1) - 1) & value) << 21); 5978 return *this; 5979 } 5980 volatile dma_status0_r &set_ob1_ready_c0(uint32_t value) volatile 5981 { 5982 word0 = (((~((1U << 1) - 1)) << 21) & word0) | ((((1U << 1) - 1) & value) << 21); 5983 return *this; 5984 } 5985 CONSTEXPR uint32_t get_cmd_valid() const 5986 { 5987 uint32_t value = ((1U << 1) - 1) & (word0 >> 22); 5988 return value; 5989 } 5990 uint32_t get_cmd_valid() const volatile 5991 { 5992 uint32_t value = ((1U << 1) - 1) & (word0 >> 22); 5993 return value; 5994 } 5995 CONSTEXPR dma_status0_r &set_cmd_valid(uint32_t value) 5996 { 5997 word0 = (((~((1U << 1) - 1)) << 22) & word0) | ((((1U << 1) - 1) & value) << 22); 5998 return *this; 5999 } 6000 volatile dma_status0_r &set_cmd_valid(uint32_t value) volatile 6001 { 6002 word0 = (((~((1U << 1) - 1)) << 22) & word0) | ((((1U << 1) - 1) & value) << 22); 6003 return *this; 6004 } 6005 CONSTEXPR uint32_t get_cmd_ready() const 6006 { 6007 uint32_t value = ((1U << 1) - 1) & (word0 >> 23); 6008 return value; 6009 } 6010 uint32_t get_cmd_ready() const volatile 6011 { 6012 uint32_t value = ((1U << 1) - 1) & (word0 >> 23); 6013 return value; 6014 } 6015 CONSTEXPR dma_status0_r &set_cmd_ready(uint32_t value) 6016 { 6017 word0 = (((~((1U << 1) - 1)) << 23) & word0) | ((((1U << 1) - 1) & value) << 23); 6018 return *this; 6019 } 6020 volatile dma_status0_r &set_cmd_ready(uint32_t value) volatile 6021 { 6022 word0 = (((~((1U << 1) - 1)) << 23) & word0) | ((((1U << 1) - 1) & value) << 23); 6023 return *this; 6024 } 6025 CONSTEXPR uint32_t get_wd_bitstream_valid_c0() const 6026 { 6027 uint32_t value = ((1U << 1) - 1) & (word0 >> 24); 6028 return value; 6029 } 6030 uint32_t get_wd_bitstream_valid_c0() const volatile 6031 { 6032 uint32_t value = ((1U << 1) - 1) & (word0 >> 24); 6033 return value; 6034 } 6035 CONSTEXPR dma_status0_r &set_wd_bitstream_valid_c0(uint32_t value) 6036 { 6037 word0 = (((~((1U << 1) - 1)) << 24) & word0) | ((((1U << 1) - 1) & value) << 24); 6038 return *this; 6039 } 6040 volatile dma_status0_r &set_wd_bitstream_valid_c0(uint32_t value) volatile 6041 { 6042 word0 = (((~((1U << 1) - 1)) << 24) & word0) | ((((1U << 1) - 1) & value) << 24); 6043 return *this; 6044 } 6045 CONSTEXPR uint32_t get_wd_bitstream_ready_c0() const 6046 { 6047 uint32_t value = ((1U << 1) - 1) & (word0 >> 25); 6048 return value; 6049 } 6050 uint32_t get_wd_bitstream_ready_c0() const volatile 6051 { 6052 uint32_t value = ((1U << 1) - 1) & (word0 >> 25); 6053 return value; 6054 } 6055 CONSTEXPR dma_status0_r &set_wd_bitstream_ready_c0(uint32_t value) 6056 { 6057 word0 = (((~((1U << 1) - 1)) << 25) & word0) | ((((1U << 1) - 1) & value) << 25); 6058 return *this; 6059 } 6060 volatile dma_status0_r &set_wd_bitstream_ready_c0(uint32_t value) volatile 6061 { 6062 word0 = (((~((1U << 1) - 1)) << 25) & word0) | ((((1U << 1) - 1) & value) << 25); 6063 return *this; 6064 } 6065 CONSTEXPR uint32_t get_bs_bitstream_valid_c0() const 6066 { 6067 uint32_t value = ((1U << 1) - 1) & (word0 >> 26); 6068 return value; 6069 } 6070 uint32_t get_bs_bitstream_valid_c0() const volatile 6071 { 6072 uint32_t value = ((1U << 1) - 1) & (word0 >> 26); 6073 return value; 6074 } 6075 CONSTEXPR dma_status0_r &set_bs_bitstream_valid_c0(uint32_t value) 6076 { 6077 word0 = (((~((1U << 1) - 1)) << 26) & word0) | ((((1U << 1) - 1) & value) << 26); 6078 return *this; 6079 } 6080 volatile dma_status0_r &set_bs_bitstream_valid_c0(uint32_t value) volatile 6081 { 6082 word0 = (((~((1U << 1) - 1)) << 26) & word0) | ((((1U << 1) - 1) & value) << 26); 6083 return *this; 6084 } 6085 CONSTEXPR uint32_t get_bs_bitstream_ready_c0() const 6086 { 6087 uint32_t value = ((1U << 1) - 1) & (word0 >> 27); 6088 return value; 6089 } 6090 uint32_t get_bs_bitstream_ready_c0() const volatile 6091 { 6092 uint32_t value = ((1U << 1) - 1) & (word0 >> 27); 6093 return value; 6094 } 6095 CONSTEXPR dma_status0_r &set_bs_bitstream_ready_c0(uint32_t value) 6096 { 6097 word0 = (((~((1U << 1) - 1)) << 27) & word0) | ((((1U << 1) - 1) & value) << 27); 6098 return *this; 6099 } 6100 volatile dma_status0_r &set_bs_bitstream_ready_c0(uint32_t value) volatile 6101 { 6102 word0 = (((~((1U << 1) - 1)) << 27) & word0) | ((((1U << 1) - 1) & value) << 27); 6103 return *this; 6104 } 6105 CONSTEXPR uint32_t get_axi0_ar_stalled() const 6106 { 6107 uint32_t value = ((1U << 1) - 1) & (word0 >> 28); 6108 return value; 6109 } 6110 uint32_t get_axi0_ar_stalled() const volatile 6111 { 6112 uint32_t value = ((1U << 1) - 1) & (word0 >> 28); 6113 return value; 6114 } 6115 CONSTEXPR dma_status0_r &set_axi0_ar_stalled(uint32_t value) 6116 { 6117 word0 = (((~((1U << 1) - 1)) << 28) & word0) | ((((1U << 1) - 1) & value) << 28); 6118 return *this; 6119 } 6120 volatile dma_status0_r &set_axi0_ar_stalled(uint32_t value) volatile 6121 { 6122 word0 = (((~((1U << 1) - 1)) << 28) & word0) | ((((1U << 1) - 1) & value) << 28); 6123 return *this; 6124 } 6125 CONSTEXPR uint32_t get_axi0_rd_limit_stall() const 6126 { 6127 uint32_t value = ((1U << 1) - 1) & (word0 >> 29); 6128 return value; 6129 } 6130 uint32_t get_axi0_rd_limit_stall() const volatile 6131 { 6132 uint32_t value = ((1U << 1) - 1) & (word0 >> 29); 6133 return value; 6134 } 6135 CONSTEXPR dma_status0_r &set_axi0_rd_limit_stall(uint32_t value) 6136 { 6137 word0 = (((~((1U << 1) - 1)) << 29) & word0) | ((((1U << 1) - 1) & value) << 29); 6138 return *this; 6139 } 6140 volatile dma_status0_r &set_axi0_rd_limit_stall(uint32_t value) volatile 6141 { 6142 word0 = (((~((1U << 1) - 1)) << 29) & word0) | ((((1U << 1) - 1) & value) << 29); 6143 return *this; 6144 } 6145 CONSTEXPR uint32_t get_axi0_aw_stalled() const 6146 { 6147 uint32_t value = ((1U << 1) - 1) & (word0 >> 30); 6148 return value; 6149 } 6150 uint32_t get_axi0_aw_stalled() const volatile 6151 { 6152 uint32_t value = ((1U << 1) - 1) & (word0 >> 30); 6153 return value; 6154 } 6155 CONSTEXPR dma_status0_r &set_axi0_aw_stalled(uint32_t value) 6156 { 6157 word0 = (((~((1U << 1) - 1)) << 30) & word0) | ((((1U << 1) - 1) & value) << 30); 6158 return *this; 6159 } 6160 volatile dma_status0_r &set_axi0_aw_stalled(uint32_t value) volatile 6161 { 6162 word0 = (((~((1U << 1) - 1)) << 30) & word0) | ((((1U << 1) - 1) & value) << 30); 6163 return *this; 6164 } 6165 CONSTEXPR uint32_t get_axi0_w_stalled() const 6166 { 6167 uint32_t value = ((1U << 1) - 1) & (word0 >> 31); 6168 return value; 6169 } 6170 uint32_t get_axi0_w_stalled() const volatile 6171 { 6172 uint32_t value = ((1U << 1) - 1) & (word0 >> 31); 6173 return value; 6174 } 6175 CONSTEXPR dma_status0_r &set_axi0_w_stalled(uint32_t value) 6176 { 6177 word0 = (((~((1U << 1) - 1)) << 31) & word0) | ((((1U << 1) - 1) & value) << 31); 6178 return *this; 6179 } 6180 volatile dma_status0_r &set_axi0_w_stalled(uint32_t value) volatile 6181 { 6182 word0 = (((~((1U << 1) - 1)) << 31) & word0) | ((((1U << 1) - 1) & value) << 31); 6183 return *this; 6184 } 6185 #endif 6186 }; 6187 6188 // dma_status1_r - DMA_STATUS1 6189 struct dma_status1_r 6190 { 6191 #ifndef __cplusplus 6192 union 6193 { 6194 struct 6195 { 6196 uint32_t axi0_wr_limit_stall : 1; // Write stalled due to one AXI0 limit counter being reached 6197 uint32_t axi1_ar_stalled : 1; // Read transfer request stalled on arready low AXI1 (due to memory system) 6198 uint32_t axi1_rd_limit_stall : 1; // Read stalled due to one AXI1 limit counter being reached 6199 uint32_t axi1_wr_stalled : 1; // Write transfer request stalled on awready low AXI1 (due to memory system) 6200 uint32_t axi1_w_stalled : 1; // Write transfer stalled on wready low AXI1 (due to memory system) 6201 uint32_t axi1_wr_limit_stall : 1; // Write stalled due to one AXI1 limit counter being reached 6202 uint32_t wgt_idle_c1 : 1; // When this bit is high means that the WGT block is not busy in generating 6203 // addresses for a WGT job 6204 uint32_t bas_idle_c1 : 1; // When this bit is high means that the BAS block is not busy in generating 6205 // addresses for a BAS job 6206 uint32_t ib0_ai_valid_c1 : 1; // Data for AI to be read in IFM input buffer 0 - Core 1 6207 uint32_t ib0_ai_ready_c1 : 1; // Data consumed from AI in IFM input buffer 0 - Core 1 6208 uint32_t ib1_ai_valid_c1 : 1; // Data for AI to be read in IFM input buffer 1 - Core 1 6209 uint32_t ib1_ai_ready_c1 : 1; // Data consumed from AI in IFM input buffer 1 - Core 1 6210 uint32_t ib0_ao_valid_c1 : 1; // Data for AO to be read in IFM input buffer 0 - Core 1 6211 uint32_t ib0_ao_ready_c1 : 1; // Data consumed from AO in IFM input buffer 0 - Core 1 6212 uint32_t ib1_ao_valid_c1 : 1; // Data for AO to be read in IFM input buffer 0 - Core 1 6213 uint32_t ib1_ao_ready_c1 : 1; // Data consumed from AO in IFM input buffer 1 - Core 1 6214 uint32_t ob0_valid_c1 : 1; // Data for DMA ready to be consumed in OFM output buffer 0 - Core 1 6215 uint32_t ob0_ready_c1 : 1; // Data consumed from DMA in OFM output buffer 0 - Core 1 6216 uint32_t ob1_valid_c1 : 1; // Data for DMA ready to be consumed in OFM output buffer 1 - Core 1 6217 uint32_t ob1_ready_c1 : 1; // Data consumed from DMA in OFM output buffer 1 - Core 1 6218 uint32_t wd_bitstream_valid_c1 : 1; // New weight word for WD to be consumed - Core 1 6219 uint32_t wd_bitstream_ready_c1 : 1; // Weight word consumed by WD - Core 1 6220 uint32_t bs_bitstream_valid_c1 : 1; // New BaS word for AO to be consumed - Core 1 6221 uint32_t bs_bitstream_ready_c1 : 1; // BaS word consumed by AO - Core 1 6222 uint32_t reserved0 : 8; 6223 }; 6224 uint32_t word; 6225 }; 6226 #else 6227 private: 6228 uint32_t word0; 6229 6230 public: 6231 CONSTEXPR dma_status1_r() : word0(0) {} 6232 CONSTEXPR dma_status1_r(uint32_t init) : word0(init) {} 6233 CONSTEXPR void operator=(uint32_t value) 6234 { 6235 word0 = value; 6236 } 6237 void operator=(uint32_t value) volatile 6238 { 6239 word0 = value; 6240 } 6241 CONSTEXPR operator uint32_t() 6242 { 6243 return word0; 6244 } 6245 operator uint32_t() volatile 6246 { 6247 return word0; 6248 } 6249 dma_status1_r copy() volatile 6250 { 6251 return *this; 6252 } 6253 CONSTEXPR uint32_t get_axi0_wr_limit_stall() const 6254 { 6255 uint32_t value = ((1U << 1) - 1) & (word0 >> 0); 6256 return value; 6257 } 6258 uint32_t get_axi0_wr_limit_stall() const volatile 6259 { 6260 uint32_t value = ((1U << 1) - 1) & (word0 >> 0); 6261 return value; 6262 } 6263 CONSTEXPR dma_status1_r &set_axi0_wr_limit_stall(uint32_t value) 6264 { 6265 word0 = (((~((1U << 1) - 1)) << 0) & word0) | ((((1U << 1) - 1) & value) << 0); 6266 return *this; 6267 } 6268 volatile dma_status1_r &set_axi0_wr_limit_stall(uint32_t value) volatile 6269 { 6270 word0 = (((~((1U << 1) - 1)) << 0) & word0) | ((((1U << 1) - 1) & value) << 0); 6271 return *this; 6272 } 6273 CONSTEXPR uint32_t get_axi1_ar_stalled() const 6274 { 6275 uint32_t value = ((1U << 1) - 1) & (word0 >> 1); 6276 return value; 6277 } 6278 uint32_t get_axi1_ar_stalled() const volatile 6279 { 6280 uint32_t value = ((1U << 1) - 1) & (word0 >> 1); 6281 return value; 6282 } 6283 CONSTEXPR dma_status1_r &set_axi1_ar_stalled(uint32_t value) 6284 { 6285 word0 = (((~((1U << 1) - 1)) << 1) & word0) | ((((1U << 1) - 1) & value) << 1); 6286 return *this; 6287 } 6288 volatile dma_status1_r &set_axi1_ar_stalled(uint32_t value) volatile 6289 { 6290 word0 = (((~((1U << 1) - 1)) << 1) & word0) | ((((1U << 1) - 1) & value) << 1); 6291 return *this; 6292 } 6293 CONSTEXPR uint32_t get_axi1_rd_limit_stall() const 6294 { 6295 uint32_t value = ((1U << 1) - 1) & (word0 >> 2); 6296 return value; 6297 } 6298 uint32_t get_axi1_rd_limit_stall() const volatile 6299 { 6300 uint32_t value = ((1U << 1) - 1) & (word0 >> 2); 6301 return value; 6302 } 6303 CONSTEXPR dma_status1_r &set_axi1_rd_limit_stall(uint32_t value) 6304 { 6305 word0 = (((~((1U << 1) - 1)) << 2) & word0) | ((((1U << 1) - 1) & value) << 2); 6306 return *this; 6307 } 6308 volatile dma_status1_r &set_axi1_rd_limit_stall(uint32_t value) volatile 6309 { 6310 word0 = (((~((1U << 1) - 1)) << 2) & word0) | ((((1U << 1) - 1) & value) << 2); 6311 return *this; 6312 } 6313 CONSTEXPR uint32_t get_axi1_wr_stalled() const 6314 { 6315 uint32_t value = ((1U << 1) - 1) & (word0 >> 3); 6316 return value; 6317 } 6318 uint32_t get_axi1_wr_stalled() const volatile 6319 { 6320 uint32_t value = ((1U << 1) - 1) & (word0 >> 3); 6321 return value; 6322 } 6323 CONSTEXPR dma_status1_r &set_axi1_wr_stalled(uint32_t value) 6324 { 6325 word0 = (((~((1U << 1) - 1)) << 3) & word0) | ((((1U << 1) - 1) & value) << 3); 6326 return *this; 6327 } 6328 volatile dma_status1_r &set_axi1_wr_stalled(uint32_t value) volatile 6329 { 6330 word0 = (((~((1U << 1) - 1)) << 3) & word0) | ((((1U << 1) - 1) & value) << 3); 6331 return *this; 6332 } 6333 CONSTEXPR uint32_t get_axi1_w_stalled() const 6334 { 6335 uint32_t value = ((1U << 1) - 1) & (word0 >> 4); 6336 return value; 6337 } 6338 uint32_t get_axi1_w_stalled() const volatile 6339 { 6340 uint32_t value = ((1U << 1) - 1) & (word0 >> 4); 6341 return value; 6342 } 6343 CONSTEXPR dma_status1_r &set_axi1_w_stalled(uint32_t value) 6344 { 6345 word0 = (((~((1U << 1) - 1)) << 4) & word0) | ((((1U << 1) - 1) & value) << 4); 6346 return *this; 6347 } 6348 volatile dma_status1_r &set_axi1_w_stalled(uint32_t value) volatile 6349 { 6350 word0 = (((~((1U << 1) - 1)) << 4) & word0) | ((((1U << 1) - 1) & value) << 4); 6351 return *this; 6352 } 6353 CONSTEXPR uint32_t get_axi1_wr_limit_stall() const 6354 { 6355 uint32_t value = ((1U << 1) - 1) & (word0 >> 5); 6356 return value; 6357 } 6358 uint32_t get_axi1_wr_limit_stall() const volatile 6359 { 6360 uint32_t value = ((1U << 1) - 1) & (word0 >> 5); 6361 return value; 6362 } 6363 CONSTEXPR dma_status1_r &set_axi1_wr_limit_stall(uint32_t value) 6364 { 6365 word0 = (((~((1U << 1) - 1)) << 5) & word0) | ((((1U << 1) - 1) & value) << 5); 6366 return *this; 6367 } 6368 volatile dma_status1_r &set_axi1_wr_limit_stall(uint32_t value) volatile 6369 { 6370 word0 = (((~((1U << 1) - 1)) << 5) & word0) | ((((1U << 1) - 1) & value) << 5); 6371 return *this; 6372 } 6373 CONSTEXPR uint32_t get_wgt_idle_c1() const 6374 { 6375 uint32_t value = ((1U << 1) - 1) & (word0 >> 6); 6376 return value; 6377 } 6378 uint32_t get_wgt_idle_c1() const volatile 6379 { 6380 uint32_t value = ((1U << 1) - 1) & (word0 >> 6); 6381 return value; 6382 } 6383 CONSTEXPR dma_status1_r &set_wgt_idle_c1(uint32_t value) 6384 { 6385 word0 = (((~((1U << 1) - 1)) << 6) & word0) | ((((1U << 1) - 1) & value) << 6); 6386 return *this; 6387 } 6388 volatile dma_status1_r &set_wgt_idle_c1(uint32_t value) volatile 6389 { 6390 word0 = (((~((1U << 1) - 1)) << 6) & word0) | ((((1U << 1) - 1) & value) << 6); 6391 return *this; 6392 } 6393 CONSTEXPR uint32_t get_bas_idle_c1() const 6394 { 6395 uint32_t value = ((1U << 1) - 1) & (word0 >> 7); 6396 return value; 6397 } 6398 uint32_t get_bas_idle_c1() const volatile 6399 { 6400 uint32_t value = ((1U << 1) - 1) & (word0 >> 7); 6401 return value; 6402 } 6403 CONSTEXPR dma_status1_r &set_bas_idle_c1(uint32_t value) 6404 { 6405 word0 = (((~((1U << 1) - 1)) << 7) & word0) | ((((1U << 1) - 1) & value) << 7); 6406 return *this; 6407 } 6408 volatile dma_status1_r &set_bas_idle_c1(uint32_t value) volatile 6409 { 6410 word0 = (((~((1U << 1) - 1)) << 7) & word0) | ((((1U << 1) - 1) & value) << 7); 6411 return *this; 6412 } 6413 CONSTEXPR uint32_t get_ib0_ai_valid_c1() const 6414 { 6415 uint32_t value = ((1U << 1) - 1) & (word0 >> 8); 6416 return value; 6417 } 6418 uint32_t get_ib0_ai_valid_c1() const volatile 6419 { 6420 uint32_t value = ((1U << 1) - 1) & (word0 >> 8); 6421 return value; 6422 } 6423 CONSTEXPR dma_status1_r &set_ib0_ai_valid_c1(uint32_t value) 6424 { 6425 word0 = (((~((1U << 1) - 1)) << 8) & word0) | ((((1U << 1) - 1) & value) << 8); 6426 return *this; 6427 } 6428 volatile dma_status1_r &set_ib0_ai_valid_c1(uint32_t value) volatile 6429 { 6430 word0 = (((~((1U << 1) - 1)) << 8) & word0) | ((((1U << 1) - 1) & value) << 8); 6431 return *this; 6432 } 6433 CONSTEXPR uint32_t get_ib0_ai_ready_c1() const 6434 { 6435 uint32_t value = ((1U << 1) - 1) & (word0 >> 9); 6436 return value; 6437 } 6438 uint32_t get_ib0_ai_ready_c1() const volatile 6439 { 6440 uint32_t value = ((1U << 1) - 1) & (word0 >> 9); 6441 return value; 6442 } 6443 CONSTEXPR dma_status1_r &set_ib0_ai_ready_c1(uint32_t value) 6444 { 6445 word0 = (((~((1U << 1) - 1)) << 9) & word0) | ((((1U << 1) - 1) & value) << 9); 6446 return *this; 6447 } 6448 volatile dma_status1_r &set_ib0_ai_ready_c1(uint32_t value) volatile 6449 { 6450 word0 = (((~((1U << 1) - 1)) << 9) & word0) | ((((1U << 1) - 1) & value) << 9); 6451 return *this; 6452 } 6453 CONSTEXPR uint32_t get_ib1_ai_valid_c1() const 6454 { 6455 uint32_t value = ((1U << 1) - 1) & (word0 >> 10); 6456 return value; 6457 } 6458 uint32_t get_ib1_ai_valid_c1() const volatile 6459 { 6460 uint32_t value = ((1U << 1) - 1) & (word0 >> 10); 6461 return value; 6462 } 6463 CONSTEXPR dma_status1_r &set_ib1_ai_valid_c1(uint32_t value) 6464 { 6465 word0 = (((~((1U << 1) - 1)) << 10) & word0) | ((((1U << 1) - 1) & value) << 10); 6466 return *this; 6467 } 6468 volatile dma_status1_r &set_ib1_ai_valid_c1(uint32_t value) volatile 6469 { 6470 word0 = (((~((1U << 1) - 1)) << 10) & word0) | ((((1U << 1) - 1) & value) << 10); 6471 return *this; 6472 } 6473 CONSTEXPR uint32_t get_ib1_ai_ready_c1() const 6474 { 6475 uint32_t value = ((1U << 1) - 1) & (word0 >> 11); 6476 return value; 6477 } 6478 uint32_t get_ib1_ai_ready_c1() const volatile 6479 { 6480 uint32_t value = ((1U << 1) - 1) & (word0 >> 11); 6481 return value; 6482 } 6483 CONSTEXPR dma_status1_r &set_ib1_ai_ready_c1(uint32_t value) 6484 { 6485 word0 = (((~((1U << 1) - 1)) << 11) & word0) | ((((1U << 1) - 1) & value) << 11); 6486 return *this; 6487 } 6488 volatile dma_status1_r &set_ib1_ai_ready_c1(uint32_t value) volatile 6489 { 6490 word0 = (((~((1U << 1) - 1)) << 11) & word0) | ((((1U << 1) - 1) & value) << 11); 6491 return *this; 6492 } 6493 CONSTEXPR uint32_t get_ib0_ao_valid_c1() const 6494 { 6495 uint32_t value = ((1U << 1) - 1) & (word0 >> 12); 6496 return value; 6497 } 6498 uint32_t get_ib0_ao_valid_c1() const volatile 6499 { 6500 uint32_t value = ((1U << 1) - 1) & (word0 >> 12); 6501 return value; 6502 } 6503 CONSTEXPR dma_status1_r &set_ib0_ao_valid_c1(uint32_t value) 6504 { 6505 word0 = (((~((1U << 1) - 1)) << 12) & word0) | ((((1U << 1) - 1) & value) << 12); 6506 return *this; 6507 } 6508 volatile dma_status1_r &set_ib0_ao_valid_c1(uint32_t value) volatile 6509 { 6510 word0 = (((~((1U << 1) - 1)) << 12) & word0) | ((((1U << 1) - 1) & value) << 12); 6511 return *this; 6512 } 6513 CONSTEXPR uint32_t get_ib0_ao_ready_c1() const 6514 { 6515 uint32_t value = ((1U << 1) - 1) & (word0 >> 13); 6516 return value; 6517 } 6518 uint32_t get_ib0_ao_ready_c1() const volatile 6519 { 6520 uint32_t value = ((1U << 1) - 1) & (word0 >> 13); 6521 return value; 6522 } 6523 CONSTEXPR dma_status1_r &set_ib0_ao_ready_c1(uint32_t value) 6524 { 6525 word0 = (((~((1U << 1) - 1)) << 13) & word0) | ((((1U << 1) - 1) & value) << 13); 6526 return *this; 6527 } 6528 volatile dma_status1_r &set_ib0_ao_ready_c1(uint32_t value) volatile 6529 { 6530 word0 = (((~((1U << 1) - 1)) << 13) & word0) | ((((1U << 1) - 1) & value) << 13); 6531 return *this; 6532 } 6533 CONSTEXPR uint32_t get_ib1_ao_valid_c1() const 6534 { 6535 uint32_t value = ((1U << 1) - 1) & (word0 >> 14); 6536 return value; 6537 } 6538 uint32_t get_ib1_ao_valid_c1() const volatile 6539 { 6540 uint32_t value = ((1U << 1) - 1) & (word0 >> 14); 6541 return value; 6542 } 6543 CONSTEXPR dma_status1_r &set_ib1_ao_valid_c1(uint32_t value) 6544 { 6545 word0 = (((~((1U << 1) - 1)) << 14) & word0) | ((((1U << 1) - 1) & value) << 14); 6546 return *this; 6547 } 6548 volatile dma_status1_r &set_ib1_ao_valid_c1(uint32_t value) volatile 6549 { 6550 word0 = (((~((1U << 1) - 1)) << 14) & word0) | ((((1U << 1) - 1) & value) << 14); 6551 return *this; 6552 } 6553 CONSTEXPR uint32_t get_ib1_ao_ready_c1() const 6554 { 6555 uint32_t value = ((1U << 1) - 1) & (word0 >> 15); 6556 return value; 6557 } 6558 uint32_t get_ib1_ao_ready_c1() const volatile 6559 { 6560 uint32_t value = ((1U << 1) - 1) & (word0 >> 15); 6561 return value; 6562 } 6563 CONSTEXPR dma_status1_r &set_ib1_ao_ready_c1(uint32_t value) 6564 { 6565 word0 = (((~((1U << 1) - 1)) << 15) & word0) | ((((1U << 1) - 1) & value) << 15); 6566 return *this; 6567 } 6568 volatile dma_status1_r &set_ib1_ao_ready_c1(uint32_t value) volatile 6569 { 6570 word0 = (((~((1U << 1) - 1)) << 15) & word0) | ((((1U << 1) - 1) & value) << 15); 6571 return *this; 6572 } 6573 CONSTEXPR uint32_t get_ob0_valid_c1() const 6574 { 6575 uint32_t value = ((1U << 1) - 1) & (word0 >> 16); 6576 return value; 6577 } 6578 uint32_t get_ob0_valid_c1() const volatile 6579 { 6580 uint32_t value = ((1U << 1) - 1) & (word0 >> 16); 6581 return value; 6582 } 6583 CONSTEXPR dma_status1_r &set_ob0_valid_c1(uint32_t value) 6584 { 6585 word0 = (((~((1U << 1) - 1)) << 16) & word0) | ((((1U << 1) - 1) & value) << 16); 6586 return *this; 6587 } 6588 volatile dma_status1_r &set_ob0_valid_c1(uint32_t value) volatile 6589 { 6590 word0 = (((~((1U << 1) - 1)) << 16) & word0) | ((((1U << 1) - 1) & value) << 16); 6591 return *this; 6592 } 6593 CONSTEXPR uint32_t get_ob0_ready_c1() const 6594 { 6595 uint32_t value = ((1U << 1) - 1) & (word0 >> 17); 6596 return value; 6597 } 6598 uint32_t get_ob0_ready_c1() const volatile 6599 { 6600 uint32_t value = ((1U << 1) - 1) & (word0 >> 17); 6601 return value; 6602 } 6603 CONSTEXPR dma_status1_r &set_ob0_ready_c1(uint32_t value) 6604 { 6605 word0 = (((~((1U << 1) - 1)) << 17) & word0) | ((((1U << 1) - 1) & value) << 17); 6606 return *this; 6607 } 6608 volatile dma_status1_r &set_ob0_ready_c1(uint32_t value) volatile 6609 { 6610 word0 = (((~((1U << 1) - 1)) << 17) & word0) | ((((1U << 1) - 1) & value) << 17); 6611 return *this; 6612 } 6613 CONSTEXPR uint32_t get_ob1_valid_c1() const 6614 { 6615 uint32_t value = ((1U << 1) - 1) & (word0 >> 18); 6616 return value; 6617 } 6618 uint32_t get_ob1_valid_c1() const volatile 6619 { 6620 uint32_t value = ((1U << 1) - 1) & (word0 >> 18); 6621 return value; 6622 } 6623 CONSTEXPR dma_status1_r &set_ob1_valid_c1(uint32_t value) 6624 { 6625 word0 = (((~((1U << 1) - 1)) << 18) & word0) | ((((1U << 1) - 1) & value) << 18); 6626 return *this; 6627 } 6628 volatile dma_status1_r &set_ob1_valid_c1(uint32_t value) volatile 6629 { 6630 word0 = (((~((1U << 1) - 1)) << 18) & word0) | ((((1U << 1) - 1) & value) << 18); 6631 return *this; 6632 } 6633 CONSTEXPR uint32_t get_ob1_ready_c1() const 6634 { 6635 uint32_t value = ((1U << 1) - 1) & (word0 >> 19); 6636 return value; 6637 } 6638 uint32_t get_ob1_ready_c1() const volatile 6639 { 6640 uint32_t value = ((1U << 1) - 1) & (word0 >> 19); 6641 return value; 6642 } 6643 CONSTEXPR dma_status1_r &set_ob1_ready_c1(uint32_t value) 6644 { 6645 word0 = (((~((1U << 1) - 1)) << 19) & word0) | ((((1U << 1) - 1) & value) << 19); 6646 return *this; 6647 } 6648 volatile dma_status1_r &set_ob1_ready_c1(uint32_t value) volatile 6649 { 6650 word0 = (((~((1U << 1) - 1)) << 19) & word0) | ((((1U << 1) - 1) & value) << 19); 6651 return *this; 6652 } 6653 CONSTEXPR uint32_t get_wd_bitstream_valid_c1() const 6654 { 6655 uint32_t value = ((1U << 1) - 1) & (word0 >> 20); 6656 return value; 6657 } 6658 uint32_t get_wd_bitstream_valid_c1() const volatile 6659 { 6660 uint32_t value = ((1U << 1) - 1) & (word0 >> 20); 6661 return value; 6662 } 6663 CONSTEXPR dma_status1_r &set_wd_bitstream_valid_c1(uint32_t value) 6664 { 6665 word0 = (((~((1U << 1) - 1)) << 20) & word0) | ((((1U << 1) - 1) & value) << 20); 6666 return *this; 6667 } 6668 volatile dma_status1_r &set_wd_bitstream_valid_c1(uint32_t value) volatile 6669 { 6670 word0 = (((~((1U << 1) - 1)) << 20) & word0) | ((((1U << 1) - 1) & value) << 20); 6671 return *this; 6672 } 6673 CONSTEXPR uint32_t get_wd_bitstream_ready_c1() const 6674 { 6675 uint32_t value = ((1U << 1) - 1) & (word0 >> 21); 6676 return value; 6677 } 6678 uint32_t get_wd_bitstream_ready_c1() const volatile 6679 { 6680 uint32_t value = ((1U << 1) - 1) & (word0 >> 21); 6681 return value; 6682 } 6683 CONSTEXPR dma_status1_r &set_wd_bitstream_ready_c1(uint32_t value) 6684 { 6685 word0 = (((~((1U << 1) - 1)) << 21) & word0) | ((((1U << 1) - 1) & value) << 21); 6686 return *this; 6687 } 6688 volatile dma_status1_r &set_wd_bitstream_ready_c1(uint32_t value) volatile 6689 { 6690 word0 = (((~((1U << 1) - 1)) << 21) & word0) | ((((1U << 1) - 1) & value) << 21); 6691 return *this; 6692 } 6693 CONSTEXPR uint32_t get_bs_bitstream_valid_c1() const 6694 { 6695 uint32_t value = ((1U << 1) - 1) & (word0 >> 22); 6696 return value; 6697 } 6698 uint32_t get_bs_bitstream_valid_c1() const volatile 6699 { 6700 uint32_t value = ((1U << 1) - 1) & (word0 >> 22); 6701 return value; 6702 } 6703 CONSTEXPR dma_status1_r &set_bs_bitstream_valid_c1(uint32_t value) 6704 { 6705 word0 = (((~((1U << 1) - 1)) << 22) & word0) | ((((1U << 1) - 1) & value) << 22); 6706 return *this; 6707 } 6708 volatile dma_status1_r &set_bs_bitstream_valid_c1(uint32_t value) volatile 6709 { 6710 word0 = (((~((1U << 1) - 1)) << 22) & word0) | ((((1U << 1) - 1) & value) << 22); 6711 return *this; 6712 } 6713 CONSTEXPR uint32_t get_bs_bitstream_ready_c1() const 6714 { 6715 uint32_t value = ((1U << 1) - 1) & (word0 >> 23); 6716 return value; 6717 } 6718 uint32_t get_bs_bitstream_ready_c1() const volatile 6719 { 6720 uint32_t value = ((1U << 1) - 1) & (word0 >> 23); 6721 return value; 6722 } 6723 CONSTEXPR dma_status1_r &set_bs_bitstream_ready_c1(uint32_t value) 6724 { 6725 word0 = (((~((1U << 1) - 1)) << 23) & word0) | ((((1U << 1) - 1) & value) << 23); 6726 return *this; 6727 } 6728 volatile dma_status1_r &set_bs_bitstream_ready_c1(uint32_t value) volatile 6729 { 6730 word0 = (((~((1U << 1) - 1)) << 23) & word0) | ((((1U << 1) - 1) & value) << 23); 6731 return *this; 6732 } 6733 #endif 6734 }; 6735 6736 // clkforce_r - Force clocks on for clock gating 6737 struct clkforce_r 6738 { 6739 #ifndef __cplusplus 6740 union 6741 { 6742 struct 6743 { 6744 uint32_t top_level_clk : 1; // set to 1 to force on TOP level clock 6745 uint32_t cc_clk : 1; // set to 1 to force on CC clock 6746 uint32_t dma_clk : 1; // set to 1 to force on DMA clock 6747 uint32_t mac_clk : 1; // set to 1 to force on MAC clock 6748 uint32_t ao_clk : 1; // set to 1 to force on AO clock 6749 uint32_t wd_clk : 1; // set to 1 to force on WD clock 6750 uint32_t reserved0 : 26; 6751 }; 6752 uint32_t word; 6753 }; 6754 #else 6755 private: 6756 uint32_t word0; 6757 6758 public: 6759 CONSTEXPR clkforce_r() : word0(0) {} 6760 CONSTEXPR clkforce_r(uint32_t init) : word0(init) {} 6761 CONSTEXPR void operator=(uint32_t value) 6762 { 6763 word0 = value; 6764 } 6765 void operator=(uint32_t value) volatile 6766 { 6767 word0 = value; 6768 } 6769 CONSTEXPR operator uint32_t() 6770 { 6771 return word0; 6772 } 6773 operator uint32_t() volatile 6774 { 6775 return word0; 6776 } 6777 clkforce_r copy() volatile 6778 { 6779 return *this; 6780 } 6781 CONSTEXPR uint32_t get_top_level_clk() const 6782 { 6783 uint32_t value = ((1U << 1) - 1) & (word0 >> 0); 6784 return value; 6785 } 6786 uint32_t get_top_level_clk() const volatile 6787 { 6788 uint32_t value = ((1U << 1) - 1) & (word0 >> 0); 6789 return value; 6790 } 6791 CONSTEXPR clkforce_r &set_top_level_clk(uint32_t value) 6792 { 6793 word0 = (((~((1U << 1) - 1)) << 0) & word0) | ((((1U << 1) - 1) & value) << 0); 6794 return *this; 6795 } 6796 volatile clkforce_r &set_top_level_clk(uint32_t value) volatile 6797 { 6798 word0 = (((~((1U << 1) - 1)) << 0) & word0) | ((((1U << 1) - 1) & value) << 0); 6799 return *this; 6800 } 6801 CONSTEXPR uint32_t get_cc_clk() const 6802 { 6803 uint32_t value = ((1U << 1) - 1) & (word0 >> 1); 6804 return value; 6805 } 6806 uint32_t get_cc_clk() const volatile 6807 { 6808 uint32_t value = ((1U << 1) - 1) & (word0 >> 1); 6809 return value; 6810 } 6811 CONSTEXPR clkforce_r &set_cc_clk(uint32_t value) 6812 { 6813 word0 = (((~((1U << 1) - 1)) << 1) & word0) | ((((1U << 1) - 1) & value) << 1); 6814 return *this; 6815 } 6816 volatile clkforce_r &set_cc_clk(uint32_t value) volatile 6817 { 6818 word0 = (((~((1U << 1) - 1)) << 1) & word0) | ((((1U << 1) - 1) & value) << 1); 6819 return *this; 6820 } 6821 CONSTEXPR uint32_t get_dma_clk() const 6822 { 6823 uint32_t value = ((1U << 1) - 1) & (word0 >> 2); 6824 return value; 6825 } 6826 uint32_t get_dma_clk() const volatile 6827 { 6828 uint32_t value = ((1U << 1) - 1) & (word0 >> 2); 6829 return value; 6830 } 6831 CONSTEXPR clkforce_r &set_dma_clk(uint32_t value) 6832 { 6833 word0 = (((~((1U << 1) - 1)) << 2) & word0) | ((((1U << 1) - 1) & value) << 2); 6834 return *this; 6835 } 6836 volatile clkforce_r &set_dma_clk(uint32_t value) volatile 6837 { 6838 word0 = (((~((1U << 1) - 1)) << 2) & word0) | ((((1U << 1) - 1) & value) << 2); 6839 return *this; 6840 } 6841 CONSTEXPR uint32_t get_mac_clk() const 6842 { 6843 uint32_t value = ((1U << 1) - 1) & (word0 >> 3); 6844 return value; 6845 } 6846 uint32_t get_mac_clk() const volatile 6847 { 6848 uint32_t value = ((1U << 1) - 1) & (word0 >> 3); 6849 return value; 6850 } 6851 CONSTEXPR clkforce_r &set_mac_clk(uint32_t value) 6852 { 6853 word0 = (((~((1U << 1) - 1)) << 3) & word0) | ((((1U << 1) - 1) & value) << 3); 6854 return *this; 6855 } 6856 volatile clkforce_r &set_mac_clk(uint32_t value) volatile 6857 { 6858 word0 = (((~((1U << 1) - 1)) << 3) & word0) | ((((1U << 1) - 1) & value) << 3); 6859 return *this; 6860 } 6861 CONSTEXPR uint32_t get_ao_clk() const 6862 { 6863 uint32_t value = ((1U << 1) - 1) & (word0 >> 4); 6864 return value; 6865 } 6866 uint32_t get_ao_clk() const volatile 6867 { 6868 uint32_t value = ((1U << 1) - 1) & (word0 >> 4); 6869 return value; 6870 } 6871 CONSTEXPR clkforce_r &set_ao_clk(uint32_t value) 6872 { 6873 word0 = (((~((1U << 1) - 1)) << 4) & word0) | ((((1U << 1) - 1) & value) << 4); 6874 return *this; 6875 } 6876 volatile clkforce_r &set_ao_clk(uint32_t value) volatile 6877 { 6878 word0 = (((~((1U << 1) - 1)) << 4) & word0) | ((((1U << 1) - 1) & value) << 4); 6879 return *this; 6880 } 6881 CONSTEXPR uint32_t get_wd_clk() const 6882 { 6883 uint32_t value = ((1U << 1) - 1) & (word0 >> 5); 6884 return value; 6885 } 6886 uint32_t get_wd_clk() const volatile 6887 { 6888 uint32_t value = ((1U << 1) - 1) & (word0 >> 5); 6889 return value; 6890 } 6891 CONSTEXPR clkforce_r &set_wd_clk(uint32_t value) 6892 { 6893 word0 = (((~((1U << 1) - 1)) << 5) & word0) | ((((1U << 1) - 1) & value) << 5); 6894 return *this; 6895 } 6896 volatile clkforce_r &set_wd_clk(uint32_t value) volatile 6897 { 6898 word0 = (((~((1U << 1) - 1)) << 5) & word0) | ((((1U << 1) - 1) & value) << 5); 6899 return *this; 6900 } 6901 #endif 6902 }; 6903 6904 // debug_address_r - Set debug address for register reads 0x400-0x7FF. The address must be 1KB aligned 6905 struct debug_address_r 6906 { 6907 #ifndef __cplusplus 6908 union 6909 { 6910 struct 6911 { 6912 uint32_t addr : 32; // Register address 6913 }; 6914 uint32_t word; 6915 }; 6916 #else 6917 private: 6918 uint32_t word0; 6919 6920 public: 6921 CONSTEXPR debug_address_r() : word0(0) {} 6922 CONSTEXPR debug_address_r(uint32_t init) : word0(init) {} 6923 CONSTEXPR void operator=(uint32_t value) 6924 { 6925 word0 = value; 6926 } 6927 void operator=(uint32_t value) volatile 6928 { 6929 word0 = value; 6930 } 6931 CONSTEXPR operator uint32_t() 6932 { 6933 return word0; 6934 } 6935 operator uint32_t() volatile 6936 { 6937 return word0; 6938 } 6939 debug_address_r copy() volatile 6940 { 6941 return *this; 6942 } 6943 CONSTEXPR uint32_t get_addr() const 6944 { 6945 uint32_t value = word0; 6946 return value; 6947 } 6948 uint32_t get_addr() const volatile 6949 { 6950 uint32_t value = word0; 6951 return value; 6952 } 6953 CONSTEXPR debug_address_r &set_addr(uint32_t value) 6954 { 6955 word0 = value; 6956 return *this; 6957 } 6958 volatile debug_address_r &set_addr(uint32_t value) volatile 6959 { 6960 word0 = value; 6961 return *this; 6962 } 6963 #endif 6964 }; 6965 6966 // debug_misc_r - 32-bit read/write register for driver debug use. This does not affect NPU function 6967 struct debug_misc_r 6968 { 6969 #ifndef __cplusplus 6970 union 6971 { 6972 struct 6973 { 6974 uint32_t misc : 32; // Debug misc 6975 }; 6976 uint32_t word; 6977 }; 6978 #else 6979 private: 6980 uint32_t word0; 6981 6982 public: 6983 CONSTEXPR debug_misc_r() : word0(0) {} 6984 CONSTEXPR debug_misc_r(uint32_t init) : word0(init) {} 6985 CONSTEXPR void operator=(uint32_t value) 6986 { 6987 word0 = value; 6988 } 6989 void operator=(uint32_t value) volatile 6990 { 6991 word0 = value; 6992 } 6993 CONSTEXPR operator uint32_t() 6994 { 6995 return word0; 6996 } 6997 operator uint32_t() volatile 6998 { 6999 return word0; 7000 } 7001 debug_misc_r copy() volatile 7002 { 7003 return *this; 7004 } 7005 CONSTEXPR uint32_t get_misc() const 7006 { 7007 uint32_t value = word0; 7008 return value; 7009 } 7010 uint32_t get_misc() const volatile 7011 { 7012 uint32_t value = word0; 7013 return value; 7014 } 7015 CONSTEXPR debug_misc_r &set_misc(uint32_t value) 7016 { 7017 word0 = value; 7018 return *this; 7019 } 7020 volatile debug_misc_r &set_misc(uint32_t value) volatile 7021 { 7022 word0 = value; 7023 return *this; 7024 } 7025 #endif 7026 }; 7027 7028 // debug_block_r - Set from which of four block banks the TSU registers are read. 0 = read from the current bank 256+n = 7029 // force to read from bank n where n is in the range 0 to 3 7030 struct debug_block_r 7031 { 7032 #ifndef __cplusplus 7033 union 7034 { 7035 struct 7036 { 7037 uint32_t block : 32; // Debug block 7038 }; 7039 uint32_t word; 7040 }; 7041 #else 7042 private: 7043 uint32_t word0; 7044 7045 public: 7046 CONSTEXPR debug_block_r() : word0(0) {} 7047 CONSTEXPR debug_block_r(uint32_t init) : word0(init) {} 7048 CONSTEXPR void operator=(uint32_t value) 7049 { 7050 word0 = value; 7051 } 7052 void operator=(uint32_t value) volatile 7053 { 7054 word0 = value; 7055 } 7056 CONSTEXPR operator uint32_t() 7057 { 7058 return word0; 7059 } 7060 operator uint32_t() volatile 7061 { 7062 return word0; 7063 } 7064 debug_block_r copy() volatile 7065 { 7066 return *this; 7067 } 7068 CONSTEXPR uint32_t get_block() const 7069 { 7070 uint32_t value = word0; 7071 return value; 7072 } 7073 uint32_t get_block() const volatile 7074 { 7075 uint32_t value = word0; 7076 return value; 7077 } 7078 CONSTEXPR debug_block_r &set_block(uint32_t value) 7079 { 7080 word0 = value; 7081 return *this; 7082 } 7083 volatile debug_block_r &set_block(uint32_t value) volatile 7084 { 7085 word0 = value; 7086 return *this; 7087 } 7088 #endif 7089 }; 7090 7091 // pmcr_r - PMU Register control 7092 struct pmcr_r 7093 { 7094 #ifndef __cplusplus 7095 union 7096 { 7097 struct 7098 { 7099 uint32_t cnt_en : 1; // Enable counter 7100 uint32_t event_cnt_rst : 1; // Reset event counter 7101 uint32_t cycle_cnt_rst : 1; // Reset cycle counter 7102 uint32_t mask_en : 1; // PMU can be enabled/disabled by command stream operation NPU_OP_PMU_MASK 7103 uint32_t reserved0 : 7; 7104 uint32_t num_event_cnt : 5; // Number of event counters 7105 uint32_t reserved1 : 16; 7106 }; 7107 uint32_t word; 7108 }; 7109 #else 7110 private: 7111 uint32_t word0; 7112 7113 public: 7114 CONSTEXPR pmcr_r() : word0(8192) {} 7115 CONSTEXPR pmcr_r(uint32_t init) : word0(init) {} 7116 CONSTEXPR void operator=(uint32_t value) 7117 { 7118 word0 = value; 7119 } 7120 void operator=(uint32_t value) volatile 7121 { 7122 word0 = value; 7123 } 7124 CONSTEXPR operator uint32_t() 7125 { 7126 return word0; 7127 } 7128 operator uint32_t() volatile 7129 { 7130 return word0; 7131 } 7132 pmcr_r copy() volatile 7133 { 7134 return *this; 7135 } 7136 CONSTEXPR uint32_t get_cnt_en() const 7137 { 7138 uint32_t value = ((1U << 1) - 1) & (word0 >> 0); 7139 return value; 7140 } 7141 uint32_t get_cnt_en() const volatile 7142 { 7143 uint32_t value = ((1U << 1) - 1) & (word0 >> 0); 7144 return value; 7145 } 7146 CONSTEXPR pmcr_r &set_cnt_en(uint32_t value) 7147 { 7148 word0 = (((~((1U << 1) - 1)) << 0) & word0) | ((((1U << 1) - 1) & value) << 0); 7149 return *this; 7150 } 7151 volatile pmcr_r &set_cnt_en(uint32_t value) volatile 7152 { 7153 word0 = (((~((1U << 1) - 1)) << 0) & word0) | ((((1U << 1) - 1) & value) << 0); 7154 return *this; 7155 } 7156 CONSTEXPR uint32_t get_event_cnt_rst() const 7157 { 7158 uint32_t value = ((1U << 1) - 1) & (word0 >> 1); 7159 return value; 7160 } 7161 uint32_t get_event_cnt_rst() const volatile 7162 { 7163 uint32_t value = ((1U << 1) - 1) & (word0 >> 1); 7164 return value; 7165 } 7166 CONSTEXPR pmcr_r &set_event_cnt_rst(uint32_t value) 7167 { 7168 word0 = (((~((1U << 1) - 1)) << 1) & word0) | ((((1U << 1) - 1) & value) << 1); 7169 return *this; 7170 } 7171 volatile pmcr_r &set_event_cnt_rst(uint32_t value) volatile 7172 { 7173 word0 = (((~((1U << 1) - 1)) << 1) & word0) | ((((1U << 1) - 1) & value) << 1); 7174 return *this; 7175 } 7176 CONSTEXPR uint32_t get_cycle_cnt_rst() const 7177 { 7178 uint32_t value = ((1U << 1) - 1) & (word0 >> 2); 7179 return value; 7180 } 7181 uint32_t get_cycle_cnt_rst() const volatile 7182 { 7183 uint32_t value = ((1U << 1) - 1) & (word0 >> 2); 7184 return value; 7185 } 7186 CONSTEXPR pmcr_r &set_cycle_cnt_rst(uint32_t value) 7187 { 7188 word0 = (((~((1U << 1) - 1)) << 2) & word0) | ((((1U << 1) - 1) & value) << 2); 7189 return *this; 7190 } 7191 volatile pmcr_r &set_cycle_cnt_rst(uint32_t value) volatile 7192 { 7193 word0 = (((~((1U << 1) - 1)) << 2) & word0) | ((((1U << 1) - 1) & value) << 2); 7194 return *this; 7195 } 7196 CONSTEXPR uint32_t get_mask_en() const 7197 { 7198 uint32_t value = ((1U << 1) - 1) & (word0 >> 3); 7199 return value; 7200 } 7201 uint32_t get_mask_en() const volatile 7202 { 7203 uint32_t value = ((1U << 1) - 1) & (word0 >> 3); 7204 return value; 7205 } 7206 CONSTEXPR pmcr_r &set_mask_en(uint32_t value) 7207 { 7208 word0 = (((~((1U << 1) - 1)) << 3) & word0) | ((((1U << 1) - 1) & value) << 3); 7209 return *this; 7210 } 7211 volatile pmcr_r &set_mask_en(uint32_t value) volatile 7212 { 7213 word0 = (((~((1U << 1) - 1)) << 3) & word0) | ((((1U << 1) - 1) & value) << 3); 7214 return *this; 7215 } 7216 CONSTEXPR uint32_t get_num_event_cnt() const 7217 { 7218 uint32_t value = ((1U << 5) - 1) & (word0 >> 11); 7219 return value; 7220 } 7221 uint32_t get_num_event_cnt() const volatile 7222 { 7223 uint32_t value = ((1U << 5) - 1) & (word0 >> 11); 7224 return value; 7225 } 7226 CONSTEXPR pmcr_r &set_num_event_cnt(uint32_t value) 7227 { 7228 word0 = (((~((1U << 5) - 1)) << 11) & word0) | ((((1U << 5) - 1) & value) << 11); 7229 return *this; 7230 } 7231 volatile pmcr_r &set_num_event_cnt(uint32_t value) volatile 7232 { 7233 word0 = (((~((1U << 5) - 1)) << 11) & word0) | ((((1U << 5) - 1) & value) << 11); 7234 return *this; 7235 } 7236 #endif 7237 }; 7238 7239 // pmcntenset_r - Count enable set register 7240 struct pmcntenset_r 7241 { 7242 #ifndef __cplusplus 7243 union 7244 { 7245 struct 7246 { 7247 uint32_t EVENT_CNT_0 : 1; // Event counter enable bit for PMEVCNTR0 7248 uint32_t EVENT_CNT_1 : 1; // Event counter enable bit for PMEVCNTR1 7249 uint32_t EVENT_CNT_2 : 1; // Event counter enable bit for PMEVCNTR2 7250 uint32_t EVENT_CNT_3 : 1; // Event counter enable bit for PMEVCNTR3 7251 uint32_t reserved0 : 27; 7252 uint32_t CYCLE_CNT : 1; // PMCCNTR enable bit 7253 }; 7254 uint32_t word; 7255 }; 7256 #else 7257 private: 7258 uint32_t word0; 7259 7260 public: 7261 CONSTEXPR pmcntenset_r() : word0(0) {} 7262 CONSTEXPR pmcntenset_r(uint32_t init) : word0(init) {} 7263 CONSTEXPR void operator=(uint32_t value) 7264 { 7265 word0 = value; 7266 } 7267 void operator=(uint32_t value) volatile 7268 { 7269 word0 = value; 7270 } 7271 CONSTEXPR operator uint32_t() 7272 { 7273 return word0; 7274 } 7275 operator uint32_t() volatile 7276 { 7277 return word0; 7278 } 7279 pmcntenset_r copy() volatile 7280 { 7281 return *this; 7282 } 7283 CONSTEXPR uint32_t get_EVENT_CNT_0() const 7284 { 7285 uint32_t value = ((1U << 1) - 1) & (word0 >> 0); 7286 return value; 7287 } 7288 uint32_t get_EVENT_CNT_0() const volatile 7289 { 7290 uint32_t value = ((1U << 1) - 1) & (word0 >> 0); 7291 return value; 7292 } 7293 CONSTEXPR pmcntenset_r &set_EVENT_CNT_0(uint32_t value) 7294 { 7295 word0 = (((~((1U << 1) - 1)) << 0) & word0) | ((((1U << 1) - 1) & value) << 0); 7296 return *this; 7297 } 7298 volatile pmcntenset_r &set_EVENT_CNT_0(uint32_t value) volatile 7299 { 7300 word0 = (((~((1U << 1) - 1)) << 0) & word0) | ((((1U << 1) - 1) & value) << 0); 7301 return *this; 7302 } 7303 CONSTEXPR uint32_t get_EVENT_CNT_1() const 7304 { 7305 uint32_t value = ((1U << 1) - 1) & (word0 >> 1); 7306 return value; 7307 } 7308 uint32_t get_EVENT_CNT_1() const volatile 7309 { 7310 uint32_t value = ((1U << 1) - 1) & (word0 >> 1); 7311 return value; 7312 } 7313 CONSTEXPR pmcntenset_r &set_EVENT_CNT_1(uint32_t value) 7314 { 7315 word0 = (((~((1U << 1) - 1)) << 1) & word0) | ((((1U << 1) - 1) & value) << 1); 7316 return *this; 7317 } 7318 volatile pmcntenset_r &set_EVENT_CNT_1(uint32_t value) volatile 7319 { 7320 word0 = (((~((1U << 1) - 1)) << 1) & word0) | ((((1U << 1) - 1) & value) << 1); 7321 return *this; 7322 } 7323 CONSTEXPR uint32_t get_EVENT_CNT_2() const 7324 { 7325 uint32_t value = ((1U << 1) - 1) & (word0 >> 2); 7326 return value; 7327 } 7328 uint32_t get_EVENT_CNT_2() const volatile 7329 { 7330 uint32_t value = ((1U << 1) - 1) & (word0 >> 2); 7331 return value; 7332 } 7333 CONSTEXPR pmcntenset_r &set_EVENT_CNT_2(uint32_t value) 7334 { 7335 word0 = (((~((1U << 1) - 1)) << 2) & word0) | ((((1U << 1) - 1) & value) << 2); 7336 return *this; 7337 } 7338 volatile pmcntenset_r &set_EVENT_CNT_2(uint32_t value) volatile 7339 { 7340 word0 = (((~((1U << 1) - 1)) << 2) & word0) | ((((1U << 1) - 1) & value) << 2); 7341 return *this; 7342 } 7343 CONSTEXPR uint32_t get_EVENT_CNT_3() const 7344 { 7345 uint32_t value = ((1U << 1) - 1) & (word0 >> 3); 7346 return value; 7347 } 7348 uint32_t get_EVENT_CNT_3() const volatile 7349 { 7350 uint32_t value = ((1U << 1) - 1) & (word0 >> 3); 7351 return value; 7352 } 7353 CONSTEXPR pmcntenset_r &set_EVENT_CNT_3(uint32_t value) 7354 { 7355 word0 = (((~((1U << 1) - 1)) << 3) & word0) | ((((1U << 1) - 1) & value) << 3); 7356 return *this; 7357 } 7358 volatile pmcntenset_r &set_EVENT_CNT_3(uint32_t value) volatile 7359 { 7360 word0 = (((~((1U << 1) - 1)) << 3) & word0) | ((((1U << 1) - 1) & value) << 3); 7361 return *this; 7362 } 7363 CONSTEXPR uint32_t get_CYCLE_CNT() const 7364 { 7365 uint32_t value = ((1U << 1) - 1) & (word0 >> 31); 7366 return value; 7367 } 7368 uint32_t get_CYCLE_CNT() const volatile 7369 { 7370 uint32_t value = ((1U << 1) - 1) & (word0 >> 31); 7371 return value; 7372 } 7373 CONSTEXPR pmcntenset_r &set_CYCLE_CNT(uint32_t value) 7374 { 7375 word0 = (((~((1U << 1) - 1)) << 31) & word0) | ((((1U << 1) - 1) & value) << 31); 7376 return *this; 7377 } 7378 volatile pmcntenset_r &set_CYCLE_CNT(uint32_t value) volatile 7379 { 7380 word0 = (((~((1U << 1) - 1)) << 31) & word0) | ((((1U << 1) - 1) & value) << 31); 7381 return *this; 7382 } 7383 #endif 7384 }; 7385 7386 // pmcntenclr_r - Count enable clear register 7387 struct pmcntenclr_r 7388 { 7389 #ifndef __cplusplus 7390 union 7391 { 7392 struct 7393 { 7394 uint32_t EVENT_CNT_0 : 1; // Event counter disable bit for PMEVCNTR0 7395 uint32_t EVENT_CNT_1 : 1; // Event counter disable bit for PMEVCNTR1 7396 uint32_t EVENT_CNT_2 : 1; // Event counter disable bit for PMEVCNTR2 7397 uint32_t EVENT_CNT_3 : 1; // Event counter disable bit for PMEVCNTR3 7398 uint32_t reserved0 : 27; 7399 uint32_t CYCLE_CNT : 1; // PMCCNTR disable bit 7400 }; 7401 uint32_t word; 7402 }; 7403 #else 7404 private: 7405 uint32_t word0; 7406 7407 public: 7408 CONSTEXPR pmcntenclr_r() : word0(0) {} 7409 CONSTEXPR pmcntenclr_r(uint32_t init) : word0(init) {} 7410 CONSTEXPR void operator=(uint32_t value) 7411 { 7412 word0 = value; 7413 } 7414 void operator=(uint32_t value) volatile 7415 { 7416 word0 = value; 7417 } 7418 CONSTEXPR operator uint32_t() 7419 { 7420 return word0; 7421 } 7422 operator uint32_t() volatile 7423 { 7424 return word0; 7425 } 7426 pmcntenclr_r copy() volatile 7427 { 7428 return *this; 7429 } 7430 CONSTEXPR uint32_t get_EVENT_CNT_0() const 7431 { 7432 uint32_t value = ((1U << 1) - 1) & (word0 >> 0); 7433 return value; 7434 } 7435 uint32_t get_EVENT_CNT_0() const volatile 7436 { 7437 uint32_t value = ((1U << 1) - 1) & (word0 >> 0); 7438 return value; 7439 } 7440 CONSTEXPR pmcntenclr_r &set_EVENT_CNT_0(uint32_t value) 7441 { 7442 word0 = (((~((1U << 1) - 1)) << 0) & word0) | ((((1U << 1) - 1) & value) << 0); 7443 return *this; 7444 } 7445 volatile pmcntenclr_r &set_EVENT_CNT_0(uint32_t value) volatile 7446 { 7447 word0 = (((~((1U << 1) - 1)) << 0) & word0) | ((((1U << 1) - 1) & value) << 0); 7448 return *this; 7449 } 7450 CONSTEXPR uint32_t get_EVENT_CNT_1() const 7451 { 7452 uint32_t value = ((1U << 1) - 1) & (word0 >> 1); 7453 return value; 7454 } 7455 uint32_t get_EVENT_CNT_1() const volatile 7456 { 7457 uint32_t value = ((1U << 1) - 1) & (word0 >> 1); 7458 return value; 7459 } 7460 CONSTEXPR pmcntenclr_r &set_EVENT_CNT_1(uint32_t value) 7461 { 7462 word0 = (((~((1U << 1) - 1)) << 1) & word0) | ((((1U << 1) - 1) & value) << 1); 7463 return *this; 7464 } 7465 volatile pmcntenclr_r &set_EVENT_CNT_1(uint32_t value) volatile 7466 { 7467 word0 = (((~((1U << 1) - 1)) << 1) & word0) | ((((1U << 1) - 1) & value) << 1); 7468 return *this; 7469 } 7470 CONSTEXPR uint32_t get_EVENT_CNT_2() const 7471 { 7472 uint32_t value = ((1U << 1) - 1) & (word0 >> 2); 7473 return value; 7474 } 7475 uint32_t get_EVENT_CNT_2() const volatile 7476 { 7477 uint32_t value = ((1U << 1) - 1) & (word0 >> 2); 7478 return value; 7479 } 7480 CONSTEXPR pmcntenclr_r &set_EVENT_CNT_2(uint32_t value) 7481 { 7482 word0 = (((~((1U << 1) - 1)) << 2) & word0) | ((((1U << 1) - 1) & value) << 2); 7483 return *this; 7484 } 7485 volatile pmcntenclr_r &set_EVENT_CNT_2(uint32_t value) volatile 7486 { 7487 word0 = (((~((1U << 1) - 1)) << 2) & word0) | ((((1U << 1) - 1) & value) << 2); 7488 return *this; 7489 } 7490 CONSTEXPR uint32_t get_EVENT_CNT_3() const 7491 { 7492 uint32_t value = ((1U << 1) - 1) & (word0 >> 3); 7493 return value; 7494 } 7495 uint32_t get_EVENT_CNT_3() const volatile 7496 { 7497 uint32_t value = ((1U << 1) - 1) & (word0 >> 3); 7498 return value; 7499 } 7500 CONSTEXPR pmcntenclr_r &set_EVENT_CNT_3(uint32_t value) 7501 { 7502 word0 = (((~((1U << 1) - 1)) << 3) & word0) | ((((1U << 1) - 1) & value) << 3); 7503 return *this; 7504 } 7505 volatile pmcntenclr_r &set_EVENT_CNT_3(uint32_t value) volatile 7506 { 7507 word0 = (((~((1U << 1) - 1)) << 3) & word0) | ((((1U << 1) - 1) & value) << 3); 7508 return *this; 7509 } 7510 CONSTEXPR uint32_t get_CYCLE_CNT() const 7511 { 7512 uint32_t value = ((1U << 1) - 1) & (word0 >> 31); 7513 return value; 7514 } 7515 uint32_t get_CYCLE_CNT() const volatile 7516 { 7517 uint32_t value = ((1U << 1) - 1) & (word0 >> 31); 7518 return value; 7519 } 7520 CONSTEXPR pmcntenclr_r &set_CYCLE_CNT(uint32_t value) 7521 { 7522 word0 = (((~((1U << 1) - 1)) << 31) & word0) | ((((1U << 1) - 1) & value) << 31); 7523 return *this; 7524 } 7525 volatile pmcntenclr_r &set_CYCLE_CNT(uint32_t value) volatile 7526 { 7527 word0 = (((~((1U << 1) - 1)) << 31) & word0) | ((((1U << 1) - 1) & value) << 31); 7528 return *this; 7529 } 7530 #endif 7531 }; 7532 7533 // pmovsset_r - Overflow flag status set register 7534 struct pmovsset_r 7535 { 7536 #ifndef __cplusplus 7537 union 7538 { 7539 struct 7540 { 7541 uint32_t EVENT_CNT_0_OVF : 1; // Event counter overflow set bit for PMEVCNTR0 7542 uint32_t EVENT_CNT_1_OVF : 1; // Event counter overflow set bit for PMEVCNTR1 7543 uint32_t EVENT_CNT_2_OVF : 1; // Event counter overflow set bit for PMEVCNTR2 7544 uint32_t EVENT_CNT_3_OVF : 1; // Event counter overflow set bit for PMEVCNTR3 7545 uint32_t reserved0 : 27; 7546 uint32_t CYCLE_CNT_OVF : 1; // PMCCNTR overflow set bit 7547 }; 7548 uint32_t word; 7549 }; 7550 #else 7551 private: 7552 uint32_t word0; 7553 7554 public: 7555 CONSTEXPR pmovsset_r() : word0(0) {} 7556 CONSTEXPR pmovsset_r(uint32_t init) : word0(init) {} 7557 CONSTEXPR void operator=(uint32_t value) 7558 { 7559 word0 = value; 7560 } 7561 void operator=(uint32_t value) volatile 7562 { 7563 word0 = value; 7564 } 7565 CONSTEXPR operator uint32_t() 7566 { 7567 return word0; 7568 } 7569 operator uint32_t() volatile 7570 { 7571 return word0; 7572 } 7573 pmovsset_r copy() volatile 7574 { 7575 return *this; 7576 } 7577 CONSTEXPR uint32_t get_EVENT_CNT_0_OVF() const 7578 { 7579 uint32_t value = ((1U << 1) - 1) & (word0 >> 0); 7580 return value; 7581 } 7582 uint32_t get_EVENT_CNT_0_OVF() const volatile 7583 { 7584 uint32_t value = ((1U << 1) - 1) & (word0 >> 0); 7585 return value; 7586 } 7587 CONSTEXPR pmovsset_r &set_EVENT_CNT_0_OVF(uint32_t value) 7588 { 7589 word0 = (((~((1U << 1) - 1)) << 0) & word0) | ((((1U << 1) - 1) & value) << 0); 7590 return *this; 7591 } 7592 volatile pmovsset_r &set_EVENT_CNT_0_OVF(uint32_t value) volatile 7593 { 7594 word0 = (((~((1U << 1) - 1)) << 0) & word0) | ((((1U << 1) - 1) & value) << 0); 7595 return *this; 7596 } 7597 CONSTEXPR uint32_t get_EVENT_CNT_1_OVF() const 7598 { 7599 uint32_t value = ((1U << 1) - 1) & (word0 >> 1); 7600 return value; 7601 } 7602 uint32_t get_EVENT_CNT_1_OVF() const volatile 7603 { 7604 uint32_t value = ((1U << 1) - 1) & (word0 >> 1); 7605 return value; 7606 } 7607 CONSTEXPR pmovsset_r &set_EVENT_CNT_1_OVF(uint32_t value) 7608 { 7609 word0 = (((~((1U << 1) - 1)) << 1) & word0) | ((((1U << 1) - 1) & value) << 1); 7610 return *this; 7611 } 7612 volatile pmovsset_r &set_EVENT_CNT_1_OVF(uint32_t value) volatile 7613 { 7614 word0 = (((~((1U << 1) - 1)) << 1) & word0) | ((((1U << 1) - 1) & value) << 1); 7615 return *this; 7616 } 7617 CONSTEXPR uint32_t get_EVENT_CNT_2_OVF() const 7618 { 7619 uint32_t value = ((1U << 1) - 1) & (word0 >> 2); 7620 return value; 7621 } 7622 uint32_t get_EVENT_CNT_2_OVF() const volatile 7623 { 7624 uint32_t value = ((1U << 1) - 1) & (word0 >> 2); 7625 return value; 7626 } 7627 CONSTEXPR pmovsset_r &set_EVENT_CNT_2_OVF(uint32_t value) 7628 { 7629 word0 = (((~((1U << 1) - 1)) << 2) & word0) | ((((1U << 1) - 1) & value) << 2); 7630 return *this; 7631 } 7632 volatile pmovsset_r &set_EVENT_CNT_2_OVF(uint32_t value) volatile 7633 { 7634 word0 = (((~((1U << 1) - 1)) << 2) & word0) | ((((1U << 1) - 1) & value) << 2); 7635 return *this; 7636 } 7637 CONSTEXPR uint32_t get_EVENT_CNT_3_OVF() const 7638 { 7639 uint32_t value = ((1U << 1) - 1) & (word0 >> 3); 7640 return value; 7641 } 7642 uint32_t get_EVENT_CNT_3_OVF() const volatile 7643 { 7644 uint32_t value = ((1U << 1) - 1) & (word0 >> 3); 7645 return value; 7646 } 7647 CONSTEXPR pmovsset_r &set_EVENT_CNT_3_OVF(uint32_t value) 7648 { 7649 word0 = (((~((1U << 1) - 1)) << 3) & word0) | ((((1U << 1) - 1) & value) << 3); 7650 return *this; 7651 } 7652 volatile pmovsset_r &set_EVENT_CNT_3_OVF(uint32_t value) volatile 7653 { 7654 word0 = (((~((1U << 1) - 1)) << 3) & word0) | ((((1U << 1) - 1) & value) << 3); 7655 return *this; 7656 } 7657 CONSTEXPR uint32_t get_CYCLE_CNT_OVF() const 7658 { 7659 uint32_t value = ((1U << 1) - 1) & (word0 >> 31); 7660 return value; 7661 } 7662 uint32_t get_CYCLE_CNT_OVF() const volatile 7663 { 7664 uint32_t value = ((1U << 1) - 1) & (word0 >> 31); 7665 return value; 7666 } 7667 CONSTEXPR pmovsset_r &set_CYCLE_CNT_OVF(uint32_t value) 7668 { 7669 word0 = (((~((1U << 1) - 1)) << 31) & word0) | ((((1U << 1) - 1) & value) << 31); 7670 return *this; 7671 } 7672 volatile pmovsset_r &set_CYCLE_CNT_OVF(uint32_t value) volatile 7673 { 7674 word0 = (((~((1U << 1) - 1)) << 31) & word0) | ((((1U << 1) - 1) & value) << 31); 7675 return *this; 7676 } 7677 #endif 7678 }; 7679 7680 // pmovsclr_r - Overflow flag status clear register 7681 struct pmovsclr_r 7682 { 7683 #ifndef __cplusplus 7684 union 7685 { 7686 struct 7687 { 7688 uint32_t EVENT_CNT_0_OVF : 1; // Event counter overflow clear bit for PMEVCNTR0 7689 uint32_t EVENT_CNT_1_OVF : 1; // Event counter overflow clear bit for PMEVCNTR1 7690 uint32_t EVENT_CNT_2_OVF : 1; // Event counter overflow clear bit for PMEVCNTR2 7691 uint32_t EVENT_CNT_3_OVF : 1; // Event counter overflow clear bit for PMEVCNTR3 7692 uint32_t reserved0 : 27; 7693 uint32_t CYCLE_CNT_OVF : 1; // PMCCNTR overflow clear bit 7694 }; 7695 uint32_t word; 7696 }; 7697 #else 7698 private: 7699 uint32_t word0; 7700 7701 public: 7702 CONSTEXPR pmovsclr_r() : word0(0) {} 7703 CONSTEXPR pmovsclr_r(uint32_t init) : word0(init) {} 7704 CONSTEXPR void operator=(uint32_t value) 7705 { 7706 word0 = value; 7707 } 7708 void operator=(uint32_t value) volatile 7709 { 7710 word0 = value; 7711 } 7712 CONSTEXPR operator uint32_t() 7713 { 7714 return word0; 7715 } 7716 operator uint32_t() volatile 7717 { 7718 return word0; 7719 } 7720 pmovsclr_r copy() volatile 7721 { 7722 return *this; 7723 } 7724 CONSTEXPR uint32_t get_EVENT_CNT_0_OVF() const 7725 { 7726 uint32_t value = ((1U << 1) - 1) & (word0 >> 0); 7727 return value; 7728 } 7729 uint32_t get_EVENT_CNT_0_OVF() const volatile 7730 { 7731 uint32_t value = ((1U << 1) - 1) & (word0 >> 0); 7732 return value; 7733 } 7734 CONSTEXPR pmovsclr_r &set_EVENT_CNT_0_OVF(uint32_t value) 7735 { 7736 word0 = (((~((1U << 1) - 1)) << 0) & word0) | ((((1U << 1) - 1) & value) << 0); 7737 return *this; 7738 } 7739 volatile pmovsclr_r &set_EVENT_CNT_0_OVF(uint32_t value) volatile 7740 { 7741 word0 = (((~((1U << 1) - 1)) << 0) & word0) | ((((1U << 1) - 1) & value) << 0); 7742 return *this; 7743 } 7744 CONSTEXPR uint32_t get_EVENT_CNT_1_OVF() const 7745 { 7746 uint32_t value = ((1U << 1) - 1) & (word0 >> 1); 7747 return value; 7748 } 7749 uint32_t get_EVENT_CNT_1_OVF() const volatile 7750 { 7751 uint32_t value = ((1U << 1) - 1) & (word0 >> 1); 7752 return value; 7753 } 7754 CONSTEXPR pmovsclr_r &set_EVENT_CNT_1_OVF(uint32_t value) 7755 { 7756 word0 = (((~((1U << 1) - 1)) << 1) & word0) | ((((1U << 1) - 1) & value) << 1); 7757 return *this; 7758 } 7759 volatile pmovsclr_r &set_EVENT_CNT_1_OVF(uint32_t value) volatile 7760 { 7761 word0 = (((~((1U << 1) - 1)) << 1) & word0) | ((((1U << 1) - 1) & value) << 1); 7762 return *this; 7763 } 7764 CONSTEXPR uint32_t get_EVENT_CNT_2_OVF() const 7765 { 7766 uint32_t value = ((1U << 1) - 1) & (word0 >> 2); 7767 return value; 7768 } 7769 uint32_t get_EVENT_CNT_2_OVF() const volatile 7770 { 7771 uint32_t value = ((1U << 1) - 1) & (word0 >> 2); 7772 return value; 7773 } 7774 CONSTEXPR pmovsclr_r &set_EVENT_CNT_2_OVF(uint32_t value) 7775 { 7776 word0 = (((~((1U << 1) - 1)) << 2) & word0) | ((((1U << 1) - 1) & value) << 2); 7777 return *this; 7778 } 7779 volatile pmovsclr_r &set_EVENT_CNT_2_OVF(uint32_t value) volatile 7780 { 7781 word0 = (((~((1U << 1) - 1)) << 2) & word0) | ((((1U << 1) - 1) & value) << 2); 7782 return *this; 7783 } 7784 CONSTEXPR uint32_t get_EVENT_CNT_3_OVF() const 7785 { 7786 uint32_t value = ((1U << 1) - 1) & (word0 >> 3); 7787 return value; 7788 } 7789 uint32_t get_EVENT_CNT_3_OVF() const volatile 7790 { 7791 uint32_t value = ((1U << 1) - 1) & (word0 >> 3); 7792 return value; 7793 } 7794 CONSTEXPR pmovsclr_r &set_EVENT_CNT_3_OVF(uint32_t value) 7795 { 7796 word0 = (((~((1U << 1) - 1)) << 3) & word0) | ((((1U << 1) - 1) & value) << 3); 7797 return *this; 7798 } 7799 volatile pmovsclr_r &set_EVENT_CNT_3_OVF(uint32_t value) volatile 7800 { 7801 word0 = (((~((1U << 1) - 1)) << 3) & word0) | ((((1U << 1) - 1) & value) << 3); 7802 return *this; 7803 } 7804 CONSTEXPR uint32_t get_CYCLE_CNT_OVF() const 7805 { 7806 uint32_t value = ((1U << 1) - 1) & (word0 >> 31); 7807 return value; 7808 } 7809 uint32_t get_CYCLE_CNT_OVF() const volatile 7810 { 7811 uint32_t value = ((1U << 1) - 1) & (word0 >> 31); 7812 return value; 7813 } 7814 CONSTEXPR pmovsclr_r &set_CYCLE_CNT_OVF(uint32_t value) 7815 { 7816 word0 = (((~((1U << 1) - 1)) << 31) & word0) | ((((1U << 1) - 1) & value) << 31); 7817 return *this; 7818 } 7819 volatile pmovsclr_r &set_CYCLE_CNT_OVF(uint32_t value) volatile 7820 { 7821 word0 = (((~((1U << 1) - 1)) << 31) & word0) | ((((1U << 1) - 1) & value) << 31); 7822 return *this; 7823 } 7824 #endif 7825 }; 7826 7827 // pmintset_r - Interrupt enable set register 7828 struct pmintset_r 7829 { 7830 #ifndef __cplusplus 7831 union 7832 { 7833 struct 7834 { 7835 uint32_t EVENT_CNT_0_INT : 1; // Event counter overflow interrupt request enable bit for PMEVCNTR0 7836 uint32_t EVENT_CNT_1_INT : 1; // Event counter overflow interrupt request enable bit for PMEVCNTR1 7837 uint32_t EVENT_CNT_2_INT : 1; // Event counter overflow interrupt request enable bit for PMEVCNTR2 7838 uint32_t EVENT_CNT_3_INT : 1; // Event counter overflow interrupt request enable bit for PMEVCNTR3 7839 uint32_t reserved0 : 27; 7840 uint32_t CYCLE_CNT_INT : 1; // PMCCNTR overflow interrupt request enable bit 7841 }; 7842 uint32_t word; 7843 }; 7844 #else 7845 private: 7846 uint32_t word0; 7847 7848 public: 7849 CONSTEXPR pmintset_r() : word0(0) {} 7850 CONSTEXPR pmintset_r(uint32_t init) : word0(init) {} 7851 CONSTEXPR void operator=(uint32_t value) 7852 { 7853 word0 = value; 7854 } 7855 void operator=(uint32_t value) volatile 7856 { 7857 word0 = value; 7858 } 7859 CONSTEXPR operator uint32_t() 7860 { 7861 return word0; 7862 } 7863 operator uint32_t() volatile 7864 { 7865 return word0; 7866 } 7867 pmintset_r copy() volatile 7868 { 7869 return *this; 7870 } 7871 CONSTEXPR uint32_t get_EVENT_CNT_0_INT() const 7872 { 7873 uint32_t value = ((1U << 1) - 1) & (word0 >> 0); 7874 return value; 7875 } 7876 uint32_t get_EVENT_CNT_0_INT() const volatile 7877 { 7878 uint32_t value = ((1U << 1) - 1) & (word0 >> 0); 7879 return value; 7880 } 7881 CONSTEXPR pmintset_r &set_EVENT_CNT_0_INT(uint32_t value) 7882 { 7883 word0 = (((~((1U << 1) - 1)) << 0) & word0) | ((((1U << 1) - 1) & value) << 0); 7884 return *this; 7885 } 7886 volatile pmintset_r &set_EVENT_CNT_0_INT(uint32_t value) volatile 7887 { 7888 word0 = (((~((1U << 1) - 1)) << 0) & word0) | ((((1U << 1) - 1) & value) << 0); 7889 return *this; 7890 } 7891 CONSTEXPR uint32_t get_EVENT_CNT_1_INT() const 7892 { 7893 uint32_t value = ((1U << 1) - 1) & (word0 >> 1); 7894 return value; 7895 } 7896 uint32_t get_EVENT_CNT_1_INT() const volatile 7897 { 7898 uint32_t value = ((1U << 1) - 1) & (word0 >> 1); 7899 return value; 7900 } 7901 CONSTEXPR pmintset_r &set_EVENT_CNT_1_INT(uint32_t value) 7902 { 7903 word0 = (((~((1U << 1) - 1)) << 1) & word0) | ((((1U << 1) - 1) & value) << 1); 7904 return *this; 7905 } 7906 volatile pmintset_r &set_EVENT_CNT_1_INT(uint32_t value) volatile 7907 { 7908 word0 = (((~((1U << 1) - 1)) << 1) & word0) | ((((1U << 1) - 1) & value) << 1); 7909 return *this; 7910 } 7911 CONSTEXPR uint32_t get_EVENT_CNT_2_INT() const 7912 { 7913 uint32_t value = ((1U << 1) - 1) & (word0 >> 2); 7914 return value; 7915 } 7916 uint32_t get_EVENT_CNT_2_INT() const volatile 7917 { 7918 uint32_t value = ((1U << 1) - 1) & (word0 >> 2); 7919 return value; 7920 } 7921 CONSTEXPR pmintset_r &set_EVENT_CNT_2_INT(uint32_t value) 7922 { 7923 word0 = (((~((1U << 1) - 1)) << 2) & word0) | ((((1U << 1) - 1) & value) << 2); 7924 return *this; 7925 } 7926 volatile pmintset_r &set_EVENT_CNT_2_INT(uint32_t value) volatile 7927 { 7928 word0 = (((~((1U << 1) - 1)) << 2) & word0) | ((((1U << 1) - 1) & value) << 2); 7929 return *this; 7930 } 7931 CONSTEXPR uint32_t get_EVENT_CNT_3_INT() const 7932 { 7933 uint32_t value = ((1U << 1) - 1) & (word0 >> 3); 7934 return value; 7935 } 7936 uint32_t get_EVENT_CNT_3_INT() const volatile 7937 { 7938 uint32_t value = ((1U << 1) - 1) & (word0 >> 3); 7939 return value; 7940 } 7941 CONSTEXPR pmintset_r &set_EVENT_CNT_3_INT(uint32_t value) 7942 { 7943 word0 = (((~((1U << 1) - 1)) << 3) & word0) | ((((1U << 1) - 1) & value) << 3); 7944 return *this; 7945 } 7946 volatile pmintset_r &set_EVENT_CNT_3_INT(uint32_t value) volatile 7947 { 7948 word0 = (((~((1U << 1) - 1)) << 3) & word0) | ((((1U << 1) - 1) & value) << 3); 7949 return *this; 7950 } 7951 CONSTEXPR uint32_t get_CYCLE_CNT_INT() const 7952 { 7953 uint32_t value = ((1U << 1) - 1) & (word0 >> 31); 7954 return value; 7955 } 7956 uint32_t get_CYCLE_CNT_INT() const volatile 7957 { 7958 uint32_t value = ((1U << 1) - 1) & (word0 >> 31); 7959 return value; 7960 } 7961 CONSTEXPR pmintset_r &set_CYCLE_CNT_INT(uint32_t value) 7962 { 7963 word0 = (((~((1U << 1) - 1)) << 31) & word0) | ((((1U << 1) - 1) & value) << 31); 7964 return *this; 7965 } 7966 volatile pmintset_r &set_CYCLE_CNT_INT(uint32_t value) volatile 7967 { 7968 word0 = (((~((1U << 1) - 1)) << 31) & word0) | ((((1U << 1) - 1) & value) << 31); 7969 return *this; 7970 } 7971 #endif 7972 }; 7973 7974 // pmintclr_r - Interrupt enable clear register 7975 struct pmintclr_r 7976 { 7977 #ifndef __cplusplus 7978 union 7979 { 7980 struct 7981 { 7982 uint32_t EVENT_CNT_0_INT : 1; // Event counter overflow interrupt request disable bit for PMEVCNTR0 7983 uint32_t EVENT_CNT_1_INT : 1; // Event counter overflow interrupt request disable bit for PMEVCNTR1 7984 uint32_t EVENT_CNT_2_INT : 1; // Event counter overflow interrupt request disable bit for PMEVCNTR2 7985 uint32_t EVENT_CNT_3_INT : 1; // Event counter overflow interrupt request disable bit for PMEVCNTR3 7986 uint32_t reserved0 : 27; 7987 uint32_t CYCLE_CNT_INT : 1; // PMCCNTR overflow interrupt request disable bit 7988 }; 7989 uint32_t word; 7990 }; 7991 #else 7992 private: 7993 uint32_t word0; 7994 7995 public: 7996 CONSTEXPR pmintclr_r() : word0(0) {} 7997 CONSTEXPR pmintclr_r(uint32_t init) : word0(init) {} 7998 CONSTEXPR void operator=(uint32_t value) 7999 { 8000 word0 = value; 8001 } 8002 void operator=(uint32_t value) volatile 8003 { 8004 word0 = value; 8005 } 8006 CONSTEXPR operator uint32_t() 8007 { 8008 return word0; 8009 } 8010 operator uint32_t() volatile 8011 { 8012 return word0; 8013 } 8014 pmintclr_r copy() volatile 8015 { 8016 return *this; 8017 } 8018 CONSTEXPR uint32_t get_EVENT_CNT_0_INT() const 8019 { 8020 uint32_t value = ((1U << 1) - 1) & (word0 >> 0); 8021 return value; 8022 } 8023 uint32_t get_EVENT_CNT_0_INT() const volatile 8024 { 8025 uint32_t value = ((1U << 1) - 1) & (word0 >> 0); 8026 return value; 8027 } 8028 CONSTEXPR pmintclr_r &set_EVENT_CNT_0_INT(uint32_t value) 8029 { 8030 word0 = (((~((1U << 1) - 1)) << 0) & word0) | ((((1U << 1) - 1) & value) << 0); 8031 return *this; 8032 } 8033 volatile pmintclr_r &set_EVENT_CNT_0_INT(uint32_t value) volatile 8034 { 8035 word0 = (((~((1U << 1) - 1)) << 0) & word0) | ((((1U << 1) - 1) & value) << 0); 8036 return *this; 8037 } 8038 CONSTEXPR uint32_t get_EVENT_CNT_1_INT() const 8039 { 8040 uint32_t value = ((1U << 1) - 1) & (word0 >> 1); 8041 return value; 8042 } 8043 uint32_t get_EVENT_CNT_1_INT() const volatile 8044 { 8045 uint32_t value = ((1U << 1) - 1) & (word0 >> 1); 8046 return value; 8047 } 8048 CONSTEXPR pmintclr_r &set_EVENT_CNT_1_INT(uint32_t value) 8049 { 8050 word0 = (((~((1U << 1) - 1)) << 1) & word0) | ((((1U << 1) - 1) & value) << 1); 8051 return *this; 8052 } 8053 volatile pmintclr_r &set_EVENT_CNT_1_INT(uint32_t value) volatile 8054 { 8055 word0 = (((~((1U << 1) - 1)) << 1) & word0) | ((((1U << 1) - 1) & value) << 1); 8056 return *this; 8057 } 8058 CONSTEXPR uint32_t get_EVENT_CNT_2_INT() const 8059 { 8060 uint32_t value = ((1U << 1) - 1) & (word0 >> 2); 8061 return value; 8062 } 8063 uint32_t get_EVENT_CNT_2_INT() const volatile 8064 { 8065 uint32_t value = ((1U << 1) - 1) & (word0 >> 2); 8066 return value; 8067 } 8068 CONSTEXPR pmintclr_r &set_EVENT_CNT_2_INT(uint32_t value) 8069 { 8070 word0 = (((~((1U << 1) - 1)) << 2) & word0) | ((((1U << 1) - 1) & value) << 2); 8071 return *this; 8072 } 8073 volatile pmintclr_r &set_EVENT_CNT_2_INT(uint32_t value) volatile 8074 { 8075 word0 = (((~((1U << 1) - 1)) << 2) & word0) | ((((1U << 1) - 1) & value) << 2); 8076 return *this; 8077 } 8078 CONSTEXPR uint32_t get_EVENT_CNT_3_INT() const 8079 { 8080 uint32_t value = ((1U << 1) - 1) & (word0 >> 3); 8081 return value; 8082 } 8083 uint32_t get_EVENT_CNT_3_INT() const volatile 8084 { 8085 uint32_t value = ((1U << 1) - 1) & (word0 >> 3); 8086 return value; 8087 } 8088 CONSTEXPR pmintclr_r &set_EVENT_CNT_3_INT(uint32_t value) 8089 { 8090 word0 = (((~((1U << 1) - 1)) << 3) & word0) | ((((1U << 1) - 1) & value) << 3); 8091 return *this; 8092 } 8093 volatile pmintclr_r &set_EVENT_CNT_3_INT(uint32_t value) volatile 8094 { 8095 word0 = (((~((1U << 1) - 1)) << 3) & word0) | ((((1U << 1) - 1) & value) << 3); 8096 return *this; 8097 } 8098 CONSTEXPR uint32_t get_CYCLE_CNT_INT() const 8099 { 8100 uint32_t value = ((1U << 1) - 1) & (word0 >> 31); 8101 return value; 8102 } 8103 uint32_t get_CYCLE_CNT_INT() const volatile 8104 { 8105 uint32_t value = ((1U << 1) - 1) & (word0 >> 31); 8106 return value; 8107 } 8108 CONSTEXPR pmintclr_r &set_CYCLE_CNT_INT(uint32_t value) 8109 { 8110 word0 = (((~((1U << 1) - 1)) << 31) & word0) | ((((1U << 1) - 1) & value) << 31); 8111 return *this; 8112 } 8113 volatile pmintclr_r &set_CYCLE_CNT_INT(uint32_t value) volatile 8114 { 8115 word0 = (((~((1U << 1) - 1)) << 31) & word0) | ((((1U << 1) - 1) & value) << 31); 8116 return *this; 8117 } 8118 #endif 8119 }; 8120 8121 // pmccntr_r - Performance monitor cycle count register 8122 struct pmccntr_r 8123 { 8124 #ifndef __cplusplus 8125 union 8126 { 8127 struct 8128 { 8129 uint32_t CYCLE_CNT_LO : 32; // Cycle count - LSB 8130 uint32_t CYCLE_CNT_HI : 16; // Cycle count - MSB 8131 uint32_t reserved0 : 16; 8132 }; 8133 uint32_t word[2]; 8134 }; 8135 #else 8136 private: 8137 uint32_t word0; 8138 uint32_t word1; 8139 8140 public: 8141 CONSTEXPR pmccntr_r() : word0(0), word1(0) {} 8142 CONSTEXPR pmccntr_r(uint64_t init) : 8143 word0(static_cast<uint32_t>((init)&std::numeric_limits<uint64_t>::max())), 8144 word1(static_cast<uint32_t>((init >> 32) & std::numeric_limits<uint64_t>::max())) 8145 { 8146 } 8147 CONSTEXPR void operator=(uint64_t value) 8148 { 8149 word0 = static_cast<uint32_t>((value)&std::numeric_limits<uint64_t>::max()); 8150 word1 = static_cast<uint32_t>((value >> 32) & std::numeric_limits<uint64_t>::max()); 8151 } 8152 void operator=(uint64_t value) volatile 8153 { 8154 word0 = static_cast<uint32_t>((value)&std::numeric_limits<uint64_t>::max()); 8155 word1 = static_cast<uint32_t>((value >> 32) & std::numeric_limits<uint64_t>::max()); 8156 } 8157 CONSTEXPR operator uint64_t() 8158 { 8159 return (static_cast<uint64_t>(word1) << 32) | word0; 8160 } 8161 operator uint64_t() volatile 8162 { 8163 return (static_cast<uint64_t>(word1) << 32) | word0; 8164 } 8165 pmccntr_r copy() volatile 8166 { 8167 return *this; 8168 } 8169 #endif 8170 }; 8171 8172 // pmccntr_cfg_r - Set start/stop event on the cycle counter 8173 struct pmccntr_cfg_r 8174 { 8175 #ifndef __cplusplus 8176 union 8177 { 8178 struct 8179 { 8180 uint32_t CYCLE_CNT_CFG_START : 10; // Cycle counter start event 8181 uint32_t reserved0 : 6; 8182 uint32_t CYCLE_CNT_CFG_STOP : 10; // Cycle counter stop event 8183 uint32_t reserved1 : 6; 8184 }; 8185 uint32_t word; 8186 }; 8187 #else 8188 private: 8189 uint32_t word0; 8190 8191 public: 8192 CONSTEXPR pmccntr_cfg_r() : word0(0) {} 8193 CONSTEXPR pmccntr_cfg_r(uint32_t init) : word0(init) {} 8194 CONSTEXPR void operator=(uint32_t value) 8195 { 8196 word0 = value; 8197 } 8198 void operator=(uint32_t value) volatile 8199 { 8200 word0 = value; 8201 } 8202 CONSTEXPR operator uint32_t() 8203 { 8204 return word0; 8205 } 8206 operator uint32_t() volatile 8207 { 8208 return word0; 8209 } 8210 pmccntr_cfg_r copy() volatile 8211 { 8212 return *this; 8213 } 8214 CONSTEXPR NPU_NAMESPACE::pmu_event get_CYCLE_CNT_CFG_START() const 8215 { 8216 NPU_NAMESPACE::pmu_event value = static_cast<NPU_NAMESPACE::pmu_event>(((1U << 10) - 1) & (word0 >> 0)); 8217 return value; 8218 } 8219 NPU_NAMESPACE::pmu_event get_CYCLE_CNT_CFG_START() const volatile 8220 { 8221 NPU_NAMESPACE::pmu_event value = static_cast<NPU_NAMESPACE::pmu_event>(((1U << 10) - 1) & (word0 >> 0)); 8222 return value; 8223 } 8224 CONSTEXPR pmccntr_cfg_r &set_CYCLE_CNT_CFG_START(NPU_NAMESPACE::pmu_event value) 8225 { 8226 word0 = (((~((1U << 10) - 1)) << 0) & word0) | ((((1U << 10) - 1) & static_cast<uint32_t>(value)) << 0); 8227 return *this; 8228 } 8229 volatile pmccntr_cfg_r &set_CYCLE_CNT_CFG_START(NPU_NAMESPACE::pmu_event value) volatile 8230 { 8231 word0 = (((~((1U << 10) - 1)) << 0) & word0) | ((((1U << 10) - 1) & static_cast<uint32_t>(value)) << 0); 8232 return *this; 8233 } 8234 CONSTEXPR NPU_NAMESPACE::pmu_event get_CYCLE_CNT_CFG_STOP() const 8235 { 8236 NPU_NAMESPACE::pmu_event value = static_cast<NPU_NAMESPACE::pmu_event>(((1U << 10) - 1) & (word0 >> 16)); 8237 return value; 8238 } 8239 NPU_NAMESPACE::pmu_event get_CYCLE_CNT_CFG_STOP() const volatile 8240 { 8241 NPU_NAMESPACE::pmu_event value = static_cast<NPU_NAMESPACE::pmu_event>(((1U << 10) - 1) & (word0 >> 16)); 8242 return value; 8243 } 8244 CONSTEXPR pmccntr_cfg_r &set_CYCLE_CNT_CFG_STOP(NPU_NAMESPACE::pmu_event value) 8245 { 8246 word0 = (((~((1U << 10) - 1)) << 16) & word0) | ((((1U << 10) - 1) & static_cast<uint32_t>(value)) << 16); 8247 return *this; 8248 } 8249 volatile pmccntr_cfg_r &set_CYCLE_CNT_CFG_STOP(NPU_NAMESPACE::pmu_event value) volatile 8250 { 8251 word0 = (((~((1U << 10) - 1)) << 16) & word0) | ((((1U << 10) - 1) & static_cast<uint32_t>(value)) << 16); 8252 return *this; 8253 } 8254 #endif 8255 }; 8256 8257 // pmcaxi_chan_r - Set which AXI channel to monitor for latency measurements in PMU 8258 struct pmcaxi_chan_r 8259 { 8260 #ifndef __cplusplus 8261 union 8262 { 8263 struct 8264 { 8265 uint32_t CH_SEL : 4; // Channel select for latency measurements 8266 uint32_t reserved0 : 4; 8267 uint32_t AXI_CNT_SEL : 2; // AXI counter to monitor for latency measurements 8268 uint32_t BW_CH_SEL_EN : 1; // Bandwidth channel selector 8269 uint32_t reserved1 : 21; 8270 }; 8271 uint32_t word; 8272 }; 8273 #else 8274 private: 8275 uint32_t word0; 8276 8277 public: 8278 CONSTEXPR pmcaxi_chan_r() : word0(0) {} 8279 CONSTEXPR pmcaxi_chan_r(uint32_t init) : word0(init) {} 8280 CONSTEXPR void operator=(uint32_t value) 8281 { 8282 word0 = value; 8283 } 8284 void operator=(uint32_t value) volatile 8285 { 8286 word0 = value; 8287 } 8288 CONSTEXPR operator uint32_t() 8289 { 8290 return word0; 8291 } 8292 operator uint32_t() volatile 8293 { 8294 return word0; 8295 } 8296 pmcaxi_chan_r copy() volatile 8297 { 8298 return *this; 8299 } 8300 CONSTEXPR NPU_NAMESPACE::pmu_axi_channel get_CH_SEL() const 8301 { 8302 NPU_NAMESPACE::pmu_axi_channel value = 8303 static_cast<NPU_NAMESPACE::pmu_axi_channel>(((1U << 4) - 1) & (word0 >> 0)); 8304 return value; 8305 } 8306 NPU_NAMESPACE::pmu_axi_channel get_CH_SEL() const volatile 8307 { 8308 NPU_NAMESPACE::pmu_axi_channel value = 8309 static_cast<NPU_NAMESPACE::pmu_axi_channel>(((1U << 4) - 1) & (word0 >> 0)); 8310 return value; 8311 } 8312 CONSTEXPR pmcaxi_chan_r &set_CH_SEL(NPU_NAMESPACE::pmu_axi_channel value) 8313 { 8314 word0 = (((~((1U << 4) - 1)) << 0) & word0) | ((((1U << 4) - 1) & static_cast<uint32_t>(value)) << 0); 8315 return *this; 8316 } 8317 volatile pmcaxi_chan_r &set_CH_SEL(NPU_NAMESPACE::pmu_axi_channel value) volatile 8318 { 8319 word0 = (((~((1U << 4) - 1)) << 0) & word0) | ((((1U << 4) - 1) & static_cast<uint32_t>(value)) << 0); 8320 return *this; 8321 } 8322 CONSTEXPR uint32_t get_AXI_CNT_SEL() const 8323 { 8324 uint32_t value = ((1U << 2) - 1) & (word0 >> 8); 8325 return value; 8326 } 8327 uint32_t get_AXI_CNT_SEL() const volatile 8328 { 8329 uint32_t value = ((1U << 2) - 1) & (word0 >> 8); 8330 return value; 8331 } 8332 CONSTEXPR pmcaxi_chan_r &set_AXI_CNT_SEL(uint32_t value) 8333 { 8334 word0 = (((~((1U << 2) - 1)) << 8) & word0) | ((((1U << 2) - 1) & value) << 8); 8335 return *this; 8336 } 8337 volatile pmcaxi_chan_r &set_AXI_CNT_SEL(uint32_t value) volatile 8338 { 8339 word0 = (((~((1U << 2) - 1)) << 8) & word0) | ((((1U << 2) - 1) & value) << 8); 8340 return *this; 8341 } 8342 CONSTEXPR uint32_t get_BW_CH_SEL_EN() const 8343 { 8344 uint32_t value = ((1U << 1) - 1) & (word0 >> 10); 8345 return value; 8346 } 8347 uint32_t get_BW_CH_SEL_EN() const volatile 8348 { 8349 uint32_t value = ((1U << 1) - 1) & (word0 >> 10); 8350 return value; 8351 } 8352 CONSTEXPR pmcaxi_chan_r &set_BW_CH_SEL_EN(uint32_t value) 8353 { 8354 word0 = (((~((1U << 1) - 1)) << 10) & word0) | ((((1U << 1) - 1) & value) << 10); 8355 return *this; 8356 } 8357 volatile pmcaxi_chan_r &set_BW_CH_SEL_EN(uint32_t value) volatile 8358 { 8359 word0 = (((~((1U << 1) - 1)) << 10) & word0) | ((((1U << 1) - 1) & value) << 10); 8360 return *this; 8361 } 8362 #endif 8363 }; 8364 8365 // kernel_x_r - Kernel X offset of in kernel decomposition 8366 struct kernel_x_r 8367 { 8368 #ifndef __cplusplus 8369 union 8370 { 8371 struct 8372 { 8373 uint32_t value : 32; // 32-bit register value 8374 }; 8375 uint32_t word; 8376 }; 8377 #else 8378 private: 8379 uint32_t word0; 8380 8381 public: 8382 CONSTEXPR kernel_x_r() : word0(0) {} 8383 CONSTEXPR kernel_x_r(uint32_t init) : word0(init) {} 8384 CONSTEXPR void operator=(uint32_t value) 8385 { 8386 word0 = value; 8387 } 8388 void operator=(uint32_t value) volatile 8389 { 8390 word0 = value; 8391 } 8392 CONSTEXPR operator uint32_t() 8393 { 8394 return word0; 8395 } 8396 operator uint32_t() volatile 8397 { 8398 return word0; 8399 } 8400 kernel_x_r copy() volatile 8401 { 8402 return *this; 8403 } 8404 CONSTEXPR uint32_t get_value() const 8405 { 8406 uint32_t value = word0; 8407 return value; 8408 } 8409 uint32_t get_value() const volatile 8410 { 8411 uint32_t value = word0; 8412 return value; 8413 } 8414 CONSTEXPR kernel_x_r &set_value(uint32_t value) 8415 { 8416 word0 = value; 8417 return *this; 8418 } 8419 volatile kernel_x_r &set_value(uint32_t value) volatile 8420 { 8421 word0 = value; 8422 return *this; 8423 } 8424 #endif 8425 }; 8426 8427 // kernel_y_r - Kernel Y offset of in kernel decomposition 8428 struct kernel_y_r 8429 { 8430 #ifndef __cplusplus 8431 union 8432 { 8433 struct 8434 { 8435 uint32_t value : 32; // 32-bit register value 8436 }; 8437 uint32_t word; 8438 }; 8439 #else 8440 private: 8441 uint32_t word0; 8442 8443 public: 8444 CONSTEXPR kernel_y_r() : word0(0) {} 8445 CONSTEXPR kernel_y_r(uint32_t init) : word0(init) {} 8446 CONSTEXPR void operator=(uint32_t value) 8447 { 8448 word0 = value; 8449 } 8450 void operator=(uint32_t value) volatile 8451 { 8452 word0 = value; 8453 } 8454 CONSTEXPR operator uint32_t() 8455 { 8456 return word0; 8457 } 8458 operator uint32_t() volatile 8459 { 8460 return word0; 8461 } 8462 kernel_y_r copy() volatile 8463 { 8464 return *this; 8465 } 8466 CONSTEXPR uint32_t get_value() const 8467 { 8468 uint32_t value = word0; 8469 return value; 8470 } 8471 uint32_t get_value() const volatile 8472 { 8473 uint32_t value = word0; 8474 return value; 8475 } 8476 CONSTEXPR kernel_y_r &set_value(uint32_t value) 8477 { 8478 word0 = value; 8479 return *this; 8480 } 8481 volatile kernel_y_r &set_value(uint32_t value) volatile 8482 { 8483 word0 = value; 8484 return *this; 8485 } 8486 #endif 8487 }; 8488 8489 // kernel_w_m1_r - Kernel (width-1) of current block 8490 struct kernel_w_m1_r 8491 { 8492 #ifndef __cplusplus 8493 union 8494 { 8495 struct 8496 { 8497 uint32_t value : 32; // 32-bit register value 8498 }; 8499 uint32_t word; 8500 }; 8501 #else 8502 private: 8503 uint32_t word0; 8504 8505 public: 8506 CONSTEXPR kernel_w_m1_r() : word0(0) {} 8507 CONSTEXPR kernel_w_m1_r(uint32_t init) : word0(init) {} 8508 CONSTEXPR void operator=(uint32_t value) 8509 { 8510 word0 = value; 8511 } 8512 void operator=(uint32_t value) volatile 8513 { 8514 word0 = value; 8515 } 8516 CONSTEXPR operator uint32_t() 8517 { 8518 return word0; 8519 } 8520 operator uint32_t() volatile 8521 { 8522 return word0; 8523 } 8524 kernel_w_m1_r copy() volatile 8525 { 8526 return *this; 8527 } 8528 CONSTEXPR uint32_t get_value() const 8529 { 8530 uint32_t value = word0; 8531 return value; 8532 } 8533 uint32_t get_value() const volatile 8534 { 8535 uint32_t value = word0; 8536 return value; 8537 } 8538 CONSTEXPR kernel_w_m1_r &set_value(uint32_t value) 8539 { 8540 word0 = value; 8541 return *this; 8542 } 8543 volatile kernel_w_m1_r &set_value(uint32_t value) volatile 8544 { 8545 word0 = value; 8546 return *this; 8547 } 8548 #endif 8549 }; 8550 8551 // kernel_h_m1_r - Kernel (height-1) of current block 8552 struct kernel_h_m1_r 8553 { 8554 #ifndef __cplusplus 8555 union 8556 { 8557 struct 8558 { 8559 uint32_t value : 32; // 32-bit register value 8560 }; 8561 uint32_t word; 8562 }; 8563 #else 8564 private: 8565 uint32_t word0; 8566 8567 public: 8568 CONSTEXPR kernel_h_m1_r() : word0(0) {} 8569 CONSTEXPR kernel_h_m1_r(uint32_t init) : word0(init) {} 8570 CONSTEXPR void operator=(uint32_t value) 8571 { 8572 word0 = value; 8573 } 8574 void operator=(uint32_t value) volatile 8575 { 8576 word0 = value; 8577 } 8578 CONSTEXPR operator uint32_t() 8579 { 8580 return word0; 8581 } 8582 operator uint32_t() volatile 8583 { 8584 return word0; 8585 } 8586 kernel_h_m1_r copy() volatile 8587 { 8588 return *this; 8589 } 8590 CONSTEXPR uint32_t get_value() const 8591 { 8592 uint32_t value = word0; 8593 return value; 8594 } 8595 uint32_t get_value() const volatile 8596 { 8597 uint32_t value = word0; 8598 return value; 8599 } 8600 CONSTEXPR kernel_h_m1_r &set_value(uint32_t value) 8601 { 8602 word0 = value; 8603 return *this; 8604 } 8605 volatile kernel_h_m1_r &set_value(uint32_t value) volatile 8606 { 8607 word0 = value; 8608 return *this; 8609 } 8610 #endif 8611 }; 8612 8613 // ofm_cblk_width_m1_r - OFM current block (width-1) 8614 struct ofm_cblk_width_m1_r 8615 { 8616 #ifndef __cplusplus 8617 union 8618 { 8619 struct 8620 { 8621 uint32_t value : 32; // 32-bit register value 8622 }; 8623 uint32_t word; 8624 }; 8625 #else 8626 private: 8627 uint32_t word0; 8628 8629 public: 8630 CONSTEXPR ofm_cblk_width_m1_r() : word0(0) {} 8631 CONSTEXPR ofm_cblk_width_m1_r(uint32_t init) : word0(init) {} 8632 CONSTEXPR void operator=(uint32_t value) 8633 { 8634 word0 = value; 8635 } 8636 void operator=(uint32_t value) volatile 8637 { 8638 word0 = value; 8639 } 8640 CONSTEXPR operator uint32_t() 8641 { 8642 return word0; 8643 } 8644 operator uint32_t() volatile 8645 { 8646 return word0; 8647 } 8648 ofm_cblk_width_m1_r copy() volatile 8649 { 8650 return *this; 8651 } 8652 CONSTEXPR uint32_t get_value() const 8653 { 8654 uint32_t value = word0; 8655 return value; 8656 } 8657 uint32_t get_value() const volatile 8658 { 8659 uint32_t value = word0; 8660 return value; 8661 } 8662 CONSTEXPR ofm_cblk_width_m1_r &set_value(uint32_t value) 8663 { 8664 word0 = value; 8665 return *this; 8666 } 8667 volatile ofm_cblk_width_m1_r &set_value(uint32_t value) volatile 8668 { 8669 word0 = value; 8670 return *this; 8671 } 8672 #endif 8673 }; 8674 8675 // ofm_cblk_height_m1_r - OFM current block (height-1) 8676 struct ofm_cblk_height_m1_r 8677 { 8678 #ifndef __cplusplus 8679 union 8680 { 8681 struct 8682 { 8683 uint32_t value : 32; // 32-bit register value 8684 }; 8685 uint32_t word; 8686 }; 8687 #else 8688 private: 8689 uint32_t word0; 8690 8691 public: 8692 CONSTEXPR ofm_cblk_height_m1_r() : word0(0) {} 8693 CONSTEXPR ofm_cblk_height_m1_r(uint32_t init) : word0(init) {} 8694 CONSTEXPR void operator=(uint32_t value) 8695 { 8696 word0 = value; 8697 } 8698 void operator=(uint32_t value) volatile 8699 { 8700 word0 = value; 8701 } 8702 CONSTEXPR operator uint32_t() 8703 { 8704 return word0; 8705 } 8706 operator uint32_t() volatile 8707 { 8708 return word0; 8709 } 8710 ofm_cblk_height_m1_r copy() volatile 8711 { 8712 return *this; 8713 } 8714 CONSTEXPR uint32_t get_value() const 8715 { 8716 uint32_t value = word0; 8717 return value; 8718 } 8719 uint32_t get_value() const volatile 8720 { 8721 uint32_t value = word0; 8722 return value; 8723 } 8724 CONSTEXPR ofm_cblk_height_m1_r &set_value(uint32_t value) 8725 { 8726 word0 = value; 8727 return *this; 8728 } 8729 volatile ofm_cblk_height_m1_r &set_value(uint32_t value) volatile 8730 { 8731 word0 = value; 8732 return *this; 8733 } 8734 #endif 8735 }; 8736 8737 // ofm_cblk_depth_m1_r - OFM current block (depth-1) 8738 struct ofm_cblk_depth_m1_r 8739 { 8740 #ifndef __cplusplus 8741 union 8742 { 8743 struct 8744 { 8745 uint32_t value : 32; // 32-bit register value 8746 }; 8747 uint32_t word; 8748 }; 8749 #else 8750 private: 8751 uint32_t word0; 8752 8753 public: 8754 CONSTEXPR ofm_cblk_depth_m1_r() : word0(0) {} 8755 CONSTEXPR ofm_cblk_depth_m1_r(uint32_t init) : word0(init) {} 8756 CONSTEXPR void operator=(uint32_t value) 8757 { 8758 word0 = value; 8759 } 8760 void operator=(uint32_t value) volatile 8761 { 8762 word0 = value; 8763 } 8764 CONSTEXPR operator uint32_t() 8765 { 8766 return word0; 8767 } 8768 operator uint32_t() volatile 8769 { 8770 return word0; 8771 } 8772 ofm_cblk_depth_m1_r copy() volatile 8773 { 8774 return *this; 8775 } 8776 CONSTEXPR uint32_t get_value() const 8777 { 8778 uint32_t value = word0; 8779 return value; 8780 } 8781 uint32_t get_value() const volatile 8782 { 8783 uint32_t value = word0; 8784 return value; 8785 } 8786 CONSTEXPR ofm_cblk_depth_m1_r &set_value(uint32_t value) 8787 { 8788 word0 = value; 8789 return *this; 8790 } 8791 volatile ofm_cblk_depth_m1_r &set_value(uint32_t value) volatile 8792 { 8793 word0 = value; 8794 return *this; 8795 } 8796 #endif 8797 }; 8798 8799 // ifm_cblk_depth_m1_r - IFM current block (depth-1) 8800 struct ifm_cblk_depth_m1_r 8801 { 8802 #ifndef __cplusplus 8803 union 8804 { 8805 struct 8806 { 8807 uint32_t value : 32; // 32-bit register value 8808 }; 8809 uint32_t word; 8810 }; 8811 #else 8812 private: 8813 uint32_t word0; 8814 8815 public: 8816 CONSTEXPR ifm_cblk_depth_m1_r() : word0(0) {} 8817 CONSTEXPR ifm_cblk_depth_m1_r(uint32_t init) : word0(init) {} 8818 CONSTEXPR void operator=(uint32_t value) 8819 { 8820 word0 = value; 8821 } 8822 void operator=(uint32_t value) volatile 8823 { 8824 word0 = value; 8825 } 8826 CONSTEXPR operator uint32_t() 8827 { 8828 return word0; 8829 } 8830 operator uint32_t() volatile 8831 { 8832 return word0; 8833 } 8834 ifm_cblk_depth_m1_r copy() volatile 8835 { 8836 return *this; 8837 } 8838 CONSTEXPR uint32_t get_value() const 8839 { 8840 uint32_t value = word0; 8841 return value; 8842 } 8843 uint32_t get_value() const volatile 8844 { 8845 uint32_t value = word0; 8846 return value; 8847 } 8848 CONSTEXPR ifm_cblk_depth_m1_r &set_value(uint32_t value) 8849 { 8850 word0 = value; 8851 return *this; 8852 } 8853 volatile ifm_cblk_depth_m1_r &set_value(uint32_t value) volatile 8854 { 8855 word0 = value; 8856 return *this; 8857 } 8858 #endif 8859 }; 8860 8861 // ofm_x_r - Block X coordinate in OFM 8862 struct ofm_x_r 8863 { 8864 #ifndef __cplusplus 8865 union 8866 { 8867 struct 8868 { 8869 uint32_t value : 32; // 32-bit register value 8870 }; 8871 uint32_t word; 8872 }; 8873 #else 8874 private: 8875 uint32_t word0; 8876 8877 public: 8878 CONSTEXPR ofm_x_r() : word0(0) {} 8879 CONSTEXPR ofm_x_r(uint32_t init) : word0(init) {} 8880 CONSTEXPR void operator=(uint32_t value) 8881 { 8882 word0 = value; 8883 } 8884 void operator=(uint32_t value) volatile 8885 { 8886 word0 = value; 8887 } 8888 CONSTEXPR operator uint32_t() 8889 { 8890 return word0; 8891 } 8892 operator uint32_t() volatile 8893 { 8894 return word0; 8895 } 8896 ofm_x_r copy() volatile 8897 { 8898 return *this; 8899 } 8900 CONSTEXPR uint32_t get_value() const 8901 { 8902 uint32_t value = word0; 8903 return value; 8904 } 8905 uint32_t get_value() const volatile 8906 { 8907 uint32_t value = word0; 8908 return value; 8909 } 8910 CONSTEXPR ofm_x_r &set_value(uint32_t value) 8911 { 8912 word0 = value; 8913 return *this; 8914 } 8915 volatile ofm_x_r &set_value(uint32_t value) volatile 8916 { 8917 word0 = value; 8918 return *this; 8919 } 8920 #endif 8921 }; 8922 8923 // ofm_y_r - Block Y coordinate in OFM 8924 struct ofm_y_r 8925 { 8926 #ifndef __cplusplus 8927 union 8928 { 8929 struct 8930 { 8931 uint32_t value : 32; // 32-bit register value 8932 }; 8933 uint32_t word; 8934 }; 8935 #else 8936 private: 8937 uint32_t word0; 8938 8939 public: 8940 CONSTEXPR ofm_y_r() : word0(0) {} 8941 CONSTEXPR ofm_y_r(uint32_t init) : word0(init) {} 8942 CONSTEXPR void operator=(uint32_t value) 8943 { 8944 word0 = value; 8945 } 8946 void operator=(uint32_t value) volatile 8947 { 8948 word0 = value; 8949 } 8950 CONSTEXPR operator uint32_t() 8951 { 8952 return word0; 8953 } 8954 operator uint32_t() volatile 8955 { 8956 return word0; 8957 } 8958 ofm_y_r copy() volatile 8959 { 8960 return *this; 8961 } 8962 CONSTEXPR uint32_t get_value() const 8963 { 8964 uint32_t value = word0; 8965 return value; 8966 } 8967 uint32_t get_value() const volatile 8968 { 8969 uint32_t value = word0; 8970 return value; 8971 } 8972 CONSTEXPR ofm_y_r &set_value(uint32_t value) 8973 { 8974 word0 = value; 8975 return *this; 8976 } 8977 volatile ofm_y_r &set_value(uint32_t value) volatile 8978 { 8979 word0 = value; 8980 return *this; 8981 } 8982 #endif 8983 }; 8984 8985 // ofm_z_r - Block Z (channel) coordinate in OFM 8986 struct ofm_z_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 ofm_z_r() : word0(0) {} 9003 CONSTEXPR ofm_z_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 ofm_z_r copy() volatile 9021 { 9022 return *this; 9023 } 9024 CONSTEXPR uint32_t get_value() const 9025 { 9026 uint32_t value = word0; 9027 return value; 9028 } 9029 uint32_t get_value() const volatile 9030 { 9031 uint32_t value = word0; 9032 return value; 9033 } 9034 CONSTEXPR ofm_z_r &set_value(uint32_t value) 9035 { 9036 word0 = value; 9037 return *this; 9038 } 9039 volatile ofm_z_r &set_value(uint32_t value) volatile 9040 { 9041 word0 = value; 9042 return *this; 9043 } 9044 #endif 9045 }; 9046 9047 // ifm_z_r - Block Z (channel) coordinate in IFM 9048 struct ifm_z_r 9049 { 9050 #ifndef __cplusplus 9051 union 9052 { 9053 struct 9054 { 9055 uint32_t value : 32; // 32-bit register value 9056 }; 9057 uint32_t word; 9058 }; 9059 #else 9060 private: 9061 uint32_t word0; 9062 9063 public: 9064 CONSTEXPR ifm_z_r() : word0(0) {} 9065 CONSTEXPR ifm_z_r(uint32_t init) : word0(init) {} 9066 CONSTEXPR void operator=(uint32_t value) 9067 { 9068 word0 = value; 9069 } 9070 void operator=(uint32_t value) volatile 9071 { 9072 word0 = value; 9073 } 9074 CONSTEXPR operator uint32_t() 9075 { 9076 return word0; 9077 } 9078 operator uint32_t() volatile 9079 { 9080 return word0; 9081 } 9082 ifm_z_r copy() volatile 9083 { 9084 return *this; 9085 } 9086 CONSTEXPR uint32_t get_value() const 9087 { 9088 uint32_t value = word0; 9089 return value; 9090 } 9091 uint32_t get_value() const volatile 9092 { 9093 uint32_t value = word0; 9094 return value; 9095 } 9096 CONSTEXPR ifm_z_r &set_value(uint32_t value) 9097 { 9098 word0 = value; 9099 return *this; 9100 } 9101 volatile ifm_z_r &set_value(uint32_t value) volatile 9102 { 9103 word0 = value; 9104 return *this; 9105 } 9106 #endif 9107 }; 9108 9109 // pad_top_r - Block top pad 9110 struct pad_top_r 9111 { 9112 #ifndef __cplusplus 9113 union 9114 { 9115 struct 9116 { 9117 uint32_t value : 32; // 32-bit register value 9118 }; 9119 uint32_t word; 9120 }; 9121 #else 9122 private: 9123 uint32_t word0; 9124 9125 public: 9126 CONSTEXPR pad_top_r() : word0(0) {} 9127 CONSTEXPR pad_top_r(uint32_t init) : word0(init) {} 9128 CONSTEXPR void operator=(uint32_t value) 9129 { 9130 word0 = value; 9131 } 9132 void operator=(uint32_t value) volatile 9133 { 9134 word0 = value; 9135 } 9136 CONSTEXPR operator uint32_t() 9137 { 9138 return word0; 9139 } 9140 operator uint32_t() volatile 9141 { 9142 return word0; 9143 } 9144 pad_top_r copy() volatile 9145 { 9146 return *this; 9147 } 9148 CONSTEXPR uint32_t get_value() const 9149 { 9150 uint32_t value = word0; 9151 return value; 9152 } 9153 uint32_t get_value() const volatile 9154 { 9155 uint32_t value = word0; 9156 return value; 9157 } 9158 CONSTEXPR pad_top_r &set_value(uint32_t value) 9159 { 9160 word0 = value; 9161 return *this; 9162 } 9163 volatile pad_top_r &set_value(uint32_t value) volatile 9164 { 9165 word0 = value; 9166 return *this; 9167 } 9168 #endif 9169 }; 9170 9171 // pad_left_r - Block left pad 9172 struct pad_left_r 9173 { 9174 #ifndef __cplusplus 9175 union 9176 { 9177 struct 9178 { 9179 uint32_t value : 32; // 32-bit register value 9180 }; 9181 uint32_t word; 9182 }; 9183 #else 9184 private: 9185 uint32_t word0; 9186 9187 public: 9188 CONSTEXPR pad_left_r() : word0(0) {} 9189 CONSTEXPR pad_left_r(uint32_t init) : word0(init) {} 9190 CONSTEXPR void operator=(uint32_t value) 9191 { 9192 word0 = value; 9193 } 9194 void operator=(uint32_t value) volatile 9195 { 9196 word0 = value; 9197 } 9198 CONSTEXPR operator uint32_t() 9199 { 9200 return word0; 9201 } 9202 operator uint32_t() volatile 9203 { 9204 return word0; 9205 } 9206 pad_left_r copy() volatile 9207 { 9208 return *this; 9209 } 9210 CONSTEXPR uint32_t get_value() const 9211 { 9212 uint32_t value = word0; 9213 return value; 9214 } 9215 uint32_t get_value() const volatile 9216 { 9217 uint32_t value = word0; 9218 return value; 9219 } 9220 CONSTEXPR pad_left_r &set_value(uint32_t value) 9221 { 9222 word0 = value; 9223 return *this; 9224 } 9225 volatile pad_left_r &set_value(uint32_t value) volatile 9226 { 9227 word0 = value; 9228 return *this; 9229 } 9230 #endif 9231 }; 9232 9233 // ifm_cblk_width_r - IFM current block derived width 9234 struct ifm_cblk_width_r 9235 { 9236 #ifndef __cplusplus 9237 union 9238 { 9239 struct 9240 { 9241 uint32_t value : 32; // 32-bit register value 9242 }; 9243 uint32_t word; 9244 }; 9245 #else 9246 private: 9247 uint32_t word0; 9248 9249 public: 9250 CONSTEXPR ifm_cblk_width_r() : word0(0) {} 9251 CONSTEXPR ifm_cblk_width_r(uint32_t init) : word0(init) {} 9252 CONSTEXPR void operator=(uint32_t value) 9253 { 9254 word0 = value; 9255 } 9256 void operator=(uint32_t value) volatile 9257 { 9258 word0 = value; 9259 } 9260 CONSTEXPR operator uint32_t() 9261 { 9262 return word0; 9263 } 9264 operator uint32_t() volatile 9265 { 9266 return word0; 9267 } 9268 ifm_cblk_width_r copy() volatile 9269 { 9270 return *this; 9271 } 9272 CONSTEXPR uint32_t get_value() const 9273 { 9274 uint32_t value = word0; 9275 return value; 9276 } 9277 uint32_t get_value() const volatile 9278 { 9279 uint32_t value = word0; 9280 return value; 9281 } 9282 CONSTEXPR ifm_cblk_width_r &set_value(uint32_t value) 9283 { 9284 word0 = value; 9285 return *this; 9286 } 9287 volatile ifm_cblk_width_r &set_value(uint32_t value) volatile 9288 { 9289 word0 = value; 9290 return *this; 9291 } 9292 #endif 9293 }; 9294 9295 // ifm_cblk_height_r - IFM current block derived height 9296 struct ifm_cblk_height_r 9297 { 9298 #ifndef __cplusplus 9299 union 9300 { 9301 struct 9302 { 9303 uint32_t value : 32; // 32-bit register value 9304 }; 9305 uint32_t word; 9306 }; 9307 #else 9308 private: 9309 uint32_t word0; 9310 9311 public: 9312 CONSTEXPR ifm_cblk_height_r() : word0(0) {} 9313 CONSTEXPR ifm_cblk_height_r(uint32_t init) : word0(init) {} 9314 CONSTEXPR void operator=(uint32_t value) 9315 { 9316 word0 = value; 9317 } 9318 void operator=(uint32_t value) volatile 9319 { 9320 word0 = value; 9321 } 9322 CONSTEXPR operator uint32_t() 9323 { 9324 return word0; 9325 } 9326 operator uint32_t() volatile 9327 { 9328 return word0; 9329 } 9330 ifm_cblk_height_r copy() volatile 9331 { 9332 return *this; 9333 } 9334 CONSTEXPR uint32_t get_value() const 9335 { 9336 uint32_t value = word0; 9337 return value; 9338 } 9339 uint32_t get_value() const volatile 9340 { 9341 uint32_t value = word0; 9342 return value; 9343 } 9344 CONSTEXPR ifm_cblk_height_r &set_value(uint32_t value) 9345 { 9346 word0 = value; 9347 return *this; 9348 } 9349 volatile ifm_cblk_height_r &set_value(uint32_t value) volatile 9350 { 9351 word0 = value; 9352 return *this; 9353 } 9354 #endif 9355 }; 9356 9357 // dma_ifm_src_r - DMA IFM channel source position on AXI 9358 struct dma_ifm_src_r 9359 { 9360 #ifndef __cplusplus 9361 union 9362 { 9363 struct 9364 { 9365 uint32_t offset : 32; // Offset 9366 uint32_t reserved0 : 32; 9367 }; 9368 uint32_t word[2]; 9369 }; 9370 #else 9371 private: 9372 uint32_t word0; 9373 uint32_t word1; 9374 9375 public: 9376 CONSTEXPR dma_ifm_src_r() : word0(0), word1(0) {} 9377 CONSTEXPR dma_ifm_src_r(uint64_t init) : 9378 word0(static_cast<uint32_t>((init)&std::numeric_limits<uint64_t>::max())), 9379 word1(static_cast<uint32_t>((init >> 32) & std::numeric_limits<uint64_t>::max())) 9380 { 9381 } 9382 CONSTEXPR void operator=(uint64_t value) 9383 { 9384 word0 = static_cast<uint32_t>((value)&std::numeric_limits<uint64_t>::max()); 9385 word1 = static_cast<uint32_t>((value >> 32) & std::numeric_limits<uint64_t>::max()); 9386 } 9387 void operator=(uint64_t value) volatile 9388 { 9389 word0 = static_cast<uint32_t>((value)&std::numeric_limits<uint64_t>::max()); 9390 word1 = static_cast<uint32_t>((value >> 32) & std::numeric_limits<uint64_t>::max()); 9391 } 9392 CONSTEXPR operator uint64_t() 9393 { 9394 return (static_cast<uint64_t>(word1) << 32) | word0; 9395 } 9396 operator uint64_t() volatile 9397 { 9398 return (static_cast<uint64_t>(word1) << 32) | word0; 9399 } 9400 dma_ifm_src_r copy() volatile 9401 { 9402 return *this; 9403 } 9404 #endif 9405 }; 9406 9407 // dma_ifm_dst_r - DMA IFM channel destination position in SHRAM 9408 struct dma_ifm_dst_r 9409 { 9410 #ifndef __cplusplus 9411 union 9412 { 9413 struct 9414 { 9415 uint32_t value : 32; // 32-bit register value 9416 }; 9417 uint32_t word; 9418 }; 9419 #else 9420 private: 9421 uint32_t word0; 9422 9423 public: 9424 CONSTEXPR dma_ifm_dst_r() : word0(0) {} 9425 CONSTEXPR dma_ifm_dst_r(uint32_t init) : word0(init) {} 9426 CONSTEXPR void operator=(uint32_t value) 9427 { 9428 word0 = value; 9429 } 9430 void operator=(uint32_t value) volatile 9431 { 9432 word0 = value; 9433 } 9434 CONSTEXPR operator uint32_t() 9435 { 9436 return word0; 9437 } 9438 operator uint32_t() volatile 9439 { 9440 return word0; 9441 } 9442 dma_ifm_dst_r copy() volatile 9443 { 9444 return *this; 9445 } 9446 CONSTEXPR uint32_t get_value() const 9447 { 9448 uint32_t value = word0; 9449 return value; 9450 } 9451 uint32_t get_value() const volatile 9452 { 9453 uint32_t value = word0; 9454 return value; 9455 } 9456 CONSTEXPR dma_ifm_dst_r &set_value(uint32_t value) 9457 { 9458 word0 = value; 9459 return *this; 9460 } 9461 volatile dma_ifm_dst_r &set_value(uint32_t value) volatile 9462 { 9463 word0 = value; 9464 return *this; 9465 } 9466 #endif 9467 }; 9468 9469 // dma_ofm_src_r - DMA OFM channel source position in SHRAM 9470 struct dma_ofm_src_r 9471 { 9472 #ifndef __cplusplus 9473 union 9474 { 9475 struct 9476 { 9477 uint32_t value : 32; // 32-bit register value 9478 }; 9479 uint32_t word; 9480 }; 9481 #else 9482 private: 9483 uint32_t word0; 9484 9485 public: 9486 CONSTEXPR dma_ofm_src_r() : word0(0) {} 9487 CONSTEXPR dma_ofm_src_r(uint32_t init) : word0(init) {} 9488 CONSTEXPR void operator=(uint32_t value) 9489 { 9490 word0 = value; 9491 } 9492 void operator=(uint32_t value) volatile 9493 { 9494 word0 = value; 9495 } 9496 CONSTEXPR operator uint32_t() 9497 { 9498 return word0; 9499 } 9500 operator uint32_t() volatile 9501 { 9502 return word0; 9503 } 9504 dma_ofm_src_r copy() volatile 9505 { 9506 return *this; 9507 } 9508 CONSTEXPR uint32_t get_value() const 9509 { 9510 uint32_t value = word0; 9511 return value; 9512 } 9513 uint32_t get_value() const volatile 9514 { 9515 uint32_t value = word0; 9516 return value; 9517 } 9518 CONSTEXPR dma_ofm_src_r &set_value(uint32_t value) 9519 { 9520 word0 = value; 9521 return *this; 9522 } 9523 volatile dma_ofm_src_r &set_value(uint32_t value) volatile 9524 { 9525 word0 = value; 9526 return *this; 9527 } 9528 #endif 9529 }; 9530 9531 // dma_ofm_dst_r - DMA OFM channel destination position on AXI 9532 struct dma_ofm_dst_r 9533 { 9534 #ifndef __cplusplus 9535 union 9536 { 9537 struct 9538 { 9539 uint32_t offset : 32; // Offset 9540 uint32_t reserved0 : 32; 9541 }; 9542 uint32_t word[2]; 9543 }; 9544 #else 9545 private: 9546 uint32_t word0; 9547 uint32_t word1; 9548 9549 public: 9550 CONSTEXPR dma_ofm_dst_r() : word0(0), word1(0) {} 9551 CONSTEXPR dma_ofm_dst_r(uint64_t init) : 9552 word0(static_cast<uint32_t>((init)&std::numeric_limits<uint64_t>::max())), 9553 word1(static_cast<uint32_t>((init >> 32) & std::numeric_limits<uint64_t>::max())) 9554 { 9555 } 9556 CONSTEXPR void operator=(uint64_t value) 9557 { 9558 word0 = static_cast<uint32_t>((value)&std::numeric_limits<uint64_t>::max()); 9559 word1 = static_cast<uint32_t>((value >> 32) & std::numeric_limits<uint64_t>::max()); 9560 } 9561 void operator=(uint64_t value) volatile 9562 { 9563 word0 = static_cast<uint32_t>((value)&std::numeric_limits<uint64_t>::max()); 9564 word1 = static_cast<uint32_t>((value >> 32) & std::numeric_limits<uint64_t>::max()); 9565 } 9566 CONSTEXPR operator uint64_t() 9567 { 9568 return (static_cast<uint64_t>(word1) << 32) | word0; 9569 } 9570 operator uint64_t() volatile 9571 { 9572 return (static_cast<uint64_t>(word1) << 32) | word0; 9573 } 9574 dma_ofm_dst_r copy() volatile 9575 { 9576 return *this; 9577 } 9578 #endif 9579 }; 9580 9581 // dma_weight_src_r - DMA weight channel source position on AXI 9582 struct dma_weight_src_r 9583 { 9584 #ifndef __cplusplus 9585 union 9586 { 9587 struct 9588 { 9589 uint32_t offset : 32; // Offset 9590 uint32_t reserved0 : 32; 9591 }; 9592 uint32_t word[2]; 9593 }; 9594 #else 9595 private: 9596 uint32_t word0; 9597 uint32_t word1; 9598 9599 public: 9600 CONSTEXPR dma_weight_src_r() : word0(0), word1(0) {} 9601 CONSTEXPR dma_weight_src_r(uint64_t init) : 9602 word0(static_cast<uint32_t>((init)&std::numeric_limits<uint64_t>::max())), 9603 word1(static_cast<uint32_t>((init >> 32) & std::numeric_limits<uint64_t>::max())) 9604 { 9605 } 9606 CONSTEXPR void operator=(uint64_t value) 9607 { 9608 word0 = static_cast<uint32_t>((value)&std::numeric_limits<uint64_t>::max()); 9609 word1 = static_cast<uint32_t>((value >> 32) & std::numeric_limits<uint64_t>::max()); 9610 } 9611 void operator=(uint64_t value) volatile 9612 { 9613 word0 = static_cast<uint32_t>((value)&std::numeric_limits<uint64_t>::max()); 9614 word1 = static_cast<uint32_t>((value >> 32) & std::numeric_limits<uint64_t>::max()); 9615 } 9616 CONSTEXPR operator uint64_t() 9617 { 9618 return (static_cast<uint64_t>(word1) << 32) | word0; 9619 } 9620 operator uint64_t() volatile 9621 { 9622 return (static_cast<uint64_t>(word1) << 32) | word0; 9623 } 9624 dma_weight_src_r copy() volatile 9625 { 9626 return *this; 9627 } 9628 #endif 9629 }; 9630 9631 // dma_cmd_src_r - DMA command channel source position on AXI 9632 struct dma_cmd_src_r 9633 { 9634 #ifndef __cplusplus 9635 union 9636 { 9637 struct 9638 { 9639 uint32_t offset : 32; // Offset 9640 uint32_t reserved0 : 32; 9641 }; 9642 uint32_t word[2]; 9643 }; 9644 #else 9645 private: 9646 uint32_t word0; 9647 uint32_t word1; 9648 9649 public: 9650 CONSTEXPR dma_cmd_src_r() : word0(0), word1(0) {} 9651 CONSTEXPR dma_cmd_src_r(uint64_t init) : 9652 word0(static_cast<uint32_t>((init)&std::numeric_limits<uint64_t>::max())), 9653 word1(static_cast<uint32_t>((init >> 32) & std::numeric_limits<uint64_t>::max())) 9654 { 9655 } 9656 CONSTEXPR void operator=(uint64_t value) 9657 { 9658 word0 = static_cast<uint32_t>((value)&std::numeric_limits<uint64_t>::max()); 9659 word1 = static_cast<uint32_t>((value >> 32) & std::numeric_limits<uint64_t>::max()); 9660 } 9661 void operator=(uint64_t value) volatile 9662 { 9663 word0 = static_cast<uint32_t>((value)&std::numeric_limits<uint64_t>::max()); 9664 word1 = static_cast<uint32_t>((value >> 32) & std::numeric_limits<uint64_t>::max()); 9665 } 9666 CONSTEXPR operator uint64_t() 9667 { 9668 return (static_cast<uint64_t>(word1) << 32) | word0; 9669 } 9670 operator uint64_t() volatile 9671 { 9672 return (static_cast<uint64_t>(word1) << 32) | word0; 9673 } 9674 dma_cmd_src_r copy() volatile 9675 { 9676 return *this; 9677 } 9678 #endif 9679 }; 9680 9681 // dma_cmd_size_r - DMA command channel number of bytes buffered 9682 struct dma_cmd_size_r 9683 { 9684 #ifndef __cplusplus 9685 union 9686 { 9687 struct 9688 { 9689 uint32_t value : 32; // 32-bit register value 9690 }; 9691 uint32_t word; 9692 }; 9693 #else 9694 private: 9695 uint32_t word0; 9696 9697 public: 9698 CONSTEXPR dma_cmd_size_r() : word0(0) {} 9699 CONSTEXPR dma_cmd_size_r(uint32_t init) : word0(init) {} 9700 CONSTEXPR void operator=(uint32_t value) 9701 { 9702 word0 = value; 9703 } 9704 void operator=(uint32_t value) volatile 9705 { 9706 word0 = value; 9707 } 9708 CONSTEXPR operator uint32_t() 9709 { 9710 return word0; 9711 } 9712 operator uint32_t() volatile 9713 { 9714 return word0; 9715 } 9716 dma_cmd_size_r copy() volatile 9717 { 9718 return *this; 9719 } 9720 CONSTEXPR uint32_t get_value() const 9721 { 9722 uint32_t value = word0; 9723 return value; 9724 } 9725 uint32_t get_value() const volatile 9726 { 9727 uint32_t value = word0; 9728 return value; 9729 } 9730 CONSTEXPR dma_cmd_size_r &set_value(uint32_t value) 9731 { 9732 word0 = value; 9733 return *this; 9734 } 9735 volatile dma_cmd_size_r &set_value(uint32_t value) volatile 9736 { 9737 word0 = value; 9738 return *this; 9739 } 9740 #endif 9741 }; 9742 9743 // dma_m2m_src_r - DMA memory to memory source position on AXI 9744 struct dma_m2m_src_r 9745 { 9746 #ifndef __cplusplus 9747 union 9748 { 9749 struct 9750 { 9751 uint32_t offset : 32; // Offset 9752 uint32_t reserved0 : 32; 9753 }; 9754 uint32_t word[2]; 9755 }; 9756 #else 9757 private: 9758 uint32_t word0; 9759 uint32_t word1; 9760 9761 public: 9762 CONSTEXPR dma_m2m_src_r() : word0(0), word1(0) {} 9763 CONSTEXPR dma_m2m_src_r(uint64_t init) : 9764 word0(static_cast<uint32_t>((init)&std::numeric_limits<uint64_t>::max())), 9765 word1(static_cast<uint32_t>((init >> 32) & std::numeric_limits<uint64_t>::max())) 9766 { 9767 } 9768 CONSTEXPR void operator=(uint64_t value) 9769 { 9770 word0 = static_cast<uint32_t>((value)&std::numeric_limits<uint64_t>::max()); 9771 word1 = static_cast<uint32_t>((value >> 32) & std::numeric_limits<uint64_t>::max()); 9772 } 9773 void operator=(uint64_t value) volatile 9774 { 9775 word0 = static_cast<uint32_t>((value)&std::numeric_limits<uint64_t>::max()); 9776 word1 = static_cast<uint32_t>((value >> 32) & std::numeric_limits<uint64_t>::max()); 9777 } 9778 CONSTEXPR operator uint64_t() 9779 { 9780 return (static_cast<uint64_t>(word1) << 32) | word0; 9781 } 9782 operator uint64_t() volatile 9783 { 9784 return (static_cast<uint64_t>(word1) << 32) | word0; 9785 } 9786 dma_m2m_src_r copy() volatile 9787 { 9788 return *this; 9789 } 9790 #endif 9791 }; 9792 9793 // dma_m2m_dst_r - DMA memory to memory destination position on AXI 9794 struct dma_m2m_dst_r 9795 { 9796 #ifndef __cplusplus 9797 union 9798 { 9799 struct 9800 { 9801 uint32_t offset : 32; // Offset 9802 uint32_t reserved0 : 32; 9803 }; 9804 uint32_t word[2]; 9805 }; 9806 #else 9807 private: 9808 uint32_t word0; 9809 uint32_t word1; 9810 9811 public: 9812 CONSTEXPR dma_m2m_dst_r() : word0(0), word1(0) {} 9813 CONSTEXPR dma_m2m_dst_r(uint64_t init) : 9814 word0(static_cast<uint32_t>((init)&std::numeric_limits<uint64_t>::max())), 9815 word1(static_cast<uint32_t>((init >> 32) & std::numeric_limits<uint64_t>::max())) 9816 { 9817 } 9818 CONSTEXPR void operator=(uint64_t value) 9819 { 9820 word0 = static_cast<uint32_t>((value)&std::numeric_limits<uint64_t>::max()); 9821 word1 = static_cast<uint32_t>((value >> 32) & std::numeric_limits<uint64_t>::max()); 9822 } 9823 void operator=(uint64_t value) volatile 9824 { 9825 word0 = static_cast<uint32_t>((value)&std::numeric_limits<uint64_t>::max()); 9826 word1 = static_cast<uint32_t>((value >> 32) & std::numeric_limits<uint64_t>::max()); 9827 } 9828 CONSTEXPR operator uint64_t() 9829 { 9830 return (static_cast<uint64_t>(word1) << 32) | word0; 9831 } 9832 operator uint64_t() volatile 9833 { 9834 return (static_cast<uint64_t>(word1) << 32) | word0; 9835 } 9836 dma_m2m_dst_r copy() volatile 9837 { 9838 return *this; 9839 } 9840 #endif 9841 }; 9842 9843 // current_qread_r - QREAD position being issued (rather than completed) 9844 struct current_qread_r 9845 { 9846 #ifndef __cplusplus 9847 union 9848 { 9849 struct 9850 { 9851 uint32_t value : 32; // 32-bit register value 9852 }; 9853 uint32_t word; 9854 }; 9855 #else 9856 private: 9857 uint32_t word0; 9858 9859 public: 9860 CONSTEXPR current_qread_r() : word0(0) {} 9861 CONSTEXPR current_qread_r(uint32_t init) : word0(init) {} 9862 CONSTEXPR void operator=(uint32_t value) 9863 { 9864 word0 = value; 9865 } 9866 void operator=(uint32_t value) volatile 9867 { 9868 word0 = value; 9869 } 9870 CONSTEXPR operator uint32_t() 9871 { 9872 return word0; 9873 } 9874 operator uint32_t() volatile 9875 { 9876 return word0; 9877 } 9878 current_qread_r copy() volatile 9879 { 9880 return *this; 9881 } 9882 CONSTEXPR uint32_t get_value() const 9883 { 9884 uint32_t value = word0; 9885 return value; 9886 } 9887 uint32_t get_value() const volatile 9888 { 9889 uint32_t value = word0; 9890 return value; 9891 } 9892 CONSTEXPR current_qread_r &set_value(uint32_t value) 9893 { 9894 word0 = value; 9895 return *this; 9896 } 9897 volatile current_qread_r &set_value(uint32_t value) volatile 9898 { 9899 word0 = value; 9900 return *this; 9901 } 9902 #endif 9903 }; 9904 9905 // dma_scale_src_r - DMA scale and bias channel source position on AXI 9906 struct dma_scale_src_r 9907 { 9908 #ifndef __cplusplus 9909 union 9910 { 9911 struct 9912 { 9913 uint32_t offset : 32; // Offset 9914 uint32_t reserved0 : 32; 9915 }; 9916 uint32_t word[2]; 9917 }; 9918 #else 9919 private: 9920 uint32_t word0; 9921 uint32_t word1; 9922 9923 public: 9924 CONSTEXPR dma_scale_src_r() : word0(0), word1(0) {} 9925 CONSTEXPR dma_scale_src_r(uint64_t init) : 9926 word0(static_cast<uint32_t>((init)&std::numeric_limits<uint64_t>::max())), 9927 word1(static_cast<uint32_t>((init >> 32) & std::numeric_limits<uint64_t>::max())) 9928 { 9929 } 9930 CONSTEXPR void operator=(uint64_t value) 9931 { 9932 word0 = static_cast<uint32_t>((value)&std::numeric_limits<uint64_t>::max()); 9933 word1 = static_cast<uint32_t>((value >> 32) & std::numeric_limits<uint64_t>::max()); 9934 } 9935 void operator=(uint64_t value) volatile 9936 { 9937 word0 = static_cast<uint32_t>((value)&std::numeric_limits<uint64_t>::max()); 9938 word1 = static_cast<uint32_t>((value >> 32) & std::numeric_limits<uint64_t>::max()); 9939 } 9940 CONSTEXPR operator uint64_t() 9941 { 9942 return (static_cast<uint64_t>(word1) << 32) | word0; 9943 } 9944 operator uint64_t() volatile 9945 { 9946 return (static_cast<uint64_t>(word1) << 32) | word0; 9947 } 9948 dma_scale_src_r copy() volatile 9949 { 9950 return *this; 9951 } 9952 #endif 9953 }; 9954 9955 // current_block_r - 0-3. Current block bank being executed by the TSU or last one executed if TSU is stopped 9956 struct current_block_r 9957 { 9958 #ifndef __cplusplus 9959 union 9960 { 9961 struct 9962 { 9963 uint32_t value : 32; // 32-bit register value 9964 }; 9965 uint32_t word; 9966 }; 9967 #else 9968 private: 9969 uint32_t word0; 9970 9971 public: 9972 CONSTEXPR current_block_r() : word0(0) {} 9973 CONSTEXPR current_block_r(uint32_t init) : word0(init) {} 9974 CONSTEXPR void operator=(uint32_t value) 9975 { 9976 word0 = value; 9977 } 9978 void operator=(uint32_t value) volatile 9979 { 9980 word0 = value; 9981 } 9982 CONSTEXPR operator uint32_t() 9983 { 9984 return word0; 9985 } 9986 operator uint32_t() volatile 9987 { 9988 return word0; 9989 } 9990 current_block_r copy() volatile 9991 { 9992 return *this; 9993 } 9994 CONSTEXPR uint32_t get_value() const 9995 { 9996 uint32_t value = word0; 9997 return value; 9998 } 9999 uint32_t get_value() const volatile 10000 { 10001 uint32_t value = word0; 10002 return value; 10003 } 10004 CONSTEXPR current_block_r &set_value(uint32_t value) 10005 { 10006 word0 = value; 10007 return *this; 10008 } 10009 volatile current_block_r &set_value(uint32_t value) volatile 10010 { 10011 word0 = value; 10012 return *this; 10013 } 10014 #endif 10015 }; 10016 10017 // current_op_r - Current NPU OP command being executed by the TSU 10018 struct current_op_r 10019 { 10020 #ifndef __cplusplus 10021 union 10022 { 10023 struct 10024 { 10025 uint32_t value : 32; // 32-bit register value 10026 }; 10027 uint32_t word; 10028 }; 10029 #else 10030 private: 10031 uint32_t word0; 10032 10033 public: 10034 CONSTEXPR current_op_r() : word0(0) {} 10035 CONSTEXPR current_op_r(uint32_t init) : word0(init) {} 10036 CONSTEXPR void operator=(uint32_t value) 10037 { 10038 word0 = value; 10039 } 10040 void operator=(uint32_t value) volatile 10041 { 10042 word0 = value; 10043 } 10044 CONSTEXPR operator uint32_t() 10045 { 10046 return word0; 10047 } 10048 operator uint32_t() volatile 10049 { 10050 return word0; 10051 } 10052 current_op_r copy() volatile 10053 { 10054 return *this; 10055 } 10056 CONSTEXPR uint32_t get_value() const 10057 { 10058 uint32_t value = word0; 10059 return value; 10060 } 10061 uint32_t get_value() const volatile 10062 { 10063 uint32_t value = word0; 10064 return value; 10065 } 10066 CONSTEXPR current_op_r &set_value(uint32_t value) 10067 { 10068 word0 = value; 10069 return *this; 10070 } 10071 volatile current_op_r &set_value(uint32_t value) volatile 10072 { 10073 word0 = value; 10074 return *this; 10075 } 10076 #endif 10077 }; 10078 10079 // current_cmd_r - Current 32-bit command being parsed by the command stream parser 10080 struct current_cmd_r 10081 { 10082 #ifndef __cplusplus 10083 union 10084 { 10085 struct 10086 { 10087 uint32_t value : 32; // 32-bit register value 10088 }; 10089 uint32_t word; 10090 }; 10091 #else 10092 private: 10093 uint32_t word0; 10094 10095 public: 10096 CONSTEXPR current_cmd_r() : word0(0) {} 10097 CONSTEXPR current_cmd_r(uint32_t init) : word0(init) {} 10098 CONSTEXPR void operator=(uint32_t value) 10099 { 10100 word0 = value; 10101 } 10102 void operator=(uint32_t value) volatile 10103 { 10104 word0 = value; 10105 } 10106 CONSTEXPR operator uint32_t() 10107 { 10108 return word0; 10109 } 10110 operator uint32_t() volatile 10111 { 10112 return word0; 10113 } 10114 current_cmd_r copy() volatile 10115 { 10116 return *this; 10117 } 10118 CONSTEXPR uint32_t get_value() const 10119 { 10120 uint32_t value = word0; 10121 return value; 10122 } 10123 uint32_t get_value() const volatile 10124 { 10125 uint32_t value = word0; 10126 return value; 10127 } 10128 CONSTEXPR current_cmd_r &set_value(uint32_t value) 10129 { 10130 word0 = value; 10131 return *this; 10132 } 10133 volatile current_cmd_r &set_value(uint32_t value) volatile 10134 { 10135 word0 = value; 10136 return *this; 10137 } 10138 #endif 10139 }; 10140 10141 // pmevcntr_r - Performance monitor event 0 count register 10142 struct pmevcntr_r 10143 { 10144 #ifndef __cplusplus 10145 union 10146 { 10147 struct 10148 { 10149 uint32_t count : 32; // Count word 10150 }; 10151 uint32_t word; 10152 }; 10153 #else 10154 private: 10155 uint32_t word0; 10156 10157 public: 10158 CONSTEXPR pmevcntr_r() : word0(0) {} 10159 CONSTEXPR pmevcntr_r(uint32_t init) : word0(init) {} 10160 CONSTEXPR void operator=(uint32_t value) 10161 { 10162 word0 = value; 10163 } 10164 void operator=(uint32_t value) volatile 10165 { 10166 word0 = value; 10167 } 10168 CONSTEXPR operator uint32_t() 10169 { 10170 return word0; 10171 } 10172 operator uint32_t() volatile 10173 { 10174 return word0; 10175 } 10176 pmevcntr_r copy() volatile 10177 { 10178 return *this; 10179 } 10180 CONSTEXPR uint32_t get_count() const 10181 { 10182 uint32_t value = word0; 10183 return value; 10184 } 10185 uint32_t get_count() const volatile 10186 { 10187 uint32_t value = word0; 10188 return value; 10189 } 10190 CONSTEXPR pmevcntr_r &set_count(uint32_t value) 10191 { 10192 word0 = value; 10193 return *this; 10194 } 10195 volatile pmevcntr_r &set_count(uint32_t value) volatile 10196 { 10197 word0 = value; 10198 return *this; 10199 } 10200 #endif 10201 }; 10202 10203 // pmevtyper_r - Performance monitor event type register 0 10204 struct pmevtyper_r 10205 { 10206 #ifndef __cplusplus 10207 union 10208 { 10209 struct 10210 { 10211 uint32_t EV_TYPE : 10; // Event Type 10212 uint32_t reserved0 : 22; 10213 }; 10214 uint32_t word; 10215 }; 10216 #else 10217 private: 10218 uint32_t word0; 10219 10220 public: 10221 CONSTEXPR pmevtyper_r() : word0(0) {} 10222 CONSTEXPR pmevtyper_r(uint32_t init) : word0(init) {} 10223 CONSTEXPR void operator=(uint32_t value) 10224 { 10225 word0 = value; 10226 } 10227 void operator=(uint32_t value) volatile 10228 { 10229 word0 = value; 10230 } 10231 CONSTEXPR operator uint32_t() 10232 { 10233 return word0; 10234 } 10235 operator uint32_t() volatile 10236 { 10237 return word0; 10238 } 10239 pmevtyper_r copy() volatile 10240 { 10241 return *this; 10242 } 10243 CONSTEXPR NPU_NAMESPACE::pmu_event get_EV_TYPE() const 10244 { 10245 NPU_NAMESPACE::pmu_event value = static_cast<NPU_NAMESPACE::pmu_event>(((1U << 10) - 1) & (word0 >> 0)); 10246 return value; 10247 } 10248 NPU_NAMESPACE::pmu_event get_EV_TYPE() const volatile 10249 { 10250 NPU_NAMESPACE::pmu_event value = static_cast<NPU_NAMESPACE::pmu_event>(((1U << 10) - 1) & (word0 >> 0)); 10251 return value; 10252 } 10253 CONSTEXPR pmevtyper_r &set_EV_TYPE(NPU_NAMESPACE::pmu_event value) 10254 { 10255 word0 = (((~((1U << 10) - 1)) << 0) & word0) | ((((1U << 10) - 1) & static_cast<uint32_t>(value)) << 0); 10256 return *this; 10257 } 10258 volatile pmevtyper_r &set_EV_TYPE(NPU_NAMESPACE::pmu_event value) volatile 10259 { 10260 word0 = (((~((1U << 10) - 1)) << 0) & word0) | ((((1U << 10) - 1) & static_cast<uint32_t>(value)) << 0); 10261 return *this; 10262 } 10263 #endif 10264 }; 10265 10266 // shared_buffer_r - Shared buffer debug access. Only valid in STOPPED state 10267 struct shared_buffer_r 10268 { 10269 #ifndef __cplusplus 10270 union 10271 { 10272 struct 10273 { 10274 uint32_t mem_word : 32; // Memory word 10275 }; 10276 uint32_t word; 10277 }; 10278 #else 10279 private: 10280 uint32_t word0; 10281 10282 public: 10283 CONSTEXPR shared_buffer_r() : word0(0) {} 10284 CONSTEXPR shared_buffer_r(uint32_t init) : word0(init) {} 10285 CONSTEXPR void operator=(uint32_t value) 10286 { 10287 word0 = value; 10288 } 10289 void operator=(uint32_t value) volatile 10290 { 10291 word0 = value; 10292 } 10293 CONSTEXPR operator uint32_t() 10294 { 10295 return word0; 10296 } 10297 operator uint32_t() volatile 10298 { 10299 return word0; 10300 } 10301 shared_buffer_r copy() volatile 10302 { 10303 return *this; 10304 } 10305 CONSTEXPR uint32_t get_mem_word() const 10306 { 10307 uint32_t value = word0; 10308 return value; 10309 } 10310 uint32_t get_mem_word() const volatile 10311 { 10312 uint32_t value = word0; 10313 return value; 10314 } 10315 CONSTEXPR shared_buffer_r &set_mem_word(uint32_t value) 10316 { 10317 word0 = value; 10318 return *this; 10319 } 10320 volatile shared_buffer_r &set_mem_word(uint32_t value) volatile 10321 { 10322 word0 = value; 10323 return *this; 10324 } 10325 #endif 10326 }; 10327 10328 // ifm_pad_top_r - None 10329 struct ifm_pad_top_r 10330 { 10331 #ifndef __cplusplus 10332 union 10333 { 10334 struct 10335 { 10336 uint32_t value : 32; // 32-bit register value 10337 }; 10338 uint32_t word; 10339 }; 10340 #else 10341 private: 10342 uint32_t word0; 10343 10344 public: 10345 CONSTEXPR ifm_pad_top_r() : word0(0) {} 10346 CONSTEXPR ifm_pad_top_r(uint32_t init) : word0(init) {} 10347 CONSTEXPR void operator=(uint32_t value) 10348 { 10349 word0 = value; 10350 } 10351 void operator=(uint32_t value) volatile 10352 { 10353 word0 = value; 10354 } 10355 CONSTEXPR operator uint32_t() 10356 { 10357 return word0; 10358 } 10359 operator uint32_t() volatile 10360 { 10361 return word0; 10362 } 10363 ifm_pad_top_r copy() volatile 10364 { 10365 return *this; 10366 } 10367 CONSTEXPR uint32_t get_value() const 10368 { 10369 uint32_t value = word0; 10370 return value; 10371 } 10372 uint32_t get_value() const volatile 10373 { 10374 uint32_t value = word0; 10375 return value; 10376 } 10377 CONSTEXPR ifm_pad_top_r &set_value(uint32_t value) 10378 { 10379 word0 = value; 10380 return *this; 10381 } 10382 volatile ifm_pad_top_r &set_value(uint32_t value) volatile 10383 { 10384 word0 = value; 10385 return *this; 10386 } 10387 #endif 10388 }; 10389 10390 // ifm_pad_left_r - None 10391 struct ifm_pad_left_r 10392 { 10393 #ifndef __cplusplus 10394 union 10395 { 10396 struct 10397 { 10398 uint32_t value : 32; // 32-bit register value 10399 }; 10400 uint32_t word; 10401 }; 10402 #else 10403 private: 10404 uint32_t word0; 10405 10406 public: 10407 CONSTEXPR ifm_pad_left_r() : word0(0) {} 10408 CONSTEXPR ifm_pad_left_r(uint32_t init) : word0(init) {} 10409 CONSTEXPR void operator=(uint32_t value) 10410 { 10411 word0 = value; 10412 } 10413 void operator=(uint32_t value) volatile 10414 { 10415 word0 = value; 10416 } 10417 CONSTEXPR operator uint32_t() 10418 { 10419 return word0; 10420 } 10421 operator uint32_t() volatile 10422 { 10423 return word0; 10424 } 10425 ifm_pad_left_r copy() volatile 10426 { 10427 return *this; 10428 } 10429 CONSTEXPR uint32_t get_value() const 10430 { 10431 uint32_t value = word0; 10432 return value; 10433 } 10434 uint32_t get_value() const volatile 10435 { 10436 uint32_t value = word0; 10437 return value; 10438 } 10439 CONSTEXPR ifm_pad_left_r &set_value(uint32_t value) 10440 { 10441 word0 = value; 10442 return *this; 10443 } 10444 volatile ifm_pad_left_r &set_value(uint32_t value) volatile 10445 { 10446 word0 = value; 10447 return *this; 10448 } 10449 #endif 10450 }; 10451 10452 // ifm_pad_right_r - None 10453 struct ifm_pad_right_r 10454 { 10455 #ifndef __cplusplus 10456 union 10457 { 10458 struct 10459 { 10460 uint32_t value : 32; // 32-bit register value 10461 }; 10462 uint32_t word; 10463 }; 10464 #else 10465 private: 10466 uint32_t word0; 10467 10468 public: 10469 CONSTEXPR ifm_pad_right_r() : word0(0) {} 10470 CONSTEXPR ifm_pad_right_r(uint32_t init) : word0(init) {} 10471 CONSTEXPR void operator=(uint32_t value) 10472 { 10473 word0 = value; 10474 } 10475 void operator=(uint32_t value) volatile 10476 { 10477 word0 = value; 10478 } 10479 CONSTEXPR operator uint32_t() 10480 { 10481 return word0; 10482 } 10483 operator uint32_t() volatile 10484 { 10485 return word0; 10486 } 10487 ifm_pad_right_r copy() volatile 10488 { 10489 return *this; 10490 } 10491 CONSTEXPR uint32_t get_value() const 10492 { 10493 uint32_t value = word0; 10494 return value; 10495 } 10496 uint32_t get_value() const volatile 10497 { 10498 uint32_t value = word0; 10499 return value; 10500 } 10501 CONSTEXPR ifm_pad_right_r &set_value(uint32_t value) 10502 { 10503 word0 = value; 10504 return *this; 10505 } 10506 volatile ifm_pad_right_r &set_value(uint32_t value) volatile 10507 { 10508 word0 = value; 10509 return *this; 10510 } 10511 #endif 10512 }; 10513 10514 // ifm_pad_bottom_r - None 10515 struct ifm_pad_bottom_r 10516 { 10517 #ifndef __cplusplus 10518 union 10519 { 10520 struct 10521 { 10522 uint32_t value : 32; // 32-bit register value 10523 }; 10524 uint32_t word; 10525 }; 10526 #else 10527 private: 10528 uint32_t word0; 10529 10530 public: 10531 CONSTEXPR ifm_pad_bottom_r() : word0(0) {} 10532 CONSTEXPR ifm_pad_bottom_r(uint32_t init) : word0(init) {} 10533 CONSTEXPR void operator=(uint32_t value) 10534 { 10535 word0 = value; 10536 } 10537 void operator=(uint32_t value) volatile 10538 { 10539 word0 = value; 10540 } 10541 CONSTEXPR operator uint32_t() 10542 { 10543 return word0; 10544 } 10545 operator uint32_t() volatile 10546 { 10547 return word0; 10548 } 10549 ifm_pad_bottom_r copy() volatile 10550 { 10551 return *this; 10552 } 10553 CONSTEXPR uint32_t get_value() const 10554 { 10555 uint32_t value = word0; 10556 return value; 10557 } 10558 uint32_t get_value() const volatile 10559 { 10560 uint32_t value = word0; 10561 return value; 10562 } 10563 CONSTEXPR ifm_pad_bottom_r &set_value(uint32_t value) 10564 { 10565 word0 = value; 10566 return *this; 10567 } 10568 volatile ifm_pad_bottom_r &set_value(uint32_t value) volatile 10569 { 10570 word0 = value; 10571 return *this; 10572 } 10573 #endif 10574 }; 10575 10576 // ifm_depth_m1_r - None 10577 struct ifm_depth_m1_r 10578 { 10579 #ifndef __cplusplus 10580 union 10581 { 10582 struct 10583 { 10584 uint32_t value : 32; // 32-bit register value 10585 }; 10586 uint32_t word; 10587 }; 10588 #else 10589 private: 10590 uint32_t word0; 10591 10592 public: 10593 CONSTEXPR ifm_depth_m1_r() : word0(0) {} 10594 CONSTEXPR ifm_depth_m1_r(uint32_t init) : word0(init) {} 10595 CONSTEXPR void operator=(uint32_t value) 10596 { 10597 word0 = value; 10598 } 10599 void operator=(uint32_t value) volatile 10600 { 10601 word0 = value; 10602 } 10603 CONSTEXPR operator uint32_t() 10604 { 10605 return word0; 10606 } 10607 operator uint32_t() volatile 10608 { 10609 return word0; 10610 } 10611 ifm_depth_m1_r copy() volatile 10612 { 10613 return *this; 10614 } 10615 CONSTEXPR uint32_t get_value() const 10616 { 10617 uint32_t value = word0; 10618 return value; 10619 } 10620 uint32_t get_value() const volatile 10621 { 10622 uint32_t value = word0; 10623 return value; 10624 } 10625 CONSTEXPR ifm_depth_m1_r &set_value(uint32_t value) 10626 { 10627 word0 = value; 10628 return *this; 10629 } 10630 volatile ifm_depth_m1_r &set_value(uint32_t value) volatile 10631 { 10632 word0 = value; 10633 return *this; 10634 } 10635 #endif 10636 }; 10637 10638 // ifm_precision_r - None 10639 struct ifm_precision_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 ifm_precision_r() : word0(0) {} 10656 CONSTEXPR ifm_precision_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 ifm_precision_r copy() volatile 10674 { 10675 return *this; 10676 } 10677 CONSTEXPR uint32_t get_value() const 10678 { 10679 uint32_t value = word0; 10680 return value; 10681 } 10682 uint32_t get_value() const volatile 10683 { 10684 uint32_t value = word0; 10685 return value; 10686 } 10687 CONSTEXPR ifm_precision_r &set_value(uint32_t value) 10688 { 10689 word0 = value; 10690 return *this; 10691 } 10692 volatile ifm_precision_r &set_value(uint32_t value) volatile 10693 { 10694 word0 = value; 10695 return *this; 10696 } 10697 #endif 10698 }; 10699 10700 // ifm_upscale_r - None 10701 struct ifm_upscale_r 10702 { 10703 #ifndef __cplusplus 10704 union 10705 { 10706 struct 10707 { 10708 uint32_t value : 32; // 32-bit register value 10709 }; 10710 uint32_t word; 10711 }; 10712 #else 10713 private: 10714 uint32_t word0; 10715 10716 public: 10717 CONSTEXPR ifm_upscale_r() : word0(0) {} 10718 CONSTEXPR ifm_upscale_r(uint32_t init) : word0(init) {} 10719 CONSTEXPR void operator=(uint32_t value) 10720 { 10721 word0 = value; 10722 } 10723 void operator=(uint32_t value) volatile 10724 { 10725 word0 = value; 10726 } 10727 CONSTEXPR operator uint32_t() 10728 { 10729 return word0; 10730 } 10731 operator uint32_t() volatile 10732 { 10733 return word0; 10734 } 10735 ifm_upscale_r copy() volatile 10736 { 10737 return *this; 10738 } 10739 CONSTEXPR uint32_t get_value() const 10740 { 10741 uint32_t value = word0; 10742 return value; 10743 } 10744 uint32_t get_value() const volatile 10745 { 10746 uint32_t value = word0; 10747 return value; 10748 } 10749 CONSTEXPR ifm_upscale_r &set_value(uint32_t value) 10750 { 10751 word0 = value; 10752 return *this; 10753 } 10754 volatile ifm_upscale_r &set_value(uint32_t value) volatile 10755 { 10756 word0 = value; 10757 return *this; 10758 } 10759 #endif 10760 }; 10761 10762 // ifm_zero_point_r - None 10763 struct ifm_zero_point_r 10764 { 10765 #ifndef __cplusplus 10766 union 10767 { 10768 struct 10769 { 10770 uint32_t value : 32; // 32-bit register value 10771 }; 10772 uint32_t word; 10773 }; 10774 #else 10775 private: 10776 uint32_t word0; 10777 10778 public: 10779 CONSTEXPR ifm_zero_point_r() : word0(0) {} 10780 CONSTEXPR ifm_zero_point_r(uint32_t init) : word0(init) {} 10781 CONSTEXPR void operator=(uint32_t value) 10782 { 10783 word0 = value; 10784 } 10785 void operator=(uint32_t value) volatile 10786 { 10787 word0 = value; 10788 } 10789 CONSTEXPR operator uint32_t() 10790 { 10791 return word0; 10792 } 10793 operator uint32_t() volatile 10794 { 10795 return word0; 10796 } 10797 ifm_zero_point_r copy() volatile 10798 { 10799 return *this; 10800 } 10801 CONSTEXPR uint32_t get_value() const 10802 { 10803 uint32_t value = word0; 10804 return value; 10805 } 10806 uint32_t get_value() const volatile 10807 { 10808 uint32_t value = word0; 10809 return value; 10810 } 10811 CONSTEXPR ifm_zero_point_r &set_value(uint32_t value) 10812 { 10813 word0 = value; 10814 return *this; 10815 } 10816 volatile ifm_zero_point_r &set_value(uint32_t value) volatile 10817 { 10818 word0 = value; 10819 return *this; 10820 } 10821 #endif 10822 }; 10823 10824 // ifm_width0_m1_r - None 10825 struct ifm_width0_m1_r 10826 { 10827 #ifndef __cplusplus 10828 union 10829 { 10830 struct 10831 { 10832 uint32_t value : 32; // 32-bit register value 10833 }; 10834 uint32_t word; 10835 }; 10836 #else 10837 private: 10838 uint32_t word0; 10839 10840 public: 10841 CONSTEXPR ifm_width0_m1_r() : word0(0) {} 10842 CONSTEXPR ifm_width0_m1_r(uint32_t init) : word0(init) {} 10843 CONSTEXPR void operator=(uint32_t value) 10844 { 10845 word0 = value; 10846 } 10847 void operator=(uint32_t value) volatile 10848 { 10849 word0 = value; 10850 } 10851 CONSTEXPR operator uint32_t() 10852 { 10853 return word0; 10854 } 10855 operator uint32_t() volatile 10856 { 10857 return word0; 10858 } 10859 ifm_width0_m1_r copy() volatile 10860 { 10861 return *this; 10862 } 10863 CONSTEXPR uint32_t get_value() const 10864 { 10865 uint32_t value = word0; 10866 return value; 10867 } 10868 uint32_t get_value() const volatile 10869 { 10870 uint32_t value = word0; 10871 return value; 10872 } 10873 CONSTEXPR ifm_width0_m1_r &set_value(uint32_t value) 10874 { 10875 word0 = value; 10876 return *this; 10877 } 10878 volatile ifm_width0_m1_r &set_value(uint32_t value) volatile 10879 { 10880 word0 = value; 10881 return *this; 10882 } 10883 #endif 10884 }; 10885 10886 // ifm_height0_m1_r - None 10887 struct ifm_height0_m1_r 10888 { 10889 #ifndef __cplusplus 10890 union 10891 { 10892 struct 10893 { 10894 uint32_t value : 32; // 32-bit register value 10895 }; 10896 uint32_t word; 10897 }; 10898 #else 10899 private: 10900 uint32_t word0; 10901 10902 public: 10903 CONSTEXPR ifm_height0_m1_r() : word0(0) {} 10904 CONSTEXPR ifm_height0_m1_r(uint32_t init) : word0(init) {} 10905 CONSTEXPR void operator=(uint32_t value) 10906 { 10907 word0 = value; 10908 } 10909 void operator=(uint32_t value) volatile 10910 { 10911 word0 = value; 10912 } 10913 CONSTEXPR operator uint32_t() 10914 { 10915 return word0; 10916 } 10917 operator uint32_t() volatile 10918 { 10919 return word0; 10920 } 10921 ifm_height0_m1_r copy() volatile 10922 { 10923 return *this; 10924 } 10925 CONSTEXPR uint32_t get_value() const 10926 { 10927 uint32_t value = word0; 10928 return value; 10929 } 10930 uint32_t get_value() const volatile 10931 { 10932 uint32_t value = word0; 10933 return value; 10934 } 10935 CONSTEXPR ifm_height0_m1_r &set_value(uint32_t value) 10936 { 10937 word0 = value; 10938 return *this; 10939 } 10940 volatile ifm_height0_m1_r &set_value(uint32_t value) volatile 10941 { 10942 word0 = value; 10943 return *this; 10944 } 10945 #endif 10946 }; 10947 10948 // ifm_height1_m1_r - None 10949 struct ifm_height1_m1_r 10950 { 10951 #ifndef __cplusplus 10952 union 10953 { 10954 struct 10955 { 10956 uint32_t value : 32; // 32-bit register value 10957 }; 10958 uint32_t word; 10959 }; 10960 #else 10961 private: 10962 uint32_t word0; 10963 10964 public: 10965 CONSTEXPR ifm_height1_m1_r() : word0(0) {} 10966 CONSTEXPR ifm_height1_m1_r(uint32_t init) : word0(init) {} 10967 CONSTEXPR void operator=(uint32_t value) 10968 { 10969 word0 = value; 10970 } 10971 void operator=(uint32_t value) volatile 10972 { 10973 word0 = value; 10974 } 10975 CONSTEXPR operator uint32_t() 10976 { 10977 return word0; 10978 } 10979 operator uint32_t() volatile 10980 { 10981 return word0; 10982 } 10983 ifm_height1_m1_r copy() volatile 10984 { 10985 return *this; 10986 } 10987 CONSTEXPR uint32_t get_value() const 10988 { 10989 uint32_t value = word0; 10990 return value; 10991 } 10992 uint32_t get_value() const volatile 10993 { 10994 uint32_t value = word0; 10995 return value; 10996 } 10997 CONSTEXPR ifm_height1_m1_r &set_value(uint32_t value) 10998 { 10999 word0 = value; 11000 return *this; 11001 } 11002 volatile ifm_height1_m1_r &set_value(uint32_t value) volatile 11003 { 11004 word0 = value; 11005 return *this; 11006 } 11007 #endif 11008 }; 11009 11010 // ifm_ib_end_r - None 11011 struct ifm_ib_end_r 11012 { 11013 #ifndef __cplusplus 11014 union 11015 { 11016 struct 11017 { 11018 uint32_t value : 32; // 32-bit register value 11019 }; 11020 uint32_t word; 11021 }; 11022 #else 11023 private: 11024 uint32_t word0; 11025 11026 public: 11027 CONSTEXPR ifm_ib_end_r() : word0(0) {} 11028 CONSTEXPR ifm_ib_end_r(uint32_t init) : word0(init) {} 11029 CONSTEXPR void operator=(uint32_t value) 11030 { 11031 word0 = value; 11032 } 11033 void operator=(uint32_t value) volatile 11034 { 11035 word0 = value; 11036 } 11037 CONSTEXPR operator uint32_t() 11038 { 11039 return word0; 11040 } 11041 operator uint32_t() volatile 11042 { 11043 return word0; 11044 } 11045 ifm_ib_end_r copy() volatile 11046 { 11047 return *this; 11048 } 11049 CONSTEXPR uint32_t get_value() const 11050 { 11051 uint32_t value = word0; 11052 return value; 11053 } 11054 uint32_t get_value() const volatile 11055 { 11056 uint32_t value = word0; 11057 return value; 11058 } 11059 CONSTEXPR ifm_ib_end_r &set_value(uint32_t value) 11060 { 11061 word0 = value; 11062 return *this; 11063 } 11064 volatile ifm_ib_end_r &set_value(uint32_t value) volatile 11065 { 11066 word0 = value; 11067 return *this; 11068 } 11069 #endif 11070 }; 11071 11072 // ifm_region_r - None 11073 struct ifm_region_r 11074 { 11075 #ifndef __cplusplus 11076 union 11077 { 11078 struct 11079 { 11080 uint32_t value : 32; // 32-bit register value 11081 }; 11082 uint32_t word; 11083 }; 11084 #else 11085 private: 11086 uint32_t word0; 11087 11088 public: 11089 CONSTEXPR ifm_region_r() : word0(0) {} 11090 CONSTEXPR ifm_region_r(uint32_t init) : word0(init) {} 11091 CONSTEXPR void operator=(uint32_t value) 11092 { 11093 word0 = value; 11094 } 11095 void operator=(uint32_t value) volatile 11096 { 11097 word0 = value; 11098 } 11099 CONSTEXPR operator uint32_t() 11100 { 11101 return word0; 11102 } 11103 operator uint32_t() volatile 11104 { 11105 return word0; 11106 } 11107 ifm_region_r copy() volatile 11108 { 11109 return *this; 11110 } 11111 CONSTEXPR uint32_t get_value() const 11112 { 11113 uint32_t value = word0; 11114 return value; 11115 } 11116 uint32_t get_value() const volatile 11117 { 11118 uint32_t value = word0; 11119 return value; 11120 } 11121 CONSTEXPR ifm_region_r &set_value(uint32_t value) 11122 { 11123 word0 = value; 11124 return *this; 11125 } 11126 volatile ifm_region_r &set_value(uint32_t value) volatile 11127 { 11128 word0 = value; 11129 return *this; 11130 } 11131 #endif 11132 }; 11133 11134 // ofm_width_m1_r - None 11135 struct ofm_width_m1_r 11136 { 11137 #ifndef __cplusplus 11138 union 11139 { 11140 struct 11141 { 11142 uint32_t value : 32; // 32-bit register value 11143 }; 11144 uint32_t word; 11145 }; 11146 #else 11147 private: 11148 uint32_t word0; 11149 11150 public: 11151 CONSTEXPR ofm_width_m1_r() : word0(0) {} 11152 CONSTEXPR ofm_width_m1_r(uint32_t init) : word0(init) {} 11153 CONSTEXPR void operator=(uint32_t value) 11154 { 11155 word0 = value; 11156 } 11157 void operator=(uint32_t value) volatile 11158 { 11159 word0 = value; 11160 } 11161 CONSTEXPR operator uint32_t() 11162 { 11163 return word0; 11164 } 11165 operator uint32_t() volatile 11166 { 11167 return word0; 11168 } 11169 ofm_width_m1_r copy() volatile 11170 { 11171 return *this; 11172 } 11173 CONSTEXPR uint32_t get_value() const 11174 { 11175 uint32_t value = word0; 11176 return value; 11177 } 11178 uint32_t get_value() const volatile 11179 { 11180 uint32_t value = word0; 11181 return value; 11182 } 11183 CONSTEXPR ofm_width_m1_r &set_value(uint32_t value) 11184 { 11185 word0 = value; 11186 return *this; 11187 } 11188 volatile ofm_width_m1_r &set_value(uint32_t value) volatile 11189 { 11190 word0 = value; 11191 return *this; 11192 } 11193 #endif 11194 }; 11195 11196 // ofm_height_m1_r - None 11197 struct ofm_height_m1_r 11198 { 11199 #ifndef __cplusplus 11200 union 11201 { 11202 struct 11203 { 11204 uint32_t value : 32; // 32-bit register value 11205 }; 11206 uint32_t word; 11207 }; 11208 #else 11209 private: 11210 uint32_t word0; 11211 11212 public: 11213 CONSTEXPR ofm_height_m1_r() : word0(0) {} 11214 CONSTEXPR ofm_height_m1_r(uint32_t init) : word0(init) {} 11215 CONSTEXPR void operator=(uint32_t value) 11216 { 11217 word0 = value; 11218 } 11219 void operator=(uint32_t value) volatile 11220 { 11221 word0 = value; 11222 } 11223 CONSTEXPR operator uint32_t() 11224 { 11225 return word0; 11226 } 11227 operator uint32_t() volatile 11228 { 11229 return word0; 11230 } 11231 ofm_height_m1_r copy() volatile 11232 { 11233 return *this; 11234 } 11235 CONSTEXPR uint32_t get_value() const 11236 { 11237 uint32_t value = word0; 11238 return value; 11239 } 11240 uint32_t get_value() const volatile 11241 { 11242 uint32_t value = word0; 11243 return value; 11244 } 11245 CONSTEXPR ofm_height_m1_r &set_value(uint32_t value) 11246 { 11247 word0 = value; 11248 return *this; 11249 } 11250 volatile ofm_height_m1_r &set_value(uint32_t value) volatile 11251 { 11252 word0 = value; 11253 return *this; 11254 } 11255 #endif 11256 }; 11257 11258 // ofm_depth_m1_r - None 11259 struct ofm_depth_m1_r 11260 { 11261 #ifndef __cplusplus 11262 union 11263 { 11264 struct 11265 { 11266 uint32_t value : 32; // 32-bit register value 11267 }; 11268 uint32_t word; 11269 }; 11270 #else 11271 private: 11272 uint32_t word0; 11273 11274 public: 11275 CONSTEXPR ofm_depth_m1_r() : word0(0) {} 11276 CONSTEXPR ofm_depth_m1_r(uint32_t init) : word0(init) {} 11277 CONSTEXPR void operator=(uint32_t value) 11278 { 11279 word0 = value; 11280 } 11281 void operator=(uint32_t value) volatile 11282 { 11283 word0 = value; 11284 } 11285 CONSTEXPR operator uint32_t() 11286 { 11287 return word0; 11288 } 11289 operator uint32_t() volatile 11290 { 11291 return word0; 11292 } 11293 ofm_depth_m1_r copy() volatile 11294 { 11295 return *this; 11296 } 11297 CONSTEXPR uint32_t get_value() const 11298 { 11299 uint32_t value = word0; 11300 return value; 11301 } 11302 uint32_t get_value() const volatile 11303 { 11304 uint32_t value = word0; 11305 return value; 11306 } 11307 CONSTEXPR ofm_depth_m1_r &set_value(uint32_t value) 11308 { 11309 word0 = value; 11310 return *this; 11311 } 11312 volatile ofm_depth_m1_r &set_value(uint32_t value) volatile 11313 { 11314 word0 = value; 11315 return *this; 11316 } 11317 #endif 11318 }; 11319 11320 // ofm_precision_r - None 11321 struct ofm_precision_r 11322 { 11323 #ifndef __cplusplus 11324 union 11325 { 11326 struct 11327 { 11328 uint32_t value : 32; // 32-bit register value 11329 }; 11330 uint32_t word; 11331 }; 11332 #else 11333 private: 11334 uint32_t word0; 11335 11336 public: 11337 CONSTEXPR ofm_precision_r() : word0(0) {} 11338 CONSTEXPR ofm_precision_r(uint32_t init) : word0(init) {} 11339 CONSTEXPR void operator=(uint32_t value) 11340 { 11341 word0 = value; 11342 } 11343 void operator=(uint32_t value) volatile 11344 { 11345 word0 = value; 11346 } 11347 CONSTEXPR operator uint32_t() 11348 { 11349 return word0; 11350 } 11351 operator uint32_t() volatile 11352 { 11353 return word0; 11354 } 11355 ofm_precision_r copy() volatile 11356 { 11357 return *this; 11358 } 11359 CONSTEXPR uint32_t get_value() const 11360 { 11361 uint32_t value = word0; 11362 return value; 11363 } 11364 uint32_t get_value() const volatile 11365 { 11366 uint32_t value = word0; 11367 return value; 11368 } 11369 CONSTEXPR ofm_precision_r &set_value(uint32_t value) 11370 { 11371 word0 = value; 11372 return *this; 11373 } 11374 volatile ofm_precision_r &set_value(uint32_t value) volatile 11375 { 11376 word0 = value; 11377 return *this; 11378 } 11379 #endif 11380 }; 11381 11382 // ofm_blk_width_m1_r - None 11383 struct ofm_blk_width_m1_r 11384 { 11385 #ifndef __cplusplus 11386 union 11387 { 11388 struct 11389 { 11390 uint32_t value : 32; // 32-bit register value 11391 }; 11392 uint32_t word; 11393 }; 11394 #else 11395 private: 11396 uint32_t word0; 11397 11398 public: 11399 CONSTEXPR ofm_blk_width_m1_r() : word0(0) {} 11400 CONSTEXPR ofm_blk_width_m1_r(uint32_t init) : word0(init) {} 11401 CONSTEXPR void operator=(uint32_t value) 11402 { 11403 word0 = value; 11404 } 11405 void operator=(uint32_t value) volatile 11406 { 11407 word0 = value; 11408 } 11409 CONSTEXPR operator uint32_t() 11410 { 11411 return word0; 11412 } 11413 operator uint32_t() volatile 11414 { 11415 return word0; 11416 } 11417 ofm_blk_width_m1_r copy() volatile 11418 { 11419 return *this; 11420 } 11421 CONSTEXPR uint32_t get_value() const 11422 { 11423 uint32_t value = word0; 11424 return value; 11425 } 11426 uint32_t get_value() const volatile 11427 { 11428 uint32_t value = word0; 11429 return value; 11430 } 11431 CONSTEXPR ofm_blk_width_m1_r &set_value(uint32_t value) 11432 { 11433 word0 = value; 11434 return *this; 11435 } 11436 volatile ofm_blk_width_m1_r &set_value(uint32_t value) volatile 11437 { 11438 word0 = value; 11439 return *this; 11440 } 11441 #endif 11442 }; 11443 11444 // ofm_blk_height_m1_r - None 11445 struct ofm_blk_height_m1_r 11446 { 11447 #ifndef __cplusplus 11448 union 11449 { 11450 struct 11451 { 11452 uint32_t value : 32; // 32-bit register value 11453 }; 11454 uint32_t word; 11455 }; 11456 #else 11457 private: 11458 uint32_t word0; 11459 11460 public: 11461 CONSTEXPR ofm_blk_height_m1_r() : word0(0) {} 11462 CONSTEXPR ofm_blk_height_m1_r(uint32_t init) : word0(init) {} 11463 CONSTEXPR void operator=(uint32_t value) 11464 { 11465 word0 = value; 11466 } 11467 void operator=(uint32_t value) volatile 11468 { 11469 word0 = value; 11470 } 11471 CONSTEXPR operator uint32_t() 11472 { 11473 return word0; 11474 } 11475 operator uint32_t() volatile 11476 { 11477 return word0; 11478 } 11479 ofm_blk_height_m1_r copy() volatile 11480 { 11481 return *this; 11482 } 11483 CONSTEXPR uint32_t get_value() const 11484 { 11485 uint32_t value = word0; 11486 return value; 11487 } 11488 uint32_t get_value() const volatile 11489 { 11490 uint32_t value = word0; 11491 return value; 11492 } 11493 CONSTEXPR ofm_blk_height_m1_r &set_value(uint32_t value) 11494 { 11495 word0 = value; 11496 return *this; 11497 } 11498 volatile ofm_blk_height_m1_r &set_value(uint32_t value) volatile 11499 { 11500 word0 = value; 11501 return *this; 11502 } 11503 #endif 11504 }; 11505 11506 // ofm_blk_depth_m1_r - None 11507 struct ofm_blk_depth_m1_r 11508 { 11509 #ifndef __cplusplus 11510 union 11511 { 11512 struct 11513 { 11514 uint32_t value : 32; // 32-bit register value 11515 }; 11516 uint32_t word; 11517 }; 11518 #else 11519 private: 11520 uint32_t word0; 11521 11522 public: 11523 CONSTEXPR ofm_blk_depth_m1_r() : word0(0) {} 11524 CONSTEXPR ofm_blk_depth_m1_r(uint32_t init) : word0(init) {} 11525 CONSTEXPR void operator=(uint32_t value) 11526 { 11527 word0 = value; 11528 } 11529 void operator=(uint32_t value) volatile 11530 { 11531 word0 = value; 11532 } 11533 CONSTEXPR operator uint32_t() 11534 { 11535 return word0; 11536 } 11537 operator uint32_t() volatile 11538 { 11539 return word0; 11540 } 11541 ofm_blk_depth_m1_r copy() volatile 11542 { 11543 return *this; 11544 } 11545 CONSTEXPR uint32_t get_value() const 11546 { 11547 uint32_t value = word0; 11548 return value; 11549 } 11550 uint32_t get_value() const volatile 11551 { 11552 uint32_t value = word0; 11553 return value; 11554 } 11555 CONSTEXPR ofm_blk_depth_m1_r &set_value(uint32_t value) 11556 { 11557 word0 = value; 11558 return *this; 11559 } 11560 volatile ofm_blk_depth_m1_r &set_value(uint32_t value) volatile 11561 { 11562 word0 = value; 11563 return *this; 11564 } 11565 #endif 11566 }; 11567 11568 // ofm_zero_point_r - None 11569 struct ofm_zero_point_r 11570 { 11571 #ifndef __cplusplus 11572 union 11573 { 11574 struct 11575 { 11576 uint32_t value : 32; // 32-bit register value 11577 }; 11578 uint32_t word; 11579 }; 11580 #else 11581 private: 11582 uint32_t word0; 11583 11584 public: 11585 CONSTEXPR ofm_zero_point_r() : word0(0) {} 11586 CONSTEXPR ofm_zero_point_r(uint32_t init) : word0(init) {} 11587 CONSTEXPR void operator=(uint32_t value) 11588 { 11589 word0 = value; 11590 } 11591 void operator=(uint32_t value) volatile 11592 { 11593 word0 = value; 11594 } 11595 CONSTEXPR operator uint32_t() 11596 { 11597 return word0; 11598 } 11599 operator uint32_t() volatile 11600 { 11601 return word0; 11602 } 11603 ofm_zero_point_r copy() volatile 11604 { 11605 return *this; 11606 } 11607 CONSTEXPR uint32_t get_value() const 11608 { 11609 uint32_t value = word0; 11610 return value; 11611 } 11612 uint32_t get_value() const volatile 11613 { 11614 uint32_t value = word0; 11615 return value; 11616 } 11617 CONSTEXPR ofm_zero_point_r &set_value(uint32_t value) 11618 { 11619 word0 = value; 11620 return *this; 11621 } 11622 volatile ofm_zero_point_r &set_value(uint32_t value) volatile 11623 { 11624 word0 = value; 11625 return *this; 11626 } 11627 #endif 11628 }; 11629 11630 // ofm_width0_m1_r - None 11631 struct ofm_width0_m1_r 11632 { 11633 #ifndef __cplusplus 11634 union 11635 { 11636 struct 11637 { 11638 uint32_t value : 32; // 32-bit register value 11639 }; 11640 uint32_t word; 11641 }; 11642 #else 11643 private: 11644 uint32_t word0; 11645 11646 public: 11647 CONSTEXPR ofm_width0_m1_r() : word0(0) {} 11648 CONSTEXPR ofm_width0_m1_r(uint32_t init) : word0(init) {} 11649 CONSTEXPR void operator=(uint32_t value) 11650 { 11651 word0 = value; 11652 } 11653 void operator=(uint32_t value) volatile 11654 { 11655 word0 = value; 11656 } 11657 CONSTEXPR operator uint32_t() 11658 { 11659 return word0; 11660 } 11661 operator uint32_t() volatile 11662 { 11663 return word0; 11664 } 11665 ofm_width0_m1_r copy() volatile 11666 { 11667 return *this; 11668 } 11669 CONSTEXPR uint32_t get_value() const 11670 { 11671 uint32_t value = word0; 11672 return value; 11673 } 11674 uint32_t get_value() const volatile 11675 { 11676 uint32_t value = word0; 11677 return value; 11678 } 11679 CONSTEXPR ofm_width0_m1_r &set_value(uint32_t value) 11680 { 11681 word0 = value; 11682 return *this; 11683 } 11684 volatile ofm_width0_m1_r &set_value(uint32_t value) volatile 11685 { 11686 word0 = value; 11687 return *this; 11688 } 11689 #endif 11690 }; 11691 11692 // ofm_height0_m1_r - None 11693 struct ofm_height0_m1_r 11694 { 11695 #ifndef __cplusplus 11696 union 11697 { 11698 struct 11699 { 11700 uint32_t value : 32; // 32-bit register value 11701 }; 11702 uint32_t word; 11703 }; 11704 #else 11705 private: 11706 uint32_t word0; 11707 11708 public: 11709 CONSTEXPR ofm_height0_m1_r() : word0(0) {} 11710 CONSTEXPR ofm_height0_m1_r(uint32_t init) : word0(init) {} 11711 CONSTEXPR void operator=(uint32_t value) 11712 { 11713 word0 = value; 11714 } 11715 void operator=(uint32_t value) volatile 11716 { 11717 word0 = value; 11718 } 11719 CONSTEXPR operator uint32_t() 11720 { 11721 return word0; 11722 } 11723 operator uint32_t() volatile 11724 { 11725 return word0; 11726 } 11727 ofm_height0_m1_r copy() volatile 11728 { 11729 return *this; 11730 } 11731 CONSTEXPR uint32_t get_value() const 11732 { 11733 uint32_t value = word0; 11734 return value; 11735 } 11736 uint32_t get_value() const volatile 11737 { 11738 uint32_t value = word0; 11739 return value; 11740 } 11741 CONSTEXPR ofm_height0_m1_r &set_value(uint32_t value) 11742 { 11743 word0 = value; 11744 return *this; 11745 } 11746 volatile ofm_height0_m1_r &set_value(uint32_t value) volatile 11747 { 11748 word0 = value; 11749 return *this; 11750 } 11751 #endif 11752 }; 11753 11754 // ofm_height1_m1_r - None 11755 struct ofm_height1_m1_r 11756 { 11757 #ifndef __cplusplus 11758 union 11759 { 11760 struct 11761 { 11762 uint32_t value : 32; // 32-bit register value 11763 }; 11764 uint32_t word; 11765 }; 11766 #else 11767 private: 11768 uint32_t word0; 11769 11770 public: 11771 CONSTEXPR ofm_height1_m1_r() : word0(0) {} 11772 CONSTEXPR ofm_height1_m1_r(uint32_t init) : word0(init) {} 11773 CONSTEXPR void operator=(uint32_t value) 11774 { 11775 word0 = value; 11776 } 11777 void operator=(uint32_t value) volatile 11778 { 11779 word0 = value; 11780 } 11781 CONSTEXPR operator uint32_t() 11782 { 11783 return word0; 11784 } 11785 operator uint32_t() volatile 11786 { 11787 return word0; 11788 } 11789 ofm_height1_m1_r copy() volatile 11790 { 11791 return *this; 11792 } 11793 CONSTEXPR uint32_t get_value() const 11794 { 11795 uint32_t value = word0; 11796 return value; 11797 } 11798 uint32_t get_value() const volatile 11799 { 11800 uint32_t value = word0; 11801 return value; 11802 } 11803 CONSTEXPR ofm_height1_m1_r &set_value(uint32_t value) 11804 { 11805 word0 = value; 11806 return *this; 11807 } 11808 volatile ofm_height1_m1_r &set_value(uint32_t value) volatile 11809 { 11810 word0 = value; 11811 return *this; 11812 } 11813 #endif 11814 }; 11815 11816 // ofm_region_r - None 11817 struct ofm_region_r 11818 { 11819 #ifndef __cplusplus 11820 union 11821 { 11822 struct 11823 { 11824 uint32_t value : 32; // 32-bit register value 11825 }; 11826 uint32_t word; 11827 }; 11828 #else 11829 private: 11830 uint32_t word0; 11831 11832 public: 11833 CONSTEXPR ofm_region_r() : word0(0) {} 11834 CONSTEXPR ofm_region_r(uint32_t init) : word0(init) {} 11835 CONSTEXPR void operator=(uint32_t value) 11836 { 11837 word0 = value; 11838 } 11839 void operator=(uint32_t value) volatile 11840 { 11841 word0 = value; 11842 } 11843 CONSTEXPR operator uint32_t() 11844 { 11845 return word0; 11846 } 11847 operator uint32_t() volatile 11848 { 11849 return word0; 11850 } 11851 ofm_region_r copy() volatile 11852 { 11853 return *this; 11854 } 11855 CONSTEXPR uint32_t get_value() const 11856 { 11857 uint32_t value = word0; 11858 return value; 11859 } 11860 uint32_t get_value() const volatile 11861 { 11862 uint32_t value = word0; 11863 return value; 11864 } 11865 CONSTEXPR ofm_region_r &set_value(uint32_t value) 11866 { 11867 word0 = value; 11868 return *this; 11869 } 11870 volatile ofm_region_r &set_value(uint32_t value) volatile 11871 { 11872 word0 = value; 11873 return *this; 11874 } 11875 #endif 11876 }; 11877 11878 // kernel_width_m1_r - None 11879 struct kernel_width_m1_r 11880 { 11881 #ifndef __cplusplus 11882 union 11883 { 11884 struct 11885 { 11886 uint32_t value : 32; // 32-bit register value 11887 }; 11888 uint32_t word; 11889 }; 11890 #else 11891 private: 11892 uint32_t word0; 11893 11894 public: 11895 CONSTEXPR kernel_width_m1_r() : word0(0) {} 11896 CONSTEXPR kernel_width_m1_r(uint32_t init) : word0(init) {} 11897 CONSTEXPR void operator=(uint32_t value) 11898 { 11899 word0 = value; 11900 } 11901 void operator=(uint32_t value) volatile 11902 { 11903 word0 = value; 11904 } 11905 CONSTEXPR operator uint32_t() 11906 { 11907 return word0; 11908 } 11909 operator uint32_t() volatile 11910 { 11911 return word0; 11912 } 11913 kernel_width_m1_r copy() volatile 11914 { 11915 return *this; 11916 } 11917 CONSTEXPR uint32_t get_value() const 11918 { 11919 uint32_t value = word0; 11920 return value; 11921 } 11922 uint32_t get_value() const volatile 11923 { 11924 uint32_t value = word0; 11925 return value; 11926 } 11927 CONSTEXPR kernel_width_m1_r &set_value(uint32_t value) 11928 { 11929 word0 = value; 11930 return *this; 11931 } 11932 volatile kernel_width_m1_r &set_value(uint32_t value) volatile 11933 { 11934 word0 = value; 11935 return *this; 11936 } 11937 #endif 11938 }; 11939 11940 // kernel_height_m1_r - None 11941 struct kernel_height_m1_r 11942 { 11943 #ifndef __cplusplus 11944 union 11945 { 11946 struct 11947 { 11948 uint32_t value : 32; // 32-bit register value 11949 }; 11950 uint32_t word; 11951 }; 11952 #else 11953 private: 11954 uint32_t word0; 11955 11956 public: 11957 CONSTEXPR kernel_height_m1_r() : word0(0) {} 11958 CONSTEXPR kernel_height_m1_r(uint32_t init) : word0(init) {} 11959 CONSTEXPR void operator=(uint32_t value) 11960 { 11961 word0 = value; 11962 } 11963 void operator=(uint32_t value) volatile 11964 { 11965 word0 = value; 11966 } 11967 CONSTEXPR operator uint32_t() 11968 { 11969 return word0; 11970 } 11971 operator uint32_t() volatile 11972 { 11973 return word0; 11974 } 11975 kernel_height_m1_r copy() volatile 11976 { 11977 return *this; 11978 } 11979 CONSTEXPR uint32_t get_value() const 11980 { 11981 uint32_t value = word0; 11982 return value; 11983 } 11984 uint32_t get_value() const volatile 11985 { 11986 uint32_t value = word0; 11987 return value; 11988 } 11989 CONSTEXPR kernel_height_m1_r &set_value(uint32_t value) 11990 { 11991 word0 = value; 11992 return *this; 11993 } 11994 volatile kernel_height_m1_r &set_value(uint32_t value) volatile 11995 { 11996 word0 = value; 11997 return *this; 11998 } 11999 #endif 12000 }; 12001 12002 // kernel_stride_r - None 12003 struct kernel_stride_r 12004 { 12005 #ifndef __cplusplus 12006 union 12007 { 12008 struct 12009 { 12010 uint32_t value : 32; // 32-bit register value 12011 }; 12012 uint32_t word; 12013 }; 12014 #else 12015 private: 12016 uint32_t word0; 12017 12018 public: 12019 CONSTEXPR kernel_stride_r() : word0(0) {} 12020 CONSTEXPR kernel_stride_r(uint32_t init) : word0(init) {} 12021 CONSTEXPR void operator=(uint32_t value) 12022 { 12023 word0 = value; 12024 } 12025 void operator=(uint32_t value) volatile 12026 { 12027 word0 = value; 12028 } 12029 CONSTEXPR operator uint32_t() 12030 { 12031 return word0; 12032 } 12033 operator uint32_t() volatile 12034 { 12035 return word0; 12036 } 12037 kernel_stride_r copy() volatile 12038 { 12039 return *this; 12040 } 12041 CONSTEXPR uint32_t get_value() const 12042 { 12043 uint32_t value = word0; 12044 return value; 12045 } 12046 uint32_t get_value() const volatile 12047 { 12048 uint32_t value = word0; 12049 return value; 12050 } 12051 CONSTEXPR kernel_stride_r &set_value(uint32_t value) 12052 { 12053 word0 = value; 12054 return *this; 12055 } 12056 volatile kernel_stride_r &set_value(uint32_t value) volatile 12057 { 12058 word0 = value; 12059 return *this; 12060 } 12061 #endif 12062 }; 12063 12064 // acc_format_r - None 12065 struct acc_format_r 12066 { 12067 #ifndef __cplusplus 12068 union 12069 { 12070 struct 12071 { 12072 uint32_t value : 32; // 32-bit register value 12073 }; 12074 uint32_t word; 12075 }; 12076 #else 12077 private: 12078 uint32_t word0; 12079 12080 public: 12081 CONSTEXPR acc_format_r() : word0(0) {} 12082 CONSTEXPR acc_format_r(uint32_t init) : word0(init) {} 12083 CONSTEXPR void operator=(uint32_t value) 12084 { 12085 word0 = value; 12086 } 12087 void operator=(uint32_t value) volatile 12088 { 12089 word0 = value; 12090 } 12091 CONSTEXPR operator uint32_t() 12092 { 12093 return word0; 12094 } 12095 operator uint32_t() volatile 12096 { 12097 return word0; 12098 } 12099 acc_format_r copy() volatile 12100 { 12101 return *this; 12102 } 12103 CONSTEXPR uint32_t get_value() const 12104 { 12105 uint32_t value = word0; 12106 return value; 12107 } 12108 uint32_t get_value() const volatile 12109 { 12110 uint32_t value = word0; 12111 return value; 12112 } 12113 CONSTEXPR acc_format_r &set_value(uint32_t value) 12114 { 12115 word0 = value; 12116 return *this; 12117 } 12118 volatile acc_format_r &set_value(uint32_t value) volatile 12119 { 12120 word0 = value; 12121 return *this; 12122 } 12123 #endif 12124 }; 12125 12126 // activation_r - None 12127 struct activation_r 12128 { 12129 #ifndef __cplusplus 12130 union 12131 { 12132 struct 12133 { 12134 uint32_t value : 32; // 32-bit register value 12135 }; 12136 uint32_t word; 12137 }; 12138 #else 12139 private: 12140 uint32_t word0; 12141 12142 public: 12143 CONSTEXPR activation_r() : word0(0) {} 12144 CONSTEXPR activation_r(uint32_t init) : word0(init) {} 12145 CONSTEXPR void operator=(uint32_t value) 12146 { 12147 word0 = value; 12148 } 12149 void operator=(uint32_t value) volatile 12150 { 12151 word0 = value; 12152 } 12153 CONSTEXPR operator uint32_t() 12154 { 12155 return word0; 12156 } 12157 operator uint32_t() volatile 12158 { 12159 return word0; 12160 } 12161 activation_r copy() volatile 12162 { 12163 return *this; 12164 } 12165 CONSTEXPR uint32_t get_value() const 12166 { 12167 uint32_t value = word0; 12168 return value; 12169 } 12170 uint32_t get_value() const volatile 12171 { 12172 uint32_t value = word0; 12173 return value; 12174 } 12175 CONSTEXPR activation_r &set_value(uint32_t value) 12176 { 12177 word0 = value; 12178 return *this; 12179 } 12180 volatile activation_r &set_value(uint32_t value) volatile 12181 { 12182 word0 = value; 12183 return *this; 12184 } 12185 #endif 12186 }; 12187 12188 // activation_min_r - None 12189 struct activation_min_r 12190 { 12191 #ifndef __cplusplus 12192 union 12193 { 12194 struct 12195 { 12196 uint32_t value : 32; // 32-bit register value 12197 }; 12198 uint32_t word; 12199 }; 12200 #else 12201 private: 12202 uint32_t word0; 12203 12204 public: 12205 CONSTEXPR activation_min_r() : word0(0) {} 12206 CONSTEXPR activation_min_r(uint32_t init) : word0(init) {} 12207 CONSTEXPR void operator=(uint32_t value) 12208 { 12209 word0 = value; 12210 } 12211 void operator=(uint32_t value) volatile 12212 { 12213 word0 = value; 12214 } 12215 CONSTEXPR operator uint32_t() 12216 { 12217 return word0; 12218 } 12219 operator uint32_t() volatile 12220 { 12221 return word0; 12222 } 12223 activation_min_r copy() volatile 12224 { 12225 return *this; 12226 } 12227 CONSTEXPR uint32_t get_value() const 12228 { 12229 uint32_t value = word0; 12230 return value; 12231 } 12232 uint32_t get_value() const volatile 12233 { 12234 uint32_t value = word0; 12235 return value; 12236 } 12237 CONSTEXPR activation_min_r &set_value(uint32_t value) 12238 { 12239 word0 = value; 12240 return *this; 12241 } 12242 volatile activation_min_r &set_value(uint32_t value) volatile 12243 { 12244 word0 = value; 12245 return *this; 12246 } 12247 #endif 12248 }; 12249 12250 // activation_max_r - None 12251 struct activation_max_r 12252 { 12253 #ifndef __cplusplus 12254 union 12255 { 12256 struct 12257 { 12258 uint32_t value : 32; // 32-bit register value 12259 }; 12260 uint32_t word; 12261 }; 12262 #else 12263 private: 12264 uint32_t word0; 12265 12266 public: 12267 CONSTEXPR activation_max_r() : word0(0) {} 12268 CONSTEXPR activation_max_r(uint32_t init) : word0(init) {} 12269 CONSTEXPR void operator=(uint32_t value) 12270 { 12271 word0 = value; 12272 } 12273 void operator=(uint32_t value) volatile 12274 { 12275 word0 = value; 12276 } 12277 CONSTEXPR operator uint32_t() 12278 { 12279 return word0; 12280 } 12281 operator uint32_t() volatile 12282 { 12283 return word0; 12284 } 12285 activation_max_r copy() volatile 12286 { 12287 return *this; 12288 } 12289 CONSTEXPR uint32_t get_value() const 12290 { 12291 uint32_t value = word0; 12292 return value; 12293 } 12294 uint32_t get_value() const volatile 12295 { 12296 uint32_t value = word0; 12297 return value; 12298 } 12299 CONSTEXPR activation_max_r &set_value(uint32_t value) 12300 { 12301 word0 = value; 12302 return *this; 12303 } 12304 volatile activation_max_r &set_value(uint32_t value) volatile 12305 { 12306 word0 = value; 12307 return *this; 12308 } 12309 #endif 12310 }; 12311 12312 // weight_region_r - None 12313 struct weight_region_r 12314 { 12315 #ifndef __cplusplus 12316 union 12317 { 12318 struct 12319 { 12320 uint32_t value : 32; // 32-bit register value 12321 }; 12322 uint32_t word; 12323 }; 12324 #else 12325 private: 12326 uint32_t word0; 12327 12328 public: 12329 CONSTEXPR weight_region_r() : word0(0) {} 12330 CONSTEXPR weight_region_r(uint32_t init) : word0(init) {} 12331 CONSTEXPR void operator=(uint32_t value) 12332 { 12333 word0 = value; 12334 } 12335 void operator=(uint32_t value) volatile 12336 { 12337 word0 = value; 12338 } 12339 CONSTEXPR operator uint32_t() 12340 { 12341 return word0; 12342 } 12343 operator uint32_t() volatile 12344 { 12345 return word0; 12346 } 12347 weight_region_r copy() volatile 12348 { 12349 return *this; 12350 } 12351 CONSTEXPR uint32_t get_value() const 12352 { 12353 uint32_t value = word0; 12354 return value; 12355 } 12356 uint32_t get_value() const volatile 12357 { 12358 uint32_t value = word0; 12359 return value; 12360 } 12361 CONSTEXPR weight_region_r &set_value(uint32_t value) 12362 { 12363 word0 = value; 12364 return *this; 12365 } 12366 volatile weight_region_r &set_value(uint32_t value) volatile 12367 { 12368 word0 = value; 12369 return *this; 12370 } 12371 #endif 12372 }; 12373 12374 // scale_region_r - None 12375 struct scale_region_r 12376 { 12377 #ifndef __cplusplus 12378 union 12379 { 12380 struct 12381 { 12382 uint32_t value : 32; // 32-bit register value 12383 }; 12384 uint32_t word; 12385 }; 12386 #else 12387 private: 12388 uint32_t word0; 12389 12390 public: 12391 CONSTEXPR scale_region_r() : word0(0) {} 12392 CONSTEXPR scale_region_r(uint32_t init) : word0(init) {} 12393 CONSTEXPR void operator=(uint32_t value) 12394 { 12395 word0 = value; 12396 } 12397 void operator=(uint32_t value) volatile 12398 { 12399 word0 = value; 12400 } 12401 CONSTEXPR operator uint32_t() 12402 { 12403 return word0; 12404 } 12405 operator uint32_t() volatile 12406 { 12407 return word0; 12408 } 12409 scale_region_r copy() volatile 12410 { 12411 return *this; 12412 } 12413 CONSTEXPR uint32_t get_value() const 12414 { 12415 uint32_t value = word0; 12416 return value; 12417 } 12418 uint32_t get_value() const volatile 12419 { 12420 uint32_t value = word0; 12421 return value; 12422 } 12423 CONSTEXPR scale_region_r &set_value(uint32_t value) 12424 { 12425 word0 = value; 12426 return *this; 12427 } 12428 volatile scale_region_r &set_value(uint32_t value) volatile 12429 { 12430 word0 = value; 12431 return *this; 12432 } 12433 #endif 12434 }; 12435 12436 // ab_start_r - None 12437 struct ab_start_r 12438 { 12439 #ifndef __cplusplus 12440 union 12441 { 12442 struct 12443 { 12444 uint32_t value : 32; // 32-bit register value 12445 }; 12446 uint32_t word; 12447 }; 12448 #else 12449 private: 12450 uint32_t word0; 12451 12452 public: 12453 CONSTEXPR ab_start_r() : word0(0) {} 12454 CONSTEXPR ab_start_r(uint32_t init) : word0(init) {} 12455 CONSTEXPR void operator=(uint32_t value) 12456 { 12457 word0 = value; 12458 } 12459 void operator=(uint32_t value) volatile 12460 { 12461 word0 = value; 12462 } 12463 CONSTEXPR operator uint32_t() 12464 { 12465 return word0; 12466 } 12467 operator uint32_t() volatile 12468 { 12469 return word0; 12470 } 12471 ab_start_r copy() volatile 12472 { 12473 return *this; 12474 } 12475 CONSTEXPR uint32_t get_value() const 12476 { 12477 uint32_t value = word0; 12478 return value; 12479 } 12480 uint32_t get_value() const volatile 12481 { 12482 uint32_t value = word0; 12483 return value; 12484 } 12485 CONSTEXPR ab_start_r &set_value(uint32_t value) 12486 { 12487 word0 = value; 12488 return *this; 12489 } 12490 volatile ab_start_r &set_value(uint32_t value) volatile 12491 { 12492 word0 = value; 12493 return *this; 12494 } 12495 #endif 12496 }; 12497 12498 // blockdep_r - None 12499 struct blockdep_r 12500 { 12501 #ifndef __cplusplus 12502 union 12503 { 12504 struct 12505 { 12506 uint32_t value : 32; // 32-bit register value 12507 }; 12508 uint32_t word; 12509 }; 12510 #else 12511 private: 12512 uint32_t word0; 12513 12514 public: 12515 CONSTEXPR blockdep_r() : word0(0) {} 12516 CONSTEXPR blockdep_r(uint32_t init) : word0(init) {} 12517 CONSTEXPR void operator=(uint32_t value) 12518 { 12519 word0 = value; 12520 } 12521 void operator=(uint32_t value) volatile 12522 { 12523 word0 = value; 12524 } 12525 CONSTEXPR operator uint32_t() 12526 { 12527 return word0; 12528 } 12529 operator uint32_t() volatile 12530 { 12531 return word0; 12532 } 12533 blockdep_r copy() volatile 12534 { 12535 return *this; 12536 } 12537 CONSTEXPR uint32_t get_value() const 12538 { 12539 uint32_t value = word0; 12540 return value; 12541 } 12542 uint32_t get_value() const volatile 12543 { 12544 uint32_t value = word0; 12545 return value; 12546 } 12547 CONSTEXPR blockdep_r &set_value(uint32_t value) 12548 { 12549 word0 = value; 12550 return *this; 12551 } 12552 volatile blockdep_r &set_value(uint32_t value) volatile 12553 { 12554 word0 = value; 12555 return *this; 12556 } 12557 #endif 12558 }; 12559 12560 // dma0_src_region_r - None 12561 struct dma0_src_region_r 12562 { 12563 #ifndef __cplusplus 12564 union 12565 { 12566 struct 12567 { 12568 uint32_t value : 32; // 32-bit register value 12569 }; 12570 uint32_t word; 12571 }; 12572 #else 12573 private: 12574 uint32_t word0; 12575 12576 public: 12577 CONSTEXPR dma0_src_region_r() : word0(0) {} 12578 CONSTEXPR dma0_src_region_r(uint32_t init) : word0(init) {} 12579 CONSTEXPR void operator=(uint32_t value) 12580 { 12581 word0 = value; 12582 } 12583 void operator=(uint32_t value) volatile 12584 { 12585 word0 = value; 12586 } 12587 CONSTEXPR operator uint32_t() 12588 { 12589 return word0; 12590 } 12591 operator uint32_t() volatile 12592 { 12593 return word0; 12594 } 12595 dma0_src_region_r copy() volatile 12596 { 12597 return *this; 12598 } 12599 CONSTEXPR uint32_t get_value() const 12600 { 12601 uint32_t value = word0; 12602 return value; 12603 } 12604 uint32_t get_value() const volatile 12605 { 12606 uint32_t value = word0; 12607 return value; 12608 } 12609 CONSTEXPR dma0_src_region_r &set_value(uint32_t value) 12610 { 12611 word0 = value; 12612 return *this; 12613 } 12614 volatile dma0_src_region_r &set_value(uint32_t value) volatile 12615 { 12616 word0 = value; 12617 return *this; 12618 } 12619 #endif 12620 }; 12621 12622 // dma0_dst_region_r - None 12623 struct dma0_dst_region_r 12624 { 12625 #ifndef __cplusplus 12626 union 12627 { 12628 struct 12629 { 12630 uint32_t value : 32; // 32-bit register value 12631 }; 12632 uint32_t word; 12633 }; 12634 #else 12635 private: 12636 uint32_t word0; 12637 12638 public: 12639 CONSTEXPR dma0_dst_region_r() : word0(0) {} 12640 CONSTEXPR dma0_dst_region_r(uint32_t init) : word0(init) {} 12641 CONSTEXPR void operator=(uint32_t value) 12642 { 12643 word0 = value; 12644 } 12645 void operator=(uint32_t value) volatile 12646 { 12647 word0 = value; 12648 } 12649 CONSTEXPR operator uint32_t() 12650 { 12651 return word0; 12652 } 12653 operator uint32_t() volatile 12654 { 12655 return word0; 12656 } 12657 dma0_dst_region_r copy() volatile 12658 { 12659 return *this; 12660 } 12661 CONSTEXPR uint32_t get_value() const 12662 { 12663 uint32_t value = word0; 12664 return value; 12665 } 12666 uint32_t get_value() const volatile 12667 { 12668 uint32_t value = word0; 12669 return value; 12670 } 12671 CONSTEXPR dma0_dst_region_r &set_value(uint32_t value) 12672 { 12673 word0 = value; 12674 return *this; 12675 } 12676 volatile dma0_dst_region_r &set_value(uint32_t value) volatile 12677 { 12678 word0 = value; 12679 return *this; 12680 } 12681 #endif 12682 }; 12683 12684 // dma0_size0_r - None 12685 struct dma0_size0_r 12686 { 12687 #ifndef __cplusplus 12688 union 12689 { 12690 struct 12691 { 12692 uint32_t value : 32; // 32-bit register value 12693 }; 12694 uint32_t word; 12695 }; 12696 #else 12697 private: 12698 uint32_t word0; 12699 12700 public: 12701 CONSTEXPR dma0_size0_r() : word0(0) {} 12702 CONSTEXPR dma0_size0_r(uint32_t init) : word0(init) {} 12703 CONSTEXPR void operator=(uint32_t value) 12704 { 12705 word0 = value; 12706 } 12707 void operator=(uint32_t value) volatile 12708 { 12709 word0 = value; 12710 } 12711 CONSTEXPR operator uint32_t() 12712 { 12713 return word0; 12714 } 12715 operator uint32_t() volatile 12716 { 12717 return word0; 12718 } 12719 dma0_size0_r copy() volatile 12720 { 12721 return *this; 12722 } 12723 CONSTEXPR uint32_t get_value() const 12724 { 12725 uint32_t value = word0; 12726 return value; 12727 } 12728 uint32_t get_value() const volatile 12729 { 12730 uint32_t value = word0; 12731 return value; 12732 } 12733 CONSTEXPR dma0_size0_r &set_value(uint32_t value) 12734 { 12735 word0 = value; 12736 return *this; 12737 } 12738 volatile dma0_size0_r &set_value(uint32_t value) volatile 12739 { 12740 word0 = value; 12741 return *this; 12742 } 12743 #endif 12744 }; 12745 12746 // dma0_size1_r - None 12747 struct dma0_size1_r 12748 { 12749 #ifndef __cplusplus 12750 union 12751 { 12752 struct 12753 { 12754 uint32_t value : 32; // 32-bit register value 12755 }; 12756 uint32_t word; 12757 }; 12758 #else 12759 private: 12760 uint32_t word0; 12761 12762 public: 12763 CONSTEXPR dma0_size1_r() : word0(0) {} 12764 CONSTEXPR dma0_size1_r(uint32_t init) : word0(init) {} 12765 CONSTEXPR void operator=(uint32_t value) 12766 { 12767 word0 = value; 12768 } 12769 void operator=(uint32_t value) volatile 12770 { 12771 word0 = value; 12772 } 12773 CONSTEXPR operator uint32_t() 12774 { 12775 return word0; 12776 } 12777 operator uint32_t() volatile 12778 { 12779 return word0; 12780 } 12781 dma0_size1_r copy() volatile 12782 { 12783 return *this; 12784 } 12785 CONSTEXPR uint32_t get_value() const 12786 { 12787 uint32_t value = word0; 12788 return value; 12789 } 12790 uint32_t get_value() const volatile 12791 { 12792 uint32_t value = word0; 12793 return value; 12794 } 12795 CONSTEXPR dma0_size1_r &set_value(uint32_t value) 12796 { 12797 word0 = value; 12798 return *this; 12799 } 12800 volatile dma0_size1_r &set_value(uint32_t value) volatile 12801 { 12802 word0 = value; 12803 return *this; 12804 } 12805 #endif 12806 }; 12807 12808 // ifm2_broadcast_r - None 12809 struct ifm2_broadcast_r 12810 { 12811 #ifndef __cplusplus 12812 union 12813 { 12814 struct 12815 { 12816 uint32_t value : 32; // 32-bit register value 12817 }; 12818 uint32_t word; 12819 }; 12820 #else 12821 private: 12822 uint32_t word0; 12823 12824 public: 12825 CONSTEXPR ifm2_broadcast_r() : word0(0) {} 12826 CONSTEXPR ifm2_broadcast_r(uint32_t init) : word0(init) {} 12827 CONSTEXPR void operator=(uint32_t value) 12828 { 12829 word0 = value; 12830 } 12831 void operator=(uint32_t value) volatile 12832 { 12833 word0 = value; 12834 } 12835 CONSTEXPR operator uint32_t() 12836 { 12837 return word0; 12838 } 12839 operator uint32_t() volatile 12840 { 12841 return word0; 12842 } 12843 ifm2_broadcast_r copy() volatile 12844 { 12845 return *this; 12846 } 12847 CONSTEXPR uint32_t get_value() const 12848 { 12849 uint32_t value = word0; 12850 return value; 12851 } 12852 uint32_t get_value() const volatile 12853 { 12854 uint32_t value = word0; 12855 return value; 12856 } 12857 CONSTEXPR ifm2_broadcast_r &set_value(uint32_t value) 12858 { 12859 word0 = value; 12860 return *this; 12861 } 12862 volatile ifm2_broadcast_r &set_value(uint32_t value) volatile 12863 { 12864 word0 = value; 12865 return *this; 12866 } 12867 #endif 12868 }; 12869 12870 // ifm2_scalar_r - None 12871 struct ifm2_scalar_r 12872 { 12873 #ifndef __cplusplus 12874 union 12875 { 12876 struct 12877 { 12878 uint32_t value : 32; // 32-bit register value 12879 }; 12880 uint32_t word; 12881 }; 12882 #else 12883 private: 12884 uint32_t word0; 12885 12886 public: 12887 CONSTEXPR ifm2_scalar_r() : word0(0) {} 12888 CONSTEXPR ifm2_scalar_r(uint32_t init) : word0(init) {} 12889 CONSTEXPR void operator=(uint32_t value) 12890 { 12891 word0 = value; 12892 } 12893 void operator=(uint32_t value) volatile 12894 { 12895 word0 = value; 12896 } 12897 CONSTEXPR operator uint32_t() 12898 { 12899 return word0; 12900 } 12901 operator uint32_t() volatile 12902 { 12903 return word0; 12904 } 12905 ifm2_scalar_r copy() volatile 12906 { 12907 return *this; 12908 } 12909 CONSTEXPR uint32_t get_value() const 12910 { 12911 uint32_t value = word0; 12912 return value; 12913 } 12914 uint32_t get_value() const volatile 12915 { 12916 uint32_t value = word0; 12917 return value; 12918 } 12919 CONSTEXPR ifm2_scalar_r &set_value(uint32_t value) 12920 { 12921 word0 = value; 12922 return *this; 12923 } 12924 volatile ifm2_scalar_r &set_value(uint32_t value) volatile 12925 { 12926 word0 = value; 12927 return *this; 12928 } 12929 #endif 12930 }; 12931 12932 // ifm2_precision_r - None 12933 struct ifm2_precision_r 12934 { 12935 #ifndef __cplusplus 12936 union 12937 { 12938 struct 12939 { 12940 uint32_t value : 32; // 32-bit register value 12941 }; 12942 uint32_t word; 12943 }; 12944 #else 12945 private: 12946 uint32_t word0; 12947 12948 public: 12949 CONSTEXPR ifm2_precision_r() : word0(0) {} 12950 CONSTEXPR ifm2_precision_r(uint32_t init) : word0(init) {} 12951 CONSTEXPR void operator=(uint32_t value) 12952 { 12953 word0 = value; 12954 } 12955 void operator=(uint32_t value) volatile 12956 { 12957 word0 = value; 12958 } 12959 CONSTEXPR operator uint32_t() 12960 { 12961 return word0; 12962 } 12963 operator uint32_t() volatile 12964 { 12965 return word0; 12966 } 12967 ifm2_precision_r copy() volatile 12968 { 12969 return *this; 12970 } 12971 CONSTEXPR uint32_t get_value() const 12972 { 12973 uint32_t value = word0; 12974 return value; 12975 } 12976 uint32_t get_value() const volatile 12977 { 12978 uint32_t value = word0; 12979 return value; 12980 } 12981 CONSTEXPR ifm2_precision_r &set_value(uint32_t value) 12982 { 12983 word0 = value; 12984 return *this; 12985 } 12986 volatile ifm2_precision_r &set_value(uint32_t value) volatile 12987 { 12988 word0 = value; 12989 return *this; 12990 } 12991 #endif 12992 }; 12993 12994 // ifm2_zero_point_r - None 12995 struct ifm2_zero_point_r 12996 { 12997 #ifndef __cplusplus 12998 union 12999 { 13000 struct 13001 { 13002 uint32_t value : 32; // 32-bit register value 13003 }; 13004 uint32_t word; 13005 }; 13006 #else 13007 private: 13008 uint32_t word0; 13009 13010 public: 13011 CONSTEXPR ifm2_zero_point_r() : word0(0) {} 13012 CONSTEXPR ifm2_zero_point_r(uint32_t init) : word0(init) {} 13013 CONSTEXPR void operator=(uint32_t value) 13014 { 13015 word0 = value; 13016 } 13017 void operator=(uint32_t value) volatile 13018 { 13019 word0 = value; 13020 } 13021 CONSTEXPR operator uint32_t() 13022 { 13023 return word0; 13024 } 13025 operator uint32_t() volatile 13026 { 13027 return word0; 13028 } 13029 ifm2_zero_point_r copy() volatile 13030 { 13031 return *this; 13032 } 13033 CONSTEXPR uint32_t get_value() const 13034 { 13035 uint32_t value = word0; 13036 return value; 13037 } 13038 uint32_t get_value() const volatile 13039 { 13040 uint32_t value = word0; 13041 return value; 13042 } 13043 CONSTEXPR ifm2_zero_point_r &set_value(uint32_t value) 13044 { 13045 word0 = value; 13046 return *this; 13047 } 13048 volatile ifm2_zero_point_r &set_value(uint32_t value) volatile 13049 { 13050 word0 = value; 13051 return *this; 13052 } 13053 #endif 13054 }; 13055 13056 // ifm2_width0_m1_r - None 13057 struct ifm2_width0_m1_r 13058 { 13059 #ifndef __cplusplus 13060 union 13061 { 13062 struct 13063 { 13064 uint32_t value : 32; // 32-bit register value 13065 }; 13066 uint32_t word; 13067 }; 13068 #else 13069 private: 13070 uint32_t word0; 13071 13072 public: 13073 CONSTEXPR ifm2_width0_m1_r() : word0(0) {} 13074 CONSTEXPR ifm2_width0_m1_r(uint32_t init) : word0(init) {} 13075 CONSTEXPR void operator=(uint32_t value) 13076 { 13077 word0 = value; 13078 } 13079 void operator=(uint32_t value) volatile 13080 { 13081 word0 = value; 13082 } 13083 CONSTEXPR operator uint32_t() 13084 { 13085 return word0; 13086 } 13087 operator uint32_t() volatile 13088 { 13089 return word0; 13090 } 13091 ifm2_width0_m1_r copy() volatile 13092 { 13093 return *this; 13094 } 13095 CONSTEXPR uint32_t get_value() const 13096 { 13097 uint32_t value = word0; 13098 return value; 13099 } 13100 uint32_t get_value() const volatile 13101 { 13102 uint32_t value = word0; 13103 return value; 13104 } 13105 CONSTEXPR ifm2_width0_m1_r &set_value(uint32_t value) 13106 { 13107 word0 = value; 13108 return *this; 13109 } 13110 volatile ifm2_width0_m1_r &set_value(uint32_t value) volatile 13111 { 13112 word0 = value; 13113 return *this; 13114 } 13115 #endif 13116 }; 13117 13118 // ifm2_height0_m1_r - None 13119 struct ifm2_height0_m1_r 13120 { 13121 #ifndef __cplusplus 13122 union 13123 { 13124 struct 13125 { 13126 uint32_t value : 32; // 32-bit register value 13127 }; 13128 uint32_t word; 13129 }; 13130 #else 13131 private: 13132 uint32_t word0; 13133 13134 public: 13135 CONSTEXPR ifm2_height0_m1_r() : word0(0) {} 13136 CONSTEXPR ifm2_height0_m1_r(uint32_t init) : word0(init) {} 13137 CONSTEXPR void operator=(uint32_t value) 13138 { 13139 word0 = value; 13140 } 13141 void operator=(uint32_t value) volatile 13142 { 13143 word0 = value; 13144 } 13145 CONSTEXPR operator uint32_t() 13146 { 13147 return word0; 13148 } 13149 operator uint32_t() volatile 13150 { 13151 return word0; 13152 } 13153 ifm2_height0_m1_r copy() volatile 13154 { 13155 return *this; 13156 } 13157 CONSTEXPR uint32_t get_value() const 13158 { 13159 uint32_t value = word0; 13160 return value; 13161 } 13162 uint32_t get_value() const volatile 13163 { 13164 uint32_t value = word0; 13165 return value; 13166 } 13167 CONSTEXPR ifm2_height0_m1_r &set_value(uint32_t value) 13168 { 13169 word0 = value; 13170 return *this; 13171 } 13172 volatile ifm2_height0_m1_r &set_value(uint32_t value) volatile 13173 { 13174 word0 = value; 13175 return *this; 13176 } 13177 #endif 13178 }; 13179 13180 // ifm2_height1_m1_r - None 13181 struct ifm2_height1_m1_r 13182 { 13183 #ifndef __cplusplus 13184 union 13185 { 13186 struct 13187 { 13188 uint32_t value : 32; // 32-bit register value 13189 }; 13190 uint32_t word; 13191 }; 13192 #else 13193 private: 13194 uint32_t word0; 13195 13196 public: 13197 CONSTEXPR ifm2_height1_m1_r() : word0(0) {} 13198 CONSTEXPR ifm2_height1_m1_r(uint32_t init) : word0(init) {} 13199 CONSTEXPR void operator=(uint32_t value) 13200 { 13201 word0 = value; 13202 } 13203 void operator=(uint32_t value) volatile 13204 { 13205 word0 = value; 13206 } 13207 CONSTEXPR operator uint32_t() 13208 { 13209 return word0; 13210 } 13211 operator uint32_t() volatile 13212 { 13213 return word0; 13214 } 13215 ifm2_height1_m1_r copy() volatile 13216 { 13217 return *this; 13218 } 13219 CONSTEXPR uint32_t get_value() const 13220 { 13221 uint32_t value = word0; 13222 return value; 13223 } 13224 uint32_t get_value() const volatile 13225 { 13226 uint32_t value = word0; 13227 return value; 13228 } 13229 CONSTEXPR ifm2_height1_m1_r &set_value(uint32_t value) 13230 { 13231 word0 = value; 13232 return *this; 13233 } 13234 volatile ifm2_height1_m1_r &set_value(uint32_t value) volatile 13235 { 13236 word0 = value; 13237 return *this; 13238 } 13239 #endif 13240 }; 13241 13242 // ifm2_ib_start_r - None 13243 struct ifm2_ib_start_r 13244 { 13245 #ifndef __cplusplus 13246 union 13247 { 13248 struct 13249 { 13250 uint32_t value : 32; // 32-bit register value 13251 }; 13252 uint32_t word; 13253 }; 13254 #else 13255 private: 13256 uint32_t word0; 13257 13258 public: 13259 CONSTEXPR ifm2_ib_start_r() : word0(0) {} 13260 CONSTEXPR ifm2_ib_start_r(uint32_t init) : word0(init) {} 13261 CONSTEXPR void operator=(uint32_t value) 13262 { 13263 word0 = value; 13264 } 13265 void operator=(uint32_t value) volatile 13266 { 13267 word0 = value; 13268 } 13269 CONSTEXPR operator uint32_t() 13270 { 13271 return word0; 13272 } 13273 operator uint32_t() volatile 13274 { 13275 return word0; 13276 } 13277 ifm2_ib_start_r copy() volatile 13278 { 13279 return *this; 13280 } 13281 CONSTEXPR uint32_t get_value() const 13282 { 13283 uint32_t value = word0; 13284 return value; 13285 } 13286 uint32_t get_value() const volatile 13287 { 13288 uint32_t value = word0; 13289 return value; 13290 } 13291 CONSTEXPR ifm2_ib_start_r &set_value(uint32_t value) 13292 { 13293 word0 = value; 13294 return *this; 13295 } 13296 volatile ifm2_ib_start_r &set_value(uint32_t value) volatile 13297 { 13298 word0 = value; 13299 return *this; 13300 } 13301 #endif 13302 }; 13303 13304 // ifm2_region_r - None 13305 struct ifm2_region_r 13306 { 13307 #ifndef __cplusplus 13308 union 13309 { 13310 struct 13311 { 13312 uint32_t value : 32; // 32-bit register value 13313 }; 13314 uint32_t word; 13315 }; 13316 #else 13317 private: 13318 uint32_t word0; 13319 13320 public: 13321 CONSTEXPR ifm2_region_r() : word0(0) {} 13322 CONSTEXPR ifm2_region_r(uint32_t init) : word0(init) {} 13323 CONSTEXPR void operator=(uint32_t value) 13324 { 13325 word0 = value; 13326 } 13327 void operator=(uint32_t value) volatile 13328 { 13329 word0 = value; 13330 } 13331 CONSTEXPR operator uint32_t() 13332 { 13333 return word0; 13334 } 13335 operator uint32_t() volatile 13336 { 13337 return word0; 13338 } 13339 ifm2_region_r copy() volatile 13340 { 13341 return *this; 13342 } 13343 CONSTEXPR uint32_t get_value() const 13344 { 13345 uint32_t value = word0; 13346 return value; 13347 } 13348 uint32_t get_value() const volatile 13349 { 13350 uint32_t value = word0; 13351 return value; 13352 } 13353 CONSTEXPR ifm2_region_r &set_value(uint32_t value) 13354 { 13355 word0 = value; 13356 return *this; 13357 } 13358 volatile ifm2_region_r &set_value(uint32_t value) volatile 13359 { 13360 word0 = value; 13361 return *this; 13362 } 13363 #endif 13364 }; 13365 13366 // ifm_base0_r - None 13367 struct ifm_base0_r 13368 { 13369 #ifndef __cplusplus 13370 union 13371 { 13372 struct 13373 { 13374 uint32_t value_LO : 32; // 64-bit register value - LSB 13375 uint32_t value_HI : 32; // 64-bit register value - MSB 13376 }; 13377 uint32_t word[2]; 13378 }; 13379 #else 13380 private: 13381 uint32_t word0; 13382 uint32_t word1; 13383 13384 public: 13385 CONSTEXPR ifm_base0_r() : word0(0), word1(0) {} 13386 CONSTEXPR ifm_base0_r(uint64_t init) : 13387 word0(static_cast<uint32_t>((init)&std::numeric_limits<uint64_t>::max())), 13388 word1(static_cast<uint32_t>((init >> 32) & std::numeric_limits<uint64_t>::max())) 13389 { 13390 } 13391 CONSTEXPR void operator=(uint64_t value) 13392 { 13393 word0 = static_cast<uint32_t>((value)&std::numeric_limits<uint64_t>::max()); 13394 word1 = static_cast<uint32_t>((value >> 32) & std::numeric_limits<uint64_t>::max()); 13395 } 13396 void operator=(uint64_t value) volatile 13397 { 13398 word0 = static_cast<uint32_t>((value)&std::numeric_limits<uint64_t>::max()); 13399 word1 = static_cast<uint32_t>((value >> 32) & std::numeric_limits<uint64_t>::max()); 13400 } 13401 CONSTEXPR operator uint64_t() 13402 { 13403 return (static_cast<uint64_t>(word1) << 32) | word0; 13404 } 13405 operator uint64_t() volatile 13406 { 13407 return (static_cast<uint64_t>(word1) << 32) | word0; 13408 } 13409 ifm_base0_r copy() volatile 13410 { 13411 return *this; 13412 } 13413 #endif 13414 }; 13415 13416 // ifm_base1_r - None 13417 struct ifm_base1_r 13418 { 13419 #ifndef __cplusplus 13420 union 13421 { 13422 struct 13423 { 13424 uint32_t value_LO : 32; // 64-bit register value - LSB 13425 uint32_t value_HI : 32; // 64-bit register value - MSB 13426 }; 13427 uint32_t word[2]; 13428 }; 13429 #else 13430 private: 13431 uint32_t word0; 13432 uint32_t word1; 13433 13434 public: 13435 CONSTEXPR ifm_base1_r() : word0(0), word1(0) {} 13436 CONSTEXPR ifm_base1_r(uint64_t init) : 13437 word0(static_cast<uint32_t>((init)&std::numeric_limits<uint64_t>::max())), 13438 word1(static_cast<uint32_t>((init >> 32) & std::numeric_limits<uint64_t>::max())) 13439 { 13440 } 13441 CONSTEXPR void operator=(uint64_t value) 13442 { 13443 word0 = static_cast<uint32_t>((value)&std::numeric_limits<uint64_t>::max()); 13444 word1 = static_cast<uint32_t>((value >> 32) & std::numeric_limits<uint64_t>::max()); 13445 } 13446 void operator=(uint64_t value) volatile 13447 { 13448 word0 = static_cast<uint32_t>((value)&std::numeric_limits<uint64_t>::max()); 13449 word1 = static_cast<uint32_t>((value >> 32) & std::numeric_limits<uint64_t>::max()); 13450 } 13451 CONSTEXPR operator uint64_t() 13452 { 13453 return (static_cast<uint64_t>(word1) << 32) | word0; 13454 } 13455 operator uint64_t() volatile 13456 { 13457 return (static_cast<uint64_t>(word1) << 32) | word0; 13458 } 13459 ifm_base1_r copy() volatile 13460 { 13461 return *this; 13462 } 13463 #endif 13464 }; 13465 13466 // ifm_base2_r - None 13467 struct ifm_base2_r 13468 { 13469 #ifndef __cplusplus 13470 union 13471 { 13472 struct 13473 { 13474 uint32_t value_LO : 32; // 64-bit register value - LSB 13475 uint32_t value_HI : 32; // 64-bit register value - MSB 13476 }; 13477 uint32_t word[2]; 13478 }; 13479 #else 13480 private: 13481 uint32_t word0; 13482 uint32_t word1; 13483 13484 public: 13485 CONSTEXPR ifm_base2_r() : word0(0), word1(0) {} 13486 CONSTEXPR ifm_base2_r(uint64_t init) : 13487 word0(static_cast<uint32_t>((init)&std::numeric_limits<uint64_t>::max())), 13488 word1(static_cast<uint32_t>((init >> 32) & std::numeric_limits<uint64_t>::max())) 13489 { 13490 } 13491 CONSTEXPR void operator=(uint64_t value) 13492 { 13493 word0 = static_cast<uint32_t>((value)&std::numeric_limits<uint64_t>::max()); 13494 word1 = static_cast<uint32_t>((value >> 32) & std::numeric_limits<uint64_t>::max()); 13495 } 13496 void operator=(uint64_t value) volatile 13497 { 13498 word0 = static_cast<uint32_t>((value)&std::numeric_limits<uint64_t>::max()); 13499 word1 = static_cast<uint32_t>((value >> 32) & std::numeric_limits<uint64_t>::max()); 13500 } 13501 CONSTEXPR operator uint64_t() 13502 { 13503 return (static_cast<uint64_t>(word1) << 32) | word0; 13504 } 13505 operator uint64_t() volatile 13506 { 13507 return (static_cast<uint64_t>(word1) << 32) | word0; 13508 } 13509 ifm_base2_r copy() volatile 13510 { 13511 return *this; 13512 } 13513 #endif 13514 }; 13515 13516 // ifm_base3_r - None 13517 struct ifm_base3_r 13518 { 13519 #ifndef __cplusplus 13520 union 13521 { 13522 struct 13523 { 13524 uint32_t value_LO : 32; // 64-bit register value - LSB 13525 uint32_t value_HI : 32; // 64-bit register value - MSB 13526 }; 13527 uint32_t word[2]; 13528 }; 13529 #else 13530 private: 13531 uint32_t word0; 13532 uint32_t word1; 13533 13534 public: 13535 CONSTEXPR ifm_base3_r() : word0(0), word1(0) {} 13536 CONSTEXPR ifm_base3_r(uint64_t init) : 13537 word0(static_cast<uint32_t>((init)&std::numeric_limits<uint64_t>::max())), 13538 word1(static_cast<uint32_t>((init >> 32) & std::numeric_limits<uint64_t>::max())) 13539 { 13540 } 13541 CONSTEXPR void operator=(uint64_t value) 13542 { 13543 word0 = static_cast<uint32_t>((value)&std::numeric_limits<uint64_t>::max()); 13544 word1 = static_cast<uint32_t>((value >> 32) & std::numeric_limits<uint64_t>::max()); 13545 } 13546 void operator=(uint64_t value) volatile 13547 { 13548 word0 = static_cast<uint32_t>((value)&std::numeric_limits<uint64_t>::max()); 13549 word1 = static_cast<uint32_t>((value >> 32) & std::numeric_limits<uint64_t>::max()); 13550 } 13551 CONSTEXPR operator uint64_t() 13552 { 13553 return (static_cast<uint64_t>(word1) << 32) | word0; 13554 } 13555 operator uint64_t() volatile 13556 { 13557 return (static_cast<uint64_t>(word1) << 32) | word0; 13558 } 13559 ifm_base3_r copy() volatile 13560 { 13561 return *this; 13562 } 13563 #endif 13564 }; 13565 13566 // ifm_stride_x_r - None 13567 struct ifm_stride_x_r 13568 { 13569 #ifndef __cplusplus 13570 union 13571 { 13572 struct 13573 { 13574 uint32_t value_LO : 32; // 64-bit register value - LSB 13575 uint32_t value_HI : 32; // 64-bit register value - MSB 13576 }; 13577 uint32_t word[2]; 13578 }; 13579 #else 13580 private: 13581 uint32_t word0; 13582 uint32_t word1; 13583 13584 public: 13585 CONSTEXPR ifm_stride_x_r() : word0(0), word1(0) {} 13586 CONSTEXPR ifm_stride_x_r(uint64_t init) : 13587 word0(static_cast<uint32_t>((init)&std::numeric_limits<uint64_t>::max())), 13588 word1(static_cast<uint32_t>((init >> 32) & std::numeric_limits<uint64_t>::max())) 13589 { 13590 } 13591 CONSTEXPR void operator=(uint64_t value) 13592 { 13593 word0 = static_cast<uint32_t>((value)&std::numeric_limits<uint64_t>::max()); 13594 word1 = static_cast<uint32_t>((value >> 32) & std::numeric_limits<uint64_t>::max()); 13595 } 13596 void operator=(uint64_t value) volatile 13597 { 13598 word0 = static_cast<uint32_t>((value)&std::numeric_limits<uint64_t>::max()); 13599 word1 = static_cast<uint32_t>((value >> 32) & std::numeric_limits<uint64_t>::max()); 13600 } 13601 CONSTEXPR operator uint64_t() 13602 { 13603 return (static_cast<uint64_t>(word1) << 32) | word0; 13604 } 13605 operator uint64_t() volatile 13606 { 13607 return (static_cast<uint64_t>(word1) << 32) | word0; 13608 } 13609 ifm_stride_x_r copy() volatile 13610 { 13611 return *this; 13612 } 13613 #endif 13614 }; 13615 13616 // ifm_stride_y_r - None 13617 struct ifm_stride_y_r 13618 { 13619 #ifndef __cplusplus 13620 union 13621 { 13622 struct 13623 { 13624 uint32_t value_LO : 32; // 64-bit register value - LSB 13625 uint32_t value_HI : 32; // 64-bit register value - MSB 13626 }; 13627 uint32_t word[2]; 13628 }; 13629 #else 13630 private: 13631 uint32_t word0; 13632 uint32_t word1; 13633 13634 public: 13635 CONSTEXPR ifm_stride_y_r() : word0(0), word1(0) {} 13636 CONSTEXPR ifm_stride_y_r(uint64_t init) : 13637 word0(static_cast<uint32_t>((init)&std::numeric_limits<uint64_t>::max())), 13638 word1(static_cast<uint32_t>((init >> 32) & std::numeric_limits<uint64_t>::max())) 13639 { 13640 } 13641 CONSTEXPR void operator=(uint64_t value) 13642 { 13643 word0 = static_cast<uint32_t>((value)&std::numeric_limits<uint64_t>::max()); 13644 word1 = static_cast<uint32_t>((value >> 32) & std::numeric_limits<uint64_t>::max()); 13645 } 13646 void operator=(uint64_t value) volatile 13647 { 13648 word0 = static_cast<uint32_t>((value)&std::numeric_limits<uint64_t>::max()); 13649 word1 = static_cast<uint32_t>((value >> 32) & std::numeric_limits<uint64_t>::max()); 13650 } 13651 CONSTEXPR operator uint64_t() 13652 { 13653 return (static_cast<uint64_t>(word1) << 32) | word0; 13654 } 13655 operator uint64_t() volatile 13656 { 13657 return (static_cast<uint64_t>(word1) << 32) | word0; 13658 } 13659 ifm_stride_y_r copy() volatile 13660 { 13661 return *this; 13662 } 13663 #endif 13664 }; 13665 13666 // ifm_stride_c_r - None 13667 struct ifm_stride_c_r 13668 { 13669 #ifndef __cplusplus 13670 union 13671 { 13672 struct 13673 { 13674 uint32_t value_LO : 32; // 64-bit register value - LSB 13675 uint32_t value_HI : 32; // 64-bit register value - MSB 13676 }; 13677 uint32_t word[2]; 13678 }; 13679 #else 13680 private: 13681 uint32_t word0; 13682 uint32_t word1; 13683 13684 public: 13685 CONSTEXPR ifm_stride_c_r() : word0(0), word1(0) {} 13686 CONSTEXPR ifm_stride_c_r(uint64_t init) : 13687 word0(static_cast<uint32_t>((init)&std::numeric_limits<uint64_t>::max())), 13688 word1(static_cast<uint32_t>((init >> 32) & std::numeric_limits<uint64_t>::max())) 13689 { 13690 } 13691 CONSTEXPR void operator=(uint64_t value) 13692 { 13693 word0 = static_cast<uint32_t>((value)&std::numeric_limits<uint64_t>::max()); 13694 word1 = static_cast<uint32_t>((value >> 32) & std::numeric_limits<uint64_t>::max()); 13695 } 13696 void operator=(uint64_t value) volatile 13697 { 13698 word0 = static_cast<uint32_t>((value)&std::numeric_limits<uint64_t>::max()); 13699 word1 = static_cast<uint32_t>((value >> 32) & std::numeric_limits<uint64_t>::max()); 13700 } 13701 CONSTEXPR operator uint64_t() 13702 { 13703 return (static_cast<uint64_t>(word1) << 32) | word0; 13704 } 13705 operator uint64_t() volatile 13706 { 13707 return (static_cast<uint64_t>(word1) << 32) | word0; 13708 } 13709 ifm_stride_c_r copy() volatile 13710 { 13711 return *this; 13712 } 13713 #endif 13714 }; 13715 13716 // ofm_base0_r - None 13717 struct ofm_base0_r 13718 { 13719 #ifndef __cplusplus 13720 union 13721 { 13722 struct 13723 { 13724 uint32_t value_LO : 32; // 64-bit register value - LSB 13725 uint32_t value_HI : 32; // 64-bit register value - MSB 13726 }; 13727 uint32_t word[2]; 13728 }; 13729 #else 13730 private: 13731 uint32_t word0; 13732 uint32_t word1; 13733 13734 public: 13735 CONSTEXPR ofm_base0_r() : word0(0), word1(0) {} 13736 CONSTEXPR ofm_base0_r(uint64_t init) : 13737 word0(static_cast<uint32_t>((init)&std::numeric_limits<uint64_t>::max())), 13738 word1(static_cast<uint32_t>((init >> 32) & std::numeric_limits<uint64_t>::max())) 13739 { 13740 } 13741 CONSTEXPR void operator=(uint64_t value) 13742 { 13743 word0 = static_cast<uint32_t>((value)&std::numeric_limits<uint64_t>::max()); 13744 word1 = static_cast<uint32_t>((value >> 32) & std::numeric_limits<uint64_t>::max()); 13745 } 13746 void operator=(uint64_t value) volatile 13747 { 13748 word0 = static_cast<uint32_t>((value)&std::numeric_limits<uint64_t>::max()); 13749 word1 = static_cast<uint32_t>((value >> 32) & std::numeric_limits<uint64_t>::max()); 13750 } 13751 CONSTEXPR operator uint64_t() 13752 { 13753 return (static_cast<uint64_t>(word1) << 32) | word0; 13754 } 13755 operator uint64_t() volatile 13756 { 13757 return (static_cast<uint64_t>(word1) << 32) | word0; 13758 } 13759 ofm_base0_r copy() volatile 13760 { 13761 return *this; 13762 } 13763 #endif 13764 }; 13765 13766 // ofm_base1_r - None 13767 struct ofm_base1_r 13768 { 13769 #ifndef __cplusplus 13770 union 13771 { 13772 struct 13773 { 13774 uint32_t value_LO : 32; // 64-bit register value - LSB 13775 uint32_t value_HI : 32; // 64-bit register value - MSB 13776 }; 13777 uint32_t word[2]; 13778 }; 13779 #else 13780 private: 13781 uint32_t word0; 13782 uint32_t word1; 13783 13784 public: 13785 CONSTEXPR ofm_base1_r() : word0(0), word1(0) {} 13786 CONSTEXPR ofm_base1_r(uint64_t init) : 13787 word0(static_cast<uint32_t>((init)&std::numeric_limits<uint64_t>::max())), 13788 word1(static_cast<uint32_t>((init >> 32) & std::numeric_limits<uint64_t>::max())) 13789 { 13790 } 13791 CONSTEXPR void operator=(uint64_t value) 13792 { 13793 word0 = static_cast<uint32_t>((value)&std::numeric_limits<uint64_t>::max()); 13794 word1 = static_cast<uint32_t>((value >> 32) & std::numeric_limits<uint64_t>::max()); 13795 } 13796 void operator=(uint64_t value) volatile 13797 { 13798 word0 = static_cast<uint32_t>((value)&std::numeric_limits<uint64_t>::max()); 13799 word1 = static_cast<uint32_t>((value >> 32) & std::numeric_limits<uint64_t>::max()); 13800 } 13801 CONSTEXPR operator uint64_t() 13802 { 13803 return (static_cast<uint64_t>(word1) << 32) | word0; 13804 } 13805 operator uint64_t() volatile 13806 { 13807 return (static_cast<uint64_t>(word1) << 32) | word0; 13808 } 13809 ofm_base1_r copy() volatile 13810 { 13811 return *this; 13812 } 13813 #endif 13814 }; 13815 13816 // ofm_base2_r - None 13817 struct ofm_base2_r 13818 { 13819 #ifndef __cplusplus 13820 union 13821 { 13822 struct 13823 { 13824 uint32_t value_LO : 32; // 64-bit register value - LSB 13825 uint32_t value_HI : 32; // 64-bit register value - MSB 13826 }; 13827 uint32_t word[2]; 13828 }; 13829 #else 13830 private: 13831 uint32_t word0; 13832 uint32_t word1; 13833 13834 public: 13835 CONSTEXPR ofm_base2_r() : word0(0), word1(0) {} 13836 CONSTEXPR ofm_base2_r(uint64_t init) : 13837 word0(static_cast<uint32_t>((init)&std::numeric_limits<uint64_t>::max())), 13838 word1(static_cast<uint32_t>((init >> 32) & std::numeric_limits<uint64_t>::max())) 13839 { 13840 } 13841 CONSTEXPR void operator=(uint64_t value) 13842 { 13843 word0 = static_cast<uint32_t>((value)&std::numeric_limits<uint64_t>::max()); 13844 word1 = static_cast<uint32_t>((value >> 32) & std::numeric_limits<uint64_t>::max()); 13845 } 13846 void operator=(uint64_t value) volatile 13847 { 13848 word0 = static_cast<uint32_t>((value)&std::numeric_limits<uint64_t>::max()); 13849 word1 = static_cast<uint32_t>((value >> 32) & std::numeric_limits<uint64_t>::max()); 13850 } 13851 CONSTEXPR operator uint64_t() 13852 { 13853 return (static_cast<uint64_t>(word1) << 32) | word0; 13854 } 13855 operator uint64_t() volatile 13856 { 13857 return (static_cast<uint64_t>(word1) << 32) | word0; 13858 } 13859 ofm_base2_r copy() volatile 13860 { 13861 return *this; 13862 } 13863 #endif 13864 }; 13865 13866 // ofm_base3_r - None 13867 struct ofm_base3_r 13868 { 13869 #ifndef __cplusplus 13870 union 13871 { 13872 struct 13873 { 13874 uint32_t value_LO : 32; // 64-bit register value - LSB 13875 uint32_t value_HI : 32; // 64-bit register value - MSB 13876 }; 13877 uint32_t word[2]; 13878 }; 13879 #else 13880 private: 13881 uint32_t word0; 13882 uint32_t word1; 13883 13884 public: 13885 CONSTEXPR ofm_base3_r() : word0(0), word1(0) {} 13886 CONSTEXPR ofm_base3_r(uint64_t init) : 13887 word0(static_cast<uint32_t>((init)&std::numeric_limits<uint64_t>::max())), 13888 word1(static_cast<uint32_t>((init >> 32) & std::numeric_limits<uint64_t>::max())) 13889 { 13890 } 13891 CONSTEXPR void operator=(uint64_t value) 13892 { 13893 word0 = static_cast<uint32_t>((value)&std::numeric_limits<uint64_t>::max()); 13894 word1 = static_cast<uint32_t>((value >> 32) & std::numeric_limits<uint64_t>::max()); 13895 } 13896 void operator=(uint64_t value) volatile 13897 { 13898 word0 = static_cast<uint32_t>((value)&std::numeric_limits<uint64_t>::max()); 13899 word1 = static_cast<uint32_t>((value >> 32) & std::numeric_limits<uint64_t>::max()); 13900 } 13901 CONSTEXPR operator uint64_t() 13902 { 13903 return (static_cast<uint64_t>(word1) << 32) | word0; 13904 } 13905 operator uint64_t() volatile 13906 { 13907 return (static_cast<uint64_t>(word1) << 32) | word0; 13908 } 13909 ofm_base3_r copy() volatile 13910 { 13911 return *this; 13912 } 13913 #endif 13914 }; 13915 13916 // ofm_stride_x_r - None 13917 struct ofm_stride_x_r 13918 { 13919 #ifndef __cplusplus 13920 union 13921 { 13922 struct 13923 { 13924 uint32_t value_LO : 32; // 64-bit register value - LSB 13925 uint32_t value_HI : 32; // 64-bit register value - MSB 13926 }; 13927 uint32_t word[2]; 13928 }; 13929 #else 13930 private: 13931 uint32_t word0; 13932 uint32_t word1; 13933 13934 public: 13935 CONSTEXPR ofm_stride_x_r() : word0(0), word1(0) {} 13936 CONSTEXPR ofm_stride_x_r(uint64_t init) : 13937 word0(static_cast<uint32_t>((init)&std::numeric_limits<uint64_t>::max())), 13938 word1(static_cast<uint32_t>((init >> 32) & std::numeric_limits<uint64_t>::max())) 13939 { 13940 } 13941 CONSTEXPR void operator=(uint64_t value) 13942 { 13943 word0 = static_cast<uint32_t>((value)&std::numeric_limits<uint64_t>::max()); 13944 word1 = static_cast<uint32_t>((value >> 32) & std::numeric_limits<uint64_t>::max()); 13945 } 13946 void operator=(uint64_t value) volatile 13947 { 13948 word0 = static_cast<uint32_t>((value)&std::numeric_limits<uint64_t>::max()); 13949 word1 = static_cast<uint32_t>((value >> 32) & std::numeric_limits<uint64_t>::max()); 13950 } 13951 CONSTEXPR operator uint64_t() 13952 { 13953 return (static_cast<uint64_t>(word1) << 32) | word0; 13954 } 13955 operator uint64_t() volatile 13956 { 13957 return (static_cast<uint64_t>(word1) << 32) | word0; 13958 } 13959 ofm_stride_x_r copy() volatile 13960 { 13961 return *this; 13962 } 13963 #endif 13964 }; 13965 13966 // ofm_stride_y_r - None 13967 struct ofm_stride_y_r 13968 { 13969 #ifndef __cplusplus 13970 union 13971 { 13972 struct 13973 { 13974 uint32_t value_LO : 32; // 64-bit register value - LSB 13975 uint32_t value_HI : 32; // 64-bit register value - MSB 13976 }; 13977 uint32_t word[2]; 13978 }; 13979 #else 13980 private: 13981 uint32_t word0; 13982 uint32_t word1; 13983 13984 public: 13985 CONSTEXPR ofm_stride_y_r() : word0(0), word1(0) {} 13986 CONSTEXPR ofm_stride_y_r(uint64_t init) : 13987 word0(static_cast<uint32_t>((init)&std::numeric_limits<uint64_t>::max())), 13988 word1(static_cast<uint32_t>((init >> 32) & std::numeric_limits<uint64_t>::max())) 13989 { 13990 } 13991 CONSTEXPR void operator=(uint64_t value) 13992 { 13993 word0 = static_cast<uint32_t>((value)&std::numeric_limits<uint64_t>::max()); 13994 word1 = static_cast<uint32_t>((value >> 32) & std::numeric_limits<uint64_t>::max()); 13995 } 13996 void operator=(uint64_t value) volatile 13997 { 13998 word0 = static_cast<uint32_t>((value)&std::numeric_limits<uint64_t>::max()); 13999 word1 = static_cast<uint32_t>((value >> 32) & std::numeric_limits<uint64_t>::max()); 14000 } 14001 CONSTEXPR operator uint64_t() 14002 { 14003 return (static_cast<uint64_t>(word1) << 32) | word0; 14004 } 14005 operator uint64_t() volatile 14006 { 14007 return (static_cast<uint64_t>(word1) << 32) | word0; 14008 } 14009 ofm_stride_y_r copy() volatile 14010 { 14011 return *this; 14012 } 14013 #endif 14014 }; 14015 14016 // ofm_stride_c_r - None 14017 struct ofm_stride_c_r 14018 { 14019 #ifndef __cplusplus 14020 union 14021 { 14022 struct 14023 { 14024 uint32_t value_LO : 32; // 64-bit register value - LSB 14025 uint32_t value_HI : 32; // 64-bit register value - MSB 14026 }; 14027 uint32_t word[2]; 14028 }; 14029 #else 14030 private: 14031 uint32_t word0; 14032 uint32_t word1; 14033 14034 public: 14035 CONSTEXPR ofm_stride_c_r() : word0(0), word1(0) {} 14036 CONSTEXPR ofm_stride_c_r(uint64_t init) : 14037 word0(static_cast<uint32_t>((init)&std::numeric_limits<uint64_t>::max())), 14038 word1(static_cast<uint32_t>((init >> 32) & std::numeric_limits<uint64_t>::max())) 14039 { 14040 } 14041 CONSTEXPR void operator=(uint64_t value) 14042 { 14043 word0 = static_cast<uint32_t>((value)&std::numeric_limits<uint64_t>::max()); 14044 word1 = static_cast<uint32_t>((value >> 32) & std::numeric_limits<uint64_t>::max()); 14045 } 14046 void operator=(uint64_t value) volatile 14047 { 14048 word0 = static_cast<uint32_t>((value)&std::numeric_limits<uint64_t>::max()); 14049 word1 = static_cast<uint32_t>((value >> 32) & std::numeric_limits<uint64_t>::max()); 14050 } 14051 CONSTEXPR operator uint64_t() 14052 { 14053 return (static_cast<uint64_t>(word1) << 32) | word0; 14054 } 14055 operator uint64_t() volatile 14056 { 14057 return (static_cast<uint64_t>(word1) << 32) | word0; 14058 } 14059 ofm_stride_c_r copy() volatile 14060 { 14061 return *this; 14062 } 14063 #endif 14064 }; 14065 14066 // weight_base_r - None 14067 struct weight_base_r 14068 { 14069 #ifndef __cplusplus 14070 union 14071 { 14072 struct 14073 { 14074 uint32_t value_LO : 32; // 64-bit register value - LSB 14075 uint32_t value_HI : 32; // 64-bit register value - MSB 14076 }; 14077 uint32_t word[2]; 14078 }; 14079 #else 14080 private: 14081 uint32_t word0; 14082 uint32_t word1; 14083 14084 public: 14085 CONSTEXPR weight_base_r() : word0(0), word1(0) {} 14086 CONSTEXPR weight_base_r(uint64_t init) : 14087 word0(static_cast<uint32_t>((init)&std::numeric_limits<uint64_t>::max())), 14088 word1(static_cast<uint32_t>((init >> 32) & std::numeric_limits<uint64_t>::max())) 14089 { 14090 } 14091 CONSTEXPR void operator=(uint64_t value) 14092 { 14093 word0 = static_cast<uint32_t>((value)&std::numeric_limits<uint64_t>::max()); 14094 word1 = static_cast<uint32_t>((value >> 32) & std::numeric_limits<uint64_t>::max()); 14095 } 14096 void operator=(uint64_t value) volatile 14097 { 14098 word0 = static_cast<uint32_t>((value)&std::numeric_limits<uint64_t>::max()); 14099 word1 = static_cast<uint32_t>((value >> 32) & std::numeric_limits<uint64_t>::max()); 14100 } 14101 CONSTEXPR operator uint64_t() 14102 { 14103 return (static_cast<uint64_t>(word1) << 32) | word0; 14104 } 14105 operator uint64_t() volatile 14106 { 14107 return (static_cast<uint64_t>(word1) << 32) | word0; 14108 } 14109 weight_base_r copy() volatile 14110 { 14111 return *this; 14112 } 14113 #endif 14114 }; 14115 14116 // weight_length_r - None 14117 struct weight_length_r 14118 { 14119 #ifndef __cplusplus 14120 union 14121 { 14122 struct 14123 { 14124 uint32_t value_LO : 32; // 64-bit register value - LSB 14125 uint32_t value_HI : 32; // 64-bit register value - MSB 14126 }; 14127 uint32_t word[2]; 14128 }; 14129 #else 14130 private: 14131 uint32_t word0; 14132 uint32_t word1; 14133 14134 public: 14135 CONSTEXPR weight_length_r() : word0(0), word1(0) {} 14136 CONSTEXPR weight_length_r(uint64_t init) : 14137 word0(static_cast<uint32_t>((init)&std::numeric_limits<uint64_t>::max())), 14138 word1(static_cast<uint32_t>((init >> 32) & std::numeric_limits<uint64_t>::max())) 14139 { 14140 } 14141 CONSTEXPR void operator=(uint64_t value) 14142 { 14143 word0 = static_cast<uint32_t>((value)&std::numeric_limits<uint64_t>::max()); 14144 word1 = static_cast<uint32_t>((value >> 32) & std::numeric_limits<uint64_t>::max()); 14145 } 14146 void operator=(uint64_t value) volatile 14147 { 14148 word0 = static_cast<uint32_t>((value)&std::numeric_limits<uint64_t>::max()); 14149 word1 = static_cast<uint32_t>((value >> 32) & std::numeric_limits<uint64_t>::max()); 14150 } 14151 CONSTEXPR operator uint64_t() 14152 { 14153 return (static_cast<uint64_t>(word1) << 32) | word0; 14154 } 14155 operator uint64_t() volatile 14156 { 14157 return (static_cast<uint64_t>(word1) << 32) | word0; 14158 } 14159 weight_length_r copy() volatile 14160 { 14161 return *this; 14162 } 14163 #endif 14164 }; 14165 14166 // scale_base_r - None 14167 struct scale_base_r 14168 { 14169 #ifndef __cplusplus 14170 union 14171 { 14172 struct 14173 { 14174 uint32_t value_LO : 32; // 64-bit register value - LSB 14175 uint32_t value_HI : 32; // 64-bit register value - MSB 14176 }; 14177 uint32_t word[2]; 14178 }; 14179 #else 14180 private: 14181 uint32_t word0; 14182 uint32_t word1; 14183 14184 public: 14185 CONSTEXPR scale_base_r() : word0(0), word1(0) {} 14186 CONSTEXPR scale_base_r(uint64_t init) : 14187 word0(static_cast<uint32_t>((init)&std::numeric_limits<uint64_t>::max())), 14188 word1(static_cast<uint32_t>((init >> 32) & std::numeric_limits<uint64_t>::max())) 14189 { 14190 } 14191 CONSTEXPR void operator=(uint64_t value) 14192 { 14193 word0 = static_cast<uint32_t>((value)&std::numeric_limits<uint64_t>::max()); 14194 word1 = static_cast<uint32_t>((value >> 32) & std::numeric_limits<uint64_t>::max()); 14195 } 14196 void operator=(uint64_t value) volatile 14197 { 14198 word0 = static_cast<uint32_t>((value)&std::numeric_limits<uint64_t>::max()); 14199 word1 = static_cast<uint32_t>((value >> 32) & std::numeric_limits<uint64_t>::max()); 14200 } 14201 CONSTEXPR operator uint64_t() 14202 { 14203 return (static_cast<uint64_t>(word1) << 32) | word0; 14204 } 14205 operator uint64_t() volatile 14206 { 14207 return (static_cast<uint64_t>(word1) << 32) | word0; 14208 } 14209 scale_base_r copy() volatile 14210 { 14211 return *this; 14212 } 14213 #endif 14214 }; 14215 14216 // scale_length_r - None 14217 struct scale_length_r 14218 { 14219 #ifndef __cplusplus 14220 union 14221 { 14222 struct 14223 { 14224 uint32_t value_LO : 32; // 64-bit register value - LSB 14225 uint32_t value_HI : 32; // 64-bit register value - MSB 14226 }; 14227 uint32_t word[2]; 14228 }; 14229 #else 14230 private: 14231 uint32_t word0; 14232 uint32_t word1; 14233 14234 public: 14235 CONSTEXPR scale_length_r() : word0(0), word1(0) {} 14236 CONSTEXPR scale_length_r(uint64_t init) : 14237 word0(static_cast<uint32_t>((init)&std::numeric_limits<uint64_t>::max())), 14238 word1(static_cast<uint32_t>((init >> 32) & std::numeric_limits<uint64_t>::max())) 14239 { 14240 } 14241 CONSTEXPR void operator=(uint64_t value) 14242 { 14243 word0 = static_cast<uint32_t>((value)&std::numeric_limits<uint64_t>::max()); 14244 word1 = static_cast<uint32_t>((value >> 32) & std::numeric_limits<uint64_t>::max()); 14245 } 14246 void operator=(uint64_t value) volatile 14247 { 14248 word0 = static_cast<uint32_t>((value)&std::numeric_limits<uint64_t>::max()); 14249 word1 = static_cast<uint32_t>((value >> 32) & std::numeric_limits<uint64_t>::max()); 14250 } 14251 CONSTEXPR operator uint64_t() 14252 { 14253 return (static_cast<uint64_t>(word1) << 32) | word0; 14254 } 14255 operator uint64_t() volatile 14256 { 14257 return (static_cast<uint64_t>(word1) << 32) | word0; 14258 } 14259 scale_length_r copy() volatile 14260 { 14261 return *this; 14262 } 14263 #endif 14264 }; 14265 14266 // ofm_scale_r - None 14267 struct ofm_scale_r 14268 { 14269 #ifndef __cplusplus 14270 union 14271 { 14272 struct 14273 { 14274 uint32_t value : 32; // 32-bit register value 14275 }; 14276 uint32_t word; 14277 }; 14278 #else 14279 private: 14280 uint32_t word0; 14281 14282 public: 14283 CONSTEXPR ofm_scale_r() : word0(0) {} 14284 CONSTEXPR ofm_scale_r(uint32_t init) : word0(init) {} 14285 CONSTEXPR void operator=(uint32_t value) 14286 { 14287 word0 = value; 14288 } 14289 void operator=(uint32_t value) volatile 14290 { 14291 word0 = value; 14292 } 14293 CONSTEXPR operator uint32_t() 14294 { 14295 return word0; 14296 } 14297 operator uint32_t() volatile 14298 { 14299 return word0; 14300 } 14301 ofm_scale_r copy() volatile 14302 { 14303 return *this; 14304 } 14305 CONSTEXPR uint32_t get_value() const 14306 { 14307 uint32_t value = word0; 14308 return value; 14309 } 14310 uint32_t get_value() const volatile 14311 { 14312 uint32_t value = word0; 14313 return value; 14314 } 14315 CONSTEXPR ofm_scale_r &set_value(uint32_t value) 14316 { 14317 word0 = value; 14318 return *this; 14319 } 14320 volatile ofm_scale_r &set_value(uint32_t value) volatile 14321 { 14322 word0 = value; 14323 return *this; 14324 } 14325 #endif 14326 }; 14327 14328 // ofm_scale_shift_r - None 14329 struct ofm_scale_shift_r 14330 { 14331 #ifndef __cplusplus 14332 union 14333 { 14334 struct 14335 { 14336 uint32_t value : 32; // 32-bit register value 14337 }; 14338 uint32_t word; 14339 }; 14340 #else 14341 private: 14342 uint32_t word0; 14343 14344 public: 14345 CONSTEXPR ofm_scale_shift_r() : word0(0) {} 14346 CONSTEXPR ofm_scale_shift_r(uint32_t init) : word0(init) {} 14347 CONSTEXPR void operator=(uint32_t value) 14348 { 14349 word0 = value; 14350 } 14351 void operator=(uint32_t value) volatile 14352 { 14353 word0 = value; 14354 } 14355 CONSTEXPR operator uint32_t() 14356 { 14357 return word0; 14358 } 14359 operator uint32_t() volatile 14360 { 14361 return word0; 14362 } 14363 ofm_scale_shift_r copy() volatile 14364 { 14365 return *this; 14366 } 14367 CONSTEXPR uint32_t get_value() const 14368 { 14369 uint32_t value = word0; 14370 return value; 14371 } 14372 uint32_t get_value() const volatile 14373 { 14374 uint32_t value = word0; 14375 return value; 14376 } 14377 CONSTEXPR ofm_scale_shift_r &set_value(uint32_t value) 14378 { 14379 word0 = value; 14380 return *this; 14381 } 14382 volatile ofm_scale_shift_r &set_value(uint32_t value) volatile 14383 { 14384 word0 = value; 14385 return *this; 14386 } 14387 #endif 14388 }; 14389 14390 // opa_scale_r - None 14391 struct opa_scale_r 14392 { 14393 #ifndef __cplusplus 14394 union 14395 { 14396 struct 14397 { 14398 uint32_t value : 32; // 32-bit register value 14399 }; 14400 uint32_t word; 14401 }; 14402 #else 14403 private: 14404 uint32_t word0; 14405 14406 public: 14407 CONSTEXPR opa_scale_r() : word0(0) {} 14408 CONSTEXPR opa_scale_r(uint32_t init) : word0(init) {} 14409 CONSTEXPR void operator=(uint32_t value) 14410 { 14411 word0 = value; 14412 } 14413 void operator=(uint32_t value) volatile 14414 { 14415 word0 = value; 14416 } 14417 CONSTEXPR operator uint32_t() 14418 { 14419 return word0; 14420 } 14421 operator uint32_t() volatile 14422 { 14423 return word0; 14424 } 14425 opa_scale_r copy() volatile 14426 { 14427 return *this; 14428 } 14429 CONSTEXPR uint32_t get_value() const 14430 { 14431 uint32_t value = word0; 14432 return value; 14433 } 14434 uint32_t get_value() const volatile 14435 { 14436 uint32_t value = word0; 14437 return value; 14438 } 14439 CONSTEXPR opa_scale_r &set_value(uint32_t value) 14440 { 14441 word0 = value; 14442 return *this; 14443 } 14444 volatile opa_scale_r &set_value(uint32_t value) volatile 14445 { 14446 word0 = value; 14447 return *this; 14448 } 14449 #endif 14450 }; 14451 14452 // opa_scale_shift_r - None 14453 struct opa_scale_shift_r 14454 { 14455 #ifndef __cplusplus 14456 union 14457 { 14458 struct 14459 { 14460 uint32_t value : 32; // 32-bit register value 14461 }; 14462 uint32_t word; 14463 }; 14464 #else 14465 private: 14466 uint32_t word0; 14467 14468 public: 14469 CONSTEXPR opa_scale_shift_r() : word0(0) {} 14470 CONSTEXPR opa_scale_shift_r(uint32_t init) : word0(init) {} 14471 CONSTEXPR void operator=(uint32_t value) 14472 { 14473 word0 = value; 14474 } 14475 void operator=(uint32_t value) volatile 14476 { 14477 word0 = value; 14478 } 14479 CONSTEXPR operator uint32_t() 14480 { 14481 return word0; 14482 } 14483 operator uint32_t() volatile 14484 { 14485 return word0; 14486 } 14487 opa_scale_shift_r copy() volatile 14488 { 14489 return *this; 14490 } 14491 CONSTEXPR uint32_t get_value() const 14492 { 14493 uint32_t value = word0; 14494 return value; 14495 } 14496 uint32_t get_value() const volatile 14497 { 14498 uint32_t value = word0; 14499 return value; 14500 } 14501 CONSTEXPR opa_scale_shift_r &set_value(uint32_t value) 14502 { 14503 word0 = value; 14504 return *this; 14505 } 14506 volatile opa_scale_shift_r &set_value(uint32_t value) volatile 14507 { 14508 word0 = value; 14509 return *this; 14510 } 14511 #endif 14512 }; 14513 14514 // opb_scale_r - None 14515 struct opb_scale_r 14516 { 14517 #ifndef __cplusplus 14518 union 14519 { 14520 struct 14521 { 14522 uint32_t value : 32; // 32-bit register value 14523 }; 14524 uint32_t word; 14525 }; 14526 #else 14527 private: 14528 uint32_t word0; 14529 14530 public: 14531 CONSTEXPR opb_scale_r() : word0(0) {} 14532 CONSTEXPR opb_scale_r(uint32_t init) : word0(init) {} 14533 CONSTEXPR void operator=(uint32_t value) 14534 { 14535 word0 = value; 14536 } 14537 void operator=(uint32_t value) volatile 14538 { 14539 word0 = value; 14540 } 14541 CONSTEXPR operator uint32_t() 14542 { 14543 return word0; 14544 } 14545 operator uint32_t() volatile 14546 { 14547 return word0; 14548 } 14549 opb_scale_r copy() volatile 14550 { 14551 return *this; 14552 } 14553 CONSTEXPR uint32_t get_value() const 14554 { 14555 uint32_t value = word0; 14556 return value; 14557 } 14558 uint32_t get_value() const volatile 14559 { 14560 uint32_t value = word0; 14561 return value; 14562 } 14563 CONSTEXPR opb_scale_r &set_value(uint32_t value) 14564 { 14565 word0 = value; 14566 return *this; 14567 } 14568 volatile opb_scale_r &set_value(uint32_t value) volatile 14569 { 14570 word0 = value; 14571 return *this; 14572 } 14573 #endif 14574 }; 14575 14576 // dma0_src_r - None 14577 struct dma0_src_r 14578 { 14579 #ifndef __cplusplus 14580 union 14581 { 14582 struct 14583 { 14584 uint32_t value_LO : 32; // 64-bit register value - LSB 14585 uint32_t value_HI : 32; // 64-bit register value - MSB 14586 }; 14587 uint32_t word[2]; 14588 }; 14589 #else 14590 private: 14591 uint32_t word0; 14592 uint32_t word1; 14593 14594 public: 14595 CONSTEXPR dma0_src_r() : word0(0), word1(0) {} 14596 CONSTEXPR dma0_src_r(uint64_t init) : 14597 word0(static_cast<uint32_t>((init)&std::numeric_limits<uint64_t>::max())), 14598 word1(static_cast<uint32_t>((init >> 32) & std::numeric_limits<uint64_t>::max())) 14599 { 14600 } 14601 CONSTEXPR void operator=(uint64_t value) 14602 { 14603 word0 = static_cast<uint32_t>((value)&std::numeric_limits<uint64_t>::max()); 14604 word1 = static_cast<uint32_t>((value >> 32) & std::numeric_limits<uint64_t>::max()); 14605 } 14606 void operator=(uint64_t value) volatile 14607 { 14608 word0 = static_cast<uint32_t>((value)&std::numeric_limits<uint64_t>::max()); 14609 word1 = static_cast<uint32_t>((value >> 32) & std::numeric_limits<uint64_t>::max()); 14610 } 14611 CONSTEXPR operator uint64_t() 14612 { 14613 return (static_cast<uint64_t>(word1) << 32) | word0; 14614 } 14615 operator uint64_t() volatile 14616 { 14617 return (static_cast<uint64_t>(word1) << 32) | word0; 14618 } 14619 dma0_src_r copy() volatile 14620 { 14621 return *this; 14622 } 14623 #endif 14624 }; 14625 14626 // dma0_dst_r - None 14627 struct dma0_dst_r 14628 { 14629 #ifndef __cplusplus 14630 union 14631 { 14632 struct 14633 { 14634 uint32_t value_LO : 32; // 64-bit register value - LSB 14635 uint32_t value_HI : 32; // 64-bit register value - MSB 14636 }; 14637 uint32_t word[2]; 14638 }; 14639 #else 14640 private: 14641 uint32_t word0; 14642 uint32_t word1; 14643 14644 public: 14645 CONSTEXPR dma0_dst_r() : word0(0), word1(0) {} 14646 CONSTEXPR dma0_dst_r(uint64_t init) : 14647 word0(static_cast<uint32_t>((init)&std::numeric_limits<uint64_t>::max())), 14648 word1(static_cast<uint32_t>((init >> 32) & std::numeric_limits<uint64_t>::max())) 14649 { 14650 } 14651 CONSTEXPR void operator=(uint64_t value) 14652 { 14653 word0 = static_cast<uint32_t>((value)&std::numeric_limits<uint64_t>::max()); 14654 word1 = static_cast<uint32_t>((value >> 32) & std::numeric_limits<uint64_t>::max()); 14655 } 14656 void operator=(uint64_t value) volatile 14657 { 14658 word0 = static_cast<uint32_t>((value)&std::numeric_limits<uint64_t>::max()); 14659 word1 = static_cast<uint32_t>((value >> 32) & std::numeric_limits<uint64_t>::max()); 14660 } 14661 CONSTEXPR operator uint64_t() 14662 { 14663 return (static_cast<uint64_t>(word1) << 32) | word0; 14664 } 14665 operator uint64_t() volatile 14666 { 14667 return (static_cast<uint64_t>(word1) << 32) | word0; 14668 } 14669 dma0_dst_r copy() volatile 14670 { 14671 return *this; 14672 } 14673 #endif 14674 }; 14675 14676 // dma0_len_r - None 14677 struct dma0_len_r 14678 { 14679 #ifndef __cplusplus 14680 union 14681 { 14682 struct 14683 { 14684 uint32_t value_LO : 32; // 64-bit register value - LSB 14685 uint32_t value_HI : 32; // 64-bit register value - MSB 14686 }; 14687 uint32_t word[2]; 14688 }; 14689 #else 14690 private: 14691 uint32_t word0; 14692 uint32_t word1; 14693 14694 public: 14695 CONSTEXPR dma0_len_r() : word0(0), word1(0) {} 14696 CONSTEXPR dma0_len_r(uint64_t init) : 14697 word0(static_cast<uint32_t>((init)&std::numeric_limits<uint64_t>::max())), 14698 word1(static_cast<uint32_t>((init >> 32) & std::numeric_limits<uint64_t>::max())) 14699 { 14700 } 14701 CONSTEXPR void operator=(uint64_t value) 14702 { 14703 word0 = static_cast<uint32_t>((value)&std::numeric_limits<uint64_t>::max()); 14704 word1 = static_cast<uint32_t>((value >> 32) & std::numeric_limits<uint64_t>::max()); 14705 } 14706 void operator=(uint64_t value) volatile 14707 { 14708 word0 = static_cast<uint32_t>((value)&std::numeric_limits<uint64_t>::max()); 14709 word1 = static_cast<uint32_t>((value >> 32) & std::numeric_limits<uint64_t>::max()); 14710 } 14711 CONSTEXPR operator uint64_t() 14712 { 14713 return (static_cast<uint64_t>(word1) << 32) | word0; 14714 } 14715 operator uint64_t() volatile 14716 { 14717 return (static_cast<uint64_t>(word1) << 32) | word0; 14718 } 14719 dma0_len_r copy() volatile 14720 { 14721 return *this; 14722 } 14723 #endif 14724 }; 14725 14726 // ifm2_base0_r - None 14727 struct ifm2_base0_r 14728 { 14729 #ifndef __cplusplus 14730 union 14731 { 14732 struct 14733 { 14734 uint32_t value_LO : 32; // 64-bit register value - LSB 14735 uint32_t value_HI : 32; // 64-bit register value - MSB 14736 }; 14737 uint32_t word[2]; 14738 }; 14739 #else 14740 private: 14741 uint32_t word0; 14742 uint32_t word1; 14743 14744 public: 14745 CONSTEXPR ifm2_base0_r() : word0(0), word1(0) {} 14746 CONSTEXPR ifm2_base0_r(uint64_t init) : 14747 word0(static_cast<uint32_t>((init)&std::numeric_limits<uint64_t>::max())), 14748 word1(static_cast<uint32_t>((init >> 32) & std::numeric_limits<uint64_t>::max())) 14749 { 14750 } 14751 CONSTEXPR void operator=(uint64_t value) 14752 { 14753 word0 = static_cast<uint32_t>((value)&std::numeric_limits<uint64_t>::max()); 14754 word1 = static_cast<uint32_t>((value >> 32) & std::numeric_limits<uint64_t>::max()); 14755 } 14756 void operator=(uint64_t value) volatile 14757 { 14758 word0 = static_cast<uint32_t>((value)&std::numeric_limits<uint64_t>::max()); 14759 word1 = static_cast<uint32_t>((value >> 32) & std::numeric_limits<uint64_t>::max()); 14760 } 14761 CONSTEXPR operator uint64_t() 14762 { 14763 return (static_cast<uint64_t>(word1) << 32) | word0; 14764 } 14765 operator uint64_t() volatile 14766 { 14767 return (static_cast<uint64_t>(word1) << 32) | word0; 14768 } 14769 ifm2_base0_r copy() volatile 14770 { 14771 return *this; 14772 } 14773 #endif 14774 }; 14775 14776 // ifm2_base1_r - None 14777 struct ifm2_base1_r 14778 { 14779 #ifndef __cplusplus 14780 union 14781 { 14782 struct 14783 { 14784 uint32_t value_LO : 32; // 64-bit register value - LSB 14785 uint32_t value_HI : 32; // 64-bit register value - MSB 14786 }; 14787 uint32_t word[2]; 14788 }; 14789 #else 14790 private: 14791 uint32_t word0; 14792 uint32_t word1; 14793 14794 public: 14795 CONSTEXPR ifm2_base1_r() : word0(0), word1(0) {} 14796 CONSTEXPR ifm2_base1_r(uint64_t init) : 14797 word0(static_cast<uint32_t>((init)&std::numeric_limits<uint64_t>::max())), 14798 word1(static_cast<uint32_t>((init >> 32) & std::numeric_limits<uint64_t>::max())) 14799 { 14800 } 14801 CONSTEXPR void operator=(uint64_t value) 14802 { 14803 word0 = static_cast<uint32_t>((value)&std::numeric_limits<uint64_t>::max()); 14804 word1 = static_cast<uint32_t>((value >> 32) & std::numeric_limits<uint64_t>::max()); 14805 } 14806 void operator=(uint64_t value) volatile 14807 { 14808 word0 = static_cast<uint32_t>((value)&std::numeric_limits<uint64_t>::max()); 14809 word1 = static_cast<uint32_t>((value >> 32) & std::numeric_limits<uint64_t>::max()); 14810 } 14811 CONSTEXPR operator uint64_t() 14812 { 14813 return (static_cast<uint64_t>(word1) << 32) | word0; 14814 } 14815 operator uint64_t() volatile 14816 { 14817 return (static_cast<uint64_t>(word1) << 32) | word0; 14818 } 14819 ifm2_base1_r copy() volatile 14820 { 14821 return *this; 14822 } 14823 #endif 14824 }; 14825 14826 // ifm2_base2_r - None 14827 struct ifm2_base2_r 14828 { 14829 #ifndef __cplusplus 14830 union 14831 { 14832 struct 14833 { 14834 uint32_t value_LO : 32; // 64-bit register value - LSB 14835 uint32_t value_HI : 32; // 64-bit register value - MSB 14836 }; 14837 uint32_t word[2]; 14838 }; 14839 #else 14840 private: 14841 uint32_t word0; 14842 uint32_t word1; 14843 14844 public: 14845 CONSTEXPR ifm2_base2_r() : word0(0), word1(0) {} 14846 CONSTEXPR ifm2_base2_r(uint64_t init) : 14847 word0(static_cast<uint32_t>((init)&std::numeric_limits<uint64_t>::max())), 14848 word1(static_cast<uint32_t>((init >> 32) & std::numeric_limits<uint64_t>::max())) 14849 { 14850 } 14851 CONSTEXPR void operator=(uint64_t value) 14852 { 14853 word0 = static_cast<uint32_t>((value)&std::numeric_limits<uint64_t>::max()); 14854 word1 = static_cast<uint32_t>((value >> 32) & std::numeric_limits<uint64_t>::max()); 14855 } 14856 void operator=(uint64_t value) volatile 14857 { 14858 word0 = static_cast<uint32_t>((value)&std::numeric_limits<uint64_t>::max()); 14859 word1 = static_cast<uint32_t>((value >> 32) & std::numeric_limits<uint64_t>::max()); 14860 } 14861 CONSTEXPR operator uint64_t() 14862 { 14863 return (static_cast<uint64_t>(word1) << 32) | word0; 14864 } 14865 operator uint64_t() volatile 14866 { 14867 return (static_cast<uint64_t>(word1) << 32) | word0; 14868 } 14869 ifm2_base2_r copy() volatile 14870 { 14871 return *this; 14872 } 14873 #endif 14874 }; 14875 14876 // ifm2_base3_r - None 14877 struct ifm2_base3_r 14878 { 14879 #ifndef __cplusplus 14880 union 14881 { 14882 struct 14883 { 14884 uint32_t value_LO : 32; // 64-bit register value - LSB 14885 uint32_t value_HI : 32; // 64-bit register value - MSB 14886 }; 14887 uint32_t word[2]; 14888 }; 14889 #else 14890 private: 14891 uint32_t word0; 14892 uint32_t word1; 14893 14894 public: 14895 CONSTEXPR ifm2_base3_r() : word0(0), word1(0) {} 14896 CONSTEXPR ifm2_base3_r(uint64_t init) : 14897 word0(static_cast<uint32_t>((init)&std::numeric_limits<uint64_t>::max())), 14898 word1(static_cast<uint32_t>((init >> 32) & std::numeric_limits<uint64_t>::max())) 14899 { 14900 } 14901 CONSTEXPR void operator=(uint64_t value) 14902 { 14903 word0 = static_cast<uint32_t>((value)&std::numeric_limits<uint64_t>::max()); 14904 word1 = static_cast<uint32_t>((value >> 32) & std::numeric_limits<uint64_t>::max()); 14905 } 14906 void operator=(uint64_t value) volatile 14907 { 14908 word0 = static_cast<uint32_t>((value)&std::numeric_limits<uint64_t>::max()); 14909 word1 = static_cast<uint32_t>((value >> 32) & std::numeric_limits<uint64_t>::max()); 14910 } 14911 CONSTEXPR operator uint64_t() 14912 { 14913 return (static_cast<uint64_t>(word1) << 32) | word0; 14914 } 14915 operator uint64_t() volatile 14916 { 14917 return (static_cast<uint64_t>(word1) << 32) | word0; 14918 } 14919 ifm2_base3_r copy() volatile 14920 { 14921 return *this; 14922 } 14923 #endif 14924 }; 14925 14926 // ifm2_stride_x_r - None 14927 struct ifm2_stride_x_r 14928 { 14929 #ifndef __cplusplus 14930 union 14931 { 14932 struct 14933 { 14934 uint32_t value_LO : 32; // 64-bit register value - LSB 14935 uint32_t value_HI : 32; // 64-bit register value - MSB 14936 }; 14937 uint32_t word[2]; 14938 }; 14939 #else 14940 private: 14941 uint32_t word0; 14942 uint32_t word1; 14943 14944 public: 14945 CONSTEXPR ifm2_stride_x_r() : word0(0), word1(0) {} 14946 CONSTEXPR ifm2_stride_x_r(uint64_t init) : 14947 word0(static_cast<uint32_t>((init)&std::numeric_limits<uint64_t>::max())), 14948 word1(static_cast<uint32_t>((init >> 32) & std::numeric_limits<uint64_t>::max())) 14949 { 14950 } 14951 CONSTEXPR void operator=(uint64_t value) 14952 { 14953 word0 = static_cast<uint32_t>((value)&std::numeric_limits<uint64_t>::max()); 14954 word1 = static_cast<uint32_t>((value >> 32) & std::numeric_limits<uint64_t>::max()); 14955 } 14956 void operator=(uint64_t value) volatile 14957 { 14958 word0 = static_cast<uint32_t>((value)&std::numeric_limits<uint64_t>::max()); 14959 word1 = static_cast<uint32_t>((value >> 32) & std::numeric_limits<uint64_t>::max()); 14960 } 14961 CONSTEXPR operator uint64_t() 14962 { 14963 return (static_cast<uint64_t>(word1) << 32) | word0; 14964 } 14965 operator uint64_t() volatile 14966 { 14967 return (static_cast<uint64_t>(word1) << 32) | word0; 14968 } 14969 ifm2_stride_x_r copy() volatile 14970 { 14971 return *this; 14972 } 14973 #endif 14974 }; 14975 14976 // ifm2_stride_y_r - None 14977 struct ifm2_stride_y_r 14978 { 14979 #ifndef __cplusplus 14980 union 14981 { 14982 struct 14983 { 14984 uint32_t value_LO : 32; // 64-bit register value - LSB 14985 uint32_t value_HI : 32; // 64-bit register value - MSB 14986 }; 14987 uint32_t word[2]; 14988 }; 14989 #else 14990 private: 14991 uint32_t word0; 14992 uint32_t word1; 14993 14994 public: 14995 CONSTEXPR ifm2_stride_y_r() : word0(0), word1(0) {} 14996 CONSTEXPR ifm2_stride_y_r(uint64_t init) : 14997 word0(static_cast<uint32_t>((init)&std::numeric_limits<uint64_t>::max())), 14998 word1(static_cast<uint32_t>((init >> 32) & std::numeric_limits<uint64_t>::max())) 14999 { 15000 } 15001 CONSTEXPR void operator=(uint64_t value) 15002 { 15003 word0 = static_cast<uint32_t>((value)&std::numeric_limits<uint64_t>::max()); 15004 word1 = static_cast<uint32_t>((value >> 32) & std::numeric_limits<uint64_t>::max()); 15005 } 15006 void operator=(uint64_t value) volatile 15007 { 15008 word0 = static_cast<uint32_t>((value)&std::numeric_limits<uint64_t>::max()); 15009 word1 = static_cast<uint32_t>((value >> 32) & std::numeric_limits<uint64_t>::max()); 15010 } 15011 CONSTEXPR operator uint64_t() 15012 { 15013 return (static_cast<uint64_t>(word1) << 32) | word0; 15014 } 15015 operator uint64_t() volatile 15016 { 15017 return (static_cast<uint64_t>(word1) << 32) | word0; 15018 } 15019 ifm2_stride_y_r copy() volatile 15020 { 15021 return *this; 15022 } 15023 #endif 15024 }; 15025 15026 // ifm2_stride_c_r - None 15027 struct ifm2_stride_c_r 15028 { 15029 #ifndef __cplusplus 15030 union 15031 { 15032 struct 15033 { 15034 uint32_t value_LO : 32; // 64-bit register value - LSB 15035 uint32_t value_HI : 32; // 64-bit register value - MSB 15036 }; 15037 uint32_t word[2]; 15038 }; 15039 #else 15040 private: 15041 uint32_t word0; 15042 uint32_t word1; 15043 15044 public: 15045 CONSTEXPR ifm2_stride_c_r() : word0(0), word1(0) {} 15046 CONSTEXPR ifm2_stride_c_r(uint64_t init) : 15047 word0(static_cast<uint32_t>((init)&std::numeric_limits<uint64_t>::max())), 15048 word1(static_cast<uint32_t>((init >> 32) & std::numeric_limits<uint64_t>::max())) 15049 { 15050 } 15051 CONSTEXPR void operator=(uint64_t value) 15052 { 15053 word0 = static_cast<uint32_t>((value)&std::numeric_limits<uint64_t>::max()); 15054 word1 = static_cast<uint32_t>((value >> 32) & std::numeric_limits<uint64_t>::max()); 15055 } 15056 void operator=(uint64_t value) volatile 15057 { 15058 word0 = static_cast<uint32_t>((value)&std::numeric_limits<uint64_t>::max()); 15059 word1 = static_cast<uint32_t>((value >> 32) & std::numeric_limits<uint64_t>::max()); 15060 } 15061 CONSTEXPR operator uint64_t() 15062 { 15063 return (static_cast<uint64_t>(word1) << 32) | word0; 15064 } 15065 operator uint64_t() volatile 15066 { 15067 return (static_cast<uint64_t>(word1) << 32) | word0; 15068 } 15069 ifm2_stride_c_r copy() volatile 15070 { 15071 return *this; 15072 } 15073 #endif 15074 }; 15075 15076 // revision_r - Internal FPGA build revision: first 32-bits of the Ultan Git hash used for the build 15077 struct revision_r 15078 { 15079 #ifndef __cplusplus 15080 union 15081 { 15082 struct 15083 { 15084 uint32_t value : 32; // 32-bit register value 15085 }; 15086 uint32_t word; 15087 }; 15088 #else 15089 private: 15090 uint32_t word0; 15091 15092 public: 15093 CONSTEXPR revision_r() : word0(0) {} 15094 CONSTEXPR revision_r(uint32_t init) : word0(init) {} 15095 CONSTEXPR void operator=(uint32_t value) 15096 { 15097 word0 = value; 15098 } 15099 void operator=(uint32_t value) volatile 15100 { 15101 word0 = value; 15102 } 15103 CONSTEXPR operator uint32_t() 15104 { 15105 return word0; 15106 } 15107 operator uint32_t() volatile 15108 { 15109 return word0; 15110 } 15111 revision_r copy() volatile 15112 { 15113 return *this; 15114 } 15115 CONSTEXPR uint32_t get_value() const 15116 { 15117 uint32_t value = word0; 15118 return value; 15119 } 15120 uint32_t get_value() const volatile 15121 { 15122 uint32_t value = word0; 15123 return value; 15124 } 15125 CONSTEXPR revision_r &set_value(uint32_t value) 15126 { 15127 word0 = value; 15128 return *this; 15129 } 15130 volatile revision_r &set_value(uint32_t value) volatile 15131 { 15132 word0 = value; 15133 return *this; 15134 } 15135 #endif 15136 }; 15137 15138 // pid4_r - Peripheral ID byte 4 (Arm=code 4) 15139 struct pid4_r 15140 { 15141 #ifndef __cplusplus 15142 union 15143 { 15144 struct 15145 { 15146 uint32_t PID4 : 32; // Byte 4 of Peripheral ID (Lower 8 bits valid) 15147 }; 15148 uint32_t word; 15149 }; 15150 #else 15151 private: 15152 uint32_t word0; 15153 15154 public: 15155 CONSTEXPR pid4_r() : word0(4) {} 15156 CONSTEXPR pid4_r(uint32_t init) : word0(init) {} 15157 CONSTEXPR void operator=(uint32_t value) 15158 { 15159 word0 = value; 15160 } 15161 void operator=(uint32_t value) volatile 15162 { 15163 word0 = value; 15164 } 15165 CONSTEXPR operator uint32_t() 15166 { 15167 return word0; 15168 } 15169 operator uint32_t() volatile 15170 { 15171 return word0; 15172 } 15173 pid4_r copy() volatile 15174 { 15175 return *this; 15176 } 15177 CONSTEXPR uint32_t get_PID4() const 15178 { 15179 uint32_t value = word0; 15180 return value; 15181 } 15182 uint32_t get_PID4() const volatile 15183 { 15184 uint32_t value = word0; 15185 return value; 15186 } 15187 CONSTEXPR pid4_r &set_PID4(uint32_t value) 15188 { 15189 word0 = value; 15190 return *this; 15191 } 15192 volatile pid4_r &set_PID4(uint32_t value) volatile 15193 { 15194 word0 = value; 15195 return *this; 15196 } 15197 #endif 15198 }; 15199 15200 // pid5_r - Peripheral ID byte 5 (reserved) 15201 struct pid5_r 15202 { 15203 #ifndef __cplusplus 15204 union 15205 { 15206 struct 15207 { 15208 uint32_t PID5 : 32; // Byte 5 of Peripheral ID (Lower 8 bits valid) 15209 }; 15210 uint32_t word; 15211 }; 15212 #else 15213 private: 15214 uint32_t word0; 15215 15216 public: 15217 CONSTEXPR pid5_r() : word0(0) {} 15218 CONSTEXPR pid5_r(uint32_t init) : word0(init) {} 15219 CONSTEXPR void operator=(uint32_t value) 15220 { 15221 word0 = value; 15222 } 15223 void operator=(uint32_t value) volatile 15224 { 15225 word0 = value; 15226 } 15227 CONSTEXPR operator uint32_t() 15228 { 15229 return word0; 15230 } 15231 operator uint32_t() volatile 15232 { 15233 return word0; 15234 } 15235 pid5_r copy() volatile 15236 { 15237 return *this; 15238 } 15239 CONSTEXPR uint32_t get_PID5() const 15240 { 15241 uint32_t value = word0; 15242 return value; 15243 } 15244 uint32_t get_PID5() const volatile 15245 { 15246 uint32_t value = word0; 15247 return value; 15248 } 15249 CONSTEXPR pid5_r &set_PID5(uint32_t value) 15250 { 15251 word0 = value; 15252 return *this; 15253 } 15254 volatile pid5_r &set_PID5(uint32_t value) volatile 15255 { 15256 word0 = value; 15257 return *this; 15258 } 15259 #endif 15260 }; 15261 15262 // pid6_r - Peripheral ID byte 6 (reserved) 15263 struct pid6_r 15264 { 15265 #ifndef __cplusplus 15266 union 15267 { 15268 struct 15269 { 15270 uint32_t PID6 : 32; // Byte 6 of Peripheral ID (Lower 8 bits valid) 15271 }; 15272 uint32_t word; 15273 }; 15274 #else 15275 private: 15276 uint32_t word0; 15277 15278 public: 15279 CONSTEXPR pid6_r() : word0(0) {} 15280 CONSTEXPR pid6_r(uint32_t init) : word0(init) {} 15281 CONSTEXPR void operator=(uint32_t value) 15282 { 15283 word0 = value; 15284 } 15285 void operator=(uint32_t value) volatile 15286 { 15287 word0 = value; 15288 } 15289 CONSTEXPR operator uint32_t() 15290 { 15291 return word0; 15292 } 15293 operator uint32_t() volatile 15294 { 15295 return word0; 15296 } 15297 pid6_r copy() volatile 15298 { 15299 return *this; 15300 } 15301 CONSTEXPR uint32_t get_PID6() const 15302 { 15303 uint32_t value = word0; 15304 return value; 15305 } 15306 uint32_t get_PID6() const volatile 15307 { 15308 uint32_t value = word0; 15309 return value; 15310 } 15311 CONSTEXPR pid6_r &set_PID6(uint32_t value) 15312 { 15313 word0 = value; 15314 return *this; 15315 } 15316 volatile pid6_r &set_PID6(uint32_t value) volatile 15317 { 15318 word0 = value; 15319 return *this; 15320 } 15321 #endif 15322 }; 15323 15324 // pid7_r - Peripheral ID byte 7 (reserved) 15325 struct pid7_r 15326 { 15327 #ifndef __cplusplus 15328 union 15329 { 15330 struct 15331 { 15332 uint32_t PID7 : 32; // Byte 7 of Peripheral ID (Lower 8 bits valid) 15333 }; 15334 uint32_t word; 15335 }; 15336 #else 15337 private: 15338 uint32_t word0; 15339 15340 public: 15341 CONSTEXPR pid7_r() : word0(0) {} 15342 CONSTEXPR pid7_r(uint32_t init) : word0(init) {} 15343 CONSTEXPR void operator=(uint32_t value) 15344 { 15345 word0 = value; 15346 } 15347 void operator=(uint32_t value) volatile 15348 { 15349 word0 = value; 15350 } 15351 CONSTEXPR operator uint32_t() 15352 { 15353 return word0; 15354 } 15355 operator uint32_t() volatile 15356 { 15357 return word0; 15358 } 15359 pid7_r copy() volatile 15360 { 15361 return *this; 15362 } 15363 CONSTEXPR uint32_t get_PID7() const 15364 { 15365 uint32_t value = word0; 15366 return value; 15367 } 15368 uint32_t get_PID7() const volatile 15369 { 15370 uint32_t value = word0; 15371 return value; 15372 } 15373 CONSTEXPR pid7_r &set_PID7(uint32_t value) 15374 { 15375 word0 = value; 15376 return *this; 15377 } 15378 volatile pid7_r &set_PID7(uint32_t value) volatile 15379 { 15380 word0 = value; 15381 return *this; 15382 } 15383 #endif 15384 }; 15385 15386 // pid0_r - Peripheral ID byte 0. This is bits[7:0] of the part number 15387 struct pid0_r 15388 { 15389 #ifndef __cplusplus 15390 union 15391 { 15392 struct 15393 { 15394 uint32_t PID0 : 32; // Byte 0 of Peripheral ID (Lower 8 bits valid) 15395 }; 15396 uint32_t word; 15397 }; 15398 #else 15399 private: 15400 uint32_t word0; 15401 15402 public: 15403 CONSTEXPR pid0_r() : word0(128) {} 15404 CONSTEXPR pid0_r(uint32_t init) : word0(init) {} 15405 CONSTEXPR void operator=(uint32_t value) 15406 { 15407 word0 = value; 15408 } 15409 void operator=(uint32_t value) volatile 15410 { 15411 word0 = value; 15412 } 15413 CONSTEXPR operator uint32_t() 15414 { 15415 return word0; 15416 } 15417 operator uint32_t() volatile 15418 { 15419 return word0; 15420 } 15421 pid0_r copy() volatile 15422 { 15423 return *this; 15424 } 15425 CONSTEXPR uint32_t get_PID0() const 15426 { 15427 uint32_t value = word0; 15428 return value; 15429 } 15430 uint32_t get_PID0() const volatile 15431 { 15432 uint32_t value = word0; 15433 return value; 15434 } 15435 CONSTEXPR pid0_r &set_PID0(uint32_t value) 15436 { 15437 word0 = value; 15438 return *this; 15439 } 15440 volatile pid0_r &set_PID0(uint32_t value) volatile 15441 { 15442 word0 = value; 15443 return *this; 15444 } 15445 #endif 15446 }; 15447 15448 // 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 15449 // bits[7:4] 15450 struct pid1_r 15451 { 15452 #ifndef __cplusplus 15453 union 15454 { 15455 struct 15456 { 15457 uint32_t PID1 : 32; // Byte 1 of Peripheral ID (Lower 8 bits valid) 15458 }; 15459 uint32_t word; 15460 }; 15461 #else 15462 private: 15463 uint32_t word0; 15464 15465 public: 15466 CONSTEXPR pid1_r() : word0(181) {} 15467 CONSTEXPR pid1_r(uint32_t init) : word0(init) {} 15468 CONSTEXPR void operator=(uint32_t value) 15469 { 15470 word0 = value; 15471 } 15472 void operator=(uint32_t value) volatile 15473 { 15474 word0 = value; 15475 } 15476 CONSTEXPR operator uint32_t() 15477 { 15478 return word0; 15479 } 15480 operator uint32_t() volatile 15481 { 15482 return word0; 15483 } 15484 pid1_r copy() volatile 15485 { 15486 return *this; 15487 } 15488 CONSTEXPR uint32_t get_PID1() const 15489 { 15490 uint32_t value = word0; 15491 return value; 15492 } 15493 uint32_t get_PID1() const volatile 15494 { 15495 uint32_t value = word0; 15496 return value; 15497 } 15498 CONSTEXPR pid1_r &set_PID1(uint32_t value) 15499 { 15500 word0 = value; 15501 return *this; 15502 } 15503 volatile pid1_r &set_PID1(uint32_t value) volatile 15504 { 15505 word0 = value; 15506 return *this; 15507 } 15508 #endif 15509 }; 15510 15511 // 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 15512 struct pid2_r 15513 { 15514 #ifndef __cplusplus 15515 union 15516 { 15517 struct 15518 { 15519 uint32_t PID2 : 32; // Byte 2 of Peripheral ID (Lower 8 bits valid) 15520 }; 15521 uint32_t word; 15522 }; 15523 #else 15524 private: 15525 uint32_t word0; 15526 15527 public: 15528 CONSTEXPR pid2_r() : word0(11) {} 15529 CONSTEXPR pid2_r(uint32_t init) : word0(init) {} 15530 CONSTEXPR void operator=(uint32_t value) 15531 { 15532 word0 = value; 15533 } 15534 void operator=(uint32_t value) volatile 15535 { 15536 word0 = value; 15537 } 15538 CONSTEXPR operator uint32_t() 15539 { 15540 return word0; 15541 } 15542 operator uint32_t() volatile 15543 { 15544 return word0; 15545 } 15546 pid2_r copy() volatile 15547 { 15548 return *this; 15549 } 15550 CONSTEXPR uint32_t get_PID2() const 15551 { 15552 uint32_t value = word0; 15553 return value; 15554 } 15555 uint32_t get_PID2() const volatile 15556 { 15557 uint32_t value = word0; 15558 return value; 15559 } 15560 CONSTEXPR pid2_r &set_PID2(uint32_t value) 15561 { 15562 word0 = value; 15563 return *this; 15564 } 15565 volatile pid2_r &set_PID2(uint32_t value) volatile 15566 { 15567 word0 = value; 15568 return *this; 15569 } 15570 #endif 15571 }; 15572 15573 // pid3_r - Peripheral ID byte 3 15574 struct pid3_r 15575 { 15576 #ifndef __cplusplus 15577 union 15578 { 15579 struct 15580 { 15581 uint32_t PID3 : 32; // Byte 1 of Peripheral ID (Lower 8 bits valid) 15582 }; 15583 uint32_t word; 15584 }; 15585 #else 15586 private: 15587 uint32_t word0; 15588 15589 public: 15590 CONSTEXPR pid3_r() : word0(0) {} 15591 CONSTEXPR pid3_r(uint32_t init) : word0(init) {} 15592 CONSTEXPR void operator=(uint32_t value) 15593 { 15594 word0 = value; 15595 } 15596 void operator=(uint32_t value) volatile 15597 { 15598 word0 = value; 15599 } 15600 CONSTEXPR operator uint32_t() 15601 { 15602 return word0; 15603 } 15604 operator uint32_t() volatile 15605 { 15606 return word0; 15607 } 15608 pid3_r copy() volatile 15609 { 15610 return *this; 15611 } 15612 CONSTEXPR uint32_t get_PID3() const 15613 { 15614 uint32_t value = word0; 15615 return value; 15616 } 15617 uint32_t get_PID3() const volatile 15618 { 15619 uint32_t value = word0; 15620 return value; 15621 } 15622 CONSTEXPR pid3_r &set_PID3(uint32_t value) 15623 { 15624 word0 = value; 15625 return *this; 15626 } 15627 volatile pid3_r &set_PID3(uint32_t value) volatile 15628 { 15629 word0 = value; 15630 return *this; 15631 } 15632 #endif 15633 }; 15634 15635 // cid0_r - Component ID byte 0 15636 struct cid0_r 15637 { 15638 #ifndef __cplusplus 15639 union 15640 { 15641 struct 15642 { 15643 uint32_t CID0 : 32; // Byte 0 of Component ID (Lower 8 bits valid) 15644 }; 15645 uint32_t word; 15646 }; 15647 #else 15648 private: 15649 uint32_t word0; 15650 15651 public: 15652 CONSTEXPR cid0_r() : word0(13) {} 15653 CONSTEXPR cid0_r(uint32_t init) : word0(init) {} 15654 CONSTEXPR void operator=(uint32_t value) 15655 { 15656 word0 = value; 15657 } 15658 void operator=(uint32_t value) volatile 15659 { 15660 word0 = value; 15661 } 15662 CONSTEXPR operator uint32_t() 15663 { 15664 return word0; 15665 } 15666 operator uint32_t() volatile 15667 { 15668 return word0; 15669 } 15670 cid0_r copy() volatile 15671 { 15672 return *this; 15673 } 15674 CONSTEXPR uint32_t get_CID0() const 15675 { 15676 uint32_t value = word0; 15677 return value; 15678 } 15679 uint32_t get_CID0() const volatile 15680 { 15681 uint32_t value = word0; 15682 return value; 15683 } 15684 CONSTEXPR cid0_r &set_CID0(uint32_t value) 15685 { 15686 word0 = value; 15687 return *this; 15688 } 15689 volatile cid0_r &set_CID0(uint32_t value) volatile 15690 { 15691 word0 = value; 15692 return *this; 15693 } 15694 #endif 15695 }; 15696 15697 // cid1_r - Component ID byte 1 15698 struct cid1_r 15699 { 15700 #ifndef __cplusplus 15701 union 15702 { 15703 struct 15704 { 15705 uint32_t CID1 : 32; // Byte 1 of Component ID (Lower 8 bits valid) 15706 }; 15707 uint32_t word; 15708 }; 15709 #else 15710 private: 15711 uint32_t word0; 15712 15713 public: 15714 CONSTEXPR cid1_r() : word0(240) {} 15715 CONSTEXPR cid1_r(uint32_t init) : word0(init) {} 15716 CONSTEXPR void operator=(uint32_t value) 15717 { 15718 word0 = value; 15719 } 15720 void operator=(uint32_t value) volatile 15721 { 15722 word0 = value; 15723 } 15724 CONSTEXPR operator uint32_t() 15725 { 15726 return word0; 15727 } 15728 operator uint32_t() volatile 15729 { 15730 return word0; 15731 } 15732 cid1_r copy() volatile 15733 { 15734 return *this; 15735 } 15736 CONSTEXPR uint32_t get_CID1() const 15737 { 15738 uint32_t value = word0; 15739 return value; 15740 } 15741 uint32_t get_CID1() const volatile 15742 { 15743 uint32_t value = word0; 15744 return value; 15745 } 15746 CONSTEXPR cid1_r &set_CID1(uint32_t value) 15747 { 15748 word0 = value; 15749 return *this; 15750 } 15751 volatile cid1_r &set_CID1(uint32_t value) volatile 15752 { 15753 word0 = value; 15754 return *this; 15755 } 15756 #endif 15757 }; 15758 15759 // cid2_r - Component ID byte 2 15760 struct cid2_r 15761 { 15762 #ifndef __cplusplus 15763 union 15764 { 15765 struct 15766 { 15767 uint32_t CID2 : 32; // Byte 2 of Component ID (Lower 8 bits valid) 15768 }; 15769 uint32_t word; 15770 }; 15771 #else 15772 private: 15773 uint32_t word0; 15774 15775 public: 15776 CONSTEXPR cid2_r() : word0(5) {} 15777 CONSTEXPR cid2_r(uint32_t init) : word0(init) {} 15778 CONSTEXPR void operator=(uint32_t value) 15779 { 15780 word0 = value; 15781 } 15782 void operator=(uint32_t value) volatile 15783 { 15784 word0 = value; 15785 } 15786 CONSTEXPR operator uint32_t() 15787 { 15788 return word0; 15789 } 15790 operator uint32_t() volatile 15791 { 15792 return word0; 15793 } 15794 cid2_r copy() volatile 15795 { 15796 return *this; 15797 } 15798 CONSTEXPR uint32_t get_CID2() const 15799 { 15800 uint32_t value = word0; 15801 return value; 15802 } 15803 uint32_t get_CID2() const volatile 15804 { 15805 uint32_t value = word0; 15806 return value; 15807 } 15808 CONSTEXPR cid2_r &set_CID2(uint32_t value) 15809 { 15810 word0 = value; 15811 return *this; 15812 } 15813 volatile cid2_r &set_CID2(uint32_t value) volatile 15814 { 15815 word0 = value; 15816 return *this; 15817 } 15818 #endif 15819 }; 15820 15821 // cid3_r - Component ID byte 3 15822 struct cid3_r 15823 { 15824 #ifndef __cplusplus 15825 union 15826 { 15827 struct 15828 { 15829 uint32_t CID3 : 32; // Byte 3 of Component ID (Lower 8 bits valid) 15830 }; 15831 uint32_t word; 15832 }; 15833 #else 15834 private: 15835 uint32_t word0; 15836 15837 public: 15838 CONSTEXPR cid3_r() : word0(177) {} 15839 CONSTEXPR cid3_r(uint32_t init) : word0(init) {} 15840 CONSTEXPR void operator=(uint32_t value) 15841 { 15842 word0 = value; 15843 } 15844 void operator=(uint32_t value) volatile 15845 { 15846 word0 = value; 15847 } 15848 CONSTEXPR operator uint32_t() 15849 { 15850 return word0; 15851 } 15852 operator uint32_t() volatile 15853 { 15854 return word0; 15855 } 15856 cid3_r copy() volatile 15857 { 15858 return *this; 15859 } 15860 CONSTEXPR uint32_t get_CID3() const 15861 { 15862 uint32_t value = word0; 15863 return value; 15864 } 15865 uint32_t get_CID3() const volatile 15866 { 15867 uint32_t value = word0; 15868 return value; 15869 } 15870 CONSTEXPR cid3_r &set_CID3(uint32_t value) 15871 { 15872 word0 = value; 15873 return *this; 15874 } 15875 volatile cid3_r &set_CID3(uint32_t value) volatile 15876 { 15877 word0 = value; 15878 return *this; 15879 } 15880 #endif 15881 }; 15882 15883 struct NPU_REG 15884 { 15885 STRUCT id_r ID; // 0x0000 15886 STRUCT status_r STATUS; // 0x0004 15887 STRUCT cmd_r CMD; // 0x0008 15888 STRUCT reset_r RESET; // 0x000C 15889 STRUCT qbase_r QBASE; // 0x0010 15890 STRUCT qread_r QREAD; // 0x0018 15891 STRUCT qconfig_r QCONFIG; // 0x001C 15892 STRUCT qsize_r QSIZE; // 0x0020 15893 STRUCT prot_r PROT; // 0x0024 15894 STRUCT config_r CONFIG; // 0x0028 15895 STRUCT lock_r LOCK; // 0x002C 15896 uint32_t unused0[3]; 15897 STRUCT regioncfg_r REGIONCFG; // 0x003C 15898 STRUCT axi_limit0_r AXI_LIMIT0; // 0x0040 15899 STRUCT axi_limit1_r AXI_LIMIT1; // 0x0044 15900 STRUCT axi_limit2_r AXI_LIMIT2; // 0x0048 15901 STRUCT axi_limit3_r AXI_LIMIT3; // 0x004C 15902 uint32_t unused1[12]; 15903 STRUCT basep_r BASEP[8]; // 0x0080 15904 uint32_t unused2[16]; 15905 STRUCT wd_status_r WD_STATUS; // 0x0100 15906 STRUCT mac_status_r MAC_STATUS; // 0x0104 15907 STRUCT ao_status_r AO_STATUS; // 0x0108 15908 uint32_t unused3[1]; 15909 STRUCT dma_status0_r DMA_STATUS0; // 0x0110 15910 STRUCT dma_status1_r DMA_STATUS1; // 0x0114 15911 uint32_t unused4[10]; 15912 STRUCT clkforce_r CLKFORCE; // 0x0140 15913 STRUCT debug_address_r DEBUG_ADDRESS; // 0x0144 15914 STRUCT debug_misc_r DEBUG_MISC; // 0x0148 15915 uint32_t unused5[1]; 15916 STRUCT debug_block_r DEBUG_BLOCK; // 0x0150 15917 uint32_t unused6[11]; 15918 STRUCT pmcr_r PMCR; // 0x0180 15919 STRUCT pmcntenset_r PMCNTENSET; // 0x0184 15920 STRUCT pmcntenclr_r PMCNTENCLR; // 0x0188 15921 STRUCT pmovsset_r PMOVSSET; // 0x018C 15922 STRUCT pmovsclr_r PMOVSCLR; // 0x0190 15923 STRUCT pmintset_r PMINTSET; // 0x0194 15924 STRUCT pmintclr_r PMINTCLR; // 0x0198 15925 uint32_t unused7[1]; 15926 STRUCT pmccntr_r PMCCNTR; // 0x01A0 15927 STRUCT pmccntr_cfg_r PMCCNTR_CFG; // 0x01A8 15928 STRUCT pmcaxi_chan_r PMCAXI_CHAN; // 0x01AC 15929 uint32_t unused8[20]; 15930 STRUCT kernel_x_r KERNEL_X; // 0x0200 15931 STRUCT kernel_y_r KERNEL_Y; // 0x0204 15932 STRUCT kernel_w_m1_r KERNEL_W_M1; // 0x0208 15933 STRUCT kernel_h_m1_r KERNEL_H_M1; // 0x020C 15934 STRUCT ofm_cblk_width_m1_r OFM_CBLK_WIDTH_M1; // 0x0210 15935 STRUCT ofm_cblk_height_m1_r OFM_CBLK_HEIGHT_M1; // 0x0214 15936 STRUCT ofm_cblk_depth_m1_r OFM_CBLK_DEPTH_M1; // 0x0218 15937 STRUCT ifm_cblk_depth_m1_r IFM_CBLK_DEPTH_M1; // 0x021C 15938 STRUCT ofm_x_r OFM_X; // 0x0220 15939 STRUCT ofm_y_r OFM_Y; // 0x0224 15940 STRUCT ofm_z_r OFM_Z; // 0x0228 15941 STRUCT ifm_z_r IFM_Z; // 0x022C 15942 STRUCT pad_top_r PAD_TOP; // 0x0230 15943 STRUCT pad_left_r PAD_LEFT; // 0x0234 15944 STRUCT ifm_cblk_width_r IFM_CBLK_WIDTH; // 0x0238 15945 STRUCT ifm_cblk_height_r IFM_CBLK_HEIGHT; // 0x023C 15946 STRUCT dma_ifm_src_r DMA_IFM_SRC; // 0x0240 15947 STRUCT dma_ifm_dst_r DMA_IFM_DST; // 0x0248 15948 STRUCT dma_ofm_src_r DMA_OFM_SRC; // 0x024C 15949 STRUCT dma_ofm_dst_r DMA_OFM_DST; // 0x0250 15950 STRUCT dma_weight_src_r DMA_WEIGHT_SRC; // 0x0258 15951 STRUCT dma_cmd_src_r DMA_CMD_SRC; // 0x0260 15952 STRUCT dma_cmd_size_r DMA_CMD_SIZE; // 0x0268 15953 STRUCT dma_m2m_src_r DMA_M2M_SRC; // 0x026C 15954 STRUCT dma_m2m_dst_r DMA_M2M_DST; // 0x0274 15955 STRUCT current_qread_r CURRENT_QREAD; // 0x027C 15956 STRUCT dma_scale_src_r DMA_SCALE_SRC; // 0x0280 15957 uint32_t unused9[11]; 15958 STRUCT current_block_r CURRENT_BLOCK; // 0x02B4 15959 STRUCT current_op_r CURRENT_OP; // 0x02B8 15960 STRUCT current_cmd_r CURRENT_CMD; // 0x02BC 15961 uint32_t unused10[16]; 15962 STRUCT pmevcntr_r PMEVCNTR[4]; // 0x0300 15963 uint32_t unused11[28]; 15964 STRUCT pmevtyper_r PMEVTYPER[4]; // 0x0380 15965 uint32_t unused12[28]; 15966 STRUCT shared_buffer_r SHARED_BUFFER[256]; // 0x0400 15967 STRUCT ifm_pad_top_r IFM_PAD_TOP; // 0x0800 15968 STRUCT ifm_pad_left_r IFM_PAD_LEFT; // 0x0804 15969 STRUCT ifm_pad_right_r IFM_PAD_RIGHT; // 0x0808 15970 STRUCT ifm_pad_bottom_r IFM_PAD_BOTTOM; // 0x080C 15971 STRUCT ifm_depth_m1_r IFM_DEPTH_M1; // 0x0810 15972 STRUCT ifm_precision_r IFM_PRECISION; // 0x0814 15973 uint32_t unused13[1]; 15974 STRUCT ifm_upscale_r IFM_UPSCALE; // 0x081C 15975 uint32_t unused14[1]; 15976 STRUCT ifm_zero_point_r IFM_ZERO_POINT; // 0x0824 15977 STRUCT ifm_width0_m1_r IFM_WIDTH0_M1; // 0x0828 15978 STRUCT ifm_height0_m1_r IFM_HEIGHT0_M1; // 0x082C 15979 STRUCT ifm_height1_m1_r IFM_HEIGHT1_M1; // 0x0830 15980 STRUCT ifm_ib_end_r IFM_IB_END; // 0x0834 15981 uint32_t unused15[1]; 15982 STRUCT ifm_region_r IFM_REGION; // 0x083C 15983 uint32_t unused16[1]; 15984 STRUCT ofm_width_m1_r OFM_WIDTH_M1; // 0x0844 15985 STRUCT ofm_height_m1_r OFM_HEIGHT_M1; // 0x0848 15986 STRUCT ofm_depth_m1_r OFM_DEPTH_M1; // 0x084C 15987 STRUCT ofm_precision_r OFM_PRECISION; // 0x0850 15988 STRUCT ofm_blk_width_m1_r OFM_BLK_WIDTH_M1; // 0x0854 15989 STRUCT ofm_blk_height_m1_r OFM_BLK_HEIGHT_M1; // 0x0858 15990 STRUCT ofm_blk_depth_m1_r OFM_BLK_DEPTH_M1; // 0x085C 15991 STRUCT ofm_zero_point_r OFM_ZERO_POINT; // 0x0860 15992 uint32_t unused17[1]; 15993 STRUCT ofm_width0_m1_r OFM_WIDTH0_M1; // 0x0868 15994 STRUCT ofm_height0_m1_r OFM_HEIGHT0_M1; // 0x086C 15995 STRUCT ofm_height1_m1_r OFM_HEIGHT1_M1; // 0x0870 15996 uint32_t unused18[2]; 15997 STRUCT ofm_region_r OFM_REGION; // 0x087C 15998 STRUCT kernel_width_m1_r KERNEL_WIDTH_M1; // 0x0880 15999 STRUCT kernel_height_m1_r KERNEL_HEIGHT_M1; // 0x0884 16000 STRUCT kernel_stride_r KERNEL_STRIDE; // 0x0888 16001 uint32_t unused19[1]; 16002 STRUCT acc_format_r ACC_FORMAT; // 0x0890 16003 STRUCT activation_r ACTIVATION; // 0x0894 16004 STRUCT activation_min_r ACTIVATION_MIN; // 0x0898 16005 STRUCT activation_max_r ACTIVATION_MAX; // 0x089C 16006 STRUCT weight_region_r WEIGHT_REGION; // 0x08A0 16007 STRUCT scale_region_r SCALE_REGION; // 0x08A4 16008 uint32_t unused20[3]; 16009 STRUCT ab_start_r AB_START; // 0x08B4 16010 uint32_t unused21[1]; 16011 STRUCT blockdep_r BLOCKDEP; // 0x08BC 16012 STRUCT dma0_src_region_r DMA0_SRC_REGION; // 0x08C0 16013 STRUCT dma0_dst_region_r DMA0_DST_REGION; // 0x08C4 16014 STRUCT dma0_size0_r DMA0_SIZE0; // 0x08C8 16015 STRUCT dma0_size1_r DMA0_SIZE1; // 0x08CC 16016 uint32_t unused22[12]; 16017 STRUCT ifm2_broadcast_r IFM2_BROADCAST; // 0x0900 16018 STRUCT ifm2_scalar_r IFM2_SCALAR; // 0x0904 16019 uint32_t unused23[3]; 16020 STRUCT ifm2_precision_r IFM2_PRECISION; // 0x0914 16021 uint32_t unused24[3]; 16022 STRUCT ifm2_zero_point_r IFM2_ZERO_POINT; // 0x0924 16023 STRUCT ifm2_width0_m1_r IFM2_WIDTH0_M1; // 0x0928 16024 STRUCT ifm2_height0_m1_r IFM2_HEIGHT0_M1; // 0x092C 16025 STRUCT ifm2_height1_m1_r IFM2_HEIGHT1_M1; // 0x0930 16026 STRUCT ifm2_ib_start_r IFM2_IB_START; // 0x0934 16027 uint32_t unused25[1]; 16028 STRUCT ifm2_region_r IFM2_REGION; // 0x093C 16029 uint32_t unused26[48]; 16030 STRUCT ifm_base0_r IFM_BASE0; // 0x0A00 16031 STRUCT ifm_base1_r IFM_BASE1; // 0x0A08 16032 STRUCT ifm_base2_r IFM_BASE2; // 0x0A10 16033 STRUCT ifm_base3_r IFM_BASE3; // 0x0A18 16034 STRUCT ifm_stride_x_r IFM_STRIDE_X; // 0x0A20 16035 STRUCT ifm_stride_y_r IFM_STRIDE_Y; // 0x0A28 16036 STRUCT ifm_stride_c_r IFM_STRIDE_C; // 0x0A30 16037 uint32_t unused27[2]; 16038 STRUCT ofm_base0_r OFM_BASE0; // 0x0A40 16039 STRUCT ofm_base1_r OFM_BASE1; // 0x0A48 16040 STRUCT ofm_base2_r OFM_BASE2; // 0x0A50 16041 STRUCT ofm_base3_r OFM_BASE3; // 0x0A58 16042 STRUCT ofm_stride_x_r OFM_STRIDE_X; // 0x0A60 16043 STRUCT ofm_stride_y_r OFM_STRIDE_Y; // 0x0A68 16044 STRUCT ofm_stride_c_r OFM_STRIDE_C; // 0x0A70 16045 uint32_t unused28[2]; 16046 STRUCT weight_base_r WEIGHT_BASE; // 0x0A80 16047 STRUCT weight_length_r WEIGHT_LENGTH; // 0x0A88 16048 STRUCT scale_base_r SCALE_BASE; // 0x0A90 16049 STRUCT scale_length_r SCALE_LENGTH; // 0x0A98 16050 STRUCT ofm_scale_r OFM_SCALE; // 0x0AA0 16051 STRUCT ofm_scale_shift_r OFM_SCALE_SHIFT; // 0x0AA4 16052 STRUCT opa_scale_r OPA_SCALE; // 0x0AA8 16053 STRUCT opa_scale_shift_r OPA_SCALE_SHIFT; // 0x0AAC 16054 STRUCT opb_scale_r OPB_SCALE; // 0x0AB0 16055 uint32_t unused29[3]; 16056 STRUCT dma0_src_r DMA0_SRC; // 0x0AC0 16057 STRUCT dma0_dst_r DMA0_DST; // 0x0AC8 16058 STRUCT dma0_len_r DMA0_LEN; // 0x0AD0 16059 uint32_t unused30[10]; 16060 STRUCT ifm2_base0_r IFM2_BASE0; // 0x0B00 16061 STRUCT ifm2_base1_r IFM2_BASE1; // 0x0B08 16062 STRUCT ifm2_base2_r IFM2_BASE2; // 0x0B10 16063 STRUCT ifm2_base3_r IFM2_BASE3; // 0x0B18 16064 STRUCT ifm2_stride_x_r IFM2_STRIDE_X; // 0x0B20 16065 STRUCT ifm2_stride_y_r IFM2_STRIDE_Y; // 0x0B28 16066 STRUCT ifm2_stride_c_r IFM2_STRIDE_C; // 0x0B30 16067 uint32_t unused31[18]; 16068 uint32_t USER_DEFINED[16]; // 0x0B80 16069 uint32_t unused32[256]; 16070 STRUCT revision_r REVISION; // 0x0FC0 16071 uint32_t unused33[3]; 16072 STRUCT pid4_r PID4; // 0x0FD0 16073 STRUCT pid5_r PID5; // 0x0FD4 16074 STRUCT pid6_r PID6; // 0x0FD8 16075 STRUCT pid7_r PID7; // 0x0FDC 16076 STRUCT pid0_r PID0; // 0x0FE0 16077 STRUCT pid1_r PID1; // 0x0FE4 16078 STRUCT pid2_r PID2; // 0x0FE8 16079 STRUCT pid3_r PID3; // 0x0FEC 16080 STRUCT cid0_r CID0; // 0x0FF0 16081 STRUCT cid1_r CID1; // 0x0FF4 16082 STRUCT cid2_r CID2; // 0x0FF8 16083 STRUCT cid3_r CID3; // 0x0FFC 16084 16085 #ifdef __cplusplus 16086 enum class access_type_t : uint8_t 16087 { 16088 RW, 16089 RO, 16090 WO 16091 }; NPU_REGNPU_REG16092 NPU_REG() 16093 { 16094 reset(); 16095 } resetNPU_REG16096 void reset() 16097 { 16098 ID = 269500929; 16099 STATUS = 8; 16100 CMD = 12; 16101 RESET = 0; 16102 QBASE = 0; 16103 QREAD = 0; 16104 QCONFIG = 0; 16105 QSIZE = 0; 16106 PROT = 0; 16107 CONFIG = 0; 16108 LOCK = 0; 16109 REGIONCFG = 0; 16110 AXI_LIMIT0 = 0; 16111 AXI_LIMIT1 = 0; 16112 AXI_LIMIT2 = 0; 16113 AXI_LIMIT3 = 0; 16114 for (size_t i = 0; i < (sizeof(BASEP) / sizeof(BASEP[0])); ++i) 16115 BASEP[i] = 0; 16116 WD_STATUS = 0; 16117 MAC_STATUS = 0; 16118 AO_STATUS = 0; 16119 DMA_STATUS0 = 0; 16120 DMA_STATUS1 = 0; 16121 CLKFORCE = 0; 16122 DEBUG_ADDRESS = 0; 16123 DEBUG_MISC = 0; 16124 DEBUG_BLOCK = 0; 16125 PMCR = 8192; 16126 PMCNTENSET = 0; 16127 PMCNTENCLR = 0; 16128 PMOVSSET = 0; 16129 PMOVSCLR = 0; 16130 PMINTSET = 0; 16131 PMINTCLR = 0; 16132 PMCCNTR = 0; 16133 PMCCNTR_CFG = 0; 16134 PMCAXI_CHAN = 0; 16135 KERNEL_X = 0; 16136 KERNEL_Y = 0; 16137 KERNEL_W_M1 = 0; 16138 KERNEL_H_M1 = 0; 16139 OFM_CBLK_WIDTH_M1 = 0; 16140 OFM_CBLK_HEIGHT_M1 = 0; 16141 OFM_CBLK_DEPTH_M1 = 0; 16142 IFM_CBLK_DEPTH_M1 = 0; 16143 OFM_X = 0; 16144 OFM_Y = 0; 16145 OFM_Z = 0; 16146 IFM_Z = 0; 16147 PAD_TOP = 0; 16148 PAD_LEFT = 0; 16149 IFM_CBLK_WIDTH = 0; 16150 IFM_CBLK_HEIGHT = 0; 16151 DMA_IFM_SRC = 0; 16152 DMA_IFM_DST = 0; 16153 DMA_OFM_SRC = 0; 16154 DMA_OFM_DST = 0; 16155 DMA_WEIGHT_SRC = 0; 16156 DMA_CMD_SRC = 0; 16157 DMA_CMD_SIZE = 0; 16158 DMA_M2M_SRC = 0; 16159 DMA_M2M_DST = 0; 16160 CURRENT_QREAD = 0; 16161 DMA_SCALE_SRC = 0; 16162 CURRENT_BLOCK = 0; 16163 CURRENT_OP = 0; 16164 CURRENT_CMD = 0; 16165 for (size_t i = 0; i < (sizeof(PMEVCNTR) / sizeof(PMEVCNTR[0])); ++i) 16166 PMEVCNTR[i] = 0; 16167 for (size_t i = 0; i < (sizeof(PMEVTYPER) / sizeof(PMEVTYPER[0])); ++i) 16168 PMEVTYPER[i] = 0; 16169 for (size_t i = 0; i < (sizeof(SHARED_BUFFER) / sizeof(SHARED_BUFFER[0])); ++i) 16170 SHARED_BUFFER[i] = 0; 16171 IFM_PAD_TOP = 0; 16172 IFM_PAD_LEFT = 0; 16173 IFM_PAD_RIGHT = 0; 16174 IFM_PAD_BOTTOM = 0; 16175 IFM_DEPTH_M1 = 0; 16176 IFM_PRECISION = 0; 16177 IFM_UPSCALE = 0; 16178 IFM_ZERO_POINT = 0; 16179 IFM_WIDTH0_M1 = 0; 16180 IFM_HEIGHT0_M1 = 0; 16181 IFM_HEIGHT1_M1 = 0; 16182 IFM_IB_END = 0; 16183 IFM_REGION = 0; 16184 OFM_WIDTH_M1 = 0; 16185 OFM_HEIGHT_M1 = 0; 16186 OFM_DEPTH_M1 = 0; 16187 OFM_PRECISION = 0; 16188 OFM_BLK_WIDTH_M1 = 0; 16189 OFM_BLK_HEIGHT_M1 = 0; 16190 OFM_BLK_DEPTH_M1 = 0; 16191 OFM_ZERO_POINT = 0; 16192 OFM_WIDTH0_M1 = 0; 16193 OFM_HEIGHT0_M1 = 0; 16194 OFM_HEIGHT1_M1 = 0; 16195 OFM_REGION = 0; 16196 KERNEL_WIDTH_M1 = 0; 16197 KERNEL_HEIGHT_M1 = 0; 16198 KERNEL_STRIDE = 0; 16199 ACC_FORMAT = 0; 16200 ACTIVATION = 0; 16201 ACTIVATION_MIN = 0; 16202 ACTIVATION_MAX = 0; 16203 WEIGHT_REGION = 0; 16204 SCALE_REGION = 0; 16205 AB_START = 0; 16206 BLOCKDEP = 0; 16207 DMA0_SRC_REGION = 0; 16208 DMA0_DST_REGION = 0; 16209 DMA0_SIZE0 = 0; 16210 DMA0_SIZE1 = 0; 16211 IFM2_BROADCAST = 0; 16212 IFM2_SCALAR = 0; 16213 IFM2_PRECISION = 0; 16214 IFM2_ZERO_POINT = 0; 16215 IFM2_WIDTH0_M1 = 0; 16216 IFM2_HEIGHT0_M1 = 0; 16217 IFM2_HEIGHT1_M1 = 0; 16218 IFM2_IB_START = 0; 16219 IFM2_REGION = 0; 16220 IFM_BASE0 = 0; 16221 IFM_BASE1 = 0; 16222 IFM_BASE2 = 0; 16223 IFM_BASE3 = 0; 16224 IFM_STRIDE_X = 0; 16225 IFM_STRIDE_Y = 0; 16226 IFM_STRIDE_C = 0; 16227 OFM_BASE0 = 0; 16228 OFM_BASE1 = 0; 16229 OFM_BASE2 = 0; 16230 OFM_BASE3 = 0; 16231 OFM_STRIDE_X = 0; 16232 OFM_STRIDE_Y = 0; 16233 OFM_STRIDE_C = 0; 16234 WEIGHT_BASE = 0; 16235 WEIGHT_LENGTH = 0; 16236 SCALE_BASE = 0; 16237 SCALE_LENGTH = 0; 16238 OFM_SCALE = 0; 16239 OFM_SCALE_SHIFT = 0; 16240 OPA_SCALE = 0; 16241 OPA_SCALE_SHIFT = 0; 16242 OPB_SCALE = 0; 16243 DMA0_SRC = 0; 16244 DMA0_DST = 0; 16245 DMA0_LEN = 0; 16246 IFM2_BASE0 = 0; 16247 IFM2_BASE1 = 0; 16248 IFM2_BASE2 = 0; 16249 IFM2_BASE3 = 0; 16250 IFM2_STRIDE_X = 0; 16251 IFM2_STRIDE_Y = 0; 16252 IFM2_STRIDE_C = 0; 16253 for (size_t i = 0; i < (sizeof(USER_DEFINED) / sizeof(USER_DEFINED[0])); ++i) 16254 USER_DEFINED[i] = 0; 16255 REVISION = 0; 16256 PID4 = 4; 16257 PID5 = 0; 16258 PID6 = 0; 16259 PID7 = 0; 16260 PID0 = 128; 16261 PID1 = 181; 16262 PID2 = 11; 16263 PID3 = 0; 16264 CID0 = 13; 16265 CID1 = 240; 16266 CID2 = 5; 16267 CID3 = 177; 16268 } 16269 uint32_t &operator[](const int addr_offset) 16270 { 16271 return reinterpret_cast<uint32_t *>(this)[addr_offset / 4]; 16272 } get_access_typeNPU_REG16273 access_type_t get_access_type(uint32_t offset) 16274 { 16275 switch (offset) 16276 { 16277 case 0: 16278 return access_type_t::RO; 16279 case 4: 16280 return access_type_t::RO; 16281 case 8: 16282 return access_type_t::RW; 16283 case 12: 16284 return access_type_t::RW; 16285 case 16: 16286 return access_type_t::RW; 16287 case 24: 16288 return access_type_t::RO; 16289 case 28: 16290 return access_type_t::RW; 16291 case 32: 16292 return access_type_t::RW; 16293 case 36: 16294 return access_type_t::RO; 16295 case 40: 16296 return access_type_t::RO; 16297 case 44: 16298 return access_type_t::RW; 16299 case 60: 16300 return access_type_t::RW; 16301 case 64: 16302 return access_type_t::RW; 16303 case 68: 16304 return access_type_t::RW; 16305 case 72: 16306 return access_type_t::RW; 16307 case 76: 16308 return access_type_t::RW; 16309 case 128: 16310 return access_type_t::RW; 16311 case 136: 16312 return access_type_t::RW; 16313 case 144: 16314 return access_type_t::RW; 16315 case 152: 16316 return access_type_t::RW; 16317 case 160: 16318 return access_type_t::RW; 16319 case 168: 16320 return access_type_t::RW; 16321 case 176: 16322 return access_type_t::RW; 16323 case 184: 16324 return access_type_t::RW; 16325 case 256: 16326 return access_type_t::RO; 16327 case 260: 16328 return access_type_t::RO; 16329 case 264: 16330 return access_type_t::RO; 16331 case 272: 16332 return access_type_t::RO; 16333 case 276: 16334 return access_type_t::RO; 16335 case 320: 16336 return access_type_t::RW; 16337 case 324: 16338 return access_type_t::RW; 16339 case 328: 16340 return access_type_t::RW; 16341 case 336: 16342 return access_type_t::RW; 16343 case 384: 16344 return access_type_t::RW; 16345 case 388: 16346 return access_type_t::RW; 16347 case 392: 16348 return access_type_t::RW; 16349 case 396: 16350 return access_type_t::RW; 16351 case 400: 16352 return access_type_t::RW; 16353 case 404: 16354 return access_type_t::RW; 16355 case 408: 16356 return access_type_t::RW; 16357 case 416: 16358 return access_type_t::RW; 16359 case 424: 16360 return access_type_t::RW; 16361 case 428: 16362 return access_type_t::RW; 16363 case 512: 16364 return access_type_t::RO; 16365 case 516: 16366 return access_type_t::RO; 16367 case 520: 16368 return access_type_t::RO; 16369 case 524: 16370 return access_type_t::RO; 16371 case 528: 16372 return access_type_t::RO; 16373 case 532: 16374 return access_type_t::RO; 16375 case 536: 16376 return access_type_t::RO; 16377 case 540: 16378 return access_type_t::RO; 16379 case 544: 16380 return access_type_t::RO; 16381 case 548: 16382 return access_type_t::RO; 16383 case 552: 16384 return access_type_t::RO; 16385 case 556: 16386 return access_type_t::RO; 16387 case 560: 16388 return access_type_t::RO; 16389 case 564: 16390 return access_type_t::RO; 16391 case 568: 16392 return access_type_t::RO; 16393 case 572: 16394 return access_type_t::RO; 16395 case 576: 16396 return access_type_t::RO; 16397 case 584: 16398 return access_type_t::RO; 16399 case 588: 16400 return access_type_t::RO; 16401 case 592: 16402 return access_type_t::RO; 16403 case 600: 16404 return access_type_t::RO; 16405 case 608: 16406 return access_type_t::RO; 16407 case 616: 16408 return access_type_t::RO; 16409 case 620: 16410 return access_type_t::RO; 16411 case 628: 16412 return access_type_t::RO; 16413 case 636: 16414 return access_type_t::RO; 16415 case 640: 16416 return access_type_t::RO; 16417 case 692: 16418 return access_type_t::RO; 16419 case 696: 16420 return access_type_t::RO; 16421 case 700: 16422 return access_type_t::RO; 16423 case 768: 16424 return access_type_t::RW; 16425 case 772: 16426 return access_type_t::RW; 16427 case 776: 16428 return access_type_t::RW; 16429 case 780: 16430 return access_type_t::RW; 16431 case 896: 16432 return access_type_t::RW; 16433 case 900: 16434 return access_type_t::RW; 16435 case 904: 16436 return access_type_t::RW; 16437 case 908: 16438 return access_type_t::RW; 16439 case 1024: 16440 return access_type_t::RW; 16441 case 1028: 16442 return access_type_t::RW; 16443 case 1032: 16444 return access_type_t::RW; 16445 case 1036: 16446 return access_type_t::RW; 16447 case 1040: 16448 return access_type_t::RW; 16449 case 1044: 16450 return access_type_t::RW; 16451 case 1048: 16452 return access_type_t::RW; 16453 case 1052: 16454 return access_type_t::RW; 16455 case 1056: 16456 return access_type_t::RW; 16457 case 1060: 16458 return access_type_t::RW; 16459 case 1064: 16460 return access_type_t::RW; 16461 case 1068: 16462 return access_type_t::RW; 16463 case 1072: 16464 return access_type_t::RW; 16465 case 1076: 16466 return access_type_t::RW; 16467 case 1080: 16468 return access_type_t::RW; 16469 case 1084: 16470 return access_type_t::RW; 16471 case 1088: 16472 return access_type_t::RW; 16473 case 1092: 16474 return access_type_t::RW; 16475 case 1096: 16476 return access_type_t::RW; 16477 case 1100: 16478 return access_type_t::RW; 16479 case 1104: 16480 return access_type_t::RW; 16481 case 1108: 16482 return access_type_t::RW; 16483 case 1112: 16484 return access_type_t::RW; 16485 case 1116: 16486 return access_type_t::RW; 16487 case 1120: 16488 return access_type_t::RW; 16489 case 1124: 16490 return access_type_t::RW; 16491 case 1128: 16492 return access_type_t::RW; 16493 case 1132: 16494 return access_type_t::RW; 16495 case 1136: 16496 return access_type_t::RW; 16497 case 1140: 16498 return access_type_t::RW; 16499 case 1144: 16500 return access_type_t::RW; 16501 case 1148: 16502 return access_type_t::RW; 16503 case 1152: 16504 return access_type_t::RW; 16505 case 1156: 16506 return access_type_t::RW; 16507 case 1160: 16508 return access_type_t::RW; 16509 case 1164: 16510 return access_type_t::RW; 16511 case 1168: 16512 return access_type_t::RW; 16513 case 1172: 16514 return access_type_t::RW; 16515 case 1176: 16516 return access_type_t::RW; 16517 case 1180: 16518 return access_type_t::RW; 16519 case 1184: 16520 return access_type_t::RW; 16521 case 1188: 16522 return access_type_t::RW; 16523 case 1192: 16524 return access_type_t::RW; 16525 case 1196: 16526 return access_type_t::RW; 16527 case 1200: 16528 return access_type_t::RW; 16529 case 1204: 16530 return access_type_t::RW; 16531 case 1208: 16532 return access_type_t::RW; 16533 case 1212: 16534 return access_type_t::RW; 16535 case 1216: 16536 return access_type_t::RW; 16537 case 1220: 16538 return access_type_t::RW; 16539 case 1224: 16540 return access_type_t::RW; 16541 case 1228: 16542 return access_type_t::RW; 16543 case 1232: 16544 return access_type_t::RW; 16545 case 1236: 16546 return access_type_t::RW; 16547 case 1240: 16548 return access_type_t::RW; 16549 case 1244: 16550 return access_type_t::RW; 16551 case 1248: 16552 return access_type_t::RW; 16553 case 1252: 16554 return access_type_t::RW; 16555 case 1256: 16556 return access_type_t::RW; 16557 case 1260: 16558 return access_type_t::RW; 16559 case 1264: 16560 return access_type_t::RW; 16561 case 1268: 16562 return access_type_t::RW; 16563 case 1272: 16564 return access_type_t::RW; 16565 case 1276: 16566 return access_type_t::RW; 16567 case 1280: 16568 return access_type_t::RW; 16569 case 1284: 16570 return access_type_t::RW; 16571 case 1288: 16572 return access_type_t::RW; 16573 case 1292: 16574 return access_type_t::RW; 16575 case 1296: 16576 return access_type_t::RW; 16577 case 1300: 16578 return access_type_t::RW; 16579 case 1304: 16580 return access_type_t::RW; 16581 case 1308: 16582 return access_type_t::RW; 16583 case 1312: 16584 return access_type_t::RW; 16585 case 1316: 16586 return access_type_t::RW; 16587 case 1320: 16588 return access_type_t::RW; 16589 case 1324: 16590 return access_type_t::RW; 16591 case 1328: 16592 return access_type_t::RW; 16593 case 1332: 16594 return access_type_t::RW; 16595 case 1336: 16596 return access_type_t::RW; 16597 case 1340: 16598 return access_type_t::RW; 16599 case 1344: 16600 return access_type_t::RW; 16601 case 1348: 16602 return access_type_t::RW; 16603 case 1352: 16604 return access_type_t::RW; 16605 case 1356: 16606 return access_type_t::RW; 16607 case 1360: 16608 return access_type_t::RW; 16609 case 1364: 16610 return access_type_t::RW; 16611 case 1368: 16612 return access_type_t::RW; 16613 case 1372: 16614 return access_type_t::RW; 16615 case 1376: 16616 return access_type_t::RW; 16617 case 1380: 16618 return access_type_t::RW; 16619 case 1384: 16620 return access_type_t::RW; 16621 case 1388: 16622 return access_type_t::RW; 16623 case 1392: 16624 return access_type_t::RW; 16625 case 1396: 16626 return access_type_t::RW; 16627 case 1400: 16628 return access_type_t::RW; 16629 case 1404: 16630 return access_type_t::RW; 16631 case 1408: 16632 return access_type_t::RW; 16633 case 1412: 16634 return access_type_t::RW; 16635 case 1416: 16636 return access_type_t::RW; 16637 case 1420: 16638 return access_type_t::RW; 16639 case 1424: 16640 return access_type_t::RW; 16641 case 1428: 16642 return access_type_t::RW; 16643 case 1432: 16644 return access_type_t::RW; 16645 case 1436: 16646 return access_type_t::RW; 16647 case 1440: 16648 return access_type_t::RW; 16649 case 1444: 16650 return access_type_t::RW; 16651 case 1448: 16652 return access_type_t::RW; 16653 case 1452: 16654 return access_type_t::RW; 16655 case 1456: 16656 return access_type_t::RW; 16657 case 1460: 16658 return access_type_t::RW; 16659 case 1464: 16660 return access_type_t::RW; 16661 case 1468: 16662 return access_type_t::RW; 16663 case 1472: 16664 return access_type_t::RW; 16665 case 1476: 16666 return access_type_t::RW; 16667 case 1480: 16668 return access_type_t::RW; 16669 case 1484: 16670 return access_type_t::RW; 16671 case 1488: 16672 return access_type_t::RW; 16673 case 1492: 16674 return access_type_t::RW; 16675 case 1496: 16676 return access_type_t::RW; 16677 case 1500: 16678 return access_type_t::RW; 16679 case 1504: 16680 return access_type_t::RW; 16681 case 1508: 16682 return access_type_t::RW; 16683 case 1512: 16684 return access_type_t::RW; 16685 case 1516: 16686 return access_type_t::RW; 16687 case 1520: 16688 return access_type_t::RW; 16689 case 1524: 16690 return access_type_t::RW; 16691 case 1528: 16692 return access_type_t::RW; 16693 case 1532: 16694 return access_type_t::RW; 16695 case 1536: 16696 return access_type_t::RW; 16697 case 1540: 16698 return access_type_t::RW; 16699 case 1544: 16700 return access_type_t::RW; 16701 case 1548: 16702 return access_type_t::RW; 16703 case 1552: 16704 return access_type_t::RW; 16705 case 1556: 16706 return access_type_t::RW; 16707 case 1560: 16708 return access_type_t::RW; 16709 case 1564: 16710 return access_type_t::RW; 16711 case 1568: 16712 return access_type_t::RW; 16713 case 1572: 16714 return access_type_t::RW; 16715 case 1576: 16716 return access_type_t::RW; 16717 case 1580: 16718 return access_type_t::RW; 16719 case 1584: 16720 return access_type_t::RW; 16721 case 1588: 16722 return access_type_t::RW; 16723 case 1592: 16724 return access_type_t::RW; 16725 case 1596: 16726 return access_type_t::RW; 16727 case 1600: 16728 return access_type_t::RW; 16729 case 1604: 16730 return access_type_t::RW; 16731 case 1608: 16732 return access_type_t::RW; 16733 case 1612: 16734 return access_type_t::RW; 16735 case 1616: 16736 return access_type_t::RW; 16737 case 1620: 16738 return access_type_t::RW; 16739 case 1624: 16740 return access_type_t::RW; 16741 case 1628: 16742 return access_type_t::RW; 16743 case 1632: 16744 return access_type_t::RW; 16745 case 1636: 16746 return access_type_t::RW; 16747 case 1640: 16748 return access_type_t::RW; 16749 case 1644: 16750 return access_type_t::RW; 16751 case 1648: 16752 return access_type_t::RW; 16753 case 1652: 16754 return access_type_t::RW; 16755 case 1656: 16756 return access_type_t::RW; 16757 case 1660: 16758 return access_type_t::RW; 16759 case 1664: 16760 return access_type_t::RW; 16761 case 1668: 16762 return access_type_t::RW; 16763 case 1672: 16764 return access_type_t::RW; 16765 case 1676: 16766 return access_type_t::RW; 16767 case 1680: 16768 return access_type_t::RW; 16769 case 1684: 16770 return access_type_t::RW; 16771 case 1688: 16772 return access_type_t::RW; 16773 case 1692: 16774 return access_type_t::RW; 16775 case 1696: 16776 return access_type_t::RW; 16777 case 1700: 16778 return access_type_t::RW; 16779 case 1704: 16780 return access_type_t::RW; 16781 case 1708: 16782 return access_type_t::RW; 16783 case 1712: 16784 return access_type_t::RW; 16785 case 1716: 16786 return access_type_t::RW; 16787 case 1720: 16788 return access_type_t::RW; 16789 case 1724: 16790 return access_type_t::RW; 16791 case 1728: 16792 return access_type_t::RW; 16793 case 1732: 16794 return access_type_t::RW; 16795 case 1736: 16796 return access_type_t::RW; 16797 case 1740: 16798 return access_type_t::RW; 16799 case 1744: 16800 return access_type_t::RW; 16801 case 1748: 16802 return access_type_t::RW; 16803 case 1752: 16804 return access_type_t::RW; 16805 case 1756: 16806 return access_type_t::RW; 16807 case 1760: 16808 return access_type_t::RW; 16809 case 1764: 16810 return access_type_t::RW; 16811 case 1768: 16812 return access_type_t::RW; 16813 case 1772: 16814 return access_type_t::RW; 16815 case 1776: 16816 return access_type_t::RW; 16817 case 1780: 16818 return access_type_t::RW; 16819 case 1784: 16820 return access_type_t::RW; 16821 case 1788: 16822 return access_type_t::RW; 16823 case 1792: 16824 return access_type_t::RW; 16825 case 1796: 16826 return access_type_t::RW; 16827 case 1800: 16828 return access_type_t::RW; 16829 case 1804: 16830 return access_type_t::RW; 16831 case 1808: 16832 return access_type_t::RW; 16833 case 1812: 16834 return access_type_t::RW; 16835 case 1816: 16836 return access_type_t::RW; 16837 case 1820: 16838 return access_type_t::RW; 16839 case 1824: 16840 return access_type_t::RW; 16841 case 1828: 16842 return access_type_t::RW; 16843 case 1832: 16844 return access_type_t::RW; 16845 case 1836: 16846 return access_type_t::RW; 16847 case 1840: 16848 return access_type_t::RW; 16849 case 1844: 16850 return access_type_t::RW; 16851 case 1848: 16852 return access_type_t::RW; 16853 case 1852: 16854 return access_type_t::RW; 16855 case 1856: 16856 return access_type_t::RW; 16857 case 1860: 16858 return access_type_t::RW; 16859 case 1864: 16860 return access_type_t::RW; 16861 case 1868: 16862 return access_type_t::RW; 16863 case 1872: 16864 return access_type_t::RW; 16865 case 1876: 16866 return access_type_t::RW; 16867 case 1880: 16868 return access_type_t::RW; 16869 case 1884: 16870 return access_type_t::RW; 16871 case 1888: 16872 return access_type_t::RW; 16873 case 1892: 16874 return access_type_t::RW; 16875 case 1896: 16876 return access_type_t::RW; 16877 case 1900: 16878 return access_type_t::RW; 16879 case 1904: 16880 return access_type_t::RW; 16881 case 1908: 16882 return access_type_t::RW; 16883 case 1912: 16884 return access_type_t::RW; 16885 case 1916: 16886 return access_type_t::RW; 16887 case 1920: 16888 return access_type_t::RW; 16889 case 1924: 16890 return access_type_t::RW; 16891 case 1928: 16892 return access_type_t::RW; 16893 case 1932: 16894 return access_type_t::RW; 16895 case 1936: 16896 return access_type_t::RW; 16897 case 1940: 16898 return access_type_t::RW; 16899 case 1944: 16900 return access_type_t::RW; 16901 case 1948: 16902 return access_type_t::RW; 16903 case 1952: 16904 return access_type_t::RW; 16905 case 1956: 16906 return access_type_t::RW; 16907 case 1960: 16908 return access_type_t::RW; 16909 case 1964: 16910 return access_type_t::RW; 16911 case 1968: 16912 return access_type_t::RW; 16913 case 1972: 16914 return access_type_t::RW; 16915 case 1976: 16916 return access_type_t::RW; 16917 case 1980: 16918 return access_type_t::RW; 16919 case 1984: 16920 return access_type_t::RW; 16921 case 1988: 16922 return access_type_t::RW; 16923 case 1992: 16924 return access_type_t::RW; 16925 case 1996: 16926 return access_type_t::RW; 16927 case 2000: 16928 return access_type_t::RW; 16929 case 2004: 16930 return access_type_t::RW; 16931 case 2008: 16932 return access_type_t::RW; 16933 case 2012: 16934 return access_type_t::RW; 16935 case 2016: 16936 return access_type_t::RW; 16937 case 2020: 16938 return access_type_t::RW; 16939 case 2024: 16940 return access_type_t::RW; 16941 case 2028: 16942 return access_type_t::RW; 16943 case 2032: 16944 return access_type_t::RW; 16945 case 2036: 16946 return access_type_t::RW; 16947 case 2040: 16948 return access_type_t::RW; 16949 case 2044: 16950 return access_type_t::RW; 16951 case 2048: 16952 return access_type_t::RW; 16953 case 2052: 16954 return access_type_t::RW; 16955 case 2056: 16956 return access_type_t::RW; 16957 case 2060: 16958 return access_type_t::RW; 16959 case 2064: 16960 return access_type_t::RW; 16961 case 2068: 16962 return access_type_t::RW; 16963 case 2076: 16964 return access_type_t::RW; 16965 case 2084: 16966 return access_type_t::RW; 16967 case 2088: 16968 return access_type_t::RW; 16969 case 2092: 16970 return access_type_t::RW; 16971 case 2096: 16972 return access_type_t::RW; 16973 case 2100: 16974 return access_type_t::RW; 16975 case 2108: 16976 return access_type_t::RW; 16977 case 2116: 16978 return access_type_t::RW; 16979 case 2120: 16980 return access_type_t::RW; 16981 case 2124: 16982 return access_type_t::RW; 16983 case 2128: 16984 return access_type_t::RW; 16985 case 2132: 16986 return access_type_t::RW; 16987 case 2136: 16988 return access_type_t::RW; 16989 case 2140: 16990 return access_type_t::RW; 16991 case 2144: 16992 return access_type_t::RW; 16993 case 2152: 16994 return access_type_t::RW; 16995 case 2156: 16996 return access_type_t::RW; 16997 case 2160: 16998 return access_type_t::RW; 16999 case 2172: 17000 return access_type_t::RW; 17001 case 2176: 17002 return access_type_t::RW; 17003 case 2180: 17004 return access_type_t::RW; 17005 case 2184: 17006 return access_type_t::RW; 17007 case 2192: 17008 return access_type_t::RW; 17009 case 2196: 17010 return access_type_t::RW; 17011 case 2200: 17012 return access_type_t::RW; 17013 case 2204: 17014 return access_type_t::RW; 17015 case 2208: 17016 return access_type_t::RW; 17017 case 2212: 17018 return access_type_t::RW; 17019 case 2228: 17020 return access_type_t::RW; 17021 case 2236: 17022 return access_type_t::RW; 17023 case 2240: 17024 return access_type_t::RW; 17025 case 2244: 17026 return access_type_t::RW; 17027 case 2248: 17028 return access_type_t::RW; 17029 case 2252: 17030 return access_type_t::RW; 17031 case 2304: 17032 return access_type_t::RW; 17033 case 2308: 17034 return access_type_t::RW; 17035 case 2324: 17036 return access_type_t::RW; 17037 case 2340: 17038 return access_type_t::RW; 17039 case 2344: 17040 return access_type_t::RW; 17041 case 2348: 17042 return access_type_t::RW; 17043 case 2352: 17044 return access_type_t::RW; 17045 case 2356: 17046 return access_type_t::RW; 17047 case 2364: 17048 return access_type_t::RW; 17049 case 2560: 17050 return access_type_t::RW; 17051 case 2568: 17052 return access_type_t::RW; 17053 case 2576: 17054 return access_type_t::RW; 17055 case 2584: 17056 return access_type_t::RW; 17057 case 2592: 17058 return access_type_t::RW; 17059 case 2600: 17060 return access_type_t::RW; 17061 case 2608: 17062 return access_type_t::RW; 17063 case 2624: 17064 return access_type_t::RW; 17065 case 2632: 17066 return access_type_t::RW; 17067 case 2640: 17068 return access_type_t::RW; 17069 case 2648: 17070 return access_type_t::RW; 17071 case 2656: 17072 return access_type_t::RW; 17073 case 2664: 17074 return access_type_t::RW; 17075 case 2672: 17076 return access_type_t::RW; 17077 case 2688: 17078 return access_type_t::RW; 17079 case 2696: 17080 return access_type_t::RW; 17081 case 2704: 17082 return access_type_t::RW; 17083 case 2712: 17084 return access_type_t::RW; 17085 case 2720: 17086 return access_type_t::RW; 17087 case 2724: 17088 return access_type_t::RW; 17089 case 2728: 17090 return access_type_t::RW; 17091 case 2732: 17092 return access_type_t::RW; 17093 case 2736: 17094 return access_type_t::RW; 17095 case 2752: 17096 return access_type_t::RW; 17097 case 2760: 17098 return access_type_t::RW; 17099 case 2768: 17100 return access_type_t::RW; 17101 case 2816: 17102 return access_type_t::RW; 17103 case 2824: 17104 return access_type_t::RW; 17105 case 2832: 17106 return access_type_t::RW; 17107 case 2840: 17108 return access_type_t::RW; 17109 case 2848: 17110 return access_type_t::RW; 17111 case 2856: 17112 return access_type_t::RW; 17113 case 2864: 17114 return access_type_t::RW; 17115 case 2944: 17116 return access_type_t::RW; 17117 case 2952: 17118 return access_type_t::RW; 17119 case 2960: 17120 return access_type_t::RW; 17121 case 2968: 17122 return access_type_t::RW; 17123 case 2976: 17124 return access_type_t::RW; 17125 case 2984: 17126 return access_type_t::RW; 17127 case 2992: 17128 return access_type_t::RW; 17129 case 3000: 17130 return access_type_t::RW; 17131 case 4032: 17132 return access_type_t::RO; 17133 case 4048: 17134 return access_type_t::RO; 17135 case 4052: 17136 return access_type_t::RO; 17137 case 4056: 17138 return access_type_t::RO; 17139 case 4060: 17140 return access_type_t::RO; 17141 case 4064: 17142 return access_type_t::RO; 17143 case 4068: 17144 return access_type_t::RO; 17145 case 4072: 17146 return access_type_t::RO; 17147 case 4076: 17148 return access_type_t::RO; 17149 case 4080: 17150 return access_type_t::RO; 17151 case 4084: 17152 return access_type_t::RO; 17153 case 4088: 17154 return access_type_t::RO; 17155 case 4092: 17156 return access_type_t::RO; 17157 default: 17158 return access_type_t::RO; 17159 } 17160 } 17161 #endif 17162 }; 17163 17164 #ifdef __cplusplus 17165 struct isa 17166 { 17167 #ifdef NPU_DISASSEMBLE disassembleisa17168 static int disassemble(const uint32_t *in, 17169 std::string &op, 17170 std::vector<std::pair<std::string, std::string>> &fields) 17171 { 17172 switch (*in & 0xffff) 17173 { 17174 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) | 17175 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_STOP): 17176 { 17177 const npu_op_stop_t &v = *reinterpret_cast<const npu_op_stop_t *>(in); 17178 op = "NPU_OP_STOP"; 17179 v.disassemble(fields); 17180 break; 17181 } 17182 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) | 17183 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_IRQ): 17184 { 17185 const npu_op_irq_t &v = *reinterpret_cast<const npu_op_irq_t *>(in); 17186 op = "NPU_OP_IRQ"; 17187 v.disassemble(fields); 17188 break; 17189 } 17190 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) | 17191 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_CONV): 17192 { 17193 const npu_op_conv_t &v = *reinterpret_cast<const npu_op_conv_t *>(in); 17194 op = "NPU_OP_CONV"; 17195 v.disassemble(fields); 17196 break; 17197 } 17198 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) | 17199 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_DEPTHWISE): 17200 { 17201 const npu_op_depthwise_t &v = *reinterpret_cast<const npu_op_depthwise_t *>(in); 17202 op = "NPU_OP_DEPTHWISE"; 17203 v.disassemble(fields); 17204 break; 17205 } 17206 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) | 17207 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_POOL): 17208 { 17209 const npu_op_pool_t &v = *reinterpret_cast<const npu_op_pool_t *>(in); 17210 op = "NPU_OP_POOL"; 17211 v.disassemble(fields); 17212 break; 17213 } 17214 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) | 17215 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_ELEMENTWISE): 17216 { 17217 const npu_op_elementwise_t &v = *reinterpret_cast<const npu_op_elementwise_t *>(in); 17218 op = "NPU_OP_ELEMENTWISE"; 17219 v.disassemble(fields); 17220 break; 17221 } 17222 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) | 17223 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_DMA_START): 17224 { 17225 const npu_op_dma_start_t &v = *reinterpret_cast<const npu_op_dma_start_t *>(in); 17226 op = "NPU_OP_DMA_START"; 17227 v.disassemble(fields); 17228 break; 17229 } 17230 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) | 17231 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_DMA_WAIT): 17232 { 17233 const npu_op_dma_wait_t &v = *reinterpret_cast<const npu_op_dma_wait_t *>(in); 17234 op = "NPU_OP_DMA_WAIT"; 17235 v.disassemble(fields); 17236 break; 17237 } 17238 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) | 17239 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_KERNEL_WAIT): 17240 { 17241 const npu_op_kernel_wait_t &v = *reinterpret_cast<const npu_op_kernel_wait_t *>(in); 17242 op = "NPU_OP_KERNEL_WAIT"; 17243 v.disassemble(fields); 17244 break; 17245 } 17246 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) | 17247 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_PMU_MASK): 17248 { 17249 const npu_op_pmu_mask_t &v = *reinterpret_cast<const npu_op_pmu_mask_t *>(in); 17250 op = "NPU_OP_PMU_MASK"; 17251 v.disassemble(fields); 17252 break; 17253 } 17254 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) | 17255 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_PAD_TOP): 17256 { 17257 const npu_set_ifm_pad_top_t &v = *reinterpret_cast<const npu_set_ifm_pad_top_t *>(in); 17258 op = "NPU_SET_IFM_PAD_TOP"; 17259 v.disassemble(fields); 17260 break; 17261 } 17262 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) | 17263 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_PAD_LEFT): 17264 { 17265 const npu_set_ifm_pad_left_t &v = *reinterpret_cast<const npu_set_ifm_pad_left_t *>(in); 17266 op = "NPU_SET_IFM_PAD_LEFT"; 17267 v.disassemble(fields); 17268 break; 17269 } 17270 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) | 17271 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_PAD_RIGHT): 17272 { 17273 const npu_set_ifm_pad_right_t &v = *reinterpret_cast<const npu_set_ifm_pad_right_t *>(in); 17274 op = "NPU_SET_IFM_PAD_RIGHT"; 17275 v.disassemble(fields); 17276 break; 17277 } 17278 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) | 17279 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_PAD_BOTTOM): 17280 { 17281 const npu_set_ifm_pad_bottom_t &v = *reinterpret_cast<const npu_set_ifm_pad_bottom_t *>(in); 17282 op = "NPU_SET_IFM_PAD_BOTTOM"; 17283 v.disassemble(fields); 17284 break; 17285 } 17286 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) | 17287 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_DEPTH_M1): 17288 { 17289 const npu_set_ifm_depth_m1_t &v = *reinterpret_cast<const npu_set_ifm_depth_m1_t *>(in); 17290 op = "NPU_SET_IFM_DEPTH_M1"; 17291 v.disassemble(fields); 17292 break; 17293 } 17294 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) | 17295 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_PRECISION): 17296 { 17297 const npu_set_ifm_precision_t &v = *reinterpret_cast<const npu_set_ifm_precision_t *>(in); 17298 op = "NPU_SET_IFM_PRECISION"; 17299 v.disassemble(fields); 17300 break; 17301 } 17302 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) | 17303 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_UPSCALE): 17304 { 17305 const npu_set_ifm_upscale_t &v = *reinterpret_cast<const npu_set_ifm_upscale_t *>(in); 17306 op = "NPU_SET_IFM_UPSCALE"; 17307 v.disassemble(fields); 17308 break; 17309 } 17310 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) | 17311 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_ZERO_POINT): 17312 { 17313 const npu_set_ifm_zero_point_t &v = *reinterpret_cast<const npu_set_ifm_zero_point_t *>(in); 17314 op = "NPU_SET_IFM_ZERO_POINT"; 17315 v.disassemble(fields); 17316 break; 17317 } 17318 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) | 17319 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_WIDTH0_M1): 17320 { 17321 const npu_set_ifm_width0_m1_t &v = *reinterpret_cast<const npu_set_ifm_width0_m1_t *>(in); 17322 op = "NPU_SET_IFM_WIDTH0_M1"; 17323 v.disassemble(fields); 17324 break; 17325 } 17326 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) | 17327 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_HEIGHT0_M1): 17328 { 17329 const npu_set_ifm_height0_m1_t &v = *reinterpret_cast<const npu_set_ifm_height0_m1_t *>(in); 17330 op = "NPU_SET_IFM_HEIGHT0_M1"; 17331 v.disassemble(fields); 17332 break; 17333 } 17334 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) | 17335 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_HEIGHT1_M1): 17336 { 17337 const npu_set_ifm_height1_m1_t &v = *reinterpret_cast<const npu_set_ifm_height1_m1_t *>(in); 17338 op = "NPU_SET_IFM_HEIGHT1_M1"; 17339 v.disassemble(fields); 17340 break; 17341 } 17342 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) | 17343 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_IB_END): 17344 { 17345 const npu_set_ifm_ib_end_t &v = *reinterpret_cast<const npu_set_ifm_ib_end_t *>(in); 17346 op = "NPU_SET_IFM_IB_END"; 17347 v.disassemble(fields); 17348 break; 17349 } 17350 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) | 17351 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_REGION): 17352 { 17353 const npu_set_ifm_region_t &v = *reinterpret_cast<const npu_set_ifm_region_t *>(in); 17354 op = "NPU_SET_IFM_REGION"; 17355 v.disassemble(fields); 17356 break; 17357 } 17358 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) | 17359 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_OFM_WIDTH_M1): 17360 { 17361 const npu_set_ofm_width_m1_t &v = *reinterpret_cast<const npu_set_ofm_width_m1_t *>(in); 17362 op = "NPU_SET_OFM_WIDTH_M1"; 17363 v.disassemble(fields); 17364 break; 17365 } 17366 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) | 17367 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_OFM_HEIGHT_M1): 17368 { 17369 const npu_set_ofm_height_m1_t &v = *reinterpret_cast<const npu_set_ofm_height_m1_t *>(in); 17370 op = "NPU_SET_OFM_HEIGHT_M1"; 17371 v.disassemble(fields); 17372 break; 17373 } 17374 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) | 17375 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_OFM_DEPTH_M1): 17376 { 17377 const npu_set_ofm_depth_m1_t &v = *reinterpret_cast<const npu_set_ofm_depth_m1_t *>(in); 17378 op = "NPU_SET_OFM_DEPTH_M1"; 17379 v.disassemble(fields); 17380 break; 17381 } 17382 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) | 17383 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_OFM_PRECISION): 17384 { 17385 const npu_set_ofm_precision_t &v = *reinterpret_cast<const npu_set_ofm_precision_t *>(in); 17386 op = "NPU_SET_OFM_PRECISION"; 17387 v.disassemble(fields); 17388 break; 17389 } 17390 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) | 17391 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_OFM_BLK_WIDTH_M1): 17392 { 17393 const npu_set_ofm_blk_width_m1_t &v = *reinterpret_cast<const npu_set_ofm_blk_width_m1_t *>(in); 17394 op = "NPU_SET_OFM_BLK_WIDTH_M1"; 17395 v.disassemble(fields); 17396 break; 17397 } 17398 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) | 17399 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_OFM_BLK_HEIGHT_M1): 17400 { 17401 const npu_set_ofm_blk_height_m1_t &v = *reinterpret_cast<const npu_set_ofm_blk_height_m1_t *>(in); 17402 op = "NPU_SET_OFM_BLK_HEIGHT_M1"; 17403 v.disassemble(fields); 17404 break; 17405 } 17406 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) | 17407 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_OFM_BLK_DEPTH_M1): 17408 { 17409 const npu_set_ofm_blk_depth_m1_t &v = *reinterpret_cast<const npu_set_ofm_blk_depth_m1_t *>(in); 17410 op = "NPU_SET_OFM_BLK_DEPTH_M1"; 17411 v.disassemble(fields); 17412 break; 17413 } 17414 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) | 17415 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_OFM_ZERO_POINT): 17416 { 17417 const npu_set_ofm_zero_point_t &v = *reinterpret_cast<const npu_set_ofm_zero_point_t *>(in); 17418 op = "NPU_SET_OFM_ZERO_POINT"; 17419 v.disassemble(fields); 17420 break; 17421 } 17422 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) | 17423 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_OFM_WIDTH0_M1): 17424 { 17425 const npu_set_ofm_width0_m1_t &v = *reinterpret_cast<const npu_set_ofm_width0_m1_t *>(in); 17426 op = "NPU_SET_OFM_WIDTH0_M1"; 17427 v.disassemble(fields); 17428 break; 17429 } 17430 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) | 17431 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_OFM_HEIGHT0_M1): 17432 { 17433 const npu_set_ofm_height0_m1_t &v = *reinterpret_cast<const npu_set_ofm_height0_m1_t *>(in); 17434 op = "NPU_SET_OFM_HEIGHT0_M1"; 17435 v.disassemble(fields); 17436 break; 17437 } 17438 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) | 17439 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_OFM_HEIGHT1_M1): 17440 { 17441 const npu_set_ofm_height1_m1_t &v = *reinterpret_cast<const npu_set_ofm_height1_m1_t *>(in); 17442 op = "NPU_SET_OFM_HEIGHT1_M1"; 17443 v.disassemble(fields); 17444 break; 17445 } 17446 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) | 17447 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_OFM_REGION): 17448 { 17449 const npu_set_ofm_region_t &v = *reinterpret_cast<const npu_set_ofm_region_t *>(in); 17450 op = "NPU_SET_OFM_REGION"; 17451 v.disassemble(fields); 17452 break; 17453 } 17454 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) | 17455 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_KERNEL_WIDTH_M1): 17456 { 17457 const npu_set_kernel_width_m1_t &v = *reinterpret_cast<const npu_set_kernel_width_m1_t *>(in); 17458 op = "NPU_SET_KERNEL_WIDTH_M1"; 17459 v.disassemble(fields); 17460 break; 17461 } 17462 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) | 17463 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_KERNEL_HEIGHT_M1): 17464 { 17465 const npu_set_kernel_height_m1_t &v = *reinterpret_cast<const npu_set_kernel_height_m1_t *>(in); 17466 op = "NPU_SET_KERNEL_HEIGHT_M1"; 17467 v.disassemble(fields); 17468 break; 17469 } 17470 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) | 17471 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_KERNEL_STRIDE): 17472 { 17473 const npu_set_kernel_stride_t &v = *reinterpret_cast<const npu_set_kernel_stride_t *>(in); 17474 op = "NPU_SET_KERNEL_STRIDE"; 17475 v.disassemble(fields); 17476 break; 17477 } 17478 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) | 17479 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_ACC_FORMAT): 17480 { 17481 const npu_set_acc_format_t &v = *reinterpret_cast<const npu_set_acc_format_t *>(in); 17482 op = "NPU_SET_ACC_FORMAT"; 17483 v.disassemble(fields); 17484 break; 17485 } 17486 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) | 17487 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_ACTIVATION): 17488 { 17489 const npu_set_activation_t &v = *reinterpret_cast<const npu_set_activation_t *>(in); 17490 op = "NPU_SET_ACTIVATION"; 17491 v.disassemble(fields); 17492 break; 17493 } 17494 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) | 17495 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_ACTIVATION_MIN): 17496 { 17497 const npu_set_activation_min_t &v = *reinterpret_cast<const npu_set_activation_min_t *>(in); 17498 op = "NPU_SET_ACTIVATION_MIN"; 17499 v.disassemble(fields); 17500 break; 17501 } 17502 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) | 17503 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_ACTIVATION_MAX): 17504 { 17505 const npu_set_activation_max_t &v = *reinterpret_cast<const npu_set_activation_max_t *>(in); 17506 op = "NPU_SET_ACTIVATION_MAX"; 17507 v.disassemble(fields); 17508 break; 17509 } 17510 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) | 17511 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_WEIGHT_REGION): 17512 { 17513 const npu_set_weight_region_t &v = *reinterpret_cast<const npu_set_weight_region_t *>(in); 17514 op = "NPU_SET_WEIGHT_REGION"; 17515 v.disassemble(fields); 17516 break; 17517 } 17518 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) | 17519 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_SCALE_REGION): 17520 { 17521 const npu_set_scale_region_t &v = *reinterpret_cast<const npu_set_scale_region_t *>(in); 17522 op = "NPU_SET_SCALE_REGION"; 17523 v.disassemble(fields); 17524 break; 17525 } 17526 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) | 17527 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_AB_START): 17528 { 17529 const npu_set_ab_start_t &v = *reinterpret_cast<const npu_set_ab_start_t *>(in); 17530 op = "NPU_SET_AB_START"; 17531 v.disassemble(fields); 17532 break; 17533 } 17534 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) | 17535 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_BLOCKDEP): 17536 { 17537 const npu_set_blockdep_t &v = *reinterpret_cast<const npu_set_blockdep_t *>(in); 17538 op = "NPU_SET_BLOCKDEP"; 17539 v.disassemble(fields); 17540 break; 17541 } 17542 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) | 17543 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_DMA0_SRC_REGION): 17544 { 17545 const npu_set_dma0_src_region_t &v = *reinterpret_cast<const npu_set_dma0_src_region_t *>(in); 17546 op = "NPU_SET_DMA0_SRC_REGION"; 17547 v.disassemble(fields); 17548 break; 17549 } 17550 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) | 17551 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_DMA0_DST_REGION): 17552 { 17553 const npu_set_dma0_dst_region_t &v = *reinterpret_cast<const npu_set_dma0_dst_region_t *>(in); 17554 op = "NPU_SET_DMA0_DST_REGION"; 17555 v.disassemble(fields); 17556 break; 17557 } 17558 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) | 17559 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_DMA0_SIZE0): 17560 { 17561 const npu_set_dma0_size0_t &v = *reinterpret_cast<const npu_set_dma0_size0_t *>(in); 17562 op = "NPU_SET_DMA0_SIZE0"; 17563 v.disassemble(fields); 17564 break; 17565 } 17566 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) | 17567 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_DMA0_SIZE1): 17568 { 17569 const npu_set_dma0_size1_t &v = *reinterpret_cast<const npu_set_dma0_size1_t *>(in); 17570 op = "NPU_SET_DMA0_SIZE1"; 17571 v.disassemble(fields); 17572 break; 17573 } 17574 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) | 17575 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM2_BROADCAST): 17576 { 17577 const npu_set_ifm2_broadcast_t &v = *reinterpret_cast<const npu_set_ifm2_broadcast_t *>(in); 17578 op = "NPU_SET_IFM2_BROADCAST"; 17579 v.disassemble(fields); 17580 break; 17581 } 17582 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) | 17583 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM2_SCALAR): 17584 { 17585 const npu_set_ifm2_scalar_t &v = *reinterpret_cast<const npu_set_ifm2_scalar_t *>(in); 17586 op = "NPU_SET_IFM2_SCALAR"; 17587 v.disassemble(fields); 17588 break; 17589 } 17590 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) | 17591 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM2_PRECISION): 17592 { 17593 const npu_set_ifm2_precision_t &v = *reinterpret_cast<const npu_set_ifm2_precision_t *>(in); 17594 op = "NPU_SET_IFM2_PRECISION"; 17595 v.disassemble(fields); 17596 break; 17597 } 17598 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) | 17599 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM2_ZERO_POINT): 17600 { 17601 const npu_set_ifm2_zero_point_t &v = *reinterpret_cast<const npu_set_ifm2_zero_point_t *>(in); 17602 op = "NPU_SET_IFM2_ZERO_POINT"; 17603 v.disassemble(fields); 17604 break; 17605 } 17606 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) | 17607 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM2_WIDTH0_M1): 17608 { 17609 const npu_set_ifm2_width0_m1_t &v = *reinterpret_cast<const npu_set_ifm2_width0_m1_t *>(in); 17610 op = "NPU_SET_IFM2_WIDTH0_M1"; 17611 v.disassemble(fields); 17612 break; 17613 } 17614 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) | 17615 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM2_HEIGHT0_M1): 17616 { 17617 const npu_set_ifm2_height0_m1_t &v = *reinterpret_cast<const npu_set_ifm2_height0_m1_t *>(in); 17618 op = "NPU_SET_IFM2_HEIGHT0_M1"; 17619 v.disassemble(fields); 17620 break; 17621 } 17622 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) | 17623 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM2_HEIGHT1_M1): 17624 { 17625 const npu_set_ifm2_height1_m1_t &v = *reinterpret_cast<const npu_set_ifm2_height1_m1_t *>(in); 17626 op = "NPU_SET_IFM2_HEIGHT1_M1"; 17627 v.disassemble(fields); 17628 break; 17629 } 17630 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) | 17631 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM2_IB_START): 17632 { 17633 const npu_set_ifm2_ib_start_t &v = *reinterpret_cast<const npu_set_ifm2_ib_start_t *>(in); 17634 op = "NPU_SET_IFM2_IB_START"; 17635 v.disassemble(fields); 17636 break; 17637 } 17638 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL) << 14) | 17639 static_cast<uint32_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM2_REGION): 17640 { 17641 const npu_set_ifm2_region_t &v = *reinterpret_cast<const npu_set_ifm2_region_t *>(in); 17642 op = "NPU_SET_IFM2_REGION"; 17643 v.disassemble(fields); 17644 break; 17645 } 17646 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL) << 14) | 17647 static_cast<uint32_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM_BASE0): 17648 { 17649 const npu_set_ifm_base0_t &v = *reinterpret_cast<const npu_set_ifm_base0_t *>(in); 17650 op = "NPU_SET_IFM_BASE0"; 17651 v.disassemble(fields); 17652 break; 17653 } 17654 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL) << 14) | 17655 static_cast<uint32_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM_BASE1): 17656 { 17657 const npu_set_ifm_base1_t &v = *reinterpret_cast<const npu_set_ifm_base1_t *>(in); 17658 op = "NPU_SET_IFM_BASE1"; 17659 v.disassemble(fields); 17660 break; 17661 } 17662 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL) << 14) | 17663 static_cast<uint32_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM_BASE2): 17664 { 17665 const npu_set_ifm_base2_t &v = *reinterpret_cast<const npu_set_ifm_base2_t *>(in); 17666 op = "NPU_SET_IFM_BASE2"; 17667 v.disassemble(fields); 17668 break; 17669 } 17670 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL) << 14) | 17671 static_cast<uint32_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM_BASE3): 17672 { 17673 const npu_set_ifm_base3_t &v = *reinterpret_cast<const npu_set_ifm_base3_t *>(in); 17674 op = "NPU_SET_IFM_BASE3"; 17675 v.disassemble(fields); 17676 break; 17677 } 17678 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL) << 14) | 17679 static_cast<uint32_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM_STRIDE_X): 17680 { 17681 const npu_set_ifm_stride_x_t &v = *reinterpret_cast<const npu_set_ifm_stride_x_t *>(in); 17682 op = "NPU_SET_IFM_STRIDE_X"; 17683 v.disassemble(fields); 17684 break; 17685 } 17686 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL) << 14) | 17687 static_cast<uint32_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM_STRIDE_Y): 17688 { 17689 const npu_set_ifm_stride_y_t &v = *reinterpret_cast<const npu_set_ifm_stride_y_t *>(in); 17690 op = "NPU_SET_IFM_STRIDE_Y"; 17691 v.disassemble(fields); 17692 break; 17693 } 17694 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL) << 14) | 17695 static_cast<uint32_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM_STRIDE_C): 17696 { 17697 const npu_set_ifm_stride_c_t &v = *reinterpret_cast<const npu_set_ifm_stride_c_t *>(in); 17698 op = "NPU_SET_IFM_STRIDE_C"; 17699 v.disassemble(fields); 17700 break; 17701 } 17702 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL) << 14) | 17703 static_cast<uint32_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_OFM_BASE0): 17704 { 17705 const npu_set_ofm_base0_t &v = *reinterpret_cast<const npu_set_ofm_base0_t *>(in); 17706 op = "NPU_SET_OFM_BASE0"; 17707 v.disassemble(fields); 17708 break; 17709 } 17710 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL) << 14) | 17711 static_cast<uint32_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_OFM_BASE1): 17712 { 17713 const npu_set_ofm_base1_t &v = *reinterpret_cast<const npu_set_ofm_base1_t *>(in); 17714 op = "NPU_SET_OFM_BASE1"; 17715 v.disassemble(fields); 17716 break; 17717 } 17718 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL) << 14) | 17719 static_cast<uint32_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_OFM_BASE2): 17720 { 17721 const npu_set_ofm_base2_t &v = *reinterpret_cast<const npu_set_ofm_base2_t *>(in); 17722 op = "NPU_SET_OFM_BASE2"; 17723 v.disassemble(fields); 17724 break; 17725 } 17726 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL) << 14) | 17727 static_cast<uint32_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_OFM_BASE3): 17728 { 17729 const npu_set_ofm_base3_t &v = *reinterpret_cast<const npu_set_ofm_base3_t *>(in); 17730 op = "NPU_SET_OFM_BASE3"; 17731 v.disassemble(fields); 17732 break; 17733 } 17734 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL) << 14) | 17735 static_cast<uint32_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_OFM_STRIDE_X): 17736 { 17737 const npu_set_ofm_stride_x_t &v = *reinterpret_cast<const npu_set_ofm_stride_x_t *>(in); 17738 op = "NPU_SET_OFM_STRIDE_X"; 17739 v.disassemble(fields); 17740 break; 17741 } 17742 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL) << 14) | 17743 static_cast<uint32_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_OFM_STRIDE_Y): 17744 { 17745 const npu_set_ofm_stride_y_t &v = *reinterpret_cast<const npu_set_ofm_stride_y_t *>(in); 17746 op = "NPU_SET_OFM_STRIDE_Y"; 17747 v.disassemble(fields); 17748 break; 17749 } 17750 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL) << 14) | 17751 static_cast<uint32_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_OFM_STRIDE_C): 17752 { 17753 const npu_set_ofm_stride_c_t &v = *reinterpret_cast<const npu_set_ofm_stride_c_t *>(in); 17754 op = "NPU_SET_OFM_STRIDE_C"; 17755 v.disassemble(fields); 17756 break; 17757 } 17758 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL) << 14) | 17759 static_cast<uint32_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_WEIGHT_BASE): 17760 { 17761 const npu_set_weight_base_t &v = *reinterpret_cast<const npu_set_weight_base_t *>(in); 17762 op = "NPU_SET_WEIGHT_BASE"; 17763 v.disassemble(fields); 17764 break; 17765 } 17766 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL) << 14) | 17767 static_cast<uint32_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_WEIGHT_LENGTH): 17768 { 17769 const npu_set_weight_length_t &v = *reinterpret_cast<const npu_set_weight_length_t *>(in); 17770 op = "NPU_SET_WEIGHT_LENGTH"; 17771 v.disassemble(fields); 17772 break; 17773 } 17774 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL) << 14) | 17775 static_cast<uint32_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_SCALE_BASE): 17776 { 17777 const npu_set_scale_base_t &v = *reinterpret_cast<const npu_set_scale_base_t *>(in); 17778 op = "NPU_SET_SCALE_BASE"; 17779 v.disassemble(fields); 17780 break; 17781 } 17782 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL) << 14) | 17783 static_cast<uint32_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_SCALE_LENGTH): 17784 { 17785 const npu_set_scale_length_t &v = *reinterpret_cast<const npu_set_scale_length_t *>(in); 17786 op = "NPU_SET_SCALE_LENGTH"; 17787 v.disassemble(fields); 17788 break; 17789 } 17790 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL) << 14) | 17791 static_cast<uint32_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_OFM_SCALE): 17792 { 17793 const npu_set_ofm_scale_t &v = *reinterpret_cast<const npu_set_ofm_scale_t *>(in); 17794 op = "NPU_SET_OFM_SCALE"; 17795 v.disassemble(fields); 17796 break; 17797 } 17798 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL) << 14) | 17799 static_cast<uint32_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_OPA_SCALE): 17800 { 17801 const npu_set_opa_scale_t &v = *reinterpret_cast<const npu_set_opa_scale_t *>(in); 17802 op = "NPU_SET_OPA_SCALE"; 17803 v.disassemble(fields); 17804 break; 17805 } 17806 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL) << 14) | 17807 static_cast<uint32_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_OPB_SCALE): 17808 { 17809 const npu_set_opb_scale_t &v = *reinterpret_cast<const npu_set_opb_scale_t *>(in); 17810 op = "NPU_SET_OPB_SCALE"; 17811 v.disassemble(fields); 17812 break; 17813 } 17814 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL) << 14) | 17815 static_cast<uint32_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_DMA0_SRC): 17816 { 17817 const npu_set_dma0_src_t &v = *reinterpret_cast<const npu_set_dma0_src_t *>(in); 17818 op = "NPU_SET_DMA0_SRC"; 17819 v.disassemble(fields); 17820 break; 17821 } 17822 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL) << 14) | 17823 static_cast<uint32_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_DMA0_DST): 17824 { 17825 const npu_set_dma0_dst_t &v = *reinterpret_cast<const npu_set_dma0_dst_t *>(in); 17826 op = "NPU_SET_DMA0_DST"; 17827 v.disassemble(fields); 17828 break; 17829 } 17830 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL) << 14) | 17831 static_cast<uint32_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_DMA0_LEN): 17832 { 17833 const npu_set_dma0_len_t &v = *reinterpret_cast<const npu_set_dma0_len_t *>(in); 17834 op = "NPU_SET_DMA0_LEN"; 17835 v.disassemble(fields); 17836 break; 17837 } 17838 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL) << 14) | 17839 static_cast<uint32_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM2_BASE0): 17840 { 17841 const npu_set_ifm2_base0_t &v = *reinterpret_cast<const npu_set_ifm2_base0_t *>(in); 17842 op = "NPU_SET_IFM2_BASE0"; 17843 v.disassemble(fields); 17844 break; 17845 } 17846 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL) << 14) | 17847 static_cast<uint32_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM2_BASE1): 17848 { 17849 const npu_set_ifm2_base1_t &v = *reinterpret_cast<const npu_set_ifm2_base1_t *>(in); 17850 op = "NPU_SET_IFM2_BASE1"; 17851 v.disassemble(fields); 17852 break; 17853 } 17854 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL) << 14) | 17855 static_cast<uint32_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM2_BASE2): 17856 { 17857 const npu_set_ifm2_base2_t &v = *reinterpret_cast<const npu_set_ifm2_base2_t *>(in); 17858 op = "NPU_SET_IFM2_BASE2"; 17859 v.disassemble(fields); 17860 break; 17861 } 17862 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL) << 14) | 17863 static_cast<uint32_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM2_BASE3): 17864 { 17865 const npu_set_ifm2_base3_t &v = *reinterpret_cast<const npu_set_ifm2_base3_t *>(in); 17866 op = "NPU_SET_IFM2_BASE3"; 17867 v.disassemble(fields); 17868 break; 17869 } 17870 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL) << 14) | 17871 static_cast<uint32_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM2_STRIDE_X): 17872 { 17873 const npu_set_ifm2_stride_x_t &v = *reinterpret_cast<const npu_set_ifm2_stride_x_t *>(in); 17874 op = "NPU_SET_IFM2_STRIDE_X"; 17875 v.disassemble(fields); 17876 break; 17877 } 17878 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL) << 14) | 17879 static_cast<uint32_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM2_STRIDE_Y): 17880 { 17881 const npu_set_ifm2_stride_y_t &v = *reinterpret_cast<const npu_set_ifm2_stride_y_t *>(in); 17882 op = "NPU_SET_IFM2_STRIDE_Y"; 17883 v.disassemble(fields); 17884 break; 17885 } 17886 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL) << 14) | 17887 static_cast<uint32_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_IFM2_STRIDE_C): 17888 { 17889 const npu_set_ifm2_stride_c_t &v = *reinterpret_cast<const npu_set_ifm2_stride_c_t *>(in); 17890 op = "NPU_SET_IFM2_STRIDE_C"; 17891 v.disassemble(fields); 17892 break; 17893 } 17894 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL) << 14) | 17895 static_cast<uint32_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_USER_DEFINED0): 17896 { 17897 const npu_set_user_defined0_t &v = *reinterpret_cast<const npu_set_user_defined0_t *>(in); 17898 op = "NPU_SET_USER_DEFINED0"; 17899 v.disassemble(fields); 17900 break; 17901 } 17902 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL) << 14) | 17903 static_cast<uint32_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_USER_DEFINED1): 17904 { 17905 const npu_set_user_defined1_t &v = *reinterpret_cast<const npu_set_user_defined1_t *>(in); 17906 op = "NPU_SET_USER_DEFINED1"; 17907 v.disassemble(fields); 17908 break; 17909 } 17910 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL) << 14) | 17911 static_cast<uint32_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_USER_DEFINED2): 17912 { 17913 const npu_set_user_defined2_t &v = *reinterpret_cast<const npu_set_user_defined2_t *>(in); 17914 op = "NPU_SET_USER_DEFINED2"; 17915 v.disassemble(fields); 17916 break; 17917 } 17918 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL) << 14) | 17919 static_cast<uint32_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_USER_DEFINED3): 17920 { 17921 const npu_set_user_defined3_t &v = *reinterpret_cast<const npu_set_user_defined3_t *>(in); 17922 op = "NPU_SET_USER_DEFINED3"; 17923 v.disassemble(fields); 17924 break; 17925 } 17926 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL) << 14) | 17927 static_cast<uint32_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_USER_DEFINED4): 17928 { 17929 const npu_set_user_defined4_t &v = *reinterpret_cast<const npu_set_user_defined4_t *>(in); 17930 op = "NPU_SET_USER_DEFINED4"; 17931 v.disassemble(fields); 17932 break; 17933 } 17934 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL) << 14) | 17935 static_cast<uint32_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_USER_DEFINED5): 17936 { 17937 const npu_set_user_defined5_t &v = *reinterpret_cast<const npu_set_user_defined5_t *>(in); 17938 op = "NPU_SET_USER_DEFINED5"; 17939 v.disassemble(fields); 17940 break; 17941 } 17942 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL) << 14) | 17943 static_cast<uint32_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_USER_DEFINED6): 17944 { 17945 const npu_set_user_defined6_t &v = *reinterpret_cast<const npu_set_user_defined6_t *>(in); 17946 op = "NPU_SET_USER_DEFINED6"; 17947 v.disassemble(fields); 17948 break; 17949 } 17950 case (static_cast<uint32_t>(NPU_NAMESPACE::cmd_ctrl::CMD1_CTRL) << 14) | 17951 static_cast<uint32_t>(NPU_NAMESPACE::cmd1_opcode::NPU_SET_USER_DEFINED7): 17952 { 17953 const npu_set_user_defined7_t &v = *reinterpret_cast<const npu_set_user_defined7_t *>(in); 17954 op = "NPU_SET_USER_DEFINED7"; 17955 v.disassemble(fields); 17956 break; 17957 } 17958 } 17959 return (*in & (3 << 14)) != 0 ? 2 : 1; 17960 } 17961 #endif 17962 #endif 17963 // Signal the end of command stream 17964 struct npu_op_stop_t 17965 { 17966 #ifdef __cplusplus 17967 private: 17968 #endif 17969 uint32_t opcode : 10; // opcode 17970 uint32_t reserved0 : 4; 17971 uint32_t control : 2; // control 17972 uint32_t mask : 16; // Encoding for 16-bit mask value 17973 #ifdef __cplusplus 17974 public: npu_op_stop_tisa::npu_op_stop_t17975 npu_op_stop_t(uint32_t _mask) : 17976 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_STOP)), reserved0(0), 17977 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), mask(_mask & ((1U << 16) - 1)) 17978 { 17979 } npu_op_stop_tisa::npu_op_stop_t17980 CONSTEXPR npu_op_stop_t() : 17981 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_STOP)), reserved0(0), 17982 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), mask(0) 17983 { 17984 } validisa::npu_op_stop_t17985 CONSTEXPR bool valid() const 17986 { 17987 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_STOP) && 17988 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL); 17989 } initisa::npu_op_stop_t17990 CONSTEXPR void init() 17991 { 17992 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_STOP); 17993 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL); 17994 } uint32_tisa::npu_op_stop_t17995 operator uint32_t() 17996 { 17997 uint32_t word; 17998 std::memcpy(&word, this, sizeof(word)); 17999 return word; 18000 } get_opcodeisa::npu_op_stop_t18001 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const 18002 { 18003 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode); 18004 } set_opcodeisa::npu_op_stop_t18005 CONSTEXPR npu_op_stop_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value) 18006 { 18007 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1); 18008 return *this; 18009 } get_controlisa::npu_op_stop_t18010 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const 18011 { 18012 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control); 18013 } set_controlisa::npu_op_stop_t18014 CONSTEXPR npu_op_stop_t &set_control(NPU_NAMESPACE::cmd_ctrl value) 18015 { 18016 control = static_cast<uint8_t>(value) & ((1U << 2) - 1); 18017 return *this; 18018 } get_maskisa::npu_op_stop_t18019 CONSTEXPR uint32_t get_mask() const 18020 { 18021 return static_cast<uint32_t>(mask); 18022 } set_maskisa::npu_op_stop_t18023 CONSTEXPR npu_op_stop_t &set_mask(uint32_t value) 18024 { 18025 mask = static_cast<uint16_t>(value) & ((1U << 16) - 1); 18026 return *this; 18027 } 18028 #ifdef NPU_DISASSEMBLE disassembleisa::npu_op_stop_t18029 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const 18030 { 18031 fields.push_back(std::make_pair<std::string, std::string>("mask", std::to_string(mask))); 18032 } 18033 #endif 18034 #endif 18035 }; 18036 // Raises an IRQ to the host 18037 struct npu_op_irq_t 18038 { 18039 #ifdef __cplusplus 18040 private: 18041 #endif 18042 uint32_t opcode : 10; // opcode 18043 uint32_t reserved0 : 4; 18044 uint32_t control : 2; // control 18045 uint32_t mask : 16; // Encoding for 16-bit mask value 18046 #ifdef __cplusplus 18047 public: npu_op_irq_tisa::npu_op_irq_t18048 npu_op_irq_t(uint32_t _mask) : 18049 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_IRQ)), reserved0(0), 18050 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), mask(_mask & ((1U << 16) - 1)) 18051 { 18052 } npu_op_irq_tisa::npu_op_irq_t18053 CONSTEXPR npu_op_irq_t() : 18054 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_IRQ)), reserved0(0), 18055 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), mask(0) 18056 { 18057 } validisa::npu_op_irq_t18058 CONSTEXPR bool valid() const 18059 { 18060 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_IRQ) && 18061 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL); 18062 } initisa::npu_op_irq_t18063 CONSTEXPR void init() 18064 { 18065 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_IRQ); 18066 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL); 18067 } uint32_tisa::npu_op_irq_t18068 operator uint32_t() 18069 { 18070 uint32_t word; 18071 std::memcpy(&word, this, sizeof(word)); 18072 return word; 18073 } get_opcodeisa::npu_op_irq_t18074 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const 18075 { 18076 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode); 18077 } set_opcodeisa::npu_op_irq_t18078 CONSTEXPR npu_op_irq_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value) 18079 { 18080 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1); 18081 return *this; 18082 } get_controlisa::npu_op_irq_t18083 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const 18084 { 18085 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control); 18086 } set_controlisa::npu_op_irq_t18087 CONSTEXPR npu_op_irq_t &set_control(NPU_NAMESPACE::cmd_ctrl value) 18088 { 18089 control = static_cast<uint8_t>(value) & ((1U << 2) - 1); 18090 return *this; 18091 } get_maskisa::npu_op_irq_t18092 CONSTEXPR uint32_t get_mask() const 18093 { 18094 return static_cast<uint32_t>(mask); 18095 } set_maskisa::npu_op_irq_t18096 CONSTEXPR npu_op_irq_t &set_mask(uint32_t value) 18097 { 18098 mask = static_cast<uint16_t>(value) & ((1U << 16) - 1); 18099 return *this; 18100 } 18101 #ifdef NPU_DISASSEMBLE disassembleisa::npu_op_irq_t18102 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const 18103 { 18104 fields.push_back(std::make_pair<std::string, std::string>("mask", std::to_string(mask))); 18105 } 18106 #endif 18107 #endif 18108 }; 18109 // 2D convolution 18110 struct npu_op_conv_t 18111 { 18112 #ifdef __cplusplus 18113 private: 18114 #endif 18115 uint32_t opcode : 10; // opcode 18116 uint32_t reserved0 : 4; 18117 uint32_t control : 2; // control 18118 uint32_t reserved1 : 16; 18119 #ifdef __cplusplus 18120 public: npu_op_conv_tisa::npu_op_conv_t18121 CONSTEXPR npu_op_conv_t() : 18122 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_CONV)), reserved0(0), 18123 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), reserved1(0) 18124 { 18125 } validisa::npu_op_conv_t18126 CONSTEXPR bool valid() const 18127 { 18128 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_CONV) && 18129 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL); 18130 } initisa::npu_op_conv_t18131 CONSTEXPR void init() 18132 { 18133 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_CONV); 18134 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL); 18135 } uint32_tisa::npu_op_conv_t18136 operator uint32_t() 18137 { 18138 uint32_t word; 18139 std::memcpy(&word, this, sizeof(word)); 18140 return word; 18141 } get_opcodeisa::npu_op_conv_t18142 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const 18143 { 18144 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode); 18145 } set_opcodeisa::npu_op_conv_t18146 CONSTEXPR npu_op_conv_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value) 18147 { 18148 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1); 18149 return *this; 18150 } get_controlisa::npu_op_conv_t18151 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const 18152 { 18153 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control); 18154 } set_controlisa::npu_op_conv_t18155 CONSTEXPR npu_op_conv_t &set_control(NPU_NAMESPACE::cmd_ctrl value) 18156 { 18157 control = static_cast<uint8_t>(value) & ((1U << 2) - 1); 18158 return *this; 18159 } 18160 #ifdef NPU_DISASSEMBLE disassembleisa::npu_op_conv_t18161 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const {} 18162 #endif 18163 #endif 18164 }; 18165 // Depth-wise 2D convolution 18166 struct npu_op_depthwise_t 18167 { 18168 #ifdef __cplusplus 18169 private: 18170 #endif 18171 uint32_t opcode : 10; // opcode 18172 uint32_t reserved0 : 4; 18173 uint32_t control : 2; // control 18174 uint32_t reserved1 : 16; 18175 #ifdef __cplusplus 18176 public: npu_op_depthwise_tisa::npu_op_depthwise_t18177 CONSTEXPR npu_op_depthwise_t() : 18178 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_DEPTHWISE)), reserved0(0), 18179 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), reserved1(0) 18180 { 18181 } validisa::npu_op_depthwise_t18182 CONSTEXPR bool valid() const 18183 { 18184 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_DEPTHWISE) && 18185 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL); 18186 } initisa::npu_op_depthwise_t18187 CONSTEXPR void init() 18188 { 18189 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_DEPTHWISE); 18190 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL); 18191 } uint32_tisa::npu_op_depthwise_t18192 operator uint32_t() 18193 { 18194 uint32_t word; 18195 std::memcpy(&word, this, sizeof(word)); 18196 return word; 18197 } get_opcodeisa::npu_op_depthwise_t18198 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const 18199 { 18200 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode); 18201 } set_opcodeisa::npu_op_depthwise_t18202 CONSTEXPR npu_op_depthwise_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value) 18203 { 18204 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1); 18205 return *this; 18206 } get_controlisa::npu_op_depthwise_t18207 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const 18208 { 18209 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control); 18210 } set_controlisa::npu_op_depthwise_t18211 CONSTEXPR npu_op_depthwise_t &set_control(NPU_NAMESPACE::cmd_ctrl value) 18212 { 18213 control = static_cast<uint8_t>(value) & ((1U << 2) - 1); 18214 return *this; 18215 } 18216 #ifdef NPU_DISASSEMBLE disassembleisa::npu_op_depthwise_t18217 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const {} 18218 #endif 18219 #endif 18220 }; 18221 // Pooling 18222 struct npu_op_pool_t 18223 { 18224 #ifdef __cplusplus 18225 private: 18226 #endif 18227 uint32_t opcode : 10; // opcode 18228 uint32_t reserved0 : 4; 18229 uint32_t control : 2; // control 18230 uint32_t pooling_mode : 3; // Pooling mode 18231 uint32_t reserved1 : 13; 18232 #ifdef __cplusplus 18233 public: npu_op_pool_tisa::npu_op_pool_t18234 npu_op_pool_t(NPU_NAMESPACE::pooling_mode _pooling_mode) : 18235 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_POOL)), reserved0(0), 18236 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), 18237 pooling_mode(static_cast<uint8_t>(_pooling_mode) & ((1U << 3) - 1)), reserved1(0) 18238 { 18239 } npu_op_pool_tisa::npu_op_pool_t18240 CONSTEXPR npu_op_pool_t() : 18241 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_POOL)), reserved0(0), 18242 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), pooling_mode(0), reserved1(0) 18243 { 18244 } validisa::npu_op_pool_t18245 CONSTEXPR bool valid() const 18246 { 18247 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_POOL) && 18248 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL); 18249 } initisa::npu_op_pool_t18250 CONSTEXPR void init() 18251 { 18252 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_POOL); 18253 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL); 18254 } uint32_tisa::npu_op_pool_t18255 operator uint32_t() 18256 { 18257 uint32_t word; 18258 std::memcpy(&word, this, sizeof(word)); 18259 return word; 18260 } get_opcodeisa::npu_op_pool_t18261 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const 18262 { 18263 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode); 18264 } set_opcodeisa::npu_op_pool_t18265 CONSTEXPR npu_op_pool_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value) 18266 { 18267 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1); 18268 return *this; 18269 } get_controlisa::npu_op_pool_t18270 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const 18271 { 18272 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control); 18273 } set_controlisa::npu_op_pool_t18274 CONSTEXPR npu_op_pool_t &set_control(NPU_NAMESPACE::cmd_ctrl value) 18275 { 18276 control = static_cast<uint8_t>(value) & ((1U << 2) - 1); 18277 return *this; 18278 } get_pooling_modeisa::npu_op_pool_t18279 CONSTEXPR NPU_NAMESPACE::pooling_mode get_pooling_mode() const 18280 { 18281 return static_cast<NPU_NAMESPACE::pooling_mode>(pooling_mode); 18282 } set_pooling_modeisa::npu_op_pool_t18283 CONSTEXPR npu_op_pool_t &set_pooling_mode(NPU_NAMESPACE::pooling_mode value) 18284 { 18285 pooling_mode = static_cast<uint8_t>(value) & ((1U << 3) - 1); 18286 return *this; 18287 } 18288 #ifdef NPU_DISASSEMBLE disassembleisa::npu_op_pool_t18289 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const 18290 { 18291 fields.push_back(std::make_pair<std::string, std::string>( 18292 "pooling_mode", 18293 (pooling_mode < (sizeof(pooling_mode_str) / sizeof(pooling_mode_str[0])) ? 18294 pooling_mode_str[pooling_mode] : 18295 "****"))); 18296 } 18297 #endif 18298 #endif 18299 }; 18300 // Elementwise operation 18301 struct npu_op_elementwise_t 18302 { 18303 #ifdef __cplusplus 18304 private: 18305 #endif 18306 uint32_t opcode : 10; // opcode 18307 uint32_t reserved0 : 4; 18308 uint32_t control : 2; // control 18309 uint32_t elementwise_mode : 6; // Elementwise mode 18310 uint32_t reserved1 : 10; 18311 #ifdef __cplusplus 18312 public: npu_op_elementwise_tisa::npu_op_elementwise_t18313 npu_op_elementwise_t(NPU_NAMESPACE::elementwise_mode _elementwise_mode) : 18314 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_ELEMENTWISE)), reserved0(0), 18315 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), 18316 elementwise_mode(static_cast<uint8_t>(_elementwise_mode) & ((1U << 6) - 1)), reserved1(0) 18317 { 18318 } npu_op_elementwise_tisa::npu_op_elementwise_t18319 CONSTEXPR npu_op_elementwise_t() : 18320 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_ELEMENTWISE)), reserved0(0), 18321 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), elementwise_mode(0), reserved1(0) 18322 { 18323 } validisa::npu_op_elementwise_t18324 CONSTEXPR bool valid() const 18325 { 18326 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_ELEMENTWISE) && 18327 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL); 18328 } initisa::npu_op_elementwise_t18329 CONSTEXPR void init() 18330 { 18331 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_ELEMENTWISE); 18332 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL); 18333 } uint32_tisa::npu_op_elementwise_t18334 operator uint32_t() 18335 { 18336 uint32_t word; 18337 std::memcpy(&word, this, sizeof(word)); 18338 return word; 18339 } get_opcodeisa::npu_op_elementwise_t18340 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const 18341 { 18342 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode); 18343 } set_opcodeisa::npu_op_elementwise_t18344 CONSTEXPR npu_op_elementwise_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value) 18345 { 18346 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1); 18347 return *this; 18348 } get_controlisa::npu_op_elementwise_t18349 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const 18350 { 18351 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control); 18352 } set_controlisa::npu_op_elementwise_t18353 CONSTEXPR npu_op_elementwise_t &set_control(NPU_NAMESPACE::cmd_ctrl value) 18354 { 18355 control = static_cast<uint8_t>(value) & ((1U << 2) - 1); 18356 return *this; 18357 } get_elementwise_modeisa::npu_op_elementwise_t18358 CONSTEXPR NPU_NAMESPACE::elementwise_mode get_elementwise_mode() const 18359 { 18360 return static_cast<NPU_NAMESPACE::elementwise_mode>(elementwise_mode); 18361 } set_elementwise_modeisa::npu_op_elementwise_t18362 CONSTEXPR npu_op_elementwise_t &set_elementwise_mode(NPU_NAMESPACE::elementwise_mode value) 18363 { 18364 elementwise_mode = static_cast<uint8_t>(value) & ((1U << 6) - 1); 18365 return *this; 18366 } 18367 #ifdef NPU_DISASSEMBLE disassembleisa::npu_op_elementwise_t18368 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const 18369 { 18370 fields.push_back(std::make_pair<std::string, std::string>( 18371 "elementwise_mode", 18372 (elementwise_mode < (sizeof(elementwise_mode_str) / sizeof(elementwise_mode_str[0])) ? 18373 elementwise_mode_str[elementwise_mode] : 18374 "****"))); 18375 } 18376 #endif 18377 #endif 18378 }; 18379 // Queue new DMA for the given channel 18380 struct npu_op_dma_start_t 18381 { 18382 #ifdef __cplusplus 18383 private: 18384 #endif 18385 uint32_t opcode : 10; // opcode 18386 uint32_t reserved0 : 4; 18387 uint32_t control : 2; // control 18388 uint32_t reserved1 : 16; 18389 #ifdef __cplusplus 18390 public: npu_op_dma_start_tisa::npu_op_dma_start_t18391 CONSTEXPR npu_op_dma_start_t() : 18392 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_DMA_START)), reserved0(0), 18393 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), reserved1(0) 18394 { 18395 } validisa::npu_op_dma_start_t18396 CONSTEXPR bool valid() const 18397 { 18398 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_DMA_START) && 18399 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL); 18400 } initisa::npu_op_dma_start_t18401 CONSTEXPR void init() 18402 { 18403 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_DMA_START); 18404 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL); 18405 } uint32_tisa::npu_op_dma_start_t18406 operator uint32_t() 18407 { 18408 uint32_t word; 18409 std::memcpy(&word, this, sizeof(word)); 18410 return word; 18411 } get_opcodeisa::npu_op_dma_start_t18412 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const 18413 { 18414 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode); 18415 } set_opcodeisa::npu_op_dma_start_t18416 CONSTEXPR npu_op_dma_start_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value) 18417 { 18418 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1); 18419 return *this; 18420 } get_controlisa::npu_op_dma_start_t18421 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const 18422 { 18423 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control); 18424 } set_controlisa::npu_op_dma_start_t18425 CONSTEXPR npu_op_dma_start_t &set_control(NPU_NAMESPACE::cmd_ctrl value) 18426 { 18427 control = static_cast<uint8_t>(value) & ((1U << 2) - 1); 18428 return *this; 18429 } 18430 #ifdef NPU_DISASSEMBLE disassembleisa::npu_op_dma_start_t18431 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const {} 18432 #endif 18433 #endif 18434 }; 18435 // Wait for the DMA channel to have k or fewer active descriptors outstanding 18436 struct npu_op_dma_wait_t 18437 { 18438 #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 k : 4; // Number of outstanding descriptors 18445 uint32_t reserved1 : 12; 18446 #ifdef __cplusplus 18447 public: npu_op_dma_wait_tisa::npu_op_dma_wait_t18448 npu_op_dma_wait_t(uint32_t _k) : 18449 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_DMA_WAIT)), reserved0(0), 18450 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), k(_k & ((1U << 4) - 1)), reserved1(0) 18451 { 18452 } npu_op_dma_wait_tisa::npu_op_dma_wait_t18453 CONSTEXPR npu_op_dma_wait_t() : 18454 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_DMA_WAIT)), reserved0(0), 18455 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), k(0), reserved1(0) 18456 { 18457 } validisa::npu_op_dma_wait_t18458 CONSTEXPR bool valid() const 18459 { 18460 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_DMA_WAIT) && 18461 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL); 18462 } initisa::npu_op_dma_wait_t18463 CONSTEXPR void init() 18464 { 18465 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_DMA_WAIT); 18466 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL); 18467 } uint32_tisa::npu_op_dma_wait_t18468 operator uint32_t() 18469 { 18470 uint32_t word; 18471 std::memcpy(&word, this, sizeof(word)); 18472 return word; 18473 } get_opcodeisa::npu_op_dma_wait_t18474 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const 18475 { 18476 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode); 18477 } set_opcodeisa::npu_op_dma_wait_t18478 CONSTEXPR npu_op_dma_wait_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value) 18479 { 18480 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1); 18481 return *this; 18482 } get_controlisa::npu_op_dma_wait_t18483 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const 18484 { 18485 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control); 18486 } set_controlisa::npu_op_dma_wait_t18487 CONSTEXPR npu_op_dma_wait_t &set_control(NPU_NAMESPACE::cmd_ctrl value) 18488 { 18489 control = static_cast<uint8_t>(value) & ((1U << 2) - 1); 18490 return *this; 18491 } get_kisa::npu_op_dma_wait_t18492 CONSTEXPR uint32_t get_k() const 18493 { 18494 return static_cast<uint32_t>(k); 18495 } set_kisa::npu_op_dma_wait_t18496 CONSTEXPR npu_op_dma_wait_t &set_k(uint32_t value) 18497 { 18498 k = static_cast<uint8_t>(value) & ((1U << 4) - 1); 18499 return *this; 18500 } 18501 #ifdef NPU_DISASSEMBLE disassembleisa::npu_op_dma_wait_t18502 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const 18503 { 18504 fields.push_back(std::make_pair<std::string, std::string>("k", std::to_string(k))); 18505 } 18506 #endif 18507 #endif 18508 }; 18509 // Wait for n or fewer kernel operations to be remaining 18510 struct npu_op_kernel_wait_t 18511 { 18512 #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 n : 2; // Number of kernel operations in range 0-3 18519 uint32_t reserved1 : 14; 18520 #ifdef __cplusplus 18521 public: npu_op_kernel_wait_tisa::npu_op_kernel_wait_t18522 npu_op_kernel_wait_t(uint32_t _n) : 18523 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_KERNEL_WAIT)), reserved0(0), 18524 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), n(_n & ((1U << 2) - 1)), reserved1(0) 18525 { 18526 } npu_op_kernel_wait_tisa::npu_op_kernel_wait_t18527 CONSTEXPR npu_op_kernel_wait_t() : 18528 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_KERNEL_WAIT)), reserved0(0), 18529 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), n(0), reserved1(0) 18530 { 18531 } validisa::npu_op_kernel_wait_t18532 CONSTEXPR bool valid() const 18533 { 18534 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_KERNEL_WAIT) && 18535 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL); 18536 } initisa::npu_op_kernel_wait_t18537 CONSTEXPR void init() 18538 { 18539 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_KERNEL_WAIT); 18540 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL); 18541 } uint32_tisa::npu_op_kernel_wait_t18542 operator uint32_t() 18543 { 18544 uint32_t word; 18545 std::memcpy(&word, this, sizeof(word)); 18546 return word; 18547 } get_opcodeisa::npu_op_kernel_wait_t18548 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const 18549 { 18550 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode); 18551 } set_opcodeisa::npu_op_kernel_wait_t18552 CONSTEXPR npu_op_kernel_wait_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value) 18553 { 18554 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1); 18555 return *this; 18556 } get_controlisa::npu_op_kernel_wait_t18557 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const 18558 { 18559 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control); 18560 } set_controlisa::npu_op_kernel_wait_t18561 CONSTEXPR npu_op_kernel_wait_t &set_control(NPU_NAMESPACE::cmd_ctrl value) 18562 { 18563 control = static_cast<uint8_t>(value) & ((1U << 2) - 1); 18564 return *this; 18565 } get_nisa::npu_op_kernel_wait_t18566 CONSTEXPR uint32_t get_n() const 18567 { 18568 return static_cast<uint32_t>(n); 18569 } set_nisa::npu_op_kernel_wait_t18570 CONSTEXPR npu_op_kernel_wait_t &set_n(uint32_t value) 18571 { 18572 n = static_cast<uint8_t>(value) & ((1U << 2) - 1); 18573 return *this; 18574 } 18575 #ifdef NPU_DISASSEMBLE disassembleisa::npu_op_kernel_wait_t18576 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const 18577 { 18578 fields.push_back(std::make_pair<std::string, std::string>("n", std::to_string(n))); 18579 } 18580 #endif 18581 #endif 18582 }; 18583 // Enable or disable PMU counting (debug feature only) 18584 struct npu_op_pmu_mask_t 18585 { 18586 #ifdef __cplusplus 18587 private: 18588 #endif 18589 uint32_t opcode : 10; // opcode 18590 uint32_t reserved0 : 4; 18591 uint32_t control : 2; // control 18592 uint32_t enable : 1; // Enable or disable PMU mask 18593 uint32_t reserved1 : 15; 18594 #ifdef __cplusplus 18595 public: npu_op_pmu_mask_tisa::npu_op_pmu_mask_t18596 npu_op_pmu_mask_t(uint32_t _enable) : 18597 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_PMU_MASK)), reserved0(0), 18598 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), enable(_enable & ((1U << 1) - 1)), 18599 reserved1(0) 18600 { 18601 } npu_op_pmu_mask_tisa::npu_op_pmu_mask_t18602 CONSTEXPR npu_op_pmu_mask_t() : 18603 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_PMU_MASK)), reserved0(0), 18604 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), enable(0), reserved1(0) 18605 { 18606 } validisa::npu_op_pmu_mask_t18607 CONSTEXPR bool valid() const 18608 { 18609 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_PMU_MASK) && 18610 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL); 18611 } initisa::npu_op_pmu_mask_t18612 CONSTEXPR void init() 18613 { 18614 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_OP_PMU_MASK); 18615 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL); 18616 } uint32_tisa::npu_op_pmu_mask_t18617 operator uint32_t() 18618 { 18619 uint32_t word; 18620 std::memcpy(&word, this, sizeof(word)); 18621 return word; 18622 } get_opcodeisa::npu_op_pmu_mask_t18623 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const 18624 { 18625 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode); 18626 } set_opcodeisa::npu_op_pmu_mask_t18627 CONSTEXPR npu_op_pmu_mask_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value) 18628 { 18629 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1); 18630 return *this; 18631 } get_controlisa::npu_op_pmu_mask_t18632 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const 18633 { 18634 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control); 18635 } set_controlisa::npu_op_pmu_mask_t18636 CONSTEXPR npu_op_pmu_mask_t &set_control(NPU_NAMESPACE::cmd_ctrl value) 18637 { 18638 control = static_cast<uint8_t>(value) & ((1U << 2) - 1); 18639 return *this; 18640 } get_enableisa::npu_op_pmu_mask_t18641 CONSTEXPR uint32_t get_enable() const 18642 { 18643 return static_cast<uint32_t>(enable); 18644 } set_enableisa::npu_op_pmu_mask_t18645 CONSTEXPR npu_op_pmu_mask_t &set_enable(uint32_t value) 18646 { 18647 enable = static_cast<uint8_t>(value) & ((1U << 1) - 1); 18648 return *this; 18649 } 18650 #ifdef NPU_DISASSEMBLE disassembleisa::npu_op_pmu_mask_t18651 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const 18652 { 18653 fields.push_back(std::make_pair<std::string, std::string>("enable", std::to_string(enable))); 18654 } 18655 #endif 18656 #endif 18657 }; 18658 // IFM top pad 18659 struct npu_set_ifm_pad_top_t 18660 { 18661 #ifdef __cplusplus 18662 private: 18663 #endif 18664 uint32_t opcode : 10; // opcode 18665 uint32_t reserved0 : 4; 18666 uint32_t control : 2; // control 18667 uint32_t pad : 7; // IFM top pad 18668 uint32_t reserved1 : 9; 18669 #ifdef __cplusplus 18670 public: npu_set_ifm_pad_top_tisa::npu_set_ifm_pad_top_t18671 npu_set_ifm_pad_top_t(uint32_t _pad) : 18672 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_PAD_TOP)), reserved0(0), 18673 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), pad(_pad & ((1U << 7) - 1)), reserved1(0) 18674 { 18675 } npu_set_ifm_pad_top_tisa::npu_set_ifm_pad_top_t18676 CONSTEXPR npu_set_ifm_pad_top_t() : 18677 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_PAD_TOP)), reserved0(0), 18678 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), pad(0), reserved1(0) 18679 { 18680 } validisa::npu_set_ifm_pad_top_t18681 CONSTEXPR bool valid() const 18682 { 18683 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_PAD_TOP) && 18684 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL); 18685 } initisa::npu_set_ifm_pad_top_t18686 CONSTEXPR void init() 18687 { 18688 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_PAD_TOP); 18689 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL); 18690 } uint32_tisa::npu_set_ifm_pad_top_t18691 operator uint32_t() 18692 { 18693 uint32_t word; 18694 std::memcpy(&word, this, sizeof(word)); 18695 return word; 18696 } get_opcodeisa::npu_set_ifm_pad_top_t18697 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const 18698 { 18699 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode); 18700 } set_opcodeisa::npu_set_ifm_pad_top_t18701 CONSTEXPR npu_set_ifm_pad_top_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value) 18702 { 18703 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1); 18704 return *this; 18705 } get_controlisa::npu_set_ifm_pad_top_t18706 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const 18707 { 18708 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control); 18709 } set_controlisa::npu_set_ifm_pad_top_t18710 CONSTEXPR npu_set_ifm_pad_top_t &set_control(NPU_NAMESPACE::cmd_ctrl value) 18711 { 18712 control = static_cast<uint8_t>(value) & ((1U << 2) - 1); 18713 return *this; 18714 } get_padisa::npu_set_ifm_pad_top_t18715 CONSTEXPR uint32_t get_pad() const 18716 { 18717 return static_cast<uint32_t>(pad); 18718 } set_padisa::npu_set_ifm_pad_top_t18719 CONSTEXPR npu_set_ifm_pad_top_t &set_pad(uint32_t value) 18720 { 18721 pad = static_cast<uint8_t>(value) & ((1U << 7) - 1); 18722 return *this; 18723 } 18724 #ifdef NPU_DISASSEMBLE disassembleisa::npu_set_ifm_pad_top_t18725 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const 18726 { 18727 fields.push_back(std::make_pair<std::string, std::string>("pad", std::to_string(pad))); 18728 } 18729 #endif 18730 #endif 18731 }; 18732 // IFM left pad 18733 struct npu_set_ifm_pad_left_t 18734 { 18735 #ifdef __cplusplus 18736 private: 18737 #endif 18738 uint32_t opcode : 10; // opcode 18739 uint32_t reserved0 : 4; 18740 uint32_t control : 2; // control 18741 uint32_t pad : 7; // IFM left pad 18742 uint32_t reserved1 : 9; 18743 #ifdef __cplusplus 18744 public: npu_set_ifm_pad_left_tisa::npu_set_ifm_pad_left_t18745 npu_set_ifm_pad_left_t(uint32_t _pad) : 18746 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_PAD_LEFT)), reserved0(0), 18747 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), pad(_pad & ((1U << 7) - 1)), reserved1(0) 18748 { 18749 } npu_set_ifm_pad_left_tisa::npu_set_ifm_pad_left_t18750 CONSTEXPR npu_set_ifm_pad_left_t() : 18751 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_PAD_LEFT)), reserved0(0), 18752 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), pad(0), reserved1(0) 18753 { 18754 } validisa::npu_set_ifm_pad_left_t18755 CONSTEXPR bool valid() const 18756 { 18757 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_PAD_LEFT) && 18758 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL); 18759 } initisa::npu_set_ifm_pad_left_t18760 CONSTEXPR void init() 18761 { 18762 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_PAD_LEFT); 18763 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL); 18764 } uint32_tisa::npu_set_ifm_pad_left_t18765 operator uint32_t() 18766 { 18767 uint32_t word; 18768 std::memcpy(&word, this, sizeof(word)); 18769 return word; 18770 } get_opcodeisa::npu_set_ifm_pad_left_t18771 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const 18772 { 18773 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode); 18774 } set_opcodeisa::npu_set_ifm_pad_left_t18775 CONSTEXPR npu_set_ifm_pad_left_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value) 18776 { 18777 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1); 18778 return *this; 18779 } get_controlisa::npu_set_ifm_pad_left_t18780 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const 18781 { 18782 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control); 18783 } set_controlisa::npu_set_ifm_pad_left_t18784 CONSTEXPR npu_set_ifm_pad_left_t &set_control(NPU_NAMESPACE::cmd_ctrl value) 18785 { 18786 control = static_cast<uint8_t>(value) & ((1U << 2) - 1); 18787 return *this; 18788 } get_padisa::npu_set_ifm_pad_left_t18789 CONSTEXPR uint32_t get_pad() const 18790 { 18791 return static_cast<uint32_t>(pad); 18792 } set_padisa::npu_set_ifm_pad_left_t18793 CONSTEXPR npu_set_ifm_pad_left_t &set_pad(uint32_t value) 18794 { 18795 pad = static_cast<uint8_t>(value) & ((1U << 7) - 1); 18796 return *this; 18797 } 18798 #ifdef NPU_DISASSEMBLE disassembleisa::npu_set_ifm_pad_left_t18799 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const 18800 { 18801 fields.push_back(std::make_pair<std::string, std::string>("pad", std::to_string(pad))); 18802 } 18803 #endif 18804 #endif 18805 }; 18806 // IFM right pad 18807 struct npu_set_ifm_pad_right_t 18808 { 18809 #ifdef __cplusplus 18810 private: 18811 #endif 18812 uint32_t opcode : 10; // opcode 18813 uint32_t reserved0 : 4; 18814 uint32_t control : 2; // control 18815 uint32_t pad : 8; // IFM right pad. Max value is 128 18816 uint32_t reserved1 : 8; 18817 #ifdef __cplusplus 18818 public: npu_set_ifm_pad_right_tisa::npu_set_ifm_pad_right_t18819 npu_set_ifm_pad_right_t(uint32_t _pad) : 18820 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_PAD_RIGHT)), reserved0(0), 18821 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), pad(_pad & ((1U << 8) - 1)), reserved1(0) 18822 { 18823 } npu_set_ifm_pad_right_tisa::npu_set_ifm_pad_right_t18824 CONSTEXPR npu_set_ifm_pad_right_t() : 18825 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_PAD_RIGHT)), reserved0(0), 18826 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), pad(0), reserved1(0) 18827 { 18828 } validisa::npu_set_ifm_pad_right_t18829 CONSTEXPR bool valid() const 18830 { 18831 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_PAD_RIGHT) && 18832 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL); 18833 } initisa::npu_set_ifm_pad_right_t18834 CONSTEXPR void init() 18835 { 18836 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_PAD_RIGHT); 18837 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL); 18838 } uint32_tisa::npu_set_ifm_pad_right_t18839 operator uint32_t() 18840 { 18841 uint32_t word; 18842 std::memcpy(&word, this, sizeof(word)); 18843 return word; 18844 } get_opcodeisa::npu_set_ifm_pad_right_t18845 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const 18846 { 18847 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode); 18848 } set_opcodeisa::npu_set_ifm_pad_right_t18849 CONSTEXPR npu_set_ifm_pad_right_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value) 18850 { 18851 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1); 18852 return *this; 18853 } get_controlisa::npu_set_ifm_pad_right_t18854 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const 18855 { 18856 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control); 18857 } set_controlisa::npu_set_ifm_pad_right_t18858 CONSTEXPR npu_set_ifm_pad_right_t &set_control(NPU_NAMESPACE::cmd_ctrl value) 18859 { 18860 control = static_cast<uint8_t>(value) & ((1U << 2) - 1); 18861 return *this; 18862 } get_padisa::npu_set_ifm_pad_right_t18863 CONSTEXPR uint32_t get_pad() const 18864 { 18865 return static_cast<uint32_t>(pad); 18866 } set_padisa::npu_set_ifm_pad_right_t18867 CONSTEXPR npu_set_ifm_pad_right_t &set_pad(uint32_t value) 18868 { 18869 pad = static_cast<uint8_t>(value) & ((1U << 8) - 1); 18870 return *this; 18871 } 18872 #ifdef NPU_DISASSEMBLE disassembleisa::npu_set_ifm_pad_right_t18873 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const 18874 { 18875 fields.push_back(std::make_pair<std::string, std::string>("pad", std::to_string(pad))); 18876 } 18877 #endif 18878 #endif 18879 }; 18880 // IFM bottom pad 18881 struct npu_set_ifm_pad_bottom_t 18882 { 18883 #ifdef __cplusplus 18884 private: 18885 #endif 18886 uint32_t opcode : 10; // opcode 18887 uint32_t reserved0 : 4; 18888 uint32_t control : 2; // control 18889 uint32_t pad : 8; // IFM bottom pad. Max value is 128 18890 uint32_t reserved1 : 8; 18891 #ifdef __cplusplus 18892 public: npu_set_ifm_pad_bottom_tisa::npu_set_ifm_pad_bottom_t18893 npu_set_ifm_pad_bottom_t(uint32_t _pad) : 18894 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_PAD_BOTTOM)), reserved0(0), 18895 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), pad(_pad & ((1U << 8) - 1)), reserved1(0) 18896 { 18897 } npu_set_ifm_pad_bottom_tisa::npu_set_ifm_pad_bottom_t18898 CONSTEXPR npu_set_ifm_pad_bottom_t() : 18899 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_PAD_BOTTOM)), reserved0(0), 18900 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), pad(0), reserved1(0) 18901 { 18902 } validisa::npu_set_ifm_pad_bottom_t18903 CONSTEXPR bool valid() const 18904 { 18905 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_PAD_BOTTOM) && 18906 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL); 18907 } initisa::npu_set_ifm_pad_bottom_t18908 CONSTEXPR void init() 18909 { 18910 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_PAD_BOTTOM); 18911 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL); 18912 } uint32_tisa::npu_set_ifm_pad_bottom_t18913 operator uint32_t() 18914 { 18915 uint32_t word; 18916 std::memcpy(&word, this, sizeof(word)); 18917 return word; 18918 } get_opcodeisa::npu_set_ifm_pad_bottom_t18919 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const 18920 { 18921 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode); 18922 } set_opcodeisa::npu_set_ifm_pad_bottom_t18923 CONSTEXPR npu_set_ifm_pad_bottom_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value) 18924 { 18925 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1); 18926 return *this; 18927 } get_controlisa::npu_set_ifm_pad_bottom_t18928 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const 18929 { 18930 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control); 18931 } set_controlisa::npu_set_ifm_pad_bottom_t18932 CONSTEXPR npu_set_ifm_pad_bottom_t &set_control(NPU_NAMESPACE::cmd_ctrl value) 18933 { 18934 control = static_cast<uint8_t>(value) & ((1U << 2) - 1); 18935 return *this; 18936 } get_padisa::npu_set_ifm_pad_bottom_t18937 CONSTEXPR uint32_t get_pad() const 18938 { 18939 return static_cast<uint32_t>(pad); 18940 } set_padisa::npu_set_ifm_pad_bottom_t18941 CONSTEXPR npu_set_ifm_pad_bottom_t &set_pad(uint32_t value) 18942 { 18943 pad = static_cast<uint8_t>(value) & ((1U << 8) - 1); 18944 return *this; 18945 } 18946 #ifdef NPU_DISASSEMBLE disassembleisa::npu_set_ifm_pad_bottom_t18947 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const 18948 { 18949 fields.push_back(std::make_pair<std::string, std::string>("pad", std::to_string(pad))); 18950 } 18951 #endif 18952 #endif 18953 }; 18954 // Number of input channels for convolution 18955 struct npu_set_ifm_depth_m1_t 18956 { 18957 #ifdef __cplusplus 18958 private: 18959 #endif 18960 uint32_t opcode : 10; // opcode 18961 uint32_t reserved0 : 4; 18962 uint32_t control : 2; // control 18963 uint32_t depth_m1 : 16; // Number of input channels for convolution 18964 #ifdef __cplusplus 18965 public: npu_set_ifm_depth_m1_tisa::npu_set_ifm_depth_m1_t18966 npu_set_ifm_depth_m1_t(uint32_t _depth_m1) : 18967 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_DEPTH_M1)), reserved0(0), 18968 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), depth_m1(_depth_m1 & ((1U << 16) - 1)) 18969 { 18970 } npu_set_ifm_depth_m1_tisa::npu_set_ifm_depth_m1_t18971 CONSTEXPR npu_set_ifm_depth_m1_t() : 18972 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_DEPTH_M1)), reserved0(0), 18973 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), depth_m1(0) 18974 { 18975 } validisa::npu_set_ifm_depth_m1_t18976 CONSTEXPR bool valid() const 18977 { 18978 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_DEPTH_M1) && 18979 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL); 18980 } initisa::npu_set_ifm_depth_m1_t18981 CONSTEXPR void init() 18982 { 18983 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_DEPTH_M1); 18984 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL); 18985 } uint32_tisa::npu_set_ifm_depth_m1_t18986 operator uint32_t() 18987 { 18988 uint32_t word; 18989 std::memcpy(&word, this, sizeof(word)); 18990 return word; 18991 } get_opcodeisa::npu_set_ifm_depth_m1_t18992 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const 18993 { 18994 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode); 18995 } set_opcodeisa::npu_set_ifm_depth_m1_t18996 CONSTEXPR npu_set_ifm_depth_m1_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value) 18997 { 18998 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1); 18999 return *this; 19000 } get_controlisa::npu_set_ifm_depth_m1_t19001 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const 19002 { 19003 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control); 19004 } set_controlisa::npu_set_ifm_depth_m1_t19005 CONSTEXPR npu_set_ifm_depth_m1_t &set_control(NPU_NAMESPACE::cmd_ctrl value) 19006 { 19007 control = static_cast<uint8_t>(value) & ((1U << 2) - 1); 19008 return *this; 19009 } get_depth_m1isa::npu_set_ifm_depth_m1_t19010 CONSTEXPR uint32_t get_depth_m1() const 19011 { 19012 return static_cast<uint32_t>(depth_m1); 19013 } set_depth_m1isa::npu_set_ifm_depth_m1_t19014 CONSTEXPR npu_set_ifm_depth_m1_t &set_depth_m1(uint32_t value) 19015 { 19016 depth_m1 = static_cast<uint16_t>(value) & ((1U << 16) - 1); 19017 return *this; 19018 } 19019 #ifdef NPU_DISASSEMBLE disassembleisa::npu_set_ifm_depth_m1_t19020 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const 19021 { 19022 fields.push_back(std::make_pair<std::string, std::string>("depth_m1", std::to_string(depth_m1))); 19023 } 19024 #endif 19025 #endif 19026 }; 19027 // IFM Precision 19028 struct npu_set_ifm_precision_t 19029 { 19030 #ifdef __cplusplus 19031 private: 19032 #endif 19033 uint32_t opcode : 10; // opcode 19034 uint32_t reserved0 : 4; 19035 uint32_t control : 2; // control 19036 uint32_t activation_type : 1; // IFM type 19037 uint32_t reserved1 : 1; 19038 uint32_t activation_precision : 2; // IFM precision 19039 uint32_t reserved2 : 2; 19040 uint32_t activation_format : 2; // IFM format 19041 uint32_t scale_mode : 2; // IFM scale mode 19042 uint32_t reserved3 : 4; 19043 uint32_t round_mode : 2; // IFM round mode 19044 #ifdef __cplusplus 19045 public: npu_set_ifm_precision_tisa::npu_set_ifm_precision_t19046 npu_set_ifm_precision_t(NPU_NAMESPACE::activation_type _activation_type, 19047 NPU_NAMESPACE::activation_precision _activation_precision, 19048 NPU_NAMESPACE::activation_format _activation_format, 19049 NPU_NAMESPACE::ifm_scale_mode _scale_mode, 19050 NPU_NAMESPACE::round_mode _round_mode) : 19051 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_PRECISION)), 19052 reserved0(0), control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), 19053 activation_type(static_cast<uint8_t>(_activation_type) & ((1U << 1) - 1)), reserved1(0), 19054 activation_precision(static_cast<uint8_t>(_activation_precision) & ((1U << 2) - 1)), reserved2(0), 19055 activation_format(static_cast<uint8_t>(_activation_format) & ((1U << 2) - 1)), 19056 scale_mode(static_cast<uint8_t>(_scale_mode) & ((1U << 2) - 1)), reserved3(0), 19057 round_mode(static_cast<uint8_t>(_round_mode) & ((1U << 2) - 1)) 19058 { 19059 } npu_set_ifm_precision_tisa::npu_set_ifm_precision_t19060 CONSTEXPR npu_set_ifm_precision_t() : 19061 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_PRECISION)), reserved0(0), 19062 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), activation_type(0), reserved1(0), 19063 activation_precision(0), reserved2(0), activation_format(0), scale_mode(0), reserved3(0), round_mode(0) 19064 { 19065 } validisa::npu_set_ifm_precision_t19066 CONSTEXPR bool valid() const 19067 { 19068 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_PRECISION) && 19069 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL); 19070 } initisa::npu_set_ifm_precision_t19071 CONSTEXPR void init() 19072 { 19073 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_PRECISION); 19074 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL); 19075 } uint32_tisa::npu_set_ifm_precision_t19076 operator uint32_t() 19077 { 19078 uint32_t word; 19079 std::memcpy(&word, this, sizeof(word)); 19080 return word; 19081 } get_opcodeisa::npu_set_ifm_precision_t19082 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const 19083 { 19084 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode); 19085 } set_opcodeisa::npu_set_ifm_precision_t19086 CONSTEXPR npu_set_ifm_precision_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value) 19087 { 19088 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1); 19089 return *this; 19090 } get_controlisa::npu_set_ifm_precision_t19091 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const 19092 { 19093 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control); 19094 } set_controlisa::npu_set_ifm_precision_t19095 CONSTEXPR npu_set_ifm_precision_t &set_control(NPU_NAMESPACE::cmd_ctrl value) 19096 { 19097 control = static_cast<uint8_t>(value) & ((1U << 2) - 1); 19098 return *this; 19099 } get_activation_typeisa::npu_set_ifm_precision_t19100 CONSTEXPR NPU_NAMESPACE::activation_type get_activation_type() const 19101 { 19102 return static_cast<NPU_NAMESPACE::activation_type>(activation_type); 19103 } set_activation_typeisa::npu_set_ifm_precision_t19104 CONSTEXPR npu_set_ifm_precision_t &set_activation_type(NPU_NAMESPACE::activation_type value) 19105 { 19106 activation_type = static_cast<uint8_t>(value) & ((1U << 1) - 1); 19107 return *this; 19108 } get_activation_precisionisa::npu_set_ifm_precision_t19109 CONSTEXPR NPU_NAMESPACE::activation_precision get_activation_precision() const 19110 { 19111 return static_cast<NPU_NAMESPACE::activation_precision>(activation_precision); 19112 } set_activation_precisionisa::npu_set_ifm_precision_t19113 CONSTEXPR npu_set_ifm_precision_t &set_activation_precision(NPU_NAMESPACE::activation_precision value) 19114 { 19115 activation_precision = static_cast<uint8_t>(value) & ((1U << 2) - 1); 19116 return *this; 19117 } get_activation_formatisa::npu_set_ifm_precision_t19118 CONSTEXPR NPU_NAMESPACE::activation_format get_activation_format() const 19119 { 19120 return static_cast<NPU_NAMESPACE::activation_format>(activation_format); 19121 } set_activation_formatisa::npu_set_ifm_precision_t19122 CONSTEXPR npu_set_ifm_precision_t &set_activation_format(NPU_NAMESPACE::activation_format value) 19123 { 19124 activation_format = static_cast<uint8_t>(value) & ((1U << 2) - 1); 19125 return *this; 19126 } get_scale_modeisa::npu_set_ifm_precision_t19127 CONSTEXPR NPU_NAMESPACE::ifm_scale_mode get_scale_mode() const 19128 { 19129 return static_cast<NPU_NAMESPACE::ifm_scale_mode>(scale_mode); 19130 } set_scale_modeisa::npu_set_ifm_precision_t19131 CONSTEXPR npu_set_ifm_precision_t &set_scale_mode(NPU_NAMESPACE::ifm_scale_mode value) 19132 { 19133 scale_mode = static_cast<uint8_t>(value) & ((1U << 2) - 1); 19134 return *this; 19135 } get_round_modeisa::npu_set_ifm_precision_t19136 CONSTEXPR NPU_NAMESPACE::round_mode get_round_mode() const 19137 { 19138 return static_cast<NPU_NAMESPACE::round_mode>(round_mode); 19139 } set_round_modeisa::npu_set_ifm_precision_t19140 CONSTEXPR npu_set_ifm_precision_t &set_round_mode(NPU_NAMESPACE::round_mode value) 19141 { 19142 round_mode = static_cast<uint8_t>(value) & ((1U << 2) - 1); 19143 return *this; 19144 } 19145 #ifdef NPU_DISASSEMBLE disassembleisa::npu_set_ifm_precision_t19146 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const 19147 { 19148 fields.push_back(std::make_pair<std::string, std::string>( 19149 "activation_type", 19150 (activation_type < (sizeof(activation_type_str) / sizeof(activation_type_str[0])) ? 19151 activation_type_str[activation_type] : 19152 "****"))); 19153 fields.push_back(std::make_pair<std::string, std::string>( 19154 "activation_precision", 19155 (activation_precision < (sizeof(activation_precision_str) / sizeof(activation_precision_str[0])) ? 19156 activation_precision_str[activation_precision] : 19157 "****"))); 19158 fields.push_back(std::make_pair<std::string, std::string>( 19159 "activation_format", 19160 (activation_format < (sizeof(activation_format_str) / sizeof(activation_format_str[0])) ? 19161 activation_format_str[activation_format] : 19162 "****"))); 19163 fields.push_back(std::make_pair<std::string, std::string>( 19164 "scale_mode", 19165 (scale_mode < (sizeof(ifm_scale_mode_str) / sizeof(ifm_scale_mode_str[0])) ? 19166 ifm_scale_mode_str[scale_mode] : 19167 "****"))); 19168 fields.push_back(std::make_pair<std::string, std::string>( 19169 "round_mode", 19170 (round_mode < (sizeof(round_mode_str) / sizeof(round_mode_str[0])) ? round_mode_str[round_mode] : 19171 "****"))); 19172 } 19173 #endif 19174 #endif 19175 }; 19176 // IFM upscale mode 19177 struct npu_set_ifm_upscale_t 19178 { 19179 #ifdef __cplusplus 19180 private: 19181 #endif 19182 uint32_t opcode : 10; // opcode 19183 uint32_t reserved0 : 4; 19184 uint32_t control : 2; // control 19185 uint32_t mode : 2; // IFM upscale mode 19186 uint32_t reserved1 : 14; 19187 #ifdef __cplusplus 19188 public: npu_set_ifm_upscale_tisa::npu_set_ifm_upscale_t19189 npu_set_ifm_upscale_t(NPU_NAMESPACE::ifm_upscale_mode _mode) : 19190 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_UPSCALE)), reserved0(0), 19191 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), 19192 mode(static_cast<uint8_t>(_mode) & ((1U << 2) - 1)), reserved1(0) 19193 { 19194 } npu_set_ifm_upscale_tisa::npu_set_ifm_upscale_t19195 CONSTEXPR npu_set_ifm_upscale_t() : 19196 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_UPSCALE)), reserved0(0), 19197 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), mode(0), reserved1(0) 19198 { 19199 } validisa::npu_set_ifm_upscale_t19200 CONSTEXPR bool valid() const 19201 { 19202 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_UPSCALE) && 19203 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL); 19204 } initisa::npu_set_ifm_upscale_t19205 CONSTEXPR void init() 19206 { 19207 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_UPSCALE); 19208 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL); 19209 } uint32_tisa::npu_set_ifm_upscale_t19210 operator uint32_t() 19211 { 19212 uint32_t word; 19213 std::memcpy(&word, this, sizeof(word)); 19214 return word; 19215 } get_opcodeisa::npu_set_ifm_upscale_t19216 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const 19217 { 19218 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode); 19219 } set_opcodeisa::npu_set_ifm_upscale_t19220 CONSTEXPR npu_set_ifm_upscale_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value) 19221 { 19222 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1); 19223 return *this; 19224 } get_controlisa::npu_set_ifm_upscale_t19225 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const 19226 { 19227 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control); 19228 } set_controlisa::npu_set_ifm_upscale_t19229 CONSTEXPR npu_set_ifm_upscale_t &set_control(NPU_NAMESPACE::cmd_ctrl value) 19230 { 19231 control = static_cast<uint8_t>(value) & ((1U << 2) - 1); 19232 return *this; 19233 } get_modeisa::npu_set_ifm_upscale_t19234 CONSTEXPR NPU_NAMESPACE::ifm_upscale_mode get_mode() const 19235 { 19236 return static_cast<NPU_NAMESPACE::ifm_upscale_mode>(mode); 19237 } set_modeisa::npu_set_ifm_upscale_t19238 CONSTEXPR npu_set_ifm_upscale_t &set_mode(NPU_NAMESPACE::ifm_upscale_mode value) 19239 { 19240 mode = static_cast<uint8_t>(value) & ((1U << 2) - 1); 19241 return *this; 19242 } 19243 #ifdef NPU_DISASSEMBLE disassembleisa::npu_set_ifm_upscale_t19244 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const 19245 { 19246 fields.push_back(std::make_pair<std::string, std::string>( 19247 "mode", 19248 (mode < (sizeof(ifm_upscale_mode_str) / sizeof(ifm_upscale_mode_str[0])) ? ifm_upscale_mode_str[mode] : 19249 "****"))); 19250 } 19251 #endif 19252 #endif 19253 }; 19254 // IFM zero point 19255 struct npu_set_ifm_zero_point_t 19256 { 19257 #ifdef __cplusplus 19258 private: 19259 #endif 19260 uint32_t opcode : 10; // opcode 19261 uint32_t reserved0 : 4; 19262 uint32_t control : 2; // control 19263 uint32_t zero_point : 16; // Zero point offset 19264 #ifdef __cplusplus 19265 public: npu_set_ifm_zero_point_tisa::npu_set_ifm_zero_point_t19266 npu_set_ifm_zero_point_t(uint32_t _zero_point) : 19267 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_ZERO_POINT)), reserved0(0), 19268 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), 19269 zero_point(_zero_point & ((1U << 16) - 1)) 19270 { 19271 } npu_set_ifm_zero_point_tisa::npu_set_ifm_zero_point_t19272 CONSTEXPR npu_set_ifm_zero_point_t() : 19273 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_ZERO_POINT)), reserved0(0), 19274 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), zero_point(0) 19275 { 19276 } validisa::npu_set_ifm_zero_point_t19277 CONSTEXPR bool valid() const 19278 { 19279 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_ZERO_POINT) && 19280 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL); 19281 } initisa::npu_set_ifm_zero_point_t19282 CONSTEXPR void init() 19283 { 19284 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_ZERO_POINT); 19285 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL); 19286 } uint32_tisa::npu_set_ifm_zero_point_t19287 operator uint32_t() 19288 { 19289 uint32_t word; 19290 std::memcpy(&word, this, sizeof(word)); 19291 return word; 19292 } get_opcodeisa::npu_set_ifm_zero_point_t19293 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const 19294 { 19295 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode); 19296 } set_opcodeisa::npu_set_ifm_zero_point_t19297 CONSTEXPR npu_set_ifm_zero_point_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value) 19298 { 19299 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1); 19300 return *this; 19301 } get_controlisa::npu_set_ifm_zero_point_t19302 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const 19303 { 19304 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control); 19305 } set_controlisa::npu_set_ifm_zero_point_t19306 CONSTEXPR npu_set_ifm_zero_point_t &set_control(NPU_NAMESPACE::cmd_ctrl value) 19307 { 19308 control = static_cast<uint8_t>(value) & ((1U << 2) - 1); 19309 return *this; 19310 } get_zero_pointisa::npu_set_ifm_zero_point_t19311 CONSTEXPR uint32_t get_zero_point() const 19312 { 19313 return static_cast<uint32_t>(zero_point); 19314 } set_zero_pointisa::npu_set_ifm_zero_point_t19315 CONSTEXPR npu_set_ifm_zero_point_t &set_zero_point(uint32_t value) 19316 { 19317 zero_point = static_cast<uint16_t>(value) & ((1U << 16) - 1); 19318 return *this; 19319 } 19320 #ifdef NPU_DISASSEMBLE disassembleisa::npu_set_ifm_zero_point_t19321 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const 19322 { 19323 fields.push_back(std::make_pair<std::string, std::string>("zero_point", std::to_string(zero_point))); 19324 } 19325 #endif 19326 #endif 19327 }; 19328 // IFM Tile 0 and tile 2 width 19329 struct npu_set_ifm_width0_m1_t 19330 { 19331 #ifdef __cplusplus 19332 private: 19333 #endif 19334 uint32_t opcode : 10; // opcode 19335 uint32_t reserved0 : 4; 19336 uint32_t control : 2; // control 19337 uint32_t width_m1 : 16; // IFM Tile 0 and tile 2 width 19338 #ifdef __cplusplus 19339 public: npu_set_ifm_width0_m1_tisa::npu_set_ifm_width0_m1_t19340 npu_set_ifm_width0_m1_t(uint32_t _width_m1) : 19341 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_WIDTH0_M1)), reserved0(0), 19342 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), width_m1(_width_m1 & ((1U << 16) - 1)) 19343 { 19344 } npu_set_ifm_width0_m1_tisa::npu_set_ifm_width0_m1_t19345 CONSTEXPR npu_set_ifm_width0_m1_t() : 19346 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_WIDTH0_M1)), reserved0(0), 19347 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), width_m1(0) 19348 { 19349 } validisa::npu_set_ifm_width0_m1_t19350 CONSTEXPR bool valid() const 19351 { 19352 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_WIDTH0_M1) && 19353 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL); 19354 } initisa::npu_set_ifm_width0_m1_t19355 CONSTEXPR void init() 19356 { 19357 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_WIDTH0_M1); 19358 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL); 19359 } uint32_tisa::npu_set_ifm_width0_m1_t19360 operator uint32_t() 19361 { 19362 uint32_t word; 19363 std::memcpy(&word, this, sizeof(word)); 19364 return word; 19365 } get_opcodeisa::npu_set_ifm_width0_m1_t19366 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const 19367 { 19368 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode); 19369 } set_opcodeisa::npu_set_ifm_width0_m1_t19370 CONSTEXPR npu_set_ifm_width0_m1_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value) 19371 { 19372 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1); 19373 return *this; 19374 } get_controlisa::npu_set_ifm_width0_m1_t19375 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const 19376 { 19377 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control); 19378 } set_controlisa::npu_set_ifm_width0_m1_t19379 CONSTEXPR npu_set_ifm_width0_m1_t &set_control(NPU_NAMESPACE::cmd_ctrl value) 19380 { 19381 control = static_cast<uint8_t>(value) & ((1U << 2) - 1); 19382 return *this; 19383 } get_width_m1isa::npu_set_ifm_width0_m1_t19384 CONSTEXPR uint32_t get_width_m1() const 19385 { 19386 return static_cast<uint32_t>(width_m1); 19387 } set_width_m1isa::npu_set_ifm_width0_m1_t19388 CONSTEXPR npu_set_ifm_width0_m1_t &set_width_m1(uint32_t value) 19389 { 19390 width_m1 = static_cast<uint16_t>(value) & ((1U << 16) - 1); 19391 return *this; 19392 } 19393 #ifdef NPU_DISASSEMBLE disassembleisa::npu_set_ifm_width0_m1_t19394 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const 19395 { 19396 fields.push_back(std::make_pair<std::string, std::string>("width_m1", std::to_string(width_m1))); 19397 } 19398 #endif 19399 #endif 19400 }; 19401 // IFM Tile 0 height 19402 struct npu_set_ifm_height0_m1_t 19403 { 19404 #ifdef __cplusplus 19405 private: 19406 #endif 19407 uint32_t opcode : 10; // opcode 19408 uint32_t reserved0 : 4; 19409 uint32_t control : 2; // control 19410 uint32_t height_m1 : 16; // IFM Tile 0 height 19411 #ifdef __cplusplus 19412 public: npu_set_ifm_height0_m1_tisa::npu_set_ifm_height0_m1_t19413 npu_set_ifm_height0_m1_t(uint32_t _height_m1) : 19414 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_HEIGHT0_M1)), reserved0(0), 19415 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), height_m1(_height_m1 & ((1U << 16) - 1)) 19416 { 19417 } npu_set_ifm_height0_m1_tisa::npu_set_ifm_height0_m1_t19418 CONSTEXPR npu_set_ifm_height0_m1_t() : 19419 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_HEIGHT0_M1)), reserved0(0), 19420 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), height_m1(0) 19421 { 19422 } validisa::npu_set_ifm_height0_m1_t19423 CONSTEXPR bool valid() const 19424 { 19425 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_HEIGHT0_M1) && 19426 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL); 19427 } initisa::npu_set_ifm_height0_m1_t19428 CONSTEXPR void init() 19429 { 19430 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_HEIGHT0_M1); 19431 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL); 19432 } uint32_tisa::npu_set_ifm_height0_m1_t19433 operator uint32_t() 19434 { 19435 uint32_t word; 19436 std::memcpy(&word, this, sizeof(word)); 19437 return word; 19438 } get_opcodeisa::npu_set_ifm_height0_m1_t19439 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const 19440 { 19441 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode); 19442 } set_opcodeisa::npu_set_ifm_height0_m1_t19443 CONSTEXPR npu_set_ifm_height0_m1_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value) 19444 { 19445 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1); 19446 return *this; 19447 } get_controlisa::npu_set_ifm_height0_m1_t19448 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const 19449 { 19450 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control); 19451 } set_controlisa::npu_set_ifm_height0_m1_t19452 CONSTEXPR npu_set_ifm_height0_m1_t &set_control(NPU_NAMESPACE::cmd_ctrl value) 19453 { 19454 control = static_cast<uint8_t>(value) & ((1U << 2) - 1); 19455 return *this; 19456 } get_height_m1isa::npu_set_ifm_height0_m1_t19457 CONSTEXPR uint32_t get_height_m1() const 19458 { 19459 return static_cast<uint32_t>(height_m1); 19460 } set_height_m1isa::npu_set_ifm_height0_m1_t19461 CONSTEXPR npu_set_ifm_height0_m1_t &set_height_m1(uint32_t value) 19462 { 19463 height_m1 = static_cast<uint16_t>(value) & ((1U << 16) - 1); 19464 return *this; 19465 } 19466 #ifdef NPU_DISASSEMBLE disassembleisa::npu_set_ifm_height0_m1_t19467 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const 19468 { 19469 fields.push_back(std::make_pair<std::string, std::string>("height_m1", std::to_string(height_m1))); 19470 } 19471 #endif 19472 #endif 19473 }; 19474 // IFM Tile 1 height 19475 struct npu_set_ifm_height1_m1_t 19476 { 19477 #ifdef __cplusplus 19478 private: 19479 #endif 19480 uint32_t opcode : 10; // opcode 19481 uint32_t reserved0 : 4; 19482 uint32_t control : 2; // control 19483 uint32_t height_m1 : 16; // IFM Tile 1 height 19484 #ifdef __cplusplus 19485 public: npu_set_ifm_height1_m1_tisa::npu_set_ifm_height1_m1_t19486 npu_set_ifm_height1_m1_t(uint32_t _height_m1) : 19487 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_HEIGHT1_M1)), reserved0(0), 19488 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), height_m1(_height_m1 & ((1U << 16) - 1)) 19489 { 19490 } npu_set_ifm_height1_m1_tisa::npu_set_ifm_height1_m1_t19491 CONSTEXPR npu_set_ifm_height1_m1_t() : 19492 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_HEIGHT1_M1)), reserved0(0), 19493 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), height_m1(0) 19494 { 19495 } validisa::npu_set_ifm_height1_m1_t19496 CONSTEXPR bool valid() const 19497 { 19498 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_HEIGHT1_M1) && 19499 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL); 19500 } initisa::npu_set_ifm_height1_m1_t19501 CONSTEXPR void init() 19502 { 19503 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_HEIGHT1_M1); 19504 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL); 19505 } uint32_tisa::npu_set_ifm_height1_m1_t19506 operator uint32_t() 19507 { 19508 uint32_t word; 19509 std::memcpy(&word, this, sizeof(word)); 19510 return word; 19511 } get_opcodeisa::npu_set_ifm_height1_m1_t19512 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const 19513 { 19514 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode); 19515 } set_opcodeisa::npu_set_ifm_height1_m1_t19516 CONSTEXPR npu_set_ifm_height1_m1_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value) 19517 { 19518 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1); 19519 return *this; 19520 } get_controlisa::npu_set_ifm_height1_m1_t19521 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const 19522 { 19523 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control); 19524 } set_controlisa::npu_set_ifm_height1_m1_t19525 CONSTEXPR npu_set_ifm_height1_m1_t &set_control(NPU_NAMESPACE::cmd_ctrl value) 19526 { 19527 control = static_cast<uint8_t>(value) & ((1U << 2) - 1); 19528 return *this; 19529 } get_height_m1isa::npu_set_ifm_height1_m1_t19530 CONSTEXPR uint32_t get_height_m1() const 19531 { 19532 return static_cast<uint32_t>(height_m1); 19533 } set_height_m1isa::npu_set_ifm_height1_m1_t19534 CONSTEXPR npu_set_ifm_height1_m1_t &set_height_m1(uint32_t value) 19535 { 19536 height_m1 = static_cast<uint16_t>(value) & ((1U << 16) - 1); 19537 return *this; 19538 } 19539 #ifdef NPU_DISASSEMBLE disassembleisa::npu_set_ifm_height1_m1_t19540 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const 19541 { 19542 fields.push_back(std::make_pair<std::string, std::string>("height_m1", std::to_string(height_m1))); 19543 } 19544 #endif 19545 #endif 19546 }; 19547 // End of IB0,IB1 buffers 19548 struct npu_set_ifm_ib_end_t 19549 { 19550 #ifdef __cplusplus 19551 private: 19552 #endif 19553 uint32_t opcode : 10; // opcode 19554 uint32_t reserved0 : 4; 19555 uint32_t control : 2; // control 19556 uint32_t ib_end : 6; // End of IB0,IB1 buffers in the SHRAM in KB units. Multiple of 2 19557 uint32_t reserved1 : 10; 19558 #ifdef __cplusplus 19559 public: npu_set_ifm_ib_end_tisa::npu_set_ifm_ib_end_t19560 npu_set_ifm_ib_end_t(uint32_t _ib_end) : 19561 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_IB_END)), reserved0(0), 19562 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), ib_end(_ib_end & ((1U << 6) - 1)), 19563 reserved1(0) 19564 { 19565 } npu_set_ifm_ib_end_tisa::npu_set_ifm_ib_end_t19566 CONSTEXPR npu_set_ifm_ib_end_t() : 19567 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_IB_END)), reserved0(0), 19568 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), ib_end(0), reserved1(0) 19569 { 19570 } validisa::npu_set_ifm_ib_end_t19571 CONSTEXPR bool valid() const 19572 { 19573 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_IB_END) && 19574 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL); 19575 } initisa::npu_set_ifm_ib_end_t19576 CONSTEXPR void init() 19577 { 19578 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_IB_END); 19579 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL); 19580 } uint32_tisa::npu_set_ifm_ib_end_t19581 operator uint32_t() 19582 { 19583 uint32_t word; 19584 std::memcpy(&word, this, sizeof(word)); 19585 return word; 19586 } get_opcodeisa::npu_set_ifm_ib_end_t19587 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const 19588 { 19589 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode); 19590 } set_opcodeisa::npu_set_ifm_ib_end_t19591 CONSTEXPR npu_set_ifm_ib_end_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value) 19592 { 19593 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1); 19594 return *this; 19595 } get_controlisa::npu_set_ifm_ib_end_t19596 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const 19597 { 19598 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control); 19599 } set_controlisa::npu_set_ifm_ib_end_t19600 CONSTEXPR npu_set_ifm_ib_end_t &set_control(NPU_NAMESPACE::cmd_ctrl value) 19601 { 19602 control = static_cast<uint8_t>(value) & ((1U << 2) - 1); 19603 return *this; 19604 } get_ib_endisa::npu_set_ifm_ib_end_t19605 CONSTEXPR uint32_t get_ib_end() const 19606 { 19607 return static_cast<uint32_t>(ib_end); 19608 } set_ib_endisa::npu_set_ifm_ib_end_t19609 CONSTEXPR npu_set_ifm_ib_end_t &set_ib_end(uint32_t value) 19610 { 19611 ib_end = static_cast<uint8_t>(value) & ((1U << 6) - 1); 19612 return *this; 19613 } 19614 #ifdef NPU_DISASSEMBLE disassembleisa::npu_set_ifm_ib_end_t19615 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const 19616 { 19617 fields.push_back(std::make_pair<std::string, std::string>("ib_end", std::to_string(ib_end))); 19618 } 19619 #endif 19620 #endif 19621 }; 19622 // Index n for IFM access 19623 struct npu_set_ifm_region_t 19624 { 19625 #ifdef __cplusplus 19626 private: 19627 #endif 19628 uint32_t opcode : 10; // opcode 19629 uint32_t reserved0 : 4; 19630 uint32_t control : 2; // control 19631 uint32_t region : 3; // Region number n 19632 uint32_t reserved1 : 12; 19633 uint32_t custom_dma_cs : 1; // Custom DMA select 19634 #ifdef __cplusplus 19635 public: npu_set_ifm_region_tisa::npu_set_ifm_region_t19636 npu_set_ifm_region_t(uint32_t _region, NPU_NAMESPACE::custom_dma_cs _custom_dma_cs) : 19637 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_REGION)), reserved0(0), 19638 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), region(_region & ((1U << 3) - 1)), 19639 reserved1(0), custom_dma_cs(static_cast<uint8_t>(_custom_dma_cs) & ((1U << 1) - 1)) 19640 { 19641 } npu_set_ifm_region_tisa::npu_set_ifm_region_t19642 CONSTEXPR npu_set_ifm_region_t() : 19643 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_REGION)), reserved0(0), 19644 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), region(0), reserved1(0), custom_dma_cs(0) 19645 { 19646 } validisa::npu_set_ifm_region_t19647 CONSTEXPR bool valid() const 19648 { 19649 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_REGION) && 19650 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL); 19651 } initisa::npu_set_ifm_region_t19652 CONSTEXPR void init() 19653 { 19654 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_IFM_REGION); 19655 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL); 19656 } uint32_tisa::npu_set_ifm_region_t19657 operator uint32_t() 19658 { 19659 uint32_t word; 19660 std::memcpy(&word, this, sizeof(word)); 19661 return word; 19662 } get_opcodeisa::npu_set_ifm_region_t19663 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const 19664 { 19665 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode); 19666 } set_opcodeisa::npu_set_ifm_region_t19667 CONSTEXPR npu_set_ifm_region_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value) 19668 { 19669 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1); 19670 return *this; 19671 } get_controlisa::npu_set_ifm_region_t19672 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const 19673 { 19674 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control); 19675 } set_controlisa::npu_set_ifm_region_t19676 CONSTEXPR npu_set_ifm_region_t &set_control(NPU_NAMESPACE::cmd_ctrl value) 19677 { 19678 control = static_cast<uint8_t>(value) & ((1U << 2) - 1); 19679 return *this; 19680 } get_regionisa::npu_set_ifm_region_t19681 CONSTEXPR uint32_t get_region() const 19682 { 19683 return static_cast<uint32_t>(region); 19684 } set_regionisa::npu_set_ifm_region_t19685 CONSTEXPR npu_set_ifm_region_t &set_region(uint32_t value) 19686 { 19687 region = static_cast<uint8_t>(value) & ((1U << 3) - 1); 19688 return *this; 19689 } get_custom_dma_csisa::npu_set_ifm_region_t19690 CONSTEXPR NPU_NAMESPACE::custom_dma_cs get_custom_dma_cs() const 19691 { 19692 return static_cast<NPU_NAMESPACE::custom_dma_cs>(custom_dma_cs); 19693 } set_custom_dma_csisa::npu_set_ifm_region_t19694 CONSTEXPR npu_set_ifm_region_t &set_custom_dma_cs(NPU_NAMESPACE::custom_dma_cs value) 19695 { 19696 custom_dma_cs = static_cast<uint8_t>(value) & ((1U << 1) - 1); 19697 return *this; 19698 } 19699 #ifdef NPU_DISASSEMBLE disassembleisa::npu_set_ifm_region_t19700 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const 19701 { 19702 fields.push_back(std::make_pair<std::string, std::string>("region", std::to_string(region))); 19703 fields.push_back(std::make_pair<std::string, std::string>( 19704 "custom_dma_cs", 19705 (custom_dma_cs < (sizeof(custom_dma_cs_str) / sizeof(custom_dma_cs_str[0])) ? 19706 custom_dma_cs_str[custom_dma_cs] : 19707 "****"))); 19708 } 19709 #endif 19710 #endif 19711 }; 19712 // Output feature map width 19713 struct npu_set_ofm_width_m1_t 19714 { 19715 #ifdef __cplusplus 19716 private: 19717 #endif 19718 uint32_t opcode : 10; // opcode 19719 uint32_t reserved0 : 4; 19720 uint32_t control : 2; // control 19721 uint32_t width_m1 : 16; // Output feature map width 19722 #ifdef __cplusplus 19723 public: npu_set_ofm_width_m1_tisa::npu_set_ofm_width_m1_t19724 npu_set_ofm_width_m1_t(uint32_t _width_m1) : 19725 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_OFM_WIDTH_M1)), reserved0(0), 19726 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), width_m1(_width_m1 & ((1U << 16) - 1)) 19727 { 19728 } npu_set_ofm_width_m1_tisa::npu_set_ofm_width_m1_t19729 CONSTEXPR npu_set_ofm_width_m1_t() : 19730 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_OFM_WIDTH_M1)), reserved0(0), 19731 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), width_m1(0) 19732 { 19733 } validisa::npu_set_ofm_width_m1_t19734 CONSTEXPR bool valid() const 19735 { 19736 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_OFM_WIDTH_M1) && 19737 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL); 19738 } initisa::npu_set_ofm_width_m1_t19739 CONSTEXPR void init() 19740 { 19741 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_OFM_WIDTH_M1); 19742 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL); 19743 } uint32_tisa::npu_set_ofm_width_m1_t19744 operator uint32_t() 19745 { 19746 uint32_t word; 19747 std::memcpy(&word, this, sizeof(word)); 19748 return word; 19749 } get_opcodeisa::npu_set_ofm_width_m1_t19750 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const 19751 { 19752 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode); 19753 } set_opcodeisa::npu_set_ofm_width_m1_t19754 CONSTEXPR npu_set_ofm_width_m1_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value) 19755 { 19756 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1); 19757 return *this; 19758 } get_controlisa::npu_set_ofm_width_m1_t19759 CONSTEXPR NPU_NAMESPACE::cmd_ctrl get_control() const 19760 { 19761 return static_cast<NPU_NAMESPACE::cmd_ctrl>(control); 19762 } set_controlisa::npu_set_ofm_width_m1_t19763 CONSTEXPR npu_set_ofm_width_m1_t &set_control(NPU_NAMESPACE::cmd_ctrl value) 19764 { 19765 control = static_cast<uint8_t>(value) & ((1U << 2) - 1); 19766 return *this; 19767 } get_width_m1isa::npu_set_ofm_width_m1_t19768 CONSTEXPR uint32_t get_width_m1() const 19769 { 19770 return static_cast<uint32_t>(width_m1); 19771 } set_width_m1isa::npu_set_ofm_width_m1_t19772 CONSTEXPR npu_set_ofm_width_m1_t &set_width_m1(uint32_t value) 19773 { 19774 width_m1 = static_cast<uint16_t>(value) & ((1U << 16) - 1); 19775 return *this; 19776 } 19777 #ifdef NPU_DISASSEMBLE disassembleisa::npu_set_ofm_width_m1_t19778 void disassemble(std::vector<std::pair<std::string, std::string>> &fields) const 19779 { 19780 fields.push_back(std::make_pair<std::string, std::string>("width_m1", std::to_string(width_m1))); 19781 } 19782 #endif 19783 #endif 19784 }; 19785 // Output feature map height 19786 struct npu_set_ofm_height_m1_t 19787 { 19788 #ifdef __cplusplus 19789 private: 19790 #endif 19791 uint32_t opcode : 10; // opcode 19792 uint32_t reserved0 : 4; 19793 uint32_t control : 2; // control 19794 uint32_t height_m1 : 16; // Output feature map height 19795 #ifdef __cplusplus 19796 public: npu_set_ofm_height_m1_tisa::npu_set_ofm_height_m1_t19797 npu_set_ofm_height_m1_t(uint32_t _height_m1) : 19798 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_OFM_HEIGHT_M1)), reserved0(0), 19799 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), height_m1(_height_m1 & ((1U << 16) - 1)) 19800 { 19801 } npu_set_ofm_height_m1_tisa::npu_set_ofm_height_m1_t19802 CONSTEXPR npu_set_ofm_height_m1_t() : 19803 opcode(static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_OFM_HEIGHT_M1)), reserved0(0), 19804 control(static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL)), height_m1(0) 19805 { 19806 } validisa::npu_set_ofm_height_m1_t19807 CONSTEXPR bool valid() const 19808 { 19809 return opcode == static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_OFM_HEIGHT_M1) && 19810 control == static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL); 19811 } initisa::npu_set_ofm_height_m1_t19812 CONSTEXPR void init() 19813 { 19814 opcode = static_cast<uint16_t>(NPU_NAMESPACE::cmd0_opcode::NPU_SET_OFM_HEIGHT_M1); 19815 control = static_cast<uint8_t>(NPU_NAMESPACE::cmd_ctrl::CMD0_CTRL); 19816 } uint32_tisa::npu_set_ofm_height_m1_t19817 operator uint32_t() 19818 { 19819 uint32_t word; 19820 std::memcpy(&word, this, sizeof(word)); 19821 return word; 19822 } get_opcodeisa::npu_set_ofm_height_m1_t19823 CONSTEXPR NPU_NAMESPACE::cmd0_opcode get_opcode() const 19824 { 19825 return static_cast<NPU_NAMESPACE::cmd0_opcode>(opcode); 19826 } set_opcodeisa::npu_set_ofm_height_m1_t19827 CONSTEXPR npu_set_ofm_height_m1_t &set_opcode(NPU_NAMESPACE::cmd0_opcode value) 19828 { 19829 opcode = static_cast<uint16_t>(value) & ((1U << 10) - 1); 19830 return *this; 19831 } get_controlisa::npu_set_ofm_height_m1_t19832