Skip to content

VerifyHardwareAndSoftware

Zheeeng edited this page Nov 30, 2015 · 3 revisions

Table of Contents

Compile and Load Driver

Compile driver and tools

  • Compile
cd ~/netfpga/ make
  • Sample correct output:
make -C C
make[1]: Entering directory `/home/gac1/temp/NF2/lib/C'
make -C kernel
make[2]: Entering directory `/home/gac1/temp/NF2/lib/C/kernel'
make -C /lib/modules/2.6.9-55.0.9.ELsmp/build M=/home/gac1/temp/NF2/lib/C/kernel   LDDINC=/home/gac1/temp/NF2/lib/C/kernel/../include modules
make[3]: Entering directory `/usr/src/kernels/2.6.9-55.0.9.EL-smp-i686'
  Building modules, stage 2.
  MODPOST
make[3]: Leaving directory `/usr/src/kernels/2.6.9-55.0.9.EL-smp-i686'
make[2]: Leaving directory `/home/gac1/temp/NF2/lib/C/kernel'
make -C download
make[2]: Entering directory `/home/gac1/temp/NF2/lib/C/download'
make -C ../common
make[3]: Entering directory `/home/gac1/temp/NF2/lib/C/common'
make[3]: Nothing to be done for `all'.
make[3]: Leaving directory `/home/gac1/temp/NF2/lib/C/common'
make[2]: Leaving directory `/home/gac1/temp/NF2/lib/C/download'
make -C reg_access
make[2]: Entering directory `/home/gac1/temp/NF2/lib/C/reg_access'
make -C ../common
make[3]: Entering directory `/home/gac1/temp/NF2/lib/C/common'
make[3]: Nothing to be done for `all'.
make[3]: Leaving directory `/home/gac1/temp/NF2/lib/C/common'
make[2]: Leaving directory `/home/gac1/temp/NF2/lib/C/reg_access'
make -C router
make[2]: Entering directory `/home/gac1/temp/NF2/lib/C/router'
gcc -lncurses  cli.o ../common/nf2util.o ../common/util.o ../common/reg_defines.h   -o cli
gcc -lncurses  regdump.o ../common/nf2util.o ../common/reg_defines.h   -o regdump
gcc -lncurses  show_stats.o ../common/nf2util.o ../common/util.o ../common/reg_defines.h   -o show_stats
make[2]: Leaving directory `/home/gac1/temp/NF2/lib/C/router'
make[1]: Leaving directory `/home/gac1/temp/NF2/lib/C'
make -C scripts
make[1]: Entering directory `/home/gac1/temp/NF2/lib/scripts'
make -C cpci_reprogram
make[2]: Entering directory `/home/gac1/temp/NF2/lib/scripts/cpci_reprogram'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/gac1/temp/NF2/lib/scripts/cpci_reprogram'
make -C cpci_config_reg_access
make[2]: Entering directory `/home/gac1/temp/NF2/lib/scripts/cpci_config_reg_access'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/gac1/temp/NF2/lib/scripts/cpci_config_reg_access'
make[1]: Leaving directory `/home/gac1/temp/NF2/lib/scripts' 
  • If you get an error message such as "make: *** /lib/modules/2.6.9-42.ELsmp/build: No such file or directory. Stop.", then kernel sources are need to build the driver.

