anchor.diff:        Bool wEnb_indc = !(oldEqNewPatt && oldPattVR) && oldPattVR && oldPattMultiOccR;
         Bool wEnb_iVld = !(oldEqNewPatt && oldPattVR) && oldPattVR && !oldPattMultiOccR;
         if (wEnb_indc) //Need a closer look
  -      ram9b.wEnb_indc.put(wEnb_indc);
  +         ram9b.wEnb_indc.put(wEnb_indc);
         ram9b.wEnb_iVld.put(wEnb_iVld);
         ram9b.wIVld.put(False);
  -      oldNewbPattWr_reg <= oldPattVR;
  +      oldNewbPattWrR <= oldPattVR;
         Bit#(9) patt = oldPattVR ? oldPattR : wPatt_bcam;
         ram9b.wPatt.put(patt);
         curr_state <= S1;
  
positive.code:       cycle <= cycle + 1;
     endrule
  
     Reg#(Bool) oldNewbPattWr_reg <- mkReg(False);
  
     Reg#(Bit#(9)) oldPattR <- mkReg(0);
     Reg#(Bool) oldPattVR <- mkReg(False);
  
     // setram fifo, remove later.
     FIFO#(Bit#(32)) oldPattIndc_fifo <- mkFIFO1();
     FIFO#(Bit#(32)) newPattIndc_fifo <- mkFIFO1();
  
     Reg#(Bit#(9)) wPatt_bcam <- mkReg(0);
     Reg#(Bit#(camSz)) wAddr_bcam <- mkReg(0);
     FIFO#(void) setram_read <- mkFIFO1;
     FIFO#(void) vacram_read <- mkFIFO1;
     FIFO#(void) idxram_read <- mkFIFO1;
     FIFO#(void) bcam_fsm_start <- mkFIFO1;
     FIFO#(void) ram9b_wIndx_start <- mkFIFO1;
  
     Wire#(Bit#(5)) newPattOccFLoc_wire <- mkDWire(0);
  
     FIFO#(Bool) wEnb_setram_fifo <- mkFIFO1;
     FIFO#(Bool) wEnb_vacram_fifo <- mkFIFO1;
     FIFO#(Bool) wEnb_idxram_fifo <- mkFIFO1;
  
     Reg#(Bit#(5)) vacFLocR <- mkReg(0);
  
     Reg#(Bit#(32)) cVacR <- mkReg(maxBound);
     Reg#(Bool) oldPattMultiOccR <- mkReg(False);
     Reg#(Bool) newPattMultiOccR <- mkReg(False);
     Reg#(Bit#(5)) oldIdxR <- mkReg(0);
     Reg#(Bit#(5)) newIdxR <- mkReg(0);
  
     FIFOF#(Bit#(5)) wIndx_fifo <- mkFIFOF();
     FIFOF#(Bit#(5)) wAddrL_fifo <- mkFIFOF();
     FIFOF#(Bit#(160)) data_oldPatt_fifo <- mkFIFOF();
     FIFOF#(Bit#(160)) data_newPatt_fifo <- mkFIFOF();
  
     Reg#(Bool) oldEqNewPattR <- mkReg(False);
  
     PE#(32) pe_multiOcc <- mkPEncoder();
     PE#(32) pe_vac <- mkPEncoder();
  
negative.code:       let v <- toGet(ram9b_wIndx_start).get;
        Bit#(5) _oldIdx = oldPattMultiOccR ? oldIdxR : 0;
        Bit#(5) _newIdx = newPattMultiOccR ? newIdxR : vacFLocR;
        Bit#(5) wIndx = oldNewbPattWrR ? _oldIdx : _newIdx;
        if (verbose) $display("vacram %d: oldPattMultiOccR=%x, newPattMultiOcc=%x, oldNewbPattWrR=%x", cycle, oldPattMultiOccR, newPattMultiOccR, oldNewbPattWrR);
        if (verbose) $display("vacram %d: compute oldIdx_=%x, newIdx_=%x wIndx=%x", cycle, _oldIdx, _newIdx, wIndx);
        ram9b.wIndx.put(wIndx);
        ram9b.wAddr_indc.put(wIndx);
  