Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow npu_perf_trace.sh to trace shim_test #247

Merged
merged 2 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/driver/tools/npu_perf_trace.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,17 @@ fi
# Global variables
sdt_pre_enabled=0
xrt_lib_prefix="/opt/xilinx/xrt/lib"
while [ $# -gt 0 ]; do
case "$1" in
-libdir | -l)
xrt_lib_prefix=$2
shift
;;
*)
break
esac
shift
done
accel_debugfs="/sys/kernel/debug/accel"
xrt_libs="${xrt_lib_prefix}/libxrt_coreutil.so,${xrt_lib_prefix}/libxrt_driver_xdna.so"
perf_record_args="-e amdxdna_trace:* "
Expand Down
6 changes: 4 additions & 2 deletions test/shim_test/io_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ int verify_output(int8_t* buf, const std::string &wrk_path)
ss >> key >> str_val;
ss.clear();
golden_output_files.push_back(wrk_path + "golden_" + str_val + ".bin");
dump_output_files.push_back(wrk_path + "dump_" + str_val + ".bin");
dump_output_files.push_back("/tmp/dump_" + str_val + "." + std::to_string(getpid()) + ".bin");

getline(myfile, line);
ss.str(line);
Expand Down Expand Up @@ -239,12 +239,14 @@ int verify_output(int8_t* buf, const std::string &wrk_path)

int ret = 0;
for (int i = 0; i < num_outputs; i++) {
std::cout << "Examing output: " << golden_output_files[i] << std::endl;
ret = comp_buf_strides(buf + output_ddr_addr[i], golden_output_files[i],
dump_output_files[i], output_shapes[i], output_strides[i]);
if (ret) {
std::cout << "Examing failed, ret " << ret << std::endl;
std::cout << "Examing output: " << dump_output_files[i] << std::endl;
break;
} else {
std::remove(dump_output_files[i].c_str());
}
}

Expand Down