Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

sc_wait_cthread.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002 
00003   The following code is derived, directly or indirectly, from the SystemC
00004   source code Copyright (c) 1996-2004 by all Contributors.
00005   All Rights reserved.
00006 
00007   The contents of this file are subject to the restrictions and limitations
00008   set forth in the SystemC Open Source License Version 2.3 (the "License");
00009   You may not use this file except in compliance with such restrictions and
00010   limitations. You may obtain instructions on how to receive a copy of the
00011   License at http://www.systemc.org/. Software distributed by Contributors
00012   under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF
00013   ANY KIND, either express or implied. See the License for the specific
00014   language governing rights and limitations under the License.
00015 
00016  *****************************************************************************/
00017 
00018 /*****************************************************************************
00019 
00020   sc_wait_cthread.h -- Wait() and related functions for SC_CTHREADs.
00021 
00022   Original Author: Stan Y. Liao, Synopsys, Inc.
00023                    Martin Janssen, Synopsys, Inc.
00024 
00025  *****************************************************************************/
00026 
00027 /******************************************************************************
00028 
00029   MODIFICATION LOG - modifiers, enter your name, affiliation, date and
00030   changes you are making here.
00031 
00032       Name, Affiliation, Date:
00033   Description of Modification:
00034 
00035 ******************************************************************************/
00036 
00037 #ifndef SC_WAIT_CTHREAD_H
00038 #define SC_WAIT_CTHREAD_H
00039 
00040 
00041 #include "systemc/kernel/sc_lambda.h"
00042 #include "systemc/kernel/sc_simcontext.h"
00043 
00044 
00045 // for SC_CTHREADs
00046 
00047 extern
00048 void
00049 halt( sc_simcontext* = sc_get_curr_simcontext() );
00050 
00051 
00052 extern
00053 void
00054 wait( int,
00055       sc_simcontext* = sc_get_curr_simcontext() );
00056 
00057 
00058 extern
00059 void
00060 wait_until( const sc_lambda_ptr&,
00061       sc_simcontext* = sc_get_curr_simcontext() );
00062 
00063 inline
00064 void
00065 wait_until( const sc_signal_bool_deval& s,
00066       sc_simcontext* simc = sc_get_curr_simcontext() )
00067 {
00068     wait_until( sc_lambda_ptr( s ), simc );
00069 }
00070 
00071 
00072 extern
00073 void
00074 at_posedge( const sc_signal_in_if<bool>&,
00075       sc_simcontext* = sc_get_curr_simcontext() );
00076 
00077 extern
00078 void
00079 at_posedge( const sc_signal_in_if<sc_logic>&,
00080       sc_simcontext* = sc_get_curr_simcontext() );
00081 
00082 extern
00083 void
00084 at_negedge( const sc_signal_in_if<bool>&,
00085       sc_simcontext* = sc_get_curr_simcontext() );
00086 
00087 extern
00088 void
00089 at_negedge( const sc_signal_in_if<sc_logic>&,
00090       sc_simcontext* = sc_get_curr_simcontext() );
00091 
00092 
00093 inline
00094 void
00095 watching( const sc_lambda_ptr& lambda,
00096     sc_simcontext* simc = sc_get_curr_simcontext() )
00097 {
00098     (*simc->m_watching_fn)( lambda, simc );
00099 }
00100 
00101 inline
00102 void
00103 watching( const sc_signal_bool_deval& s,
00104     sc_simcontext* simc = sc_get_curr_simcontext() )
00105 {
00106     (*simc->m_watching_fn)( sc_lambda_ptr( s ), simc );
00107 }
00108 
00109 
00110 extern
00111 void
00112 __open_watching( sc_cthread_handle );
00113 
00114 extern
00115 void
00116 __close_watching( sc_cthread_handle );
00117 
00118 extern
00119 int
00120 __watch_level( sc_cthread_handle );
00121 
00122 extern
00123 void
00124 __watching_first( sc_cthread_handle );
00125 
00126 extern
00127 void
00128 __sanitycheck_watchlists( sc_cthread_handle );
00129 
00130 
00131 class sc_watch
00132 {
00133 public:
00134 
00135     sc_cthread_handle cthread_h;
00136 
00137     sc_watch( sc_simcontext* simc )
00138     {
00139         sc_curr_proc_handle cpi = simc->get_curr_proc_info();
00140         assert( SC_CTHREAD_PROC_ == cpi->kind );
00141         cthread_h = RCAST<sc_cthread_handle>( cpi->process_handle );
00142         __open_watching( cthread_h );
00143     }
00144 
00145     ~sc_watch()
00146     {
00147         __close_watching( cthread_h );
00148     }
00149 };
00150 
00151 
00152 #endif

Generated on Fri Jan 14 08:29:09 2005 for SystemC2.1beta11(excludingMSLib)(IncludingSCV)\nProvidedby:www.openverificationfoundation.org by doxygen1.2.18