Browse Source

few demo scripts

Suren A. Chilingaryan 12 years ago
parent
commit
667c1e8a83
6 changed files with 86 additions and 14 deletions
  1. 3 0
      tests/dump_file.sh
  2. 0 5
      tests/frame.sh
  3. 37 0
      tests/frame2.sh
  4. 16 9
      tests/grab.sh
  5. 0 0
      tests/reset_init.sh
  6. 30 0
      tests/stimuli.sh

+ 3 - 0
tests/dump_file.sh

@@ -0,0 +1,3 @@
+#!/bin/bash
+
+hexdump -e ' "0x%08.8_ax: " 4/4 " 0x%08x " "\n" ' $1 | less

+ 0 - 5
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

+ 37 - 0
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
+

+ 16 - 9
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

+ 0 - 0
tests/Reset_Init.sh → tests/reset_init.sh


+ 30 - 0
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
+