2018-08-20 15:54:20 +02:00
|
|
|
/*
|
2023-02-01 16:23:01 +00:00
|
|
|
* Copyright (C) 2018-2023 Intel Corporation
|
2018-08-20 15:54:20 +02:00
|
|
|
*
|
2018-09-18 09:11:08 +02:00
|
|
|
* SPDX-License-Identifier: MIT
|
2018-08-20 15:54:20 +02:00
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
2020-10-16 12:10:52 +02:00
|
|
|
#include "shared/source/aub/aub_helper.h"
|
2019-02-27 11:39:32 +01:00
|
|
|
|
2021-12-07 11:22:25 +00:00
|
|
|
#include "shared/source/aub_mem_dump/aub_mem_dump.h"
|
2021-07-05 14:52:03 +00:00
|
|
|
#include "shared/source/aub_mem_dump/page_table_entry_bits.h"
|
2020-02-23 22:44:01 +01:00
|
|
|
#include "shared/source/debug_settings/debug_settings_manager.h"
|
|
|
|
|
#include "shared/source/helpers/basic_math.h"
|
2021-07-05 14:52:03 +00:00
|
|
|
#include "shared/source/helpers/constants.h"
|
2023-02-01 16:23:01 +00:00
|
|
|
#include "shared/source/helpers/gfx_core_helper.h"
|
2021-07-05 14:52:03 +00:00
|
|
|
#include "shared/source/tbx/tbx_proto.h"
|
2020-02-24 10:22:30 +01:00
|
|
|
|
2022-11-23 09:14:27 +00:00
|
|
|
#include "aubstream/aubstream.h"
|
2020-08-22 14:12:46 +02:00
|
|
|
|
2019-03-26 11:59:46 +01:00
|
|
|
namespace NEO {
|
2018-09-11 10:26:39 +02:00
|
|
|
|
2019-02-12 13:37:39 +01:00
|
|
|
uint64_t AubHelper::getTotalMemBankSize() {
|
2021-07-05 14:52:03 +00:00
|
|
|
return 32ull * MemoryConstants::gigaByte;
|
2019-02-12 13:37:39 +01:00
|
|
|
}
|
|
|
|
|
|
2018-08-20 15:54:20 +02:00
|
|
|
int AubHelper::getMemTrace(uint64_t pdEntryBits) {
|
2021-07-05 14:52:03 +00:00
|
|
|
if (pdEntryBits & BIT(PageTableEntry::localMemoryBit)) {
|
|
|
|
|
return AubMemDump::AddressSpaceValues::TraceLocal;
|
|
|
|
|
}
|
2018-08-20 15:54:20 +02:00
|
|
|
return AubMemDump::AddressSpaceValues::TraceNonlocal;
|
|
|
|
|
}
|
2018-09-11 10:26:39 +02:00
|
|
|
|
|
|
|
|
uint64_t AubHelper::getPTEntryBits(uint64_t pdEntryBits) {
|
2021-07-05 14:52:03 +00:00
|
|
|
pdEntryBits &= ~BIT(PageTableEntry::localMemoryBit);
|
2018-09-11 10:26:39 +02:00
|
|
|
return pdEntryBits;
|
|
|
|
|
}
|
2018-10-15 13:01:45 +02:00
|
|
|
|
2018-11-09 23:00:58 -08:00
|
|
|
uint32_t AubHelper::getMemType(uint32_t addressSpace) {
|
2021-07-05 14:52:03 +00:00
|
|
|
if (addressSpace == AubMemDump::AddressSpaceValues::TraceLocal) {
|
|
|
|
|
return mem_types::MEM_TYPE_LOCALMEM;
|
|
|
|
|
}
|
|
|
|
|
return mem_types::MEM_TYPE_SYSTEM;
|
2018-11-09 23:00:58 -08:00
|
|
|
}
|
|
|
|
|
|
2023-10-26 15:04:39 +02:00
|
|
|
uint64_t AubHelper::getPerTileLocalMemorySize(const HardwareInfo *pHwInfo) {
|
2021-07-05 14:52:03 +00:00
|
|
|
if (DebugManager.flags.HBMSizePerTileInGigabytes.get() > 0) {
|
|
|
|
|
return DebugManager.flags.HBMSizePerTileInGigabytes.get() * MemoryConstants::gigaByte;
|
|
|
|
|
}
|
2023-10-26 15:04:39 +02:00
|
|
|
return getTotalMemBankSize() / GfxCoreHelper::getSubDevicesCount(pHwInfo);
|
2020-08-22 14:12:46 +02:00
|
|
|
}
|
2019-03-26 11:59:46 +01:00
|
|
|
} // namespace NEO
|