added tolerance to exptime, fixed test
Build on RHEL9 docker image / build (push) Successful in 3m31s
Build on RHEL8 docker image / build (push) Successful in 4m52s
Run Simulator Tests on local RHEL9 / build (push) Failing after 11m12s
Run Simulator Tests on local RHEL8 / build (push) Failing after 13m17s

This commit is contained in:
2026-03-18 17:50:55 +01:00
parent a810ddeaf4
commit 27ea49c8e8
4 changed files with 12 additions and 6 deletions
@@ -1145,9 +1145,11 @@ int getNumTransceiverSamples() { return ntSamples; }
int setExpTime(int64_t val) {
setPatternWaitInterval(0, val);
// validate for tolerance
// Tolerance: three clock periods in ns.
int64_t retval = getExpTime();
if (val != retval) {
int64_t toleranceNs = 3 * (1000000000 / clkFrequency[RUN_CLK]);
int64_t diff = val - retval;
if (diff < -toleranceNs || diff > toleranceNs) {
return FAIL;
}
return OK;
@@ -307,7 +307,9 @@ uint64_t getPatternWaitInterval(int level) {
LOG(logERROR, ("runclk is 0. Cannot divide by 0. Returning -1.\n"));
return -1;
}
return numClocks / (NS_TO_CLK_CYCLE * runclk);
double conv = NS_TO_CLK_CYCLE * runclk;
uint64_t waitNs = (uint64_t)(numClocks / conv + 0.5);
return waitNs;
}
int validate_setPatternWaitClocksAndInterval(char *message, int level,
@@ -5867,7 +5867,7 @@ int set_clock_frequency(int file_des) {
if (getFrequency(c) == val) {
LOG(logINFO, ("Same %s: %d %s\n", modeName, val, "Hz"));
} else {
int ret = setFrequency(c, val); // MM: Poblem
int ret = setFrequency(c, val);
if (ret == FAIL) {
sprintf(mess, "Could not set %s to %d %s\n", modeName, val,"Hz");
LOG(logERROR, (mess));
@@ -1055,9 +1055,11 @@ int getNumTransceiverSamples() {
int setExpTime(int64_t val) {
setPatternWaitInterval(0, val);
// validate for tolerance
// Tolerance: three clock periods in ns.
int64_t retval = getExpTime();
if (val != retval) {
int64_t toleranceNs = 3 * (1000000000 / clkFrequency[RUN_CLK]);
int64_t diff = val - retval;
if (diff < -toleranceNs || diff > toleranceNs) {
return FAIL;
}
return OK;