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 

Prelude.bs error

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



Joined: 26 May 2008
Posts: 10

PostPosted: Tue Mar 17, 2009 12:17 am    Post subject: Prelude.bs error Reply with quote

I am getting the following error. Some one help me. If you need more information, please reply. Thank you.
Quote:
checking package dependencies
compiling controller.bsv
code generation for mkController starts
Warning: "Prelude.bs", line 2469, column 0: (G0024)
The function unfolding steps interval has been exceeded when unfolding
`Prelude.primFix'. The current number of steps is 100000. Next warning at
200000 steps. Elaboration terminates at 1000000 steps.
Warning: "Prelude.bs", line 2469, column 0: (G0024)
The function unfolding steps interval has been exceeded when unfolding
`Prelude.primFix'. The current number of steps is 200000. Next warning at
300000 steps. Elaboration terminates at 1000000 steps.
Stack space overflow: current size 10000000 bytes.
Use `+RTS -Ksize' to increase it.


I increased the stack size using
Code:
  +RTS -K51200k


Still I get
Quote:
Warning: "Prelude.bs", line 2469, column 0: (G0024)
The function unfolding steps interval has been exceeded when unfolding
`Prelude.primFix'. The current number of steps is 900000. Next warning at
1000000 steps. Elaboration terminates at 1000000 steps.
Error: "Prelude.bs", line 2469, column 0: (G0024)
The maximum number of function unfolding steps has been exceeded when
unfolding `Prelude.primFix'. You can use the flags "-steps N",
"-steps-warn-interval N", and "-steps-max-intervals N" to set the maximum
number of steps. The current maximum is 1000000.


Please help me with this.
Back to top
View user's profile Send private message
quark
Site Admin


Joined: 02 Nov 2007
Posts: 499

PostPosted: Tue Mar 17, 2009 12:28 pm    Post subject: Re: Prelude.bs error Reply with quote

It sounds like you might have recursive definitions that are resulting in an infinite loop.

You are seeing two messages, which are similar: "out of stack" and "function unfolding steps exceeded". Both of these messages occur because some iteration in the static elaboration phase of the compiler (a while-loop or for-loop, or a recursive function call, or something like that) is taking a long time. (The position information, line 2469 of the Prelude in your case, is just the point at which it happened to run out of steps, and is completely irrelevant: please ignore it.)

This might not be an error at all -- you might simply have written a design that takes a long time to unfold. As you saw with the "out of stack" error, you can increase the stack size, hoping that the design will finish elaborating if it is given more stack space. Similarly, it is possible that the design just needs a slightly higher function unfolding limit. In this case you can allow it to go on for longer, by using the -steps-max-intervals flag. (Note that the argument of this flag is the number of intervals, not the number of steps. The "current maximum" given in the error report is the product of the number of steps in each interval, set by the -steps-warn-interval flag, and the number of intervals, set by the -steps-max-intervals flag.)

On the other hand, the error report might be an indication that you have accidentally written an iteration that does not terminate. It could be that no matter how big you make the stack or how high you set the unfolding limit, the design will run out of stack or hit that limit. So you should check all the iterations in your design to make sure you haven't done that.

One way this might occur is if the termination condition of a loop depends on a value which isn't available till the hardware is actually running (e.g. the contents of a register). This isn't allowed of course, because these loops are unfolded at compile time, before the hardware exists. The compiler tries to check for this (and report an error), but it doesn't catch all cases.

Other possibilities are that you have defined a recursive function but forgot the termination condition or left out the increment step so that it never reaches the condition.

If you suspect that there is a problem in your design but you are unable to find it, feel free to email the code to [email protected] and we'd be happy to take a look.
Back to top
View user's profile Send private message
tyeowkwa



Joined: 09 Feb 2010
Posts: 7

PostPosted: Fri Mar 19, 2010 1:19 pm    Post subject: Re: Prelude.bs error Reply with quote

quark wrote:
It sounds like you might have recursive definitions that are resulting in an infinite loop.

You are seeing two messages, which are similar: "out of stack" and "function unfolding steps exceeded". Both of these messages occur because some iteration in the static elaboration phase of the compiler (a while-loop or for-loop, or a recursive function call, or something like that) is taking a long time. (The position information, line 2469 of the Prelude in your case, is just the point at which it happened to run out of steps, and is completely irrelevant: please ignore it.)

This might not be an error at all -- you might simply have written a design that takes a long time to unfold. As you saw with the "out of stack" error, you can increase the stack size, hoping that the design will finish elaborating if it is given more stack space. Similarly, it is possible that the design just needs a slightly higher function unfolding limit. In this case you can allow it to go on for longer, by using the -steps-max-intervals flag. (Note that the argument of this flag is the number of intervals, not the number of steps. The "current maximum" given in the error report is the product of the number of steps in each interval, set by the -steps-warn-interval flag, and the number of intervals, set by the -steps-max-intervals flag.)

On the other hand, the error report might be an indication that you have accidentally written an iteration that does not terminate. It could be that no matter how big you make the stack or how high you set the unfolding limit, the design will run out of stack or hit that limit. So you should check all the iterations in your design to make sure you haven't done that.

One way this might occur is if the termination condition of a loop depends on a value which isn't available till the hardware is actually running (e.g. the contents of a register). This isn't allowed of course, because these loops are unfolded at compile time, before the hardware exists. The compiler tries to check for this (and report an error), but it doesn't catch all cases.

Other possibilities are that you have defined a recursive function but forgot the termination condition or left out the increment step so that it never reaches the condition.

If you suspect that there is a problem in your design but you are unable to find it, feel free to email the code to [email protected] and we'd be happy to take a look.


where should I write this code to extend the stack memory?

+RTS -K51200k
Back to top
View user's profile Send private message
quark
Site Admin


Joined: 02 Nov 2007
Posts: 499

PostPosted: Fri Mar 19, 2010 1:45 pm    Post subject: Re: Prelude.bs error Reply with quote

tyeowkwa wrote:
where should I write this code to extend the stack memory?


These are flags that can be given on the command-line to BSC:
Code:
# bsc +RTS (rts flags) -RTS (bsc flags)


Flags that control system resources, like memory, are delimited with +RTS and -RTS. These are Run-Time System flags. See the BSC User Guide for more information on these flags.
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