Add aiger and protobuf backends binary support

This commit is contained in:
Miodrag Milanovic 2019-09-28 09:50:29 +02:00
parent d0493925ec
commit 0c380f0855
2 changed files with 3 additions and 3 deletions

View File

@ -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();

View File

@ -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));