1 2/* 3 * Copyright (c) 2006 The Regents of The University of Michigan 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions are 8 * met: redistributions of source code must retain the above copyright --- 23 unchanged lines hidden (view full) --- 32 33/** 34 * @file 35 * Definition of a simple bus bridge without buffering. 36 */ 37 38#include <algorithm> 39 |
40#include "base/range_ops.hh" |
41#include "base/trace.hh" 42#include "mem/bridge.hh" 43#include "params/Bridge.hh" 44 45Bridge::BridgePort::BridgePort(const std::string &_name, 46 Bridge *_bridge, BridgePort *_otherPort, 47 int _delay, int _nack_delay, int _req_limit, |
48 int _resp_limit, 49 std::vector<Range<Addr> > filter_ranges) |
50 : Port(_name), bridge(_bridge), otherPort(_otherPort), |
51 delay(_delay), nackDelay(_nack_delay), filterRanges(filter_ranges), |
52 outstandingResponses(0), queuedRequests(0), inRetry(false), 53 reqQueueLimit(_req_limit), respQueueLimit(_resp_limit), sendEvent(this) 54{ 55} 56 57Bridge::Bridge(Params *p) 58 : MemObject(p->name), 59 portA(p->name + "-portA", this, &portB, p->delay, p->nack_delay, |
60 p->req_size_a, p->resp_size_a, p->filter_ranges_a), |
61 portB(p->name + "-portB", this, &portA, p->delay, p->nack_delay, |
62 p->req_size_b, p->resp_size_b, p->filter_ranges_b), |
63 ackWrites(p->write_ack), _params(p) 64{ 65 if (ackWrites) 66 panic("No support for acknowledging writes\n"); 67} 68 69Port * 70Bridge::getPort(const std::string &if_name, int idx) --- 169 unchanged lines hidden (view full) --- 240 assert(!sendQueue.empty()); 241 242 PacketBuffer *buf = sendQueue.front(); 243 244 assert(buf->ready <= curTick); 245 246 PacketPtr pkt = buf->pkt; 247 |
248 DPRINTF(BusBridge, "trySend: origSrc %d dest %d addr 0x%x\n", 249 buf->origSrc, pkt->getDest(), pkt->getAddr()); 250 251 bool wasReq = pkt->isRequest(); 252 bool wasNacked = pkt->wasNacked(); 253 254 if (sendTiming(pkt)) { 255 // send successful --- 43 unchanged lines hidden (view full) --- 299 sendEvent.schedule(nextReady); 300} 301 302/** Function called by the port when the bus is receiving a Atomic 303 * transaction.*/ 304Tick 305Bridge::BridgePort::recvAtomic(PacketPtr pkt) 306{ |
307 return delay + otherPort->sendAtomic(pkt); 308} 309 310/** Function called by the port when the bus is receiving a Functional 311 * transaction.*/ 312void 313Bridge::BridgePort::recvFunctional(PacketPtr pkt) 314{ --- 15 unchanged lines hidden (view full) --- 330 otherPort->sendStatusChange(status); 331} 332 333void 334Bridge::BridgePort::getDeviceAddressRanges(AddrRangeList &resp, 335 bool &snoop) 336{ 337 otherPort->getPeerAddressRanges(resp, snoop); |
338 FilterRangeList(filterRanges, resp); |
339 // we don't allow snooping across bridges 340 snoop = false; 341} 342 343Bridge * 344BridgeParams::create() 345{ 346 return new Bridge(this); 347} |