|
| 1 | +/************************************************************************************ |
| 2 | + * A full-featured AHB 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 ahb_env_example extends uvm_env; |
| 20 | + `uvm_component_utils(ahb_env_example) |
| 21 | + |
| 22 | + typedef ahb_agent#( |
| 23 | + .DATA_WIDTH(32), |
| 24 | + .ADDR_WIDTH(32), |
| 25 | + .HBURST_WIDTH(0), |
| 26 | + .HPROT_WIDTH(4), |
| 27 | + .HMASTER_WIDTH |
| 28 | + ) example_agent; |
| 29 | + |
| 30 | + // Group: Class Properties |
| 31 | + //////////////////////////////////////////////////////////////////////////////////////////////// |
| 32 | + |
| 33 | + example_agent completer_agent; |
| 34 | + example_agent requester_agent; |
| 35 | + |
| 36 | + // Group: Constructor |
| 37 | + //////////////////////////////////////////////////////////////////////////////////////////////// |
| 38 | + |
| 39 | + // Constructor: new |
| 40 | + function new(string name="ahb_env_example", uvm_component parent=null); |
| 41 | + super.new(name, parent); |
| 42 | + endfunction : new |
| 43 | + |
| 44 | + virtual function void build_phase(uvm_phase phase); |
| 45 | + super.build_phase(phase); |
| 46 | + |
| 47 | + completer_agent = example_agent::type_id::create("completer_agent", this); |
| 48 | + completer_agent.m_cfg = ahb_agent_config::type_id::create("completer_cfg"); |
| 49 | + completer_agent.m_cfg.agent_mode = AHB_COMPLETER_AGENT; |
| 50 | + completer_agent.m_cfg.is_active = UVM_ACTIVE; |
| 51 | + |
| 52 | + requester_agent = example_agent::type_id::create("requester_agent", this); |
| 53 | + requester_agent.m_cfg = ahb_agent_config::type_id::create("completer_cfg"); |
| 54 | + requester_agent.m_cfg.agent_mode = AHB_REQUESTER_AGENT; |
| 55 | + requester_agent.m_cfg.is_active = UVM_ACTIVE; |
| 56 | + |
| 57 | + endfunction : build_phase |
| 58 | + |
| 59 | +endclass : ahb_env_example |
0 commit comments