anchor.diff:  	    wordCount = reqLimitReg - reqTailReg;
   	    tail = 4;
   	 end
  -	 //$display("requestMessage id=%d tail=%h wordCount=%d", sglIdReg, reqTailReg, wordCount);
  +	 if (verbose) $display("requestMessage id=%d tail=%h head=%h wordCount=%d", sglIdReg, reqTailReg, reqHeadReg, wordCount);
   
   	 reqTailReg <= tail;
   	 wordCountReg <= truncate(wordCount);
  -	 demuxCountReg <= truncate(wordCount);
  -	 let fetchCount = wordCount;
  -	 if ((fetchCount & 1) == 1)
  -	    fetchCount = fetchCount + 1;
   	 readEngine.readServers[0].request.put(MemengineCmd {sglId: sglIdReg,
   							     base: extend(reqTailReg << 2),
   							     burstLen: 16,
  -							     len: fetchCount << 2
  +							     len: wordCount << 2
   							     });
   	 reqState <= MessageHeaderRequested;
         endrule
   
  -      FIFOF#(Vector#(2,Maybe#(Bit#(32)))) readFifo <- mkFIFOF();
  -      rule demuxwords;
  +      MIFO#(4,1,4,Bit#(32)) readMifo <- mkMIFO();
  +      rule demuxwords if (readMifo.enqReady());
   	 let data <- toGet(readEngine.dataPipes[0]).get();
   	 Vector#(2,Bit#(32)) dvec = unpack(data);
  -	 function Maybe#(a) toValid(a in); return tagged Valid in; endfunction
  -	 Vector#(2,Maybe#(Bit#(32))) mvec = map(toValid, dvec);
  -	 let demuxCount = demuxCountReg - 2;
  -	 if (demuxCountReg == 1) begin
  -	    mvec[1] = tagged Invalid;
  -	    demuxCount = 0;
  -	 end
  -	 demuxCountReg <= demuxCount;
  -	 readFifo.enq(mvec);
  -      endrule
  -
  -      PipeOut#(Vector#(2,Maybe#(Bit#(32)))) readPipe2 = toPipeOut(readFifo);
  -      PipeOut#(Maybe#(Bit#(32))) readPipe <- mkFunnel1(readPipe2);
  +	 let enqCount = 2;
  +	 Vector#(4,Bit#(32)) dvec4;
  +	 dvec4[0] = dvec[0];
  +	 dvec4[1] = dvec[1];
  +	 dvec4[2] = 0;
  +	 dvec4[3] = 0;
  +	 readMifo.enq(enqCount, dvec4);
  +      endrule
   
         rule receiveMessageHeader if (reqState == MessageHeaderRequested);
  -	 let maybehdr <- toGet(readPipe).get();
  -	 if (maybehdr matches tagged Valid .hdr) begin
  -	     let methodId = hdr[31:16];
  -	     let messageWords = hdr[15:0];
  -	     methodIdReg <= methodId;
  -	    if (verbose)
  -	     $display("receiveMessageHeader hdr=%x methodId=%x messageWords=%d wordCount=%d", hdr, methodId, messageWords, wordCountReg);
  -	     wordCountReg <= wordCountReg - 1;
  -	     messageWordsReg <= messageWords - 1;
  -	     if (wordCountReg <= 1)
  -		reqState <= UpdateTail;
  -	     else if (messageWords <= 1)
  -		reqState <= MessageHeaderRequested;
  -	     else
  -		reqState <= MessageRequested;
  -	 end
  -	 else begin
  -	    //$display("receiveMessageHeader tagged invalid %x wordCountReg", maybehdr, wordCountReg);
  +	 let vec <- toGet(readMifo).get();
  +	 let hdr = vec[0];
  +	 let methodId = hdr[31:16];
  +	 let messageWords = hdr[15:0];
  +	 methodIdReg <= methodId;
  +	 if (verbose)
  +	    $display("receiveMessageHeader hdr=%x methodId=%x messageWords=%d wordCount=%d", hdr, methodId, messageWords, wordCountReg);
  +	 wordCountReg <= wordCountReg - 1;
  +	 messageWordsReg <= messageWords - 1;
  +	 if (wordCountReg <= messageWords)
   	    reqState <= UpdateTail;
  -	 end
  +	 else if (messageWords == 1)
  +	    reqState <= MessageHeaderRequested;
  +	 else
  +	    reqState <= MessageRequested;
         endrule
   
         //GearBox(Bit#(64),Bit#(32)) gb <- mkNto1Gearbox(defaultClock,defaultReset,defaultClock,defaultReset);
         rule receiveMessage if (reqState == MessageRequested);
  -	 let maybedata <- toGet(readPipe).get();
  -	 if (maybedata matches tagged Valid .data) begin
  -	    //$display("receiveMessage data=%x messageWords=%d wordCount=%d", data, messageWordsReg, wordCountReg);
  -	     portal.requests[methodIdReg].enq(data);
  -
  -	     messageWordsReg <= messageWordsReg - 1;
  -	     wordCountReg <= wordCountReg - 1;
  -	     if (messageWordsReg <= 1)
  -		reqState <= MessageHeaderRequested;
  -	     else if (wordCountReg <= 1)
  -		reqState <= UpdateTail;
  -	 end
  -	 else begin
  -	    //$display("receiveMessage tagged Invalid %x", maybedata);
  +	 let vec <- toGet(readMifo).get();
  +	 let data = vec[0];
  +	 $display("receiveMessage data=%x messageWords=%d wordCount=%d", data, messageWordsReg, wordCountReg);
  +	 if (methodIdReg != 16'hFFFF)
  +	    portal.requests[methodIdReg].enq(data);
  +
  +	 messageWordsReg <= messageWordsReg - 1;
  +	 wordCountReg <= wordCountReg - 1;
  +	 if (messageWordsReg == 1)
  +	    reqState <= MessageHeaderRequested;
  +	 else if (wordCountReg <= 1)
   	    reqState <= UpdateTail;
  -	 end
         endrule
   
         rule updateTail if (reqState == UpdateTail);
  -	 //$display("updateTail: tail=%d", reqTailReg);
  +	 $display("updateTail: tail=%d", reqTailReg);
   	 // update the tail pointer
   	 writeEngine.writeServers[0].request.put(MemengineCmd {sglId: sglIdReg,
   							       base: 8,
  
positive.code: import ClientServer::*;
  import CtrlMux::*;
  
  import Pipe::*;
  import Portal::*;
  import MemTypes::*;
  
negative.code: 	    else
  	       reqState <= Idle;
  	 end
  	 if (head != tail || verbose || True)
  	    $display("receiveReqHeadTail state=%d w0=%x w1=%x head=%d tail=%d limit=%d", reqState, w0, w1, head, tail, reqLimitReg);
        endrule
  
        rule requestMessage if (reqState == RequestMessage);
  