summaryrefslogtreecommitdiff
path: root/tool/download.tcl
diff options
context:
space:
mode:
Diffstat (limited to 'tool/download.tcl')
-rwxr-xr-xtool/download.tcl33
1 files changed, 33 insertions, 0 deletions
diff --git a/tool/download.tcl b/tool/download.tcl
new file mode 100755
index 0000000..c0dca55
--- /dev/null
+++ b/tool/download.tcl
@@ -0,0 +1,33 @@
1#!/usr/bin/env expect
2
3set timeout 3600
4
5set core 0
6set wordsperline 1
7
8if {$::argc > 1} {
9 set core [lindex $::argv 0]
10 set wordsperline [lindex $::argv 1]
11} elseif {$::argc > 0} {
12 set core [lindex $::argv 0]
13}
14
15spawn tool/connect
16
17send "@[format %x [expr $core * 32768 / $wordsperline]]\n"
18
19while {[gets stdin line] >= 0} {
20 send "$line\n"
21 expect -ex "$line\n"
22}
23
24# It's likely we ended with a very large zero-memory operation. We want to see
25# two command bytes echoed back to us in order to guarantee that the zero
26# operation has completely flushed to memory.
27send "?"
28expect -ex "?"
29send "?"
30expect -ex "?"
31
32send "\n~."
33wait