yjt98765 Posted October 15, 2015 Report Share Posted October 15, 2015 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. Jintao Quote Link to comment Share on other sites More sharing options...
Hans64 Posted October 15, 2015 Report Share Posted October 15, 2015 Hi Jintao, You can change the Modelsim SystemC stacksize by modifying the ScMainStackSize variable in your modelsim.ini file. I believe there is also a SystemC set_stack_size() call you can use. Good luck, Hans. www.ht-lab.com Quote Link to comment Share on other sites More sharing options...
yjt98765 Posted October 15, 2015 Author Report Share Posted October 15, 2015 Thank you, Hans. I tried this two methods, but they do not work. The error remains. Quote Link to comment Share on other sites More sharing options...
Philipp A Hartmann Posted October 15, 2015 Report Share Posted October 15, 2015 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? hth, Philipp yjt98765 1 Quote Link to comment Share on other sites More sharing options...
yjt98765 Posted October 16, 2015 Author Report Share Posted October 16, 2015 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? hth, Philipp 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! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.