source: trunk/modules/vci_iox_network/caba/source/include/vci_iox_network.h @ 451

Last change on this file since 451 was 451, checked in by alain, 11 years ago

Introducing the vci_iox_network modeling the external IO network.

File size: 4.0 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 <nipo@ssji.net>, 2013
25 *
26 * Maintainers: alain
27 */
28
29//////////////////////////////////////////////////////////////////////////////
30// This component emulates an external IO bus such as PCIe or Hypertransport,
31// but respect the VCI protocol.
32// It is considered as a local interconnect that must be attached to
33// one OR SEVERAL clusters in a global interconnect.
34// It uses two different routing table:
35// - the cmd_routing_table decodes the local field of the VCI address
36//   to return the target port
37// - The rsp_routing_table decodes the local field of the VCI srcid
38//   to return the initator port
39// It is implemented as two independant crossbars, for VCI commands and
40// VCI responses respectively.
41// - The CMD crossbar has nb_ini input ports, and nb_tgt output ports.
42// - The RSP crossbar has nb_tgt input ports, and nb_ini output ports.
43// For both crossbars, output ports allocation policy is round robin.
44//////////////////////////////////////////////////////////////////////////////
45
46#ifndef VCI_IOX_NETWORK_H
47#define VCI_IOX_NETWORK_H
48
49#include <systemc>
50#include "caba_base_module.h"
51#include "vci_initiator.h"
52#include "vci_target.h"
53#include "vci_buffers.h"
54#include "mapping_table.h"
55#include "address_decoding_table.h"
56
57namespace soclib { namespace caba {
58
59using namespace sc_core;
60using namespace soclib::common;
61
62template<typename pkt_t> class IoXbar;
63
64///////////////////////////////////////
65template<typename vci_param>
66class VciIoxNetwork
67///////////////////////////////////////
68    : public BaseModule
69{
70
71public:
72
73    sc_in<bool>                              p_clk;
74    sc_in<bool>                              p_resetn;
75    VciInitiator<vci_param>*                 p_to_tgt;
76    VciTarget<vci_param>*                    p_to_ini;
77
78private:
79
80    typedef IoXbar<VciCmdBuffer<vci_param> > cmd_xbar_t;
81    typedef IoXbar<VciRspBuffer<vci_param> > rsp_xbar_t;
82
83    size_t                                   m_nb_tgt;
84    size_t                                   m_nb_ini;
85
86    VciInitiator<vci_param>**                m_ports_to_target;
87    VciTarget<vci_param>**                   m_ports_to_initiator;
88
89        rsp_xbar_t*                              m_rsp_xbar;  // RSP crossbar
90        cmd_xbar_t*                              m_cmd_xbar;  // CMD crossbar
91
92    AddressDecodingTable<uint64_t,size_t>    m_cmd_rt;    // routing table for CMD
93    AddressDecodingTable<uint64_t,size_t>    m_rsp_rt;    // routing table for RSP
94
95    void transition();
96
97    void genMealy_cmd_val();
98    void genMealy_cmd_ack();
99    void genMealy_rsp_val();
100    void genMealy_rsp_ack();
101
102protected:
103    SC_HAS_PROCESS(VciIoxNetwork);
104
105public:
106    void print_trace();
107
108    VciIoxNetwork( sc_module_name                      name,
109                                   const soclib::common::MappingTable  &mt,
110                   size_t                              cluster_id,
111                                   size_t                              nb_tgt,
112                                   size_t                              nb_ini );
113
114    ~VciIoxNetwork();
115};
116
117}}
118
119#endif
120
121// Local Variables:
122// tab-width: 4
123// c-basic-offset: 4
124// c-file-offsets:((innamespace . 0)(inline-open . 0))
125// indent-tabs-mode: nil
126// End:
127
128// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=4:softtabstop=4
Note: See TracBrowser for help on using the repository browser.