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

Subversion Repositories lpffir

[/] [lpffir/] [trunk/] [uvm/] [lpffir_uvm/] [generated_tb/] [tb/] [top/] [sv/] [reference.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: reference.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: Reference model for use with Syosil scoreboard
14
//=============================================================================
15
 
16
`ifndef REFERENCE_SV
17
`define REFERENCE_SV
18
 
19
// You can insert code here by setting ref_model_inc_before_class in file common.tpl
20
 
21
 
22
`uvm_analysis_imp_decl(_reference_0)
23
 
24
class reference extends uvm_component;
25
  `uvm_component_utils(reference)
26
 
27
  uvm_analysis_imp_reference_0 #(input_tx, reference) analysis_export_0; // m_data_input_agent
28
 
29
  uvm_analysis_port #(uvm_sequence_item) analysis_port_0; // m_data_output_agent
30
 
31
  extern function new(string name, uvm_component parent);
32
  extern function void write_reference_0(input input_tx t);
33
 
34
  // Start of inlined include file generated_tb/tb/include/reference_inc_inside_class.sv
35
  extern function void send(input_tx t);
36
 
37
  int save_pnt = 5;
38
  logic [15:0] tx_save [0:5];
39
  int init_flag = 1;  // End of inlined include file
40
 
41
endclass
42
 
43
 
44
function reference::new(string name, uvm_component parent);
45
  super.new(name, parent);
46
  analysis_export_0 = new("analysis_export_0", this);
47
  analysis_port_0   = new("analysis_port_0",   this);
48
endfunction : new
49
 
50
 
51
// Start of inlined include file generated_tb/tb/include/reference_inc_after_class.sv
52
function void reference::write_reference_0(input_tx t);
53
  send(t);
54
endfunction
55
 
56
function void reference::send(input_tx t);
57
  output_tx tx;
58
  tx = output_tx::type_id::create("tx");
59
  if (init_flag == 1)
60
    begin
61
      init_flag = 0;
62
      foreach(tx_save[j])
63
        tx_save[j] = 0;
64
    end
65
  if (save_pnt == 5)
66
    save_pnt = 0;
67
  else
68
  save_pnt++;
69
  tx_save[save_pnt] = t.data;
70
  tx.data = tx_save[0] + tx_save[1] + tx_save[2] + tx_save[3] + tx_save[4] + tx_save[5];
71
  analysis_port_0.write(tx);
72
  `uvm_info(get_type_name(), $sformatf("Reference Model save_pnt = %0d, data = %0d",save_pnt, tx.data), UVM_HIGH)
73
endfunction
74
// End of inlined include file
75
 
76
`endif // REFERENCE_SV
77
 

powered by: WebSVN 2.1.0

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