source: branches/v5/modules/dspin_simple_ring_fast_c/caba/source/include/dspin_simple_ring_fast_c.h @ 326

Last change on this file since 326 was 326, checked in by simerabe, 11 years ago

introducing 2 new components : simple and local ring interconnect using dspin interface

  • Property svn:executable set to *
File size: 3.5 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 * Author   : Abdelmalek SI MERABET
23 * Date     : March 2010
24 * Copyright: UPMC - LIP6
25 */
26#ifndef DSPIN_SIMPLE_RING_FAST_C_H_
27#define DSPIN_SIMPLE_RING_FAST_C_H_
28
29#include <systemc>
30#include "caba_base_module.h"
31#include "mapping_table.h"
32#include "address_decoding_table.h"
33#include "address_masking_table.h"
34#include "ring_signals_fast.h"
35#include "dspin_simple_ring_initiator_fast_c.h"
36#include "dspin_simple_ring_target_fast_c.h"
37#include "dspin_interface.h"
38
39namespace soclib { namespace caba {
40
41using namespace sc_core;
42
43template<typename vci_param, int ring_cmd_data_size, int ring_rsp_data_size>
44class DspinSimpleRingFastC
45        : public soclib::caba::BaseModule
46{
47
48
49        public:
50                sc_in<bool>             p_clk;
51                sc_in<bool>             p_resetn;
52
53                soclib::caba::DspinOutput<ring_cmd_data_size> * p_cmd_out;
54                soclib::caba::DspinInput<ring_rsp_data_size>  * p_rsp_in;
55                soclib::caba::DspinInput<ring_cmd_data_size>  * p_cmd_in;
56                soclib::caba::DspinOutput<ring_rsp_data_size> * p_rsp_out;               
57               
58        protected:
59                SC_HAS_PROCESS(DspinSimpleRingFastC);
60
61        private:               
62                int m_ns;  // number of ring signals
63                int m_nai; // number of attached initiators
64                int m_nat; // number of attached targets
65
66               
67                cmd_str *init_cmd;
68                rsp_str *tgt_rsp;
69                bool *tgt_cmd_val;  // valid command received
70                bool *init_rsp_val; // valid response received
71               
72//--
73                typedef SimpleRingSignals ring_signal_t;
74                typedef DspinSimpleRingInitiatorFastC<vci_param, ring_cmd_data_size, ring_rsp_data_size> ring_initiator_t;
75                typedef DspinSimpleRingTargetFastC<vci_param, ring_cmd_data_size, ring_rsp_data_size>    ring_target_t;
76
77                void transition();
78                void genMoore();
79
80                ring_signal_t    *m_ring_signal; 
81                ring_initiator_t **m_ring_initiator;
82                ring_target_t    **m_ring_target;
83
84        public:
85
86                DspinSimpleRingFastC(   sc_module_name insname,
87                                        const soclib::common::MappingTable &mt,
88                                        const soclib::common::IntTab &ringid,   
89                                        const int &wrapper_fifo_depth,
90                                        int nb_attached_initiator,
91                                        int nb_attached_target);
92                                                                   
93                ~DspinSimpleRingFastC();
94                void print_trace();
95};
96}} // end namespace
97
98#endif //DSPIN_SIMPLE_RING_FAST_C_H_
Note: See TracBrowser for help on using the repository browser.