cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
simchask
Explorer
Explorer
2,036 Views
Registered: ‎11-23-2017

C TB Failed, after XSIM completed

Jump to solution

I manage to simulate my simple code with a testbench. After XSIM completes, I get these messages.

INFO: [COSIM 212-302] Starting C TB testing ... 
ERROR: System recieved a signal named SIGSEGV and the program has to stop immediately!
This signal was generated when a program tries to read or write outside the memory that is allocated for it, or to write memory that can only be read.
Possible cause of this problem may be: 1) the depth setting of pointer type argument is much larger than it needed; 2)insufficient depth of array argument; 3)null pointer etc.
Current execution stopped during CodeState = DUMP_INPUTS.
You can search CodeState variable name in apatb*.cpp file under ./sim/wrapc dir to locate the position.

ERROR: [COSIM 212-360] Aborting co-simulation: C TB simulation failed.
ERROR: [COSIM 212-320] C TB testing failed, stop generating test vectors. Please check C TB or re-run cosim.
ERROR: [COSIM 212-4] *** C/RTL co-simulation finished: FAIL ***
command 'ap_source' returned error code
    while executing
"source C:/Users/Owner/DDRConst2/solution1/cosim.tcl"
    invoked from within
"hls::main C:/Users/Owner/DDRConst2/solution1/cosim.tcl"
    ("uplevel" body line 1)
    invoked from within
"uplevel 1 hls::main {*}$args"
    (procedure "hls_proc" line 5)
    invoked from within
"hls_proc $argv"
Finished C/RTL cosimulation.

Note that my main function always returns 0.

The test bench:

#include <stdio.h>
#include "DDRConst.h"

unsigned char mem[11];
unsigned char s;


int main()
{
//#pragma HLS INTERFACE s_axilite depth=200000 port=mem bundle=mem_b

	DDRConst(mem,10, 5);
	for (int i=0; i<11; i++)
		printf("mem cell %X: %X \n", i, mem[i]);

	return(0); //Will always report failure otherwise
}
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
simchask
Explorer
Explorer
2,374 Views
Registered: ‎11-23-2017

Solved my own problem.

Very annoying - compiler keeps warning that if the depth of the master port is insufficient there will be problems. So I kept increasing it until it reached 2000000.

When I reduced it to 100 the warning stayed but the error disappeared.

View solution in original post

2 Replies
simchask
Explorer
Explorer
2,375 Views
Registered: ‎11-23-2017

Solved my own problem.

Very annoying - compiler keeps warning that if the depth of the master port is insufficient there will be problems. So I kept increasing it until it reached 2000000.

When I reduced it to 100 the warning stayed but the error disappeared.

View solution in original post

yaya04
Visitor
Visitor
714 Views
Registered: ‎07-30-2019

I've seen similar error and solved it by following your solution.

 

It seems that the depth of the interface should be the size of the array.

 

Thanks anyway.

Chaeeon.

0 Kudos