Switch.cc (9274:ba635023d4bb) Switch.cc (9302:c2e70a9bc340)
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;

--- 203 unchanged lines hidden (view full) ---

212}
213
214void
215Switch::print(std::ostream& out) const
216{
217 // FIXME printing
218 out << "[Switch]";
219}
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;

--- 203 unchanged lines hidden (view full) ---

212}
213
214void
215Switch::print(std::ostream& out) const
216{
217 // FIXME printing
218 out << "[Switch]";
219}
220bool
221Switch::functionalRead(Packet *pkt)
222{
223 // Access the buffers in the switch for performing a functional read
224 for (unsigned int i = 0; i < m_buffers_to_free.size(); ++i) {
225 if (m_buffers_to_free[i]->functionalRead(pkt)) {
226 return true;
227 }
228 }
229 return false;
230}
220
231
232uint32_t
233Switch::functionalWrite(Packet *pkt)
234{
235 // Access the buffers in the switch for performing a functional write
236 uint32_t num_functional_writes = 0;
237 for (unsigned int i = 0; i < m_buffers_to_free.size(); ++i) {
238 num_functional_writes += m_buffers_to_free[i]->functionalWrite(pkt);
239 }
240 return num_functional_writes;
241}
242
221Switch *
222SwitchParams::create()
223{
224 return new Switch(this);
225}
243Switch *
244SwitchParams::create()
245{
246 return new Switch(this);
247}