1 |
21 |
mcwaccent |
----------------------------------------------------------------------------------
|
2 |
|
|
--
|
3 |
|
|
-- This file is a part of Technica Corporation Wizardry Project
|
4 |
|
|
--
|
5 |
|
|
-- Copyright (C) 2004-2009, Technica Corporation
|
6 |
|
|
--
|
7 |
|
|
-- This program is free software: you can redistribute it and/or modify
|
8 |
|
|
-- it under the terms of the GNU General Public License as published by
|
9 |
|
|
-- the Free Software Foundation, either version 3 of the License, or
|
10 |
|
|
-- (at your option) any later version.
|
11 |
|
|
--
|
12 |
|
|
-- This program is distributed in the hope that it will be useful,
|
13 |
|
|
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14 |
|
|
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15 |
|
|
-- GNU General Public License for more details.
|
16 |
|
|
--
|
17 |
|
|
-- You should have received a copy of the GNU General Public License
|
18 |
|
|
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
|
19 |
|
|
--
|
20 |
|
|
----------------------------------------------------------------------------------
|
21 |
|
|
----------------------------------------------------------------------------------
|
22 |
|
|
-- Module Name: Address_Path - Structural
|
23 |
|
|
-- Project Name: Wizardry
|
24 |
|
|
-- Target Devices: Virtex 4 ML401
|
25 |
|
|
-- Description: Structural description for Address path for Memory Access Controller.
|
26 |
|
|
-- Revision: 1.0
|
27 |
|
|
-- Additional Comments:
|
28 |
|
|
--
|
29 |
|
|
----------------------------------------------------------------------------------
|
30 |
|
|
library IEEE;
|
31 |
|
|
use IEEE.STD_LOGIC_1164.ALL;
|
32 |
|
|
use IEEE.STD_LOGIC_ARITH.ALL;
|
33 |
|
|
use IEEE.STD_LOGIC_UNSIGNED.ALL;
|
34 |
|
|
use work.MAC_Constants.all;
|
35 |
|
|
|
36 |
|
|
---- Uncomment the following library declaration if instantiating
|
37 |
|
|
---- any Xilinx primitives in this code.
|
38 |
|
|
--library UNISIM;
|
39 |
|
|
--use UNISIM.VComponents.all;
|
40 |
|
|
|
41 |
|
|
entity Address_Path is
|
42 |
|
|
Port ( clock : in STD_LOGIC;
|
43 |
|
|
reset : in STD_LOGIC;
|
44 |
|
|
read_enable_in : in std_logic_vector(num_of_ports downto 0);
|
45 |
|
|
write_enable_in : in std_logic_vector(num_of_ports downto 0);
|
46 |
|
|
Memory_Access_in : in Memory_Access_Port_in;
|
47 |
|
|
burst_addresses : in v_adr_i;
|
48 |
|
|
read_address : in v_adr_i;
|
49 |
|
|
acknowledge_read_data_in : in STD_LOGIC;
|
50 |
|
|
read_index : out integer range 0 to num_of_ports;
|
51 |
|
|
read_err_o : out STD_LOGIC_VECTOR (num_of_ports downto 0);
|
52 |
|
|
write_err_o : out STD_LOGIC_VECTOR (num_of_ports downto 0);
|
53 |
|
|
Decoded_write_address_out : out std_logic_vector(physical_address_width -1 downto 0);
|
54 |
|
|
Write_enable_out : out STD_LOGIC_VECTOR (num_of_ports downto 0);
|
55 |
|
|
Decoded_Read_address_out : out std_logic_vector(physical_address_width -1 downto 0);
|
56 |
|
|
read_enable_out : out STD_LOGIC;
|
57 |
|
|
Read_Acknowledge_out : out STD_LOGIC_VECTOR(num_of_ports downto 0)
|
58 |
|
|
);
|
59 |
|
|
end Address_Path;
|
60 |
|
|
|
61 |
|
|
architecture Behavioral of Address_Path is
|
62 |
|
|
|
63 |
|
|
component read_address_decoder is
|
64 |
|
|
Port ( reset : in std_logic;
|
65 |
|
|
clock : in STD_LOGIC;
|
66 |
|
|
read_enable_in : in STD_LOGIC_VECTOR (num_of_ports downto 0);
|
67 |
|
|
adr_i : in v_adr_i;
|
68 |
|
|
id_i : in ID_type;
|
69 |
|
|
read_index : out integer range 0 to num_of_ports;
|
70 |
|
|
decoded_read_address_out : out STD_LOGIC_VECTOR(physical_address_width -1 downto 0);
|
71 |
|
|
err_o : out STD_LOGIC_VECTOR (num_of_ports downto 0);
|
72 |
|
|
read_enable_out : out STD_LOGIC);
|
73 |
|
|
end component;
|
74 |
|
|
|
75 |
|
|
component write_address_decoder is
|
76 |
|
|
Port ( clock : std_logic;
|
77 |
|
|
ports_in : memory_access_port_in;
|
78 |
|
|
burst_addresses : v_adr_i;
|
79 |
|
|
write_enable_in : in STD_LOGIC_VECTOR (num_of_ports downto 0);
|
80 |
|
|
decoded_write_address : out STD_LOGIC_VECTOR (physical_address_width -1 downto 0);
|
81 |
|
|
write_enable_out : out STD_LOGIC_VECTOR (num_of_ports downto 0);
|
82 |
|
|
write_error_out : out STD_LOGIC_VECTOR (num_of_ports downto 0)
|
83 |
|
|
);
|
84 |
|
|
end component;
|
85 |
|
|
|
86 |
|
|
component Acknowledge_Path is
|
87 |
|
|
Port ( clock : in STD_LOGIC;
|
88 |
|
|
reset : in STD_LOGIC;
|
89 |
|
|
read_index : in integer range 0 to num_of_ports;
|
90 |
|
|
read_index_out : out integer range 0 to num_of_ports;
|
91 |
|
|
read_enable : in STD_LOGIC;
|
92 |
|
|
acknowledge_read_data_in : in STD_LOGIC;
|
93 |
|
|
read_acknowledge : out STD_LOGIC_VECTOR (num_of_ports downto 0));
|
94 |
|
|
end component;
|
95 |
|
|
|
96 |
|
|
signal read_index_s,read_index_out_s : integer range 0 to num_of_ports;
|
97 |
|
|
signal read_enable_out_s : std_logic;
|
98 |
|
|
signal write_enable_out_s : std_logic_vector(num_of_ports downto 0);
|
99 |
|
|
--signal burst_addresses_s : v_adr_i;
|
100 |
|
|
|
101 |
|
|
begin
|
102 |
|
|
A0 : read_address_decoder
|
103 |
|
|
Port Map( reset => reset,
|
104 |
|
|
clock => clock,
|
105 |
|
|
read_enable_in => read_enable_in,
|
106 |
|
|
adr_i => read_address,
|
107 |
|
|
id_i => Memory_Access_in.ID_i,
|
108 |
|
|
read_index => read_index_s,
|
109 |
|
|
decoded_read_address_out => decoded_read_address_out,
|
110 |
|
|
err_o => read_err_o,
|
111 |
|
|
read_enable_out => read_enable_out_s
|
112 |
|
|
);
|
113 |
|
|
|
114 |
|
|
A1 : write_address_decoder
|
115 |
|
|
Port Map( clock => clock,
|
116 |
|
|
ports_in => Memory_Access_in,
|
117 |
|
|
burst_addresses => burst_addresses,
|
118 |
|
|
write_enable_in => write_enable_in,
|
119 |
|
|
decoded_write_address => decoded_write_address_out,
|
120 |
|
|
write_enable_out => write_enable_out_s,
|
121 |
|
|
write_error_out => write_err_o
|
122 |
|
|
);
|
123 |
|
|
|
124 |
|
|
A2 : Acknowledge_Path
|
125 |
|
|
Port Map ( clock => clock,
|
126 |
|
|
reset => reset,
|
127 |
|
|
read_index => read_index_s,
|
128 |
|
|
read_index_out => read_index_out_s,
|
129 |
|
|
read_enable => read_enable_out_s,
|
130 |
|
|
acknowledge_read_data_in => acknowledge_read_data_in,
|
131 |
|
|
read_acknowledge => Read_Acknowledge_out);
|
132 |
|
|
read_index <= read_index_out_s;
|
133 |
|
|
read_enable_out <= read_enable_out_s;
|
134 |
|
|
write_enable_out <= write_enable_out_s;
|
135 |
|
|
end Behavioral;
|
136 |
|
|
|