Jump to content

SystemC stack overflow on large system


Recommended Posts

Hi there,


I want to simulate a lager system which calculates the inner product of two large vectors. The target vector size is 10^6, but now I can only achieve 4096. When the size N equals 8192, it reports an error: ./../src/systemc/sc_cor_qt.cpp:115: virtual void sc_core::sc_cor_qt::stack_protect(bool): Assertion `ret == 0' failed.


I tried set_stack_size which does not work. Because any single thread is not large. They are either an adder or a multiplier. But the whole system is quite large, containing N multiplier and more than N adders. I guess enlarge the stack for sc_main may help, but I do not know how to do that. There is such an option in ModelSim, however, it does not work for my case.


Does anybody have any suggestion? Thanks.



Link to post
Share on other sites

I'd guess, that this is not a stack overflow but an out-of-memory issue, where the kernel fails to obtain enough memory for your processes.


Maybe, you can switch your modeling style from SC_THREADs to using SC_METHODs, or even decrease the stack size as a first step?




Yes, it works! Thank you, Philipp. I changed all the SC_THREADs to SC_METHODS and now I can run a size as large as 32768. When N=65536, the 8GB memory on my computer runs out, but there are no errors any more. For SC_METHODS, I cannot change the stack size. So for the next step, probably I need to improve the algorithm.


Anyway, this problem is solved. Thanks again!

Link to post
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...