Changeset 1013


Ignore:
Timestamp:
Sep 12, 2015, 11:41:52 AM (9 years ago)
Author:
cfuguet
Message:

reconf: bugfix in reconf:vci_local_crossbar regarding the hardware
barrier.

Release the barrier if there is no pending global-to-local
request.

This avoid a race condition between a global-to-local request, and the
release of the barrier. In such situation, for multi-flit packets,
some flits may be dropped and others not. Therefore, a packet must be
consumed completely before the barrier release.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/reconfiguration/modules/vci_local_crossbar/caba/source/src/vci_local_crossbar.cpp

    r1001 r1013  
    7878    const void*                 m_lt;           // locality table if cmd / id_locality table if rsp
    7979    const bool              m_is_cmd;       // cmd crossbar when true
    80     bool                    m_barrier;      // barrier in the global interface is enabled
     80
     81    bool                    m_barrier;         // barrier in the global interface is enabled
     82    bool                    m_barrier_release; // request to release the barrier
    8183
    8284    sc_signal<bool>*            r_allocated;    // for each output port: allocation state
     
    9294                        void*   rt,             // routing table
    9395                        void*   lt,             // locality table
    94                     bool    is_cmd )
     96                    bool    is_cmd,
     97                    bool    barrier = false)
    9598        : m_cluster_id( cluster_id ),
    9699      m_in_size( in_size ),
     
    99102          m_lt( lt ),
    100103      m_is_cmd( is_cmd ),
    101       m_barrier( false )
     104      m_barrier( barrier ),
     105      m_barrier_release( false )
    102106        {
    103107            r_allocated = new sc_signal<bool>[out_size];
     
    108112
    109113    //////////////////////////////////
    110     void setBarrier(const bool &value)
     114    inline void setBarrier(const bool &value)
    111115    {
    112116        m_barrier = value;
     117    }
     118
     119    //////////////////////////////////
     120    inline void releaseBarrier()
     121    {
     122        m_barrier_release = true;
    113123    }
    114124
     
    288298            }
    289299        }
     300
     301        // release the barrier if there is no pending global-to-local
     302        // request. This avoid a race condition situation between a
     303        // global-to-local request and the release of the barrier. In
     304        // such situation, for multi-flit packets, some flits may be
     305        // dropped and others not.
     306        if (m_barrier && m_barrier_release && !input_port[m_in_size-1]->getVal())
     307        {
     308            m_barrier = false;
     309        }
    290310    } // end transition
    291311
     
    310330                // incoming packet (send the acknowledgement to the input port)
    311331                // and resetting the cmdval signal to the upper network level.
     332                // When there is a barrier release request, local-to-global
     333                // request are allowed.
    312334                bool read = output_port[out]->getAck();
    313335                if (out == (m_out_size - 1)) {
    314                     read = read || m_barrier;
    315                     tmp.set_val(tmp.val() && !m_barrier);
     336                    read = read || (m_barrier && !m_barrier_release);
     337                    tmp.set_val(tmp.val() && (!m_barrier || m_barrier_release));
    316338                }
    317339
     
    362384    }
    363385
    364     if (p_barrier_enable != NULL)
    365     {
    366         const bool enable = (p_barrier_enable->read() != 0xFFFFFFFF);
    367         m_cmd_crossbar->setBarrier(enable);
    368         m_rsp_crossbar->setBarrier(enable);
     386    if ( p_barrier_enable != NULL )
     387    {
     388        if ( p_barrier_enable->read() == 0xFFFFFFFF )
     389        {
     390            m_cmd_crossbar->releaseBarrier();
     391            m_rsp_crossbar->releaseBarrier();
     392        }
    369393    }
    370394    m_cmd_crossbar->transition( m_ports_to_initiator, m_ports_to_target );
     
    432456                         (void*)(&m_cmd_rt),
    433457                         (void*)(&m_cmd_lt),
    434                          true );
     458                         true,
     459                         hardware_barrier );
    435460
    436461        m_rsp_crossbar = new SimpleCrossbar<VciRspBuffer<vci_param> >(
     
    440465                         (void*)(&m_rsp_rt),
    441466                         (void*)(&m_rsp_lt),
    442                          false );
     467                         false,
     468                         hardware_barrier );
    443469
    444470    m_ports_to_initiator = new VciTarget<vci_param>*[nb_attached_initiators+1];
Note: See TracChangeset for help on using the changeset viewer.