diff options
author | Miodrag Milanovic <mmicko@gmail.com> | 2019-09-28 09:28:51 +0200 |
---|---|---|
committer | Miodrag Milanovic <mmicko@gmail.com> | 2019-09-28 09:36:18 +0200 |
commit | d0493925ec739aa13cd72e5aa525e98ca49cc326 (patch) | |
tree | 514d90fdc77cf3091a52dd6518ad25f9e4c0f433 /kernel | |
parent | c372e7baf9c48d41ebdbea4486a72e8dfaaddd3d (diff) | |
download | yosys-d0493925ec739aa13cd72e5aa525e98ca49cc326.tar.gz yosys-d0493925ec739aa13cd72e5aa525e98ca49cc326.tar.bz2 yosys-d0493925ec739aa13cd72e5aa525e98ca49cc326.zip |
Support binary files for backends, fixes #1407
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/register.cc | 4 | ||||
-rw-r--r-- | kernel/register.h | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/kernel/register.cc b/kernel/register.cc index 8131fa279..3033ee710 100644 --- a/kernel/register.cc +++ b/kernel/register.cc @@ -612,7 +612,7 @@ void Backend::execute(std::vector<std::string> args, RTLIL::Design *design) delete f; } -void Backend::extra_args(std::ostream *&f, std::string &filename, std::vector<std::string> args, size_t argidx) +void Backend::extra_args(std::ostream *&f, std::string &filename, std::vector<std::string> args, size_t argidx, bool bin_output) { bool called_with_fp = f != NULL; @@ -647,7 +647,7 @@ void Backend::extra_args(std::ostream *&f, std::string &filename, std::vector<st #endif } else { std::ofstream *ff = new std::ofstream; - ff->open(filename.c_str(), std::ofstream::trunc); + ff->open(filename.c_str(), bin_output ? (std::ofstream::trunc | std::ofstream::binary) : std::ofstream::trunc); yosys_output_files.insert(filename); if (ff->fail()) { delete ff; diff --git a/kernel/register.h b/kernel/register.h index c74029823..be836013f 100644 --- a/kernel/register.h +++ b/kernel/register.h @@ -109,7 +109,7 @@ struct Backend : Pass void execute(std::vector<std::string> args, RTLIL::Design *design) YS_OVERRIDE YS_FINAL; virtual void execute(std::ostream *&f, std::string filename, std::vector<std::string> args, RTLIL::Design *design) = 0; - void extra_args(std::ostream *&f, std::string &filename, std::vector<std::string> args, size_t argidx); + void extra_args(std::ostream *&f, std::string &filename, std::vector<std::string> args, size_t argidx, bool bin_output = false); static void backend_call(RTLIL::Design *design, std::ostream *f, std::string filename, std::string command); static void backend_call(RTLIL::Design *design, std::ostream *f, std::string filename, std::vector<std::string> args); |