anchor.diff:      endinterface);
     end
     mkConnection(mdc, mds);
  -
     function MetadataClient toMetadataClient(FIFO#(MetadataRequest) reqFifo,
                                              FIFO#(MetadataResponse) respFifo);
       MetadataClient ret_ifc;
  
positive.code:     Vector#(272, Bit#(1)) dataVec = unpack(data);
      let ipv4_t = extract_ipv4_t(pack(takeAt(0, dataVec)));
      parseStateFifo.enq(StateParseIpv4);
      parsed_ipv4_protocol_fifo.enq(ipv4_t.protocol);
      parsed_ipv4_dstAddr_fifo.enq(ipv4_t.dstAddr);
      next_state_wire[0] <= tagged Valid StateParseStart;
    endaction
  
negative.code:     endinterface);
      return ret_ifc;
    endfunction
    RoutingTable routingTable <- mkRoutingTable(toGPClient(routingReqFifo, routingRespFifo));
    BbForward bb_forward <- mkBbForward();
    BbNop bb_nop <- mkBbNop();
    mkConnection(routingTable.next_control_state_0, bb_nop.prev_control_state);
    mkConnection(routingTable.next_control_state_1, bb_forward.prev_control_state);
    rule default_next_control_state if (defaultReqFifo.first matches tagged DefaultRequest {pkt: .pkt, meta: .meta});
      defaultReqFifo.deq;
      MetadataRequest req = tagged RoutingTableRequest {pkt: pkt, meta: meta};
      routingReqFifo.enq(req);
    endrule
    rule routing_next_control_state if (routingRespFifo.first matches tagged RoutingTableResponse {pkt: .pkt, meta: .meta});
      routingRespFifo.deq;
      if (meta.routing$p4_action matches tagged Valid .data) begin
        case (data) matches
          FORWARD: begin
            MetadataRequest req = tagged ForwardQueueRequest {pkt: pkt, meta: meta};
            currPacketFifo.enq(req);
          end
          NOP: begin
            MetadataRequest req = tagged ForwardQueueRequest {pkt: pkt, meta: meta};
            currPacketFifo.enq(req);
          end
        endcase
      end
    endrule
  