-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtestbench.vhd
56 lines (49 loc) · 1.12 KB
/
testbench.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
51
52
53
54
55
56
library ieee;
use ieee.std_logic_1164.all;
entity testbench is
end entity;
architecture behavioral of testbench is
component top_level is
generic(RAM_FILE : string;
uROM_FILE : string;
clk_speed : integer);
port(
clk_50mhz : in std_logic; --reference clock
hex_0 : out std_logic_vector(6 downto 0);
hex_1 : out std_logic_vector(6 downto 0);
upc_clear : in std_logic;
MARload : out std_logic
);
end component;
signal clk_50mhz : std_logic;
signal hex_0 : std_logic_vector(6 downto 0);
signal hex_1 : std_logic_vector(6 downto 0);
signal upc_clear : std_logic;
signal MARload : std_logic;
constant clk_period : time := 20 ns;
begin
UUT: top_level
GENERIC MAP(
RAM_FILE => "test_programs/ram12.hex",
uROM_FILE => "microde.hex",
clk_speed => 2)
PORT MAP(
clk_50mhz => clk_50mhz,
hex_0 => hex_0,
hex_1 => hex_1,
upc_clear => upc_clear,
MARload => MARload
);
TESTBENCH: process
begin
upc_clear <= '0';
wait;
end process;
CLOCK_GEN : process
begin
clk_50mhz <= '1';
wait for clk_period/2;
clk_50mhz <= '0';
wait for clk_period/2;
end process;
end behavioral;