source: trunk/modules/vci_local_ring_network_2/caba/source/include/vci_local_ring_network_2.h @ 8

Last change on this file since 8 was 8, checked in by simerabe, 14 years ago

new ring components for systemcass

  • Property svn:executable set to *
File size: 3.7 KB
Line 
1/* -*- c++ -*-
2 * SOCLIB_LGPL_HEADER_BEGIN
3 *
4 * This file is part of SoCLib, GNU LGPLv2.1.
5 *
6 * SoCLib is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU Lesser General Public License as published
8 * by the Free Software Foundation; version 2.1 of the License.
9 *
10 * SoCLib is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with SoCLib; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 * 02110-1301 USA
19 *
20 * SOCLIB_LGPL_HEADER_END
21 *
22 * Authors  : Abdelmalek SI MERABET
23 * Date     : March 2010
24 * Copyright: UPMC - LIP6
25 */
26#ifndef VCI_LOCAL_RING_H_
27#define VCI_LOCAL_RING_H_
28
29#include <systemc>
30#include "caba_base_module.h"
31#include "mapping_table.h"
32#include "generic_fifo.h"
33#include "address_decoding_table.h"
34#include "address_masking_table.h"
35#include "ring_signals_2.h"
36#include "vci_ring_initiator.h"
37#include "vci_ring_target.h"
38#include "half_gateway_initiator_2.h"
39#include "half_gateway_target_2.h"
40
41
42namespace soclib { namespace caba {
43
44    using namespace sc_core;
45
46    template<typename vci_param, int ring_cmd_data_size, int ring_rsp_data_size>
47        class VciLocalRingNetwork2
48        : public soclib::caba::BaseModule
49        {
50            public:
51                sc_in<bool>             p_clk;
52                sc_in<bool>             p_resetn;
53
54                soclib::caba::VciInitiator<vci_param>* p_to_target;
55                soclib::caba::VciTarget<vci_param>   * p_to_initiator;
56
57                // Gate interface
58                soclib::caba::GateInitiator2<ring_cmd_data_size, ring_rsp_data_size> p_gate_initiator;
59                soclib::caba::GateTarget2<ring_cmd_data_size, ring_rsp_data_size>    p_gate_target;
60               
61        protected:
62                SC_HAS_PROCESS(VciLocalRingNetwork2);
63
64        private:               
65                int m_ns;   // network number of signals
66                int m_nai; // number of attached initiators
67                int m_nat; // number of attached targets
68                                         
69                typedef RingSignals2 ring_signal_t;
70                typedef VciRingInitiator<vci_param, ring_cmd_data_size, ring_rsp_data_size> ring_initiator_t;
71                typedef VciRingTarget<vci_param, ring_cmd_data_size, ring_rsp_data_size>    ring_target_t;
72                typedef HalfGatewayInitiator2<vci_param, ring_cmd_data_size, ring_rsp_data_size> half_gateway_initiator_t;
73                typedef HalfGatewayTarget2<vci_param, ring_cmd_data_size, ring_rsp_data_size> half_gateway_target_t;
74 
75                void transition();
76                void genMoore(); 
77     
78                ring_signal_t    *m_ring_signal; 
79                ring_initiator_t **m_ring_initiator;
80                ring_target_t    **m_ring_target;
81               
82                half_gateway_initiator_t *m_half_gateway_initiator;
83                half_gateway_target_t    *m_half_gateway_target;
84
85        public:
86                VciLocalRingNetwork2( sc_module_name insname,
87                         const soclib::common::MappingTable &mt,
88                         const soclib::common::IntTab &ringid,   
89                         const int &wrapper_fifo_depth,
90                         const int &half_gateway_fifo_depth,
91                         int nb_attached_initiator,
92                         int nb_attached_target);
93                                                                   
94               ~VciLocalRingNetwork2();
95        };
96}} // end namespace
97
98#endif //VCI_LOCAL_RING_H_
Note: See TracBrowser for help on using the repository browser.