SystemC  2.3.1
Accellera SystemC proof-of-concept library
sc_ver.h
Go to the documentation of this file.
1 /*****************************************************************************
2 
3  The following code is derived, directly or indirectly, from the SystemC
4  source code Copyright (c) 1996-2014 by all Contributors.
5  All Rights reserved.
6 
7  The contents of this file are subject to the restrictions and limitations
8  set forth in the SystemC Open Source License (the "License");
9  You may not use this file except in compliance with such restrictions and
10  limitations. You may obtain instructions on how to receive a copy of the
11  License at http://www.accellera.org/. Software distributed by Contributors
12  under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF
13  ANY KIND, either express or implied. See the License for the specific
14  language governing rights and limitations under the License.
15 
16  *****************************************************************************/
17 
18 /*****************************************************************************
19 
20  sc_ver.h -- Version and copyright information.
21 
22  Original Author: Stan Y. Liao, Synopsys, Inc.
23 
24  NO AUTOMATIC CHANGE LOG IS GENERATED, EXPLICIT CHANGE LOG AT END OF FILE
25  *****************************************************************************/
26 
27 
28 #ifndef SC_VER_H
29 #define SC_VER_H
30 
31 #include "sysc/kernel/sc_macros.h" // SC_CONCAT_UNDERSCORE_
32  // SC_STRINGIFY_HELPER_
33 #include "sysc/communication/sc_writer_policy.h" // SC_DEFAULT_WRITER_POLICY
34 
35 #include <string>
36 
37 namespace sc_core {
38 
39 extern const char* sc_copyright();
40 extern const char* sc_release();
41 extern const char* sc_version();
42 
43 extern const unsigned int sc_version_major;
44 extern const unsigned int sc_version_minor;
45 extern const unsigned int sc_version_patch;
46 
47 extern const std::string sc_version_originator;
48 extern const std::string sc_version_release_date;
49 extern const std::string sc_version_prerelease;
50 extern const bool sc_is_prerelease;
51 extern const std::string sc_version_string;
52 extern const std::string sc_copyright_string;
53 
54 #define SYSTEMC_2_3_1
55 
56 #define SYSTEMC_VERSION 20140417
57 #define SC_VERSION_ORIGINATOR "Accellera"
58 #define SC_VERSION_MAJOR 2
59 #define SC_VERSION_MINOR 3
60 #define SC_VERSION_PATCH 1
61 #define SC_IS_PRERELEASE 0
62 
64 #define IEEE_1666_SYSTEMC 201101L
65 
66 #define SC_COPYRIGHT \
67  "Copyright (c) 1996-2014 by all Contributors,\n" \
68  "ALL RIGHTS RESERVED\n"
69 
70 
71 #define SC_VERSION_RELEASE_DATE \
72  SC_STRINGIFY_HELPER_( SYSTEMC_VERSION )
73 
74 #if ( SC_IS_PRERELEASE == 1 )
75 # define SC_VERSION_PRERELEASE "pub_rev"
76 # define SC_VERSION \
77  SC_STRINGIFY_HELPER_( SC_VERSION_MAJOR.SC_VERSION_MINOR.SC_VERSION_PATCH ) \
78  "_" SC_VERSION_PRERELEASE "_" SC_VERSION_RELEASE_DATE \
79  "-" SC_VERSION_ORIGINATOR
80 #else
81 # define SC_VERSION_PRERELEASE "" // nothing
82 # define SC_VERSION \
83  SC_STRINGIFY_HELPER_( SC_VERSION_MAJOR.SC_VERSION_MINOR.SC_VERSION_PATCH ) \
84  "-" SC_VERSION_ORIGINATOR
85 #endif
86 
87 // THIS CLASS AND STATIC INSTANCE BELOW DETECTS BAD REV OBJECTS AT LINK TIME
88 //
89 // Each source file which includes this file for the current SystemC version
90 // will have a static instance of the class sc_api_version_XXX defined
91 // in it. That object instance will cause the constructor below
92 // to be invoked. If the version of the SystemC being linked against
93 // does not contain the constructor below a linkage error will occur.
94 
95 #define SC_API_VERSION_STRING \
96  SC_CONCAT_UNDERSCORE_( sc_api_version, \
97  SC_CONCAT_UNDERSCORE_( SC_VERSION_MAJOR, \
98  SC_CONCAT_UNDERSCORE_( SC_VERSION_MINOR, \
99  SC_VERSION_PATCH ) ) )
100 
101 // explicitly avoid macro expansion
102 #define SC_API_DEFINED_( Symbol ) \
103  Symbol ## _DEFINED_
104 #define SC_API_UNDEFINED_( Symbol ) \
105  Symbol ## _UNDEFINED_
106 
107 // Some preprocessor switches need to be consistent between the application
108 // and the library (e.g. if sizes of classes are affected or other parts of
109 // the ABI are affected). (Some of) these are checked here at link-time as
110 // well, by setting template parameters to sc_api_version_XXX, while only
111 // one variant is defined in sc_ver.cpp.
112 
113 #if 0 // don't enforce check of DEBUG_SYSTEMC for now
114 // DEBUG_SYSTEMC
115 #if defined( DEBUG_SYSTEMC )
116 # define DEBUG_SYSTEMC_CHECK_ \
117  SC_CONFIG_DEFINED_(DEBUG_SYSTEMC)
118 #else
119 # define DEBUG_SYSTEMC_CHECK_ \
120  SC_CONFIG_UNDEFINED_(DEBUG_SYSTEMC)
121 #endif
122 extern const int DEBUG_SYSTEMC_CHECK_;
123 #endif
124 
125 // SC_DISABLE_VIRTUAL_BIND
126 #if defined( SC_DISABLE_VIRTUAL_BIND )
127 # define SC_DISABLE_VIRTUAL_BIND_CHECK_ \
128  SC_API_DEFINED_(SC_DISABLE_VIRTUAL_BIND)
129 #else
130 # define SC_DISABLE_VIRTUAL_BIND_CHECK_ \
131  SC_API_UNDEFINED_(SC_DISABLE_VIRTUAL_BIND)
132 #endif
133 extern const int SC_DISABLE_VIRTUAL_BIND_CHECK_;
134 
135 // Some preprocessor switches need to be consistent between different
136 // translation units of an application. Those can't be easily checked
137 // during link-time. Instead, perform a check during run-time by
138 // passing the value to the constructor of the api_version_check object.
139 
140 // Note: Template and constructor parameters are not passed as default
141 // values to avoid ODR violations in the check itself.
142 
143 template // use pointers for more verbose error messages
144 <
145 // const int * DebugSystemC,
146  const int * DisableVirtualBind
147 >
149 {
151  (
152  // SC_DEFAULT_WRITER_POLICY
153  sc_writer_policy default_writer_policy
154  );
155 };
156 
157 #if !defined( SC_DISABLE_API_VERSION_CHECK ) // disabled in sc_ver.cpp
158 static
160 <
161 // & DEBUG_SYSTEMC_CHECK_,
163 >
165 (
167 );
168 #endif // SC_DISABLE_API_VERSION_CHECK
169 
170 //#undef SC_API_DEFINED_
171 //#undef SC_API_UNDEFINED_
172 
173 } // namespace sc_core
174 
175 /*****************************************************************************
176 
177  MODIFICATION LOG - modifiers, enter your name, affiliation, date and
178  changes you are making here.
179 
180  Name, Affiliation, Date:
181  Description of Modification:
182 
183  *****************************************************************************/
184 #endif
const bool sc_is_prerelease
const std::string sc_version_release_date
const std::string sc_copyright_string
SC_API_VERSION_STRING(sc_writer_policy default_writer_policy)
#define SC_DEFAULT_WRITER_POLICY
const std::string sc_version_prerelease
const unsigned int sc_version_patch
const char * sc_release()
const std::string sc_version_string
const unsigned int sc_version_minor
const char * sc_version()
const char * sc_copyright()
const unsigned int sc_version_major
const int SC_DISABLE_VIRTUAL_BIND_CHECK_
static SC_API_VERSION_STRING< &SC_DISABLE_VIRTUAL_BIND_CHECK_ > api_version_check(SC_DEFAULT_WRITER_POLICY)
const std::string sc_version_originator