OpenCores
URL https://opencores.org/ocsvn/i2s_interface/i2s_interface/trunk

Subversion Repositories i2s_interface

[/] [i2s_interface/] [trunk/] [bench/] [vhdl/] [tb_i2s.vhd] - Blame information for rev 26

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 16 gedra
----------------------------------------------------------------------
2
----                                                              ----
3
---- WISHBONE I2S Interface IP Core                               ----
4
----                                                              ----
5
---- This file is part of the I2S Interface project               ----
6
---- http://www.opencores.org/cores/i2s_interface/                ----
7
----                                                              ----
8
---- Description                                                  ----
9
---- I2S top level test bench. Two transmitters and two receivers ----
10
---- are instantiated, one each in slave and master mode.         ----
11
---- Test result is displayed in the log window, there should     ----
12
---- be no errors.                                                ----
13
----                                                              ----
14
---- To Do:                                                       ----
15
---- -                                                            ----
16
----                                                              ----
17
---- Author(s):                                                   ----
18
---- - Geir Drange, gedra@opencores.org                           ----
19
----                                                              ----
20
----------------------------------------------------------------------
21
----                                                              ----
22
---- Copyright (C) 2004 Authors and OPENCORES.ORG                 ----
23
----                                                              ----
24
---- This source file may be used and distributed without         ----
25
---- restriction provided that this copyright statement is not    ----
26
---- removed from the file and that any derivative work contains  ----
27
---- the original copyright notice and the associated disclaimer. ----
28
----                                                              ----
29
---- This source file is free software; you can redistribute it   ----
30
---- and/or modify it under the terms of the GNU General          ----
31
---- Public License as published by the Free Software Foundation; ----
32
---- either version 2.0 of the License, or (at your option) any   ----
33
---- later version.                                               ----
34
----                                                              ----
35
---- This source is distributed in the hope that it will be       ----
36
---- useful, but WITHOUT ANY WARRANTY; without even the implied   ----
37
---- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ----
38 19 gedra
---- PURPOSE. See the GNU General Public License for more details.----
39 16 gedra
----                                                              ----
40
---- You should have received a copy of the GNU General           ----
41
---- Public License along with this source; if not, download it   ----
42
---- from http://www.gnu.org/licenses/gpl.txt                     ----
43
----                                                              ----
44
----------------------------------------------------------------------
45
--
46
-- CVS Revision History
47
--
48
-- $Log: not supported by cvs2svn $
49 25 gedra
-- Revision 1.2  2004/08/07 12:33:29  gedra
50
-- De-linted.
51
--
52 19 gedra
-- Revision 1.1  2004/08/04 14:31:02  gedra
53
-- Top level test bench.
54 16 gedra
--
55
--
56 19 gedra
--
57 25 gedra
 
58 16 gedra
library ieee;
59
use ieee.std_logic_1164.all;
60
use ieee.numeric_std.all;
61
use work.wb_tb_pack.all;
62
 
63 25 gedra
entity tb_i2s is
64
 
65 16 gedra
end tb_i2s;
66
 
67
architecture behav of tb_i2s is
68
 
69 25 gedra
   component tx_i2s_topm
70
      generic (DATA_WIDTH : integer range 16 to 32;
71
               ADDR_WIDTH : integer range 5 to 32);
72
      port (
73
         -- Wishbone interface
74
         wb_clk_i  : in  std_logic;
75
         wb_rst_i  : in  std_logic;
76
         wb_sel_i  : in  std_logic;
77
         wb_stb_i  : in  std_logic;
78
         wb_we_i   : in  std_logic;
79
         wb_cyc_i  : in  std_logic;
80
         wb_bte_i  : in  std_logic_vector(1 downto 0);
81
         wb_cti_i  : in  std_logic_vector(2 downto 0);
82
         wb_adr_i  : in  std_logic_vector(ADDR_WIDTH - 1 downto 0);
83
         wb_dat_i  : in  std_logic_vector(DATA_WIDTH -1 downto 0);
84
         wb_ack_o  : out std_logic;
85
         wb_dat_o  : out std_logic_vector(DATA_WIDTH - 1 downto 0);
86
         -- Interrupt line
87
         tx_int_o  : out std_logic;
88
         -- I2S signals
89
         i2s_sd_o  : out std_logic;
90
         i2s_sck_o : out std_logic;
91
         i2s_ws_o  : out std_logic);
92
   end component;
93 16 gedra
 
94 25 gedra
   component tx_i2s_tops
