anchor.diff:     Reg#(Bit#(32)) setupCnt <- mkReg(0);
      Reg#(Bit#(32)) doneCnt <- mkReg(0);
   
  -   let read_servers = zip(haystack_re.readServers,config_re.readServers);
  -   Vector#(DegPar, MPEngine#(haystackBusWidth,configBusWidth)) engines <- mapM(uncurry(mkMPEngine),read_servers);
  -   Vector#(DegPar, PipeOut#(Int#(32))) locdonePipes;
  -
  -   FIFOF#(Triplet#(Bit#(32))) setsearchFIFO <- mkFIFOF;
  -   UnFunnelPipe#(1,DegPar,Triplet#(Bit#(32)),1) setsearchPipeUnFunnel <- mkUnFunnelPipesPipelinedRR(vec(toPipeOut(setsearchFIFO)), 1);
  -
  -   for(Integer i = 0; i < valueOf(DegPar); i=i+1) begin
  -      locdonePipes[i] = engines[i].locdone;
  -      mkConnection(setsearchPipeUnFunnel[i],engines[i].setsearch);
  -   end
  -
  -   FunnelPipe#(1,DegPar,Int#(32),1) locdonePipe <- mkFunnelPipesPipelined(locdonePipes);
  -   let lpv = fromInteger(valueOf(logDegPar));
  -   let pv = fromInteger(valueOf(DegPar));
  +   MPStreamEngine#(haystackBusWidth,configBusWidth) engine <- mkMPStreamEngine;
  +   mkConnection(config_re.readServers[0].data, engine.needle);
  +   mkConnection(config_re.readServers[1].data, engine.mpNext);
  +   mkConnection(haystack_re.readServers[0].data, engine.haystack);
   
      rule resr;
  -      let rv <- toGet(locdonePipe[0]).get;
  -      if (rv == -1) begin  
  -	 // notify the SW when the search is finished
  -	 if (doneCnt+1 == pv) begin
  -	    doneCnt <= 0;
  -	    indication.searchResult(-1);
  -	 end
  -	 else begin
  -	    doneCnt <= doneCnt+1;
  -	 end
  -      end
  -      else begin    
  -	 // send results back to SW
  -	 indication.searchResult(rv);
  -	 if (verbose) $display("strstr search result %d", rv);
  -      end
  +      let rv <- toGet(engine.locdone).get;
  +      // send results back to SW
  +      indication.searchResult(rv);
  +      if (verbose) $display("strstr search result %d", rv);
      endrule
  -   
  -   // setup the MPEngines when new configuration arrives
  -   Stmt setupStmt = 
  -   seq
  -      action
  -	 if (verbose) $display("setupStmt (begin)");
  -	 setupCnt <= 0;
  -      endaction
  -      while(setupCnt < pv) action
  -	 setupCnt <= setupCnt+1;
  -	 let tup = tuple3(needleSGLId, mpNextSGLId, needleLen);
  -	 setsearchFIFO.enq(tup);
  -	 if (verbose) $display(fshow("setupStmt (mid) ")+fshow(tup));
  -      endaction
  -      if (verbose) $display("setupStmt (end)");
  -   endseq;
  -   FSM setupFSM <- mkFSM(setupStmt);
  -
  -   // start the search;
  -   Stmt startStmt = 
  -   seq
  -      action
  -	 if (verbose) $display("startStmt (begin)");
  -	 startCnt <= 0;
  -	 startBase <= 0;
  -      endaction
  -      while (startCnt < pv-1) action
  -	 let tup = tuple3(haystackSGLId, (haystackLen>>lpv)+needleLen, startBase);
  -	 setsearchFIFO.enq(tup);
  -	 startBase <= startBase + (haystackLen>>lpv);
  -	 startCnt <= startCnt+1;
  -	 if (verbose) $display(fshow("startStmt ")+fshow(tup)+fshow(" (mid)"));
  -      endaction
  -      action
  -	 let tup = tuple3(haystackSGLId, haystackLen>>lpv, startBase);
  -	 setsearchFIFO.enq(tup);
  -	 if (verbose) $display(fshow("startStmt ")+fshow(tup)+fshow(" (end)"));
  -      endaction
  -   endseq;
  -   FSM startFSM <- mkFSM(startStmt);
         
      interface StrstrRequest request;
         method Action setup(Bit#(32) needle_sglId, Bit#(32) mpNext_sglId, Bit#(32) needle_len);
  
positive.code: 	 needleLen <= needle_len;
  	 needleSGLId <= needle_sglId;
  	 mpNextSGLId <= mpNext_sglId;
  	 setupFSM.start();
        endmethod
     
        method Action search(Bit#(32) haystack_sglId, Bit#(32) haystack_len);
  	 if (verbose) $display("mkStrstr::search %d %d", haystack_sglId, haystack_len);
  	 haystackLen <= haystack_len;
  	 haystackSGLId <= haystack_sglId;
  	 startFSM.start();
        endmethod
     endinterface
     interface config_read_client = vec(config_re.dmaClient);
  
negative.code: // I can't belive we still have to do this shit
  function Bool my_or(Bool a, Bool b) = a || b;
     
  module mkStrstr#(StrstrIndication indication)(Strstr#(haystackBusWidth, configBusWidth))
     provisos (
     Mul#(TDiv#(configBusWidth, 8), 8, configBusWidth)
     ,Mul#(TDiv#(haystackBusWidth, 8), 8, haystackBusWidth)
     ,Add#(1, a__, TDiv#(haystackBusWidth, 8))
     ,Add#(b__, TLog#(TDiv#(haystackBusWidth, 8)), 32)
  