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 

subinterfaces and method calling

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



Joined: 12 Jun 2012
Posts: 17

PostPosted: Tue Jun 19, 2012 3:50 pm    Post subject: subinterfaces and method calling Reply with quote

Hi, so my code is laid out where my top most module has the interface x:

interface x;
interface y
interface z
endinterface

interface y;
method a
endinterface

interface z;
method b
method c
endinterface

in a separate module, i instantiate something with interface x
then i do something like

rule
x.z.c;
x.z.b;
endrule

However, when I try to compile that, it's not happy about it; it says that there's methods that conflicts in parallel even though I know for sure that the different methods I'm calling do not interact with each other.

Is it just that Bluespec doesn't like it when I call methods from the same subinterface in the same rule, or I'm I missing something?
Back to top
View user's profile Send private message
zhangka



Joined: 12 Jun 2012
Posts: 17

PostPosted: Tue Jun 19, 2012 3:57 pm    Post subject: Reply with quote

update:

if instead of doing the 2 method calls in 1 rule, I separate them into different rules, it works...
Back to top
View user's profile Send private message
quark
Site Admin


Joined: 02 Nov 2007
Posts: 500

PostPosted: Tue Jun 19, 2012 5:50 pm    Post subject: Re: subinterfaces and method calling Reply with quote

Two methods can conflict in parallel if they write to the same state. However, they can also conflict in parallel if there is a data dependency that causes a rule to execute between them. For instance, if method m1 writes to a wire which is read by rule rA, and rule rA writes to a wire that is read by method m2. In this case, BSC will insist that methods m1 and m2 cannot be used together in the same rule in the top module (call it "rTop"), because there is no way for m1 and m2 to be called simultaneously and still have rA execute between them. The result is that m1 and m2 have to be called from separate rules, so that rA can execute in between.

If you want to see more information about why BSC concluded a relationship for a pair of methods, there are two things you can do. One is to view the relationship in the Bluespec Workstation using the Schedule window. The other is to provide the -show-rule-rel or -show-rul-rel-all flag on the command line (which will dump relationship information as text).
Back to top
View user's profile Send private message
zhangka



Joined: 12 Jun 2012
Posts: 17

PostPosted: Tue Jun 19, 2012 6:14 pm    Post subject: Reply with quote

However, this bsv code I'm writing is simply a wrapper for a verilog file. As such, the methods I'm trying to call in a single rule are all methods that just feeds input into the verilog file, which shouldn't have any dependencies with each other.
Back to top
View user's profile Send private message
quark
Site Admin


Joined: 02 Nov 2007
Posts: 500

PostPosted: Wed Jun 20, 2012 12:19 pm    Post subject: Reply with quote

When importing a Verilog module, you are the one who specifies what the relationships are between the methods. So if BSC is complaining that the methods conflict, it's because you specified that in the import.

Try changing the "schedule" statements in the import-BVI. Consider using SB (instead of SBR) or CF.

Also, when you say that the "methods are just feeding inputs", it makes me wonder if there might be a better style for writing the interface. If the methods are expected to be called together, consider using one method with multiple arguments instead of separate methods.
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