SystemC  2.3.2
Accellera SystemC proof-of-concept library
sc_ver.h
Go to the documentation of this file.
1 /*****************************************************************************
2 
3  Licensed to Accellera Systems Initiative Inc. (Accellera) under one or
4  more contributor license agreements. See the NOTICE file distributed
5  with this work for additional information regarding copyright ownership.
6  Accellera licenses this file to you under the Apache License, Version 2.0
7  (the "License"); you may not use this file except in compliance with the
8  License. You may obtain a copy of the License at
9 
10  http://www.apache.org/licenses/LICENSE-2.0
11 
12  Unless required by applicable law or agreed to in writing, software
13  distributed under the License is distributed on an "AS IS" BASIS,
14  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
15  implied. See the License for the specific language governing
16  permissions and limitations under the License.
17 
18  *****************************************************************************/
19 
20 /*****************************************************************************
21 
22  sc_ver.h -- Version and copyright information.
23 */
34 #ifndef SC_VER_H
35 #define SC_VER_H
36 
37 #include "sysc/kernel/sc_cmnhdr.h"
38 #include "sysc/kernel/sc_macros.h" // SC_CONCAT_UNDERSCORE_
39  // SC_STRINGIFY_HELPER_
40 #include "sysc/communication/sc_writer_policy.h" // SC_DEFAULT_WRITER_POLICY
41 
42 #include <string>
43 
44 namespace sc_core {
45 
46 extern SC_API const char* sc_copyright();
47 extern SC_API const char* sc_release();
48 extern SC_API const char* sc_version();
49 
50 extern SC_API const unsigned int sc_version_major;
51 extern SC_API const unsigned int sc_version_minor;
52 extern SC_API const unsigned int sc_version_patch;
53 
54 extern SC_API const std::string sc_version_originator;
55 extern SC_API const std::string sc_version_release_date;
56 extern SC_API const std::string sc_version_prerelease;
57 extern SC_API const bool sc_is_prerelease;
58 extern SC_API const std::string sc_version_string;
59 extern SC_API const std::string sc_copyright_string;
60 
61 #define SYSTEMC_2_3_2
62 
63 #define SYSTEMC_VERSION 20171012
64 #define SC_VERSION_ORIGINATOR "Accellera"
65 #define SC_VERSION_MAJOR 2
66 #define SC_VERSION_MINOR 3
67 #define SC_VERSION_PATCH 2
68 #define SC_IS_PRERELEASE 0
69 
71 #define IEEE_1666_SYSTEMC 201101L
72 
73 #define SC_COPYRIGHT \
74  "Copyright (c) 1996-2017 by all Contributors,\n" \
75  "ALL RIGHTS RESERVED\n"
76 
77 
78 #define SC_VERSION_RELEASE_DATE \
79  SC_STRINGIFY_HELPER_( SYSTEMC_VERSION )
80 
81 #if ( SC_IS_PRERELEASE == 1 )
82 # define SC_VERSION_PRERELEASE "pub_rev"
83 # define SC_VERSION \
84  SC_STRINGIFY_HELPER_( SC_VERSION_MAJOR.SC_VERSION_MINOR.SC_VERSION_PATCH ) \
85  "_" SC_VERSION_PRERELEASE "_" SC_VERSION_RELEASE_DATE \
86  "-" SC_VERSION_ORIGINATOR
87 #else
88 # define SC_VERSION_PRERELEASE "" // nothing
89 # define SC_VERSION \
90  SC_STRINGIFY_HELPER_( SC_VERSION_MAJOR.SC_VERSION_MINOR.SC_VERSION_PATCH ) \
91  "-" SC_VERSION_ORIGINATOR
92 #endif
93 
94 // THIS CLASS AND STATIC INSTANCE BELOW DETECTS BAD REV OBJECTS AT LINK TIME
95 //
96 // Each source file which includes this file for the current SystemC version
97 // will have a static instance of the class sc_api_version_XXX defined
98 // in it. That object instance will cause the constructor below
99 // to be invoked. If the version of the SystemC being linked against
100 // does not contain the constructor below a linkage error will occur.
101 //
102 // The static API check includes the SystemC version numbers as well as
103 // the underlying C++ standard version (SC_CPLUSPLUS).
104 
105 #define SC_API_VERSION_STRING \
106  SC_CONCAT_UNDERSCORE_( sc_api_version, \
107  SC_CONCAT_UNDERSCORE_( SC_VERSION_MAJOR, \
108  SC_CONCAT_UNDERSCORE_( SC_VERSION_MINOR, \
109  SC_CONCAT_UNDERSCORE_( SC_VERSION_PATCH, \
110  SC_CONCAT_HELPER_( cxx, SC_CPLUSPLUS ) \
111  ) ) ) )
112 
113 // explicitly avoid macro expansion
115 #define SC_API_DEFINED_( Symbol ) \
116  Symbol ## _DEFINED_
117 
118 #define SC_API_UNDEFINED_( Symbol ) \
119  Symbol ## _UNDEFINED_
120 
121 // Some preprocessor switches need to be consistent between the application
122 // and the library (e.g. if sizes of classes are affected or other parts of
123 // the ABI are affected). (Some of) these are checked here at link-time as
124 // well, by setting template parameters to sc_api_version_XXX, while only
125 // one variant is defined in sc_ver.cpp.
126 
127 #if 0 // don't enforce check of DEBUG_SYSTEMC for now
128 // DEBUG_SYSTEMC
129 #if defined( DEBUG_SYSTEMC )
130 # define DEBUG_SYSTEMC_CHECK_ \
131  SC_CONFIG_DEFINED_(DEBUG_SYSTEMC)
132 #else
133 # define DEBUG_SYSTEMC_CHECK_ \
134  SC_CONFIG_UNDEFINED_(DEBUG_SYSTEMC)
135 #endif
136 extern const int DEBUG_SYSTEMC_CHECK_;
137 #endif
138 
139 // SC_DISABLE_VIRTUAL_BIND
140 #if defined( SC_DISABLE_VIRTUAL_BIND )
141 # define SC_DISABLE_VIRTUAL_BIND_CHECK_ \
142  SC_API_DEFINED_(SC_DISABLE_VIRTUAL_BIND)
143 #else
144 # define SC_DISABLE_VIRTUAL_BIND_CHECK_ \
145  SC_API_UNDEFINED_(SC_DISABLE_VIRTUAL_BIND)
146 #endif
147 extern const int SC_DISABLE_VIRTUAL_BIND_CHECK_;
148 
149 // Some preprocessor switches need to be consistent between different
150 // translation units of an application. Those can't be easily checked
151 // during link-time. Instead, perform a check during run-time by
152 // passing the value to the constructor of the api_version_check object.
153 
154 // Note: Template and constructor parameters are not passed as default
155 // values to avoid ODR violations in the check itself.
156 
157 template // use pointers for more verbose error messages
158 <
159 // const int * DebugSystemC,
160  const int * DisableVirtualBind
161 >
163 {
165  (
166  // SC_DEFAULT_WRITER_POLICY
167  sc_writer_policy default_writer_policy
168  );
169 };
170 
171 #if !defined(SC_BUILD)
172 // import explicitly instantiated template
174 <
175  &SC_DISABLE_VIRTUAL_BIND_CHECK_
176 >;
177 
178 #if !defined(SC_DISABLE_API_VERSION_CHECK)
179 static
181 <
182 // & DEBUG_SYSTEMC_CHECK_,
183  & SC_DISABLE_VIRTUAL_BIND_CHECK_
184 >
186 (
188 );
189 #endif // SC_DISABLE_API_VERSION_CHECK
190 #endif // SC_BUILD
191 
192 //#undef SC_API_DEFINED_
193 //#undef SC_API_UNDEFINED_
194 
195 } // namespace sc_core
196 
197 /*****************************************************************************
198 
199  MODIFICATION LOG - modifiers, enter your name, affiliation, date and
200  changes you are making here.
201 
202  Name, Affiliation, Date:
203  Description of Modification:
204 
205  *****************************************************************************/
206 #endif
#define SC_DEFAULT_WRITER_POLICY
SC_API const unsigned int sc_version_patch
SC_API const std::string sc_copyright_string
SC_API const bool sc_is_prerelease
SC_API const char * sc_version()
SC_API const std::string sc_version_originator
SC_API_VERSION_STRING(sc_writer_policy default_writer_policy)
const int SC_DISABLE_VIRTUAL_BIND_CHECK_
SC_API const char * sc_copyright()
SC_API const std::string sc_version_prerelease
Miscellaneous definitions that are needed by the headers.
#define SC_TPLEXTERN_
Definition: sc_cmnhdr.h:155
SC_API const std::string sc_version_release_date
SC_API const unsigned int sc_version_major
SC_API const char * sc_release()
SC_API const unsigned int sc_version_minor
SC_API const std::string sc_version_string
The sc_signal<T> writer policy definition.
static SC_API_VERSION_STRING< &SC_DISABLE_VIRTUAL_BIND_CHECK_ > api_version_check(SC_DEFAULT_WRITER_POLICY)
#define SC_API
Definition: sc_cmnhdr.h:168