anchor.diff:        dmaIndication.configResp(ptr, barr0);
      endrule
   
  -   FIFO#(Tuple2#(Bit#(entryIdxSize),Page)) sglistPageReadFifo <- mkFIFO();
  -   rule sglistPageRead;
  -      match { .addr, .page } <- toGet(sglistPageReadFifo).get();
  -      portsel(pages, 0).request.put(BRAMRequest{write:True, responseOnWrite:False, address:addr, datain:page});
  -   endrule
  -
  -   method Action region(Bit#(32) ptr, Bit#(40) barr8, Bit#(8) off8, Bit#(40) barr4, Bit#(8) off4, Bit#(40) barr0, Bit#(8) off0);
  -      Region region8 = Region { barrier: barr8, idxOffset: off8 };
  -      Region region4 = Region { barrier: barr4, idxOffset: off4 };
  -      Region region0 = Region { barrier: barr0, idxOffset: off0 };
  -      portsel(reg8, 0).request.put(BRAMRequest{write:True, responseOnWrite:False, address:truncate(ptr-1), datain: region8});
  -      portsel(reg4, 0).request.put(BRAMRequest{write:True, responseOnWrite:False, address:truncate(ptr-1), datain: region4});
  -      portsel(reg0, 0).request.put(BRAMRequest{write:True, responseOnWrite:False, address:truncate(ptr-1), datain: region0});
  -      //$display("region ptr=%d off8=%h off4=%h off0=%h", ptr, off8, off4, off0);
  -      configRespFifo.enq(tuple2(ptr, barr0));
  -   endmethod
  -	       
  -   
  -   method Action sglist(Bit#(32) ptr, Bit#(40) paddr, Bit#(32) len);
  +   FIFO#(Tuple3#(Bit#(32),Bit#(40),Bit#(32))) sglistFifo <- mkFIFO();
  +   rule sglistRule;
  +      match { .ptr, .paddr, .len } <- toGet(sglistFifo).get();
  +
         // $display("sglist(ptr=%d, paddr=%h, len=%h", ptr, paddr,len);
         if (idxReg+1 == 0) begin
   	 $display("sglist: exceeded maximun length of sglist");
  
positive.code: 	 return x.portB;
     endfunction
  
     // pipeline the address lookup
     for(Integer i = 0; i < 2; i=i+1) begin
        rule req0;
  	 reqs[i].deq;
  	 let ptr = tpl_1(reqs[i].first);
  	 let off = tpl_2(reqs[i].first);
  	 Offset o = tagged OOrd0 0;
  	 Bit#(8) pbase = 0;
  	 Bit#(8) idxOffset = 0;
  	 Region region8 <- portsel(reg8,i).response.get;
  	 Region region4 <- portsel(reg4,i).response.get;
  	 Region region0 <- portsel(reg0,i).response.get;
  	 Bit#(40) barrier8 = region8.barrier;
  	 Bit#(40) barrier4 = region4.barrier;
  	 Bit#(40) barrier0 = region0.barrier;
  
  	 if (off < barrier8) begin
  	    //$display("request: ptr=%h off=%h barrier8=%h", ptr, off, barrier8);
  	    o = tagged OOrd8 truncate(off);
  	    pbase = truncate(off>>page_shift8);
  	    idxOffset = region8.idxOffset;
  	 end 
  	 else if (off < barrier4) begin
  	    //$display("request: ptr=%h off=%h barrier4=%h", ptr, off, barrier4);
  	    o = tagged OOrd4 truncate(off);
  	    pbase = truncate(off>>page_shift4);
  	    idxOffset = region4.idxOffset;
  	 end
  	 else if (off < barrier0) begin
  	    //$display("request: ptr=%h off=%h barrier0=%h", ptr, off, barrier0);
  	    o = tagged OOrd0 truncate(off);
  	    pbase = truncate(off>>page_shift0);
  	    idxOffset = region0.idxOffset;
  	 end 
  	 else begin
  	    $display("mkSGListMMU.addr[%d].request.put: ERROR   ptr=%h off=%h\n", i, ptr, off);
  	    dmaIndication.badAddrTrans(extend(ptr), extend(off), barrier0);
  	 end
  	 offs[i].enq(o);
  	 pbases[i].enq(pbase);
  	 idxOffsets[i].enq(idxOffset);
  	 ptrs[i].enq(ptr);
        endrule
        rule req1;
  	 let ptr <- toGet(ptrs[i]).get();
  	 let pbase <- toGet(pbases[i]).get();
  	 let idxOffset <- toGet(idxOffsets[i]).get();
  	 Bit#(8) p = pbase + idxOffset;
  	 rp[i].enq({ptr-1,p});
        endrule
        rule req2;
  	 rp[i].deq;
  	 //$display("pages[%d].read %h", i, rp[i].first());
  	 portsel(pages, i).request.put(BRAMRequest{write:False, responseOnWrite:False, address:rp[i].first, datain:?});
        endrule
        rule pageResponse;
  	 let page <- portsel(pages, i).response.get;
  
negative.code:       end
        else begin
  	 Page page = tagged POrd0 0;
  	 if (len == 0) begin
  	    idxReg <= 0;
  	 end
  	 else begin
  	    idxReg <= idxReg+1;
  	    if (extend(len) == ord0) begin
  