From 667c1e8a83b3f5f8e90af824212c8da389f849d2 Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Wed, 14 Dec 2011 03:50:48 +0100 Subject: few demo scripts --- tests/Reset_Init.sh | 23 ----------------------- tests/dump_file.sh | 3 +++ tests/frame.sh | 5 ----- tests/frame2.sh | 37 +++++++++++++++++++++++++++++++++++++ tests/grab.sh | 25 ++++++++++++++++--------- tests/reset_init.sh | 23 +++++++++++++++++++++++ tests/stimuli.sh | 30 ++++++++++++++++++++++++++++++ 7 files changed, 109 insertions(+), 37 deletions(-) delete mode 100755 tests/Reset_Init.sh create mode 100755 tests/dump_file.sh create mode 100755 tests/frame2.sh create mode 100755 tests/reset_init.sh create mode 100755 tests/stimuli.sh diff --git a/tests/Reset_Init.sh b/tests/Reset_Init.sh deleted file mode 100755 index ebfc9f5..0000000 --- a/tests/Reset_Init.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash - -echo " Reset Readout and CMOSIS " -pci -w 0x9040 1e5 -echo " Release Reset for Readout" -pci -w 0x9040 1e1 - -echo " Start CMOSIS Configuration .." -pci -w 0x9000 f301 -pci -r 0x9000 -s 4 - -pci -w 0x9000 d207 -pci -r 0x9000 -s 4 - -pci -w 0x9000 8101 -pci -r 0x9000 -s 4 - -pci -w 0x9000 8200 -pci -r 0x9000 -s 4 -echo " End CMOSIS Configuration .." -pci -w 0x9040 3e1 - -pci -r 0x9000 -s 100 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 new file mode 100755 index 0000000..ebfc9f5 --- /dev/null +++ b/tests/reset_init.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +echo " Reset Readout and CMOSIS " +pci -w 0x9040 1e5 +echo " Release Reset for Readout" +pci -w 0x9040 1e1 + +echo " Start CMOSIS Configuration .." +pci -w 0x9000 f301 +pci -r 0x9000 -s 4 + +pci -w 0x9000 d207 +pci -r 0x9000 -s 4 + +pci -w 0x9000 8101 +pci -r 0x9000 -s 4 + +pci -w 0x9000 8200 +pci -r 0x9000 -s 4 +echo " End CMOSIS Configuration .." +pci -w 0x9040 3e1 + +pci -r 0x9000 -s 100 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 + -- cgit v1.2.3