cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Visitor
Visitor
400 Views
Registered: ‎09-16-2020

@E Simulation failed: SIGSEGV

Jump to solution

Hi, I try to declare array like this 

int x[25][256000]

and it caused the  @E Simulation failed: SIGSEGV error. it only caused error in c simulation, but I can synthesize it without problem.

Is it possible to declare such big array for simulation? if it is possible, how?

0 Kudos
Reply
1 Solution

Accepted Solutions
Advisor
Advisor
333 Views
Registered: ‎04-26-2015

Luckily this is easy to fix: just declare it static:

 

static int x[25][256000]

 

This both fixes the problem and matches HLS behaviour better (in that this will allocate some memory just for that array that remains for as long as the program runs; it won't be deallocated when the function finishes).

View solution in original post

2 Replies
Advisor
Advisor
334 Views
Registered: ‎04-26-2015

Luckily this is easy to fix: just declare it static:

 

static int x[25][256000]

 

This both fixes the problem and matches HLS behaviour better (in that this will allocate some memory just for that array that remains for as long as the program runs; it won't be deallocated when the function finishes).

View solution in original post

Visitor
Visitor
324 Views
Registered: ‎09-16-2020

Hi, thank you for the reply. And it does help the simulation, I can simulate it without error now

But, the problem now, I am initializing the x array using another function, and based on my reading, I cannot do that if it is static.

static int x[25][256000];
int i, j;

x[24][1] = 1;

for(i=24; i<=0; i--){
   for(j=1; j<256000; j++){
      x[i][j] = otherfunc();
   }
}

printf("x[24][1]=%d\n", x[24][1]);
printf("x[24][2]=%d\n", x[24][2]);

this is my code right now

x[24][1]=1
x[24][2]=0

and this is the result. I can initialized x[24][1] but not other elements in the array.

is there any other way? correct me if I'm wrong

thank you

0 Kudos
Reply