version.hh revision 13521
16166Ssteve.reinhardt@amd.com/*****************************************************************************
26166Ssteve.reinhardt@amd.com
36166Ssteve.reinhardt@amd.com  Licensed to Accellera Systems Initiative Inc. (Accellera) under one or
46166Ssteve.reinhardt@amd.com  more contributor license agreements.  See the NOTICE file distributed
56166Ssteve.reinhardt@amd.com  with this work for additional information regarding copyright ownership.
66166Ssteve.reinhardt@amd.com  Accellera licenses this file to you under the Apache License, Version 2.0
76166Ssteve.reinhardt@amd.com  (the "License"); you may not use this file except in compliance with the
86166Ssteve.reinhardt@amd.com  License.  You may obtain a copy of the License at
96166Ssteve.reinhardt@amd.com
106166Ssteve.reinhardt@amd.com    http://www.apache.org/licenses/LICENSE-2.0
116166Ssteve.reinhardt@amd.com
126166Ssteve.reinhardt@amd.com  Unless required by applicable law or agreed to in writing, software
136166Ssteve.reinhardt@amd.com  distributed under the License is distributed on an "AS IS" BASIS,
146166Ssteve.reinhardt@amd.com  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
156166Ssteve.reinhardt@amd.com  implied.  See the License for the specific language governing
166166Ssteve.reinhardt@amd.com  permissions and limitations under the License.
176166Ssteve.reinhardt@amd.com
186166Ssteve.reinhardt@amd.com *****************************************************************************/
196166Ssteve.reinhardt@amd.com
206166Ssteve.reinhardt@amd.com/* ---------------------------------------------------------------------------
216166Ssteve.reinhardt@amd.com  Original Author:
226166Ssteve.reinhardt@amd.com    Charles Wilson, XtremeEDA Corporation
236166Ssteve.reinhardt@amd.com
246166Ssteve.reinhardt@amd.com @description
256166Ssteve.reinhardt@amd.com  This header contains preprocessor and compiler symbols to allow for the
266166Ssteve.reinhardt@amd.com   determination of the TLM version information. This conforms to
276166Ssteve.reinhardt@amd.com   IEEE 1666-2005 section 8.5.5 - 8.5.7
286166Ssteve.reinhardt@amd.com   The following are provided:
296166Ssteve.reinhardt@amd.com
306166Ssteve.reinhardt@amd.com   preprocessor: TLM_VERSION_MAJOR        numeric
319113SBrad.Beckmann@amd.com                 TLM_VERSION_MINOR        numeric
326166Ssteve.reinhardt@amd.com                 TLM_VERSION_PATCH        numeric
336166Ssteve.reinhardt@amd.com                 TLM_VERSION_ORIGINATOR   string       ([A-Z][a-z][0-9]_)
346166Ssteve.reinhardt@amd.com                 TLM_VERSION_RELEASE_DATE ISO8601 date (YYYYMMDD)
356166Ssteve.reinhardt@amd.com                 TLM_VERSION_PRERELEASE   string       ([A-Z][a-z][0-9]_)
366166Ssteve.reinhardt@amd.com                 TLM_IS_PRERELEASE        bool         (1,0)
376289Snate@binkert.org                 TLM_VERSION              string       {2.0.0_DR3-TLMWG}
386870Sdrh5@cs.wisc.edu                 TLM_COPYRIGHT            string
396289Snate@binkert.org
406166Ssteve.reinhardt@amd.com   compiler:     tlm_version_major        const unsigned int
419036Sandreas.hansson@arm.com                 tlm_version_minor        const unsigned int
426166Ssteve.reinhardt@amd.com                 tlm_version_patch        const unsigned int
436166Ssteve.reinhardt@amd.com                 tlm_version_originator   const std::string
446166Ssteve.reinhardt@amd.com                 tlm_version_release_date const std::string
457876Sgblack@eecs.umich.edu                 tlm_version_prerelease   const std::string
466166Ssteve.reinhardt@amd.com                 tlm_is_prerelease        const bool
476166Ssteve.reinhardt@amd.com                 tlm_version              const string
486166Ssteve.reinhardt@amd.com                 tlm_copyright            const string
498839Sandreas.hansson@arm.com
506166Ssteve.reinhardt@amd.com   accessors:    inline const char* tlm_release   (void)
518732Sandreas.hansson@arm.com                 inline const char* tlm_version   (void)
528839Sandreas.hansson@arm.com                 inline const char* tlm_copyright (void)
536166Ssteve.reinhardt@amd.com--------------------------------------------------------------------------- */
546166Ssteve.reinhardt@amd.com
556166Ssteve.reinhardt@amd.com#ifndef __SYSTEMC_EXT_TLM_CORE_2_VERSION_HH__
566166Ssteve.reinhardt@amd.com#define __SYSTEMC_EXT_TLM_CORE_2_VERSION_HH__
576166Ssteve.reinhardt@amd.com
588801Sgblack@eecs.umich.edunamespace tlm
596166Ssteve.reinhardt@amd.com{
60
61#define TLM_VERSION_MAJOR 2 ///< version major level ( numeric )
62#define TLM_VERSION_MINOR 0 ///< version minor level ( numeric )
63#define TLM_VERSION_PATCH 4 ///< version patch level ( numeric )
64#define TLM_VERSION_ORIGINATOR "Accellera" ///< TLM creator string
65#define TLM_VERSION_SEPARATOR "." ///< version string separator
66
67#define TLM_IS_PRERELEASE 0 ///< pre-release flag (1/0)
68
69#if TLM_IS_PRERELEASE
70#    define TLM_VERSION_PRERELEASE "pub_rev" ///< pre-release version string
71#else
72#    define TLM_VERSION_PRERELEASE "" ///< pre-release version string
73#endif
74
75#define TLM_VERSION_RELEASE_YEAR "2017" ///< release year  ( YYYY )
76#define TLM_VERSION_RELEASE_MONTH "10" ///< release month ( MM )
77#define TLM_VERSION_RELEASE_DAY "12" ///< release day   ( DD )
78
79#define TLM_COPYRIGHT \
80  "Copyright (c) 1996-" TLM_VERSION_RELEASE_YEAR " by all Contributors\n" \
81  "ALL RIGHTS RESERVED"
82
83/******************** do not modify below this line *************************/
84
85/************************* preprocessor symbols *****************************/
86
87#define TLM_VERSION_RELEASE_DATE TLM_VERSION_RELEASE_YEAR \
88                                 TLM_VERSION_RELEASE_MONTH \
89                                 TLM_VERSION_RELEASE_DAY
90
91#define TLM_VERSION_STR(x) TLM_VERSION_STR_HELPER(x)
92#define TLM_VERSION_STR_HELPER(x) #x
93
94#define TLM_VERSION_STRING_MAJOR TLM_VERSION_STR(TLM_VERSION_MAJOR)
95#define TLM_VERSION_STRING_MINOR TLM_VERSION_STR(TLM_VERSION_MINOR)
96#define TLM_VERSION_STRING_PATCH TLM_VERSION_STR(TLM_VERSION_PATCH)
97
98#define TLM_VERSION_STRING_MMP TLM_VERSION_STRING_MAJOR TLM_VERSION_SEPARATOR \
99                               TLM_VERSION_STRING_MINOR TLM_VERSION_SEPARATOR \
100                               TLM_VERSION_STRING_PATCH
101
102#define TLM_VERSION_STRING_PRE_START "_"
103#define TLM_VERSION_STRING_PRE_END "-"
104
105#if (TLM_IS_PRERELEASE == 1)
106
107#   define TLM_VERSION_STRING_PRERELEASE TLM_VERSION_PRERELEASE
108#   define TLM_VERSION_STRING_RELEASE_DATE ""
109
110#else /* TLM_IS_PRERELEASE == 1 */
111
112#   define TLM_VERSION_STRING_PRERELEASE ""
113#   define TLM_VERSION_STRING_RELEASE_DATE TLM_VERSION_RELEASE_DATE
114
115#endif /* TLM_IS_PRERELEASE == 1 */
116
117#define TLM_VERSION_STRING TLM_VERSION_STRING_MMP \
118                           TLM_VERSION_STRING_PRE_START \
119                           TLM_VERSION_STRING_PRERELEASE \
120                           TLM_VERSION_STRING_PRE_END \
121                           TLM_VERSION_ORIGINATOR
122
123#define TLM_VERSION_STRING_2 "TLM " \
124                             TLM_VERSION_STRING_MMP \
125                             " --- " \
126                             TLM_VERSION_RELEASE_YEAR \
127                             "-" \
128                             TLM_VERSION_RELEASE_MONTH \
129                             "-" \
130                             TLM_VERSION_RELEASE_DAY
131
132#define TLM_VERSION TLM_VERSION_STRING
133
134/*************************** compiler symbols ********************************/
135
136const unsigned int tlm_version_major(TLM_VERSION_MAJOR);
137const unsigned int tlm_version_minor(TLM_VERSION_MINOR);
138const unsigned int tlm_version_patch(TLM_VERSION_PATCH);
139
140const bool tlm_is_prerelease(TLM_IS_PRERELEASE);
141
142const std::string tlm_version_string(TLM_VERSION_STRING);
143const std::string tlm_version_originator(TLM_VERSION_ORIGINATOR);
144const std::string tlm_version_prerelease(TLM_VERSION_PRERELEASE);
145const std::string tlm_version_release_date(TLM_VERSION_STRING_RELEASE_DATE);
146const std::string tlm_copyright_string(TLM_COPYRIGHT);
147const std::string tlm_version_string_2(TLM_VERSION_STRING_2);
148
149inline const char *tlm_release() { return tlm_version_string.c_str(); }
150inline const char *tlm_version() { return tlm_version_string_2.c_str(); }
151inline const char *tlm_copyright() { return tlm_copyright_string.c_str(); }
152
153} // namespace tlm
154
155#endif /* __SYSTEMC_EXT_TLM_CORE_2_VERSION_HH__ */
156