aboutsummaryrefslogtreecommitdiffstats
path: root/backends/protobuf/protobuf.cc
diff options
context:
space:
mode:
authorSergey <37293587+SergeyDegtyar@users.noreply.github.com>2019-10-01 10:57:09 +0300
committerGitHub <noreply@github.com>2019-10-01 10:57:09 +0300
commitd99b1e32618f8aa92c01eb0ac5d08486f411cca0 (patch)
tree5671ffa605b5f6b31b86aacb2dbeaacd018302d7 /backends/protobuf/protobuf.cc
parentfc56459746fec7751735749e3328378e1089b914 (diff)
parentd963e8c2c6207ad98d48dc528922ad58c030173f (diff)
downloadyosys-d99b1e32618f8aa92c01eb0ac5d08486f411cca0.tar.gz
yosys-d99b1e32618f8aa92c01eb0ac5d08486f411cca0.tar.bz2
yosys-d99b1e32618f8aa92c01eb0ac5d08486f411cca0.zip
Merge branch 'master' into SergeyDegtyar/anlogic
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));