cloudFPGA (cF) API  1.0
The documentation of the source code of cloudFPGA (cF)
util.hpp
Go to the documentation of this file.
1 
25 #ifndef _UTIL_HPP_
26 #define _UTIL_HPP_
27 
28 #include <stdio.h>
29 #include <stdint.h>
30 #include <stdarg.h>
31 #include <ostream>
32 #include <fstream>
33 #include "config.h"
34 #include <string>
35 
36 extern std::ostream &dout;
37 
38 #define dbgLevelNone 0
39 #define dbgLevelError 1
40 #define dbgLevelWarning 2
41 #define dbgLevelInfo 3
42 #define dbgLevelDebug 4
43 
44 
45 template<uint8_t level>
46 void Dprintf(const char* format, ... ) {
47 #ifndef __SYNTHESIS__
48  if (level<=DEBUG_LEVEL) {
49  va_list arglist;
50  va_start( arglist, format );
51  vprintf( format, arglist );
52  va_end( arglist );
53  }
54 #endif
55 }
56 
57 void Dfprintf(uint8_t level, FILE *stream, const char* format, ... );
58 void bprintf( const char* format, ... );
59 
60 bool isNumeric(const std::string str);
61 
62 
63 #endif
#define DEBUG_LEVEL
Definition: nal.hpp:123
std::ostream & dout
Definition: util.cpp:54
void Dfprintf(uint8_t level, FILE *stream, const char *format,...)
Definition: util.cpp:29
void bprintf(const char *format,...)
Definition: util.cpp:40
bool isNumeric(const std::string str)
Definition: util.cpp:58
void Dprintf(const char *format,...)
Definition: util.hpp:46