aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/gna/issue382/tb_demo.vhd
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2017-07-14 07:48:14 +0200
committerTristan Gingold <tgingold@free.fr>2017-07-14 07:48:14 +0200
commitc14fe80a292695f6245dbea1df9202bf4b5a6c98 (patch)
tree5c81fa92f3bdcb6ffa56537cbfaf5cd1bfd4902a /testsuite/gna/issue382/tb_demo.vhd
parente0ece4a694de1b31cb71f17e8d7178dab9c15893 (diff)
downloadghdl-c14fe80a292695f6245dbea1df9202bf4b5a6c98.tar.gz
ghdl-c14fe80a292695f6245dbea1df9202bf4b5a6c98.tar.bz2
ghdl-c14fe80a292695f6245dbea1df9202bf4b5a6c98.zip
Add testcase from #382
Diffstat (limited to 'testsuite/gna/issue382/tb_demo.vhd')
-rw-r--r--testsuite/gna/issue382/tb_demo.vhd54
1 files changed, 54 insertions, 0 deletions
diff --git a/testsuite/gna/issue382/tb_demo.vhd b/testsuite/gna/issue382/tb_demo.vhd
new file mode 100644
index 000000000..4ff04a4b0
--- /dev/null
+++ b/testsuite/gna/issue382/tb_demo.vhd
@@ -0,0 +1,54 @@
+library IEEE;
+use IEEE.std_logic_1164.all;
+use IEEE.numeric_std.all;
+
+entity tb_demo is
+end entity;
+
+architecture v1 of tb_demo is
+ signal clk,reset: std_logic;
+
+ component demo is
+ port (
+ clk,reset: in std_logic;
+ load: in std_logic;
+ load_val: in unsigned(7 downto 0);
+ qout: out unsigned(7 downto 0);
+ is5: out std_logic
+ );
+ end component;
+
+ signal load, is5: std_logic;
+ signal load_val,qout: unsigned(7 downto 0);
+begin
+
+UUT1: demo port map (clk, reset, load, load_val, qout, is5);
+
+ process
+ begin
+ load<='0';
+ for i in 0 to 3 loop
+ wait until clk='1';
+ end loop;
+
+ load<='1';
+ load_val<=x"42";
+ wait until clk='1';
+ end process;
+
+ process
+ begin
+ reset<='1';
+ clk<='0';
+ wait for 2 sec;
+ reset<='0';
+ while 1=1 loop
+ clk<='0';
+ wait for 0.5 sec;
+ clk<='1';
+ wait for 0.5 sec;
+ end loop;
+ end process;
+
+
+end v1;