aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/synth/mem01/tb_srom01.vhdl
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2020-02-18 18:44:42 +0100
committerTristan Gingold <tgingold@free.fr>2020-02-18 18:45:07 +0100
commit393612fc52586d8eb8372f0ce3f05c162cfccfe2 (patch)
tree9a3f06bd59ba01c80b8012b1e3e52e7a4aa516d9 /testsuite/synth/mem01/tb_srom01.vhdl
parent3689e0eb1d8b4a9689afa6f76187f1ecdc5ec458 (diff)
downloadghdl-393612fc52586d8eb8372f0ce3f05c162cfccfe2.tar.gz
ghdl-393612fc52586d8eb8372f0ce3f05c162cfccfe2.tar.bz2
ghdl-393612fc52586d8eb8372f0ce3f05c162cfccfe2.zip
testsuite/synth: merge ram01 to mem01, add NOTES.txt
Diffstat (limited to 'testsuite/synth/mem01/tb_srom01.vhdl')
-rw-r--r--testsuite/synth/mem01/tb_srom01.vhdl38
1 files changed, 38 insertions, 0 deletions
diff --git a/testsuite/synth/mem01/tb_srom01.vhdl b/testsuite/synth/mem01/tb_srom01.vhdl
new file mode 100644
index 000000000..530423a67
--- /dev/null
+++ b/testsuite/synth/mem01/tb_srom01.vhdl
@@ -0,0 +1,38 @@
+entity tb_srom01 is
+end tb_srom01;
+
+library ieee;
+use ieee.std_logic_1164.all;
+
+architecture behav of tb_srom01 is
+ signal addr : std_logic_vector(3 downto 0);
+ signal rdat : std_logic_vector(7 downto 0);
+ signal clk : std_logic;
+begin
+ dut: entity work.srom01
+ port map (clk_i => clk, addr_i => addr, data_o => rdat);
+
+ process
+ procedure pulse is
+ begin
+ clk <= '0';
+ wait for 1 ns;
+ clk <= '1';
+ wait for 1 ns;
+ end pulse;
+ begin
+ addr <= "0000";
+ pulse;
+ assert rdat = x"f0" severity failure;
+
+ addr <= "0001";
+ pulse;
+ assert rdat = x"e1" severity failure;
+
+ addr <= "0100";
+ pulse;
+ assert rdat = x"b4" severity failure;
+
+ wait;
+ end process;
+end behav;