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

Subversion Repositories lpffir

[/] [lpffir/] [trunk/] [uvm/] [lpffir_uvm/] [generated_tb/] [tb/] [data_output/] [sv/] [data_output_output_tx.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: data_output_seq_item.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 item for data_output_sequencer
14
//=============================================================================
15
 
16
`ifndef DATA_OUTPUT_SEQ_ITEM_SV
17
`define DATA_OUTPUT_SEQ_ITEM_SV
18
 
19
// You can insert code here by setting trans_inc_before_class in file data_output.tpl
20
 
21
class output_tx extends uvm_sequence_item;
22
 
23
  `uvm_object_utils(output_tx)
24
 
25
  // To include variables in copy, compare, print, record, pack, unpack, and compare2string, define them using trans_var in file data_output.tpl
26
  // To exclude variables from compare, pack, and unpack methods, define them using trans_meta in file data_output.tpl
27
 
28
  // Transaction variables
29
  rand logic [15:0] data;
30
 
31
 
32
  extern function new(string name = "");
33
 
34
  // You can remove do_copy/compare/print/record and convert2string method by setting trans_generate_methods_inside_class = no in file data_output.tpl
35
  extern function void do_copy(uvm_object rhs);
36
  extern function bit  do_compare(uvm_object rhs, uvm_comparer comparer);
37
  extern function void do_print(uvm_printer printer);
38
  extern function void do_record(uvm_recorder recorder);
39
  extern function void do_pack(uvm_packer packer);
40
  extern function void do_unpack(uvm_packer packer);
41
  extern function string convert2string();
42
 
43
  // You can insert code here by setting trans_inc_inside_class in file data_output.tpl
44
 
45
endclass : output_tx
46
 
47
 
48
function output_tx::new(string name = "");
49
  super.new(name);
50
endfunction : new
51
 
52
 
53
// You can remove do_copy/compare/print/record and convert2string method by setting trans_generate_methods_after_class = no in file data_output.tpl
54
 
55
function void output_tx::do_copy(uvm_object rhs);
56
  output_tx rhs_;
57
  if (!$cast(rhs_, rhs))
58
    `uvm_fatal(get_type_name(), "Cast of rhs object failed")
59
  super.do_copy(rhs);
60
  data = rhs_.data;
61
endfunction : do_copy
62
 
63
 
64
function bit output_tx::do_compare(uvm_object rhs, uvm_comparer comparer);
65
  bit result;
66
  output_tx rhs_;
67
  if (!$cast(rhs_, rhs))
68
    `uvm_fatal(get_type_name(), "Cast of rhs object failed")
69
  result = super.do_compare(rhs, comparer);
70
  result &= comparer.compare_field("data", data, rhs_.data, $bits(data));
71
  return result;
72
endfunction : do_compare
73
 
74
 
75
function void output_tx::do_print(uvm_printer printer);
76
  if (printer.knobs.sprint == 0)
77
    `uvm_info(get_type_name(), convert2string(), UVM_MEDIUM)
78
  else
79
    printer.m_string = convert2string();
80
endfunction : do_print
81
 
82
 
83
function void output_tx::do_record(uvm_recorder recorder);
84
  super.do_record(recorder);
85
  // Use the record macros to record the item fields:
86
  `uvm_record_field("data", data)
87
endfunction : do_record
88
 
89
 
90
function void output_tx::do_pack(uvm_packer packer);
91
  super.do_pack(packer);
92
  `uvm_pack_int(data)
93
endfunction : do_pack
94
 
95
 
96
function void output_tx::do_unpack(uvm_packer packer);
97
  super.do_unpack(packer);
98
  `uvm_unpack_int(data)
99
endfunction : do_unpack
100
 
101
 
102
function string output_tx::convert2string();
103
  string s;
104
  $sformat(s, "%s\n", super.convert2string());
105
  $sformat(s, {"%s\n",
106
    "data = 'h%0h  'd%0d\n"},
107
    get_full_name(), data, data);
108
  return s;
109
endfunction : convert2string
110
 
111
 
112
// You can insert code here by setting trans_inc_after_class in file data_output.tpl
113
 
114
`endif // DATA_OUTPUT_SEQ_ITEM_SV
115
 

powered by: WebSVN 2.1.0

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