📄 xbus_slave_agent.sv
字号:
// $Id: //dvt/vtech/dev/main/ovm/examples/xbus/sv/xbus_slave_agent.sv#6 $//----------------------------------------------------------------------// Copyright 2007-2008 Mentor Graphics Corporation// Copyright 2007-2008 Cadence Design Systems, Inc.// All Rights Reserved Worldwide//// Licensed under the Apache License, Version 2.0 (the// "License"); you may not use this file except in// compliance with the License. You may obtain a copy of// the License at//// http://www.apache.org/licenses/LICENSE-2.0//// Unless required by applicable law or agreed to in// writing, software distributed under the License is// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR// CONDITIONS OF ANY KIND, either express or implied. See// the License for the specific language governing// permissions and limitations under the License.//----------------------------------------------------------------------`ifndef XBUS_SLAVE_AGENT_SV`define XBUS_SLAVE_AGENT_SV//------------------------------------------------------------------------------//// CLASS: xbus_slave_agent////------------------------------------------------------------------------------class xbus_slave_agent extends ovm_agent; protected ovm_active_passive_enum is_active = OVM_ACTIVE; xbus_slave_driver driver; xbus_slave_sequencer sequencer; xbus_slave_monitor monitor; // Provide implementations of virtual methods such as get_type_name and create `ovm_component_utils_begin(xbus_slave_agent) `ovm_field_enum(ovm_active_passive_enum, is_active, OVM_ALL_ON) `ovm_component_utils_end // new - constructor function new (string name, ovm_component parent); super.new(name, parent); endfunction : new // build virtual function void build(); super.build(); $cast(monitor, create_component("xbus_slave_monitor", "monitor")); monitor.build(); if(is_active == OVM_ACTIVE) begin $cast(driver, create_component("xbus_slave_driver", "driver")); driver.build(); $cast(sequencer, create_component("xbus_slave_sequencer", "sequencer")); sequencer.build(); driver.seq_item_prod_if.connect_if(sequencer.seq_item_cons_if); sequencer.addr_ph_port.connect(monitor.addr_ph_imp); end endfunction : build function void assign_vi(virtual interface xbus_if xsi); monitor.xsi = xsi; if (is_active == 1) begin sequencer.xsi = xsi; driver.xsi = xsi; end endfunction : assign_viendclass : xbus_slave_agent`endif // XBUS_SLAVE_AGENT_SV
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -