AXI muckbucket
axi_pipelined_reads_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 
34 class axi_pipelined_reads_test : public axi_base_test { public:
35 
37 
38 
39  axi_agent_config driver_agent_config;
41 
42  new (string name="axi_pipelined_reads_test", uvm_component parent=null) {
43  super.new(name, parent);
44  }
45 
46  void build_phase(uvm_phase phase) {
47 
48 
49  driver_agent_config = axi_agent_config::type_id::create("driver_agent_config", this);
50 
51 
52  assert(driver_agent_config.randomize() with {
53  // bready_toggle_pattern == 32'hFFFF_FFFF;
54  // rready_toggle_pattern == 32'hFFFF_FFFF;
55 
56  min_clks_between_ar_transfers == 0;
57  max_clks_between_ar_transfers == 3;
58  min_clks_between_aw_transfers == 0;
59  max_clks_between_aw_transfers == 3;
60  min_clks_between_w_transfers == 0;
61  max_clks_between_w_transfers == 3;
62  });
63 
64  driver_agent_config.m_active = UVM_ACTIVE;
65  driver_agent_config.drv_type = e_DRIVER;
66 
67  // Put the agent_config handle into config_db
68  uvm_config_db <axi_agent_config> ::set(null, "*", "m_axidriver_agent.m_config", driver_agent_config);
69 
70 
71  responder_agent_config = axi_agent_config::type_id::create("responder_agent_config", this);
72 
73 
74  assert(responder_agent_config.randomize() with {
75  // awready_toggle_pattern == 32'hFFFF_FFFF;
76  // wready_toggle_pattern == 32'hFFFF_FFFF;
77  // arready_toggle_pattern == 32'hFFFF_FFFF;
78 
79  min_clks_between_r_transfers == 0;
80  max_clks_between_r_transfers == 3;
81  min_clks_between_b_transfers == 0;
82  max_clks_between_b_transfers == 3;
83 
84  });
85 
86  responder_agent_config.m_active = UVM_ACTIVE;
87  responder_agent_config.drv_type = e_RESPONDER;
88 
89  // Put the agent_config handle into config_db
90  uvm_config_db <axi_agent_config> ::set(null, "*", "m_axiresponder_agent.m_config", responder_agent_config);
91 
92 
93  axi_seq::type_id::set_type_override(axi_pipelined_reads_seq::get_type(), 1);
94 
95  super.build_phase(phase);
96 
97  }
98 
99  task run_phase(uvm_phase phase) {
100 
101  phase.raise_objection(this);
102 
103  fork
104  m_resp_seq.start(m_env.m_responder_seqr);
105  join_none
106 
107  m_seq.start(m_env.m_driver_seqr);
108 
109 
110  phase.drop_objection(this);
111  }
112 
113 
114 };
base test. AXI tests are to be extended from this test.
axi_responder_seq m_resp_seq
driver_type_t drv_type
uvm_component_utils(axi_pipelined_reads_test) axi_agent_config driver_agent_config
new(string name="axi_agent_config")
Constructor.
Configuration object for an axi_agent.