APB UVM Agent  0.0.1
apb_read_seq.svh
Go to the documentation of this file.
1 //------------------------------------------------------------
2 // Copyright 2010 Mentor Graphics Corporation
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 
20 /**
21 * Executes a simple 32-bit APB read transaction.
22 */
23 class apb_read_seq extends uvm_sequence #(apb_seq_item);
24 
25 // UVM Factory Registration Macro
26 //
27 `uvm_object_utils(apb_read_seq)
28 
29 //------------------------------------------
30 // Data Members (Outputs rand, inputs non-rand)
31 //------------------------------------------
32 //! Transaction address.
33 rand logic [31:0] addr;
34 //! Transaction data (read from the address).
35 logic [31:0] data;
36 
37 //------------------------------------------
38 // Constraints
39 //------------------------------------------
40 
41 
42 
43 //------------------------------------------
44 // Methods
45 //------------------------------------------
46 
47 // Standard UVM Methods:
48 
49 /**
50 * Conventional UVM object constructor.
51 */
52 extern function new(string name = "apb_read_seq");
53 
54 /**
55 * Executes a single read transaction from the #addr address, placing the return
56 * data in the #data field.
57 */
58 extern task body;
59 
60 endclass:apb_read_seq
61 
62 function apb_read_seq::new(string name = "apb_read_seq");
63  super.new(name);
64 endfunction
65 
67  apb_seq_item req = apb_seq_item::type_id::create("req");;
68 
69  begin
70  start_item(req);
71  req.we = 0;
72  req.addr = addr;
73  finish_item(req);
74  data = req.data;
75  end
76 
77 endtask:body
new(string name="apb_read_seq")
Conventional UVM object constructor.
Base APB transaction.
Executes a simple 32-bit APB read transaction.
uvm_object_utils(apb_read_seq) rand logic< 31 logic< 31:0 > data
Transaction address.
task body()
Executes a single read transaction from the #addr address, placing the return data in the data field...