gem5 v24.0.0.0
Loading...
Searching...
No Matches
sdma_packets.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_SDMA_PACKETS_HH__
34#define __DEV_AMDGPU_SDMA_PACKETS_HH__
35
36namespace gem5
37{
38
42typedef struct GEM5_PACKED
43{
44 uint32_t count : 30;
45 uint32_t res0 : 2;
46 uint32_t res1 : 16;
47 uint32_t sdw: 2;
48 uint32_t res2 : 6;
49 uint32_t ddw: 2;
50 uint32_t res3 : 6;
51 uint64_t source;
52 uint64_t dest;
54static_assert(sizeof(sdmaCopy) == 24);
55
56typedef struct GEM5_PACKED
57{
58 uint64_t dest;
59 uint32_t count : 20;
60 uint32_t reserved0 : 4;
61 uint32_t sw : 2;
62 uint32_t reserved1 : 6;
64static_assert(sizeof(sdmaWrite) == 12);
65
66typedef struct GEM5_PACKED
67{
68 union
69 {
70 struct
71 {
72 uint32_t addrLo;
73 uint32_t addrHi;
74 };
76 };
77 uint32_t srcData;
78 uint32_t unused : 10;
79 uint32_t count : 22;
81static_assert(sizeof(sdmaConstFill) == 16);
82
83typedef struct GEM5_PACKED
84{
85 union
86 {
87 struct
88 {
89 uint32_t op : 8;
90 uint32_t sub_op : 8;
91 uint32_t sw : 2;
92 uint32_t res0 : 12;
93 uint32_t fillsize : 2;
94 };
95 uint32_t ordinal;
96 };
98static_assert(sizeof(sdmaConstFillHeader) == 4);
99
100typedef struct GEM5_PACKED
101{
102 uint32_t key0;
103 uint32_t key1;
104 uint32_t key2;
105 uint32_t key3;
106 uint32_t count0;
107 uint32_t count1;
108 uint32_t count2;
109 uint32_t count3;
111static_assert(sizeof(sdmaAESKey) == 32);
112
113typedef struct GEM5_PACKED
114{
115 uint32_t countData0;
116 uint32_t countData1;
117 uint32_t countData2;
118 uint32_t countData3;
120static_assert(sizeof(sdmaAESCounter) == 16);
121
122typedef struct GEM5_PACKED
123{
124 uint32_t countKey0;
125 uint32_t countKey1;
126 uint32_t countKey2;
127 uint32_t countKey3;
129static_assert(sizeof(sdmaAESLoad) == 16);
130
131typedef struct GEM5_PACKED
132{
133 uint32_t reserved : 6;
134 uint32_t offset : 26;
136static_assert(sizeof(sdmaAESOffset) == 4);
137
138typedef struct GEM5_PACKED
139{
140 uint64_t base;
141 uint32_t size : 20;
142 uint32_t reserved : 12;
143 uint64_t csaAddr;
145static_assert(sizeof(sdmaIndirectBuffer) == 20);
146
147typedef struct GEM5_PACKED
148{
149 uint32_t priv : 1;
150 uint32_t reserved1 : 11;
151 uint32_t vmid : 4;
152 uint32_t reserved2 : 16;
154static_assert(sizeof(sdmaIndirectBufferHeader) == 4);
155
156typedef struct GEM5_PACKED
157{
158 uint64_t dest;
159 uint32_t data;
161static_assert(sizeof(sdmaFence) == 12);
162
163typedef struct GEM5_PACKED
164{
165 union
166 {
167 struct
168 {
169 uint32_t contextId : 3;
170 uint32_t rbRptr: 13;
171 uint32_t ibOffset : 12;
172 uint32_t reserved : 4;
173 };
174 uint32_t intrContext;
175 };
177static_assert(sizeof(sdmaTrap) == 4);
178
179typedef struct GEM5_PACKED
180{
181 union
182 {
183 struct
184 {
185 uint32_t reserved : 3;
186 uint32_t addrLo : 29;
187 uint32_t addrHi;
188 };
189 Addr addr;
190 };
192static_assert(sizeof(sdmaSemaphore) == 8);
193
194typedef struct GEM5_PACKED
195{
196 union
197 {
198 struct
199 {
200 uint32_t reserved : 3;
201 uint32_t addrLo : 29;
202 uint32_t addrHi;
203 };
204 Addr addr;
205 };
207static_assert(sizeof(sdmaMemInc) == 8);
208
209typedef struct GEM5_PACKED
210{
211 uint32_t regAddr : 18;
212 uint32_t reserved : 2;
213 uint32_t apertureId : 12;
214 uint32_t data;
216static_assert(sizeof(sdmaSRBMWrite) == 8);
217
218typedef struct GEM5_PACKED
219{
220 uint32_t reserved : 28;
221 uint32_t byteEnable : 4;
223static_assert(sizeof(sdmaSRBMWriteHeader) == 4);
224
225typedef struct GEM5_PACKED
226{
227 uint64_t address;
228 uint32_t ref;
229 uint32_t mask;
230 uint32_t pollInt : 16;
231 uint32_t retryCount : 12;
232 uint32_t reserved1 : 4;
234static_assert(sizeof(sdmaPollRegMem) == 20);
235
236typedef struct GEM5_PACKED
237{
238 uint32_t reserved : 26;
239 uint32_t op : 2; // Operation
240 uint32_t func : 3; // Comparison function
241 uint32_t mode : 1; // Mode: register or memory polling
243static_assert(sizeof(sdmaPollRegMemHeader) == 4);
244
245typedef struct GEM5_PACKED
246{
247 union
248 {
249 struct
250 {
251 uint32_t addrLo;
252 uint32_t addrHi;
253 };
254 Addr addr;
255 };
256 uint32_t reference;
257 union
258 {
259 struct
260 {
261 uint32_t execCount : 14;
262 uint32_t unused : 18;
263 };
264 uint32_t ordinal;
265 };
267static_assert(sizeof(sdmaCondExec) == 16);
268
269typedef struct GEM5_PACKED
270{
271 union
272 {
273 struct
274 {
275 uint32_t addrLo;
276 uint32_t addrHi;
277 };
278 Addr addr;
279 };
280 union
281 {
282 struct
283 {
284 uint32_t srcDataLo;
285 uint32_t srdDataHi;
286 };
287 uint64_t srcData;
288 };
289 union
290 {
291 struct
292 {
293 uint32_t cmpDataLo;
294 uint32_t cmpDataHi;
295 };
296 uint64_t cmpData;
297 };
298 uint32_t loopInt : 13;
299 uint32_t reserved : 19;
301static_assert(sizeof(sdmaAtomic) == 28);
302
303typedef struct GEM5_PACKED
304{
305 int unused2 : 16;
306 int loop : 1;
307 int unused1 : 8;
308 int opcode : 7;
310static_assert(sizeof(sdmaAtomicHeader) == 4);
311
312constexpr unsigned int SDMA_ATOMIC_ADD64 = 47;
313
314typedef struct GEM5_PACKED
315{
316 uint64_t dest;
317 uint64_t mask;
318 uint64_t initValue;
319 uint64_t increment;
320 uint32_t count: 19;
321 uint32_t reserved : 13;
323static_assert(sizeof(sdmaPtePde) == 36);
324
325typedef struct GEM5_PACKED
326{
327 union
328 {
329 struct
330 {
331 uint32_t initDataLo;
332 uint32_t initDataHi;
333 };
334 uint64_t initData;
335 };
337static_assert(sizeof(sdmaTimestamp) == 8);
338
339typedef struct GEM5_PACKED
340{
341 uint32_t execCount : 14;
342 uint32_t reserved : 18;
344static_assert(sizeof(sdmaPredExec) == 4);
345
346typedef struct GEM5_PACKED
347{
348 uint32_t opcode : 8;
349 uint32_t subOpcode : 8;
350 uint32_t device : 8;
351 uint32_t unused : 8;
353static_assert(sizeof(sdmaPredExecHeader) == 4);
354
355typedef struct GEM5_PACKED
356{
357 uint32_t contextId : 3;
358 uint32_t rbRptr: 13;
359 uint32_t ibOffset : 12;
360 uint32_t reserved : 4;
362static_assert(sizeof(sdmaDummyTrap) == 4);
363
364typedef struct GEM5_PACKED
365{
366 uint32_t byteStride;
367 uint32_t dmaCount;
368 union
369 {
370 struct
371 {
372 uint32_t destLo;
373 uint32_t destHi;
374 };
375 uint64_t dest;
376 };
377 uint32_t byteCount : 26;
379static_assert(sizeof(sdmaDataFillMulti) == 20);
380
381typedef struct GEM5_PACKED
382{
383 uint16_t format : 8;
384 uint16_t barrier : 1;
385 uint16_t acqFenceScope : 2;
386 uint16_t relFenceScope : 2;
387 uint16_t reserved : 3;
389static_assert(sizeof(sdmaHeaderAgentDisp) == 2);
390
391typedef struct GEM5_PACKED
392{
394 uint16_t res0;
395 uint32_t res1;
396 union
397 {
398 struct
399 {
400 uint32_t retLo;
401 uint32_t retHi;
402 };
404 };
405 uint32_t count : 22;
406 uint32_t res2 : 10;
407 uint32_t res3 : 16;
408 uint32_t swDest : 2;
409 uint32_t res4 : 6;
410 uint32_t swSrc : 2;
411 uint32_t unused : 6;
412 union
413 {
414 struct
415 {
416 uint32_t srcLo;
417 uint32_t srcHi;
418 };
420 };
421 union
422 {
423 struct
424 {
425 uint32_t destLo;
426 uint32_t destHi;
427 };
429 };
430 uint64_t res5;
431 uint64_t res6;
432 union
433 {
434 struct
435 {
436 uint32_t compSignalLo;
437 uint32_t compSignalHi;
438 };
440 };
442static_assert(sizeof(sdmaAQLCopy) == 64);
443
444typedef struct GEM5_PACKED
445{
447 uint16_t res0;
448 uint32_t res1;
454 uint64_t res2;
455 union
456 {
457 struct
458 {
459 uint32_t compSignalLo;
460 uint32_t compSignalHi;
461 };
463 };
465static_assert(sizeof(sdmaAQLBarrierOr) == 64);
466
467} // namespace gem5
468
469#endif // __DEV_AMDGPU_SDMA_PACKETS_HH__
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
Definition binary32.hh:36
struct gem5::GEM5_PACKED sdmaFence
struct gem5::GEM5_PACKED sdmaDataFillMulti
struct gem5::GEM5_PACKED sdmaConstFill
struct gem5::GEM5_PACKED sdmaIndirectBufferHeader
struct gem5::GEM5_PACKED sdmaTimestamp
struct gem5::GEM5_PACKED sdmaConstFillHeader
struct gem5::GEM5_PACKED sdmaAESCounter
struct gem5::GEM5_PACKED sdmaAtomic
struct gem5::GEM5_PACKED sdmaPredExecHeader
struct gem5::GEM5_PACKED sdmaAQLBarrierOr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition types.hh:147
struct gem5::GEM5_PACKED sdmaPtePde
struct gem5::GEM5_PACKED sdmaPollRegMem
struct gem5::GEM5_PACKED sdmaMemInc
struct gem5::GEM5_PACKED sdmaPollRegMemHeader
struct gem5::GEM5_PACKED sdmaPredExec
struct gem5::GEM5_PACKED sdmaAESKey
constexpr unsigned int SDMA_ATOMIC_ADD64
struct gem5::GEM5_PACKED sdmaWrite
struct gem5::GEM5_PACKED sdmaAtomicHeader
struct gem5::GEM5_PACKED sdmaCopy
SDMA packets - see src/core/inc/sdma_registers.h in ROCR-Runtime.
struct gem5::GEM5_PACKED sdmaIndirectBuffer
struct gem5::GEM5_PACKED sdmaTrap
struct gem5::GEM5_PACKED sdmaSRBMWrite
struct gem5::GEM5_PACKED sdmaAQLCopy
struct gem5::GEM5_PACKED sdmaAESOffset
struct gem5::GEM5_PACKED sdmaHeaderAgentDisp
struct gem5::GEM5_PACKED sdmaAESLoad
struct gem5::GEM5_PACKED sdmaSRBMWriteHeader
struct gem5::GEM5_PACKED sdmaDummyTrap
struct gem5::GEM5_PACKED sdmaSemaphore
struct gem5::GEM5_PACKED sdmaCondExec
PM4 packets.
sdmaHeaderAgentDisp header

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