ETISS 0.8.0
Extendable Translating Instruction Set Simulator (version 0.8.0)
Classes | Namespaces | Macros | Enumerations | Functions
Misc.h File Reference

general configuration and logging More...

#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <mutex>
#include <regex>
#include <set>
#include <sstream>
#include <string>
#include <typeinfo>
#include <vector>
#include "etiss/config.h"
#include "etiss/jit/types.h"
#include "etiss/ClassDefs.h"
Include dependency graph for Misc.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  etiss::ToString
 Marker interface for toString() support. More...
 
class  etiss::SourceCodeLocation
 simple class that store source location information. More...
 
class  etiss::Configuration
 simple class to hold configuration options More...
 
class  etiss::ConfigAnnouncer
 simple class to add a configuration option to the list of known options More...
 

Namespaces

 etiss
 Page Table Entry (PTE) defines the composition of Page Frame Number (PFN) and relavant flags.
 

Macros

#define ETISS_TOSTRING2(X)   #X
 
#define ETISS_TOSTRING(X)   ETISS_TOSTRING2(X)
 
#define etiss_log(LEVEL, MSG)
 
#define etiss_del_copy(CLASS)
 
#define etiss_del_move(CLASS)
 
#define etiss_del_como(CLASS)   etiss_del_copy(CLASS) etiss_del_move(CLASS)
 
#define ETISS_TEMPLATE_EXPRESSION_IS_VALID(STRUCT, EXPRESSION)
 
#define ETISS_SRCLOC   etiss::SourceCodeLocation(__FILE__, __LINE__)
 
#define ETISS_VARVAL(VAR)   (std::string(ETISS_TOSTRING(VAR)) + "={" + toLogString(VAR) + "}")
 

Enumerations

enum  etiss::Verbosity {
  etiss::SILENT = 0 , etiss::FATALERROR = 1 , etiss::ERROR = 2 , etiss::WARNING = 3 ,
  etiss::INFO = 4 , etiss::VERBOSE = 5
}
 Enumeration type for the log levels. More...
 
enum  etiss::endian_t : uint32_t { etiss::_LITTLE_ENDIAN_ = ETISS_LITTLE_ENDIAN , etiss::_BIG_ENDIAN_ = ETISS_BIG_ENDIAN , etiss::_UNKNOWN_ENDIAN_ = ETISS_UNKNOWN_ENDIAN }
 Enumeration type for the endianness. More...
 

Functions

template<typename T >
std::enable_if< std::is_base_of< etiss::ToString, T >::value, std::ostream & >::type etiss::operator<< (std::ostream &os, const T &val)
 Implementation of the write to stream operator for objects, that implement the etiss::ToString interface. More...
 
Verbosityetiss::verbosity ()
 Get log level reference. More...
 
template<typename T >
std::string etiss::toString (const T &val)
 conversion of type T to std::string. More...
 
std::list< std::string > etiss::split (const std::string &str, std::function< size_t(const std::string &, size_t, size_t &)> findsplit)
 
std::list< std::string > etiss::split (const std::string &str, char splitchar)
 
std::list< std::string > etiss::split (const std::string &str, const std::string &splitstring)
 
template<typename T , typename T2 , typename... O>
std::string etiss::toString (const T &val, const T2 &val2, const O &... others)
 conversion of type T to std::string. More...
 
std::string etiss::toString (const Verbosity &val)
 prints string representation of verbosity level More...
 
void etiss::log (Verbosity level, std::string msg)
 write log message at the given level. More...
 
void etiss::logC (Verbosity level, std::function< std::string(void)> msgGen)
 write log message at the given level. More...
 
template<typename T >
std::string etiss::toLogString (const T &t)
 Format the string representation of a value for the log output. More...
 
template<typename T1 , typename T2 , typename... O>
std::string etiss::toLogString (const T1 &t1, const T2 &t2, const O &... os)
 Format a list of arguments for the log output. More...
 
template<typename T , typename... O>
void etiss::log (Verbosity level, std::string msg, const T &t, const O &... args)
 additional objects will be converted to a string with toString and are added to the message More...
 
std::vector< std::string > etiss::parseCommands (const std::string &cmdline)
 
