3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-06-06 06:03:23 +00:00

Added "yosys -r <topmodule>"

Signed-off-by: Claire Xenia Wolf <claire@clairexen.net>
This commit is contained in:
Claire Xenia Wolf 2021-12-09 22:24:58 +01:00
parent 0cbdb42dcd
commit ce08046f44
3 changed files with 35 additions and 28 deletions

View file

@ -956,7 +956,7 @@ static void handle_label(std::string &command, bool &from_to_active, const std::
}
}
void run_frontend(std::string filename, std::string command, std::string *backend_command, std::string *from_to_label, RTLIL::Design *design)
bool run_frontend(std::string filename, std::string command, RTLIL::Design *design, std::string *from_to_label)
{
if (design == nullptr)
design = yosys_design;
@ -1056,10 +1056,12 @@ void run_frontend(std::string filename, std::string command, std::string *backen
if (filename != "-")
fclose(f);
if (backend_command != NULL && *backend_command == "auto")
*backend_command = "";
return true;
}
return;
if (command == "tcl") {
Pass::call(design, vector<string>({command, filename}));
return true;
}
if (filename == "-") {
@ -1068,20 +1070,15 @@ 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());
}
if (command == "tcl")
Pass::call(design, vector<string>({command, filename}));
else if (command[0] == ' ') {
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();
}
void run_frontend(std::string filename, std::string command, RTLIL::Design *design)
{
run_frontend(filename, command, nullptr, nullptr, design);
design->check();
return false;
}
void run_pass(std::string command, RTLIL::Design *design)
@ -1395,7 +1392,7 @@ struct ScriptCmdPass : public Pass {
else if (args.size() == 2)
run_frontend(args[1], "script", design);
else if (args.size() == 3)
run_frontend(args[1], "script", NULL, &args[2], design);
run_frontend(args[1], "script", design, &args[2]);
else
extra_args(args, 2, design, false);
}