diff options
author | Suren A. Chilingaryan <csa@dside.dyndns.org> | 2013-11-26 20:50:34 +0100 |
---|---|---|
committer | Suren A. Chilingaryan <csa@dside.dyndns.org> | 2013-11-26 20:50:34 +0100 |
commit | 57ca91fd955dd228f208000de1c2fa2bc4a0e317 (patch) | |
tree | c0f78e7ac4181b27bcc3cabbc53068692e253fdb /tests | |
parent | d34069a3cb882bf4f2a2f6353f69ed1cce4b27af (diff) | |
download | pcitool-57ca91fd955dd228f208000de1c2fa2bc4a0e317.tar.gz pcitool-57ca91fd955dd228f208000de1c2fa2bc4a0e317.tar.bz2 pcitool-57ca91fd955dd228f208000de1c2fa2bc4a0e317.tar.xz pcitool-57ca91fd955dd228f208000de1c2fa2bc4a0e317.zip |
Adjustments to test scripts
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/frame.sh | 5 | ||||
-rwxr-xr-x | tests/ipecamera/Reset_Init_all_reg_10bit.sh | 22 | ||||
-rwxr-xr-x | tests/ipecamera/Reset_Init_all_reg_11bit.sh | 9 | ||||
-rwxr-xr-x | tests/ipecamera/Reset_Init_all_reg_12bit.sh | 26 | ||||
-rwxr-xr-x | tests/loopback-test.sh | 22 | ||||
-rwxr-xr-x | tests/run-and-decode-test.sh | 33 |
6 files changed, 98 insertions, 19 deletions
diff --git a/tests/frame.sh b/tests/frame.sh index b2b2a70..679817b 100755 --- a/tests/frame.sh +++ b/tests/frame.sh @@ -1,7 +1,10 @@ #!/bin/bash +TESTS_PATH="`dirname \"$0\"`" +TESTS_PATH="`( cd \"$TESTS_PATH\" && pwd )`" + function pci { - PCILIB_PATH="/root/pcitool" + PCILIB_PATH=$TESTS_PATH/.. LD_LIBRARY_PATH="$PCILIB_PATH" $PCILIB_PATH/pci $* } diff --git a/tests/ipecamera/Reset_Init_all_reg_10bit.sh b/tests/ipecamera/Reset_Init_all_reg_10bit.sh index f6a3521..f4afa06 100755 --- a/tests/ipecamera/Reset_Init_all_reg_10bit.sh +++ b/tests/ipecamera/Reset_Init_all_reg_10bit.sh @@ -5,10 +5,10 @@ error=0 echo " Reset Readout and CMOSIS " -pci -w 0x9040 204 +pci -w 0x9040 80000204 sleep .1 #echo " Release Reset for Readout" -#pci -w 0x9040 1e0 +#pci -w 0x9040 800001e0 sleep .1 ##################### PLL SET ##################################### val=f501 @@ -228,7 +228,7 @@ fi #################################################################################################################### sleep 0.01 -#pci -w 0x9040 201 +#pci -w 0x9040 80000201 sleep 0.01 ########################## WRITE THE READOUT NUMBER OF LINE ####################################################### pci -w cmosis_number_lines 1088 @@ -288,16 +288,23 @@ sleep 0.01 ######################################################################################################### sleep 0.01 + + +################################################## +#SET the max number of frame in DDR +pci -w 0x91a0 0x71 + #echo " Reset Readout and CMOSIS " -pci -w 0x9040 0x204 +pci -w 0x9040 0x80000204 sleep .1 echo " Release Reset for Readout" -pci -w 0x9040 0x201 +pci -w 0x9040 0x80000201 sleep .1 status=`pci -r 0x9050 -s 4 | awk '{print $2$3$4}'` if [ "$status" != "8449ffff0f0010013ffff111" ]; then echo "--------------------------------->>>> ERROR! in the camera status ... " + echo " $status " error=1 # exit fi @@ -311,4 +318,9 @@ else fi echo +echo "DMA reset ... " +pci --stop-dma dma1 +sleep 0.5 +pci --start-dma dma1 + diff --git a/tests/ipecamera/Reset_Init_all_reg_11bit.sh b/tests/ipecamera/Reset_Init_all_reg_11bit.sh index 048f6b0..3c4af0e 100755 --- a/tests/ipecamera/Reset_Init_all_reg_11bit.sh +++ b/tests/ipecamera/Reset_Init_all_reg_11bit.sh @@ -279,6 +279,10 @@ if [ "$value" != "b$val" ]; then fi #pci -r 0x9000 -s 10 +################################################## +#SET the max number of frame in DDR +pci -w 0x91a0 0x1C + sleep 0.01 #pci -w 0x9000 0xd011 sleep 0.01 @@ -307,3 +311,8 @@ fi echo +echo "DMA reset ... " +pci --stop-dma dma1 +sleep 0.5 +pci --start-dma dma1 + diff --git a/tests/ipecamera/Reset_Init_all_reg_12bit.sh b/tests/ipecamera/Reset_Init_all_reg_12bit.sh index 00c2481..b04f2cd 100755 --- a/tests/ipecamera/Reset_Init_all_reg_12bit.sh +++ b/tests/ipecamera/Reset_Init_all_reg_12bit.sh @@ -188,7 +188,7 @@ echo " End CMOSIS Configuration .." echo " Write exp time......" ######################################### EXP TIME ####################################################### -val=aa01 +val=aa0f pci -w 0x9000 $val sleep 0.01 #pci -r 0x9000 -s 10 @@ -280,20 +280,29 @@ fi #pci -r 0x9000 -s 10 sleep 0.01 + +################################################## +#SET the max number of frame in DDR +pci -w 0x91a0 0x1C + + #pci -w 0x9000 0xd011 sleep 0.01 -#pci -r 0x9000 -s 10 +pci -r 0x9000 -s 10 sleep 0.01 #pci -w 0x9000 0xd111 -#pci -r 0x9000 -s 10 -######################################################################################################### sleep 0.01 +pci -r 0x9000 -s 10 +######################################################################################################### +sleep 0.1 status=`pci -r 0x9050 -s 4 | awk '{print $2$3$4}'` -if [ "$status" != "8449ffff0f0010013ffff111" ]; then +if [ "$status" != "844950280f0010013ffff111" ]; then + echo "--------------------------------->>>> ERROR! in the camera status ... " - error =1 + echo $status + error=1 # exit fi @@ -307,3 +316,8 @@ fi echo + +echo "DMA reset ... " +pci --stop-dma dma1 +sleep 0.5 +pci --start-dma dma1 diff --git a/tests/loopback-test.sh b/tests/loopback-test.sh index 7ae03a4..09bfc82 100755 --- a/tests/loopback-test.sh +++ b/tests/loopback-test.sh @@ -35,27 +35,42 @@ fi failed=0 send=0 errors=0 +err_num=0 + +print_iters=`expr 2 + 1024 '*' 100 / $size` read_size=`expr $multiplier '*' $size` echo "Starting..." i=1 + pci -w 0x9040 0x201 + while [ 1 ]; do + if [ $wait -gt 0 ]; then + pci -w 0x9040 0x1 + fi + pci -w dma1 -s $size "*0x$i" rm -f /tmp/camera-test.out - pci -r dma1 --multipacket -s $read_size -o /tmp/camera-test.out &> /dev/null + pci -r dma1 --wait --multipacket -s $read_size -o /tmp/camera-test.out -t 1000000 &> /dev/null if [ $wait -gt 0 ]; then wrdone=0 while [ $wrdone -eq 0 ]; do - pci --list-dma-engines +# pci --list-dma-engines pci --list-dma-engines | grep "DMA1 S2C" | grep "SD" #&> /dev/null wrdone=$? done + pci -w 0x9040 0x201 fi res=`compare /tmp/camera-test.out $read_size "$i" 6 2 6` if [ $? -eq 0 ]; then err_cnt=`echo $res | cut -f 1 -d ' '` + if [ "$err_cnt" -ne 0 ]; then + pci -r dma1 --wait --multipacket -o /tmp/camera-test.out -t 1000000 &> /dev/null + cp /tmp/camera-test.out /tmp/camera-test.out.$err_num + err_num=$(($err_num + 1)) + fi byte_cnt=`echo $res | cut -f 3 -d ' '` send=$(($send + $byte_cnt * 4)) errors=$(($errors + $err_cnt * 4)) @@ -64,8 +79,9 @@ while [ 1 ]; do fi i=$((i + 1)) - if [ $i -eq 100 ]; then + if [ $i -eq $print_iters ]; then echo "Data send: $send bytes, Errors: $errors bytes, Failed exchanges: $failed" +# pci -r 0x9070 -s 4 i=1 fi done diff --git a/tests/run-and-decode-test.sh b/tests/run-and-decode-test.sh index c021c2d..5bf6513 100755 --- a/tests/run-and-decode-test.sh +++ b/tests/run-and-decode-test.sh @@ -1,7 +1,7 @@ #! /bin/bash -#location=/mnt/fast/ -location="./" +location=/mnt/fast/ +#location="./" duration=10000000 wait_frame=1000000 @@ -18,6 +18,13 @@ function stop { pci -w control 0x201 &> /dev/null } +function reset { + pci -r 0x9000 -s 256 > $1.status + $TESTS_PATH/ipecamera/Reset_Init_all_reg_10bit.sh &> $1.reset +} + + +$TESTS_PATH/ipecamera/Reset_Init_all_reg_10bit.sh &> /dev/null /root/pcitool/tests/frame.sh &> /dev/null rm -f bench.out @@ -39,6 +46,9 @@ decode_failures=0 failures=0 failed=0 frames=0 +fpga_failures=0 +cmosis_failures=0 +frame_rate_failures=0 iter=0 while [ 1 ]; do @@ -60,19 +70,34 @@ while [ 1 ]; do if [ $? -ne 0 -o $cur_failed -eq 0 ]; then ipedec -d -v --continue $output > $output.decode decode_failures=$(($decode_failures + 1)) + reset $output else cur_failed=$(($cur_failed - 1)) cur_frames=`echo $cur_decoded | cut -f 2 -d ' '` failed=$(($failed + $cur_failed)) frames=$(($frames + $cur_frames)) - if [ $cur_failed -eq 0 ]; then + fpga_status=`pci -r 0x9054 | awk '{print $2;}' | cut -c 2` + cmosis_status=`pci -r 0x9050 | awk '{print $2;}' | cut -c 3-4` + if [ "$fpga_status" != "f" ]; then + fpga_failures=$(($fpga_failures + 1)) + reset $output + elif [ "$cmosis_status" == "7d" ]; then + cmosis_failures=$(($cmosis_failures + 1)) + reset $output + elif [ $cur_frames -lt 10 ]; then + frame_rate_failures=$(($frame_rate_failures + 1)) + reset $output + elif [ $cur_failed -eq 0 ]; then rm -f $output + else + reset $output fi fi else failures=$(($failures + 1)) + reset $output fi - echo "Frames: $frames, Failed Frames: $failed, Failed Exchanges: $failures, Failed Decodings: $decode_failures" + echo "Frames: $frames, Failed Frames: $failed, Failed Exchanges: $failures, Failed Decodings: $decode_failures, FPGA Failures: $fpga_failures, CMOSIS Failures: $cmosis_failures, Low Frame Rate: $frame_rate_failures" iter=`expr $iter + 1` done |