summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@dside.dyndns.org>2011-07-17 23:22:21 +0200
committerSuren A. Chilingaryan <csa@dside.dyndns.org>2011-07-17 23:22:21 +0200
commit1f133e363c89e736a4221a3dda800e90a706056a (patch)
tree672af40ccd831c78b782d3af35acf5454717299a
parentbd6a3cb1cc31c74d36c1afaf1fbcc63ab18f993a (diff)
downloadpcitool-1f133e363c89e736a4221a3dda800e90a706056a.tar.gz
pcitool-1f133e363c89e736a4221a3dda800e90a706056a.tar.bz2
pcitool-1f133e363c89e736a4221a3dda800e90a706056a.tar.xz
pcitool-1f133e363c89e736a4221a3dda800e90a706056a.zip
Provide few scripts to test DMA
-rwxr-xr-xtests/bench.sh30
-rwxr-xr-xtests/cleanup.sh13
2 files changed, 43 insertions, 0 deletions
diff --git a/tests/bench.sh b/tests/bench.sh
new file mode 100755
index 0000000..ca3988e
--- /dev/null
+++ b/tests/bench.sh
@@ -0,0 +1,30 @@
+#!/bin/bash
+
+function pci {
+ PCILIB_PATH="/root/pcitool"
+ LD_LIBRARY_PATH="$PCILIB_PATH" $PCILIB_PATH/pci $*
+}
+
+size=16
+bytes=`expr $size "*" 4`
+
+pci -w xrawdata_packet_length $bytes
+pci -w xrawdata_enable_loopback 0
+pci -w xrawdata_enable_generator 0
+
+pci --start-dma dma1
+
+while [ $? -eq 0 ]; do
+ pci -r dma1 -s 65536 &> /dev/null
+done
+
+pci -w xrawdata_enable_loopback 1
+
+for i in `seq 1 10`; do
+ pci -w dma1 -s $size "*$i"
+ pci -r dma1 -s $size
+done
+
+pci --stop-dma dma1
+
+pci -w xrawdata_enable_loopback 0
diff --git a/tests/cleanup.sh b/tests/cleanup.sh
new file mode 100755
index 0000000..3dd201e
--- /dev/null
+++ b/tests/cleanup.sh
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+function pci {
+ PCILIB_PATH="/root/pcitool"
+ LD_LIBRARY_PATH="$PCILIB_PATH" $PCILIB_PATH/pci $*
+}
+
+pci --start-dma dma1r
+pci -w dma1r_reset_request 1
+pci -w dma1r_reset 1
+pci -r dma1r_running
+
+pci --clean-kernel-memory dma