anchor.diff:  	  method ActionValue#(Axi3ReadRequest#(32,12)) get();
   	     let hdr = readHeaderFifo.first;
   	     readHeaderFifo.deq;
  +	     //$display("req_ar hdr.length=%d hdr.addr=%h", hdr.length, hdr.addr);
   	     readDataFifo.enq(hdr);
  -	     return Axi3ReadRequest { address: extend(readHeaderFifo.first.addr) << 2, len: 0, id: extend(readHeaderFifo.first.tag),
  +	     let axilen = hdr.length -1;
  +	     return Axi3ReadRequest { address: extend(readHeaderFifo.first.addr) << 2, len: truncate(axilen), id: extend(readHeaderFifo.first.tag),
   				     size: axiBusSize(32), burst: 1, prot: 0, cache: 'b011, lock:0, qos: 0 };
   	    endmethod
          endinterface: req_ar
          interface Put resp_read;
  -	  method Action put(Axi3ReadResponse#(32,12) resp) if (interruptSecondHalf matches tagged Invalid);
  -	        let hdr = readDataFifo.first;
  -		//FIXME: assumes only 1 word read per request
  -		readDataFifo.deq;
  -
  -	        TLPCompletionHeader completion = defaultValue;
  -		completion.format = MEM_WRITE_3DW_DATA;
  -		completion.pkttype = COMPLETION;
  -		completion.relaxed = hdr.relaxed;
  -		completion.nosnoop = hdr.nosnoop;
  -		completion.length = 1;
  -		completion.tclass = hdr.tclass;
  -		completion.cmplid = my_id;
  -		completion.tag = truncate(resp.id);
  -		completion.bytecount = 4;
  -		completion.reqid = hdr.reqid;
  -		completion.loweraddr = getLowerAddr(hdr.addr, hdr.firstbe);
  -		completion.data = byteSwap(resp.data);
  -	        TLPData#(16) tlp = defaultValue;
  -		tlp.data = pack(completion);
  -		tlp.sof = True;
  -		tlp.eof = True;
  -		tlp.be = 16'hFFFF;
  -		tlp.hit = hitReg;
  -		tlpOutFifo.enq(tlp);
  -	    endmethod
  +	  method Action put(Axi3ReadResponse#(32,12) resp) if (completionMimo.enqReadyN(1));
  +	     Vector#(1, Bit#(32)) vec = cons(resp.data, nil);
  +	     completionMimo.enq(1, vec);
  +	  endmethod
   	endinterface: resp_read
       endinterface: master
       interface Put interruptRequest;
  
positive.code: import Vector       :: *;
  import GetPut       :: *;
  import Connectable  :: *;
  import PCIE         :: *;
  import DefaultValue :: *;
  
  
negative.code:     Reg#(Maybe#(Bit#(32))) interruptSecondHalf <- mkReg(tagged Invalid);
      Reg#(Bit#(7)) hitReg <- mkReg(0);
      Reg#(Bit#(4)) timerReg <- mkReg(0);
      FIFOF#(TLPMemoryIO3DWHeader) readHeaderFifo <- mkSizedFIFOF(8);
      FIFOF#(TLPMemoryIO3DWHeader) readDataFifo <- mkSizedFIFOF(8);
      FIFOF#(TLPMemoryIO3DWHeader) writeHeaderFifo <- mkSizedFIFOF(8);
      FIFOF#(TLPMemoryIO3DWHeader) writeDataFifo <- mkSizedFIFOF(8);
      FIFOF#(TLPData#(16)) tlpOutFifo <- mkSizedFIFOF(8);
      Reg#(TLPTag) tlpTag <- mkReg(0);
      Reg#(Bit#(12)) bTagReg <- mkReg(0);
  
      MIMOConfiguration mimoCfg = defaultValue;
      MIMO#(1,4,16,Bit#(32)) completionMimo <- mkMIMO(mimoCfg);
     Reg#(TLPLength) readBurstCount <- mkReg(0);
     rule completionHeader if (readBurstCount == 0 && readDataFifo.notEmpty() && completionMimo.deqReadyN(1) &&& interruptSecondHalf matches tagged Invalid);
        let hdr = readDataFifo.first;
        TLPLength rbc = hdr.length;
  
        Vector#(4, Bit#(32)) dvec = completionMimo.first();
        completionMimo.deq(1);
  
        //$display("completionHeader length=%d rbc=%d addr=%x", hdr.length, rbc, hdr.addr);
        TLPCompletionHeader completion = defaultValue;
        completion.format = MEM_WRITE_3DW_DATA;
        completion.pkttype = COMPLETION;
        completion.relaxed = hdr.relaxed;
        completion.nosnoop = hdr.nosnoop;
        completion.length = hdr.length;
        completion.tclass = hdr.tclass;
        completion.cmplid = my_id;
        completion.tag = truncate(hdr.tag);
        completion.bytecount = 4;
        completion.reqid = hdr.reqid;
        completion.loweraddr = getLowerAddr(hdr.addr, hdr.firstbe);
        completion.data = byteSwap(dvec[0]);
        TLPData#(16) tlp = defaultValue;
        tlp.data = pack(completion);
        tlp.sof = True;
        tlp.eof = (rbc == 1) ? True : False;
        tlp.be = 16'hFFFF;
        tlp.hit = hitReg;
        tlpOutFifo.enq(tlp);
  
        rbc = rbc - 1;
        readBurstCount <= rbc;
        if (rbc == 0) begin
  	 readDataFifo.deq;
        end
     endrule
  
      function Bit#(16) tlpBe(TLPLength len);
         if (len == 0)
  	  return 0;
         else if (len == 1)
  	  return 16'hf000;
         else if (len == 2)
  	  return 16'hff00;
         else if (len == 3)
  	  return 16'hfff0;
         else
  	  return 16'hffff;
      endfunction
  
     rule continuation if (readBurstCount > 0);
        let rbc = readBurstCount;
        let sendit = False;
        TLPData#(16) tlp = defaultValue;
        Vector#(4, Bit#(32)) dvec = unpack(0);
        tlp.sof = False;
        //$display("continuation rbc=%d", rbc);
        if (rbc > 4) begin
  	 if (completionMimo.deqReadyN(4)) begin
  	    rbc = rbc - 4;
  	    dvec = completionMimo.first();
  	    completionMimo.deq(4);
  	    tlp.be = tlpBe(4);
  	    tlp.eof = False;
  	    sendit = True;
  	 end
        end
        else begin
  	 UInt#(3) deqCount = truncate(unpack(rbc));
  	 if (completionMimo.deqReadyN(deqCount)) begin
  	    dvec = completionMimo.first();
  	    completionMimo.deq(deqCount);
  	    tlp.be = tlpBe(rbc);
  	    //$display("tlp.data=%h tlp.be=%h", tlp.data, tlp.be);
  	    tlp.eof = True;
  	    rbc = 0;
  	    sendit = True;
  	 end
        end
  
        readBurstCount <= rbc;
        if (rbc == 0) begin
  	 readDataFifo.deq();
        end
        if (sendit) begin
  	 for (Integer i = 0; i < 4; i = i + 1)
  	    tlp.data[(i+1)*32-1:i*32] = byteSwap(dvec[3-i]);
  	 tlpOutFifo.enq(tlp);
        end
     endrule
     rule txnTimer if (timerReg > 0);
        timerReg <= timerReg - 1;
     endrule
  
      rule interruptTlpOut if (interruptRequestFifo.notEmpty &&& interruptSecondHalf matches tagged Invalid);
         TLPData#(16) tlp = defaultValue;
  