Changeset 549 for trunk/modules/vci_iox_network/caba/source/src
- Timestamp:
- Oct 17, 2013, 8:50:46 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/modules/vci_iox_network/caba/source/src/vci_iox_network.cpp
r471 r549 26 26 */ 27 27 28 //////////////////////////////////////////////////////////////////////////////// 29 // This component emulates an external IO bus such as PCIe or Hypertransport, 30 // but respect the VCI protocol. It can be attached to one OR SEVERAL clusters, 31 // using a vci_io_bridge component. 32 // It is considered as a local interconnect, for the ADDRESS or SRCID 33 // decoding tables: 34 // - the CMD routing_table decodes the local field of the VCI ADDRESS 35 // to return the local target port 36 // - The RSP routing_table decodes the local field of the VCI SRCID 37 // to return the initator port 38 // It is implemented as two independant crossbars, for VCI commands and 39 // VCI responses respectively. 40 // - The CMD crossbar has nb_ini input ports, and nb_tgt output ports, 41 // including the ports to the vci_io_bridge component(s). 42 // - The RSP crossbar has nb_tgt input ports, and nb_ini output ports. 43 // including the ports to the vci_io_bridge component(s). 44 // For both crossbars, output ports allocation policy is round robin. 45 //////////////////////////////////////////////////////////////////////////////// 46 28 47 #include <systemc> 29 48 #include <cassert> … … 50 69 typedef typename pkt_t::output_port_t output_port_t; 51 70 52 const bool 53 const size_t 54 const size_t 55 AddressDecodingTable<uint64_t,size_t>*m_rt; // pointer on routing table (CMD or RSP)56 57 sc_signal<bool>* 58 sc_signal<size_t>* 59 sc_signal<bool>* 60 sc_signal<size_t>* 71 const bool m_is_cmd; // CMD XBAR if true 72 const size_t m_inputs; // number of inputs 73 const size_t m_outputs; // number of outputs 74 void* m_rt; // pointer on routing table (CMD or RSP) 75 76 sc_signal<bool>* r_out_allocated; // for each output: allocation state 77 sc_signal<size_t>* r_out_origin; // for each output: input port index 78 sc_signal<bool>* r_in_allocated; // for each input: allocation state 79 sc_signal<size_t>* r_in_dest; // for each input: output port index 61 80 62 81 public: 63 82 /////////////////////// 64 IoXbar( bool 65 size_t 66 size_t 67 AddressDecodingTable<uint64_t,size_t>* rt )83 IoXbar( bool is_cmd, 84 size_t nb_inputs, 85 size_t nb_outputs, 86 void* rt ) 68 87 : m_is_cmd( is_cmd ), 69 88 m_inputs( nb_inputs ), … … 150 169 if ( m_is_cmd ) 151 170 { 152 req = ((AddressDecodingTable<uint64_t,size_t>*)m_rt)->get_value( 153 (uint64_t)(input_port[in]->address.read()) ); 171 AddressDecodingTable<uint64_t, size_t>* rt = 172 (AddressDecodingTable<uint64_t, size_t>*)m_rt; 173 req = rt->get_value((uint64_t)(input_port[in]->address.read())); 154 174 } 155 175 else 156 176 { 157 req = ((AddressDecodingTable<uint64_t,size_t>*)m_rt)->get_value( 158 (uint64_t)(input_port[in]->rsrcid.read()) ); 177 AddressDecodingTable<uint32_t, size_t>* rt = 178 (AddressDecodingTable<uint32_t, size_t>*)m_rt; 179 req = rt->get_value((uint32_t)(input_port[in]->rsrcid.read())); 159 180 } 160 181 // allocate the output port if requested … … 260 281 tmpl(/**/)::VciIoxNetwork( sc_core::sc_module_name name, 261 282 const soclib::common::MappingTable &mt, 262 size_t cluster_id,263 283 size_t nb_tgt, 264 284 size_t nb_ini ) … … 274 294 m_nb_ini( nb_ini ), 275 295 276 m_cmd_rt( mt.get PortidFromAddress(cluster_id) ),277 m_rsp_rt( mt.get PortidFromSrcid(cluster_id) )296 m_cmd_rt( mt.getLocalIndexFromAddress(0) ), 297 m_rsp_rt( mt.getLocalIndexFromSrcid(0) ) 278 298 { 279 299 std::cout << " Building VciIoxNetwork : " << name << std::endl;
Note: See TracChangeset
for help on using the changeset viewer.