From cd35dd6d3f1343b8ec2590cf9bfc9a1bc41c4960 Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Mon, 31 Oct 2011 06:34:26 +0100 Subject: Update scripts --- NOTES | 24 +++++++++++++++++++++++ tests/Frame_Req.sh | 50 ------------------------------------------------ tests/Reset_Init.sh | 24 +++++++++++------------ tests/bench.sh | 30 ----------------------------- tests/bench3.sh | 26 ------------------------- tests/bench_ipecamera.sh | 34 ++++++++++++++++++++++++++++++++ tests/bench_nwl.sh | 30 +++++++++++++++++++++++++++++ tests/frame.sh | 38 ++++++++++++++++++++++++++++++++++++ tests/frame_req.sh | 27 ++++++++++++++++++++++++++ tests/grab.sh | 17 ++++++++++++++++ tests/tb_mic.sh | 11 ----------- 11 files changed, 182 insertions(+), 129 deletions(-) delete mode 100755 tests/Frame_Req.sh delete mode 100755 tests/bench.sh delete mode 100755 tests/bench3.sh create mode 100755 tests/bench_ipecamera.sh create mode 100755 tests/bench_nwl.sh create mode 100755 tests/frame.sh create mode 100755 tests/frame_req.sh create mode 100755 tests/grab.sh delete mode 100755 tests/tb_mic.sh diff --git a/NOTES b/NOTES index 27990d0..94e4e95 100644 --- a/NOTES +++ b/NOTES @@ -145,6 +145,30 @@ DMA Access Synchronization user to check their consistency and restart DMA engine.] IRQs are enabled and disabled at each call + +DMA Reads +========= +standard: default reading mode, reads a single full packet +multipacket: reads all available packets +waiting multipacket: reads all available packets, after finishing the + last one waiting if new data arrives +exact read: read exactly specified number of bytes (should be + only supported if it is multiple of packets, otherwise + error should be returned) +ignore packets: autoterminate each buffer, depends on engine + configuration +autogrow: automatic memory allocation, only through streaming + + first | new_pkt | bufer + -------------------------- +standard wait | term | wait +multiple packets wait | check | wait - DMA_READ_FLAG_MULTIPACKET +waiting multipacket wait | wait | wait - DMA_READ_FLAG_WAIT +exact wait | wait/term | wait - limited by size parameter +ignore packets wait | check | check - just autoterminated +autogrow + +Shall we do a special handling in case of overflow? Register Access Synchronization =============================== diff --git a/tests/Frame_Req.sh b/tests/Frame_Req.sh deleted file mode 100755 index 0988ee2..0000000 --- a/tests/Frame_Req.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/bash - -echo " Reset Readout and CMOSIS " -pci -w 0xd2009040 1e5 -pci -r 0xd2009040 -s 10 -echo " Release Reset for CMOSIS" -pci -w 0xd2009040 1e1 -pci -r 0xd2009040 -s 10 - -sleep 1 -echo " Start CMOSIS Configuration .." -pci -w 0xd2009000 f301 -pci -r 0xd2009000 -s 10 - -usleep 1000 -pci -w 0xd2009000 d207 -pci -r 0xd2009000 -s 10 -usleep 1000 -echo " Number of rows set here " -pci -w 0xd2009000 8102 -pci -r 0xd2009000 -s 10 - -usleep 1000 -pci -w 0xd2009000 8200 -pci -r 0xd2009000 -s 10 - -sleep 1 -echo "Set packet siye 1024 .. " -pci -w xrawdata_packet_length 4096 -pci --start-dma dma1 -sleep 1 - -echo "Send frame request ... " -pci -w 0xd2009040 1e9 -pci -w 0xd2009040 1e1 - -echo "Status ... " -pci -r 0xd2009000 -s 100 - -echo "Enable Readout ... " -pci -w 0xd2009040 3e1 -pci -r 0xd2009000 -s 100 - -for i in `seq 1 10`; do -# pci -r dma1 -s 1024 -o bench.out - pci -r dma1 -s 4096 -done - -pci --stop-dma dma1 - diff --git a/tests/Reset_Init.sh b/tests/Reset_Init.sh index 198cbfc..ebfc9f5 100755 --- a/tests/Reset_Init.sh +++ b/tests/Reset_Init.sh @@ -1,23 +1,23 @@ #!/bin/bash echo " Reset Readout and CMOSIS " -pci -w 0xd2009040 1e5 +pci -w 0x9040 1e5 echo " Release Reset for Readout" -pci -w 0xd2009040 1e1 +pci -w 0x9040 1e1 echo " Start CMOSIS Configuration .." -pci -w 0xd2009000 f301 -pci -r 0xd2009000 -s 4 +pci -w 0x9000 f301 +pci -r 0x9000 -s 4 -pci -w 0xd2009000 d207 -pci -r 0xd2009000 -s 4 +pci -w 0x9000 d207 +pci -r 0x9000 -s 4 -pci -w 0xd2009000 8101 -pci -r 0xd2009000 -s 4 +pci -w 0x9000 8101 +pci -r 0x9000 -s 4 -pci -w 0xd2009000 8200 -pci -r 0xd2009000 -s 4 +pci -w 0x9000 8200 +pci -r 0x9000 -s 4 echo " End CMOSIS Configuration .." -pci -w 0xd2009040 3e1 +pci -w 0x9040 3e1 -pci -r 0xd2009000 -s 100 +pci -r 0x9000 -s 100 diff --git a/tests/bench.sh b/tests/bench.sh deleted file mode 100755 index b36c251..0000000 --- a/tests/bench.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/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 -o bench.out -done - -pci --stop-dma dma1 - -pci -w xrawdata_enable_loopback 0 diff --git a/tests/bench3.sh b/tests/bench3.sh deleted file mode 100755 index 1108cd9..0000000 --- a/tests/bench3.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/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 --start-dma dma1 -pci -w control 0x1e5 -sleep 1 -pci -w control 0x1e1 - -for i in `seq 1 10`; do - pci -w control 0x1e1 - pci -w dma1 -s $size "*$i" - pci -w control 0x3e1 - pci -r dma1 -s $size -o bench.out -done - -pci --stop-dma dma1 - diff --git a/tests/bench_ipecamera.sh b/tests/bench_ipecamera.sh new file mode 100755 index 0000000..09edae9 --- /dev/null +++ b/tests/bench_ipecamera.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +function pci { + PCILIB_PATH="/root/pcitool" + LD_LIBRARY_PATH="$PCILIB_PATH" $PCILIB_PATH/pci $* +} + +size=16 +bytes=`expr $size "*" 4` + +rm -f bench.out +pci --stop-dma dma1 +pci --reset + +#pci -w xrawdata_packet_length $bytes + +pci --start-dma dma1 +pci -w control 0x1e5 +sleep 1 +pci -w control 0x1e1 + +sleep 1 +pci -w control 0x3e1 +for i in `seq 1 10`; do +# pci -w control 0x1e1 + pci -w dma1 -s $size "*$i" +# pci -w control 0x3e1 + usleep 100000 + pci -r dma1 -s $size -o bench.out +done + +pci -w control 0x1e1 +pci --stop-dma dma1 + diff --git a/tests/bench_nwl.sh b/tests/bench_nwl.sh new file mode 100755 index 0000000..b36c251 --- /dev/null +++ b/tests/bench_nwl.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 -o bench.out +done + +pci --stop-dma dma1 + +pci -w xrawdata_enable_loopback 0 diff --git a/tests/frame.sh b/tests/frame.sh new file mode 100755 index 0000000..e6f071d --- /dev/null +++ b/tests/frame.sh @@ -0,0 +1,38 @@ +#!/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 100000 +pci -w control 1e1 +usleep 100000 + +echo "Enable Readout ... " +pci -w control 3e1 + +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/frame_req.sh b/tests/frame_req.sh new file mode 100755 index 0000000..8d14c38 --- /dev/null +++ b/tests/frame_req.sh @@ -0,0 +1,27 @@ +#!/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 100000 +pci -w control 1e1 +usleep 100000 + +echo "Enable Readout 3... " +pci -w control 3e1 +usleep 1000000 +pci -w control 1e1 + diff --git a/tests/grab.sh b/tests/grab.sh new file mode 100755 index 0000000..3d2b03f --- /dev/null +++ b/tests/grab.sh @@ -0,0 +1,17 @@ +#! /bin/bash + +function pci { + PCILIB_PATH="/root/pcitool" + LD_LIBRARY_PATH="$PCILIB_PATH" $PCILIB_PATH/pci $* +} + +rm image.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 diff --git a/tests/tb_mic.sh b/tests/tb_mic.sh deleted file mode 100755 index 6b7269b..0000000 --- a/tests/tb_mic.sh +++ /dev/null @@ -1,11 +0,0 @@ - -pci --stop-dma dma1 -pci -w xrawdata_packet_length 4096 -pci --start-dma dma1 -pci -w 0xd2009040 1e9 -pci -w 0xd2009040 1e1 -pci -w 0xd2009040 3e1 -pci -r 0xd2009000 -s 100 -#pci -r dma1 -s 1024 -#LD_LIBRARY_PATH=/root/pcitool ./pci -g -o 1.image -#pci --stop-dma dma1 -- cgit v1.2.3