-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLEDSlave.vhd
More file actions
43 lines (38 loc) · 1.12 KB
/
Copy pathLEDSlave.vhd
File metadata and controls
43 lines (38 loc) · 1.12 KB
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
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity LEDSlave is
Port(Hsel : in STD_LOGIC;
Haddress : in STD_LOGIC_VECTOR(15 downto 0);
HWrite : in STD_LOGIC;
HReady : out STD_LOGIC;
HTrans : in STD_LOGIC_VECTOR(1 downto 0);
HReset : in STD_LOGIC;
HClock : in STD_LOGIC;
HWData : in STD_LOGIC_VECTOR(31 downto 0);
LED : out STD_LOGIC_VECTOR(15 downto 0));
end LEDSlave;
architecture Behavioral of LEDSlave is
Type State is (
IDLE,
EXECUTE
);
begin
process(HClock,HReset)
begin
if HReset = '1' then
--curr_state<=IDLE;
HReady <= '1';
LED <= "0000000000000000";
elsif rising_edge(HClock) then
--case curr_state is
--when IDLE =>
if HTrans = "10" and HSel ='1' and HWrite = '1' then
-- curr_state <= EXECUTE;
LED <= HWData(15 downto 0);
HReady <= '1';
end if;
--when EXECUTE =>
-- curr_state <= IDLE;
end if;
end process;
end Behavioral;