Ejemplo n.º 1
0
void NETLIST_OBJECT_LIST::connectBusLabels()
{
    // Propagate the net code between all bus label member objects connected by they name.
    // If the net code is not yet existing, a new one is created
    // Search is done in the entire list
    for( unsigned ii = 0; ii < size(); ii++ )
    {
        NETLIST_OBJECT* Label = GetItem( ii );

        if( Label->IsLabelBusMemberType() )
        {
            if( Label->GetNet() == 0 )
            {
                // Not yet existiing net code: create a new one.
                Label->SetNet( m_lastNetCode );
                m_lastNetCode++;
            }

            for( unsigned jj = ii + 1; jj < size(); jj++ )
            {
                NETLIST_OBJECT* LabelInTst =  GetItem( jj );

                if( LabelInTst->IsLabelBusMemberType() )
                {
                    if( LabelInTst->m_BusNetCode != Label->m_BusNetCode )
                        continue;

                    if( LabelInTst->m_Member != Label->m_Member )
                        continue;

                    if( LabelInTst->GetNet() == 0 )
                        // Append this object to the current net
                        LabelInTst->SetNet( Label->GetNet() );
                    else
                        // Merge the 2 net codes, they are connected.
                        propagateNetCode( LabelInTst->GetNet(), Label->GetNet(), IS_WIRE );
                }
            }
        }
    }
}