fix: Removing stream

Related-To: NEO-14718
Signed-off-by: Aleksandra Nizio <aleksandra.nizio@intel.com>
This commit is contained in:
Aleksandra Nizio 2025-05-27 11:55:16 +00:00 committed by Compute-Runtime-Automation
parent 9831931722
commit e43ec2bbfd
19 changed files with 11 additions and 909 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2024 Intel Corporation
* Copyright (C) 2018-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@ -187,40 +187,4 @@ HWTEST_F(AubMemDumpTests, GivenVcsThenExpectationsAreMet) {
HWTEST_F(AubMemDumpTests, GivenVecsThenExpectationsAreMet) {
setupAUB<FamilyType>(pDevice, aub_stream::ENGINE_VECS);
}
TEST(AubMemDumpBasic, givenDebugOverrideMmioWhenMmioNotMatchThenDoNotAlterValue) {
DebugManagerStateRestore dbgRestore;
uint32_t dbgOffset = 0x1000;
uint32_t dbgValue = 0xDEAD;
debugManager.flags.AubDumpOverrideMmioRegister.set(static_cast<int32_t>(dbgOffset));
debugManager.flags.AubDumpOverrideMmioRegisterValue.set(static_cast<int32_t>(dbgValue));
uint32_t offset = 0x2000;
uint32_t value = 0x3000;
MMIOPair mmio = std::make_pair(offset, value);
MockAubFileStreamMockMmioWrite mockAubStream;
mockAubStream.writeMMIO(offset, value);
EXPECT_EQ(1u, mockAubStream.mmioList.size());
EXPECT_TRUE(mockAubStream.isOnMmioList(mmio));
}
TEST(AubMemDumpBasic, givenDebugOverrideMmioWhenMmioMatchThenAlterValue) {
DebugManagerStateRestore dbgRestore;
uint32_t dbgOffset = 0x2000;
uint32_t dbgValue = 0xDEAD;
MMIOPair dbgMmio = std::make_pair(dbgOffset, dbgValue);
debugManager.flags.AubDumpOverrideMmioRegister.set(static_cast<int32_t>(dbgOffset));
debugManager.flags.AubDumpOverrideMmioRegisterValue.set(static_cast<int32_t>(dbgValue));
uint32_t offset = 0x2000;
uint32_t value = 0x3000;
MockAubFileStreamMockMmioWrite mockAubStream;
mockAubStream.writeMMIO(offset, value);
EXPECT_EQ(1u, mockAubStream.mmioList.size());
EXPECT_TRUE(mockAubStream.isOnMmioList(dbgMmio));
}
}

View File

