Ignore:
Timestamp:
Jan 15, 2013, 5:54:45 PM (11 years ago)
Author:
joannou
Message:

Updated vci_vdspin_initiator_wrapper and vci_vdspin_target_wrapper to fit new spec :
A single flit VCI response packet with a rdata=0 is translated to a single flit DSPIN response packet.
(All other responses need multi flit DSPIN response packets)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/modules/vci_vdspin_target_wrapper/caba/source/include/vci_vdspin_target_wrapper.h

    r185 r287  
    55  *
    66  * SOCLIB_LGPL_HEADER_BEGIN
    7   * 
     7  *
    88  * This file is part of SoCLib, GNU LGPLv2.1.
    9   * 
     9  *
    1010  * SoCLib is free software; you can redistribute it and/or modify it
    1111  * under the terms of the GNU Lesser General Public License as published
    1212  * by the Free Software Foundation; version 2.1 of the License.
    13   * 
     13  *
    1414  * SoCLib is distributed in the hope that it will be useful, but
    1515  * WITHOUT ANY WARRANTY; without even the implied warranty of
    1616  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    1717  * Lesser General Public License for more details.
    18   * 
     18  *
    1919  * You should have received a copy of the GNU Lesser General Public
    2020  * License along with SoCLib; if not, write to the Free Software
    2121  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    2222  * 02110-1301 USA
    23   * 
     23  *
    2424  * SOCLIB_LGPL_HEADER_END
     25  *
     26  * Maintainers: alexandre.joannou@lip6.fr
     27  *
    2528  */
    2629
     
    3942// - VCI address width    <= 40 bits
    4043// - VCI data             == 32 bits
    41 // - VCI plen             == 8  bits
    42 // - VCI srcid            <= 14 bits
    43 // - VCI trdid            <= 8  bits
    44 // - VCI pktid field not transmitted
    45 // - VCI rerror           == 2 bits
     44// - VCI plen             == 8  bits
     45// - VCI srcid            <= 14 bits
     46// - VCI trdid            <= 4  bits
     47// - VCI pktid            <= 4  bits
     48// - VCI rerror           == 1  bit
    4649////////////////////////////////////////////////////////////////////////
    4750
     
    6265template<typename vci_param, int dspin_cmd_width, int dspin_rsp_width>
    6366class VciVdspinTargetWrapper
    64         : public soclib::caba::BaseModule
     67    : public soclib::caba::BaseModule
    6568{
    6669
    67     // Command FSM 
     70    // Command FSM
    6871    enum fsm_state_cmd{
    6972    CMD_IDLE,
     
    7780    enum fsm_state_rsp{
    7881    RSP_IDLE,
    79     RSP_READ,
    80     RSP_WRITE,
     82    RSP_DSPIN_SINGLE_FLIT,
     83    RSP_DSPIN_MULTI_FLIT,
    8184    };
    8285
     
    8689public:
    8790    // ports
    88     sc_core::sc_in<bool>                                        p_clk;
    89     sc_core::sc_in<bool>                                        p_resetn;
    90     soclib::caba::DspinOutput<dspin_rsp_width>                  p_dspin_out;
    91     soclib::caba::DspinInput<dspin_cmd_width>                   p_dspin_in;
    92     soclib::caba::VciInitiator<vci_param>                       p_vci;
     91    sc_core::sc_in<bool>                                    p_clk;
     92    sc_core::sc_in<bool>                                    p_resetn;
     93    soclib::caba::DspinOutput<dspin_rsp_width>              p_dspin_out;
     94    soclib::caba::DspinInput<dspin_cmd_width>               p_dspin_in;
     95    soclib::caba::VciInitiator<vci_param>                   p_vci;
    9396
    9497    // constructor / destructor
    95     VciVdspinTargetWrapper(     sc_module_name                  name,
    96                                 size_t                          cmd_fifo_depth,
    97                                 size_t                          rsp_fifo_depth);
     98    VciVdspinTargetWrapper( sc_module_name                  name,
     99                            size_t                          cmd_fifo_depth,
     100                            size_t                          rsp_fifo_depth  );
    98101private:
    99102    // internal registers
    100     sc_core::sc_signal<int>                                     r_cmd_fsm;
    101     sc_core::sc_signal<sc_uint<dspin_cmd_width> >               r_cmd_buf0;
    102     sc_core::sc_signal<sc_uint<dspin_cmd_width> >               r_cmd_buf1;
    103     sc_core::sc_signal<int>                                     r_rsp_fsm;
    104     sc_core::sc_signal<size_t>                                  r_flit_count;
     103    sc_core::sc_signal<int>                                 r_cmd_fsm;
     104    sc_core::sc_signal<sc_uint<dspin_cmd_width> >           r_cmd_buf0;
     105    sc_core::sc_signal<sc_uint<dspin_cmd_width> >           r_cmd_buf1;
     106    sc_core::sc_signal<int>                                 r_rsp_fsm;
     107    sc_core::sc_signal<size_t>                              r_flit_count;
    105108
    106109    // fifos cmd and rsp
    107     soclib::caba::GenericFifo<sc_uint<dspin_cmd_width> >        r_fifo_cmd;
    108     soclib::caba::GenericFifo<sc_uint<dspin_rsp_width> >        r_fifo_rsp;
     110    soclib::caba::GenericFifo<sc_uint<dspin_cmd_width> >    r_fifo_cmd;
     111    soclib::caba::GenericFifo<sc_uint<dspin_rsp_width> >    r_fifo_rsp;
    109112
    110113    // methods systemc
     
    118121
    119122}} // end namespace
    120                
     123
    121124#endif // VCI_VDSPIN_TARGET_WRAPPER_H_
    122125
Note: See TracChangeset for help on using the changeset viewer.