⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 xbus_transfer.sv

📁 Open Verification Methodology
💻 SV
字号:
// $Id: //dvt/vtech/dev/main/ovm/examples/xbus/sv/xbus_transfer.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_TRANSFER_SV`define XBUS_TRANSFER_SV//------------------------------------------------------------------------------//// xbus transfer enums, parameters, and events////------------------------------------------------------------------------------typedef enum { NOP,               READ,               WRITE             } xbus_read_write_enum;//------------------------------------------------------------------------------//// CLASS: xbus_transfer////------------------------------------------------------------------------------class xbus_transfer extends ovm_sequence_item;                                    rand bit [15:0]           addr;  rand xbus_read_write_enum read_write;  rand int unsigned         size;  rand bit [7:0]            data[];  rand int unsigned         wait_state[];  rand int unsigned         error_pos;  rand int unsigned         transmit_delay = 0;  string                    master = "";  string                    slave = "";  constraint c_read_write {    read_write inside { READ, WRITE };  }  constraint c_size {    size inside {1,2,4,8};  }  constraint c_data_wait_size {    data.size() == size;    wait_state.size() == size;  }  constraint c_transmit_delay {     transmit_delay <= 10 ;   }  constraint c_max_wait_state { foreach (wait_state[i]) wait_state[i] <= 8; }  `ovm_object_utils_begin(xbus_transfer)    `ovm_field_int      (addr,           OVM_ALL_ON)    `ovm_field_enum     (xbus_read_write_enum, read_write, OVM_ALL_ON)    `ovm_field_int      (size,           OVM_ALL_ON)    `ovm_field_array_int(data,           OVM_ALL_ON)    `ovm_field_array_int(wait_state,     OVM_ALL_ON)    `ovm_field_int      (error_pos,      OVM_ALL_ON)    `ovm_field_int      (transmit_delay, OVM_ALL_ON)    `ovm_field_string   (master,         OVM_ALL_ON|OVM_NOCOMPARE)    `ovm_field_string   (slave,          OVM_ALL_ON|OVM_NOCOMPARE)  `ovm_object_utils_end  // new - constructor  function new (string name = "xbus_transfer_inst",                ovm_sequencer_base sequencer = null,                ovm_sequence parent_seq = null);    super.new(name, sequencer, parent_seq);  endfunction : newendclass : xbus_transfer`endif // XBUS_TRANSFER_SV

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -