gem5 v24.0.0.0
Loading...
Searching...
No Matches
pm4_defines.hh
Go to the documentation of this file.
1/*
2 * Copyright (c) 2021 Advanced Micro Devices, Inc.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer.
10 *
11 * 2. Redistributions in binary form must reproduce the above copyright notice,
12 * this list of conditions and the following disclaimer in the documentation
13 * and/or other materials provided with the distribution.
14 *
15 * 3. Neither the name of the copyright holder nor the names of its
16 * contributors may be used to endorse or promote products derived from this
17 * software without specific prior written permission.
18 *
19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE.
30 *
31 */
32
33#ifndef __DEV_AMDGPU_PM4_DEFINES_H__
34#define __DEV_AMDGPU_PM4_DEFINES_H__
35
36#include <cstdlib>
37#include <iostream>
38#include <vector>
39
40#include "base/types.hh"
41
42namespace gem5
43{
44
68
72#define PACKET3_SET_UCONFIG_REG_START 0x0000c000
73
77typedef struct GEM5_PACKED
78{
79 union
80 {
81 struct
82 {
83 uint16_t predicated : 1;
84 uint16_t shader : 1;
85 uint16_t reserved : 6;
86 uint16_t opcode : 8;
87 uint16_t count : 14;
88 uint16_t type : 2;
89 };
90 uint32_t ordinal;
91 };
93static_assert(sizeof(PM4Header) == 4);
94
95typedef struct GEM5_PACKED
96{
97 uint32_t reserved1 : 8;
98 uint32_t destSel : 4;
99 uint32_t reserved2 : 4;
100 uint32_t addrIncr : 1;
101 uint32_t reserved3 : 2;
102 uint32_t resume : 1;
103 uint32_t writeConfirm : 1;
104 uint32_t reserved4 : 4;
105 uint32_t cachePolicy : 2;
106 uint32_t reserved5 : 5;
107 union
108 {
109 struct
110 {
111 uint32_t destAddrLo;
112 uint32_t destAddrHi;
113 };
114 uint64_t destAddr;
115 };
116 uint32_t data;
118static_assert(sizeof(PM4WriteData) == 16);
119
120typedef struct GEM5_PACKED
121{
122 uint32_t reserved1 : 4;
123 uint32_t queueSel : 2;
124 uint32_t reserved2 : 2;
125 uint32_t vmid : 4;
126 uint32_t reserved3 : 1;
127 uint32_t queueSlot : 3;
128 uint32_t pipe : 2;
129 uint32_t me : 1;
130 uint32_t reserved6 : 2;
131 uint32_t queueType : 3;
132 uint32_t allocFormat : 2;
133 uint32_t engineSel : 3;
134 uint32_t numQueues : 3;
135 uint32_t reserved4 : 1;
136 uint32_t checkDisable : 1;
137 uint32_t doorbellOffset : 26;
138 uint32_t reserved5 : 4;
139 union
140 {
141 struct
142 {
143 uint32_t mqdAddrLo : 32;
144 uint32_t mqdAddrHi : 32;
145 };
146 uint64_t mqdAddr;
147 };
148 union
149 {
150 struct
151 {
152 uint32_t wptrAddrLo : 32;
153 uint32_t wptrAddrHi : 32;
154 };
155 uint64_t wptrAddr;
156 };
158static_assert(sizeof(PM4MapQueues) == 24);
159
160typedef struct GEM5_PACKED
161{
162 uint32_t action : 2;
163 uint32_t reserved : 2;
164 uint32_t queueSel : 2;
165 uint32_t reserved1 : 20;
166 uint32_t engineSel : 3;
167 uint32_t numQueues : 3;
168 union
169 {
170 struct
171 {
172 uint32_t pasid : 16;
173 uint32_t reserved2 : 16;
174 };
175 struct
176 {
177 uint32_t reserved3 : 2;
178 uint32_t doorbellOffset0 : 26;
179 uint32_t reserved4 : 4;
180 };
181 };
182 uint32_t reserved5 : 2;
183 uint32_t doorbellOffset1 : 26;
184 uint32_t reserved6 : 4;
185 uint32_t reserved7 : 2;
186 uint32_t doorbellOffset2 : 26;
187 uint32_t reserved8 : 4;
188 uint32_t reserved9 : 2;
189 uint32_t doorbellOffset3 : 26;
190 uint32_t reserved10 : 4;
192static_assert(sizeof(PM4UnmapQueues) == 20);
193
194typedef struct GEM5_PACKED
195{
196 uint32_t vmidMask : 16;
197 uint32_t unmapLatency : 8;
198 uint32_t reserved : 5;
199 uint32_t queueType : 3;
200 union
201 {
202 struct
203 {
204 uint32_t queueMaskLo;
205 uint32_t queueMaskHi;
206 };
207 uint64_t queueMask;
208 };
209 union
210 {
211 struct
212 {
213 uint32_t gwsMaskLo;
214 uint32_t gwsMaskHi;
215 };
216 uint64_t gwsMask;
217 };
218 uint16_t oacMask;
219 uint16_t reserved1;
220 uint32_t gdsHeapBase : 6;
221 uint32_t reserved2 : 5;
222 uint32_t gdsHeapSize : 6;
223 uint32_t reserved3 : 15;
225static_assert(sizeof(PM4SetResources) == 28);
226
227typedef struct GEM5_PACKED
228{
229 uint32_t pasid : 16;
230 uint32_t reserved0 : 8;
231 uint32_t diq : 1;
232 uint32_t processQuantum : 7;
233 union
234 {
235 struct
236 {
237 uint32_t ptBaseLo;
238 uint32_t ptBaseHi;
239 };
240 uint64_t ptBase;
241 };
242 uint32_t shMemBases;
243 uint32_t shMemConfig;
244 uint32_t reserved1;
245 uint32_t reserved2;
246 uint32_t reserved3;
247 uint32_t reserved4;
248 uint32_t reserved5;
249 union
250 {
251 struct
252 {
253 uint32_t gdsAddrLo;
254 uint32_t gdsAddrHi;
255 };
256 uint64_t gdsAddr;
257 };
258 uint32_t numGws : 6;
259 uint32_t reserved7 : 2;
260 uint32_t numOac : 4;
261 uint32_t reserved8 : 4;
262 uint32_t gdsSize : 6;
263 uint32_t numQueues : 10;
264 union
265 {
266 struct
267 {
270 };
272 };
274static_assert(sizeof(PM4MapProcess) == 60);
275
276typedef struct GEM5_PACKED
277{
278 uint32_t pasid : 16;
279 uint32_t reserved0 : 8;
280 uint32_t diq : 1;
281 uint32_t processQuantum : 7;
282 union
283 {
284 struct
285 {
286 uint32_t ptBaseLo;
287 uint32_t ptBaseHi;
288 };
289 uint64_t ptBase;
290 };
291 uint32_t shMemBases;
292 uint32_t shMemConfig;
297 uint32_t reserved1;
298 union
299 {
300 struct
301 {
302 uint32_t gdsAddrLo;
303 uint32_t gdsAddrHi;
304 };
305 uint64_t gdsAddr;
306 };
307 union
308 {
309 struct
310 {
311 uint32_t numGws : 7;
312 uint32_t sdma_enable : 1;
313 uint32_t numOac : 4;
314 uint32_t reserved3 : 4;
315 uint32_t gdsSize : 6;
316 uint32_t numQueues : 10;
317 };
318 uint32_t ordinal14;
319 };
321 uint32_t tcpWatchCntl[4];
322 union
323 {
324 struct
325 {
326 uint32_t completionSignalLo;
327 uint32_t completionSignalHi;
328 };
329 uint64_t completionSignal;
330 };
332static_assert(sizeof(PM4MapProcessV2) == 80);
333
334typedef struct GEM5_PACKED
335{
336 uint32_t function : 4;
337 uint32_t memSpace : 2;
338 uint32_t operation : 2;
339 uint32_t reserved1 : 24;
340 union
341 {
342 struct
343 {
344 uint32_t regAddr1 : 18;
345 uint32_t reserved2 : 14;
346 };
347 uint32_t memAddrLo;
348 };
349 union
350 {
351 struct
352 {
353 uint32_t regAddr2 : 18;
354 uint32_t reserved3 : 14;
355 };
356 uint32_t memAddrHi;
357 };
358 uint32_t reference;
359 uint32_t mask;
360 uint32_t pollInterval;
362static_assert(sizeof(PM4WaitRegMem) == 24);
363
364typedef struct GEM5_PACKED
365{
366 uint32_t regOffset : 16;
367 uint32_t reserved : 16;
368 uint32_t regData;
370static_assert(sizeof(PM4SetUConfig) == 8);
371
372typedef struct GEM5_PACKED
373{
374 union
375 {
376 struct
377 {
378 uint32_t ibBaseLo;
379 uint32_t ibBaseHi;
380 };
381 uint64_t ibBase;
382 };
383 uint32_t ibSize : 20;
384 uint32_t chain : 1;
385 uint32_t poll : 1;
386 uint32_t reserved0 : 1;
387 uint32_t valid: 1;
388 uint32_t vmid : 4;
389 uint32_t cachePolicy : 2;
390 uint32_t reserved1 : 1;
391 uint32_t priv : 1;
393static_assert(sizeof(PM4IndirectBuf) == 12);
394
395typedef struct GEM5_PACKED
396{
397 union
398 {
399 struct
400 {
401 uint32_t tmz : 1;
402 uint32_t reserved : 31;
403 };
404 uint32_t dummy;
405 };
407static_assert(sizeof(PM4SwitchBuf) == 4);
408
409typedef struct GEM5_PACKED
410{
411 union
412 {
413 struct
414 {
415 uint32_t ibBaseLo;
416 uint32_t ibBaseHi;
417 };
418 uint64_t ibBase;
419 };
420 uint32_t ibSize : 20;
421 uint32_t chain : 1;
422 uint32_t ena : 1;
423 uint32_t reserved1 : 2;
424 uint32_t vmid : 4;
425 uint32_t cachePolicy : 2;
426 uint32_t preResume : 1;
427 uint32_t priv : 1;
429static_assert(sizeof(PM4IndirectBufConst) == 12);
430
431typedef struct GEM5_PACKED
432{
433 uint32_t tmz : 1;
434 uint32_t reserved : 27;
435 uint32_t command : 4;
437static_assert(sizeof(PM4FrameCtrl) == 4);
438
439typedef struct GEM5_PACKED
440{
441 uint32_t event : 6;
442 uint32_t reserved0 : 2;
443 uint32_t eventIdx : 4;
444 uint32_t l1Volatile : 1;
445 uint32_t l2Volatile : 1;
446 uint32_t reserved1 : 1;
447 uint32_t l2WB : 1;
448 uint32_t l1Inv : 1;
449 uint32_t l2Inv : 1;
450 uint32_t reserved2 : 1;
451 uint32_t l2NC : 1;
452 uint32_t l2WC : 1;
453 uint32_t l2Meta : 1;
454 uint32_t reserved3 : 3;
455 uint32_t cachePolicy : 2;
456 uint32_t reserved4 : 1;
457 uint32_t execute : 1;
458 uint32_t reserved5 : 3;
459 uint32_t reserved6 : 16;
460 uint32_t destSelect : 2;
461 uint32_t reserved7 : 6;
462 uint32_t intSelect : 3;
463 uint32_t reserved8 : 2;
464 uint32_t dataSelect : 3;
465 union
466 {
467 struct
468 {
469 uint32_t addrLo;
470 uint32_t addrHi;
471 };
472 uint64_t addr;
473 };
474 union
475 {
476 struct
477 {
478 union
479 {
480 struct
481 {
482 uint32_t dwOffset : 16;
483 uint32_t numDws : 16;
484 };
485 uint32_t dataLo : 32;
486 };
487 uint32_t dataHi;
488 };
489 uint64_t data;
490 };
491 uint32_t intCtxId;
493static_assert(sizeof(PM4ReleaseMem) == 28);
494
495typedef struct GEM5_PACKED
496{
497 uint32_t offset : 16;
498 uint32_t reserved : 16;
499 uint32_t data;
501static_assert(sizeof(PM4SetUconfigReg) == 8);
502
503typedef struct GEM5_PACKED
504{
505 union
506 {
507 struct
508 {
509 uint32_t ibBaseLo;
510 uint32_t ibBaseHi;
511 };
512 uint64_t ibBase;
513 };
514 uint32_t ibSize : 20;
515 uint32_t chain : 1;
516 uint32_t offleadPolling : 1;
517 uint32_t reserved1 : 1;
518 uint32_t valid : 1;
519 uint32_t processCnt : 4;
520 uint32_t reserved2 : 4;
522static_assert(sizeof(PM4RunList) == 12);
523
524typedef struct GEM5_PACKED
525{
526 uint32_t contextId : 28;
527 uint32_t interruptSel : 2;
528 uint32_t command : 2;
529 union
530 {
531 struct
532 {
533 uint32_t pasid : 16;
534 uint32_t reserved0 : 16;
535 };
536 struct
537 {
538 uint32_t reserved1 : 2;
539 uint32_t doorbellOffset : 26;
540 uint32_t engineSel : 3;
541 uint32_t reserved2 : 1;
542 };
543 };
544 union
545 {
546 struct
547 {
548 uint32_t addrLo;
549 uint32_t addrHi;
550 };
551 uint64_t addr;
552 };
553 union
554 {
555 struct
556 {
557 uint32_t dataLo;
558 uint32_t dataHi;
559 };
560 uint64_t data;
561 };
563static_assert(sizeof(PM4QueryStatus) == 24);
564
565} // namespace gem5
566
567#endif // __DEV_AMDGPU_PM4_DEFINES_HH__
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,...
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
Definition binary32.hh:36
struct gem5::GEM5_PACKED PM4IndirectBufConst
struct gem5::GEM5_PACKED PM4WriteData
struct gem5::GEM5_PACKED PM4WaitRegMem
struct gem5::GEM5_PACKED PM4RunList
struct gem5::GEM5_PACKED PM4ReleaseMem
struct gem5::GEM5_PACKED PM4SwitchBuf
struct gem5::GEM5_PACKED PM4Header
PM4 packets.
struct gem5::GEM5_PACKED PM4MapQueues
struct gem5::GEM5_PACKED PM4MapProcess
struct gem5::GEM5_PACKED PM4MapProcessV2
struct gem5::GEM5_PACKED PM4UnmapQueues
struct gem5::GEM5_PACKED PM4SetUconfigReg
struct gem5::GEM5_PACKED PM4SetResources
it_opcode_type
PM4 opcodes.
@ IT_RELEASE_MEM
@ IT_WRITE_DATA
@ IT_RUN_LIST
@ IT_MAP_QUEUES
@ IT_SET_UCONFIG_REG
@ IT_MAP_PROCESS
@ IT_INVALIDATE_TLBS
@ IT_QUERY_STATUS
@ IT_WAIT_REG_MEM
@ IT_UNMAP_QUEUES
@ IT_INDIRECT_BUFFER
@ IT_SWITCH_BUFFER
struct gem5::GEM5_PACKED PM4QueryStatus
struct gem5::GEM5_PACKED PM4FrameCtrl
struct gem5::GEM5_PACKED PM4SetUConfig
struct gem5::GEM5_PACKED PM4IndirectBuf
uint32_t completionSignalLo
uint32_t doorbellOffset0
uint32_t doorbellOffset3
uint32_t doorbellOffset2
uint32_t spiGdbgPerVmidCntl
uint32_t doorbellOffset
uint32_t completionSignalHi
uint32_t processQuantum
uint32_t tcpWatchCntl[4]
uint32_t offleadPolling
uint32_t doorbellOffset1
uint64_t completionSignal

Generated on Tue Jun 18 2024 16:24:02 for gem5 by doxygen 1.11.0