diff options
| author | Julian Blake Kongslie | 2022-03-13 16:51:03 -0700 |
|---|---|---|
| committer | Julian Blake Kongslie | 2022-03-13 16:51:03 -0700 |
| commit | f747a526b97b29a0479c62c4ecea285f1f5f2fde (patch) | |
| tree | 7c389b4b62a97f8d0fa87c14f1682ea858c6ae94 /download.tcl | |
| parent | Add memory arbiter and broadcast in between command UART and DRAM. (diff) | |
| download | multipdp8-f747a526b97b29a0479c62c4ecea285f1f5f2fde.tar.xz | |
Change command parser to support bulk download script.
Diffstat (limited to 'download.tcl')
| -rwxr-xr-x | download.tcl | 28 |
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 | |||
| 3 | set core 0 | ||
| 4 | |||
| 5 | if {$::argc > 0} { | ||
| 6 | set core [lindex $::argv 0] | ||
| 7 | } | ||
| 8 | |||
| 9 | spawn nios2-terminal --instance 0 | ||
| 10 | expect -ex "connected to hardware target" | ||
| 11 | |||
| 12 | send "@[format %x [expr $core * 32768]]\n" | ||
| 13 | |||
| 14 | while {[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. | ||
| 22 | send "?" | ||
| 23 | expect -ex "?" | ||
| 24 | send "?" | ||
| 25 | expect -ex "?" | ||
| 26 | |||
| 27 | send "\004" | ||
| 28 | expect -ex "exiting due to ^D on remote" | ||
