Merge zizzer:/bk/newmem

into  zeep.pool:/z/saidi/work/m5.newmem

--HG--
extra : convert_revision : 32dc1bec7fdb1ecb8879ed2dd745c4b23929aeab
This commit is contained in:
Ali Saidi 2007-05-15 18:06:52 -04:00
commit f487edf146
6 changed files with 29 additions and 83 deletions

View file

@ -23,7 +23,7 @@ netcat -c -l -p 8000
BINARY=/benchmarks/netperf-bin/netperf BINARY=/benchmarks/netperf-bin/netperf
TEST="UDP_STREAM" TEST="UDP_STREAM"
SHORT_ARGS="-l 2 -- -m 4096" SHORT_ARGS="-l 2 -- -m 16384 -M 16384 -s 262144 -S 262144"
#LONG_ARGS="-k16384,0 -K16384,0 -- -m 65536 -M 65536 -s 262144 -S 262144" #LONG_ARGS="-k16384,0 -K16384,0 -- -m 65536 -M 65536 -s 262144 -S 262144"

View file

@ -1,4 +1,4 @@
# Copyright (c) 2006 The Regents of The University of Michigan # Copyright (c) 2006-2007 The Regents of The University of Michigan
# All rights reserved. # All rights reserved.
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
@ -31,6 +31,7 @@ parser.add_option("-d", "--detailed", action="store_true")
parser.add_option("-t", "--timing", action="store_true") parser.add_option("-t", "--timing", action="store_true")
parser.add_option("-n", "--num_cpus", type="int", default=1) parser.add_option("-n", "--num_cpus", type="int", default=1)
parser.add_option("--caches", action="store_true") parser.add_option("--caches", action="store_true")
parser.add_option("--l2cache", action="store_true")
# Run duration options # Run duration options
parser.add_option("-m", "--maxtick", type="int") parser.add_option("-m", "--maxtick", type="int")

View file

