version.hh revision 13521:74fa3ac44057
11758SN/A/*****************************************************************************
21762SN/A
31758SN/A  Licensed to Accellera Systems Initiative Inc. (Accellera) under one or
41758SN/A  more contributor license agreements.  See the NOTICE file distributed
51758SN/A  with this work for additional information regarding copyright ownership.
61758SN/A  Accellera licenses this file to you under the Apache License, Version 2.0
71758SN/A  (the "License"); you may not use this file except in compliance with the
81758SN/A  License.  You may obtain a copy of the License at
91758SN/A
101758SN/A    http://www.apache.org/licenses/LICENSE-2.0
111758SN/A
121758SN/A  Unless required by applicable law or agreed to in writing, software
131758SN/A  distributed under the License is distributed on an "AS IS" BASIS,
141758SN/A  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
151758SN/A  implied.  See the License for the specific language governing
161758SN/A  permissions and limitations under the License.
171758SN/A
181758SN/A *****************************************************************************/
191758SN/A
201758SN/A/* ---------------------------------------------------------------------------
211758SN/A  Original Author:
221758SN/A    Charles Wilson, XtremeEDA Corporation
231758SN/A
241758SN/A @description
251758SN/A  This header contains preprocessor and compiler symbols to allow for the
261758SN/A   determination of the TLM version information. This conforms to
272665Ssaidi@eecs.umich.edu   IEEE 1666-2005 section 8.5.5 - 8.5.7
282665Ssaidi@eecs.umich.edu   The following are provided:
292665Ssaidi@eecs.umich.edu
301758SN/A   preprocessor: TLM_VERSION_MAJOR        numeric
312SN/A                 TLM_VERSION_MINOR        numeric
322171SN/A                 TLM_VERSION_PATCH        numeric
33732SN/A                 TLM_VERSION_ORIGINATOR   string       ([A-Z][a-z][0-9]_)
34732SN/A                 TLM_VERSION_RELEASE_DATE ISO8601 date (YYYYMMDD)
35732SN/A                 TLM_VERSION_PRERELEASE   string       ([A-Z][a-z][0-9]_)
36732SN/A                 TLM_IS_PRERELEASE        bool         (1,0)
37732SN/A                 TLM_VERSION              string       {2.0.0_DR3-TLMWG}
381858SN/A                 TLM_COPYRIGHT            string
391717SN/A
402190SN/A   compiler:     tlm_version_major        const unsigned int
4156SN/A                 tlm_version_minor        const unsigned int
421070SN/A                 tlm_version_patch        const unsigned int
43676SN/A                 tlm_version_originator   const std::string
4456SN/A                 tlm_version_release_date const std::string
452SN/A                 tlm_version_prerelease   const std::string
461858SN/A                 tlm_is_prerelease        const bool
472SN/A                 tlm_version              const string
481147SN/A                 tlm_copyright            const string
491147SN/A
502SN/A   accessors:    inline const char* tlm_release   (void)
512SN/A                 inline const char* tlm_version   (void)
522SN/A                 inline const char* tlm_copyright (void)
532SN/A--------------------------------------------------------------------------- */
542SN/A
552190SN/A#ifndef __SYSTEMC_EXT_TLM_CORE_2_VERSION_HH__
562SN/A#define __SYSTEMC_EXT_TLM_CORE_2_VERSION_HH__
572190SN/A
58190SN/Anamespace tlm
592190SN/A{
602190SN/A
612114SN/A#define TLM_VERSION_MAJOR 2 ///< version major level ( numeric )
622234SN/A#define TLM_VERSION_MINOR 0 ///< version minor level ( numeric )
632190SN/A#define TLM_VERSION_PATCH 4 ///< version patch level ( numeric )
642SN/A#define TLM_VERSION_ORIGINATOR "Accellera" ///< TLM creator string
652SN/A#define TLM_VERSION_SEPARATOR "." ///< version string separator
662SN/A
672SN/A#define TLM_IS_PRERELEASE 0 ///< pre-release flag (1/0)
682SN/A
692SN/A#if TLM_IS_PRERELEASE
702SN/A#    define TLM_VERSION_PRERELEASE "pub_rev" ///< pre-release version string
712190SN/A#else
722SN/A#    define TLM_VERSION_PRERELEASE "" ///< pre-release version string
732190SN/A#endif
742190SN/A
752190SN/A#define TLM_VERSION_RELEASE_YEAR "2017" ///< release year  ( YYYY )
762SN/A#define TLM_VERSION_RELEASE_MONTH "10" ///< release month ( MM )
772190SN/A#define TLM_VERSION_RELEASE_DAY "12" ///< release day   ( DD )
782190SN/A
792190SN/A#define TLM_COPYRIGHT \
802SN/A  "Copyright (c) 1996-" TLM_VERSION_RELEASE_YEAR " by all Contributors\n" \
812SN/A  "ALL RIGHTS RESERVED"
822SN/A
831133SN/A/******************** do not modify below this line *************************/
84716SN/A
851133SN/A/************************* preprocessor symbols *****************************/
86716SN/A
87716SN/A#define TLM_VERSION_RELEASE_DATE TLM_VERSION_RELEASE_YEAR \
88716SN/A                                 TLM_VERSION_RELEASE_MONTH \
89716SN/A                                 TLM_VERSION_RELEASE_DAY
90716SN/A
91716SN/A#define TLM_VERSION_STR(x) TLM_VERSION_STR_HELPER(x)
921133SN/A#define TLM_VERSION_STR_HELPER(x) #x
93716SN/A
942159SN/A#define TLM_VERSION_STRING_MAJOR TLM_VERSION_STR(TLM_VERSION_MAJOR)
95716SN/A#define TLM_VERSION_STRING_MINOR TLM_VERSION_STR(TLM_VERSION_MINOR)
96716SN/A#define TLM_VERSION_STRING_PATCH TLM_VERSION_STR(TLM_VERSION_PATCH)
972159SN/A
98716SN/A#define TLM_VERSION_STRING_MMP TLM_VERSION_STRING_MAJOR TLM_VERSION_SEPARATOR \
99716SN/A                               TLM_VERSION_STRING_MINOR TLM_VERSION_SEPARATOR \
1002159SN/A                               TLM_VERSION_STRING_PATCH
101716SN/A
102716SN/A#define TLM_VERSION_STRING_PRE_START "_"
103716SN/A#define TLM_VERSION_STRING_PRE_END "-"
104716SN/A
105716SN/A#if (TLM_IS_PRERELEASE == 1)
106716SN/A
107716SN/A#   define TLM_VERSION_STRING_PRERELEASE TLM_VERSION_PRERELEASE
1081133SN/A#   define TLM_VERSION_STRING_RELEASE_DATE ""
109716SN/A
110716SN/A#else /* TLM_IS_PRERELEASE == 1 */
111716SN/A
112716SN/A#   define TLM_VERSION_STRING_PRERELEASE ""
113716SN/A#   define TLM_VERSION_STRING_RELEASE_DATE TLM_VERSION_RELEASE_DATE
114716SN/A
115716SN/A#endif /* TLM_IS_PRERELEASE == 1 */
116716SN/A
117716SN/A#define TLM_VERSION_STRING TLM_VERSION_STRING_MMP \
118716SN/A                           TLM_VERSION_STRING_PRE_START \
119716SN/A                           TLM_VERSION_STRING_PRERELEASE \
120716SN/A                           TLM_VERSION_STRING_PRE_END \
1212159SN/A                           TLM_VERSION_ORIGINATOR
1222159SN/A
1232159SN/A#define TLM_VERSION_STRING_2 "TLM " \
1242147SN/A                             TLM_VERSION_STRING_MMP \
125716SN/A                             " --- " \
1262159SN/A                             TLM_VERSION_RELEASE_YEAR \
127716SN/A                             "-" \
128716SN/A                             TLM_VERSION_RELEASE_MONTH \
129716SN/A                             "-" \
130716SN/A                             TLM_VERSION_RELEASE_DAY
1311133SN/A
132716SN/A#define TLM_VERSION TLM_VERSION_STRING
1331133SN/A
134716SN/A/*************************** compiler symbols ********************************/
135716SN/A
136739SN/Aconst unsigned int tlm_version_major(TLM_VERSION_MAJOR);
137739SN/Aconst unsigned int tlm_version_minor(TLM_VERSION_MINOR);
1382190SN/Aconst unsigned int tlm_version_patch(TLM_VERSION_PATCH);
1392455SN/A
140716SN/Aconst bool tlm_is_prerelease(TLM_IS_PRERELEASE);
141716SN/A
1422SN/Aconst std::string tlm_version_string(TLM_VERSION_STRING);
1432190SN/Aconst std::string tlm_version_originator(TLM_VERSION_ORIGINATOR);
1442SN/Aconst std::string tlm_version_prerelease(TLM_VERSION_PRERELEASE);
1451136SN/Aconst std::string tlm_version_release_date(TLM_VERSION_STRING_RELEASE_DATE);
1462147SN/Aconst std::string tlm_copyright_string(TLM_COPYRIGHT);
1472SN/Aconst std::string tlm_version_string_2(TLM_VERSION_STRING_2);
1482159SN/A
1492SN/Ainline const char *tlm_release() { return tlm_version_string.c_str(); }
1502SN/Ainline const char *tlm_version() { return tlm_version_string_2.c_str(); }
1512190SN/Ainline const char *tlm_copyright() { return tlm_copyright_string.c_str(); }
152216SN/A
1531133SN/A} // namespace tlm
1542SN/A
1552SN/A#endif /* __SYSTEMC_EXT_TLM_CORE_2_VERSION_HH__ */
1562SN/A