anchor.diff:  	    needleBram.portA.request.put(BRAMRequest{write:False, address: truncate(iReg+1-1), datain:?, responseOnWrite:?});
   	    let t = haystackGb.first[0]; haystackGb.deq();
   	    t_j <= t;
  -	    if (t == 0) begin
  -	       $display("iReg=%d jReg=%d t==0 locf.enq(-1)", iReg, jReg, t);
  +      endaction
  +      action
  +	    if (t_j == 0) begin
  +	       $display("iReg=%d jReg=%d t==0 locf.enq(-1)", iReg-1, jReg-1, t_j);
   	       locf.enq(-1); // this seems to be needed for the strstr example to terminate
   	    end
   	 endaction
  
positive.code: 	 jReg <= 1;
  	 let t = haystackGb.first[0]; haystackGb.deq();
  	 t_j <= t;
  	 needleBram.portA.request.put(BRAMRequest{write:False, address: truncate(iReg-1), datain:?, responseOnWrite:?});
        endaction
        action
  	 let xNext <- needleBram.portA.response.get();
  
negative.code:    let t_j <- mkReg(0);
     let m = needleLenReg;
     let i = iReg;
     let iReg_minus_1 <- mkReg(0);
     let matchFsm <- mkAutoFSM(seq
        while (stage != Search) seq
  	 iReg <= 1;
  