anchor.diff:     Vector#(N,FIFOF#(Bool)) lastFifos <- replicateM(mkFIFOF());
      Vector#(N, PipeOut#(Tuple3#(Bool,Float,Float))) abpipes = map(toPipeOut,abfifos);
   
  -   Vector#(NUM_MACS, Server#(Tuple3#(Maybe#(Float), Float, Float), Tuple2#(Float,Exception))) macs <- replicateM(mkFloatMac(defaultValue));
  -   Vector#(1, FIFOF#(Bit#(TLog#(N)))) chanFifo <- replicateM(mkFIFOF());
  +   Vector#(NUM_MACS, Server#(Tuple2#(Float, Float), Tuple2#(Float,Exception))) muls <- replicateM(mkFloatMultiplier(defaultValue));
  +   Vector#(NUM_MACS, Server#(Tuple2#(Float, Float), Tuple2#(Float,Exception))) adders <- replicateM(mkFloatAdder(defaultValue));
  +   Vector#(1, FIFOF#(Bit#(TLog#(TAdd#(N,1))))) accumChanFifo <- replicateM(mkFIFOF());
  +   Vector#(1, FIFOF#(Bit#(TLog#(N)))) mulChanFifoFifo <- replicateM(mkFIFOF());
      Vector#(N, FIFO#(Float)) accumFifo <- replicateM(mkFIFO());
      Vector#(N, FIFOF#(Float)) resultFifos <- replicateM(mkFIFOF());
   
  
positive.code:       endrule
     end
  
     Vector#(N, PipeOut#(Float)) resultPipes = map(toPipeOut, resultFifos);
     PipeOut#(Vector#(N,Float)) resultPipe <- mkJoinVector(id, resultPipes);
     PipeOut#(Float) dotpipe <- mkReducePipe(mkFloatAddPipe, resultPipe);
     PipeOut#(Float) displaydotpipe = (interface PipeOut#(Float);
        method Float first(); return dotpipe.first(); endmethod
        method Action deq(); $display(fshow("label=")+fshow(label)+fshow(" dotpipe=")+fshow(dotpipe.first())); dotpipe.deq(); endmethod
        method Bool notEmpty(); return dotpipe.notEmpty(); endmethod
        endinterface);
     interface Put request;
        method Action put(Tuple2#(Vector#(N,Float),Vector#(N,Float)) tpl);
  	 Bool isFirst = (countInReg == 0);
  
negative.code: 	 let y = tpl_3(v);
  
  	 Maybe#(Float) accum = tagged Invalid;
  	 if (isFirst) begin
  	    accumFifo[i].enq(unpack(0));
  	 end
  	 Integer mac_number = i;
  	 if (valueOf(N) > valueOf(NUM_MACS)) begin
  	    mulChanFifoFifo[0].enq(fromInteger(i));
  	    mac_number = 0;
  	 end
           //macs[mac_number].request.put(tuple3(accum, x, y));
  	 muls[mac_number].request.put(tuple2(x, y));
  	 if (verbose) $display($format(fshow("label=")+fshow(label)+fshow(" dotprod x=") + fshow(x) + fshow(" y=") + fshow(y)
  				       + fshow(" isFirst=") + fshow(isFirst) + fshow(" accum=")+fshow(pack(accum))));
        endrule
     end
  
     for (Integer i = 0; i < valueOf(N); i = i + 1) begin
        rule startacc if ((valueOf(N) == valueOf(NUM_MACS)) || (mulChanFifoFifo[0].first() == fromInteger(i)));
  	 Integer mac_number = i;
  	 if (valueOf(N) > valueOf(NUM_MACS)) begin
  	    mulChanFifoFifo[0].deq();
  	    mac_number = 0;
  	    accumChanFifo[0].enq(fromInteger(i));
  	 end
  	 let resp <- muls[mac_number].response.get();
  	 let acc <- toGet(accumFifo[i]).get();
  	 adders[mac_number].request.put(tuple2(tpl_1(resp),acc));
        endrule
     end
  
     for (Integer i = 0; i < valueOf(N); i = i + 1) begin
        rule macout if ((valueOf(N) == valueOf(NUM_MACS)) || (accumChanFifo[0].first() == fromInteger(i)));
  	 Integer mac_number = i;
  	 if (valueOf(N) > valueOf(NUM_MACS)) begin
  	    accumChanFifo[0].deq();
  	    mac_number = 0;
  	 end
  	 let isLast = lastFifos[i].first();
  	 lastFifos[i].deq();
  	 Float vi;
  	 let resp <- adders[mac_number].response.get();
  	 vi = tpl_1(resp);
  	 if (!isLast) begin
  	    accumFifo[i].enq(vi);
  