sc_ver.h revision 12027
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 30#ifndef SC_VER_H 31#define SC_VER_H 32 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 const char* sc_copyright(); 42extern const char* sc_release(); 43extern const char* sc_version(); 44 45extern const unsigned int sc_version_major; 46extern const unsigned int sc_version_minor; 47extern const unsigned int sc_version_patch; 48 49extern const std::string sc_version_originator; 50extern const std::string sc_version_release_date; 51extern const std::string sc_version_prerelease; 52extern const bool sc_is_prerelease; 53extern const std::string sc_version_string; 54extern const std::string sc_copyright_string; 55 56#define SYSTEMC_2_3_1 57 58#define SYSTEMC_VERSION 20140417 59#define SC_VERSION_ORIGINATOR "Accellera" 60#define SC_VERSION_MAJOR 2 61#define SC_VERSION_MINOR 3 62#define SC_VERSION_PATCH 1 63#define SC_IS_PRERELEASE 0 64 65/// compliancy with IEEE 1666-2011 (see 8.6.5) 66#define IEEE_1666_SYSTEMC 201101L 67 68#define SC_COPYRIGHT \ 69 "Copyright (c) 1996-2014 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#define SC_API_VERSION_STRING \ 98 SC_CONCAT_UNDERSCORE_( sc_api_version, \ 99 SC_CONCAT_UNDERSCORE_( SC_VERSION_MAJOR, \ 100 SC_CONCAT_UNDERSCORE_( SC_VERSION_MINOR, \ 101 SC_VERSION_PATCH ) ) ) 102 103// explicitly avoid macro expansion 104#define SC_API_DEFINED_( Symbol ) \ 105 Symbol ## _DEFINED_ 106#define SC_API_UNDEFINED_( Symbol ) \ 107 Symbol ## _UNDEFINED_ 108 109// Some preprocessor switches need to be consistent between the application 110// and the library (e.g. if sizes of classes are affected or other parts of 111// the ABI are affected). (Some of) these are checked here at link-time as 112// well, by setting template parameters to sc_api_version_XXX, while only 113// one variant is defined in sc_ver.cpp. 114 115#if 0 // don't enforce check of DEBUG_SYSTEMC for now 116// DEBUG_SYSTEMC 117#if defined( DEBUG_SYSTEMC ) 118# define DEBUG_SYSTEMC_CHECK_ \ 119 SC_CONFIG_DEFINED_(DEBUG_SYSTEMC) 120#else 121# define DEBUG_SYSTEMC_CHECK_ \ 122 SC_CONFIG_UNDEFINED_(DEBUG_SYSTEMC) 123#endif 124extern const int DEBUG_SYSTEMC_CHECK_; 125#endif 126 127// SC_DISABLE_VIRTUAL_BIND 128#if defined( SC_DISABLE_VIRTUAL_BIND ) 129# define SC_DISABLE_VIRTUAL_BIND_CHECK_ \ 130 SC_API_DEFINED_(SC_DISABLE_VIRTUAL_BIND) 131#else 132# define SC_DISABLE_VIRTUAL_BIND_CHECK_ \ 133 SC_API_UNDEFINED_(SC_DISABLE_VIRTUAL_BIND) 134#endif 135extern const int SC_DISABLE_VIRTUAL_BIND_CHECK_; 136 137// Some preprocessor switches need to be consistent between different 138// translation units of an application. Those can't be easily checked 139// during link-time. Instead, perform a check during run-time by 140// passing the value to the constructor of the api_version_check object. 141 142// Note: Template and constructor parameters are not passed as default 143// values to avoid ODR violations in the check itself. 144 145template // use pointers for more verbose error messages 146< 147// const int * DebugSystemC, 148 const int * DisableVirtualBind 149> 150struct SC_API_VERSION_STRING 151{ 152 SC_API_VERSION_STRING 153 ( 154 // SC_DEFAULT_WRITER_POLICY 155 sc_writer_policy default_writer_policy 156 ); 157}; 158 159#if !defined( SC_DISABLE_API_VERSION_CHECK ) // disabled in sc_ver.cpp 160static 161SC_API_VERSION_STRING 162< 163// & DEBUG_SYSTEMC_CHECK_, 164 & SC_DISABLE_VIRTUAL_BIND_CHECK_ 165> 166api_version_check 167( 168 SC_DEFAULT_WRITER_POLICY 169); 170#endif // SC_DISABLE_API_VERSION_CHECK 171 172//#undef SC_API_DEFINED_ 173//#undef SC_API_UNDEFINED_ 174 175} // namespace sc_core 176 177/***************************************************************************** 178 179 MODIFICATION LOG - modifiers, enter your name, affiliation, date and 180 changes you are making here. 181 182 Name, Affiliation, Date: 183 Description of Modification: 184 185 *****************************************************************************/ 186#endif 187