1515const int n_rows = 208 ;
1616const int n_cols = 288 ;
1717
18+
19+ namespace ips
20+ {
1821struct Image {
19- int matrix[n_rows][n_cols];
22+ int matrix[n_rows][n_cols] = { 0 } ;
2023};
24+ }
2125
22- Image dummy_img (int i_rows, int i_cols)
26+ ips:: Image dummy_img (int i_rows, int i_cols)
2327{
24- Image dummy;
28+ ips:: Image dummy = {} ;
2529 // Fill the image with values
2630 int filler = 10 ;
2731 for (int i = 0 ; i < i_rows; i++) {
@@ -33,32 +37,15 @@ Image dummy_img(int i_rows, int i_cols)
3337 return dummy;
3438}
3539
36- void print_matrix (Image image, int image_rows, int image_cols)
37- {
38- for (int i = 0 ; i < image_rows; ++i) {
39- for (int j = 0 ; j < image_cols; ++j) {
40- cout << image.matrix [i][j]<<" " ;
41- }
42- cout << endl;
43- }
44- }
45-
46- void print_array (signed char *Arr, int array_length)
47- {
48- for (int i = 0 ; i < array_length; ++i) {
49- cout << int (Arr[i])<<" " ;
50- }
51- cout << endl;
52- }
53- int sc_main (int argc, char * argv[]) {
40+ int sc_main (int , char *[]) {
5441 sc_signal<sc_int<32 > > matrix_element;
5542 sc_signal<sc_int<32 > > matrix_row;
5643 sc_signal<sc_int<32 > > matrix_col;
5744 sc_signal<sc_int<8 > > Array_element;
5845 sc_signal<sc_int<32 > > array_index;
5946 sc_signal<sc_int<32 > > Array_size;
6047
61- Image input_image = dummy_img (n_rows, n_cols);
48+ ips:: Image input_image = dummy_img (n_rows, n_cols);
6249 int image_rows = sizeof (input_image.matrix )/ sizeof (input_image.matrix [0 ]);
6350 int image_cols = sizeof (input_image.matrix [0 ])/ sizeof (int );
6451 // Image output_image;
@@ -128,6 +115,5 @@ int sc_main (int argc, char* argv[]) {
128115 cout << " @" << sc_time_stamp () <<" Terminating simulation\n " << endl;
129116 sc_close_vcd_trace_file (wf);
130117 return 0 ;// Terminate simulation
131-
132- }
118+ }
133119#endif // IPS_JPG_AT_EN
0 commit comments