3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-09-30 13:19:05 +00:00

Merge pull request #518 from xerpi/master

passes/hierarchy: Reduce code duplication in expand_module
This commit is contained in:
Clifford Wolf 2018-03-27 14:10:39 +02:00 committed by GitHub
commit c652774ca2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -173,22 +173,20 @@ bool expand_module(RTLIL::Design *design, RTLIL::Module *module, bool flag_check
for (auto &dir : libdirs) for (auto &dir : libdirs)
{ {
filename = dir + "/" + RTLIL::unescape_id(cell->type) + ".v"; static const std::map<std::string, std::string> extensions_map =
if (check_file_exists(filename)) { {
Frontend::frontend_call(design, NULL, filename, "verilog"); {".v", "verilog"},
goto loaded_module; {".sv", "verilog -sv"},
} {".il", "ilang"}
};
filename = dir + "/" + RTLIL::unescape_id(cell->type) + ".sv"; for (auto &ext : extensions_map)
if (check_file_exists(filename)) { {
Frontend::frontend_call(design, NULL, filename, "verilog -sv"); filename = dir + "/" + RTLIL::unescape_id(cell->type) + ext.first;
goto loaded_module; if (check_file_exists(filename)) {
} Frontend::frontend_call(design, NULL, filename, ext.second);
goto loaded_module;
filename = dir + "/" + RTLIL::unescape_id(cell->type) + ".il"; }
if (check_file_exists(filename)) {
Frontend::frontend_call(design, NULL, filename, "ilang");
goto loaded_module;
} }
} }