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 |
|
|
library ieee;
|
47 |
|
|
use ieee.std_logic_1164.all;
|
48 |
|
|
use ieee.numeric_std.all;
|
49 |
|
|
use ieee.std_logic_unsigned.all;
|
50 |
|
|
|
51 |
|
|
library plb2wb_bridge_v1_00_a;
|
52 |
|
|
use plb2wb_bridge_v1_00_a.all;
|
53 |
|
|
|
54 |
|
|
|
55 |
|
|
entity top is
|
56 |
|
|
|
57 |
|
|
generic
|
58 |
|
|
(
|
59 |
|
|
SYNCHRONY : boolean := false; -- true = synchron, false = asynchron!
|
60 |
|
|
|
61 |
|
|
-- PLB Parameters -----------------------------------
|
62 |
|
|
C_BASEADDR : std_logic_vector := X"FFFFFFFF";
|
63 |
|
|
C_HIGHADDR : std_logic_vector := X"00000000";
|
64 |
|
|
C_STATUS_BASEADDR : std_logic_vector := X"FFFFFFFF";
|
65 |
|
|
C_STATUS_HIGHADDR : std_logic_vector := X"00000000";
|
66 |
|
|
C_SPLB_AWIDTH : integer := 32;
|
67 |
|
|
C_SPLB_DWIDTH : integer := 128;
|
68 |
|
|
C_SPLB_NUM_MASTERS : integer := 8;
|
69 |
|
|
C_SPLB_MID_WIDTH : integer := 3;
|
70 |
|
|
C_SPLB_NATIVE_DWIDTH : integer := 32;
|
71 |
|
|
C_SPLB_SUPPORT_BUR_LINE : integer := 1;
|
72 |
|
|
C_SPLB_SUPPORT_ADR_PIPE : integer := 1;
|
73 |
|
|
|
74 |
|
|
-- WB Parameters -----------------------------------
|
75 |
|
|
WB_DAT_W : integer := 32;
|
76 |
|
|
WB_ADR_W : integer := 32;
|
77 |
|
|
WB_TIMEOUT_CYCLES : integer := 32;
|
78 |
|
|
WB_ADR_OFFSET : std_logic_vector := X"f0000000";
|
79 |
|
|
WB_ADR_OFFSET_NEG : std_logic := '0';
|
80 |
|
|
WB_PIC_INTS : integer := 32;
|
81 |
|
|
WB_PIC_INT_LEVEL : std_logic := '1';
|
82 |
|
|
WB_SUPPORT_BLOCK : integer := 1
|
83 |
|
|
);
|
84 |
|
|
|
85 |
|
|
|
86 |
|
|
port(
|
87 |
|
|
PLB2WB_IRQ : out std_logic;
|
88 |
|
|
|
89 |
|
|
-- WB Signals ---------------------------------------
|
90 |
|
|
wb_clk_i : in std_logic;
|
91 |
|
|
wb_rst_i : in std_logic;
|
92 |
|
|
wb_dat_i : in std_logic_vector( WB_DAT_W-1 downto 0 );
|
93 |
|
|
wb_dat_o : out std_logic_vector( WB_DAT_W-1 downto 0 );
|
94 |
|
|
wb_adr_o : out std_logic_vector( WB_ADR_W-1 downto 0 );
|
95 |
|
|
wb_sel_o : out std_logic_vector( WB_DAT_W/8-1 downto 0 );
|
96 |
|
|
wb_we_o : out std_logic;
|
97 |
|
|
wb_cyc_o : out std_logic;
|
98 |
|
|
wb_stb_o : out std_logic;
|
99 |
|
|
wb_ack_i : in std_logic;
|
100 |
|
|
wb_err_i : in std_logic;
|
101 |
|
|
wb_rty_i : in std_logic;
|
102 |
|
|
wb_lock_o : out std_logic;
|
103 |
|
|
|
104 |
|
|
wb_pic_int_i : in std_logic_vector( WB_PIC_INTS-1 downto 0 );
|
105 |
|
|
|
106 |
|
|
-- PLB Signals --------------------------------------
|
107 |
|
|
SPLB_Clk : in std_logic;
|
108 |
|
|
SPLB_Rst : in std_logic;
|
109 |
|
|
PLB_ABus : in std_logic_vector( 0 to 31 );
|
110 |
|
|
PLB_UABus : in std_logic_vector( 0 to 31 );
|
111 |
|
|
PLB_PAValid : in std_logic;
|
112 |
|
|
PLB_SAValid : in std_logic;
|
113 |
|
|
PLB_rdPrim : in std_logic;
|
114 |
|
|
PLB_wrPrim : in std_logic;
|
115 |
|
|
PLB_masterID : in std_logic_vector( 0 to C_SPLB_MID_WIDTH-1 );
|
116 |
|
|
PLB_abort : in std_logic;
|
117 |
|
|
PLB_busLock : in std_logic;
|
118 |
|
|
PLB_RNW : in std_logic;
|
119 |
|
|
PLB_BE : in std_logic_vector( 0 to C_SPLB_DWIDTH/8-1 );
|
120 |
|
|
PLB_MSize : in std_logic_vector( 0 to 1 );
|
121 |
|
|
PLB_size : in std_logic_vector( 0 to 3 );
|
122 |
|
|
PLB_type : in std_logic_vector( 0 to 2 );
|
123 |
|
|
PLB_lockErr : in std_logic;
|
124 |
|
|
PLB_wrDBus : in std_logic_vector( 0 to C_SPLB_DWIDTH-1 );
|
125 |
|
|
PLB_wrBurst : in std_logic;
|
126 |
|
|
PLB_rdBurst : in std_logic;
|
127 |
|
|
PLB_wrPendReq : in std_logic;
|
128 |
|
|
PLB_rdPendReq : in std_logic;
|
129 |
|
|
PLB_wrPendPri : in std_logic_vector( 0 to 1 );
|
130 |
|
|
PLB_rdPendPri : in std_logic_vector( 0 to 1 );
|
131 |
|
|
PLB_reqPri : in std_logic_vector( 0 to 1 );
|
132 |
|
|
PLB_TAttribute : in std_logic_vector( 0 to 15 );
|
133 |
|
|
Sl_addrAck : out std_logic;
|
134 |
|
|
Sl_SSize : out std_logic_vector( 0 to 1 );
|
135 |
|
|
Sl_wait : out std_logic;
|
136 |
|
|
Sl_rearbitrate : out std_logic;
|
137 |
|
|
Sl_wrDAck : out std_logic;
|
138 |
|
|
Sl_wrComp : out std_logic;
|
139 |
|
|
Sl_wrBTerm : out std_logic;
|
140 |
|
|
Sl_rdDBus : out std_logic_vector( 0 to C_SPLB_DWIDTH-1 );
|
141 |
|
|
Sl_rdWdAddr : out std_logic_vector( 0 to 3 );
|
142 |
|
|
Sl_rdDAck : out std_logic;
|
143 |
|
|
Sl_rdComp : out std_logic;
|
144 |
|
|
Sl_rdBTerm : out std_logic;
|
145 |
|
|
Sl_MBusy : out std_logic_vector( 0 to C_SPLB_NUM_MASTERS-1 );
|
146 |
|
|
Sl_MWrErr : out std_logic_vector( 0 to C_SPLB_NUM_MASTERS-1 );
|
147 |
|
|
Sl_MRdErr : out std_logic_vector( 0 to C_SPLB_NUM_MASTERS-1 );
|
148 |
|
|
Sl_MIRQ : out std_logic_vector( 0 to C_SPLB_NUM_MASTERS-1 )
|
149 |
|
|
|
150 |
|
|
);
|
151 |
|
|
|
152 |
|
|
|
153 |
|
|
end entity top;
|
154 |
|
|
|
155 |
|
|
|
156 |
|
|
architecture imp of top is
|
157 |
|
|
|
158 |
|
|
|
159 |
|
|
|
160 |
|
|
begin
|
161 |
|
|
|
162 |
|
|
bridge : entity plb2wb_bridge_v1_00_a.plb2wb_bridge(IMP)
|
163 |
|
|
generic map
|
164 |
|
|
(
|
165 |
|
|
SYNCHRONY => SYNCHRONY ,
|
166 |
|
|
|
167 |
|
|
C_BASEADDR => C_BASEADDR ,
|
168 |
|
|
C_HIGHADDR => C_HIGHADDR ,
|
169 |
|
|
C_STATUS_BASEADDR => C_STATUS_BASEADDR ,
|
170 |
|
|
C_STATUS_HIGHADDR => C_STATUS_HIGHADDR ,
|
171 |
|
|
C_SPLB_AWIDTH => C_SPLB_AWIDTH ,
|
172 |
|
|
C_SPLB_DWIDTH => C_SPLB_DWIDTH ,
|
173 |
|
|
C_SPLB_NUM_MASTERS => C_SPLB_NUM_MASTERS ,
|
174 |
|
|
C_SPLB_MID_WIDTH => C_SPLB_MID_WIDTH ,
|
175 |
|
|
C_SPLB_NATIVE_DWIDTH => C_SPLB_NATIVE_DWIDTH ,
|
176 |
|
|
C_SPLB_SUPPORT_BUR_LINE => C_SPLB_SUPPORT_BUR_LINE ,
|
177 |
|
|
C_SPLB_SUPPORT_ADR_PIPE => C_SPLB_SUPPORT_ADR_PIPE,
|
178 |
|
|
|
179 |
|
|
WB_DAT_W => WB_DAT_W ,
|
180 |
|
|
WB_ADR_W => WB_ADR_W ,
|
181 |
|
|
WB_TIMEOUT_CYCLES => WB_TIMEOUT_CYCLES ,
|
182 |
|
|
WB_ADR_OFFSET => WB_ADR_OFFSET ,
|
183 |
|
|
WB_ADR_OFFSET_NEG => WB_ADR_OFFSET_NEG ,
|
184 |
|
|
WB_PIC_INTS => WB_PIC_INTS ,
|
185 |
|
|
WB_PIC_INT_LEVEL => WB_PIC_INT_LEVEL ,
|
186 |
|
|
WB_SUPPORT_BLOCK => WB_SUPPORT_BLOCK
|
187 |
|
|
)
|
188 |
|
|
port map
|
189 |
|
|
(
|
190 |
|
|
|
191 |
|
|
PLB2WB_IRQ => PLB2WB_IRQ ,
|
192 |
|
|
|
193 |
|
|
wb_clk_i => wb_clk_i ,
|
194 |
|
|
wb_rst_i => wb_rst_i ,
|
195 |
|
|
wb_dat_i => wb_dat_i ,
|
196 |
|
|
wb_dat_o => wb_dat_o ,
|
197 |
|
|
wb_adr_o => wb_adr_o ,
|
198 |
|
|
wb_sel_o => wb_sel_o ,
|
199 |
|
|
wb_we_o => wb_we_o ,
|
200 |
|
|
wb_cyc_o => wb_cyc_o ,
|
201 |
|
|
wb_stb_o => wb_stb_o ,
|
202 |
|
|
wb_ack_i => wb_ack_i ,
|
203 |
|
|
wb_err_i => wb_err_i ,
|
204 |
|
|
wb_rty_i => wb_rty_i ,
|
205 |
|
|
wb_lock_o => wb_lock_o ,
|
206 |
|
|
|
207 |
|
|
wb_pic_int_i => wb_pic_int_i ,
|
208 |
|
|
|
209 |
|
|
SPLB_Clk => SPLB_Clk ,
|
210 |
|
|
SPLB_Rst => SPLB_Rst ,
|
211 |
|
|
PLB_ABus => PLB_ABus ,
|
212 |
|
|
PLB_UABus => PLB_UABus ,
|
213 |
|
|
PLB_PAValid => PLB_PAValid ,
|
214 |
|
|
PLB_SAValid => PLB_SAValid ,
|
215 |
|
|
PLB_rdPrim => PLB_rdPrim ,
|
216 |
|
|
PLB_wrPrim => PLB_wrPrim ,
|
217 |
|
|
PLB_masterID => PLB_masterID ,
|
218 |
|
|
PLB_abort => PLB_abort ,
|
219 |
|
|
PLB_busLock => PLB_busLock ,
|
220 |
|
|
PLB_RNW => PLB_RNW ,
|
221 |
|
|
PLB_BE => PLB_BE ,
|
222 |
|
|
PLB_MSize => PLB_MSize ,
|
223 |
|
|
PLB_size => PLB_size ,
|
224 |
|
|
PLB_type => PLB_type ,
|
225 |
|
|
PLB_lockErr => PLB_lockErr ,
|
226 |
|
|
PLB_wrDBus => PLB_wrDBus ,
|
227 |
|
|
PLB_wrBurst => PLB_wrBurst ,
|
228 |
|
|
PLB_rdBurst => PLB_rdBurst ,
|
229 |
|
|
PLB_wrPendReq => PLB_wrPendReq ,
|
230 |
|
|
PLB_rdPendReq => PLB_rdPendReq ,
|
231 |
|
|
PLB_wrPendPri => PLB_wrPendPri ,
|
232 |
|
|
PLB_rdPendPri => PLB_rdPendPri ,
|
233 |
|
|
PLB_reqPri => PLB_reqPri ,
|
234 |
|
|
PLB_TAttribute => PLB_TAttribute ,
|
235 |
|
|
Sl_addrAck => Sl_addrAck ,
|
236 |
|
|
Sl_SSize => Sl_SSize ,
|
237 |
|
|
Sl_wait => Sl_wait ,
|
238 |
|
|
Sl_rearbitrate => Sl_rearbitrate ,
|
239 |
|
|
Sl_wrDAck => Sl_wrDAck ,
|
240 |
|
|
Sl_wrComp => Sl_wrComp ,
|
241 |
|
|
Sl_wrBTerm => Sl_wrBTerm ,
|
242 |
|
|
Sl_rdDBus => Sl_rdDBus ,
|
243 |
|
|
Sl_rdWdAddr => Sl_rdWdAddr ,
|
244 |
|
|
Sl_rdDAck => Sl_rdDAck ,
|
245 |
|
|
Sl_rdComp => Sl_rdComp ,
|
246 |
|
|
Sl_rdBTerm => Sl_rdBTerm ,
|
247 |
|
|
Sl_MBusy => Sl_MBusy ,
|
248 |
|
|
Sl_MWrErr => Sl_MWrErr ,
|
249 |
|
|
Sl_MRdErr => Sl_MRdErr ,
|
250 |
|
|
Sl_MIRQ => Sl_MIRQ
|
251 |
|
|
);
|
252 |
|
|
|
253 |
|
|
|
254 |
|
|
|
255 |
|
|
|
256 |
|
|
|
257 |
|
|
|
258 |
|
|
|
259 |
|
|
|
260 |
|
|
|
261 |
|
|
end architecture imp;
|
262 |
|
|
|
263 |
|
|
|
264 |
|
|
|
265 |
|
|
|