Changeset 877 for branches


Ignore:
Timestamp:
Nov 12, 2014, 3:14:47 PM (9 years ago)
Author:
cfuguet
Message:

reconf: replace internal BH variable by an input port in the dspin_router

  • This port is conditionnaly instantiated in the router if the newly introduced constructor parameter 'reconfigurable' is true.
  • When this port is used, it can be bound to a CONFIG component which can reconfigure the router.
Location:
branches/reconfiguration/modules/dspin_router/caba/source
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/reconfiguration/modules/dspin_router/caba/source/include/dspin_router.h

    r873 r877  
    109109    DspinOutput<flit_width>     *p_out;
    110110
     111    sc_in<int>                  *p_blackhole_pos;
     112
    111113    // constructor / destructor
    112114    DspinRouter( sc_module_name  name,
     
    117119                 const size_t    in_fifo_depth,
    118120                 const size_t    out_fifo_depth,
    119                  const bool      broadcast_supported = false ); // default value
     121                 const bool      broadcast_supported = false,
     122                 const bool      reconfigurable = false );
     123
     124    ~DspinRouter();
    120125
    121126    private:
     
    151156    bool                        m_broadcast_supported;
    152157    int                         m_disable_mask;
    153     int                         m_blackhole_pos;
    154158
    155159    // methods
     
    169173    }
    170174
    171     void set_blackhole_pos( int pos )
    172     {
    173         m_blackhole_pos = pos;
    174     }
    175 
    176175    void print_trace();
    177176};
  • branches/reconfiguration/modules/dspin_router/caba/source/src/dspin_router.cpp

    r873 r877  
    5959                             const size_t   in_fifo_depth,
    6060                             const size_t   out_fifo_depth,
    61                              const bool     broadcast_supported )
     61                             const bool     broadcast_supported,
     62                             const bool     reconfigurable )
    6263    : soclib::caba::BaseModule(name),
    6364
     
    114115                GenericFifo<internal_flit_t >(stro.str(), out_fifo_depth);
    115116        }
     117
     118        if ( reconfigurable ) p_blackhole_pos = new sc_core::sc_in<int>;
     119        else                  p_blackhole_pos = NULL;
    116120    } //  end constructor
     121
     122    ///////////////////////////////////////////////////
     123    tmpl(/**/)::~DspinRouter()
     124    {
     125        if ( p_blackhole_pos != NULL ) delete p_blackhole_pos;
     126    }
    117127
    118128    ///////////////////////////////////////////////////
     
    128138    tmpl(int)::recovery_route( size_t xdest, size_t ydest )
    129139    {
    130         int bhpos = m_blackhole_pos;
     140        int bhpos = p_blackhole_pos->read();
    131141        if ( xdest > m_local_x ) {
    132142            if ( (bhpos == BH_NE) || (bhpos == BH_E) || (bhpos == BH_SE) ||
     
    238248        size_t xdest = (size_t)(data >> m_x_shift) & m_x_mask;
    239249        size_t ydest = (size_t)(data >> m_y_shift) & m_y_mask;
    240         if ( m_blackhole_pos == BH_NONE ) {
    241             return xfirst_route(xdest, ydest);
    242         }
    243         else {
    244             return recovery_route(xdest, ydest);
    245         }
     250        if ( p_blackhole_pos != NULL )
     251        {
     252            if (p_blackhole_pos->read() != BH_NONE)
     253            {
     254                return recovery_route(xdest, ydest);
     255            }
     256        }
     257        return xfirst_route(xdest, ydest);
    246258    }
    247259
     
    378390                r_fifo_out[i].init();
    379391            }
    380 
    381             set_blackhole_pos(BH_NONE);
    382392            return;
    383393        }
Note: See TracChangeset for help on using the changeset viewer.