summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@dside.dyndns.org>2011-12-14 03:50:48 +0100
committerSuren A. Chilingaryan <csa@dside.dyndns.org>2011-12-14 03:50:48 +0100
commit667c1e8a83b3f5f8e90af824212c8da389f849d2 (patch)
treeb5e3573a8780c533985fee2ccdc5f0718f501419 /tests
parentc4c9ad7708ddd3114f78c5f860ebfeb92cfb79c3 (diff)
downloadpcitool-667c1e8a83b3f5f8e90af824212c8da389f849d2.tar.gz
pcitool-667c1e8a83b3f5f8e90af824212c8da389f849d2.tar.bz2
pcitool-667c1e8a83b3f5f8e90af824212c8da389f849d2.tar.xz
pcitool-667c1e8a83b3f5f8e90af824212c8da389f849d2.zip
few demo scripts
Diffstat (limited to 'tests')
-rwxr-xr-xtests/dump_file.sh3
-rwxr-xr-xtests/frame.sh5
-rwxr-xr-xtests/frame2.sh37
-rwxr-xr-xtests/grab.sh25
-rwxr-xr-xtests/reset_init.sh (renamed from tests/Reset_Init.sh)0
-rwxr-xr-xtests/stimuli.sh30
6 files changed, 86 insertions, 14 deletions
diff --git a/tests/dump_file.sh b/tests/dump_file.sh
new file mode 100755
index 0000000..6773a19
--- /dev/null
+++ b/tests/dump_file.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+hexdump -e ' "0x%08.8_ax: " 4/4 " 0x%08x " "\n" ' $1 | less
diff --git a/tests/frame.sh b/tests/frame.sh
index e6f071d..1696320 100755
--- a/tests/frame.sh
+++ b/tests/frame.sh
@@ -27,11 +27,6 @@ usleep 100000
pci -r dma1 -o bench.out --multipacket
-#for i in `seq 1 1000`; do
-# pci -r dma1 -s 4096 -o bench.out
-# if [ $? -ne 0 ]; then break; fi
-#done
-
pci -w control 1e1
pci --stop-dma dma1
diff --git a/tests/frame2.sh b/tests/frame2.sh
new file mode 100755
index 0000000..da05807
--- /dev/null
+++ b/tests/frame2.sh
@@ -0,0 +1,37 @@
+#!/bin/bash
+
+function pci {
+ PCILIB_PATH="/root/pcitool"
+ LD_LIBRARY_PATH="$PCILIB_PATH" $PCILIB_PATH/pci $*
+}
+
+pci --stop-dma dma1
+pci --reset
+
+echo "Set packet size 1024 .. "
+pci -w number_lines 1088
+#pci -w xrawdata_packet_length 4096
+pci --start-dma dma1
+usleep 1000
+
+echo "Send frame request ... "
+pci -w control 1e9
+usleep 1000
+pci -w control 1e1
+usleep 300000
+pci -w control 1e9
+usleep 1000
+pci -w control 1e1
+usleep 3000
+
+echo "Enable Readout ... "
+pci -w control 3e1
+
+usleep 100000
+
+pci -r dma1 -o bench.out --multipacket --timeout 1000000
+
+pci -w control 1e1
+
+pci --stop-dma dma1
+
diff --git a/tests/grab.sh b/tests/grab.sh
index 35e690b..5fa6100 100755
--- a/tests/grab.sh
+++ b/tests/grab.sh
@@ -5,13 +5,20 @@ function pci {
LD_LIBRARY_PATH="$PCILIB_PATH" $PCILIB_PATH/pci $*
}
-rm -f image.raw
+rm -f images.raw
-echo "Reset..."
-pci --reset
-echo "Stop DMA..."
-pci --stop-dma
-echo "Start DMA..."
-pci --start-dma dma1
-echo "Request..."
-pci -g -o image.raw
+
+echo "Starting the grabber"
+pci -g -o images.raw --run-time 3000000 &
+pid=$!
+
+usleep 1000000
+
+for i in `seq 1 10`; do
+ echo "Trigger $i"
+ pci --trigger
+ usleep 100000
+done
+
+echo "Waiting grabber to finish"
+wait $pid
diff --git a/tests/Reset_Init.sh b/tests/reset_init.sh
index ebfc9f5..ebfc9f5 100755
--- a/tests/Reset_Init.sh
+++ b/tests/reset_init.sh
diff --git a/tests/stimuli.sh b/tests/stimuli.sh
new file mode 100755
index 0000000..33e99e1
--- /dev/null
+++ b/tests/stimuli.sh
@@ -0,0 +1,30 @@
+#!/bin/bash
+
+function pci {
+ PCILIB_PATH="/root/pcitool"
+ LD_LIBRARY_PATH="$PCILIB_PATH" $PCILIB_PATH/pci $*
+}
+
+rm -f bench.out
+
+echo "Set FFFF the frame space .."
+pci -w 0x9180 fff
+
+echo "Set the number of frames .."
+pci -w reg9170 55
+
+pci --start-dma dma1
+
+echo "Send frame request ... "
+pci -w control 1f1
+usleep 100000
+pci -w control 1e1
+
+
+echo "Enable Readout ... "
+pci -w control 3e1
+pci -r dma1 -o bench.out --multipacket
+pci -w control 1e1
+
+pci --stop-dma dma1
+