mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-06 02:18:05 +08:00
Refactoring of additional MMIO registers in AubDump
Change-Id: I97c0cc25aa24c6abcff4ba7469d6a6e3f0c12b86
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (C) 2018 Intel Corporation
|
||||
# Copyright (C) 2018-2019 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
||||
@@ -11,6 +11,7 @@ set(RUNTIME_SRCS_AUB
|
||||
${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}/aub_helper.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/aub_helper.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/aub_helper.inl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/aub_helper_add_mmio.cpp
|
||||
)
|
||||
target_sources(${NEO_STATIC_LIB_NAME} PRIVATE ${RUNTIME_SRCS_AUB})
|
||||
set_property(GLOBAL PROPERTY RUNTIME_SRCS_AUB ${RUNTIME_SRCS_AUB})
|
||||
|
||||
@@ -9,12 +9,17 @@
|
||||
#include "runtime/aub/aub_helper.h"
|
||||
#include "runtime/helpers/hw_info.h"
|
||||
#include "runtime/os_interface/debug_settings_manager.h"
|
||||
#include "third_party/aub_stream/headers/options.h"
|
||||
|
||||
namespace OCLRT {
|
||||
AubCenter::AubCenter(const HardwareInfo *pHwInfo, bool localMemoryEnabled, const std::string &aubFileName) {
|
||||
if (DebugManager.flags.UseAubStream.get()) {
|
||||
auto devicesCount = AubHelper::getDevicesCount(pHwInfo);
|
||||
auto memoryBankSize = AubHelper::getMemBankSize();
|
||||
if (DebugManager.flags.AubDumpAddMmioRegistersList.get() != "unk") {
|
||||
AubDump::injectMMIOList = AubHelper::getAdditionalMmioList();
|
||||
}
|
||||
|
||||
aubManager.reset(createAubManager(pHwInfo->pPlatform->eRenderCoreFamily, devicesCount, memoryBankSize, localMemoryEnabled, aubFileName));
|
||||
}
|
||||
addressMapper = std::make_unique<AddressMapper>();
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "runtime/gen_common/aub_mapper_base.h"
|
||||
#include "runtime/helpers/hw_info.h"
|
||||
#include "runtime/helpers/properties_helper.h"
|
||||
#include "runtime/memory_manager/graphics_allocation.h"
|
||||
@@ -32,6 +33,7 @@ class AubHelper : public NonCopyableOrMovableClass {
|
||||
static uint32_t getMemType(uint32_t addressSpace);
|
||||
static uint64_t getMemBankSize();
|
||||
static uint32_t getDevicesCount(const HardwareInfo *pHwInfo);
|
||||
static MMIOList getAdditionalMmioList();
|
||||
|
||||
virtual int getDataHintForPml4Entry() const = 0;
|
||||
virtual int getDataHintForPdpEntry() const = 0;
|
||||
@@ -42,6 +44,9 @@ class AubHelper : public NonCopyableOrMovableClass {
|
||||
virtual int getMemTraceForPdpEntry() const = 0;
|
||||
virtual int getMemTraceForPdEntry() const = 0;
|
||||
virtual int getMemTraceForPtEntry() const = 0;
|
||||
|
||||
protected:
|
||||
static MMIOList splitMMIORegisters(const std::string ®isters, char delimiter);
|
||||
};
|
||||
|
||||
template <typename GfxFamily>
|
||||
|
||||
54
runtime/aub/aub_helper_add_mmio.cpp
Normal file
54
runtime/aub/aub_helper_add_mmio.cpp
Normal file
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2019 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "runtime/aub/aub_helper.h"
|
||||
#include "runtime/os_interface/debug_settings_manager.h"
|
||||
#include "third_party/aub_stream/headers/options.h"
|
||||
|
||||
namespace OCLRT {
|
||||
|
||||
MMIOList AubHelper::getAdditionalMmioList() {
|
||||
return splitMMIORegisters(DebugManager.flags.AubDumpAddMmioRegistersList.get(), ';');
|
||||
}
|
||||
|
||||
MMIOList AubHelper::splitMMIORegisters(const std::string ®isters, char delimiter) {
|
||||
MMIOList result;
|
||||
bool firstElementInPair = false;
|
||||
std::string token;
|
||||
uint32_t registerOffset = 0;
|
||||
uint32_t registerValue = 0;
|
||||
std::istringstream stream("");
|
||||
|
||||
for (std::string::const_iterator i = registers.begin();; i++) {
|
||||
if (i == registers.end() || *i == delimiter) {
|
||||
if (token.size() > 0) {
|
||||
stream.str(token);
|
||||
stream.clear();
|
||||
firstElementInPair = !firstElementInPair;
|
||||
stream >> std::hex >> (firstElementInPair ? registerOffset : registerValue);
|
||||
if (stream.fail()) {
|
||||
result.clear();
|
||||
break;
|
||||
}
|
||||
token.clear();
|
||||
if (!firstElementInPair) {
|
||||
result.push_back(std::pair<uint32_t, uint32_t>(registerOffset, registerValue));
|
||||
registerValue = 0;
|
||||
registerOffset = 0;
|
||||
}
|
||||
}
|
||||
if (i == registers.end()) {
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
token.push_back(*i);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
} // namespace OCLRT
|
||||
Reference in New Issue
Block a user