diff options
author | Gabe Black <gblack@eecs.umich.edu> | 2007-08-18 19:41:08 -0700 |
---|---|---|
committer | Gabe Black <gblack@eecs.umich.edu> | 2007-08-18 19:41:08 -0700 |
commit | a874cb40ab9f22612b0609cbac2c739daebacbd5 (patch) | |
tree | 551e5aadc93be0ba3013e2b33272d08c78da01f9 /src/dev/sinic.cc | |
parent | 4bce50340f8fc1e1e0361cef1971dd127125d5a5 (diff) | |
parent | 464a51e29e858d6dc38847120868b36e97c8bb6d (diff) | |
download | gem5-a874cb40ab9f22612b0609cbac2c739daebacbd5.tar.xz |
Merge with head.
--HG--
extra : convert_revision : 6ce77b5bd4f43ddecd51ea8c66759e4b70d4ad82
Diffstat (limited to 'src/dev/sinic.cc')
-rw-r--r-- | src/dev/sinic.cc | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/src/dev/sinic.cc b/src/dev/sinic.cc index ed5ab428c..7457a2b47 100644 --- a/src/dev/sinic.cc +++ b/src/dev/sinic.cc @@ -73,14 +73,14 @@ const char *TxStateStrings[] = // // Sinic PCI Device // -Base::Base(Params *p) +Base::Base(const Params *p) : PciDev(p), rxEnable(false), txEnable(false), clock(p->clock), intrDelay(p->intr_delay), intrTick(0), cpuIntrEnable(false), cpuPendingIntr(false), intrEvent(0), interface(NULL) { } -Device::Device(Params *p) +Device::Device(const Params *p) : Base(p), rxUnique(0), txUnique(0), virtualRegs(p->virtual_count < 1 ? 1 : p->virtual_count), rxFifo(p->rx_fifo_size), txFifo(p->tx_fifo_size), @@ -89,6 +89,7 @@ Device::Device(Params *p) dmaReadDelay(p->dma_read_delay), dmaReadFactor(p->dma_read_factor), dmaWriteDelay(p->dma_write_delay), dmaWriteFactor(p->dma_write_factor) { + interface = new Interface(name() + ".int0", this); reset(); } @@ -266,6 +267,19 @@ Device::regStats() rxPacketRate = rxPackets / simSeconds; } +EtherInt* +Device::getEthPort(const std::string &if_name, int idx) +{ + if (if_name == "interface") { + if (interface->getPeer()) + panic("interface already connected to\n"); + + return interface; + } + return NULL; +} + + void Device::prepareIO(int cpu, int index) { @@ -1595,21 +1609,6 @@ Device::unserialize(Checkpoint *cp, const std::string §ion) /* namespace Sinic */ } -Sinic::Interface * -SinicIntParams::create() -{ - using namespace Sinic; - - Interface *dev_int = new Interface(name, device); - - if (peer) { - dev_int->setPeer(peer); - peer->setPeer(dev_int); - } - - return dev_int; -} - Sinic::Device * SinicParams::create() { |