AXI muckbucket
axi_base_test.svh
Go to the documentation of this file.
1 //
3 // Copyright (C) 2017, Matt Dew @ Dew Technologies, LLC
4 //
5 // This program is free software (logic verification): you can redistribute it
6 // and/or modify it under the terms of the GNU Lesser General Public License (LGPL)
7 // as published by the Free Software Foundation, either version 3 of the License,
8 // or (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful, but WITHOUT
11 // ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY or
12 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
13 // for more details.
14 //
15 // License: LGPL, v3, as defined and found on www.gnu.org,
16 // http://www.gnu.org/licenses/lgpl.html
17 //
18 //
19 // Author's intent: If you use this AXI verification code and find or fix bugs
20 // or make improvements, then share those fixes or improvements.
21 // If you use this in a bigger project, I don't care about,
22 // or want, any changes or code outside this block.
23 // Example: If you use this in an SoC simulation/testbench
24 // I don't want, or care about, your SoC or other blocks.
25 // I just care about the enhancements to these AXI files.
26 // That's why I have choosen the LGPL instead of the GPL.
28 
35 class axi_base_test : public uvm_test { public:
36 
38 
39  axi_env m_env;
42 
43  //memory m_memory;
44 
45  new (string name="axi_base_test", uvm_component parent=null) {
46  super.new(name, parent);
47  }
48 
49  void build_phase(uvm_phase phase) {
50 
51  int transactions;
52 
53  super.build_phase(phase);
54 
55  m_env = axi_env::type_id::create("m_env", this);
56 
57  m_seq = axi_seq::type_id::create("m_seq");
58 
59  if ($value$plusargs("transactions=%d", transactions)) {
60  uvm_info("plusargs", $sformatf("TRANSACTIONS: %0d", transactions), UVM_INFO)
61  m_seq.set_transaction_count(transactions);
62  }
63 
64 
65  m_resp_seq = axi_responder_seq::type_id::create("m_resp_seq");
66 
67 
68  }
69 
70  task run_phase(uvm_phase phase) {
71  phase.raise_objection(this);
72 
73  fork
74  m_resp_seq.start(m_env.m_responder_seqr);
75  join_none
76 
77  m_seq.start(m_env.m_driver_seqr);
78 
79  phase.drop_objection(this);
80  }
81 
82 
83 };
void set_transaction_count(int count)
How many transactions?
Definition: axi_seq.svh:92
void build_phase(uvm_phase phase)
base test. AXI tests are to be extended from this test.
axi_sequencer m_driver_seqr
Definition: axi_env.svh:37
axi_responder_seq m_resp_seq
task run_phase(uvm_phase phase)
Forever running sequence that setups up responder *ready toggle patterns, then receives TLM packet fr...
uvm_object_utils(axi_responder_seq) uvm_declare_p_sequencer(axi_sequencer) logic<7 new(string name="axi_responder_seq")
Constructor.
uvm_component_utils(axi_base_test) axi_env m_env
Writes to memory over AXI, backdoor readback, then AXI readback.
Definition: axi_seq.svh:33
Creates two active AXI agents, one master and one slave/responder, plus a memory. ...
Definition: axi_env.svh:32
axi_sequencer m_responder_seqr
Definition: axi_env.svh:38