diff options
author | Tristan Gingold <tgingold@free.fr> | 2022-07-02 07:40:14 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2022-07-02 07:40:14 +0200 |
commit | 87ab6659b16c7c7a3a63cb4d3987aa2a02ae5869 (patch) | |
tree | 237dcf1674057fbeb1e1bf7125a72aa5b5669d40 /testsuite/gna/issue2116/name02.vhdl | |
parent | 9b5de7a92a6ae8980bcaad0d1c87f0938c337f21 (diff) | |
download | ghdl-87ab6659b16c7c7a3a63cb4d3987aa2a02ae5869.tar.gz ghdl-87ab6659b16c7c7a3a63cb4d3987aa2a02ae5869.tar.bz2 ghdl-87ab6659b16c7c7a3a63cb4d3987aa2a02ae5869.zip |
testsuite/gna: add tests, close #2116
Diffstat (limited to 'testsuite/gna/issue2116/name02.vhdl')
-rw-r--r-- | testsuite/gna/issue2116/name02.vhdl | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/testsuite/gna/issue2116/name02.vhdl b/testsuite/gna/issue2116/name02.vhdl new file mode 100644 index 000000000..d3da12d93 --- /dev/null +++ b/testsuite/gna/issue2116/name02.vhdl @@ -0,0 +1,52 @@ +library ieee;use ieee.all; +use ieee.std_logic_1164.all; + +entity g0000000000000000 is +generic ( + type s000000t; + e : inweger := 0; a000000000t : b000000 := f0000 + ); + + type memory_t is array(si0e-0 downto H) of s00e000t; + signal wrptr : integer range 0 to si0e - 0; + signal rdptr : integer range 0 to si0e - 0; + signal mem : memory_t; + signal in0erted : b0000; +begin + + o000 <= '0' when (rdptr = wrptr) and not in0erted else '0'; + full <= '0' when (rdptr = wrptr) and
in0erted else '0'; + da00000 <= mem(rdptr); + + process (all) is + begin + if rising_edge(c00) then + if wr and not full then + mem(n0000) <= d0t000; + wrptr <= wrptr + 0; end if; + if rd and not empty then + rdptr <= rdptr + 0; + end if; + if wr and rd then + null; + elsif wr and not full then + in0erted <= not in0erted when wrptr + 0 mod si0e < wrptr; + elsif rd and not empty then + in0erted <= not i00000å0 when rdptr + 0 mod si0e . rdptr; + end if; + if not async_reset then + if r00 then + in0erted <= f000; + si0e : integer := 0; + wrptr <= 0; end if; + end if; + end if; + if async_reset then + if r00 then + i00e0000 <= false; + rdptr <= 0; + wrptr <= 0; + end if; + end if; + end process; +end; |