diff --git a/modules/compression/src/ips_jpg_at_testbench.cpp b/modules/compression/src/ips_jpg_at_testbench.cpp index 4d14fa5..ebaeea7 100644 --- a/modules/compression/src/ips_jpg_at_testbench.cpp +++ b/modules/compression/src/ips_jpg_at_testbench.cpp @@ -15,13 +15,17 @@ const int n_rows = 208; const int n_cols = 288; + +namespace ips +{ struct Image { - int matrix[n_rows][n_cols]; + int matrix[n_rows][n_cols] = {0}; }; +} -Image dummy_img(int i_rows, int i_cols) +ips::Image dummy_img(int i_rows, int i_cols) { - Image dummy; + ips::Image dummy = {}; // Fill the image with values int filler = 10; for (int i = 0; i < i_rows; i++) { @@ -33,24 +37,7 @@ Image dummy_img(int i_rows, int i_cols) return dummy; } -void print_matrix(Image image, int image_rows, int image_cols) -{ - for (int i = 0; i < image_rows; ++i) { - for (int j = 0; j < image_cols; ++j) { - cout << image.matrix[i][j]<<" "; - } - cout << endl; - } -} - -void print_array(signed char *Arr, int array_length) -{ - for (int i = 0; i < array_length; ++i) { - cout << int(Arr[i])<<" "; - } - cout << endl; -} -int sc_main (int argc, char* argv[]) { +int sc_main(int, char*[]) { sc_signal > matrix_element; sc_signal > matrix_row; sc_signal > matrix_col; @@ -58,7 +45,7 @@ int sc_main (int argc, char* argv[]) { sc_signal > array_index; sc_signal > Array_size; - Image input_image = dummy_img(n_rows, n_cols); + ips::Image input_image = dummy_img(n_rows, n_cols); int image_rows = sizeof(input_image.matrix)/ sizeof(input_image.matrix[0]); int image_cols = sizeof(input_image.matrix[0])/ sizeof(int); //Image output_image; @@ -128,6 +115,5 @@ int sc_main (int argc, char* argv[]) { cout << "@" << sc_time_stamp() <<" Terminating simulation\n" << endl; sc_close_vcd_trace_file(wf); return 0;// Terminate simulation - - } +} #endif // IPS_JPG_AT_EN diff --git a/modules/compression/src/ips_jpg_lt_testbench.cpp b/modules/compression/src/ips_jpg_lt_testbench.cpp index ed01c36..dc32158 100644 --- a/modules/compression/src/ips_jpg_lt_testbench.cpp +++ b/modules/compression/src/ips_jpg_lt_testbench.cpp @@ -15,13 +15,16 @@ const int n_rows = 208; const int n_cols = 288; +namespace ips +{ struct Image { int matrix[n_rows][n_cols] = {0}; }; +} -Image dummy_img(int i_rows, int i_cols) +ips::Image dummy_img(int i_rows, int i_cols) { - Image dummy; + ips::Image dummy = {}; // Fill the image with values int filler = 10; for (int i = 0; i < i_rows; i++) { @@ -33,25 +36,8 @@ Image dummy_img(int i_rows, int i_cols) return dummy; } -void print_matrix(Image image, int image_rows, int image_cols) -{ - for (int i = 0; i < image_rows; ++i) { - for (int j = 0; j < image_cols; ++j) { - cout << image.matrix[i][j]<<" "; - } - cout << endl; - } -} - -void print_array(signed char *Arr, int array_length) -{ - for (int i = 0; i < array_length; ++i) { - cout << int(Arr[i])<<" "; - } - cout << endl; -} -int sc_main (int argc, char* argv[]) { - Image input_image = dummy_img(n_rows, n_cols); +int sc_main (int, char*[]) { + ips::Image input_image = dummy_img(n_rows, n_cols); int image_rows = sizeof(input_image.matrix)/ sizeof(input_image.matrix[0]); int image_cols = sizeof(input_image.matrix[0])/ sizeof(int); //Image output_image; @@ -104,6 +90,5 @@ int sc_main (int argc, char* argv[]) { cout << "@" << sc_time_stamp() <<" Terminating simulation\n" << endl; sc_close_vcd_trace_file(wf); return 0;// Terminate simulation - - } +} #endif // IPS_JPG_LT_EN diff --git a/modules/compression/src/ips_jpg_pv_testbench.cpp b/modules/compression/src/ips_jpg_pv_testbench.cpp index a728315..bda1245 100644 --- a/modules/compression/src/ips_jpg_pv_testbench.cpp +++ b/modules/compression/src/ips_jpg_pv_testbench.cpp @@ -15,13 +15,17 @@ const int n_rows = 452; const int n_cols = 640; +namespace ips +{ struct Image { int matrix[n_rows][n_cols] = {0}; }; +} -Image dummy_img(int i_rows, int i_cols) +ips::Image dummy_img(int i_rows, int i_cols) { - Image dummy; + ips::Image dummy = {}; + // Fill the image with values int filler = 10; for (int i = 0; i < i_rows; i++) { @@ -33,25 +37,8 @@ Image dummy_img(int i_rows, int i_cols) return dummy; } -void print_matrix(Image image, int image_rows, int image_cols) -{ - for (int i = 0; i < image_rows; ++i) { - for (int j = 0; j < image_cols; ++j) { - cout << image.matrix[i][j]<<" "; - } - cout << endl; - } -} - -void print_array(signed char *Arr, int array_length) -{ - for (int i = 0; i < array_length; ++i) { - cout << int(Arr[i])<<" "; - } - cout << endl; -} -int sc_main (int argc, char* argv[]) { - Image input_image = dummy_img(n_rows, n_cols); +int sc_main(int, char*[]) { + ips::Image input_image = dummy_img(n_rows, n_cols); int image_rows = sizeof(input_image.matrix)/ sizeof(input_image.matrix[0]); int image_cols = sizeof(input_image.matrix[0])/ sizeof(int); //Image output_image; @@ -102,5 +89,5 @@ int sc_main (int argc, char* argv[]) { sc_close_vcd_trace_file(wf); return 0;// Terminate simulation - } +} #endif // IPS_JPG_PV_EN diff --git a/modules/unification/src/unification_tb.cpp b/modules/unification/src/unification_tb.cpp index b5d9440..dc64f72 100644 --- a/modules/unification/src/unification_tb.cpp +++ b/modules/unification/src/unification_tb.cpp @@ -10,17 +10,15 @@ #include "include/stb_image_write.h" #include -#include "math.h" +#include #ifdef IMG_UNIFICATE_PV_EN #include "unification_pv_model.hpp" #endif -int sc_main (int argc, char* argv[]) { - +int sc_main(int, char*[]) { unsigned char pixel_x, pixel_y; unsigned char pixel_magnitude; - int i; int width, height, channels, pixel_count; unsigned char *img_x, *img_y, *img_unificated;