diff options
author | Tristan Gingold <tgingold@free.fr> | 2014-06-21 21:24:15 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2014-06-21 21:24:15 +0200 |
commit | 212268f54c947f4360a7d0e5b45faa97f76a4a9d (patch) | |
tree | 76a19a1ff148903c412f9f2191901ee6797b2939 /testsuite | |
parent | 270280a34295fa42785f9c8d99ad24b93d411e0c (diff) | |
download | ghdl-212268f54c947f4360a7d0e5b45faa97f76a4a9d.tar.gz ghdl-212268f54c947f4360a7d0e5b45faa97f76a4a9d.tar.bz2 ghdl-212268f54c947f4360a7d0e5b45faa97f76a4a9d.zip |
Add psl cover directive (ticket19).
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/gna/ticket19/Makefile | 12 | ||||
-rw-r--r-- | testsuite/gna/ticket19/psl_test_cover.vhd | 53 | ||||
-rw-r--r-- | testsuite/gna/ticket19/psl_test_cover2.vhd | 60 | ||||
-rw-r--r-- | testsuite/gna/ticket19/psl_test_cover3.vhd | 53 | ||||
-rwxr-xr-x | testsuite/gna/ticket19/testsuite.sh | 16 |
5 files changed, 194 insertions, 0 deletions
diff --git a/testsuite/gna/ticket19/Makefile b/testsuite/gna/ticket19/Makefile new file mode 100644 index 000000000..215246320 --- /dev/null +++ b/testsuite/gna/ticket19/Makefile @@ -0,0 +1,12 @@ +psl_test_cover: psl_test_cover.vhd + ghdl -a --std=02 -fpsl psl_test_cover.vhd + ghdl -e --std=02 -fpsl psl_test_cover + ./psl_test_cover --stop-time=200ns + +all: clean psl_test_cover + +.PHONY: clean +clean: + rm -f *.cf + rm -f *.o + rm -f psl_test_cover
\ No newline at end of file diff --git a/testsuite/gna/ticket19/psl_test_cover.vhd b/testsuite/gna/ticket19/psl_test_cover.vhd new file mode 100644 index 000000000..4f3666f19 --- /dev/null +++ b/testsuite/gna/ticket19/psl_test_cover.vhd @@ -0,0 +1,53 @@ +library ieee; +use ieee.std_logic_1164.all; +use ieee.numeric_std.all; + + + +entity psl_test_cover is +end entity psl_test_cover; + + +architecture test of psl_test_cover is + + + signal s_rst_n : std_logic := '0'; + signal s_clk : std_logic := '0'; + signal s_write : std_logic; + signal s_read : std_logic; + + +begin + + + s_rst_n <= '1' after 100 ns; + s_clk <= not s_clk after 10 ns; + + + TestP : process is + begin + report "RUNNING PSL_TEST_COVER test case"; + report "================================"; + s_write <= '0'; + s_read <= '0'; + wait until s_rst_n = '1' and rising_edge(s_clk); + s_write <= '1'; -- cover should hit + wait until rising_edge(s_clk); + s_read <= '1'; -- assertion should hit + wait until rising_edge(s_clk); + s_write <= '0'; + s_read <= '0'; + wait; + end process TestP; + + + + -- psl statements + + -- psl default clock is rising_edge(s_clk); + + -- cover directive seems not supported (ignored by GHDL) + -- psl cover always (s_write -> not(s_read)); + + +end architecture test;
\ No newline at end of file diff --git a/testsuite/gna/ticket19/psl_test_cover2.vhd b/testsuite/gna/ticket19/psl_test_cover2.vhd new file mode 100644 index 000000000..16d6ac810 --- /dev/null +++ b/testsuite/gna/ticket19/psl_test_cover2.vhd @@ -0,0 +1,60 @@ +library ieee; +use ieee.std_logic_1164.all; +use ieee.numeric_std.all; + + + +entity psl_test_cover2 is +end entity psl_test_cover2; + + +architecture test of psl_test_cover2 is + + + signal s_rst_n : std_logic := '0'; + signal s_clk : std_logic := '0'; + signal s_write : std_logic; + signal s_read : std_logic; + + +begin + + + s_rst_n <= '1' after 20 ns; + s_clk <= not s_clk after 10 ns; + + + TestP : process is + begin + report "RUNNING PSL_TEST_COVER test case"; + report "================================"; + s_write <= '0'; + s_read <= '0'; + wait until s_rst_n = '1' and rising_edge(s_clk); + s_write <= '1'; -- cover should hit + wait until rising_edge(s_clk); + s_read <= '1'; -- assertion should hit + wait until rising_edge(s_clk); + s_write <= '0'; + s_read <= '0'; + wait until rising_edge(s_clk); + s_write <= '1'; -- cover should hit + wait until rising_edge(s_clk); + s_read <= '1'; -- assertion should hit + wait until rising_edge(s_clk); + s_write <= '0'; + s_read <= '0'; + wait; + end process TestP; + + + + -- psl statements + + -- psl default clock is rising_edge(s_clk); + + -- cover directive seems not supported (ignored by GHDL) + -- psl cover always (s_write -> not(s_read)); + + +end architecture test; diff --git a/testsuite/gna/ticket19/psl_test_cover3.vhd b/testsuite/gna/ticket19/psl_test_cover3.vhd new file mode 100644 index 000000000..0ef5d6ed9 --- /dev/null +++ b/testsuite/gna/ticket19/psl_test_cover3.vhd @@ -0,0 +1,53 @@ +library ieee; +use ieee.std_logic_1164.all; +use ieee.numeric_std.all; + + + +entity psl_test_cover3 is +end entity psl_test_cover3; + + +architecture test of psl_test_cover3 is + + + signal s_rst_n : std_logic := '0'; + signal s_clk : std_logic := '0'; + signal s_write : std_logic; + signal s_read : std_logic; + + +begin + + + s_rst_n <= '1' after 20 ns; + s_clk <= not s_clk after 10 ns; + + + TestP : process is + begin + report "RUNNING PSL_TEST_COVER test case"; + report "================================"; + s_write <= '0'; + s_read <= '0'; + wait until s_rst_n = '1' and rising_edge(s_clk); + s_write <= '1'; -- cover should hit + wait until rising_edge(s_clk); + s_read <= '0'; -- no hit + wait until rising_edge(s_clk); + s_write <= '0'; + s_read <= '0'; + wait; + end process TestP; + + + + -- psl statements + + -- psl default clock is rising_edge(s_clk); + + -- cover directive seems not supported (ignored by GHDL) + -- psl cover always (s_write -> not(s_read)); + + +end architecture test; diff --git a/testsuite/gna/ticket19/testsuite.sh b/testsuite/gna/ticket19/testsuite.sh new file mode 100755 index 000000000..a594dfcaf --- /dev/null +++ b/testsuite/gna/ticket19/testsuite.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +. ../../testenv.sh + +GHDL_FLAGS="-fpsl --std=02" + +analyze psl_test_cover.vhd +elab_simulate psl_test_cover --stop-time=200ns + +analyze psl_test_cover2.vhd +elab_simulate psl_test_cover2 --stop-time=200ns + +analyze psl_test_cover3.vhd +elab_simulate psl_test_cover3 --stop-time=200ns + +clean |