Go to the documentation of this file.
32 #ifndef __DEV_AMDGPU_MMIO_READER_HH__
33 #define __DEV_AMDGPU_MMIO_READER_HH__
39 #include <unordered_map>
70 const uint64_t
BAR0 = 0x2400000000;
71 const uint64_t
BAR2 = 0x2200000000;
72 const uint32_t
BAR5 = 0xecf00000;
73 const uint32_t
ROM = 0xc0000;
94 typedef std::unordered_map<uint32_t, std::list<trace_entry_t>>
trace_BAR_t;
119 return tokens[0] ==
"R";
125 return tokens[0] ==
"W";
131 return tokens[0] ==
"UNKNOWN";
138 return tokens[0] ==
"R" || tokens[0] ==
"W" || tokens[0] ==
"UNKNOWN";
145 uint64_t
addr = strtoull(tokens[4].c_str(),
nullptr, 16);
147 return (bar == 0 || bar == 2 || bar == 5);
178 panic(
"Can't find offset for the address in MMIO trace!");
187 mtrace.
size = strtoul(tokens[1].c_str(),
nullptr, 10);
188 mtrace.
addr = strtoull(tokens[4].c_str(),
nullptr, 16);
189 mtrace.
data = strtoull(tokens[5].c_str(),
nullptr, 16);
194 mtrace.
addr = strtoull(tokens[3].c_str(),
nullptr, 16);
252 #endif // __DEV_AMDGPU_MMIO_READER_HH__
std::unordered_map< uint32_t, std::list< trace_entry_t > > trace_BAR_t
struct gem5::AMDMMIOReader::MmioTrace mtrace
bool isRelevant(std::vector< std::string > tokens)
uint64_t trace_final_index
void writeFromTrace(PacketPtr pkt, int barnum, Addr offset)
Get the next MMIO write from the trace file to an offset in a BAR and compare the value with the data...
void readMMIOTrace(std::string trace_file)
Read an MMIO trace gathered from a real system and place the MMIO values read and written into the MM...
bool traceIsUnknown(std::vector< std::string > tokens) const
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
bool isIO(std::vector< std::string > tokens) const
bool traceIsRead(std::vector< std::string > tokens) const
Helper class to read Linux kernel MMIO trace from amdgpu modprobes.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
void traceParseTokens(std::vector< std::string > tokens)
trace_BAR_t trace_BARs[6]
void readFromTrace(PacketPtr pkt, int barnum, Addr offset)
Get the next MMIO read from the trace file to an offset in a BAR and write the value to the packet pr...
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
const uint64_t BAR0
These are the BAR values from the system where the trace is collected.
bool traceIsWrite(std::vector< std::string > tokens) const
std::tuple< uint64_t, std::tuple< char, uint64_t > > trace_entry_t
The information we want from each relevant line of trace are: (1) The BAR number where the accessed a...
uint64_t traceGetOffset(uint64_t addr)
uint8_t traceGetBAR(uint64_t addr)
#define panic(...)
This implements a cprintf based panic() function.
Generated on Sun Jul 30 2023 01:56:54 for gem5 by doxygen 1.8.17