TLM-2.0  2.0.3
Accellera TLM-2.0 proof-of-concept library
tlm_version.h
Go to the documentation of this file.
1 /*****************************************************************************
2 
3  The following code is derived, directly or indirectly, from the SystemC
4  source code Copyright (c) 1996-2014 by all Contributors.
5  All Rights reserved.
6 
7  The contents of this file are subject to the restrictions and limitations
8  set forth in the SystemC Open Source License (the "License");
9  You may not use this file except in compliance with such restrictions and
10  limitations. You may obtain instructions on how to receive a copy of the
11  License at http://www.accellera.org/. Software distributed by Contributors
12  under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF
13  ANY KIND, either express or implied. See the License for the specific
14  language governing rights and limitations under the License.
15 
16  *****************************************************************************/
17 
18 /* ---------------------------------------------------------------------------------------
19  @file tlm_version.h
20 
21  @brief TLM version header
22 
23  Original Author:
24  Charles Wilson, XtremeEDA Corporation
25 
26  @description
27  This header contains preprocessor and compiler symbols to allow for the determination
28  of the TLM version information. This conforms to IEEE 1666-2005 section 8.5.5 - 8.5.7
29  .
30  The following are provided:
31  .
32  preprocessor: TLM_VERSION_MAJOR numeric
33  TLM_VERSION_MINOR numeric
34  TLM_VERSION_PATCH numeric
35  TLM_VERSION_ORIGINATOR string ([A-Z][a-z][0-9]_)
36  TLM_VERSION_RELEASE_DATE ISO8601 date (YYYYMMDD)
37  TLM_VERSION_PRERELEASE string ([A-Z][a-z][0-9]_)
38  TLM_IS_PRERELEASE bool (1,0)
39  TLM_VERSION string {2.0.0_DR3-TLMWG}
40  TLM_COPYRIGHT string
41  .
42  compiler: tlm_version_major const unsigned int
43  tlm_version_minor const unsigned int
44  tlm_version_patch const unsigned int
45  tlm_version_originator const std::string
46  tlm_version_release_date const std::string
47  tlm_version_prerelease const std::string
48  tlm_is_prerelease const bool
49  tlm_version const string
50  tlm_copyright const string
51  .
52  accessors: inline const char* tlm_release (void)
53  inline const char* tlm_version (void)
54  inline const char* tlm_copyright (void)
55 
56 --------------------------------------------------------------------------------------- */
57 
58 #ifndef __TLM_VERSION_H__
59 #define __TLM_VERSION_H__
60 
61 namespace tlm
62 {
63 
64 #define TLM_VERSION_MAJOR 2
65 #define TLM_VERSION_MINOR 0
66 #define TLM_VERSION_PATCH 3
67 #define TLM_VERSION_ORIGINATOR "Accellera"
68 #define TLM_VERSION_SEPARATOR "."
69 
70 #define TLM_IS_PRERELEASE 0
71 
72 #if TLM_IS_PRERELEASE
73 # define TLM_VERSION_PRERELEASE "pub_rev"
74 #else
75 # define TLM_VERSION_PRERELEASE ""
76 #endif
77 
78 #define TLM_VERSION_RELEASE_YEAR "2013"
79 #define TLM_VERSION_RELEASE_MONTH "12"
80 #define TLM_VERSION_RELEASE_DAY "15"
81 
82 #define TLM_COPYRIGHT \
83  "Copyright (c) 1996-" TLM_VERSION_RELEASE_YEAR " by all Contributors\n" \
84  "ALL RIGHTS RESERVED"
85 
86 /************************** do not modify below this line *******************************/
87 
88 /******************************* preprocessor symbols ***********************************/
89 
90 #define TLM_VERSION_RELEASE_DATE TLM_VERSION_RELEASE_YEAR \
91  TLM_VERSION_RELEASE_MONTH \
92  TLM_VERSION_RELEASE_DAY
93 
94 #define TLM_VERSION_STR(x) TLM_VERSION_STR_HELPER(x)
95 #define TLM_VERSION_STR_HELPER(x) #x
96 
97 #define TLM_VERSION_STRING_MAJOR TLM_VERSION_STR(TLM_VERSION_MAJOR)
98 #define TLM_VERSION_STRING_MINOR TLM_VERSION_STR(TLM_VERSION_MINOR)
99 #define TLM_VERSION_STRING_PATCH TLM_VERSION_STR(TLM_VERSION_PATCH)
100 
101 #define TLM_VERSION_STRING_MMP TLM_VERSION_STRING_MAJOR TLM_VERSION_SEPARATOR \
102  TLM_VERSION_STRING_MINOR TLM_VERSION_SEPARATOR \
103  TLM_VERSION_STRING_PATCH
104 
105 #define TLM_VERSION_STRING_PRE_START "_"
106 #define TLM_VERSION_STRING_PRE_END "-"
107 
108 #if ( TLM_IS_PRERELEASE == 1 )
109 
110 #define TLM_VERSION_STRING_PRERELEASE TLM_VERSION_PRERELEASE
111 #define TLM_VERSION_STRING_RELEASE_DATE ""
112 
113 #else /* TLM_IS_PRERELEASE == 1 */
114 
115 #define TLM_VERSION_STRING_PRERELEASE ""
116 #define TLM_VERSION_STRING_RELEASE_DATE TLM_VERSION_RELEASE_DATE
117 
118 #endif /* TLM_IS_PRERELEASE == 1 */
119 
120 #define TLM_VERSION_STRING TLM_VERSION_STRING_MMP \
121  TLM_VERSION_STRING_PRE_START \
122  TLM_VERSION_STRING_PRERELEASE \
123  TLM_VERSION_STRING_PRE_END \
124  TLM_VERSION_ORIGINATOR
125 
126 #define TLM_VERSION_STRING_2 "TLM " \
127  TLM_VERSION_STRING_MMP \
128  " --- " \
129  TLM_VERSION_RELEASE_YEAR \
130  "-" \
131  TLM_VERSION_RELEASE_MONTH \
132  "-" \
133  TLM_VERSION_RELEASE_DAY
134 
135 #define TLM_VERSION TLM_VERSION_STRING
136 
137 /********************************* compiler symbols **************************************/
138 
139 const unsigned int tlm_version_major ( TLM_VERSION_MAJOR );
140 const unsigned int tlm_version_minor ( TLM_VERSION_MINOR );
141 const unsigned int tlm_version_patch ( TLM_VERSION_PATCH );
142 
143 const bool tlm_is_prerelease ( TLM_IS_PRERELEASE );
144 
145 const std::string tlm_version_string ( TLM_VERSION_STRING );
146 const std::string tlm_version_originator ( TLM_VERSION_ORIGINATOR );
147 const std::string tlm_version_prerelease ( TLM_VERSION_PRERELEASE );
149 const std::string tlm_copyright_string ( TLM_COPYRIGHT );
150 const std::string tlm_version_string_2 ( TLM_VERSION_STRING_2 );
151 
152 inline const char*
154 ( void
155 )
156 {
157  return tlm_version_string.c_str ();
158 }
159 
160 inline const char*
162 ( void
163 )
164 {
165  return tlm_version_string_2.c_str ();
166 }
167 
168 inline const char*
170 ( void
171 )
172 {
173  return tlm_copyright_string.c_str ();
174 }
175 
176 } // namespace tlm
177 
178 #endif /* __TLM_VERSION_H__ */
#define TLM_VERSION_STRING_2
Definition: tlm_version.h:126
const std::string tlm_copyright_string(TLM_COPYRIGHT)
const char * tlm_copyright(void)
Definition: tlm_version.h:170
const char * tlm_release(void)
Definition: tlm_version.h:154
const std::string tlm_version_prerelease(TLM_VERSION_PRERELEASE)
const unsigned int tlm_version_major(TLM_VERSION_MAJOR)
#define TLM_VERSION_MAJOR
version major level ( numeric )
Definition: tlm_version.h:64
const std::string tlm_version_originator(TLM_VERSION_ORIGINATOR)
const unsigned int tlm_version_minor(TLM_VERSION_MINOR)
#define TLM_VERSION_PRERELEASE
pre-release version string
Definition: tlm_version.h:75
#define TLM_VERSION_STRING
Definition: tlm_version.h:120
#define TLM_VERSION_PATCH
version patch level ( numeric )
Definition: tlm_version.h:66
const unsigned int tlm_version_patch(TLM_VERSION_PATCH)
#define TLM_VERSION_MINOR
version minor level ( numeric )
Definition: tlm_version.h:65
#define TLM_VERSION_STRING_RELEASE_DATE
Definition: tlm_version.h:116
const std::string tlm_version_string(TLM_VERSION_STRING)
const bool tlm_is_prerelease(TLM_IS_PRERELEASE)
#define TLM_VERSION_ORIGINATOR
TLM creator string.
Definition: tlm_version.h:67
const std::string tlm_version_release_date(TLM_VERSION_STRING_RELEASE_DATE)
const std::string tlm_version_string_2(TLM_VERSION_STRING_2)
const char * tlm_version(void)
Definition: tlm_version.h:162
#define TLM_IS_PRERELEASE
pre-release flag ( 1 / 0 )
Definition: tlm_version.h:70
#define TLM_COPYRIGHT
Definition: tlm_version.h:82