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 

Understanding rules behavior in multiple modules

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



Joined: 20 Nov 2018
Posts: 1

PostPosted: Fri Nov 23, 2018 8:24 am    Post subject: Understanding rules behavior in multiple modules Reply with quote

Regarding example Eg02c_HelloWorld in the provided tutorials on github.
https://github.com/BSVLang/Main/tree/master/Tutorials/BSV_Training/Example_Programs
It has two modules with 3 rules total as following:
* mkDeepThought
* rl_think
* mkTestbench
* rl_ask
* rl_print_answer

#######
Part #1

According to Lec3_Rule_Semantics

For each clock:
Consider each rule in order
If rJ does not conflict with earlier rules (r1..rJ-1)
Execute rJ according to the per-rule semantics

How this is applied to the above 3 rules given that there is an instance of mkDeepThough inside mkTestbench.

------------
Part #2
* To my understanding conditions of ActionValue and Action methods become part of the rule condition itself. So condition of the following method ( method whatIsTheAnswer inside mkDeepThought module) will be part of rule rl_ask inside mkTestbench module
Code:
 
// mkDeepThought module
method Action whatIsTheAnswer if (rg_state_dt == IDLE );
      rg_state_dt <= THINKING;
   endmethod

// mkTestbench module
   rule rl_ask;
      $display ("Asking the Ultimate Question of Life, The Universe and Everything");
      deepThought.whatIsTheAnswer;
   endrule


If I changed the the condition of `whatIsTheAnswer` to `rg_state_dt == IDLE || rg_state_dt == THINKING`, rl_ask keeps executing forever and rl_think inside mkDeepThought never executes although its condition is true. Why does this happen and doesn't this conflict with part mentioned of the lecture above ? What I am missing here ?

Note: #1 I didn't post the full code in order not to bloat the post, so please refer to the github repo.
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