avadh patel <avadh4all <at> gmail.com> writes:
>
>
> On Thu, Sep 13, 2012 at 10:26 PM, shuchang <ShuShang.Shan <at> amd.com>
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.
I'm still unclear on how to 'find the cpu context id' from the trhead-id
and core-id. If it's a single core configuration, wouldn't this just be 1
or 0, whichever is used for the first core?
>
>
> - Avadh
>
>
> Regards,
> Shuchang
> _______________________________________________http://www.marss86.org
> Marss86-Devel mailing listMarss86-Devel <at>
cs.binghamton.eduhttps://www.cs.binghamton.edu/mailman/listinfo/marss86-
devel
>
>
>
>
>
> <div>
> <br><br><div class="gmail_quote">On Thu, Sep 13, 2012 at 10:26 PM,
shuchang <span dir="ltr"><<a href="mailto:ShuShang.Shan <at> amd.com"
target="_blank">ShuShang.Shan <at> amd.com</a>></span> wrote:<br>
<blockquote class="gmail_quote">
>
> Hi all,<br><br>
> I want to get the memory data before and after write operations to the
memory.<br>
> I think I can read the data before modification in<br><br>
> MemoryController::handle_interconnect_cb function like this:<br><br>
> (memoryController.cpp)<br><br>
> bool isWrite = memRequest->get_type() ==
MEMORY_OP_UPDATE;<br><br>
> bool accepted = mem-
>addTransaction(isWrite,physicalAddress);<br><br><br>
> //added for data profiling of memory<br>
> if (isWrite) {<br>
> ofstream file("before modification.txt");<br>
> W64 phy_addr = message->request-
>get_physical_address();<br>
> W64 data =
getthread().ctx.loadphys();<br>
> file << phy_addr;<br>
> file.close();<br>
> }<br><br>
> As we know, getthread() function cannot be called in
memoryController.cpp.<br><br>
> Is there any advice how can I call context::loadphys() in memory module?
<br><br>
> </blockquote>
> <div>There is a function called 'contextof(i)' where 'i' is context id to
get the context reference.</div>
> <div>You can get core-id and thread-id from memory request to find the
cpu context id.</div>
>
> <div><br></div>
> <div>- Avadh</div>
> <div><br></div>
> <blockquote class="gmail_quote">
> Regards,<br>
> Shuchang<br><br><br><br>
> _______________________________________________<br><a
href="http://www.marss86.org" target="_blank">http://www.marss86.org</a>
<br>
> Marss86-Devel mailing list<br><a href="mailto:Marss86-Devel <at>
cs.binghamton.edu">Marss86-Devel <at> cs.binghamton.edu</a><br><a
href="https://www.cs.binghamton.edu/mailman/listinfo/marss86-devel"
target="_blank">https://www.cs.binghamton.edu/mailman/listinfo/marss86-
devel</a><br>
> </blockquote>
> </div>
> <br>
> </div>
>
_______________________________________________
http://www.marss86.org
Marss86-Devel mailing list
[email protected]
https://www.cs.binghamton.edu/mailman/listinfo/marss86-devel