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 

Conflicts across FSM seq stmts

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



Joined: 19 Dec 2017
Posts: 2

PostPosted: Sat Jan 19, 2019 12:50 pm    Post subject: Conflicts across FSM seq stmts Reply with quote

A simple testbench:

Code:
module mkArbiterTest(Empty);

   Reg#(Bit#(32)) cycle <- mkReg(0);
   rule every_cycle;
      cycle <= cycle + 1;
   endrule

   //---------------------------------------------------------------------------                 

   Arbiter#(3) arb <- mkRRArbiter();

   Stmt test_rr =
   seq
      $display("%d: -- RRArbiter tests", cycle);
      par
         $display("%d: Test no requests", cycle);
         dynamicAssert(arb.clients[0].grant() == False, "");
         dynamicAssert(arb.clients[1].grant() == False, "");
         dynamicAssert(arb.clients[2].grant() == False, "");
         dynamicAssert(arb.grant_id == 0, "");
      endpar
      par
         $display("%d: Test all requests, first client granted", cycle);
         arb.clients[0].request();
         arb.clients[1].request();
         arb.clients[2].request();
         dynamicAssert(arb.clients[0].grant() == True, "");
         dynamicAssert(arb.clients[1].grant() == False, "");
         dynamicAssert(arb.clients[2].grant() == False, "");
         dynamicAssert(arb.grant_id == 0, "");
      endpar
      par
         $display("%d: Test no requests, no grant_id", cycle);
         dynamicAssert(arb.clients[0].grant() == False, "");
         dynamicAssert(arb.clients[1].grant() == False, "");
         dynamicAssert(arb.clients[2].grant() == False, "");
         dynamicAssert(arb.grant_id == 0, "");
      endpar
      par
         $display("%d: Test all requests, second client granted", cycle);
         arb.clients[0].request();
         arb.clients[1].request();
         arb.clients[2].request();
         dynamicAssert(arb.clients[0].grant() == False, "");
         dynamicAssert(arb.clients[1].grant() == True, "");
         dynamicAssert(arb.clients[2].grant() == False, "");
         dynamicAssert(arb.grant_id == 1, "");
      endpar
   endseq;

   mkAutoFSM(test_rr);

endmodule


Produces these bsc warnings:

Code:
Warning: "ArbiterTest.bsv", line 8, column 8: (G0010)
  Rule "action_l31c13" was treated as more urgent than
  "action_l48c13". Conflicts:
    "action_l31c13" cannot fire before "action_l48c13":
      calls to arb_client_request_0.wset vs. arb_client_request_0.wset
    "action_l48c13" cannot fire before "action_l31c13":
      calls to arb_client_request_0.wset vs. arb_client_request_0.wset
Warning: "ArbiterTest.bsv", line 8, column 8: (G0010)
  Rule "action_l32c13" was treated as more urgent than
  "action_l49c13". Conflicts:
    "action_l32c13" cannot fire before "action_l49c13":
      calls to arb_client_request_1.wset vs. arb_client_request_1.wset
    "action_l49c13" cannot fire before "action_l32c13":
      calls to arb_client_request_1.wset vs. arb_client_request_1.wset
Warning: "ArbiterTest.bsv", line 8, column 8: (G0010)
  Rule "action_l33c13" was treated as more urgent than
  "action_l50c13". Conflicts:
    "action_l33c13" cannot fire before "action_l50c13":
      calls to arb_client_request_2.wset vs. arb_client_request_2.wset
    "action_l50c13" cannot fire before "action_l33c13":
      calls to arb_client_request_2.wset vs. arb_client_request_2.wset


Each par block should execute sequentially one after the other.

So, why are there conflicts when calling request() across the par blocks?
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