anchor.diff:  endinterface
   
   module mkMemWriterBuff(MemWriterBuff#(dataWidth, bufferDepth))
  -   provisos(Add#(b__, TAdd#(1, TLog#(bufferDepth)), 8),
  +   provisos(Log#(bufferDepth,bufferDepthWidth),
  +	    Max#(TAdd#(bufferDepthWidth,1),8,availableWidth),
  +	    Add#(a__,8,availableWidth),
   	    Div#(dataWidth,8,dataWidthBytes),
   	    Mul#(dataWidthBytes,8,dataWidth),
   	    Log#(dataWidthBytes,beatShift));
   
  -   FIFOFLevel#(ObjectData#(dataWidth),bufferDepth) writeBuffer <- mkBRAMFIFOFLevel;
  +   FIFOF#(ObjectData#(dataWidth))  writeBuffer <- mkSizedBRAMFIFOF(valueOf(bufferDepth));
      FIFOF#(ObjectRequest)        reqOutstanding <- mkFIFOF();
  -   FIFOF#(ObjectRequest)        reqCommitted <- mkFIFOF();
  -   FIFOF#(Bit#(6))                        doneTags <- mkFIFOF();
  -   ConfigCounter#(TAdd#(1,TLog#(bufferDepth)))  unfulfilled <- mkConfigCounter(0);
  +   FIFOF#(ObjectRequest)          reqCommitted <- mkFIFOF();
  +   FIFOF#(Bit#(6))                    doneTags <- mkFIFOF();
  +   ConfigCounter#(availableWidth)    available <- mkConfigCounter(0);
      let beat_shift = fromInteger(valueOf(beatShift));
      
      // only issue the writeRequest when sufficient data is available.  This includes the data we have already comitted.
  -   Bit#(TAdd#(1,TLog#(bufferDepth))) sreq = pack(satPlus(Sat_Bound, unpack(truncate(reqOutstanding.first.burstLen>>beat_shift)), unfulfilled.read()));
  -
  -   rule commitReq if (writeBuffer.highWater(sreq));
  +   rule commitReq if (unpack(extend(reqOutstanding.first.burstLen>>beat_shift)) <= available.read());
         let req <- toGet(reqOutstanding).get();
  -      unfulfilled.increment(unpack(truncate(req.burstLen>>beat_shift)));
  +      available.decrement(unpack(extend(req.burstLen>>beat_shift)));
         reqCommitted.enq(req);
      endrule
   
      interface ObjectWriteServer writeServer;
         interface Put writeReq = toPut(reqOutstanding);
  -      interface Put writeData = toPut(writeBuffer);
  +      interface Put writeData;
  +	 method Action put(ObjectData#(dataWidth) d);
  +	    writeBuffer.enq(d);
  +	    available.increment(1);
  +	 endmethod
  +      endinterface: writeData
         interface Get writeDone = toGet(doneTags);
      endinterface
      interface ObjectWriteClient writeClient;
         interface Get writeReq = toGet(reqCommitted);
         interface Get writeData;
   	 method ActionValue#(ObjectData#(dataWidth)) get();
  -	    unfulfilled.decrement(1);
  -	    writeBuffer.fifo.deq;
  -	    return writeBuffer.fifo.first;
  +	    writeBuffer.deq;
  +	    return writeBuffer.first;
   	 endmethod
         endinterface
         interface Put writeDone = toPut(doneTags);
      endinterface
   endmodule
  -
   
   interface UGBramFifos#(numeric type numFifos, numeric type fifoDepth, type a);
      method Action enq(Bit#(TLog#(numFifos)) idx, a v);
  
positive.code: 
  
  import BRAM::*;
  import FIFO::*;
  import Vector::*;
  import Gearbox::*;
  
negative.code: 
     interface ObjectReadServer readServer;
        interface Put readReq = toPut(reqOutstanding);
        interface Get readData;
  	 method ActionValue#(ObjectData#(dataWidth)) get();
  	    let v <- toGet(readBuffer).get();
  	    unfulfilled.decrement(1);
  	    return v;
  	 endmethod
        endinterface: readData
     endinterface
     interface ObjectReadClient readClient;
        interface Get readReq = toGet(reqCommitted);
        interface Put readData;
     	 method Action put(ObjectData#(dataWidth) x);
  	    readBuffer.enq(x);
     	 endmethod
        endinterface
     endinterface
  