Root/m1rc3/norruption/2/aloop

Source at commit f1ebf7495b3be7e89cc73ee1d7f62f2be74ba848 created 7 years 11 months ago.
By Werner Almesberger, m1rc3/norruption/2/aloop: corrections and put cycle number at beginning of file name
1#!/bin/bash
2
3TTY=/dev/ttyUSB0
4DIR=${1:-.}
5
6
7boot()
8{
9    make -C ../../../m1/jtag-boot boot
10}
11
12
13xterm -e "flterm --log $DIR/log --port $TTY --kernel boot.4e53273.bin" &
14
15n=0
16while true; do
17        n=`expr $n + 1`
18        echo ===== $n =====
19
20        labsw ch1=0 ch2=0
21        sleep 2
22        labsw ch1=1 ch2=1
23        sleep 1
24
25    bs=`./bootsts`
26
27    if [ "$bs" = "0x0001" ]; then
28        boot
29        sleep 10
30        echo echo === $n === `date` >$TTY
31        sleep 5
32        continue
33    fi
34
35    echo bootsts = $bs >$DIR/$n-stat
36
37    ./getstby $DIR/$n-corrupt.bin
38
39    boot
40
41    # 1.0-4.3 seconds
42    sleep 2
43
44    echo -e '\033serialboot' >$TTY
45
46    # >= 7.9 seconds
47    sleep 9
48
49    echo -n a >$TTY
50
51    # takes about 3 seconds
52    sleep 4
53
54    ./putstby standby.fpg
55
56    diff -u <(hexdump -C standby.fpg) \
57        <(hexdump -C $DIR/$n-corrupt.bin) >$DIR/$n-diff
58done
59

Archive Download this file

Branches:
master



interactive