ovm_scenario_driver.svh

Go to the documentation of this file.
00001 // $Id: a00273.html,v 1.1 2009/01/07 19:29:51 alex.marin Exp $
00002 //----------------------------------------------------------------------
00003 //   Copyright 2007-2008 Mentor Graphics Corporation
00004 //   Copyright 2007-2008 Cadence Design Systems, Inc.
00005 //   All Rights Reserved Worldwide
00006 //
00007 //   Licensed under the Apache License, Version 2.0 (the
00008 //   "License"); you may not use this file except in
00009 //   compliance with the License.  You may obtain a copy of
00010 //   the License at
00011 //
00012 //       http://www.apache.org/licenses/LICENSE-2.0
00013 //
00014 //   Unless required by applicable law or agreed to in
00015 //   writing, software distributed under the License is
00016 //   distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
00017 //   CONDITIONS OF ANY KIND, either express or implied.  See
00018 //   the License for the specific language governing
00019 //   permissions and limitations under the License.
00020 //----------------------------------------------------------------------
00021 
00022 
00023 //typedef class ovm_scenario_controller_base;
00024 //typedef class ovm_scenario_base;
00025 
00026 virtual class ovm_scenario_driver #(type REQ = ovm_sequence_item, type RSP = REQ) 
00027   extends ovm_driver #(REQ, RSP);
00028 
00029 typedef ovm_scenario_driver #(REQ, RSP) p_drv;
00030 typedef ovm_sequencer #(REQ, RSP) sequencer_t;
00031 ovm_seq_item_pull_port #(REQ, RSP) req_port;
00032 ovm_seq_item_pull_port #(REQ, RSP) put_rsp;
00033 
00034 
00035 function void set_scenario_controller(sequencer_t scenario_controller_ptr);
00036     seq_item_port.connect(scenario_controller_ptr.seq_item_export);
00037 endfunction
00038 
00039 function new (string name, ovm_component parent);
00040     super.new(name, parent);
00041     req_port = seq_item_port;
00042 endfunction // new
00043 
00044 function void end_of_elaboration();
00045     put_rsp = seq_item_port;
00046 endfunction // void
00047 
00048 
00050 //
00051 // get_next_item
00052 //   Called by the driver to issue a request from
00053 //   the scenario_controller and return the next scenario item
00055 
00056   virtual task get_next_item(output REQ req_item, input bit non_blocking = 0);
00057     if (non_blocking == 0) begin
00058       seq_item_port.get(req_item);
00059       
00060     end
00061     else begin
00062       if (seq_item_port.has_do_available() == 0) begin
00063         req_item = null;
00064         return;
00065       end
00066       seq_item_port.get(req_item);
00067     end
00068   endtask  
00069 
00070   virtual task run();
00071   endtask // run
00072 
00073 endclass
00074 

Intelligent Design Verification
Intelligent Design Verification
Project: OVM, Revision: 2.0.1
Copyright (c) 2008 Intelligent Design Verification.
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
A copy of the license is included here:
http://www.intelligentdv.com/licenses/fdl.txt
doxygen
Doxygen Version: 1.5.5
Wed Jan 7 19:27:18 2009
Find a documentation bug? Report bugs to: bugs.intelligentdv.com Project: DoxygenFilterSV