Skip to content

Odin: add soft errors #905

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ODIN_II/SRC/include/odin_error.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ static inline void _verbose_assert(bool condition, const char *condition_str, co
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, ...);

#define error_message(error_type, line_number, file, message, ...) _log_message(error_type, line_number, file, false, __FILE__, __LINE__, __func__, message, __VA_ARGS__)
#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__)
#define warning_message(error_type, line_number, file, message, ...) _log_message(error_type, line_number, file, true, __FILE__, __LINE__, __func__, message, __VA_ARGS__)

#endif
1 change: 1 addition & 0 deletions ODIN_II/SRC/include/odin_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ struct global_args_t
argparse::ArgValue<std::string> blif_file;
argparse::ArgValue<std::string> output_file;
argparse::ArgValue<std::string> arch_file; // Name of the FPGA architecture file
argparse::ArgValue<bool> permissive; //turn possible_errors into warnings

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

Expand Down
11 changes: 11 additions & 0 deletions ODIN_II/SRC/odin_ii.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,12 @@ void get_options(int argc, char** argv) {
.metavar("ARCHITECTURE_FILE")
;

other_grp.add_argument(global_args.permissive, "--permissive")
.help("Turn possible_error_messages into warning_messages ... unexpected behaviour may occur")
.default_value("false")
.action(argparse::Action::STORE_TRUE)
;

other_grp.add_argument(global_args.write_netlist_as_dot, "-G")
.help("Output netlist graph in graphviz .dot format")
.default_value("false")
Expand Down Expand Up @@ -607,6 +613,11 @@ void get_options(int argc, char** argv) {
{
configuration.debug_output_path = global_args.sim_directory;
}

if(global_args.permissive.value())
{
warning_message(ARG_ERROR,-1,-1, "%s", "Permissive flag is ON. Undefined behaviour may occur\n");
}
}

/*---------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion ODIN_II/SRC/odin_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ void assert_supported_file_extension(std::string input_file, int file_number)
supported_extension_list += file_extension_supported_STR[i];
}

error_message(ARG_ERROR, -1, file_number,
possible_error_message(ARG_ERROR, -1, file_number,
"File (%s) has an unsupported extension (%s), Odin only support { %s }",
input_file.c_str(),
extension.c_str(),
Expand Down