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

Subversion Repositories lpffir

[/] [lpffir/] [trunk/] [uvm/] [tools/] [uvm_syoscb/] [tb/] [test/] [cl_scbtest_test_ooo_io_simple.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 test with two SCBs with different compares.
21
 
22
class cl_scbtest_test_ooo_io_simple extends cl_scbtest_test_base;
23
  //-------------------------------------
24
  // UVM Macros
25
  //-------------------------------------
26
  `uvm_component_utils(cl_scbtest_test_ooo_io_simple)
27
 
28
  //-------------------------------------
29
  // Constructor
30
  //-------------------------------------
31
  extern function new(string name = "cl_scbtest_test_ooo_io_simple", 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_io_simple
39
 
40
function cl_scbtest_test_ooo_io_simple::new(string name = "cl_scbtest_test_ooo_io_simple", uvm_component parent = null);
41
  super.new(name, parent);
42
endfunction : new
43
 
44
function void cl_scbtest_test_ooo_io_simple::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
 
50
  cl_syoscb_compare_base::type_id::set_inst_override(cl_syoscb_compare_ooo::get_type(),
51
                                                     "uvm_test_top.scbtest_env.syoscb0.*");
52
 
53
  cl_syoscb_compare_base::type_id::set_inst_override(cl_syoscb_compare_io::get_type(),
54
                                                     "uvm_test_top.scbtest_env.syoscb1.*");
55
 
56
/* TBD::JSA: This doesn't work?
57
  cl_syoscb_compare::set_inst_override_by_type("uvm_test_top.scbtest_env.syoscb0.compare_strategy",
58
                                               cl_syoscb_compare_base::get_type(),
59
                                               cl_syoscb_compare_ooo::get_type());
60
 
61
  cl_syoscb_compare::set_inst_override_by_type("uvm_test_top.scbtest_env.syoscb1.compare_strategy",
62
                                               cl_syoscb_compare_base::get_type(),
63
                                               cl_syoscb_compare_ooo::get_type());
64
*/
65
/* TBD::JSA: This doesn't work?
66
  this.set_inst_override_by_type("uvm_test_top.scbtest_env.syoscb0.compare_strategy",
67
                                 cl_syoscb_compare_base::get_type(),
68
                                 cl_syoscb_compare_ooo::get_type());
69
 
70
  this.set_inst_override_by_type("uvm_test_top.scbtest_env.syoscb1.compare_strategy",
71
                                 cl_syoscb_compare_base::get_type(),
72
                                 cl_syoscb_compare_io::get_type());
73
*/
74
/* Old general type overwrite
75
  this.set_type_override_by_type(cl_syoscb_compare_base::get_type(),
76
                                 cl_syoscb_compare_ooo::get_type(),
77
                                 "*");
78
*/
79
 
80
  super.build_phase(phase);
81
endfunction: build_phase
82
 
83
task cl_scbtest_test_ooo_io_simple::run_phase(uvm_phase phase);
84
  super.run_phase(phase);
85
 
86
  fork
87
    // Insert items in Q1 as P1 with int_a from 0 to 9
88
    // in both syoscb[0] and syoscb[1]
89
    for(int unsigned i=0; i<10; i++) begin
90
      cl_scbtest_seq_item item1;
91
      item1 = cl_scbtest_seq_item::type_id::create("item1");
92
      item1.int_a = i;
93
      scbtest_env.syoscb[0].add_item("Q1", "P1", item1);
94
      scbtest_env.syoscb[1].add_item("Q1", "P1", item1);
95
    end
96
 
97
    // Insert items in Q2 as P1 with int_a from 9 to 0
98
    // but only in syoscb[0] as it runs with an OOO compare
99
    for(int i=9; i>=0; i--) begin
100
      cl_scbtest_seq_item item1;
101
      item1 = cl_scbtest_seq_item::type_id::create("item1");
102
      item1.int_a = i;
103
      scbtest_env.syoscb[0].add_item("Q2", "P1", item1);
104
    end
105
 
106
    // Insert items in Q2 as P1 with int_a from 0 to 9
107
    // but only in syoscb[1] as it runs with an IO compare
108
    for(int i=0; i<10; i++) begin
109
      cl_scbtest_seq_item item1;
110
      item1 = cl_scbtest_seq_item::type_id::create("item1");
111
      item1.int_a = i;
112
      scbtest_env.syoscb[1].add_item("Q2", "P1", item1);
113
    end
114
  join
115
endtask: run_phase

powered by: WebSVN 2.1.0

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