VMM OpenSource - sv/RAL/vmm_ral_version.sv

sv/RAL/vmm_ral_version.sv expanded 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 `ifndef RVM_RAL_VERSION__SV
00023 `define RVM_RAL_VERSION__SV
00024 
00025 
00026 class vmm_ral_version;
00027    extern function int major();
00028    extern function int minor();
00029    extern function int patch();
00030    extern function string vendor();
00031    extern function void display(string prefix = "");
00032    extern function string psdisplay(string prefix = "");
00033 endclass: vmm_ral_version
00034 
00035 function int vmm_ral_version::major();
00036    major = 1;
00037 endfunction: major
00038 
00039 function int vmm_ral_version::minor();
00040    minor = 12;
00041 endfunction: minor
00042 
00043 function int vmm_ral_version::patch();
00044    patch = 2;
00045 endfunction: patch
00046 
00047 
00048 function string vmm_ral_version::vendor();
00049    vendor = "Synopsys";
00050 endfunction: vendor
00051 
00052 function void vmm_ral_version::display(string prefix = "");
00053    $write("%s\n", this.psdisplay(prefix));
00054 endfunction: display
00055 
00056 function string vmm_ral_version::psdisplay(string prefix = "");
00057    $sformat(psdisplay, "%sVMM RAL Version %0d.%0d.%0d (%s)",
00058             prefix, this.major(), this.minor(), this.patch(),this.vendor());
00059 endfunction: psdisplay
00060 
00061 `endif // RVM_RAL_VERSION__SV