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