Skip to content

Commit 8d0a906

Browse files
authored
Merge pull request #905 from CAS-Atlantic/odin_soft_error
Odin: add soft errors
2 parents 7a9d7c4 + db82cd7 commit 8d0a906

File tree

4 files changed

+14
-1
lines changed

4 files changed

+14
-1
lines changed

ODIN_II/SRC/include/odin_error.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ static inline void _verbose_assert(bool condition, const char *condition_str, co
4343
void _log_message(odin_error error_type, long line_number, long file, bool soft_error, const char *function_file_name, long function_line, const char *function_name, const char *message, ...);
4444

4545
#define error_message(error_type, line_number, file, message, ...) _log_message(error_type, line_number, file, false, __FILE__, __LINE__, __func__, message, __VA_ARGS__)
46+
#define possible_error_message(error_type, line_number, file, message, ...) _log_message(error_type, line_number, file, global_args.permissive.value(), __FILE__, __LINE__, __func__, message, __VA_ARGS__)
4647
#define warning_message(error_type, line_number, file, message, ...) _log_message(error_type, line_number, file, true, __FILE__, __LINE__, __func__, message, __VA_ARGS__)
4748

4849
#endif

ODIN_II/SRC/include/odin_types.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ struct global_args_t
8888
argparse::ArgValue<std::string> blif_file;
8989
argparse::ArgValue<std::string> output_file;
9090
argparse::ArgValue<std::string> arch_file; // Name of the FPGA architecture file
91+
argparse::ArgValue<bool> permissive; //turn possible_errors into warnings
9192

9293
argparse::ArgValue<std::string> high_level_block; //Legacy option, no longer used
9394

ODIN_II/SRC/odin_ii.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,12 @@ void get_options(int argc, char** argv) {
396396
.metavar("ARCHITECTURE_FILE")
397397
;
398398

399+
other_grp.add_argument(global_args.permissive, "--permissive")
400+
.help("Turn possible_error_messages into warning_messages ... unexpected behaviour may occur")
401+
.default_value("false")
402+
.action(argparse::Action::STORE_TRUE)
403+
;
404+
399405
other_grp.add_argument(global_args.write_netlist_as_dot, "-G")
400406
.help("Output netlist graph in graphviz .dot format")
401407
.default_value("false")
@@ -607,6 +613,11 @@ void get_options(int argc, char** argv) {
607613
{
608614
configuration.debug_output_path = global_args.sim_directory;
609615
}
616+
617+
if(global_args.permissive.value())
618+
{
619+
warning_message(ARG_ERROR,-1,-1, "%s", "Permissive flag is ON. Undefined behaviour may occur\n");
620+
}
610621
}
611622

612623
/*---------------------------------------------------------------------------

ODIN_II/SRC/odin_util.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ void assert_supported_file_extension(std::string input_file, int file_number)
104104
supported_extension_list += file_extension_supported_STR[i];
105105
}
106106

107-
error_message(ARG_ERROR, -1, file_number,
107+
possible_error_message(ARG_ERROR, -1, file_number,
108108
"File (%s) has an unsupported extension (%s), Odin only support { %s }",
109109
input_file.c_str(),
110110
extension.c_str(),

0 commit comments

Comments
 (0)