aboutsummaryrefslogtreecommitdiff
path: root/reference_model/include/func_debug.h
diff options
context:
space:
mode:
Diffstat (limited to 'reference_model/include/func_debug.h')
-rw-r--r--reference_model/include/func_debug.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/reference_model/include/func_debug.h b/reference_model/include/func_debug.h
index d762026..3794a35 100644
--- a/reference_model/include/func_debug.h
+++ b/reference_model/include/func_debug.h
@@ -1,5 +1,5 @@
-// Copyright (c) 2020, ARM Limited.
+// Copyright (c) 2020-2023, ARM Limited.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -114,6 +114,17 @@ struct func_debug_t
}
#endif
+#ifndef LEVEL_CHECK
+#define LEVEL_CHECK(COND, fmt, ...) \
+ if (g_func_config.tosa_level != func_config_t::NONE && (!(COND))) \
+ { \
+ fprintf(g_func_debug.func_debug_file, COL_FATAL("LEVEL_CHECK() fails AT %s:%d %s(): (%s)\n"), __FILE__, __LINE__, \
+ __func__, #COND); \
+ fprintf(g_func_debug.func_debug_file, COL_FATAL(fmt) "\n", ##__VA_ARGS__); \
+ this->parent_sgt->setGraphStatus(GraphStatus::TOSA_UNPREDICTABLE); \
+ }
+#endif
+
#ifndef ERROR_IF
#define ERROR_IF(COND, fmt, ...) \
if ((COND)) \