anchor.diff:        if (regist == 0) rbufferbase <= truncate(addr);
         else if (regist == 1) rbufferend <= truncate(addr);
         else if (regist == 2) rbufferfirst <= truncate(addr);
  -      else if (regist == 3) rbufferlast <= truncate(addr);
  +      else if (regist == 3) rbufferlastfetch <= truncate(addr);
         else if (regist == 4) rbuffermask <= truncate(addr);
         else if (regist == 5) rmempointer <= truncate(addr);
  +      else if (regist == 6) rbufferlastack <= truncate(addr);
         else renable <= (addr[0] != 0);
      endmethod
      
  
positive.code:    endmethod
     
     method Action setLast(Bit#(64) addr);
        rbufferlast <= truncate(addr);
     endmethod
     
     method Bit#(64) get(Bit#(3) regist);
        if (regist == 0) return (zeroExtend(rbufferbase));
        else if (regist == 1) return (zeroExtend(rbufferend));
        else if (regist == 2) return (zeroExtend(rbufferfirst));
        else if (regist == 3) return (zeroExtend(rbufferlast));
        else if (regist == 4) return (zeroExtend(rbuffermask));
        else if (regist == 5) return (zeroExtend(rmempointer));
        else return(zeroExtend(pack(renable)));
     endmethod
     endinterface
  
     method Bool notEmpty();
     return (rbufferfirst != rbufferlast);
     endmethod
  
     method Bool notFull();
     return (((rbufferfirst + 64) & rbuffermask) != rbufferlast);
     endmethod
  
     method Action push(Bit#(8) num);
     rbufferfirst <= (rbufferfirst + zeroExtend(num)) & rbuffermask;
     endmethod
  
     method Action pop(Bit#(8) num);
     rbufferlast <= (rbufferlast + zeroExtend(num)) & rbuffermask;
     endmethod
   
     interface Reg bufferfirst = rbufferfirst;
     interface Reg bufferlast = rbufferlast;
     interface Reg enable = renable;
     interface Reg mempointer = rmempointer;
  
  
negative.code:    method Bit#(64) get(Bit#(3) regist);
  endinterface
  
  module mkRingBuffer(RingBuffer);
     
     Reg#(Bit#(DmaOffsetSize)) rbufferbase <- mkReg(0);
     Reg#(Bit#(DmaOffsetSize)) rbufferend <- mkReg(0);
     Reg#(Bit#(DmaOffsetSize)) rbufferfirst <- mkReg(0);
     Reg#(Bit#(DmaOffsetSize)) rbufferlastfetch <- mkReg(0);
     Reg#(Bit#(DmaOffsetSize)) rbufferlastack <- mkReg(0);
     Reg#(Bit#(DmaOffsetSize)) rbuffermask <- mkReg(0);
     Reg#(DmaPointer) rmempointer <- mkReg(0);
     Reg#(Bool) renable <- mkReg(False);
  