From: Miodrag Milanovic Date: Sat, 28 Sep 2019 07:50:29 +0000 (+0200) Subject: Add aiger and protobuf backends binary support X-Git-Tag: working-ls180~1040^2 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0c380f085576c2cead5e3576825cb60046bfd76b;p=yosys.git Add aiger and protobuf backends binary support --- diff --git a/backends/aiger/aiger.cc b/backends/aiger/aiger.cc index 0798fb35d..3e8b14dee 100644 --- a/backends/aiger/aiger.cc +++ b/backends/aiger/aiger.cc @@ -777,7 +777,7 @@ struct AigerBackend : public Backend { } break; } - extra_args(f, filename, args, argidx); + extra_args(f, filename, args, argidx, !ascii_mode); Module *top_module = design->top_module(); 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));