Load driver and tools

  • Install the driver and reboot. The driver will be stored in /lib/modules/`uname -r`/kernel/drivers/nf2.ko
 make install 
  • Sample correct output:
 for dir in lib bitfiles projects/scone/base projects/selftest/sw ; do \
         make -C $dir install; \
 done
 make[1]: Entering directory `/home/gac1/temp/NF2/lib'
 for dir in C scripts java/gui ; do \
         make -C $dir install; \
 done
 make[2]: Entering directory `/home/gac1/temp/NF2/lib/C'
 for dir in kernel download reg_access router ; do \
         make -C $dir install; \
 done
 make[3]: Entering directory `/home/gac1/temp/NF2/lib/C/kernel'
 make -C /lib/modules/2.6.9-55.0.9.ELsmp/build M=/home/gac1/temp/NF2/lib/C/kernel LDDINC=/home/gac1/temp/NF2/lib/C/kernel/../include modules
 make[4]: Entering directory `/usr/src/kernels/2.6.9-55.0.9.EL-smp-i686'
   Building modules, stage 2.
   MODPOST
 make[4]: Leaving directory `/usr/src/kernels/2.6.9-55.0.9.EL-smp-i686'
 install -m 644 nf2.ko /lib/modules/`uname -r`/kernel/drivers/nf2.ko /sbin/depmod -a
 make[3]: Leaving directory `/home/gac1/temp/NF2/lib/C/kernel'
 make[3]: Entering directory `/home/gac1/temp/NF2/lib/C/download'
 install nf2_download /usr/local/bin
 make[3]: Leaving directory `/home/gac1/temp/NF2/lib/C/download'
 make[3]: Entering directory `/home/gac1/temp/NF2/lib/C/reg_access'
 install regread /usr/local/bin
 install regwrite /usr/local/bin
 make[3]: Leaving directory `/home/gac1/temp/NF2/lib/C/reg_access'
 make[3]: Entering directory `/home/gac1/temp/NF2/lib/C/router'
 make[3]: Nothing to be done for `install'.
 make[3]: Leaving directory `/home/gac1/temp/NF2/lib/C/router'
 make[2]: Leaving directory `/home/gac1/temp/NF2/lib/C'
 make[2]: Entering directory `/home/gac1/temp/NF2/lib/scripts'
 for dir in cpci_reprogram cpci_config_reg_access ; do \
         make -C $dir install; \
 done
 make[3]: Entering directory `/home/gac1/temp/NF2/lib/scripts/cpci_reprogram'
 install cpci_reprogram.pl /usr/local/sbin
 make[3]: Leaving directory `/home/gac1/temp/NF2/lib/scripts/cpci_reprogram'
 make[3]: Entering directory `/home/gac1/temp/NF2/lib/scripts/cpci_config_reg_access'
 install dumpregs.sh /usr/local/sbin
 install loadregs.sh /usr/local/sbin
 make[3]: Leaving directory `/home/gac1/temp/NF2/lib/scripts/cpci_config_reg_access'
 make[2]: Leaving directory `/home/gac1/temp/NF2/lib/scripts'
 make[2]: Entering directory `/home/gac1/temp/NF2/lib/java/gui'
 make[2]: Nothing to be done for `install'.
 make[2]: Leaving directory `/home/gac1/temp/NF2/lib/java/gui'
 make[1]: Leaving directory `/home/gac1/temp/NF2/lib'
 make[1]: Entering directory `/home/gac1/temp/NF2/bitfiles'
 for bitfile in CPCI_2.1.bit cpci_reprogrammer.bit ; do \
         install -D -m 0644 $bitfile /usr/local/netfpga/bitfiles/$bitfile ; \
 done 
 make[1]: Leaving directory `/home/gac1/temp/NF2/bitfiles'
 make[1]: Entering directory `/home/gac1/temp/NF2/projects/scone/base'
 make[1]: Nothing to be done for `install'.
 make[1]: Leaving directory `/home/gac1/temp/NF2/projects/scone/base'
 make[1]: Entering directory `/home/gac1/temp/NF2/projects/selftest/sw'
 make[1]: Nothing to be done for `install'.
 make[1]: Leaving directory `/home/gac1/temp/NF2/projects/selftest/sw'
 
  • Reboot the machine. The driver currently crashes upon rmmod, so a reboot is required to load the newly compiled driver. You may want to check if other users are on the machine with the 'who' command first. If you don't like the other current machine users or you're the only one on the machine, run the following:
 reboot 
  • After reboot log in as root.
  • Verify that the driver loaded:
 lsmod  || grep nf2 
  • Sample correct output:
 nf2                    28428  0 

Verify NetFPGA interfaces

  • Verify that four nf2cX interfaces have successfully loaded by executing:
 ifconfig -a || grep nf2 
  • Sample correct output:
nf2c0     Link encap:Ethernet  HWaddr 00:4E:46:32:43:00 
nf2c1     Link encap:Ethernet  HWaddr 00:4E:46:32:43:01 
nf2c2     Link encap:Ethernet  HWaddr 00:4E:46:32:43:02 
nf2c3     Link encap:Ethernet  HWaddr 00:4E:46:32:43:03  

Reprogram the CPCI

  • Run the cpci reprogramming script
/usr/local/sbin/cpci_reprogram.pl --all               
(to reprogram all NetFPGAs in a system) 
  • Expected output:
Loading the CPCI Reprogrammer on NetFPGA 0   
Loading the CPCI on NetFPGA 0   
CPCI on NetFPGA 0 has been successfully reprogrammed 
  • Every time you restart the computer, you need to reload the CPCI!
  • To have the CPCI reprogrammed when the computer boots add the following line to /etc/rc.local
  /usr/local/netfpga/lib/scripts/cpci_reprogram/cpci_reprogram.pl --all 
  • If the NetFPGA refuses to send packets, and the regression or selftest is failing, make sure you've reprogrammed the cpci.

Run Selftest

