On Tuesday 14 December 2010 16:54:47 avadh patel wrote: > On Tue, Dec 14, 2010 at 6:25 AM, Shen Zhong > <[email protected]<mailto:[email protected]>> wrote: > On Tuesday 14,December,2010 03:50 PM, Shen Zhong wrote: > > > On Thursday 09,December,2010 12:43 AM, avadh patel wrote: > > > > On Wed, Dec 8, 2010 at 6:09 AM, Shen Zhong > > > > <[email protected]<mailto:[email protected]>> wrote: > > > > Suppose I know a certain virtual address, and I need to read the > > > > corresponding data from the main memory in ptlsim, but I don't want to > > > > add an entry to the load store queue, since there was no such load > > > > instruction in the application we are running. > > > > > > > Yes you are right about no data memory in simulated model. You can read > > > the data > > > using 'Context::loadvirt' function. But before using that function you > > > need to make sure > > > that requested virtual address doesn't have page fault. > > > > Now I can read the data from memory. I use the "has_page_fault" > > function to check whether there is page fault. However, sometimes there are > > page faults, but I still want to read the data even if there is page fault. > > How can I handle it? > > Sorry, I solved the problem by calling the "handle_page_fault" function, but > I still got error of > OutOfOrderMachine::run(PTLsimConfig&): Assertion `ctx.handle_interrupt == 1' > failed. > How can I handle this ? > Thanks! > > In case of page fault, you should not try to fix it because it will put the > simulation CPU context into unstable state. So if you want to read data from > memory that has page fault, you have to wait till the fault has been handled > by the CPU simulation. Once the fault is handled and data is loaded from > hard-drive to RAM then program execution will begin from the same location so > you will not miss any memory read/write in your trace.
What you would usually do is to record physical addresses in the core and read those memory locations. If you do not want the memory locations to be paged out, you need to pin them in the application / OS you are simulating. (Under Linux applications you can use mmap.) Maybe if you can shed some light about what you are trying to read, we could help more :-) Stephan -- Stephan Diestelhorst, AMD Operating System Research Center [email protected] Tel. +49 (0)351 448 356 719 Advanced Micro Devices GmbH Einsteinring 24 85609 Dornach / Aschheim Registration: Dornach, Gemeinde Aschheim Landkreis Muenchen Registergericht Muenchen HRB Nr. 43632 General Managers: Alberto Bozzo, Andrew Bowd _______________________________________________ http://www.marss86.org Marss86-Devel mailing list [email protected] https://www.cs.binghamton.edu/mailman/listinfo/marss86-devel
