8
8
9
9
#include " show_trans.h"
10
10
11
+ #include < util/cout_message.h>
12
+
11
13
#include < verilog/expr2verilog.h>
12
14
13
15
#include " ebmc_base.h"
25
27
26
28
\*******************************************************************/
27
29
28
- class show_transt : public ebmc_baset
30
+ class show_transt
29
31
{
30
32
public:
31
- show_transt (
32
- const cmdlinet &cmdline,
33
- ui_message_handlert &ui_message_handler):
34
- ebmc_baset (cmdline, ui_message_handler)
33
+ explicit show_transt (const transition_systemt &_transition_system)
34
+ : transition_system(_transition_system)
35
35
{
36
36
}
37
37
38
- int show_trans_verilog_rtl ();
39
- int show_trans_verilog_netlist ();
40
- int show_trans ();
38
+ int show_trans_verilog_rtl (std::ostream & );
39
+ int show_trans_verilog_netlist (std::ostream & );
40
+ int show_trans (std::ostream & );
41
41
42
42
protected:
43
- int show_trans_verilog_rtl (std::ostream &out) ;
44
- int show_trans_verilog_netlist (std::ostream &out);
43
+ const transition_systemt &transition_system ;
44
+
45
45
void verilog_header (std::ostream &out, const std::string &desc);
46
46
void
47
47
print_verilog_constraints (const exprt &, const namespacet &, std::ostream &);
@@ -60,11 +60,11 @@ Function: show_trans_verilog_netlist
60
60
\*******************************************************************/
61
61
62
62
int show_trans_verilog_netlist (
63
- const cmdlinet &cmdline ,
64
- ui_message_handlert &ui_message_handler )
63
+ const transition_systemt &transition_system ,
64
+ std::ostream &out )
65
65
{
66
- show_transt show_trans (cmdline, ui_message_handler);
67
- return show_trans.show_trans_verilog_netlist ();
66
+ show_transt show_trans (transition_system);
67
+ return show_trans.show_trans_verilog_netlist (out );
68
68
}
69
69
70
70
/* ******************************************************************\
@@ -80,11 +80,11 @@ Function: show_trans_verilog_rtl
80
80
\*******************************************************************/
81
81
82
82
int show_trans_verilog_rtl (
83
- const cmdlinet &cmdline ,
84
- ui_message_handlert &ui_message_handler )
83
+ const transition_systemt &transition_system ,
84
+ std::ostream &out )
85
85
{
86
- show_transt show_trans (cmdline, ui_message_handler);
87
- return show_trans.show_trans_verilog_rtl ();
86
+ show_transt show_trans (transition_system);
87
+ return show_trans.show_trans_verilog_rtl (out );
88
88
}
89
89
90
90
/* ******************************************************************\
@@ -101,8 +101,10 @@ Function: show_transt::show_trans_verilog_netlist
101
101
102
102
int show_transt::show_trans_verilog_netlist (std::ostream &out)
103
103
{
104
+ console_message_handlert message_handler;
105
+
104
106
output_verilog_netlistt output_verilog (
105
- transition_system.symbol_table , out, message. get_message_handler () );
107
+ transition_system.symbol_table , out, message_handler );
106
108
107
109
try
108
110
{
@@ -145,8 +147,10 @@ Function: show_transt::show_trans_verilog_rtl
145
147
146
148
int show_transt::show_trans_verilog_rtl (std::ostream &out)
147
149
{
150
+ console_message_handlert message_handler;
151
+
148
152
output_verilog_rtlt output_verilog (
149
- transition_system.symbol_table , out, message. get_message_handler () );
153
+ transition_system.symbol_table , out, message_handler );
150
154
151
155
try
152
156
{
@@ -177,6 +181,24 @@ int show_transt::show_trans_verilog_rtl(std::ostream &out)
177
181
178
182
/* ******************************************************************\
179
183
184
+ Function: show_transt::show_trans
185
+
186
+ Inputs:
187
+
188
+ Outputs:
189
+
190
+ Purpose:
191
+
192
+ \*******************************************************************/
193
+
194
+ int show_transt::show_trans (std::ostream &out)
195
+ {
196
+ transition_system.output (out);
197
+ return 0 ;
198
+ }
199
+
200
+ /* ******************************************************************\
201
+
180
202
Function: show_transt::verilog_header
181
203
182
204
Inputs:
@@ -226,86 +248,6 @@ void show_transt::print_verilog_constraints(
226
248
227
249
/* ******************************************************************\
228
250
229
- Function: show_transt::show_trans
230
-
231
- Inputs:
232
-
233
- Outputs:
234
-
235
- Purpose:
236
-
237
- \*******************************************************************/
238
-
239
- int show_transt::show_trans ()
240
- {
241
- transition_system =
242
- get_transition_system (cmdline, message.get_message_handler ());
243
-
244
- transition_system.output (std::cout);
245
-
246
- return 0 ;
247
- }
248
-
249
- /* ******************************************************************\
250
-
251
- Function: show_transt::show_trans_verilog_rtl
252
-
253
- Inputs:
254
-
255
- Outputs:
256
-
257
- Purpose:
258
-
259
- \*******************************************************************/
260
-
261
- int show_transt::show_trans_verilog_rtl ()
262
- {
263
- transition_system =
264
- get_transition_system (cmdline, message.get_message_handler ());
265
-
266
- if (cmdline.isset (" outfile" ))
267
- {
268
- const std::string filename=cmdline.get_value (" outfile" );
269
- auto outfile = output_filet{filename};
270
- show_trans_verilog_rtl (outfile.stream ());
271
- }
272
- else
273
- show_trans_verilog_rtl (std::cout);
274
-
275
- return 0 ;
276
- }
277
-
278
- /* ******************************************************************\
279
-
280
- Function: show_transt::show_trans_verilog_netlist
281
-
282
- Inputs:
283
-
284
- Outputs:
285
-
286
- Purpose:
287
-
288
- \*******************************************************************/
289
-
290
- int show_transt::show_trans_verilog_netlist ()
291
- {
292
- transition_system =
293
- get_transition_system (cmdline, message.get_message_handler ());
294
-
295
- if (cmdline.isset (" outfile" ))
296
- {
297
- const std::string filename=cmdline.get_value (" outfile" );
298
- auto outfile = output_filet{filename};
299
- show_trans_verilog_netlist (outfile.stream ());
300
- }
301
- else
302
- show_trans_verilog_netlist (std::cout);
303
-
304
- return 0 ;
305
- }
306
-
307
- /* ******************************************************************\
308
-
309
251
Function: show_trans
310
252
311
253
Inputs:
@@ -316,11 +258,8 @@ Function: show_trans
316
258
317
259
\*******************************************************************/
318
260
319
- int show_trans (
320
- const cmdlinet &cmdline,
321
- ui_message_handlert &ui_message_handler)
261
+ int show_trans (const transition_systemt &transition_system, std::ostream &out)
322
262
{
323
- show_transt show_trans (cmdline, ui_message_handler );
324
- return show_trans.show_trans ();
263
+ show_transt show_trans (transition_system );
264
+ return show_trans.show_trans (out );
325
265
}
326
-
0 commit comments