The NetFPGA self-test is an FPGA bitfile and software that ensures that all of the components on your platform are fully functional. The self-test consists of both an FPGA bitfile that contains logic and interfaces to external components as well the software that displays the results. The self-test exercises all of the hardware in parallel. The test continues to run repeatedly until terminated by the user. The self-test was run at the factory just after the cards were manufactured. Cards are not distributed unless they completely pass all functions of the self-test process.

The self-test bitfile performs rigorous testing of the SRAM and DDR2 DRAM to ensure that all memory lines can be properly written to and read back with the same data. Multiple data patterns are used to ensure that no address or data lines have faults. The network test sends bursts of packets on the Ethernet interfaces and the loopback cables are put in place so that packets can be read and compared to the data that was transmitted. The SATA loopback test transmits data using the Multi-Gigabit I/O lines (MGIOs) to ensure that data can be reliably transmitted on the high-speed I/O interfaces. The DMA test exercises the PCI Controller (CPCI), the VirtexII, and the PCI bus to ensure that large blocks of data can be sent between the NetFPGA the host computer's memory. The self-test bitfile runs all of the tests above in parallel and continuously runs until it is terminated. The self-test software displays the results of testing on a console.

We provide the self-test bitfile and the software to end-users so that the self-test can be run when the hardware is delivered. When you receive a NetFPGA card, we suggest that you run the self-test to ensure that the card is still fully functional and that the card works properly in your environment. Before running the self-test, be sure that you have connected the loopback cables as shown in the directions on how to set up a NetFPGA in your system. If the loopback cables are not connected, the self-test will correctly report that an interface appears non-functional.

The following instructions assume that you have successfully installed a NetFPGA card with CentOS. The selftest is an enhanced version of the test run on every NetFPGA at the factory by Digilent to verify proper hardware operation.

Connect loopback cables

Install a SATA cable to loopback the board-to-board high-speed serial I/O.

Note: To minimize the chance that you damage your computer or the NetFPGA module, wear an anti-static wrist strap when handing the hardware.

align=center

Install two Ethernet cables as shown:

align=center

align=center

Bring nf2cX interfaces up

  • Type:
 for i in `seq 0 3`; do ifconfig nf2c$i up; done 

Load self-test bitfile

  • Type:
 nf_download ~/netfpga/bitfiles/selftest.bit 

Run Selftest

  • If you have connected a SATA cable to the NetFPGA, type the following command.
      ~/netfpga/projects/selftest/sw/selftest 
  • Otherwise, type the following command.
      ~/netfpga/projects/selftest/sw/selftest -n 
  • Expected Output:
Found net device: nf2c0  
NetFPGA selftest 1.00 alpha  
Running..... PASSED  

Run Regression Tests

The regression test suite is a set of tests that exercise the functionality of the released gateware and software. On a fast machine, this test should take approximately 10 minutes.

The features exercised by regression test suite are the only features we will try to provide support for. Additional features might be available and functional in the released gateware, but they are not supported.

For more information on the features we support, as defined by tests, see the following:

  • The NIC supports a set of features
    • The details of how each feature is tested is described in the NIC Regression test document available on the Wiki.
  • The Reference Router (RR) supports a set of features
    • The details of how each feature is tested is described in the RR Regression test, a large document available on the Wiki.
Please make sure that you have successfully completed the selftest before proceeding to the regression tests.

Connect Ethernet test cables

  • Connect 'eth1' to 'nf2c0' (c0 is the port closest to the mainboard)
  • Connect 'eth2' to 'nf2c1' (c1 is the port one away from the mainboard)
    • The location of your eth1 and eth2 ports may vary depending on your NIC
    • The photo below shows the configuration of a nf-test machine
align=center

Log in as root through X session

  • Log in as root or 'su -' to root using an X session, because we will be testing the GUI Scone

Load reference_router bitfile

  • Download the reference bitfile to the NetFPGA board:
 nf_download ~/netfpga/bitfiles/reference_router.bit 
  • Sample correct output:
Found net device: nf2c0
Bit file built from: nf2_top_par.ncd
Part: 2vp50ff1152
Date: 2007/10/ 9
Time: 22: 3: 4
Error Registers: 1000000
Good, after resetting programming interface the FIFO is empty
Download completed -  2377668 bytes. (expected 2377668).
DONE went high - chip has been successfully programmed.

Run regression test suite

  • Run the regression test suite. The tests should take about 10 minutes total.
