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 

bug in bsim when use mkLFIFO in interface

 
Post new topic   Reply to topic    bluespec.com Forum Index -> Tools: Bluesim
View previous topic :: View next topic  
Author Message
test001
Guest





PostPosted: Thu Jun 25, 2009 7:35 am    Post subject: bug in bsim when use mkLFIFO in interface Reply with quote

I build this example with
Code:
bsc -u -sim -simdir obj -bdir obj -info-dir obj -aggressive-conditions -show-range-conflict -p .:%/Prelude:%/Libraries -keep-fires -g mkTb  mkTb.bsv

bsc -u -sim -simdir obj -bdir obj -info-dir obj -aggressive-conditions -show-range-conflict -p .:%/Prelude:%/Libraries -keep-fires -e mkTb  *.ba

After run the a.out, I found the state never enter ST_End.

When I rebuild it with Verilog, it work fine.

At the next, I return to bsim, I change mkLFIFOF to mkFIFOF, it work fine also.
I think here has some bug.



mkTb_bug.rar
 Description:

Download
 Filename:  mkTb_bug.rar
 Filesize:  833 Bytes
 Downloaded:  1215 Time(s)

Back to top
quark
Site Admin


Joined: 02 Nov 2007
Posts: 496

PostPosted: Thu Jun 25, 2009 2:02 pm    Post subject: Reply with quote

Thank you for the example. This is indeed a bug in Bluesim, but it is not about the mkLFIFO module. The problem is between the rule "do_test" in the dut and the combination of rule "test" in mkTb and the method "my_new" in the dut.

You can workaround the problem by splitting the rule "test" into separate rules:
Code:
rule test0 (cycles == 0); ... endrule

rule test1 (cycles == 1); ... endrule

The problem can occur when (1) a method and a rule are mutually exclusive and (2) the method is conditionally called inside a rule in the parent module and (3) the -aggressive-conditions flag is used. Even then, it only occurs under certain schedules, which is why the choice of mkLFIFO vs mkFIFO triggers the bug.

The rule "do_test" and the method "my_test" are mutually exclusive because their predicates test for different values of the "state" register. And the method is called conditionally, because only some branches of the case-statement in rule "test" call the method. The workaround works because it creates a rule ("test1") in which the method is always called (there are no branches in which it is not called).

We will fix the bug for a future release, but in the meantime I hope that the workaround will be sufficient.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    bluespec.com Forum Index -> Tools: Bluesim 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