-
Notifications
You must be signed in to change notification settings - Fork 1
/
IOT_Distributor.vhd
86 lines (73 loc) · 2.75 KB
/
IOT_Distributor.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
----------------------------------------------------------------------------------
-- Company:
-- Engineer:
--
-- Create Date: 17:33:50 03/21/2011
-- Design Name:
-- Module Name: IOT_Distributor - Behavioral
-- Project Name:
-- Target Devices:
-- Tool versions:
-- Description:
--
-- Dependencies:
--
-- Revision:
-- Revision 0.01 - File Created
-- Additional Comments:
--
----------------------------------------------------------------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
-- Uncomment the following library declaration if using
-- arithmetic functions with Signed or Unsigned values
--use IEEE.NUMERIC_STD.ALL;
-- Uncomment the following library declaration if instantiating
-- any Xilinx primitives in this code.
--library UNISIM;
--use UNISIM.VComponents.all;
entity IOT_Distributor is
Port ( -- interface to device 3
ready_3 : in STD_LOGIC;
clear_3 : out STD_LOGIC;
clearacc_3 : in STD_LOGIC;
dataout_3 : out STD_LOGIC_VECTOR (7 downto 0);
datain_3 : in STD_LOGIC_VECTOR (7 downto 0);
load_3 : out STD_LOGIC;
-- interface to device 4
ready_4 : in STD_LOGIC;
clear_4 : out STD_LOGIC;
clearacc_4 : in STD_LOGIC;
dataout_4 : out STD_LOGIC_VECTOR (7 downto 0);
datain_4 : in STD_LOGIC_VECTOR (7 downto 0);
load_4 : out STD_LOGIC;
-- interface to CPU
skip_flag : out STD_LOGIC;
bit1_cp2 : in STD_LOGIC;
clearacc : out STD_LOGIC;
dataout : in STD_LOGIC_VECTOR (7 downto 0);
datain : out STD_LOGIC_VECTOR (7 downto 0);
bit2_cp3 : in STD_LOGIC;
io_address : in STD_LOGIC_VECTOR (2 downto 0));
end IOT_Distributor;
architecture Behavioral of IOT_Distributor is
begin
-- multiplexers
skip_flag <= ready_3 when io_address = "011" else
ready_4 when io_address = "100" else
'0';
clearacc <= clearacc_3 when io_address = "011" else
clearacc_4 when io_address = "100" else
'0';
datain <= datain_3 when io_address = "011" else
datain_4 when io_address = "100" else
"00000000";
-- pass through
dataout_3 <= dataout;
dataout_4 <= dataout;
-- demultiplexers
clear_3 <= bit1_cp2 when io_address = "011" else '0';
clear_4 <= bit1_cp2 when io_address = "100" else '0';
load_3 <= bit2_cp3 when io_address = "011" else '0';
load_4 <= bit2_cp3 when io_address = "100" else '0';
end Behavioral;