diff --git a/ODIN_II/SRC/enum_str.cpp b/ODIN_II/SRC/enum_str.cpp index dc0fe6ad837..e72babdb005 100644 --- a/ODIN_II/SRC/enum_str.cpp +++ b/ODIN_II/SRC/enum_str.cpp @@ -2,7 +2,8 @@ const char *file_extension_supported_STR[] = { - ".v" + ".v", + ".vh" }; const char *edge_type_e_STR[] = diff --git a/ODIN_II/SRC/include/odin_types.h b/ODIN_II/SRC/include/odin_types.h index aef540785ea..5130929ea6a 100644 --- a/ODIN_II/SRC/include/odin_types.h +++ b/ODIN_II/SRC/include/odin_types.h @@ -162,6 +162,7 @@ extern const char *ids_STR []; enum file_extension_supported { VERILOG, + VERILOG_HEADER, file_extension_supported_END }; diff --git a/ODIN_II/SRC/include/odin_util.h b/ODIN_II/SRC/include/odin_util.h index ee74236d94e..634fd334dd5 100644 --- a/ODIN_II/SRC/include/odin_util.h +++ b/ODIN_II/SRC/include/odin_util.h @@ -11,6 +11,7 @@ long shift_left_value_with_overflow_check(long input_value, long shift_by); std::string get_file_extension(std::string input_file); void create_directory(std::string path); +void assert_supported_file_extension(std::string input_file, int file_number); const char *name_based_on_op(operation_list op); const char *name_based_on_ids(ids op); diff --git a/ODIN_II/SRC/odin_util.cpp b/ODIN_II/SRC/odin_util.cpp index 81b8431e849..0bd02f8e0df 100644 --- a/ODIN_II/SRC/odin_util.cpp +++ b/ODIN_II/SRC/odin_util.cpp @@ -86,6 +86,33 @@ void create_directory(std::string path) } } +void assert_supported_file_extension(std::string input_file, int file_number) +{ + bool supported = false; + std::string extension = get_file_extension(input_file); + for(int i = 0; i< file_extension_supported_END && ! supported; i++) + { + supported = (extension == std::string(file_extension_supported_STR[i]) ); + } + + if(! supported) + { + std::string supported_extension_list = ""; + for(int i=0; ichildren[i] = markAndProcessPortWith(top_type, id, NO_ID, symbol_list->children[i], is_signed); break; case WIRE: - if ((symbol_list->children[i]->num_children == 6 && symbol_list->children[i]->children[5] != NULL) - || (symbol_list->children[i]->num_children == 8 && symbol_list->children[i]->children[7] != NULL)) - { - error_message(NETLIST_ERROR, symbol_list->children[i]->line_number, symbol_list->children[i]->file_number, "%s", - "Nets cannot be initialized\n"); - } if (is_signed) { /* cannot support signed nets right now */ diff --git a/ODIN_II/SRC/verilog_preprocessor.cpp b/ODIN_II/SRC/verilog_preprocessor.cpp index 34153f60993..423ca364473 100644 --- a/ODIN_II/SRC/verilog_preprocessor.cpp +++ b/ODIN_II/SRC/verilog_preprocessor.cpp @@ -505,6 +505,7 @@ void veri_preproc_bootstraped(FILE *original_source, FILE *preproc_producer, ver } else if (NULL != (new_include = add_veri_include(file_path.c_str(), line_number, current_include))) { + assert_supported_file_extension(file_path, -1); printf("Including file %s\n", new_include->path); veri_preproc_bootstraped(included_file, preproc_producer, new_include); }