aboutsummaryrefslogtreecommitdiffstats
path: root/backends/protobuf/protobuf.cc
diff options
context:
space:
mode:
authorSergey <37293587+SergeyDegtyar@users.noreply.github.com>2019-10-01 11:04:32 +0300
committerGitHub <noreply@github.com>2019-10-01 11:04:32 +0300
commite092c4ae6b60cf67efd16efbfbf739895ad501c0 (patch)
tree939a5b94d14a11df511aa95482458b33a1f6139f /backends/protobuf/protobuf.cc
parent1070f2e90b9ba37856932189ef09a0f2316d9a21 (diff)
parentd963e8c2c6207ad98d48dc528922ad58c030173f (diff)
downloadyosys-e092c4ae6b60cf67efd16efbfbf739895ad501c0.tar.gz
yosys-e092c4ae6b60cf67efd16efbfbf739895ad501c0.tar.bz2
yosys-e092c4ae6b60cf67efd16efbfbf739895ad501c0.zip
Merge branch 'master' into SergeyDegtyar/efinix
Diffstat (limited to 'backends/protobuf/protobuf.cc')
-rw-r--r--backends/protobuf/protobuf.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/backends/protobuf/protobuf.cc b/backends/protobuf/protobuf.cc
index fff110bb0..671686173 100644
--- a/backends/protobuf/protobuf.cc
+++ b/backends/protobuf/protobuf.cc
@@ -266,7 +266,7 @@ struct ProtobufBackend : public Backend {
}
break;
}
- extra_args(f, filename, args, argidx);
+ extra_args(f, filename, args, argidx, !text_mode);
log_header(design, "Executing Protobuf backend.\n");
@@ -338,7 +338,7 @@ struct ProtobufPass : public Pass {
if (!filename.empty()) {
rewrite_filename(filename);
std::ofstream *ff = new std::ofstream;
- ff->open(filename.c_str(), std::ofstream::trunc);
+ ff->open(filename.c_str(), text_mode ? std::ofstream::trunc : (std::ofstream::trunc | std::ofstream::binary));
if (ff->fail()) {
delete ff;
log_error("Can't open file `%s' for writing: %s\n", filename.c_str(), strerror(errno));