gem5 v23.0.0.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
amdgpu_nbio.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
33#ifndef __DEV_AMDGPU_AMDGPU_NBIO__
34#define __DEV_AMDGPU_AMDGPU_NBIO__
35
36#include <unordered_map>
37
38#include "base/types.hh"
39#include "mem/packet.hh"
40
41namespace gem5
42{
43
44class AMDGPUDevice;
45
56#define AMDGPU_MM_INDEX 0x00000
57#define AMDGPU_MM_INDEX_HI 0x00018
58#define AMDGPU_MM_DATA 0x00004
59#define AMDGPU_PCIE_DATA_REG 0x0003c
60
61// Message bus related to psp
62#define AMDGPU_MP0_SMN_C2PMSG_33 0x58184
63#define AMDGPU_MP0_SMN_C2PMSG_35 0x5818c
64#define AMDGPU_MP0_SMN_C2PMSG_64 0x58200
65#define AMDGPU_MP0_SMN_C2PMSG_69 0x58214
66#define AMDGPU_MP0_SMN_C2PMSG_70 0x58218
67#define AMDGPU_MP0_SMN_C2PMSG_71 0x5821c
68#define AMDGPU_MP0_SMN_C2PMSG_81 0x58244
69
70// Device specific invalidation engines used during initialization
71#define VEGA10_INV_ENG17_ACK1 0x0a318
72#define VEGA10_INV_ENG17_ACK2 0x69c18
73#define VEGA10_INV_ENG17_SEM1 0x0a288
74#define VEGA10_INV_ENG17_SEM2 0x69b88
75
76#define MI100_INV_ENG17_ACK1 0x0a318
77#define MI100_INV_ENG17_ACK2 0x6a918
78#define MI100_INV_ENG17_ACK3 0x76918
79#define MI100_INV_ENG17_SEM1 0x0a288
80#define MI100_INV_ENG17_SEM2 0x6a888
81#define MI100_INV_ENG17_SEM3 0x76888
82
83#define MI200_INV_ENG17_ACK1 0x0a318
84#define MI200_INV_ENG17_ACK2 0x6b018
85#define MI200_INV_ENG17_SEM1 0x0a288
86#define MI200_INV_ENG17_SEM2 0x6af88
87
89{
90 public:
91 AMDGPUNbio();
92
93 void setGPUDevice(AMDGPUDevice *gpu_device);
94
95 void readMMIO(PacketPtr pkt, Addr offset);
96 void writeMMIO(PacketPtr pkt, Addr offset);
97
98 bool readFrame(PacketPtr pkt, Addr offset);
100
101 private:
103
104 /*
105 * Driver initialization sequence helper variables.
106 */
107 uint64_t mm_index_reg = 0;
108 std::unordered_map<uint32_t, uint32_t> triggered_reads;
109
110 /*
111 * PSP variables used in initialization.
112 */
118};
119
120} // namespace gem5
121
122#endif // __DEV_AMDGPU_AMDGPU_NBIO__
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,...
Device model for an AMD GPU.
void readMMIO(PacketPtr pkt, Addr offset)
std::unordered_map< uint32_t, uint32_t > triggered_reads
void writeMMIO(PacketPtr pkt, Addr offset)
bool readFrame(PacketPtr pkt, Addr offset)
uint64_t mm_index_reg
AMDGPUDevice * gpuDevice
void writeFrame(PacketPtr pkt, Addr offset)
void setGPUDevice(AMDGPUDevice *gpu_device)
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
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
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 Mon Jul 10 2023 14:24:30 for gem5 by doxygen 1.9.7