예제 #1
0
파일: 06.c 프로젝트: edgd1er/seatp1
void yield()
{
  irq_disable();
  printf("-Yield: current id: %d, next id: %d-\n",current_ctx->id,current_ctx->next->id);
  /*
  static int old_esp, old_ebp;
  */
  regread(esp);
  //old_esp = esp;
  regread(ebp);
  //old_ebp = ebp;
  current_ctx->esp = esp;
  current_ctx->ebp = ebp;
  current_ctx = current_ctx->next;
  regwrite(esp,current_ctx->esp);
  regwrite(ebp,current_ctx->ebp);
  disp_procs();
  if (current_ctx->started)
  {
    irq_enable();
    return;
  } else {
    current_ctx->started = 1;
    irq_enable();
    current_ctx->f_ptr(current_ctx->f_args);
    //for(;;) ;
    /*regwrite(esp,old_esp);
    regwrite(ebp,old_ebp);*/
  }
}
예제 #2
0
파일: athpoke.c 프로젝트: coyizumi/cs111
int
main(int argc, char *argv[])
{
	struct ath_diag atd;
	const char *ifname;
	char *eptr;
	int c, s;

	s = socket(AF_INET, SOCK_DGRAM, 0);
	if (s < 0)
		err(1, "socket");
	ifname = getenv("ATH");
	if (!ifname)
		ifname = ATH_DEFAULT;

	while ((c = getopt(argc, argv, "i:")) != -1)
		switch (c) {
		case 'i':
			ifname = optarg;
			break;
		default:
			usage();
			/*NOTREACHED*/
		}
	strncpy(atd.ad_name, ifname, sizeof (atd.ad_name));

	atd.ad_id = HAL_DIAG_REVS;
	atd.ad_out_data = (caddr_t) &state.revs;
	atd.ad_out_size = sizeof(state.revs);
	if (ioctl(s, SIOCGATHDIAG, &atd) < 0)
		err(1, atd.ad_name);

	argc -= optind;
	argv += optind;

	for (; argc > 0; argc--, argv++) {
		char *cp;
		const struct dumpreg *dr;
		uint32_t reg;

		cp = strchr(argv[0], '=');
		if (cp != NULL)
			*cp++ = '\0';
		dr = reglookup(argv[0]);
		if (dr == NULL) {
			errno = 0;
			reg = (uint32_t) strtoul(argv[0], &eptr, 0);
			if (argv[0] == eptr || eptr[0] != '\0')
				errx(1, "invalid register \"%s\"", argv[0]);
		} else
			reg = dr->addr;
		if (cp != NULL)
			regwrite(s, &atd, reg, (uint32_t) strtoul(cp, NULL, 0));
		printf("%s = %08x\n", argv[0], regread(s, &atd, reg));
	}
	return 0;
}
예제 #3
0
int ethreg_main(int argc, char *argv[])
{
	const char *ifname = "eth0";
	int c,portnum = 0x3f,cmd = 0,value = -1;
        int optionindex = 0;
        int vlanid = 0;
        char *mac = NULL;
        int tos = -1;
        const char *opt = "xfhci:d:s:j:v:t:p:m:l:";
        const struct option long_options[] =
        {
            { "f_link", no_argument, 0, ATHR_FLOW_LINK_EN},
            { "txfctl", no_argument, 0, ATHR_PHY_TXFCTL},
            { "rxfctl", no_argument, 0, ATHR_PHY_RXFCTL},
            { "stats" , no_argument, 0, ATHR_GMAC_STATS},
            { "mib"   , no_argument, 0, ATHR_PHY_MIB},
            { "dma"   , no_argument, 0, ATHR_GMAC_DMA_CHECK},
            { "qos"   , no_argument, 0, ATHR_QOS_ETH_SOFT_CLASS},
            { "ppri"  , no_argument, 0, ATHR_QOS_ETH_PORT},
            { "ipqos" , no_argument, 0, ATHR_QOS_ETH_IP},
            { "vqos"  , no_argument, 0, ATHR_QOS_ETH_VLAN},
            { "mqos"  , no_argument, 0, ATHR_QOS_ETH_DA},
            { "igrl"  , no_argument, 0, ATHR_QOS_PORT_ELIMIT},
            { "egrl"  , no_argument, 0, ATHR_QOS_PORT_ILIMIT},
            { "p_st"  , no_argument, 0, ATHR_PORT_STATS},
            { "macfl" , no_argument, 0, ATHR_GMAC_FLOW_CTRL},
            { "swfl"  , no_argument, 0, ATHR_PHY_FLOW_CTRL},
            { 0,0,0,0}
        };

	s = socket(AF_INET, SOCK_DGRAM, 0);
	if (s < 0)
		err(1, "socket");

        opt_force = 0;
	progname = argv[0];

	while ((c = getopt_long(argc, argv,
                    opt, long_options, &optionindex)) != -1) { 
	switch (c) {
        	case ATHR_FLOW_LINK_EN:
                	cmd = ATHR_FLOW_LINK_EN;
                        break;
        	case ATHR_PHY_TXFCTL:
                        cmd = ATHR_PHY_TXFCTL;
                        break;
                case ATHR_PHY_RXFCTL:
                        cmd = ATHR_PHY_RXFCTL;
                        break;
                case ATHR_PHY_MIB:
                        cmd = ATHR_PHY_MIB;
                        break;
                case ATHR_GMAC_STATS:
                        cmd = ATHR_GMAC_STATS;
                        break;
                case ATHR_GMAC_DMA_CHECK:
                        cmd = ATHR_GMAC_DMA_CHECK;
                        break;
                case ATHR_QOS_ETH_SOFT_CLASS:
                        cmd = ATHR_QOS_ETH_SOFT_CLASS;
                        break;
                case ATHR_QOS_ETH_PORT:
                        cmd = ATHR_QOS_ETH_PORT;
                        break;
                case ATHR_QOS_ETH_VLAN:
                        cmd = ATHR_QOS_ETH_VLAN;
                        break;
                case ATHR_QOS_ETH_IP:
                        cmd = ATHR_QOS_ETH_IP;
                        break;
                case ATHR_QOS_ETH_DA:
                        cmd = ATHR_QOS_ETH_DA;
                        break; 
                case ATHR_PORT_STATS:
                        cmd = ATHR_PORT_STATS;
                        break;
                case ATHR_QOS_PORT_ELIMIT:
                        cmd = ATHR_QOS_PORT_ELIMIT;
                        break;
                case ATHR_QOS_PORT_ILIMIT:
                        cmd = ATHR_QOS_PORT_ILIMIT;
                        break;
                case ATHR_GMAC_FLOW_CTRL:
                        cmd = ATHR_GMAC_FLOW_CTRL;
                        break;
                case ATHR_PHY_FLOW_CTRL:
                        cmd = ATHR_PHY_FLOW_CTRL;
                        break;
                case 'm':
                        mac = optarg;
                        break;
                case 'v':
                        value = strtoul(optarg, 0, 0);
                        break;
		case 'i':
			ifname = optarg;
			break;
                case 't':
                        tos = strtoul(optarg, 0, 0);
                        break;
		case 'p':
                        portnum = strtoul(optarg, 0, 0);
			break;
		case 'f':
			opt_force = 1;
			break;
                case 'd':
			duplex = strtoul(optarg, 0, 0);
			break;
                case 'c':
			cmd = ATHR_ACL_COMMIT;
                        break;
                case 'x':
			cmd = ATHR_ACL_FLUSH;
                        break;
                case 's':
                        cmd = ATHR_FRAME_SIZE_CTL;
                        value = strtoul(optarg, 0, 0);
                        break;
		case 'j':
                        cmd = ATHR_JUMBO_FRAME;
                        value = strtoul(optarg, 0, 0);
                        break;
                case 'l':
                        vlanid = strtoul (optarg, 0, 0);
                        break;
                case 'h':
                        usage();
                        break;
		default:
			usage();
			/*NOTREACHED*/
		}

        }

	argc -= optind;
	argv += optind;
	strncpy(etd.ad_name, ifname, sizeof (etd.ad_name));
        strncpy(ifr.ifr_name, ifname, IFNAMSIZ);
        ifr.ifr_data = (void *) &etd;

        if (cmd == ATHR_ACL_COMMIT) {
        	athr_commit_acl_rules();
              	return 0;
        }
        else if (cmd == ATHR_ACL_FLUSH) {
              	athr_flush_acl_rules();
              	return 0;
        }
        else if(cmd == ATHR_FRAME_SIZE_CTL) {
        	if (value == -1) {
                	printf ("usage:ethreg -i <if_name> -s <val>\n");
                  	return -1; 
              	} else {
	          	athr_set_framesize(value);
              	}
              	return 0;
        }
        else if (cmd == ATHR_JUMBO_FRAME) {
        	if (value == -1) {
                	printf ("usage: ethreg -i <if_name> -j <0|1>\n");
                	return -1;
             	} else {
	        	athr_en_jumboframe(value);
             	}
             return 0;
	}
        else if (cmd == ATHR_FLOW_LINK_EN) {
        	if (value == -1 || portnum == 0x3f) {
                	printf ("usage: ethreg --f_link -i <ifname> -p <portnum> -v 1\n");
                 	return -1;
             	} else {
                	athr_flow_link(portnum, value);
             	}
             	return 0;
        }
        else if (cmd == ATHR_PHY_RXFCTL) {
        	if (value == -1) {
                	printf ("usage: ethreg --rxfctl -i <ifname> -p <portnum> -v [0|1]\n");
                	printf ("usage: ethreg --rxfctl -i <ifname> -v [0|1]\n");
                 	return -1;
             	} else {
                 	athr_rxflctrl(portnum, value);
             	}
             	return 0;
        }
        else if (cmd == ATHR_PHY_TXFCTL) {
        	if (value == -1) {
                	printf ("usage: ethreg --txfctl -i <ifname> -p <portnum> -v [0|1]\n");
                	printf ("usage: ethreg --txfctl -i <ifname> -v [0|1]\n");
                 	return -1;
             	} else {
                	 athr_txflctrl(portnum, value);
             	}
             	return 0;
        }
        else if (cmd == ATHR_PHY_MIB) {
        	if (value == -1) {
        		printf ("usage: ethreg --mib -i <ifname> -v 1\n");
		 	return -1;
             	} else {
                	athr_set_mib(value);
             	}
             	return 0;
        }
	else if (cmd == ATHR_GMAC_STATS) {
        	athr_disp_stats(portnum);
	     	return 0;
	}
	else if (cmd == ATHR_GMAC_DMA_CHECK) {
                if (value == -1) {
                	printf ("usage: ethreg --dma -i <ifname> -v [0|1]\n");
                        return -1;
                } else {
        		athr_dma_check(value);
                }
             	return 0;
        }
        else if (cmd == ATHR_QOS_ETH_SOFT_CLASS) {
        	if (value == -1) {
                	printf ("usage: ethreg --qos -i <ifname> -v [0|1]\n");
                	return -1;
             	} else {
                	athr_set_qos(value);
             	}
             	return 0;
               
        }
        else if (cmd == ATHR_QOS_ETH_PORT) {
        	if (value == -1) {
                	printf("usage: ethreg --ppri -i <ifname> -p <portno> -v <val>\n");
                	return -1;
             	} else {
                 	athr_set_port_pri(portnum, value);
             	}
             	return 0;
        }
        else if (cmd == ATHR_QOS_ETH_IP) {
        	if (tos == -1 || value == -1) {
                 	printf ("usage: ethreg --ipqos -i <ifname> -v <val> -t <tos>\n");
                 	return -1;
             	} else {
                 	athr_ip_qos(tos, value);
             	}
             	return 0;
        }
        else if (cmd == ATHR_QOS_ETH_VLAN) {
        	if (value == -1 || vlanid == -1) {
                	printf ("usage: ethreg --vqos -i <ifname> -v <val> -l <vlanid>\n");
                 	return -1;
             	} else {
                	athr_vlan_qos(vlanid, value);
                 
             	}
             	return 0;
        }
        else if (cmd == ATHR_QOS_ETH_DA) {
        	if (portnum == 0x3f || value == -1 || mac == NULL) {
                	printf ("usage: ethreg --mqos -i <ifname> -v <val> -p <portnum> -m <macaddr>\n");
                 	return -1;
             	} else {
                	athr_mac_qos(portnum, value, mac);
             	}
             	return 0;
        }
        else if (cmd == ATHR_PORT_STATS) {
        	if (portnum == 0x3f) {
                	printf ("usage: ethreg --port_st -i <ifname> -p <portno>\n");
			return -1;
             	} else {
                	athr_port_st(portnum);
             	}
             	return 0;
        }
        else if (cmd == ATHR_QOS_PORT_ELIMIT) {
        	if (portnum == 0x3f || value == -1 ) {
                	printf("usage: ethreg --egrl -i <ifname> -p <portnum> -v <val>\n");
                 	return -1;
             	} else {
                	athr_process_egress(portnum, value);
             	}
             	return 0;
       	}
       	else if (cmd == ATHR_QOS_PORT_ILIMIT) {
       		if (portnum == 0x3f || value == -1 ) {
                	printf("usage: ethreg --igrl -i <ifname> -p <portnum> -v <val>\n");
                 	return -1;
             	} else {
                 	athr_process_igress(portnum, value);
             	}
             	return 0;
	}
        else if (cmd == ATHR_GMAC_FLOW_CTRL){
        	athr_gmac_flow_ctrl(value);
                return 0;
        }
        else if (cmd == ATHR_PHY_FLOW_CTRL){
        	athr_phy_flow_ctrl(value, portnum);
                return 0;
        }

	for (; argc > 0; argc--, argv++) {
		u_int32_t   off;
                u_int32_t  val, oval;
                char *cp;

                cp = strchr(argv[0], '=');

                if (cp != NULL)
                        *cp = '\0';

                off = (u_int) strtoul(argv[0], 0, 0);

                if (off == 0 && errno == EINVAL)
               		errx(1, "%s: invalid reg offset %s",
                              progname, argv[0]);

                if (cp == NULL) {
                	val = regread(off,portnum);
                    	printf("Read Reg: 0x%08x = 0x%08x\n",off, val);
                    	return 0;
                } else {
                	val = (u_int32_t) strtoul(cp+1, 0, 0);
                    	if (val == 0 && errno == EINVAL) {
                        	errx(1, "%s: invalid reg value %s",
                                        progname, cp+1);
                    	}
                     	else {
                        	oval = regread(off,portnum);
				if(opt_force == 0) {
                            		printf("Write Reg: 0x%08x: Oldval = 0x%08x Newval = 0x%08x\n", off, oval, val);

                        	} else if(opt_force == 1 && portnum == 0x3f) {
                            		fprintf(stderr, "usage: %s [-f]  -p portnum =10/100/0 [-d duplex]\n", progname);
                            		return -1;
                        	}
                            	regwrite(off,val,portnum);
                     	}	
                }
        }
        return 0;
}
예제 #4
0
파일: reg.c 프로젝트: KHATEEBNSIT/AP
int
main(int argc, char *argv[])
{
	HAL_REVS revs;
	const char *ifname = ATH_DEFAULT;
	int c;

	s = socket(AF_INET, SOCK_DGRAM, 0);
	if (s < 0)
		err(1, "socket");

	progname = argv[0];
	while ((c = getopt(argc, argv, "di:")) != -1)
		switch (c) {
		case 'i':
			ifname = optarg;
			break;
		case 'd':
			strncpy(atd.ad_name, ifname, sizeof (atd.ad_name));
			getdmadbg();
			return 0;
		default:
			usage();
			/*NOTREACHED*/
		}
	argc -= optind;
	argv += optind;

	strncpy(atd.ad_name, ifname, sizeof (atd.ad_name));

	for (; argc > 0; argc--, argv++) {
		u_int   off, i;
		u_int32_t  val, oval,regbase;
		char line[256];
		char *cp;
		cp = strchr(argv[0], '=');
		if (cp != NULL)
			*cp = '\0';
		off = (u_int) strtoul(argv[0], NULL, 0);
		printf("offset =0x%x.\n",off);
		if (off == 0 && errno == EINVAL)
			errx(1, "%s: invalid reg offset %s",
			     progname, argv[0]);
		if (cp == NULL) {
            int cnt = 1;
		    if (argc > 1) {
		        cnt = (u_int) strtoul(argv[1], NULL, 0);
                argc--; argv++;
            }
		    for (i = 0; i < cnt; i++) {
		        printf("%p:%04x = 0x%04x\n",getregbase(), off+(4*i), regread(off+(4*i)));
		    }
		} else {
			val = (u_int32_t) strtoul(cp+1, NULL, 0);
			if (val == 0 && errno == EINVAL)
				errx(1, "%s: invalid reg value %s",
				     progname, cp+1);
			oval = regread(off);
			printf("Write %04x: %04x = %04x\n",
			       off, oval, val);
			regwrite(off, val);
		}
	}
	return 0;
}
예제 #5
0
int main(){

    printf("--------------------------------------------------------------------\n");
    printf("|                      Interface registers                          |\n");
    printf("--------------------------------------------------------------------\n");
    printf("reg\t|      nf0       |      nf1       |      nf2     |       nf3|\n");
    printf("--------------------------------------------------------------------\n");
    printf("rst_counters\t|      %llx      |      %llx      |      %llx    |       %llx       |\n",    regread(XPAR_NF10_10G_INTERFACE_0_RESET_CNTRS),regread(XPAR_NF10_10G_INTERFACE_1_RESET_CNTRS),regread(XPAR_NF10_10G_INTERFACE_2_RESET_CNTRS),regread(XPAR_NF10_10G_INTERFACE_3_RESET_CNTRS));
    printf("bad_frames\t|       %llx     |      %llx      |      %llx    |       %llx       |\n", regread(XPAR_NF10_10G_INTERFACE_0_BAD_FRAMES_COUNTER),regread(XPAR_NF10_10G_INTERFACE_1_BAD_FRAMES_COUNTER),regread(XPAR_NF10_10G_INTERFACE_2_BAD_FRAMES_COUNTER),regread(XPAR_NF10_10G_INTERFACE_3_BAD_FRAMES_COUNTER));
    printf("good_frames\t|       %llx     |      %llx      |      %llx    |       %llx       |\n",   regread(XPAR_NF10_10G_INTERFACE_0_GOOD_FRAMES_COUNTER),regread(XPAR_NF10_10G_INTERFACE_1_GOOD_FRAMES_COUNTER),regread(XPAR_NF10_10G_INTERFACE_2_GOOD_FRAMES_COUNTER),regread(XPAR_NF10_10G_INTERFACE_3_GOOD_FRAMES_COUNTER));
    printf("bytes_from_mac\t|      %llx      |      %llx      |      %llx    |       %llx       |\n",regread(XPAR_NF10_10G_INTERFACE_0_BYTES_FROM_MAC),regread(XPAR_NF10_10G_INTERFACE_1_BYTES_FROM_MAC),regread(XPAR_NF10_10G_INTERFACE_2_BYTES_FROM_MAC),regread(XPAR_NF10_10G_INTERFACE_3_BYTES_FROM_MAC));
    printf("rx_enq_pkt\t|       %llx     |      %llx      |      %llx    |       %llx       |\n",  regread(XPAR_NF10_10G_INTERFACE_0_RX_ENQUEUED_PKTS),regread(XPAR_NF10_10G_INTERFACE_1_RX_ENQUEUED_PKTS),regread(XPAR_NF10_10G_INTERFACE_2_RX_ENQUEUED_PKTS),regread(XPAR_NF10_10G_INTERFACE_3_RX_ENQUEUED_PKTS));
    printf("rx_enq_bytes\t|       %llx     |      %llx      |      %llx    |       %llx       |\n",regread(XPAR_NF10_10G_INTERFACE_0_RX_ENQUEUED_BYTES),regread(XPAR_NF10_10G_INTERFACE_1_RX_ENQUEUED_BYTES),regread(XPAR_NF10_10G_INTERFACE_2_RX_ENQUEUED_BYTES),regread(XPAR_NF10_10G_INTERFACE_3_RX_ENQUEUED_BYTES));
    printf("rx_deq_pkt\t|       %llx     |      %llx      |      %llx    |       %llx       |\n",  regread(XPAR_NF10_10G_INTERFACE_0_RX_DEQUEUED_PKTS),regread(XPAR_NF10_10G_INTERFACE_1_RX_DEQUEUED_PKTS),regread(XPAR_NF10_10G_INTERFACE_2_RX_DEQUEUED_PKTS),regread(XPAR_NF10_10G_INTERFACE_3_RX_DEQUEUED_PKTS));
    printf("rx_deq_bytes\t|       %llx     |      %llx      |      %llx    |       %llx       |\n",regread(XPAR_NF10_10G_INTERFACE_0_RX_DEQUEUED_BYTES),regread(XPAR_NF10_10G_INTERFACE_1_RX_DEQUEUED_BYTES),regread(XPAR_NF10_10G_INTERFACE_2_RX_DEQUEUED_BYTES),regread(XPAR_NF10_10G_INTERFACE_3_RX_DEQUEUED_BYTES));
    printf("tx_enq_pkts\t|       %llx     |      %llx      |      %llx    |       %llx       |\n",regread(XPAR_NF10_10G_INTERFACE_0_TX_ENQUEUED_PKTS),regread(XPAR_NF10_10G_INTERFACE_1_TX_ENQUEUED_PKTS),regread(XPAR_NF10_10G_INTERFACE_2_TX_ENQUEUED_PKTS),regread(XPAR_NF10_10G_INTERFACE_3_TX_ENQUEUED_PKTS));
    printf("tx_enq_bytes\t|       %llx     |      %llx      |      %llx    |       %llx       |\n",regread(XPAR_NF10_10G_INTERFACE_0_TX_ENQUEUED_BYTES),regread(XPAR_NF10_10G_INTERFACE_1_TX_ENQUEUED_BYTES),regread(XPAR_NF10_10G_INTERFACE_2_TX_ENQUEUED_BYTES),regread(XPAR_NF10_10G_INTERFACE_3_TX_ENQUEUED_BYTES));
    printf("tx_deq_pkts\t|       %llx     |      %llx      |      %llx    |       %llx       |\n",  regread(XPAR_NF10_10G_INTERFACE_0_TX_DEQUEUED_PKTS),regread(XPAR_NF10_10G_INTERFACE_1_TX_DEQUEUED_PKTS),regread(XPAR_NF10_10G_INTERFACE_2_TX_DEQUEUED_PKTS),regread(XPAR_NF10_10G_INTERFACE_3_TX_DEQUEUED_PKTS));
    printf("tx_deq_bytes\t|       %llx     |      %llx      |      %llx    |       %llx       |\n",regread(XPAR_NF10_10G_INTERFACE_0_TX_DEQUEUED_BYTES),regread(XPAR_NF10_10G_INTERFACE_1_TX_DEQUEUED_BYTES),regread(XPAR_NF10_10G_INTERFACE_2_TX_DEQUEUED_BYTES),regread(XPAR_NF10_10G_INTERFACE_3_TX_DEQUEUED_BYTES));
    printf("pkts_in_rxq\t|       %llx     |      %llx      |      %llx    |       %llx       |\n",regread(XPAR_NF10_10G_INTERFACE_0_RX_PKTS_IN_QUEUE),regread(XPAR_NF10_10G_INTERFACE_1_RX_PKTS_IN_QUEUE),regread(XPAR_NF10_10G_INTERFACE_2_RX_PKTS_IN_QUEUE),regread(XPAR_NF10_10G_INTERFACE_3_RX_PKTS_IN_QUEUE));
    printf("bytes_in_rxq\t|       %llx     |      %llx      |      %llx    |       %llx       |\n",regread(XPAR_NF10_10G_INTERFACE_0_RX_BYTES_IN_QUEUE),regread(XPAR_NF10_10G_INTERFACE_1_RX_BYTES_IN_QUEUE),regread(XPAR_NF10_10G_INTERFACE_2_RX_BYTES_IN_QUEUE),regread(XPAR_NF10_10G_INTERFACE_3_RX_BYTES_IN_QUEUE));
    printf("pkts_in_txq\t|       %llx     |      %llx      |      %llx    |       %llx       |\n",regread(XPAR_NF10_10G_INTERFACE_0_TX_PKTS_IN_QUEUE),regread(XPAR_NF10_10G_INTERFACE_1_TX_PKTS_IN_QUEUE),regread(XPAR_NF10_10G_INTERFACE_2_TX_PKTS_IN_QUEUE),regread(XPAR_NF10_10G_INTERFACE_3_TX_PKTS_IN_QUEUE));
    printf("bytes_in_txq\t|       %llx     |      %llx      |      %llx    |       %llx       |\n",regread(XPAR_NF10_10G_INTERFACE_0_TX_BYTES_IN_QUEUE),regread(XPAR_NF10_10G_INTERFACE_1_TX_BYTES_IN_QUEUE),regread(XPAR_NF10_10G_INTERFACE_2_TX_BYTES_IN_QUEUE),regread(XPAR_NF10_10G_INTERFACE_3_TX_BYTES_IN_QUEUE)); 
    printf("rx_pkts_dropped\t|       %llx     |      %llx      |      %llx    |       %llx       |\n",regread(XPAR_NF10_10G_INTERFACE_0_RX_PKTS_DROPPED),regread(XPAR_NF10_10G_INTERFACE_1_RX_PKTS_DROPPED),regread(XPAR_NF10_10G_INTERFACE_2_RX_PKTS_DROPPED),regread(XPAR_NF10_10G_INTERFACE_3_RX_PKTS_DROPPED));
    printf("rx_bytes_dropped|       %llx     |      %llx      |      %llx    |       %llx       |\n",regread(XPAR_NF10_10G_INTERFACE_0_RX_BYTES_DROPPED),regread(XPAR_NF10_10G_INTERFACE_1_RX_BYTES_DROPPED),regread(XPAR_NF10_10G_INTERFACE_2_RX_BYTES_DROPPED),regread(XPAR_NF10_10G_INTERFACE_3_RX_BYTES_DROPPED));


    printf("\n");
    
    printf("--------------------------------------------------------------------\n");
    printf("|                      Input Arbiter registers                         |\n");
    printf("--------------------------------------------------------------------\n");

    printf("rst_counter\t|      %llx |\n",    regread(XPAR_NF10_INPUT_ARBITER_0_RESET_CNTRS));
    printf("pkts_processed\t|      %llx |\n",    regread(XPAR_NF10_INPUT_ARBITER_0_NUM_PKTS_PROCESSED));

    printf("\n");

    printf("---------------------------------------------------------\n");
    printf("|             Switch-lite pcore registers               |\n");
    printf("---------------------------------------------------------\n");
    printf("Type\t\t\t\t|offset |\tValue\t|\n");
    printf("---------------------------------------------------------\n");
    printf("RESET_CNTRS\t\t\t|00\t|       %llx \t|\n", regread(XPAR_NF10_SWITCH_OUTPUT_PORT_LOOKUP_0_RESET_CNTRS));
    printf("SWITCH_OP_LUT_NUM_HITS_REG\t|04\t|       %llx \t|\n", regread(XPAR_NF10_SWITCH_OUTPUT_PORT_LOOKUP_0_LUT_NUM_HITS_REG));
    printf("SWITCH_OP_LUT_NUM_MISSES_REG\t|08\t|       %llx \t|\n", regread(XPAR_NF10_SWITCH_OUTPUT_PORT_LOOKUP_0_LUT_NUM_MISSES_REG));
    printf("---------------------------------------------------------\n");
    printf("\n");

    printf("--------------------------------------------------------------------------------------------\n");
    printf("|                      Output Queues registers                                              |\n");
    printf("--------------------------------------------------------------------------------------------\n");
    printf("interface\t|      nf0       |      nf1       |      nf2     |      nf3     |   host     |\n");
    printf("--------------------------------------------------------------------------------------------\n");
 
    printf("rst_counter\t|      %llx      |\n",    regread(XPAR_NF10_BRAM_OUTPUT_QUEUES_0_RESET_CNTRS));
    printf("pkts_stored\t|       %llx     |      %llx      |      %llx    |       %llx       |       %llx       |\n",    regread(XPAR_NF10_BRAM_OUTPUT_QUEUES_0_PKT_STORED_PORT_0),regread(XPAR_NF10_BRAM_OUTPUT_QUEUES_0_PKT_STORED_PORT_1),regread(XPAR_NF10_BRAM_OUTPUT_QUEUES_0_PKT_STORED_PORT_2),regread(XPAR_NF10_BRAM_OUTPUT_QUEUES_0_PKT_STORED_PORT_3),regread(XPAR_NF10_BRAM_OUTPUT_QUEUES_0_PKT_STORED_PORT_4));
    printf("bytes_stored\t|       %llx     |      %llx      |      %llx    |       %llx       |       %llx       |\n",   regread(XPAR_NF10_BRAM_OUTPUT_QUEUES_0_BYTES_STORED_PORT_0),regread(XPAR_NF10_BRAM_OUTPUT_QUEUES_0_BYTES_STORED_PORT_1),regread(XPAR_NF10_BRAM_OUTPUT_QUEUES_0_BYTES_STORED_PORT_2),regread(XPAR_NF10_BRAM_OUTPUT_QUEUES_0_BYTES_STORED_PORT_3),regread(XPAR_NF10_BRAM_OUTPUT_QUEUES_0_BYTES_STORED_PORT_4));
    printf("pkts_removed\t|      %llx      |      %llx      |      %llx    |       %llx       |       %llx       |\n",   regread(XPAR_NF10_BRAM_OUTPUT_QUEUES_0_PKT_REMOVED_PORT_0),regread(XPAR_NF10_BRAM_OUTPUT_QUEUES_0_PKT_REMOVED_PORT_1),regread(XPAR_NF10_BRAM_OUTPUT_QUEUES_0_PKT_REMOVED_PORT_2),regread(XPAR_NF10_BRAM_OUTPUT_QUEUES_0_PKT_REMOVED_PORT_3),regread(XPAR_NF10_BRAM_OUTPUT_QUEUES_0_PKT_REMOVED_PORT_4));
    printf("bytes_removed\t|       %llx     |      %llx      |      %llx    |       %llx       |       %llx       |\n",  regread(XPAR_NF10_BRAM_OUTPUT_QUEUES_0_BYTES_REMOVED_PORT_0),regread(XPAR_NF10_BRAM_OUTPUT_QUEUES_0_BYTES_REMOVED_PORT_1),regread(XPAR_NF10_BRAM_OUTPUT_QUEUES_0_BYTES_REMOVED_PORT_2),regread(XPAR_NF10_BRAM_OUTPUT_QUEUES_0_BYTES_REMOVED_PORT_3),regread(XPAR_NF10_BRAM_OUTPUT_QUEUES_0_BYTES_REMOVED_PORT_4));
    printf("pkts_dropped\t|       %llx     |      %llx      |      %llx    |       %llx       |       %llx       |\n",   regread(XPAR_NF10_BRAM_OUTPUT_QUEUES_0_PKT_DROPPED_PORT_0),regread(XPAR_NF10_BRAM_OUTPUT_QUEUES_0_PKT_DROPPED_PORT_1),regread(XPAR_NF10_BRAM_OUTPUT_QUEUES_0_PKT_DROPPED_PORT_2),regread(XPAR_NF10_BRAM_OUTPUT_QUEUES_0_PKT_DROPPED_PORT_3),regread(XPAR_NF10_BRAM_OUTPUT_QUEUES_0_PKT_DROPPED_PORT_4));
    printf("bytes_dropped\t|       %llx     |      %llx      |      %llx    |       %llx       |       %llx       |\n",  regread(XPAR_NF10_BRAM_OUTPUT_QUEUES_0_BYTES_DROPPED_PORT_0),regread(XPAR_NF10_BRAM_OUTPUT_QUEUES_0_BYTES_DROPPED_PORT_1),regread(XPAR_NF10_BRAM_OUTPUT_QUEUES_0_BYTES_DROPPED_PORT_2),regread(XPAR_NF10_BRAM_OUTPUT_QUEUES_0_BYTES_DROPPED_PORT_3),regread(XPAR_NF10_BRAM_OUTPUT_QUEUES_0_BYTES_DROPPED_PORT_4));
    printf("pkts_in_queue\t|       %llx     |      %llx      |      %llx    |       %llx       |       %llx       |\n",  regread(XPAR_NF10_BRAM_OUTPUT_QUEUES_0_PKT_IN_QUEUE_PORT_0),regread(XPAR_NF10_BRAM_OUTPUT_QUEUES_0_PKT_IN_QUEUE_PORT_1),regread(XPAR_NF10_BRAM_OUTPUT_QUEUES_0_PKT_IN_QUEUE_PORT_2),regread(XPAR_NF10_BRAM_OUTPUT_QUEUES_0_PKT_IN_QUEUE_PORT_3),regread(XPAR_NF10_BRAM_OUTPUT_QUEUES_0_PKT_IN_QUEUE_PORT_4));
    printf("bytes_in_queue\t|       %llx     |      %llx      |      %llx    |       %llx       |       %llx       |\n", regread(XPAR_NF10_BRAM_OUTPUT_QUEUES_0_BYTES_IN_QUEUE_PORT_0),regread(XPAR_NF10_BRAM_OUTPUT_QUEUES_0_PKT_IN_QUEUE_PORT_1),regread(XPAR_NF10_BRAM_OUTPUT_QUEUES_0_PKT_IN_QUEUE_PORT_2),regread(XPAR_NF10_BRAM_OUTPUT_QUEUES_0_PKT_IN_QUEUE_PORT_3),regread(XPAR_NF10_BRAM_OUTPUT_QUEUES_0_PKT_IN_QUEUE_PORT_4));

}