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.

 

Jintao

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?

 

hth,

 Philipp

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?

 

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!

Link to post
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...