VMM OpenSource - (expanded) sv/std_lib/vmm_scenario.sv

Expanded versions of source files are the output of the preprocessor. Lines subject to conditional compilation are not shown and all compiler pragmas have been stripped. Macros have been completely expanded.

sv/std_lib/vmm_scenario.sv unexpanded source

00001: //
00002: // -------------------------------------------------------------
00003: //    Copyright 2004-2008 Synopsys, 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: 
00022: 
00023: 
00024: 
00025: function vmm_scenario::new(vmm_log log );
00026:    super.new(log );
00027: endfunction: new
00028: 
00029: 
00030: function string vmm_scenario::psdisplay(string prefix);
00031:    int i;
00032: 
00033:    $sformat(psdisplay,
00034:             "%sScenario \"%s\": kind=%0d, length=%0d (max=%0d), repeated=%0d",
00035:             prefix, this.scenario_name(this.scenario_kind),
00036:             this.scenario_kind, this.length, this.max_length,
00037:             this.repeated);
00038: endfunction: psdisplay
00039: 
00040: 
00041: function int unsigned vmm_scenario::define_scenario(string name,
00042:                                                     int unsigned max_len);
00043:    define_scenario = this.next_scenario_kind++;
00044:    this.scenario_names[define_scenario] = name;
00045: 
00046:    if (max_len > this.max_length) this.max_length = max_len;
00047: endfunction: define_scenario
00048: 
00049: 
00050: function void vmm_scenario::redefine_scenario(int unsigned scenario_kind,
00051:                                               string       name,
00052:                                               int unsigned max_len);
00053:    this.scenario_names[scenario_kind] = name;
00054:     if (max_len > this.max_length) this.max_length = max_len;
00055: endfunction: redefine_scenario
00056: 
00057: 
00058: function string vmm_scenario::scenario_name(int unsigned scenario_kind);
00059:    if (!this.scenario_names.exists(scenario_kind)) begin
00060:       
     : do 
     :    /* synopsys translate_off */ 
     :    if (super.notify.log.start_msg(vmm_log::FAILURE_TYP, vmm_log::ERROR_SEV, "", -1)) begin 
     :       void'(super.notify.log.text($psprintf("Cannot find scenario name: undefined scenario kind %0d",
     :                                          scenario_kind))); 
     :       super.notify.log.end_msg(); 
     :    end 
     :    /* synopsys translate_on */ 
     : while (0);
00062:       return "?";
00063:    end
00064: 
00065:    scenario_name = this.scenario_names[scenario_kind];
00066: endfunction: scenario_name
00067: 
00068: 
00069: function int unsigned vmm_scenario::get_max_length();
00070:    return this.max_length;
00071: endfunction: get_max_length
00072: 
00073: function void vmm_scenario::set_parent_scenario(vmm_scenario parent);
00074:    this.parent = parent;
00075:    if(parent == null) return;
00076: endfunction: set_parent_scenario
00077: 
00078: function vmm_scenario vmm_scenario::get_parent_scenario();
00079:    get_parent_scenario = this.parent;
00080: endfunction: get_parent_scenario
00081: 
00082: task vmm_scenario::execute(ref int n);
00083: endtask: execute