1 |
2 |
feddischso |
----------------------------------------------------------------------
|
2 |
|
|
---- ----
|
3 |
|
|
---- PLB2WB-Bridge ----
|
4 |
|
|
---- ----
|
5 |
|
|
---- This file is part of the PLB-to-WB-Bridge project ----
|
6 |
|
|
---- http://opencores.org/project,plb2wbbridge ----
|
7 |
|
|
---- ----
|
8 |
|
|
---- Description ----
|
9 |
|
|
---- Implementation of a PLB-to-WB-Bridge according to ----
|
10 |
|
|
---- PLB-to-WB Bridge specification document. ----
|
11 |
|
|
---- ----
|
12 |
|
|
---- To Do: ----
|
13 |
|
|
---- Nothing ----
|
14 |
|
|
---- ----
|
15 |
|
|
---- Author(s): ----
|
16 |
|
|
---- - Christian Haettich ----
|
17 |
|
|
---- feddischson@opencores.org ----
|
18 |
|
|
---- ----
|
19 |
|
|
----------------------------------------------------------------------
|
20 |
|
|
---- ----
|
21 |
|
|
---- Copyright (C) 2010 Authors ----
|
22 |
|
|
---- ----
|
23 |
|
|
---- This source file may be used and distributed without ----
|
24 |
|
|
---- restriction provided that this copyright statement is not ----
|
25 |
|
|
---- removed from the file and that any derivative work contains ----
|
26 |
|
|
---- the original copyright notice and the associated disclaimer. ----
|
27 |
|
|
---- ----
|
28 |
|
|
---- This source file is free software; you can redistribute it ----
|
29 |
|
|
---- and/or modify it under the terms of the GNU Lesser General ----
|
30 |
|
|
---- Public License as published by the Free Software Foundation; ----
|
31 |
|
|
---- either version 2.1 of the License, or (at your option) any ----
|
32 |
|
|
---- later version. ----
|
33 |
|
|
---- ----
|
34 |
|
|
---- This source is distributed in the hope that it will be ----
|
35 |
|
|
---- useful, but WITHOUT ANY WARRANTY; without even the implied ----
|
36 |
|
|
---- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ----
|
37 |
|
|
---- PURPOSE. See the GNU Lesser General Public License for more ----
|
38 |
|
|
---- details. ----
|
39 |
|
|
---- ----
|
40 |
|
|
---- You should have received a copy of the GNU Lesser General ----
|
41 |
|
|
---- Public License along with this source; if not, download it ----
|
42 |
|
|
---- from http://www.opencores.org/lgpl.shtml ----
|
43 |
|
|
---- ----
|
44 |
|
|
----------------------------------------------------------------------
|
45 |
|
|
|
46 |
|
|
|
47 |
|
|
library ieee;
|
48 |
|
|
use ieee.std_logic_1164.all;
|
49 |
|
|
use ieee.numeric_std.all;
|
50 |
|
|
use ieee.std_logic_unsigned.all;
|
51 |
|
|
|
52 |
|
|
|
53 |
|
|
library plb2wb_bridge_v1_00_a;
|
54 |
|
|
use plb2wb_bridge_v1_00_a.all;
|
55 |
|
|
use plb2wb_bridge_v1_00_a.plb2wb_pkg.ALL;
|
56 |
|
|
|
57 |
|
|
------------------------------------------------------------------------------
|
58 |
|
|
-- Definition of Generics:
|
59 |
|
|
--
|
60 |
|
|
-- SYNCHRONY -- The PLB and WB clocks are synchron
|
61 |
|
|
-- WB_ADR_OFFSET -- Address offset: is added to every address on WB side
|
62 |
|
|
-- WB_ADR_OFFSET_NEG -- Defines if WB_ADR_OFFSET is added or subtracted
|
63 |
|
|
-- WB_PIC_INTS -- Number of Wishbone interrupt lines
|
64 |
|
|
-- WB_PIC_INT_LEVEL -- Interrupts are active high or acrive low
|
65 |
|
|
-- WB_SUPPORT_BLOCK -- Wishbone block transfers are supported
|
66 |
|
|
-- WB_DAT_W -- Wishbone data bus width
|
67 |
|
|
-- WB_ADR_W -- Wishbone address bus width
|
68 |
|
|
-- WB_TIMEOUT_CYCLES -- Watchdog timer cycles
|
69 |
|
|
--
|
70 |
|
|
--
|
71 |
|
|
-- C_BASEADDR -- PLBv46 slave: base address
|
72 |
|
|
-- C_HIGHADDR -- PLBv46 slave: high address
|
73 |
|
|
-- C_SPLB_AWIDTH -- PLBv46 slave: address bus width
|
74 |
|
|
-- C_STATUS_BASEADDR -- PLBv46 slave: base address of status registers
|
75 |
|
|
-- C_STATUS_HIGHADDR -- PLBv46 slave: base address of status registers
|
76 |
|
|
-- C_SPLB_DWIDTH -- PLBv46 slave: data bus width
|
77 |
|
|
-- C_SPLB_NUM_MASTERS -- PLBv46 slave: Number of masters
|
78 |
|
|
-- C_SPLB_MID_WIDTH -- PLBv46 slave: master ID bus width
|
79 |
|
|
-- C_SPLB_NATIVE_DWIDTH -- PLBv46 slave: internal native data bus width
|
80 |
|
|
-- C_SPLB_SUPPORT_BUR_LINE -- PLBv46 slave: support burst and line transfers
|
81 |
|
|
-- C_SPLB_SUPPORT_ADR_PIPE -- PLBv46 slave: support address pipelining
|
82 |
|
|
--
|
83 |
|
|
-- Definition of Ports:
|
84 |
|
|
-- SPLB_Clk -- PLB main bus clock
|
85 |
|
|
-- SPLB_Rst -- PLB main bus reset
|
86 |
|
|
-- PLB_ABus -- PLB address bus
|
87 |
|
|
-- PLB_UABus -- PLB upper address bus
|
88 |
|
|
-- PLB_PAValid -- PLB primary address valid indicator
|
89 |
|
|
-- PLB_SAValid -- PLB secondary address valid indicator
|
90 |
|
|
-- PLB_rdPrim -- PLB secondary to primary read request indicator
|
91 |
|
|
-- PLB_wrPrim -- PLB secondary to primary write request indicator
|
92 |
|
|
-- PLB_masterID -- PLB current master identifier
|
93 |
|
|
-- PLB_abort -- PLB abort request indicator
|
94 |
|
|
-- PLB_busLock -- PLB bus lock
|
95 |
|
|
-- PLB_RNW -- PLB read/not write
|
96 |
|
|
-- PLB_BE -- PLB byte enables
|
97 |
|
|
-- PLB_MSize -- PLB master data bus size
|
98 |
|
|
-- PLB_size -- PLB transfer size
|
99 |
|
|
-- PLB_type -- PLB transfer type
|
100 |
|
|
-- PLB_lockErr -- PLB lock error indicator
|
101 |
|
|
-- PLB_wrDBus -- PLB write data bus
|
102 |
|
|
-- PLB_wrBurst -- PLB burst write transfer indicator
|
103 |
|
|
-- PLB_rdBurst -- PLB burst read transfer indicator
|
104 |
|
|
-- PLB_wrPendReq -- PLB write pending bus request indicator
|
105 |
|
|
-- PLB_rdPendReq -- PLB read pending bus request indicator
|
106 |
|
|
-- PLB_wrPendPri -- PLB write pending request priority
|
107 |
|
|
-- PLB_rdPendPri -- PLB read pending request priority
|
108 |
|
|
-- PLB_reqPri -- PLB current request priority
|
109 |
|
|
-- PLB_TAttribute -- PLB transfer attribute
|
110 |
|
|
-- Sl_addrAck -- PLB slave address acknowledge
|
111 |
|
|
-- Sl_SSize -- PLB slave data bus size
|
112 |
|
|
-- Sl_wait -- PLB slave wait indicator
|
113 |
|
|
-- Sl_rearbitrate -- PLB slave re-arbitrate bus indicator
|
114 |
|
|
-- Sl_wrDAck -- PLB slave write data acknowledge
|
115 |
|
|
-- Sl_wrComp -- PLB slave write transfer complete indicator
|
116 |
|
|
-- Sl_wrBTerm -- PLB slave terminate write burst transfer
|
117 |
|
|
-- Sl_rdDBus -- PLB slave read data bus
|
118 |
|
|
-- Sl_rdWdAddr -- PLB slave read word address
|
119 |
|
|
-- Sl_rdDAck -- PLB slave read data acknowledge
|
120 |
|
|
-- Sl_rdComp -- PLB slave read transfer complete indicator
|
121 |
|
|
-- Sl_rdBTerm -- PLB slave terminate read burst transfer
|
122 |
|
|
-- Sl_MBusy -- PLB slave busy indicator
|
123 |
|
|
-- Sl_MWrErr -- PLB slave write error indicator
|
124 |
|
|
-- Sl_MRdErr -- PLB slave read error indicator
|
125 |
|
|
-- Sl_MIRQ -- PLB slave bus interrupt indicator (not used by xilinx)
|
126 |
|
|
-- PLB2WB_IRQ -- PLB slave interrupt out
|
127 |
|
|
|
128 |
|
|
-- WB Signals ---------------------------------------
|
129 |
|
|
-- wb_clk_i -- WB bus clock
|
130 |
|
|
-- wb_rst_i -- WB bus reset
|
131 |
|
|
-- wb_dat_i -- WB master read data bus
|
132 |
|
|
-- wb_dat_o -- WB master write data bus
|
133 |
|
|
-- wb_adr_o -- WB master address bus
|
134 |
|
|
-- wb_sel_o -- WB master byte enables
|
135 |
|
|
-- wb_we_o -- WB master write enable ('0' when read)
|
136 |
|
|
-- wb_cyc_o -- WB master bus cycle indicator
|
137 |
|
|
-- wb_stb_o -- WB master strobe output
|
138 |
|
|
-- wb_ack_i -- WB master acknowledge input
|
139 |
|
|
-- wb_err_i -- WB master error input
|
140 |
|
|
-- wb_rty_i -- WB master retry input
|
141 |
|
|
-- wb_lock_o -- WB master bus lock
|
142 |
|
|
-- wb_pic_int_i -- WB master interrupt input
|
143 |
|
|
|
144 |
|
|
------------------------------------------------------------------------------
|
145 |
|
|
|
146 |
|
|
entity plb2wb_bridge is
|
147 |
|
|
generic
|
148 |
|
|
(
|
149 |
|
|
SYNCHRONY : boolean := true; -- true = synchron, false = asynchron!
|
150 |
|
|
|
151 |
|
|
-- PLB Parameters -----------------------------------
|
152 |
|
|
C_BASEADDR : std_logic_vector := X"FFFFFFFF";
|
153 |
|
|
C_HIGHADDR : std_logic_vector := X"00000000";
|
154 |
|
|
C_STATUS_BASEADDR : std_logic_vector := X"FFFFFFFF";
|
155 |
|
|
C_STATUS_HIGHADDR : std_logic_vector := X"00000000";
|
156 |
|
|
C_SPLB_AWIDTH : integer := 32;
|
157 |
|
|
C_SPLB_DWIDTH : integer := 128;
|
158 |
|
|
C_SPLB_NUM_MASTERS : integer := 8;
|
159 |
|
|
C_SPLB_MID_WIDTH : integer := 3;
|
160 |
|
|
C_SPLB_NATIVE_DWIDTH : integer := 32;
|
161 |
|
|
C_SPLB_SUPPORT_BUR_LINE : integer := 1;
|
162 |
|
|
C_SPLB_SUPPORT_ADR_PIPE : integer := 1;
|
163 |
|
|
|
164 |
|
|
-- WB Parameters -----------------------------------
|
165 |
|
|
WB_DAT_W : integer := 32;
|
166 |
|
|
WB_ADR_W : integer := 32;
|
167 |
|
|
WB_TIMEOUT_CYCLES : integer := 10;
|
168 |
|
|
WB_ADR_OFFSET : std_logic_vector := X"00000000";
|
169 |
|
|
WB_ADR_OFFSET_NEG : std_logic := '0';
|
170 |
|
|
WB_PIC_INTS : integer := 0;
|
171 |
|
|
WB_PIC_INT_LEVEL : std_logic := '1';
|
172 |
|
|
WB_SUPPORT_BLOCK : integer := 1
|
173 |
|
|
);
|
174 |
|
|
port
|
175 |
|
|
(
|
176 |
|
|
|
177 |
|
|
PLB2WB_IRQ : out std_logic;
|
178 |
|
|
|
179 |
|
|
-- WB Signals ---------------------------------------
|
180 |
|
|
wb_clk_i : in std_logic;
|
181 |
|
|
wb_rst_i : in std_logic;
|
182 |
|
|
wb_dat_i : in std_logic_vector( WB_DAT_W-1 downto 0 );
|
183 |
|
|
wb_dat_o : out std_logic_vector( WB_DAT_W-1 downto 0 );
|
184 |
|
|
wb_adr_o : out std_logic_vector( WB_ADR_W-1 downto 0 );
|
185 |
|
|
wb_sel_o : out std_logic_vector( WB_DAT_W/8-1 downto 0 );
|
186 |
|
|
wb_we_o : out std_logic;
|
187 |
|
|
wb_cyc_o : out std_logic;
|
188 |
|
|
wb_stb_o : out std_logic;
|
189 |
|
|
wb_ack_i : in std_logic;
|
190 |
|
|
wb_err_i : in std_logic;
|
191 |
|
|
wb_rty_i : in std_logic;
|
192 |
|
|
wb_lock_o : out std_logic;
|
193 |
|
|
|
194 |
|
|
wb_pic_int_i : in std_logic_vector( WB_PIC_INTS-1 downto 0 );
|
195 |
|
|
|
196 |
|
|
-- PLB Signals --------------------------------------
|
197 |
|
|
SPLB_Clk : in std_logic;
|
198 |
|
|
SPLB_Rst : in std_logic;
|
199 |
|
|
PLB_ABus : in std_logic_vector( 0 to 31 );
|
200 |
|
|
PLB_UABus : in std_logic_vector( 0 to 31 );
|
201 |
|
|
PLB_PAValid : in std_logic;
|
202 |
|
|
PLB_SAValid : in std_logic;
|
203 |
|
|
PLB_rdPrim : in std_logic;
|
204 |
|
|
PLB_wrPrim : in std_logic;
|
205 |
|
|
PLB_masterID : in std_logic_vector( 0 to C_SPLB_MID_WIDTH-1 );
|
206 |
|
|
PLB_abort : in std_logic;
|
207 |
|
|
PLB_busLock : in std_logic;
|
208 |
|
|
PLB_RNW : in std_logic;
|
209 |
|
|
PLB_BE : in std_logic_vector( 0 to C_SPLB_DWIDTH/8-1 );
|
210 |
|
|
PLB_MSize : in std_logic_vector( 0 to 1 );
|
211 |
|
|
PLB_size : in std_logic_vector( 0 to 3 );
|
212 |
|
|
PLB_type : in std_logic_vector( 0 to 2 );
|
213 |
|
|
PLB_lockErr : in std_logic;
|
214 |
|
|
PLB_wrDBus : in std_logic_vector( 0 to C_SPLB_DWIDTH-1 );
|
215 |
|
|
PLB_wrBurst : in std_logic;
|
216 |
|
|
PLB_rdBurst : in std_logic;
|
217 |
|
|
PLB_wrPendReq : in std_logic;
|
218 |
|
|
PLB_rdPendReq : in std_logic;
|
219 |
|
|
PLB_wrPendPri : in std_logic_vector( 0 to 1 );
|
220 |
|
|
PLB_rdPendPri : in std_logic_vector( 0 to 1 );
|
221 |
|
|
PLB_reqPri : in std_logic_vector( 0 to 1 );
|
222 |
|
|
PLB_TAttribute : in std_logic_vector( 0 to 15 );
|
223 |
|
|
Sl_addrAck : out std_logic;
|
224 |
|
|
Sl_SSize : out std_logic_vector( 0 to 1 );
|
225 |
|
|
Sl_wait : out std_logic;
|
226 |
|
|
Sl_rearbitrate : out std_logic;
|
227 |
|
|
Sl_wrDAck : out std_logic;
|
228 |
|
|
Sl_wrComp : out std_logic;
|
229 |
|
|
Sl_wrBTerm : out std_logic;
|
230 |
|
|
Sl_rdDBus : out std_logic_vector( 0 to C_SPLB_DWIDTH-1 );
|
231 |
|
|
Sl_rdWdAddr : out std_logic_vector( 0 to 3 );
|
232 |
|
|
Sl_rdDAck : out std_logic;
|
233 |
|
|
Sl_rdComp : out std_logic;
|
234 |
|
|
Sl_rdBTerm : out std_logic;
|
235 |
|
|
Sl_MBusy : out std_logic_vector( 0 to C_SPLB_NUM_MASTERS-1 );
|
236 |
|
|
Sl_MWrErr : out std_logic_vector( 0 to C_SPLB_NUM_MASTERS-1 );
|
237 |
|
|
Sl_MRdErr : out std_logic_vector( 0 to C_SPLB_NUM_MASTERS-1 );
|
238 |
|
|
Sl_MIRQ : out std_logic_vector( 0 to C_SPLB_NUM_MASTERS-1 )
|
239 |
|
|
);
|
240 |
|
|
|
241 |
|
|
|
242 |
|
|
constant WB_DWIDTH : integer := 32;
|
243 |
|
|
constant WB_AWIDTH : integer := WB_ADR_W;
|
244 |
|
|
constant C_SPLB_SIZE_WIDTH : integer := 4;
|
245 |
|
|
constant C_SPLB_TYPE_WIDTH : integer := 3;
|
246 |
|
|
constant C_SPLB_BE_WIDTH : integer := C_SPLB_DWIDTH/8;
|
247 |
|
|
constant C_SPLB_NATIVE_BE_WIDTH : integer := C_SPLB_NATIVE_DWIDTH/8;
|
248 |
|
|
|
249 |
|
|
|
250 |
|
|
end entity plb2wb_bridge;
|
251 |
|
|
|
252 |
|
|
|
253 |
|
|
|
254 |
|
|
|
255 |
|
|
|
256 |
|
|
architecture IMP of plb2wb_bridge is
|
257 |
|
|
|
258 |
|
|
|
259 |
|
|
signal wb_dat_o_t : std_logic_vector( WB_DAT_W-1 downto 0 );
|
260 |
|
|
signal wb_adr_o_t : std_logic_vector( WB_ADR_W-1 downto 0 );
|
261 |
|
|
signal wb_sel_o_t : std_logic_vector( WB_DAT_W/8-1 downto 0 );
|
262 |
|
|
signal wb_we_o_t : std_logic;
|
263 |
|
|
signal wb_cyc_o_t : std_logic;
|
264 |
|
|
signal wb_stb_o_t : std_logic;
|
265 |
|
|
|
266 |
|
|
signal Sl_addrAck_t : std_logic;
|
267 |
|
|
signal Sl_SSize_t : std_logic_vector( 0 to 1 );
|
268 |
|
|
signal Sl_wait_t : std_logic;
|
269 |
|
|
signal Sl_rearbitrate_t : std_logic;
|
270 |
|
|
signal Sl_wrDAck_t : std_logic;
|
271 |
|
|
signal Sl_wrComp_t : std_logic;
|
272 |
|
|
signal Sl_wrBTerm_t : std_logic;
|
273 |
|
|
signal Sl_rdDBus_t : std_logic_vector( 0 to C_SPLB_DWIDTH-1 );
|
274 |
|
|
signal Sl_rdWdAddr_t : std_logic_vector( 0 to 3 );
|
275 |
|
|
signal Sl_rdDAck_t : std_logic;
|
276 |
|
|
signal Sl_rdComp_t : std_logic;
|
277 |
|
|
signal Sl_rdBTerm_t : std_logic;
|
278 |
|
|
signal Sl_MBusy_t : std_logic_vector( 0 to C_SPLB_NUM_MASTERS-1 );
|
279 |
|
|
signal Sl_MWrErr_t : std_logic_vector( 0 to C_SPLB_NUM_MASTERS-1 );
|
280 |
|
|
signal Sl_MRdErr_t : std_logic_vector( 0 to C_SPLB_NUM_MASTERS-1 );
|
281 |
|
|
signal Sl_MIRQ_t : std_logic_vector( 0 to C_SPLB_NUM_MASTERS-1 );
|
282 |
|
|
|
283 |
|
|
signal AMU_buf_RNW : std_logic;
|
284 |
|
|
|
285 |
|
|
signal AMU_bufEmpty : std_logic;
|
286 |
|
|
signal AMU_bufFull : std_logic;
|
287 |
|
|
signal AMU_deviceSelect : std_logic;
|
288 |
|
|
signal AMU_statusSelect : std_logic;
|
289 |
|
|
signal AMU_addrAck : std_logic;
|
290 |
|
|
signal AMU_pipe_wmID : std_logic_vector( 0 to C_SPLB_MID_WIDTH -1 );
|
291 |
|
|
signal AMU_pipe_rmID : std_logic_vector( 0 to C_SPLB_MID_WIDTH -1 );
|
292 |
|
|
signal AMU_buf_size : std_logic_vector( C_SPLB_SIZE_WIDTH-1 downto 0 );
|
293 |
|
|
signal AMU_buf_BE : std_logic_vector( C_SPLB_NATIVE_BE_WIDTH-1 downto 0 );
|
294 |
|
|
signal AMU_buf_adr : std_logic_vector( WB_ADR_W-1 downto 0 );
|
295 |
|
|
signal AMU_buf_adr_wo : std_logic_vector( WB_ADR_W-1 downto 0 );
|
296 |
|
|
signal AMU_pipe_size : std_logic_vector( 0 to C_SPLB_SIZE_WIDTH-1 );
|
297 |
|
|
signal AMU_pipe_BE : std_logic_vector( 0 to C_SPLB_NATIVE_BE_WIDTH-1 );
|
298 |
|
|
signal AMU_pipe_adr : std_logic_vector( 0 to C_SPLB_AWIDTH-1 );
|
299 |
|
|
signal AMU_buf_masterID : std_logic_vector( 0 to C_SPLB_MID_WIDTH-1 );
|
300 |
|
|
signal AMU_pipe_rStatusSelect : std_logic;
|
301 |
|
|
signal AMU_pipe_wStatusSelect : std_logic;
|
302 |
|
|
|
303 |
|
|
|
304 |
|
|
signal RBF_rBus : std_logic_vector( WB_DWIDTH-1 downto 0 );
|
305 |
|
|
signal RBF_empty : std_logic;
|
306 |
|
|
signal RBF_almostEmpty : std_logic;
|
307 |
|
|
signal RBF_full : std_logic;
|
308 |
|
|
signal RBF_rdErrOut : std_logic;
|
309 |
|
|
signal RBF_rdErrIn : std_logic;
|
310 |
|
|
|
311 |
|
|
signal WBF_empty : std_logic;
|
312 |
|
|
signal WBF_full : std_logic;
|
313 |
|
|
signal WBF_wBus : std_logic_vector( 0 to C_SPLB_NATIVE_DWIDTH-1 );
|
314 |
|
|
|
315 |
|
|
|
316 |
|
|
signal TCU_wbufWEn : std_logic;
|
317 |
|
|
signal TCU_wbufREn : std_logic;
|
318 |
|
|
signal TCU_rbufWEn : std_logic;
|
319 |
|
|
signal TCU_rbufREn : std_logic;
|
320 |
|
|
signal TCU_adrBufREn : std_logic;
|
321 |
|
|
signal TCU_adrBufWEn : std_logic;
|
322 |
|
|
signal TCU_enRdDBus : std_logic;
|
323 |
|
|
signal TCU_enStuRdDBus : std_logic;
|
324 |
|
|
signal TCU_MRBusy : std_logic_vector( 0 to C_SPLB_NUM_MASTERS-1 );
|
325 |
|
|
signal TCU_addrAck : std_logic;
|
326 |
|
|
signal TCU_rpipeRdEn : std_logic;
|
327 |
|
|
signal TCU_wpipeRdEn : std_logic;
|
328 |
|
|
signal TCU_adr_offset : std_logic_vector( 3 downto 0 );
|
329 |
|
|
signal TCU_stuLatchPA : std_logic;
|
330 |
|
|
signal TCU_stuLatchSA : std_logic;
|
331 |
|
|
signal TCU_stuWritePA : std_logic;
|
332 |
|
|
signal TCU_stuWriteSA : std_logic;
|
333 |
|
|
|
334 |
|
|
signal TCU_wb_status_info : std_logic_vector( STATUS2PLB_INFO_SIZE-1 downto 0 );
|
335 |
|
|
signal TCU_stat2plb_en : std_logic;
|
336 |
|
|
|
337 |
|
|
signal STU_rdDBus : std_logic_vector( 0 to C_SPLB_DWIDTH-1 );
|
338 |
|
|
|
339 |
|
|
signal STU_full : std_logic;
|
340 |
|
|
signal STU_continue : std_logic;
|
341 |
|
|
signal STU_abort : std_logic;
|
342 |
|
|
signal STU_softReset : std_logic;
|
343 |
|
|
|
344 |
|
|
|
345 |
|
|
signal plb2wb_rst : std_logic;
|
346 |
|
|
signal TCU_wb_irq_info : std_logic_vector( IRQ_INFO_SIZE-1 downto 0 );
|
347 |
|
|
|
348 |
|
|
begin
|
349 |
|
|
|
350 |
|
|
|
351 |
|
|
wb_dat_o <= wb_dat_o_t ;
|
352 |
|
|
wb_adr_o <= wb_adr_o_t ;
|
353 |
|
|
wb_sel_o <= wb_sel_o_t ;
|
354 |
|
|
wb_we_o <= wb_we_o_t ;
|
355 |
|
|
wb_cyc_o <= wb_cyc_o_t ;
|
356 |
|
|
wb_stb_o <= wb_stb_o_t ;
|
357 |
|
|
|
358 |
|
|
Sl_addrAck <= Sl_addrAck_t ;
|
359 |
|
|
Sl_SSize <= Sl_SSize_t ;
|
360 |
|
|
Sl_wait <= Sl_wait_t ;
|
361 |
|
|
Sl_rearbitrate <= Sl_rearbitrate_t ;
|
362 |
|
|
Sl_wrDAck <= Sl_wrDAck_t ;
|
363 |
|
|
Sl_wrComp <= Sl_wrComp_t ;
|
364 |
|
|
Sl_wrBTerm <= Sl_wrBTerm_t ;
|
365 |
|
|
Sl_rdDBus <= Sl_rdDBus_t or STU_rdDBus;
|
366 |
|
|
Sl_rdWdAddr <= Sl_rdWdAddr_t ;
|
367 |
|
|
Sl_rdDAck <= Sl_rdDAck_t ;
|
368 |
|
|
Sl_rdComp <= Sl_rdComp_t ;
|
369 |
|
|
Sl_rdBTerm <= Sl_rdBTerm_t ;
|
370 |
|
|
Sl_MBusy <= Sl_MBusy_t ;
|
371 |
|
|
Sl_MWrErr <= Sl_MWrErr_t ;
|
372 |
|
|
Sl_MRdErr <= Sl_MRdErr_t ;
|
373 |
|
|
Sl_MIRQ <= Sl_MIRQ_t ;
|
374 |
|
|
|
375 |
|
|
|
376 |
|
|
|
377 |
|
|
Sl_MBusy_t <= TCU_MRBusy;
|
378 |
|
|
Sl_addrAck_t <= TCU_addrAck or AMU_addrAck;
|
379 |
|
|
|
380 |
|
|
-----
|
381 |
|
|
--
|
382 |
|
|
-- Set the slave-size, depending on SPLB_NATIVE_DWIDTH
|
383 |
|
|
--
|
384 |
|
|
Sl_SSize_t <= "01" when C_SPLB_NATIVE_DWIDTH = 64 else
|
385 |
|
|
"10" when C_SPLB_NATIVE_DWIDTH = 128 else
|
386 |
|
|
"00";
|
387 |
|
|
|
388 |
|
|
|
389 |
|
|
|
390 |
|
|
plb2wb_rst <= SPLB_Rst or STU_softReset;
|
391 |
|
|
|
392 |
|
|
|
393 |
|
|
stu : entity plb2wb_bridge_v1_00_a.plb2wb_stu( IMP )
|
394 |
|
|
generic map(
|
395 |
|
|
SYNCHRONY => SYNCHRONY,
|
396 |
|
|
WB_DWIDTH => WB_DWIDTH,
|
397 |
|
|
WB_AWIDTH => WB_AWIDTH,
|
398 |
|
|
C_SPLB_AWIDTH => C_SPLB_AWIDTH,
|
399 |
|
|
C_SPLB_DWIDTH => C_SPLB_DWIDTH,
|
400 |
|
|
C_SPLB_MID_WIDTH => C_SPLB_MID_WIDTH,
|
401 |
|
|
C_SPLB_NUM_MASTERS => C_SPLB_NUM_MASTERS,
|
402 |
|
|
C_SPLB_SIZE_WIDTH => C_SPLB_SIZE_WIDTH,
|
403 |
|
|
C_SPLB_BE_WIDTH => C_SPLB_BE_WIDTH,
|
404 |
|
|
C_SPLB_NATIVE_BE_WIDTH => C_SPLB_NATIVE_BE_WIDTH,
|
405 |
|
|
C_SPLB_NATIVE_DWIDTH => C_SPLB_NATIVE_DWIDTH
|
406 |
|
|
)
|
407 |
|
|
port map(
|
408 |
|
|
wb_clk_i => wb_clk_i,
|
409 |
|
|
SPLB_Clk => SPLB_Clk,
|
410 |
|
|
SPLB_Rst => SPLB_Rst,
|
411 |
|
|
|
412 |
|
|
AMU_masterID => AMU_pipe_wmID,
|
413 |
|
|
AMU_pipe_adr => AMU_pipe_adr,
|
414 |
|
|
AMU_buf_adr_wo => AMU_buf_adr_wo,
|
415 |
|
|
AMU_buf_masterID => AMU_buf_masterID,
|
416 |
|
|
|
417 |
|
|
PLB_masterID => PLB_masterID,
|
418 |
|
|
PLB_size => PLB_size,
|
419 |
|
|
PLB_wrDBus => PLB_wrDBus,
|
420 |
|
|
PLB_ABus => PLB_ABus,
|
421 |
|
|
PLB_BE => PLB_BE ,
|
422 |
|
|
Sl_rdWdAddr => Sl_rdWdAddr_t,
|
423 |
|
|
Sl_MIRQ => Sl_MIRQ_t,
|
424 |
|
|
|
425 |
|
|
STU_rdDBus => STU_rdDBus,
|
426 |
|
|
STU_full => STU_full,
|
427 |
|
|
STU_continue => STU_continue,
|
428 |
|
|
STU_abort => STU_abort,
|
429 |
|
|
STU_softReset => STU_softReset,
|
430 |
|
|
WBF_wBus => WBF_wBus,
|
431 |
|
|
|
432 |
|
|
TCU_wb_irq_info => TCU_wb_irq_info,
|
433 |
|
|
TCU_enStuRdDBus => TCU_enStuRdDBus,
|
434 |
|
|
TCU_wb_status_info => TCU_wb_status_info,
|
435 |
|
|
TCU_stuLatchPA => TCU_stuLatchPA,
|
436 |
|
|
TCU_stuLatchSA => TCU_stuLatchSA,
|
437 |
|
|
TCU_stuWritePA => TCU_stuWritePA,
|
438 |
|
|
TCU_stuWriteSA => TCU_stuWriteSA,
|
439 |
|
|
TCU_stat2plb_en => TCU_stat2plb_en,
|
440 |
|
|
PLB2WB_IRQ => PLB2WB_IRQ
|
441 |
|
|
);
|
442 |
|
|
|
443 |
|
|
|
444 |
|
|
|
445 |
|
|
|
446 |
|
|
|
447 |
|
|
|
448 |
|
|
amu : entity plb2wb_bridge_v1_00_a.plb2wb_amu( IMP )
|
449 |
|
|
generic map(
|
450 |
|
|
SYNCHRONY => SYNCHRONY,
|
451 |
|
|
|
452 |
|
|
WB_DWIDTH => WB_DWIDTH,
|
453 |
|
|
WB_AWIDTH => WB_AWIDTH,
|
454 |
|
|
WB_ADR_OFFSET => WB_ADR_OFFSET,
|
455 |
|
|
WB_ADR_OFFSET_NEG => WB_ADR_OFFSET_NEG,
|
456 |
|
|
|
457 |
|
|
C_BASEADDR => C_BASEADDR,
|
458 |
|
|
C_HIGHADDR => C_HIGHADDR,
|
459 |
|
|
C_STATUS_BASEADDR => C_STATUS_BASEADDR,
|
460 |
|
|
C_STATUS_HIGHADDR => C_STATUS_HIGHADDR,
|
461 |
|
|
C_SPLB_AWIDTH => C_SPLB_AWIDTH,
|
462 |
|
|
C_SPLB_SIZE_WIDTH => C_SPLB_SIZE_WIDTH,
|
463 |
|
|
C_SPLB_TYPE_WIDTH => C_SPLB_TYPE_WIDTH,
|
464 |
|
|
C_SPLB_BE_WIDTH => C_SPLB_BE_WIDTH,
|
465 |
|
|
C_SPLB_NATIVE_BE_WIDTH => C_SPLB_NATIVE_BE_WIDTH,
|
466 |
|
|
C_SPLB_SUPPORT_BUR_LINE => C_SPLB_SUPPORT_BUR_LINE,
|
467 |
|
|
C_SPLB_MID_WIDTH => C_SPLB_MID_WIDTH,
|
468 |
|
|
C_SPLB_SUPPORT_ADR_PIPE => C_SPLB_SUPPORT_ADR_PIPE
|
469 |
|
|
)
|
470 |
|
|
port map(
|
471 |
|
|
|
472 |
|
|
wb_clk_i => wb_clk_i ,
|
473 |
|
|
wb_sel_o => wb_sel_o_t ,
|
474 |
|
|
|
475 |
|
|
SPLB_Clk => SPLB_Clk ,
|
476 |
|
|
plb2wb_rst => plb2wb_rst ,
|
477 |
|
|
|
478 |
|
|
PLB_ABus => PLB_ABus ,
|
479 |
|
|
PLB_UABus => PLB_UABus ,
|
480 |
|
|
PLB_SAValid => PLB_SAValid ,
|
481 |
|
|
PLB_size => PLB_size ,
|
482 |
|
|
PLB_type => PLB_type ,
|
483 |
|
|
PLB_BE => PLB_BE ,
|
484 |
|
|
PLB_RNW => PLB_RNW ,
|
485 |
|
|
PLB_masterID => PLB_masterID ,
|
486 |
|
|
|
487 |
|
|
TCU_adrBufREn => TCU_adrBufREn,
|
488 |
|
|
TCU_adrBufWEn => TCU_adrBufWEn,
|
489 |
|
|
TCU_rpipeRdEn => TCU_rpipeRdEn,
|
490 |
|
|
TCU_wpipeRdEn => TCU_wpipeRdEn ,
|
491 |
|
|
TCU_stuWriteSA => TCU_stuWriteSA,
|
492 |
|
|
|
493 |
|
|
AMU_deviceSelect => AMU_deviceSelect,
|
494 |
|
|
AMU_statusSelect => AMU_statusSelect,
|
495 |
|
|
AMU_bufEmpty => AMU_bufEmpty ,
|
496 |
|
|
AMU_bufFull => AMU_bufFull,
|
497 |
|
|
AMU_addrAck => AMU_addrAck,
|
498 |
|
|
AMU_buf_RNW => AMU_buf_RNW,
|
499 |
|
|
AMU_pipe_wmID => AMU_pipe_wmID,
|
500 |
|
|
AMU_pipe_rmID => AMU_pipe_rmID,
|
501 |
|
|
AMU_buf_size => AMU_buf_size,
|
502 |
|
|
AMU_buf_masterID => AMU_buf_masterID,
|
503 |
|
|
AMU_buf_adr => AMU_buf_adr,
|
504 |
|
|
AMU_buf_adr_wo => AMU_buf_adr_wo,
|
505 |
|
|
AMU_pipe_size => AMU_pipe_size,
|
506 |
|
|
AMU_pipe_BE => AMU_pipe_BE,
|
507 |
|
|
AMU_buf_BE => AMU_buf_BE,
|
508 |
|
|
AMU_pipe_adr => AMU_pipe_adr,
|
509 |
|
|
AMU_pipe_rStatusSelect =>AMU_pipe_rStatusSelect,
|
510 |
|
|
AMU_pipe_wStatusSelect =>AMU_pipe_wStatusSelect
|
511 |
|
|
);
|
512 |
|
|
|
513 |
|
|
|
514 |
|
|
wb_adr_o_t <= std_logic_vector( unsigned( AMU_buf_adr ) + unsigned( TCU_adr_offset & "00" ) );
|
515 |
|
|
|
516 |
|
|
|
517 |
|
|
|
518 |
|
|
|
519 |
|
|
|
520 |
|
|
|
521 |
|
|
|
522 |
|
|
|
523 |
|
|
tcu : entity plb2wb_bridge_v1_00_a.plb2wb_tcu( IMP )
|
524 |
|
|
generic map(
|
525 |
|
|
C_SPLB_SIZE_WIDTH => C_SPLB_SIZE_WIDTH,
|
526 |
|
|
C_SPLB_DWIDTH => C_SPLB_DWIDTH,
|
527 |
|
|
C_SPLB_NATIVE_BE_WIDTH => C_SPLB_NATIVE_BE_WIDTH,
|
528 |
|
|
C_SPLB_NUM_MASTERS => C_SPLB_NUM_MASTERS,
|
529 |
|
|
C_SPLB_MID_WIDTH => C_SPLB_MID_WIDTH,
|
530 |
|
|
C_SPLB_TYPE_WIDTH => C_SPLB_TYPE_WIDTH,
|
531 |
|
|
C_SPLB_SUPPORT_BUR_LINE => C_SPLB_SUPPORT_BUR_LINE,
|
532 |
|
|
WB_PIC_INTS => WB_PIC_INTS,
|
533 |
|
|
WB_PIC_INT_LEVEL => WB_PIC_INT_LEVEL,
|
534 |
|
|
WB_SUPPORT_BLOCK => WB_SUPPORT_BLOCK
|
535 |
|
|
)
|
536 |
|
|
port map(
|
537 |
|
|
|
538 |
|
|
wb_clk_i => wb_clk_i,
|
539 |
|
|
wb_stb_o => wb_stb_o_t,
|
540 |
|
|
wb_we_o => wb_we_o_t,
|
541 |
|
|
wb_cyc_o => wb_cyc_o_t,
|
542 |
|
|
wb_ack_i => wb_ack_i,
|
543 |
|
|
wb_err_i => wb_err_i,
|
544 |
|
|
wb_rty_i => wb_rty_i,
|
545 |
|
|
wb_lock_o => wb_lock_o,
|
546 |
|
|
wb_rst_i => wb_rst_i,
|
547 |
|
|
wb_pic_int_i => wb_pic_int_i,
|
548 |
|
|
|
549 |
|
|
SPLB_Clk => SPLB_Clk,
|
550 |
|
|
plb2wb_rst => plb2wb_rst,
|
551 |
|
|
PLB_MSize => PLB_MSize,
|
552 |
|
|
PLB_TAttribute => PLB_TAttribute,
|
553 |
|
|
PLB_lockErr => PLB_lockErr,
|
554 |
|
|
PLB_abort => PLB_abort,
|
555 |
|
|
PLB_rdBurst => PLB_rdBurst,
|
556 |
|
|
PLB_wrBurst => PLB_wrBurst,
|
557 |
|
|
PLB_RNW => PLB_RNW,
|
558 |
|
|
PLB_PAValid => PLB_PAValid,
|
559 |
|
|
PLB_masterID => PLB_masterID,
|
560 |
|
|
PLB_rdPrim => PLB_rdPrim,
|
561 |
|
|
PLB_wrPrim => PLB_wrPrim,
|
562 |
|
|
PLB_size => PLB_size,
|
563 |
|
|
PLB_BE => PLB_BE,
|
564 |
|
|
PLB_type => PLB_type,
|
565 |
|
|
|
566 |
|
|
STU_continue => STU_continue,
|
567 |
|
|
STU_abort => STU_abort,
|
568 |
|
|
|
569 |
|
|
Sl_MWrErr => Sl_MWrErr_t,
|
570 |
|
|
Sl_wrDAck => Sl_wrDAck_t,
|
571 |
|
|
Sl_wrComp => Sl_wrComp_t,
|
572 |
|
|
Sl_wrBTerm => Sl_wrBTerm_t,
|
573 |
|
|
Sl_rdDAck => Sl_rdDAck_t,
|
574 |
|
|
Sl_rdComp => Sl_rdComp_t,
|
575 |
|
|
Sl_rdBTerm => Sl_rdBTerm_t,
|
576 |
|
|
Sl_rdWdAddr => Sl_rdWdAddr_t,
|
577 |
|
|
Sl_wait => Sl_wait_t,
|
578 |
|
|
Sl_rearbitrate => Sl_rearbitrate_t,
|
579 |
|
|
Sl_MRdErr => Sl_MRdErr_t,
|
580 |
|
|
|
581 |
|
|
AMU_deviceSelect => AMU_deviceSelect,
|
582 |
|
|
AMU_bufEmpty => AMU_bufEmpty,
|
583 |
|
|
AMU_bufFull => AMU_bufFull,
|
584 |
|
|
AMU_buf_RNW => AMU_buf_RNW,
|
585 |
|
|
AMU_buf_BE => AMU_buf_BE,
|
586 |
|
|
AMU_buf_size => AMU_buf_size,
|
587 |
|
|
AMU_pipe_rmID => AMU_pipe_rmID,
|
588 |
|
|
AMU_pipe_wmID => AMU_pipe_wmID,
|
589 |
|
|
AMU_pipe_size => AMU_pipe_size,
|
590 |
|
|
AMU_pipe_BE => AMU_pipe_BE,
|
591 |
|
|
AMU_statusSelect => AMU_statusSelect,
|
592 |
|
|
AMU_pipe_rStatusSelect =>AMU_pipe_rStatusSelect,
|
593 |
|
|
AMU_pipe_wStatusSelect =>AMU_pipe_wStatusSelect,
|
594 |
|
|
|
595 |
|
|
TCU_wbufWEn => TCU_wbufWEn,
|
596 |
|
|
TCU_wbufREn => TCU_wbufREn,
|
597 |
|
|
TCU_rbufWEn => TCU_rbufWEn,
|
598 |
|
|
TCU_rbufREn => TCU_rbufREn,
|
599 |
|
|
TCU_adrBufREn => TCU_adrBufREn,
|
600 |
|
|
TCU_adrBufWEn => TCU_adrBufWEn,
|
601 |
|
|
TCU_enStuRdDBus => TCU_enStuRdDBus,
|
602 |
|
|
TCU_enRdDBus => TCU_enRdDBus,
|
603 |
|
|
TCU_MRBusy => TCU_MRBusy,
|
604 |
|
|
TCU_addrAck => TCU_addrAck,
|
605 |
|
|
TCU_rpipeRdEn => TCU_rpipeRdEn,
|
606 |
|
|
TCU_wpipeRdEn => TCU_wpipeRdEn ,
|
607 |
|
|
TCU_adr_offset => TCU_adr_offset,
|
608 |
|
|
TCU_stuLatchPA => TCU_stuLatchPA,
|
609 |
|
|
TCU_stuLatchSA => TCU_stuLatchSA,
|
610 |
|
|
TCU_stuWritePA => TCU_stuWritePA,
|
611 |
|
|
TCU_stuWriteSA => TCU_stuWriteSA,
|
612 |
|
|
TCU_stat2plb_en => TCU_stat2plb_en,
|
613 |
|
|
TCU_wb_status_info => TCU_wb_status_info,
|
614 |
|
|
TCU_wb_irq_info => TCU_wb_irq_info,
|
615 |
|
|
|
616 |
|
|
WBF_empty => WBF_empty,
|
617 |
|
|
WBF_full => WBF_full,
|
618 |
|
|
|
619 |
|
|
RBF_rdErrOut => RBF_rdErrOut,
|
620 |
|
|
RBF_rdErrIn => RBF_rdErrIn,
|
621 |
|
|
RBF_empty => RBF_empty,
|
622 |
|
|
RBF_almostEmpty => RBF_almostEmpty,
|
623 |
|
|
RBF_full => RBF_full
|
624 |
|
|
);
|
625 |
|
|
|
626 |
|
|
|
627 |
|
|
|
628 |
|
|
|
629 |
|
|
|
630 |
|
|
|
631 |
|
|
|
632 |
|
|
|
633 |
|
|
|
634 |
|
|
|
635 |
|
|
|
636 |
|
|
---------------------------------
|
637 |
|
|
--
|
638 |
|
|
--
|
639 |
|
|
--
|
640 |
|
|
-- Read and Write Buffer
|
641 |
|
|
--
|
642 |
|
|
--
|
643 |
|
|
wb_dat_o_t <= WBF_wBus;
|
644 |
|
|
|
645 |
|
|
gen_128 : if C_SPLB_DWIDTH = 128 generate
|
646 |
|
|
Sl_rdDBus_t <= RBF_rBus & RBF_rBus & RBF_rBus & RBF_rBus when TCU_enRdDBus = '1' else
|
647 |
|
|
( others => '0' );
|
648 |
|
|
end generate gen_128;
|
649 |
|
|
|
650 |
|
|
gen_64 : if C_SPLB_DWIDTH = 64 generate
|
651 |
|
|
Sl_rdDBus_t <= RBF_rBus & RBF_rBus when TCU_enRdDBus = '1' else
|
652 |
|
|
( others => '0' );
|
653 |
|
|
end generate gen_64;
|
654 |
|
|
|
655 |
|
|
gen_32 : if C_SPLB_DWIDTH = 32 generate
|
656 |
|
|
Sl_rdDBus_t <= RBF_rBus when TCU_enRdDBus = '1' else
|
657 |
|
|
( others => '0' );
|
658 |
|
|
end generate gen_32;
|
659 |
|
|
|
660 |
|
|
|
661 |
|
|
|
662 |
|
|
|
663 |
|
|
wbuf : entity plb2wb_bridge_v1_00_a.plb2wb_wbuf( IMP_32 )
|
664 |
|
|
generic map(
|
665 |
|
|
SYNCHRONY => SYNCHRONY,
|
666 |
|
|
C_SPLB_DWIDTH => C_SPLB_DWIDTH,
|
667 |
|
|
C_SPLB_NATIVE_DWIDTH => C_SPLB_NATIVE_DWIDTH,
|
668 |
|
|
C_SPLB_SIZE_WIDTH => C_SPLB_SIZE_WIDTH
|
669 |
|
|
)
|
670 |
|
|
port map(
|
671 |
|
|
|
672 |
|
|
wb_clk_i => wb_clk_i,
|
673 |
|
|
SPLB_Clk => SPLB_Clk,
|
674 |
|
|
plb2wb_rst => plb2wb_rst,
|
675 |
|
|
PLB_size => PLB_size,
|
676 |
|
|
PLB_wrDBus => PLB_wrDBus,
|
677 |
|
|
TCU_wbufWEn => TCU_wbufWEn,
|
678 |
|
|
TCU_wbufREn => TCU_wbufREn,
|
679 |
|
|
|
680 |
|
|
WBF_empty => WBF_empty,
|
681 |
|
|
WBF_full => WBF_full,
|
682 |
|
|
WBF_wBus => WBF_wBus
|
683 |
|
|
);
|
684 |
|
|
|
685 |
|
|
rbuf : entity plb2wb_bridge_v1_00_a.plb2wb_rbuf( IMP_32 )
|
686 |
|
|
generic map(
|
687 |
|
|
SYNCHRONY => SYNCHRONY,
|
688 |
|
|
WB_DWIDTH => WB_DWIDTH
|
689 |
|
|
)
|
690 |
|
|
port map(
|
691 |
|
|
wb_clk_i => wb_clk_i,
|
692 |
|
|
SPLB_Clk => SPLB_Clk,
|
693 |
|
|
plb2wb_rst => plb2wb_rst,
|
694 |
|
|
wb_dat_i => wb_dat_i,
|
695 |
|
|
RBF_rBus => RBF_rBus,
|
696 |
|
|
RBF_empty => RBF_empty,
|
697 |
|
|
RBF_almostEmpty => RBF_almostEmpty,
|
698 |
|
|
RBF_full => RBF_full,
|
699 |
|
|
RBF_rdErrOut => RBF_rdErrOut,
|
700 |
|
|
RBF_rdErrIn => RBF_rdErrIn,
|
701 |
|
|
TCU_rbufWEn => TCU_rbufWEn,
|
702 |
|
|
TCU_rbufREn => TCU_rbufREn
|
703 |
|
|
);
|
704 |
|
|
--
|
705 |
|
|
-------------------------------------------
|
706 |
|
|
|
707 |
|
|
|
708 |
|
|
|
709 |
|
|
|
710 |
|
|
|
711 |
|
|
|
712 |
|
|
end IMP;
|