Skip to content

Commit 3614b2a

Browse files
Add mock for AUB file stream to test MMIO writes
Change-Id: I939d94e1fd50e22a2a8b278449ab1a93492bf83c
1 parent a15af76 commit 3614b2a

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

unit_tests/mocks/mock_aub_csr.h

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,24 @@
2020

2121
namespace OCLRT {
2222

23+
struct MockAubFileStreamMockMmioWrite : public AubMemDump::AubFileStream {
24+
void writeMMIO(uint32_t offset, uint32_t value) override {
25+
mmioList.push_back(std::make_pair(offset, value));
26+
}
27+
bool isOnMmioList(const MMIOPair &mmio) {
28+
bool mmioFound = false;
29+
for (auto &mmioPair : mmioList) {
30+
if (mmioPair.first == mmio.first && mmioPair.second == mmio.second) {
31+
mmioFound = true;
32+
break;
33+
}
34+
}
35+
return mmioFound;
36+
}
37+
38+
std::vector<std::pair<uint32_t, uint32_t>> mmioList;
39+
};
40+
2341
template <typename GfxFamily>
2442
struct MockAubCsr : public AUBCommandStreamReceiverHw<GfxFamily> {
2543
MockAubCsr(const HardwareInfo &hwInfoIn, const std::string &fileName, bool standalone, ExecutionEnvironment &executionEnvironment)

0 commit comments

Comments
 (0)