Skip to content

Commit 76ef0bf

Browse files
bmyatesCompute-Runtime-Automation
authored andcommitted
L0debug - Canonize SBA in single address space mode
Signed-off-by: Brandon Yates<[email protected]>
1 parent 83f63e0 commit 76ef0bf

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

shared/source/debugger/debugger_l0.inl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ void DebuggerL0Hw<GfxFamily>::captureStateBaseAddress(NEO::LinearStream &cmdStre
4141
sbaCanonized.IndirectObjectBaseAddress, sbaCanonized.InstructionBaseAddress, sbaCanonized.BindlessSurfaceStateBaseAddress);
4242

4343
if (singleAddressSpaceSbaTracking) {
44-
programSbaTrackingCommandsSingleAddressSpace(cmdStream, sba);
44+
programSbaTrackingCommandsSingleAddressSpace(cmdStream, sbaCanonized);
4545
} else {
4646
if (sbaCanonized.GeneralStateBaseAddress) {
4747
auto generalStateBaseAddress = sbaCanonized.GeneralStateBaseAddress;

shared/test/unit_test/debugger/test_l0_debugger_single_address_space.cpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
*/
77

88
#include "shared/source/command_container/command_encoder.h"
9+
#include "shared/source/gmm_helper/gmm_helper.h"
910
#include "shared/test/common/cmd_parse/gen_cmd_parse.h"
1011
#include "shared/test/common/fixtures/device_fixture.h"
1112
#include "shared/test/common/helpers/debug_manager_state_restore.h"
@@ -241,12 +242,13 @@ HWTEST2_F(SingleAddressSpaceFixture, GivenOneNonZeroSbaAddressesWhenProgrammingS
241242
cmdStream.replaceGraphicsAllocation(streamAllocation);
242243
cmdStream.replaceBuffer(streamAllocation->getUnderlyingBuffer(), streamAllocation->getUnderlyingBufferSize());
243244

244-
uint64_t ssba = 0x1234567000;
245+
uint64_t ssba = 0x0000800011112222;
245246

246247
NEO::Debugger::SbaAddresses sbaAddresses = {0};
247248
sbaAddresses.SurfaceStateBaseAddress = ssba;
248249

249-
debugger->programSbaTrackingCommandsSingleAddressSpace(cmdStream, sbaAddresses);
250+
debugger->singleAddressSpaceSbaTracking = true;
251+
debugger->captureStateBaseAddress(cmdStream, sbaAddresses);
250252

251253
GenCmdList cmdList;
252254
ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer(cmdList, cmdStream.getCpuBase(), cmdStream.getUsed()));
@@ -289,9 +291,17 @@ HWTEST2_F(SingleAddressSpaceFixture, GivenOneNonZeroSbaAddressesWhenProgrammingS
289291

290292
itor = find<MI_STORE_DATA_IMM *>(itor, cmdList.end());
291293
ASSERT_NE(cmdList.end(), itor);
294+
auto lowDword = genCmdCast<MI_STORE_DATA_IMM *>(*itor)->getDataDword0();
295+
itor++;
292296

293297
itor = find<MI_STORE_DATA_IMM *>(itor, cmdList.end());
294298
ASSERT_NE(cmdList.end(), itor);
299+
auto highDword = genCmdCast<MI_STORE_DATA_IMM *>(*itor)->getDataDword0();
300+
301+
uint64_t foundSsba = ((static_cast<uint64_t>(highDword) & 0xffffffff) << 32) | lowDword;
302+
const auto gmmHelper = pDevice->getGmmHelper();
303+
const auto ssbaCanonized = gmmHelper->canonize(ssba);
304+
EXPECT_EQ(ssbaCanonized, foundSsba);
295305

296306
itor = find<MI_ARB_CHECK *>(itor, cmdList.end());
297307
ASSERT_NE(cmdList.end(), itor);

0 commit comments

Comments
 (0)