From: Claire Xenia Wolf Date: Thu, 9 Dec 2021 09:33:55 +0000 (+0100) Subject: Use "read" command to parse HDL files from Yosys command-line X-Git-Tag: yosys-0.13~41^2~2 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0cbdb42dcd74090296aa3fe6bf11db1c288d9962;p=yosys.git Use "read" command to parse HDL files from Yosys command-line Signed-off-by: Claire Xenia Wolf --- diff --git a/kernel/yosys.cc b/kernel/yosys.cc index 39d6a1ec1..4f7347d4c 100644 --- a/kernel/yosys.cc +++ b/kernel/yosys.cc @@ -966,11 +966,11 @@ void run_frontend(std::string filename, std::string command, std::string *backen if (filename_trim.size() > 3 && filename_trim.compare(filename_trim.size()-3, std::string::npos, ".gz") == 0) filename_trim.erase(filename_trim.size()-3); if (filename_trim.size() > 2 && filename_trim.compare(filename_trim.size()-2, std::string::npos, ".v") == 0) - command = "verilog"; + command = " -vlog2k"; else if (filename_trim.size() > 2 && filename_trim.compare(filename_trim.size()-3, std::string::npos, ".sv") == 0) - command = "verilog -sv"; + command = " -sv"; else if (filename_trim.size() > 3 && filename_trim.compare(filename_trim.size()-4, std::string::npos, ".vhd") == 0) - command = "vhdl"; + command = " -vhdl"; else if (filename_trim.size() > 4 && filename_trim.compare(filename_trim.size()-5, std::string::npos, ".blif") == 0) command = "blif"; else if (filename_trim.size() > 5 && filename_trim.compare(filename_trim.size()-6, std::string::npos, ".eblif") == 0) @@ -1070,7 +1070,11 @@ void run_frontend(std::string filename, std::string command, std::string *backen if (command == "tcl") Pass::call(design, vector({command, filename})); - else + else if (command[0] == ' ') { + auto argv = split_tokens("read" + command); + argv.push_back(filename); + Pass::call(design, argv); + } else Frontend::frontend_call(design, NULL, filename, command); design->check(); }