PandA-2024.02
|
This file collects some utility functions and macros. More...
#include "panda_types.hpp"
#include "string_manipulation.hpp"
#include "config_HAVE_ASSERTS.hpp"
#include <boost/concept/usage.hpp>
#include <boost/iterator/iterator_facade.hpp>
#include <boost/lexical_cast.hpp>
#include <limits>
#include <sstream>
#include <string>
#include <utility>
#include <vector>
Go to the source code of this file.
Data Structures | |
class | string_separator |
Functor to tokenize string used with boost::tokenizer. More... | |
struct | check_long_double< T > |
Concept checking class This class is used to check that an object can be converted into long double. More... | |
struct | TimeStamp |
The type used for timestamp. More... | |
Macros | |
#define | STR_CST_string_separator std::string(1, 31) |
The character used to separate concatenated string. More... | |
#define | STR_CST_string_separator_char static_cast<char>(31) |
The character used to separate concatenated string. More... | |
#define | INFINITE_INT (std::numeric_limits<int>::max()) |
INT representing infinite. More... | |
#define | INFINITE_UINT (std::numeric_limits<unsigned int>::max()) |
UNSIGNED INT representing infinite. More... | |
#define | INFINITE_SIZE_T (std::numeric_limits<size_t>::max()) |
SIZE_T representing infinite. More... | |
#define | INFINITE_DOUBLE (std::numeric_limits<double>::max()) |
DOUBLE representing infinite. More... | |
#define | INFINITE_LONG_DOUBLE (std::numeric_limits<long double>::max()) |
long double representing infinite More... | |
#define | INFINITE_ULONGLONG_INT (std::numeric_limits<unsigned long long int>::max()) |
LONGLONG representing infinite. More... | |
#define | MINUS_INFINITE_LONG_DOUBLE (std::numeric_limits<long double>::min()) |
long double representing -infinite More... | |
#define | DEBUG_PARAMETER(parameter) parameter |
macro used to solve problem of parameters used only in not-release More... | |
#define | ASSERT_PARAMETER(parameter) |
#define | GET_CLASS_NAME(meth) #meth |
Macro returning the name of a class. More... | |
#define | GET_FUNCTION_DEBUG_LEVEL(parameters) parameters->GetFunctionDebugLevel(GET_CLASS(*this), __func__) |
Macro returning the debug_level of a function. More... | |
Functions | |
template<class G > | |
std::string | convert_to_binary (G _value, unsigned long long precision) |
template<typename _InputIt > | |
std::string | container_to_string (_InputIt first, _InputIt last, const std::string &separator, bool trim_empty=true) |
template<typename _Container > | |
std::string | container_to_string (const _Container &_c, const std::string &separator, bool trim_empty=true) |
template<typename _OutputIt > | |
constexpr void | string_to_container (_OutputIt first, const std::string &str, const std::string &separator, bool trim_empty=true) |
template<typename _Container > | |
constexpr _Container | string_to_container (const std::string &str, const std::string &separator, bool trim_empty=true) |
template<class T > | |
void | ShuffleVector (typename std::vector< T > &shuffle, const unsigned int seed) |
Randomly shuffle a vector. More... | |
This file collects some utility functions and macros.
Definition in file utility.hpp.
#define ASSERT_PARAMETER | ( | parameter | ) |
Definition at line 96 of file utility.hpp.
Referenced by tree_manager::find_identifier_nodeID().
#define DEBUG_PARAMETER | ( | parameter | ) | parameter |
macro used to solve problem of parameters used only in not-release
Definition at line 91 of file utility.hpp.
#define GET_CLASS_NAME | ( | meth | ) | #meth |
Macro returning the name of a class.
It uses the static version of get_kind_text
Definition at line 102 of file utility.hpp.
Referenced by HLS_constraints::add_builtin_constraints(), HLS_constraints::HLS_constraints(), HLS_constraints::read_HLS_constraints_File(), HLS_constraints::write_HLS_constraints_File(), structural_manager::xload(), structural_object::xload(), functional_unit::xload(), functional_unit_template::xload(), port_o::xload(), action_o::xload(), signal_o::xload(), module::xload(), functional_unit::xwrite(), functional_unit_template::xwrite(), and RTLCharacterization::xwrite_characterization().
#define GET_FUNCTION_DEBUG_LEVEL | ( | parameters | ) | parameters->GetFunctionDebugLevel(GET_CLASS(*this), __func__) |
Macro returning the debug_level of a function.
Definition at line 107 of file utility.hpp.
Referenced by tree_manager::create_tree_node(), tree_manager::get_next_vers(), and tree_manager::RecursiveReplaceTreeNode().
#define INFINITE_DOUBLE (std::numeric_limits<double>::max()) |
DOUBLE representing infinite.
Definition at line 76 of file utility.hpp.
#define INFINITE_INT (std::numeric_limits<int>::max()) |
INT representing infinite.
Definition at line 67 of file utility.hpp.
#define INFINITE_LONG_DOUBLE (std::numeric_limits<long double>::max()) |
long double representing infinite
Definition at line 79 of file utility.hpp.
Referenced by SpiderParameter::SetDefaults().
SIZE_T representing infinite.
Definition at line 73 of file utility.hpp.
#define INFINITE_UINT (std::numeric_limits<unsigned int>::max()) |
UNSIGNED INT representing infinite.
Definition at line 70 of file utility.hpp.
Referenced by fu_binding::bind(), compute_condition1(), HLS_manager::create_HLS(), estimate_muxes(), fun_dominator_allocation::Exec(), StorageValueInformation::get_compatibility_weight(), HLS_constraints::get_number_fu(), AllocationInformation::GetConnectionTime(), mux_connection_binding::input_logic(), allocation::IntegrateTechnologyLibraries(), unique_binding::InternalExec(), easy_module_binding::InternalExec(), port_swapping::InternalExec(), allocation::InternalExec(), cdfc_module_binding::InternalExec(), AllocationInformation::max_number_of_resources(), AllocationInformation::min_number_of_resources(), HLS_constraints::print(), BB_based_stg::res_const_operation(), updatecopy_HLS_constraints_functor::update(), HLS_constraints::xwriteFUConstraints(), and HLS_constraints::xwriteHLSConstraints().
#define INFINITE_ULONGLONG_INT (std::numeric_limits<unsigned long long int>::max()) |
LONGLONG representing infinite.
Definition at line 82 of file utility.hpp.
#define MINUS_INFINITE_LONG_DOUBLE (std::numeric_limits<long double>::min()) |
long double representing -infinite
Definition at line 85 of file utility.hpp.
#define STR_CST_string_separator std::string(1, 31) |
The character used to separate concatenated string.
Definition at line 61 of file utility.hpp.
Referenced by BambuParameter::add_bambu_library(), BambuParameter::add_experimental_setup_compiler_options(), tree_panda_gcc_parameter::CheckParameters(), SpiderParameter::CheckParameters(), BambuParameter::CheckParameters(), CompilerWrapper::CompileFile(), tree_panda_gcc_parameter::Exec(), SpiderParameter::Exec(), BambuParameter::Exec(), AadlParser::Exec(), CreateAddressTranslation::Exec(), CompilerWrapper::FillTreeManager(), SimulationTool::GenerateLibraryBuildScript(), Parameter::getOption(), Parameter::ManageDefaultOptions(), TestVectorParser::ParseUserString(), and BambuParameter::SetDefaults().
#define STR_CST_string_separator_char static_cast<char>(31) |
The character used to separate concatenated string.
Definition at line 64 of file utility.hpp.
std::string container_to_string | ( | _InputIt | first, |
_InputIt | last, | ||
const std::string & | separator, | ||
bool | trim_empty = true |
||
) |
Definition at line 122 of file utility.hpp.
References str.
Referenced by add_evaluation_objective_string(), container_to_string(), fsm_controller::create_state_machine(), BambuParameter::Exec(), CompilerWrapper::FillTreeManager(), IntegerToBitArray(), TestbenchNoneModuleGenerator::InternalExec(), TestbenchHandshakeModuleGenerator::InternalExec(), TestbenchOvalidModuleGenerator::InternalExec(), TestbenchAcknowledgeModuleGenerator::InternalExec(), TestbenchFifoModuleGenerator::InternalExec(), TestbenchArrayModuleGenerator::InternalExec(), TestbenchValidModuleGenerator::InternalExec(), read_technology_File(), and dead_code_eliminationIPA::signature_opt().
std::string container_to_string | ( | const _Container & | _c, |
const std::string & | separator, | ||
bool | trim_empty = true |
||
) |
Definition at line 142 of file utility.hpp.
References container_to_string().
std::string convert_to_binary | ( | G | _value, |
unsigned long long | precision | ||
) |
Definition at line 110 of file utility.hpp.
References symmetry::value.
Referenced by mux_connection_binding::determine_connection(), HLS_manager::get_constant_string(), Bit_Value_opt::optimize(), and fu_binding::specialise_fu().
void ShuffleVector | ( | typename std::vector< T > & | shuffle, |
const unsigned int | seed | ||
) |
Randomly shuffle a vector.
shuffle | is the vector to be shuffled |
seed | is the seed to be used in the random generator |
Definition at line 263 of file utility.hpp.
References k.
constexpr void string_to_container | ( | _OutputIt | first, |
const std::string & | str, | ||
const std::string & | separator, | ||
bool | trim_empty = true |
||
) |
Definition at line 148 of file utility.hpp.
Referenced by add_evaluation_objective_string(), read_technology_File(), string_to_container(), and HLSCWriter::WriteHeader().
constexpr _Container string_to_container | ( | const std::string & | str, |
const std::string & | separator, | ||
bool | trim_empty = true |
||
) |
Definition at line 167 of file utility.hpp.
References string_to_container().