On Thu, Sep 13, 2012 at 10:26 PM, shuchang <[email protected]> wrote:

> Hi all,
>
> I want to get the memory data before and after write operations to the
> memory.
> I think I can read the data before modification in
>
> MemoryController::handle_interconnect_cb function like this:
>
> (memoryController.cpp)
>
>     bool isWrite = memRequest->get_type() == MEMORY_OP_UPDATE;
>
>     bool accepted = mem->addTransaction(isWrite,physicalAddress);
>
>
> //added for data profiling of memory
>     if (isWrite) {
>         ofstream file("before modification.txt");
>         W64 phy_addr = message->request->get_physical_address();
>                 W64 data = getthread().ctx.loadphys();
>         file << phy_addr;
>         file.close();
>     }
>
> As we know, getthread() function cannot be called in memoryController.cpp.
>
> Is there any advice how can I call context::loadphys() in memory module?
>
> There is a function called 'contextof(i)' where 'i' is context id to get
the context reference.
You can get core-id and thread-id from memory request to find the cpu
context id.

- Avadh

Regards,
> Shuchang
>
>
>
> _______________________________________________
> http://www.marss86.org
> Marss86-Devel mailing list
> [email protected]
> https://www.cs.binghamton.edu/mailman/listinfo/marss86-devel
>
_______________________________________________
http://www.marss86.org
Marss86-Devel mailing list
[email protected]
https://www.cs.binghamton.edu/mailman/listinfo/marss86-devel

Reply via email to