summaryrefslogtreecommitdiff
path: root/download.tcl
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xdownload.tcl8
1 files changed, 6 insertions, 2 deletions
diff --git a/download.tcl b/download.tcl
index 2e64865..31d4c82 100755
--- a/download.tcl
+++ b/download.tcl
@@ -1,15 +1,19 @@
1#!/usr/bin/env expect 1#!/usr/bin/env expect
2 2
3set core 0 3set core 0
4set wordsperline 1
4 5
5if {$::argc > 0} { 6if {$::argc > 1} {
7 set core [lindex $::argv 0]
8 set wordsperline [lindex $::argv 1]
9} elseif {$::argc > 0} {
6 set core [lindex $::argv 0] 10 set core [lindex $::argv 0]
7} 11}
8 12
9spawn nios2-terminal --instance 0 13spawn nios2-terminal --instance 0
10expect -ex "connected to hardware target" 14expect -ex "connected to hardware target"
11 15
12send "@[format %x [expr $core * 32768]]\n" 16send "@[format %x [expr $core * 32768 / $wordsperline]]\n"
13 17
14while {[gets stdin line] >= 0} { 18while {[gets stdin line] >= 0} {
15 send "$line\n" 19 send "$line\n"