Skip to content

Commit

Permalink
Checking with working test file
Browse files Browse the repository at this point in the history
  • Loading branch information
pvasireddy-amd committed Nov 6, 2024
1 parent d13e607 commit dd87d0b
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions test/npu-xrt/dynamic_object_fifo/two_core_sliding_window/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
#include "xrt/xrt_kernel.h"

#ifndef XCLBIN
#define XCLBIN "final.xclbin"
#define XCLBIN "build/final.xclbin"
#endif

#ifndef INSTS_TXT
#define INSTS_TXT "insts.txt"
#define INSTS_TXT "build/insts.txt"
#endif

#ifndef KERNEL_NAME
Expand All @@ -33,9 +33,24 @@

#include "test_utils.h"

std::vector<uint32_t> load_instr_sequence(std::string instr_path) {
std::ifstream instr_file(instr_path);
std::string line;
std::vector<uint32_t> instr_v;
while (std::getline(instr_file, line)) {
std::istringstream iss(line);
uint32_t a;
if (!(iss >> std::hex >> a)) {
throw std::runtime_error("Unable to parse instruction file\n");
}
instr_v.push_back(a);
}
return instr_v;
}

int main(int argc, const char *argv[]) {

std::vector<uint32_t> instr_v = test_utils::load_instr_sequence(INSTS_TXT);
std::vector<uint32_t> instr_v = load_instr_sequence(INSTS_TXT);
assert(instr_v.size() > 0);

// Get a device handle
Expand Down

0 comments on commit dd87d0b

Please sign in to comment.