- Timestamp:
- Apr 15, 2015, 4:02:12 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/reconfiguration/modules/dspin_local_crossbar/caba/source/include/dspin_local_crossbar.h
r976 r977 5 5 * 6 6 * SOCLIB_LGPL_HEADER_BEGIN 7 * 7 * 8 8 * This file is part of SoCLib, GNU LGPLv2.1. 9 * 9 * 10 10 * SoCLib is free software; you can redistribute it and/or modify it 11 11 * under the terms of the GNU Lesser General Public License as published 12 12 * by the Free Software Foundation; version 2.1 of the License. 13 * 13 * 14 14 * SoCLib is distributed in the hope that it will be useful, but 15 15 * WITHOUT ANY WARRANTY; without even the implied warranty of 16 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 17 * Lesser General Public License for more details. 18 * 18 * 19 19 * You should have received a copy of the GNU Lesser General Public 20 20 * License along with SoCLib; if not, write to the Free Software 21 21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 22 22 * 02110-1301 USA 23 * 23 * 24 24 * SOCLIB_LGPL_HEADER_END 25 25 * … … 44 44 45 45 template<size_t flit_width> 46 47 48 46 class DspinLocalCrossbar 47 : public soclib::caba::BaseModule 48 { 49 49 // Input Port FSM 50 enum 50 enum 51 51 { 52 52 INFSM_IDLE, … … 57 57 }; 58 58 59 60 59 protected: 60 SC_HAS_PROCESS(DspinLocalCrossbar); 61 61 62 62 public: 63 63 64 65 66 67 DspinInput<flit_width>p_global_in;68 DspinOutput<flit_width>p_global_out;69 DspinInput<flit_width>*p_local_in;70 DspinOutput<flit_width>*p_local_out;64 // ports 65 sc_in<bool> p_clk; 66 sc_in<bool> p_resetn; 67 DspinInput<flit_width> p_global_in; 68 DspinOutput<flit_width> p_global_out; 69 DspinInput<flit_width>* p_local_in; 70 DspinOutput<flit_width>* p_local_out; 71 71 72 72 void print_trace(); 73 73 74 75 DspinLocalCrossbar( sc_module_name name, 74 // constructor / destructor 75 DspinLocalCrossbar( sc_module_name name, 76 76 const MappingTable &mt, 77 77 const size_t x, // cluster x coordinate 78 78 const size_t y, // cluster y coordinate 79 79 const size_t x_width, // x field width 80 const size_t y_width, // y field width 80 const size_t y_width, // y field width 81 81 const size_t l_width, // local field width 82 82 const size_t nb_local_inputs, … … 90 90 ~DspinLocalCrossbar(); 91 91 92 92 private: 93 93 94 94 // define the FIFO flit 95 typedef struct internal_flit_s 95 typedef struct internal_flit_s 96 96 { 97 97 sc_uint<flit_width> data; … … 99 99 } internal_flit_t; 100 100 101 102 sc_signal<bool>*r_alloc_out; // output port allocated103 101 // internal registers 102 sc_signal<bool> *r_alloc_out; // output port allocated 103 sc_signal<size_t> *r_index_out; // owner input port index 104 104 internal_flit_t *r_buf_in; // input port fifo extension 105 105 sc_signal<int> *r_fsm_in; // input port state 106 106 sc_signal<size_t> *r_index_in; // requested output port index 107 107 108 109 110 108 // fifos 109 soclib::caba::GenericFifo<internal_flit_t>* r_fifo_in; 110 soclib::caba::GenericFifo<internal_flit_t>* r_fifo_out; 111 111 112 113 114 115 116 117 118 119 120 121 122 123 112 // structural parameters 113 const size_t m_local_x; 114 const size_t m_local_y; 115 const size_t m_x_width; 116 const size_t m_x_shift; 117 const size_t m_x_mask; 118 const size_t m_y_width; 119 const size_t m_y_shift; 120 const size_t m_y_mask; 121 const size_t m_l_width; 122 const size_t m_l_shift; 123 const size_t m_l_mask; 124 124 const size_t m_local_inputs; 125 125 const size_t m_local_outputs; … … 133 133 AddressDecodingTable<uint32_t, size_t> m_rsp_rt; 134 134 135 // methods 136 137 135 // methods 136 void transition(); 137 void genMoore(); 138 138 size_t route( sc_uint<flit_width> data, size_t index ); 139 139 bool is_broadcast( sc_uint<flit_width> data ); 140 140 }; 141 141 142 142 }} // end namespace 143 143 144 144 #endif // DSPIN_LOCAL_CROSSBAR_H_ 145 145
Note: See TracChangeset
for help on using the changeset viewer.