test.sh 838 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #!/bin/bash
  2. size=65536
  3. function pci {
  4. PCILIB_PATH=`pwd`/../..
  5. LD_LIBRARY_PATH="$PCILIB_PATH/pcilib" $PCILIB_PATH/pcitool/pci -m ipedma $*
  6. }
  7. rm -f bench.out
  8. echo "Stopping DMA and skipping exiting data..."
  9. pci --stop-dma dma0r
  10. echo "Starting DMA..."
  11. pci --start-dma dma0r
  12. echo "Starting data generation..."
  13. pci -w 0x9000 0x1
  14. # Clean DMA buffers
  15. #while [ $? -eq 0 ]; do
  16. # pci -r dma0 -s 65536 &> /dev/null
  17. #done
  18. echo "Reading the data from DMA..."
  19. for i in `seq 1 100`; do
  20. pci -r dma0 --multipacket -s $size -o bench.out --timeout 1000000
  21. # pci -r dma0 --multipacket -s $size -o /dev/null --timeout 10000000
  22. if [ $? -ne 0 ]; then
  23. echo "Stopping DMA due to the error..."
  24. # pci --stop-dma dma0r
  25. exit
  26. fi
  27. done
  28. echo "Stopping DMA..."
  29. pci --stop-dma dma0r
  30. ../../apps/check_counter bench.out
  31. #pci -r 0 -s 32