On Tue, Dec 14, 2010 at 6:25 AM, Shen Zhong <[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]> wrote:
>
>> Dear all,
>>
>>   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.
>>   What I found is ptlsim didn't implement the memory itself, what it
>> does is reading the data from the host memory. Is it right? If so how
>> can I read the data from the memory after knowing its virtual address?
>>
>
>  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.
>
>  - Avadh
>
>>   Thanks a lot!
>>
>> -Regards
>>  Shen Zhong
>>
>>
>> _______________________________________________
>> http://www.marss86.org
>> Marss86-Devel mailing list
>> [email protected]
>> https://www.cs.binghamton.edu/mailman/listinfo/marss86-devel
>>
>  Thanks a lot Avadh.
> 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?
>
> -Best Regards
>  Shen Zhong
>
>  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.

- Avadh

P.S. never user 'handle_page_fault' unless you know what you are doing. This
function will switch to QEMU and may put the CPU simulation in un-stable
state that will crash either simulator or VM.

_______________________________________________
> 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