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

Subversion Repositories lpffir

[/] [lpffir/] [trunk/] [uvm/] [lpffir_uvm/] [generated_tb/] [tb/] [top/] [sv/] [top_seq_lib.sv] - Blame information for rev 11

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 11 vladimirar
// You can insert code here by setting file_header_inc in file common.tpl
2
 
3
//=============================================================================
4
// Project  : generated_tb
5
//
6
// File Name: top_seq_lib.sv
7
//
8
//
9
// Version:   1.0
10
//
11
// Code created by Easier UVM Code Generator version 2016-04-18-EP on Sat Apr 27 13:59:59 2019
12
//=============================================================================
13
// Description: Sequence for top
14
//=============================================================================
15
 
16
`ifndef TOP_SEQ_LIB_SV
17
`define TOP_SEQ_LIB_SV
18
 
19
class top_default_seq extends uvm_sequence #(uvm_sequence_item);
20
 
21
  `uvm_object_utils(top_default_seq)
22
 
23
  data_input_agent   m_data_input_agent;
24
  data_output_agent  m_data_output_agent;
25
 
26
  // Number of times to repeat child sequences
27
  int m_seq_count = 10;
28
 
29
  extern function new(string name = "");
30
  extern task body();
31
  extern task pre_start();
32
  extern task post_start();
33
 
34
`ifndef UVM_POST_VERSION_1_1
35
  // Functions to support UVM 1.2 objection API in UVM 1.1
36
  extern function uvm_phase get_starting_phase();
37
  extern function void set_starting_phase(uvm_phase phase);
38
`endif
39
 
40
endclass : top_default_seq
41
 
42
 
43
function top_default_seq::new(string name = "");
44
  super.new(name);
45
endfunction : new
46
 
47
 
48
task top_default_seq::body();
49
  `uvm_info(get_type_name(), "Default sequence starting", UVM_HIGH)
50
 
51
 
52
  repeat (m_seq_count)
53
  begin
54
    fork
55
      if (m_data_input_agent.m_config.is_active == UVM_ACTIVE)
56
      begin
57
        data_input_default_seq seq;
58
        seq = data_input_default_seq::type_id::create("seq");
59
        seq.set_item_context(this, m_data_input_agent.m_sequencer);
60
        if ( !seq.randomize() )
61
          `uvm_error(get_type_name(), "Failed to randomize sequence")
62
        seq.set_starting_phase( get_starting_phase() );
63
        seq.start(m_data_input_agent.m_sequencer, this);
64
      end
65
      if (m_data_output_agent.m_config.is_active == UVM_ACTIVE)
66
      begin
67
        data_output_default_seq seq;
68
        seq = data_output_default_seq::type_id::create("seq");
69
        seq.set_item_context(this, m_data_output_agent.m_sequencer);
70
        if ( !seq.randomize() )
71
          `uvm_error(get_type_name(), "Failed to randomize sequence")
72
        seq.set_starting_phase( get_starting_phase() );
73
        seq.start(m_data_output_agent.m_sequencer, this);
74
      end
75
    join
76
  end
77
 
78
  `uvm_info(get_type_name(), "Default sequence completed", UVM_HIGH)
79
endtask : body
80
 
81
 
82
task top_default_seq::pre_start();
83
  uvm_phase phase = get_starting_phase();
84
  if (phase != null)
85
    phase.raise_objection(this);
86
endtask: pre_start
87
 
88
 
89
task top_default_seq::post_start();
90
  uvm_phase phase = get_starting_phase();
91
  if (phase != null)
92
    phase.drop_objection(this);
93
endtask: post_start
94
 
95
 
96
`ifndef UVM_POST_VERSION_1_1
97
function uvm_phase top_default_seq::get_starting_phase();
98
  return starting_phase;
99
endfunction: get_starting_phase
100
 
101
 
102
function void top_default_seq::set_starting_phase(uvm_phase phase);
103
  starting_phase = phase;
104
endfunction: set_starting_phase
105
`endif
106
 
107
 
108
// You can insert code here by setting top_seq_inc in file common.tpl
109
 
110
`endif // TOP_SEQ_LIB_SV
111
 

powered by: WebSVN 2.1.0

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