@ -32,7 +32,6 @@ class AUBCommandStreamReceiverHw : public CommandStreamReceiverSimulatedHw<GfxFa
using CommandStreamReceiverSimulatedCommonHw<GfxFamily>::aubManager;
using CommandStreamReceiverSimulatedCommonHw<GfxFamily>::hardwareContextController;
using CommandStreamReceiverSimulatedCommonHw<GfxFamily>::engineInfo;
using CommandStreamReceiverSimulatedCommonHw<GfxFamily>::stream;
using CommandStreamReceiverSimulatedCommonHw<GfxFamily>::writeMemory;
SubmissionStatus flush(BatchBuffer &batchBuffer, ResidencyContainer &allocationsForResidency) override;
@ -60,7 +59,6 @@ class AUBCommandStreamReceiverHw : public CommandStreamReceiverSimulatedHw<GfxFa
WaitStatus waitForTaskCountWithKmdNotifyFallback(TaskCountType taskCountToWait, FlushStamp flushStampToWait, bool useQuickKmdSleep, QueueThrottle throttle) override;
uint32_t getDumpHandle();
MOCKABLE_VIRTUAL void addContextToken(uint32_t dumpHandle);
void dumpAllocation(GraphicsAllocation &gfxAllocation) override;
static CommandStreamReceiver *create(const std::string &fileName,
@ -90,7 +88,6 @@ class AUBCommandStreamReceiverHw : public CommandStreamReceiverSimulatedHw<GfxFa
std::unique_ptr<std::conditional<is64bit, PML4, PDPE>::type> ppgtt;
std::unique_ptr<PDPE> ggtt;
void addGUCStartMessage(uint64_t batchBufferAddress);
uint32_t getGUCWorkQueueItemHeader();
CommandStreamReceiverType getType() const override {

View File

@ -308,24 +308,9 @@ void AUBCommandStreamReceiverHw<GfxFamily>::makeNonResidentExternal(uint64_t gpu
}
}
}
template <typename GfxFamily>
void AUBCommandStreamReceiverHw<GfxFamily>::writeMemory(uint64_t gpuAddress, void *cpuAddress, size_t size, uint32_t memoryBank, uint64_t entryBits) {
UNRECOVERABLE_IF(!isEngineInitialized);
{
std::ostringstream str;
str << "ppgtt: " << std::hex << std::showbase << gpuAddress << " end address: " << gpuAddress + size << " cpu address: " << cpuAddress << " size: " << std::dec << size;
}
AubHelperHw<GfxFamily> aubHelperHw(this->isLocalMemoryEnabled());
PageWalker walker = [&](uint64_t physAddress, size_t size, size_t offset, uint64_t entryBits) {
AUB::reserveAddressGGTTAndWriteMmeory(*stream, static_cast<uintptr_t>(gpuAddress), cpuAddress, physAddress, size, offset, entryBits,
aubHelperHw);
};
ppgtt->pageWalk(static_cast<uintptr_t>(gpuAddress), size, 0, entryBits, walker, memoryBank);
}
template <typename GfxFamily>
@ -497,44 +482,4 @@ template <typename GfxFamily>
uint32_t AUBCommandStreamReceiverHw<GfxFamily>::getDumpHandle() {
return hashPtrToU32(this);
}
template <typename GfxFamily>
void AUBCommandStreamReceiverHw<GfxFamily>::addGUCStartMessage(uint64_t batchBufferAddress) {
typedef typename GfxFamily::MI_BATCH_BUFFER_START MI_BATCH_BUFFER_START;
auto bufferSize = sizeof(uint32_t) + sizeof(MI_BATCH_BUFFER_START);
AubHelperHw<GfxFamily> aubHelperHw(this->isLocalMemoryEnabled());
std::unique_ptr<void, std::function<void(void *)>> buffer(this->getMemoryManager()->alignedMallocWrapper(bufferSize, MemoryConstants::pageSize), [&](void *ptr) { this->getMemoryManager()->alignedFreeWrapper(ptr); });
LinearStream linearStream(buffer.get(), bufferSize);
uint32_t *header = static_cast<uint32_t *>(linearStream.getSpace(sizeof(uint32_t)));
*header = getGUCWorkQueueItemHeader();
MI_BATCH_BUFFER_START *miBatchBufferStartSpace = linearStream.getSpaceForCmd<MI_BATCH_BUFFER_START>();
DEBUG_BREAK_IF(bufferSize != linearStream.getUsed());
auto miBatchBufferStart = GfxFamily::cmdInitBatchBufferStart;
miBatchBufferStart.setBatchBufferStartAddress(AUB::ptrToPPGTT(buffer.get()));
miBatchBufferStart.setAddressSpaceIndicator(MI_BATCH_BUFFER_START::ADDRESS_SPACE_INDICATOR_PPGTT);
*miBatchBufferStartSpace = miBatchBufferStart;
auto physBufferAddres = ppgtt->map(reinterpret_cast<uintptr_t>(buffer.get()), bufferSize,
this->getPPGTTAdditionalBits(linearStream.getGraphicsAllocation()),
MemoryBanks::mainBank);
AUB::reserveAddressPPGTT(*stream, reinterpret_cast<uintptr_t>(buffer.get()), bufferSize, physBufferAddres,
this->getPPGTTAdditionalBits(linearStream.getGraphicsAllocation()),
aubHelperHw);
AUB::addMemoryWrite(
*stream,
physBufferAddres,
buffer.get(),
bufferSize,
this->getAddressSpace(AubMemDump::DataTypeHintValues::TraceNotype));
PatchInfoData patchInfoData(batchBufferAddress, 0u, PatchInfoAllocationType::defaultType, reinterpret_cast<uintptr_t>(buffer.get()), sizeof(uint32_t) + sizeof(MI_BATCH_BUFFER_START) - sizeof(uint64_t), PatchInfoAllocationType::gucStartMessage);
this->flatBatchBufferHelper->setPatchInfoData(patchInfoData);
}
} // namespace NEO

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2021 Intel Corporation
* Copyright (C) 2021-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@ -16,11 +16,6 @@ constexpr uint32_t AUBCommandStreamReceiverHw<GfxFamily>::getMaskAndValueForPoll
return 0x00008000;
}
template <typename GfxFamily>
void AUBCommandStreamReceiverHw<GfxFamily>::addContextToken(uint32_t dumpHandle) {
AUB::createContext(*stream, dumpHandle);
}
template <typename GfxFamily>
uint32_t AUBCommandStreamReceiverHw<GfxFamily>::getGUCWorkQueueItemHeader() {
if (EngineHelpers::isCcs(osContext->getEngineType())) {

View File

@ -43,13 +43,10 @@ class CommandStreamReceiverSimulatedCommonHw : public CommandStreamReceiverHw<Gf
uint64_t getGTTBits() const {
return 0u;
}
void initGlobalMMIO();
uint64_t getPPGTTAdditionalBits(GraphicsAllocation *gfxAllocation);
void getGTTData(void *memory, AubGTTData &data);
uint32_t getMemoryBankForGtt() const;
static const AubMemDump::LrcaHelper &getCsTraits(aub_stream::EngineType engineType);
void initEngineMMIO();
void submitLRCA(const MiContextDescriptorReg &contextDescriptor);
void setupContext(OsContext &osContext) override;
virtual bool expectMemoryEqual(void *gfxAddress, const void *srcAddress, size_t length);
virtual bool expectMemoryNotEqual(void *gfxAddress, const void *srcAddress, size_t length);
@ -87,7 +84,5 @@ class CommandStreamReceiverSimulatedCommonHw : public CommandStreamReceiverHw<Gf
size_t sizeRingBuffer;
uint32_t tailRingBuffer;
} engineInfo = {};
AubMemDump::AubStream *stream;
};
} // namespace NEO

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2021-2024 Intel Corporation
* Copyright (C) 2021-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@ -15,39 +15,6 @@
namespace NEO {
template <typename GfxFamily>
void CommandStreamReceiverSimulatedCommonHw<GfxFamily>::initGlobalMMIO() {
for (auto &mmioPair : AUBFamilyMapper<GfxFamily>::globalMMIO) {
stream->writeMMIO(mmioPair.first, mmioPair.second);
}
if (this->localMemoryEnabled) {
MMIOPair guCntl = {0x00101010, 0x00000080}; // GU_CNTL
stream->writeMMIO(guCntl.first, guCntl.second);
MMIOPair lmemCfg = {0x0000cf58, 0x80000000}; // LMEM_CFG
stream->writeMMIO(lmemCfg.first, lmemCfg.second);
MMIOPair tileAddrRange[] = {{0x00004900, 0x0001},
{0x00004904, 0x0001},
{0x00004908, 0x0001},
{0x0000490c, 0x0001}}; // XEHP_TILE_ADDR_RANGE
const uint32_t numberOfTiles = 4;
const uint32_t localMemorySizeGB = static_cast<uint32_t>(AubHelper::getPerTileLocalMemorySize(&this->peekHwInfo(), releaseHelper) / MemoryConstants::gigaByte);
uint32_t localMemoryBaseAddressInGB = 0x0;
for (uint32_t i = 0; i < numberOfTiles; i++) {
tileAddrRange[i].second |= localMemoryBaseAddressInGB << 1;
tileAddrRange[i].second |= localMemorySizeGB << 8;
stream->writeMMIO(tileAddrRange[i].first, tileAddrRange[i].second);
localMemoryBaseAddressInGB += localMemorySizeGB;
}
}
}
template <typename GfxFamily>
uint64_t CommandStreamReceiverSimulatedCommonHw<GfxFamily>::getPPGTTAdditionalBits(GraphicsAllocation *gfxAllocation) {
if (debugManager.flags.AUBDumpForceAllToLocalMemory.get() ||
@ -76,24 +43,4 @@ template <typename GfxFamily>
const AubMemDump::LrcaHelper &CommandStreamReceiverSimulatedCommonHw<GfxFamily>::getCsTraits(aub_stream::EngineType engineType) {
return *AUBFamilyMapper<GfxFamily>::csTraits[engineType];
}
template <typename GfxFamily>
void CommandStreamReceiverSimulatedCommonHw<GfxFamily>::initEngineMMIO() {
auto mmioList = AUBFamilyMapper<GfxFamily>::perEngineMMIO[osContext->getEngineType()];
DEBUG_BREAK_IF(!mmioList);
for (auto &mmioPair : *mmioList) {
stream->writeMMIO(mmioPair.first, mmioPair.second);
}
}
template <typename GfxFamily>
void CommandStreamReceiverSimulatedCommonHw<GfxFamily>::submitLRCA(const MiContextDescriptorReg &contextDescriptor) {
auto mmioBase = getCsTraits(osContext->getEngineType()).mmioBase;
stream->writeMMIO(AubMemDump::computeRegisterOffset(mmioBase, 0x2510), contextDescriptor.ulData[0]);
stream->writeMMIO(AubMemDump::computeRegisterOffset(mmioBase, 0x2514), contextDescriptor.ulData[1]);
// Load our new exec list
stream->writeMMIO(AubMemDump::computeRegisterOffset(mmioBase, 0x2550), 1);
}
} // namespace NEO

View File

@ -48,7 +48,6 @@ class TbxCommandStreamReceiverHw : public CommandStreamReceiverSimulatedHw<GfxFa
using CommandStreamReceiverSimulatedCommonHw<GfxFamily>::aubManager;
using CommandStreamReceiverSimulatedCommonHw<GfxFamily>::hardwareContextController;
using CommandStreamReceiverSimulatedCommonHw<GfxFamily>::engineInfo;
using CommandStreamReceiverSimulatedCommonHw<GfxFamily>::stream;
using CommandStreamReceiverSimulatedCommonHw<GfxFamily>::peekExecutionEnvironment;
using CommandStreamReceiverSimulatedCommonHw<GfxFamily>::writeMemory;

View File

@ -65,7 +65,6 @@ TbxCommandStreamReceiverHw<GfxFamily>::TbxCommandStreamReceiverHw(ExecutionEnvir
this->aubDeviceId = debugDeviceId == -1
? this->peekHwInfo().capabilityTable.aubDeviceId
: static_cast<uint32_t>(debugDeviceId);
this->stream = &tbxStream;
this->downloadAllocationImpl = [this](GraphicsAllocation &graphicsAllocation) {
this->downloadAllocationTbx(graphicsAllocation);
};
@ -231,7 +230,6 @@ CommandStreamReceiver *TbxCommandStreamReceiverHw<GfxFamily>::create(const std::
auto &rootDeviceEnvironment = *executionEnvironment.rootDeviceEnvironments[rootDeviceIndex];
auto &hwInfo = *rootDeviceEnvironment.getHardwareInfo();
auto &gfxCoreHelper = rootDeviceEnvironment.getHelper<GfxCoreHelper>();
const auto &productHelper = rootDeviceEnvironment.getHelper<ProductHelper>();
if (withAubDump) {
auto localMemoryEnabled = gfxCoreHelper.getEnableLocalMemory(hwInfo);
auto fullName = AUBCommandStreamReceiver::createFullFilePath(hwInfo, baseName, rootDeviceIndex);
@ -261,15 +259,6 @@ CommandStreamReceiver *TbxCommandStreamReceiverHw<GfxFamily>::create(const std::
} else {
csr = new TbxCommandStreamReceiverHw<GfxFamily>(executionEnvironment, rootDeviceIndex, deviceBitfield);
}
if (!csr->aubManager) {
// Open our stream
csr->stream->open(nullptr);
// Add the file header.
bool streamInitialized = csr->stream->init(productHelper.getAubStreamSteppingFromHwRevId(hwInfo), csr->aubDeviceId);
csr->streamInitialized = streamInitialized;
}
return csr;
}
@ -327,128 +316,8 @@ SubmissionStatus TbxCommandStreamReceiverHw<GfxFamily>::flush(BatchBuffer &batch
template <typename GfxFamily>
void TbxCommandStreamReceiverHw<GfxFamily>::submitBatchBufferTbx(uint64_t batchBufferGpuAddress, const void *batchBuffer, size_t batchBufferSize, uint32_t memoryBank, uint64_t entryBits, bool overrideRingHead) {
if (hardwareContextController) {
if (batchBufferSize) {
hardwareContextController->submit(batchBufferGpuAddress, batchBuffer, batchBufferSize, memoryBank, MemoryConstants::pageSize64k, overrideRingHead);
}
return;
}
auto csTraits = this->getCsTraits(osContext->getEngineType());
{
auto physBatchBuffer = ppgtt->map(static_cast<uintptr_t>(batchBufferGpuAddress), batchBufferSize, entryBits, memoryBank);
AubHelperHw<GfxFamily> aubHelperHw(this->localMemoryEnabled);
AUB::reserveAddressPPGTT(tbxStream, static_cast<uintptr_t>(batchBufferGpuAddress), batchBufferSize, physBatchBuffer,
entryBits, aubHelperHw);
AUB::addMemoryWrite(
tbxStream,
physBatchBuffer,
batchBuffer,
batchBufferSize,
this->getAddressSpace(AubMemDump::DataTypeHintValues::TraceBatchBufferPrimary),
AubMemDump::DataTypeHintValues::TraceBatchBufferPrimary);
}
// Add a batch buffer start to the RCS
auto previousTail = engineInfo.tailRingBuffer;
{
typedef typename GfxFamily::MI_LOAD_REGISTER_IMM MI_LOAD_REGISTER_IMM;
typedef typename GfxFamily::MI_BATCH_BUFFER_START MI_BATCH_BUFFER_START;
typedef typename GfxFamily::MI_NOOP MI_NOOP;
auto pTail = ptrOffset(engineInfo.pRingBuffer, engineInfo.tailRingBuffer);
auto ggttTail = ptrOffset(engineInfo.ggttRingBuffer, engineInfo.tailRingBuffer);
auto sizeNeeded =
sizeof(MI_BATCH_BUFFER_START) +
sizeof(MI_NOOP) +
sizeof(MI_LOAD_REGISTER_IMM);
if (engineInfo.tailRingBuffer + sizeNeeded >= engineInfo.sizeRingBuffer) {
// Pad the remaining ring with NOOPs
auto sizeToWrap = engineInfo.sizeRingBuffer - engineInfo.tailRingBuffer;
memset(pTail, 0, sizeToWrap);
// write remaining ring
auto physDumpStart = ggtt->map(ggttTail, sizeToWrap, this->getGTTBits(), this->getMemoryBankForGtt());
AUB::addMemoryWrite(
tbxStream,
physDumpStart,
pTail,
sizeToWrap,
this->getAddressSpace(AubMemDump::DataTypeHintValues::TraceCommandBuffer),
AubMemDump::DataTypeHintValues::TraceCommandBuffer);
previousTail = 0;
engineInfo.tailRingBuffer = 0;
pTail = engineInfo.pRingBuffer;
} else if (engineInfo.tailRingBuffer == 0) {
// Add a LRI if this is our first submission
auto lri = GfxFamily::cmdInitLoadRegisterImm;
lri.setRegisterOffset(AubMemDump::computeRegisterOffset(csTraits.mmioBase, 0x2244));
lri.setDataDword(0x00010000);
*(MI_LOAD_REGISTER_IMM *)pTail = lri;
pTail = ((MI_LOAD_REGISTER_IMM *)pTail) + 1;
}
// Add our BBS
auto bbs = GfxFamily::cmdInitBatchBufferStart;
bbs.setBatchBufferStartAddress(static_cast<uint64_t>(batchBufferGpuAddress));
bbs.setAddressSpaceIndicator(MI_BATCH_BUFFER_START::ADDRESS_SPACE_INDICATOR_PPGTT);
*(MI_BATCH_BUFFER_START *)pTail = bbs;
pTail = ((MI_BATCH_BUFFER_START *)pTail) + 1;
// Add a NOOP as our tail needs to be aligned to a QWORD
*(MI_NOOP *)pTail = GfxFamily::cmdInitNoop;
pTail = ((MI_NOOP *)pTail) + 1;
// Compute our new ring tail.
engineInfo.tailRingBuffer = (uint32_t)ptrDiff(pTail, engineInfo.pRingBuffer);
// Only dump the new commands
auto ggttDumpStart = ptrOffset(engineInfo.ggttRingBuffer, previousTail);
auto dumpStart = ptrOffset(engineInfo.pRingBuffer, previousTail);
auto dumpLength = engineInfo.tailRingBuffer - previousTail;
// write RCS
auto physDumpStart = ggtt->map(ggttDumpStart, dumpLength, this->getGTTBits(), this->getMemoryBankForGtt());
AUB::addMemoryWrite(
tbxStream,
physDumpStart,
dumpStart,
dumpLength,
this->getAddressSpace(AubMemDump::DataTypeHintValues::TraceCommandBuffer),
AubMemDump::DataTypeHintValues::TraceCommandBuffer);
// update the RCS mmio tail in the LRCA
auto physLRCA = ggtt->map(engineInfo.ggttLRCA, sizeof(engineInfo.tailRingBuffer), this->getGTTBits(), this->getMemoryBankForGtt());
AUB::addMemoryWrite(
tbxStream,
physLRCA + 0x101c,
&engineInfo.tailRingBuffer,
sizeof(engineInfo.tailRingBuffer),
this->getAddressSpace(AubMemDump::DataTypeHintValues::TraceNotype));
DEBUG_BREAK_IF(engineInfo.tailRingBuffer >= engineInfo.sizeRingBuffer);
}
// Submit our execlist by submitting to the execlist submit ports
{
typename AUB::MiContextDescriptorReg contextDescriptor = {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
contextDescriptor.sData.valid = true;
contextDescriptor.sData.forcePageDirRestore = false;
contextDescriptor.sData.forceRestore = false;
contextDescriptor.sData.legacy = true;
contextDescriptor.sData.faultSupport = 0;
contextDescriptor.sData.privilegeAccessOrPPGTT = true;
contextDescriptor.sData.aDor64bitSupport = AUB::Traits::addressingBits > 32;
auto ggttLRCA = engineInfo.ggttLRCA;
contextDescriptor.sData.logicalRingCtxAddress = ggttLRCA / 4096;
contextDescriptor.sData.contextID = 0;
this->submitLRCA(contextDescriptor);
if (hardwareContextController && batchBufferSize) {
hardwareContextController->submit(batchBufferGpuAddress, batchBuffer, batchBufferSize, memoryBank, MemoryConstants::pageSize64k, overrideRingHead);
}
}

View File

@ -22,11 +22,6 @@ constexpr uint32_t AUBCommandStreamReceiverHw<Family>::getMaskAndValueForPollFor
return 0x00008000;
}
template <>
void AUBCommandStreamReceiverHw<Family>::addContextToken(uint32_t dumpHandle) {
AUB::createContext(*stream, dumpHandle);
}
template <>
void populateFactoryTable<AUBCommandStreamReceiverHw<Family>>() {
extern AubCommandStreamReceiverCreateFunc aubCommandStreamReceiverFactory[IGFX_MAX_CORE];

View File

@ -10,13 +10,6 @@
namespace NEO {
typedef Gen12LpFamily Family;
template <typename GfxFamily>
void CommandStreamReceiverSimulatedCommonHw<GfxFamily>::initGlobalMMIO() {
for (auto &mmioPair : AUBFamilyMapper<GfxFamily>::globalMMIO) {
stream->writeMMIO(mmioPair.first, mmioPair.second);
}
}
template <typename GfxFamily>
uint32_t CommandStreamReceiverSimulatedCommonHw<GfxFamily>::getMemoryBankForGtt() const {
return MemoryBanks::getBank(getDeviceIndex());
@ -27,28 +20,6 @@ const AubMemDump::LrcaHelper &CommandStreamReceiverSimulatedCommonHw<GfxFamily>:
return *AUBFamilyMapper<GfxFamily>::csTraits[engineType];
}
template <typename GfxFamily>
void CommandStreamReceiverSimulatedCommonHw<GfxFamily>::initEngineMMIO() {
auto mmioList = AUBFamilyMapper<GfxFamily>::perEngineMMIO[osContext->getEngineType()];
DEBUG_BREAK_IF(!mmioList);
for (auto &mmioPair : *mmioList) {
stream->writeMMIO(mmioPair.first, mmioPair.second);
}
}
template <>
void CommandStreamReceiverSimulatedCommonHw<Family>::initGlobalMMIO() {
for (auto &mmioPair : AUBFamilyMapper<Family>::globalMMIO) {
stream->writeMMIO(mmioPair.first, mmioPair.second);
}
if (this->isLocalMemoryEnabled()) {
MMIOPair lmemCfg = {0x0000cf58, 0x80000000}; // LMEM_CFG
stream->writeMMIO(lmemCfg.first, lmemCfg.second);
}
}
template <>
uint64_t CommandStreamReceiverSimulatedCommonHw<Family>::getPPGTTAdditionalBits(GraphicsAllocation *gfxAllocation) {
return BIT(PageTableEntry::presentBit) | BIT(PageTableEntry::writableBit) |
@ -63,15 +34,5 @@ void CommandStreamReceiverSimulatedCommonHw<Family>::getGTTData(void *memory, Au
data.localMemory = this->isLocalMemoryEnabled();
}
template <>
void CommandStreamReceiverSimulatedCommonHw<Family>::submitLRCA(const MiContextDescriptorReg &contextDescriptor) {
auto mmioBase = getCsTraits(osContext->getEngineType()).mmioBase;
stream->writeMMIO(AubMemDump::computeRegisterOffset(mmioBase, 0x2510), contextDescriptor.ulData[0]);
stream->writeMMIO(AubMemDump::computeRegisterOffset(mmioBase, 0x2514), contextDescriptor.ulData[1]);
// Load our new exec list
stream->writeMMIO(AubMemDump::computeRegisterOffset(mmioBase, 0x2550), 1);
}
template class CommandStreamReceiverSimulatedCommonHw<Family>;
} // namespace NEO

View File

@ -28,16 +28,6 @@ struct MockAubFileStreamMockMmioWrite : public AubMemDump::AubFileStream {
void writeMMIOImpl(uint32_t offset, uint32_t value) override {
mmioList.push_back(std::make_pair(offset, value));
}
bool isOnMmioList(const MMIOPair &mmio) {
bool mmioFound = false;
for (auto &mmioPair : mmioList) {
if (mmioPair.first == mmio.first && mmioPair.second == mmio.second) {
mmioFound = true;
break;
}
}
return mmioFound;
}
std::vector<std::pair<uint32_t, uint32_t>> mmioList;
};

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2021-2024 Intel Corporation
* Copyright (C) 2021-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@ -139,8 +139,6 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, XeHPAndLaterAubCommandStreamReceiverTests, givenAub
debugManager.flags.AUBDumpForceAllToLocalMemory.set(true);
std::unique_ptr<MockAubCsrXeHPAndLater<FamilyType>> aubCsr(new MockAubCsrXeHPAndLater<FamilyType>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()));
auto stream = std::make_unique<MockAubFileStreamMockMmioWrite>();
aubCsr->stream = stream.get();
auto addressSpace = aubCsr->getAddressSpace(AubMemDump::DataTypeHintValues::TraceNotype);
@ -154,50 +152,15 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, XeHPAndLaterAubCommandStreamReceiverTests, givenAub
debugManager.flags.AUBDumpForceAllToLocalMemory.set(false);
std::unique_ptr<MockAubCsrXeHPAndLater<FamilyType>> aubCsr(new MockAubCsrXeHPAndLater<FamilyType>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()));
auto stream = std::make_unique<MockAubFileStreamMockMmioWrite>();
aubCsr->stream = stream.get();
auto addressSpace = aubCsr->getAddressSpace(AubMemDump::DataTypeHintValues::TraceNotype);
EXPECT_EQ(AubMemDump::AddressSpaceValues::TraceNonlocal, addressSpace);
}
HWCMDTEST_F(IGFX_XE_HP_CORE, XeHPAndLaterAubCommandStreamReceiverTests, givenCCSEnabledWhenEngineMmiosAreInitializedThenExpectL3ConfigMmioIsWritten) {
setUpImpl<FamilyType>();
MockOsContext osContext(0, EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_CCS, EngineUsage::regular}));
AUBCommandStreamReceiverHw<FamilyType> aubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield());
aubCsr.setupContext(osContext);
auto stream = std::make_unique<MockAubFileStreamMockMmioWrite>();
aubCsr.stream = stream.get();
aubCsr.initEngineMMIO();
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0xB234, 0xA0000000u)));
}
HWCMDTEST_F(IGFX_XE_HP_CORE, XeHPAndLaterAubCommandStreamReceiverTests, givenRCSEnabledWhenEngineMmiosAreInitializedThenExpectL3ConfigMmioIsWritten) {
setUpImpl<FamilyType>();
MockOsContext osContext(0, EngineDescriptorHelper::getDefaultDescriptor());
AUBCommandStreamReceiverHw<FamilyType> aubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield());
aubCsr.setupContext(osContext);
auto stream = std::make_unique<MockAubFileStreamMockMmioWrite>();
aubCsr.stream = stream.get();
aubCsr.initEngineMMIO();
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0xB134, 0xA0000000u)));
}
HWCMDTEST_F(IGFX_XE_HP_CORE, XeHPAndLaterAubCommandStreamReceiverTests, givenLocaLMemoryBitWhenGetAddressSpaceFromPTEBitsIsCalledThenTraceLocalIsReturned) {
setUpImpl<FamilyType>();
std::unique_ptr<MockAubCsrXeHPAndLater<FamilyType>> aubCsr(new MockAubCsrXeHPAndLater<FamilyType>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()));
auto stream = std::make_unique<MockAubFileStreamMockMmioWrite>();
aubCsr->stream = stream.get();
uint64_t bits = BIT(PageTableEntry::presentBit) | BIT(PageTableEntry::writableBit) | BIT(PageTableEntry::localMemoryBit);
auto addressSpace = aubCsr->getAddressSpaceFromPTEBits(bits);
@ -254,48 +217,6 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, XeHPAndLaterAubCommandStreamReceiverTests, whenPhys
EXPECT_EQ(4u, allocator->getNumberOfBanks());
}
HWCMDTEST_F(IGFX_XE_HP_CORE, XeHPAndLaterAubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenInitEngineMMIOIsCalledForGivenEngineTypeThenCorrespondingMmiosAreInitialized) {
setUpImpl<FamilyType>();
DebugManagerStateRestore debugRestorer;
MockOsContext rcsOsContext(0, EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_RCS, EngineUsage::regular}));
MockOsContext ccs0OsContext(0, EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_CCS, EngineUsage::regular}));
MockOsContext ccs1OsContext(0, EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_CCS1, EngineUsage::regular}));
MockOsContext ccs2OsContext(0, EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_CCS2, EngineUsage::regular}));
MockOsContext ccs3OsContext(0, EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_CCS3, EngineUsage::regular}));
auto aubCsr = std::make_unique<AUBCommandStreamReceiverHw<FamilyType>>("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield());
EXPECT_NE(nullptr, aubCsr);
auto stream = std::make_unique<MockAubFileStreamMockMmioWrite>();
aubCsr->stream = stream.get();
aubCsr->setupContext(rcsOsContext);
aubCsr->initEngineMMIO();
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0002000 + 0x000058, 0x00000000)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0002000 + 0x00029c, 0xffff8280)));
aubCsr->setupContext(ccs0OsContext);
aubCsr->initEngineMMIO();
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000ce90, 0x00030003)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x1a000 + 0x000029c, 0xffff8280)));
aubCsr->setupContext(ccs1OsContext);
aubCsr->initEngineMMIO();
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000ce90, 0x00030003)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x1c000 + 0x000029c, 0xffff8280)));
aubCsr->setupContext(ccs2OsContext);
aubCsr->initEngineMMIO();
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000ce90, 0x00030003)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x1e000 + 0x000029c, 0xffff8280)));
aubCsr->setupContext(ccs3OsContext);
aubCsr->initEngineMMIO();
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000ce90, 0x00030003)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x26000 + 0x000029c, 0xffff8280)));
}
template <class FamilyType>
static void checkCcsEngineMMIO(aub_stream::EngineType engineType, uint32_t mmioBase) {
auto &mmioList = *AUBFamilyMapper<FamilyType>::perEngineMMIO[engineType];

View File

@ -222,35 +222,6 @@ HWTEST_F(AubFileStreamWithoutAubStreamTests, givenAubCommandStreamReceiverWhenCa
EXPECT_TRUE(aubCsr->pollForCompletionCalled);
}
HWTEST_F(AubFileStreamWithoutAubStreamTests, givenNoNewTasksSinceLastPollWhenCallingPollForCompletionThenDontCallRegisterPoll) {
auto aubStream = std::make_unique<MockAubFileStream>();
auto aubExecutionEnvironment = getEnvironment<MockAubCsr<FamilyType>>(true, true, true);
auto aubCsr = aubExecutionEnvironment->template getCsr<MockAubCsr<FamilyType>>();
aubCsr->stream = aubStream.get();
aubCsr->latestSentTaskCount = 50;
aubCsr->pollForCompletionTaskCount = 50;
ASSERT_FALSE(aubStream->registerPollCalled);
aubCsr->pollForCompletion();
EXPECT_FALSE(aubStream->registerPollCalled);
EXPECT_EQ(50u, aubCsr->pollForCompletionTaskCount);
}
HWTEST_F(AubFileStreamWithoutAubStreamTests, givenNoNewTaskSinceLastPollWhenDeletingAubCsrThenDontCallRegisterPoll) {
auto aubStream = std::make_unique<MockAubFileStream>();
auto aubExecutionEnvironment = getEnvironment<MockAubCsr<FamilyType>>(true, true, true);
auto aubCsr = aubExecutionEnvironment->template getCsr<MockAubCsr<FamilyType>>();
aubCsr->stream = aubStream.get();
aubCsr->latestSentTaskCount = 50;
aubCsr->pollForCompletionTaskCount = 50;
ASSERT_FALSE(aubStream->registerPollCalled);
aubExecutionEnvironment->commandStreamReceiver.reset();
EXPECT_FALSE(aubStream->registerPollCalled);
}
HWTEST_F(AubCsrTests, givenNewTasksAndHardwareContextPresentWhenCallingPollForCompletionThenCallPollForCompletion) {
MockAubCsr<FamilyType> aubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield());
MockOsContext osContext(0, EngineDescriptorHelper::getDefaultDescriptor());
@ -279,29 +250,6 @@ HWTEST_F(AubCsrTests, givenNoNewTasksAndHardwareContextPresentWhenCallingPollFor
EXPECT_FALSE(hardwareContext->pollForCompletionCalled);
}
HWTEST_F(AubFileStreamWithoutAubStreamTests, givenAubCommandStreamReceiverInSubCaptureModeWhenPollForCompletionIsCalledButSubCaptureIsDisabledThenItShouldntCallRegisterPoll) {
DebugManagerStateRestore stateRestore;
AubSubCaptureCommon aubSubCaptureCommon;
auto aubSubCaptureManagerMock = new AubSubCaptureManagerMock("", aubSubCaptureCommon);
auto aubStream = std::make_unique<MockAubFileStream>();
auto aubExecutionEnvironment = getEnvironment<MockAubCsr<FamilyType>>(true, true, true);
auto aubCsr = aubExecutionEnvironment->template getCsr<MockAubCsr<FamilyType>>();
aubCsr->stream = aubStream.get();
aubSubCaptureCommon.subCaptureMode = AubSubCaptureManager::SubCaptureMode::toggle;
aubSubCaptureManagerMock->disableSubCapture();
aubCsr->subCaptureManager = std::unique_ptr<AubSubCaptureManagerMock>(aubSubCaptureManagerMock);
ASSERT_FALSE(aubCsr->subCaptureManager->isSubCaptureEnabled());
aubCsr->latestSentTaskCount = 50;
aubCsr->pollForCompletionTaskCount = 49;
ASSERT_FALSE(aubStream->registerPollCalled);
aubCsr->pollForCompletion();
EXPECT_FALSE(aubStream->registerPollCalled);
}
HWTEST_F(AubCsrTests, givenAubCommandStreamReceiverWithHardwareContextInSubCaptureModeWhenPollForCompletionIsCalledAndSubCaptureIsEnabledThenItShouldCallPollForCompletionOnHwContext) {
DebugManagerStateRestore stateRestore;
AubSubCaptureCommon aubSubCaptureCommon;

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2021-2024 Intel Corporation
* Copyright (C) 2021-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@ -18,178 +18,6 @@
using XeHPAndLaterMockSimulatedCsrHwTests = Test<DeviceFixture>;
HWCMDTEST_F(IGFX_XE_HP_CORE, XeHPAndLaterMockSimulatedCsrHwTests, givenLocalMemoryEnabledWhenGlobalMmiosAreInitializedThenLmemIsInitializedAndLmemCfgMmioIsWritten) {
std::unique_ptr<MockSimulatedCsrHw<FamilyType>> csrSimulatedCommonHw(new MockSimulatedCsrHw<FamilyType>(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()));
csrSimulatedCommonHw->localMemoryEnabled = true;
auto stream = std::make_unique<MockAubStreamMockMmioWrite>();
csrSimulatedCommonHw->stream = stream.get();
csrSimulatedCommonHw->initGlobalMMIO();
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x00101010, 0x00000080u)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000cf58, 0x80000000u)));
}
HWCMDTEST_F(IGFX_XE_HP_CORE, XeHPAndLaterMockSimulatedCsrHwTests, givenAUBDumpForceAllToLocalMemoryWhenGlobalMmiosAreInitializedThenLmemIsInitializedAndLmemCfgMmioIsWritten) {
DebugManagerStateRestore debugRestorer;
debugManager.flags.AUBDumpForceAllToLocalMemory.set(true);
std::unique_ptr<MockSimulatedCsrHw<FamilyType>> csrSimulatedCommonHw(new MockSimulatedCsrHw<FamilyType>(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()));
auto stream = std::make_unique<MockAubStreamMockMmioWrite>();
csrSimulatedCommonHw->stream = stream.get();
csrSimulatedCommonHw->initGlobalMMIO();
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x00101010, 0x00000080u)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000cf58, 0x80000000u)));
}
HWCMDTEST_F(IGFX_XE_HP_CORE, XeHPAndLaterMockSimulatedCsrHwTests, givenAubCommandStreamReceiverWhenGlobalMmiosAreInitializedThenMOCSRegistersAreConfigured) {
MockSimulatedCsrHw<FamilyType> csrSimulatedCommonHw(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield());
auto stream = std::make_unique<MockAubStreamMockMmioWrite>();
csrSimulatedCommonHw.stream = stream.get();
csrSimulatedCommonHw.initGlobalMMIO();
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x00004000, 0x00000008)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x00004004, 0x00000038)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x00004008, 0x00000038)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000400C, 0x00000008)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x00004010, 0x00000018)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x00004014, 0x00060038)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x00004018, 0x00000000)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000401C, 0x00000033)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x00004020, 0x00060037)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x00004024, 0x0000003B)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x00004028, 0x00000032)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000402C, 0x00000036)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x00004030, 0x0000003A)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x00004034, 0x00000033)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x00004038, 0x00000037)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000403C, 0x0000003B)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x00004040, 0x00000030)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x00004044, 0x00000034)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x00004048, 0x00000038)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000404C, 0x00000031)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x00004050, 0x00000032)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x00004054, 0x00000036)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x00004058, 0x0000003A)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000405C, 0x00000033)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x00004060, 0x00000037)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x00004064, 0x0000003B)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x00004068, 0x00000032)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000406C, 0x00000036)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x00004070, 0x0000003A)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x00004074, 0x00000033)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x00004078, 0x00000037)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000407C, 0x0000003B)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x00004080, 0x00000030)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x00004084, 0x00000034)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x00004088, 0x00000038)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000408C, 0x00000031)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x00004090, 0x00000032)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x00004094, 0x00000036)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x00004098, 0x0000003A)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000409C, 0x00000033)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x000040A0, 0x00000037)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x000040A4, 0x0000003B)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x000040A8, 0x00000032)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x000040AC, 0x00000036)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x000040B0, 0x0000003A)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x000040B4, 0x00000033)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x000040B8, 0x00000037)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x000040BC, 0x0000003B)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x000040C0, 0x00000038)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x000040C4, 0x00000034)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x000040C8, 0x00000038)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x000040CC, 0x00000031)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x000040D0, 0x00000032)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x000040D4, 0x00000036)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x000040D8, 0x0000003A)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x000040DC, 0x00000033)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x000040E0, 0x00000037)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x000040E4, 0x0000003B)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x000040E8, 0x00000032)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x000040EC, 0x00000036)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x000040F0, 0x00000038)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x000040F4, 0x00000038)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x000040F8, 0x00000038)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x000040FC, 0x00000038)));
}
HWCMDTEST_F(IGFX_XE_HP_CORE, XeHPAndLaterMockSimulatedCsrHwTests, givenAubCommandStreamReceiverWhenGlobalMmiosAreInitializedThenLNCFRegistersAreConfigured) {
MockSimulatedCsrHw<FamilyType> csrSimulatedCommonHw(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield());
auto stream = std::make_unique<MockAubStreamMockMmioWrite>();
csrSimulatedCommonHw.stream = stream.get();
csrSimulatedCommonHw.initGlobalMMIO();
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000B020, 0x00300010)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000B024, 0x00300010)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000B028, 0x00300030)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000B02C, 0x00000000)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000B030, 0x0030001F)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000B034, 0x00170013)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000B038, 0x0000001F)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000B03C, 0x00000000)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000B040, 0x00100000)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000B044, 0x00170013)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000B048, 0x0010001F)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000B04C, 0x00170013)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000B050, 0x0030001F)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000B054, 0x00170013)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000B058, 0x0000001F)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000B05C, 0x00000000)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000B060, 0x00100000)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000B064, 0x00170013)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000B068, 0x0010001F)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000B06C, 0x00170013)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000B070, 0x0030001F)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000B074, 0x00170013)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000B078, 0x0000001F)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000B07C, 0x00000000)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000B080, 0x00300030)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000B084, 0x00170013)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000B088, 0x0010001F)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000B08C, 0x00170013)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000B090, 0x0030001F)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000B094, 0x00170013)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000B098, 0x00300010)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000B09C, 0x00300010)));
}
HWCMDTEST_F(IGFX_XE_HP_CORE, XeHPAndLaterMockSimulatedCsrHwTests, givenAubCommandStreamReceiverWhenGlobalMmiosAreInitializedThenPerfMmioRegistersAreConfigured) {
MockSimulatedCsrHw<FamilyType> csrSimulatedCommonHw(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield());
auto stream = std::make_unique<MockAubStreamMockMmioWrite>();
csrSimulatedCommonHw.stream = stream.get();
csrSimulatedCommonHw.initGlobalMMIO();
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000B004, 0x2FC0100B)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000B404, 0x00000160)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x00008708, 0x00000000)));
}
HWCMDTEST_F(IGFX_XE_HP_CORE, XeHPAndLaterMockSimulatedCsrHwTests, givenAubCommandStreamReceiverWhenGlobalMmiosAreInitializedThenTRTTRegistersAreConfigured) {
MockSimulatedCsrHw<FamilyType> csrSimulatedCommonHw(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield());
auto stream = std::make_unique<MockAubStreamMockMmioWrite>();
csrSimulatedCommonHw.stream = stream.get();
csrSimulatedCommonHw.initGlobalMMIO();
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x00004410, 0xffffffff)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x00004414, 0xfffffffe)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x00004404, 0x000000ff)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x00004408, 0x00000000)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000440C, 0x00000000)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x00004400, 0x00000001)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x00004DFC, 0x00000000)));
}
class XeHPAndLaterTileRangeRegisterTest : public DeviceFixture, public ::testing::Test {
public:
template <typename FamilyType>
@ -208,73 +36,5 @@ class XeHPAndLaterTileRangeRegisterTest : public DeviceFixture, public ::testing
DeviceFixture::tearDown();
}
void checkMMIOs(MMIOList &list, uint32_t tilesNumber) {
const uint32_t numberOfTiles = tilesNumber;
const uint32_t totalLocalMemorySizeGB = static_cast<uint32_t>(AubHelper::getTotalMemBankSize(releaseHelper.get()) / MemoryConstants::gigaByte);
MMIOPair tileAddrRegisters[] = {{0x00004900, 0x0001},
{0x00004904, 0x0001},
{0x00004908, 0x0001},
{0x0000490c, 0x0001}};
uint32_t localMemoryBase = 0x0;
for (uint32_t i = 0; i < sizeof(tileAddrRegisters) / sizeof(MMIOPair); i++) {
tileAddrRegisters[i].second |= localMemoryBase << 1;
tileAddrRegisters[i].second |= (totalLocalMemorySizeGB / numberOfTiles) << 8;
localMemoryBase += (totalLocalMemorySizeGB / numberOfTiles);
}
uint32_t mmiosFound = 0;
for (auto &mmioPair : list) {
for (uint32_t i = 0; i < numberOfTiles; i++) {
if (mmioPair.first == tileAddrRegisters[i].first && mmioPair.second == tileAddrRegisters[i].second) {
mmiosFound++;
}
}
}
EXPECT_EQ(numberOfTiles, mmiosFound);
}
std::unique_ptr<ReleaseHelper> releaseHelper;
};
HWCMDTEST_F(IGFX_XE_HP_CORE, XeHPAndLaterTileRangeRegisterTest, givenLocalMemoryEnabledWhenGlobalMmiosAreInitializedThenTileRangeRegistersAreProgrammed) {
setUpImpl<FamilyType>();
std::unique_ptr<MockSimulatedCsrHw<FamilyType>> csrSimulatedCommonHw(new MockSimulatedCsrHw<FamilyType>(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()));
csrSimulatedCommonHw->localMemoryEnabled = true;
auto stream = std::make_unique<MockAubStreamMockMmioWrite>();
csrSimulatedCommonHw->stream = stream.get();
csrSimulatedCommonHw->initGlobalMMIO();
checkMMIOs(stream->mmioList, 1);
}
HWCMDTEST_F(IGFX_XE_HP_CORE, XeHPAndLaterTileRangeRegisterTest, givenLocalMemoryEnabledAnd4TileConfigWhenGlobalMmiosAreInitializedThenTileRangeRegistersAreProgrammed) {
DebugManagerStateRestore restorer;
debugManager.flags.CreateMultipleSubDevices.set(4);
setUpImpl<FamilyType>();
std::unique_ptr<MockSimulatedCsrHw<FamilyType>> csrSimulatedCommonHw(new MockSimulatedCsrHw<FamilyType>(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()));
csrSimulatedCommonHw->localMemoryEnabled = true;
auto stream = std::make_unique<MockAubStreamMockMmioWrite>();
csrSimulatedCommonHw->stream = stream.get();
csrSimulatedCommonHw->initGlobalMMIO();
checkMMIOs(stream->mmioList, 4);
}
HWCMDTEST_F(IGFX_XE_HP_CORE, XeHPAndLaterTileRangeRegisterTest, givenAUBDumpForceAllToLocalMemoryWhenGlobalMmiosAreInitializedThenTileRangeRegistersAreProgrammed) {
setUpImpl<FamilyType>();
DebugManagerStateRestore debugRestorer;
debugManager.flags.AUBDumpForceAllToLocalMemory.set(true);
std::unique_ptr<MockSimulatedCsrHw<FamilyType>> csrSimulatedCommonHw(new MockSimulatedCsrHw<FamilyType>(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield()));
csrSimulatedCommonHw->localMemoryEnabled = true;
auto stream = std::make_unique<MockAubStreamMockMmioWrite>();
csrSimulatedCommonHw->stream = stream.get();
csrSimulatedCommonHw->initGlobalMMIO();
checkMMIOs(stream->mmioList, 1);
}

