From f2a4e0984778e3055df0eb6cb0a2ac330de018e5 Mon Sep 17 00:00:00 2001 From: Yvan Tortorella Date: Fri, 14 Jun 2024 12:24:07 +0200 Subject: [PATCH] Fix software. --- sw/redmule.c | 5 +---- sw/utils/redmule_utils.h | 8 ++++---- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/sw/redmule.c b/sw/redmule.c index cd6e195..6d5d896 100644 --- a/sw/redmule.c +++ b/sw/redmule.c @@ -26,7 +26,7 @@ int main() { uint8_t *w = w_inp; uint8_t *y = y_inp; uint8_t *z = z_oup; // golden_out //1c010000 - uint32_t *gold; + uint32_t *gold = golden; uint8_t float_fmt = (SRC_FMT == FP8) ? (uint8_t)Float8 : (SRC_FMT == FP8ALT) ? (uint8_t)Float8Alt @@ -36,9 +36,6 @@ int main() { int golden_size = (float_fmt == (Float8 | Float8Alt)) ? m_size*k_size/4 : m_size*k_size/2; - for (int i = 0; i < golden_size; i++) - *(gold + i) = golden[i]; - volatile int errors = 0; int gold_sum = 0, check_sum = 0; int i, j; diff --git a/sw/utils/redmule_utils.h b/sw/utils/redmule_utils.h index 21103d7..eefff79 100644 --- a/sw/utils/redmule_utils.h +++ b/sw/utils/redmule_utils.h @@ -66,13 +66,13 @@ int redmule16_compare_int(uint32_t *actual_z, uint32_t *golden_z, int len) { errors += error; #ifdef DEBUG - tfp_printf("Golden: 0x%08x; Actual: 0x%08x,\n", golden_word, actual_word); + tfp_printf("Golden: 0x%08lx @ 0x%08ln; Actual: 0x%08lx @ 0x%08ln,\n", golden_word, (golden_z + i), actual_word, (actual_z + i)); #endif #ifdef VERBOSE if (error) { if (errors == 1) tfp_printf(" golden <- actual @ address @ index\n"); - tfp_printf("0x%08x <- 0x%08x @ 0x%08x @ 0x%08x\n", golden_word, actual_word, (actual_z + i), + tfp_printf("0x%08lx <- 0x%08lx @ 0x%08ln @ 0x%08x\n", golden_word, actual_word, (actual_z + i), i * 4); } #endif @@ -170,13 +170,13 @@ int redmule8_compare_int(uint32_t *actual_z, uint32_t *golden_z, int m, int k) { errors += error; #ifdef DEBUG - tfp_printf("Golden: 0x%08x; Actual: 0x%08x,\n", golden_word, actual_word); + tfp_printf("Golden: 0x%08x @ 0x%08x; Actual: 0x%08x @ 0x%08x,\n", golden_word, (golden_z + i), actual_word, (actual_z + i)); #endif #ifdef VERBOSE if (error) { if (errors == 1) tfp_printf(" golden <- actual @ address @ index\n"); - tfp_printf(" 0x%08x <- 0x%08x @ 0x%08x @ 0x%08x\n", golden_word, actual_word, (actual_z + i), + tfp_printf(" 0x%x <- 0x%x @ 0x%x @ 0x%x\n", golden_word, actual_word, (actual_z + i), i * 4); } #endif