This repository has been archived by the owner on Jul 12, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
matrix_driver_top.vhd
89 lines (79 loc) · 2.88 KB
/
matrix_driver_top.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
--Matrix_driver_top is de toplevel van de driver.
--Deze verbind een paar componenten (ledcontrol en memory) aan elkaar, zodat de matrix kan worden aangestuurd
library ieee;
USE ieee.std_logic_1164.ALL;
use work.rgbmatrix.all; --config bestand: bevat standaardwaarden en definities voor kleuren voor de matrix.
entity matrix_driver_top is
port(
CLOCK :IN STD_LOGIC;
RESET : in std_logic;
DATA : in std_logic_vector(DATA_WIDTH-1 downto 0);
ADDR : in std_logic_vector(ADDR_WIDTH-1 downto 0);
RESETLED : out std_logic; --led om te tonen dat de reset 1 is
PINSOUT : OUT STD_LOGIC_VECTOR(12 downto 0)
);
end entity;
architecture behaviour of matrix_driver_top is
signal s_addr : std_logic_vector(ADDR_WIDTH-1 downto 0);
signal data_incoming : std_logic_vector(DATA_WIDTH-1 downto 0); --ingaande data
signal data_outgoing : std_logic_vector(DATA_WIDTH-1 downto 0); --uitgaande data
signal readready : std_logic; --flag wanneer klaar om te lezen
component matrix_ledcontrol is --leest data uit en geeft deze weer op de matrix
port (
clk_in : in std_logic;
reset : in std_logic;
clk_out : out std_logic;
rgb1_out : out std_logic_vector(2 downto 0);
rgb2_out : out std_logic_vector(2 downto 0);
ledaddr_out : out std_logic_vector(3 downto 0);
lat_out : out std_logic;
oe_out : out std_logic;
addr : out std_logic_vector(ADDR_WIDTH-1 downto 0);
data : in std_logic_vector(DATA_WIDTH-1 downto 0);
readready : out std_logic
);
end component;
component matrix_datamemory is --bevat geheugenblok om data in op te slaan
port (
reset : in std_logic;
clock : in std_logic;
data_in : in std_logic_vector(DATA_WIDTH - 1 downto 0);
address_read : in std_logic_vector(ADDR_WIDTH - 1 downto 0);
address_in : in std_logic_vector(ADDR_WIDTH - 1 downto 0);
data_out : out std_logic_vector(DATA_WIDTH - 1 downto 0);
readready : in std_logic
);
end component;
begin
RESETLED <= reset;
data_incoming <= DATA; --ingaande data wordt op data_incoming gezet
memory : matrix_datamemory port map(
reset => reset,
clock => CLOCK,
data_in => data_incoming,
address_read => s_addr,
address_in => ADDR,
data_out => data_outgoing,
readready => readready
);
matrix : matrix_ledcontrol port map(
clk_in => CLOCK,
reset => reset,
clk_out => PINSOUT(10), --clk
rgb1_out(0) => PINSOUT(2), --b1
rgb1_out(1) => PINSOUT(0), --g1
rgb1_out(2) => PINSOUT(1), --r1
rgb2_out(0) => PINSOUT(5), --b2
rgb2_out(1) => PINSOUT(4), --g2
rgb2_out(2) => PINSOUT(3), --r2
ledaddr_out(0) => PINSOUT(6), --a
ledaddr_out(1) => PINSOUT(7), --b
ledaddr_out(2) => PINSOUT(8), --c
ledaddr_out(3) => PINSOUT(9), --d
lat_out => PINSOUT(11), --lat
oe_out => PINSOUT(12), --oe
addr => s_addr,
data => data_outgoing,
readready => readready
);
end architecture;