View File

@ -10,7 +10,6 @@ if(TESTS_GEN12LP)
${CMAKE_CURRENT_SOURCE_DIR}/aub_command_stream_receiver_tests_gen12lp.inl
${CMAKE_CURRENT_SOURCE_DIR}/coherency_tests_gen12lp.inl
${CMAKE_CURRENT_SOURCE_DIR}/command_encoder_tests_gen12lp.cpp
${CMAKE_CURRENT_SOURCE_DIR}/command_stream_receiver_simulated_common_hw_tests_gen12lp.inl
${CMAKE_CURRENT_SOURCE_DIR}/compute_mode_tests_gen12lp.inl
${CMAKE_CURRENT_SOURCE_DIR}/excludes_gen12lp.cpp
${CMAKE_CURRENT_SOURCE_DIR}/gen12lp_shared_tests_wrapper.cpp

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2019-2023 Intel Corporation
* Copyright (C) 2019-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@ -46,29 +46,3 @@ GEN12LPTEST_F(Gen12LPAubCommandStreamReceiverTests, givenGraphicsAlloctionWithLo
EXPECT_EQ(expectedBits, bits);
}
GEN12LPTEST_F(Gen12LPAubCommandStreamReceiverTests, givenCCSEnabledWhenEngineMmiosAreInitializedThenExpectL3ConfigMmioIsWritten) {
MockOsContext osContext(0, EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_CCS, EngineUsage::regular}));
AUBCommandStreamReceiverHw<FamilyType> aubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield());
aubCsr.setupContext(osContext);
auto stream = std::make_unique<MockAubFileStreamMockMmioWrite>();
aubCsr.stream = stream.get();
aubCsr.initEngineMMIO();
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0xB234, 0xD0000020u)));
}
GEN12LPTEST_F(Gen12LPAubCommandStreamReceiverTests, givenRCSEnabledWhenEngineMmiosAreInitializedThenExpectL3ConfigMmioIsWritten) {
MockOsContext osContext(0, EngineDescriptorHelper::getDefaultDescriptor());
AUBCommandStreamReceiverHw<FamilyType> aubCsr("", true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield());
aubCsr.setupContext(osContext);
auto stream = std::make_unique<MockAubFileStreamMockMmioWrite>();
aubCsr.stream = stream.get();
aubCsr.initEngineMMIO();
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0xB134, 0xD0000020u)));
}

