|
2 | 2 | #define COMMON_FUNC_HPP |
3 | 3 |
|
4 | 4 | #define dbgprint(FORMAT, ARGS...) \ |
5 | | -printf("%s(%0d) @%s: " FORMAT "\n", __FILE__, __LINE__, sc_time_stamp().to_string().c_str(), ##ARGS) |
| 5 | +printf("%s(%0d) @%s: " FORMAT "\n", __FILE__, __LINE__, sc_time_stamp().to_string().c_str(), ##ARGS); |
6 | 6 |
|
7 | | -#define dbgmodprint(FORMAT, ARGS...) \ |
8 | | -printf("%s(%0d) [%s] @%s : " FORMAT "\n", __FILE__, __LINE__, this->name(), sc_time_stamp().to_string().c_str(), ##ARGS) |
| 7 | +#define dbgmodprint(DBG_ACT, FORMAT, ARGS...) \ |
| 8 | +if (DBG_ACT) printf("%s(%0d) [%s] @%s : " FORMAT "\n", __FILE__, __LINE__, this->name(), sc_time_stamp().to_string().c_str(), ##ARGS) |
9 | 9 |
|
10 | | -#define dbgimgtarmodprint(FORMAT, ARGS...) \ |
11 | | -printf("%s(%0d) [%s] @%s : " FORMAT "\n", __FILE__, __LINE__, img_target::name(), sc_time_stamp().to_string().c_str(), ##ARGS) |
| 10 | +#define dbgimgtarmodprint(DBG_ACT, FORMAT, ARGS...) \ |
| 11 | +if (DBG_ACT) printf("%s(%0d) [%s] @%s : " FORMAT "\n", __FILE__, __LINE__, img_target::name(), sc_time_stamp().to_string().c_str(), ##ARGS) |
| 12 | + |
| 13 | +#define checkprintenable(DBG_ACT) \ |
| 14 | +if (DBG_ACT) \ |
| 15 | +{ \ |
| 16 | + printf("%s(%0d) [%s] @%s : " "Prints enabled for this module" "\n", __FILE__, __LINE__, this->name(), sc_time_stamp().to_string().c_str()); \ |
| 17 | +} \ |
| 18 | +else \ |
| 19 | +{ \ |
| 20 | + printf("%s(%0d) [%s] @%s : " "Prints are not enabled for this module" "\n", __FILE__, __LINE__, this->name(), sc_time_stamp().to_string().c_str()); \ |
| 21 | +} |
| 22 | + |
| 23 | +#define checkprintenableimgtar(DBG_ACT) \ |
| 24 | +if (DBG_ACT) \ |
| 25 | +{ \ |
| 26 | + printf("%s(%0d) [%s] @%s : " "Prints enabled for this module" "\n", __FILE__, __LINE__, img_target::name(), sc_time_stamp().to_string().c_str()); \ |
| 27 | +} \ |
| 28 | +else \ |
| 29 | +{ \ |
| 30 | + printf("%s(%0d) [%s] @%s : " "Prints are not enabled for this module" "\n", __FILE__, __LINE__, img_target::name(), sc_time_stamp().to_string().c_str()); \ |
| 31 | +} |
12 | 32 |
|
13 | 33 | #endif // COMMON_FUNC_HPP |
0 commit comments