diff options
author | Tristan Gingold <tgingold@free.fr> | 2022-08-14 04:43:51 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2022-08-14 20:53:48 +0200 |
commit | 119034986fb631d2e8baa8e90aa30febe5b95b55 (patch) | |
tree | 41f51e3d6eaf43d6cdd584e25a04af0a4156e12d /testsuite/synth/memdp01/dpram2w.vhdl | |
parent | 00daf9d550e459f7cac4cdc2175cc3752098b41f (diff) | |
download | ghdl-119034986fb631d2e8baa8e90aa30febe5b95b55.tar.gz ghdl-119034986fb631d2e8baa8e90aa30febe5b95b55.tar.bz2 ghdl-119034986fb631d2e8baa8e90aa30febe5b95b55.zip |
testsuite/synth: rename mem2d01 to memdp01
Diffstat (limited to 'testsuite/synth/memdp01/dpram2w.vhdl')
-rw-r--r-- | testsuite/synth/memdp01/dpram2w.vhdl | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/testsuite/synth/memdp01/dpram2w.vhdl b/testsuite/synth/memdp01/dpram2w.vhdl new file mode 100644 index 000000000..2c412824f --- /dev/null +++ b/testsuite/synth/memdp01/dpram2w.vhdl @@ -0,0 +1,26 @@ +library ieee; +use ieee.std_logic_1164.all; +use ieee.numeric_std.all; + +entity dpram2w is + port (waddr : natural range 0 to 3; + wnib : natural range 0 to 1; + wdat : std_logic_vector (3 downto 0); + raddr : natural range 0 to 3; + rdat : out std_logic_vector (7 downto 0); + clk : std_logic); +end dpram2w; + +architecture behav of dpram2w is + type memtype is array (0 to 3) of std_logic_vector (7 downto 0); + signal mem : memtype; +begin + process (clk) + begin + if rising_edge (clk) then + -- Not a memory: different widths + mem (waddr)(wnib * 4 + 3 downto wnib * 4) <= wdat; + rdat <= mem (raddr); + end if; + end process; +end behav; |