bluespec.com Forum Index bluespec.com
Bluespec Forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Segmentation Fault Issue

 
Post new topic   Reply to topic    bluespec.com Forum Index -> Designing with BSV's Rules, Interfaces, ...
View previous topic :: View next topic  
Author Message
gagan



Joined: 21 Aug 2014
Posts: 17

PostPosted: Tue May 19, 2015 4:54 am    Post subject: Segmentation Fault Issue Reply with quote

The thing is , If i only do compile , design compiles without throwing any error
If i do Complle + Link , compiler gives segmentation fault.

sh: line 1: 18933 Segmentation fault (core dumped) bsc -u -sim -simdir build -bdir build -info-dir build -keep-fires -aggressive-conditions -p .:%/Prelude:%/Libraries:%/Libraries/BlueNoC:./bsv_src:./../Axi4:%/Libraries/TLM3:%/Libraries/Axi:./Apb -g mkTestbench bsv_src/Testbench.bsv

Any suggestions..?
Back to top
View user's profile Send private message
quark
Site Admin


Joined: 02 Nov 2007
Posts: 500

PostPosted: Wed May 20, 2015 4:00 pm    Post subject: Re: Segmentation Fault Issue Reply with quote

This is probably not a segfault. It is likely that BSC is encountering an error (such as running out of memory) and that is being displayed as a segfault in this case. On some operating systems, when a program is run inside a shell script, if the program aborts with an out-of-memory error, then the shell script wrapper will display a segfault, rather than show the out-of-memory error. When we execute BSC, we're actually calling a shell script, and inside that script the actual BSC program is called; so that's probably what's going on here.

To confirm this, you can run the BSC executable directly, instead of through a script. To do that, you'll need to set BLUESPECDIR and also add a directory to LD_LIBRARY_PATH:
Code:
setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:${BLUESPECDIR}/SAT/g++4_64/

Once you do that, you can run the executable found here:
Code:
${BLUESPECDIR}/bin/linux64/bsc

(Or use the 'linux32' subdirectory, if you're on a 32-bit host).

If you run BSC that way, do you see a better error message?

You can also identify which stage of compilation is having the problem, by using the -v flag. With this flag, BSC will print messages each time it enters and exits a stage. By looking at the last message before the error, you can tell what stage failed. If it's the 'expanded' stage (which is the elaboration of the design), then you can get even more precise information by using the -show-elab-progress flag. This flag will cause BSC to print messages each time it enters and exits a submodule in the design, or a rule within a module. If BSC is using too much memory (or taking too much time) during elaboration, this flag will help you identify which module or rule is the source of the difficulty.

You report that BSC finishes successfully when you only do type-checking (no synthesis), but that BSC aborts when you try synthesis. This suggests that it probably is a memory issue, and probably during elaboration. It's possible that you have written code that expands too large (perhaps even an infinite loop), and BSC is running out memory when it tries to unfold the design. The -show-elab-progress flag will help identify where that is happening. If you think that your design is OK, then you can send it to [email protected] and we can see if it's a BSC bug. (It would also help if you can report what version of BSC you're using.)
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    bluespec.com Forum Index -> Designing with BSV's Rules, Interfaces, ... All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum
bluespec.com topic RSS feed 


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP