Skip to content

Commit

Permalink
Merge 3604e63 into fac810a
Browse files Browse the repository at this point in the history
  • Loading branch information
anandaravuri committed Nov 14, 2023
2 parents fac810a + 3604e63 commit 92ab17e
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions samples/cxl_host_exerciser/cxl_he_cmd.h
Original file line number Diff line number Diff line change
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);
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

0 comments on commit 92ab17e

Please sign in to comment.