@@ -16,6 +16,7 @@ Author: Daniel Kroening, kroening@kroening.com
1616#include < verilog/verilog_language.h>
1717#include < verilog/verilog_synthesis.h>
1818#include < verilog/verilog_typecheck.h>
19+ #include < verilog/verilog_types.h>
1920
2021#include " output_verilog.h"
2122
@@ -585,17 +586,17 @@ void output_verilog_baset::module_header(const symbolt &symbol)
585586{
586587 out << " module " << symbol.base_name ;
587588
588- const irept &ports=symbol.type . find (ID_ports );
589+ const auto &ports=to_module_type ( symbol.type ). ports ( );
589590
590591 //
591592 // print port in module statement
592593 //
593- if (!ports.get_sub (). empty ())
594+ if (!ports.empty ())
594595 {
595596 out << ' (' ;
596597
597598 bool first = true ;
598- for (auto &port : ports. get_sub () )
599+ for (auto &port : ports)
599600 {
600601 if (first)
601602 first = false ;
@@ -615,10 +616,10 @@ void output_verilog_baset::module_header(const symbolt &symbol)
615616 //
616617 // port declarations
617618 //
618- for (auto &port : ports. get_sub () )
619+ for (auto &port : ports)
619620 {
620- bool is_input = port.get_bool (ID_input );
621- bool is_output = port.get_bool (ID_output );
621+ bool is_input = port.input ( );
622+ bool is_output = port.output ( );
622623
623624 out << " " ;
624625
@@ -629,7 +630,7 @@ void output_verilog_baset::module_header(const symbolt &symbol)
629630 else
630631 out << " output" ;
631632
632- const typet &type = static_cast < const typet &>( port.find (ID_type) );
633+ const typet &type = port.type ( );
633634
634635 if (type.id ()==ID_named_block)
635636 continue ;
0 commit comments