Skip to content

Commit

Permalink
Merge pull request #16 from ErickOF/feature-qa_checks
Browse files Browse the repository at this point in the history
Fixing Lint violations for quality checks
  • Loading branch information
ErickOF authored Jun 18, 2024
2 parents e5118fb + 642a58e commit 4ab3708
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 73 deletions.
34 changes: 10 additions & 24 deletions modules/compression/src/ips_jpg_at_testbench.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand All @@ -33,32 +37,15 @@ 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<sc_int<32> > matrix_element;
sc_signal<sc_int<32> > matrix_row;
sc_signal<sc_int<32> > matrix_col;
sc_signal<sc_int<8> > Array_element;
sc_signal<sc_int<32> > array_index;
sc_signal<sc_int<32> > 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;
Expand Down Expand Up @@ -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
31 changes: 8 additions & 23 deletions modules/compression/src/ips_jpg_lt_testbench.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand All @@ -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;
Expand Down Expand Up @@ -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
31 changes: 9 additions & 22 deletions modules/compression/src/ips_jpg_pv_testbench.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand All @@ -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;
Expand Down Expand Up @@ -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
6 changes: 2 additions & 4 deletions modules/unification/src/unification_tb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,15 @@
#include "include/stb_image_write.h"

#include <systemc.h>
#include "math.h"
#include <math.h>

#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;

Expand Down

0 comments on commit 4ab3708

Please sign in to comment.