[932] | 1 | /* -*- c++ -*- |
---|
| 2 | * |
---|
| 3 | * SOCLIB_LGPL_HEADER_BEGIN |
---|
| 4 | * |
---|
| 5 | * This file is part of SoCLib, GNU LGPLv2.1. |
---|
| 6 | * |
---|
| 7 | * SoCLib is free software; you can redistribute it and/or modify it |
---|
| 8 | * under the terms of the GNU Lesser General Public License as published |
---|
| 9 | * by the Free Software Foundation; version 2.1 of the License. |
---|
| 10 | * |
---|
| 11 | * SoCLib is distributed in the hope that it will be useful, but |
---|
| 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
| 14 | * Lesser General Public License for more details. |
---|
| 15 | * |
---|
| 16 | * You should have received a copy of the GNU Lesser General Public |
---|
| 17 | * License along with SoCLib; if not, write to the Free Software |
---|
| 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
---|
| 19 | * 02110-1301 USA |
---|
| 20 | * |
---|
| 21 | * SOCLIB_LGPL_HEADER_END |
---|
| 22 | * |
---|
| 23 | * Copyright (c) UPMC, Lip6, Asim |
---|
| 24 | * Alain Greiner <alain.greiner@lip6.fr>, 2005 |
---|
| 25 | * Nicolas Pouillon <nipo@ssji.net>, 2008 |
---|
| 26 | * |
---|
| 27 | * Maintainers: alain |
---|
| 28 | */ |
---|
| 29 | |
---|
| 30 | #ifndef SOCLIB_CABA_VCI_LOCAL_CROSSBAR_H_ |
---|
| 31 | #define SOCLIB_CABA_VCI_LOCAL_CROSSBAR_H_ |
---|
| 32 | |
---|
| 33 | #include <systemc> |
---|
| 34 | #include "caba_base_module.h" |
---|
| 35 | #include "vci_initiator.h" |
---|
| 36 | #include "vci_target.h" |
---|
| 37 | #include "vci_buffers.h" |
---|
| 38 | #include "mapping_table.h" |
---|
| 39 | #include "address_decoding_table.h" |
---|
| 40 | |
---|
| 41 | namespace soclib { namespace caba { |
---|
| 42 | |
---|
| 43 | using namespace soclib::common; |
---|
| 44 | |
---|
| 45 | template<typename pkt_t> class SimpleCrossbar; |
---|
| 46 | |
---|
| 47 | //////////////////////////////////// |
---|
| 48 | template<typename vci_param> |
---|
| 49 | class VciLocalCrossbar |
---|
| 50 | //////////////////////////////////// |
---|
| 51 | : public BaseModule |
---|
| 52 | { |
---|
| 53 | public: |
---|
| 54 | |
---|
| 55 | sc_in<bool> p_clk; |
---|
| 56 | sc_in<bool> p_resetn; |
---|
| 57 | |
---|
[1001] | 58 | sc_in<uint32_t> *p_barrier_enable; |
---|
| 59 | |
---|
[932] | 60 | VciInitiator<vci_param> *p_to_target; |
---|
| 61 | VciTarget<vci_param> *p_to_initiator; |
---|
| 62 | VciTarget<vci_param> p_target_to_up; |
---|
| 63 | VciInitiator<vci_param> p_initiator_to_up; |
---|
| 64 | |
---|
| 65 | private: |
---|
| 66 | |
---|
| 67 | size_t m_nb_attached_initiators; |
---|
| 68 | size_t m_nb_attached_targets; |
---|
| 69 | |
---|
| 70 | AddressDecodingTable<uint64_t, size_t> m_cmd_rt; // command routing table |
---|
| 71 | AddressDecodingTable<uint64_t, bool> m_cmd_lt; // command locality table |
---|
| 72 | |
---|
| 73 | AddressDecodingTable<uint32_t, size_t> m_rsp_rt; // response routing table |
---|
| 74 | AddressDecodingTable<uint32_t, bool> m_rsp_lt; // response locality table |
---|
| 75 | |
---|
| 76 | VciInitiator<vci_param> **m_ports_to_target; |
---|
| 77 | VciTarget<vci_param> **m_ports_to_initiator; |
---|
| 78 | |
---|
| 79 | SimpleCrossbar<VciCmdBuffer<vci_param> > *m_cmd_crossbar; |
---|
| 80 | SimpleCrossbar<VciRspBuffer<vci_param> > *m_rsp_crossbar; |
---|
| 81 | |
---|
| 82 | void transition(); |
---|
| 83 | void genMealy(); |
---|
| 84 | |
---|
| 85 | protected: |
---|
| 86 | SC_HAS_PROCESS(VciLocalCrossbar); |
---|
| 87 | |
---|
| 88 | public: |
---|
| 89 | void print_trace(); |
---|
| 90 | |
---|
| 91 | VciLocalCrossbar( sc_core::sc_module_name name, |
---|
| 92 | const soclib::common::MappingTable &mt, |
---|
| 93 | const size_t cluster_id, |
---|
| 94 | const size_t nb_attached_initiators, |
---|
| 95 | const size_t nb_attached_targets, |
---|
[1001] | 96 | const size_t default_target_id, |
---|
| 97 | const bool hardware_barrier = false ); |
---|
[932] | 98 | ~VciLocalCrossbar(); |
---|
| 99 | }; |
---|
| 100 | |
---|
| 101 | }} |
---|
| 102 | |
---|
| 103 | #endif /* SOCLIB_CABA_VCI_LOCAL_CROSSBAR_H_ */ |
---|
| 104 | |
---|
| 105 | // Local Variables: |
---|
| 106 | // tab-width: 4 |
---|
| 107 | // c-basic-offset: 4 |
---|
| 108 | // c-file-offsets:((innamespace . 0)(inline-open . 0)) |
---|
| 109 | // indent-tabs-mode: nil |
---|
| 110 | // End: |
---|
| 111 | |
---|
| 112 | // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=4:softtabstop=4 |
---|