diff options
author | Tristan Gingold <tgingold@free.fr> | 2017-01-15 18:24:14 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2017-01-15 18:24:14 +0100 |
commit | b42069e0f4538bbaffbc015359770018caa9b209 (patch) | |
tree | ef80e2932f7dae8362dd394926d64865c2048058 | |
parent | 9b4124223aebc967d9fc380d45aeca4e35f1231b (diff) | |
download | ghdl-b42069e0f4538bbaffbc015359770018caa9b209.tar.gz ghdl-b42069e0f4538bbaffbc015359770018caa9b209.tar.bz2 ghdl-b42069e0f4538bbaffbc015359770018caa9b209.zip |
Reproducer for #256
-rw-r--r-- | testsuite/gna/issue256/testcase.vhd | 15 | ||||
-rw-r--r-- | testsuite/gna/issue256/testcase2.vhd | 5 | ||||
-rw-r--r-- | testsuite/gna/issue256/testcase3.vhd | 10 | ||||
-rw-r--r-- | testsuite/gna/issue256/testcase_testbench.vhd | 26 | ||||
-rwxr-xr-x | testsuite/gna/issue256/testsuite.sh | 13 |
5 files changed, 69 insertions, 0 deletions
diff --git a/testsuite/gna/issue256/testcase.vhd b/testsuite/gna/issue256/testcase.vhd new file mode 100644 index 000000000..392e92380 --- /dev/null +++ b/testsuite/gna/issue256/testcase.vhd @@ -0,0 +1,15 @@ +entity testcase is + port(clk: in bit); +begin + check: process is + begin + -- Require at least 10ns between clock edges + assert clk'delayed'last_event >= 10 ns; + wait on clk; + end process check; +end entity testcase; + +-- Keep the compiler happy +architecture empty of testcase is +begin +end architecture empty; diff --git a/testsuite/gna/issue256/testcase2.vhd b/testsuite/gna/issue256/testcase2.vhd new file mode 100644 index 000000000..2f8b9a4ca --- /dev/null +++ b/testsuite/gna/issue256/testcase2.vhd @@ -0,0 +1,5 @@ +entity testcase2 is + port(clk: in bit); +begin + check: assert clk'delayed'last_event >= 10 ns; +end entity testcase2; diff --git a/testsuite/gna/issue256/testcase3.vhd b/testsuite/gna/issue256/testcase3.vhd new file mode 100644 index 000000000..3d0c6f91e --- /dev/null +++ b/testsuite/gna/issue256/testcase3.vhd @@ -0,0 +1,10 @@ +entity testcase3 is + port(clk: in bit); +begin +end entity testcase3; + +-- Keep the compiler happy +architecture empty of testcase3 is +begin + check: assert clk'delayed'last_event >= 10 ns; +end architecture empty; diff --git a/testsuite/gna/issue256/testcase_testbench.vhd b/testsuite/gna/issue256/testcase_testbench.vhd new file mode 100644 index 000000000..ef8a7bdff --- /dev/null +++ b/testsuite/gna/issue256/testcase_testbench.vhd @@ -0,0 +1,26 @@ +entity testcase_testbench is +end entity testcase_testbench; + +architecture bench of testcase_testbench is + signal clk: bit; +begin + dut: entity work.testcase(empty) port map(clk => clk); + + stimulus: process is + begin + -- Valid low and high pulses + clk <= '0'; + wait for 10 ns; + clk <= '1'; + wait for 10 ns; + -- Confirm that we're timing events, not transactions + clk <= '1'; + wait for 5 ns; + -- Now send a short pulse to make the assertion fire + clk <= '0'; + wait for 5 ns; + -- Assertion should fire here, at 30ns + clk <= '1'; + wait; + end process stimulus; +end architecture bench; diff --git a/testsuite/gna/issue256/testsuite.sh b/testsuite/gna/issue256/testsuite.sh new file mode 100755 index 000000000..f9ec0e8cc --- /dev/null +++ b/testsuite/gna/issue256/testsuite.sh @@ -0,0 +1,13 @@ +#! /bin/sh + +. ../../testenv.sh + +analyze testcase.vhd +analyze testcase2.vhd +analyze testcase3.vhd +analyze testcase_testbench.vhd +elab_simulate testcase_testbench + +clean + +echo "Test successful" |