APB UVM Agent  0.0.1
apb_write_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 write transaction.
22 */
23 class apb_write_seq extends uvm_sequence #(apb_seq_item);
24 
25 // UVM Factory Registration Macro
26 //
27 `uvm_object_utils(apb_write_seq)
28 
29 //------------------------------------------
30 // Data Members (Outputs rand, inputs non-rand)
31 //------------------------------------------
32 //! Transaction address.
33 rand logic [31:0] addr;
34 //! Transaction data (to be written).
35 rand 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_write_seq");
53 
54 /**
55 * Executes a single write transaction writing #data at the #addr address.
56 */
57 extern task body;
58 
59 endclass:apb_write_seq
60 
61 function apb_write_seq::new(string name = "apb_write_seq");
62  super.new(name);
63 endfunction
64 
66  apb_seq_item req = apb_seq_item::type_id::create("req");;
67 
68  begin
69  start_item(req);
70  req.we = 1;
71  req.addr = addr;
72  req.data = data;
73  finish_item(req);
74  end
75 
76 endtask:body
uvm_object_utils(apb_write_seq) rand logic< 31 rand logic< 31:0 > data
Transaction address.
task body()
Executes a single write transaction writing data at the #addr address.
Base APB transaction.
Executes a simple 32-bit APB write transaction.
new(string name="apb_write_seq")
Conventional UVM object constructor.