TLM-2.0  2.0.4
Accellera TLM-2.0 proof-of-concept library
tlm_version.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  @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 
63 namespace tlm
64 {
65 
66 #define TLM_VERSION_MAJOR 2
67 #define TLM_VERSION_MINOR 0
68 #define TLM_VERSION_PATCH 4
69 #define TLM_VERSION_ORIGINATOR "Accellera"
70 #define TLM_VERSION_SEPARATOR "."
71 
72 #define TLM_IS_PRERELEASE 0
73 
74 #if TLM_IS_PRERELEASE
75 # define TLM_VERSION_PRERELEASE "pub_rev"
76 #else
77 # define TLM_VERSION_PRERELEASE ""
78 #endif
79 
80 #define TLM_VERSION_RELEASE_YEAR "2017"
81 #define TLM_VERSION_RELEASE_MONTH "10"
82 #define TLM_VERSION_RELEASE_DAY "12"
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 
141 const unsigned int tlm_version_major ( TLM_VERSION_MAJOR );
142 const unsigned int tlm_version_minor ( TLM_VERSION_MINOR );
143 const unsigned int tlm_version_patch ( TLM_VERSION_PATCH );
144 
145 const bool tlm_is_prerelease ( TLM_IS_PRERELEASE );
146 
147 const std::string tlm_version_string ( TLM_VERSION_STRING );
148 const std::string tlm_version_originator ( TLM_VERSION_ORIGINATOR );
149 const std::string tlm_version_prerelease ( TLM_VERSION_PRERELEASE );
151 const std::string tlm_copyright_string ( TLM_COPYRIGHT );
152 const std::string tlm_version_string_2 ( TLM_VERSION_STRING_2 );
153 
154 inline const char*
156 ( void
157 )
158 {
159  return tlm_version_string.c_str ();
160 }
161 
162 inline const char*
164 ( void
165 )
166 {
167  return tlm_version_string_2.c_str ();
168 }
169 
170 inline const char*
172 ( void
173 )
174 {
175  return tlm_copyright_string.c_str ();
176 }
177 
178 } // namespace tlm
179 
180 #endif /* __TLM_VERSION_H__ */
const unsigned int tlm_version_patch(TLM_VERSION_PATCH)
const unsigned int tlm_version_major(TLM_VERSION_MAJOR)
const std::string tlm_copyright_string(TLM_COPYRIGHT)
const std::string tlm_version_string(TLM_VERSION_STRING)
#define TLM_COPYRIGHT
Definition: tlm_version.h:84
#define TLM_VERSION_MINOR
version minor level ( numeric )
Definition: tlm_version.h:67
#define TLM_VERSION_STRING_RELEASE_DATE
Definition: tlm_version.h:118
#define TLM_IS_PRERELEASE
pre-release flag ( 1 / 0 )
Definition: tlm_version.h:72
#define TLM_VERSION_PRERELEASE
pre-release version string
Definition: tlm_version.h:77
const char * tlm_release(void)
Definition: tlm_version.h:156
const bool tlm_is_prerelease(TLM_IS_PRERELEASE)
#define TLM_VERSION_STRING_2
Definition: tlm_version.h:128
#define TLM_VERSION_ORIGINATOR
TLM creator string.
Definition: tlm_version.h:69
#define TLM_VERSION_PATCH
version patch level ( numeric )
Definition: tlm_version.h:68
const std::string tlm_version_originator(TLM_VERSION_ORIGINATOR)
const std::string tlm_version_prerelease(TLM_VERSION_PRERELEASE)
const std::string tlm_version_string_2(TLM_VERSION_STRING_2)
const unsigned int tlm_version_minor(TLM_VERSION_MINOR)
const std::string tlm_version_release_date(TLM_VERSION_STRING_RELEASE_DATE)
const char * tlm_copyright(void)
Definition: tlm_version.h:172
#define TLM_VERSION_STRING
Definition: tlm_version.h:122
#define TLM_VERSION_MAJOR
version major level ( numeric )
Definition: tlm_version.h:66
const char * tlm_version(void)
Definition: tlm_version.h:164