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

📄 simple_seq_lib.sv

📁 This is OVM 2.0 source code .Very useful for developing system verilog Env
💻 SV
字号:
// $Id: simple_seq_lib.sv,v 1.6 2008/08/25 16:50:00 redelman Exp $//----------------------------------------------------------------------//   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 SIMPLE_SEQ_LIB_SV`define SIMPLE_SEQ_LIB_SV//------------------------------------------------------------------------------//// SEQUENCE: simple_seq_do////------------------------------------------------------------------------------class simple_seq_do extends ovm_sequence #(simple_item);  function new(string name="simple_seq_do");    super.new(name);  endfunction    `ovm_sequence_utils(simple_seq_do, simple_sequencer)      virtual task body();    ovm_report_info(get_name(), $psprintf("In body() of %s", get_name()),1000);    `ovm_do(req)  endtask  endclass : simple_seq_do//------------------------------------------------------------------------------//// SEQUENCE: simple_seq_do_with////------------------------------------------------------------------------------class simple_seq_do_with extends ovm_sequence #(simple_item);  function new(string name="simple_seq_do_with");    super.new(name);  endfunction    `ovm_sequence_utils(simple_seq_do_with, simple_sequencer)  virtual task body();    ovm_report_info(get_name(), $psprintf("In body() of %s", get_name()),1000);    `ovm_do_with(req, { req.addr == 16'h0123; req.data == 16'h0456; } )  endtask  endclass : simple_seq_do_with//------------------------------------------------------------------------------//// SEQUENCE: simple_seq_do_with_vars////------------------------------------------------------------------------------class simple_seq_do_with_vars extends ovm_sequence #(simple_item);  function new(string name="simple_seq_do_with_vars");    super.new(name);  endfunction    `ovm_sequence_utils(simple_seq_do_with_vars, simple_sequencer)      rand int unsigned start_addr;    constraint c1 { start_addr < 16'h0200; }  rand int unsigned start_data;    constraint c2 { start_data < 16'h0100; }  virtual task body();    ovm_report_info(get_name(), $psprintf("In body() of %s", get_name()),1000);    `ovm_do_with(req, { req.addr == start_addr; req.data == start_data; } )  endtask  endclass : simple_seq_do_with_vars//------------------------------------------------------------------------------//// SEQUENCE: simple_seq_sub_seqs////------------------------------------------------------------------------------class simple_seq_sub_seqs extends ovm_sequence #(simple_item);  function new(string name="simple_seq_sub_seqs");    super.new(name);  endfunction    `ovm_sequence_utils(simple_seq_sub_seqs, simple_sequencer)      simple_seq_do seq_do;  simple_seq_do_with seq_do_with;  simple_seq_do_with_vars seq_do_with_vars;  virtual task body();    ovm_report_info(get_name(), $psprintf("In body() of %s", get_name()),1000);    #100;    `ovm_do(seq_do)    #100;    `ovm_do(seq_do_with)    #100;    `ovm_do_with(seq_do_with_vars, { seq_do_with_vars.start_addr == 16'h0003; seq_do_with_vars.start_data == 16'h0009; } )  endtask  endclass : simple_seq_sub_seqs`endif // SIMPLE_SEQ_LIB_SV

⌨️ 快捷键说明

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