00001 /***************************************************************************** 00002 00003 The following code is derived, directly or indirectly, from the SystemC 00004 source code Copyright (c) 1996-2014 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 (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.accellera.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_semaphore_if.h -- The sc_semaphore_if interface class. 00021 00022 Original Author: Martin Janssen, Synopsys, Inc., 2001-05-21 00023 00024 CHANGE LOG IS AT THE END OF THE FILE 00025 *****************************************************************************/ 00026 00027 #ifndef SC_SEMAPHORE_IF_H 00028 #define SC_SEMAPHORE_IF_H 00029 00030 #include "sysc/communication/sc_interface.h" 00031 00032 namespace sc_core { 00033 00034 /**************************************************************************/ 00040 class sc_semaphore_if 00041 : virtual public sc_interface 00042 { 00043 public: 00044 00045 // the classical operations: wait(), trywait(), and post() 00046 00047 // lock (take) the semaphore, block if not available 00048 00053 // 08/19/2015 GL: modified for the OoO simulation 00054 virtual int wait( int ) = 0; 00055 00056 // lock (take) the semaphore, return -1 if not available 00057 virtual int trywait() = 0; 00058 00059 // unlock (give) the semaphore 00060 virtual int post() = 0; 00061 00062 // get the value of the semphore 00063 virtual int get_value() const = 0; 00064 00065 protected: 00066 00067 // constructor 00068 00069 sc_semaphore_if() 00070 {} 00071 00072 private: 00073 00074 // disabled 00075 sc_semaphore_if( const sc_semaphore_if& ); 00076 sc_semaphore_if& operator = ( const sc_semaphore_if& ); 00077 }; 00078 00079 } // namespace sc_core 00080 00081 //$Log: sc_semaphore_if.h,v $ 00082 //Revision 1.3 2011/08/26 20:45:42 acg 00083 // Andy Goodrich: moved the modification log to the end of the file to 00084 // eliminate source line number skew when check-ins are done. 00085 // 00086 //Revision 1.2 2011/02/18 20:23:45 acg 00087 // Andy Goodrich: Copyright update. 00088 // 00089 //Revision 1.1.1.1 2006/12/15 20:20:04 acg 00090 //SystemC 2.3 00091 // 00092 //Revision 1.2 2006/01/03 23:18:26 acg 00093 //Changed copyright to include 2006. 00094 // 00095 //Revision 1.1.1.1 2005/12/19 23:16:43 acg 00096 //First check in of SystemC 2.1 into its own archive. 00097 // 00098 //Revision 1.8 2005/06/10 22:43:55 acg 00099 //Added CVS change log annotation. 00100 // 00101 00102 #endif 00103 00104 // Taf!