From 8fc06589cbf28b2a5bf13384d1c683dc50f68a8a Mon Sep 17 00:00:00 2001 From: Ron Dreslinski Date: Thu, 23 Feb 2006 13:51:54 -0500 Subject: Update functional memory to have a response event Clean out old memory python files, move them into old_mem directory. Maybe we should just delete them, they are under revision control. Add new py files for new objects. SConscript: Update because memory is just a header file now base/chunk_generator.hh: Make Chunk Generator return the entire size if the chunk_size is set to zero. Useful when trying to chunck on blocksize of memory, which can write large pieces of data. cpu/simple/cpu.cc: Make sure to delete the pkt. mem/physical.cc: mem/physical.hh: Set up response event. mem/port.cc: Rename rqst to req to conform to same standard naming convention. python/m5/objects/PhysicalMemory.py: Update the params, inheritence --HG-- extra : convert_revision : 857154ec256522baf423b715833930497999549b --- mem/physical.cc | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) (limited to 'mem/physical.cc') diff --git a/mem/physical.cc b/mem/physical.cc index beebb65c8..58c9ea408 100644 --- a/mem/physical.cc +++ b/mem/physical.cc @@ -46,11 +46,31 @@ #include "mem/physical.hh" #include "sim/host.hh" #include "sim/builder.hh" +#include "sim/eventq.hh" #include "targetarch/isa_traits.hh" using namespace std; +PhysicalMemory::MemResponseEvent::MemResponseEvent(Packet &pkt, MemoryPort* _m) + : Event(&mainEventQueue, CPU_Tick_Pri), pkt(pkt), memoryPort(_m) +{ + + this->setFlags(AutoDelete); +} + +void +PhysicalMemory::MemResponseEvent::process() +{ + memoryPort->sendTiming(pkt); +} + +const char * +PhysicalMemory::MemResponseEvent::description() +{ + return "Physical Memory Timing Access respnse event"; +} + #if FULL_SYSTEM PhysicalMemory::PhysicalMemory(const string &n, Range range, MemoryController *mmu, const std::string &fname) @@ -157,7 +177,10 @@ bool PhysicalMemory::doTimingAccess (Packet &pkt) { doFunctionalAccess(pkt); - //Schedule a response event at curTick + lat; + + MemResponseEvent* response = new MemResponseEvent(pkt, &memoryPort); + response->schedule(curTick + lat); + return true; } @@ -213,6 +236,11 @@ PhysicalMemory::MemoryPort::getDeviceAddressRanges(AddrRangeList &range_list, panic("??"); } +int +PhysicalMemory::MemoryPort::deviceBlockSize() +{ + return memory->deviceBlockSize(); +} bool PhysicalMemory::MemoryPort::recvTiming(Packet &pkt) -- cgit v1.2.3