1/* 2 * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 55 unchanged lines hidden (view full) --- 64 BasicRouter::init(); 65 m_perfect_switch->init(m_network_ptr); 66} 67 68void 69Switch::addInPort(const vector<MessageBuffer*>& in) 70{ 71 m_perfect_switch->addInPort(in); |
72} 73 74void 75Switch::addOutPort(const vector<MessageBuffer*>& out, 76 const NetDest& routing_table_entry, 77 Cycles link_latency, int bw_multiplier) 78{ 79 // Create a throttle --- 4 unchanged lines hidden (view full) --- 84 this); 85 86 m_throttles.push_back(throttle_ptr); 87 88 // Create one buffer per vnet (these are intermediaryQueues) 89 vector<MessageBuffer*> intermediateBuffers; 90 91 for (int i = 0; i < out.size(); ++i) { |
92 assert(m_num_connected_buffers < m_port_buffers.size()); 93 MessageBuffer* buffer_ptr = m_port_buffers[m_num_connected_buffers]; 94 m_num_connected_buffers++; 95 intermediateBuffers.push_back(buffer_ptr); |
96 } 97 98 // Hook the queues to the PerfectSwitch 99 m_perfect_switch->addOutPort(intermediateBuffers, routing_table_entry); 100 101 // Hook the queues to the Throttle 102 throttle_ptr->addLinks(intermediateBuffers, out); 103} --- 95 unchanged lines hidden --- |