anchor.diff:     end
   
      rule dotProdValue;
  -      Tuple2#(UInt#(addrwidth),UInt#(addrwidth)) xy = indexpipes[k].first;
  +      Tuple2#(UInt#(addrwidth),UInt#(addrwidth)) index = indexpipes[k].first;
         indexpipes[k].deq;
         Vector#(K,Float) vs;
         for (Integer i = 0; i < k; i = i + 1) begin
   	 let v = fxdotprods[i].pipe.first;
   	 fxdotprods[i].pipe.deq;
  -	 let xyi = tuple2(tpl_1(xy), tpl_2(xy)+fromInteger(i));
  -	 if (verbose) $display($format(fshow(cycles)+fshow("    dotprodvalue xy=")+fshow(xyi)+fshow(" dotprod=")+fshow(v)));
  +	 let indexi = tuple2(tpl_1(index), tpl_2(index)+fromInteger(i));
  +	 if (verbose) $display($format(fshow(cycles)+fshow("    dotprodvalue index=")+fshow(indexi)+fshow(" dotprod=")+fshow(v)));
   	 vs[i] = v;
         end
         dfifo.enq(fromInteger(k), vs);
  
positive.code: 
     rule sinkDone;
        // each time we write a burst of k values via sinkC
        let xy = indexpipes[k+1].first;
        indexpipes[k+1].deq;
        let b <- sinkC.vector.finish();
        let c = dotprodCount-fromInteger(k);
        if (verbose) $display($format(fshow(cycles)+fshow("    sinkDone c")+fshow(c)+fshow("    xy=")+fshow(xy)));
        dotprodCount <= c;
        if (c == 0) begin
  	 running <= False;
  
negative.code:       cycles <= cycles+1;
     endrule
  
     Vector#(K, Reg#(UInt#(addrwidth))) startBOffset <- replicateM(mkReg(0));
     for (Integer i = 0; i < k; i = i + 1) begin
        FIFO#(UInt#(addrwidth)) startAFifo <- mkFIFO();
        //FIFO#(UInt#(addrwidth)) startBFifo <- mkFIFO();
        FIFO#(UInt#(addrwidth)) startCFifo <- mkFIFO();
        FIFO#(UInt#(addrwidth))    colFifo <- mkFIFO();
        rule startDotProd1;
  	 Tuple2#(UInt#(addrwidth),UInt#(addrwidth)) index <- toGet(indexpipes[i]).get();
  	 match { .startAcheck, .unusedA } <- toGet(offsetpipesA[i]).get();
  	 match { .unusedB, .startBcheck } <- toGet(offsetpipesB[i]).get();
  	 match { .startCcheck, .unusedC } <- toGet(offsetpipesC[i]).get();
  	 
  	 UInt#(TLog#(K)) in = fromInteger(i);
  	 int i_v = fromInteger(i);
  
  	 let row = tpl_1(index);
  	 let col = tpl_2(index)+fromInteger(i);
  	 
  	 let startA = row*descriptorA.numColumns; // row major
  	 let startB = col*descriptorB.numColumns; // col major layout (pre-transposed)
  	 let startC = row*descriptorC.numColumns; // + col; // row major
  	 if (startA != startAcheck)
  	    $display("startAmismatch row=%d col=%d startA=%d startAcheck=%d", row, col, startA, startAcheck);
  	 if (startB != (startBcheck + startBOffset[i]))
  	    $display("startBmismatch row=%d col=%d startB=%d startBcheck=%d i=%d", row, col, startB, startBcheck, i_v);
  	 if (startC != startCcheck)
  	    $display("startCmismatch row=%d col=%d startC=%d startCcheck=%d", row, col, startC, startCcheck);
  	 
  	 if (timing || verbose) $display($format(fshow(cycles)+fshow("    startDotProd index=")+fshow(tuple2(row,col))
  	    +fshow(" startA=")+fshow(startA)
  	    +fshow(" startB=")+fshow(startB)
  	    +fshow(" startC=")+fshow(startC+col)
  	    +fshow(" k=")+fshow(i_v)));
  
  	 if (i == 0) begin
  	    startCFifo.enq(startC);
  	 end
  