View File

@ -1,146 +0,0 @@
/*
* Copyright (C) 2019-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/command_stream/command_stream_receiver_simulated_hw.h"
#include "shared/test/common/fixtures/device_fixture.h"
#include "shared/test/common/helpers/debug_manager_state_restore.h"
#include "shared/test/common/test_macros/header/per_product_test_definitions.h"
#include "shared/test/common/test_macros/test.h"
#include "shared/test/unit_test/mocks/mock_aub_stream.h"
#include "shared/test/unit_test/mocks/mock_csr_simulated_common_hw.h"
using namespace NEO;
using Gen12LPCommandStreamReceiverSimulatedCommonHwTests = Test<DeviceFixture>;
GEN12LPTEST_F(Gen12LPCommandStreamReceiverSimulatedCommonHwTests, givenAubCommandStreamReceiverWhewGlobalMmiosAreInitializedThenMOCSRegistersAreConfigured) {
MockSimulatedCsrHw<FamilyType> csrSimulatedCommonHw(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield());
auto stream = std::make_unique<MockAubStreamMockMmioWrite>();
csrSimulatedCommonHw.stream = stream.get();
csrSimulatedCommonHw.initGlobalMMIO();
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x00004000, 0x00000008)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x00004004, 0x00000038)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x00004008, 0x00000038)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000400C, 0x00000008)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x00004010, 0x00000018)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x00004014, 0x00060038)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x00004018, 0x00000000)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000401C, 0x00000033)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x00004020, 0x00060037)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x00004024, 0x0000003B)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x00004028, 0x00000032)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000402C, 0x00000036)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x00004030, 0x0000003A)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x00004034, 0x00000033)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x00004038, 0x00000037)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000403C, 0x0000003B)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x00004040, 0x00000030)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x00004044, 0x00000034)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x00004048, 0x00000038)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000404C, 0x00000031)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x00004050, 0x00000032)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x00004054, 0x00000036)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x00004058, 0x0000003A)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000405C, 0x00000033)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x00004060, 0x00000037)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x00004064, 0x0000003B)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x00004068, 0x00000032)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000406C, 0x00000036)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x00004070, 0x0000003A)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x00004074, 0x00000033)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x00004078, 0x00000037)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000407C, 0x0000003B)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x00004080, 0x00000030)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x00004084, 0x00000034)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x00004088, 0x00000038)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000408C, 0x00000031)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x00004090, 0x00000032)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x00004094, 0x00000036)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x00004098, 0x0000003A)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000409C, 0x00000033)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x000040A0, 0x00000037)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x000040A4, 0x0000003B)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x000040A8, 0x00000032)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x000040AC, 0x00000036)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x000040B0, 0x0000003A)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x000040B4, 0x00000033)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x000040B8, 0x00000037)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x000040BC, 0x0000003B)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x000040C0, 0x00000038)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x000040C4, 0x00000034)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x000040C8, 0x00000038)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x000040CC, 0x00000031)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x000040D0, 0x00000032)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x000040D4, 0x00000036)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x000040D8, 0x0000003A)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x000040DC, 0x00000033)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x000040E0, 0x00000037)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x000040E4, 0x0000003B)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x000040E8, 0x00000032)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x000040EC, 0x00000036)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x000040F0, 0x00000038)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x000040F4, 0x00000038)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x000040F8, 0x00000038)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x000040FC, 0x00000038)));
}
GEN12LPTEST_F(Gen12LPCommandStreamReceiverSimulatedCommonHwTests, givenAubCommandStreamReceiverWhenGlobalMmiosAreInitializedThenLNCFRegistersAreConfigured) {
MockSimulatedCsrHw<FamilyType> csrSimulatedCommonHw(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield());
auto stream = std::make_unique<MockAubStreamMockMmioWrite>();
csrSimulatedCommonHw.stream = stream.get();
csrSimulatedCommonHw.initGlobalMMIO();
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000B020, 0x00300010)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000B024, 0x00300010)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000B028, 0x00300030)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000B02C, 0x00000000)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000B030, 0x0030001F)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000B034, 0x00170013)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000B038, 0x0000001F)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000B03C, 0x00000000)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000B040, 0x00100000)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000B044, 0x00170013)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000B048, 0x0010001F)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000B04C, 0x00170013)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000B050, 0x0030001F)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000B054, 0x00170013)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000B058, 0x0000001F)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000B05C, 0x00000000)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000B060, 0x00100000)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000B064, 0x00170013)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000B068, 0x0010001F)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000B06C, 0x00170013)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000B070, 0x0030001F)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000B074, 0x00170013)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000B078, 0x0000001F)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000B07C, 0x00000000)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000B080, 0x00000030)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000B084, 0x00170013)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000B088, 0x0010001F)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000B08C, 0x00170013)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000B090, 0x0030001F)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000B094, 0x00170013)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000B098, 0x00300010)));
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000B09C, 0x00300010)));
}
GEN12LPTEST_F(Gen12LPCommandStreamReceiverSimulatedCommonHwTests, givenLocalMemoryEnabledWhenGlobalMmiosAreInitializedThenLmemCfgMmioIsWritten) {
MockSimulatedCsrHw<FamilyType> csrSimulatedCommonHw(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield());
csrSimulatedCommonHw.localMemoryEnabled = true;
auto stream = std::make_unique<MockAubStreamMockMmioWrite>();
csrSimulatedCommonHw.stream = stream.get();
csrSimulatedCommonHw.initGlobalMMIO();
EXPECT_TRUE(stream->isOnMmioList(MMIOPair(0x0000CF58, 0x80000000)));
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2021-2024 Intel Corporation
* Copyright (C) 2021-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@ -7,7 +7,6 @@
#include "shared/test/unit_test/gen12lp/aub_command_stream_receiver_tests_gen12lp.inl"
#include "shared/test/unit_test/gen12lp/coherency_tests_gen12lp.inl"
#include "shared/test/unit_test/gen12lp/command_stream_receiver_simulated_common_hw_tests_gen12lp.inl"
#include "shared/test/unit_test/gen12lp/compute_mode_tests_gen12lp.inl"
#include "shared/test/unit_test/gen12lp/tbx_command_stream_receiver_tests_gen12lp.inl"
#include "shared/test/unit_test/gen12lp/test_device_caps_gen12lp.inl"

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2022 Intel Corporation
* Copyright (C) 2018-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@ -25,16 +25,6 @@ struct MockAubStreamMockMmioWrite : AubMemDump::AubStream {
void writeMMIOImpl(uint32_t offset, uint32_t value) override {
mmioList.push_back(std::make_pair(offset, value));
}
bool isOnMmioList(const MMIOPair &mmio) {
bool mmioFound = false;
for (auto &mmioPair : mmioList) {
if (mmioPair.first == mmio.first && mmioPair.second == mmio.second) {
mmioFound = true;
break;
}
}
return mmioFound;
}
std::vector<std::pair<uint32_t, uint32_t>> mmioList;
};