aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/synth/issue2390/rom.vhdl
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2023-03-14 08:18:13 +0100
committerTristan Gingold <tgingold@free.fr>2023-03-14 08:18:13 +0100
commitea460cb31034202c6d6d3fd720126fd0bedd8820 (patch)
treeb476a8a2700fa51ff7caadab89d7d3c27ed0d9d8 /testsuite/synth/issue2390/rom.vhdl
parente4740a99eb4db83bfbc212a699745d2d51494554 (diff)
downloadghdl-ea460cb31034202c6d6d3fd720126fd0bedd8820.tar.gz
ghdl-ea460cb31034202c6d6d3fd720126fd0bedd8820.tar.bz2
ghdl-ea460cb31034202c6d6d3fd720126fd0bedd8820.zip
testsuite/synth: add a test for #2390
Diffstat (limited to 'testsuite/synth/issue2390/rom.vhdl')
-rw-r--r--testsuite/synth/issue2390/rom.vhdl21
1 files changed, 21 insertions, 0 deletions
diff --git a/testsuite/synth/issue2390/rom.vhdl b/testsuite/synth/issue2390/rom.vhdl
new file mode 100644
index 000000000..07c068ebf
--- /dev/null
+++ b/testsuite/synth/issue2390/rom.vhdl
@@ -0,0 +1,21 @@
+library ieee;
+context ieee.ieee_std_context;
+use work.uCPUtypes.all;
+
+entity ROM is
+ port (
+ abus : in unsigned_byte;
+ dbus : out code_word;
+ en : in logic
+ );
+end entity ROM;
+
+architecture RTL of ROM is
+ type memory is array (0 to 255) of code_word;
+ constant mem : memory := (x"777", others => x"000");
+begin
+
+dbus <= mem(to_integer(abus)) when en else x"ZZZ";
+
+end architecture RTL;
+