gem5 v24.0.0.0
Loading...
Searching...
No Matches
amdgpu_gfx.hh
Go to the documentation of this file.
1/*
2 * Copyright (c) 2023 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#ifndef __DEV_AMDGPU_AMDGPU_GFX_HH__
33#define __DEV_AMDGPU_AMDGPU_GFX_HH__
34
35#include "base/types.hh"
36#include "mem/packet.hh"
37
50// Registers used to read GPU clock count used in profiling
51#define AMDGPU_MM_RLC_GPU_CLOCK_COUNT_LSB 0x13090
52#define AMDGPU_MM_RLC_GPU_CLOCK_COUNT_MSB 0x13094
53#define AMDGPU_MM_RLC_CAPTURE_GPU_CLOCK_COUNT 0x13098
54
55// Scratch registers used for GPU post
56#define AMDGPU_MM_SCRATCH_REG0 0x08100
57
58namespace gem5
59{
60
62{
63 public:
64 AMDGPUGfx();
65
66 void readMMIO(PacketPtr pkt, Addr offset);
67 void writeMMIO(PacketPtr pkt, Addr offset);
68
69 private:
70 /*
71 * GPU clock count at the time capture MMIO is received.
72 */
74
75 /*
76 * Scratch registers.
77 */
78 static constexpr int SCRATCH_REGS = 8;
79 std::array<uint32_t, SCRATCH_REGS> scratchRegs;
80};
81
82} // namespace gem5
83
84#endif // __DEV_AMDGPU_AMDGPU_GFX_HH__
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,...
static constexpr int SCRATCH_REGS
Definition amdgpu_gfx.hh:78
std::array< uint32_t, SCRATCH_REGS > scratchRegs
Definition amdgpu_gfx.hh:79
void readMMIO(PacketPtr pkt, Addr offset)
Definition amdgpu_gfx.cc:48
void writeMMIO(PacketPtr pkt, Addr offset)
Definition amdgpu_gfx.cc:66
uint64_t captured_clock_count
Definition amdgpu_gfx.hh:73
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Definition packet.hh:295
Bitfield< 23, 0 > offset
Definition types.hh:144
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
Definition binary32.hh:36
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition types.hh:147
Declaration of the Packet class.

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