@@ -92,80 +92,56 @@ void create_directory(std::string path) {
9292}
9393
9494/* *
95- * @brief assert all input files have valid type and extenstion
96- *
97- * @param name_list list of input files
98- * @param type the type to be checked with
95+ * @brief report the frontend elaborator and its parser
9996 */
100- void assert_valid_file_extenstion (std::vector<std::string> name_list, file_type_e type) {
101- for (auto file_name : name_list) {
102- // lookup the file type string from file extension map
103- auto file_ext_str = string_to_lower (get_file_extension (file_name));
104- auto file_ext_it = file_extension_strmap.find (file_ext_str);
105-
106- // Unsupported file types should be already check.
107- // However, we double-check here
108- if (file_ext_it == file_extension_strmap.end ()) {
109- assert_supported_file_extension (file_name, unknown_location);
110- } else {
111- file_type_e file_type = file_ext_it->second ;
112- // Check if the file_name extension matches with type
113- switch (type) {
114- case (file_type_e::_VERILOG): // fallthrough
115- case (file_type_e::_VERILOG_HEADER): {
116- if (file_type != file_type_e::_VERILOG && file_type != file_type_e::_VERILOG_HEADER)
117- error_message (UTIL, unknown_location,
118- " File (%s) has an invalid extension (%s), supposed to be a %s or %s file { %s, %s },\
119- please see ./odin --help" ,
120- file_name.c_str (),
121- file_ext_str.c_str (),
122- file_type_strmap.find (file_type_e::_VERILOG)->second .c_str (),
123- file_type_strmap.find (file_type_e::_VERILOG_HEADER)->second .c_str (),
124- file_extension_strmap.find (file_type_e::_VERILOG)->second .c_str (),
125- file_extension_strmap.find (file_type_e::_VERILOG_HEADER)->second .c_str ());
126- break ;
127- }
128- case (file_type_e::_SYSTEM_VERILOG): // fallthrough
129- case (file_type_e::_UHDM): {
130- if (configuration.elaborator_type != elaborator_e::_YOSYS) {
131- #ifndef ODIN_USE_YOSYS
132- error_message (PARSE_ARGS, unknown_location, " %s" , YOSYS_INSTALLATION_ERROR);
97+ void report_frontend_elaborator () {
98+ // Check if the file_name extension matches with type
99+ switch (configuration.input_file_type ) {
100+ case (file_type_e::_VERILOG): // fallthrough
101+ case (file_type_e::_VERILOG_HEADER): {
102+ if (configuration.elaborator_type == elaborator_e::_ODIN) {
103+ printf (" Using the ODIN_II parser for elaboration\n " );
104+ } else if (configuration.elaborator_type == elaborator_e::_YOSYS) {
105+ printf (" Using the Yosys elaborator with it's conventional Verilog/SystemVerilog parser\n " );
106+ }
107+ break ;
108+ }
109+ case (file_type_e::_SYSTEM_VERILOG): {
110+ if (configuration.elaborator_type != elaborator_e::_YOSYS) {
111+ error_message (PARSE_ARGS, unknown_location, " %s" , SYSTEMVERILOG_PARSER_ERROR);
112+ }
113+ #ifndef YOSYS_SV_UHDM_PLUGIN
114+ printf (" Using the Yosys elaborator with it's conventional Verilog/SystemVerilog parser\n " );
133115#else
134- error_message (UTIL, unknown_location, " %s " , YOSYS_PLUGINS_WITH_ODIN_ERROR );
116+ printf ( " Using the Yosys elaborator with the Yosys-F4PGA-Plugin parser for SystemVerilog \n " );
135117#endif
136- } else {
137- #ifndef YOSYS_SV_UHDM_PLUGIN
138- error_message (UTIL, unknown_location, " %s" , YOSYS_PLUGINS_NOT_COMPILED);
118+ break ;
119+ }
120+ case (file_type_e::_UHDM): {
121+ if (configuration.elaborator_type != elaborator_e::_YOSYS) {
122+ error_message (PARSE_ARGS, unknown_location, " %s" , UHDM_PARSER_ERROR);
123+
124+ } else if (configuration.elaborator_type == elaborator_e::_YOSYS) {
125+ #ifndef ODIN_USE_YOSYS
126+ error_message (PARSE_ARGS, unknown_location, " %s" , YOSYS_INSTALLATION_ERROR);
127+ #else
128+ # ifndef YOSYS_SV_UHDM_PLUGIN
129+ error_message (PARSE_ARGS, unknown_location, " %s" , YOSYS_PLUGINS_NOT_COMPILED);
130+ # endif
139131#endif
140- }
141- if (file_type != type && type != file_type_e::_UHDM)
142- error_message (UTIL, unknown_location,
143- " File (%s) has an invalid extension (%s), supposed to be a %s file { %s },\
144- please see ./odin --help" ,
145- file_name.c_str (),
146- file_ext_str.c_str (),
147- file_type_strmap.find (type)->second .c_str (),
148- file_extension_strmap.find (type)->second .c_str ());
149- break ;
150- }
151- case (file_type_e::_BLIF): {
152- if (file_type != type)
153- error_message (UTIL, unknown_location,
154- " File (%s) has an invalid extension (%s), supposed to be a %s file { %s },\
155- please see ./odin --help" ,
156- file_name.c_str (),
157- file_ext_str.c_str (),
158- file_type_strmap.find (type)->second .c_str (),
159- file_extension_strmap.find (type)->second .c_str ());
160- break ;
161- }
162- case (file_type_e::_EBLIF): // fallthrough
163- case (file_type_e::_ILANG): // fallthrough
164- default : {
165- assert_supported_file_extension (file_name, unknown_location);
166- break ;
167- }
168132 }
133+ printf (" Using the Yosys elaborator with the Surelog parser for UHDM\n " );
134+ break ;
135+ }
136+ case (file_type_e::_BLIF): {
137+ printf (" Using the ODIN_II BLIF parser\n " );
138+ break ;
139+ }
140+ case (file_type_e::_EBLIF): // fallthrough
141+ case (file_type_e::_ILANG): // fallthrough
142+ default : {
143+ error_message (UTIL, unknown_location, " %s" , " Invalid file type" );
144+ break ;
169145 }
170146 }
171147}
0 commit comments