summaryrefslogtreecommitdiff
path: root/src/dev/sinic.cc
diff options
context:
space:
mode:
authorAli Saidi <saidi@eecs.umich.edu>2007-08-16 16:49:02 -0400
committerAli Saidi <saidi@eecs.umich.edu>2007-08-16 16:49:02 -0400
commit773cb77656174b221c1e51b92a8af7d8e268b733 (patch)
treec6358a24188fde67e0d0a2816f6b9e2b55d8c535 /src/dev/sinic.cc
parenta9e4daf574e265e419a0a4a6bcbd03edf3a3299f (diff)
downloadgem5-773cb77656174b221c1e51b92a8af7d8e268b733.tar.xz
Devices: Make EtherInts connect in the same way memory ports currently do.
--HG-- extra : convert_revision : 765b096785a77df9adc4791c9101b90696bd7be2
Diffstat (limited to 'src/dev/sinic.cc')
-rw-r--r--src/dev/sinic.cc33
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 &section)
/* 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()
{