|
| 1 | +/************************************************************************************ |
| 2 | + * A full-featured APB UVM Agent |
| 3 | + * Copyright (C) 2025 RISCY-Lib Contributors |
| 4 | + * |
| 5 | + * This program is free software: you can redistribute it and/or modify |
| 6 | + * it under the terms of the GNU General Public License as published by |
| 7 | + * the Free Software Foundation, either version 3 of the License, or |
| 8 | + * (at your option) any later version. |
| 9 | + * |
| 10 | + * This program is distributed in the hope that it will be useful, |
| 11 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | + * GNU General Public License for more details. |
| 14 | + * |
| 15 | + * You should have received a copy of the GNU General Public License |
| 16 | + * along with this program. If not, see <https://www.gnu.org/licenses/>. |
| 17 | + ************************************************************************************/ |
| 18 | + |
| 19 | +class apb_env_example extends uvm_env; |
| 20 | + `uvm_component_utils(apb_env_example) |
| 21 | + |
| 22 | + typedef apb_agent#(.DATA_WIDTH(32), .ADDR_WIDTH(32)) example_agent; |
| 23 | + |
| 24 | + // Group: Class Properties |
| 25 | + //////////////////////////////////////////////////////////////////////////////////////////////// |
| 26 | + |
| 27 | + example_agent completer_agent; |
| 28 | + example_agent requester_agent; |
| 29 | + |
| 30 | + // Group: Constructor |
| 31 | + //////////////////////////////////////////////////////////////////////////////////////////////// |
| 32 | + |
| 33 | + // Constructor: new |
| 34 | + function new(string name="apb_env_example", uvm_component parent=null); |
| 35 | + super.new(name, parent); |
| 36 | + endfunction : new |
| 37 | + |
| 38 | + virtual function void build_phase(uvm_phase phase); |
| 39 | + super.build_phase(phase); |
| 40 | + |
| 41 | + completer_agent = example_agent::type_id::create("completer_agent", this); |
| 42 | + completer_agent.m_cfg = apb_agent_config::type_id::create("completer_cfg"); |
| 43 | + completer_agent.m_cfg.agent_mode = APB_COMPLETER_AGENT; |
| 44 | + completer_agent.m_cfg.is_active = UVM_ACTIVE; |
| 45 | + |
| 46 | + requester_agent = example_agent::type_id::create("requester_agent", this); |
| 47 | + requester_agent.m_cfg = apb_agent_config::type_id::create("completer_cfg"); |
| 48 | + requester_agent.m_cfg.agent_mode = APB_REQUESTER_AGENT; |
| 49 | + requester_agent.m_cfg.is_active = UVM_ACTIVE; |
| 50 | + |
| 51 | + endfunction : build_phase |
| 52 | + |
| 53 | +endclass : apb_env_example |
0 commit comments