Skip to content

Commit 642a58e

Browse files
committed
Fixing Lint violations for quality checks
1 parent e5118fb commit 642a58e

File tree

4 files changed

+29
-73
lines changed

4 files changed

+29
-73
lines changed

modules/compression/src/ips_jpg_at_testbench.cpp

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,17 @@
1515
const int n_rows = 208;
1616
const int n_cols = 288;
1717

18+
19+
namespace ips
20+
{
1821
struct 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

modules/compression/src/ips_jpg_lt_testbench.cpp

Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,16 @@
1515
const int n_rows = 208;
1616
const int n_cols = 288;
1717

18+
namespace ips
19+
{
1820
struct Image {
1921
int matrix[n_rows][n_cols] = {0};
2022
};
23+
}
2124

22-
Image dummy_img(int i_rows, int i_cols)
25+
ips::Image dummy_img(int i_rows, int i_cols)
2326
{
24-
Image dummy;
27+
ips::Image dummy = {};
2528
// Fill the image with values
2629
int filler = 10;
2730
for (int i = 0; i < i_rows; i++) {
@@ -33,25 +36,8 @@ Image dummy_img(int i_rows, int i_cols)
3336
return dummy;
3437
}
3538

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[]) {
54-
Image input_image = dummy_img(n_rows, n_cols);
39+
int sc_main (int, char*[]) {
40+
ips::Image input_image = dummy_img(n_rows, n_cols);
5541
int image_rows = sizeof(input_image.matrix)/ sizeof(input_image.matrix[0]);
5642
int image_cols = sizeof(input_image.matrix[0])/ sizeof(int);
5743
//Image output_image;
@@ -104,6 +90,5 @@ int sc_main (int argc, char* argv[]) {
10490
cout << "@" << sc_time_stamp() <<" Terminating simulation\n" << endl;
10591
sc_close_vcd_trace_file(wf);
10692
return 0;// Terminate simulation
107-
108-
}
93+
}
10994
#endif // IPS_JPG_LT_EN

modules/compression/src/ips_jpg_pv_testbench.cpp

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,17 @@
1515
const int n_rows = 452;
1616
const int n_cols = 640;
1717

18+
namespace ips
19+
{
1820
struct Image {
1921
int matrix[n_rows][n_cols] = {0};
2022
};
23+
}
2124

22-
Image dummy_img(int i_rows, int i_cols)
25+
ips::Image dummy_img(int i_rows, int i_cols)
2326
{
24-
Image dummy;
27+
ips::Image dummy = {};
28+
2529
// Fill the image with values
2630
int filler = 10;
2731
for (int i = 0; i < i_rows; i++) {
@@ -33,25 +37,8 @@ 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[]) {
54-
Image input_image = dummy_img(n_rows, n_cols);
40+
int sc_main(int, char*[]) {
41+
ips::Image input_image = dummy_img(n_rows, n_cols);
5542
int image_rows = sizeof(input_image.matrix)/ sizeof(input_image.matrix[0]);
5643
int image_cols = sizeof(input_image.matrix[0])/ sizeof(int);
5744
//Image output_image;
@@ -102,5 +89,5 @@ int sc_main (int argc, char* argv[]) {
10289
sc_close_vcd_trace_file(wf);
10390
return 0;// Terminate simulation
10491

105-
}
92+
}
10693
#endif // IPS_JPG_PV_EN

modules/unification/src/unification_tb.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,15 @@
1010
#include "include/stb_image_write.h"
1111

1212
#include <systemc.h>
13-
#include "math.h"
13+
#include <math.h>
1414

1515
#ifdef IMG_UNIFICATE_PV_EN
1616
#include "unification_pv_model.hpp"
1717
#endif
1818

19-
int sc_main (int argc, char* argv[]) {
20-
19+
int sc_main(int, char*[]) {
2120
unsigned char pixel_x, pixel_y;
2221
unsigned char pixel_magnitude;
23-
int i;
2422
int width, height, channels, pixel_count;
2523
unsigned char *img_x, *img_y, *img_unificated;
2624

0 commit comments

Comments
 (0)