idv_watchdog_sim_ovm.sv

Go to the documentation of this file.
00001 // $Id: idv_watchdog_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 Watchdog Timer for OVM.
00020  * This file contains a simulation watchdog 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_watchdog_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_WATCHDOG_SIM_OVM__SV
00043 `define IDV_WATCHDOG_SIM_OVM__SV
00044 
00045 `include "idv_watchdog_sim.sv"
00046 
00047 /**
00048  *  Simulation Watchdog Timer for OVM.
00049  *  Extends the base IDV watchdog timer to add OVM logging.
00050  *
00051  *  @class idv_watchdog_sim_ovm
00052  *
00053  */
00054 class idv_watchdog_sim_ovm extends idv_watchdog_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, the event to monitor, autostart enable/disable, file name macro, file line macro <br>
00066     *  @code
00067     *  idv_watchdog_sim_ovm m_watchdog;
00068     *  ...
00069     *  m_watchdog = new(5ns, m_event, this, 0, `ovm_file, `ovm_line);
00070     *  @endcode
00071     *
00072     *  @param countdown_time time - Time to countdown from
00073     *  @param watched_event event - Event that this watchdog is watching
00074     *  @param component ovm_component - OVM Component that contains this timer instance
00075     *  @param autostart bit - Start timer on construction (defaults to off)
00076     *  @param file_name string - Name of the file that contains this timer instance
00077     *  @param file_line int - Line number of the file that contains this timer instance
00078     */
00079    function new(time countdown_time, event watched_event, ovm_component component, bit autostart = 0, string file_name = "", int file_line = 0);
00080       super.new(countdown_time, watched_event, "", autostart);
00081       m_component_h = component;
00082       m_file_name = file_name;
00083       m_file_line = file_line;
00084    endfunction: new
00085 
00086    /**
00087     *  Alarm.
00088     *  Defines what happens when the countdown time expires.<br>
00089     *
00090     *  @return void
00091     */
00092    virtual function void alarm();
00093       m_component_h.ovm_report_fatal(m_component_h.get_type_name(), $psdisplay("WOOF! Time expired at time %0t", $time), OVM_NONE, m_file_name, m_file_line);
00094    endfunction: alarm
00095 
00096    /**
00097     *  Fatal Error.
00098     *  Defines what happens when a fatal error occurs in the base class (this class).<br>
00099     *
00100     *  @return void
00101     */
00102    virtual function void fatal_error(string msg = "");
00103       m_component_h.ovm_report_fatal(m_component_h.get_type_name(), $psdisplay("Fatal Timer Error: At time %0t; %s", $time, msg), OVM_NONE, m_file_name, m_file_line);
00104    endfunction: fatal_error
00105 
00106 endclass:idv_watchdog_sim_ovm
00107 
00108 `endif

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