Add front-end detection for *.tcl files
authorClifford Wolf <clifford@clifford.at>
Tue, 28 Mar 2017 10:13:58 +0000 (12:13 +0200)
committerClifford Wolf <clifford@clifford.at>
Tue, 28 Mar 2017 10:13:58 +0000 (12:13 +0200)
kernel/yosys.cc

index 3d0aca78e9988e368c8603ba0d4383c78d3b2d23..fd5a3504afc89484e80316306e69c4cf0ab66db9 100644 (file)
@@ -796,6 +796,8 @@ void run_frontend(std::string filename, std::string command, std::string *backen
                        command = "ilang";
                else if (filename.size() > 3 && filename.substr(filename.size()-3) == ".ys")
                        command = "script";
+               else if (filename.size() > 2 && filename.substr(filename.size()-4) == ".tcl")
+                       command = "tcl";
                else if (filename == "-")
                        command = "script";
                else
@@ -875,7 +877,10 @@ void run_frontend(std::string filename, std::string command, std::string *backen
                log("\n-- Parsing `%s' using frontend `%s' --\n", filename.c_str(), command.c_str());
        }
 
-       Frontend::frontend_call(design, NULL, filename, command);
+       if (command == "tcl")
+               Pass::call(design, vector<string>({command, filename}));
+       else
+               Frontend::frontend_call(design, NULL, filename, command);
 }
 
 void run_frontend(std::string filename, std::string command, RTLIL::Design *design)