-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathload_tv.vhd
93 lines (64 loc) · 1.81 KB
/
load_tv.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
library IEEE;
use IEEE.NUMERIC_STD.ALL;
use IEEE.STD_LOGIC_1164.ALL;
Entity load_tb is
end entity;
Architecture tb of load_tb is
Component LOADER IS
Port (
OutM1 : OUT STD_LOGIC_VECTOR( 7 DOWNTO 0);
OutM2 : OUT STD_LOGIC_VECTOR(7 DOWNTO 0);
InM3 : IN STD_LOGIC_VECTOR(15 DOWNTO 0);
--Ena : In STD_LOGIC;
Res : In STD_LOGIC; -- reset
Addr_W : Out INTEGER;
Addr_R : Out INTEGER;
WEN : Out STD_LOGIC;
EN : Out STD_LOGIC;
RCLK : Out STD_LOGIC;
WCLK : Out STD_LOGIC;
DATA_R : IN STD_LOGIC_VECTOR(7 DOWNTO 0);
DATA_W : Out STD_LOGIC_VECTOR(7 DOWNTO 0);
Write : IN STD_LOGIC; -- tells loader to write out to RAM
Loaded : OUT STD_LOGIC;
Nex : IN STD_LOGIC; -- tells the loader to output next value
LoadM1 : IN STD_LOGIC;
LoadM2 : IN STD_LOGIC;
Clk : IN STD_LOGIC
);
END component;
signal oM1, oM2 : std_logic_vector( 7 downto 0);
signal im3 : std_logic_vector(15 downto 0) := "1010_1010_1010_1010";
signal res, write, nex, lm1, lm2, clk : std_logic := '0';
signal dR : std_logic_vector(7 downto 0) <= "110011_00";
signal dW : std_logic_vector( 7 downto 0);
signal adW, adR : integer;
signal wen, en, rclk, wclk, loaded : std_logic;
BEGIN
l : LOADER port map( Res=>res, Write=>write,Nex=> nex, LoadM1=>lm1, LoadM2=>lm2,Clk=> clk,
DATA_R => dR, DATA_W => dW, WEN=> wen, EN => en, RCLK=> rclk, WCLK=> wclk, Loaded => loaded,
Addr_W=>adW, Addr_R=> adR, InM3=> im3. OutM1=> oM1, OutM2=> oM2 );
clock : process begin
clk<= '0';
wait for 10 ns;
clk <= '1';
wait for 10 ns;
end process;
tes:process begin
res <= '1';
wait for 100 ns;
res <= '0';
LoadM1<= '1';
Wait for 10 ns;
LoadM1<= '0';
wait for 20 ns;
LoadM2 <= '1';
wait for 10 ns;
LoadM2 <= '0';
wait for 20 ns;
write <= '1';
wait for 10 ns;
write <= '0';
wait;
end process;
END tb;