113521Sgabeblack@google.com/*****************************************************************************
213521Sgabeblack@google.com
313521Sgabeblack@google.com  Licensed to Accellera Systems Initiative Inc. (Accellera) under one or
413521Sgabeblack@google.com  more contributor license agreements.  See the NOTICE file distributed
513521Sgabeblack@google.com  with this work for additional information regarding copyright ownership.
613521Sgabeblack@google.com  Accellera licenses this file to you under the Apache License, Version 2.0
713521Sgabeblack@google.com  (the "License"); you may not use this file except in compliance with the
813521Sgabeblack@google.com  License.  You may obtain a copy of the License at
913521Sgabeblack@google.com
1013521Sgabeblack@google.com    http://www.apache.org/licenses/LICENSE-2.0
1113521Sgabeblack@google.com
1213521Sgabeblack@google.com  Unless required by applicable law or agreed to in writing, software
1313521Sgabeblack@google.com  distributed under the License is distributed on an "AS IS" BASIS,
1413521Sgabeblack@google.com  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
1513521Sgabeblack@google.com  implied.  See the License for the specific language governing
1613521Sgabeblack@google.com  permissions and limitations under the License.
1713521Sgabeblack@google.com
1813521Sgabeblack@google.com *****************************************************************************/
1913521Sgabeblack@google.com
2013521Sgabeblack@google.com/* ---------------------------------------------------------------------------
2113521Sgabeblack@google.com  Original Author:
2213521Sgabeblack@google.com    Charles Wilson, XtremeEDA Corporation
2313521Sgabeblack@google.com
2413521Sgabeblack@google.com @description
2513521Sgabeblack@google.com  This header contains preprocessor and compiler symbols to allow for the
2613521Sgabeblack@google.com   determination of the TLM version information. This conforms to
2713521Sgabeblack@google.com   IEEE 1666-2005 section 8.5.5 - 8.5.7
2813521Sgabeblack@google.com   The following are provided:
2913521Sgabeblack@google.com
3013521Sgabeblack@google.com   preprocessor: TLM_VERSION_MAJOR        numeric
3113521Sgabeblack@google.com                 TLM_VERSION_MINOR        numeric
3213521Sgabeblack@google.com                 TLM_VERSION_PATCH        numeric
3313521Sgabeblack@google.com                 TLM_VERSION_ORIGINATOR   string       ([A-Z][a-z][0-9]_)
3413521Sgabeblack@google.com                 TLM_VERSION_RELEASE_DATE ISO8601 date (YYYYMMDD)
3513521Sgabeblack@google.com                 TLM_VERSION_PRERELEASE   string       ([A-Z][a-z][0-9]_)
3613521Sgabeblack@google.com                 TLM_IS_PRERELEASE        bool         (1,0)
3713521Sgabeblack@google.com                 TLM_VERSION              string       {2.0.0_DR3-TLMWG}
3813521Sgabeblack@google.com                 TLM_COPYRIGHT            string
3913521Sgabeblack@google.com
4013521Sgabeblack@google.com   compiler:     tlm_version_major        const unsigned int
4113521Sgabeblack@google.com                 tlm_version_minor        const unsigned int
4213521Sgabeblack@google.com                 tlm_version_patch        const unsigned int
4313521Sgabeblack@google.com                 tlm_version_originator   const std::string
4413521Sgabeblack@google.com                 tlm_version_release_date const std::string
4513521Sgabeblack@google.com                 tlm_version_prerelease   const std::string
4613521Sgabeblack@google.com                 tlm_is_prerelease        const bool
4713521Sgabeblack@google.com                 tlm_version              const string
4813521Sgabeblack@google.com                 tlm_copyright            const string
4913521Sgabeblack@google.com
5013521Sgabeblack@google.com   accessors:    inline const char* tlm_release   (void)
5113521Sgabeblack@google.com                 inline const char* tlm_version   (void)
5213521Sgabeblack@google.com                 inline const char* tlm_copyright (void)
5313521Sgabeblack@google.com--------------------------------------------------------------------------- */
5413521Sgabeblack@google.com
5513521Sgabeblack@google.com#ifndef __SYSTEMC_EXT_TLM_CORE_2_VERSION_HH__
5613521Sgabeblack@google.com#define __SYSTEMC_EXT_TLM_CORE_2_VERSION_HH__
5713521Sgabeblack@google.com
5813521Sgabeblack@google.comnamespace tlm
5913521Sgabeblack@google.com{
6013521Sgabeblack@google.com
6113521Sgabeblack@google.com#define TLM_VERSION_MAJOR 2 ///< version major level ( numeric )
6213521Sgabeblack@google.com#define TLM_VERSION_MINOR 0 ///< version minor level ( numeric )
6313521Sgabeblack@google.com#define TLM_VERSION_PATCH 4 ///< version patch level ( numeric )
6413521Sgabeblack@google.com#define TLM_VERSION_ORIGINATOR "Accellera" ///< TLM creator string
6513521Sgabeblack@google.com#define TLM_VERSION_SEPARATOR "." ///< version string separator
6613521Sgabeblack@google.com
6713521Sgabeblack@google.com#define TLM_IS_PRERELEASE 0 ///< pre-release flag (1/0)
6813521Sgabeblack@google.com
6913521Sgabeblack@google.com#if TLM_IS_PRERELEASE
7013521Sgabeblack@google.com#    define TLM_VERSION_PRERELEASE "pub_rev" ///< pre-release version string
7113521Sgabeblack@google.com#else
7213521Sgabeblack@google.com#    define TLM_VERSION_PRERELEASE "" ///< pre-release version string
7313521Sgabeblack@google.com#endif
7413521Sgabeblack@google.com
7513521Sgabeblack@google.com#define TLM_VERSION_RELEASE_YEAR "2017" ///< release year  ( YYYY )
7613521Sgabeblack@google.com#define TLM_VERSION_RELEASE_MONTH "10" ///< release month ( MM )
7713521Sgabeblack@google.com#define TLM_VERSION_RELEASE_DAY "12" ///< release day   ( DD )
7813521Sgabeblack@google.com
7913521Sgabeblack@google.com#define TLM_COPYRIGHT \
8013521Sgabeblack@google.com  "Copyright (c) 1996-" TLM_VERSION_RELEASE_YEAR " by all Contributors\n" \
8113521Sgabeblack@google.com  "ALL RIGHTS RESERVED"
8213521Sgabeblack@google.com
8313521Sgabeblack@google.com/******************** do not modify below this line *************************/
8413521Sgabeblack@google.com
8513521Sgabeblack@google.com/************************* preprocessor symbols *****************************/
8613521Sgabeblack@google.com
8713521Sgabeblack@google.com#define TLM_VERSION_RELEASE_DATE TLM_VERSION_RELEASE_YEAR \
8813521Sgabeblack@google.com                                 TLM_VERSION_RELEASE_MONTH \
8913521Sgabeblack@google.com                                 TLM_VERSION_RELEASE_DAY
9013521Sgabeblack@google.com
9113521Sgabeblack@google.com#define TLM_VERSION_STR(x) TLM_VERSION_STR_HELPER(x)
9213521Sgabeblack@google.com#define TLM_VERSION_STR_HELPER(x) #x
9313521Sgabeblack@google.com
9413521Sgabeblack@google.com#define TLM_VERSION_STRING_MAJOR TLM_VERSION_STR(TLM_VERSION_MAJOR)
9513521Sgabeblack@google.com#define TLM_VERSION_STRING_MINOR TLM_VERSION_STR(TLM_VERSION_MINOR)
9613521Sgabeblack@google.com#define TLM_VERSION_STRING_PATCH TLM_VERSION_STR(TLM_VERSION_PATCH)
9713521Sgabeblack@google.com
9813521Sgabeblack@google.com#define TLM_VERSION_STRING_MMP TLM_VERSION_STRING_MAJOR TLM_VERSION_SEPARATOR \
9913521Sgabeblack@google.com                               TLM_VERSION_STRING_MINOR TLM_VERSION_SEPARATOR \
10013521Sgabeblack@google.com                               TLM_VERSION_STRING_PATCH
10113521Sgabeblack@google.com
10213521Sgabeblack@google.com#define TLM_VERSION_STRING_PRE_START "_"
10313521Sgabeblack@google.com#define TLM_VERSION_STRING_PRE_END "-"
10413521Sgabeblack@google.com
10513521Sgabeblack@google.com#if (TLM_IS_PRERELEASE == 1)
10613521Sgabeblack@google.com
10713521Sgabeblack@google.com#   define TLM_VERSION_STRING_PRERELEASE TLM_VERSION_PRERELEASE
10813521Sgabeblack@google.com#   define TLM_VERSION_STRING_RELEASE_DATE ""
10913521Sgabeblack@google.com
11013521Sgabeblack@google.com#else /* TLM_IS_PRERELEASE == 1 */
11113521Sgabeblack@google.com
11213521Sgabeblack@google.com#   define TLM_VERSION_STRING_PRERELEASE ""
11313521Sgabeblack@google.com#   define TLM_VERSION_STRING_RELEASE_DATE TLM_VERSION_RELEASE_DATE
11413521Sgabeblack@google.com
11513521Sgabeblack@google.com#endif /* TLM_IS_PRERELEASE == 1 */
11613521Sgabeblack@google.com
11713521Sgabeblack@google.com#define TLM_VERSION_STRING TLM_VERSION_STRING_MMP \
11813521Sgabeblack@google.com                           TLM_VERSION_STRING_PRE_START \
11913521Sgabeblack@google.com                           TLM_VERSION_STRING_PRERELEASE \
12013521Sgabeblack@google.com                           TLM_VERSION_STRING_PRE_END \
12113521Sgabeblack@google.com                           TLM_VERSION_ORIGINATOR
12213521Sgabeblack@google.com
12313521Sgabeblack@google.com#define TLM_VERSION_STRING_2 "TLM " \
12413521Sgabeblack@google.com                             TLM_VERSION_STRING_MMP \
12513521Sgabeblack@google.com                             " --- " \
12613521Sgabeblack@google.com                             TLM_VERSION_RELEASE_YEAR \
12713521Sgabeblack@google.com                             "-" \
12813521Sgabeblack@google.com                             TLM_VERSION_RELEASE_MONTH \
12913521Sgabeblack@google.com                             "-" \
13013521Sgabeblack@google.com                             TLM_VERSION_RELEASE_DAY
13113521Sgabeblack@google.com
13213521Sgabeblack@google.com#define TLM_VERSION TLM_VERSION_STRING
13313521Sgabeblack@google.com
13413521Sgabeblack@google.com/*************************** compiler symbols ********************************/
13513521Sgabeblack@google.com
13613521Sgabeblack@google.comconst unsigned int tlm_version_major(TLM_VERSION_MAJOR);
13713521Sgabeblack@google.comconst unsigned int tlm_version_minor(TLM_VERSION_MINOR);
13813521Sgabeblack@google.comconst unsigned int tlm_version_patch(TLM_VERSION_PATCH);
13913521Sgabeblack@google.com
14013521Sgabeblack@google.comconst bool tlm_is_prerelease(TLM_IS_PRERELEASE);
14113521Sgabeblack@google.com
14213521Sgabeblack@google.comconst std::string tlm_version_string(TLM_VERSION_STRING);
14313521Sgabeblack@google.comconst std::string tlm_version_originator(TLM_VERSION_ORIGINATOR);
14413521Sgabeblack@google.comconst std::string tlm_version_prerelease(TLM_VERSION_PRERELEASE);
14513521Sgabeblack@google.comconst std::string tlm_version_release_date(TLM_VERSION_STRING_RELEASE_DATE);
14613521Sgabeblack@google.comconst std::string tlm_copyright_string(TLM_COPYRIGHT);
14713521Sgabeblack@google.comconst std::string tlm_version_string_2(TLM_VERSION_STRING_2);
14813521Sgabeblack@google.com
14913521Sgabeblack@google.cominline const char *tlm_release() { return tlm_version_string.c_str(); }
15013521Sgabeblack@google.cominline const char *tlm_version() { return tlm_version_string_2.c_str(); }
15113521Sgabeblack@google.cominline const char *tlm_copyright() { return tlm_copyright_string.c_str(); }
15213521Sgabeblack@google.com
15313521Sgabeblack@google.com} // namespace tlm
15413521Sgabeblack@google.com
15513521Sgabeblack@google.com#endif /* __SYSTEMC_EXT_TLM_CORE_2_VERSION_HH__ */
156