cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
UdayanMallik
Visitor
Visitor
201 Views
Registered: ‎02-01-2021

@E Simulation failed: SIGSEGV.

I am compiling my HLS testbench to simulate a simple multiplier.

I am receiving the error described in the title.

@E Simulation failed: SIGSEGV.

Does anyone know of a quick solution to the problem?

 

Test Bed.

/*********************************************************
.h file for program in Vivado HLS to multiply two floating
point numbers
*********************************************************/

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "FloatingMultiplication.h"

int main () {

// Number of Samples in the input file - Forcing File
int SAMPLES=5;


// File to print computed data
FILE *fp;

// File to read input data
FILE *fr;


// Variable to read input data
char tp[32];
data_t output;

// Open output File
fp=fopen("out.dat","w");
float a;


// Open input file
fr=fopen("squareArrayIn.dat",'r');


for (int i=0;i<=SAMPLES;i++) {

// Scan input file for input to the Simulation
fscanf(fr, "%s",tp);

// Convert the string to a floating point number
a = atof(tp);

// Compute
FloatingMultiplication(&output,a);

fprintf(fp,"%f\n", output);
}
fclose(fr);
fclose(fp);

// Lets compare the numbers
printf ("Comparing against output data \n");
if (system("diff -w out.dat squareArrayOUT.gold.dat")) {
fprintf(stdout, "*******************************************\n");
fprintf(stdout, "FAIL: Output DOES NOT match the golden output\n");
fprintf(stdout, "*******************************************\n");
return 1;
} else {
fprintf(stdout, "*******************************************\n");
fprintf(stdout, "PASS: The output matches the golden output!\n");
fprintf(stdout, "*******************************************\n");
return 0;
}
}

 

The Device under Test is:

 

#include "FloatingMultiplication.h"

void FloatingMultiplication (data_t* b, data_t a)
{
*b = a * a;
}

 

/*********************************************************
.h file for program in Vivado HLS to multiply two floating
point numbers
*********************************************************/


#ifndef FLOATINGMULTIPLICATION_H_
#define FLOATINGMULTIPLICATION_H_

typedef float data_t;

void FloatingMultiplication (data_t* b, data_t a);

#endif

0 Kudos
0 Replies