@ -51,7 +51,6 @@ parser.add_option("--kernel", action="store", type="string")
parser.add_option("--script", action="store", type="string") parser.add_option("--script", action="store", type="string")
# Benchmark options # Benchmark options
parser.add_option("--l2cache", action="store_true")
parser.add_option("--dual", action="store_true", parser.add_option("--dual", action="store_true",
help="Simulate two systems attached with an ethernet link") help="Simulate two systems attached with an ethernet link")
parser.add_option("-b", "--benchmark", action="store", type="string", parser.add_option("-b", "--benchmark", action="store", type="string",

View file

@ -1,4 +1,4 @@
# Copyright (c) 2006 The Regents of The University of Michigan # Copyright (c) 2006-2007 The Regents of The University of Michigan
# All rights reserved. # All rights reserved.
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
@ -104,6 +104,13 @@ for i in xrange(np):
if options.caches: if options.caches:
system.cpu[i].addPrivateSplitL1Caches(L1Cache(size = '32kB'), system.cpu[i].addPrivateSplitL1Caches(L1Cache(size = '32kB'),
L1Cache(size = '64kB')) L1Cache(size = '64kB'))
if options.l2cache:
system.l2 = L2Cache(size='2MB')
system.tol2bus = Bus()
system.l2.cpu_side = system.tol2bus.port
system.l2.mem_side = system.membus.port
system.cpu[i].connectMemPorts(system.tol2bus)
else:
system.cpu[i].connectMemPorts(system.membus) system.cpu[i].connectMemPorts(system.membus)
system.cpu[i].workload = process system.cpu[i].workload = process

View file

@ -247,8 +247,6 @@ Bridge::BridgePort::trySend()
{ {
assert(!sendQueue.empty()); assert(!sendQueue.empty());
int pbs = peerBlockSize();
PacketBuffer *buf = sendQueue.front(); PacketBuffer *buf = sendQueue.front();
assert(buf->ready <= curTick); assert(buf->ready <= curTick);
@ -257,11 +255,15 @@ Bridge::BridgePort::trySend()
pkt->flags &= ~SNOOP_COMMIT; //CLear it if it was set pkt->flags &= ~SNOOP_COMMIT; //CLear it if it was set
// Ugly! @todo When multilevel coherence works this will be removed
if (pkt->cmd == MemCmd::WriteInvalidateReq && fixPartialWrite && if (pkt->cmd == MemCmd::WriteInvalidateReq && fixPartialWrite &&
pkt->result != Packet::Nacked && pkt->getOffset(pbs) && pkt->result != Packet::Nacked) {
pkt->getSize() != pbs) { PacketPtr funcPkt = new Packet(pkt->req, MemCmd::WriteReq,
buf->partialWriteFix(this); Packet::Broadcast);
pkt = buf->pkt; funcPkt->dataStatic(pkt->getPtr<uint8_t>());
sendFunctional(funcPkt);
pkt->cmd = MemCmd::WriteReq;
delete funcPkt;
} }
DPRINTF(BusBridge, "trySend: origSrc %d dest %d addr 0x%x\n", DPRINTF(BusBridge, "trySend: origSrc %d dest %d addr 0x%x\n",
@ -300,7 +302,6 @@ Bridge::BridgePort::trySend()
} }
} else { } else {
DPRINTF(BusBridge, " unsuccessful\n"); DPRINTF(BusBridge, " unsuccessful\n");
buf->undoPartialWriteFix();
inRetry = true; inRetry = true;
} }
DPRINTF(BusBridge, "trySend: queue size: %d outreq: %d outstanding resp: %d\n", DPRINTF(BusBridge, "trySend: queue size: %d outreq: %d outstanding resp: %d\n",
@ -324,32 +325,18 @@ Bridge::BridgePort::recvRetry()
Tick Tick
Bridge::BridgePort::recvAtomic(PacketPtr pkt) Bridge::BridgePort::recvAtomic(PacketPtr pkt)
{ {
int pbs = otherPort->peerBlockSize();
Tick atomic_delay;
// fix partial atomic writes... similar to the timing code that does the // fix partial atomic writes... similar to the timing code that does the
// same // same... will be removed once our code gets this right
if (pkt->cmd == MemCmd::WriteInvalidateReq && fixPartialWrite && if (pkt->cmd == MemCmd::WriteInvalidateReq && fixPartialWrite) {
pkt->getOffset(pbs) && pkt->getSize() != pbs) {
PacketDataPtr data;
data = new uint8_t[pbs];
PacketPtr funcPkt = new Packet(pkt->req, MemCmd::ReadReq,
Packet::Broadcast, pbs);
funcPkt->dataStatic(data); PacketPtr funcPkt = new Packet(pkt->req, MemCmd::WriteReq,
Packet::Broadcast);
funcPkt->dataStatic(pkt->getPtr<uint8_t>());
otherPort->sendFunctional(funcPkt); otherPort->sendFunctional(funcPkt);
assert(funcPkt->result == Packet::Success);
delete funcPkt; delete funcPkt;
memcpy(data + pkt->getOffset(pbs), pkt->getPtr<uint8_t>(), pkt->cmd = MemCmd::WriteReq;
pkt->getSize());
PacketPtr newPkt = new Packet(pkt->req, MemCmd::WriteInvalidateReq,
Packet::Broadcast, pbs);
pkt->dataDynamicArray(data);
atomic_delay = otherPort->sendAtomic(newPkt);
delete newPkt;
} else {
atomic_delay = otherPort->sendAtomic(pkt);
} }
return atomic_delay + delay; return delay + otherPort->sendAtomic(pkt);
} }
/** Function called by the port when the bus is receiving a Functional /** Function called by the port when the bus is receiving a Functional
@ -431,3 +418,4 @@ CREATE_SIM_OBJECT(Bridge)
REGISTER_SIM_OBJECT("Bridge", Bridge) REGISTER_SIM_OBJECT("Bridge", Bridge)

View file

@ -80,14 +80,10 @@ class Bridge : public MemObject
short origSrc; short origSrc;
bool expectResponse; bool expectResponse;
bool partialWriteFixed;
PacketPtr oldPkt;
PacketBuffer(PacketPtr _pkt, Tick t, bool nack = false) PacketBuffer(PacketPtr _pkt, Tick t, bool nack = false)
: ready(t), pkt(_pkt), : ready(t), pkt(_pkt),
origSenderState(_pkt->senderState), origSrc(_pkt->getSrc()), origSenderState(_pkt->senderState), origSrc(_pkt->getSrc()),
expectResponse(_pkt->needsResponse() && !nack), expectResponse(_pkt->needsResponse() && !nack)
partialWriteFixed(false)
{ {
if (!pkt->isResponse() && !nack && pkt->result != Packet::Nacked) if (!pkt->isResponse() && !nack && pkt->result != Packet::Nacked)
@ -99,52 +95,7 @@ class Bridge : public MemObject
assert(pkt->senderState == this); assert(pkt->senderState == this);
pkt->setDest(origSrc); pkt->setDest(origSrc);
pkt->senderState = origSenderState; pkt->senderState = origSenderState;
if (partialWriteFixed)
delete oldPkt;
} }
void partialWriteFix(Port *port)
{
assert(!partialWriteFixed);
assert(expectResponse);
Addr pbs = port->peerBlockSize();
Addr blockAddr = pkt->getAddr() & ~(pbs-1);
partialWriteFixed = true;
PacketDataPtr data;
data = new uint8_t[pbs];
RequestPtr funcReq = new Request(blockAddr, 4, 0);
PacketPtr funcPkt = new Packet(funcReq, MemCmd::ReadReq,
Packet::Broadcast);
for (int x = 0; x < pbs; x+=4) {
funcReq->setPhys(blockAddr + x, 4, 0);
funcPkt->reinitFromRequest();
funcPkt->dataStatic(data + x);
port->sendFunctional(funcPkt);
assert(funcPkt->result == Packet::Success);
}
delete funcPkt;
delete funcReq;
oldPkt = pkt;
memcpy(data + oldPkt->getOffset(pbs), pkt->getPtr<uint8_t>(),
pkt->getSize());
pkt = new Packet(oldPkt->req, MemCmd::WriteInvalidateReq,
Packet::Broadcast, pbs);
pkt->dataDynamicArray(data);
pkt->senderState = oldPkt->senderState;
}
void undoPartialWriteFix()
{
if (!partialWriteFixed)
return;
delete pkt;
pkt = oldPkt;
partialWriteFixed = false;
}
}; };
/** /**