source: branches/reconfiguration/modules/dspin_router/caba/test/recovery_bcast_evaluation/synthetic_dspin_network/caba/source/include/synthetic_dspin_network.h @ 1016

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

reconf: dspin_router

  • improve the code readability of the dspin_router model.
  • update the unitary tests of the dspin_router to support the local gateway hardware barrier, and the memory cache scratchpad mode.
File size: 2.8 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 * Authors  : Cesar Armando Fuguet Tortolero
24 * Date     : jul 2015
25 * Copyright: UPMC - LIP6
26 */
27#ifndef SYNTHETIC_DSPIN_NETWORK
28#define SYNTHETIC_DSPIN_NETWORK
29
30#include <systemc>
31#include <stdint.h>
32#include "caba_base_module.h"
33#include "dspin_router.h"
34
35#if UNICAST
36#include "dspin_packet_generator.h"
37#else
38#include "dspin_broadcast_generator.h"
39#endif
40
41namespace soclib {
42namespace caba {
43
44
45class SyntheticDspinNetwork
46    : public soclib::caba::BaseModule
47{
48    static const int X_WIDTH = 4;
49    static const int Y_WIDTH = 4;
50    static const int DSPIN_WIDTH = 39;
51    static const int DSPIN_ROUTER_FIFO_DEPTH = 4;
52    static const int DSPIN_GENERATOR_FIFO_DEPTH = 50;
53
54#if UNICAST
55    typedef DspinPacketGenerator<DSPIN_WIDTH, DSPIN_WIDTH>
56    DspinNetworkGenerator;
57#else
58    typedef DspinBroadcastGenerator<DSPIN_WIDTH, DSPIN_WIDTH>
59    DspinNetworkGenerator;
60#endif
61
62    typedef DspinRouter<DSPIN_WIDTH>
63    DspinNetworkRouter;
64    typedef DspinSignals<DSPIN_WIDTH>
65    DspinNetworkSignal;
66
67
68public:
69
70    sc_core::sc_in<bool> p_clk;
71    sc_core::sc_in<bool> p_resetn;
72
73    SyntheticDspinNetwork(sc_module_name name,
74                          const size_t x_size,
75                          const size_t y_size,
76                          const size_t load);
77
78    ~SyntheticDspinNetwork();
79
80    void reset();
81    void set_faulty_router(const size_t faulty_x, const size_t faulty_y);
82    void print_stats(const size_t x, const size_t y);
83
84
85private:
86
87    const size_t m_x_size;
88    const size_t m_y_size;
89
90    DspinNetworkGenerator **dspinGenerator;
91    DspinNetworkRouter **dspinRouter;
92
93    DspinNetworkSignal ***sL;
94    DspinNetworkSignal ***sH;
95    DspinNetworkSignal ***sV;
96
97    sc_core::sc_signal<uint32_t>** sConfigRouter;
98};                  // end class SyntheticDspinNetwork
99
100
101}                   // end namespace caba
102}                   // end namespace soclib
103
104#endif              // end SYNTHETIC_DSPIN_NETWORK
105
106// Local Variables:
107// tab-width: 4
108// c-basic-offset: 4
109// c-file-offsets:((innamespace . 0)(inline-open . 0))
110// indent-tabs-mode: nil
111// End:
Note: See TracBrowser for help on using the repository browser.