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

Subversion Repositories modular_oscilloscope

[/] [modular_oscilloscope/] [trunk/] [hdl/] [tbench/] [modullar_oscilloscope_tbench_text.vhd] - Blame information for rev 55

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 53 budinero
-------------------------------------------------------------------------------------------------100
2
--| Modular Oscilloscope
3
--| UNSL - Argentine
4
--|
5
--| File: modullar_oscilloscope_tbench_text.vhd
6
--| Version: 0.1
7
--| Tested in: Actel A3PE1500
8
--|   Board: RVI Prototype Board + LP Data Conversion Daughter Board
9
--|-------------------------------------------------------------------------------------------------
10
--| Description:
11
--|   This file is only for test purposes. 
12
--|
13
--|-------------------------------------------------------------------------------------------------
14
--| File history:
15
--|   0.1   | aug-2009 | First release
16
----------------------------------------------------------------------------------------------------
17 54 budinero
--| Copyright © 2009, Facundo Aguilera (budinero at gmail.com.
18 53 budinero
--|
19
--| This VHDL design file is an open design; you can redistribute it and/or
20
--| modify it and/or implement it after contacting the author.
21
----------------------------------------------------------------------------------------------------
22
 
23
--==================================================================================================
24
-- TO DO
25
-- · Full full test
26
--==================================================================================================
27
 
28 54 budinero
-- NOTES
29
-- · Board clock freq = 25 MHz
30
-- · PLL clocks: clk_epp freq = 10 MHz, clk_epp freq = 40 MHz
31 53 budinero
 
32
-->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
33 54 budinero
-->> Virtual clock
34 53 budinero
library ieee;
35
use ieee.std_logic_1164.all;
36
use ieee.math_real.all;
37
 
38
 
39
 
40 54 budinero
entity tb_simple_clock is
41 53 budinero
  port (
42
    CLK_PERIOD: in time;-- := 20 ns;
43
    CLK_DUTY:  in  real; -- := 0.5;
44
    active:  in     boolean;
45
    clk_o:   out    std_logic
46
  );
47 54 budinero
end entity tb_simple_clock ;
48 53 budinero
 
49 54 budinero
architecture beh of tb_simple_clock is
50 53 budinero
begin
51
  P_main: process
52
  begin
53
    wait until active;
54
    while (active = true) loop
55
      clk_o <= '0';
56
      wait for CLK_PERIOD * (100.0 - clk_Duty)/100.0;
57
      clk_o <= '1';
58
      wait for CLK_PERIOD * clk_Duty/100.0;
59
    end loop;
60
    clk_o <= '0';
61
    wait;
62
  end process;
63
end architecture beh;
64
 
65 54 budinero
-->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
66
-->> Virtual ADC
67
library ieee;
68
use ieee.std_logic_1164.all;
69
use ieee.std_logic_unsigned.all;
70 53 budinero
 
71 54 budinero
entity virtual_adc is
72
  port (
73
    clk_I:        in  std_logic;
74
    sel_I:        in  std_logic;
75
    chip_sel_I:   in  std_logic;
76
    sleep_I:      in  std_logic;
77
    data_O:       out std_logic_vector(9 downto 0)
78
  );
79
end entity virtual_adc ;
80
 
81
architecture beh of virtual_adc is
82
    signal data1: std_logic_vector(9 downto 0) := "0000000001"; -- odd
83
    signal data2: std_logic_vector(9 downto 0) := (others => '0'); -- pair  
84
begin
85 53 budinero
 
86 54 budinero
  P_virtual_adc: process (clk_I, sel_I, chip_sel_I, sleep_I)
87
 
88
  begin
89
    if clk_I'event and clk_I = '1' then
90
      data1 <= data1 + 2;
91
      data2 <= data2 + 2;
92
    end if;
93
 
94
    if sleep_I = '1' or chip_sel_I = '0' then
95
      data_O <= (others => '0');
96
    else
97
      case sel_I is
98
        when '0' =>
99
          data_O <= data1;
100
        when others =>
101
          data_O <= data2;
102
      end case;
103
    end if;
104
 
105
  end process;
106
 
107
end architecture beh;
108
 
109 53 budinero
-->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
110 54 budinero
-->> Stimulus
111 53 budinero
library ieee, std;
112
use ieee.std_logic_1164.all;
113
use ieee.std_logic_unsigned.all;
114 54 budinero
--use IEEE.NUMERIC_STD.ALL;
115 53 budinero
use ieee.math_real.all;
116
 
117
 
118
-- Additional libraries used by Model Under Test.
119
use work.ctrl_pkg.all;
120
use work.daq_pkg.all;
121
use work.memory_pkg.all;
122
use work.eppwbn_pkg.all;
123
 
124
entity stimulus is
125
  port(
126
 -- ADC
127 54 budinero
    adc_data_I:     inout    std_logic_vector (9 downto 0) := (others => '0');
128 53 budinero
    adc_sel_O:      in   std_logic;
129
    adc_clk_O:      in   std_logic;
130
    adc_sleep_O:    in   std_logic;
131
    adc_chip_sel_O: in   std_logic;
132
 
133
    -- EPP
134
    nStrobe_I:      inout std_logic;                       --  HostClk/nWrite 
135
    Data_IO:        inout std_logic_vector (7 downto 0);--   AD8..1 (Data1..Data8)
136
    nAck_O:         in std_logic;                      --  PtrClk/PeriphClk/Intr
137 54 budinero
    Busy_O:         in std_logic;                      --  PtrBusy/PeriphAck/nWait
138 53 budinero
    PError_O:       in std_logic;                      --  AckData/nAckReverse
139
    Sel_O:          in std_logic;                      --  XFlag (Select)
140
    nAutoFd_I:      inout std_logic;                       --  HostBusy/HostAck/nDStrb
141
    PeriphLogicH_O: in std_logic;                      --  (Periph Logic High)
142
    nInit_I:        inout std_logic;                       --  nReverseRequest
143
    nFault_O:       in std_logic;                      --  nDataAvail/nPeriphRequest
144
    nSelectIn_I:    inout std_logic;                       --  1284 Active/nAStrb
145
 
146
    -- Peripherals
147
    reset_I:    inout std_logic;
148 54 budinero
    pll_clk_I:  inout std_logic;  -- clock signal go to pll, and is divided in two clocks
149
 
150
    test_number: out integer range 0 to 20
151 53 budinero
  );
152
 
153
end stimulus;
154
 
155
architecture STIMULATOR of stimulus is
156 54 budinero
  -- PLL clocks
157
  constant CLK_DAQ_PERIOD: time := 25  ns;
158
  constant CLK_EPP_PERIOD: time := 100 ns;
159
 
160 53 budinero
  -- Control Signal Declarations
161
  signal tb_InitFlag : boolean := false;
162
  signal tb_ParameterInitFlag : boolean := false;
163
  signal i: std_logic;
164 54 budinero
  signal runflag: std_logic;
165 53 budinero
 
166
  -- Parm Declarations
167
  signal clk_Duty :   real := 0.0;
168
  signal clk_Period : time := 0 ns;
169
 
170
begin
171
  --------------------------------------------------------------------------------------------------
172
  -- Parm Assignment Block
173
  P_AssignParms : process
174
    variable clk_Duty_real :    real;
175
    variable clk_Period_real :  real;
176
  begin
177
    -- Basic parameters
178 54 budinero
    clk_Period_real := 40.0; --<--<--<--<--<--<--<--<--<--<--<--<--<--<--<--<--
179 53 budinero
    clk_Period <= clk_Period_real * 1 ns;
180
    clk_Duty_real := 50.0;
181
    clk_Duty <= clk_Duty_real;
182
 
183
    tb_ParameterInitFlag <= true;
184
 
185
    wait;
186
  end process;
187
 
188
 
189
  --------------------------------------------------------------------------------------------------
190 54 budinero
  -- Instantiation
191 53 budinero
  -- Clock Instantiation
192 54 budinero
  U_TB_CLK: entity work.tb_simple_clock
193 53 budinero
  port map (
194
    clk_Period => clk_Period,
195
    clk_Duty => clk_Duty,
196
    active => tb_InitFlag,
197
    clk_o => pll_clk_I
198
  );
199
 
200 54 budinero
  -- ADC Instantiation
201
  U_TB_ADC: entity work.virtual_adc
202
  port map(
203
    clk_I => adc_clk_O,
204
    sel_I => adc_sel_O,
205
    chip_sel_I => adc_chip_sel_O,
206
    sleep_I => adc_sleep_O,
207
    data_O => adc_data_I
208
  );
209
 
210 53 budinero
 
211
  --------------------------------------------------------------------------------------------------
212 54 budinero
  -- Main process
213
  P_Unclocked : process
214
    ------------------------------------------------------------------------------------------------
215
    -- Procedure for write in epp port
216
    procedure WriteData(
217
      constant in_address: in  std_logic_vector(7 downto 0);
218
      constant in_data:    in  std_logic_vector(15 downto 0);
219
      signal Data_IO:      out std_logic_vector(7 downto 0);
220
      signal nStrobe_I:    out std_logic;
221
      signal nSelectIn_I:  out std_logic;
222
      signal nAutoFd_I:    out std_logic;
223
      signal Busy_O:       in  std_logic
224
    ) is
225
    begin
226
      nStrobe_I <= '0'; -- '0' -> is write
227 53 budinero
 
228 54 budinero
      Data_IO <= in_address;          -- Address
229
      nSelectIn_I <= '0';             -- addStb      
230
      wait until Busy_O = '1';
231
      --wait for 30 ns;
232
      nSelectIn_I <= '1';
233
      wait until Busy_O = '0';
234
 
235
      Data_IO <= in_data(7 downto 0); -- Data1
236
      nAutoFd_I <= '0';                -- datStb
237
      wait until Busy_O = '1';
238
      nAutoFd_I <= '1';
239
      wait until Busy_O = '0';
240
 
241
      Data_IO <= in_data(15 downto 8); -- Data0  
242
      nAutoFd_I <= '0';               -- datStb
243
      wait until Busy_O = '1';
244
      nAutoFd_I <= '1';
245
      wait until Busy_O = '0';
246
 
247
    end procedure WriteData;
248
    ------------------------------------------------------------------------------------------------
249
    -- Procedure for read from epp port
250
    procedure ReadData(
251
      signal out_runflag:  out std_logic;
252
      constant in_address: in  std_logic_vector(7 downto 0);
253
      signal Data_IO:      inout std_logic_vector(7 downto 0);
254
      signal nStrobe_I:    out std_logic;
255
      signal nSelectIn_I:  out std_logic;
256
      signal nAutoFd_I:    out std_logic;
257
      signal Busy_O:       in  std_logic
258
    ) is
259
    begin
260
 
261
      nStrobe_I <= '0'; -- '0' -> is write
262
      Data_IO <= in_address;          -- Address
263
      nSelectIn_I <= '0';             -- addStb
264
      wait until Busy_O = '1';
265
      --wait for 30 ns;
266
      nSelectIn_I <= '1';
267
      wait until Busy_O = '0';
268
 
269
      nStrobe_I <= '1'; -- '1' -> is read
270
      Data_IO <= (others => 'Z');     -- Data1
271
      nAutoFd_I <= '0';               -- datStb
272
      wait until (Busy_O = '1');
273
      wait for 30 ns;
274
      nAutoFd_I <= '1';
275
      wait until (Busy_O = '0');
276
 
277
      Data_IO <= (others => 'Z');     -- Data0
278
      nAutoFd_I <= '0';               -- datStb
279
      wait until (Busy_O = '1');
280
      wait for 30 ns;
281
      out_runflag <= Data_IO(6);
282
      nAutoFd_I <= '1';
283
      wait until (Busy_O = '0');
284
 
285
    end procedure ReadData;
286 53 budinero
 
287
  begin
288 54 budinero
    ------------------------------------------------------------------------------------------------
289
    -- Init
290
    test_number <= 0;
291 53 budinero
    wait until tb_ParameterInitFlag;
292
    tb_InitFlag <= true;
293
 
294 54 budinero
    nSelectIn_I <= '0';
295
    nStrobe_I   <= '0';
296
    Data_IO     <= (others => '0');
297
    nAutoFd_I   <= '1';
298
    nInit_I     <= '1';
299
    reset_I     <= '1';
300
    wait for 700 ns; -- PLL delay
301 53 budinero
 
302 54 budinero
    reset_I     <= '0';
303 53 budinero
 
304 54 budinero
    -- EPP Mode Negotiation
305
    -- Standar timing and handshake
306
    nStrobe_I <= '1';
307
    wait for 500 ns;
308 53 budinero
 
309 54 budinero
    Data_IO <= X"40";
310
    wait for 500 ns;
311 53 budinero
 
312 54 budinero
    nSelectIn_I <= '1';
313
    nAutoFd_I <= '0';
314
    wait until (PError_O = '1' and nAck_O = '0' and nFault_O = '1' and Sel_O = '1');
315 53 budinero
 
316 54 budinero
    nStrobe_I <= '0';
317
    wait for 500 ns;
318 53 budinero
 
319 54 budinero
    nAutoFd_I <= '1';
320
    nStrobe_I <= '1';
321 55 budinero
    wait until (nAck_O = '1' and Sel_O = '1');
322 53 budinero
 
323 54 budinero
    ------------------------------------------------------------------------------------------------
324
    -- Test 1
325
    -- Writing in all control register
326 53 budinero
 
327 54 budinero
    -- 00   RunConf_R   RW     [       |       |       |       |       |TScal04|TScal03|TScal02|
328
    --                          TScal01|TScal00|TScalEn|   TrCh|  TrEdg|   TrOn|   Cont|  Start]    
329
    --      
330
    -- 01   Channels_R  RW     [       |       |       |       |       |       |       |       |
331
    --                                 |       |       |       |       |       |  RCh01|  RCh00] 
332
    --      
333
    -- 02   BuffSize_R  RW     [       |       |BuffS13|BuffS12|BuffS11|BuffS10|BuffS09|BuffS08|
334
    --                          BuffS07|BuffS06|BuffS05|BuffS04|BuffS03|BuffS02|BuffS01|BuffS00]
335
    --      
336
    -- 03   TrigLvl_R   RW     [       |       |       |       |       |       |TrLvl09|TrLvl08|
337
    --                          TrLvl07|TrLvl06|TrLvl05|TrLvl04|TrLvl03|TrLvl02|TrLvl01|TrLvl00]
338
    --           
339
    -- 04   TrigOff_R   RW     [       |TrOff14|TrOff13|TrOff12|TrOff11|TrOff10|TrOff09|TrOff08|
340
    --                          TrOff07|TrOff06|TrOff00|TrOff00|TrOff00|TrOff00|TrOff00|TrOff00]  
341
    --
342
    -- 05   ADCConf     RW     [       |       |       |       |   ADCS|ADSleep| ADPSEn| ADPS08|
343
    --                           ADPS07| ADPS06| ADPS05| ADPS04| ADPS03| ADPS02| ADPS01| ADPS00]  
344
    --
345
    -- 08   Data_O      R      [ErrFlag|RunFlag|       |       |       |  DCh00|  Dat09|  Dat08|
346
    --                            Dat07|  Dat06|  Dat05|  Dat04|  Dat03|  Dat02|  Dat01|  Dat00] 
347
    -- 
348
    -- 09   Error_O     R      [       |       |       |       |       |       |       |       |
349
    --                                 |       |       |       |       | ErrN02| ErrN01| ErrN00] 
350 55 budinero
--     test_number <= 1;
351
--     
352
--     WriteData(X"00", X"FFFE", Data_IO, nStrobe_I, nSelectIn_I, nAutoFd_I, Busy_O);
353
--     WriteData(X"01", X"FFFF", Data_IO, nStrobe_I, nSelectIn_I, nAutoFd_I, Busy_O);
354
--     WriteData(X"02", X"FFFF", Data_IO, nStrobe_I, nSelectIn_I, nAutoFd_I, Busy_O);
355
--     WriteData(X"03", X"FFFF", Data_IO, nStrobe_I, nSelectIn_I, nAutoFd_I, Busy_O);
356
--     WriteData(X"04", X"FFFF", Data_IO, nStrobe_I, nSelectIn_I, nAutoFd_I, Busy_O);
357
--     
358
--     ReadData(runflag, X"00", Data_IO, nStrobe_I, nSelectIn_I, nAutoFd_I, Busy_O);
359
--     ReadData(runflag, X"01", Data_IO, nStrobe_I, nSelectIn_I, nAutoFd_I, Busy_O);
360
--     ReadData(runflag, X"02", Data_IO, nStrobe_I, nSelectIn_I, nAutoFd_I, Busy_O);
361
--     ReadData(runflag, X"03", Data_IO, nStrobe_I, nSelectIn_I, nAutoFd_I, Busy_O);
362
--     ReadData(runflag, X"04", Data_IO, nStrobe_I, nSelectIn_I, nAutoFd_I, Busy_O);
363
--     
364
--     wait for 50 ns;
365
--     ------------------------------------------------------------------------------------------------
366
--     -- Test 2 - DAQ Config
367
--     -- Writing in daq config register
368
--     test_number <= 2;
369
--     
370
--     WriteData(X"05", X"07FF", Data_IO, nStrobe_I, nSelectIn_I, nAutoFd_I, Busy_O);
371
--     ReadData(runflag, X"05", Data_IO, nStrobe_I, nSelectIn_I, nAutoFd_I, Busy_O);
372
--     
373
--     WriteData(X"05", X"0A00", Data_IO, nStrobe_I, nSelectIn_I, nAutoFd_I, Busy_O);
374
--     ReadData(runflag, X"05", Data_IO, nStrobe_I, nSelectIn_I, nAutoFd_I, Busy_O);
375
--     
376
--     wait for 50 ns;
377
--     ------------------------------------------------------------------------------------------------
378
--     -- Test 3 - Test basic
379
--     -- daq freq = ctrl freq/2 (default), w/o trigger, w/o skipper, channels 1 and 2, 
380
--     -- buffer size = 50h, continuous
381
--     test_number <= 3;
382
--     
383
--     WriteData(X"01", X"0003", Data_IO, nStrobe_I, nSelectIn_I, nAutoFd_I, Busy_O); -- Channels_R
384
--     WriteData(X"02", X"0050", Data_IO, nStrobe_I, nSelectIn_I, nAutoFd_I, Busy_O); -- BuffSize_R
385
--     WriteData(X"03", X"0000", Data_IO, nStrobe_I, nSelectIn_I, nAutoFd_I, Busy_O); -- TrigLvl_R
386
--     WriteData(X"04", X"0000", Data_IO, nStrobe_I, nSelectIn_I, nAutoFd_I, Busy_O); -- TrigOff_R
387
--     WriteData(X"00", X"0001", Data_IO, nStrobe_I, nSelectIn_I, nAutoFd_I, Busy_O); -- RunConf_R
388
--     
389
--     
390
--     ReadData(runflag, X"08", Data_IO, nStrobe_I, nSelectIn_I, nAutoFd_I, Busy_O);
391
--     while (runflag = '1') loop
392
--       ReadData(runflag, X"08", Data_IO, nStrobe_I, nSelectIn_I, nAutoFd_I, Busy_O);    
393
--     end loop;
394
--     
395
--     wait for 50 ns;
396
--     ------------------------------------------------------------------------------------------------
397
--     -- Test 4 - Skipper
398
--     -- daq freq = ctrl freq/2 (default), w/o trigger, skipper = 3, channels 1 and 2, 
399
--     -- buffer size = 80h, no continuous
400
--     test_number <= 4;
401
--     
402
--     WriteData(X"01", X"0003", Data_IO, nStrobe_I, nSelectIn_I, nAutoFd_I, Busy_O); -- Channels_R
403
--     WriteData(X"02", X"0080", Data_IO, nStrobe_I, nSelectIn_I, nAutoFd_I, Busy_O); -- BuffSize_R
404
--     WriteData(X"03", X"0000", Data_IO, nStrobe_I, nSelectIn_I, nAutoFd_I, Busy_O); -- TrigLvl_R
405
--     WriteData(X"04", X"0000", Data_IO, nStrobe_I, nSelectIn_I, nAutoFd_I, Busy_O); -- TrigOff_R
406
--     WriteData(X"00", B"00000_00011_1_0_0_0_0_1", Data_IO, nStrobe_I, nSelectIn_I, nAutoFd_I, Busy_O); -- RunConf_R
407
--                        
408
--     
409
--     
410
--     ReadData(runflag, X"08", Data_IO, nStrobe_I, nSelectIn_I, nAutoFd_I, Busy_O);
411
--     while (runflag = '1') loop
412
--       ReadData(runflag, X"08", Data_IO, nStrobe_I, nSelectIn_I, nAutoFd_I, Busy_O);    
413
--     end loop;
414
--     
415
--     -- Some samples
416
--     --     011011001  0  217
417
--     --     011110110  1  246
418
--     --     011111001  0  249  32
419
--     --     100010110  1  278  32
420
--     --     100011001  0  281  32
421
--     --     100110110  1  310  32
422
--     --     100111001  0  313  32
423
--     --     101010110  1  342  32
424
--     
425
--     
426 53 budinero
 
427 54 budinero
    wait for 50 ns;
428 53 budinero
 
429 54 budinero
    ------------------------------------------------------------------------------------------------
430 55 budinero
    -- Test 5 - Trigger - one shot
431
    -- daq freq = ctrl freq/2 (default), trigger channel 1, level 30 %, not continuous, skipper = 5, 
432
    -- channels 1 and 2, buffer size = 100h, rissing edge, trigg offset = 0
433
    test_number <= 5;
434 54 budinero
 
435
    WriteData(X"01", X"0003", Data_IO, nStrobe_I, nSelectIn_I, nAutoFd_I, Busy_O); -- Channels_R
436 55 budinero
    WriteData(X"02", X"0100", Data_IO, nStrobe_I, nSelectIn_I, nAutoFd_I, Busy_O); -- BuffSize_R
437
    WriteData(X"03", X"0133", Data_IO, nStrobe_I, nSelectIn_I, nAutoFd_I, Busy_O); -- TrigLvl_R
438 54 budinero
    WriteData(X"04", X"0000", Data_IO, nStrobe_I, nSelectIn_I, nAutoFd_I, Busy_O); -- TrigOff_R
439 55 budinero
    WriteData(X"00", B"00000_00101_1_1_0_1_0_1", Data_IO, nStrobe_I, nSelectIn_I, nAutoFd_I, Busy_O); -- RunConf_R
440 54 budinero
 
441
 
442
    ReadData(runflag, X"08", Data_IO, nStrobe_I, nSelectIn_I, nAutoFd_I, Busy_O);
443
    while (runflag = '1') loop
444
      ReadData(runflag, X"08", Data_IO, nStrobe_I, nSelectIn_I, nAutoFd_I, Busy_O);
445
    end loop;
446
 
447
 
448
    ------------------------------------------------------------------------------------------------
449
    -- Test 6 - Trigger 
450
    -- daq freq = ctrl freq/2 (default), trigger channel 1, level 30 %, continuous, skipper = 5, 
451
    -- channels 1, buffer size = 50
452
 
453
 
454
    ------------------------------------------------------------------------------------------------
455
    -- Test 7 - One channel
456
    -- daq freq = ctrl freq/2 (default), trigger channel 1, level 30 %, continuous, skipper = 5, 
457
    -- channels 1, buffer size = 50
458
 
459
 
460
 
461
    ------------------------------------------------------------------------------------------------
462
    -- Test 8  - Test write while working
463
    -- daq freq = ctrl freq/2 (default), trigger channel 1, level 30 %, continuous, skipper = 5, 
464
    -- channels 1, buffer size = 50
465
 
466
 
467
 
468
 
469
      wait for 100 ns;
470
 
471
    tb_InitFlag <= false;
472
    wait;
473
 
474
 
475 53 budinero
  end process;
476
 
477
 
478
 
479
end architecture STIMULATOR;
480
 
481
 
482
 
483
 
484
 
485
 
486
 
487
 
488
 
489
-->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
490
 library ieee, std;
491
 use ieee.std_logic_1164.all;
492
 
493
 
494
-- Additional libraries used by Model Under Test.
495
-- ...
496
entity testbench is
497
end testbench;
498
 
499
architecture tbGeneratedCode of testbench is
500
    -- ADC
501
    signal adc_data_I:      std_logic_vector (9 downto 0);
502
    signal adc_sel_O:       std_logic;
503
    signal adc_clk_O:       std_logic;
504
    signal adc_sleep_O:     std_logic;
505
    signal adc_chip_sel_O:  std_logic;
506
    -- EPP
507
    signal nStrobe_I:       std_logic;
508
    signal Data_IO:         std_logic_vector (7 downto 0);
509
    signal nAck_O:          std_logic;
510
    signal busy_O:          std_logic;
511
    signal PError_O:        std_logic;
512
    signal Sel_O:           std_logic;
513
    signal nAutoFd_I:       std_logic;
514
    signal PeriphLogicH_O:  std_logic;
515
    signal nInit_I:         std_logic;
516
    signal nFault_O:        std_logic;
517
    signal nSelectIn_I:     std_logic;
518
    -- Peripherals
519
    signal reset_I:     std_logic;
520
    signal pll_clk_I:   std_logic;
521 54 budinero
 
522
 
523
    signal test_number: integer range 0 to 20;
524 53 budinero
begin
525
  --------------------------------------------------------------------------------------------------
526
  -- Instantiation of Stimulus.
527
  U_stimulus_0 : entity work.stimulus
528
    port map (
529
      -- ADC
530
      adc_data_I => adc_data_I,
531
      adc_sel_O => adc_sel_O,
532
      adc_clk_O => adc_clk_O,
533
      adc_sleep_O => adc_sleep_O,
534
      adc_chip_sel_O => adc_chip_sel_O,
535
      -- EPP
536
      nStrobe_I => nStrobe_I,
537
      Data_IO => Data_IO,
538
      nAck_O => nAck_O,
539
      busy_O => busy_O,
540
      PError_O => PError_O,
541
      Sel_O => Sel_O,
542
      nAutoFd_I => nAutoFd_I,
543
      PeriphLogicH_O =>PeriphLogicH_O ,
544
      nInit_I => nInit_I,
545
      nFault_O => nFault_O,
546
      nSelectIn_I => nSelectIn_I,
547
      -- Peripherals
548
      reset_I => reset_I,
549 54 budinero
      pll_clk_I => pll_clk_I,
550
 
551
      test_number => test_number
552 53 budinero
    );
553
 
554
  --------------------------------------------------------------------------------------------------
555
  -- Instantiation of Model Under Test.
556 54 budinero
  U_OSC0 : entity work.modular_oscilloscope --<--<--<--<--<--<--<--<--<--<--<--<--<--<--<--<--
557 53 budinero
    port map (
558
      -- ADC
559
      adc_data_I => adc_data_I,
560
      adc_sel_O => adc_sel_O,
561
      adc_clk_O => adc_clk_O,
562
      adc_sleep_O => adc_sleep_O,
563
      adc_chip_sel_O => adc_chip_sel_O,
564
      -- EPP
565
      nStrobe_I => nStrobe_I,
566
      Data_IO => Data_IO,
567
      nAck_O => nAck_O,
568
      busy_O => busy_O,
569
      PError_O => PError_O,
570
      Sel_O => Sel_O,
571
      nAutoFd_I => nAutoFd_I,
572
      PeriphLogicH_O =>PeriphLogicH_O ,
573
      nInit_I => nInit_I,
574
      nFault_O => nFault_O,
575
      nSelectIn_I => nSelectIn_I,
576
      -- Peripherals
577
      reset_I => reset_I,
578
      pll_clk_I => pll_clk_I
579
    );
580
 
581
end tbGeneratedCode;
582
----------------------------------------------------------------------------------------------------

powered by: WebSVN 2.1.0

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