anchor.diff:                                    // Tx Path
   /*-------------------------------------------------------------------------------*/
       Reg#(MAC) dst_mac_addr <- mkReg(0);
  -    Reg#(Bit#(1)) blast_phase <- mkReg(0);
  -    Reg#(ServerIndex) blast_phase_count <- mkReg(0);
  -    Reg#(Bit#(1)) remove_phase <- mkReg(0);
  -    Reg#(ServerIndex) remove_phase_count <- mkReg(0);
  +    Reg#(Bit#(1)) flow_add_blast_phase <- mkReg(0);
  +    Reg#(ServerIndex) flow_add_blast_phase_count <- mkReg(0);
  +    Reg#(Bit#(1)) flow_rem_blast_phase <- mkReg(0);
  +    Reg#(ServerIndex) flow_rem_blast_phase_count <- mkReg(0);
  +
  +    Reg#(Bit#(1)) check_flow_add_remove_tx_flag <- mkReg(0);
  +    Reg#(Bit#(256)) buf_data <- mkReg(0);
  +
  +    FIFO#(Bit#(1)) send_flow_rem_pkt_fifo <- mkSizedFIFO(valueof(DEFAULT_FIFO_LEN));
  +
  +    Reg#(Bit#(1)) check_to_end_flow_add_blast_flag <- mkReg(0);
  +
  +    rule check_flow_add_remove_tx (check_flow_add_remove_tx_flag == 1);
  +        check_flow_add_remove_tx_flag <= 0;
  +
  +        IP src_ip = buf_data[143:112];
  +        IP dst_ip = buf_data[175:144];
  +        Bit#(1) ctrl_bits = buf_data[111];
  +
  +        ServerIndex src = host_id(src_ip);
  +        ServerIndex dst = host_id(dst_ip);
  +
  +        if (src == host_index
  +            && dst < fromInteger(valueof(NUM_OF_SERVERS)))
  +        begin
  +            if (ctrl_bits == 'b1 && mmf.flowExists(src, dst))
  +            begin
  +                mmf.removeFlow(src, dst);
  +                mmf.remFromFlowCountMatrix(src, dst);
  +                flow_rem_blast_phase <= 1;
  +                flow_rem_blast_phase_count <= 0;
  +            end
  +
  +            else if (!mmf.flowExists(src, dst))
  +            begin
  +                mmf.addFlow(src, dst);
  +                mmf.addToFlowCountMatrix(src, dst);
  +                flow_add_blast_phase <= 1;
  +                flow_add_blast_phase_count <= 0;
  +            end
  +        end
  +    endrule
   
       rule get_dst_addr (curr_state == RUN && start_tx_scheduling == 1);
   		Bit#(64) curr_time = clk.currTime();
  
positive.code: /*-------------------------------------------------------------------------------*/
                                    // Rx Path
  /*-------------------------------------------------------------------------------*/
  	// should be atleast as large as buffer_depth + max num of data blocks
      Vector#(NUM_OF_ALTERA_PORTS, FIFOF#(RingBufferDataT)) buffer_fifo
  	                    <- replicateM(mkSizedFIFOF(valueof(DEFAULT_FIFO_LEN)));
  
negative.code:                     /* Find the index of the ring buffer to insert to. */
                      IP dst_ip = (buffered_data[i])[143:112];
                      IP src_ip = (buffered_data[i])[175:144];
                      Bit#(1) ctrl_bits = (buffered_data[i])[111];
  
                      /* Check if a flow is to be added or removed */
                      recvd_pkt_src_ip[i] <= src_ip;
                      recvd_pkt_dst_ip[i] <= dst_ip;
                      recvd_pkt_ctrl_bits[i] <= ctrl_bits;
                      check_flow_add_remove_rx_flag[i] <= 1;
  
                      if (dst_ip == ip_address(host_index))
                          ring_buffer_index_fifo[i].enq(0);
  