bridge.cc (4885:385a051ad874) bridge.cc (4918:3214e3694fb2)
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

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

34 * @file
35 * Definition of a simple bus bridge without buffering.
36 */
37
38#include <algorithm>
39
40#include "base/trace.hh"
41#include "mem/bridge.hh"
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

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

34 * @file
35 * Definition of a simple bus bridge without buffering.
36 */
37
38#include <algorithm>
39
40#include "base/trace.hh"
41#include "mem/bridge.hh"
42#include "sim/builder.hh"
42#include "params/Bridge.hh"
43
44Bridge::BridgePort::BridgePort(const std::string &_name,
45 Bridge *_bridge, BridgePort *_otherPort,
46 int _delay, int _nack_delay, int _req_limit,
47 int _resp_limit, bool fix_partial_write)
48 : Port(_name), bridge(_bridge), otherPort(_otherPort),
49 delay(_delay), nackDelay(_nack_delay), fixPartialWrite(fix_partial_write),
50 outstandingResponses(0), queuedRequests(0), inRetry(false),

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

354Bridge::BridgePort::getDeviceAddressRanges(AddrRangeList &resp,
355 bool &snoop)
356{
357 otherPort->getPeerAddressRanges(resp, snoop);
358 // we don't allow snooping across bridges
359 snoop = false;
360}
361
43
44Bridge::BridgePort::BridgePort(const std::string &_name,
45 Bridge *_bridge, BridgePort *_otherPort,
46 int _delay, int _nack_delay, int _req_limit,
47 int _resp_limit, bool fix_partial_write)
48 : Port(_name), bridge(_bridge), otherPort(_otherPort),
49 delay(_delay), nackDelay(_nack_delay), fixPartialWrite(fix_partial_write),
50 outstandingResponses(0), queuedRequests(0), inRetry(false),

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

354Bridge::BridgePort::getDeviceAddressRanges(AddrRangeList &resp,
355 bool &snoop)
356{
357 otherPort->getPeerAddressRanges(resp, snoop);
358 // we don't allow snooping across bridges
359 snoop = false;
360}
361
362BEGIN_DECLARE_SIM_OBJECT_PARAMS(Bridge)
363
364 Param<int> req_size_a;
365 Param<int> req_size_b;
366 Param<int> resp_size_a;
367 Param<int> resp_size_b;
368 Param<Tick> delay;
369 Param<Tick> nack_delay;
370 Param<bool> write_ack;
371 Param<bool> fix_partial_write_a;
372 Param<bool> fix_partial_write_b;
373
374END_DECLARE_SIM_OBJECT_PARAMS(Bridge)
375
376BEGIN_INIT_SIM_OBJECT_PARAMS(Bridge)
377
378 INIT_PARAM(req_size_a, "The size of the queue for requests coming into side a"),
379 INIT_PARAM(req_size_b, "The size of the queue for requests coming into side b"),
380 INIT_PARAM(resp_size_a, "The size of the queue for responses coming into side a"),
381 INIT_PARAM(resp_size_b, "The size of the queue for responses coming into side b"),
382 INIT_PARAM(delay, "The miminum delay to cross this bridge"),
383 INIT_PARAM(nack_delay, "The minimum delay to nack a packet"),
384 INIT_PARAM(write_ack, "Acknowledge any writes that are received."),
385 INIT_PARAM(fix_partial_write_a, "Fixup any partial block writes that are received"),
386 INIT_PARAM(fix_partial_write_b, "Fixup any partial block writes that are received")
387
388END_INIT_SIM_OBJECT_PARAMS(Bridge)
389
390CREATE_SIM_OBJECT(Bridge)
362Bridge *
363BridgeParams::create()
391{
364{
392 Bridge::Params *p = new Bridge::Params;
393 p->name = getInstanceName();
394 p->req_size_a = req_size_a;
395 p->req_size_b = req_size_b;
396 p->resp_size_a = resp_size_a;
397 p->resp_size_b = resp_size_b;
398 p->delay = delay;
399 p->nack_delay = nack_delay;
400 p->write_ack = write_ack;
401 p->fix_partial_write_a = fix_partial_write_a;
402 p->fix_partial_write_b = fix_partial_write_b;
403 return new Bridge(p);
365 return new Bridge(this);
404}
366}
405
406REGISTER_SIM_OBJECT("Bridge", Bridge)
407
408