aboutsummaryrefslogtreecommitdiffstats
path: root/frontends/ilang/ilang_frontend.cc
diff options
context:
space:
mode:
authorJim Lawson <ucbjrl@berkeley.edu>2019-02-11 12:43:46 -0800
committerJim Lawson <ucbjrl@berkeley.edu>2019-02-11 12:43:46 -0800
commit311396860b7380e5dc68e66c17d5083d1953fe3f (patch)
treec5146a20e59acc342dfe414e1b35fdfe419b9e81 /frontends/ilang/ilang_frontend.cc
parent76696e80041dc5b8f4ba986f4f83d6e7b6854e96 (diff)
parente112d2fbf5a31f00ef19e6d05f28fecc1e9c56b9 (diff)
downloadyosys-311396860b7380e5dc68e66c17d5083d1953fe3f.tar.gz
yosys-311396860b7380e5dc68e66c17d5083d1953fe3f.tar.bz2
yosys-311396860b7380e5dc68e66c17d5083d1953fe3f.zip
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'frontends/ilang/ilang_frontend.cc')
-rw-r--r--frontends/ilang/ilang_frontend.cc30
1 files changed, 29 insertions, 1 deletions
diff --git a/frontends/ilang/ilang_frontend.cc b/frontends/ilang/ilang_frontend.cc
index d8783ac1d..6b302a796 100644
--- a/frontends/ilang/ilang_frontend.cc
+++ b/frontends/ilang/ilang_frontend.cc
@@ -44,11 +44,39 @@ struct IlangFrontend : public Frontend {
log("Load modules from an ilang file to the current design. (ilang is a text\n");
log("representation of a design in yosys's internal format.)\n");
log("\n");
+ log(" -nooverwrite\n");
+ log(" ignore re-definitions of modules. (the default behavior is to\n");
+ log(" create an error message if the existing module is not a blackbox\n");
+ log(" module, and overwrite the existing module if it is a blackbox module.)\n");
+ log("\n");
+ log(" -overwrite\n");
+ log(" overwrite existing modules with the same name\n");
+ log("\n");
}
void execute(std::istream *&f, std::string filename, std::vector<std::string> args, RTLIL::Design *design) YS_OVERRIDE
{
+ ILANG_FRONTEND::flag_nooverwrite = false;
+ ILANG_FRONTEND::flag_overwrite = false;
+
log_header(design, "Executing ILANG frontend.\n");
- extra_args(f, filename, args, 1);
+
+ size_t argidx;
+ for (argidx = 1; argidx < args.size(); argidx++) {
+ std::string arg = args[argidx];
+ if (arg == "-nooverwrite") {
+ ILANG_FRONTEND::flag_nooverwrite = true;
+ ILANG_FRONTEND::flag_overwrite = false;
+ continue;
+ }
+ if (arg == "-overwrite") {
+ ILANG_FRONTEND::flag_nooverwrite = false;
+ ILANG_FRONTEND::flag_overwrite = true;
+ continue;
+ }
+ break;
+ }
+ extra_args(f, filename, args, argidx);
+
log("Input filename: %s\n", filename.c_str());
ILANG_FRONTEND::lexin = f;