diff options
Diffstat (limited to 'testsuite/synth/enum01')
-rw-r--r-- | testsuite/synth/enum01/test2.vhdl | 54 | ||||
-rwxr-xr-x | testsuite/synth/enum01/testsuite.sh | 2 |
2 files changed, 56 insertions, 0 deletions
diff --git a/testsuite/synth/enum01/test2.vhdl b/testsuite/synth/enum01/test2.vhdl new file mode 100644 index 000000000..02f3bdc08 --- /dev/null +++ b/testsuite/synth/enum01/test2.vhdl @@ -0,0 +1,54 @@ +use work.test_pkg.all; + +entity test2 is + port ( + eq : out boolean; + neq : out boolean; + lt : out boolean; + lte : out boolean; + gt : out boolean; + gte : out boolean + ); +end entity; + +architecture a of test2 is + function is_eq (l, r : number_t) return boolean is + begin + return l = r; + end is_eq; + + function is_ne (l, r : number_t) return boolean is + begin + return l /= r; + end is_ne; + + function is_lt (l, r : number_t) return boolean is + begin + return l < r; + end is_lt; + + function is_le (l, r : number_t) return boolean is + begin + return l <= r; + end is_le; + + function is_gt (l, r : number_t) return boolean is + begin + return l > r; + end is_gt; + + function is_ge (l, r : number_t) return boolean is + begin + return l >= r; + end is_ge; + + constant x : number_t := ONE; + constant y : number_t := THREE; +begin + eq <= is_eq (x, y); + neq <= is_ne (x, y); + lt <= is_lt (x, y); + lte <= is_le (x, y); + gt <= is_gt (x, y); + gte <= is_ge (x, y); +end architecture; diff --git a/testsuite/synth/enum01/testsuite.sh b/testsuite/synth/enum01/testsuite.sh index 511dcb1f4..4f1d78b1f 100755 --- a/testsuite/synth/enum01/testsuite.sh +++ b/testsuite/synth/enum01/testsuite.sh @@ -11,4 +11,6 @@ analyze test_pkg.vhdl syn_test.vhdl tb_test.vhdl elab_simulate tb_test --ieee-asserts=disable-at-0 --assert-level=error clean +synth test_pkg.vhdl test2.vhdl -e test2 > syn_test2.vhdl + echo "Test successful" |