-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLTROFEU_PACKAGE.vhd
124 lines (119 loc) · 13.4 KB
/
LTROFEU_PACKAGE.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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
USE IEEE.STD_LOGIC_UNSIGNED.ALL;
USE IEEE.STD_LOGIC_ARITH.ALL;
USE IEEE.NUMERIC_STD.ALL;
PACKAGE LTROFEU_PACKAGE IS
PROCEDURE LTROFEU(SIGNAL EN_DRAW:IN STD_LOGIC;SIGNAL Xpos,Ypos,Xcur,Ycur:IN INTEGER;SIGNAL R,G,B:OUT STD_LOGIC_VECTOR(3 downto 0);SIGNAL DRAW: OUT STD_LOGIC);
END LTROFEU_PACKAGE;
PACKAGE BODY LTROFEU_PACKAGE IS
PROCEDURE LTROFEU(SIGNAL EN_DRAW:IN STD_LOGIC;SIGNAL Xpos,Ypos,Xcur,Ycur:IN INTEGER;SIGNAL R,G,B:OUT STD_LOGIC_VECTOR(3 downto 0);SIGNAL DRAW: OUT STD_LOGIC) IS
CONSTANT size : INTEGER := 6;
BEGIN
IF (EN_DRAW = '1') AND ((((Xcur >= Xpos + 3*SIZE) AND (Xcur < Xpos + 4*SIZE)) AND ((Ycur >= Ypos + 0*SIZE) AND (Ycur < Ypos + 1*SIZE))) OR
(((Xcur >= Xpos + 4*SIZE) AND (Xcur < Xpos + 5*SIZE)) AND ((Ycur >= Ypos + 0*SIZE) AND (Ycur < Ypos + 1*SIZE))) OR
(((Xcur >= Xpos + 5*SIZE) AND (Xcur < Xpos + 6*SIZE)) AND ((Ycur >= Ypos + 0*SIZE) AND (Ycur < Ypos + 1*SIZE))) OR
(((Xcur >= Xpos + 6*SIZE) AND (Xcur < Xpos + 7*SIZE)) AND ((Ycur >= Ypos + 0*SIZE) AND (Ycur < Ypos + 1*SIZE))) OR
(((Xcur >= Xpos + 7*SIZE) AND (Xcur < Xpos + 8*SIZE)) AND ((Ycur >= Ypos + 0*SIZE) AND (Ycur < Ypos + 1*SIZE))) OR
(((Xcur >= Xpos + 8*SIZE) AND (Xcur < Xpos + 9*SIZE)) AND ((Ycur >= Ypos + 0*SIZE) AND (Ycur < Ypos + 1*SIZE))) OR
(((Xcur >= Xpos + 9*SIZE) AND (Xcur < Xpos + 10*SIZE)) AND ((Ycur >= Ypos + 0*SIZE) AND (Ycur < Ypos + 1*SIZE))) OR
(((Xcur >= Xpos + 3*SIZE) AND (Xcur < Xpos + 4*SIZE)) AND ((Ycur >= Ypos + 1*SIZE) AND (Ycur < Ypos + 2*SIZE))) OR
(((Xcur >= Xpos + 4*SIZE) AND (Xcur < Xpos + 5*SIZE)) AND ((Ycur >= Ypos + 1*SIZE) AND (Ycur < Ypos + 2*SIZE))) OR
(((Xcur >= Xpos + 5*SIZE) AND (Xcur < Xpos + 6*SIZE)) AND ((Ycur >= Ypos + 1*SIZE) AND (Ycur < Ypos + 2*SIZE))) OR
(((Xcur >= Xpos + 6*SIZE) AND (Xcur < Xpos + 7*SIZE)) AND ((Ycur >= Ypos + 1*SIZE) AND (Ycur < Ypos + 2*SIZE))) OR
(((Xcur >= Xpos + 7*SIZE) AND (Xcur < Xpos + 8*SIZE)) AND ((Ycur >= Ypos + 1*SIZE) AND (Ycur < Ypos + 2*SIZE))) OR
(((Xcur >= Xpos + 8*SIZE) AND (Xcur < Xpos + 9*SIZE)) AND ((Ycur >= Ypos + 1*SIZE) AND (Ycur < Ypos + 2*SIZE))) OR
(((Xcur >= Xpos + 9*SIZE) AND (Xcur < Xpos + 10*SIZE)) AND ((Ycur >= Ypos + 1*SIZE) AND (Ycur < Ypos + 2*SIZE))) OR
(((Xcur >= Xpos + 0*SIZE) AND (Xcur < Xpos + 1*SIZE)) AND ((Ycur >= Ypos + 2*SIZE) AND (Ycur < Ypos + 3*SIZE))) OR
(((Xcur >= Xpos + 1*SIZE) AND (Xcur < Xpos + 2*SIZE)) AND ((Ycur >= Ypos + 2*SIZE) AND (Ycur < Ypos + 3*SIZE))) OR
(((Xcur >= Xpos + 2*SIZE) AND (Xcur < Xpos + 3*SIZE)) AND ((Ycur >= Ypos + 2*SIZE) AND (Ycur < Ypos + 3*SIZE))) OR
(((Xcur >= Xpos + 3*SIZE) AND (Xcur < Xpos + 4*SIZE)) AND ((Ycur >= Ypos + 2*SIZE) AND (Ycur < Ypos + 3*SIZE))) OR
(((Xcur >= Xpos + 4*SIZE) AND (Xcur < Xpos + 5*SIZE)) AND ((Ycur >= Ypos + 2*SIZE) AND (Ycur < Ypos + 3*SIZE))) OR
(((Xcur >= Xpos + 5*SIZE) AND (Xcur < Xpos + 6*SIZE)) AND ((Ycur >= Ypos + 2*SIZE) AND (Ycur < Ypos + 3*SIZE))) OR
(((Xcur >= Xpos + 6*SIZE) AND (Xcur < Xpos + 7*SIZE)) AND ((Ycur >= Ypos + 2*SIZE) AND (Ycur < Ypos + 3*SIZE))) OR
(((Xcur >= Xpos + 7*SIZE) AND (Xcur < Xpos + 8*SIZE)) AND ((Ycur >= Ypos + 2*SIZE) AND (Ycur < Ypos + 3*SIZE))) OR
(((Xcur >= Xpos + 8*SIZE) AND (Xcur < Xpos + 9*SIZE)) AND ((Ycur >= Ypos + 2*SIZE) AND (Ycur < Ypos + 3*SIZE))) OR
(((Xcur >= Xpos + 9*SIZE) AND (Xcur < Xpos + 10*SIZE)) AND ((Ycur >= Ypos + 2*SIZE) AND (Ycur < Ypos + 3*SIZE))) OR
(((Xcur >= Xpos + 10*SIZE) AND (Xcur < Xpos + 11*SIZE)) AND ((Ycur >= Ypos + 2*SIZE) AND (Ycur < Ypos + 3*SIZE))) OR
(((Xcur >= Xpos + 11*SIZE) AND (Xcur < Xpos + 12*SIZE)) AND ((Ycur >= Ypos + 2*SIZE) AND (Ycur < Ypos + 3*SIZE))) OR
(((Xcur >= Xpos + 12*SIZE) AND (Xcur < Xpos + 13*SIZE)) AND ((Ycur >= Ypos + 2*SIZE) AND (Ycur < Ypos + 3*SIZE))) OR
(((Xcur >= Xpos + 0*SIZE) AND (Xcur < Xpos + 1*SIZE)) AND ((Ycur >= Ypos + 3*SIZE) AND (Ycur < Ypos + 4*SIZE))) OR
(((Xcur >= Xpos + 3*SIZE) AND (Xcur < Xpos + 4*SIZE)) AND ((Ycur >= Ypos + 3*SIZE) AND (Ycur < Ypos + 4*SIZE))) OR
(((Xcur >= Xpos + 4*SIZE) AND (Xcur < Xpos + 5*SIZE)) AND ((Ycur >= Ypos + 3*SIZE) AND (Ycur < Ypos + 4*SIZE))) OR
(((Xcur >= Xpos + 5*SIZE) AND (Xcur < Xpos + 6*SIZE)) AND ((Ycur >= Ypos + 3*SIZE) AND (Ycur < Ypos + 4*SIZE))) OR
(((Xcur >= Xpos + 6*SIZE) AND (Xcur < Xpos + 7*SIZE)) AND ((Ycur >= Ypos + 3*SIZE) AND (Ycur < Ypos + 4*SIZE))) OR
(((Xcur >= Xpos + 7*SIZE) AND (Xcur < Xpos + 8*SIZE)) AND ((Ycur >= Ypos + 3*SIZE) AND (Ycur < Ypos + 4*SIZE))) OR
(((Xcur >= Xpos + 8*SIZE) AND (Xcur < Xpos + 9*SIZE)) AND ((Ycur >= Ypos + 3*SIZE) AND (Ycur < Ypos + 4*SIZE))) OR
(((Xcur >= Xpos + 9*SIZE) AND (Xcur < Xpos + 10*SIZE)) AND ((Ycur >= Ypos + 3*SIZE) AND (Ycur < Ypos + 4*SIZE))) OR
(((Xcur >= Xpos + 12*SIZE) AND (Xcur < Xpos + 13*SIZE)) AND ((Ycur >= Ypos + 3*SIZE) AND (Ycur < Ypos + 4*SIZE))) OR
(((Xcur >= Xpos + 0*SIZE) AND (Xcur < Xpos + 1*SIZE)) AND ((Ycur >= Ypos + 4*SIZE) AND (Ycur < Ypos + 5*SIZE))) OR
(((Xcur >= Xpos + 3*SIZE) AND (Xcur < Xpos + 4*SIZE)) AND ((Ycur >= Ypos + 4*SIZE) AND (Ycur < Ypos + 5*SIZE))) OR
(((Xcur >= Xpos + 4*SIZE) AND (Xcur < Xpos + 5*SIZE)) AND ((Ycur >= Ypos + 4*SIZE) AND (Ycur < Ypos + 5*SIZE))) OR
(((Xcur >= Xpos + 5*SIZE) AND (Xcur < Xpos + 6*SIZE)) AND ((Ycur >= Ypos + 4*SIZE) AND (Ycur < Ypos + 5*SIZE))) OR
(((Xcur >= Xpos + 6*SIZE) AND (Xcur < Xpos + 7*SIZE)) AND ((Ycur >= Ypos + 4*SIZE) AND (Ycur < Ypos + 5*SIZE))) OR
(((Xcur >= Xpos + 7*SIZE) AND (Xcur < Xpos + 8*SIZE)) AND ((Ycur >= Ypos + 4*SIZE) AND (Ycur < Ypos + 5*SIZE))) OR
(((Xcur >= Xpos + 8*SIZE) AND (Xcur < Xpos + 9*SIZE)) AND ((Ycur >= Ypos + 4*SIZE) AND (Ycur < Ypos + 5*SIZE))) OR
(((Xcur >= Xpos + 9*SIZE) AND (Xcur < Xpos + 10*SIZE)) AND ((Ycur >= Ypos + 4*SIZE) AND (Ycur < Ypos + 5*SIZE))) OR
(((Xcur >= Xpos + 12*SIZE) AND (Xcur < Xpos + 13*SIZE)) AND ((Ycur >= Ypos + 4*SIZE) AND (Ycur < Ypos + 5*SIZE))) OR
(((Xcur >= Xpos + 0*SIZE) AND (Xcur < Xpos + 1*SIZE)) AND ((Ycur >= Ypos + 5*SIZE) AND (Ycur < Ypos + 6*SIZE))) OR
(((Xcur >= Xpos + 3*SIZE) AND (Xcur < Xpos + 4*SIZE)) AND ((Ycur >= Ypos + 5*SIZE) AND (Ycur < Ypos + 6*SIZE))) OR
(((Xcur >= Xpos + 4*SIZE) AND (Xcur < Xpos + 5*SIZE)) AND ((Ycur >= Ypos + 5*SIZE) AND (Ycur < Ypos + 6*SIZE))) OR
(((Xcur >= Xpos + 5*SIZE) AND (Xcur < Xpos + 6*SIZE)) AND ((Ycur >= Ypos + 5*SIZE) AND (Ycur < Ypos + 6*SIZE))) OR
(((Xcur >= Xpos + 6*SIZE) AND (Xcur < Xpos + 7*SIZE)) AND ((Ycur >= Ypos + 5*SIZE) AND (Ycur < Ypos + 6*SIZE))) OR
(((Xcur >= Xpos + 7*SIZE) AND (Xcur < Xpos + 8*SIZE)) AND ((Ycur >= Ypos + 5*SIZE) AND (Ycur < Ypos + 6*SIZE))) OR
(((Xcur >= Xpos + 8*SIZE) AND (Xcur < Xpos + 9*SIZE)) AND ((Ycur >= Ypos + 5*SIZE) AND (Ycur < Ypos + 6*SIZE))) OR
(((Xcur >= Xpos + 9*SIZE) AND (Xcur < Xpos + 10*SIZE)) AND ((Ycur >= Ypos + 5*SIZE) AND (Ycur < Ypos + 6*SIZE))) OR
(((Xcur >= Xpos + 12*SIZE) AND (Xcur < Xpos + 13*SIZE)) AND ((Ycur >= Ypos + 5*SIZE) AND (Ycur < Ypos + 6*SIZE))) OR
(((Xcur >= Xpos + 1*SIZE) AND (Xcur < Xpos + 2*SIZE)) AND ((Ycur >= Ypos + 6*SIZE) AND (Ycur < Ypos + 7*SIZE))) OR
(((Xcur >= Xpos + 2*SIZE) AND (Xcur < Xpos + 3*SIZE)) AND ((Ycur >= Ypos + 6*SIZE) AND (Ycur < Ypos + 7*SIZE))) OR
(((Xcur >= Xpos + 3*SIZE) AND (Xcur < Xpos + 4*SIZE)) AND ((Ycur >= Ypos + 6*SIZE) AND (Ycur < Ypos + 7*SIZE))) OR
(((Xcur >= Xpos + 4*SIZE) AND (Xcur < Xpos + 5*SIZE)) AND ((Ycur >= Ypos + 6*SIZE) AND (Ycur < Ypos + 7*SIZE))) OR
(((Xcur >= Xpos + 5*SIZE) AND (Xcur < Xpos + 6*SIZE)) AND ((Ycur >= Ypos + 6*SIZE) AND (Ycur < Ypos + 7*SIZE))) OR
(((Xcur >= Xpos + 6*SIZE) AND (Xcur < Xpos + 7*SIZE)) AND ((Ycur >= Ypos + 6*SIZE) AND (Ycur < Ypos + 7*SIZE))) OR
(((Xcur >= Xpos + 7*SIZE) AND (Xcur < Xpos + 8*SIZE)) AND ((Ycur >= Ypos + 6*SIZE) AND (Ycur < Ypos + 7*SIZE))) OR
(((Xcur >= Xpos + 8*SIZE) AND (Xcur < Xpos + 9*SIZE)) AND ((Ycur >= Ypos + 6*SIZE) AND (Ycur < Ypos + 7*SIZE))) OR
(((Xcur >= Xpos + 9*SIZE) AND (Xcur < Xpos + 10*SIZE)) AND ((Ycur >= Ypos + 6*SIZE) AND (Ycur < Ypos + 7*SIZE))) OR
(((Xcur >= Xpos + 10*SIZE) AND (Xcur < Xpos + 11*SIZE)) AND ((Ycur >= Ypos + 6*SIZE) AND (Ycur < Ypos + 7*SIZE))) OR
(((Xcur >= Xpos + 11*SIZE) AND (Xcur < Xpos + 12*SIZE)) AND ((Ycur >= Ypos + 6*SIZE) AND (Ycur < Ypos + 7*SIZE))) OR
(((Xcur >= Xpos + 3*SIZE) AND (Xcur < Xpos + 4*SIZE)) AND ((Ycur >= Ypos + 7*SIZE) AND (Ycur < Ypos + 8*SIZE))) OR
(((Xcur >= Xpos + 4*SIZE) AND (Xcur < Xpos + 5*SIZE)) AND ((Ycur >= Ypos + 7*SIZE) AND (Ycur < Ypos + 8*SIZE))) OR
(((Xcur >= Xpos + 5*SIZE) AND (Xcur < Xpos + 6*SIZE)) AND ((Ycur >= Ypos + 7*SIZE) AND (Ycur < Ypos + 8*SIZE))) OR
(((Xcur >= Xpos + 6*SIZE) AND (Xcur < Xpos + 7*SIZE)) AND ((Ycur >= Ypos + 7*SIZE) AND (Ycur < Ypos + 8*SIZE))) OR
(((Xcur >= Xpos + 7*SIZE) AND (Xcur < Xpos + 8*SIZE)) AND ((Ycur >= Ypos + 7*SIZE) AND (Ycur < Ypos + 8*SIZE))) OR
(((Xcur >= Xpos + 8*SIZE) AND (Xcur < Xpos + 9*SIZE)) AND ((Ycur >= Ypos + 7*SIZE) AND (Ycur < Ypos + 8*SIZE))) OR
(((Xcur >= Xpos + 9*SIZE) AND (Xcur < Xpos + 10*SIZE)) AND ((Ycur >= Ypos + 7*SIZE) AND (Ycur < Ypos + 8*SIZE))) OR
(((Xcur >= Xpos + 4*SIZE) AND (Xcur < Xpos + 5*SIZE)) AND ((Ycur >= Ypos + 8*SIZE) AND (Ycur < Ypos + 9*SIZE))) OR
(((Xcur >= Xpos + 5*SIZE) AND (Xcur < Xpos + 6*SIZE)) AND ((Ycur >= Ypos + 8*SIZE) AND (Ycur < Ypos + 9*SIZE))) OR
(((Xcur >= Xpos + 6*SIZE) AND (Xcur < Xpos + 7*SIZE)) AND ((Ycur >= Ypos + 8*SIZE) AND (Ycur < Ypos + 9*SIZE))) OR
(((Xcur >= Xpos + 7*SIZE) AND (Xcur < Xpos + 8*SIZE)) AND ((Ycur >= Ypos + 8*SIZE) AND (Ycur < Ypos + 9*SIZE))) OR
(((Xcur >= Xpos + 8*SIZE) AND (Xcur < Xpos + 9*SIZE)) AND ((Ycur >= Ypos + 8*SIZE) AND (Ycur < Ypos + 9*SIZE))) OR
(((Xcur >= Xpos + 5*SIZE) AND (Xcur < Xpos + 6*SIZE)) AND ((Ycur >= Ypos + 9*SIZE) AND (Ycur < Ypos + 10*SIZE))) OR
(((Xcur >= Xpos + 6*SIZE) AND (Xcur < Xpos + 7*SIZE)) AND ((Ycur >= Ypos + 9*SIZE) AND (Ycur < Ypos + 10*SIZE))) OR
(((Xcur >= Xpos + 7*SIZE) AND (Xcur < Xpos + 8*SIZE)) AND ((Ycur >= Ypos + 9*SIZE) AND (Ycur < Ypos + 10*SIZE))) OR
(((Xcur >= Xpos + 5*SIZE) AND (Xcur < Xpos + 6*SIZE)) AND ((Ycur >= Ypos + 10*SIZE) AND (Ycur < Ypos + 11*SIZE))) OR
(((Xcur >= Xpos + 6*SIZE) AND (Xcur < Xpos + 7*SIZE)) AND ((Ycur >= Ypos + 10*SIZE) AND (Ycur < Ypos + 11*SIZE))) OR
(((Xcur >= Xpos + 7*SIZE) AND (Xcur < Xpos + 8*SIZE)) AND ((Ycur >= Ypos + 10*SIZE) AND (Ycur < Ypos + 11*SIZE))) OR
(((Xcur >= Xpos + 5*SIZE) AND (Xcur < Xpos + 6*SIZE)) AND ((Ycur >= Ypos + 11*SIZE) AND (Ycur < Ypos + 12*SIZE))) OR
(((Xcur >= Xpos + 6*SIZE) AND (Xcur < Xpos + 7*SIZE)) AND ((Ycur >= Ypos + 11*SIZE) AND (Ycur < Ypos + 12*SIZE))) OR
(((Xcur >= Xpos + 7*SIZE) AND (Xcur < Xpos + 8*SIZE)) AND ((Ycur >= Ypos + 11*SIZE) AND (Ycur < Ypos + 12*SIZE))) OR
(((Xcur >= Xpos + 4*SIZE) AND (Xcur < Xpos + 5*SIZE)) AND ((Ycur >= Ypos + 12*SIZE) AND (Ycur < Ypos + 13*SIZE))) OR
(((Xcur >= Xpos + 5*SIZE) AND (Xcur < Xpos + 6*SIZE)) AND ((Ycur >= Ypos + 12*SIZE) AND (Ycur < Ypos + 13*SIZE))) OR
(((Xcur >= Xpos + 6*SIZE) AND (Xcur < Xpos + 7*SIZE)) AND ((Ycur >= Ypos + 12*SIZE) AND (Ycur < Ypos + 13*SIZE))) OR
(((Xcur >= Xpos + 7*SIZE) AND (Xcur < Xpos + 8*SIZE)) AND ((Ycur >= Ypos + 12*SIZE) AND (Ycur < Ypos + 13*SIZE))) OR
(((Xcur >= Xpos + 8*SIZE) AND (Xcur < Xpos + 9*SIZE)) AND ((Ycur >= Ypos + 12*SIZE) AND (Ycur < Ypos + 13*SIZE))) OR
(((Xcur >= Xpos + 3*SIZE) AND (Xcur < Xpos + 4*SIZE)) AND ((Ycur >= Ypos + 13*SIZE) AND (Ycur < Ypos + 14*SIZE))) OR
(((Xcur >= Xpos + 4*SIZE) AND (Xcur < Xpos + 5*SIZE)) AND ((Ycur >= Ypos + 13*SIZE) AND (Ycur < Ypos + 14*SIZE))) OR
(((Xcur >= Xpos + 5*SIZE) AND (Xcur < Xpos + 6*SIZE)) AND ((Ycur >= Ypos + 13*SIZE) AND (Ycur < Ypos + 14*SIZE))) OR
(((Xcur >= Xpos + 6*SIZE) AND (Xcur < Xpos + 7*SIZE)) AND ((Ycur >= Ypos + 13*SIZE) AND (Ycur < Ypos + 14*SIZE))) OR
(((Xcur >= Xpos + 7*SIZE) AND (Xcur < Xpos + 8*SIZE)) AND ((Ycur >= Ypos + 13*SIZE) AND (Ycur < Ypos + 14*SIZE))) OR
(((Xcur >= Xpos + 8*SIZE) AND (Xcur < Xpos + 9*SIZE)) AND ((Ycur >= Ypos + 13*SIZE) AND (Ycur < Ypos + 14*SIZE))) OR
(((Xcur >= Xpos + 9*SIZE) AND (Xcur < Xpos + 10*SIZE)) AND ((Ycur >= Ypos + 13*SIZE) AND (Ycur < Ypos + 14*SIZE)))) THEN
R<="1111";
G<="1111";
B<="1111";
DRAW<='1';
ELSE
DRAW<='0';
END IF;
END LTROFEU;
END LTROFEU_PACKAGE;