abc/src/phys/place/place_base.c
// --------------------------------------------------------------------
// addConcreteNet()
//
/// \brief Adds a net to the placement database.
///
/// The net object must already be allocated and the ID must be set
/// appropriately.
//
// --------------------------------------------------------------------
addConcreteNet()
\brief Adds a net to the placement database.

The net object must already be allocated and the ID must be set
appropriately.
addConcreteNet () \ brief Adds a net to the placement database . The net object must already be allocated and the ID must be set appropriately .
void   addConcreteNet(ConcreteNet *net) {
  assert(net);
  assert(net->m_id >= 0);
  if (net->m_id >= g_place_concreteNetsSize) {
    g_place_concreteNetsSize = (net->m_id > g_place_concreteNetsSize ? 
                               net->m_id : g_place_concreteNetsSize);
    g_place_concreteNetsSize *= 1.5;
    g_place_concreteNetsSize += 20;
    g_place_concreteNets = (ConcreteNet**)realloc(g_place_concreteNets, 
             sizeof(ConcreteNet*)*g_place_concreteNetsSize);
    assert(g_place_concreteNets);
  }
  if (net->m_id >= g_place_numNets) {
    memset(&(g_place_concreteNets[g_place_numNets]), 0,
            sizeof(ConcreteNet*)*(net->m_id+1-g_place_numNets));
    g_place_numNets = net->m_id+1;
    assert(g_place_numNets <= g_place_concreteNetsSize);
  }
  g_place_concreteNets[net->m_id] = net;
}
void addConcreteNet ( ConcreteNet * net ) { assert ( net ) ; assert ( net -> m_id >= 0 ) ; if ( net -> m_id >= g_place_concreteNetsSize ) { g_place_concreteNetsSize = ( net -> m_id > g_place_concreteNetsSize ? net -> m_id : g_place_concreteNetsSize ) ; g_place_concreteNetsSize *= 1.5 ; g_place_concreteNetsSize += 20 ; g_place_concreteNets = ( ConcreteNet * * ) realloc ( g_place_concreteNets , sizeof ( ConcreteNet * ) * g_place_concreteNetsSize ) ; assert ( g_place_concreteNets ) ; } if ( net -> m_id >= g_place_numNets ) { memset ( & ( g_place_concreteNets [ g_place_numNets ] ) , 0 , sizeof ( ConcreteNet * ) * ( net -> m_id + 1 - g_place_numNets ) ) ; g_place_numNets = net -> m_id + 1 ; assert ( g_place_numNets <= g_place_concreteNetsSize ) ; } g_place_concreteNets [ net -> m_id ] = net ; }
addConcreteNet()
\brief Adds a net to the placement database.
addConcreteNet () \ brief Adds a net to the placement database .