diff options
| author | Julian Blake Kongslie | 2022-03-20 17:25:39 -0700 |
|---|---|---|
| committer | Julian Blake Kongslie | 2022-03-20 17:25:39 -0700 |
| commit | d5ecb005e4b71786e63f03cb819a358b6bf0219c (patch) | |
| tree | f8e0fa3cc76d2a428d0ead9df271226d73cdb619 /download.tcl | |
| parent | Add a few useful memory images. (diff) | |
| download | multipdp8-d5ecb005e4b71786e63f03cb819a358b6bf0219c.tar.xz | |
Support loading RIMs and multi-word lines via the UART loader.
Diffstat (limited to 'download.tcl')
| -rwxr-xr-x | download.tcl | 8 |
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 | ||
| 3 | set core 0 | 3 | set core 0 |
| 4 | set wordsperline 1 | ||
| 4 | 5 | ||
| 5 | if {$::argc > 0} { | 6 | if {$::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 | ||
| 9 | spawn nios2-terminal --instance 0 | 13 | spawn nios2-terminal --instance 0 |
| 10 | expect -ex "connected to hardware target" | 14 | expect -ex "connected to hardware target" |
| 11 | 15 | ||
| 12 | send "@[format %x [expr $core * 32768]]\n" | 16 | send "@[format %x [expr $core * 32768 / $wordsperline]]\n" |
| 13 | 17 | ||
| 14 | while {[gets stdin line] >= 0} { | 18 | while {[gets stdin line] >= 0} { |
| 15 | send "$line\n" | 19 | send "$line\n" |
