diff options
-rw-r--r-- | testsuite/gna/issue881/t87.vhdl | 17 | ||||
-rw-r--r-- | testsuite/gna/issue881/t87io.vhdl | 19 | ||||
-rwxr-xr-x | testsuite/gna/issue881/testsuite.sh | 21 |
3 files changed, 57 insertions, 0 deletions
diff --git a/testsuite/gna/issue881/t87.vhdl b/testsuite/gna/issue881/t87.vhdl new file mode 100644 index 000000000..847bf4e47 --- /dev/null +++ b/testsuite/gna/issue881/t87.vhdl @@ -0,0 +1,17 @@ +entity t87 is +end; + +architecture behav of t87 is + constant t1 : time := 1 ns; + constant t2 : natural := time'pos (t1); +begin + assert t1 = 1000 ps; + process + variable v : natural; + begin + -- Time resolution must be ps + v := time'pos(ps); + assert v = 1 severity failure; + wait; + end process; +end behav; diff --git a/testsuite/gna/issue881/t87io.vhdl b/testsuite/gna/issue881/t87io.vhdl new file mode 100644 index 000000000..3b2c70c18 --- /dev/null +++ b/testsuite/gna/issue881/t87io.vhdl @@ -0,0 +1,19 @@ +entity t87io is +end; + +use std.textio.all; + +architecture behav of t87io is + constant t1 : time := 1 ns; + constant t2 : natural := time'pos (t1); +begin + assert t1 = 1000 ps; + process + variable v : natural; + begin + -- Time resolution must be ps + v := time'pos(ps); + assert v = 1 severity failure; + wait; + end process; +end behav; diff --git a/testsuite/gna/issue881/testsuite.sh b/testsuite/gna/issue881/testsuite.sh new file mode 100755 index 000000000..1ec9e0a4d --- /dev/null +++ b/testsuite/gna/issue881/testsuite.sh @@ -0,0 +1,21 @@ +#! /bin/sh + +. ../../testenv.sh + +# See #613 + +if ! $GHDL --help -a | grep -q time-resolution; then + echo "option --time-resolution not available" +else + analyze t87.vhdl + elab_simulate --time-resolution=ps t87 + elab_simulate --time-resolution=auto t87 + + analyze t87io.vhdl + elab_simulate --time-resolution=ps t87io + elab_simulate --time-resolution=auto t87io + + clean +fi + +echo "Test successful" |