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

Subversion Repositories lpffir

[/] [lpffir/] [trunk/] [uvm/] [tools/] [uvm_syoscb/] [tb/] [test/] [cl_scbtest_test_ooo_gp.svh] - Blame information for rev 4

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 4 vladimirar
//----------------------------------------------------------------------
2
//   Copyright 2014-2015 SyoSil ApS
3
//   All Rights Reserved Worldwide
4
//
5
//   Licensed under the Apache License, Version 2.0 (the
6
//   "License"); you may not use this file except in
7
//   compliance with the License.  You may obtain a copy of
8
//   the License at
9
//
10
//       http://www.apache.org/licenses/LICENSE-2.0
11
//
12
//   Unless required by applicable law or agreed to in
13
//   writing, software distributed under the License is
14
//   distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
15
//   CONDITIONS OF ANY KIND, either express or implied.  See
16
//   the License for the specific language governing
17
//   permissions and limitations under the License.
18
//----------------------------------------------------------------------
19
// *NOTES*:
20
// Simple OOO compare test for TLM generic payload using the function based API
21
 
22
class cl_scbtest_test_ooo_gp extends cl_scbtest_test_base;
23
  //-------------------------------------
24
  // UVM Macros
25
  //-------------------------------------
26
  `uvm_component_utils(cl_scbtest_test_ooo_gp)
27
 
28
  //-------------------------------------
29
  // Constructor
30
  //-------------------------------------
31
  extern function new(string name = "cl_scbtest_test_ooo_gp", uvm_component parent = null);
32
 
33
  //-------------------------------------
34
  // UVM Phase methods
35
  //-------------------------------------
36
  extern function void build_phase(uvm_phase phase);
37
  extern task run_phase(uvm_phase phase);
38
endclass : cl_scbtest_test_ooo_gp
39
 
40
function cl_scbtest_test_ooo_gp::new(string name = "cl_scbtest_test_ooo_gp", uvm_component parent = null);
41
  super.new(name, parent);
42
endfunction : new
43
 
44
function void cl_scbtest_test_ooo_gp::build_phase(uvm_phase phase);
45
  cl_syoscb_queue::set_type_override_by_type(cl_syoscb_queue::get_type(),
46
                                             cl_syoscb_queue_std::get_type(),
47
                                             "*");
48
 
49
  this.set_type_override_by_type(cl_syoscb_compare_base::get_type(),
50
                                 cl_syoscb_compare_ooo::get_type(),
51
                                 "*");
52
  super.build_phase(phase);
53
endfunction: build_phase
54
 
55
task cl_scbtest_test_ooo_gp::run_phase(uvm_phase phase);
56
  super.run_phase(phase);
57
 
58
  begin
59
    uvm_tlm_generic_payload gp;
60
 
61
    // Create
62
    gp = uvm_tlm_generic_payload::type_id::create("gp0");
63
 
64
    // Command
65
    gp.set_write();
66
 
67
    // Address
68
    gp.set_address(64'h0);
69
 
70
    // Data
71
    begin
72
      byte unsigned gp_data[];
73
 
74
      gp_data = new[4];
75
 
76
      gp_data[0] = 8'h0;
77
      gp_data[1] = 8'h1;
78
      gp_data[2] = 8'h2;
79
      gp_data[3] = 8'h3;
80
 
81
      gp.set_data_length(4);
82
      gp.set_data(gp_data);
83
    end
84
 
85
    // Byte enable
86
    begin
87
      byte unsigned gp_be[];
88
 
89
      gp_be = new[4];
90
 
91
      gp_be[0] = 8'hff;
92
      gp_be[1] = 8'hff;
93
      gp_be[2] = 8'hff;
94
      gp_be[3] = 8'hff;
95
 
96
      gp.set_byte_enable_length(4);
97
      gp.set_byte_enable(gp_be);
98
    end
99
 
100
    // Status
101
    gp.set_response_status(UVM_TLM_OK_RESPONSE);
102
 
103
    gp.print();
104
 
105
    scbtest_env.syoscb[0].add_item("Q1", "P1", gp);
106
  end
107
 
108
  begin
109
    uvm_tlm_generic_payload gp;
110
 
111
    // Create
112
    gp = uvm_tlm_generic_payload::type_id::create("gp1");
113
 
114
    // Command
115
    gp.set_write();
116
 
117
    // Address
118
    gp.set_address(64'h0);
119
 
120
    // Data
121
    begin
122
      byte unsigned gp_data[];
123
 
124
      gp_data = new[4];
125
 
126
      gp_data[0] = 8'h4;
127
      gp_data[1] = 8'h5;
128
      gp_data[2] = 8'h6;
129
      gp_data[3] = 8'h7;
130
 
131
      gp.set_data_length(4);
132
      gp.set_data(gp_data);
133
    end
134
 
135
    // Byte enable
136
    begin
137
      byte unsigned gp_be[];
138
 
139
      gp_be = new[4];
140
 
141
      gp_be[0] = 8'hff;
142
      gp_be[1] = 8'hff;
143
      gp_be[2] = 8'hff;
144
      gp_be[3] = 8'hff;
145
 
146
      gp.set_byte_enable_length(4);
147
      gp.set_byte_enable(gp_be);
148
    end
149
 
150
    // Status
151
    gp.set_response_status(UVM_TLM_OK_RESPONSE);
152
 
153
    gp.print();
154
 
155
    scbtest_env.syoscb[0].add_item("Q2", "P1", gp);
156
  end
157
endtask: run_phase

powered by: WebSVN 2.1.0

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