95
      generic (DATA_WIDTH : integer range 16 to 32;
96
               ADDR_WIDTH : integer range 5 to 32);
97
      port (
98
         wb_clk_i  : in  std_logic;
99
         wb_rst_i  : in  std_logic;
100
         wb_sel_i  : in  std_logic;
101
         wb_stb_i  : in  std_logic;
102
         wb_we_i   : in  std_logic;
103
         wb_cyc_i  : in  std_logic;
104
         wb_bte_i  : in  std_logic_vector(1 downto 0);
105
         wb_cti_i  : in  std_logic_vector(2 downto 0);
106
         wb_adr_i  : in  std_logic_vector(ADDR_WIDTH - 1 downto 0);
107
         wb_dat_i  : in  std_logic_vector(DATA_WIDTH -1 downto 0);
108
         i2s_sck_i : in  std_logic;
109
         i2s_ws_i  : in  std_logic;
110
         wb_ack_o  : out std_logic;
111
         wb_dat_o  : out std_logic_vector(DATA_WIDTH - 1 downto 0);
112
         tx_int_o  : out std_logic;
113
         i2s_sd_o  : out std_logic);
114
   end component;
115 16 gedra
 
116 25 gedra
   component rx_i2s_topm
117
      generic (DATA_WIDTH : integer range 16 to 32;
118
               ADDR_WIDTH : integer range 5 to 32);
119
      port (
120
         wb_clk_i  : in  std_logic;
121
         wb_rst_i  : in  std_logic;
122
         wb_sel_i  : in  std_logic;
123
         wb_stb_i  : in  std_logic;
124
         wb_we_i   : in  std_logic;
125
         wb_cyc_i  : in  std_logic;
126
         wb_bte_i  : in  std_logic_vector(1 downto 0);
127
         wb_cti_i  : in  std_logic_vector(2 downto 0);
128
         wb_adr_i  : in  std_logic_vector(ADDR_WIDTH - 1 downto 0);
129
         wb_dat_i  : in  std_logic_vector(DATA_WIDTH -1 downto 0);
130
         i2s_sd_i  : in  std_logic;     -- I2S data input
131
         wb_ack_o  : out std_logic;
132
         wb_dat_o  : out std_logic_vector(DATA_WIDTH - 1 downto 0);
133
         rx_int_o  : out std_logic;     -- Interrupt line
134
         i2s_sck_o : out std_logic;     -- I2S clock out
135
         i2s_ws_o  : out std_logic);    -- I2S word select out
136
   end component;
137 16 gedra
 
138 25 gedra
   component rx_i2s_tops
139
      generic (DATA_WIDTH : integer range 16 to 32;
140
               ADDR_WIDTH : integer range 5 to 32);
141
      port (
142
         wb_clk_i  : in  std_logic;
143
         wb_rst_i  : in  std_logic;
144
         wb_sel_i  : in  std_logic;
145
         wb_stb_i  : in  std_logic;
146
         wb_we_i   : in  std_logic;
147
         wb_cyc_i  : in  std_logic;
148
         wb_bte_i  : in  std_logic_vector(1 downto 0);
149
         wb_cti_i  : in  std_logic_vector(2 downto 0);
150
         wb_adr_i  : in  std_logic_vector(ADDR_WIDTH - 1 downto 0);
151
         wb_dat_i  : in  std_logic_vector(DATA_WIDTH -1 downto 0);
152
         i2s_sd_i  : in  std_logic;     -- I2S data input
153
         i2s_sck_i : in  std_logic;     -- I2S clock input
154
         i2s_ws_i  : in  std_logic;     -- I2S word select input
155
         wb_ack_o  : out std_logic;
156
         wb_dat_o  : out std_logic_vector(DATA_WIDTH - 1 downto 0);
157
         rx_int_o  : out std_logic);    -- Interrupt line
158
   end component;
159
 
160
   signal wb_clk_o, wb_rst_o, wb_sel_o, wb_stb_o, wb_we_o        : std_logic;
161
   signal wb_cyc_o, wb_ack_i, rx1_int_o                          : std_logic;
162
   signal tx_int_o, tx1_ack, rx1_ack, tx2_ack, rx2_ack           : std_logic;
163
   signal rx2_int_o, tx1_int_o, tx2_int_o                        : std_logic;
164
   signal wb_bte_o                                               : std_logic_vector(1 downto 0);
165
   signal wb_cti_o                                               : std_logic_vector(2 downto 0);
