anchor.diff:     rule move;
         if (out.notFull && in[arb.grant_id].notEmpty)
   	 action
  -	    $display("%s id %d,%d from %d", name, id[0], id[1], arb.grant_id);
  +	    $display("arb id [%d,%d] from %d", id[0], id[1], arb.grant_id);
   	    out.enq(in[arb.grant_id].first());
   	    in[arb.grant_id].deq();
   	 endaction
      endrule
   endmodule
   
  -module mkDistribute#(Vector(n, Bit#(4)) id, String name, PipeOut#(a) in, Vector#(n, PipeIn#(a)) out)(Empty);
  +module mkDistribute#(Vector(n, Bit#(4)) id, PipeOut#(a) in, Vector#(n, PipeIn#(a)) out)(Empty);
      rule move;
  -      $display("distrib %s[%d,%d] to [%d,%d] v %x",
  +      $display("distrib [%d,%d] to [%d,%d] v %x",
   	 name, id[0], id[1], in.first.address[0], in.first.address[1],
   	 in.first.payload);
         if (in.address[0] < id[0]) 
  
positive.code: 
    // interface wiring
  
     interface PipeIn in = toPipeIn(fifofromhost);
     interface PipeOut out = toPipeOut(fifotohost);
  
  endmodule
  
  
negative.code:       endmethod
  endmodule
  
  
  module mkNocNode#(Vector(dim, Bit#(4)) id)(NocNode#(dim));
     Bit#(4) radix = (ValueOf(dim) * 2) + 1;
     
     // host Links
     FIFOF#(msg) fifofromhost <- mkSizedFIFOF(4);
     FIFOF#(DataMessage) fifotohost <- mkSizedFIFOF(4);
     PipeIn#(DataMessage) tohost = toPipeIn(fifotohost);
     PipeOut#(DataMessage) fromhost = toPipeOut(fifofromhost); 
    
     Vector#(dim, SerialFIFOTX#(DataMessage)) txup <- replicateM(mkSerialFIFOTX);
     Vector#(dim, SerialFIFORX#(DataMessage)) rxup <- replicateM(mkSerialFIFORX);
     Vector#(dim, SerialFIFOTX#(DataMessage)) txdown <- replicateM(mkSerialFIFOTX);
     Vector#(dim, SerialFIFORX#(DataMessage)) rxdown <- replicateM(mkSerialFIFORX);
  	 
  	 
     // sources
     Vector#(radix, PipeOut#(DataMessage)) switchin = newVector;
     Vector#(radix, PipeOut#(DataMessage)) switchout = newVector;
     for (Bit#(4) i = 0; i < ValueOf(dim); i = i + 1)
        begin
  	 switchin[(2*i) + 0] = rxup[i].out;
  	 switchin[(2*i) + 1] = rxdown[i].out;
  	 switchout[(2*i) + 0] = txup[i].in;
  	 switchout[(2*i) + 1] = txdown[i].out;
        end
     switchin[radix - 1] = fromhost;
     switchout[radix - 1] = tohost;
     
     // buffers for crossbar switch
     Vector#(radix, Vector#(radix, FIFOF#(DataMessage))) xp = replicate(newVector);
  
     for (Bit#(4) x = 0; x < radix; x = x + 1)
        for (Bit#(4) y = 0; y < radix; y = y + 1)
  	 if (x != y) xp[x][y] <- mkSizedFIFOF(4);
  