Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

using script.tcl to build a prj in vivado hls 2018.3 error #2

Open
milozzzyj opened this issue Aug 26, 2019 · 4 comments
Open

using script.tcl to build a prj in vivado hls 2018.3 error #2

milozzzyj opened this issue Aug 26, 2019 · 4 comments

Comments

@milozzzyj
Copy link

milozzzyj commented Aug 26, 2019

i run like readme.md

image

there is an error:
image

@onioncc
Copy link
Collaborator

onioncc commented Sep 21, 2019

Hi, can you try to debug using the generated executable under the build/bin dictionary to locate the exact crash point?

Best,
Cong

@haihengcao
Copy link

I've met the exact problem in 2019.2 Vivado HLS;Can't see any concrete error either

@haihengcao
Copy link

it turns out that the stack size is not large enough.
https://forums.xilinx.com/t5/Vivado/XAPP1167-%E8%87%AA%E5%B8%A6%E4%BE%8B%E7%A8%8Bremap%E5%B7%A5%E7%A8%8B-%E6%8A%A5%E9%94%99/td-p/890685
增加栈的大小。具体方式为将Vivado HLS的Project Settings-->Simulation-->Linker Flags设置为-Wl,--stack,10485670。但是需要注意的是这种方法可能会因为机器没有足够的内存而无效。

Solved.

@onioncc onioncc closed this as completed Mar 24, 2020
@onioncc onioncc reopened this Mar 24, 2020
@weiren2
Copy link

weiren2 commented Apr 11, 2020

The default stack size on Windows is usually smaller than Linux (typically 8MB). This could explain why the code runs fine (assume it was developed in a Linux environment) but not on my Windows machine.

I think the large local array debug (on line 400) is likely to cause stack overflow.

SkyNet/FPGA/HLS/tb.cc

Lines 395 to 402 in 007e445

std::ifstream ifs_image_raw_g(img_g, std::ios::in | std::ios::binary);
ifs_image_raw_g.read((char*)(image_raw_g_burst), 3*162*2*322*2*sizeof(uint8));
float predict_box[4][5];
int constant[4][3]; //conf_j, conf_m, conf_n
float debug[10][32][44][84];
float box[4] = {1.4940052559648322, 2.3598481287086823, 4.0113013115312155, 5.760873975661669};

As mentioned in #2 (comment), you can increase stack size to a larger value (at least a little more than 10x32x44x84 floats or ~4.5MB).

If you don't want to increase stack size, you can try modify the local array to static (static float debug[10][32][44][84];) so it won't use stack to hold the array any more. (I'm not sure what the debug array does but the enclosing function test_one_group is only called once in the testbench so making it static should be safe).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants