summaryrefslogtreecommitdiff
path: root/ir
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-07-01 03:15:19 (GMT)
committerWerner Almesberger <werner@almesberger.net>2016-07-01 03:15:19 (GMT)
commitbbdc637d85209622745cb0ebd27eab4fb209cc25 (patch)
tree4d5b3dff0333f91375453e6bf90d532cbab87cee /ir
parent44fdf204123c85af27b62b58840a99c7992833df (diff)
downloadmisc-bbdc637d85209622745cb0ebd27eab4fb209cc25.zip
misc-bbdc637d85209622745cb0ebd27eab4fb209cc25.tar.gz
misc-bbdc637d85209622745cb0ebd27eab4fb209cc25.tar.bz2
ir/ev.pl: quick and dirty tester for the TX config logic circuit
Diffstat (limited to 'ir')
-rwxr-xr-xir/ev.pl34
1 files changed, 34 insertions, 0 deletions
diff --git a/ir/ev.pl b/ir/ev.pl
new file mode 100755
index 0000000..942f474
--- /dev/null
+++ b/ir/ev.pl
@@ -0,0 +1,34 @@
+#!/usr/bin/perl
+die "usage: $0 A B INV bq\n" unless $#ARGV == 3;
+
+($a, $b, $inv, $bq) = @ARGV;
+
+for $tx (0, 1) {
+ for $cts (0, 1) {
+ $t = !$tx & $bq;
+ $m = $a ? $cts : !$tx;
+ $o = ($t & !$a) | ($b & $m);
+ $res = $o ^ $inv;
+
+ print "$tx $cts -> $t $m $o -> $res\n";
+ $is_off++ unless $res;
+ $is_tx++ if $res == $tx;
+ $is_not_tx++ if $res != $tx;
+ $is_cts++ if $res == $cts;
+ $is_not_cts++ if $res != $cts;
+ }
+}
+
+print "off $is_off\n";
+print "tx $is_tx\n";
+print "!tx $is_not_tx\n";
+print "cts $is_cts\n";
+print "!cts $is_not_cts\n";
+
+print "\n";
+
+print "off\n" if $is_off == 4;
+print "TX\n" if $is_tx == 4;
+print "!TX\n" if $is_not_tx == 4;
+print "CTS\n" if $is_cts == 4;
+print "!CTS\n" if $is_not_cts == 4;