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

Fix:CXL Host exerciser calculations and output string #3042

Merged
merged 2 commits into from Nov 15, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
26 changes: 12 additions & 14 deletions samples/cxl_host_exerciser/cxl_he_cmd.h
Expand Up @@ -77,24 +77,22 @@ class he_cmd : public test_command {
cout << "actual data:" << dsm_status->actual_data << endl;
cout << "expected data:" << dsm_status->expected_data << endl;

double latency = 0;
double perf_data = 0;
// print bandwidth
if (dsm_status->num_ticks > 0) {
double perf_data =
he_num_xfers_to_bw(dsm_status->num_reads + dsm_status->num_writes,
dsm_status->num_ticks);
host_exe_->logger_->info("Bandwidth: {0:0.3f} GB/s", perf_data);
}

if (cxl_latency == HE_CXL_RD_LATENCY) {
if (dsm_status->num_ticks > 0 && dsm_status->num_reads > 0) {
double latency = (double)((dsm_status->num_ticks / (double)dsm_status->num_reads)
*( 2.5));
perf_data = he_num_xfers_to_bw(dsm_status->num_reads +
dsm_status->num_writes, dsm_status->num_ticks);

host_exe_->logger_->info("Read Latency : {0:0.2f} nanoseconds", latency);
}
else {
host_exe_->logger_->info("Read Latency: N/A");
if (cxl_latency == HE_CXL_RD_LATENCY) {
latency = (double)(dsm_status->num_ticks * 2.5);
tswhison marked this conversation as resolved.
Show resolved Hide resolved
host_exe_->logger_->info("Bandwidth: {0:0.3f} GB/s Total transaction time: {1:0.2f} nanoseconds",
perf_data, latency);
} else {
host_exe_->logger_->info("Bandwidth: {0:0.3f} GB/s", perf_data);
}
} else {
host_exe_->logger_->info("Read Latency: N/A");
}

cout << "********* DSM Status CSR end *********" << endl;
Expand Down