From f4ae49cc6509d9b4c7b4f8a21861e27e84d38571 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 25 Oct 2010 07:28:57 -0500 Subject: [PATCH] near: add a test for correctness --- tests/near.0/README | 1 + tests/near.0/expected | 122 ++++++++++++++++++++++++++++++++++++++ tests/near.0/runstreamer | 124 +++++++++++++++++++++++++++++++++++++++ tests/near.0/test.hal | 21 +++++++ 4 files changed, 268 insertions(+) create mode 100644 tests/near.0/README create mode 100644 tests/near.0/expected create mode 100644 tests/near.0/runstreamer create mode 100644 tests/near.0/test.hal diff --git a/tests/near.0/README b/tests/near.0/README new file mode 100644 index 00000000000..9d699072ca7 --- /dev/null +++ b/tests/near.0/README @@ -0,0 +1 @@ +regression test for components: near diff --git a/tests/near.0/expected b/tests/near.0/expected new file mode 100644 index 00000000000..5b4204ac462 --- /dev/null +++ b/tests/near.0/expected @@ -0,0 +1,122 @@ +-12.000000 -12.000000 1 1 +-12.000000 -11.000000 1 1 +-12.000000 -10.000000 1 0 +-12.000000 -2.000000 0 0 +-12.000000 -1.000000 0 0 +-12.000000 0.000000 0 0 +-12.000000 1.000000 0 0 +-12.000000 2.000000 0 0 +-12.000000 10.000000 0 0 +-12.000000 11.000000 0 0 +-12.000000 12.000000 0 0 +-11.000000 -12.000000 1 1 +-11.000000 -11.000000 1 1 +-11.000000 -10.000000 1 1 +-11.000000 -2.000000 0 0 +-11.000000 -1.000000 0 0 +-11.000000 0.000000 0 0 +-11.000000 1.000000 0 0 +-11.000000 2.000000 0 0 +-11.000000 10.000000 0 0 +-11.000000 11.000000 0 0 +-11.000000 12.000000 0 0 +-10.000000 -12.000000 1 0 +-10.000000 -11.000000 1 1 +-10.000000 -10.000000 1 1 +-10.000000 -2.000000 0 0 +-10.000000 -1.000000 0 0 +-10.000000 0.000000 0 0 +-10.000000 1.000000 0 0 +-10.000000 2.000000 0 0 +-10.000000 10.000000 0 0 +-10.000000 11.000000 0 0 +-10.000000 12.000000 0 0 +-2.000000 -12.000000 0 0 +-2.000000 -11.000000 0 0 +-2.000000 -10.000000 0 0 +-2.000000 -2.000000 1 1 +-2.000000 -1.000000 0 1 +-2.000000 0.000000 0 0 +-2.000000 1.000000 0 0 +-2.000000 2.000000 0 0 +-2.000000 10.000000 0 0 +-2.000000 11.000000 0 0 +-2.000000 12.000000 0 0 +-1.000000 -12.000000 0 0 +-1.000000 -11.000000 0 0 +-1.000000 -10.000000 0 0 +-1.000000 -2.000000 0 1 +-1.000000 -1.000000 1 1 +-1.000000 0.000000 0 1 +-1.000000 1.000000 0 0 +-1.000000 2.000000 0 0 +-1.000000 10.000000 0 0 +-1.000000 11.000000 0 0 +-1.000000 12.000000 0 0 +0.000000 -12.000000 0 0 +0.000000 -11.000000 0 0 +0.000000 -10.000000 0 0 +0.000000 -2.000000 0 0 +0.000000 -1.000000 0 1 +0.000000 0.000000 1 1 +0.000000 1.000000 0 1 +0.000000 2.000000 0 0 +0.000000 10.000000 0 0 +0.000000 11.000000 0 0 +0.000000 12.000000 0 0 +1.000000 -12.000000 0 0 +1.000000 -11.000000 0 0 +1.000000 -10.000000 0 0 +1.000000 -2.000000 0 0 +1.000000 -1.000000 0 0 +1.000000 0.000000 0 1 +1.000000 1.000000 1 1 +1.000000 2.000000 0 1 +1.000000 10.000000 0 0 +1.000000 11.000000 0 0 +1.000000 12.000000 0 0 +2.000000 -12.000000 0 0 +2.000000 -11.000000 0 0 +2.000000 -10.000000 0 0 +2.000000 -2.000000 0 0 +2.000000 -1.000000 0 0 +2.000000 0.000000 0 0 +2.000000 1.000000 0 1 +2.000000 2.000000 1 1 +2.000000 10.000000 0 0 +2.000000 11.000000 0 0 +2.000000 12.000000 0 0 +10.000000 -12.000000 0 0 +10.000000 -11.000000 0 0 +10.000000 -10.000000 0 0 +10.000000 -2.000000 0 0 +10.000000 -1.000000 0 0 +10.000000 0.000000 0 0 +10.000000 1.000000 0 0 +10.000000 2.000000 0 0 +10.000000 10.000000 1 1 +10.000000 11.000000 1 1 +10.000000 12.000000 1 0 +11.000000 -12.000000 0 0 +11.000000 -11.000000 0 0 +11.000000 -10.000000 0 0 +11.000000 -2.000000 0 0 +11.000000 -1.000000 0 0 +11.000000 0.000000 0 0 +11.000000 1.000000 0 0 +11.000000 2.000000 0 0 +11.000000 10.000000 1 1 +11.000000 11.000000 1 1 +11.000000 12.000000 1 1 +12.000000 -12.000000 0 0 +12.000000 -11.000000 0 0 +12.000000 -10.000000 0 0 +12.000000 -2.000000 0 0 +12.000000 -1.000000 0 0 +12.000000 0.000000 0 0 +12.000000 1.000000 0 0 +12.000000 2.000000 0 0 +12.000000 10.000000 1 0 +12.000000 11.000000 1 1 +12.000000 12.000000 1 1 +12.000000 12.000000 1 1 diff --git a/tests/near.0/runstreamer b/tests/near.0/runstreamer new file mode 100644 index 00000000000..b80e0aae11c --- /dev/null +++ b/tests/near.0/runstreamer @@ -0,0 +1,124 @@ +#!/bin/sh +halstreamer << EOF +-12 -12 +-12 -11 +-12 -10 +-12 -2 +-12 -1 +-12 0 +-12 1 +-12 2 +-12 10 +-12 11 +-12 12 +-11 -12 +-11 -11 +-11 -10 +-11 -2 +-11 -1 +-11 0 +-11 1 +-11 2 +-11 10 +-11 11 +-11 12 +-10 -12 +-10 -11 +-10 -10 +-10 -2 +-10 -1 +-10 0 +-10 1 +-10 2 +-10 10 +-10 11 +-10 12 +-2 -12 +-2 -11 +-2 -10 +-2 -2 +-2 -1 +-2 0 +-2 1 +-2 2 +-2 10 +-2 11 +-2 12 +-1 -12 +-1 -11 +-1 -10 +-1 -2 +-1 -1 +-1 0 +-1 1 +-1 2 +-1 10 +-1 11 +-1 12 +0 -12 +0 -11 +0 -10 +0 -2 +0 -1 +0 0 +0 1 +0 2 +0 10 +0 11 +0 12 +1 -12 +1 -11 +1 -10 +1 -2 +1 -1 +1 0 +1 1 +1 2 +1 10 +1 11 +1 12 +2 -12 +2 -11 +2 -10 +2 -2 +2 -1 +2 0 +2 1 +2 2 +2 10 +2 11 +2 12 +10 -12 +10 -11 +10 -10 +10 -2 +10 -1 +10 0 +10 1 +10 2 +10 10 +10 11 +10 12 +11 -12 +11 -11 +11 -10 +11 -2 +11 -1 +11 0 +11 1 +11 2 +11 10 +11 11 +11 12 +12 -12 +12 -11 +12 -10 +12 -2 +12 -1 +12 0 +12 1 +12 2 +12 10 +12 11 +12 12 +EOF diff --git a/tests/near.0/test.hal b/tests/near.0/test.hal new file mode 100644 index 00000000000..7adf5d9c48e --- /dev/null +++ b/tests/near.0/test.hal @@ -0,0 +1,21 @@ +loadrt threads name1=fast period1=100000 +loadrt near count=2 +setp near.0.scale 1.5 +setp near.1.difference 1.5 + +loadrt sampler depth=1000 cfg=ffbb +loadrt streamer depth=256 cfg=ff + +net in1 streamer.0.pin.0 => near.0.in1 near.1.in1 sampler.0.pin.0 +net in2 streamer.0.pin.1 => near.0.in2 near.1.in2 sampler.0.pin.1 +net outa near.0.out => sampler.0.pin.2 +net outb near.1.out => sampler.0.pin.3 + +addf streamer.0 fast +addf near.0 fast +addf near.1 fast +addf sampler.0 fast + +loadusr -w sh runstreamer +start +loadusr -w halsampler -n 122