Skip to content

Commit 6428ea7

Browse files
committed
ebmc: --smt-netlist and --dot-netlist now honor --outfile
1 parent 7c7e7e2 commit 6428ea7

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

CHANGELOG

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
* SystemVerilog: streaming concatenation {<<{...}} and {>>{...}}
99
* SystemVerilog: set membership operator
1010
* SystemVerilog: named sequences
11+
* ebmc: --smt-netlist and --dot-netlist now honor --outfile
1112

1213
# EBMC 5.3
1314

src/ebmc/ebmc_parse_options.cpp

+12-7
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Author: Daniel Kroening, [email protected]
2020
#include "ic3_engine.h"
2121
#include "liveness_to_safety.h"
2222
#include "neural_liveness.h"
23+
#include "output_file.h"
2324
#include "property_checker.h"
2425
#include "random_traces.h"
2526
#include "ranking_function.h"
@@ -274,9 +275,11 @@ int ebmc_parse_optionst::doit()
274275
netlistt netlist;
275276
if(ebmc_base.make_netlist(netlist))
276277
return 1;
277-
std::cout << "digraph netlist {\n";
278-
netlist.output_dot(std::cout);
279-
std::cout << "}\n";
278+
auto filename = cmdline.isset("outfile") ? cmdline.get_value("outfile") : "-";
279+
output_filet outfile{filename};
280+
outfile.stream() << "digraph netlist {\n";
281+
netlist.output_dot(outfile.stream());
282+
outfile.stream() << "}\n";
280283
return 0;
281284
}
282285

@@ -285,11 +288,13 @@ int ebmc_parse_optionst::doit()
285288
netlistt netlist;
286289
if(ebmc_base.make_netlist(netlist))
287290
return 1;
288-
std::cout << "-- Generated by EBMC " << EBMC_VERSION << '\n';
289-
std::cout << "-- Generated from "
291+
auto filename = cmdline.isset("outfile") ? cmdline.get_value("outfile") : "-";
292+
output_filet outfile{filename};
293+
outfile.stream() << "-- Generated by EBMC " << EBMC_VERSION << '\n';
294+
outfile.stream() << "-- Generated from "
290295
<< ebmc_base.transition_system.main_symbol->name << '\n';
291-
std::cout << '\n';
292-
netlist.output_smv(std::cout);
296+
outfile.stream() << '\n';
297+
netlist.output_smv(outfile.stream());
293298
return 0;
294299
}
295300

0 commit comments

Comments
 (0)