Configurationetiss::cfg (const std::string &cfgName)
 Get reference of the global ETISS configuration object. More...
 
Configurationetiss::cfg ()
 
std::string etiss::installDir ()
 Get ETISS installation directory. More...
 
std::string etiss::jitFiles ()
 Get ETISS JIT files path. More...
 
std::vector< std::string > etiss::jitExtHeaders ()
 Get ETISS JIT external headers. More...
 
std::vector< std::string > etiss::jitExtLibraries ()
 Get ETISS JIT external libraries. More...
 
std::vector< std::string > etiss::jitExtHeaderPaths ()
 Get ETISS JIT external path. More...
 
std::vector< std::string > etiss::jitExtLibPaths ()
 Get ETISS JIT external path. More...
 
template<>
std::string etiss::Configuration::get< std::string > (const std::string &key, std::string default_, bool *default_used)
 
endian_t etiss::getEndianness ()
 evaluates the endianness of the current build as a constexpr. More...
 

Detailed Description

general configuration and logging


Copyright 2018 Infineon Technologies AG

This file is part of ETISS tool, see https://github.com/tum-ei-eda/etiss.

The initial version of this software has been created with the funding support by the German Federal
Ministry of Education and Research (BMBF) in the project EffektiV under grant 01IS13022.

Redistribution and use in source and binary forms, with or without modification, are permitted
provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and
the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions
and the following disclaimer in the documentation and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse
or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.

Author
Marc Greim marc..nosp@m.grei.nosp@m.m@myt.nosp@m.um.d.nosp@m.e, Chair of Electronic Design Automation, TUM
Date
July 28, 2014
Version
0.1

Definition in file Misc.h.

Macro Definition Documentation

◆ etiss_del_como

#define etiss_del_como (   CLASS)    etiss_del_copy(CLASS) etiss_del_move(CLASS)

Definition at line 94 of file Misc.h.

◆ etiss_del_copy

#define etiss_del_copy (   CLASS)
Value:
CLASS(const CLASS &) = delete; \
CLASS &operator=(const CLASS &) = delete;

Definition at line 87 of file Misc.h.

◆ etiss_del_move

#define etiss_del_move (   CLASS)
Value:
CLASS &operator=(CLASS &&) = delete; \
CLASS(CLASS &&) = delete;

Definition at line 90 of file Misc.h.

◆ etiss_log

#define etiss_log (   LEVEL,
  MSG 
)
Value:
etiss::log(etiss::LEVEL, \
std::string("On line " ETISS_TOSTRING(__LINE__) " in file " ETISS_TOSTRING(__FILE__) ": ") + (MSG));
#define ETISS_TOSTRING(X)
Definition: Misc.h:81
void log(Verbosity level, std::string msg)
write log message at the given level.
Definition: Misc.cpp:125

Definition at line 83 of file Misc.h.

◆ ETISS_SRCLOC

#define ETISS_SRCLOC   etiss::SourceCodeLocation(__FILE__, __LINE__)

Definition at line 239 of file Misc.h.

◆ ETISS_TEMPLATE_EXPRESSION_IS_VALID

#define ETISS_TEMPLATE_EXPRESSION_IS_VALID (   STRUCT,
  EXPRESSION 
)
Value:
template <typename> \
struct STRUCT##Void \
{ \
typedef void type; \
}; \
template <typename T, typename Sfinae = void> \
struct STRUCT : std::false_type \
{ \
}; \
template <typename T> \
struct STRUCT<T, typename STRUCT##Void<decltype(EXPRESSION)>::type> : std::true_type \
{ \
};

Definition at line 98 of file Misc.h.

◆ ETISS_TOSTRING

#define ETISS_TOSTRING (   X)    ETISS_TOSTRING2(X)

Definition at line 81 of file Misc.h.

◆ ETISS_TOSTRING2

#define ETISS_TOSTRING2 (   X)    #X

Definition at line 80 of file Misc.h.

◆ ETISS_VARVAL

#define ETISS_VARVAL (   VAR)    (std::string(ETISS_TOSTRING(VAR)) + "={" + toLogString(VAR) + "}")

Definition at line 240 of file Misc.h.