From c794aaa2a7dbec514d188c28f75da181a5692992 Mon Sep 17 00:00:00 2001 From: marph91 <33229141+marph91@users.noreply.github.com> Date: Wed, 28 Aug 2019 18:51:02 +0200 Subject: synth: Integer operators (#902) * synth: added missing integer operators I. e. inequality and remainder. * testsuite/synth: added testcase for the missing integer operators --- testsuite/synth/int01/int_operators.vhdl | 20 ++++++++++++++++++++ testsuite/synth/int01/testsuite.sh | 11 +++++++++++ 2 files changed, 31 insertions(+) create mode 100644 testsuite/synth/int01/int_operators.vhdl create mode 100755 testsuite/synth/int01/testsuite.sh (limited to 'testsuite/synth/int01') diff --git a/testsuite/synth/int01/int_operators.vhdl b/testsuite/synth/int01/int_operators.vhdl new file mode 100644 index 000000000..6a09c0621 --- /dev/null +++ b/testsuite/synth/int01/int_operators.vhdl @@ -0,0 +1,20 @@ +library ieee; + use ieee.std_logic_1164.all; + +entity int_operators is + generic ( + gen_a : integer := 5; + gen_b : integer := 3 + ); + port ( + sig_a : in integer range 0 to 7; + sig_b : out std_logic; + sig_c : out integer + ); +end int_operators; + +architecture rtl of int_operators is +begin + sig_b <= '0' when sig_a /= gen_a else '1'; + sig_c <= gen_a rem gen_b; +end rtl; diff --git a/testsuite/synth/int01/testsuite.sh b/testsuite/synth/int01/testsuite.sh new file mode 100755 index 000000000..a590cde72 --- /dev/null +++ b/testsuite/synth/int01/testsuite.sh @@ -0,0 +1,11 @@ +#! /bin/sh + +. ../../testenv.sh + +for t in int_operators; do + synth $t.vhdl -e $t > syn_$t.vhdl + analyze syn_$t.vhdl + clean +done + +echo "Test successful" -- cgit v1.2.3