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 systemc.h - Top-level include file for the SystemC library with usings. 00021 00022 Original Author: Stan Y. Liao, Synopsys, Inc. 00023 00024 *****************************************************************************/ 00025 00026 /***************************************************************************** 00027 00028 MODIFICATION LOG - modifiers, enter your name, affiliation, date and 00029 changes you are making here. 00030 00031 Name, Affiliation, Date: Andy Goodrich, Forte Design Systems, 31 Mar 2005 00032 Description of Modification: Changes for namespace support. 00033 00034 *****************************************************************************/ 00035 00036 #ifndef SYSTEMC_H 00037 #define SYSTEMC_H 00038 00039 // INCLUDE SYSTEM (std) DEFINITIONS: 00040 00041 #include <cassert> 00042 #include <climits> 00043 #include <cmath> // math.h? 00044 #include <cstddef> 00045 #include <cstdio> 00046 #include <cstdlib> 00047 #include <cstring> 00048 #include <exception> 00049 #include <fstream> 00050 #include <iostream> 00051 #include <memory> 00052 #include <string> 00053 #if defined(__sun) || defined(__sun__) 00054 # include <inttypes.h> 00055 #elif !defined(WIN32) && !defined(_WIN32) 00056 # include <stdint.h> 00057 #endif 00058 #include <typeinfo> 00059 #include <utility> 00060 #include <vector> 00061 00062 // USINGS FOR I/O STREAM SUPPORT: 00063 00064 using std::ios; 00065 using std::streambuf; 00066 using std::streampos; 00067 using std::streamsize; 00068 using std::iostream; 00069 using std::istream; 00070 using std::ostream; 00071 using std::cin; 00072 using std::cout; 00073 using std::cerr; 00074 using std::endl; 00075 using std::flush; 00076 using std::dec; 00077 using std::hex; 00078 using std::oct; 00079 using std::noshowbase; 00080 using std::showbase; 00081 00082 using std::fstream; 00083 using std::ifstream; 00084 using std::ofstream; 00085 00086 // from <cstdio>: 00087 00088 using std::size_t; 00089 using std::FILE; 00090 using std::fpos_t; 00091 using std::fclose; 00092 using std::clearerr; 00093 00094 using std::remove; 00095 using std::rename; 00096 using std::tmpfile; 00097 using std::tmpnam; 00098 using std::fflush; 00099 using std::fopen; 00100 using std::freopen; 00101 using std::setbuf; 00102 using std::setvbuf; 00103 using std::fprintf; 00104 using std::fscanf; 00105 using std::printf; 00106 using std::scanf; 00107 using std::sprintf; 00108 using std::sscanf; 00109 using std::vfprintf; 00110 using std::vprintf; 00111 using std::vsprintf; 00112 using std::fgetc; 00113 using std::fgets; 00114 using std::fputc; 00115 using std::fputs; 00116 using std::getc; 00117 using std::getchar; 00118 using std::gets; 00119 using std::putc; 00120 using std::putchar; 00121 using std::puts; 00122 using std::ungetc; 00123 using std::fread; 00124 using std::fwrite; 00125 using std::fgetpos; 00126 using std::fseek; 00127 using std::fsetpos; 00128 using std::ftell; 00129 using std::rewind; 00130 using std::feof; 00131 using std::ferror; 00132 using std::perror; 00133 00134 // from <cstdlib>: 00135 00136 using std::div_t; 00137 using std::ldiv_t; 00138 00139 using std::atof; 00140 using std::atoi; 00141 using std::atol; 00142 using std::strtod; 00143 using std::strtol; 00144 using std::strtoul; 00145 using std::rand; 00146 using std::srand; 00147 using std::calloc; 00148 using std::free; 00149 using std::malloc; 00150 using std::realloc; 00151 using std::abort; 00152 using std::atexit; 00153 using std::exit; 00154 using std::getenv; 00155 using std::system; 00156 using std::bsearch; 00157 using std::qsort; 00158 using std::abs; 00159 using std::div; 00160 using std::labs; 00161 using std::ldiv; 00162 using std::mblen; 00163 using std::mbtowc; 00164 using std::mbstowcs; 00165 #if !defined(__CYGWIN__) && !defined(__CYGWIN32) 00166 using std::wctomb; 00167 using std::wcstombs; 00168 #endif 00169 00170 // from <cstring>: 00171 00172 using std::memcpy; 00173 using std::memmove; 00174 using std::strcpy; 00175 using std::strncpy; 00176 using std::strcat; 00177 using std::strncat; 00178 using std::memcmp; 00179 using std::strcmp; 00180 using std::strcoll; 00181 using std::strncmp; 00182 using std::strxfrm; 00183 using std::memchr; 00184 using std::strchr; 00185 using std::strcspn; 00186 using std::strpbrk; 00187 using std::strrchr; 00188 using std::strspn; 00189 using std::strstr; 00190 using std::strtok; 00191 using std::memset; 00192 using std::strerror; 00193 using std::strlen; 00194 00195 // deprecated strstream support 00196 #if defined( SC_INCLUDE_STRSTREAM ) 00197 #include <strstream> 00198 00199 using std::strstream; 00200 using std::strstreambuf; 00201 using std::istrstream; 00202 using std::ostrstream; 00203 00204 #endif // SC_INCLUDE_STRSTREAM 00205 00206 // INCLUDE SYSTEMC DEFINITIONS for sc_dt AND sc_core NAMESPACES: 00207 00208 #include "systemc" 00209 00210 // USINGS FOR THE sc_dt NAMESPACE: 00211 00212 using sc_dt::SC_BIN; 00213 using sc_dt::SC_BIN_SM; 00214 using sc_dt::SC_BIN_US; 00215 using sc_dt::SC_CSD; 00216 using sc_dt::SC_DEC; 00217 using sc_dt::SC_HEX; 00218 using sc_dt::SC_HEX_SM; 00219 using sc_dt::SC_HEX_US; 00220 using sc_dt::SC_LOGIC_0; 00221 using sc_dt::SC_LOGIC_1; 00222 using sc_dt::SC_LOGIC_X; 00223 using sc_dt::SC_LOGIC_Z; 00224 using sc_dt::SC_NOBASE; 00225 using sc_dt::SC_OCT; 00226 using sc_dt::SC_OCT_SM; 00227 using sc_dt::SC_OCT_US; 00228 using sc_dt::int64; 00229 using sc_dt::sc_abs; 00230 using sc_dt::sc_bigint; 00231 using sc_dt::sc_biguint; 00232 using sc_dt::sc_bit; 00233 using sc_dt::sc_bv; 00234 using sc_dt::sc_bv_base; 00235 using sc_dt::sc_digit; 00236 using sc_dt::sc_int; 00237 using sc_dt::sc_int_base; 00238 using sc_dt::sc_io_show_base; 00239 using sc_dt::sc_length_context; 00240 using sc_dt::sc_length_param; 00241 using sc_dt::sc_logic; 00242 using sc_dt::sc_lv; 00243 using sc_dt::sc_lv_base; 00244 using sc_dt::sc_max; 00245 using sc_dt::sc_min; 00246 using sc_dt::sc_numrep; 00247 using sc_dt::sc_signed; 00248 using sc_dt::sc_uint; 00249 using sc_dt::sc_uint_base; 00250 using sc_dt::sc_unsigned; 00251 using sc_dt::uint64; 00252 // #ifdef SC_DT_DEPRECATED 00253 using sc_dt::sc_logic_0; 00254 using sc_dt::sc_logic_1; 00255 using sc_dt::sc_logic_Z; 00256 using sc_dt::sc_logic_X; 00257 // #endif 00258 00259 #ifdef SC_INCLUDE_FX 00260 using sc_dt::sc_fxnum; 00261 using sc_dt::sc_fxnum_bitref; 00262 using sc_dt::sc_fxnum_fast; 00263 using sc_dt::sc_fix; 00264 using sc_dt::sc_fix_fast; 00265 using sc_dt::sc_ufix; 00266 using sc_dt::sc_ufix_fast; 00267 using sc_dt::sc_fixed; 00268 using sc_dt::sc_fixed_fast; 00269 using sc_dt::sc_ufixed; 00270 using sc_dt::sc_ufixed_fast; 00271 using sc_dt::sc_fxval; 00272 using sc_dt::sc_fxval_fast; 00273 using sc_dt::sc_fxcast_switch; 00274 using sc_dt::sc_fxcast_context; 00275 using sc_dt::sc_fxtype_params; 00276 using sc_dt::sc_fxtype_context; 00277 using sc_dt::sc_q_mode; 00278 using sc_dt::SC_RND; 00279 using sc_dt::SC_RND_ZERO; 00280 using sc_dt::SC_RND_MIN_INF; 00281 using sc_dt::SC_RND_INF; 00282 using sc_dt::SC_RND_CONV; 00283 using sc_dt::SC_TRN; 00284 using sc_dt::SC_TRN_ZERO; 00285 using sc_dt::sc_o_mode; 00286 using sc_dt::SC_SAT; 00287 using sc_dt::SC_SAT_ZERO; 00288 using sc_dt::SC_SAT_SYM; 00289 using sc_dt::SC_WRAP; 00290 using sc_dt::SC_WRAP_SM; 00291 using sc_dt::sc_switch; 00292 using sc_dt::SC_OFF; 00293 using sc_dt::SC_ON; 00294 using sc_dt::sc_fmt; 00295 using sc_dt::SC_F; 00296 using sc_dt::SC_E; 00297 using sc_dt::sc_context_begin; 00298 using sc_dt::SC_NOW; 00299 using sc_dt::SC_LATER; 00300 #endif // SC_INCLUDE_FX 00301 00302 #if 0 // defined( _MSC_VER ) // supported versions of MSVC should support ADL 00303 00304 using sc_dt::equal; 00305 using sc_dt::not_equal; 00306 using sc_dt::b_not; 00307 using sc_dt::b_and; 00308 using sc_dt::b_or; 00309 using sc_dt::b_xor; 00310 using sc_dt::lrotate; 00311 using sc_dt::rrotate; 00312 using sc_dt::reverse; 00313 using sc_dt::concat; 00314 using sc_dt::and_reduce; 00315 using sc_dt::or_reduce; 00316 using sc_dt::xor_reduce; 00317 using sc_dt::nand_reduce; 00318 using sc_dt::nor_reduce; 00319 using sc_dt::xnor_reduce; 00320 00321 #endif // defined( _MSC_VER ) 00322 00323 00324 // USINGS FOR sc_core: 00325 // 00326 // The explicit using for ::sc_core::wait is to remove an ambiguity with 00327 // the constructor for the system's union wait on Unix and Linux. This 00328 // causes problems with aCC, so users of aCC should explicitly select 00329 // the SystemC wait functions using ::sc_core::wait(...). This is actually 00330 // a good idea for SystemC programmers in general. 00331 00332 using namespace sc_core; 00333 00334 #if !defined( __HP_aCC ) 00335 using ::sc_core::wait; 00336 #endif // !defined( __HP_aCC ) 00337 00338 #ifdef SC_USE_SC_STRING_OLD 00339 using sc_dt::sc_string_old; 00340 typedef sc_dt::sc_string_old sc_string; 00341 #endif 00342 #ifdef SC_USE_STD_STRING 00343 typedef ::std::string sc_string; 00344 #endif 00345 00346 #endif