anchor.diff:  // Example usage: http://ohm.bu.edu/~dean/G-2TrackerWORKING/uart_test.vhd
   
   interface BscanBram#(type atype, type dtype);
  +   method atype getAddr();
  +   method Bit#(1) getSelected();
  +   method Bit#(8) getWidth();
      interface Clock jtagClock;
      interface Reset jtagReset;
      interface BRAMClient#(atype, dtype) bramClient;
  
positive.code:        selectdelay <= selected.read();
     endrule
  
     rule sendwrite if(bscan.sel() == 1 && bscan.update() == 1);
         startWrite.send();
     endrule
     rule readr;
         readData <= startWrite.pulse();
     endrule
  
     rule tdo;
        bscan.tdo(shiftReg[0]);
     endrule
     rule shiftextrarule;
        shiftextra <= bscan.shift() == 1;
     endrule
  
     rule shiftrule if (bscan.sel() == 1 && (bscan.capture() == 1 || bscan.shift() == 1 || shiftextra));
         let data = { bscan.tdi(), shiftReg[dsz-1:1] };
         if (bscan.capture() == 1)
             data = tojtag.read();
         shiftReg <= data;
     endrule
  
     rule clearRule if (selected.read() && !selectdelay);
         addrReg <= fromInteger(-1);  // first time USER1 selected, reset address
     endrule
     rule updateRule if (startWrite.pulse());
         addrReg <= addrReg + 1;
     endrule
  
     interface BRAMClient bramClient;
        interface Get request;
  
negative.code:    Clock tck <- mkClockBUFG(clocked_by bscan.tck);
     Reset rst <- mkAsyncReset(2, defaultReset, tck);
  
     Reg#(Bit#(asz)) addrReg <- mkReg(0);
     Reg#(Bit#(dsz)) fromBram <- mkReg(0);
     Reg#(Bool) selectdelay <- mkReg(False);
     Reg#(Bool) readData <- mkReg(False);
  
     Reg#(Bit#(dsz)) shiftReg <- mkReg(0, clocked_by tck, reset_by rst);
     Reg#(Bit#(8)) widthReg <- mkReg(0, clocked_by tck, reset_by rst);
     SyncBitIfc#(Bit#(dsz)) tojtag <- mkSyncBits(0, defaultClock, defaultReset, tck, rst);
     SyncBitIfc#(Bit#(dsz)) fromjtag <- mkSyncBits(0, tck, rst, defaultClock, defaultReset);
     SyncBitIfc#(Bool) selected <- mkSyncBits(False, tck, rst, defaultClock, defaultReset);
     SyncPulseIfc startWrite <- mkSyncHandshake(tck, rst, defaultClock);
  
     rule fromj;
  