Note: Prior to release 2.0.0 the command was nf21_regress_test.pl
 ~/netfpga/bin/nf_regress_test.pl 
  • Sample correct output:
 Running tests on project 'driver'...
   Running test 'driver_compile'... PASS
   Running test 'driver_install'... PASS
   Running test 'verify_mtu'... PASS
   Running global teardown... PASS
 
 Running tests on project 'reference_nic'...
   Running test 'download_nic'... PASS 
   Running test 'test_loopback_random'... PASS 
   Running test 'test_loopback_minsize'... PASS 
   Running test 'test_loopback_maxsize'... PASS 
   Running test 'test_loopback_drop'... PASS 
   Running test 'test_ip_interface'... PASS
   Running global teardown... PASS
 
 Running tests on project 'reference_router'...
   Running global setup... PASS
   Running test 'test_router_cpusend/run.pl'... PASS
   Running test 'test_wrong_dest_mac'... PASS
   Running test 'test_nonip_packet'... PASS
   Running test 'test_nonipv4_packet'... PASS
   Running test 'test_invalidttl_packet'... PASS
   Running test 'test_lpm_misses'... PASS
   Running test 'test_arp_misses'... PASS
   Running test 'test_badipchecksum_packet'... PASS
   Running test 'test_ipdest_filter_hit'... PASS
   Running test 'test_packet_forwarding'... PASS
   Running test 'test_lpm'... PASS
   Running test 'test_lpm_next_hop'... PASS
   Running test 'test_queue_overflow'... PASS
   Running test 'test_oq_limit'... PASS
   Running test 'test_ipdest_filter'... PASS
   Running test 'test_oq_sram_sz_cpu'... PASS
   Running test 'test_oq_sram_sz_mac'... PASS
   Running test 'test_router_table/run.pl'... PASS
   Running test 'test_send_rec/run.pl'... PASS
   Running test 'test_lut_forward'... PASS
   Running global teardown... PASS
 
 Running tests on project 'scone'...
   Running global setup... PASS
   Running test 'test_build'... PASS
   Running test 'test_mac_set'... PASS
   Running test 'test_ip_set'... PASS
   Running test 'test_rtable_set'... PASS
   Running test 'test_disabled_interfaces/run.pl'... PASS
   Running test 'test_noniparp_ethtype'... PASS
   Running test 'test_arp_rpl/run.pl'... PASS
   Running test 'test_arp_norpl/run.pl'... PASS
   Running test 'test_arp_quepkt/run.pl'... PASS
   Running test 'test_ip_error/run.pl'... PASS
   Running test 'test_ip_rtblmiss/run.pl'... PASS
   Running test 'test_ip_intfc/run.pl'... PASS
   Running test 'test_ip_checksum/run.pl'... PASS
   Running test 'test_ttl_expired/run.pl'... PASS
   Running test 'test_send_receive/run.pl'... PASS
   Running test 'test_arp_req/run.pl'... PASS
   Running test 'test_tcp_port/run.pl'... PASS
   Running test 'test_udp_packet/run.pl'... PASS
   Running test 'test_icmp_echo/run.pl'... PASS
   Running test 'test_icmp_notecho/run.pl'... PASS
   Running global teardown... PASS
 
 Running tests on project 'router_kit'...
   Running global setup... PASS
   Running test 'test_00_make/run.sh'... PASS
   Running test 'test_01_ip_dst_filter/run.pl'... PASS
   Running test 'test_02_route_table/run.pl'... PASS
   Running test 'test_03_arp_table/run.pl'... PASS
   Running test 'test_04_ip_packets/run.pl'... PASS
   Running global teardown... PASS
 
 Running tests on project 'router_buffer_sizing'...
   Running global setup... PASS
   Running test 'test_time_stamp/run'... PASS
   Running test 'test_store_event/run'... PASS
   Running global teardown... PASS
  • If there are no errors (all tests say PASS), you can play with your router, or go on to creating a bitfile from source.

Run regression scripts on new bitfile

If you installed the CAD tools, you should run this test to verify that you can build a new circuit. Skip this step if you do not plan to modify hardware.

Synthesize reference_router bitfile, from source

