From 7ec0bcfe5bd0d02a108279f3e2a27d316c40bcf4 Mon Sep 17 00:00:00 2001 From: Paulo Dutra - PU4THZ <58897843+Paulo-D2000@users.noreply.github.com> Date: Tue, 2 Jul 2024 00:05:18 -0300 Subject: [PATCH] Possible fix to uint0_t RAM function "Rounding" 0 to 1 by adding extra 1... --- src/SW_LIB.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/SW_LIB.py b/src/SW_LIB.py index b3a32b15..70ba76d3 100755 --- a/src/SW_LIB.py +++ b/src/SW_LIB.py @@ -1756,7 +1756,7 @@ def GET_MEM_H_LOGIC_LOOKUP(parser_state): dim = dims[i] addr_t = ( "uint" - + str(int(math.ceil(math.log(dim, 2)))) + + str(int(math.ceil(math.log(dim, 2)))+1) #round up by 1 + "_t" ) text += addr_t + " addr" + str(i) + ", " @@ -1766,7 +1766,7 @@ def GET_MEM_H_LOGIC_LOOKUP(parser_state): dim = dims[i] addr_t = ( "uint" - + str(int(math.ceil(math.log(dim, 2)))) + + str(int(math.ceil(math.log(dim, 2)))+1) #round up by 1 + "_t" ) text += ( @@ -8358,4 +8358,4 @@ def GET_BIN_OP_DIV_INT_N_C_CODE(partially_complete_logic, out_dir, parser_state) # print(text) # sys.exit(-1) - return text \ No newline at end of file + return text