/* -*- c++ -*- * SOCLIB_LGPL_HEADER_BEGIN * * This file is part of SoCLib, GNU LGPLv2.1. * * SoCLib is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation; version 2.1 of the License. * * SoCLib is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with SoCLib; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301 USA * * SOCLIB_LGPL_HEADER_END * * Author : Abdelmalek SI MERABET * Date : March 2010 * Copyright: UPMC - LIP6 */ #ifndef DSPIN_SIMPLE_RING_FAST_C_H_ #define DSPIN_SIMPLE_RING_FAST_C_H_ #include #include "caba_base_module.h" #include "mapping_table.h" #include "address_decoding_table.h" #include "address_masking_table.h" #include "ring_signals_fast.h" #include "dspin_simple_ring_initiator_fast_c.h" #include "dspin_simple_ring_target_fast_c.h" #include "dspin_interface.h" namespace soclib { namespace caba { using namespace sc_core; template class DspinSimpleRingFastC : public soclib::caba::BaseModule { public: sc_in p_clk; sc_in p_resetn; soclib::caba::DspinOutput * p_cmd_out; soclib::caba::DspinInput * p_rsp_in; soclib::caba::DspinInput * p_cmd_in; soclib::caba::DspinOutput * p_rsp_out; protected: SC_HAS_PROCESS(DspinSimpleRingFastC); private: int m_ns; // number of ring signals int m_nai; // number of attached initiators int m_nat; // number of attached targets cmd_str *init_cmd; rsp_str *tgt_rsp; bool *tgt_cmd_val; // valid command received bool *init_rsp_val; // valid response received //-- typedef SimpleRingSignals ring_signal_t; typedef DspinSimpleRingInitiatorFastC ring_initiator_t; typedef DspinSimpleRingTargetFastC ring_target_t; void transition(); void genMoore(); ring_signal_t *m_ring_signal; ring_initiator_t **m_ring_initiator; ring_target_t **m_ring_target; public: DspinSimpleRingFastC( sc_module_name insname, const soclib::common::MappingTable &mt, const soclib::common::IntTab &ringid, const int &wrapper_fifo_depth, int nb_attached_initiator, int nb_attached_target); ~DspinSimpleRingFastC(); void print_trace(); }; }} // end namespace #endif //DSPIN_SIMPLE_RING_FAST_C_H_