From 93829284701f589acc6959a736f6a37c74bce5d8 Mon Sep 17 00:00:00 2001 From: malenov Date: Thu, 2 Nov 2023 15:47:20 +0100 Subject: [PATCH 1/6] change memory consumption from words to bytes --- apps/decoder.c | 2 +- apps/encoder.c | 2 +- apps/renderer.c | 2 +- lib_debug/wmc_auto.c | 20 +++++++++++++++----- lib_debug/wmc_auto.h | 3 ++- 5 files changed, 20 insertions(+), 9 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index f893346623..ca333d9572 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -218,7 +218,7 @@ int main( #endif #ifdef WMOPS reset_wmops(); - reset_mem( USE_32BITS ); + reset_mem( USE_BYTES ); #endif /*------------------------------------------------------------------------------------------* diff --git a/apps/encoder.c b/apps/encoder.c index ef1e7c1c85..e224463835 100644 --- a/apps/encoder.c +++ b/apps/encoder.c @@ -202,7 +202,7 @@ int main( #endif #ifdef WMOPS reset_wmops(); - reset_mem( USE_32BITS ); + reset_mem( USE_BYTES ); #endif initArgStruct( &arg ); diff --git a/apps/renderer.c b/apps/renderer.c index 8d2877ae91..af02137c96 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -821,7 +821,7 @@ int main( #ifdef WMOPS reset_wmops(); - reset_mem( USE_32BITS ); + reset_mem( USE_BYTES ); #endif for ( i = 0; i < RENDERER_MAX_MASA_INPUTS; ++i ) diff --git a/lib_debug/wmc_auto.c b/lib_debug/wmc_auto.c index 6ee30fd269..0ff7786f05 100644 --- a/lib_debug/wmc_auto.c +++ b/lib_debug/wmc_auto.c @@ -683,7 +683,7 @@ allocator_record *allocation_list = NULL; static int Num_Records, Max_Num_Records; static size_t Stat_Cnt_Size = USE_BYTES; -static const char *Count_Unit[] = { "bytes", "words", "words" }; +static const char *Count_Unit[] = { "bytes", "words", "words", "words" }; static int32_t wc_ram_size, wc_ram_frame; static int32_t current_heap_size; @@ -1896,7 +1896,16 @@ void print_mem( ROM_Size_Lookup_Table Const_Data_PROM_Table[] ) for ( i = 0; i < nElem; i++ ) { - fprintf( stdout, "Program ROM size (%s): %d instruction words\n", Const_Data_PROM_Table[i].file_spec, Const_Data_PROM_Table[i].PROM_size ); + if ( Stat_Cnt_Size > 0 ) + { + /* words */ + fprintf( stdout, "Program ROM size (%s): %d words\n", Const_Data_PROM_Table[i].file_spec, Const_Data_PROM_Table[i].PROM_size ); + } + else + { + /* bytes */ + fprintf( stdout, "Program ROM size (%s): %d bytes\n", Const_Data_PROM_Table[i].file_spec, Const_Data_PROM_Table[i].PROM_size << Stat_Cnt_Size ); + } } for ( i = 0; i < nElem; i++ ) @@ -1985,11 +1994,12 @@ void print_mem( ROM_Size_Lookup_Table Const_Data_PROM_Table[] ) mem_count_summary(); #endif - if ( Stat_Cnt_Size > 0 ) + if ( Stat_Cnt_Size == 0 ) { - fprintf( stdout, "\nNote: 1 word = %d bits\n", 8 << Stat_Cnt_Size ); - fprintf( stdout, "This is an optimistic estimate of memory consumption assuming that each variable type is stored with sizeof(type) bits\n" ); + /* bytes */ + fprintf( stdout, "\nNote: The Program ROM size is calculated under the assumption that 1 instruction word is stored with %d bytes (%d bits)\n", 1 << Stat_Cnt_Size, 8 << Stat_Cnt_Size ); } + fprintf( stdout, "Note: The Data ROM size is calculated using the sizeof(type) built-in function\n" ); if ( n_items_wc_intra_frame_heap > 0 ) { diff --git a/lib_debug/wmc_auto.h b/lib_debug/wmc_auto.h index 0a13cb7020..e2f2af4d8f 100644 --- a/lib_debug/wmc_auto.h +++ b/lib_debug/wmc_auto.h @@ -981,7 +981,8 @@ typedef enum { USE_BYTES = 0, USE_16BITS = 1, - USE_32BITS = 2 + USE_32BITS = 2, + USE_64BITS = 3 } Counting_Size; #if ( defined( _WIN32 ) && ( _MSC_VER <= 1800 ) && ( _MSC_VER >= 1300 ) ) -- GitLab From 59647bbf039a28c160605d6e66375ffd697d9b96 Mon Sep 17 00:00:00 2001 From: Vladimir Malenovsky Date: Thu, 2 Nov 2023 15:57:21 +0100 Subject: [PATCH 2/6] change 32 bits to bytes in html report --- .../index_complexity.html | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/ci/complexity_measurements/index_complexity.html b/ci/complexity_measurements/index_complexity.html index de3d0975fc..67f48642cc 100755 --- a/ci/complexity_measurements/index_complexity.html +++ b/ci/complexity_measurements/index_complexity.html @@ -201,25 +201,25 @@
  • Max. total RAM Codec: - 32 bit words, Encoder + Decoder
  • + bytes, Encoder + Decoder
  • Max. total RAM Encoder: - 32 bit words, Encoder only
  • + bytes, Encoder only
  • Max. total RAM Decoder: - 32 bit words, Decoder only
  • + bytes, Decoder only
  • Max. HEAP Codec: - 32 bit words, Encoder + Decoder
  • + bytes, Encoder + Decoder
  • Max. HEAP Encoder - 32 bit words, Encoder only
  • + bytes, Encoder only
  • Max. HEAP Decoder - 32 bit words, Decoder only
  • + bytes, Decoder only
  • Max. STACK Codec: - 32 bit words, max(Encoder, Decoder)
  • + bytes, max(Encoder, Decoder)
  • Max. STACK Encoder: - 32 bit words, Encoder only
  • + bytes, Encoder only
  • Max. STACK Decoder: - 32 bit words, Decoder only
  • + bytes, Decoder only
-- GitLab From 82138d21c568849e37983417031601b30a32047b Mon Sep 17 00:00:00 2001 From: Vladimir Malenovsky Date: Fri, 3 Nov 2023 13:10:34 +0100 Subject: [PATCH 3/6] change the y-axis unit to bytes in the html graphs --- ci/complexity_measurements/index_complexity.html | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/ci/complexity_measurements/index_complexity.html b/ci/complexity_measurements/index_complexity.html index 67f48642cc..e8425a7871 100755 --- a/ci/complexity_measurements/index_complexity.html +++ b/ci/complexity_measurements/index_complexity.html @@ -707,7 +707,7 @@ function RAM() { max: max_val, tickFormatter: function (v, axis) { if (graph.direction == -1) - return v + " Word"; + return v + " bytes"; return v; }, invert: graph.direction == 1 @@ -755,7 +755,7 @@ function RAM() { var text = 'Score: ' + y; if (graph.direction == -1) - text += " Word"; + text += " bytes"; text += "
"; if (x > 0) { @@ -774,7 +774,7 @@ function RAM() { if (diff === diff) { text += String.fromCharCode(916) + ": " + diff; if (graph.direction == -1) - text += " Word"; + text += " bytes"; text += " (" + pdiff + "% " + better + ")
"; } } @@ -816,7 +816,7 @@ function RAM() { text += "Logfile
"; } else { - text = "RAM requirement: 100000 Word"; + text = "RAM requirement: 400000 bytes"; } showToolTip(item.pageX, item.pageY, text); @@ -868,7 +868,7 @@ function ROM() { max: max_val, tickFormatter: function (v, axis) { if (graph.direction == -1) - return v + " Word"; + return v + " bytes"; return v; }, invert: graph.direction == 1 @@ -916,7 +916,7 @@ function ROM() { var text = 'Score: ' + y; if (graph.direction == -1) - text += " Word"; + text += " bytes"; text += "
"; if (x > 0) { @@ -935,7 +935,7 @@ function ROM() { if (diff === diff) { text += String.fromCharCode(916) + ": " + diff; if (graph.direction == -1) - text += " Word"; + text += " bytes"; text += " (" + pdiff + "% " + better + ")
"; } } @@ -991,7 +991,7 @@ function ROM() { */ } else { - text = "ROM requirement: 200 kWord"; + text = "ROM requirement: 800000 bytes"; } showToolTip(item.pageX, item.pageY, text); -- GitLab From 4fcf02a98ea09b10f361ee881be2291049c39c21 Mon Sep 17 00:00:00 2001 From: Vladimir Malenovsky Date: Fri, 3 Nov 2023 13:13:47 +0100 Subject: [PATCH 4/6] correction of text on max PROM in the html document --- ci/complexity_measurements/index_complexity.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ci/complexity_measurements/index_complexity.html b/ci/complexity_measurements/index_complexity.html index e8425a7871..54a849d379 100755 --- a/ci/complexity_measurements/index_complexity.html +++ b/ci/complexity_measurements/index_complexity.html @@ -261,10 +261,10 @@
  • Max. total ROM Codec: Encoder + Decoder
  • -
  • Max. max PROM Encoder Library: lib_enc only
  • -
  • Max. max PROM Decoder Library: lib_dec only
  • -
  • Max. max PROM Common Library: lib_com only/li> -
  • Max. max PROM Ext Renderer Library: lib_ren only
  • +
  • Max. PROM Encoder Library: lib_enc only
  • +
  • Max. PROM Decoder Library: lib_dec only
  • +
  • Max. PROM Common Library: lib_com only
  • +
  • Max. PROM Ext Renderer Library: lib_ren only
  • Max. Table ROM Encoder Library: lib_enc only
  • Max. Table ROM Decoder Library: lib_dec only
  • -- GitLab From 8e474b29079464e46c2935dca4a00090af70655e Mon Sep 17 00:00:00 2001 From: Vladimir Malenovsky Date: Fri, 3 Nov 2023 13:16:24 +0100 Subject: [PATCH 5/6] small correction in the descriptions --- ci/complexity_measurements/index_complexity.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ci/complexity_measurements/index_complexity.html b/ci/complexity_measurements/index_complexity.html index 54a849d379..c5a697d843 100755 --- a/ci/complexity_measurements/index_complexity.html +++ b/ci/complexity_measurements/index_complexity.html @@ -261,10 +261,10 @@
    • Max. total ROM Codec: Encoder + Decoder
    • -
    • Max. PROM Encoder Library: lib_enc only
    • -
    • Max. PROM Decoder Library: lib_dec only
    • -
    • Max. PROM Common Library: lib_com only
    • -
    • Max. PROM Ext Renderer Library: lib_ren only
    • +
    • Max. Program ROM Encoder Library: lib_enc only
    • +
    • Max. Program ROM Decoder Library: lib_dec only
    • +
    • Max. Program ROM Common Library: lib_com only
    • +
    • Max. Program ROM Ext Renderer Library: lib_rend only
    • Max. Table ROM Encoder Library: lib_enc only
    • Max. Table ROM Decoder Library: lib_dec only
    • -- GitLab From 1902581179d374f0f091850b85a1bb431bc6917a Mon Sep 17 00:00:00 2001 From: Vladimir Malenovsky Date: Fri, 3 Nov 2023 13:19:56 +0100 Subject: [PATCH 6/6] some more small corrections in the description --- .../index_complexity.html | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/ci/complexity_measurements/index_complexity.html b/ci/complexity_measurements/index_complexity.html index c5a697d843..0e2ec822fa 100755 --- a/ci/complexity_measurements/index_complexity.html +++ b/ci/complexity_measurements/index_complexity.html @@ -201,25 +201,25 @@
      • Max. total RAM Codec: - bytes, Encoder + Decoder
      • + Encoder + Decoder
      • Max. total RAM Encoder: - bytes, Encoder only
      • + Encoder only
      • Max. total RAM Decoder: - bytes, Decoder only
      • + Decoder only
      • Max. HEAP Codec: - bytes, Encoder + Decoder
      • + Encoder + Decoder
      • Max. HEAP Encoder - bytes, Encoder only
      • + Encoder only
      • Max. HEAP Decoder - bytes, Decoder only
      • + Decoder only
      • Max. STACK Codec: - bytes, max(Encoder, Decoder)
      • + max(Encoder, Decoder)
      • Max. STACK Encoder: - bytes, Encoder only
      • + Encoder only
      • Max. STACK Decoder: - bytes, Decoder only
      • + Decoder only
      -- GitLab