166
   signal wb_adr_o                                               : std_logic_vector(15 downto 0);
167
   signal wb_dat_i, wb_dat_o, rx1_dat_i                          : std_logic_vector(31 downto 0);
168
   signal tx1_dat_i, rx2_dat_i, tx2_dat_i                        : std_logic_vector(31 downto 0);
169
   signal wb_stb_32bit_rx1, wb_stb_32bit_tx1                     : std_logic;
170
   signal wb_stb_32bit_rx2, wb_stb_32bit_tx2                     : std_logic;
171
   signal i2s_sd1, i2s_sd2, i2s_sck1, i2s_sck2, i2s_ws1, i2s_ws2 : std_logic;
172
   -- register address definitions
173
   constant RX1_VERSION                                          : natural := 16#1000#;
174
   constant RX1_CONFIG                                           : natural := 16#1001#;
175
   constant RX1_INTMASK                                          : natural := 16#1002#;
176
   constant RX1_INTSTAT                                          : natural := 16#1003#;
177
   constant RX1_BUF_BASE                                         : natural := 16#1020#;
178
   constant TX1_VERSION                                          : natural := 16#2000#;
179
   constant TX1_CONFIG                                           : natural := 16#2001#;
180
   constant TX1_INTMASK                                          : natural := 16#2002#;
181
   constant TX1_INTSTAT                                          : natural := 16#2003#;
182
   constant TX1_BUF_BASE                                         : natural := 16#2020#;
183
   constant RX2_VERSION                                          : natural := 16#3000#;
184
   constant RX2_CONFIG                                           : natural := 16#3001#;
185
   constant RX2_INTMASK                                          : natural := 16#3002#;
186
   constant RX2_INTSTAT                                          : natural := 16#3003#;
187
   constant RX2_BUF_BASE                                         : natural := 16#3020#;
188
   constant TX2_VERSION                                          : natural := 16#4000#;
189
   constant TX2_CONFIG                                           : natural := 16#4001#;
190
   constant TX2_INTMASK                                          : natural := 16#4002#;
191
   constant TX2_INTSTAT                                          : natural := 16#4003#;
192
   constant TX2_BUF_BASE                                         : natural := 16#4020#;
193
 
194 16 gedra
begin
195
 
196 25 gedra
   wb_ack_i <= rx1_ack or tx1_ack or rx2_ack or tx2_ack;
197
   wb_dat_i <= rx1_dat_i when wb_stb_32bit_rx1 = '1'
198
               else tx1_dat_i when wb_stb_32bit_tx1 = '1'
199
               else rx2_dat_i when wb_stb_32bit_rx2 = '1'
200
               else tx2_dat_i when wb_stb_32bit_tx2 = '1'
201
               else (others => '0');
202 16 gedra
 
203
-- I2S transmitter 1, slave mode
204 25 gedra
   ITX32S : tx_i2s_tops
205
      generic map (DATA_WIDTH => 32,
206
                   ADDR_WIDTH => 6)
207
      port map (
208
         -- Wishbone interface
209
         wb_clk_i  => wb_clk_o,
210
         wb_rst_i  => wb_rst_o,
211
         wb_sel_i  => wb_sel_o,
212
         wb_stb_i  => wb_stb_32bit_tx1,
213
         wb_we_i   => wb_we_o,
214
         wb_cyc_i  => wb_cyc_o,
215
         wb_bte_i  => wb_bte_o,
216
         wb_cti_i  => wb_cti_o,
217
         wb_adr_i  => wb_adr_o(5 downto 0),
218
         wb_dat_i  => wb_dat_o(31 downto 0),
219
         wb_ack_o  => tx1_ack,
220
         wb_dat_o  => tx1_dat_i,
221
         tx_int_o  => tx1_int_o,
222
         i2s_sd_o  => i2s_sd1,
223
         i2s_sck_i => i2s_sck1,
224
         i2s_ws_i  => i2s_ws1);
225 16 gedra
 
226
-- I2S transmitter 2, master mode
227 25 gedra
   ITX32M : tx_i2s_topm
228
      generic map (DATA_WIDTH => 32,
229
                   ADDR_WIDTH => 6)
