SystemC 3.0.0
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
24 Original Author: Stan Y. Liao, Synopsys, Inc.
25
26 NO AUTOMATIC CHANGE LOG IS GENERATED, EXPLICIT CHANGE LOG AT END OF FILE
27 *****************************************************************************/
28
29#ifndef SC_VER_H
30#define SC_VER_H
31
33#include "sysc/kernel/sc_macros.h" // SC_CONCAT_UNDERSCORE_
34 // SC_STRINGIFY_HELPER_
35#include "sysc/communication/sc_writer_policy.h" // SC_DEFAULT_WRITER_POLICY
36
37#include <string>
38
39namespace sc_core {
40
41extern SC_API const char* sc_copyright();
42extern SC_API const char* sc_release();
43extern SC_API const char* sc_version();
44
45extern SC_API const unsigned int sc_version_major;
46extern SC_API const unsigned int sc_version_minor;
47extern SC_API const unsigned int sc_version_patch;
48
49extern SC_API const std::string sc_version_originator;
50extern SC_API const std::string sc_version_release_date;
51extern SC_API const std::string sc_version_prerelease;
52extern SC_API const bool sc_is_prerelease;
53extern SC_API const std::string sc_version_string;
54extern SC_API const std::string sc_copyright_string;
55
56#define SYSTEMC_3_0_0
57
58#define SYSTEMC_VERSION 20240329
59#define SC_VERSION_ORIGINATOR "Accellera"
60#define SC_VERSION_MAJOR 3
61#define SC_VERSION_MINOR 0
62#define SC_VERSION_PATCH 0
63#define SC_IS_PRERELEASE 0
64
66#define IEEE_1666_SYSTEMC 202301L
67
68#define SC_COPYRIGHT \
69 "Copyright (c) 1996-2024 by all Contributors,\n" \
70 "ALL RIGHTS RESERVED\n"
71
72
73#define SC_VERSION_RELEASE_DATE \
74 SC_STRINGIFY_HELPER_( SYSTEMC_VERSION )
75
76#if ( SC_IS_PRERELEASE == 1 )
77# define SC_VERSION_PRERELEASE "pub_rev"
78# define SC_VERSION \
79 SC_STRINGIFY_HELPER_( SC_VERSION_MAJOR.SC_VERSION_MINOR.SC_VERSION_PATCH ) \
80 "_" SC_VERSION_PRERELEASE "_" SC_VERSION_RELEASE_DATE \
81 "-" SC_VERSION_ORIGINATOR
82#else
83# define SC_VERSION_PRERELEASE "" // nothing
84# define SC_VERSION \
85 SC_STRINGIFY_HELPER_( SC_VERSION_MAJOR.SC_VERSION_MINOR.SC_VERSION_PATCH ) \
86 "-" SC_VERSION_ORIGINATOR
87#endif
88
89// THIS CLASS AND STATIC INSTANCE BELOW DETECTS BAD REV OBJECTS AT LINK TIME
90//
91// Each source file which includes this file for the current SystemC version
92// will have a static instance of the class sc_api_version_XXX defined
93// in it. That object instance will cause the constructor below
94// to be invoked. If the version of the SystemC being linked against
95// does not contain the constructor below a linkage error will occur.
96//
97// The static API check includes the SystemC version numbers as well as
98// the underlying C++ standard version (SC_CPLUSPLUS).
99
100#define SC_API_VERSION_STRING \
101 SC_CONCAT_UNDERSCORE_( sc_api_version, \
102 SC_CONCAT_UNDERSCORE_( SC_VERSION_MAJOR, \
103 SC_CONCAT_UNDERSCORE_( SC_VERSION_MINOR, \
104 SC_CONCAT_UNDERSCORE_( SC_VERSION_PATCH, \
105 SC_CONCAT_HELPER_( cxx, SC_CPLUSPLUS ) \
106 ) ) ) )
107
108// explicitly avoid macro expansion
109#define SC_API_DEFINED_( Symbol ) \
110 Symbol ## _DEFINED_
111#define SC_API_UNDEFINED_( Symbol ) \
112 Symbol ## _UNDEFINED_
113
114// Some preprocessor switches need to be consistent between the application
115// and the library (e.g. if sizes of classes are affected or other parts of
116// the ABI are affected). (Some of) these are checked here at link-time as
117// well, by setting template parameters to sc_api_version_XXX, while only
118// one variant is defined in sc_ver.cpp.
119
120#if 0 // don't enforce check of DEBUG_SYSTEMC for now
121// DEBUG_SYSTEMC
122#if defined( DEBUG_SYSTEMC )
123# define DEBUG_SYSTEMC_CHECK_ \
124 SC_CONFIG_DEFINED_(DEBUG_SYSTEMC)
125#else
126# define DEBUG_SYSTEMC_CHECK_ \
127 SC_CONFIG_UNDEFINED_(DEBUG_SYSTEMC)
128#endif
129extern const int DEBUG_SYSTEMC_CHECK_;
130#endif
131
132// Some preprocessor switches need to be consistent between different
133// translation units of an application. Those can't be easily checked
134// during link-time. Instead, perform a check during run-time by
135// passing the value to the constructor of the api_version_check object.
136
137// Note: Template and constructor parameters are not passed as default
138// values to avoid ODR violations in the check itself.
139
140//template // use pointers for more verbose error messages
141//<
142// const int * DebugSystemC,
143//>
145{
147 (
148 // SC_DEFAULT_WRITER_POLICY
149 sc_writer_policy default_writer_policy
150 // SC_ENABLE_COVARIANT_VIRTUAL_BASE
151 , bool has_covariant_virtual_base
152 );
153};
154
155// co-variant return types don't mix with virtual base classes
156// (like sc_interface) on Microsoft Visual C++ compilers
157// -> keep all APIs depending on this as an opt-in for now
158#ifdef SC_ENABLE_COVARIANT_VIRTUAL_BASE
159# define SC_HAS_COVARIANT_VIRTUAL_BASE_ true
160#else
161# define SC_HAS_COVARIANT_VIRTUAL_BASE_ false
162#endif // SC_ENABLE_COVARIANT_VIRTUAL_BASE
163
164#if !defined(SC_BUILD)
165// import explicitly instantiated template
166//extern template struct SC_API SC_API_VERSION_STRING
167//<
168//>;
169
170#if !defined(SC_DISABLE_API_VERSION_CHECK)
171static
173//<
174// & DEBUG_SYSTEMC_CHECK_,
175//>
177(
180);
181#endif // SC_DISABLE_API_VERSION_CHECK
182#endif // SC_BUILD
183
184//#undef SC_API_DEFINED_
185//#undef SC_API_UNDEFINED_
186
187} // namespace sc_core
188
189/*****************************************************************************
190
191 MODIFICATION LOG - modifiers, enter your name, affiliation, date and
192 changes you are making here.
193
194 Name, Affiliation, Date:
195 Description of Modification:
196
197 *****************************************************************************/
198#endif // SC_VER_H
#define SC_API_VERSION_STRING
Definition: sc_ver.h:100
#define SC_HAS_COVARIANT_VIRTUAL_BASE_
Definition: sc_ver.h:161
#define SC_API
Definition: sc_cmnhdr.h:148
#define SC_DEFAULT_WRITER_POLICY
SC_API const std::string sc_version_string
SC_API const char * sc_release()
SC_API const std::string sc_copyright_string
SC_API const char * sc_version()
SC_API const unsigned int sc_version_minor
SC_API const std::string sc_version_originator
SC_API const std::string sc_version_prerelease
static SC_API_VERSION_STRING api_version_check(SC_DEFAULT_WRITER_POLICY, SC_HAS_COVARIANT_VIRTUAL_BASE_)
SC_API const unsigned int sc_version_major
SC_API const std::string sc_version_release_date
SC_API const bool sc_is_prerelease
SC_API const char * sc_copyright()
SC_API const unsigned int sc_version_patch
SC_API_VERSION_STRING(sc_writer_policy default_writer_policy, bool has_covariant_virtual_base)