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

Subversion Repositories qaz_libs

[/] [qaz_libs/] [trunk/] [axi4_stream_lib/] [sim/] [src/] [legacy/] [tb_axis_register_slice.sv] - Blame information for rev 49

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 49 qaztronic
//////////////////////////////////////////////////////////////////////
2
////                                                              ////
3
//// Copyright (C) 2015 Authors and OPENCORES.ORG                 ////
4
////                                                              ////
5
//// This source file may be used and distributed without         ////
6
//// restriction provided that this copyright statement is not    ////
7
//// removed from the file and that any derivative work contains  ////
8
//// the original copyright notice and the associated disclaimer. ////
9
////                                                              ////
10
//// This source file is free software; you can redistribute it   ////
11
//// and/or modify it under the terms of the GNU Lesser General   ////
12
//// Public License as published by the Free Software Foundation; ////
13
//// either version 2.1 of the License, or (at your option) any   ////
14
//// later version.                                               ////
15
////                                                              ////
16
//// This source is distributed in the hope that it will be       ////
17
//// useful, but WITHOUT ANY WARRANTY; without even the implied   ////
18
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ////
19
//// PURPOSE.  See the GNU Lesser General Public License for more ////
20
//// details.                                                     ////
21
////                                                              ////
22
//// You should have received a copy of the GNU Lesser General    ////
23
//// Public License along with this source; if not, download it   ////
24
//// from http://www.opencores.org/lgpl.shtml                     ////
25
////                                                              ////
26
//////////////////////////////////////////////////////////////////////
27
 
28
 
29
module tb_top();
30
 
31
  // --------------------------------------------------------------------
32
  // test bench clock & reset
33
  wire clk_200mhz;
34
  wire tb_clk   = clk_200mhz;
35
  wire tb_rst;
36
  wire aclk     = tb_clk;
37
  wire aresetn  = ~tb_rst;
38
 
39
  tb_base #( .PERIOD(5_000) ) tb( clk_200mhz, tb_rst );
40
 
41
 
42
  // --------------------------------------------------------------------
43
  //
44
  localparam TILES              = 1;
45
  localparam WIDTH              = 32; // tile width
46
  localparam HEIGHT             = 16; // tile height
47
  localparam OUTPUTS_PER_TILE   = 1;  // outputs per tile
48
  localparam BYTES_PER_PIXEL    = 2;
49
  localparam BITS_PER_PIXEL     = 16;
50
  localparam VERTICAL_BLANKING  = 20;
51
 
52
 
53
  // --------------------------------------------------------------------
54
  //
55
  localparam AVF_N = BYTES_PER_PIXEL * OUTPUTS_PER_TILE; // data bus width in bytes
56
  localparam AVF_U = 1;                                  // TUSER width
57
 
58
  axis_if #(.N(AVF_N), .U(AVF_U)) axis_in[TILES](.*);
59
  axis_if #(.N(AVF_N), .U(AVF_U)) axis_out[TILES](.*);
60
 
61
 
62
  // --------------------------------------------------------------------
63
  //
64
  axis_register_slice #(.N(AVF_N), .U(AVF_U))
65
    dut
66
    (
67
      .axis_en(1'b1),
68
      .axis_in(axis_in.slave[0]),
69
      .axis_out(axis_out.master[0]),
70
      .*
71
    );
72
 
73
 
74
  // --------------------------------------------------------------------
75
  //
76
  import axis_video_frame_bfm_pkg::*;
77
  import avf_agent_class_pkg::*;
78
 
79
 
80
  // --------------------------------------------------------------------
81
  //
82
  avf_agent_config_class avf_agent_config_h;
83
  avf_agent_class #(BYTES_PER_PIXEL, OUTPUTS_PER_TILE) avf_agent_h;
84
 
85
  initial
86
  begin
87
 
88
    avf_agent_config_h = new
89
    (
90
      .width(WIDTH),
91
      .height(HEIGHT),
92
      .bytes_per_pixel(BYTES_PER_PIXEL),
93
      .bits_per_pixel(BITS_PER_PIXEL),
94
      .tiles(TILES),
95
      .outputs_per_tile(OUTPUTS_PER_TILE),
96
      .name("AVF_"),
97
      .vertical_blanking(VERTICAL_BLANKING)
98
    );
99
 
100
    avf_agent_config_h.tile[0].direction = RIGHT_DOWN;
101
 
102
    avf_agent_h = new
103
    (
104
      .avf_agent_config(avf_agent_config_h),
105
      .avf_axis_in_if(axis_out),
106
      .avf_axis_out_if(axis_in)
107
    );
108
 
109
    avf_agent_h.init();
110
 
111
  end
112
 
113
 
114
  // --------------------------------------------------------------------
115
  // sim models
116
  //  |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |
117
  // \|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/
118
  //  '   '   '   '   '   '   '   '   '   '   '   '   '   '   '   '   '
119
 
120
  // --------------------------------------------------------------------
121
  //
122
 
123
 
124
  //  '   '   '   '   '   '   '   '   '   '   '   '   '   '   '   '   '
125
  // /|\-/|\-/|\-/|\-/|\-/|\-/|\-/|\-/|\-/|\-/|\-/|\-/|\-/|\-/|\-/|\-/|\
126
  //  |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |
127
  // sim models
128
  // --------------------------------------------------------------------
129
 
130
 
131
  // --------------------------------------------------------------------
132
  //  debug wires
133
  for(genvar j = 0; j < TILES; j++)
134
    axis_video_debug #(BYTES_PER_PIXEL, OUTPUTS_PER_TILE) avf_debug(axis_out[j]);
135
 
136
 
137
  // --------------------------------------------------------------------
138
  // test
139
  the_test test( tb_clk, tb_rst );
140
 
141
  initial
142
    begin
143
 
144
      test.run_the_test();
145
 
146
      $display("^^^---------------------------------");
147
      $display("^^^ %16.t | Testbench done.", $time);
148
      $display("^^^---------------------------------");
149
 
150
      $display("^^^---------------------------------");
151
 
152
      $stop();
153
 
154
    end
155
 
156
endmodule
157
 
158
 
159
 

powered by: WebSVN 2.1.0

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