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