[sw] Fix 64-bit division in HMAC test utilities
Builtin 64-bit division support has been removed. Replace instances
with a function call instead.
Signed-off-by: Michael Munday <mike.munday@lowrisc.org>
diff --git a/sw/device/lib/testing/hmac_testutils.h b/sw/device/lib/testing/hmac_testutils.h
index 37566a8..5e1a23e 100644
--- a/sw/device/lib/testing/hmac_testutils.h
+++ b/sw/device/lib/testing/hmac_testutils.h
@@ -31,7 +31,8 @@
*
* single HMAC block compression takes 80 cycles.
*/
-#define HMAC_TESTUTILS_FIFO_EMPTY_USEC (80 + 10) * 1000000 / kClockFreqCpuHz + 1
+#define HMAC_TESTUTILS_FIFO_EMPTY_USEC \
+ (udiv64_slow((80 + 10) * 1000000, kClockFreqCpuHz, NULL) + 1)
/**
* HMAC done timeout.
@@ -40,7 +41,7 @@
* compression and extra HMAC computation.
*/
#define HMAC_TESTUTILS_FINISH_TIMEOUT_USEC \
- (360 + 10) * 1000000 / kClockFreqCpuHz + 1
+ (udiv64_slow((360 + 10) * 1000000, kClockFreqCpuHz, NULL) + 1)
/**
* Reads and compares the actual sent message length against expected.