-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserial_input.vhd
133 lines (115 loc) · 3.88 KB
/
serial_input.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
125
126
127
128
129
130
131
132
133
----------------------------------------------------------------------------------
-- Organisation: HTBL Hollabrunn
-- Authors: Mattthias Preymann & Jakob Mayer
--
-- Create Date: 04/13/2018
-- Project Name: TLC5958
-- Target Devices: xc2c128-6VQ100
-- Module Name: serial_input
-- Description: Load address and sync frame data
--
----------------------------------------------------------------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity serial_input is
Port ( proc_rcv_en : in STD_LOGIC;
reset : in STD_LOGIC;
sclk : in STD_LOGIC;
sdin : in STD_LOGIC;
addr_sel : in STD_LOGIC_VECTOR (3 downto 0);
mode_data : out STD_LOGIC_VECTOR (2 downto 0);
latch_out1 : out STD_LOGIC;
latch_out2 : out STD_LOGIC;
sel : out STD_LOGIC;
done : out std_logic;
sdprev_ignore : out STD_LOGIC;
even_odd : out STD_LOGIC;
zero : out std_logic;
proc_latch : in STD_LOGIC);
end serial_input;
architecture Behavioral of serial_input is
-- Component declarations
component serial_counter_new is
Port ( reset : in STD_LOGIC;
sclk : in STD_LOGIC;
ovf : out STD_LOGIC;
even_odd : out STD_LOGIC;
mode_data_reset : in STD_LOGIC;
panel_select : in std_logic;
zero : out std_logic;
latch1 : out STD_LOGIC;
latch2 : out STD_LOGIC;
sml_eight : out STD_LOGIC);
end component serial_counter_new;
component serial_shifter is
Port ( sclk : in STD_LOGIC;
sdin : in STD_LOGIC;
dout : out STD_LOGIC_VECTOR (7 downto 0);
enable : in STD_LOGIC;
brecv : out STD_LOGIC;
mode_data_reset : in std_logic;
reset : in STD_LOGIC);
end component serial_shifter;
component address_comp is
Port ( addr_sel : in STD_LOGIC_VECTOR (3 downto 0);
serial_in : in STD_LOGIC_VECTOR (7 downto 0);
mode_data : out STD_LOGIC_VECTOR (2 downto 0);
addr_valid : out STD_LOGIC;
sdprev_disable : out STD_LOGIC;
vsync_cmd : out std_logic;
byte_rcvd : in std_logic);
end component address_comp;
-- Local signal declarations
signal ctr_sync_reset : std_logic;
signal latch1 : std_logic;
signal latch2 : std_logic;
signal ctr_done : std_logic;
signal ctr_sml_eight : std_logic;
signal ctr_zero : std_logic;
signal serial_dout : std_logic_vector( 7 downto 0 );
signal serial_byte_rcvd : std_logic;
signal panel_select : std_logic;
signal vsync_cmd : std_logic;
signal mode_data_reset : std_logic;
begin
sel <= panel_select;
done <= ctr_done;
zero <= ctr_zero;
ctr_sync_reset <= reset; --or ( clk and ctr_done and ( not proc_rcv_en ) );
latch_out1 <= ( latch1 and panel_select ) when proc_rcv_en = '1' else proc_latch;
latch_out2 <= ( latch2 and panel_select ) when proc_rcv_en = '1' else proc_latch;
mode_data_reset <= '1' when ( vsync_cmd = '1' and panel_select = '1' and proc_rcv_en = '0' ) else '0';
counter : serial_counter_new
port map(
reset => ctr_sync_reset,
sclk => sclk,
ovf => ctr_done,
zero => ctr_zero,
even_odd => even_odd,
latch1 => latch1,
latch2 => latch2,
mode_data_reset => mode_data_reset,
panel_select => panel_select,
sml_eight => ctr_sml_eight
);
shifter : serial_shifter
port map(
sclk => sclk,
sdin => sdin,
dout => serial_dout,
brecv => serial_byte_rcvd,
reset => reset,
mode_data_reset => mode_data_reset,
enable => ctr_sml_eight
);
comparator : address_comp
port map(
addr_sel => addr_sel,
serial_in => serial_dout,
mode_data => mode_data,
addr_valid => panel_select,
sdprev_disable => sdprev_ignore,
vsync_cmd => vsync_cmd,
byte_rcvd => serial_byte_rcvd
);
end Behavioral;