summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2013-02-27 23:38:38 +0100
committerClifford Wolf <clifford@clifford.at>2013-02-27 23:38:38 +0100
commita6cf02bdc7897e2fac9f51f3dd456d99ee8ada46 (patch)
treefb750af81e581d5baf15149ee8741280bcdb418d
parent500786af5584c8a27e75bdf26f123328d9d574bd (diff)
Changed default frontend for "-" to "script" (was: "ilang")
-rw-r--r--kernel/driver.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/kernel/driver.cc b/kernel/driver.cc
index ae179675..bfbf2105 100644
--- a/kernel/driver.cc
+++ b/kernel/driver.cc
@@ -37,22 +37,25 @@ static void run_frontend(std::string filename, std::string command, RTLIL::Desig
else if (filename.size() > 3 && filename.substr(filename.size()-3) == ".ys")
command = "script";
else if (filename == "-")
- command = "ilang";
+ command = "script";
else
log_error("Can't guess frontend for input file `%s' (missing -f option)!\n", filename.c_str());
}
if (command == "script") {
log("\n-- Executing script file `%s' --\n", filename.c_str());
- FILE *f = fopen(filename.c_str(), "r");
+ FILE *f = stdin;
+ if (filename != "-")
+ f = fopen(filename.c_str(), "r");
if (f == NULL)
- log_error("Can;t open script file `%s' for reading: %s\n", filename.c_str(), strerror(errno));
+ log_error("Can't open script file `%s' for reading: %s\n", filename.c_str(), strerror(errno));
char buffer[4096];
while (fgets(buffer, 4096, f) != NULL) {
Pass::call(design, buffer);
design->check();
}
- fclose(f);
+ if (filename != "-")
+ fclose(f);
if (backend_command != NULL && *backend_command == "auto")
*backend_command = "";
return;