Tim Hall | 79d07d2 | 2020-04-27 18:20:16 +0100 | [diff] [blame] | 1 | # Copyright (C) 2020 Arm Limited or its affiliates. All rights reserved. |
| 2 | # |
| 3 | # SPDX-License-Identifier: Apache-2.0 |
| 4 | # |
| 5 | # Licensed under the Apache License, Version 2.0 (the License); you may |
| 6 | # not use this file except in compliance with the License. |
| 7 | # You may obtain a copy of the License at |
| 8 | # |
| 9 | # www.apache.org/licenses/LICENSE-2.0 |
| 10 | # |
| 11 | # Unless required by applicable law or agreed to in writing, software |
| 12 | # distributed under the License is distributed on an AS IS BASIS, WITHOUT |
| 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | # See the License for the specific language governing permissions and |
| 15 | # limitations under the License. |
| 16 | |
Diqing Zhong | b731170 | 2020-04-14 12:31:44 +0200 | [diff] [blame] | 17 | |
| 18 | |
Tim Hall | 79d07d2 | 2020-04-27 18:20:16 +0100 | [diff] [blame] | 19 | from ctypes import * |
| 20 | from enum import Enum |
| 21 | |
Douglas Troha | 22df2ad | 2020-05-08 13:09:13 +0200 | [diff] [blame] | 22 | ARCH_VER = '1.0.0' |
Tim Hall | 79d07d2 | 2020-04-27 18:20:16 +0100 | [diff] [blame] | 23 | |
| 24 | |
Douglas Troha | 77f8396 | 2020-05-14 16:36:17 +0200 | [diff] [blame^] | 25 | class BASE(Enum): |
| 26 | ID = 0x0000 |
| 27 | STATUS = 0x0004 |
| 28 | CMD = 0x0008 |
| 29 | RESET = 0x000C |
| 30 | QBASE0 = 0x0010 |
| 31 | QBASE1 = 0x0014 |
| 32 | QREAD = 0x0018 |
| 33 | QCONFIG = 0x001C |
| 34 | QSIZE = 0x0020 |
| 35 | PROT = 0x0024 |
| 36 | CONFIG = 0x0028 |
| 37 | LOCK = 0x002C |
| 38 | REGIONCFG = 0x003C |
| 39 | AXI_LIMIT0 = 0x0040 |
| 40 | AXI_LIMIT1 = 0x0044 |
| 41 | AXI_LIMIT2 = 0x0048 |
| 42 | AXI_LIMIT3 = 0x004C |
| 43 | SIZE = 0x0050 |
| 44 | |
| 45 | class BASE_POINTERS(Enum): |
| 46 | BASEP0 = 0x0080 |
| 47 | BASEP1 = 0x0084 |
| 48 | BASEP2 = 0x0088 |
| 49 | BASEP3 = 0x008C |
| 50 | BASEP4 = 0x0090 |
| 51 | BASEP5 = 0x0094 |
| 52 | BASEP6 = 0x0098 |
| 53 | BASEP7 = 0x009C |
| 54 | BASEP8 = 0x00A0 |
| 55 | BASEP9 = 0x00A4 |
| 56 | BASEP10 = 0x00A8 |
| 57 | BASEP11 = 0x00AC |
| 58 | BASEP12 = 0x00B0 |
| 59 | BASEP13 = 0x00B4 |
| 60 | BASEP14 = 0x00B8 |
| 61 | BASEP15 = 0x00BC |
| 62 | SIZE = 0x00C0 |
| 63 | |
| 64 | class DEBUG(Enum): |
| 65 | WD_STATUS = 0x0100 |
| 66 | MAC_STATUS = 0x0104 |
| 67 | AO_STATUS = 0x0108 |
| 68 | DMA_STATUS0 = 0x0110 |
| 69 | DMA_STATUS1 = 0x0114 |
| 70 | CLKFORCE = 0x0140 |
| 71 | DEBUG_ADDRESS = 0x0144 |
| 72 | DEBUG_MISC = 0x0148 |
| 73 | DEBUGCORE = 0x014C |
| 74 | SIZE = 0x0150 |
| 75 | |
| 76 | class ID(Enum): |
| 77 | REVISION = 0x0FC0 |
| 78 | PID4 = 0x0FD0 |
| 79 | PID5 = 0x0FD4 |
| 80 | PID6 = 0x0FD8 |
| 81 | PID7 = 0x0FDC |
| 82 | PID0 = 0x0FE0 |
| 83 | PID1 = 0x0FE4 |
| 84 | PID2 = 0x0FE8 |
| 85 | PID3 = 0x0FEC |
| 86 | CID0 = 0x0FF0 |
| 87 | CID1 = 0x0FF4 |
| 88 | CID2 = 0x0FF8 |
| 89 | CID3 = 0x0FFC |
| 90 | SIZE = 0x1000 |
| 91 | |
| 92 | class PMU(Enum): |
| 93 | PMCR = 0x0180 |
| 94 | PMCNTENSET = 0x0184 |
| 95 | PMCNTENCLR = 0x0188 |
| 96 | PMOVSSET = 0x018C |
| 97 | PMOVSCLR = 0x0190 |
| 98 | PMINTSET = 0x0194 |
| 99 | PMINTCLR = 0x0198 |
| 100 | PMCCNTR_LO = 0x01A0 |
| 101 | PMCCNTR_HI = 0x01A4 |
| 102 | PMCCNTR_CFG = 0x01A8 |
| 103 | PMCAXI_CHAN = 0x01AC |
| 104 | PMEVCNTR0 = 0x0300 |
| 105 | PMEVCNTR1 = 0x0304 |
| 106 | PMEVCNTR2 = 0x0308 |
| 107 | PMEVCNTR3 = 0x030C |
| 108 | PMEVTYPER0 = 0x0380 |
| 109 | PMEVTYPER1 = 0x0384 |
| 110 | PMEVTYPER2 = 0x0388 |
| 111 | PMEVTYPER3 = 0x038C |
| 112 | SIZE = 0x0390 |
| 113 | |
| 114 | class SHARED_BUFFER(Enum): |
Tim Hall | 79d07d2 | 2020-04-27 18:20:16 +0100 | [diff] [blame] | 115 | SHARED_BUFFER0 = 0x0400 |
| 116 | SHARED_BUFFER1 = 0x0404 |
| 117 | SHARED_BUFFER2 = 0x0408 |
| 118 | SHARED_BUFFER3 = 0x040C |
| 119 | SHARED_BUFFER4 = 0x0410 |
| 120 | SHARED_BUFFER5 = 0x0414 |
| 121 | SHARED_BUFFER6 = 0x0418 |
| 122 | SHARED_BUFFER7 = 0x041C |
| 123 | SHARED_BUFFER8 = 0x0420 |
| 124 | SHARED_BUFFER9 = 0x0424 |
| 125 | SHARED_BUFFER10 = 0x0428 |
| 126 | SHARED_BUFFER11 = 0x042C |
| 127 | SHARED_BUFFER12 = 0x0430 |
| 128 | SHARED_BUFFER13 = 0x0434 |
| 129 | SHARED_BUFFER14 = 0x0438 |
| 130 | SHARED_BUFFER15 = 0x043C |
| 131 | SHARED_BUFFER16 = 0x0440 |
| 132 | SHARED_BUFFER17 = 0x0444 |
| 133 | SHARED_BUFFER18 = 0x0448 |
| 134 | SHARED_BUFFER19 = 0x044C |
| 135 | SHARED_BUFFER20 = 0x0450 |
| 136 | SHARED_BUFFER21 = 0x0454 |
| 137 | SHARED_BUFFER22 = 0x0458 |
| 138 | SHARED_BUFFER23 = 0x045C |
| 139 | SHARED_BUFFER24 = 0x0460 |
| 140 | SHARED_BUFFER25 = 0x0464 |
| 141 | SHARED_BUFFER26 = 0x0468 |
| 142 | SHARED_BUFFER27 = 0x046C |
| 143 | SHARED_BUFFER28 = 0x0470 |
| 144 | SHARED_BUFFER29 = 0x0474 |
| 145 | SHARED_BUFFER30 = 0x0478 |
| 146 | SHARED_BUFFER31 = 0x047C |
| 147 | SHARED_BUFFER32 = 0x0480 |
| 148 | SHARED_BUFFER33 = 0x0484 |
| 149 | SHARED_BUFFER34 = 0x0488 |
| 150 | SHARED_BUFFER35 = 0x048C |
| 151 | SHARED_BUFFER36 = 0x0490 |
| 152 | SHARED_BUFFER37 = 0x0494 |
| 153 | SHARED_BUFFER38 = 0x0498 |
| 154 | SHARED_BUFFER39 = 0x049C |
| 155 | SHARED_BUFFER40 = 0x04A0 |
| 156 | SHARED_BUFFER41 = 0x04A4 |
| 157 | SHARED_BUFFER42 = 0x04A8 |
| 158 | SHARED_BUFFER43 = 0x04AC |
| 159 | SHARED_BUFFER44 = 0x04B0 |
| 160 | SHARED_BUFFER45 = 0x04B4 |
| 161 | SHARED_BUFFER46 = 0x04B8 |
| 162 | SHARED_BUFFER47 = 0x04BC |
| 163 | SHARED_BUFFER48 = 0x04C0 |
| 164 | SHARED_BUFFER49 = 0x04C4 |
| 165 | SHARED_BUFFER50 = 0x04C8 |
| 166 | SHARED_BUFFER51 = 0x04CC |
| 167 | SHARED_BUFFER52 = 0x04D0 |
| 168 | SHARED_BUFFER53 = 0x04D4 |
| 169 | SHARED_BUFFER54 = 0x04D8 |
| 170 | SHARED_BUFFER55 = 0x04DC |
| 171 | SHARED_BUFFER56 = 0x04E0 |
| 172 | SHARED_BUFFER57 = 0x04E4 |
| 173 | SHARED_BUFFER58 = 0x04E8 |
| 174 | SHARED_BUFFER59 = 0x04EC |
| 175 | SHARED_BUFFER60 = 0x04F0 |
| 176 | SHARED_BUFFER61 = 0x04F4 |
| 177 | SHARED_BUFFER62 = 0x04F8 |
| 178 | SHARED_BUFFER63 = 0x04FC |
| 179 | SHARED_BUFFER64 = 0x0500 |
| 180 | SHARED_BUFFER65 = 0x0504 |
| 181 | SHARED_BUFFER66 = 0x0508 |
| 182 | SHARED_BUFFER67 = 0x050C |
| 183 | SHARED_BUFFER68 = 0x0510 |
| 184 | SHARED_BUFFER69 = 0x0514 |
| 185 | SHARED_BUFFER70 = 0x0518 |
| 186 | SHARED_BUFFER71 = 0x051C |
| 187 | SHARED_BUFFER72 = 0x0520 |
| 188 | SHARED_BUFFER73 = 0x0524 |
| 189 | SHARED_BUFFER74 = 0x0528 |
| 190 | SHARED_BUFFER75 = 0x052C |
| 191 | SHARED_BUFFER76 = 0x0530 |
| 192 | SHARED_BUFFER77 = 0x0534 |
| 193 | SHARED_BUFFER78 = 0x0538 |
| 194 | SHARED_BUFFER79 = 0x053C |
| 195 | SHARED_BUFFER80 = 0x0540 |
| 196 | SHARED_BUFFER81 = 0x0544 |
| 197 | SHARED_BUFFER82 = 0x0548 |
| 198 | SHARED_BUFFER83 = 0x054C |
| 199 | SHARED_BUFFER84 = 0x0550 |
| 200 | SHARED_BUFFER85 = 0x0554 |
| 201 | SHARED_BUFFER86 = 0x0558 |
| 202 | SHARED_BUFFER87 = 0x055C |
| 203 | SHARED_BUFFER88 = 0x0560 |
| 204 | SHARED_BUFFER89 = 0x0564 |
| 205 | SHARED_BUFFER90 = 0x0568 |
| 206 | SHARED_BUFFER91 = 0x056C |
| 207 | SHARED_BUFFER92 = 0x0570 |
| 208 | SHARED_BUFFER93 = 0x0574 |
| 209 | SHARED_BUFFER94 = 0x0578 |
| 210 | SHARED_BUFFER95 = 0x057C |
| 211 | SHARED_BUFFER96 = 0x0580 |
| 212 | SHARED_BUFFER97 = 0x0584 |
| 213 | SHARED_BUFFER98 = 0x0588 |
| 214 | SHARED_BUFFER99 = 0x058C |
| 215 | SHARED_BUFFER100 = 0x0590 |
| 216 | SHARED_BUFFER101 = 0x0594 |
| 217 | SHARED_BUFFER102 = 0x0598 |
| 218 | SHARED_BUFFER103 = 0x059C |
| 219 | SHARED_BUFFER104 = 0x05A0 |
| 220 | SHARED_BUFFER105 = 0x05A4 |
| 221 | SHARED_BUFFER106 = 0x05A8 |
| 222 | SHARED_BUFFER107 = 0x05AC |
| 223 | SHARED_BUFFER108 = 0x05B0 |
| 224 | SHARED_BUFFER109 = 0x05B4 |
| 225 | SHARED_BUFFER110 = 0x05B8 |
| 226 | SHARED_BUFFER111 = 0x05BC |
| 227 | SHARED_BUFFER112 = 0x05C0 |
| 228 | SHARED_BUFFER113 = 0x05C4 |
| 229 | SHARED_BUFFER114 = 0x05C8 |
| 230 | SHARED_BUFFER115 = 0x05CC |
| 231 | SHARED_BUFFER116 = 0x05D0 |
| 232 | SHARED_BUFFER117 = 0x05D4 |
| 233 | SHARED_BUFFER118 = 0x05D8 |
| 234 | SHARED_BUFFER119 = 0x05DC |
| 235 | SHARED_BUFFER120 = 0x05E0 |
| 236 | SHARED_BUFFER121 = 0x05E4 |
| 237 | SHARED_BUFFER122 = 0x05E8 |
| 238 | SHARED_BUFFER123 = 0x05EC |
| 239 | SHARED_BUFFER124 = 0x05F0 |
| 240 | SHARED_BUFFER125 = 0x05F4 |
| 241 | SHARED_BUFFER126 = 0x05F8 |
| 242 | SHARED_BUFFER127 = 0x05FC |
| 243 | SHARED_BUFFER128 = 0x0600 |
| 244 | SHARED_BUFFER129 = 0x0604 |
| 245 | SHARED_BUFFER130 = 0x0608 |
| 246 | SHARED_BUFFER131 = 0x060C |
| 247 | SHARED_BUFFER132 = 0x0610 |
| 248 | SHARED_BUFFER133 = 0x0614 |
| 249 | SHARED_BUFFER134 = 0x0618 |
| 250 | SHARED_BUFFER135 = 0x061C |
| 251 | SHARED_BUFFER136 = 0x0620 |
| 252 | SHARED_BUFFER137 = 0x0624 |
| 253 | SHARED_BUFFER138 = 0x0628 |
| 254 | SHARED_BUFFER139 = 0x062C |
| 255 | SHARED_BUFFER140 = 0x0630 |
| 256 | SHARED_BUFFER141 = 0x0634 |
| 257 | SHARED_BUFFER142 = 0x0638 |
| 258 | SHARED_BUFFER143 = 0x063C |
| 259 | SHARED_BUFFER144 = 0x0640 |
| 260 | SHARED_BUFFER145 = 0x0644 |
| 261 | SHARED_BUFFER146 = 0x0648 |
| 262 | SHARED_BUFFER147 = 0x064C |
| 263 | SHARED_BUFFER148 = 0x0650 |
| 264 | SHARED_BUFFER149 = 0x0654 |
| 265 | SHARED_BUFFER150 = 0x0658 |
| 266 | SHARED_BUFFER151 = 0x065C |
| 267 | SHARED_BUFFER152 = 0x0660 |
| 268 | SHARED_BUFFER153 = 0x0664 |
| 269 | SHARED_BUFFER154 = 0x0668 |
| 270 | SHARED_BUFFER155 = 0x066C |
| 271 | SHARED_BUFFER156 = 0x0670 |
| 272 | SHARED_BUFFER157 = 0x0674 |
| 273 | SHARED_BUFFER158 = 0x0678 |
| 274 | SHARED_BUFFER159 = 0x067C |
| 275 | SHARED_BUFFER160 = 0x0680 |
| 276 | SHARED_BUFFER161 = 0x0684 |
| 277 | SHARED_BUFFER162 = 0x0688 |
| 278 | SHARED_BUFFER163 = 0x068C |
| 279 | SHARED_BUFFER164 = 0x0690 |
| 280 | SHARED_BUFFER165 = 0x0694 |
| 281 | SHARED_BUFFER166 = 0x0698 |
| 282 | SHARED_BUFFER167 = 0x069C |
| 283 | SHARED_BUFFER168 = 0x06A0 |
| 284 | SHARED_BUFFER169 = 0x06A4 |
| 285 | SHARED_BUFFER170 = 0x06A8 |
| 286 | SHARED_BUFFER171 = 0x06AC |
| 287 | SHARED_BUFFER172 = 0x06B0 |
| 288 | SHARED_BUFFER173 = 0x06B4 |
| 289 | SHARED_BUFFER174 = 0x06B8 |
| 290 | SHARED_BUFFER175 = 0x06BC |
| 291 | SHARED_BUFFER176 = 0x06C0 |
| 292 | SHARED_BUFFER177 = 0x06C4 |
| 293 | SHARED_BUFFER178 = 0x06C8 |
| 294 | SHARED_BUFFER179 = 0x06CC |
| 295 | SHARED_BUFFER180 = 0x06D0 |
| 296 | SHARED_BUFFER181 = 0x06D4 |
| 297 | SHARED_BUFFER182 = 0x06D8 |
| 298 | SHARED_BUFFER183 = 0x06DC |
| 299 | SHARED_BUFFER184 = 0x06E0 |
| 300 | SHARED_BUFFER185 = 0x06E4 |
| 301 | SHARED_BUFFER186 = 0x06E8 |
| 302 | SHARED_BUFFER187 = 0x06EC |
| 303 | SHARED_BUFFER188 = 0x06F0 |
| 304 | SHARED_BUFFER189 = 0x06F4 |
| 305 | SHARED_BUFFER190 = 0x06F8 |
| 306 | SHARED_BUFFER191 = 0x06FC |
| 307 | SHARED_BUFFER192 = 0x0700 |
| 308 | SHARED_BUFFER193 = 0x0704 |
| 309 | SHARED_BUFFER194 = 0x0708 |
| 310 | SHARED_BUFFER195 = 0x070C |
| 311 | SHARED_BUFFER196 = 0x0710 |
| 312 | SHARED_BUFFER197 = 0x0714 |
| 313 | SHARED_BUFFER198 = 0x0718 |
| 314 | SHARED_BUFFER199 = 0x071C |
| 315 | SHARED_BUFFER200 = 0x0720 |
| 316 | SHARED_BUFFER201 = 0x0724 |
| 317 | SHARED_BUFFER202 = 0x0728 |
| 318 | SHARED_BUFFER203 = 0x072C |
| 319 | SHARED_BUFFER204 = 0x0730 |
| 320 | SHARED_BUFFER205 = 0x0734 |
| 321 | SHARED_BUFFER206 = 0x0738 |
| 322 | SHARED_BUFFER207 = 0x073C |
| 323 | SHARED_BUFFER208 = 0x0740 |
| 324 | SHARED_BUFFER209 = 0x0744 |
| 325 | SHARED_BUFFER210 = 0x0748 |
| 326 | SHARED_BUFFER211 = 0x074C |
| 327 | SHARED_BUFFER212 = 0x0750 |
| 328 | SHARED_BUFFER213 = 0x0754 |
| 329 | SHARED_BUFFER214 = 0x0758 |
| 330 | SHARED_BUFFER215 = 0x075C |
| 331 | SHARED_BUFFER216 = 0x0760 |
| 332 | SHARED_BUFFER217 = 0x0764 |
| 333 | SHARED_BUFFER218 = 0x0768 |
| 334 | SHARED_BUFFER219 = 0x076C |
| 335 | SHARED_BUFFER220 = 0x0770 |
| 336 | SHARED_BUFFER221 = 0x0774 |
| 337 | SHARED_BUFFER222 = 0x0778 |
| 338 | SHARED_BUFFER223 = 0x077C |
| 339 | SHARED_BUFFER224 = 0x0780 |
| 340 | SHARED_BUFFER225 = 0x0784 |
| 341 | SHARED_BUFFER226 = 0x0788 |
| 342 | SHARED_BUFFER227 = 0x078C |
| 343 | SHARED_BUFFER228 = 0x0790 |
| 344 | SHARED_BUFFER229 = 0x0794 |
| 345 | SHARED_BUFFER230 = 0x0798 |
| 346 | SHARED_BUFFER231 = 0x079C |
| 347 | SHARED_BUFFER232 = 0x07A0 |
| 348 | SHARED_BUFFER233 = 0x07A4 |
| 349 | SHARED_BUFFER234 = 0x07A8 |
| 350 | SHARED_BUFFER235 = 0x07AC |
| 351 | SHARED_BUFFER236 = 0x07B0 |
| 352 | SHARED_BUFFER237 = 0x07B4 |
| 353 | SHARED_BUFFER238 = 0x07B8 |
| 354 | SHARED_BUFFER239 = 0x07BC |
| 355 | SHARED_BUFFER240 = 0x07C0 |
| 356 | SHARED_BUFFER241 = 0x07C4 |
| 357 | SHARED_BUFFER242 = 0x07C8 |
| 358 | SHARED_BUFFER243 = 0x07CC |
| 359 | SHARED_BUFFER244 = 0x07D0 |
| 360 | SHARED_BUFFER245 = 0x07D4 |
| 361 | SHARED_BUFFER246 = 0x07D8 |
| 362 | SHARED_BUFFER247 = 0x07DC |
| 363 | SHARED_BUFFER248 = 0x07E0 |
| 364 | SHARED_BUFFER249 = 0x07E4 |
| 365 | SHARED_BUFFER250 = 0x07E8 |
| 366 | SHARED_BUFFER251 = 0x07EC |
| 367 | SHARED_BUFFER252 = 0x07F0 |
| 368 | SHARED_BUFFER253 = 0x07F4 |
| 369 | SHARED_BUFFER254 = 0x07F8 |
| 370 | SHARED_BUFFER255 = 0x07FC |
| 371 | SIZE = 0x0800 |
| 372 | |
Douglas Troha | 77f8396 | 2020-05-14 16:36:17 +0200 | [diff] [blame^] | 373 | class TSU(Enum): |
Tim Hall | 79d07d2 | 2020-04-27 18:20:16 +0100 | [diff] [blame] | 374 | IFM_PAD_TOP = 0x0800 |
| 375 | IFM_PAD_LEFT = 0x0804 |
| 376 | IFM_PAD_RIGHT = 0x0808 |
| 377 | IFM_PAD_BOTTOM = 0x080C |
| 378 | IFM_DEPTH_M1 = 0x0810 |
| 379 | IFM_PRECISION = 0x0814 |
| 380 | IFM_UPSCALE = 0x081C |
| 381 | IFM_ZERO_POINT = 0x0824 |
| 382 | IFM_WIDTH0_M1 = 0x0828 |
| 383 | IFM_HEIGHT0_M1 = 0x082C |
| 384 | IFM_HEIGHT1_M1 = 0x0830 |
| 385 | IFM_IB_END = 0x0834 |
| 386 | IFM_REGION = 0x083C |
| 387 | OFM_WIDTH_M1 = 0x0844 |
| 388 | OFM_HEIGHT_M1 = 0x0848 |
| 389 | OFM_DEPTH_M1 = 0x084C |
| 390 | OFM_PRECISION = 0x0850 |
| 391 | OFM_BLK_WIDTH_M1 = 0x0854 |
| 392 | OFM_BLK_HEIGHT_M1 = 0x0858 |
| 393 | OFM_BLK_DEPTH_M1 = 0x085C |
| 394 | OFM_ZERO_POINT = 0x0860 |
| 395 | OFM_WIDTH0_M1 = 0x0868 |
| 396 | OFM_HEIGHT0_M1 = 0x086C |
| 397 | OFM_HEIGHT1_M1 = 0x0870 |
| 398 | OFM_REGION = 0x087C |
| 399 | KERNEL_WIDTH_M1 = 0x0880 |
| 400 | KERNEL_HEIGHT_M1 = 0x0884 |
| 401 | KERNEL_STRIDE = 0x0888 |
| 402 | PARALLEL_MODE = 0x088C |
| 403 | ACC_FORMAT = 0x0890 |
| 404 | ACTIVATION = 0x0894 |
| 405 | ACTIVATION_MIN = 0x0898 |
| 406 | ACTIVATION_MAX = 0x089C |
| 407 | WEIGHT_REGION = 0x08A0 |
| 408 | SCALE_REGION = 0x08A4 |
| 409 | AB_START = 0x08B4 |
| 410 | BLOCKDEP = 0x08BC |
| 411 | DMA0_SRC_REGION = 0x08C0 |
| 412 | DMA0_DST_REGION = 0x08C4 |
| 413 | DMA0_SIZE0 = 0x08C8 |
| 414 | DMA0_SIZE1 = 0x08CC |
| 415 | IFM2_BROADCAST = 0x0900 |
| 416 | IFM2_SCALAR = 0x0904 |
| 417 | IFM2_PRECISION = 0x0914 |
| 418 | IFM2_ZERO_POINT = 0x0924 |
| 419 | IFM2_WIDTH0_M1 = 0x0928 |
| 420 | IFM2_HEIGHT0_M1 = 0x092C |
| 421 | IFM2_HEIGHT1_M1 = 0x0930 |
| 422 | IFM2_IB_START = 0x0934 |
| 423 | IFM2_REGION = 0x093C |
| 424 | IFM_BASE0 = 0x0A00 |
| 425 | IFM_BASE0_HI = 0x0A04 |
| 426 | IFM_BASE1 = 0x0A08 |
| 427 | IFM_BASE1_HI = 0x0A0C |
| 428 | IFM_BASE2 = 0x0A10 |
| 429 | IFM_BASE2_HI = 0x0A14 |
| 430 | IFM_BASE3 = 0x0A18 |
| 431 | IFM_BASE3_HI = 0x0A1C |
| 432 | IFM_STRIDE_X = 0x0A20 |
| 433 | IFM_STRIDE_X_HI = 0x0A24 |
| 434 | IFM_STRIDE_Y = 0x0A28 |
| 435 | IFM_STRIDE_Y_HI = 0x0A2C |
| 436 | IFM_STRIDE_C = 0x0A30 |
| 437 | IFM_STRIDE_C_HI = 0x0A34 |
| 438 | OFM_BASE0 = 0x0A40 |
| 439 | OFM_BASE0_HI = 0x0A44 |
| 440 | OFM_BASE1 = 0x0A48 |
| 441 | OFM_BASE1_HI = 0x0A4C |
| 442 | OFM_BASE2 = 0x0A50 |
| 443 | OFM_BASE2_HI = 0x0A54 |
| 444 | OFM_BASE3 = 0x0A58 |
| 445 | OFM_BASE3_HI = 0x0A5C |
| 446 | OFM_STRIDE_X = 0x0A60 |
| 447 | OFM_STRIDE_X_HI = 0x0A64 |
| 448 | OFM_STRIDE_Y = 0x0A68 |
| 449 | OFM_STRIDE_Y_HI = 0x0A6C |
| 450 | OFM_STRIDE_C = 0x0A70 |
| 451 | OFM_STRIDE_C_HI = 0x0A74 |
| 452 | WEIGHT_BASE = 0x0A80 |
| 453 | WEIGHT_BASE_HI = 0x0A84 |
| 454 | WEIGHT_LENGTH = 0x0A88 |
Tim Hall | 79d07d2 | 2020-04-27 18:20:16 +0100 | [diff] [blame] | 455 | SCALE_BASE = 0x0A90 |
| 456 | SCALE_BASE_HI = 0x0A94 |
| 457 | SCALE_LENGTH = 0x0A98 |
| 458 | OFM_SCALE = 0x0AA0 |
| 459 | OFM_SCALE_SHIFT = 0x0AA4 |
| 460 | OPA_SCALE = 0x0AA8 |
| 461 | OPA_SCALE_SHIFT = 0x0AAC |
| 462 | OPB_SCALE = 0x0AB0 |
| 463 | DMA0_SRC = 0x0AC0 |
| 464 | DMA0_SRC_HI = 0x0AC4 |
| 465 | DMA0_DST = 0x0AC8 |
| 466 | DMA0_DST_HI = 0x0ACC |
| 467 | DMA0_LEN = 0x0AD0 |
| 468 | DMA0_LEN_HI = 0x0AD4 |
| 469 | DMA0_SKIP0 = 0x0AD8 |
| 470 | DMA0_SKIP0_HI = 0x0ADC |
| 471 | DMA0_SKIP1 = 0x0AE0 |
| 472 | DMA0_SKIP1_HI = 0x0AE4 |
| 473 | IFM2_BASE0 = 0x0B00 |
| 474 | IFM2_BASE0_HI = 0x0B04 |
| 475 | IFM2_BASE1 = 0x0B08 |
| 476 | IFM2_BASE1_HI = 0x0B0C |
| 477 | IFM2_BASE2 = 0x0B10 |
| 478 | IFM2_BASE2_HI = 0x0B14 |
| 479 | IFM2_BASE3 = 0x0B18 |
| 480 | IFM2_BASE3_HI = 0x0B1C |
| 481 | IFM2_STRIDE_X = 0x0B20 |
| 482 | IFM2_STRIDE_X_HI = 0x0B24 |
| 483 | IFM2_STRIDE_Y = 0x0B28 |
| 484 | IFM2_STRIDE_Y_HI = 0x0B2C |
| 485 | IFM2_STRIDE_C = 0x0B30 |
| 486 | IFM2_STRIDE_C_HI = 0x0B34 |
| 487 | WEIGHT1_BASE = 0x0B40 |
| 488 | WEIGHT1_BASE_HI = 0x0B44 |
| 489 | WEIGHT1_LENGTH = 0x0B48 |
Tim Hall | 79d07d2 | 2020-04-27 18:20:16 +0100 | [diff] [blame] | 490 | SCALE1_BASE = 0x0B50 |
| 491 | SCALE1_BASE_HI = 0x0B54 |
| 492 | SCALE1_LENGTH = 0x0B58 |
| 493 | SIZE = 0x0B5C |
| 494 | |
Douglas Troha | 77f8396 | 2020-05-14 16:36:17 +0200 | [diff] [blame^] | 495 | class TSU_DEBUG(Enum): |
Tim Hall | 79d07d2 | 2020-04-27 18:20:16 +0100 | [diff] [blame] | 496 | KERNEL_X = 0x0200 |
| 497 | KERNEL_Y = 0x0204 |
| 498 | KERNEL_W_M1 = 0x0208 |
| 499 | KERNEL_H_M1 = 0x020C |
| 500 | OFM_CBLK_WIDTH_M1 = 0x0210 |
| 501 | OFM_CBLK_HEIGHT_M1 = 0x0214 |
| 502 | OFM_CBLK_DEPTH_M1 = 0x0218 |
| 503 | IFM_CBLK_DEPTH_M1 = 0x021C |
| 504 | OFM_X = 0x0220 |
| 505 | OFM_Y = 0x0224 |
| 506 | OFM_Z = 0x0228 |
| 507 | IFM_Z = 0x022C |
| 508 | PAD_TOP = 0x0230 |
| 509 | PAD_LEFT = 0x0234 |
| 510 | IFM_CBLK_WIDTH = 0x0238 |
| 511 | IFM_CBLK_HEIGHT = 0x023C |
| 512 | DMA_IFM_SRC = 0x0240 |
| 513 | DMA_IFM_SRC_HI = 0x0244 |
| 514 | DMA_IFM_DST = 0x0248 |
| 515 | DMA_OFM_SRC = 0x024C |
| 516 | DMA_OFM_DST = 0x0250 |
| 517 | DMA_OFM_DST_HI = 0x0254 |
| 518 | DMA_WEIGHT_SRC = 0x0258 |
| 519 | DMA_WEIGHT_SRC_HI = 0x025C |
| 520 | DMA_CMD_SRC = 0x0260 |
| 521 | DMA_CMD_SRC_HI = 0x0264 |
| 522 | DMA_CMD_SIZE = 0x0268 |
| 523 | DMA_M2M_SRC = 0x026C |
| 524 | DMA_M2M_SRC_HI = 0x0270 |
| 525 | DMA_M2M_DST = 0x0274 |
| 526 | DMA_M2M_DST_HI = 0x0278 |
| 527 | CURRENT_QREAD = 0x027C |
| 528 | DMA_SCALE_SRC = 0x0280 |
| 529 | DMA_SCALE_SRC_HI = 0x0284 |
| 530 | CURRENT_CMD = 0x02BC |
| 531 | SIZE = 0x02C0 |
| 532 | |
| 533 | |
| 534 | |
| 535 | class acc_format(Enum): |
| 536 | INT_32BIT = 0 |
| 537 | INT_40BIT = 1 |
| 538 | FP_S5_10 = 2 |
| 539 | |
| 540 | class activation(Enum): |
| 541 | NONE = 0 |
| 542 | TANH = 3 |
| 543 | SIGMOID = 4 |
| 544 | LUT_START = 16 |
| 545 | LUT_END = 23 |
| 546 | |
| 547 | class clip_range(Enum): |
| 548 | OFM_PRECISION = 0 |
| 549 | FORCE_UINT8 = 2 |
| 550 | FORCE_INT8 = 3 |
| 551 | FORCE_INT16 = 5 |
| 552 | |
| 553 | class cmd0(Enum): |
| 554 | NPU_OP_STOP = 0x000 |
| 555 | NPU_OP_IRQ = 0x001 |
| 556 | NPU_OP_CONV = 0x002 |
| 557 | NPU_OP_DEPTHWISE = 0x003 |
| 558 | NPU_OP_POOL = 0x005 |
| 559 | NPU_OP_ELEMENTWISE = 0x006 |
| 560 | NPU_OP_DMA_START = 0x010 |
| 561 | NPU_OP_DMA_WAIT = 0x011 |
| 562 | NPU_OP_KERNEL_WAIT = 0x012 |
| 563 | NPU_OP_PMU_MASK = 0x013 |
| 564 | NPU_SET_IFM_PAD_TOP = 0x100 |
| 565 | NPU_SET_IFM_PAD_LEFT = 0x101 |
| 566 | NPU_SET_IFM_PAD_RIGHT = 0x102 |
| 567 | NPU_SET_IFM_PAD_BOTTOM = 0x103 |
| 568 | NPU_SET_IFM_DEPTH_M1 = 0x104 |
| 569 | NPU_SET_IFM_PRECISION = 0x105 |
| 570 | NPU_SET_IFM_UPSCALE = 0x107 |
| 571 | NPU_SET_IFM_ZERO_POINT = 0x109 |
| 572 | NPU_SET_IFM_WIDTH0_M1 = 0x10A |
| 573 | NPU_SET_IFM_HEIGHT0_M1 = 0x10B |
| 574 | NPU_SET_IFM_HEIGHT1_M1 = 0x10C |
| 575 | NPU_SET_IFM_IB_END = 0x10D |
| 576 | NPU_SET_IFM_REGION = 0x10F |
| 577 | NPU_SET_OFM_WIDTH_M1 = 0x111 |
| 578 | NPU_SET_OFM_HEIGHT_M1 = 0x112 |
| 579 | NPU_SET_OFM_DEPTH_M1 = 0x113 |
| 580 | NPU_SET_OFM_PRECISION = 0x114 |
| 581 | NPU_SET_OFM_BLK_WIDTH_M1 = 0x115 |
| 582 | NPU_SET_OFM_BLK_HEIGHT_M1 = 0x116 |
| 583 | NPU_SET_OFM_BLK_DEPTH_M1 = 0x117 |
| 584 | NPU_SET_OFM_ZERO_POINT = 0x118 |
| 585 | NPU_SET_OFM_WIDTH0_M1 = 0x11A |
| 586 | NPU_SET_OFM_HEIGHT0_M1 = 0x11B |
| 587 | NPU_SET_OFM_HEIGHT1_M1 = 0x11C |
| 588 | NPU_SET_OFM_REGION = 0x11F |
| 589 | NPU_SET_KERNEL_WIDTH_M1 = 0x120 |
| 590 | NPU_SET_KERNEL_HEIGHT_M1 = 0x121 |
| 591 | NPU_SET_KERNEL_STRIDE = 0x122 |
| 592 | NPU_SET_PARALLEL_MODE = 0x123 |
| 593 | NPU_SET_ACC_FORMAT = 0x124 |
| 594 | NPU_SET_ACTIVATION = 0x125 |
| 595 | NPU_SET_ACTIVATION_MIN = 0x126 |
| 596 | NPU_SET_ACTIVATION_MAX = 0x127 |
| 597 | NPU_SET_WEIGHT_REGION = 0x128 |
| 598 | NPU_SET_SCALE_REGION = 0x129 |
| 599 | NPU_SET_AB_START = 0x12D |
| 600 | NPU_SET_BLOCKDEP = 0x12F |
| 601 | NPU_SET_DMA0_SRC_REGION = 0x130 |
| 602 | NPU_SET_DMA0_DST_REGION = 0x131 |
| 603 | NPU_SET_DMA0_SIZE0 = 0x132 |
| 604 | NPU_SET_DMA0_SIZE1 = 0x133 |
| 605 | NPU_SET_IFM2_BROADCAST = 0x180 |
| 606 | NPU_SET_IFM2_SCALAR = 0x181 |
| 607 | NPU_SET_IFM2_PRECISION = 0x185 |
| 608 | NPU_SET_IFM2_ZERO_POINT = 0x189 |
| 609 | NPU_SET_IFM2_WIDTH0_M1 = 0x18A |
| 610 | NPU_SET_IFM2_HEIGHT0_M1 = 0x18B |
| 611 | NPU_SET_IFM2_HEIGHT1_M1 = 0x18C |
| 612 | NPU_SET_IFM2_IB_START = 0x18D |
| 613 | NPU_SET_IFM2_REGION = 0x18F |
| 614 | |
| 615 | class cmd1(Enum): |
| 616 | NPU_SET_IFM_BASE0 = 0x000 |
| 617 | NPU_SET_IFM_BASE1 = 0x001 |
| 618 | NPU_SET_IFM_BASE2 = 0x002 |
| 619 | NPU_SET_IFM_BASE3 = 0x003 |
| 620 | NPU_SET_IFM_STRIDE_X = 0x004 |
| 621 | NPU_SET_IFM_STRIDE_Y = 0x005 |
| 622 | NPU_SET_IFM_STRIDE_C = 0x006 |
| 623 | NPU_SET_OFM_BASE0 = 0x010 |
| 624 | NPU_SET_OFM_BASE1 = 0x011 |
| 625 | NPU_SET_OFM_BASE2 = 0x012 |
| 626 | NPU_SET_OFM_BASE3 = 0x013 |
| 627 | NPU_SET_OFM_STRIDE_X = 0x014 |
| 628 | NPU_SET_OFM_STRIDE_Y = 0x015 |
| 629 | NPU_SET_OFM_STRIDE_C = 0x016 |
| 630 | NPU_SET_WEIGHT_BASE = 0x020 |
| 631 | NPU_SET_WEIGHT_LENGTH = 0x021 |
| 632 | NPU_SET_SCALE_BASE = 0x022 |
| 633 | NPU_SET_SCALE_LENGTH = 0x023 |
| 634 | NPU_SET_OFM_SCALE = 0x024 |
| 635 | NPU_SET_OPA_SCALE = 0x025 |
| 636 | NPU_SET_OPB_SCALE = 0x026 |
| 637 | NPU_SET_DMA0_SRC = 0x030 |
| 638 | NPU_SET_DMA0_DST = 0x031 |
| 639 | NPU_SET_DMA0_LEN = 0x032 |
| 640 | NPU_SET_DMA0_SKIP0 = 0x033 |
| 641 | NPU_SET_DMA0_SKIP1 = 0x034 |
| 642 | NPU_SET_IFM2_BASE0 = 0x080 |
| 643 | NPU_SET_IFM2_BASE1 = 0x081 |
| 644 | NPU_SET_IFM2_BASE2 = 0x082 |
| 645 | NPU_SET_IFM2_BASE3 = 0x083 |
| 646 | NPU_SET_IFM2_STRIDE_X = 0x084 |
| 647 | NPU_SET_IFM2_STRIDE_Y = 0x085 |
| 648 | NPU_SET_IFM2_STRIDE_C = 0x086 |
| 649 | NPU_SET_WEIGHT1_BASE = 0x090 |
| 650 | NPU_SET_WEIGHT1_LENGTH = 0x091 |
| 651 | NPU_SET_SCALE1_BASE = 0x092 |
| 652 | NPU_SET_SCALE1_LENGTH = 0x093 |
| 653 | |
| 654 | class data_format(Enum): |
| 655 | NHWC = 0 |
| 656 | NHCWB16 = 1 |
| 657 | |
| 658 | class elementwise_mode(Enum): |
| 659 | MUL = 0 |
| 660 | ADD = 1 |
| 661 | SUB = 2 |
| 662 | MIN = 3 |
| 663 | MAX = 4 |
| 664 | LRELU = 5 |
| 665 | ABS = 6 |
| 666 | CLZ = 7 |
| 667 | SHR = 8 |
| 668 | SHL = 9 |
| 669 | |
| 670 | class ifm_precision(Enum): |
Diqing Zhong | fed918b | 2020-04-27 10:27:34 +0200 | [diff] [blame] | 671 | U8 = 0 |
| 672 | S8 = 1 |
| 673 | U16 = 4 |
| 674 | S16 = 5 |
| 675 | S32 = 9 |
Tim Hall | 79d07d2 | 2020-04-27 18:20:16 +0100 | [diff] [blame] | 676 | |
| 677 | class ifm_scale_mode(Enum): |
| 678 | SCALE_16BIT = 0 |
| 679 | SCALE_OPA_32BIT = 1 |
| 680 | SCALE_OPB_32BIT = 2 |
| 681 | |
Diqing Zhong | b731170 | 2020-04-14 12:31:44 +0200 | [diff] [blame] | 682 | class macs_per_cc(Enum): |
| 683 | MACS_PER_CC_IS_5 = 0x5 |
| 684 | MACS_PER_CC_IS_6 = 0x6 |
| 685 | MACS_PER_CC_IS_7 = 0x7 |
| 686 | MACS_PER_CC_IS_8 = 0x8 |
| 687 | |
Tim Hall | 79d07d2 | 2020-04-27 18:20:16 +0100 | [diff] [blame] | 688 | class memory_type(Enum): |
| 689 | AXI0_OUTSTANDING_COUNTER0 = 0 |
| 690 | AXI0_OUTSTANDING_COUNTER1 = 1 |
| 691 | AXI1_OUTSTANDING_COUNTER2 = 2 |
| 692 | AXI1_OUTSTANDING_COUNTER3 = 3 |
| 693 | |
| 694 | class ofm_precision(Enum): |
| 695 | U8 = 0 |
| 696 | S8 = 1 |
| 697 | U16 = 2 |
| 698 | S16 = 3 |
| 699 | S32 = 5 |
| 700 | |
| 701 | class pmu_event_type(Enum): |
Diqing Zhong | b731170 | 2020-04-14 12:31:44 +0200 | [diff] [blame] | 702 | NO_EVENT = 0x00 |
Tim Hall | 79d07d2 | 2020-04-27 18:20:16 +0100 | [diff] [blame] | 703 | CYCLE = 0x11 |
| 704 | NPU_IDLE = 0x20 |
Douglas Troha | 22df2ad | 2020-05-08 13:09:13 +0200 | [diff] [blame] | 705 | CC_STALLED_ON_BLOCKDEP = 0x21 |
| 706 | CC_STALLED_ON_SHRAM_RECONFIG = 0x22 |
Tim Hall | 79d07d2 | 2020-04-27 18:20:16 +0100 | [diff] [blame] | 707 | MAC_ACTIVE = 0x30 |
| 708 | MAC_ACTIVE_8BIT = 0x31 |
| 709 | MAC_ACTIVE_16BIT = 0x32 |
| 710 | MAC_DPU_ACTIVE = 0x33 |
| 711 | MAC_STALLED_BY_WD_ACC = 0x34 |
| 712 | MAC_STALLED_BY_WD = 0x35 |
| 713 | MAC_STALLED_BY_ACC = 0x36 |
| 714 | MAC_STALLED_BY_IB = 0x37 |
Diqing Zhong | b731170 | 2020-04-14 12:31:44 +0200 | [diff] [blame] | 715 | MAC_ACTIVE_32BIT = 0x38 |
Douglas Troha | 22df2ad | 2020-05-08 13:09:13 +0200 | [diff] [blame] | 716 | MAC_STALLED_BY_INT_W = 0x39 |
| 717 | MAC_STALLED_BY_INT_ACC = 0x3A |
Tim Hall | 79d07d2 | 2020-04-27 18:20:16 +0100 | [diff] [blame] | 718 | AO_ACTIVE = 0x40 |
| 719 | AO_ACTIVE_8BIT = 0x41 |
| 720 | AO_ACTIVE_16BIT = 0x42 |
| 721 | AO_STALLED_BY_OFMP_OB = 0x43 |
| 722 | AO_STALLED_BY_OFMP = 0x44 |
| 723 | AO_STALLED_BY_OB = 0x45 |
| 724 | AO_STALLED_BY_ACC_IB = 0x46 |
| 725 | AO_STALLED_BY_ACC = 0x47 |
| 726 | AO_STALLED_BY_IB = 0x48 |
| 727 | WD_ACTIVE = 0x50 |
| 728 | WD_STALLED = 0x51 |
| 729 | WD_STALLED_BY_WS = 0x52 |
| 730 | WD_STALLED_BY_WD_BUF = 0x53 |
| 731 | WD_PARSE_ACTIVE = 0x54 |
| 732 | WD_PARSE_STALLED = 0x55 |
| 733 | WD_PARSE_STALLED_IN = 0x56 |
| 734 | WD_PARSE_STALLED_OUT = 0x57 |
Diqing Zhong | b731170 | 2020-04-14 12:31:44 +0200 | [diff] [blame] | 735 | WD_TRANS_WS = 0x58 |
| 736 | WD_TRANS_WB = 0x59 |
| 737 | WD_TRANS_DW0 = 0x5a |
| 738 | WD_TRANS_DW1 = 0x5b |
Tim Hall | 79d07d2 | 2020-04-27 18:20:16 +0100 | [diff] [blame] | 739 | AXI0_RD_TRANS_ACCEPTED = 0x80 |
| 740 | AXI0_RD_TRANS_COMPLETED = 0x81 |
| 741 | AXI0_RD_DATA_BEAT_RECEIVED = 0x82 |
| 742 | AXI0_RD_TRAN_REQ_STALLED = 0x83 |
| 743 | AXI0_WR_TRANS_ACCEPTED = 0x84 |
| 744 | AXI0_WR_TRANS_COMPLETED_M = 0x85 |
| 745 | AXI0_WR_TRANS_COMPLETED_S = 0x86 |
| 746 | AXI0_WR_DATA_BEAT_WRITTEN = 0x87 |
| 747 | AXI0_WR_TRAN_REQ_STALLED = 0x88 |
| 748 | AXI0_WR_DATA_BEAT_STALLED = 0x89 |
| 749 | AXI0_ENABLED_CYCLES = 0x8c |
| 750 | AXI0_RD_STALL_LIMIT = 0x8e |
| 751 | AXI0_WR_STALL_LIMIT = 0x8f |
| 752 | AXI1_RD_TRANS_ACCEPTED = 0x180 |
| 753 | AXI1_RD_TRANS_COMPLETED = 0x181 |
| 754 | AXI1_RD_DATA_BEAT_RECEIVED = 0x182 |
| 755 | AXI1_RD_TRAN_REQ_STALLED = 0x183 |
| 756 | AXI1_WR_TRANS_ACCEPTED = 0x184 |
| 757 | AXI1_WR_TRANS_COMPLETED_M = 0x185 |
| 758 | AXI1_WR_TRANS_COMPLETED_S = 0x186 |
| 759 | AXI1_WR_DATA_BEAT_WRITTEN = 0x187 |
| 760 | AXI1_WR_TRAN_REQ_STALLED = 0x188 |
| 761 | AXI1_WR_DATA_BEAT_STALLED = 0x189 |
| 762 | AXI1_ENABLED_CYCLES = 0x18c |
| 763 | AXI1_RD_STALL_LIMIT = 0x18e |
| 764 | AXI1_WR_STALL_LIMIT = 0x18f |
| 765 | AXI_LATENCY_ANY = 0xa0 |
| 766 | AXI_LATENCY_32 = 0xa1 |
| 767 | AXI_LATENCY_64 = 0xa2 |
| 768 | AXI_LATENCY_128 = 0xa3 |
| 769 | AXI_LATENCY_256 = 0xa4 |
| 770 | AXI_LATENCY_512 = 0xa5 |
| 771 | AXI_LATENCY_1024 = 0xa6 |
| 772 | |
| 773 | class pooling_mode(Enum): |
| 774 | MAX = 0 |
| 775 | AVERAGE = 1 |
| 776 | REDUCE_SUM = 2 |
| 777 | |
| 778 | class privilege_level(Enum): |
| 779 | USER = 0 |
| 780 | PRIVILEGED = 1 |
| 781 | |
Tim Hall | 79d07d2 | 2020-04-27 18:20:16 +0100 | [diff] [blame] | 782 | class resampling_mode(Enum): |
| 783 | NONE = 0 |
| 784 | NEAREST = 1 |
| 785 | TRANSPOSE = 2 |
| 786 | |
| 787 | class rounding(Enum): |
| 788 | TFL = 0 |
| 789 | TRUNCATE = 1 |
| 790 | NATURAL = 2 |
| 791 | |
| 792 | class security_level(Enum): |
| 793 | SECURE = 0 |
| 794 | NON_SECURE = 1 |
| 795 | |
Diqing Zhong | b731170 | 2020-04-14 12:31:44 +0200 | [diff] [blame] | 796 | class shram_size(Enum): |
| 797 | SHRAM_48KB = 0x30 |
| 798 | SHRAM_24KB = 0x18 |
| 799 | SHRAM_16KB = 0x10 |
| 800 | |
Tim Hall | 79d07d2 | 2020-04-27 18:20:16 +0100 | [diff] [blame] | 801 | class state(Enum): |
| 802 | STOPPED = 0 |
| 803 | RUNNING = 1 |
| 804 | |
| 805 | class stride_mode(Enum): |
| 806 | STRIDE_MODE_1D = 0 |
| 807 | STRIDE_MODE_2D = 1 |
| 808 | STRIDE_MODE_3D = 2 |
| 809 | |
| 810 | |
Douglas Troha | 77f8396 | 2020-05-14 16:36:17 +0200 | [diff] [blame^] | 811 | class id_r(Union): |
| 812 | class _bitfield(Structure): |
| 813 | _fields_ = [ |
| 814 | ("version_status", c_uint32, 4), |
| 815 | ("version_minor", c_uint32, 4), |
| 816 | ("version_major", c_uint32, 4), |
| 817 | ("product_major", c_uint32, 4), |
| 818 | ("arch_patch_rev", c_uint32, 4), |
| 819 | ("arch_minor_rev", c_uint32, 8), |
| 820 | ("arch_major_rev", c_uint32, 4), |
| 821 | ] |
| 822 | _fields_ = [("bits", _bitfield), |
| 823 | ("word", c_uint32)] |
| 824 | def set_version_status(self, value): self.bits.version_status = value |
| 825 | def get_version_status(self): value = self.bits.version_status; return value |
| 826 | def set_version_minor(self, value): self.bits.version_minor = value |
| 827 | def get_version_minor(self): value = self.bits.version_minor; return value |
| 828 | def set_version_major(self, value): self.bits.version_major = value |
| 829 | def get_version_major(self): value = self.bits.version_major; return value |
| 830 | def set_product_major(self, value): self.bits.product_major = value |
| 831 | def get_product_major(self): value = self.bits.product_major; return value |
| 832 | def set_arch_patch_rev(self, value): self.bits.arch_patch_rev = value |
| 833 | def get_arch_patch_rev(self): value = self.bits.arch_patch_rev; return value |
| 834 | def set_arch_minor_rev(self, value): self.bits.arch_minor_rev = value |
| 835 | def get_arch_minor_rev(self): value = self.bits.arch_minor_rev; return value |
| 836 | def set_arch_major_rev(self, value): self.bits.arch_major_rev = value |
| 837 | def get_arch_major_rev(self): value = self.bits.arch_major_rev; return value |
| 838 | |
| 839 | |
| 840 | class status_r(Union): |
| 841 | class _bitfield(Structure): |
| 842 | _fields_ = [ |
| 843 | ("state", c_uint32, 1), |
| 844 | ("irq_raised", c_uint32, 1), |
| 845 | ("bus_status", c_uint32, 1), |
| 846 | ("reset_status", c_uint32, 1), |
| 847 | ("cmd_parse_error", c_uint32, 1), |
| 848 | ("cmd_end_reached", c_uint32, 1), |
| 849 | ("pmu_irq_raised", c_uint32, 1), |
| 850 | ("wd_fault", c_uint32, 1), |
| 851 | ("reserved0", c_uint32, 3), |
| 852 | ("faulting_interface", c_uint32, 1), |
| 853 | ("faulting_channel", c_uint32, 4), |
| 854 | ("irq_history_mask", c_uint32, 16), |
| 855 | ] |
| 856 | _fields_ = [("bits", _bitfield), |
| 857 | ("word", c_uint32)] |
| 858 | def set_state(self, value): self.bits.state = value |
| 859 | def get_state(self): value = self.bits.state; return value |
| 860 | def set_irq_raised(self, value): self.bits.irq_raised = value |
| 861 | def get_irq_raised(self): value = self.bits.irq_raised; return value |
| 862 | def set_bus_status(self, value): self.bits.bus_status = value |
| 863 | def get_bus_status(self): value = self.bits.bus_status; return value |
| 864 | def set_reset_status(self, value): self.bits.reset_status = value |
| 865 | def get_reset_status(self): value = self.bits.reset_status; return value |
| 866 | def set_cmd_parse_error(self, value): self.bits.cmd_parse_error = value |
| 867 | def get_cmd_parse_error(self): value = self.bits.cmd_parse_error; return value |
| 868 | def set_cmd_end_reached(self, value): self.bits.cmd_end_reached = value |
| 869 | def get_cmd_end_reached(self): value = self.bits.cmd_end_reached; return value |
| 870 | def set_pmu_irq_raised(self, value): self.bits.pmu_irq_raised = value |
| 871 | def get_pmu_irq_raised(self): value = self.bits.pmu_irq_raised; return value |
| 872 | def set_wd_fault(self, value): self.bits.wd_fault = value |
| 873 | def get_wd_fault(self): value = self.bits.wd_fault; return value |
| 874 | def set_faulting_interface(self, value): self.bits.faulting_interface = value |
| 875 | def get_faulting_interface(self): value = self.bits.faulting_interface; return value |
| 876 | def set_faulting_channel(self, value): self.bits.faulting_channel = value |
| 877 | def get_faulting_channel(self): value = self.bits.faulting_channel; return value |
| 878 | def set_irq_history_mask(self, value): self.bits.irq_history_mask = value |
| 879 | def get_irq_history_mask(self): value = self.bits.irq_history_mask; return value |
| 880 | |
| 881 | |
| 882 | class cmd_r(Union): |
| 883 | class _bitfield(Structure): |
| 884 | _fields_ = [ |
| 885 | ("transition_to_running_state", c_uint32, 1), |
| 886 | ("clear_irq", c_uint32, 1), |
| 887 | ("clock_q_enable", c_uint32, 1), |
| 888 | ("power_q_enable", c_uint32, 1), |
| 889 | ("stop_request", c_uint32, 1), |
| 890 | ("reserved0", c_uint32, 11), |
| 891 | ("clear_irq_history", c_uint32, 16), |
| 892 | ] |
| 893 | _fields_ = [("bits", _bitfield), |
| 894 | ("word", c_uint32)] |
| 895 | def set_transition_to_running_state(self, value): self.bits.transition_to_running_state = value |
| 896 | def get_transition_to_running_state(self): value = self.bits.transition_to_running_state; return value |
| 897 | def set_clear_irq(self, value): self.bits.clear_irq = value |
| 898 | def get_clear_irq(self): value = self.bits.clear_irq; return value |
| 899 | def set_clock_q_enable(self, value): self.bits.clock_q_enable = value |
| 900 | def get_clock_q_enable(self): value = self.bits.clock_q_enable; return value |
| 901 | def set_power_q_enable(self, value): self.bits.power_q_enable = value |
| 902 | def get_power_q_enable(self): value = self.bits.power_q_enable; return value |
| 903 | def set_stop_request(self, value): self.bits.stop_request = value |
| 904 | def get_stop_request(self): value = self.bits.stop_request; return value |
| 905 | def set_clear_irq_history(self, value): self.bits.clear_irq_history = value |
| 906 | def get_clear_irq_history(self): value = self.bits.clear_irq_history; return value |
| 907 | |
| 908 | |
| 909 | class reset_r(Union): |
| 910 | class _bitfield(Structure): |
| 911 | _fields_ = [ |
| 912 | ("pending_cpl", c_uint32, 1), |
| 913 | ("pending_csl", c_uint32, 1), |
| 914 | ("reserved0", c_uint32, 30), |
| 915 | ] |
| 916 | _fields_ = [("bits", _bitfield), |
| 917 | ("word", c_uint32)] |
| 918 | def set_pending_cpl(self, value): self.bits.pending_cpl = value |
| 919 | def get_pending_cpl(self): value = self.bits.pending_cpl; return value |
| 920 | def set_pending_csl(self, value): self.bits.pending_csl = value |
| 921 | def get_pending_csl(self): value = self.bits.pending_csl; return value |
| 922 | |
| 923 | |
| 924 | class qbase0_r(Union): |
| 925 | class _bitfield(Structure): |
| 926 | _fields_ = [ |
| 927 | ("qbase0", c_uint32, 32), |
| 928 | ] |
| 929 | _fields_ = [("bits", _bitfield), |
| 930 | ("word", c_uint32)] |
| 931 | def set_qbase0(self, value): self.bits.qbase0 = value |
| 932 | def get_qbase0(self): value = self.bits.qbase0; return value |
| 933 | |
| 934 | |
| 935 | class qbase1_r(Union): |
| 936 | class _bitfield(Structure): |
| 937 | _fields_ = [ |
| 938 | ("qbase1", c_uint32, 32), |
| 939 | ] |
| 940 | _fields_ = [("bits", _bitfield), |
| 941 | ("word", c_uint32)] |
| 942 | def set_qbase1(self, value): self.bits.qbase1 = value |
| 943 | def get_qbase1(self): value = self.bits.qbase1; return value |
| 944 | |
| 945 | |
| 946 | class qread_r(Union): |
| 947 | class _bitfield(Structure): |
| 948 | _fields_ = [ |
| 949 | ("qread", c_uint32, 32), |
| 950 | ] |
| 951 | _fields_ = [("bits", _bitfield), |
| 952 | ("word", c_uint32)] |
| 953 | def set_qread(self, value): self.bits.qread = value |
| 954 | def get_qread(self): value = self.bits.qread; return value |
| 955 | |
| 956 | |
| 957 | class qconfig_r(Union): |
| 958 | class _bitfield(Structure): |
| 959 | _fields_ = [ |
| 960 | ("qconfig", c_uint32, 32), |
| 961 | ] |
| 962 | _fields_ = [("bits", _bitfield), |
| 963 | ("word", c_uint32)] |
| 964 | def set_qconfig(self, value): self.bits.qconfig = value |
| 965 | def get_qconfig(self): value = self.bits.qconfig; return value |
| 966 | |
| 967 | |
| 968 | class qsize_r(Union): |
| 969 | class _bitfield(Structure): |
| 970 | _fields_ = [ |
| 971 | ("qsize", c_uint32, 32), |
| 972 | ] |
| 973 | _fields_ = [("bits", _bitfield), |
| 974 | ("word", c_uint32)] |
| 975 | def set_qsize(self, value): self.bits.qsize = value |
| 976 | def get_qsize(self): value = self.bits.qsize; return value |
| 977 | |
| 978 | |
| 979 | class prot_r(Union): |
| 980 | class _bitfield(Structure): |
| 981 | _fields_ = [ |
| 982 | ("active_cpl", c_uint32, 1), |
| 983 | ("active_csl", c_uint32, 1), |
| 984 | ("reserved0", c_uint32, 30), |
| 985 | ] |
| 986 | _fields_ = [("bits", _bitfield), |
| 987 | ("word", c_uint32)] |
| 988 | def set_active_cpl(self, value): self.bits.active_cpl = value |
| 989 | def get_active_cpl(self): value = self.bits.active_cpl; return value |
| 990 | def set_active_csl(self, value): self.bits.active_csl = value |
| 991 | def get_active_csl(self): value = self.bits.active_csl; return value |
| 992 | |
| 993 | |
| 994 | class config_r(Union): |
| 995 | class _bitfield(Structure): |
| 996 | _fields_ = [ |
| 997 | ("macs_per_cc", c_uint32, 4), |
| 998 | ("cmd_stream_version", c_uint32, 4), |
| 999 | ("shram_size", c_uint32, 8), |
| 1000 | ("reserved0", c_uint32, 12), |
| 1001 | ("product", c_uint32, 4), |
| 1002 | ] |
| 1003 | _fields_ = [("bits", _bitfield), |
| 1004 | ("word", c_uint32)] |
| 1005 | def set_macs_per_cc(self, value): self.bits.macs_per_cc = value |
| 1006 | def get_macs_per_cc(self): value = self.bits.macs_per_cc; return value |
| 1007 | def set_cmd_stream_version(self, value): self.bits.cmd_stream_version = value |
| 1008 | def get_cmd_stream_version(self): value = self.bits.cmd_stream_version; return value |
| 1009 | def set_shram_size(self, value): self.bits.shram_size = value |
| 1010 | def get_shram_size(self): value = self.bits.shram_size; return value |
| 1011 | def set_product(self, value): self.bits.product = value |
| 1012 | def get_product(self): value = self.bits.product; return value |
| 1013 | |
| 1014 | |
| 1015 | class lock_r(Union): |
| 1016 | class _bitfield(Structure): |
| 1017 | _fields_ = [ |
| 1018 | ("lock", c_uint32, 32), |
| 1019 | ] |
| 1020 | _fields_ = [("bits", _bitfield), |
| 1021 | ("word", c_uint32)] |
| 1022 | def set_lock(self, value): self.bits.lock = value |
| 1023 | def get_lock(self): value = self.bits.lock; return value |
| 1024 | |
| 1025 | |
| 1026 | class regioncfg_r(Union): |
| 1027 | class _bitfield(Structure): |
| 1028 | _fields_ = [ |
| 1029 | ("region0", c_uint32, 2), |
| 1030 | ("region1", c_uint32, 2), |
| 1031 | ("region2", c_uint32, 2), |
| 1032 | ("region3", c_uint32, 2), |
| 1033 | ("region4", c_uint32, 2), |
| 1034 | ("region5", c_uint32, 2), |
| 1035 | ("region6", c_uint32, 2), |
| 1036 | ("region7", c_uint32, 2), |
| 1037 | ("reserved0", c_uint32, 16), |
| 1038 | ] |
| 1039 | _fields_ = [("bits", _bitfield), |
| 1040 | ("word", c_uint32)] |
| 1041 | def set_region0(self, value): self.bits.region0 = value |
| 1042 | def get_region0(self): value = self.bits.region0; return value |
| 1043 | def set_region1(self, value): self.bits.region1 = value |
| 1044 | def get_region1(self): value = self.bits.region1; return value |
| 1045 | def set_region2(self, value): self.bits.region2 = value |
| 1046 | def get_region2(self): value = self.bits.region2; return value |
| 1047 | def set_region3(self, value): self.bits.region3 = value |
| 1048 | def get_region3(self): value = self.bits.region3; return value |
| 1049 | def set_region4(self, value): self.bits.region4 = value |
| 1050 | def get_region4(self): value = self.bits.region4; return value |
| 1051 | def set_region5(self, value): self.bits.region5 = value |
| 1052 | def get_region5(self): value = self.bits.region5; return value |
| 1053 | def set_region6(self, value): self.bits.region6 = value |
| 1054 | def get_region6(self): value = self.bits.region6; return value |
| 1055 | def set_region7(self, value): self.bits.region7 = value |
| 1056 | def get_region7(self): value = self.bits.region7; return value |
| 1057 | |
| 1058 | |
| 1059 | class axi_limit0_r(Union): |
| 1060 | class _bitfield(Structure): |
| 1061 | _fields_ = [ |
| 1062 | ("max_beats", c_uint32, 2), |
| 1063 | ("reserved0", c_uint32, 2), |
| 1064 | ("memtype", c_uint32, 4), |
| 1065 | ("reserved1", c_uint32, 8), |
| 1066 | ("max_outstanding_read_m1", c_uint32, 8), |
| 1067 | ("max_outstanding_write_m1", c_uint32, 8), |
| 1068 | ] |
| 1069 | _fields_ = [("bits", _bitfield), |
| 1070 | ("word", c_uint32)] |
| 1071 | def set_max_beats(self, value): self.bits.max_beats = value |
| 1072 | def get_max_beats(self): value = self.bits.max_beats; return value |
| 1073 | def set_memtype(self, value): self.bits.memtype = value |
| 1074 | def get_memtype(self): value = self.bits.memtype; return value |
| 1075 | def set_max_outstanding_read_m1(self, value): self.bits.max_outstanding_read_m1 = value |
| 1076 | def get_max_outstanding_read_m1(self): value = self.bits.max_outstanding_read_m1; return value |
| 1077 | def set_max_outstanding_write_m1(self, value): self.bits.max_outstanding_write_m1 = value |
| 1078 | def get_max_outstanding_write_m1(self): value = self.bits.max_outstanding_write_m1; return value |
| 1079 | |
| 1080 | |
| 1081 | class axi_limit1_r(Union): |
| 1082 | class _bitfield(Structure): |
| 1083 | _fields_ = [ |
| 1084 | ("max_beats", c_uint32, 2), |
| 1085 | ("reserved0", c_uint32, 2), |
| 1086 | ("memtype", c_uint32, 4), |
| 1087 | ("reserved1", c_uint32, 8), |
| 1088 | ("max_outstanding_read_m1", c_uint32, 8), |
| 1089 | ("max_outstanding_write_m1", c_uint32, 8), |
| 1090 | ] |
| 1091 | _fields_ = [("bits", _bitfield), |
| 1092 | ("word", c_uint32)] |
| 1093 | def set_max_beats(self, value): self.bits.max_beats = value |
| 1094 | def get_max_beats(self): value = self.bits.max_beats; return value |
| 1095 | def set_memtype(self, value): self.bits.memtype = value |
| 1096 | def get_memtype(self): value = self.bits.memtype; return value |
| 1097 | def set_max_outstanding_read_m1(self, value): self.bits.max_outstanding_read_m1 = value |
| 1098 | def get_max_outstanding_read_m1(self): value = self.bits.max_outstanding_read_m1; return value |
| 1099 | def set_max_outstanding_write_m1(self, value): self.bits.max_outstanding_write_m1 = value |
| 1100 | def get_max_outstanding_write_m1(self): value = self.bits.max_outstanding_write_m1; return value |
| 1101 | |
| 1102 | |
| 1103 | class axi_limit2_r(Union): |
| 1104 | class _bitfield(Structure): |
| 1105 | _fields_ = [ |
| 1106 | ("max_beats", c_uint32, 2), |
| 1107 | ("reserved0", c_uint32, 2), |
| 1108 | ("memtype", c_uint32, 4), |
| 1109 | ("reserved1", c_uint32, 8), |
| 1110 | ("max_outstanding_read_m1", c_uint32, 8), |
| 1111 | ("max_outstanding_write_m1", c_uint32, 8), |
| 1112 | ] |
| 1113 | _fields_ = [("bits", _bitfield), |
| 1114 | ("word", c_uint32)] |
| 1115 | def set_max_beats(self, value): self.bits.max_beats = value |
| 1116 | def get_max_beats(self): value = self.bits.max_beats; return value |
| 1117 | def set_memtype(self, value): self.bits.memtype = value |
| 1118 | def get_memtype(self): value = self.bits.memtype; return value |
| 1119 | def set_max_outstanding_read_m1(self, value): self.bits.max_outstanding_read_m1 = value |
| 1120 | def get_max_outstanding_read_m1(self): value = self.bits.max_outstanding_read_m1; return value |
| 1121 | def set_max_outstanding_write_m1(self, value): self.bits.max_outstanding_write_m1 = value |
| 1122 | def get_max_outstanding_write_m1(self): value = self.bits.max_outstanding_write_m1; return value |
| 1123 | |
| 1124 | |
| 1125 | class axi_limit3_r(Union): |
| 1126 | class _bitfield(Structure): |
| 1127 | _fields_ = [ |
| 1128 | ("max_beats", c_uint32, 2), |
| 1129 | ("reserved0", c_uint32, 2), |
| 1130 | ("memtype", c_uint32, 4), |
| 1131 | ("reserved1", c_uint32, 8), |
| 1132 | ("max_outstanding_read_m1", c_uint32, 8), |
| 1133 | ("max_outstanding_write_m1", c_uint32, 8), |
| 1134 | ] |
| 1135 | _fields_ = [("bits", _bitfield), |
| 1136 | ("word", c_uint32)] |
| 1137 | def set_max_beats(self, value): self.bits.max_beats = value |
| 1138 | def get_max_beats(self): value = self.bits.max_beats; return value |
| 1139 | def set_memtype(self, value): self.bits.memtype = value |
| 1140 | def get_memtype(self): value = self.bits.memtype; return value |
| 1141 | def set_max_outstanding_read_m1(self, value): self.bits.max_outstanding_read_m1 = value |
| 1142 | def get_max_outstanding_read_m1(self): value = self.bits.max_outstanding_read_m1; return value |
| 1143 | def set_max_outstanding_write_m1(self, value): self.bits.max_outstanding_write_m1 = value |
| 1144 | def get_max_outstanding_write_m1(self): value = self.bits.max_outstanding_write_m1; return value |
| 1145 | |
| 1146 | |
| 1147 | class basep0_r(Union): |
| 1148 | class _bitfield(Structure): |
| 1149 | _fields_ = [ |
| 1150 | ("addr_word", c_uint32, 32), |
| 1151 | ] |
| 1152 | _fields_ = [("bits", _bitfield), |
| 1153 | ("word", c_uint32)] |
| 1154 | def set_addr_word(self, value): self.bits.addr_word = value |
| 1155 | def get_addr_word(self): value = self.bits.addr_word; return value |
| 1156 | |
| 1157 | |
| 1158 | class basep1_r(Union): |
| 1159 | class _bitfield(Structure): |
| 1160 | _fields_ = [ |
| 1161 | ("addr_word", c_uint32, 32), |
| 1162 | ] |
| 1163 | _fields_ = [("bits", _bitfield), |
| 1164 | ("word", c_uint32)] |
| 1165 | def set_addr_word(self, value): self.bits.addr_word = value |
| 1166 | def get_addr_word(self): value = self.bits.addr_word; return value |
| 1167 | |
| 1168 | |
| 1169 | class basep2_r(Union): |
| 1170 | class _bitfield(Structure): |
| 1171 | _fields_ = [ |
| 1172 | ("addr_word", c_uint32, 32), |
| 1173 | ] |
| 1174 | _fields_ = [("bits", _bitfield), |
| 1175 | ("word", c_uint32)] |
| 1176 | def set_addr_word(self, value): self.bits.addr_word = value |
| 1177 | def get_addr_word(self): value = self.bits.addr_word; return value |
| 1178 | |
| 1179 | |
| 1180 | class basep3_r(Union): |
| 1181 | class _bitfield(Structure): |
| 1182 | _fields_ = [ |
| 1183 | ("addr_word", c_uint32, 32), |
| 1184 | ] |
| 1185 | _fields_ = [("bits", _bitfield), |
| 1186 | ("word", c_uint32)] |
| 1187 | def set_addr_word(self, value): self.bits.addr_word = value |
| 1188 | def get_addr_word(self): value = self.bits.addr_word; return value |
| 1189 | |
| 1190 | |
| 1191 | class basep4_r(Union): |
| 1192 | class _bitfield(Structure): |
| 1193 | _fields_ = [ |
| 1194 | ("addr_word", c_uint32, 32), |
| 1195 | ] |
| 1196 | _fields_ = [("bits", _bitfield), |
| 1197 | ("word", c_uint32)] |
| 1198 | def set_addr_word(self, value): self.bits.addr_word = value |
| 1199 | def get_addr_word(self): value = self.bits.addr_word; return value |
| 1200 | |
| 1201 | |
| 1202 | class basep5_r(Union): |
| 1203 | class _bitfield(Structure): |
| 1204 | _fields_ = [ |
| 1205 | ("addr_word", c_uint32, 32), |
| 1206 | ] |
| 1207 | _fields_ = [("bits", _bitfield), |
| 1208 | ("word", c_uint32)] |
| 1209 | def set_addr_word(self, value): self.bits.addr_word = value |
| 1210 | def get_addr_word(self): value = self.bits.addr_word; return value |
| 1211 | |
| 1212 | |
| 1213 | class basep6_r(Union): |
| 1214 | class _bitfield(Structure): |
| 1215 | _fields_ = [ |
| 1216 | ("addr_word", c_uint32, 32), |
| 1217 | ] |
| 1218 | _fields_ = [("bits", _bitfield), |
| 1219 | ("word", c_uint32)] |
| 1220 | def set_addr_word(self, value): self.bits.addr_word = value |
| 1221 | def get_addr_word(self): value = self.bits.addr_word; return value |
| 1222 | |
| 1223 | |
| 1224 | class basep7_r(Union): |
| 1225 | class _bitfield(Structure): |
| 1226 | _fields_ = [ |
| 1227 | ("addr_word", c_uint32, 32), |
| 1228 | ] |
| 1229 | _fields_ = [("bits", _bitfield), |
| 1230 | ("word", c_uint32)] |
| 1231 | def set_addr_word(self, value): self.bits.addr_word = value |
| 1232 | def get_addr_word(self): value = self.bits.addr_word; return value |
| 1233 | |
| 1234 | |
| 1235 | class basep8_r(Union): |
| 1236 | class _bitfield(Structure): |
| 1237 | _fields_ = [ |
| 1238 | ("addr_word", c_uint32, 32), |
| 1239 | ] |
| 1240 | _fields_ = [("bits", _bitfield), |
| 1241 | ("word", c_uint32)] |
| 1242 | def set_addr_word(self, value): self.bits.addr_word = value |
| 1243 | def get_addr_word(self): value = self.bits.addr_word; return value |
| 1244 | |
| 1245 | |
| 1246 | class basep9_r(Union): |
| 1247 | class _bitfield(Structure): |
| 1248 | _fields_ = [ |
| 1249 | ("addr_word", c_uint32, 32), |
| 1250 | ] |
| 1251 | _fields_ = [("bits", _bitfield), |
| 1252 | ("word", c_uint32)] |
| 1253 | def set_addr_word(self, value): self.bits.addr_word = value |
| 1254 | def get_addr_word(self): value = self.bits.addr_word; return value |
| 1255 | |
| 1256 | |
| 1257 | class basep10_r(Union): |
| 1258 | class _bitfield(Structure): |
| 1259 | _fields_ = [ |
| 1260 | ("addr_word", c_uint32, 32), |
| 1261 | ] |
| 1262 | _fields_ = [("bits", _bitfield), |
| 1263 | ("word", c_uint32)] |
| 1264 | def set_addr_word(self, value): self.bits.addr_word = value |
| 1265 | def get_addr_word(self): value = self.bits.addr_word; return value |
| 1266 | |
| 1267 | |
| 1268 | class basep11_r(Union): |
| 1269 | class _bitfield(Structure): |
| 1270 | _fields_ = [ |
| 1271 | ("addr_word", c_uint32, 32), |
| 1272 | ] |
| 1273 | _fields_ = [("bits", _bitfield), |
| 1274 | ("word", c_uint32)] |
| 1275 | def set_addr_word(self, value): self.bits.addr_word = value |
| 1276 | def get_addr_word(self): value = self.bits.addr_word; return value |
| 1277 | |
| 1278 | |
| 1279 | class basep12_r(Union): |
| 1280 | class _bitfield(Structure): |
| 1281 | _fields_ = [ |
| 1282 | ("addr_word", c_uint32, 32), |
| 1283 | ] |
| 1284 | _fields_ = [("bits", _bitfield), |
| 1285 | ("word", c_uint32)] |
| 1286 | def set_addr_word(self, value): self.bits.addr_word = value |
| 1287 | def get_addr_word(self): value = self.bits.addr_word; return value |
| 1288 | |
| 1289 | |
| 1290 | class basep13_r(Union): |
| 1291 | class _bitfield(Structure): |
| 1292 | _fields_ = [ |
| 1293 | ("addr_word", c_uint32, 32), |
| 1294 | ] |
| 1295 | _fields_ = [("bits", _bitfield), |
| 1296 | ("word", c_uint32)] |
| 1297 | def set_addr_word(self, value): self.bits.addr_word = value |
| 1298 | def get_addr_word(self): value = self.bits.addr_word; return value |
| 1299 | |
| 1300 | |
| 1301 | class basep14_r(Union): |
| 1302 | class _bitfield(Structure): |
| 1303 | _fields_ = [ |
| 1304 | ("addr_word", c_uint32, 32), |
| 1305 | ] |
| 1306 | _fields_ = [("bits", _bitfield), |
| 1307 | ("word", c_uint32)] |
| 1308 | def set_addr_word(self, value): self.bits.addr_word = value |
| 1309 | def get_addr_word(self): value = self.bits.addr_word; return value |
| 1310 | |
| 1311 | |
| 1312 | class basep15_r(Union): |
| 1313 | class _bitfield(Structure): |
| 1314 | _fields_ = [ |
| 1315 | ("addr_word", c_uint32, 32), |
| 1316 | ] |
| 1317 | _fields_ = [("bits", _bitfield), |
| 1318 | ("word", c_uint32)] |
| 1319 | def set_addr_word(self, value): self.bits.addr_word = value |
| 1320 | def get_addr_word(self): value = self.bits.addr_word; return value |
| 1321 | |
| 1322 | |
Douglas Troha | 22df2ad | 2020-05-08 13:09:13 +0200 | [diff] [blame] | 1323 | class wd_status_r(Union): |
| 1324 | class _bitfield(Structure): |
| 1325 | _fields_ = [ |
| 1326 | ("core_slice_state", c_uint32, 2), |
| 1327 | ("core_idle", c_uint32, 1), |
| 1328 | ("ctrl_state", c_uint32, 2), |
| 1329 | ("ctrl_idle", c_uint32, 1), |
| 1330 | ("write_buf_index0", c_uint32, 3), |
| 1331 | ("write_buf_valid0", c_uint32, 1), |
| 1332 | ("write_buf_idle0", c_uint32, 1), |
| 1333 | ("write_buf_index1", c_uint32, 3), |
| 1334 | ("write_buf_valid1", c_uint32, 1), |
| 1335 | ("write_buf_idle1", c_uint32, 1), |
| 1336 | ("events", c_uint32, 12), |
| 1337 | ("reserved0", c_uint32, 4), |
| 1338 | ] |
| 1339 | _fields_ = [("bits", _bitfield), |
| 1340 | ("word", c_uint32)] |
| 1341 | def set_core_slice_state(self, value): self.bits.core_slice_state = value |
| 1342 | def get_core_slice_state(self): value = self.bits.core_slice_state; return value |
| 1343 | def set_core_idle(self, value): self.bits.core_idle = value |
| 1344 | def get_core_idle(self): value = self.bits.core_idle; return value |
| 1345 | def set_ctrl_state(self, value): self.bits.ctrl_state = value |
| 1346 | def get_ctrl_state(self): value = self.bits.ctrl_state; return value |
| 1347 | def set_ctrl_idle(self, value): self.bits.ctrl_idle = value |
| 1348 | def get_ctrl_idle(self): value = self.bits.ctrl_idle; return value |
| 1349 | def set_write_buf_index0(self, value): self.bits.write_buf_index0 = value |
| 1350 | def get_write_buf_index0(self): value = self.bits.write_buf_index0; return value |
| 1351 | def set_write_buf_valid0(self, value): self.bits.write_buf_valid0 = value |
| 1352 | def get_write_buf_valid0(self): value = self.bits.write_buf_valid0; return value |
| 1353 | def set_write_buf_idle0(self, value): self.bits.write_buf_idle0 = value |
| 1354 | def get_write_buf_idle0(self): value = self.bits.write_buf_idle0; return value |
| 1355 | def set_write_buf_index1(self, value): self.bits.write_buf_index1 = value |
| 1356 | def get_write_buf_index1(self): value = self.bits.write_buf_index1; return value |
| 1357 | def set_write_buf_valid1(self, value): self.bits.write_buf_valid1 = value |
| 1358 | def get_write_buf_valid1(self): value = self.bits.write_buf_valid1; return value |
| 1359 | def set_write_buf_idle1(self, value): self.bits.write_buf_idle1 = value |
| 1360 | def get_write_buf_idle1(self): value = self.bits.write_buf_idle1; return value |
| 1361 | def set_events(self, value): self.bits.events = value |
| 1362 | def get_events(self): value = self.bits.events; return value |
| 1363 | |
| 1364 | |
| 1365 | class mac_status_r(Union): |
| 1366 | class _bitfield(Structure): |
| 1367 | _fields_ = [ |
| 1368 | ("block_cfg_valid", c_uint32, 1), |
| 1369 | ("trav_en", c_uint32, 1), |
| 1370 | ("wait_for_ib", c_uint32, 1), |
| 1371 | ("wait_for_acc_buf", c_uint32, 1), |
| 1372 | ("wait_for_weights", c_uint32, 1), |
| 1373 | ("stall_stripe", c_uint32, 1), |
| 1374 | ("dw_sel", c_uint32, 1), |
| 1375 | ("wait_for_dw0_ready", c_uint32, 1), |
| 1376 | ("wait_for_dw1_ready", c_uint32, 1), |
| 1377 | ("acc_buf_sel_ai", c_uint32, 1), |
| 1378 | ("wait_for_acc0_ready", c_uint32, 1), |
| 1379 | ("wait_for_acc1_ready", c_uint32, 1), |
| 1380 | ("acc_buf_sel_aa", c_uint32, 1), |
| 1381 | ("acc0_valid", c_uint32, 1), |
| 1382 | ("acc1_valid", c_uint32, 1), |
| 1383 | ("reserved0", c_uint32, 1), |
| 1384 | ("events", c_uint32, 11), |
| 1385 | ("reserved1", c_uint32, 5), |
| 1386 | ] |
| 1387 | _fields_ = [("bits", _bitfield), |
| 1388 | ("word", c_uint32)] |
| 1389 | def set_block_cfg_valid(self, value): self.bits.block_cfg_valid = value |
| 1390 | def get_block_cfg_valid(self): value = self.bits.block_cfg_valid; return value |
| 1391 | def set_trav_en(self, value): self.bits.trav_en = value |
| 1392 | def get_trav_en(self): value = self.bits.trav_en; return value |
| 1393 | def set_wait_for_ib(self, value): self.bits.wait_for_ib = value |
| 1394 | def get_wait_for_ib(self): value = self.bits.wait_for_ib; return value |
| 1395 | def set_wait_for_acc_buf(self, value): self.bits.wait_for_acc_buf = value |
| 1396 | def get_wait_for_acc_buf(self): value = self.bits.wait_for_acc_buf; return value |
| 1397 | def set_wait_for_weights(self, value): self.bits.wait_for_weights = value |
| 1398 | def get_wait_for_weights(self): value = self.bits.wait_for_weights; return value |
| 1399 | def set_stall_stripe(self, value): self.bits.stall_stripe = value |
| 1400 | def get_stall_stripe(self): value = self.bits.stall_stripe; return value |
| 1401 | def set_dw_sel(self, value): self.bits.dw_sel = value |
| 1402 | def get_dw_sel(self): value = self.bits.dw_sel; return value |
| 1403 | def set_wait_for_dw0_ready(self, value): self.bits.wait_for_dw0_ready = value |
| 1404 | def get_wait_for_dw0_ready(self): value = self.bits.wait_for_dw0_ready; return value |
| 1405 | def set_wait_for_dw1_ready(self, value): self.bits.wait_for_dw1_ready = value |
| 1406 | def get_wait_for_dw1_ready(self): value = self.bits.wait_for_dw1_ready; return value |
| 1407 | def set_acc_buf_sel_ai(self, value): self.bits.acc_buf_sel_ai = value |
| 1408 | def get_acc_buf_sel_ai(self): value = self.bits.acc_buf_sel_ai; return value |
| 1409 | def set_wait_for_acc0_ready(self, value): self.bits.wait_for_acc0_ready = value |
| 1410 | def get_wait_for_acc0_ready(self): value = self.bits.wait_for_acc0_ready; return value |
| 1411 | def set_wait_for_acc1_ready(self, value): self.bits.wait_for_acc1_ready = value |
| 1412 | def get_wait_for_acc1_ready(self): value = self.bits.wait_for_acc1_ready; return value |
| 1413 | def set_acc_buf_sel_aa(self, value): self.bits.acc_buf_sel_aa = value |
| 1414 | def get_acc_buf_sel_aa(self): value = self.bits.acc_buf_sel_aa; return value |
| 1415 | def set_acc0_valid(self, value): self.bits.acc0_valid = value |
| 1416 | def get_acc0_valid(self): value = self.bits.acc0_valid; return value |
| 1417 | def set_acc1_valid(self, value): self.bits.acc1_valid = value |
| 1418 | def get_acc1_valid(self): value = self.bits.acc1_valid; return value |
| 1419 | def set_events(self, value): self.bits.events = value |
| 1420 | def get_events(self): value = self.bits.events; return value |
| 1421 | |
| 1422 | |
| 1423 | class ao_status_r(Union): |
| 1424 | class _bitfield(Structure): |
| 1425 | _fields_ = [ |
| 1426 | ("cmd_sbw_valid", c_uint32, 1), |
| 1427 | ("cmd_act_valid", c_uint32, 1), |
| 1428 | ("cmd_ctl_valid", c_uint32, 1), |
| 1429 | ("cmd_scl_valid", c_uint32, 1), |
| 1430 | ("cmd_sbr_valid", c_uint32, 1), |
| 1431 | ("cmd_ofm_valid", c_uint32, 1), |
| 1432 | ("blk_cmd_ready", c_uint32, 1), |
| 1433 | ("blk_cmd_valid", c_uint32, 1), |
| 1434 | ("reserved0", c_uint32, 8), |
| 1435 | ("events", c_uint32, 8), |
| 1436 | ("reserved1", c_uint32, 8), |
| 1437 | ] |
| 1438 | _fields_ = [("bits", _bitfield), |
| 1439 | ("word", c_uint32)] |
| 1440 | def set_cmd_sbw_valid(self, value): self.bits.cmd_sbw_valid = value |
| 1441 | def get_cmd_sbw_valid(self): value = self.bits.cmd_sbw_valid; return value |
| 1442 | def set_cmd_act_valid(self, value): self.bits.cmd_act_valid = value |
| 1443 | def get_cmd_act_valid(self): value = self.bits.cmd_act_valid; return value |
| 1444 | def set_cmd_ctl_valid(self, value): self.bits.cmd_ctl_valid = value |
| 1445 | def get_cmd_ctl_valid(self): value = self.bits.cmd_ctl_valid; return value |
| 1446 | def set_cmd_scl_valid(self, value): self.bits.cmd_scl_valid = value |
| 1447 | def get_cmd_scl_valid(self): value = self.bits.cmd_scl_valid; return value |
| 1448 | def set_cmd_sbr_valid(self, value): self.bits.cmd_sbr_valid = value |
| 1449 | def get_cmd_sbr_valid(self): value = self.bits.cmd_sbr_valid; return value |
| 1450 | def set_cmd_ofm_valid(self, value): self.bits.cmd_ofm_valid = value |
| 1451 | def get_cmd_ofm_valid(self): value = self.bits.cmd_ofm_valid; return value |
| 1452 | def set_blk_cmd_ready(self, value): self.bits.blk_cmd_ready = value |
| 1453 | def get_blk_cmd_ready(self): value = self.bits.blk_cmd_ready; return value |
| 1454 | def set_blk_cmd_valid(self, value): self.bits.blk_cmd_valid = value |
| 1455 | def get_blk_cmd_valid(self): value = self.bits.blk_cmd_valid; return value |
| 1456 | def set_events(self, value): self.bits.events = value |
| 1457 | def get_events(self): value = self.bits.events; return value |
| 1458 | |
| 1459 | |
| 1460 | class dma_status0_r(Union): |
| 1461 | class _bitfield(Structure): |
| 1462 | _fields_ = [ |
| 1463 | ("cmd_idle", c_uint32, 1), |
| 1464 | ("ifm_idle", c_uint32, 1), |
| 1465 | ("wgt_idle_c0", c_uint32, 1), |
| 1466 | ("bas_idle_c0", c_uint32, 1), |
| 1467 | ("m2m_idle", c_uint32, 1), |
| 1468 | ("ofm_idle", c_uint32, 1), |
| 1469 | ("halt_req", c_uint32, 1), |
| 1470 | ("halt_ack", c_uint32, 1), |
| 1471 | ("pause_req", c_uint32, 1), |
| 1472 | ("pause_ack", c_uint32, 1), |
| 1473 | ("ib0_ai_valid_c0", c_uint32, 1), |
| 1474 | ("ib0_ai_ready_c0", c_uint32, 1), |
| 1475 | ("ib1_ai_valid_c0", c_uint32, 1), |
| 1476 | ("ib1_ai_ready_c0", c_uint32, 1), |
| 1477 | ("ib0_ao_valid_c0", c_uint32, 1), |
| 1478 | ("ib0_ao_ready_c0", c_uint32, 1), |
| 1479 | ("ib1_ao_valid_c0", c_uint32, 1), |
| 1480 | ("ib1_ao_ready_c0", c_uint32, 1), |
| 1481 | ("ob0_valid_c0", c_uint32, 1), |
| 1482 | ("ob0_ready_c0", c_uint32, 1), |
| 1483 | ("ob1_valid_c0", c_uint32, 1), |
| 1484 | ("ob1_ready_c0", c_uint32, 1), |
| 1485 | ("cmd_valid", c_uint32, 1), |
| 1486 | ("cmd_ready", c_uint32, 1), |
| 1487 | ("wd_bitstream_valid_c0", c_uint32, 1), |
| 1488 | ("wd_bitstream_ready_c0", c_uint32, 1), |
| 1489 | ("bs_bitstream_valid_c0", c_uint32, 1), |
| 1490 | ("bs_bitstream_ready_c0", c_uint32, 1), |
| 1491 | ("axi0_ar_stalled", c_uint32, 1), |
| 1492 | ("axi0_rd_limit_stall", c_uint32, 1), |
| 1493 | ("axi0_aw_stalled", c_uint32, 1), |
| 1494 | ("axi0_w_stalled", c_uint32, 1), |
| 1495 | ] |
| 1496 | _fields_ = [("bits", _bitfield), |
| 1497 | ("word", c_uint32)] |
| 1498 | def set_cmd_idle(self, value): self.bits.cmd_idle = value |
| 1499 | def get_cmd_idle(self): value = self.bits.cmd_idle; return value |
| 1500 | def set_ifm_idle(self, value): self.bits.ifm_idle = value |
| 1501 | def get_ifm_idle(self): value = self.bits.ifm_idle; return value |
| 1502 | def set_wgt_idle_c0(self, value): self.bits.wgt_idle_c0 = value |
| 1503 | def get_wgt_idle_c0(self): value = self.bits.wgt_idle_c0; return value |
| 1504 | def set_bas_idle_c0(self, value): self.bits.bas_idle_c0 = value |
| 1505 | def get_bas_idle_c0(self): value = self.bits.bas_idle_c0; return value |
| 1506 | def set_m2m_idle(self, value): self.bits.m2m_idle = value |
| 1507 | def get_m2m_idle(self): value = self.bits.m2m_idle; return value |
| 1508 | def set_ofm_idle(self, value): self.bits.ofm_idle = value |
| 1509 | def get_ofm_idle(self): value = self.bits.ofm_idle; return value |
| 1510 | def set_halt_req(self, value): self.bits.halt_req = value |
| 1511 | def get_halt_req(self): value = self.bits.halt_req; return value |
| 1512 | def set_halt_ack(self, value): self.bits.halt_ack = value |
| 1513 | def get_halt_ack(self): value = self.bits.halt_ack; return value |
| 1514 | def set_pause_req(self, value): self.bits.pause_req = value |
| 1515 | def get_pause_req(self): value = self.bits.pause_req; return value |
| 1516 | def set_pause_ack(self, value): self.bits.pause_ack = value |
| 1517 | def get_pause_ack(self): value = self.bits.pause_ack; return value |
| 1518 | def set_ib0_ai_valid_c0(self, value): self.bits.ib0_ai_valid_c0 = value |
| 1519 | def get_ib0_ai_valid_c0(self): value = self.bits.ib0_ai_valid_c0; return value |
| 1520 | def set_ib0_ai_ready_c0(self, value): self.bits.ib0_ai_ready_c0 = value |
| 1521 | def get_ib0_ai_ready_c0(self): value = self.bits.ib0_ai_ready_c0; return value |
| 1522 | def set_ib1_ai_valid_c0(self, value): self.bits.ib1_ai_valid_c0 = value |
| 1523 | def get_ib1_ai_valid_c0(self): value = self.bits.ib1_ai_valid_c0; return value |
| 1524 | def set_ib1_ai_ready_c0(self, value): self.bits.ib1_ai_ready_c0 = value |
| 1525 | def get_ib1_ai_ready_c0(self): value = self.bits.ib1_ai_ready_c0; return value |
| 1526 | def set_ib0_ao_valid_c0(self, value): self.bits.ib0_ao_valid_c0 = value |
| 1527 | def get_ib0_ao_valid_c0(self): value = self.bits.ib0_ao_valid_c0; return value |
| 1528 | def set_ib0_ao_ready_c0(self, value): self.bits.ib0_ao_ready_c0 = value |
| 1529 | def get_ib0_ao_ready_c0(self): value = self.bits.ib0_ao_ready_c0; return value |
| 1530 | def set_ib1_ao_valid_c0(self, value): self.bits.ib1_ao_valid_c0 = value |
| 1531 | def get_ib1_ao_valid_c0(self): value = self.bits.ib1_ao_valid_c0; return value |
| 1532 | def set_ib1_ao_ready_c0(self, value): self.bits.ib1_ao_ready_c0 = value |
| 1533 | def get_ib1_ao_ready_c0(self): value = self.bits.ib1_ao_ready_c0; return value |
| 1534 | def set_ob0_valid_c0(self, value): self.bits.ob0_valid_c0 = value |
| 1535 | def get_ob0_valid_c0(self): value = self.bits.ob0_valid_c0; return value |
| 1536 | def set_ob0_ready_c0(self, value): self.bits.ob0_ready_c0 = value |
| 1537 | def get_ob0_ready_c0(self): value = self.bits.ob0_ready_c0; return value |
| 1538 | def set_ob1_valid_c0(self, value): self.bits.ob1_valid_c0 = value |
| 1539 | def get_ob1_valid_c0(self): value = self.bits.ob1_valid_c0; return value |
| 1540 | def set_ob1_ready_c0(self, value): self.bits.ob1_ready_c0 = value |
| 1541 | def get_ob1_ready_c0(self): value = self.bits.ob1_ready_c0; return value |
| 1542 | def set_cmd_valid(self, value): self.bits.cmd_valid = value |
| 1543 | def get_cmd_valid(self): value = self.bits.cmd_valid; return value |
| 1544 | def set_cmd_ready(self, value): self.bits.cmd_ready = value |
| 1545 | def get_cmd_ready(self): value = self.bits.cmd_ready; return value |
| 1546 | def set_wd_bitstream_valid_c0(self, value): self.bits.wd_bitstream_valid_c0 = value |
| 1547 | def get_wd_bitstream_valid_c0(self): value = self.bits.wd_bitstream_valid_c0; return value |
| 1548 | def set_wd_bitstream_ready_c0(self, value): self.bits.wd_bitstream_ready_c0 = value |
| 1549 | def get_wd_bitstream_ready_c0(self): value = self.bits.wd_bitstream_ready_c0; return value |
| 1550 | def set_bs_bitstream_valid_c0(self, value): self.bits.bs_bitstream_valid_c0 = value |
| 1551 | def get_bs_bitstream_valid_c0(self): value = self.bits.bs_bitstream_valid_c0; return value |
| 1552 | def set_bs_bitstream_ready_c0(self, value): self.bits.bs_bitstream_ready_c0 = value |
| 1553 | def get_bs_bitstream_ready_c0(self): value = self.bits.bs_bitstream_ready_c0; return value |
| 1554 | def set_axi0_ar_stalled(self, value): self.bits.axi0_ar_stalled = value |
| 1555 | def get_axi0_ar_stalled(self): value = self.bits.axi0_ar_stalled; return value |
| 1556 | def set_axi0_rd_limit_stall(self, value): self.bits.axi0_rd_limit_stall = value |
| 1557 | def get_axi0_rd_limit_stall(self): value = self.bits.axi0_rd_limit_stall; return value |
| 1558 | def set_axi0_aw_stalled(self, value): self.bits.axi0_aw_stalled = value |
| 1559 | def get_axi0_aw_stalled(self): value = self.bits.axi0_aw_stalled; return value |
| 1560 | def set_axi0_w_stalled(self, value): self.bits.axi0_w_stalled = value |
| 1561 | def get_axi0_w_stalled(self): value = self.bits.axi0_w_stalled; return value |
| 1562 | |
| 1563 | |
| 1564 | class dma_status1_r(Union): |
| 1565 | class _bitfield(Structure): |
| 1566 | _fields_ = [ |
| 1567 | ("axi0_wr_limit_stall", c_uint32, 1), |
| 1568 | ("axi1_ar_stalled", c_uint32, 1), |
| 1569 | ("axi1_rd_limit_stall", c_uint32, 1), |
| 1570 | ("axi1_wr_stalled", c_uint32, 1), |
| 1571 | ("axi1_w_stalled", c_uint32, 1), |
| 1572 | ("axi1_wr_limit_stall", c_uint32, 1), |
| 1573 | ("wgt_idle_c1", c_uint32, 1), |
| 1574 | ("bas_idle_c1", c_uint32, 1), |
| 1575 | ("ib0_ai_valid_c1", c_uint32, 1), |
| 1576 | ("ib0_ai_ready_c1", c_uint32, 1), |
| 1577 | ("ib1_ai_valid_c1", c_uint32, 1), |
| 1578 | ("ib1_ai_ready_c1", c_uint32, 1), |
| 1579 | ("ib0_ao_valid_c1", c_uint32, 1), |
| 1580 | ("ib0_ao_ready_c1", c_uint32, 1), |
| 1581 | ("ib1_ao_valid_c1", c_uint32, 1), |
| 1582 | ("ib1_ao_ready_c1", c_uint32, 1), |
| 1583 | ("ob0_valid_c1", c_uint32, 1), |
| 1584 | ("ob0_ready_c1", c_uint32, 1), |
| 1585 | ("ob1_valid_c1", c_uint32, 1), |
| 1586 | ("ob1_ready_c1", c_uint32, 1), |
| 1587 | ("wd_bitstream_valid_c1", c_uint32, 1), |
| 1588 | ("wd_bitstream_ready_c1", c_uint32, 1), |
| 1589 | ("bs_bitstream_valid_c1", c_uint32, 1), |
| 1590 | ("bs_bitstream_ready_c1", c_uint32, 1), |
| 1591 | ("reserved0", c_uint32, 8), |
| 1592 | ] |
| 1593 | _fields_ = [("bits", _bitfield), |
| 1594 | ("word", c_uint32)] |
| 1595 | def set_axi0_wr_limit_stall(self, value): self.bits.axi0_wr_limit_stall = value |
| 1596 | def get_axi0_wr_limit_stall(self): value = self.bits.axi0_wr_limit_stall; return value |
| 1597 | def set_axi1_ar_stalled(self, value): self.bits.axi1_ar_stalled = value |
| 1598 | def get_axi1_ar_stalled(self): value = self.bits.axi1_ar_stalled; return value |
| 1599 | def set_axi1_rd_limit_stall(self, value): self.bits.axi1_rd_limit_stall = value |
| 1600 | def get_axi1_rd_limit_stall(self): value = self.bits.axi1_rd_limit_stall; return value |
| 1601 | def set_axi1_wr_stalled(self, value): self.bits.axi1_wr_stalled = value |
| 1602 | def get_axi1_wr_stalled(self): value = self.bits.axi1_wr_stalled; return value |
| 1603 | def set_axi1_w_stalled(self, value): self.bits.axi1_w_stalled = value |
| 1604 | def get_axi1_w_stalled(self): value = self.bits.axi1_w_stalled; return value |
| 1605 | def set_axi1_wr_limit_stall(self, value): self.bits.axi1_wr_limit_stall = value |
| 1606 | def get_axi1_wr_limit_stall(self): value = self.bits.axi1_wr_limit_stall; return value |
| 1607 | def set_wgt_idle_c1(self, value): self.bits.wgt_idle_c1 = value |
| 1608 | def get_wgt_idle_c1(self): value = self.bits.wgt_idle_c1; return value |
| 1609 | def set_bas_idle_c1(self, value): self.bits.bas_idle_c1 = value |
| 1610 | def get_bas_idle_c1(self): value = self.bits.bas_idle_c1; return value |
| 1611 | def set_ib0_ai_valid_c1(self, value): self.bits.ib0_ai_valid_c1 = value |
| 1612 | def get_ib0_ai_valid_c1(self): value = self.bits.ib0_ai_valid_c1; return value |
| 1613 | def set_ib0_ai_ready_c1(self, value): self.bits.ib0_ai_ready_c1 = value |
| 1614 | def get_ib0_ai_ready_c1(self): value = self.bits.ib0_ai_ready_c1; return value |
| 1615 | def set_ib1_ai_valid_c1(self, value): self.bits.ib1_ai_valid_c1 = value |
| 1616 | def get_ib1_ai_valid_c1(self): value = self.bits.ib1_ai_valid_c1; return value |
| 1617 | def set_ib1_ai_ready_c1(self, value): self.bits.ib1_ai_ready_c1 = value |
| 1618 | def get_ib1_ai_ready_c1(self): value = self.bits.ib1_ai_ready_c1; return value |
| 1619 | def set_ib0_ao_valid_c1(self, value): self.bits.ib0_ao_valid_c1 = value |
| 1620 | def get_ib0_ao_valid_c1(self): value = self.bits.ib0_ao_valid_c1; return value |
| 1621 | def set_ib0_ao_ready_c1(self, value): self.bits.ib0_ao_ready_c1 = value |
| 1622 | def get_ib0_ao_ready_c1(self): value = self.bits.ib0_ao_ready_c1; return value |
| 1623 | def set_ib1_ao_valid_c1(self, value): self.bits.ib1_ao_valid_c1 = value |
| 1624 | def get_ib1_ao_valid_c1(self): value = self.bits.ib1_ao_valid_c1; return value |
| 1625 | def set_ib1_ao_ready_c1(self, value): self.bits.ib1_ao_ready_c1 = value |
| 1626 | def get_ib1_ao_ready_c1(self): value = self.bits.ib1_ao_ready_c1; return value |
| 1627 | def set_ob0_valid_c1(self, value): self.bits.ob0_valid_c1 = value |
| 1628 | def get_ob0_valid_c1(self): value = self.bits.ob0_valid_c1; return value |
| 1629 | def set_ob0_ready_c1(self, value): self.bits.ob0_ready_c1 = value |
| 1630 | def get_ob0_ready_c1(self): value = self.bits.ob0_ready_c1; return value |
| 1631 | def set_ob1_valid_c1(self, value): self.bits.ob1_valid_c1 = value |
| 1632 | def get_ob1_valid_c1(self): value = self.bits.ob1_valid_c1; return value |
| 1633 | def set_ob1_ready_c1(self, value): self.bits.ob1_ready_c1 = value |
| 1634 | def get_ob1_ready_c1(self): value = self.bits.ob1_ready_c1; return value |
| 1635 | def set_wd_bitstream_valid_c1(self, value): self.bits.wd_bitstream_valid_c1 = value |
| 1636 | def get_wd_bitstream_valid_c1(self): value = self.bits.wd_bitstream_valid_c1; return value |
| 1637 | def set_wd_bitstream_ready_c1(self, value): self.bits.wd_bitstream_ready_c1 = value |
| 1638 | def get_wd_bitstream_ready_c1(self): value = self.bits.wd_bitstream_ready_c1; return value |
| 1639 | def set_bs_bitstream_valid_c1(self, value): self.bits.bs_bitstream_valid_c1 = value |
| 1640 | def get_bs_bitstream_valid_c1(self): value = self.bits.bs_bitstream_valid_c1; return value |
| 1641 | def set_bs_bitstream_ready_c1(self, value): self.bits.bs_bitstream_ready_c1 = value |
| 1642 | def get_bs_bitstream_ready_c1(self): value = self.bits.bs_bitstream_ready_c1; return value |
| 1643 | |
| 1644 | |
Tim Hall | 79d07d2 | 2020-04-27 18:20:16 +0100 | [diff] [blame] | 1645 | class clkforce_r(Union): |
| 1646 | class _bitfield(Structure): |
| 1647 | _fields_ = [ |
| 1648 | ("top_level_clk", c_uint32, 1), |
| 1649 | ("cc_clk", c_uint32, 1), |
| 1650 | ("dma_clk", c_uint32, 1), |
| 1651 | ("mac_clk", c_uint32, 1), |
| 1652 | ("ao_clk", c_uint32, 1), |
| 1653 | ("wd_clk", c_uint32, 1), |
| 1654 | ("reserved0", c_uint32, 26), |
| 1655 | ] |
| 1656 | _fields_ = [("bits", _bitfield), |
| 1657 | ("word", c_uint32)] |
| 1658 | def set_top_level_clk(self, value): self.bits.top_level_clk = value |
| 1659 | def get_top_level_clk(self): value = self.bits.top_level_clk; return value |
| 1660 | def set_cc_clk(self, value): self.bits.cc_clk = value |
| 1661 | def get_cc_clk(self): value = self.bits.cc_clk; return value |
| 1662 | def set_dma_clk(self, value): self.bits.dma_clk = value |
| 1663 | def get_dma_clk(self): value = self.bits.dma_clk; return value |
| 1664 | def set_mac_clk(self, value): self.bits.mac_clk = value |
| 1665 | def get_mac_clk(self): value = self.bits.mac_clk; return value |
| 1666 | def set_ao_clk(self, value): self.bits.ao_clk = value |
| 1667 | def get_ao_clk(self): value = self.bits.ao_clk; return value |
| 1668 | def set_wd_clk(self, value): self.bits.wd_clk = value |
| 1669 | def get_wd_clk(self): value = self.bits.wd_clk; return value |
| 1670 | |
| 1671 | |
Tim Hall | 79d07d2 | 2020-04-27 18:20:16 +0100 | [diff] [blame] | 1672 | class pid4_r(Union): |
| 1673 | class _bitfield(Structure): |
| 1674 | _fields_ = [ |
| 1675 | ("pid4", c_uint32, 32), |
| 1676 | ] |
| 1677 | _fields_ = [("bits", _bitfield), |
| 1678 | ("word", c_uint32)] |
| 1679 | def set_pid4(self, value): self.bits.pid4 = value |
| 1680 | def get_pid4(self): value = self.bits.pid4; return value |
| 1681 | |
| 1682 | |
| 1683 | class pid5_r(Union): |
| 1684 | class _bitfield(Structure): |
| 1685 | _fields_ = [ |
| 1686 | ("pid5", c_uint32, 32), |
| 1687 | ] |
| 1688 | _fields_ = [("bits", _bitfield), |
| 1689 | ("word", c_uint32)] |
| 1690 | def set_pid5(self, value): self.bits.pid5 = value |
| 1691 | def get_pid5(self): value = self.bits.pid5; return value |
| 1692 | |
| 1693 | |
| 1694 | class pid6_r(Union): |
| 1695 | class _bitfield(Structure): |
| 1696 | _fields_ = [ |
| 1697 | ("pid6", c_uint32, 32), |
| 1698 | ] |
| 1699 | _fields_ = [("bits", _bitfield), |
| 1700 | ("word", c_uint32)] |
| 1701 | def set_pid6(self, value): self.bits.pid6 = value |
| 1702 | def get_pid6(self): value = self.bits.pid6; return value |
| 1703 | |
| 1704 | |
| 1705 | class pid7_r(Union): |
| 1706 | class _bitfield(Structure): |
| 1707 | _fields_ = [ |
| 1708 | ("pid7", c_uint32, 32), |
| 1709 | ] |
| 1710 | _fields_ = [("bits", _bitfield), |
| 1711 | ("word", c_uint32)] |
| 1712 | def set_pid7(self, value): self.bits.pid7 = value |
| 1713 | def get_pid7(self): value = self.bits.pid7; return value |
| 1714 | |
| 1715 | |
| 1716 | class pid0_r(Union): |
| 1717 | class _bitfield(Structure): |
| 1718 | _fields_ = [ |
| 1719 | ("pid0", c_uint32, 32), |
| 1720 | ] |
| 1721 | _fields_ = [("bits", _bitfield), |
| 1722 | ("word", c_uint32)] |
| 1723 | def set_pid0(self, value): self.bits.pid0 = value |
| 1724 | def get_pid0(self): value = self.bits.pid0; return value |
| 1725 | |
| 1726 | |
| 1727 | class pid1_r(Union): |
| 1728 | class _bitfield(Structure): |
| 1729 | _fields_ = [ |
| 1730 | ("pid1", c_uint32, 32), |
| 1731 | ] |
| 1732 | _fields_ = [("bits", _bitfield), |
| 1733 | ("word", c_uint32)] |
| 1734 | def set_pid1(self, value): self.bits.pid1 = value |
| 1735 | def get_pid1(self): value = self.bits.pid1; return value |
| 1736 | |
| 1737 | |
| 1738 | class pid2_r(Union): |
| 1739 | class _bitfield(Structure): |
| 1740 | _fields_ = [ |
| 1741 | ("pid2", c_uint32, 32), |
| 1742 | ] |
| 1743 | _fields_ = [("bits", _bitfield), |
| 1744 | ("word", c_uint32)] |
| 1745 | def set_pid2(self, value): self.bits.pid2 = value |
| 1746 | def get_pid2(self): value = self.bits.pid2; return value |
| 1747 | |
| 1748 | |
| 1749 | class pid3_r(Union): |
| 1750 | class _bitfield(Structure): |
| 1751 | _fields_ = [ |
| 1752 | ("pid3", c_uint32, 32), |
| 1753 | ] |
| 1754 | _fields_ = [("bits", _bitfield), |
| 1755 | ("word", c_uint32)] |
| 1756 | def set_pid3(self, value): self.bits.pid3 = value |
| 1757 | def get_pid3(self): value = self.bits.pid3; return value |
| 1758 | |
| 1759 | |
| 1760 | class cid0_r(Union): |
| 1761 | class _bitfield(Structure): |
| 1762 | _fields_ = [ |
| 1763 | ("cid0", c_uint32, 32), |
| 1764 | ] |
| 1765 | _fields_ = [("bits", _bitfield), |
| 1766 | ("word", c_uint32)] |
| 1767 | def set_cid0(self, value): self.bits.cid0 = value |
| 1768 | def get_cid0(self): value = self.bits.cid0; return value |
| 1769 | |
| 1770 | |
| 1771 | class cid1_r(Union): |
| 1772 | class _bitfield(Structure): |
| 1773 | _fields_ = [ |
| 1774 | ("cid1", c_uint32, 32), |
| 1775 | ] |
| 1776 | _fields_ = [("bits", _bitfield), |
| 1777 | ("word", c_uint32)] |
| 1778 | def set_cid1(self, value): self.bits.cid1 = value |
| 1779 | def get_cid1(self): value = self.bits.cid1; return value |
| 1780 | |
| 1781 | |
| 1782 | class cid2_r(Union): |
| 1783 | class _bitfield(Structure): |
| 1784 | _fields_ = [ |
| 1785 | ("cid2", c_uint32, 32), |
| 1786 | ] |
| 1787 | _fields_ = [("bits", _bitfield), |
| 1788 | ("word", c_uint32)] |
| 1789 | def set_cid2(self, value): self.bits.cid2 = value |
| 1790 | def get_cid2(self): value = self.bits.cid2; return value |
| 1791 | |
| 1792 | |
| 1793 | class cid3_r(Union): |
| 1794 | class _bitfield(Structure): |
| 1795 | _fields_ = [ |
| 1796 | ("cid3", c_uint32, 32), |
| 1797 | ] |
| 1798 | _fields_ = [("bits", _bitfield), |
| 1799 | ("word", c_uint32)] |
| 1800 | def set_cid3(self, value): self.bits.cid3 = value |
| 1801 | def get_cid3(self): value = self.bits.cid3; return value |
| 1802 | |
| 1803 | |
Tim Hall | 79d07d2 | 2020-04-27 18:20:16 +0100 | [diff] [blame] | 1804 | class pmcr_r(Union): |
| 1805 | class _bitfield(Structure): |
| 1806 | _fields_ = [ |
| 1807 | ("cnt_en", c_uint32, 1), |
| 1808 | ("event_cnt_rst", c_uint32, 1), |
| 1809 | ("cycle_cnt_rst", c_uint32, 1), |
| 1810 | ("mask_en", c_uint32, 1), |
| 1811 | ("reserved0", c_uint32, 7), |
| 1812 | ("num_event_cnt", c_uint32, 5), |
| 1813 | ("reserved1", c_uint32, 16), |
| 1814 | ] |
| 1815 | _fields_ = [("bits", _bitfield), |
| 1816 | ("word", c_uint32)] |
| 1817 | def set_cnt_en(self, value): self.bits.cnt_en = value |
| 1818 | def get_cnt_en(self): value = self.bits.cnt_en; return value |
| 1819 | def set_event_cnt_rst(self, value): self.bits.event_cnt_rst = value |
| 1820 | def get_event_cnt_rst(self): value = self.bits.event_cnt_rst; return value |
| 1821 | def set_cycle_cnt_rst(self, value): self.bits.cycle_cnt_rst = value |
| 1822 | def get_cycle_cnt_rst(self): value = self.bits.cycle_cnt_rst; return value |
| 1823 | def set_mask_en(self, value): self.bits.mask_en = value |
| 1824 | def get_mask_en(self): value = self.bits.mask_en; return value |
| 1825 | def set_num_event_cnt(self, value): self.bits.num_event_cnt = value |
| 1826 | def get_num_event_cnt(self): value = self.bits.num_event_cnt; return value |
| 1827 | |
| 1828 | |
| 1829 | class pmcntenset_r(Union): |
| 1830 | class _bitfield(Structure): |
| 1831 | _fields_ = [ |
| 1832 | ("event_cnt_0", c_uint32, 1), |
| 1833 | ("event_cnt_1", c_uint32, 1), |
| 1834 | ("event_cnt_2", c_uint32, 1), |
| 1835 | ("event_cnt_3", c_uint32, 1), |
| 1836 | ("reserved0", c_uint32, 27), |
| 1837 | ("cycle_cnt", c_uint32, 1), |
| 1838 | ] |
| 1839 | _fields_ = [("bits", _bitfield), |
| 1840 | ("word", c_uint32)] |
| 1841 | def set_event_cnt_0(self, value): self.bits.event_cnt_0 = value |
| 1842 | def get_event_cnt_0(self): value = self.bits.event_cnt_0; return value |
| 1843 | def set_event_cnt_1(self, value): self.bits.event_cnt_1 = value |
| 1844 | def get_event_cnt_1(self): value = self.bits.event_cnt_1; return value |
| 1845 | def set_event_cnt_2(self, value): self.bits.event_cnt_2 = value |
| 1846 | def get_event_cnt_2(self): value = self.bits.event_cnt_2; return value |
| 1847 | def set_event_cnt_3(self, value): self.bits.event_cnt_3 = value |
| 1848 | def get_event_cnt_3(self): value = self.bits.event_cnt_3; return value |
| 1849 | def set_cycle_cnt(self, value): self.bits.cycle_cnt = value |
| 1850 | def get_cycle_cnt(self): value = self.bits.cycle_cnt; return value |
| 1851 | |
| 1852 | |
| 1853 | class pmcntenclr_r(Union): |
| 1854 | class _bitfield(Structure): |
| 1855 | _fields_ = [ |
| 1856 | ("event_cnt_0", c_uint32, 1), |
| 1857 | ("event_cnt_1", c_uint32, 1), |
| 1858 | ("event_cnt_2", c_uint32, 1), |
| 1859 | ("event_cnt_3", c_uint32, 1), |
| 1860 | ("reserved0", c_uint32, 27), |
| 1861 | ("cycle_cnt", c_uint32, 1), |
| 1862 | ] |
| 1863 | _fields_ = [("bits", _bitfield), |
| 1864 | ("word", c_uint32)] |
| 1865 | def set_event_cnt_0(self, value): self.bits.event_cnt_0 = value |
| 1866 | def get_event_cnt_0(self): value = self.bits.event_cnt_0; return value |
| 1867 | def set_event_cnt_1(self, value): self.bits.event_cnt_1 = value |
| 1868 | def get_event_cnt_1(self): value = self.bits.event_cnt_1; return value |
| 1869 | def set_event_cnt_2(self, value): self.bits.event_cnt_2 = value |
| 1870 | def get_event_cnt_2(self): value = self.bits.event_cnt_2; return value |
| 1871 | def set_event_cnt_3(self, value): self.bits.event_cnt_3 = value |
| 1872 | def get_event_cnt_3(self): value = self.bits.event_cnt_3; return value |
| 1873 | def set_cycle_cnt(self, value): self.bits.cycle_cnt = value |
| 1874 | def get_cycle_cnt(self): value = self.bits.cycle_cnt; return value |
| 1875 | |
| 1876 | |
| 1877 | class pmovsset_r(Union): |
| 1878 | class _bitfield(Structure): |
| 1879 | _fields_ = [ |
| 1880 | ("event_cnt_0_ovf", c_uint32, 1), |
| 1881 | ("event_cnt_1_ovf", c_uint32, 1), |
| 1882 | ("event_cnt_2_ovf", c_uint32, 1), |
| 1883 | ("event_cnt_3_ovf", c_uint32, 1), |
| 1884 | ("reserved0", c_uint32, 27), |
| 1885 | ("cycle_cnt_ovf", c_uint32, 1), |
| 1886 | ] |
| 1887 | _fields_ = [("bits", _bitfield), |
| 1888 | ("word", c_uint32)] |
| 1889 | def set_event_cnt_0_ovf(self, value): self.bits.event_cnt_0_ovf = value |
| 1890 | def get_event_cnt_0_ovf(self): value = self.bits.event_cnt_0_ovf; return value |
| 1891 | def set_event_cnt_1_ovf(self, value): self.bits.event_cnt_1_ovf = value |
| 1892 | def get_event_cnt_1_ovf(self): value = self.bits.event_cnt_1_ovf; return value |
| 1893 | def set_event_cnt_2_ovf(self, value): self.bits.event_cnt_2_ovf = value |
| 1894 | def get_event_cnt_2_ovf(self): value = self.bits.event_cnt_2_ovf; return value |
| 1895 | def set_event_cnt_3_ovf(self, value): self.bits.event_cnt_3_ovf = value |
| 1896 | def get_event_cnt_3_ovf(self): value = self.bits.event_cnt_3_ovf; return value |
| 1897 | def set_cycle_cnt_ovf(self, value): self.bits.cycle_cnt_ovf = value |
| 1898 | def get_cycle_cnt_ovf(self): value = self.bits.cycle_cnt_ovf; return value |
| 1899 | |
| 1900 | |
| 1901 | class pmovsclr_r(Union): |
| 1902 | class _bitfield(Structure): |
| 1903 | _fields_ = [ |
| 1904 | ("event_cnt_0_ovf", c_uint32, 1), |
| 1905 | ("event_cnt_1_ovf", c_uint32, 1), |
| 1906 | ("event_cnt_2_ovf", c_uint32, 1), |
| 1907 | ("event_cnt_3_ovf", c_uint32, 1), |
| 1908 | ("reserved0", c_uint32, 27), |
| 1909 | ("cycle_cnt_ovf", c_uint32, 1), |
| 1910 | ] |
| 1911 | _fields_ = [("bits", _bitfield), |
| 1912 | ("word", c_uint32)] |
| 1913 | def set_event_cnt_0_ovf(self, value): self.bits.event_cnt_0_ovf = value |
| 1914 | def get_event_cnt_0_ovf(self): value = self.bits.event_cnt_0_ovf; return value |
| 1915 | def set_event_cnt_1_ovf(self, value): self.bits.event_cnt_1_ovf = value |
| 1916 | def get_event_cnt_1_ovf(self): value = self.bits.event_cnt_1_ovf; return value |
| 1917 | def set_event_cnt_2_ovf(self, value): self.bits.event_cnt_2_ovf = value |
| 1918 | def get_event_cnt_2_ovf(self): value = self.bits.event_cnt_2_ovf; return value |
| 1919 | def set_event_cnt_3_ovf(self, value): self.bits.event_cnt_3_ovf = value |
| 1920 | def get_event_cnt_3_ovf(self): value = self.bits.event_cnt_3_ovf; return value |
| 1921 | def set_cycle_cnt_ovf(self, value): self.bits.cycle_cnt_ovf = value |
| 1922 | def get_cycle_cnt_ovf(self): value = self.bits.cycle_cnt_ovf; return value |
| 1923 | |
| 1924 | |
| 1925 | class pmintset_r(Union): |
| 1926 | class _bitfield(Structure): |
| 1927 | _fields_ = [ |
| 1928 | ("event_cnt_0_int", c_uint32, 1), |
| 1929 | ("event_cnt_1_int", c_uint32, 1), |
| 1930 | ("event_cnt_2_int", c_uint32, 1), |
| 1931 | ("event_cnt_3_int", c_uint32, 1), |
| 1932 | ("reserved0", c_uint32, 27), |
| 1933 | ("cycle_cnt_int", c_uint32, 1), |
| 1934 | ] |
| 1935 | _fields_ = [("bits", _bitfield), |
| 1936 | ("word", c_uint32)] |
| 1937 | def set_event_cnt_0_int(self, value): self.bits.event_cnt_0_int = value |
| 1938 | def get_event_cnt_0_int(self): value = self.bits.event_cnt_0_int; return value |
| 1939 | def set_event_cnt_1_int(self, value): self.bits.event_cnt_1_int = value |
| 1940 | def get_event_cnt_1_int(self): value = self.bits.event_cnt_1_int; return value |
| 1941 | def set_event_cnt_2_int(self, value): self.bits.event_cnt_2_int = value |
| 1942 | def get_event_cnt_2_int(self): value = self.bits.event_cnt_2_int; return value |
| 1943 | def set_event_cnt_3_int(self, value): self.bits.event_cnt_3_int = value |
| 1944 | def get_event_cnt_3_int(self): value = self.bits.event_cnt_3_int; return value |
| 1945 | def set_cycle_cnt_int(self, value): self.bits.cycle_cnt_int = value |
| 1946 | def get_cycle_cnt_int(self): value = self.bits.cycle_cnt_int; return value |
| 1947 | |
| 1948 | |
| 1949 | class pmintclr_r(Union): |
| 1950 | class _bitfield(Structure): |
| 1951 | _fields_ = [ |
| 1952 | ("event_cnt_0_int", c_uint32, 1), |
| 1953 | ("event_cnt_1_int", c_uint32, 1), |
| 1954 | ("event_cnt_2_int", c_uint32, 1), |
| 1955 | ("event_cnt_3_int", c_uint32, 1), |
| 1956 | ("reserved0", c_uint32, 27), |
| 1957 | ("cycle_cnt_int", c_uint32, 1), |
| 1958 | ] |
| 1959 | _fields_ = [("bits", _bitfield), |
| 1960 | ("word", c_uint32)] |
| 1961 | def set_event_cnt_0_int(self, value): self.bits.event_cnt_0_int = value |
| 1962 | def get_event_cnt_0_int(self): value = self.bits.event_cnt_0_int; return value |
| 1963 | def set_event_cnt_1_int(self, value): self.bits.event_cnt_1_int = value |
| 1964 | def get_event_cnt_1_int(self): value = self.bits.event_cnt_1_int; return value |
| 1965 | def set_event_cnt_2_int(self, value): self.bits.event_cnt_2_int = value |
| 1966 | def get_event_cnt_2_int(self): value = self.bits.event_cnt_2_int; return value |
| 1967 | def set_event_cnt_3_int(self, value): self.bits.event_cnt_3_int = value |
| 1968 | def get_event_cnt_3_int(self): value = self.bits.event_cnt_3_int; return value |
| 1969 | def set_cycle_cnt_int(self, value): self.bits.cycle_cnt_int = value |
| 1970 | def get_cycle_cnt_int(self): value = self.bits.cycle_cnt_int; return value |
| 1971 | |
| 1972 | |
| 1973 | class pmccntr_lo_r(Union): |
| 1974 | class _bitfield(Structure): |
| 1975 | _fields_ = [ |
| 1976 | ("cycle_cnt_lo", c_uint32, 32), |
| 1977 | ] |
| 1978 | _fields_ = [("bits", _bitfield), |
| 1979 | ("word", c_uint32)] |
| 1980 | def set_cycle_cnt_lo(self, value): self.bits.cycle_cnt_lo = value |
| 1981 | def get_cycle_cnt_lo(self): value = self.bits.cycle_cnt_lo; return value |
| 1982 | |
| 1983 | |
| 1984 | class pmccntr_hi_r(Union): |
| 1985 | class _bitfield(Structure): |
| 1986 | _fields_ = [ |
| 1987 | ("cycle_cnt_hi", c_uint32, 16), |
| 1988 | ("reserved0", c_uint32, 16), |
| 1989 | ] |
| 1990 | _fields_ = [("bits", _bitfield), |
| 1991 | ("word", c_uint32)] |
| 1992 | def set_cycle_cnt_hi(self, value): self.bits.cycle_cnt_hi = value |
| 1993 | def get_cycle_cnt_hi(self): value = self.bits.cycle_cnt_hi; return value |
| 1994 | |
| 1995 | |
| 1996 | class pmccntr_cfg_r(Union): |
| 1997 | class _bitfield(Structure): |
| 1998 | _fields_ = [ |
| 1999 | ("cycle_cnt_cfg_start", c_uint32, 10), |
| 2000 | ("reserved0", c_uint32, 6), |
| 2001 | ("cycle_cnt_cfg_stop", c_uint32, 10), |
| 2002 | ("reserved1", c_uint32, 6), |
| 2003 | ] |
| 2004 | _fields_ = [("bits", _bitfield), |
| 2005 | ("word", c_uint32)] |
| 2006 | def set_cycle_cnt_cfg_start(self, value): self.bits.cycle_cnt_cfg_start = value |
| 2007 | def get_cycle_cnt_cfg_start(self): value = self.bits.cycle_cnt_cfg_start; return value |
| 2008 | def set_cycle_cnt_cfg_stop(self, value): self.bits.cycle_cnt_cfg_stop = value |
| 2009 | def get_cycle_cnt_cfg_stop(self): value = self.bits.cycle_cnt_cfg_stop; return value |
| 2010 | |
| 2011 | |
| 2012 | class pmcaxi_chan_r(Union): |
| 2013 | class _bitfield(Structure): |
| 2014 | _fields_ = [ |
Douglas Troha | 22df2ad | 2020-05-08 13:09:13 +0200 | [diff] [blame] | 2015 | ("ch_sel", c_uint32, 4), |
| 2016 | ("reserved0", c_uint32, 4), |
| 2017 | ("axi_cnt_sel", c_uint32, 2), |
| 2018 | ("bw_ch_sel_en", c_uint32, 1), |
| 2019 | ("reserved1", c_uint32, 21), |
Tim Hall | 79d07d2 | 2020-04-27 18:20:16 +0100 | [diff] [blame] | 2020 | ] |
| 2021 | _fields_ = [("bits", _bitfield), |
| 2022 | ("word", c_uint32)] |
Douglas Troha | 22df2ad | 2020-05-08 13:09:13 +0200 | [diff] [blame] | 2023 | def set_ch_sel(self, value): self.bits.ch_sel = value |
| 2024 | def get_ch_sel(self): value = self.bits.ch_sel; return value |
| 2025 | def set_axi_cnt_sel(self, value): self.bits.axi_cnt_sel = value |
| 2026 | def get_axi_cnt_sel(self): value = self.bits.axi_cnt_sel; return value |
| 2027 | def set_bw_ch_sel_en(self, value): self.bits.bw_ch_sel_en = value |
| 2028 | def get_bw_ch_sel_en(self): value = self.bits.bw_ch_sel_en; return value |
Tim Hall | 79d07d2 | 2020-04-27 18:20:16 +0100 | [diff] [blame] | 2029 | |
| 2030 | |
| 2031 | class pmevtyper0_r(Union): |
| 2032 | class _bitfield(Structure): |
| 2033 | _fields_ = [ |
| 2034 | ("ev_type", c_uint32, 10), |
| 2035 | ("reserved0", c_uint32, 22), |
| 2036 | ] |
| 2037 | _fields_ = [("bits", _bitfield), |
| 2038 | ("word", c_uint32)] |
| 2039 | def set_ev_type(self, value): self.bits.ev_type = value |
| 2040 | def get_ev_type(self): value = self.bits.ev_type; return value |
| 2041 | |
| 2042 | |
| 2043 | class pmevtyper1_r(Union): |
| 2044 | class _bitfield(Structure): |
| 2045 | _fields_ = [ |
| 2046 | ("ev_type", c_uint32, 10), |
| 2047 | ("reserved0", c_uint32, 22), |
| 2048 | ] |
| 2049 | _fields_ = [("bits", _bitfield), |
| 2050 | ("word", c_uint32)] |
| 2051 | def set_ev_type(self, value): self.bits.ev_type = value |
| 2052 | def get_ev_type(self): value = self.bits.ev_type; return value |
| 2053 | |
| 2054 | |
| 2055 | class pmevtyper2_r(Union): |
| 2056 | class _bitfield(Structure): |
| 2057 | _fields_ = [ |
| 2058 | ("ev_type", c_uint32, 10), |
| 2059 | ("reserved0", c_uint32, 22), |
| 2060 | ] |
| 2061 | _fields_ = [("bits", _bitfield), |
| 2062 | ("word", c_uint32)] |
| 2063 | def set_ev_type(self, value): self.bits.ev_type = value |
| 2064 | def get_ev_type(self): value = self.bits.ev_type; return value |
| 2065 | |
| 2066 | |
| 2067 | class pmevtyper3_r(Union): |
| 2068 | class _bitfield(Structure): |
| 2069 | _fields_ = [ |
| 2070 | ("ev_type", c_uint32, 10), |
| 2071 | ("reserved0", c_uint32, 22), |
| 2072 | ] |
| 2073 | _fields_ = [("bits", _bitfield), |
| 2074 | ("word", c_uint32)] |
| 2075 | def set_ev_type(self, value): self.bits.ev_type = value |
| 2076 | def get_ev_type(self): value = self.bits.ev_type; return value |
| 2077 | |
| 2078 | class command_no_payload_t(Structure): |
| 2079 | _fields_ = [ |
| 2080 | ("cmd_code", c_uint32, 10), |
| 2081 | ("must_be_zero0", c_uint32, 6), |
| 2082 | ("param", c_uint32, 16), |
| 2083 | ] |
| 2084 | def valid(self): return must_be_zero0==0; |
| 2085 | def get_cmd_code(self): return cmd_code |
| 2086 | def set_cmd_code(self, value): cmd_code = value |
| 2087 | def get_param(self): return param |
| 2088 | def set_param(self, value): param = value |
| 2089 | |
| 2090 | class command_with_payload_t(Structure): |
| 2091 | _fields_ = [ |
| 2092 | ("cmd_code", c_uint32, 10), |
| 2093 | ("must_be_zero", c_uint32, 4), |
| 2094 | ("payload_size", c_uint32, 2), |
| 2095 | ("param", c_uint32, 16), |
| 2096 | ("data", c_uint32, 32), |
| 2097 | ] |
| 2098 | def valid(self): return must_be_zero==0 and payload_size>=1 and payload_size<=2; |
| 2099 | def get_cmd_code(self): return cmd_code |
| 2100 | def set_cmd_code(self, value): cmd_code = value |
| 2101 | def get_data(self): return data |
| 2102 | def set_data(self, value): data = value |
| 2103 | def get_param(self): return param |
| 2104 | def set_param(self, value): param = value |
| 2105 | def get_payload_size(self): return payload_size |
| 2106 | def set_payload_size(self, value): payload_size = value |
| 2107 | |
| 2108 | class npu_op_stop_t(Structure): |
| 2109 | _fields_ = [ |
| 2110 | ("cmd_code", c_uint32, 10), |
| 2111 | ("must_be_zero0", c_uint32, 6), |
| 2112 | ("mask", c_uint32, 16), |
| 2113 | ] |
| 2114 | def valid(self): return cmd_code==cmd0.NPU_OP_STOP and must_be_zero0==0; |
| 2115 | def get_cmd_code(self): return cmd_code |
| 2116 | def set_cmd_code(self, value): cmd_code = value |
| 2117 | def get_mask(self): return mask |
| 2118 | def set_mask(self, value): mask = value |
| 2119 | |
| 2120 | class npu_op_irq_t(Structure): |
| 2121 | _fields_ = [ |
| 2122 | ("cmd_code", c_uint32, 10), |
| 2123 | ("must_be_zero0", c_uint32, 6), |
| 2124 | ("mask", c_uint32, 16), |
| 2125 | ] |
| 2126 | def valid(self): return cmd_code==cmd0.NPU_OP_IRQ and must_be_zero0==0; |
| 2127 | def get_cmd_code(self): return cmd_code |
| 2128 | def set_cmd_code(self, value): cmd_code = value |
| 2129 | def get_mask(self): return mask |
| 2130 | def set_mask(self, value): mask = value |
| 2131 | |
| 2132 | class npu_op_conv_t(Structure): |
| 2133 | _fields_ = [ |
| 2134 | ("cmd_code", c_uint32, 10), |
| 2135 | ("must_be_zero0", c_uint32, 6), |
| 2136 | ("reserved0", c_uint32, 16), |
| 2137 | ] |
| 2138 | def valid(self): return cmd_code==cmd0.NPU_OP_CONV and must_be_zero0==0; |
| 2139 | def get_cmd_code(self): return cmd_code |
| 2140 | def set_cmd_code(self, value): cmd_code = value |
| 2141 | |
| 2142 | class npu_op_depthwise_t(Structure): |
| 2143 | _fields_ = [ |
| 2144 | ("cmd_code", c_uint32, 10), |
| 2145 | ("must_be_zero0", c_uint32, 6), |
| 2146 | ("reserved0", c_uint32, 16), |
| 2147 | ] |
| 2148 | def valid(self): return cmd_code==cmd0.NPU_OP_DEPTHWISE and must_be_zero0==0; |
| 2149 | def get_cmd_code(self): return cmd_code |
| 2150 | def set_cmd_code(self, value): cmd_code = value |
| 2151 | |
| 2152 | class npu_op_pool_t(Structure): |
| 2153 | _fields_ = [ |
| 2154 | ("cmd_code", c_uint32, 10), |
| 2155 | ("must_be_zero0", c_uint32, 6), |
| 2156 | ("mode", c_uint32, 16), |
| 2157 | ] |
| 2158 | def valid(self): return cmd_code==cmd0.NPU_OP_POOL and must_be_zero0==0; |
| 2159 | def get_cmd_code(self): return cmd_code |
| 2160 | def set_cmd_code(self, value): cmd_code = value |
| 2161 | def get_mode(self): return mode |
| 2162 | def set_mode(self, value): mode = value |
| 2163 | |
| 2164 | class npu_op_elementwise_t(Structure): |
| 2165 | _fields_ = [ |
| 2166 | ("cmd_code", c_uint32, 10), |
| 2167 | ("must_be_zero0", c_uint32, 6), |
| 2168 | ("mode", c_uint32, 16), |
| 2169 | ] |
| 2170 | def valid(self): return cmd_code==cmd0.NPU_OP_ELEMENTWISE and must_be_zero0==0; |
| 2171 | def get_cmd_code(self): return cmd_code |
| 2172 | def set_cmd_code(self, value): cmd_code = value |
| 2173 | def get_mode(self): return mode |
| 2174 | def set_mode(self, value): mode = value |
| 2175 | |
| 2176 | class npu_op_dma_start_t(Structure): |
| 2177 | _fields_ = [ |
| 2178 | ("cmd_code", c_uint32, 10), |
| 2179 | ("must_be_zero0", c_uint32, 6), |
| 2180 | ("channel_mode", c_uint32, 16), |
| 2181 | ] |
| 2182 | def valid(self): return cmd_code==cmd0.NPU_OP_DMA_START and must_be_zero0==0; |
| 2183 | def get_channel_mode(self): return channel_mode |
| 2184 | def set_channel_mode(self, value): channel_mode = value |
| 2185 | def get_cmd_code(self): return cmd_code |
| 2186 | def set_cmd_code(self, value): cmd_code = value |
| 2187 | |
| 2188 | class npu_op_dma_wait_t(Structure): |
| 2189 | _fields_ = [ |
| 2190 | ("cmd_code", c_uint32, 10), |
| 2191 | ("must_be_zero0", c_uint32, 6), |
| 2192 | ("reserved0", c_uint32, 16), |
| 2193 | ] |
| 2194 | def valid(self): return cmd_code==cmd0.NPU_OP_DMA_WAIT and must_be_zero0==0; |
| 2195 | def get_cmd_code(self): return cmd_code |
| 2196 | def set_cmd_code(self, value): cmd_code = value |
| 2197 | |
| 2198 | class npu_op_kernel_wait_t(Structure): |
| 2199 | _fields_ = [ |
| 2200 | ("cmd_code", c_uint32, 10), |
| 2201 | ("must_be_zero0", c_uint32, 6), |
| 2202 | ("param", c_uint32, 16), |
| 2203 | ] |
| 2204 | def valid(self): return cmd_code==cmd0.NPU_OP_KERNEL_WAIT and must_be_zero0==0; |
| 2205 | def get_cmd_code(self): return cmd_code |
| 2206 | def set_cmd_code(self, value): cmd_code = value |
| 2207 | def get_param(self): return param |
| 2208 | def set_param(self, value): param = value |
| 2209 | |
| 2210 | class npu_op_pmu_mask_t(Structure): |
| 2211 | _fields_ = [ |
| 2212 | ("cmd_code", c_uint32, 10), |
| 2213 | ("must_be_zero0", c_uint32, 6), |
| 2214 | ("param", c_uint32, 16), |
| 2215 | ] |
| 2216 | def valid(self): return cmd_code==cmd0.NPU_OP_PMU_MASK and must_be_zero0==0; |
| 2217 | def get_cmd_code(self): return cmd_code |
| 2218 | def set_cmd_code(self, value): cmd_code = value |
| 2219 | def get_param(self): return param |
| 2220 | def set_param(self, value): param = value |
| 2221 | |
| 2222 | class npu_set_ifm_pad_top_t(Structure): |
| 2223 | _fields_ = [ |
| 2224 | ("cmd_code", c_uint32, 10), |
| 2225 | ("must_be_zero0", c_uint32, 6), |
| 2226 | ("param", c_uint32, 16), |
| 2227 | ] |
| 2228 | def valid(self): return cmd_code==cmd0.NPU_SET_IFM_PAD_TOP and must_be_zero0==0; |
| 2229 | def get_cmd_code(self): return cmd_code |
| 2230 | def set_cmd_code(self, value): cmd_code = value |
| 2231 | def get_param(self): return param |
| 2232 | def set_param(self, value): param = value |
| 2233 | |
| 2234 | class npu_set_ifm_pad_left_t(Structure): |
| 2235 | _fields_ = [ |
| 2236 | ("cmd_code", c_uint32, 10), |
| 2237 | ("must_be_zero0", c_uint32, 6), |
| 2238 | ("param", c_uint32, 16), |
| 2239 | ] |
| 2240 | def valid(self): return cmd_code==cmd0.NPU_SET_IFM_PAD_LEFT and must_be_zero0==0; |
| 2241 | def get_cmd_code(self): return cmd_code |
| 2242 | def set_cmd_code(self, value): cmd_code = value |
| 2243 | def get_param(self): return param |
| 2244 | def set_param(self, value): param = value |
| 2245 | |
| 2246 | class npu_set_ifm_pad_right_t(Structure): |
| 2247 | _fields_ = [ |
| 2248 | ("cmd_code", c_uint32, 10), |
| 2249 | ("must_be_zero0", c_uint32, 6), |
| 2250 | ("param", c_uint32, 16), |
| 2251 | ] |
| 2252 | def valid(self): return cmd_code==cmd0.NPU_SET_IFM_PAD_RIGHT and must_be_zero0==0; |
| 2253 | def get_cmd_code(self): return cmd_code |
| 2254 | def set_cmd_code(self, value): cmd_code = value |
| 2255 | def get_param(self): return param |
| 2256 | def set_param(self, value): param = value |
| 2257 | |
| 2258 | class npu_set_ifm_pad_bottom_t(Structure): |
| 2259 | _fields_ = [ |
| 2260 | ("cmd_code", c_uint32, 10), |
| 2261 | ("must_be_zero0", c_uint32, 6), |
| 2262 | ("param", c_uint32, 16), |
| 2263 | ] |
| 2264 | def valid(self): return cmd_code==cmd0.NPU_SET_IFM_PAD_BOTTOM and must_be_zero0==0; |
| 2265 | def get_cmd_code(self): return cmd_code |
| 2266 | def set_cmd_code(self, value): cmd_code = value |
| 2267 | def get_param(self): return param |
| 2268 | def set_param(self, value): param = value |
| 2269 | |
| 2270 | class npu_set_ifm_depth_m1_t(Structure): |
| 2271 | _fields_ = [ |
| 2272 | ("cmd_code", c_uint32, 10), |
| 2273 | ("must_be_zero0", c_uint32, 6), |
| 2274 | ("param", c_uint32, 16), |
| 2275 | ] |
| 2276 | def valid(self): return cmd_code==cmd0.NPU_SET_IFM_DEPTH_M1 and must_be_zero0==0; |
| 2277 | def get_cmd_code(self): return cmd_code |
| 2278 | def set_cmd_code(self, value): cmd_code = value |
| 2279 | def get_param(self): return param |
| 2280 | def set_param(self, value): param = value |
| 2281 | |
| 2282 | class npu_set_ifm_precision_t(Structure): |
| 2283 | _fields_ = [ |
| 2284 | ("cmd_code", c_uint32, 10), |
| 2285 | ("must_be_zero0", c_uint32, 6), |
Diqing Zhong | fed918b | 2020-04-27 10:27:34 +0200 | [diff] [blame] | 2286 | ("precision", c_uint32, 4), |
Tim Hall | 79d07d2 | 2020-04-27 18:20:16 +0100 | [diff] [blame] | 2287 | ("reserved0", c_uint32, 2), |
| 2288 | ("format", c_uint32, 2), |
| 2289 | ("scale_mode", c_uint32, 2), |
| 2290 | ("reserved1", c_uint32, 4), |
| 2291 | ("round_mode", c_uint32, 2), |
| 2292 | ] |
| 2293 | def valid(self): return cmd_code==cmd0.NPU_SET_IFM_PRECISION and must_be_zero0==0; |
| 2294 | def get_cmd_code(self): return cmd_code |
| 2295 | def set_cmd_code(self, value): cmd_code = value |
| 2296 | def get_format(self): return format |
| 2297 | def set_format(self, value): format = value |
Diqing Zhong | fed918b | 2020-04-27 10:27:34 +0200 | [diff] [blame] | 2298 | def get_precision(self): return precision |
| 2299 | def set_precision(self, value): precision = value |
Tim Hall | 79d07d2 | 2020-04-27 18:20:16 +0100 | [diff] [blame] | 2300 | def get_round_mode(self): return round_mode |
| 2301 | def set_round_mode(self, value): round_mode = value |
| 2302 | def get_scale_mode(self): return scale_mode |
| 2303 | def set_scale_mode(self, value): scale_mode = value |
| 2304 | |
| 2305 | class npu_set_ifm_upscale_t(Structure): |
| 2306 | _fields_ = [ |
| 2307 | ("cmd_code", c_uint32, 10), |
| 2308 | ("must_be_zero0", c_uint32, 6), |
| 2309 | ("mode", c_uint32, 2), |
| 2310 | ("reserved0", c_uint32, 14), |
| 2311 | ] |
| 2312 | def valid(self): return cmd_code==cmd0.NPU_SET_IFM_UPSCALE and must_be_zero0==0; |
| 2313 | def get_cmd_code(self): return cmd_code |
| 2314 | def set_cmd_code(self, value): cmd_code = value |
| 2315 | def get_mode(self): return mode |
| 2316 | def set_mode(self, value): mode = value |
| 2317 | |
| 2318 | class npu_set_ifm_zero_point_t(Structure): |
| 2319 | _fields_ = [ |
| 2320 | ("cmd_code", c_uint32, 10), |
| 2321 | ("must_be_zero0", c_uint32, 6), |
| 2322 | ("param", c_uint32, 16), |
| 2323 | ] |
| 2324 | def valid(self): return cmd_code==cmd0.NPU_SET_IFM_ZERO_POINT and must_be_zero0==0; |
| 2325 | def get_cmd_code(self): return cmd_code |
| 2326 | def set_cmd_code(self, value): cmd_code = value |
| 2327 | def get_param(self): return param |
| 2328 | def set_param(self, value): param = value |
| 2329 | |
| 2330 | class npu_set_ifm_width0_m1_t(Structure): |
| 2331 | _fields_ = [ |
| 2332 | ("cmd_code", c_uint32, 10), |
| 2333 | ("must_be_zero0", c_uint32, 6), |
| 2334 | ("param", c_uint32, 16), |
| 2335 | ] |
| 2336 | def valid(self): return cmd_code==cmd0.NPU_SET_IFM_WIDTH0_M1 and must_be_zero0==0; |
| 2337 | def get_cmd_code(self): return cmd_code |
| 2338 | def set_cmd_code(self, value): cmd_code = value |
| 2339 | def get_param(self): return param |
| 2340 | def set_param(self, value): param = value |
| 2341 | |
| 2342 | class npu_set_ifm_height0_m1_t(Structure): |
| 2343 | _fields_ = [ |
| 2344 | ("cmd_code", c_uint32, 10), |
| 2345 | ("must_be_zero0", c_uint32, 6), |
| 2346 | ("param", c_uint32, 16), |
| 2347 | ] |
| 2348 | def valid(self): return cmd_code==cmd0.NPU_SET_IFM_HEIGHT0_M1 and must_be_zero0==0; |
| 2349 | def get_cmd_code(self): return cmd_code |
| 2350 | def set_cmd_code(self, value): cmd_code = value |
| 2351 | def get_param(self): return param |
| 2352 | def set_param(self, value): param = value |
| 2353 | |
| 2354 | class npu_set_ifm_height1_m1_t(Structure): |
| 2355 | _fields_ = [ |
| 2356 | ("cmd_code", c_uint32, 10), |
| 2357 | ("must_be_zero0", c_uint32, 6), |
| 2358 | ("param", c_uint32, 16), |
| 2359 | ] |
| 2360 | def valid(self): return cmd_code==cmd0.NPU_SET_IFM_HEIGHT1_M1 and must_be_zero0==0; |
| 2361 | def get_cmd_code(self): return cmd_code |
| 2362 | def set_cmd_code(self, value): cmd_code = value |
| 2363 | def get_param(self): return param |
| 2364 | def set_param(self, value): param = value |
| 2365 | |
| 2366 | class npu_set_ifm_ib_end_t(Structure): |
| 2367 | _fields_ = [ |
| 2368 | ("cmd_code", c_uint32, 10), |
| 2369 | ("must_be_zero0", c_uint32, 6), |
| 2370 | ("param", c_uint32, 16), |
| 2371 | ] |
| 2372 | def valid(self): return cmd_code==cmd0.NPU_SET_IFM_IB_END and must_be_zero0==0; |
| 2373 | def get_cmd_code(self): return cmd_code |
| 2374 | def set_cmd_code(self, value): cmd_code = value |
| 2375 | def get_param(self): return param |
| 2376 | def set_param(self, value): param = value |
| 2377 | |
| 2378 | class npu_set_ifm_region_t(Structure): |
| 2379 | _fields_ = [ |
| 2380 | ("cmd_code", c_uint32, 10), |
| 2381 | ("must_be_zero0", c_uint32, 6), |
| 2382 | ("param", c_uint32, 16), |
| 2383 | ] |
| 2384 | def valid(self): return cmd_code==cmd0.NPU_SET_IFM_REGION and must_be_zero0==0; |
| 2385 | def get_cmd_code(self): return cmd_code |
| 2386 | def set_cmd_code(self, value): cmd_code = value |
| 2387 | def get_param(self): return param |
| 2388 | def set_param(self, value): param = value |
| 2389 | |
| 2390 | class npu_set_ofm_width_m1_t(Structure): |
| 2391 | _fields_ = [ |
| 2392 | ("cmd_code", c_uint32, 10), |
| 2393 | ("must_be_zero0", c_uint32, 6), |
| 2394 | ("param", c_uint32, 16), |
| 2395 | ] |
| 2396 | def valid(self): return cmd_code==cmd0.NPU_SET_OFM_WIDTH_M1 and must_be_zero0==0; |
| 2397 | def get_cmd_code(self): return cmd_code |
| 2398 | def set_cmd_code(self, value): cmd_code = value |
| 2399 | def get_param(self): return param |
| 2400 | def set_param(self, value): param = value |
| 2401 | |
| 2402 | class npu_set_ofm_height_m1_t(Structure): |
| 2403 | _fields_ = [ |
| 2404 | ("cmd_code", c_uint32, 10), |
| 2405 | ("must_be_zero0", c_uint32, 6), |
| 2406 | ("param", c_uint32, 16), |
| 2407 | ] |
| 2408 | def valid(self): return cmd_code==cmd0.NPU_SET_OFM_HEIGHT_M1 and must_be_zero0==0; |
| 2409 | def get_cmd_code(self): return cmd_code |
| 2410 | def set_cmd_code(self, value): cmd_code = value |
| 2411 | def get_param(self): return param |
| 2412 | def set_param(self, value): param = value |
| 2413 | |
| 2414 | class npu_set_ofm_depth_m1_t(Structure): |
| 2415 | _fields_ = [ |
| 2416 | ("cmd_code", c_uint32, 10), |
| 2417 | ("must_be_zero0", c_uint32, 6), |
| 2418 | ("param", c_uint32, 16), |
| 2419 | ] |
| 2420 | def valid(self): return cmd_code==cmd0.NPU_SET_OFM_DEPTH_M1 and must_be_zero0==0; |
| 2421 | def get_cmd_code(self): return cmd_code |
| 2422 | def set_cmd_code(self, value): cmd_code = value |
| 2423 | def get_param(self): return param |
| 2424 | def set_param(self, value): param = value |
| 2425 | |
| 2426 | class npu_set_ofm_precision_t(Structure): |
| 2427 | _fields_ = [ |
| 2428 | ("cmd_code", c_uint32, 10), |
| 2429 | ("must_be_zero0", c_uint32, 6), |
| 2430 | ("precision", c_uint32, 3), |
| 2431 | ("reserved0", c_uint32, 3), |
| 2432 | ("format", c_uint32, 2), |
| 2433 | ("scaling", c_uint32, 1), |
| 2434 | ("reserved1", c_uint32, 5), |
| 2435 | ("rounding", c_uint32, 2), |
| 2436 | ] |
| 2437 | def valid(self): return cmd_code==cmd0.NPU_SET_OFM_PRECISION and must_be_zero0==0; |
| 2438 | def get_cmd_code(self): return cmd_code |
| 2439 | def set_cmd_code(self, value): cmd_code = value |
| 2440 | def get_format(self): return format |
| 2441 | def set_format(self, value): format = value |
| 2442 | def get_precision(self): return precision |
| 2443 | def set_precision(self, value): precision = value |
| 2444 | def get_rounding(self): return rounding |
| 2445 | def set_rounding(self, value): rounding = value |
| 2446 | def get_scaling(self): return scaling |
| 2447 | def set_scaling(self, value): scaling = value |
| 2448 | |
| 2449 | class npu_set_ofm_blk_width_m1_t(Structure): |
| 2450 | _fields_ = [ |
| 2451 | ("cmd_code", c_uint32, 10), |
| 2452 | ("must_be_zero0", c_uint32, 6), |
| 2453 | ("param", c_uint32, 16), |
| 2454 | ] |
| 2455 | def valid(self): return cmd_code==cmd0.NPU_SET_OFM_BLK_WIDTH_M1 and must_be_zero0==0; |
| 2456 | def get_cmd_code(self): return cmd_code |
| 2457 | def set_cmd_code(self, value): cmd_code = value |
| 2458 | def get_param(self): return param |
| 2459 | def set_param(self, value): param = value |
| 2460 | |
| 2461 | class npu_set_ofm_blk_height_m1_t(Structure): |
| 2462 | _fields_ = [ |
| 2463 | ("cmd_code", c_uint32, 10), |
| 2464 | ("must_be_zero0", c_uint32, 6), |
| 2465 | ("param", c_uint32, 16), |
| 2466 | ] |
| 2467 | def valid(self): return cmd_code==cmd0.NPU_SET_OFM_BLK_HEIGHT_M1 and must_be_zero0==0; |
| 2468 | def get_cmd_code(self): return cmd_code |
| 2469 | def set_cmd_code(self, value): cmd_code = value |
| 2470 | def get_param(self): return param |
| 2471 | def set_param(self, value): param = value |
| 2472 | |
| 2473 | class npu_set_ofm_blk_depth_m1_t(Structure): |
| 2474 | _fields_ = [ |
| 2475 | ("cmd_code", c_uint32, 10), |
| 2476 | ("must_be_zero0", c_uint32, 6), |
| 2477 | ("param", c_uint32, 16), |
| 2478 | ] |
| 2479 | def valid(self): return cmd_code==cmd0.NPU_SET_OFM_BLK_DEPTH_M1 and must_be_zero0==0; |
| 2480 | def get_cmd_code(self): return cmd_code |
| 2481 | def set_cmd_code(self, value): cmd_code = value |
| 2482 | def get_param(self): return param |
| 2483 | def set_param(self, value): param = value |
| 2484 | |
| 2485 | class npu_set_ofm_zero_point_t(Structure): |
| 2486 | _fields_ = [ |
| 2487 | ("cmd_code", c_uint32, 10), |
| 2488 | ("must_be_zero0", c_uint32, 6), |
| 2489 | ("param", c_uint32, 16), |
| 2490 | ] |
| 2491 | def valid(self): return cmd_code==cmd0.NPU_SET_OFM_ZERO_POINT and must_be_zero0==0; |
| 2492 | def get_cmd_code(self): return cmd_code |
| 2493 | def set_cmd_code(self, value): cmd_code = value |
| 2494 | def get_param(self): return param |
| 2495 | def set_param(self, value): param = value |
| 2496 | |
| 2497 | class npu_set_ofm_width0_m1_t(Structure): |
| 2498 | _fields_ = [ |
| 2499 | ("cmd_code", c_uint32, 10), |
| 2500 | ("must_be_zero0", c_uint32, 6), |
| 2501 | ("param", c_uint32, 16), |
| 2502 | ] |
| 2503 | def valid(self): return cmd_code==cmd0.NPU_SET_OFM_WIDTH0_M1 and must_be_zero0==0; |
| 2504 | def get_cmd_code(self): return cmd_code |
| 2505 | def set_cmd_code(self, value): cmd_code = value |
| 2506 | def get_param(self): return param |
| 2507 | def set_param(self, value): param = value |
| 2508 | |
| 2509 | class npu_set_ofm_height0_m1_t(Structure): |
| 2510 | _fields_ = [ |
| 2511 | ("cmd_code", c_uint32, 10), |
| 2512 | ("must_be_zero0", c_uint32, 6), |
| 2513 | ("param", c_uint32, 16), |
| 2514 | ] |
| 2515 | def valid(self): return cmd_code==cmd0.NPU_SET_OFM_HEIGHT0_M1 and must_be_zero0==0; |
| 2516 | def get_cmd_code(self): return cmd_code |
| 2517 | def set_cmd_code(self, value): cmd_code = value |
| 2518 | def get_param(self): return param |
| 2519 | def set_param(self, value): param = value |
| 2520 | |
| 2521 | class npu_set_ofm_height1_m1_t(Structure): |
| 2522 | _fields_ = [ |
| 2523 | ("cmd_code", c_uint32, 10), |
| 2524 | ("must_be_zero0", c_uint32, 6), |
| 2525 | ("param", c_uint32, 16), |
| 2526 | ] |
| 2527 | def valid(self): return cmd_code==cmd0.NPU_SET_OFM_HEIGHT1_M1 and must_be_zero0==0; |
| 2528 | def get_cmd_code(self): return cmd_code |
| 2529 | def set_cmd_code(self, value): cmd_code = value |
| 2530 | def get_param(self): return param |
| 2531 | def set_param(self, value): param = value |
| 2532 | |
| 2533 | class npu_set_ofm_region_t(Structure): |
| 2534 | _fields_ = [ |
| 2535 | ("cmd_code", c_uint32, 10), |
| 2536 | ("must_be_zero0", c_uint32, 6), |
| 2537 | ("param", c_uint32, 16), |
| 2538 | ] |
| 2539 | def valid(self): return cmd_code==cmd0.NPU_SET_OFM_REGION and must_be_zero0==0; |
| 2540 | def get_cmd_code(self): return cmd_code |
| 2541 | def set_cmd_code(self, value): cmd_code = value |
| 2542 | def get_param(self): return param |
| 2543 | def set_param(self, value): param = value |
| 2544 | |
| 2545 | class npu_set_kernel_width_m1_t(Structure): |
| 2546 | _fields_ = [ |
| 2547 | ("cmd_code", c_uint32, 10), |
| 2548 | ("must_be_zero0", c_uint32, 6), |
| 2549 | ("param", c_uint32, 16), |
| 2550 | ] |
| 2551 | def valid(self): return cmd_code==cmd0.NPU_SET_KERNEL_WIDTH_M1 and must_be_zero0==0; |
| 2552 | def get_cmd_code(self): return cmd_code |
| 2553 | def set_cmd_code(self, value): cmd_code = value |
| 2554 | def get_param(self): return param |
| 2555 | def set_param(self, value): param = value |
| 2556 | |
| 2557 | class npu_set_kernel_height_m1_t(Structure): |
| 2558 | _fields_ = [ |
| 2559 | ("cmd_code", c_uint32, 10), |
| 2560 | ("must_be_zero0", c_uint32, 6), |
| 2561 | ("param", c_uint32, 16), |
| 2562 | ] |
| 2563 | def valid(self): return cmd_code==cmd0.NPU_SET_KERNEL_HEIGHT_M1 and must_be_zero0==0; |
| 2564 | def get_cmd_code(self): return cmd_code |
| 2565 | def set_cmd_code(self, value): cmd_code = value |
| 2566 | def get_param(self): return param |
| 2567 | def set_param(self, value): param = value |
| 2568 | |
| 2569 | class npu_set_kernel_stride_t(Structure): |
| 2570 | _fields_ = [ |
| 2571 | ("cmd_code", c_uint32, 10), |
| 2572 | ("must_be_zero0", c_uint32, 6), |
| 2573 | ("param", c_uint32, 16), |
| 2574 | ] |
| 2575 | def valid(self): return cmd_code==cmd0.NPU_SET_KERNEL_STRIDE and must_be_zero0==0; |
| 2576 | def get_cmd_code(self): return cmd_code |
| 2577 | def set_cmd_code(self, value): cmd_code = value |
| 2578 | def get_param(self): return param |
| 2579 | def set_param(self, value): param = value |
| 2580 | |
| 2581 | class npu_set_parallel_mode_t(Structure): |
| 2582 | _fields_ = [ |
| 2583 | ("cmd_code", c_uint32, 10), |
| 2584 | ("must_be_zero0", c_uint32, 6), |
| 2585 | ("param", c_uint32, 16), |
| 2586 | ] |
| 2587 | def valid(self): return cmd_code==cmd0.NPU_SET_PARALLEL_MODE and must_be_zero0==0; |
| 2588 | def get_cmd_code(self): return cmd_code |
| 2589 | def set_cmd_code(self, value): cmd_code = value |
| 2590 | def get_param(self): return param |
| 2591 | def set_param(self, value): param = value |
| 2592 | |
| 2593 | class npu_set_acc_format_t(Structure): |
| 2594 | _fields_ = [ |
| 2595 | ("cmd_code", c_uint32, 10), |
| 2596 | ("must_be_zero0", c_uint32, 6), |
| 2597 | ("param", c_uint32, 16), |
| 2598 | ] |
| 2599 | def valid(self): return cmd_code==cmd0.NPU_SET_ACC_FORMAT and must_be_zero0==0; |
| 2600 | def get_cmd_code(self): return cmd_code |
| 2601 | def set_cmd_code(self, value): cmd_code = value |
| 2602 | def get_param(self): return param |
| 2603 | def set_param(self, value): param = value |
| 2604 | |
| 2605 | class npu_set_activation_t(Structure): |
| 2606 | _fields_ = [ |
| 2607 | ("cmd_code", c_uint32, 10), |
| 2608 | ("must_be_zero0", c_uint32, 6), |
| 2609 | ("type", c_uint32, 12), |
| 2610 | ("act_clip_range", c_uint32, 4), |
| 2611 | ] |
| 2612 | def valid(self): return cmd_code==cmd0.NPU_SET_ACTIVATION and must_be_zero0==0; |
| 2613 | def get_act_clip_range(self): return act_clip_range |
| 2614 | def set_act_clip_range(self, value): act_clip_range = value |
| 2615 | def get_cmd_code(self): return cmd_code |
| 2616 | def set_cmd_code(self, value): cmd_code = value |
| 2617 | def get_type(self): return type |
| 2618 | def set_type(self, value): type = value |
| 2619 | |
| 2620 | class npu_set_activation_min_t(Structure): |
| 2621 | _fields_ = [ |
| 2622 | ("cmd_code", c_uint32, 10), |
| 2623 | ("must_be_zero0", c_uint32, 6), |
| 2624 | ("param", c_uint32, 16), |
| 2625 | ] |
| 2626 | def valid(self): return cmd_code==cmd0.NPU_SET_ACTIVATION_MIN and must_be_zero0==0; |
| 2627 | def get_cmd_code(self): return cmd_code |
| 2628 | def set_cmd_code(self, value): cmd_code = value |
| 2629 | def get_param(self): return param |
| 2630 | def set_param(self, value): param = value |
| 2631 | |
| 2632 | class npu_set_activation_max_t(Structure): |
| 2633 | _fields_ = [ |
| 2634 | ("cmd_code", c_uint32, 10), |
| 2635 | ("must_be_zero0", c_uint32, 6), |
| 2636 | ("param", c_uint32, 16), |
| 2637 | ] |
| 2638 | def valid(self): return cmd_code==cmd0.NPU_SET_ACTIVATION_MAX and must_be_zero0==0; |
| 2639 | def get_cmd_code(self): return cmd_code |
| 2640 | def set_cmd_code(self, value): cmd_code = value |
| 2641 | def get_param(self): return param |
| 2642 | def set_param(self, value): param = value |
| 2643 | |
| 2644 | class npu_set_weight_region_t(Structure): |
| 2645 | _fields_ = [ |
| 2646 | ("cmd_code", c_uint32, 10), |
| 2647 | ("must_be_zero0", c_uint32, 6), |
| 2648 | ("param", c_uint32, 16), |
| 2649 | ] |
| 2650 | def valid(self): return cmd_code==cmd0.NPU_SET_WEIGHT_REGION and must_be_zero0==0; |
| 2651 | def get_cmd_code(self): return cmd_code |
| 2652 | def set_cmd_code(self, value): cmd_code = value |
| 2653 | def get_param(self): return param |
| 2654 | def set_param(self, value): param = value |
| 2655 | |
| 2656 | class npu_set_scale_region_t(Structure): |
| 2657 | _fields_ = [ |
| 2658 | ("cmd_code", c_uint32, 10), |
| 2659 | ("must_be_zero0", c_uint32, 6), |
| 2660 | ("param", c_uint32, 16), |
| 2661 | ] |
| 2662 | def valid(self): return cmd_code==cmd0.NPU_SET_SCALE_REGION and must_be_zero0==0; |
| 2663 | def get_cmd_code(self): return cmd_code |
| 2664 | def set_cmd_code(self, value): cmd_code = value |
| 2665 | def get_param(self): return param |
| 2666 | def set_param(self, value): param = value |
| 2667 | |
| 2668 | class npu_set_ab_start_t(Structure): |
| 2669 | _fields_ = [ |
| 2670 | ("cmd_code", c_uint32, 10), |
| 2671 | ("must_be_zero0", c_uint32, 6), |
| 2672 | ("param", c_uint32, 16), |
| 2673 | ] |
| 2674 | def valid(self): return cmd_code==cmd0.NPU_SET_AB_START and must_be_zero0==0; |
| 2675 | def get_cmd_code(self): return cmd_code |
| 2676 | def set_cmd_code(self, value): cmd_code = value |
| 2677 | def get_param(self): return param |
| 2678 | def set_param(self, value): param = value |
| 2679 | |
| 2680 | class npu_set_blockdep_t(Structure): |
| 2681 | _fields_ = [ |
| 2682 | ("cmd_code", c_uint32, 10), |
| 2683 | ("must_be_zero0", c_uint32, 6), |
| 2684 | ("param", c_uint32, 16), |
| 2685 | ] |
| 2686 | def valid(self): return cmd_code==cmd0.NPU_SET_BLOCKDEP and must_be_zero0==0; |
| 2687 | def get_cmd_code(self): return cmd_code |
| 2688 | def set_cmd_code(self, value): cmd_code = value |
| 2689 | def get_param(self): return param |
| 2690 | def set_param(self, value): param = value |
| 2691 | |
| 2692 | class npu_set_dma0_src_region_t(Structure): |
| 2693 | _fields_ = [ |
| 2694 | ("cmd_code", c_uint32, 10), |
| 2695 | ("must_be_zero0", c_uint32, 6), |
| 2696 | ("region", c_uint32, 8), |
| 2697 | ("internal", c_uint32, 1), |
| 2698 | ("stride_mode", c_uint32, 2), |
| 2699 | ("reserved0", c_uint32, 5), |
| 2700 | ] |
| 2701 | def valid(self): return cmd_code==cmd0.NPU_SET_DMA0_SRC_REGION and must_be_zero0==0; |
| 2702 | def get_cmd_code(self): return cmd_code |
| 2703 | def set_cmd_code(self, value): cmd_code = value |
| 2704 | def get_internal(self): return internal |
| 2705 | def set_internal(self, value): internal = value |
| 2706 | def get_region(self): return region |
| 2707 | def set_region(self, value): region = value |
| 2708 | def get_stride_mode(self): return stride_mode |
| 2709 | def set_stride_mode(self, value): stride_mode = value |
| 2710 | |
| 2711 | class npu_set_dma0_dst_region_t(Structure): |
| 2712 | _fields_ = [ |
| 2713 | ("cmd_code", c_uint32, 10), |
| 2714 | ("must_be_zero0", c_uint32, 6), |
| 2715 | ("region", c_uint32, 8), |
| 2716 | ("internal", c_uint32, 1), |
| 2717 | ("stride_mode", c_uint32, 2), |
| 2718 | ("reserved0", c_uint32, 5), |
| 2719 | ] |
| 2720 | def valid(self): return cmd_code==cmd0.NPU_SET_DMA0_DST_REGION and must_be_zero0==0; |
| 2721 | def get_cmd_code(self): return cmd_code |
| 2722 | def set_cmd_code(self, value): cmd_code = value |
| 2723 | def get_internal(self): return internal |
| 2724 | def set_internal(self, value): internal = value |
| 2725 | def get_region(self): return region |
| 2726 | def set_region(self, value): region = value |
| 2727 | def get_stride_mode(self): return stride_mode |
| 2728 | def set_stride_mode(self, value): stride_mode = value |
| 2729 | |
| 2730 | class npu_set_dma0_size0_t(Structure): |
| 2731 | _fields_ = [ |
| 2732 | ("cmd_code", c_uint32, 10), |
| 2733 | ("must_be_zero0", c_uint32, 6), |
| 2734 | ("param", c_uint32, 16), |
| 2735 | ] |
| 2736 | def valid(self): return cmd_code==cmd0.NPU_SET_DMA0_SIZE0 and must_be_zero0==0; |
| 2737 | def get_cmd_code(self): return cmd_code |
| 2738 | def set_cmd_code(self, value): cmd_code = value |
| 2739 | def get_param(self): return param |
| 2740 | def set_param(self, value): param = value |
| 2741 | |
| 2742 | class npu_set_dma0_size1_t(Structure): |
| 2743 | _fields_ = [ |
| 2744 | ("cmd_code", c_uint32, 10), |
| 2745 | ("must_be_zero0", c_uint32, 6), |
| 2746 | ("param", c_uint32, 16), |
| 2747 | ] |
| 2748 | def valid(self): return cmd_code==cmd0.NPU_SET_DMA0_SIZE1 and must_be_zero0==0; |
| 2749 | def get_cmd_code(self): return cmd_code |
| 2750 | def set_cmd_code(self, value): cmd_code = value |
| 2751 | def get_param(self): return param |
| 2752 | def set_param(self, value): param = value |
| 2753 | |
| 2754 | class npu_set_ifm2_broadcast_t(Structure): |
| 2755 | _fields_ = [ |
| 2756 | ("cmd_code", c_uint32, 10), |
| 2757 | ("must_be_zero0", c_uint32, 6), |
| 2758 | ("broadcast_height", c_uint32, 1), |
| 2759 | ("broadcast_width", c_uint32, 1), |
| 2760 | ("broadcast_depth", c_uint32, 1), |
| 2761 | ("reserved0", c_uint32, 3), |
| 2762 | ("operand_order", c_uint32, 1), |
| 2763 | ("broadcast_scalar", c_uint32, 1), |
| 2764 | ("reserved1", c_uint32, 8), |
| 2765 | ] |
| 2766 | def valid(self): return cmd_code==cmd0.NPU_SET_IFM2_BROADCAST and must_be_zero0==0; |
| 2767 | def get_broadcast_depth(self): return broadcast_depth |
| 2768 | def set_broadcast_depth(self, value): broadcast_depth = value |
| 2769 | def get_broadcast_height(self): return broadcast_height |
| 2770 | def set_broadcast_height(self, value): broadcast_height = value |
| 2771 | def get_broadcast_scalar(self): return broadcast_scalar |
| 2772 | def set_broadcast_scalar(self, value): broadcast_scalar = value |
| 2773 | def get_broadcast_width(self): return broadcast_width |
| 2774 | def set_broadcast_width(self, value): broadcast_width = value |
| 2775 | def get_cmd_code(self): return cmd_code |
| 2776 | def set_cmd_code(self, value): cmd_code = value |
| 2777 | def get_operand_order(self): return operand_order |
| 2778 | def set_operand_order(self, value): operand_order = value |
| 2779 | |
| 2780 | class npu_set_ifm2_scalar_t(Structure): |
| 2781 | _fields_ = [ |
| 2782 | ("cmd_code", c_uint32, 10), |
| 2783 | ("must_be_zero0", c_uint32, 6), |
| 2784 | ("param", c_uint32, 16), |
| 2785 | ] |
| 2786 | def valid(self): return cmd_code==cmd0.NPU_SET_IFM2_SCALAR and must_be_zero0==0; |
| 2787 | def get_cmd_code(self): return cmd_code |
| 2788 | def set_cmd_code(self, value): cmd_code = value |
| 2789 | def get_param(self): return param |
| 2790 | def set_param(self, value): param = value |
| 2791 | |
| 2792 | class npu_set_ifm2_precision_t(Structure): |
| 2793 | _fields_ = [ |
| 2794 | ("cmd_code", c_uint32, 10), |
| 2795 | ("must_be_zero0", c_uint32, 6), |
Diqing Zhong | fed918b | 2020-04-27 10:27:34 +0200 | [diff] [blame] | 2796 | ("precision", c_uint32, 4), |
Tim Hall | 79d07d2 | 2020-04-27 18:20:16 +0100 | [diff] [blame] | 2797 | ("reserved0", c_uint32, 2), |
| 2798 | ("format", c_uint32, 2), |
| 2799 | ("reserved1", c_uint32, 8), |
| 2800 | ] |
| 2801 | def valid(self): return cmd_code==cmd0.NPU_SET_IFM2_PRECISION and must_be_zero0==0; |
| 2802 | def get_cmd_code(self): return cmd_code |
| 2803 | def set_cmd_code(self, value): cmd_code = value |
| 2804 | def get_format(self): return format |
| 2805 | def set_format(self, value): format = value |
Diqing Zhong | fed918b | 2020-04-27 10:27:34 +0200 | [diff] [blame] | 2806 | def get_precision(self): return precision |
| 2807 | def set_precision(self, value): precision = value |
Tim Hall | 79d07d2 | 2020-04-27 18:20:16 +0100 | [diff] [blame] | 2808 | |
| 2809 | class npu_set_ifm2_zero_point_t(Structure): |
| 2810 | _fields_ = [ |
| 2811 | ("cmd_code", c_uint32, 10), |
| 2812 | ("must_be_zero0", c_uint32, 6), |
| 2813 | ("param", c_uint32, 16), |
| 2814 | ] |
| 2815 | def valid(self): return cmd_code==cmd0.NPU_SET_IFM2_ZERO_POINT and must_be_zero0==0; |
| 2816 | def get_cmd_code(self): return cmd_code |
| 2817 | def set_cmd_code(self, value): cmd_code = value |
| 2818 | def get_param(self): return param |
| 2819 | def set_param(self, value): param = value |
| 2820 | |
| 2821 | class npu_set_ifm2_width0_m1_t(Structure): |
| 2822 | _fields_ = [ |
| 2823 | ("cmd_code", c_uint32, 10), |
| 2824 | ("must_be_zero0", c_uint32, 6), |
| 2825 | ("param", c_uint32, 16), |
| 2826 | ] |
| 2827 | def valid(self): return cmd_code==cmd0.NPU_SET_IFM2_WIDTH0_M1 and must_be_zero0==0; |
| 2828 | def get_cmd_code(self): return cmd_code |
| 2829 | def set_cmd_code(self, value): cmd_code = value |
| 2830 | def get_param(self): return param |
| 2831 | def set_param(self, value): param = value |
| 2832 | |
| 2833 | class npu_set_ifm2_height0_m1_t(Structure): |
| 2834 | _fields_ = [ |
| 2835 | ("cmd_code", c_uint32, 10), |
| 2836 | ("must_be_zero0", c_uint32, 6), |
| 2837 | ("param", c_uint32, 16), |
| 2838 | ] |
| 2839 | def valid(self): return cmd_code==cmd0.NPU_SET_IFM2_HEIGHT0_M1 and must_be_zero0==0; |
| 2840 | def get_cmd_code(self): return cmd_code |
| 2841 | def set_cmd_code(self, value): cmd_code = value |
| 2842 | def get_param(self): return param |
| 2843 | def set_param(self, value): param = value |
| 2844 | |
| 2845 | class npu_set_ifm2_height1_m1_t(Structure): |
| 2846 | _fields_ = [ |
| 2847 | ("cmd_code", c_uint32, 10), |
| 2848 | ("must_be_zero0", c_uint32, 6), |
| 2849 | ("param", c_uint32, 16), |
| 2850 | ] |
| 2851 | def valid(self): return cmd_code==cmd0.NPU_SET_IFM2_HEIGHT1_M1 and must_be_zero0==0; |
| 2852 | def get_cmd_code(self): return cmd_code |
| 2853 | def set_cmd_code(self, value): cmd_code = value |
| 2854 | def get_param(self): return param |
| 2855 | def set_param(self, value): param = value |
| 2856 | |
| 2857 | class npu_set_ifm2_ib_start_t(Structure): |
| 2858 | _fields_ = [ |
| 2859 | ("cmd_code", c_uint32, 10), |
| 2860 | ("must_be_zero0", c_uint32, 6), |
| 2861 | ("param", c_uint32, 16), |
| 2862 | ] |
| 2863 | def valid(self): return cmd_code==cmd0.NPU_SET_IFM2_IB_START and must_be_zero0==0; |
| 2864 | def get_cmd_code(self): return cmd_code |
| 2865 | def set_cmd_code(self, value): cmd_code = value |
| 2866 | def get_param(self): return param |
| 2867 | def set_param(self, value): param = value |
| 2868 | |
| 2869 | class npu_set_ifm2_region_t(Structure): |
| 2870 | _fields_ = [ |
| 2871 | ("cmd_code", c_uint32, 10), |
| 2872 | ("must_be_zero0", c_uint32, 6), |
| 2873 | ("param", c_uint32, 16), |
| 2874 | ] |
| 2875 | def valid(self): return cmd_code==cmd0.NPU_SET_IFM2_REGION and must_be_zero0==0; |
| 2876 | def get_cmd_code(self): return cmd_code |
| 2877 | def set_cmd_code(self, value): cmd_code = value |
| 2878 | def get_param(self): return param |
| 2879 | def set_param(self, value): param = value |
| 2880 | |
| 2881 | class npu_set_ifm_base0_t(Structure): |
| 2882 | _fields_ = [ |
| 2883 | ("cmd_code", c_uint32, 10), |
| 2884 | ("must_be_zero", c_uint32, 4), |
| 2885 | ("payload_size", c_uint32, 2), |
| 2886 | ("reserved0", c_uint32, 16), |
| 2887 | ("data", c_uint32, 32), |
| 2888 | ] |
| 2889 | def valid(self): return cmd_code==cmd1.NPU_SET_IFM_BASE0 and must_be_zero==0 and payload_size>=1 and payload_size<=2; |
| 2890 | def get_cmd_code(self): return cmd_code |
| 2891 | def set_cmd_code(self, value): cmd_code = value |
| 2892 | def get_data(self): return data |
| 2893 | def set_data(self, value): data = value |
| 2894 | def get_payload_size(self): return payload_size |
| 2895 | def set_payload_size(self, value): payload_size = value |
| 2896 | |
| 2897 | class npu_set_ifm_base1_t(Structure): |
| 2898 | _fields_ = [ |
| 2899 | ("cmd_code", c_uint32, 10), |
| 2900 | ("must_be_zero", c_uint32, 4), |
| 2901 | ("payload_size", c_uint32, 2), |
| 2902 | ("reserved0", c_uint32, 16), |
| 2903 | ("data", c_uint32, 32), |
| 2904 | ] |
| 2905 | def valid(self): return cmd_code==cmd1.NPU_SET_IFM_BASE1 and must_be_zero==0 and payload_size>=1 and payload_size<=2; |
| 2906 | def get_cmd_code(self): return cmd_code |
| 2907 | def set_cmd_code(self, value): cmd_code = value |
| 2908 | def get_data(self): return data |
| 2909 | def set_data(self, value): data = value |
| 2910 | def get_payload_size(self): return payload_size |
| 2911 | def set_payload_size(self, value): payload_size = value |
| 2912 | |
| 2913 | class npu_set_ifm_base2_t(Structure): |
| 2914 | _fields_ = [ |
| 2915 | ("cmd_code", c_uint32, 10), |
| 2916 | ("must_be_zero", c_uint32, 4), |
| 2917 | ("payload_size", c_uint32, 2), |
| 2918 | ("reserved0", c_uint32, 16), |
| 2919 | ("data", c_uint32, 32), |
| 2920 | ] |
| 2921 | def valid(self): return cmd_code==cmd1.NPU_SET_IFM_BASE2 and must_be_zero==0 and payload_size>=1 and payload_size<=2; |
| 2922 | def get_cmd_code(self): return cmd_code |
| 2923 | def set_cmd_code(self, value): cmd_code = value |
| 2924 | def get_data(self): return data |
| 2925 | def set_data(self, value): data = value |
| 2926 | def get_payload_size(self): return payload_size |
| 2927 | def set_payload_size(self, value): payload_size = value |
| 2928 | |
| 2929 | class npu_set_ifm_base3_t(Structure): |
| 2930 | _fields_ = [ |
| 2931 | ("cmd_code", c_uint32, 10), |
| 2932 | ("must_be_zero", c_uint32, 4), |
| 2933 | ("payload_size", c_uint32, 2), |
| 2934 | ("reserved0", c_uint32, 16), |
| 2935 | ("data", c_uint32, 32), |
| 2936 | ] |
| 2937 | def valid(self): return cmd_code==cmd1.NPU_SET_IFM_BASE3 and must_be_zero==0 and payload_size>=1 and payload_size<=2; |
| 2938 | def get_cmd_code(self): return cmd_code |
| 2939 | def set_cmd_code(self, value): cmd_code = value |
| 2940 | def get_data(self): return data |
| 2941 | def set_data(self, value): data = value |
| 2942 | def get_payload_size(self): return payload_size |
| 2943 | def set_payload_size(self, value): payload_size = value |
| 2944 | |
| 2945 | class npu_set_ifm_stride_x_t(Structure): |
| 2946 | _fields_ = [ |
| 2947 | ("cmd_code", c_uint32, 10), |
| 2948 | ("must_be_zero", c_uint32, 4), |
| 2949 | ("payload_size", c_uint32, 2), |
| 2950 | ("reserved0", c_uint32, 16), |
| 2951 | ("data", c_uint32, 32), |
| 2952 | ] |
| 2953 | def valid(self): return cmd_code==cmd1.NPU_SET_IFM_STRIDE_X and must_be_zero==0 and payload_size>=1 and payload_size<=2; |
| 2954 | def get_cmd_code(self): return cmd_code |
| 2955 | def set_cmd_code(self, value): cmd_code = value |
| 2956 | def get_data(self): return data |
| 2957 | def set_data(self, value): data = value |
| 2958 | def get_payload_size(self): return payload_size |
| 2959 | def set_payload_size(self, value): payload_size = value |
| 2960 | |
| 2961 | class npu_set_ifm_stride_y_t(Structure): |
| 2962 | _fields_ = [ |
| 2963 | ("cmd_code", c_uint32, 10), |
| 2964 | ("must_be_zero", c_uint32, 4), |
| 2965 | ("payload_size", c_uint32, 2), |
| 2966 | ("reserved0", c_uint32, 16), |
| 2967 | ("data", c_uint32, 32), |
| 2968 | ] |
| 2969 | def valid(self): return cmd_code==cmd1.NPU_SET_IFM_STRIDE_Y and must_be_zero==0 and payload_size>=1 and payload_size<=2; |
| 2970 | def get_cmd_code(self): return cmd_code |
| 2971 | def set_cmd_code(self, value): cmd_code = value |
| 2972 | def get_data(self): return data |
| 2973 | def set_data(self, value): data = value |
| 2974 | def get_payload_size(self): return payload_size |
| 2975 | def set_payload_size(self, value): payload_size = value |
| 2976 | |
| 2977 | class npu_set_ifm_stride_c_t(Structure): |
| 2978 | _fields_ = [ |
| 2979 | ("cmd_code", c_uint32, 10), |
| 2980 | ("must_be_zero", c_uint32, 4), |
| 2981 | ("payload_size", c_uint32, 2), |
| 2982 | ("reserved0", c_uint32, 16), |
| 2983 | ("data", c_uint32, 32), |
| 2984 | ] |
| 2985 | def valid(self): return cmd_code==cmd1.NPU_SET_IFM_STRIDE_C and must_be_zero==0 and payload_size>=1 and payload_size<=2; |
| 2986 | def get_cmd_code(self): return cmd_code |
| 2987 | def set_cmd_code(self, value): cmd_code = value |
| 2988 | def get_data(self): return data |
| 2989 | def set_data(self, value): data = value |
| 2990 | def get_payload_size(self): return payload_size |
| 2991 | def set_payload_size(self, value): payload_size = value |
| 2992 | |
| 2993 | class npu_set_ofm_base0_t(Structure): |
| 2994 | _fields_ = [ |
| 2995 | ("cmd_code", c_uint32, 10), |
| 2996 | ("must_be_zero", c_uint32, 4), |
| 2997 | ("payload_size", c_uint32, 2), |
| 2998 | ("reserved0", c_uint32, 16), |
| 2999 | ("data", c_uint32, 32), |
| 3000 | ] |
| 3001 | def valid(self): return cmd_code==cmd1.NPU_SET_OFM_BASE0 and must_be_zero==0 and payload_size>=1 and payload_size<=2; |
| 3002 | def get_cmd_code(self): return cmd_code |
| 3003 | def set_cmd_code(self, value): cmd_code = value |
| 3004 | def get_data(self): return data |
| 3005 | def set_data(self, value): data = value |
| 3006 | def get_payload_size(self): return payload_size |
| 3007 | def set_payload_size(self, value): payload_size = value |
| 3008 | |
| 3009 | class npu_set_ofm_base1_t(Structure): |
| 3010 | _fields_ = [ |
| 3011 | ("cmd_code", c_uint32, 10), |
| 3012 | ("must_be_zero", c_uint32, 4), |
| 3013 | ("payload_size", c_uint32, 2), |
| 3014 | ("reserved0", c_uint32, 16), |
| 3015 | ("data", c_uint32, 32), |
| 3016 | ] |
| 3017 | def valid(self): return cmd_code==cmd1.NPU_SET_OFM_BASE1 and must_be_zero==0 and payload_size>=1 and payload_size<=2; |
| 3018 | def get_cmd_code(self): return cmd_code |
| 3019 | def set_cmd_code(self, value): cmd_code = value |
| 3020 | def get_data(self): return data |
| 3021 | def set_data(self, value): data = value |
| 3022 | def get_payload_size(self): return payload_size |
| 3023 | def set_payload_size(self, value): payload_size = value |
| 3024 | |
| 3025 | class npu_set_ofm_base2_t(Structure): |
| 3026 | _fields_ = [ |
| 3027 | ("cmd_code", c_uint32, 10), |
| 3028 | ("must_be_zero", c_uint32, 4), |
| 3029 | ("payload_size", c_uint32, 2), |
| 3030 | ("reserved0", c_uint32, 16), |
| 3031 | ("data", c_uint32, 32), |
| 3032 | ] |
| 3033 | def valid(self): return cmd_code==cmd1.NPU_SET_OFM_BASE2 and must_be_zero==0 and payload_size>=1 and payload_size<=2; |
| 3034 | def get_cmd_code(self): return cmd_code |
| 3035 | def set_cmd_code(self, value): cmd_code = value |
| 3036 | def get_data(self): return data |
| 3037 | def set_data(self, value): data = value |
| 3038 | def get_payload_size(self): return payload_size |
| 3039 | def set_payload_size(self, value): payload_size = value |
| 3040 | |
| 3041 | class npu_set_ofm_base3_t(Structure): |
| 3042 | _fields_ = [ |
| 3043 | ("cmd_code", c_uint32, 10), |
| 3044 | ("must_be_zero", c_uint32, 4), |
| 3045 | ("payload_size", c_uint32, 2), |
| 3046 | ("reserved0", c_uint32, 16), |
| 3047 | ("data", c_uint32, 32), |
| 3048 | ] |
| 3049 | def valid(self): return cmd_code==cmd1.NPU_SET_OFM_BASE3 and must_be_zero==0 and payload_size>=1 and payload_size<=2; |
| 3050 | def get_cmd_code(self): return cmd_code |
| 3051 | def set_cmd_code(self, value): cmd_code = value |
| 3052 | def get_data(self): return data |
| 3053 | def set_data(self, value): data = value |
| 3054 | def get_payload_size(self): return payload_size |
| 3055 | def set_payload_size(self, value): payload_size = value |
| 3056 | |
| 3057 | class npu_set_ofm_stride_x_t(Structure): |
| 3058 | _fields_ = [ |
| 3059 | ("cmd_code", c_uint32, 10), |
| 3060 | ("must_be_zero", c_uint32, 4), |
| 3061 | ("payload_size", c_uint32, 2), |
| 3062 | ("reserved0", c_uint32, 16), |
| 3063 | ("data", c_uint32, 32), |
| 3064 | ] |
| 3065 | def valid(self): return cmd_code==cmd1.NPU_SET_OFM_STRIDE_X and must_be_zero==0 and payload_size>=1 and payload_size<=2; |
| 3066 | def get_cmd_code(self): return cmd_code |
| 3067 | def set_cmd_code(self, value): cmd_code = value |
| 3068 | def get_data(self): return data |
| 3069 | def set_data(self, value): data = value |
| 3070 | def get_payload_size(self): return payload_size |
| 3071 | def set_payload_size(self, value): payload_size = value |
| 3072 | |
| 3073 | class npu_set_ofm_stride_y_t(Structure): |
| 3074 | _fields_ = [ |
| 3075 | ("cmd_code", c_uint32, 10), |
| 3076 | ("must_be_zero", c_uint32, 4), |
| 3077 | ("payload_size", c_uint32, 2), |
| 3078 | ("reserved0", c_uint32, 16), |
| 3079 | ("data", c_uint32, 32), |
| 3080 | ] |
| 3081 | def valid(self): return cmd_code==cmd1.NPU_SET_OFM_STRIDE_Y and must_be_zero==0 and payload_size>=1 and payload_size<=2; |
| 3082 | def get_cmd_code(self): return cmd_code |
| 3083 | def set_cmd_code(self, value): cmd_code = value |
| 3084 | def get_data(self): return data |
| 3085 | def set_data(self, value): data = value |
| 3086 | def get_payload_size(self): return payload_size |
| 3087 | def set_payload_size(self, value): payload_size = value |
| 3088 | |
| 3089 | class npu_set_ofm_stride_c_t(Structure): |
| 3090 | _fields_ = [ |
| 3091 | ("cmd_code", c_uint32, 10), |
| 3092 | ("must_be_zero", c_uint32, 4), |
| 3093 | ("payload_size", c_uint32, 2), |
| 3094 | ("reserved0", c_uint32, 16), |
| 3095 | ("data", c_uint32, 32), |
| 3096 | ] |
| 3097 | def valid(self): return cmd_code==cmd1.NPU_SET_OFM_STRIDE_C and must_be_zero==0 and payload_size>=1 and payload_size<=2; |
| 3098 | def get_cmd_code(self): return cmd_code |
| 3099 | def set_cmd_code(self, value): cmd_code = value |
| 3100 | def get_data(self): return data |
| 3101 | def set_data(self, value): data = value |
| 3102 | def get_payload_size(self): return payload_size |
| 3103 | def set_payload_size(self, value): payload_size = value |
| 3104 | |
| 3105 | class npu_set_weight_base_t(Structure): |
| 3106 | _fields_ = [ |
| 3107 | ("cmd_code", c_uint32, 10), |
| 3108 | ("must_be_zero", c_uint32, 4), |
| 3109 | ("payload_size", c_uint32, 2), |
| 3110 | ("reserved0", c_uint32, 16), |
| 3111 | ("data", c_uint32, 32), |
| 3112 | ] |
| 3113 | def valid(self): return cmd_code==cmd1.NPU_SET_WEIGHT_BASE and must_be_zero==0 and payload_size>=1 and payload_size<=2; |
| 3114 | def get_cmd_code(self): return cmd_code |
| 3115 | def set_cmd_code(self, value): cmd_code = value |
| 3116 | def get_data(self): return data |
| 3117 | def set_data(self, value): data = value |
| 3118 | def get_payload_size(self): return payload_size |
| 3119 | def set_payload_size(self, value): payload_size = value |
| 3120 | |
| 3121 | class npu_set_weight_length_t(Structure): |
| 3122 | _fields_ = [ |
| 3123 | ("cmd_code", c_uint32, 10), |
| 3124 | ("must_be_zero", c_uint32, 4), |
| 3125 | ("payload_size", c_uint32, 2), |
| 3126 | ("reserved0", c_uint32, 16), |
| 3127 | ("data", c_uint32, 32), |
| 3128 | ] |
| 3129 | def valid(self): return cmd_code==cmd1.NPU_SET_WEIGHT_LENGTH and must_be_zero==0 and payload_size>=1 and payload_size<=2; |
| 3130 | def get_cmd_code(self): return cmd_code |
| 3131 | def set_cmd_code(self, value): cmd_code = value |
| 3132 | def get_data(self): return data |
| 3133 | def set_data(self, value): data = value |
| 3134 | def get_payload_size(self): return payload_size |
| 3135 | def set_payload_size(self, value): payload_size = value |
| 3136 | |
| 3137 | class npu_set_scale_base_t(Structure): |
| 3138 | _fields_ = [ |
| 3139 | ("cmd_code", c_uint32, 10), |
| 3140 | ("must_be_zero", c_uint32, 4), |
| 3141 | ("payload_size", c_uint32, 2), |
| 3142 | ("reserved0", c_uint32, 16), |
| 3143 | ("data", c_uint32, 32), |
| 3144 | ] |
| 3145 | def valid(self): return cmd_code==cmd1.NPU_SET_SCALE_BASE and must_be_zero==0 and payload_size>=1 and payload_size<=2; |
| 3146 | def get_cmd_code(self): return cmd_code |
| 3147 | def set_cmd_code(self, value): cmd_code = value |
| 3148 | def get_data(self): return data |
| 3149 | def set_data(self, value): data = value |
| 3150 | def get_payload_size(self): return payload_size |
| 3151 | def set_payload_size(self, value): payload_size = value |
| 3152 | |
| 3153 | class npu_set_scale_length_t(Structure): |
| 3154 | _fields_ = [ |
| 3155 | ("cmd_code", c_uint32, 10), |
| 3156 | ("must_be_zero", c_uint32, 4), |
| 3157 | ("payload_size", c_uint32, 2), |
| 3158 | ("reserved0", c_uint32, 16), |
| 3159 | ("data", c_uint32, 32), |
| 3160 | ] |
| 3161 | def valid(self): return cmd_code==cmd1.NPU_SET_SCALE_LENGTH and must_be_zero==0 and payload_size>=1 and payload_size<=2; |
| 3162 | def get_cmd_code(self): return cmd_code |
| 3163 | def set_cmd_code(self, value): cmd_code = value |
| 3164 | def get_data(self): return data |
| 3165 | def set_data(self, value): data = value |
| 3166 | def get_payload_size(self): return payload_size |
| 3167 | def set_payload_size(self, value): payload_size = value |
| 3168 | |
| 3169 | class npu_set_ofm_scale_t(Structure): |
| 3170 | _fields_ = [ |
| 3171 | ("cmd_code", c_uint32, 10), |
| 3172 | ("must_be_zero", c_uint32, 4), |
| 3173 | ("payload_size", c_uint32, 2), |
| 3174 | ("shift", c_uint32, 16), |
| 3175 | ("data", c_uint32, 32), |
| 3176 | ] |
| 3177 | def valid(self): return cmd_code==cmd1.NPU_SET_OFM_SCALE and must_be_zero==0 and payload_size>=1 and payload_size<=2; |
| 3178 | def get_cmd_code(self): return cmd_code |
| 3179 | def set_cmd_code(self, value): cmd_code = value |
| 3180 | def get_data(self): return data |
| 3181 | def set_data(self, value): data = value |
| 3182 | def get_payload_size(self): return payload_size |
| 3183 | def set_payload_size(self, value): payload_size = value |
| 3184 | def get_shift(self): return shift |
| 3185 | def set_shift(self, value): shift = value |
| 3186 | |
| 3187 | class npu_set_opa_scale_t(Structure): |
| 3188 | _fields_ = [ |
| 3189 | ("cmd_code", c_uint32, 10), |
| 3190 | ("must_be_zero", c_uint32, 4), |
| 3191 | ("payload_size", c_uint32, 2), |
| 3192 | ("shift", c_uint32, 16), |
| 3193 | ("data", c_uint32, 32), |
| 3194 | ] |
| 3195 | def valid(self): return cmd_code==cmd1.NPU_SET_OPA_SCALE and must_be_zero==0 and payload_size>=1 and payload_size<=2; |
| 3196 | def get_cmd_code(self): return cmd_code |
| 3197 | def set_cmd_code(self, value): cmd_code = value |
| 3198 | def get_data(self): return data |
| 3199 | def set_data(self, value): data = value |
| 3200 | def get_payload_size(self): return payload_size |
| 3201 | def set_payload_size(self, value): payload_size = value |
| 3202 | def get_shift(self): return shift |
| 3203 | def set_shift(self, value): shift = value |
| 3204 | |
| 3205 | class npu_set_opb_scale_t(Structure): |
| 3206 | _fields_ = [ |
| 3207 | ("cmd_code", c_uint32, 10), |
| 3208 | ("must_be_zero", c_uint32, 4), |
| 3209 | ("payload_size", c_uint32, 2), |
| 3210 | ("reserved0", c_uint32, 16), |
| 3211 | ("data", c_uint32, 32), |
| 3212 | ] |
| 3213 | def valid(self): return cmd_code==cmd1.NPU_SET_OPB_SCALE and must_be_zero==0 and payload_size>=1 and payload_size<=2; |
| 3214 | def get_cmd_code(self): return cmd_code |
| 3215 | def set_cmd_code(self, value): cmd_code = value |
| 3216 | def get_data(self): return data |
| 3217 | def set_data(self, value): data = value |
| 3218 | def get_payload_size(self): return payload_size |
| 3219 | def set_payload_size(self, value): payload_size = value |
| 3220 | |
| 3221 | class npu_set_dma0_src_t(Structure): |
| 3222 | _fields_ = [ |
| 3223 | ("cmd_code", c_uint32, 10), |
| 3224 | ("must_be_zero", c_uint32, 4), |
| 3225 | ("payload_size", c_uint32, 2), |
| 3226 | ("reserved0", c_uint32, 16), |
| 3227 | ("data", c_uint32, 32), |
| 3228 | ] |
| 3229 | def valid(self): return cmd_code==cmd1.NPU_SET_DMA0_SRC and must_be_zero==0 and payload_size>=1 and payload_size<=2; |
| 3230 | def get_cmd_code(self): return cmd_code |
| 3231 | def set_cmd_code(self, value): cmd_code = value |
| 3232 | def get_data(self): return data |
| 3233 | def set_data(self, value): data = value |
| 3234 | def get_payload_size(self): return payload_size |
| 3235 | def set_payload_size(self, value): payload_size = value |
| 3236 | |
| 3237 | class npu_set_dma0_dst_t(Structure): |
| 3238 | _fields_ = [ |
| 3239 | ("cmd_code", c_uint32, 10), |
| 3240 | ("must_be_zero", c_uint32, 4), |
| 3241 | ("payload_size", c_uint32, 2), |
| 3242 | ("reserved0", c_uint32, 16), |
| 3243 | ("data", c_uint32, 32), |
| 3244 | ] |
| 3245 | def valid(self): return cmd_code==cmd1.NPU_SET_DMA0_DST and must_be_zero==0 and payload_size>=1 and payload_size<=2; |
| 3246 | def get_cmd_code(self): return cmd_code |
| 3247 | def set_cmd_code(self, value): cmd_code = value |
| 3248 | def get_data(self): return data |
| 3249 | def set_data(self, value): data = value |
| 3250 | def get_payload_size(self): return payload_size |
| 3251 | def set_payload_size(self, value): payload_size = value |
| 3252 | |
| 3253 | class npu_set_dma0_len_t(Structure): |
| 3254 | _fields_ = [ |
| 3255 | ("cmd_code", c_uint32, 10), |
| 3256 | ("must_be_zero", c_uint32, 4), |
| 3257 | ("payload_size", c_uint32, 2), |
| 3258 | ("reserved0", c_uint32, 16), |
| 3259 | ("data", c_uint32, 32), |
| 3260 | ] |
| 3261 | def valid(self): return cmd_code==cmd1.NPU_SET_DMA0_LEN and must_be_zero==0 and payload_size>=1 and payload_size<=2; |
| 3262 | def get_cmd_code(self): return cmd_code |
| 3263 | def set_cmd_code(self, value): cmd_code = value |
| 3264 | def get_data(self): return data |
| 3265 | def set_data(self, value): data = value |
| 3266 | def get_payload_size(self): return payload_size |
| 3267 | def set_payload_size(self, value): payload_size = value |
| 3268 | |
| 3269 | class npu_set_dma0_skip0_t(Structure): |
| 3270 | _fields_ = [ |
| 3271 | ("cmd_code", c_uint32, 10), |
| 3272 | ("must_be_zero", c_uint32, 4), |
| 3273 | ("payload_size", c_uint32, 2), |
| 3274 | ("param", c_uint32, 16), |
| 3275 | ("data", c_uint32, 32), |
| 3276 | ] |
| 3277 | def valid(self): return cmd_code==cmd1.NPU_SET_DMA0_SKIP0 and must_be_zero==0 and payload_size>=1 and payload_size<=2; |
| 3278 | def get_cmd_code(self): return cmd_code |
| 3279 | def set_cmd_code(self, value): cmd_code = value |
| 3280 | def get_data(self): return data |
| 3281 | def set_data(self, value): data = value |
| 3282 | def get_param(self): return param |
| 3283 | def set_param(self, value): param = value |
| 3284 | def get_payload_size(self): return payload_size |
| 3285 | def set_payload_size(self, value): payload_size = value |
| 3286 | |
| 3287 | class npu_set_dma0_skip1_t(Structure): |
| 3288 | _fields_ = [ |
| 3289 | ("cmd_code", c_uint32, 10), |
| 3290 | ("must_be_zero", c_uint32, 4), |
| 3291 | ("payload_size", c_uint32, 2), |
| 3292 | ("param", c_uint32, 16), |
| 3293 | ("data", c_uint32, 32), |
| 3294 | ] |
| 3295 | def valid(self): return cmd_code==cmd1.NPU_SET_DMA0_SKIP1 and must_be_zero==0 and payload_size>=1 and payload_size<=2; |
| 3296 | def get_cmd_code(self): return cmd_code |
| 3297 | def set_cmd_code(self, value): cmd_code = value |
| 3298 | def get_data(self): return data |
| 3299 | def set_data(self, value): data = value |
| 3300 | def get_param(self): return param |
| 3301 | def set_param(self, value): param = value |
| 3302 | def get_payload_size(self): return payload_size |
| 3303 | def set_payload_size(self, value): payload_size = value |
| 3304 | |
| 3305 | class npu_set_ifm2_base0_t(Structure): |
| 3306 | _fields_ = [ |
| 3307 | ("cmd_code", c_uint32, 10), |
| 3308 | ("must_be_zero", c_uint32, 4), |
| 3309 | ("payload_size", c_uint32, 2), |
| 3310 | ("reserved0", c_uint32, 16), |
| 3311 | ("data", c_uint32, 32), |
| 3312 | ] |
| 3313 | def valid(self): return cmd_code==cmd1.NPU_SET_IFM2_BASE0 and must_be_zero==0 and payload_size>=1 and payload_size<=2; |
| 3314 | def get_cmd_code(self): return cmd_code |
| 3315 | def set_cmd_code(self, value): cmd_code = value |
| 3316 | def get_data(self): return data |
| 3317 | def set_data(self, value): data = value |
| 3318 | def get_payload_size(self): return payload_size |
| 3319 | def set_payload_size(self, value): payload_size = value |
| 3320 | |
| 3321 | class npu_set_ifm2_base1_t(Structure): |
| 3322 | _fields_ = [ |
| 3323 | ("cmd_code", c_uint32, 10), |
| 3324 | ("must_be_zero", c_uint32, 4), |
| 3325 | ("payload_size", c_uint32, 2), |
| 3326 | ("reserved0", c_uint32, 16), |
| 3327 | ("data", c_uint32, 32), |
| 3328 | ] |
| 3329 | def valid(self): return cmd_code==cmd1.NPU_SET_IFM2_BASE1 and must_be_zero==0 and payload_size>=1 and payload_size<=2; |
| 3330 | def get_cmd_code(self): return cmd_code |
| 3331 | def set_cmd_code(self, value): cmd_code = value |
| 3332 | def get_data(self): return data |
| 3333 | def set_data(self, value): data = value |
| 3334 | def get_payload_size(self): return payload_size |
| 3335 | def set_payload_size(self, value): payload_size = value |
| 3336 | |
| 3337 | class npu_set_ifm2_base2_t(Structure): |
| 3338 | _fields_ = [ |
| 3339 | ("cmd_code", c_uint32, 10), |
| 3340 | ("must_be_zero", c_uint32, 4), |
| 3341 | ("payload_size", c_uint32, 2), |
| 3342 | ("reserved0", c_uint32, 16), |
| 3343 | ("data", c_uint32, 32), |
| 3344 | ] |
| 3345 | def valid(self): return cmd_code==cmd1.NPU_SET_IFM2_BASE2 and must_be_zero==0 and payload_size>=1 and payload_size<=2; |
| 3346 | def get_cmd_code(self): return cmd_code |
| 3347 | def set_cmd_code(self, value): cmd_code = value |
| 3348 | def get_data(self): return data |
| 3349 | def set_data(self, value): data = value |
| 3350 | def get_payload_size(self): return payload_size |
| 3351 | def set_payload_size(self, value): payload_size = value |
| 3352 | |
| 3353 | class npu_set_ifm2_base3_t(Structure): |
| 3354 | _fields_ = [ |
| 3355 | ("cmd_code", c_uint32, 10), |
| 3356 | ("must_be_zero", c_uint32, 4), |
| 3357 | ("payload_size", c_uint32, 2), |
| 3358 | ("reserved0", c_uint32, 16), |
| 3359 | ("data", c_uint32, 32), |
| 3360 | ] |
| 3361 | def valid(self): return cmd_code==cmd1.NPU_SET_IFM2_BASE3 and must_be_zero==0 and payload_size>=1 and payload_size<=2; |
| 3362 | def get_cmd_code(self): return cmd_code |
| 3363 | def set_cmd_code(self, value): cmd_code = value |
| 3364 | def get_data(self): return data |
| 3365 | def set_data(self, value): data = value |
| 3366 | def get_payload_size(self): return payload_size |
| 3367 | def set_payload_size(self, value): payload_size = value |
| 3368 | |
| 3369 | class npu_set_ifm2_stride_x_t(Structure): |
| 3370 | _fields_ = [ |
| 3371 | ("cmd_code", c_uint32, 10), |
| 3372 | ("must_be_zero", c_uint32, 4), |
| 3373 | ("payload_size", c_uint32, 2), |
| 3374 | ("reserved0", c_uint32, 16), |
| 3375 | ("data", c_uint32, 32), |
| 3376 | ] |
| 3377 | def valid(self): return cmd_code==cmd1.NPU_SET_IFM2_STRIDE_X and must_be_zero==0 and payload_size>=1 and payload_size<=2; |
| 3378 | def get_cmd_code(self): return cmd_code |
| 3379 | def set_cmd_code(self, value): cmd_code = value |
| 3380 | def get_data(self): return data |
| 3381 | def set_data(self, value): data = value |
| 3382 | def get_payload_size(self): return payload_size |
| 3383 | def set_payload_size(self, value): payload_size = value |
| 3384 | |
| 3385 | class npu_set_ifm2_stride_y_t(Structure): |
| 3386 | _fields_ = [ |
| 3387 | ("cmd_code", c_uint32, 10), |
| 3388 | ("must_be_zero", c_uint32, 4), |
| 3389 | ("payload_size", c_uint32, 2), |
| 3390 | ("reserved0", c_uint32, 16), |
| 3391 | ("data", c_uint32, 32), |
| 3392 | ] |
| 3393 | def valid(self): return cmd_code==cmd1.NPU_SET_IFM2_STRIDE_Y and must_be_zero==0 and payload_size>=1 and payload_size<=2; |
| 3394 | def get_cmd_code(self): return cmd_code |
| 3395 | def set_cmd_code(self, value): cmd_code = value |
| 3396 | def get_data(self): return data |
| 3397 | def set_data(self, value): data = value |
| 3398 | def get_payload_size(self): return payload_size |
| 3399 | def set_payload_size(self, value): payload_size = value |
| 3400 | |
| 3401 | class npu_set_ifm2_stride_c_t(Structure): |
| 3402 | _fields_ = [ |
| 3403 | ("cmd_code", c_uint32, 10), |
| 3404 | ("must_be_zero", c_uint32, 4), |
| 3405 | ("payload_size", c_uint32, 2), |
| 3406 | ("reserved0", c_uint32, 16), |
| 3407 | ("data", c_uint32, 32), |
| 3408 | ] |
| 3409 | def valid(self): return cmd_code==cmd1.NPU_SET_IFM2_STRIDE_C and must_be_zero==0 and payload_size>=1 and payload_size<=2; |
| 3410 | def get_cmd_code(self): return cmd_code |
| 3411 | def set_cmd_code(self, value): cmd_code = value |
| 3412 | def get_data(self): return data |
| 3413 | def set_data(self, value): data = value |
| 3414 | def get_payload_size(self): return payload_size |
| 3415 | def set_payload_size(self, value): payload_size = value |
| 3416 | |
| 3417 | class npu_set_weight1_base_t(Structure): |
| 3418 | _fields_ = [ |
| 3419 | ("cmd_code", c_uint32, 10), |
| 3420 | ("must_be_zero", c_uint32, 4), |
| 3421 | ("payload_size", c_uint32, 2), |
| 3422 | ("param", c_uint32, 16), |
| 3423 | ("data", c_uint32, 32), |
| 3424 | ] |
| 3425 | def valid(self): return cmd_code==cmd1.NPU_SET_WEIGHT1_BASE and must_be_zero==0 and payload_size>=1 and payload_size<=2; |
| 3426 | def get_cmd_code(self): return cmd_code |
| 3427 | def set_cmd_code(self, value): cmd_code = value |
| 3428 | def get_data(self): return data |
| 3429 | def set_data(self, value): data = value |
| 3430 | def get_param(self): return param |
| 3431 | def set_param(self, value): param = value |
| 3432 | def get_payload_size(self): return payload_size |
| 3433 | def set_payload_size(self, value): payload_size = value |
| 3434 | |
| 3435 | class npu_set_weight1_length_t(Structure): |
| 3436 | _fields_ = [ |
| 3437 | ("cmd_code", c_uint32, 10), |
| 3438 | ("must_be_zero", c_uint32, 4), |
| 3439 | ("payload_size", c_uint32, 2), |
| 3440 | ("reserved0", c_uint32, 16), |
| 3441 | ("data", c_uint32, 32), |
| 3442 | ] |
| 3443 | def valid(self): return cmd_code==cmd1.NPU_SET_WEIGHT1_LENGTH and must_be_zero==0 and payload_size>=1 and payload_size<=2; |
| 3444 | def get_cmd_code(self): return cmd_code |
| 3445 | def set_cmd_code(self, value): cmd_code = value |
| 3446 | def get_data(self): return data |
| 3447 | def set_data(self, value): data = value |
| 3448 | def get_payload_size(self): return payload_size |
| 3449 | def set_payload_size(self, value): payload_size = value |
| 3450 | |
| 3451 | class npu_set_scale1_base_t(Structure): |
| 3452 | _fields_ = [ |
| 3453 | ("cmd_code", c_uint32, 10), |
| 3454 | ("must_be_zero", c_uint32, 4), |
| 3455 | ("payload_size", c_uint32, 2), |
| 3456 | ("param", c_uint32, 16), |
| 3457 | ("data", c_uint32, 32), |
| 3458 | ] |
| 3459 | def valid(self): return cmd_code==cmd1.NPU_SET_SCALE1_BASE and must_be_zero==0 and payload_size>=1 and payload_size<=2; |
| 3460 | def get_cmd_code(self): return cmd_code |
| 3461 | def set_cmd_code(self, value): cmd_code = value |
| 3462 | def get_data(self): return data |
| 3463 | def set_data(self, value): data = value |
| 3464 | def get_param(self): return param |
| 3465 | def set_param(self, value): param = value |
| 3466 | def get_payload_size(self): return payload_size |
| 3467 | def set_payload_size(self, value): payload_size = value |
| 3468 | |
| 3469 | class npu_set_scale1_length_t(Structure): |
| 3470 | _fields_ = [ |
| 3471 | ("cmd_code", c_uint32, 10), |
| 3472 | ("must_be_zero", c_uint32, 4), |
| 3473 | ("payload_size", c_uint32, 2), |
| 3474 | ("reserved0", c_uint32, 16), |
| 3475 | ("data", c_uint32, 32), |
| 3476 | ] |
| 3477 | def valid(self): return cmd_code==cmd1.NPU_SET_SCALE1_LENGTH and must_be_zero==0 and payload_size>=1 and payload_size<=2; |
| 3478 | def get_cmd_code(self): return cmd_code |
| 3479 | def set_cmd_code(self, value): cmd_code = value |
| 3480 | def get_data(self): return data |
| 3481 | def set_data(self, value): data = value |
| 3482 | def get_payload_size(self): return payload_size |
| 3483 | def set_payload_size(self, value): payload_size = value |
Diqing Zhong | b731170 | 2020-04-14 12:31:44 +0200 | [diff] [blame] | 3484 | |