Documentation for architecture MROD_X_Out/Sharc/a0
VHDL Contents
1 architecture a0 of Sharc is
56 constant Tdhbgo: Time := 9 ns;
59
60 constant Tdaddo: Time := 10 ns;
62
63 constant Tddato: Time := 12500 ps;
65
66 constant Tdrwl: Time := Tcclk/4 + 9000 ps;
68
69 constant Thaddo: Time := 1500 ps;
71
72 constant Thdato: Time := 1500 ps;
74
75 constant Tdrdo: Time := Tcclk/4 - 1000 ps;
79
80 constant Tdwro: Time := Tcclk/4 - 1000 ps;
84
85 constant Tdrdyrdl: Time := 10 ns;
87
88 constant Tsdatrdy: Time := 2 ns;
90
91 constant Thdarwh: Time := 2 ns;
93
94 Signal DataCyclePending: Std_logic := '0';
95 begin
96
97 HBRequest:
98 Process (Sharc_Clk, Rst_n)
99 Begin
100 If Rst_n = '0' Then
101 hbg_n <= '1';
102 ElsIf Sharc_Clk = '1' And Sharc_Clk'Event Then
103 hbg_n <= hbr_n After tdhbgo;
104 End If;
105 End Process;
106
107 REDY_Generation:
108 process (wr_n, rd_n, cs_n, Rst_n)
109 begin
110 If Rst_n = '0' Then
111 redy <= '0';
112 ElsIf ((cs_n = '0' and wr_n = '0' and wr_n'event) or
113 (cs_n = '0' and rd_n = '0' and rd_n'event)) then
114 redy <= TRANSPORT '0' after Tdrdyrdl, '1' AFTER Tdrdyrdl + tredy;
115 end if;
116 end process;
117
118 MS_Cycles:
119 process (Sharc_Clk, hbg_n, cs_n, rd_n, Rst_n)
120 Variable MS0_Busy: natural := 0;
121 Variable MS1_Busy: natural := 0;
122 Variable MS2_Busy: natural := 0;
123 Variable MS3_Busy: natural := 0;
124
125 Variable WaitCycle: integer := -1;
126 Variable HoldCycle: integer := -1;
127 Begin
128 If Rst_n = '0' Then
129 rd_n <= 'Z' after Tdrdo;
130 wr_n <= 'Z' after Tdwro;
131 MS0_n <= 'Z' after Thaddo;
132 MS1_n <= 'Z' after Thaddo;
133 MS2_n <= 'Z' after Thaddo;
134 MS3_n <= 'Z' after Thaddo;
135 adr <= (others => 'Z') after Thaddo;
136 Data <= (others => 'Z') after Thdato;
137 ElsIf hbg_n = '1' Then
138 If Sharc_Clk'Event And Sharc_Clk= '1' Then
139
140 If (((MS0_Busy = 1) And (MS0_Ack = False)) Or
143 ((MS1_Busy = 1) And (MS1_Ack = False)) Or
144 ((MS2_Busy = 1) And (MS2_Ack = False)) Or
145 ((MS3_Busy = 1) And (MS3_Ack = False))) then
146 waitcycle := waitcycle + 1;
147 If ((MS0_Busy = 1) And (WaitCycle >= MS0_Wait)) Or
148 ((MS1_Busy = 1) And (WaitCycle >= MS1_Wait)) Or
149 ((MS2_Busy = 1) And (WaitCycle >= MS2_Wait)) Or
150 ((MS3_Busy = 1) And (WaitCycle >= MS3_Wait)) Then
151 HoldCycle := HoldCycle + 1;
152 End If;
153 end if;
154
155 if (((MS0_Busy = 1) And (MS0_Ack = False) AND (waitcycle >= MS0_Wait)) Or
157 ((MS1_Busy = 1) And (MS1_Ack = False) AND (waitcycle >= MS1_Wait)) Or
158 ((MS2_Busy = 1) And (MS2_Ack = False) AND (waitcycle >= MS2_Wait)) Or
159 ((MS3_Busy = 1) And (MS3_Ack = False) AND (waitcycle >= MS3_Wait))) then
160 rd_n <= '1' after Tdrdo;
161 wr_n <= '1' after Tdwro;
162 end if;
163
164 If (((MS0_Busy = 1) And
166 (((MS0_Ack = False) AND (WaitCycle >= MS0_Wait) And (HoldCycle >= MS0_Hold)) Or
167 ((MS0_Ack = True) AND ((Ack = '1') OR (Ack = 'H'))))) Or
168 ((MS1_Busy = 1) And
169 (((MS1_Ack = False) AND (WaitCycle >= MS1_Wait) And (HoldCycle >= MS1_Hold)) Or
170 ((MS1_Ack = True) AND ((Ack = '1') OR (Ack = 'H'))))) Or
171 ((MS2_Busy = 1) And
172 (((MS2_Ack = False) AND (WaitCycle >= MS2_Wait) And (HoldCycle >= MS2_Hold)) Or
173 ((MS2_Ack = True) AND ((Ack = '1') OR (Ack = 'H'))))) Or
174 ((MS3_Busy = 1) And
175 (((MS3_Ack = False) AND (WaitCycle >= MS3_Wait) And (HoldCycle >= MS3_Hold)) Or
176 ((MS3_Ack = True) AND ((Ack = '1') OR (Ack = 'H')))))) Then
177 MS0_Busy := 0;
178 MS1_Busy := 0;
179 MS2_Busy := 0;
180 MS3_Busy := 0;
181 rd_n <= Transport 'Z' after Tdrdo;
182 wr_n <= Transport 'Z' after Tdwro;
183 MS0_n <= Transport 'Z' after Thaddo;
184 MS1_n <= Transport 'Z' after Thaddo;
185 MS2_n <= Transport 'Z' after Thaddo;
186 MS3_n <= Transport 'Z' after Thaddo;
187 adr <= Transport (others => 'Z') after Thaddo;
188 Data <= Transport (others => 'Z') after Thdato;
189 End If;
190
191 If Rd_MS0 = '1' then
193 ASSERT Not((MS0_Busy = 1) Or (MS1_Busy = 1) Or (MS2_Busy = 1) Or (MS3_Busy = 1)) Report LF & "Cycle not complete yet, starting a new one." severity NOTE;
194 MS0_Busy := 1;
195 MS1_Busy := 0;
196 MS2_Busy := 0;
197 MS3_Busy := 0;
198 WaitCycle := -1;
199 HoldCycle := -1;
200 adr(Adr_Width-1 downto 0) <= A_I(Adr_Width-1 downto 0) after Tdaddo;
201 Data <= Transport (others => 'Z') after Tddato;
202 rd_n <= Transport '0' after Tdrwl;
203 Wr_n <= Transport '1' after Tdrwl;
204 ms0_n <= Transport '0' after Tdaddo;
205 ms1_n <= Transport '1' after Tdaddo;
206 ms2_n <= Transport '1' after Tdaddo;
207 ms3_n <= Transport '1' after Tdaddo;
208 ElsIf Wr_MS0 = '1' then
209 ASSERT Not((MS0_Busy = 1) Or (MS1_Busy = 1) Or (MS2_Busy = 1) Or (MS3_Busy = 1)) Report LF & "Cycle not complete yet, starting a new one." severity NOTE;
210 MS0_Busy := 1;
211 MS1_Busy := 0;
212 MS2_Busy := 0;
213 MS3_Busy := 0;
214 WaitCycle := -1;
215 HoldCycle := -1;
216 adr(Adr_Width-1 downto 0) <= A_I(Adr_Width-1 downto 0) after Tdaddo;
217 Data <= Transport D_I after Tddato;
218 rd_n <= Transport '1' after Tdrwl;
219 Wr_n <= Transport '0' after Tdrwl;
220 ms0_n <= Transport '0' after Tdaddo;
221 ms1_n <= Transport '1' after Tdaddo;
222 ms2_n <= Transport '1' after Tdaddo;
223 ms3_n <= Transport '1' after Tdaddo;
224 ElsIf Rd_MS1 = '1' then
225 ASSERT Not((MS0_Busy = 1) Or (MS1_Busy = 1) Or (MS2_Busy = 1) Or (MS3_Busy = 1)) Report LF & "Cycle not complete yet, starting a new one." severity NOTE;
226 MS0_Busy := 0;
227 MS1_Busy := 1;
228 MS2_Busy := 0;
229 MS3_Busy := 0;
230 WaitCycle := -1;
231 HoldCycle := -1;
232 adr(Adr_Width-1 downto 0) <= A_I(Adr_Width-1 downto 0) after Tdaddo;
233 Data <= Transport (others => 'Z') after Tddato;
234 rd_n <= Transport '0' after Tdrwl;
235 Wr_n <= Transport '1' after Tdrwl;
236 ms0_n <= Transport '1' after Tdaddo;
237 ms1_n <= Transport '0' after Tdaddo;
238 ms2_n <= Transport '1' after Tdaddo;
239 ms3_n <= Transport '1' after Tdaddo;
240 ElsIf Wr_MS1 = '1' then
241 ASSERT Not((MS0_Busy = 1) Or (MS1_Busy = 1) Or (MS2_Busy = 1) Or (MS3_Busy = 1)) Report LF & "Cycle not complete yet, starting a new one." severity NOTE;
242 MS0_Busy := 0;
243 MS1_Busy := 1;
244 MS2_Busy := 0;
245 MS3_Busy := 0;
246 WaitCycle := -1;
247 HoldCycle := -1;
248 adr(Adr_Width-1 downto 0) <= A_I(Adr_Width-1 downto 0) after Tdaddo;
249 Data <= Transport D_I after Tddato;
250 rd_n <= Transport '1' after Tdrwl;
251 Wr_n <= Transport '0' after Tdrwl;
252 ms0_n <= Transport '1' after Tdaddo;
253 ms1_n <= Transport '0' after Tdaddo;
254 ms2_n <= Transport '1' after Tdaddo;
255 ms3_n <= Transport '1' after Tdaddo;
256 ElsIf Rd_MS2 = '1' then
257 ASSERT Not((MS0_Busy = 1) Or (MS1_Busy = 1) Or (MS2_Busy = 1) Or (MS3_Busy = 1)) Report LF & "Cycle not complete yet, starting a new one." severity NOTE;
258 MS0_Busy := 0;
259 MS1_Busy := 0;
260 MS2_Busy := 1;
261 MS3_Busy := 0;
262 WaitCycle := -1;
263 HoldCycle := -1;
264 adr(Adr_Width-1 downto 0) <= A_I(Adr_Width-1 downto 0) after Tdaddo;
265 Data <= Transport (others => 'Z') after Tddato;
266 rd_n <= Transport '0' after Tdrwl;
267 Wr_n <= Transport '1' after Tdrwl;
268 ms0_n <= Transport '1' after Tdaddo;
269 ms1_n <= Transport '1' after Tdaddo;
270 ms2_n <= Transport '0' after Tdaddo;
271 ms3_n <= Transport '1' after Tdaddo;
272 ElsIf Wr_MS2 = '1' then
273 ASSERT Not((MS0_Busy = 1) Or (MS1_Busy = 1) Or (MS2_Busy = 1) Or (MS3_Busy = 1)) Report LF & "Cycle not complete yet, starting a new one." severity NOTE;
274 MS0_Busy := 0;
275 MS1_Busy := 0;
276 MS2_Busy := 1;
277 MS3_Busy := 0;
278 WaitCycle := -1;
279 HoldCycle := -1;
280 adr(Adr_Width-1 downto 0) <= A_I(Adr_Width-1 downto 0) after Tdaddo;
281 Data <= Transport D_I after Tddato;
282 rd_n <= Transport '1' after Tdrwl;
283 Wr_n <= Transport '0' after Tdrwl;
284 ms0_n <= Transport '1' after Tdaddo;
285 ms1_n <= Transport '1' after Tdaddo;
286 ms2_n <= Transport '0' after Tdaddo;
287 ms3_n <= Transport '1' after Tdaddo;
288 ElsIf Rd_MS3 = '1' then
289 ASSERT Not((MS0_Busy = 1) Or (MS1_Busy = 1) Or (MS2_Busy = 1) Or (MS3_Busy = 1)) Report LF & "Cycle not complete yet, starting a new one." severity NOTE;
290 MS0_Busy := 0;
291 MS1_Busy := 0;
292 MS2_Busy := 0;
293 MS3_Busy := 1;
294 WaitCycle := -1;
295 HoldCycle := -1;
296 adr(Adr_Width-1 downto 0) <= A_I(Adr_Width-1 downto 0) after Tdaddo;
297 Data <= Transport (others => 'Z') after Tddato;
298 rd_n <= Transport '0' after Tdrwl;
299 Wr_n <= Transport '1' after Tdrwl;
300 ms0_n <= Transport '1' after Tdaddo;
301 ms1_n <= Transport '1' after Tdaddo;
302 ms2_n <= Transport '1' after Tdaddo;
303 ms3_n <= Transport '0' after Tdaddo;
304 ElsIf Wr_MS3 = '1' then
305 ASSERT Not((MS0_Busy = 1) Or (MS1_Busy = 1) Or (MS2_Busy = 1) Or (MS3_Busy = 1)) Report LF & "Cycle not complete yet, starting a new one." severity NOTE;
306 MS0_Busy := 0;
307 MS1_Busy := 0;
308 MS2_Busy := 0;
309 MS3_Busy := 1;
310 WaitCycle := -1;
311 HoldCycle := -1;
312 adr(Adr_Width-1 downto 0) <= A_I(Adr_Width-1 downto 0) after Tdaddo;
313 Data <= Transport D_I after Tddato;
314 rd_n <= Transport '1' after Tdrwl;
315 Wr_n <= Transport '0' after Tdrwl;
316 ms0_n <= Transport '1' after Tdaddo;
317 ms1_n <= Transport '1' after Tdaddo;
318 ms2_n <= Transport '1' after Tdaddo;
319 ms3_n <= Transport '0' after Tdaddo;
320 End If;
321 end if;
322 Else
323 If CS_n = '0' Then
327 If (rd_n = '0' and rd_n'event) Then
328 Data <= D_I after (Tdrdyrdl - Tsdatrdy + Tredy);
331 DataCyclePending <= '1' after (Tdrdyrdl - Tsdatrdy + Tredy);
332 ElsIf (rd_n = '1' and rd_n'event) Then
333 Data <= (others => 'Z') after Thdarwh;
334 DataCyclePending <= '0' after Thdarwh;
335 end if;
336 ElsIf (CS_n = '1' and CS_n'event) Then
338 Data <= (others => 'Z') after Thdarwh;
339 DataCyclePending <= '0' after Thdarwh;
340 Else
342 ms0_n <= 'Z' after Thaddo;
343 ms1_n <= 'Z' after Thaddo;
344 ms2_n <= 'Z' after Thaddo;
345 ms3_n <= 'Z' after Thaddo;
346 adr <= (others => 'Z') after Thaddo;
347 rd_n <= 'Z' after Tdrdo;
348 wr_n <= 'Z' after Tdwro;
349 If DataCyclePending = '0' Then
350 Data <= (others => 'Z') after Thdato;
351 End If;
352 End If;
353 end if;
354 end process;
355 end architecture a0 ;