230
      port map (
231
         -- Wishbone interface
232
         wb_clk_i  => wb_clk_o,
233
         wb_rst_i  => wb_rst_o,
234
         wb_sel_i  => wb_sel_o,
235
         wb_stb_i  => wb_stb_32bit_tx2,
236
         wb_we_i   => wb_we_o,
237
         wb_cyc_i  => wb_cyc_o,
238
         wb_bte_i  => wb_bte_o,
239
         wb_cti_i  => wb_cti_o,
240
         wb_adr_i  => wb_adr_o(5 downto 0),
241
         wb_dat_i  => wb_dat_o(31 downto 0),
242
         wb_ack_o  => tx2_ack,
243
         wb_dat_o  => tx2_dat_i,
244
         tx_int_o  => tx2_int_o,
245
         i2s_sd_o  => i2s_sd2,
246
         i2s_sck_o => i2s_sck2,
247
         i2s_ws_o  => i2s_ws2);
248 16 gedra
 
249
-- I2S receiver 1, master mode
250 25 gedra
   IRX32M : rx_i2s_topm
251
      generic map (DATA_WIDTH => 32,
252
                   ADDR_WIDTH => 6)
253
      port map (
254
         -- Wishbone interface
255
         wb_clk_i  => wb_clk_o,
256
         wb_rst_i  => wb_rst_o,
257
         wb_sel_i  => wb_sel_o,
258
         wb_stb_i  => wb_stb_32bit_rx1,
259
         wb_we_i   => wb_we_o,
260
         wb_cyc_i  => wb_cyc_o,
261
         wb_bte_i  => wb_bte_o,
262
         wb_cti_i  => wb_cti_o,
263
         wb_adr_i  => wb_adr_o(5 downto 0),
264
         wb_dat_i  => wb_dat_o(31 downto 0),
265
         i2s_sd_i  => i2s_sd1,
266
         wb_ack_o  => rx1_ack,
267
         wb_dat_o  => rx1_dat_i,
268
         rx_int_o  => rx1_int_o,
269
         i2s_sck_o => i2s_sck1,
270
         i2s_ws_o  => i2s_ws1);
271 16 gedra
 
272
-- I2S receiver 2, slave mode
273 25 gedra
   IRX32S : rx_i2s_tops
274
      generic map (DATA_WIDTH => 32,
275
                   ADDR_WIDTH => 6)
276
      port map (
277
         -- Wishbone interface
278
         wb_clk_i  => wb_clk_o,
279
         wb_rst_i  => wb_rst_o,
280
         wb_sel_i  => wb_sel_o,
281
         wb_stb_i  => wb_stb_32bit_rx2,
282
         wb_we_i   => wb_we_o,
283
         wb_cyc_i  => wb_cyc_o,
284
         wb_bte_i  => wb_bte_o,
285
         wb_cti_i  => wb_cti_o,
286
         wb_adr_i  => wb_adr_o(5 downto 0),
287
         wb_dat_i  => wb_dat_o(31 downto 0),
288
         i2s_sd_i  => i2s_sd2,
289
         i2s_sck_i => i2s_sck2,
290
         i2s_ws_i  => i2s_ws2,
291
         wb_ack_o  => rx2_ack,
292
         wb_dat_o  => rx2_dat_i,
293
         rx_int_o  => rx2_int_o);
294
 
295 16 gedra
-- Main test process
296 25 gedra
   MAIN : process
297
      variable read_32bit : std_logic_vector(31 downto 0);
298
      variable idx        : integer;
299 16 gedra
 
300 25 gedra
      -- Make simplified versions of procedures in wb_tb_pack
301
      procedure wb_write_32 (
302
         constant ADDRESS : in natural;
303
         constant DATA    : in natural) is
304
      begin
305
         wb_write(ADDRESS, DATA, wb_adr_o, wb_dat_o(31 downto 0), wb_cyc_o,
306
                  wb_sel_o, wb_we_o, wb_clk_o, wb_ack_i);
307
      end;
308
 
309
      procedure wb_check_32 (
310
         constant ADDRESS  : in natural;
311
         constant EXP_DATA : in natural) is
312
      begin
313
         wb_check(ADDRESS, EXP_DATA, wb_adr_o, wb_dat_i(31 downto 0), wb_cyc_o,
314
                  wb_sel_o, wb_we_o, wb_clk_o, wb_ack_i);
315
      end;
316
 
317
      procedure wb_read_32 (
318
         constant ADDRESS : in natural) is
319
      begin
320
         wb_read(ADDRESS, read_32bit, wb_adr_o, wb_dat_i(31 downto 0), wb_cyc_o,
321
                 wb_sel_o, wb_we_o, wb_clk_o, wb_ack_i);
322
      end;
323
 
324
   begin
325
      message("Simulation start with system reset.");
