[326] | 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 : Februrary 2013 |
---|
| 24 | * Copyright: UPMC - LIP6 |
---|
| 25 | */ |
---|
| 26 | #ifndef DSPIN_LOCAL_RING_FAST_H_ |
---|
| 27 | #define DSPIN_LOCAL_RING_FAST_H_ |
---|
| 28 | |
---|
| 29 | #define DSPIN_LOCAL_RING_FAST_STAT |
---|
| 30 | |
---|
| 31 | #include <systemc> |
---|
| 32 | #include "caba_base_module.h" |
---|
| 33 | #include "mapping_table.h" |
---|
| 34 | #include "generic_fifo.h" |
---|
| 35 | #include "address_decoding_table.h" |
---|
| 36 | #include "address_masking_table.h" |
---|
| 37 | #include "ring_signals_fast.h" |
---|
| 38 | #include "dspin_local_ring_initiator_fast_c.h" |
---|
| 39 | #include "dspin_local_ring_target_fast_c.h" |
---|
| 40 | #include "dspin_half_gateway_initiator_fast_c.h" |
---|
| 41 | #include "dspin_half_gateway_target_fast_c.h" |
---|
| 42 | #include "dspin_interface.h" |
---|
| 43 | |
---|
| 44 | namespace soclib { namespace caba { |
---|
| 45 | |
---|
| 46 | using namespace sc_core; |
---|
| 47 | |
---|
| 48 | |
---|
| 49 | template<typename vci_param, int ring_cmd_data_size, int ring_rsp_data_size> |
---|
| 50 | class DspinLocalRingFastC |
---|
| 51 | : public soclib::caba::BaseModule |
---|
| 52 | { |
---|
| 53 | public: |
---|
| 54 | sc_in<bool> p_clk; |
---|
| 55 | sc_in<bool> p_resetn; |
---|
| 56 | |
---|
| 57 | soclib::caba::DspinOutput<ring_cmd_data_size> * p_cmd_out; |
---|
| 58 | soclib::caba::DspinInput<ring_rsp_data_size> * p_rsp_in; |
---|
| 59 | soclib::caba::DspinInput<ring_cmd_data_size> * p_cmd_in; |
---|
| 60 | soclib::caba::DspinOutput<ring_rsp_data_size> * p_rsp_out; |
---|
| 61 | |
---|
| 62 | protected: |
---|
| 63 | SC_HAS_PROCESS(DspinLocalRingFastC); |
---|
| 64 | |
---|
| 65 | private: |
---|
| 66 | int m_ns; // network number of signals |
---|
| 67 | int m_nai; // number of attached initiators |
---|
| 68 | int m_nat; // number of attached targets |
---|
| 69 | |
---|
| 70 | bool tga; // target gate allocated |
---|
| 71 | bool iga; // initiator gate allocated |
---|
| 72 | |
---|
| 73 | cmd_str *init_cmd; |
---|
| 74 | rsp_str *tgt_rsp; |
---|
| 75 | bool *tgt_cmd_val; |
---|
| 76 | bool *init_rsp_val; |
---|
| 77 | //-- |
---|
| 78 | typedef LocalRingSignals ring_signal_t; |
---|
| 79 | typedef DspinLocalRingInitiatorFastC<vci_param, ring_cmd_data_size, ring_rsp_data_size> ring_initiator_t; |
---|
| 80 | typedef DspinLocalRingTargetFastC<vci_param, ring_cmd_data_size, ring_rsp_data_size> ring_target_t; |
---|
| 81 | typedef DspinHalfGatewayInitiatorFastC<vci_param, ring_cmd_data_size, ring_rsp_data_size> half_gateway_initiator_t; |
---|
| 82 | typedef DspinHalfGatewayTargetFastC<vci_param, ring_cmd_data_size, ring_rsp_data_size> half_gateway_target_t; |
---|
| 83 | |
---|
| 84 | void transition(); |
---|
| 85 | void genMoore(); |
---|
| 86 | |
---|
| 87 | ring_signal_t *m_ring_signal; |
---|
| 88 | ring_initiator_t **m_ring_initiator; |
---|
| 89 | ring_target_t **m_ring_target; |
---|
| 90 | |
---|
| 91 | half_gateway_initiator_t *m_half_gateway_initiator; |
---|
| 92 | half_gateway_target_t *m_half_gateway_target; |
---|
| 93 | |
---|
| 94 | public: |
---|
| 95 | DspinLocalRingFastC( sc_module_name insname, |
---|
| 96 | const soclib::common::MappingTable &mt, |
---|
| 97 | const soclib::common::IntTab &ringid, |
---|
| 98 | const int &wrapper_fifo_depth, |
---|
| 99 | const int &half_gateway_fifo_depth, |
---|
| 100 | int nb_attached_initiator, |
---|
| 101 | int nb_attached_target, |
---|
| 102 | const int x_width, |
---|
| 103 | const int y_width); |
---|
| 104 | |
---|
| 105 | ~DspinLocalRingFastC(); |
---|
| 106 | void print_trace(); |
---|
| 107 | #ifdef DSPIN_LOCAL_RING_FAST_STAT |
---|
| 108 | void print_stats(uint32_t local = 0); |
---|
| 109 | #endif |
---|
| 110 | }; |
---|
| 111 | }} // end namespace |
---|
| 112 | |
---|
| 113 | #endif //DSPIN_LOCAL_RING_FAST_H_ |
---|