Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

asm/pfpu: new option -v; cleanup

This patch contains the following changes:

- new option -v for verbose operation. By default, pfpu now only displays
  the result line and ignores the rest of the session.

- send nc's diagnostics to standard output so that we can suppress
  its "connected" line (alas, this means that error messages are
  only shown in verbose mode)

- added header comment
  • Loading branch information...
commit da4c3114ba3661711da8d762dba6bf9bc68afa03 1 parent 539486b
Werner Almesberger wpwrak authored
Showing with 29 additions and 2 deletions.
  1. +29 −2 tools/asm/pfpu
31 tools/asm/pfpu
View
@@ -1,9 +1,36 @@
#!/bin/sh
+#
+# pfpu - pfpu remote execution wrapper
+#
+# Copyright 2012 by Werner Almesberger
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+
+#
+# usage: pfpu [-i] [-v] [pfpuasm_arg ...]
+#
+# -i pass numbers in internal binary format instead of floats
+# -v display the whole session instea of just the results
+#
+
reg="sed 's/^[^#]*# R[0-9]* = //'"
-[ "$1" = -i ] && { reg=cat; shift; }
+filter="sed '1,/^1:/d;q' | tr -d '\015'"
+
+while [ "$1" ]; do
+ case "$1" in
+ -i) reg=cat; shift;;
+ -v) filter=cat; shift;;
+ *) break;;
+ esac
+done
+
trap "rm -f _out$$" 0
./pfpuasm "$@" >_out$$ || exit
-nc -i 1 -C -t -v ${M1_HOST:-m1} telnet <<EOF
+nc -i 1 -C -t -v ${M1_HOST:-m1} telnet <<EOF 2>&1 | eval $filter
${M1_USER:-foo}
${M1_PW:-bar}
pfpu `eval $reg _out$$ | sed 's/#.*//' | tr '\012' ' '`
Please sign in to comment.
Something went wrong with that request. Please try again.