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 

Method guard and scheduling

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



Joined: 24 Feb 2011
Posts: 9

PostPosted: Wed Jun 17, 2015 9:10 am    Post subject: Method guard and scheduling Reply with quote

Hello,

I did not find any previous post discussing about this, but maybe I am repeating a question.

I have a module with a guarded method and a guarded rule like the following:

Code:

Reg#(Bit#(32)) counterReg <- mkRegA(0);

rule a_rule ( counterReg > 0 );
    counterReg <= counterReg - 1;
endrule

method Action a_method(Bit#(32) new_val) if ( counterReg == 0 );
    counterReg <= new_val;
endmethod


Why does the compiler complain about the method and the rule conflicting? They cannot fire at the same cycle.

Is there a better method to implement this?

Thank you.
Back to top
View user's profile Send private message
quark
Site Admin


Joined: 02 Nov 2007
Posts: 496

PostPosted: Wed Jun 17, 2015 12:00 pm    Post subject: Re: Method guard and scheduling Reply with quote

This example does not have a conflict when I try it. What version of BSC are you using? And can you show the whole code (so that I know that I'm running exactly what you're running) and when you say that BSC complains about them conflicting, can you show the output from BSC which indicates that?
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