112027Sjungma@eit.uni-kl.de/*****************************************************************************
212027Sjungma@eit.uni-kl.de
312027Sjungma@eit.uni-kl.de  Licensed to Accellera Systems Initiative Inc. (Accellera) under one or
412027Sjungma@eit.uni-kl.de  more contributor license agreements.  See the NOTICE file distributed
512027Sjungma@eit.uni-kl.de  with this work for additional information regarding copyright ownership.
612027Sjungma@eit.uni-kl.de  Accellera licenses this file to you under the Apache License, Version 2.0
712027Sjungma@eit.uni-kl.de  (the "License"); you may not use this file except in compliance with the
812027Sjungma@eit.uni-kl.de  License.  You may obtain a copy of the License at
912027Sjungma@eit.uni-kl.de
1012027Sjungma@eit.uni-kl.de    http://www.apache.org/licenses/LICENSE-2.0
1112027Sjungma@eit.uni-kl.de
1212027Sjungma@eit.uni-kl.de  Unless required by applicable law or agreed to in writing, software
1312027Sjungma@eit.uni-kl.de  distributed under the License is distributed on an "AS IS" BASIS,
1412027Sjungma@eit.uni-kl.de  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
1512027Sjungma@eit.uni-kl.de  implied.  See the License for the specific language governing
1612027Sjungma@eit.uni-kl.de  permissions and limitations under the License.
1712027Sjungma@eit.uni-kl.de
1812027Sjungma@eit.uni-kl.de *****************************************************************************/
1912027Sjungma@eit.uni-kl.de
2012027Sjungma@eit.uni-kl.de/*****************************************************************************
2112027Sjungma@eit.uni-kl.de
2212027Sjungma@eit.uni-kl.de  sc_cthread_process.h -- Clocked thread declarations
2312027Sjungma@eit.uni-kl.de
2412027Sjungma@eit.uni-kl.de  Original Author: Andy Goodrich, Forte Design Systems, 4 August 2005
2512027Sjungma@eit.uni-kl.de
2612027Sjungma@eit.uni-kl.de
2712027Sjungma@eit.uni-kl.de  CHANGE LOG AT THE END OF THE FILE
2812027Sjungma@eit.uni-kl.de *****************************************************************************/
2912027Sjungma@eit.uni-kl.de
3012027Sjungma@eit.uni-kl.de
3112027Sjungma@eit.uni-kl.de#if !defined(sc_cthread_process_h_INCLUDED)
3212027Sjungma@eit.uni-kl.de#define sc_cthread_process_h_INCLUDED
3312027Sjungma@eit.uni-kl.de
3412027Sjungma@eit.uni-kl.de#include "sysc/kernel/sc_thread_process.h"
3512027Sjungma@eit.uni-kl.de
3612027Sjungma@eit.uni-kl.denamespace sc_core {
3712027Sjungma@eit.uni-kl.de
3812027Sjungma@eit.uni-kl.de// friend function declarations:
3912027Sjungma@eit.uni-kl.de
4012027Sjungma@eit.uni-kl.devoid halt( sc_simcontext* );
4112027Sjungma@eit.uni-kl.devoid wait( int, sc_simcontext* );
4212027Sjungma@eit.uni-kl.de
4312027Sjungma@eit.uni-kl.de
4412027Sjungma@eit.uni-kl.de//==============================================================================
4512027Sjungma@eit.uni-kl.de// sc_cthread_process -
4612027Sjungma@eit.uni-kl.de//
4712027Sjungma@eit.uni-kl.de//==============================================================================
4812027Sjungma@eit.uni-kl.declass sc_cthread_process : public sc_thread_process {
4912027Sjungma@eit.uni-kl.de
5012027Sjungma@eit.uni-kl.de    friend class sc_module;
5112027Sjungma@eit.uni-kl.de    friend class sc_process_handle;
5212027Sjungma@eit.uni-kl.de    friend class sc_process_table;
5312027Sjungma@eit.uni-kl.de    friend class sc_thread_process;
5412027Sjungma@eit.uni-kl.de    friend class sc_simcontext;
5512027Sjungma@eit.uni-kl.de
5612027Sjungma@eit.uni-kl.de    friend void sc_cthread_cor_fn( void* );
5712027Sjungma@eit.uni-kl.de
5812027Sjungma@eit.uni-kl.de    friend void halt( sc_simcontext* );
5912027Sjungma@eit.uni-kl.de    friend void wait( int, sc_simcontext* );
6012027Sjungma@eit.uni-kl.de
6112027Sjungma@eit.uni-kl.de  public:
6212027Sjungma@eit.uni-kl.de    sc_cthread_process( const char* name_p, bool free_host,
6312027Sjungma@eit.uni-kl.de        SC_ENTRY_FUNC method_p, sc_process_host* host_p,
6412027Sjungma@eit.uni-kl.de        const sc_spawn_options* opt_p );
6512027Sjungma@eit.uni-kl.de
6612027Sjungma@eit.uni-kl.de    virtual void dont_initialize( bool dont );
6712027Sjungma@eit.uni-kl.de    virtual const char* kind() const
6812027Sjungma@eit.uni-kl.de        { return "sc_cthread_process"; }
6912027Sjungma@eit.uni-kl.de
7012027Sjungma@eit.uni-kl.deprivate:
7112027Sjungma@eit.uni-kl.de
7212027Sjungma@eit.uni-kl.de    sc_cthread_process( const char*   nm,
7312027Sjungma@eit.uni-kl.de            SC_ENTRY_FUNC fn,
7412027Sjungma@eit.uni-kl.de            sc_process_host*    host );
7512027Sjungma@eit.uni-kl.de
7612027Sjungma@eit.uni-kl.de    // may not be deleted manually (called from sc_process_b)
7712027Sjungma@eit.uni-kl.de    virtual ~sc_cthread_process();
7812027Sjungma@eit.uni-kl.de
7912027Sjungma@eit.uni-kl.de    bool eval_watchlist();
8012027Sjungma@eit.uni-kl.de    bool eval_watchlist_curr_level();
8112027Sjungma@eit.uni-kl.de
8212027Sjungma@eit.uni-kl.de    void wait_halt();
8312027Sjungma@eit.uni-kl.de
8412027Sjungma@eit.uni-kl.de};
8512027Sjungma@eit.uni-kl.de
8612027Sjungma@eit.uni-kl.de//------------------------------------------------------------------------------
8712027Sjungma@eit.uni-kl.de//"sc_cthread_process::wait_halt"
8812027Sjungma@eit.uni-kl.de//
8912027Sjungma@eit.uni-kl.de//------------------------------------------------------------------------------
9012027Sjungma@eit.uni-kl.deinline void sc_cthread_process::wait_halt()
9112027Sjungma@eit.uni-kl.de{
9212027Sjungma@eit.uni-kl.de    m_wait_cycle_n = 0;
9312027Sjungma@eit.uni-kl.de    suspend_me();
9412027Sjungma@eit.uni-kl.de    throw sc_halt();
9512027Sjungma@eit.uni-kl.de}
9612027Sjungma@eit.uni-kl.de
9712027Sjungma@eit.uni-kl.de} // namespace sc_core
9812027Sjungma@eit.uni-kl.de
9912027Sjungma@eit.uni-kl.de// $Log: sc_cthread_process.h,v $
10012027Sjungma@eit.uni-kl.de// Revision 1.8  2011/08/26 20:46:09  acg
10112027Sjungma@eit.uni-kl.de//  Andy Goodrich: moved the modification log to the end of the file to
10212027Sjungma@eit.uni-kl.de//  eliminate source line number skew when check-ins are done.
10312027Sjungma@eit.uni-kl.de//
10412027Sjungma@eit.uni-kl.de// Revision 1.7  2011/02/18 20:27:14  acg
10512027Sjungma@eit.uni-kl.de//  Andy Goodrich: Updated Copyrights.
10612027Sjungma@eit.uni-kl.de//
10712027Sjungma@eit.uni-kl.de// Revision 1.6  2011/02/13 21:47:37  acg
10812027Sjungma@eit.uni-kl.de//  Andy Goodrich: update copyright notice.
10912027Sjungma@eit.uni-kl.de//
11012027Sjungma@eit.uni-kl.de// Revision 1.5  2011/02/11 13:25:24  acg
11112027Sjungma@eit.uni-kl.de//  Andy Goodrich: Philipp A. Hartmann's changes:
11212027Sjungma@eit.uni-kl.de//    (1) Removal of SC_CTHREAD method overloads.
11312027Sjungma@eit.uni-kl.de//    (2) New exception processing code.
11412027Sjungma@eit.uni-kl.de//
11512027Sjungma@eit.uni-kl.de// Revision 1.4  2011/02/01 21:01:41  acg
11612027Sjungma@eit.uni-kl.de//  Andy Goodrich: removed throw_reset() as it is now handled by the parent
11712027Sjungma@eit.uni-kl.de//  method sc_thread_process::throw_reset().
11812027Sjungma@eit.uni-kl.de//
11912027Sjungma@eit.uni-kl.de// Revision 1.3  2011/01/18 20:10:44  acg
12012027Sjungma@eit.uni-kl.de//  Andy Goodrich: changes for IEEE1666_2011 semantics.
12112027Sjungma@eit.uni-kl.de//
12212027Sjungma@eit.uni-kl.de// Revision 1.2  2008/05/22 17:06:25  acg
12312027Sjungma@eit.uni-kl.de//  Andy Goodrich: updated copyright notice to include 2008.
12412027Sjungma@eit.uni-kl.de//
12512027Sjungma@eit.uni-kl.de// Revision 1.1.1.1  2006/12/15 20:20:05  acg
12612027Sjungma@eit.uni-kl.de// SystemC 2.3
12712027Sjungma@eit.uni-kl.de//
12812027Sjungma@eit.uni-kl.de// Revision 1.6  2006/05/08 17:57:13  acg
12912027Sjungma@eit.uni-kl.de//  Andy Goodrich: Added David Long's forward declarations for friend functions
13012027Sjungma@eit.uni-kl.de//  to keep the Microsoft C++ compiler happy.
13112027Sjungma@eit.uni-kl.de//
13212027Sjungma@eit.uni-kl.de// Revision 1.5  2006/04/20 17:08:16  acg
13312027Sjungma@eit.uni-kl.de//  Andy Goodrich: 3.0 style process changes.
13412027Sjungma@eit.uni-kl.de//
13512027Sjungma@eit.uni-kl.de// Revision 1.4  2006/04/11 23:13:20  acg
13612027Sjungma@eit.uni-kl.de//   Andy Goodrich: Changes for reduced reset support that only includes
13712027Sjungma@eit.uni-kl.de//   sc_cthread, but has preliminary hooks for expanding to method and thread
13812027Sjungma@eit.uni-kl.de//   processes also.
13912027Sjungma@eit.uni-kl.de//
14012027Sjungma@eit.uni-kl.de// Revision 1.3  2006/01/13 18:44:29  acg
14112027Sjungma@eit.uni-kl.de// Added $Log to record CVS changes into the source.
14212027Sjungma@eit.uni-kl.de//
14312027Sjungma@eit.uni-kl.de
14412027Sjungma@eit.uni-kl.de#endif // !defined(sc_cthread_process_h_INCLUDED)
145