326
      wb_rst_o <= '1';                  -- system reset
327
      wb_sel_o <= '0';
328
      wb_stb_o <= '0';
329
      wb_sel_o <= '0';
330
      wb_we_o  <= '0';
331
      wb_cyc_o <= '0';
332
      wb_bte_o <= "00";
333
      wb_cti_o <= "000";
334
      wb_adr_o <= (others => '0');
335
      wb_dat_o <= (others => '0');
336
      wait for 200 ns;
337
      wb_rst_o <= '0';
338
      message("Check receiver version registers:");
339
      wb_check_32(RX1_VERSION, 16#000001b1#);
340
      wb_check_32(RX2_VERSION, 16#00000191#);
341
      message("Check transmitter version registers:");
342
      wb_check_32(TX1_VERSION, 16#00000191#);
343
      wb_check_32(TX2_VERSION, 16#000001b1#);
344
      message("Fill up sample buffers with test signal, ");
345
      message("ramp up in left, ramp down in right:");
346
      SGEN : for i in 0 to 15 loop
347
         wb_write_32(TX1_BUF_BASE + 2*i, (32768 + i*497)*256);      -- left
348
         wb_write_32(TX1_BUF_BASE + 2*i + 1, (32767 - i*497)*256);  -- right
349
         wb_write_32(TX2_BUF_BASE + 2*i, (32767 - i*497)*16);       -- left
350
         wb_write_32(TX2_BUF_BASE + 2*i + 1, (32768 + i*497)*16);   --right
351
      end loop;
352
      message("*** Test of master TX and slave RX ***");
353
      message("Enable transmitter 2:");
354
      wb_write_32(TX2_INTMASK, 16#00000003#);  -- enable interrupts
355
      wb_write_32(TX2_CONFIG, 16#00140703#);   -- 20bit resolution
356
      message("Enable recevier 2:");
357
      wb_write_32(RX2_INTMASK, 16#00000003#);  -- enable interrupts
358
      wb_write_32(RX2_CONFIG, 16#00180003#);   -- 24bit resolution
359
      wait_for_event("Wait for transmitter 2 LSBF interrupt", 150 us, tx2_int_o);
360
      wait for 1 us;
361
      message("Check for receiver LSBF interrupt:");
362
      wb_check_32(RX2_INTSTAT, 16#00000001#);
363
      message("Clear transmitter LSBF interrupt:");
364
      wb_write_32(TX2_INTSTAT, 16#00000001#);
365
      wb_check_32(TX2_INTSTAT, 16#00000000#);
366
      signal_check("tx2_int_o", '0', tx2_int_o);
367
      message("Clear receiver LSBF interrupt:");
368
      wb_write_32(RX2_INTSTAT, 16#00000001#);
369
      wb_check_32(RX2_INTSTAT, 16#00000000#);
370
      signal_check("rx2_int_o", '0', rx2_int_o);
371
      message("Check received data, lower sample buffer:");
372
      wb_read_32(RX2_BUF_BASE);
373
      -- calculate which index this word was generated with
374
      idx := (32767 - to_integer(unsigned(read_32bit(31 downto 8)))) / 497;
375
      -- then check for correct values
376
      CHKL : for i in 0 to 7 - idx loop
377
         wb_check_32(RX2_BUF_BASE + 2*i, (32767 - (i+idx)*497)*256);
378
         wb_check_32(RX2_BUF_BASE + 2*i + 1, (32768 + (i+idx)*497)*256);
379
      end loop;
380
      wait_for_event("Wait for transmitter 2 HSBF interrupt", 150 us, tx2_int_o);
381
      wait for 1 us;
382
      message("Check for receiver LSBF interrupt:");
383
      wb_check_32(RX2_INTSTAT, 16#00000002#);
384
      message("Clear transmitter HSBF interrupt:");
385
      wb_write_32(TX2_INTSTAT, 16#00000002#);
386
      wb_check_32(TX2_INTSTAT, 16#00000000#);
387
      signal_check("tx2_int_o", '0', tx2_int_o);
388
      message("Clear receiver HSBF interrupt:");
389
      wb_write_32(RX2_INTSTAT, 16#00000002#);
390
      wb_check_32(RX2_INTSTAT, 16#00000000#);
391
      signal_check("rx2_int_o", '0', rx2_int_o);
392
      message("Check received data, upper sample buffer:");
393
      CHKH : for i in 8 - idx to 15 - idx loop
394
         wb_check_32(RX2_BUF_BASE + 2*i, (32767 - (i+idx)*497)*256);
395
         wb_check_32(RX2_BUF_BASE + 2*i + 1, (32768 + (i+idx)*497)*256);
396
      end loop;
397 16 gedra
 
398 25 gedra
      message("*** Test of slave TX and master RX ***");
399
      message("Enable transmitter 1:");
400
      wb_write_32(TX1_INTMASK, 16#00000003#);  -- enable interrupts
401
      wb_write_32(TX1_CONFIG, 16#00180007#);   -- 24bit resolution
402
      message("Enable recevier 1:");
403
      wb_write_32(RX1_INTMASK, 16#00000003#);  -- enable interrupts
404
      wb_write_32(RX1_CONFIG, 16#00100707#);   -- 16bit resolution          
405
      wait_for_event("Wait for transmitter 1 LSBF interrupt", 150 us, tx1_int_o);
406
      message("Clear LSBF interrupt:");
407
      wb_write_32(TX1_INTSTAT, 16#00000001#);
408
      wb_check_32(TX1_INTSTAT, 16#00000000#);
409
      signal_check("tx1_int_o", '0', tx1_int_o);
410
      wait_for_event("Wait for recevier 1 LSBF interrupt", 150 us, rx1_int_o);
411
      message("Clear LSBF interrupt:");
412
      wb_write_32(RX1_INTSTAT, 16#00000001#);
413
      wb_check_32(RX1_INTSTAT, 16#00000000#);
414
      signal_check("rx1_int_o", '0', rx1_int_o);
415
      message("Check received data (#1), lower sample buffer:");
416
      wb_read_32(RX1_BUF_BASE);
417
      -- calculate which index this word was generated with
418
      idx := (32767 - to_integer(unsigned(read_32bit(15 downto 0)))) / 497;
419
      -- then check for correct values
420
      CHKL1 : for i in 0 to 7 - idx loop
421
         wb_check_32(RX1_BUF_BASE + 2*i, 32768 + (i+idx)*497);
422
         wb_check_32(RX1_BUF_BASE + 2*i + 1, 32767 - (i+idx)*497);
423
      end loop;
424
      wait_for_event("Wait for transmitter 1 HSBF interrupt", 150 us, tx1_int_o);
425
      message("Clear HSBF interrupt:");
426
      wb_write_32(TX1_INTSTAT, 16#00000002#);
427
      wb_check_32(TX1_INTSTAT, 16#00000000#);
428
      signal_check("tx1_int_o", '0', tx1_int_o);
429
      wait_for_event("Wait for recevier 1 HSBF interrupt", 150 us, rx1_int_o);
430
      message("Clear HSBF interrupt:");
431
      wb_write_32(RX1_INTSTAT, 16#00000002#);
432
      wb_check_32(RX1_INTSTAT, 16#00000000#);
433
      signal_check("rx1_int_o", '0', rx1_int_o);
434
      message("Check received data (#1), higher sample buffer:");
435
      CHKH1 : for i in 8 - idx to 15 - idx loop
436
         wb_check_32(RX1_BUF_BASE + 2*i, 32768 + (i+idx)*497);
437
         wb_check_32(RX1_BUF_BASE + 2*i + 1, 32767 - (i+idx)*497);
438
      end loop;
439
 
440
      sim_report("");
441
      report "End of simulation! (ignore this failure)"
442
         severity failure;
443
      wait;
444
   end process MAIN;
445
 
446 16 gedra
-- Bus strobe generator based on address. 32bit recevier mapped to addr. 0x1000
447
-- 32bit transmitter mapped to address 0x2000
448 25 gedra
   wb_stb_32bit_rx1 <= '1' when wb_adr_o(15 downto 12) = "0001" else '0';
449
   wb_stb_32bit_tx1 <= '1' when wb_adr_o(15 downto 12) = "0010" else '0';
450
   wb_stb_32bit_rx2 <= '1' when wb_adr_o(15 downto 12) = "0011" else '0';
451
   wb_stb_32bit_tx2 <= '1' when wb_adr_o(15 downto 12) = "0100" else '0';
452
 
453 16 gedra
-- Clock process, 50Mhz Wishbone master freq.
454 25 gedra
   CLKGEN : process
455
   begin
456
      wb_clk_o <= '0';
457
      wait for 10 ns;
458
      wb_clk_o <= '1';
459
      wait for 10 ns;
460
   end process CLKGEN;
461
 
462 16 gedra
end behav;
463
 
464
 
465
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.