mirror of
https://github.com/YosysHQ/yosys.git
synced 2026-08-22 06:07:26 +02:00
Support filename rewrite in backends
Signed-off-by: Ben Widawsky <[email protected]>
This commit is contained in:
@@ -776,6 +776,7 @@ struct AigerBackend : public Backend {
|
|||||||
writer.write_aiger(*f, ascii_mode, miter_mode, symbols_mode);
|
writer.write_aiger(*f, ascii_mode, miter_mode, symbols_mode);
|
||||||
|
|
||||||
if (!map_filename.empty()) {
|
if (!map_filename.empty()) {
|
||||||
|
rewrite_filename(filename);
|
||||||
std::ofstream mapf;
|
std::ofstream mapf;
|
||||||
mapf.open(map_filename.c_str(), std::ofstream::trunc);
|
mapf.open(map_filename.c_str(), std::ofstream::trunc);
|
||||||
if (mapf.fail())
|
if (mapf.fail())
|
||||||
|
|||||||
@@ -483,6 +483,7 @@ struct DumpPass : public Pass {
|
|||||||
std::stringstream buf;
|
std::stringstream buf;
|
||||||
|
|
||||||
if (!filename.empty()) {
|
if (!filename.empty()) {
|
||||||
|
rewrite_filename(filename);
|
||||||
std::ofstream *ff = new std::ofstream;
|
std::ofstream *ff = new std::ofstream;
|
||||||
ff->open(filename.c_str(), append ? std::ofstream::app : std::ofstream::trunc);
|
ff->open(filename.c_str(), append ? std::ofstream::app : std::ofstream::trunc);
|
||||||
if (ff->fail()) {
|
if (ff->fail()) {
|
||||||
|
|||||||
@@ -525,6 +525,7 @@ struct JsonPass : public Pass {
|
|||||||
std::stringstream buf;
|
std::stringstream buf;
|
||||||
|
|
||||||
if (!filename.empty()) {
|
if (!filename.empty()) {
|
||||||
|
rewrite_filename(filename);
|
||||||
std::ofstream *ff = new std::ofstream;
|
std::ofstream *ff = new std::ofstream;
|
||||||
ff->open(filename.c_str(), std::ofstream::trunc);
|
ff->open(filename.c_str(), std::ofstream::trunc);
|
||||||
if (ff->fail()) {
|
if (ff->fail()) {
|
||||||
|
|||||||
@@ -336,6 +336,7 @@ struct ProtobufPass : public Pass {
|
|||||||
std::stringstream buf;
|
std::stringstream buf;
|
||||||
|
|
||||||
if (!filename.empty()) {
|
if (!filename.empty()) {
|
||||||
|
rewrite_filename(filename);
|
||||||
std::ofstream *ff = new std::ofstream;
|
std::ofstream *ff = new std::ofstream;
|
||||||
ff->open(filename.c_str(), std::ofstream::trunc);
|
ff->open(filename.c_str(), std::ofstream::trunc);
|
||||||
if (ff->fail()) {
|
if (ff->fail()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user