Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/verilog/verilog_expr.h
Original file line number Diff line number Diff line change
Expand Up @@ -854,6 +854,18 @@ class verilog_inst_baset : public verilog_module_itemt
return operands();
}

bool positional_port_connections() const
{
return !named_port_connections();
}

bool named_port_connections() const
{
auto &connections = this->connections();
return connections.empty() ||
connections.front().id() == ID_named_port_connection;
}

protected:
using exprt::operands;
};
Expand Down
2 changes: 1 addition & 1 deletion src/verilog/verilog_synthesis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1419,7 +1419,7 @@ void verilog_synthesist::instantiate_ports(

// named port connection?

if(inst.connections().front().id() == ID_named_port_connection)
if(inst.named_port_connections())
{
const irept::subt &ports = symbol.type.find(ID_ports).get_sub();

Expand Down
4 changes: 1 addition & 3 deletions src/verilog/verilog_typecheck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,7 @@ void verilog_typecheckt::typecheck_port_connections(
}

// named port connection?
if(
inst.connections().empty() ||
inst.connections().front().id() == ID_named_port_connection)
if(inst.named_port_connections())
{
// We don't require that all ports are connected.

Expand Down
Loading