1 |
2 |
HanySalah |
//-----------------------------------------------------------------------------
|
2 |
|
|
//
|
3 |
|
|
// UART2BUS VERIFICATION
|
4 |
|
|
//
|
5 |
|
|
//-----------------------------------------------------------------------------
|
6 |
|
|
// CREATOR : HANY SALAH
|
7 |
|
|
// PROJECT : UART2BUS UVM TEST BENCH
|
8 |
|
|
// UNIT : TRANSACTION
|
9 |
|
|
//-----------------------------------------------------------------------------
|
10 |
|
|
// TITLE : UART Transaction
|
11 |
|
|
// DESCRIPTION: This
|
12 |
|
|
//-----------------------------------------------------------------------------
|
13 |
|
|
// LOG DETAILS
|
14 |
|
|
//-------------
|
15 |
|
|
// VERSION NAME DATE DESCRIPTION
|
16 |
|
|
// 1 HANY SALAH 31122015 FILE CREATION
|
17 |
|
|
// 2 HANY SALAH 01012016 COMPLETE ATTRIBUTES
|
18 |
|
|
//-----------------------------------------------------------------------------
|
19 |
|
|
// ALL COPYRIGHTS ARE RESERVED FOR THE PRODUCER ONLY .THIS FILE IS PRODUCED FOR
|
20 |
|
|
// OPENCORES MEMBERS ONLY AND IT IS PROHIBTED TO USE THIS MATERIAL WITHOUT THE
|
21 |
|
|
// CREATOR'S PERMISSION
|
22 |
|
|
//-----------------------------------------------------------------------------
|
23 |
|
|
class uart_transaction extends uvm_sequence_item;
|
24 |
|
|
|
25 |
|
|
// Represent the mode of operation either to be text or command mode
|
26 |
|
|
rand mode _mode;
|
27 |
|
|
|
28 |
|
|
// Represent the type of space either to be single space or tab
|
29 |
|
|
rand space_type _spacetype1,_spacetype2;
|
30 |
|
|
|
31 |
|
|
// Represent the wrong character used as a white space [Refer To Verification Plan For More Information]
|
32 |
|
|
rand byte space_wrong1;
|
33 |
|
|
|
34 |
|
|
// Represent the wrong character used as a white space [Refer To Verification Plan For More Information]
|
35 |
|
|
rand byte space_wrong2;
|
36 |
|
|
|
37 |
|
|
// Represent the used data through the stimulus
|
38 |
|
|
rand byte _data [];
|
39 |
|
|
|
40 |
|
|
// Represent the length of data used through the stimulus
|
41 |
|
|
rand int unsigned length_data;
|
42 |
|
|
|
43 |
|
|
// Represent the type of end of line used
|
44 |
|
|
rand eol_type _eoltype;
|
45 |
|
|
|
46 |
|
|
// Represent the wrong character used as an end of line [Refer To Verification Plan For More Information]
|
47 |
|
|
rand byte eol_wrong;
|
48 |
|
|
|
49 |
|
|
// Represent the used address through the stimulus
|
50 |
|
|
rand bit [15:0] address;
|
51 |
|
|
|
52 |
|
|
// Represent the type of command either read, write or no operation
|
53 |
|
|
rand command _command;
|
54 |
|
|
|
55 |
|
|
// Represent the acknowledge request
|
56 |
|
|
rand req _reqack;
|
57 |
|
|
|
58 |
|
|
// Represent the incremental address request
|
59 |
|
|
rand req _reqinc;
|
60 |
|
|
|
61 |
|
|
// Represent the character type of prefix in text mode command
|
62 |
|
|
rand char_type _chartype;
|
63 |
|
|
|
64 |
|
|
// Represent the internal bus state either free or busy
|
65 |
|
|
rand arbit _arbit;
|
66 |
|
|
|
67 |
|
|
// Represents random idle time
|
68 |
|
|
rand time time_before,time_after;
|
69 |
|
|
|
70 |
|
|
byte acknowledge;
|
71 |
|
|
|
72 |
|
|
int unsigned scale = 100;
|
73 |
|
|
|
74 |
|
|
`uvm_object_utils(uart_transaction)
|
75 |
|
|
|
76 |
|
|
function new (string name ="uart_transaction");
|
77 |
|
|
super.new(name);
|
78 |
|
|
endfunction: new
|
79 |
|
|
|
80 |
|
|
constraint data_length {
|
81 |
|
|
_data.size == length_data;
|
82 |
|
|
length_data <= 10;
|
83 |
|
|
time_before inside {200,300,400,500,600,700,800,900,1000};
|
84 |
|
|
time_after inside {200,300,400,500,600,700,800,900,1000};
|
85 |
|
|
}
|
86 |
|
|
|
87 |
|
|
extern function void do_copy (uvm_object rhs);
|
88 |
|
|
endclass:uart_transaction
|
89 |
|
|
|
90 |
|
|
|
91 |
|
|
function void uart_transaction::do_copy (uvm_object rhs);
|
92 |
|
|
uart_transaction _trans;
|
93 |
|
|
if (!$cast(_trans,rhs))
|
94 |
|
|
begin
|
95 |
|
|
`uvm_fatal("TYPE MISMATCH", "Type mismatch through do_copy method")
|
96 |
|
|
end
|
97 |
|
|
super.do_copy (_trans);
|
98 |
|
|
_mode =_trans._mode;
|
99 |
|
|
_spacetype1 =_trans._spacetype1;
|
100 |
|
|
_spacetype2 =_trans._spacetype2;
|
101 |
|
|
space_wrong1=_trans.space_wrong1;
|
102 |
|
|
space_wrong2=_trans.space_wrong2;
|
103 |
|
|
_data =_trans._data;
|
104 |
|
|
length_data =_trans.length_data;
|
105 |
|
|
_eoltype =_trans._eoltype;
|
106 |
|
|
eol_wrong =_trans.eol_wrong;
|
107 |
|
|
address =_trans.address;
|
108 |
|
|
_command =_trans._command;
|
109 |
|
|
_reqack =_trans._reqack;
|
110 |
|
|
_reqinc =_trans._reqinc;
|
111 |
|
|
_chartype =_trans._chartype;
|
112 |
|
|
_arbit =_trans._arbit;
|
113 |
|
|
time_before =_trans.time_before;
|
114 |
|
|
time_after =_trans.time_after;
|
115 |
|
|
acknowledge = _trans.acknowledge;
|
116 |
|
|
endfunction:do_copy
|