AXI muckbucket
axi_sequential_writes_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_sequential_writes_test : public axi_base_test { public:
35 
37 
38  axi_agent_config driver_agent_config;
40 
41  new (string name="axi_sequential_writes_test", uvm_component parent=null) {
42  super.new(name, parent);
43  }
44 
45  void build_phase(uvm_phase phase) {
46 
47  axi_seq::type_id::set_type_override(axi_sequential_writes_seq::get_type(), 1);
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  // these don't matter for sequential since
57  // they wont be back to back
58  min_clks_between_ar_transfers == 0;
59  max_clks_between_ar_transfers == 3;
60  min_clks_between_aw_transfers == 0;
61  max_clks_between_aw_transfers == 3;
62  min_clks_between_w_transfers == 0;
63  max_clks_between_w_transfers == 3;
64  });
65 
66  driver_agent_config.m_active = UVM_ACTIVE;
67  driver_agent_config.drv_type = e_DRIVER;
68 
69 
70  //driver_agent_config.wvalid = new[2];
71  //driver_agent_config.wvalid[0] = 1'b1;
72  //driver_agent_config.wvalid[1] = 1'b0;
73 
74 
75  // Put the agent_config handle into config_db
76  uvm_config_db <axi_agent_config> ::set(null, "*", "m_axidriver_agent.m_config", driver_agent_config);
77 
78 
79  responder_agent_config = axi_agent_config::type_id::create("responder_agent_config", this);
80 
81 
82  assert(responder_agent_config.randomize() with {
83  //awready_toggle_pattern == 32'hFFFF_FFFF;
84  // wready_toggle_pattern == 32'hFFFF_FFFF;
85  //arready_toggle_pattern == 32'hFFFF_FFFF;
86 
87  min_clks_between_r_transfers == 0;
88  max_clks_between_r_transfers == 3;
89  min_clks_between_b_transfers == 0;
90  max_clks_between_b_transfers == 3;
91 
92  });
93 
94  responder_agent_config.m_active = UVM_ACTIVE;
95  responder_agent_config.drv_type = e_RESPONDER;
96  //responder_agent_config.axi_incompatible_wvalid_toggling_mode=1;
97 
98 
99 
100  // Put the agent_config handle into config_db
101  uvm_config_db <axi_agent_config> ::set(null, "*", "m_axiresponder_agent.m_config", responder_agent_config);
102 
103 
104 
105  super.build_phase(phase);
106 
107  }
108 
109  task run_phase(uvm_phase phase) {
110 
111  phase.raise_objection(this);
112 
113  fork
114  m_resp_seq.start(m_env.m_responder_seqr);
115  join_none
116 
117  m_seq.start(m_env.m_driver_seqr);
118 
119 
120  phase.drop_objection(this);
121  }
122 
123 
124 };
base test. AXI tests are to be extended from this test.
axi_responder_seq m_resp_seq
Sequential AXI writes. No pipelining.
uvm_component_utils(axi_sequential_writes_test) axi_agent_config driver_agent_config
driver_type_t drv_type
new(string name="axi_agent_config")
Constructor.
Configuration object for an axi_agent.