File tree Expand file tree Collapse file tree 3 files changed +33
-26
lines changed
Expand file tree Collapse file tree 3 files changed +33
-26
lines changed Original file line number Diff line number Diff line change @@ -88,30 +88,7 @@ void ebmc_baset::show_ldg(std::ostream &out)
8888
8989 out << " Latch dependencies:" << ' \n ' ;
9090
91- for (auto var_it : netlist.var_map .sorted ())
92- {
93- auto &var = var_it->second ;
94-
95- for (std::size_t i=0 ; i<var.bits .size (); i++)
96- {
97- if (var.is_latch ())
98- {
99- literalt::var_not v=var.bits [i].current .var_no ();
100-
101- out << " " << var_it->first << " [" << i << " ] = " << v << " :" ;
102-
103- const ldg_nodet &node=ldg[v];
104-
105- for (ldg_nodet::edgest::const_iterator
106- i_it=node.in .begin ();
107- i_it!=node.in .end ();
108- i_it++)
109- out << " " << i_it->first ;
110-
111- out << ' \n ' ;
112- }
113- }
114- }
91+ ldg.output (netlist, out);
11592}
11693
11794/* ******************************************************************\
Original file line number Diff line number Diff line change @@ -98,3 +98,30 @@ void ldgt::compute(
9898 }
9999 }
100100}
101+
102+ void ldgt::output (const netlistt &netlist, std::ostream &out) const
103+ {
104+ for (auto var_it : netlist.var_map .sorted ())
105+ {
106+ auto &var = var_it->second ;
107+
108+ for (std::size_t i = 0 ; i < var.bits .size (); i++)
109+ {
110+ if (var.is_latch ())
111+ {
112+ literalt::var_not v = var.bits [i].current .var_no ();
113+
114+ out << " " << var_it->first << " [" << i << " ] = " << v << " :" ;
115+
116+ const ldg_nodet &node = (*this )[v];
117+
118+ for (ldg_nodet::edgest::const_iterator i_it = node.in .begin ();
119+ i_it != node.in .end ();
120+ i_it++)
121+ out << " " << i_it->first ;
122+
123+ out << ' \n ' ;
124+ }
125+ }
126+ }
127+ }
Original file line number Diff line number Diff line change @@ -9,12 +9,13 @@ Author: Daniel Kroening, kroening@kroening.com
99#ifndef CPROVER_TRANS_LDG_H
1010#define CPROVER_TRANS_LDG_H
1111
12- #include < set>
13-
1412#include < util/graph.h>
1513
1614#include " netlist.h"
1715
16+ #include < iosfwd>
17+ #include < set>
18+
1819struct ldg_nodet :public graph_nodet <>
1920{
2021public:
@@ -35,6 +36,8 @@ class ldgt:public grapht<ldg_nodet>
3536 // latches that are to be considered
3637 void compute (const netlistt &netlist,
3738 const latchest &localization);
39+
40+ void output (const netlistt &, std::ostream &) const ;
3841};
3942
4043#endif
You can’t perform that action at this time.
0 commit comments