anchor.diff:  	  return 0;
       endfunction
   
  -   rule writeHeaderTlp if (writeDwCount == 0 && writeDataMimo.deqReadyN(1));
  +   rule writeHeaderTlp if (!writeInProgress);
         let tlp = tlpWriteHeaderFifo.first;
   
         TLPMemory4DWHeader hdr_4dw = unpack(tlp.data);
  
positive.code: 	 v = writeDataMimo.first();
  	 writeDataMimo.deq(unpack(truncate(writeDwCount)));
  	 writeDwCount <= 0;
  	 doneTag.enq(writeTag.first());
  	 writeTag.deq();
  	 $display("writeDwCount=%d will be zero", writeDwCount);
  
negative.code:       end
     endrule
  
     rule writeTlps if (writeInProgress);
        TLPData#(16) tlp = defaultValue;
        tlp.sof = False;
        Vector#(4, Bit#(32)) v = unpack(0);
  