Sip programming changes

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
Mateusz Hoppe 2020-12-10 19:05:25 +00:00 committed by Compute-Runtime-Automation
parent 10f06bb942
commit 0747cb80f5
7 changed files with 50 additions and 6 deletions

View File

@ -140,6 +140,7 @@ HWTEST_F(L0DebuggerTest, givenDebuggingEnabledWhenCommandListIsExecutedThenValid
EXPECT_EQ(0u, debugModeRegisterCount);
EXPECT_EQ(0u, tdDebugControlRegisterCount);
if (!HwHelper::get(hwInfo.platform.eRenderCoreFamily).isSipWANeeded(hwInfo)) {
auto stateSipCmds = findAll<STATE_SIP *>(cmdList.begin(), cmdList.end());
ASSERT_EQ(1u, stateSipCmds.size());
@ -148,6 +149,7 @@ HWTEST_F(L0DebuggerTest, givenDebuggingEnabledWhenCommandListIsExecutedThenValid
auto systemRoutine = SipKernel::getSipKernelAllocation(*neoDevice);
ASSERT_NE(nullptr, systemRoutine);
EXPECT_EQ(systemRoutine->getGpuAddress(), stateSip->getSystemInstructionPointer());
}
for (auto i = 0u; i < numCommandLists; i++) {
auto commandList = CommandList::fromHandle(commandLists[i]);

View File

@ -1163,3 +1163,9 @@ HWTEST_F(HwHelperTest, GivenZeroSlmSizeWhenComputeSlmSizeIsCalledThenCorrectValu
auto receivedSlmSize = static_cast<SHARED_LOCAL_MEMORY_SIZE>(HwHelperHw<FamilyType>::get().computeSlmValues(hwInfo, 0));
EXPECT_EQ(SHARED_LOCAL_MEMORY_SIZE::SHARED_LOCAL_MEMORY_SIZE_ENCODES_0K, receivedSlmSize);
}
HWTEST2_F(HwHelperTest, givenHwHelperWhenCheckingSipWaThenFalseIsReturned, isTglLpOrBelow) {
auto &helper = HwHelper::get(renderCoreFamily);
EXPECT_FALSE(helper.isSipWANeeded(*defaultHwInfo));
}

View File

@ -125,6 +125,7 @@ class HwHelper {
virtual bool isMediaBlockIOSupported(const HardwareInfo &hwInfo) const = 0;
virtual bool isCopyOnlyEngineType(EngineGroupType type) const = 0;
virtual void adjustAddressWidthForCanonize(uint32_t &addressWidth) const = 0;
virtual bool isSipWANeeded(const HardwareInfo &hwInfo) const = 0;
static uint32_t getSubDevicesCount(const HardwareInfo *pHwInfo);
static uint32_t getEnginesCount(const HardwareInfo &hwInfo);
@ -317,6 +318,8 @@ class HwHelperHw : public HwHelper {
void adjustAddressWidthForCanonize(uint32_t &addressWidth) const override;
bool isSipWANeeded(const HardwareInfo &hwInfo) const override;
protected:
LocalMemoryAccessMode getDefaultLocalMemoryAccessMode(const HardwareInfo &hwInfo) const override;

View File

@ -514,4 +514,9 @@ template <typename GfxFamily>
void HwHelperHw<GfxFamily>::adjustAddressWidthForCanonize(uint32_t &addressWidth) const {
}
template <typename GfxFamily>
bool HwHelperHw<GfxFamily>::isSipWANeeded(const HardwareInfo &hwInfo) const {
return false;
}
} // namespace NEO

View File

@ -105,4 +105,11 @@ struct TdDebugControlRegisterOffset {
};
};
template <typename GfxFamily>
struct GlobalSipRegister {
enum {
registerOffset = 0xE42C,
};
};
} // namespace NEO

View File

@ -14,6 +14,7 @@ set(NEO_CORE_tests_mocks
${CMAKE_CURRENT_SOURCE_DIR}/mock_direct_submission_diagnostic_collector.h
${CMAKE_CURRENT_SOURCE_DIR}/mock_dispatch_kernel_encoder_interface.cpp
${CMAKE_CURRENT_SOURCE_DIR}/mock_dispatch_kernel_encoder_interface.h
${CMAKE_CURRENT_SOURCE_DIR}/mock_debugger.h
${CMAKE_CURRENT_SOURCE_DIR}/mock_device.cpp
${CMAKE_CURRENT_SOURCE_DIR}/mock_device.h
${CMAKE_CURRENT_SOURCE_DIR}/mock_graphics_allocation.h

View File

@ -0,0 +1,20 @@
/*
* Copyright (C) 2020 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#pragma once
#include "shared/source/debugger/debugger.h"
namespace NEO {
class CommandContainer;
class MockDebugger : public Debugger {
public:
MockDebugger() = default;
~MockDebugger() = default;
void captureStateBaseAddress(CommandContainer &container, SbaAddresses sba){};
};
} // namespace NEO