@@ -271,8 +271,13 @@ bool margin_receiver(struct margin_recv *recv, struct margin_args *args, struct
recv->parallel_lanes = recv->max_lanes + 1;
margin_apply_hw_quirks(recv);
- results->tim_coef = (double)recv->timing_offset / (double)recv->timing_steps;
- results->volt_coef = (double)recv->volt_offset / (double)recv->volt_steps * 10.0;
+ results->tim_off_reported = recv->timing_offset != 0;
+ results->volt_off_reported = recv->volt_offset != 0;
+ double tim_offset = results->tim_off_reported ? (double)recv->timing_offset : 50.0;
+ double volt_offset = results->volt_off_reported ? (double)recv->volt_offset : 50.0;
+
+ results->tim_coef = tim_offset / (double)recv->timing_steps;
+ results->volt_coef = volt_offset / (double)recv->volt_steps * 10.0;
results->ind_left_right_tim = recv->ind_left_right_tim;
results->volt_support = recv->volt_support;
@@ -129,6 +129,9 @@ struct margin_results {
double tim_coef;
double volt_coef;
+ bool tim_off_reported;
+ bool volt_off_reported;
+
uint8_t lanes_n;
struct margin_res_lane *lanes;
};
@@ -49,6 +49,17 @@ void margin_log_print_caps(struct margin_recv *recv)
margin_log("\nWarning: device uses Lane Reversal.\n");
margin_log("However, utility uses logical lane numbers in arguments and for logging.\n");
}
+
+ if (recv->timing_offset == 0)
+ {
+ margin_log("\nWarning: Vendor chose not to report the Max Timing Offset.\n"
+ "Utility will use its max possible value - 50 (50%% UI).\n");
+ }
+ if (recv->volt_support && recv->volt_offset == 0)
+ {
+ margin_log("\nWarning: Vendor chose not to report the Max Voltage Offset.\n"
+ "Utility will use its max possible value - 50 (500 mV).\n");
+ }
}
void margin_log_link(struct margin_dev *down, struct margin_dev *up)
@@ -87,6 +87,18 @@ void margin_results_print_brief(struct margin_results *results, uint8_t recvs_n)
if (recv->lane_reversal)
printf("Rx(%X) - Lane Reversal\n", 10 + recv->recvn - 1);
+
+ if (!recv->tim_off_reported)
+ printf("Rx(%X) - Attention: Vendor chose not to report the Max Timing Offset.\n"
+ "Utility used its max possible value (50%% UI) for calculations of %% UI and ps.\n"
+ "Keep in mind that for timing results of this receiver only steps values are reliable.\n\n",
+ 10 + recv->recvn - 1);
+ if (recv->volt_support && !recv->volt_off_reported)
+ printf("Rx(%X) - Attention: Vendor chose not to report the Max Voltage Offset.\n"
+ "Utility used its max possible value (500 mV) for calculations of mV.\n"
+ "Keep in mind that for voltage results of this receiver only steps values are reliable.\n\n",
+ 10 + recv->recvn - 1);
+
if (check_recv_weird(recv, MARGIN_TIM_MIN, MARGIN_VOLT_MIN))
lane_rating = WEIRD;
else