-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmembench.vhd
50 lines (39 loc) · 956 Bytes
/
membench.vhd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
-- Bruce A. Maxwell
-- Spring 2013
-- CS 232
--
-- test program for the memory circuit
--
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
entity membench is
end entity;
architecture test of membench is
constant num_cycles : integer := 100;
-- this circuit just needs a clock and a reset
signal clk : std_logic := '1';
signal reset : std_logic;
-- lights component
component memtest
port( clk, reset : in std_logic;
output : out std_logic_vector(7 downto 0) );
end component;
-- output signals
signal output : std_logic_vector(7 downto 0);
begin
-- start off with a short reset
reset <= '1', '0' after 1 ns;
-- create a clock
process begin
for i in 1 to num_cycles loop
clk <= not clk;
wait for 1 ns;
clk <= not clk;
wait for 1 ns;
end loop;
wait;
end process;
-- port map the circuit
L0: memtest port map( clk, reset, output );
end test;