tlm_version.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 @file tlm_version.h
22
23 @brief TLM version header
24
25  Original Author:
26    Charles Wilson, XtremeEDA Corporation
27
28 @description
29  This header contains preprocessor and compiler symbols to allow for the determination
30   of the TLM version information. This conforms to IEEE 1666-2005 section 8.5.5 - 8.5.7
31   .
32   The following are provided:
33   .
34   preprocessor: TLM_VERSION_MAJOR        numeric
35                 TLM_VERSION_MINOR        numeric
36                 TLM_VERSION_PATCH        numeric
37                 TLM_VERSION_ORIGINATOR   string       ([A-Z][a-z][0-9]_)
38                 TLM_VERSION_RELEASE_DATE ISO8601 date (YYYYMMDD)
39                 TLM_VERSION_PRERELEASE   string       ([A-Z][a-z][0-9]_)
40                 TLM_IS_PRERELEASE        bool         (1,0)
41                 TLM_VERSION              string       {2.0.0_DR3-TLMWG}
42                 TLM_COPYRIGHT            string
43   .
44   compiler:     tlm_version_major        const unsigned int
45                 tlm_version_minor        const unsigned int
46                 tlm_version_patch        const unsigned int
47                 tlm_version_originator   const std::string
48                 tlm_version_release_date const std::string
49                 tlm_version_prerelease   const std::string
50                 tlm_is_prerelease        const bool
51                 tlm_version              const string
52                 tlm_copyright            const string
53   .
54   accessors:    inline const char* tlm_release   (void)
55                 inline const char* tlm_version   (void)
56                 inline const char* tlm_copyright (void)
57
58--------------------------------------------------------------------------------------- */
59
60#ifndef __TLM_VERSION_H__
61#define __TLM_VERSION_H__
62
63namespace tlm
64{
65
66#define TLM_VERSION_MAJOR                   2           ///< version major level ( numeric )
67#define TLM_VERSION_MINOR                   0           ///< version minor level ( numeric )
68#define TLM_VERSION_PATCH                   3           ///< version patch level ( numeric )
69#define TLM_VERSION_ORIGINATOR              "Accellera" ///< TLM creator string
70#define TLM_VERSION_SEPARATOR               "."         ///< version string separator
71
72#define TLM_IS_PRERELEASE                   0           ///< pre-release flag ( 1 / 0 )
73
74#if TLM_IS_PRERELEASE
75#    define TLM_VERSION_PRERELEASE          "pub_rev"   ///< pre-release version string
76#else
77#    define TLM_VERSION_PRERELEASE          ""          ///< pre-release version string
78#endif
79
80#define TLM_VERSION_RELEASE_YEAR            "2013"      ///< release year  ( YYYY )
81#define TLM_VERSION_RELEASE_MONTH           "12"        ///< release month ( MM )
82#define TLM_VERSION_RELEASE_DAY             "15"        ///< release day   ( DD )
83
84#define TLM_COPYRIGHT \
85  "Copyright (c) 1996-" TLM_VERSION_RELEASE_YEAR " by all Contributors\n" \
86  "ALL RIGHTS RESERVED"
87
88/************************** do not modify below this line *******************************/
89
90/******************************* preprocessor symbols ***********************************/
91
92#define TLM_VERSION_RELEASE_DATE            TLM_VERSION_RELEASE_YEAR \
93                                            TLM_VERSION_RELEASE_MONTH \
94                                            TLM_VERSION_RELEASE_DAY
95
96#define TLM_VERSION_STR(x)                  TLM_VERSION_STR_HELPER(x)
97#define TLM_VERSION_STR_HELPER(x)           #x
98
99#define TLM_VERSION_STRING_MAJOR            TLM_VERSION_STR(TLM_VERSION_MAJOR)
100#define TLM_VERSION_STRING_MINOR            TLM_VERSION_STR(TLM_VERSION_MINOR)
101#define TLM_VERSION_STRING_PATCH            TLM_VERSION_STR(TLM_VERSION_PATCH)
102
103#define TLM_VERSION_STRING_MMP              TLM_VERSION_STRING_MAJOR TLM_VERSION_SEPARATOR \
104                                            TLM_VERSION_STRING_MINOR TLM_VERSION_SEPARATOR \
105                                            TLM_VERSION_STRING_PATCH
106
107#define TLM_VERSION_STRING_PRE_START        "_"
108#define TLM_VERSION_STRING_PRE_END          "-"
109
110#if ( TLM_IS_PRERELEASE == 1 )
111
112#define TLM_VERSION_STRING_PRERELEASE       TLM_VERSION_PRERELEASE
113#define TLM_VERSION_STRING_RELEASE_DATE     ""
114
115#else   /* TLM_IS_PRERELEASE == 1 */
116
117#define TLM_VERSION_STRING_PRERELEASE       ""
118#define TLM_VERSION_STRING_RELEASE_DATE     TLM_VERSION_RELEASE_DATE
119
120#endif  /* TLM_IS_PRERELEASE == 1 */
121
122#define TLM_VERSION_STRING                  TLM_VERSION_STRING_MMP \
123                                            TLM_VERSION_STRING_PRE_START \
124                                            TLM_VERSION_STRING_PRERELEASE \
125                                            TLM_VERSION_STRING_PRE_END \
126                                            TLM_VERSION_ORIGINATOR
127
128#define TLM_VERSION_STRING_2                "TLM " \
129                                            TLM_VERSION_STRING_MMP \
130                                            " --- " \
131                                            TLM_VERSION_RELEASE_YEAR \
132                                            "-" \
133                                            TLM_VERSION_RELEASE_MONTH \
134                                            "-" \
135                                            TLM_VERSION_RELEASE_DAY
136
137#define TLM_VERSION                         TLM_VERSION_STRING
138
139/********************************* compiler symbols **************************************/
140
141const unsigned int tlm_version_major        ( TLM_VERSION_MAJOR               );
142const unsigned int tlm_version_minor        ( TLM_VERSION_MINOR               );
143const unsigned int tlm_version_patch        ( TLM_VERSION_PATCH               );
144
145const bool         tlm_is_prerelease        ( TLM_IS_PRERELEASE               );
146
147const std::string  tlm_version_string       ( TLM_VERSION_STRING              );
148const std::string  tlm_version_originator   ( TLM_VERSION_ORIGINATOR          );
149const std::string  tlm_version_prerelease   ( TLM_VERSION_PRERELEASE          );
150const std::string  tlm_version_release_date ( TLM_VERSION_STRING_RELEASE_DATE );
151const std::string  tlm_copyright_string     ( TLM_COPYRIGHT                   );
152const std::string  tlm_version_string_2     ( TLM_VERSION_STRING_2            );
153
154inline const char*
155tlm_release
156( void
157)
158{
159  return tlm_version_string.c_str ();
160}
161
162inline const char*
163tlm_version
164( void
165)
166{
167  return tlm_version_string_2.c_str ();
168}
169
170inline const char*
171tlm_copyright
172( void
173)
174{
175  return tlm_copyright_string.c_str ();
176}
177
178} // namespace tlm
179
180#endif /* __TLM_VERSION_H__ */
181