AXI muckbucket
axi_sequential_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_sequential_reads_test : public axi_base_test { public:
35 
37 
38  axi_agent_config driver_agent_config;
40 
41  new (string name="axi_sequential_reads_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_reads_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  // Put the agent_config handle into config_db
70  uvm_config_db <axi_agent_config> ::set(null, "*", "m_axidriver_agent.m_config", driver_agent_config);
71 
72 
73  responder_agent_config = axi_agent_config::type_id::create("responder_agent_config", this);
74 
75 
76  assert(responder_agent_config.randomize() with {
77  // awready_toggle_pattern == 32'hFFFF_FFFF;
78  // wready_toggle_pattern == 32'h111_1111;
79  // arready_toggle_pattern == 32'hFFFF_FFFF;
80 
81  min_clks_between_r_transfers == 0;
82  max_clks_between_r_transfers == 3;
83  min_clks_between_b_transfers == 0;
84  max_clks_between_b_transfers == 3;
85 
86  });
87 
88  responder_agent_config.m_active = UVM_ACTIVE;
89  responder_agent_config.drv_type = e_RESPONDER;
90  responder_agent_config.axi_incompatible_wvalid_toggling_mode=0;
91 
92  //responder_agent_config.rvalid = new[1];
93  //responder_agent_config.rvalid[0] = 1'b1;
94 
95  // Put the agent_config handle into config_db
96  uvm_config_db <axi_agent_config> ::set(null, "*", "m_axiresponder_agent.m_config", responder_agent_config);
97 
98 
99  super.build_phase(phase);
100 
101  }
102 
103  task run_phase(uvm_phase phase) {
104 
105  //bit valid[];
106 
107  phase.raise_objection(this);
108 
109  fork
110  m_resp_seq.start(m_env.m_responder_seqr);
111  join_none
112 
113 
114  m_seq.start(m_env.m_driver_seqr);
115 
116 
117  phase.drop_objection(this);
118  }
119 
120 
121 };
base test. AXI tests are to be extended from this test.
axi_responder_seq m_resp_seq
Sequential AXI reads. No pipelining.
bit axi_incompatible_wvalid_toggling_mode
driver_type_t drv_type
uvm_component_utils(axi_sequential_reads_test) axi_agent_config driver_agent_config
new(string name="axi_agent_config")
Constructor.
Configuration object for an axi_agent.