source: branches/reconfiguration/modules/vci_local_crossbar/caba/source/include/vci_local_crossbar.h @ 932

Last change on this file since 932 was 932, checked in by cfuguet, 9 years ago

reconf: introduce a vci_local_crossbar which support the segment
recovery mechanism.

File size: 3.4 KB
Line 
1/* -*- c++ -*-
2 *
3 * SOCLIB_LGPL_HEADER_BEGIN
4 *
5 * This file is part of SoCLib, GNU LGPLv2.1.
6 *
7 * SoCLib is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU Lesser General Public License as published
9 * by the Free Software Foundation; version 2.1 of the License.
10 *
11 * SoCLib is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with SoCLib; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19 * 02110-1301 USA
20 *
21 * SOCLIB_LGPL_HEADER_END
22 *
23 * Copyright (c) UPMC, Lip6, Asim
24 *         Alain Greiner <alain.greiner@lip6.fr>, 2005
25 *         Nicolas Pouillon <nipo@ssji.net>, 2008
26 *
27 * Maintainers: alain
28 */
29
30#ifndef SOCLIB_CABA_VCI_LOCAL_CROSSBAR_H_
31#define SOCLIB_CABA_VCI_LOCAL_CROSSBAR_H_
32
33#include <systemc>
34#include "caba_base_module.h"
35#include "vci_initiator.h"
36#include "vci_target.h"
37#include "vci_buffers.h"
38#include "mapping_table.h"
39#include "address_decoding_table.h"
40
41namespace soclib { namespace caba {
42
43using namespace soclib::common;
44
45template<typename pkt_t> class SimpleCrossbar;
46
47////////////////////////////////////
48template<typename vci_param>
49class VciLocalCrossbar
50////////////////////////////////////
51    : public BaseModule
52{
53public:
54
55    sc_in<bool>                               p_clk;
56    sc_in<bool>                               p_resetn;
57
58    VciInitiator<vci_param>                  *p_to_target;
59    VciTarget<vci_param>                     *p_to_initiator;
60    VciTarget<vci_param>                      p_target_to_up;
61    VciInitiator<vci_param>                   p_initiator_to_up;
62
63private:
64
65    size_t                                    m_nb_attached_initiators;
66    size_t                                    m_nb_attached_targets;
67
68    AddressDecodingTable<uint64_t, size_t>    m_cmd_rt;   // command routing table
69    AddressDecodingTable<uint64_t, bool>      m_cmd_lt;   // command locality table
70
71    AddressDecodingTable<uint32_t, size_t>    m_rsp_rt;   // response routing table
72    AddressDecodingTable<uint32_t, bool>      m_rsp_lt;   // response locality table
73
74    VciInitiator<vci_param>                 **m_ports_to_target;
75    VciTarget<vci_param>                    **m_ports_to_initiator;
76
77    SimpleCrossbar<VciCmdBuffer<vci_param> > *m_cmd_crossbar;
78    SimpleCrossbar<VciRspBuffer<vci_param> > *m_rsp_crossbar;
79
80    void transition();
81    void genMealy();
82
83protected:
84    SC_HAS_PROCESS(VciLocalCrossbar);
85
86public:
87    void print_trace();
88
89    VciLocalCrossbar( sc_core::sc_module_name             name,
90                                          const soclib::common::MappingTable  &mt,
91                                          const size_t                        cluster_id,
92                                          const size_t                        nb_attached_initiators,
93                                          const size_t                        nb_attached_targets,
94                      const size_t                        default_target_id );
95    ~VciLocalCrossbar();
96};
97
98}}
99
100#endif /* SOCLIB_CABA_VCI_LOCAL_CROSSBAR_H_ */
101
102// Local Variables:
103// tab-width: 4
104// c-basic-offset: 4
105// c-file-offsets:((innamespace . 0)(inline-open . 0))
106// indent-tabs-mode: nil
107// End:
108
109// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=4:softtabstop=4
Note: See TracBrowser for help on using the repository browser.