From 65b1436e0bf7215b5f619b2b4c4ff0f28d80b26d Mon Sep 17 00:00:00 2001 From: Peter McGoron Date: Mon, 23 Jan 2023 04:47:12 +0000 Subject: [PATCH] autoapproach: test refreshing bram --- firmware/rtl/autoapproach/bram_interface_sim.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/firmware/rtl/autoapproach/bram_interface_sim.cpp b/firmware/rtl/autoapproach/bram_interface_sim.cpp index 224ec29..d93e845 100644 --- a/firmware/rtl/autoapproach/bram_interface_sim.cpp +++ b/firmware/rtl/autoapproach/bram_interface_sim.cpp @@ -86,9 +86,7 @@ static void test_aa_read_1() { my_assert(ind == WORD_AMNT, "second read value %zu != %d\n", ind, WORD_AMNT); } -int main(int argc, char **argv) { - init(argc, argv); - +static void refresh_data() { for (size_t i = 0; i < RAM_WID; i++) { ram_refresh_data[i] = mask_extend(rand(), 20); } @@ -105,6 +103,14 @@ int main(int argc, char **argv) { mod->refresh_start = 0; run_clock(); +} + +int main(int argc, char **argv) { + init(argc, argv); + + refresh_data(); + test_aa_read_1(); + refresh_data(); test_aa_read_1(); printf("ok\n");