diff options
-rw-r--r-- | testsuite/synth/string01/string01.vhdl | 33 | ||||
-rw-r--r-- | testsuite/synth/string01/tb_string01.vhdl | 20 | ||||
-rwxr-xr-x | testsuite/synth/string01/testsuite.sh | 17 |
3 files changed, 70 insertions, 0 deletions
diff --git a/testsuite/synth/string01/string01.vhdl b/testsuite/synth/string01/string01.vhdl new file mode 100644 index 000000000..80fa872ad --- /dev/null +++ b/testsuite/synth/string01/string01.vhdl @@ -0,0 +1,33 @@ +library ieee; +use ieee.std_logic_1164.all; + +entity driver is + generic (val : string); + port (o : out std_logic); +end driver; + +architecture behav of driver is +begin + drv1: if val = "one" generate + o <= '1'; + end generate; + + drv0: if val = "zero" generate + o <= '0'; + end generate; +end behav; + +library ieee; +use ieee.std_logic_1164.all; + +entity string01 is + port (o : out std_logic); +end string01; + +architecture behav of string01 is +begin + e : entity work.driver + generic map (val => "one") + port map (o => o); +end behav; + diff --git a/testsuite/synth/string01/tb_string01.vhdl b/testsuite/synth/string01/tb_string01.vhdl new file mode 100644 index 000000000..e1b8d5ab9 --- /dev/null +++ b/testsuite/synth/string01/tb_string01.vhdl @@ -0,0 +1,20 @@ +entity tb_string01 is +end tb_string01; + +library ieee; +use ieee.std_logic_1164.all; + +architecture behav of tb_string01 is + signal a : std_logic; +begin + dut: entity work.string01 + port map (a); + + process + begin + wait for 1 ns; + assert a = '1' severity failure; + + wait; + end process; +end behav; diff --git a/testsuite/synth/string01/testsuite.sh b/testsuite/synth/string01/testsuite.sh new file mode 100755 index 000000000..6e44cc947 --- /dev/null +++ b/testsuite/synth/string01/testsuite.sh @@ -0,0 +1,17 @@ +#! /bin/sh + +. ../../testenv.sh + +analyze string01.vhdl tb_string01.vhdl +elab_simulate tb_string01 + +clean + +synth string01.vhdl -e string01 > syn_string01.vhdl + +analyze syn_string01.vhdl tb_string01.vhdl +elab_simulate tb_string01 + +clean + +echo "Test successful" |