anchor.diff:  
   typedef enum {
      Idle,
  -   HeadRequested, // 1
  -   TailRequested, // 2
  +   WrPtrRequested, // 1
  +   RdPtrRequested, // 2
      RequestMessage, // 3
      MessageHeaderRequested, // 4
      MessageRequested, // 5
      Drain,
  -   UpdateTail,
  -   UpdateHead,
  -   UpdateHead2,
  +   UpdateRdPtr,
  +   UpdateWrPtr,
  +   UpdateWrPtr2,
      Waiting,
      SendHeader,
      SendMessage,
  
positive.code:          if (paddingReg)
              state <= SendPadding;
           else
              state <= UpdateHead;
        end
     endrule
  
     rule sendPadding if (state == SendPadding);
        $display("sendPadding");
        gb.enq(replicate(32'hffff0001));
        state <= UpdateHead;
     endrule
  
     rule updateHead if (state == UpdateHead);
        $display("updateIndHead limit=%d head=%d", limitReg, headReg);
        gb.enq(replicate(extend(limitReg)));
        writeEngine[0].request.put(
               MemengineCmd {sglId: sglIdReg, base: 0 << 2, burstLen: 8, len: 2 << 2, tag: 0});
        state <= UpdateHead2;
     endrule
  
     rule updateHead2 if (state == UpdateHead2);
        $display("updateIndHead2");
        gb.enq(replicate(extend(headReg)));
        state <= SendHeader;
     endrule
  
  
negative.code:       end
     end
  
     rule updateIndWrPtrRdPtr if (state == Idle && readyReg);
        readEngine[0].request.put(
            MemengineCmd {sglId: sglIdReg, base: 0, burstLen: 16, len: 16, tag: 0});
        state <= WrPtrRequested;
     endrule
  
     rule receiveIndWrPtrRdPtr if (state == WrPtrRequested || state == RdPtrRequested);
        let md <- toGet(readEngine[0].data).get();
        let data = md.data;
        let w0 = data[31:0];
        let w1 = data[63:32];
        let wrPtr = wrPtrReg;
        let rdPtr = rdPtrReg;
        if (state == WrPtrRequested) begin
           limitReg <= truncate(w0);
           wrPtrReg <= truncate(w1);
           wrPtr = truncate(w1);
           state <= RdPtrRequested;
        end
        else begin
           if (rdPtrReg == 0) begin
              rdPtr = truncate(w0);
              rdPtrReg <= rdPtr;
           end
           //if (rdPtr != wrPtrReg)
              state <= SendHeader;
           //else
              //state <= Idle;
        end
        if (verbose)
           $display("receiveIndWrPtrRdPtr state=%d w0=%x w1=%x wrPtr=%d rdPtr=%d limit=%d", state, w0, w1, wrPtr, rdPtr, limitReg);
     endrule
  
     rule send64bits;
  