ilasynth  1.0
ILASynth: Template-based ILA Synthesis Engine
util.hpp
Go to the documentation of this file.
1 #ifndef __UTIL_H_DEFINED__
2 #define __UTIL_H_DEFINED__
3 
4 #include <boost/multiprecision/cpp_int.hpp>
5 #include <boost/python.hpp>
6 #include <ilasynth/common.hpp>
7 #include <string>
8 
9 #define ILA_ASSERT(b, msg) ila_assert(b, msg, __FILE__, __LINE__)
10 namespace ilasynth {
11 // ---------------------------------------------------------------------- //
12 void ila_assert(bool b, const char* msg, const char* file, int line);
13 void ila_assert(bool b, const std::string& msg, const char* file, int line);
14 void dump_trace();
15 
16 // ---------------------------------------------------------------------- //
17 std::string to_string(const py::object& l);
18 std::string to_string(const mp_int_t& i);
19 mp_int_t to_cpp_int(const py::object& l);
20 py::object to_pyint(const mp_int_t& i);
21 py::object to_pyint(const std::string& s);
22 bool is_py_int(const py::object& l);
23 bool is_py_int_or_long(const py::object& l);
24 
25 // ---------------------------------------------------------------------- //
26 void set_logging_level(int level);
27 
28 const int NUM_HASHTABLE_BUCKETS = 1023;
30 }; // namespace ilasynth
31 
32 #endif // __UTIL_H_DEFINED__
void dump_trace()
boost::multiprecision::cpp_int mp_int_t
Definition: common.hpp:9
bool is_py_int_or_long(const py::object &l)
bool is_py_int(const py::object &l)
std::string to_string(const py::object &l)
const int NUM_HASHTABLE_BUCKETS
Definition: util.hpp:28
mp_int_t to_cpp_int(const py::object &l)
py::object to_pyint(const mp_int_t &i)
Definition: abstraction.hpp:21
void ila_assert(bool b, const char *msg, const char *file, int line)
void set_logging_level(int level)
const int NUM_HASHTABLE_BUCKETS_SMALL
Definition: util.hpp:29