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 typedef enum {FIFO, WEIGHTED, RANDOM, STRICT_FIFO, STRICT_RANDOM, USER} ARBITRATION_TYPE; 00022 00023 `ifndef INCA 00024 // INCA doesn't like this 00025 typedef class ovm_scenario_base; 00026 `endif 00027 00028 00029 class ovm_scenario_controller #(type REQ = ovm_sequence_item, type RSP = REQ) extends ovm_sequencer #(REQ, RSP); 00030 00031 ovm_seq_item_pull_imp #(REQ, RSP, this_type) get_req_export; 00032 ovm_sequence #(REQ, RSP) seq_ptr; 00033 00034 function new (string name, ovm_component parent); 00035 super.new(name, parent); 00036 count = 0; 00037 get_req_export = seq_item_export; 00038 endfunction // new 00039 00041 // 00042 // apply 00043 // send a scenario_item to the driver, and get 00044 // the response back 00046 00047 virtual task apply_request(ovm_scenario_base scenario, input REQ data_req, input bit randomize = 1); 00048 wait_for_grant(scenario); 00049 scenario.pre_apply(); 00050 if (randomize == 1) begin 00051 assert(data_req.randomize()); 00052 end 00053 scenario.mid_apply(); 00054 endtask 00055 00056 virtual task apply_send(ovm_scenario_base scenario, input REQ data_req, input bit randomize = 1); 00057 00058 apply_request(scenario, data_req, randomize); 00059 send_request(scenario, data_req); 00060 scenario.post_apply(); 00061 endtask 00062 00063 virtual task apply(ovm_scenario_base scenario, input REQ data_req, output RSP data_rsp, input bit randomize = 1); 00064 00065 apply_send(scenario, data_req, randomize); 00066 assert($cast(seq_ptr, scenario)); 00067 seq_ptr.get_response(data_rsp); 00068 scenario.post_apply(); 00069 endtask // apply 00070 00071 endclass 00072
![]() 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 |