Note: This step will take about 45-60 mins. This can be used to verify the setup of the machine for synthesis. You will need to have the NetFPGA Beta Plus package. The Beta (not Plus) package does not include the sources for this step.

  • If you are a hardware developer and would like to synthesize your own NetFPGA Router hardware using the Verilog source code, follow the steps below. To synthesize FPGA hardware, you will need to have all of the FPGA Development tools installed.
  • Login, either direct in an X session or via ssh -X. This step causes ~/nf2_profile, plus environment variables, to be sourced. You may say "But I'm not running anything graphical!" and you'd be right. Unfortunately, even when called with no gui, the Xilinx tools require X to be running. A bugreport on this issue has been filed to Xilinx.
  • Set up the Xilinx ISE tools (see Xilinx's website for instructions). Make sure the Xilnx tools are in your path and that the XILINX environment variable is set.
  • Go to the synthesis directory for the reference_nic and run make. This step should take under an hour on a well-endowed machine.
cd ~/netfpga/projects/reference_router/synth   
time make 
  • Verify the reference_router bitfile (nf2_top_par.bit) has been created.
 ls || grep nf2_top_par.bit 
  • Sample correct output:
 nf2_top_par.bit 

Load new bitfile

  • Download the fresh bitfile to the NetFPGA board:
 nf_download nf2_top_par.bit 

Run regression-test suite on new bitfile

  • Re-run the regression test suite.
Note: Prior to release 2.0.0 the command was nf21_regress_test.pl
 ~/netfpga/bin/nf2_regress_test.pl 
  • Sample correct output:
 Running tests on project 'driver'...
   Running test 'driver_compile'... PASS
   Running test 'driver_install'... PASS
   Running test 'verify_mtu'... PASS
   Running global teardown... PASS
 
Running tests on project 'reference_nic'...
  Running test 'download_nic'... PASS 
  Running test 'test_loopback_random'... PASS 
  Running test 'test_loopback_minsize'... PASS 
  Running test 'test_loopback_maxsize'... PASS 
  Running test 'test_loopback_drop'... PASS 
  Running test 'test_ip_interface'... PASS 
  Running global teardown... PASS
 
 Running tests on project 'reference_router'...
   Running global setup... PASS
   Running test 'test_router_cpusend/run.pl'... PASS
   Running test 'test_wrong_dest_mac'... PASS
   Running test 'test_nonip_packet'... PASS
   Running test 'test_nonipv4_packet'... PASS
   Running test 'test_invalidttl_packet'... PASS
   Running test 'test_lpm_misses'... PASS
   Running test 'test_arp_misses'... PASS
   Running test 'test_badipchecksum_packet'... PASS
   Running test 'test_ipdest_filter_hit'... PASS
   Running test 'test_packet_forwarding'... PASS
   Running test 'test_lpm'... PASS
   Running test 'test_lpm_next_hop'... PASS
   Running test 'test_queue_overflow'... PASS
   Running test 'test_oq_limit'... PASS
   Running test 'test_ipdest_filter'... PASS
   Running test 'test_oq_sram_sz_cpu'... PASS
   Running test 'test_oq_sram_sz_mac'... PASS
   Running test 'test_router_table/run.pl'... PASS
   Running test 'test_send_rec/run.pl'... PASS
   Running test 'test_lut_forward'... PASS
   Running global teardown... PASS
 
 Running tests on project 'scone'...
   Running global setup... PASS
   Running test 'test_build'... PASS
   Running test 'test_mac_set'... PASS
   Running test 'test_ip_set'... PASS
   Running test 'test_rtable_set'... PASS
   Running test 'test_disabled_interfaces/run.pl'... PASS
   Running test 'test_noniparp_ethtype'... PASS
   Running test 'test_arp_rpl/run.pl'... PASS
   Running test 'test_arp_norpl/run.pl'... PASS
   Running test 'test_arp_quepkt/run.pl'... PASS
   Running test 'test_ip_error/run.pl'... PASS
   Running test 'test_ip_rtblmiss/run.pl'... PASS
   Running test 'test_ip_intfc/run.pl'... PASS
   Running test 'test_ip_checksum/run.pl'... PASS
   Running test 'test_ttl_expired/run.pl'... PASS
   Running test 'test_send_receive/run.pl'... PASS
   Running test 'test_arp_req/run.pl'... PASS
   Running test 'test_tcp_port/run.pl'... PASS
   Running test 'test_udp_packet/run.pl'... PASS
   Running test 'test_icmp_echo/run.pl'... PASS
   Running test 'test_icmp_notecho/run.pl'... PASS
   Running global teardown... PASS
  
 Running tests on project 'router_kit'...
   Running global setup... PASS
   Running test 'test_00_make/run.sh'... PASS
   Running test 'test_01_ip_dst_filter/run.pl'... PASS
   Running test 'test_02_route_table/run.pl'... PASS
   Running test 'test_03_arp_table/run.pl'... PASS
   Running test 'test_04_ip_packets/run.pl'... PASS
   Running global teardown... PASS
 
 Running tests on project 'router_buffer_sizing'...
   Running global setup... PASS
   Running test 'test_time_stamp/run'... PASS
   Running test 'test_store_event/run'... PASS
   Running global teardown... PASS

What to do from here

Clone this wiki locally