anchor.diff:     mkAutoFSM (cmdFetch);
      mkAutoFSM (cmdDispatch);
      mkAutoFSM (cmdCompletion);
  +   mkAutoFSM (responseArbiter);
   
   
         // to start a command, doCommand fires off a memory read to the
  
positive.code: 	 return nopEngine;
     endfunction
  
     Stmt cmdFetch =   seq
        while (True) seq
  	 while(!(hwenabled && cmdRing.notEmpty())) noAction;
  	 cmd_read_chan.readReq.put(
  	    DMAAddressRequest{handle: cmdRing.memhandle,
  	       address: cmdRing.bufferlast, burstLen: 8, tag: 0});
  	 cmdRing.pop(64);
        endseq
  		     endseq;
  
     Stmt cmdDispatch = 
     seq
        while (True) seq
  	 action
  	    let rv <- cmd_read_chan.readData.get();
  	    cmd <= rv.data;
  	    cmdifc.request.put(rv.data);
  	 endaction
  	 for (dispCtr <= 1; dispCtr < 8; dispCtr <= dispCtr + 1)
  	    action
  	       let rv <- cmd_read_chan.readData.get();
  	       cmdifc.request.put(rv.data);
  	    endaction
        endseq
     endseq;
  
negative.code:       while(True) seq
  	 if (statusRing.notFull() && copyEngine.response.notEmpty())
  	    seq
  	       $display("responseArbiter copyEngine completion");
  	       status_write_chan.writeReq.put(
  		  DMAAddressRequest{handle: statusRing.memhandle, 
  		     address: statusRing.bufferfirst, burstLen: 8, tag: 0});
  	       for (respCtr <= 0; respCtr < 8; respCtr <= respCtr + 1)
  		  action
  		     let rv <- copyEngine.response.get();
  		     status_write_chan.writeData.put(DMAData{data: rv, tag: 0});
  		  endaction
  	       statusRing.push(64);
  	    endseq
  
  	 if (statusRing.notFull() && echoEngine.response.notEmpty())
  	    seq
  	       $display("responseArbiter echoEngine completion");
  	       status_write_chan.writeReq.put(
  		  DMAAddressRequest{handle: statusRing.memhandle, 
  		     address: statusRing.bufferfirst, burstLen: 8, tag: 0});
  	       for (respCtr <= 0; respCtr < 8; respCtr <= respCtr + 1)
  		  action
  		     let rv <- echoEngine.response.get();
  		     status_write_chan.writeData.put(DMAData{data: rv, tag: 0});
  		  endaction
  	       statusRing.push(64);
  	    endseq
  
        endseq
  