Пример #1
0
void NETLIST_OBJECT_LIST::labelConnect( NETLIST_OBJECT* aLabelRef )
{
    if( aLabelRef->GetNet() == 0 )
        return;

    for( unsigned i = 0; i < size(); i++ )
    {
        NETLIST_OBJECT* item = GetItem( i );

        if( item->GetNet() == aLabelRef->GetNet() )
            continue;

        if( item->m_SheetPath != aLabelRef->m_SheetPath )
        {
            if( item->m_Type != NET_PINLABEL && item->m_Type != NET_GLOBLABEL
                && item->m_Type != NET_GLOBBUSLABELMEMBER )
                continue;

            if( (item->m_Type == NET_GLOBLABEL
                 || item->m_Type == NET_GLOBBUSLABELMEMBER)
               && item->m_Type != aLabelRef->m_Type )
                //global labels only connect other global labels.
                continue;
        }

        // NET_HIERLABEL are used to connect sheets.
        // NET_LABEL are local to a sheet
        // NET_GLOBLABEL are global.
        // NET_PINLABEL is a kind of global label (generated by a power pin invisible)
        if( item->IsLabelType() )
        {
            if( item->m_Label != aLabelRef->m_Label )
                continue;

            if( item->GetNet() )
                propagateNetCode( item->GetNet(), aLabelRef->GetNet(), IS_WIRE );
            else
                item->SetNet( aLabelRef->GetNet() );
        }
    }
}