aboutsummaryrefslogtreecommitdiffstats
path: root/backends
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2014-02-04 23:45:30 +0100
committerClifford Wolf <clifford@clifford.at>2014-02-04 23:45:30 +0100
commit968ae31cac84816691e8b54c086a9e2b3d470440 (patch)
treef01bc241d4b5647884a445ddb67cbe4d17108ac9 /backends
parent1fb8ba73bd09a7328e3523193a4f03a8ff87b5c9 (diff)
downloadyosys-968ae31cac84816691e8b54c086a9e2b3d470440.tar.gz
yosys-968ae31cac84816691e8b54c086a9e2b3d470440.tar.bz2
yosys-968ae31cac84816691e8b54c086a9e2b3d470440.zip
Added support for dump -append
Diffstat (limited to 'backends')
-rw-r--r--backends/ilang/ilang_backend.cc15
1 files changed, 12 insertions, 3 deletions
diff --git a/backends/ilang/ilang_backend.cc b/backends/ilang/ilang_backend.cc
index 924e316bc..c585d40c5 100644
--- a/backends/ilang/ilang_backend.cc
+++ b/backends/ilang/ilang_backend.cc
@@ -409,13 +409,16 @@ struct DumpPass : public Pass {
log(" only dump the module headers if the entire module is selected\n");
log("\n");
log(" -outfile <filename>\n");
- log(" Write to the specified file.\n");
+ log(" write to the specified file.\n");
+ log("\n");
+ log(" -append <filename>\n");
+ log(" like -outfile but append instead of overwrite\n");
log("\n");
}
virtual void execute(std::vector<std::string> args, RTLIL::Design *design)
{
std::string filename;
- bool flag_m = false, flag_n = false;
+ bool flag_m = false, flag_n = false, append = false;
size_t argidx;
for (argidx = 1; argidx < args.size(); argidx++)
@@ -423,6 +426,12 @@ struct DumpPass : public Pass {
std::string arg = args[argidx];
if (arg == "-outfile" && argidx+1 < args.size()) {
filename = args[++argidx];
+ append = false;
+ continue;
+ }
+ if (arg == "-append" && argidx+1 < args.size()) {
+ filename = args[++argidx];
+ append = true;
continue;
}
if (arg == "-m") {
@@ -442,7 +451,7 @@ struct DumpPass : public Pass {
size_t buf_size;
if (!filename.empty()) {
- f = fopen(filename.c_str(), "w");
+ f = fopen(filename.c_str(), append ? "a" : "w");
if (f == NULL)
log_error("Can't open file `%s' for writing: %s\n", filename.c_str(), strerror(errno));
} else {