idv_timer_sim_ovm.sv

Go to the documentation of this file.
00001 // $Id: idv_timer_sim_ovm.sv 9 2009-05-31 23:41:02Z seanoboyle $
00002 //----------------------------------------------------------------------------
00003 //    This program is free software: you can redistribute it and/or modify
00004 //    it under the terms of the GNU General Public License as published by
00005 //    the Free Software Foundation, either version 3 of the License, or
00006 //    (at your option) any later version.
00007 //
00008 //    This program is distributed in the hope that it will be useful,
00009 //    but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00011 //    GNU General Public License for more details.
00012 //
00013 //    You should have received a copy of the GNU General Public License
00014 //    along with this program.  If not, see <http://www.gnu.org/licenses/>.
00015 //
00016 //----------------------------------------------------------------------------
00017 
00018 /**
00019  * Simulation Countdown Timer for OVM.
00020  * This file contains a simulation countdown timer with OVM Logging.<br>
00021  * <br>
00022  * @par Download the most recent version here:
00023  * http://intelligentdv.com/downloads/
00024  * <br>
00025  * @par File Bugs Here:
00026  * http://bugs.intelligentdv.com/ <br>
00027  * Project:  Timers
00028  *
00029  * @file idv_timer_sim_ovm.sv
00030  * @author Sean O'Boyle
00031  * @par Contact:
00032  * http://intelligentdv.com/contact/
00033  * @par Company:
00034  * <a href="http://intelligentdv.com">Intelligent Design Verification</a>
00035  *
00036  * $LastChangedRevision: 9 $
00037  * $LastChangedDate: 2009-05-31 16:41:02 -0700 (Sun, 31 May 2009) $
00038  * $LastChangedBy: seanoboyle $
00039  *
00040  */
00041 
00042 `ifndef IDV_TIMER_SIM_OVM__SV
00043 `define IDV_TIMER_SIM_OVM__SV
00044 
00045 `include "idv_timer_sim.sv"
00046 
00047 /**
00048  *  Simulation Countdown Timer for OVM.
00049  *  This class is a simulation countdown timer with OVM logging.
00050  *
00051  *  @class idv_timer_sim_ovm
00052  *
00053  */
00054 class idv_timer_sim_ovm extends idv_timer_sim;
00055 
00056    ovm_component m_component_h; ///< Component Handle
00057    string        m_file_name;   ///< File Name of file that contains this timer instance
00058    int           m_file_line;   ///< Line number of file where this timer is instantiated
00059 
00060    /**
00061     *  Constructor.
00062     *  Class Constructor <br>
00063     *  <br>
00064     *  Usage:<br>
00065     *  At construction pass: time value for countdown, autostart enable/disable, file name macro, file line macro <br>
00066     *  @code
00067     *  idv_timer_sim_ovm m_timer;
00068     *  ...
00069     *  m_timer = new(5ns, this, 0, `ovm_file, `ovm_line);
00070     *  @endcode
00071     *
00072     *  @param countdown_time time - Time to countdown from
00073     *  @param component ovm_component - OVM Component that contains this timer instance
00074     *  @param autostart bit - Start timer on construction (defaults to off)
00075     *  @param file_name string - Name of the file that contains this timer instance
00076     *  @param file_line int - Line number of the file that contains this timer instance
00077     */
00078    function new(time countdown_time, ovm_component component, bit autostart = 0, string file_name = "", int file_line = 0);
00079       super.new(countdown_time, "", autostart);
00080       m_component_h = component;
00081       m_file_name = file_name;
00082       m_file_line = file_line;
00083    endfunction: new
00084 
00085    /**
00086     *  Alarm.
00087     *  Defines what happens when the countdown time expires.<br>
00088     *
00089     *  @return void
00090     */
00091    virtual function void alarm();
00092       m_component_h.ovm_report_fatal(m_component_h.get_type_name(), $psdisplay("Timer expired at time %0t", $time), OVM_NONE, m_file_name, m_file_line);
00093    endfunction: alarm
00094 
00095    /**
00096     *  Fatal Error.
00097     *  Defines what happens when a fatal error occurs in the base class (this class).<br>
00098     *
00099     *  @return void
00100     */
00101    virtual function void fatal_error(string msg = "");
00102       m_component_h.ovm_report_fatal(m_component_h.get_type_name(), $psdisplay("Fatal Error: At time %0t; %s", $time, msg), OVM_NONE, m_file_name, m_file_line);
00103    endfunction: fatal_error
00104 
00105 endclass:idv_timer_sim_ovm
00106 
00107 `endif
00108 

Intelligent Design Verification
Intelligent Design Verification
Project: Timers, Revision: 1.2.0
Copyright (c) 2008-2010 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.6.3
IDV SV Filter Version: 2.6.3
Sat Jun 19 12:13:58 2010
Find a documentation bug? Report bugs to: bugs.intelligentdv.com Project: DoxygenFilterSV