public SortNet_CALF_FBFLY(SortNode.Rank r, Router router) { // 4x4 sorting network nodes = new SortNode[12]; // Domain 1 (x-axis) goes 0. Domain 2 (y-axis) goes 1. SortNode.Steer crossDomain = delegate(Flit f) { if (f == null) { return(0); } return((f.prefDir <= Simulator.DIR_X_3)?0:1); }; // within first half domain, goes 0; otherwise goes 1. SortNode.Steer intraDomain = delegate(Flit f) { if (f == null) { return(0); } return((f.prefDir % 4 < 2)?0:1); }; // even channel number (e.g. DIR_X_0) goes 0; otherwise goes 1. SortNode.Steer evenSteer = delegate(Flit f) { if (f == null) { return(0); } return((f.prefDir % 2 == 0)?0:1); }; for (int i = 0; i < 4; i++) { nodes[i] = new SortNode(crossDomain, r); nodes[i + 4] = new SortNode(intraDomain, r); nodes[i + 8] = new SortNode(evenSteer, r); } LOCAL_INDEX = Router.LOCAL_INDEX; TOTAL_DIR = Router.TOTAL_DIR; coord = router.coord; loopBackX = null; loopBackY = null; rbuf = new ResubBuffer(); rb_inject_block_count = 0; }
public SortNet_COW(SortNode.Rank r) { nodes = new SortNode[6]; SortNode.Steer stage1_steer = delegate(Flit f) { if (f == null) { return(0); } return((f.sortnet_winner) ? 0 : 1); }; SortNode.Steer stage2_steer = delegate(Flit f) { if (f == null) { return(0); } return((f.prefDir == Simulator.DIR_UP || f.prefDir == Simulator.DIR_RIGHT) ? 0 : 1); }; nodes[0] = new SortNode(stage1_steer, r); nodes[1] = new SortNode(stage1_steer, r); nodes[2] = new SortNode(stage2_steer, r); nodes[3] = new SortNode(stage2_steer, r); nodes[4] = new SortNode(delegate(Flit f) { if (f == null) { return(0); } return((f.prefDir == Simulator.DIR_UP) ? 0 : 1); }, r); nodes[5] = new SortNode(delegate(Flit f) { if (f == null) { return(0); } return((f.prefDir == Simulator.DIR_DOWN) ? 0 : 1); }, r); }
public SortNet_CALF(SortNode.Rank r) { nodes = new SortNode[4]; SortNode.Steer stage1_steer = delegate(Flit f) { if (f == null) { return(0); } return((f.prefDir == Simulator.DIR_UP || f.prefDir == Simulator.DIR_DOWN) ? 0 : // NS switch 1); // EW switch }; // node 0: {N,E} -> {NS, EW} nodes[0] = new SortNode(stage1_steer, r); // node 1: {S,W} -> {NS, EW} nodes[1] = new SortNode(stage1_steer, r); // node 2: {in_top,in_bottom} -> {N,S} nodes[2] = new SortNode(delegate(Flit f) { if (f == null) { return(0); } return((f.prefDir == Simulator.DIR_UP) ? 0 : 1); }, r); // node 3: {in_top,in_bottm} -> {E,W} nodes[3] = new SortNode(delegate(Flit f) { if (f == null) { return(0); } return((f.prefDir == Simulator.DIR_RIGHT) ? 0 : 1); }, r); rbuf = new ResubBuffer(); TOTAL_DIR = 4; rb_inject_block_count = 0; }