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 VCI_SIMPLE_RING_H_ |
---|
27 | #define VCI_SIMPLE_RING_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_2.h" |
---|
35 | #include "vci_ring_initiator.h" |
---|
36 | #include "vci_ring_target.h" |
---|
37 | |
---|
38 | namespace soclib { namespace caba { |
---|
39 | |
---|
40 | using namespace sc_core; |
---|
41 | |
---|
42 | template<typename vci_param, int ring_cmd_data_size, int ring_rsp_data_size> |
---|
43 | class VciSimpleRingNetwork2 |
---|
44 | : public soclib::caba::BaseModule |
---|
45 | { |
---|
46 | public: |
---|
47 | sc_in<bool> p_clk; |
---|
48 | sc_in<bool> p_resetn; |
---|
49 | |
---|
50 | soclib::caba::VciInitiator<vci_param> * p_to_target; |
---|
51 | soclib::caba::VciTarget<vci_param> * p_to_initiator; |
---|
52 | |
---|
53 | protected: |
---|
54 | SC_HAS_PROCESS(VciSimpleRingNetwork2); |
---|
55 | |
---|
56 | private: |
---|
57 | size_t m_ns; // number of ring signals |
---|
58 | size_t m_nai; // number of attached initiators |
---|
59 | size_t m_nat; // number of attached targets |
---|
60 | |
---|
61 | typedef RingSignals2 ring_signal_t; |
---|
62 | typedef VciRingInitiator<vci_param, ring_cmd_data_size, ring_rsp_data_size> ring_initiator_t; |
---|
63 | typedef VciRingTarget<vci_param, ring_cmd_data_size, ring_rsp_data_size> ring_target_t; |
---|
64 | |
---|
65 | void print_signal(size_t i); |
---|
66 | void print_vci_init(size_t i); |
---|
67 | void print_vci_target(size_t i); |
---|
68 | void transition(); |
---|
69 | void genMoore(); |
---|
70 | |
---|
71 | ring_signal_t *m_ring_signal; |
---|
72 | ring_initiator_t **m_ring_initiator; |
---|
73 | ring_target_t **m_ring_target; |
---|
74 | |
---|
75 | public: |
---|
76 | VciSimpleRingNetwork2( sc_module_name insname, |
---|
77 | const soclib::common::MappingTable &mt, |
---|
78 | const soclib::common::IntTab &ringid, |
---|
79 | const int &wrapper_fifo_depth, |
---|
80 | size_t nb_attached_initiator, |
---|
81 | size_t nb_attached_target); |
---|
82 | |
---|
83 | ~VciSimpleRingNetwork2(); |
---|
84 | }; |
---|
85 | }} // end namespace |
---|
86 | |
---|
87 | #endif //VCI_SIMPLE_RING_H_ |
---|