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

Subversion Repositories qaz_libs

[/] [qaz_libs/] [trunk/] [axi4_stream_lib/] [sim/] [tests/] [legacy/] [tb_axis_gear_box/] [tb_axis_gear_box_pkg.sv] - Blame information for rev 50

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 50 qaztronic
//////////////////////////////////////////////////////////////////////
2
////                                                              ////
3
//// Copyright (C) 2017 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
package tb_axis_gear_box_pkg;
29
 
30
  // --------------------------------------------------------------------
31
  //
32
  import uvm_pkg::*;
33
  `include "uvm_macros.svh"
34
  import axis_pkg::*;
35
 
36
  // --------------------------------------------------------------------
37
  //
38
  typedef struct
39
  {
40
    axis_config_t axis_cfg_in;
41
    axis_config_t axis_cfg_out;
42
  } dut_config_t;
43
 
44
  localparam dut_config_t dut_cfg =
45
    '{
46
      '{  N : 2 // data bus width in bytes.
47
      ,   I : 1 // TID width
48
      ,   D : 1 // TDEST width
49
      ,   U : 1 // TUSER width
50
      ,   USE_TSTRB : 0
51
      ,   USE_TKEEP : 0
52
      ,   USE_ROUTING : 0
53
      },
54
      '{  N : 2 // data bus width in bytes.
55
      ,   I : 1 // TID width
56
      ,   D : 1 // TDEST width
57
      ,   U : 1 // TUSER width
58
      ,   USE_TSTRB : 0
59
      ,   USE_TKEEP : 0
60
      ,   USE_ROUTING : 0
61
      }
62
    };
63
 
64
  // --------------------------------------------------------------------
65
  //
66
  class tb_dut_config #(dut_config_t dut_cfg);
67
 
68
    virtual tb_dut_if #(dut_cfg) dut_bus;
69
 
70
    // --------------------------------------------------------------------
71
    //
72
    function new(virtual tb_dut_if #(dut_cfg) dut_bus);
73
      this.dut_bus = dut_bus;
74
    endfunction : new
75
 
76
  // --------------------------------------------------------------------
77
  //
78
  endclass : tb_dut_config
79
 
80
  // --------------------------------------------------------------------
81
  //
82
  class tb_env extends uvm_env;
83
    `uvm_component_utils(tb_env);
84
 
85
    // --------------------------------------------------------------------
86
    //
87
    // coverage        coverage_h;
88
    // scoreboard      scoreboard_h;
89
    axis_agent #(dut_cfg.axis_cfg_in) agent_h;
90
 
91
    // --------------------------------------------------------------------
92
    //
93
    function new (string name, uvm_component parent);
94
      super.new(name,parent);
95
    endfunction : new
96
 
97
    // --------------------------------------------------------------------
98
    //
99
    function void build_phase(uvm_phase phase);
100
      tb_dut_config #(dut_cfg) cfg_h;
101
      if (!uvm_config_db#(tb_dut_config #(dut_cfg))::get(this, "", "tb_dut_config", cfg_h))
102
        `uvm_fatal(get_name(), "Couldn't get config object!")
103
 
104
      uvm_config_db
105
        #(
106
          virtual axis_if
107
            #(  .N(dut_cfg.axis_cfg_in.N)
108
            ,   .I(dut_cfg.axis_cfg_in.I)
109
            ,   .D(dut_cfg.axis_cfg_in.D)
110
            ,   .U(dut_cfg.axis_cfg_in.U)
111
            )
112
        )::set(this, "*agent_h", "axis_bus", cfg_h.dut_bus.axis_in);
113
 
114
        // // analysis
115
        // coverage_h    = coverage::type_id::create ("coverage_h",this);
116
        // scoreboard_h  = scoreboard::type_id::create("scoreboard",this);
117
 
118
        agent_h = axis_agent #(dut_cfg.axis_cfg_in)::type_id::create("agent_h", this);
119
 
120
    endfunction : build_phase
121
 
122
    // // --------------------------------------------------------------------
123
    // //
124
    // function void connect_phase(uvm_phase phase);
125
 
126
    // endfunction : connect_phase
127
 
128
// --------------------------------------------------------------------
129
//
130
endclass : tb_env
131
 
132
// --------------------------------------------------------------------
133
//
134
endpackage: tb_axis_gear_box_pkg
135
 
136
 
137
 
138
 
139
 

powered by: WebSVN 2.1.0

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