00001 //---------------------------------------------------------------------- 00002 // Copyright 2007-2008 Mentor Graphics Corporation 00003 // Copyright 2007-2008 Cadence Design Systems, Inc. 00004 // All Rights Reserved Worldwide 00005 // 00006 // Licensed under the Apache License, Version 2.0 (the 00007 // "License"); you may not use this file except in 00008 // compliance with the License. You may obtain a copy of 00009 // the License at 00010 // 00011 // http://www.apache.org/licenses/LICENSE-2.0 00012 // 00013 // Unless required by applicable law or agreed to in 00014 // writing, software distributed under the License is 00015 // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 00016 // CONDITIONS OF ANY KIND, either express or implied. See 00017 // the License for the specific language governing 00018 // permissions and limitations under the License. 00019 //---------------------------------------------------------------------- 00020 00021 virtual class ovm_scenario #(type REQ = ovm_sequence_item, type RSP = REQ) extends ovm_sequence #(REQ, RSP); 00022 00023 ovm_scenario_controller_base m_scenario_controller; 00024 ovm_scenario_controller #(REQ, RSP) param_scenario_controller; 00025 00026 00027 00028 function new(string name = "scenario"); 00029 super.new(name); 00030 endfunction // new 00031 00032 virtual function integer get_id(); 00033 return (get_sequence_id()); 00034 endfunction 00035 00036 virtual task start(ovm_scenario_controller_base sequencer, 00037 ovm_scenario_base parent_sequence = null, 00038 integer this_priority = 100, 00039 bit call_pre_post = 1); 00040 00041 m_scenario_controller = sequencer; 00042 $cast(param_scenario_controller, m_scenario_controller); 00043 call_pre_post = 1; 00044 super.start(sequencer, parent_sequence, this_priority, call_pre_post); 00045 if (sequencer != null) begin 00046 unlock(); 00047 end 00048 endtask // start 00049 00050 virtual task pre_body(); 00051 // Request a valid sequence_id(); 00052 unlock(); 00053 return; 00054 endtask // pre_body 00055 00056 virtual task apply_request(input REQ data_req, input bit randomize = 1); 00057 00058 param_scenario_controller.apply_request(this, data_req, randomize); 00059 endtask 00060 00061 virtual task apply_send(input REQ data_req, input bit randomize = 1); 00062 param_scenario_controller.apply_send(this, data_req, randomize); 00063 endtask 00064 00065 virtual task apply(input REQ data_req, output RSP data_rsp, input bit randomize = 1); 00066 00067 param_scenario_controller.apply(this, data_req, data_rsp, randomize); 00068 endtask // apply 00069 00070 virtual task pre_apply(); 00071 return; 00072 endtask 00073 00074 virtual task mid_apply(); 00075 return; 00076 endtask 00077 00078 virtual task post_apply(); 00079 return; 00080 endtask // post_apply 00081 00082 function string get_scenario_path_name(); 00083 return (get_full_name()); 00084 endfunction // string 00085 00086 endclass 00087
![]() 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 Version: 1.5.5 Wed Jan 7 19:27:18 2009 |