summaryrefslogtreecommitdiff
path: root/download.tcl
diff options
context:
space:
mode:
authorJulian Blake Kongslie2022-03-20 17:25:39 -0700
committerJulian Blake Kongslie2022-03-20 17:25:39 -0700
commitd5ecb005e4b71786e63f03cb819a358b6bf0219c (patch)
treef8e0fa3cc76d2a428d0ead9df271226d73cdb619 /download.tcl
parentAdd a few useful memory images. (diff)
downloadmultipdp8-d5ecb005e4b71786e63f03cb819a358b6bf0219c.tar.xz
Support loading RIMs and multi-word lines via the UART loader.
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"