Giter VIP home page Giter VIP logo

Comments (4)

weiren2 avatar weiren2 commented on July 22, 2024 1

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).

from skynet.

onioncc avatar onioncc commented on July 22, 2024

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

Best,
Cong

from skynet.

haihengcao avatar haihengcao commented on July 22, 2024

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

from skynet.

haihengcao avatar haihengcao commented on July 22, 2024

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.

from skynet.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.