Hi Sindhuja,

I'm not sure exactly what you're looking for when you say "base and
offset." I believe you can query the base page size from the ISA (I forget
the exact function). With that you can divide and use modulo to compute the
VPN/PPN and the offset. You can also look at the TLB code to see how it
computes these things.

Cheers,
Jason

On Mon, May 9, 2022 at 2:54 PM Sindhuja Gopalakrishnan Elango <
sindhuja.gopalakrishnanela...@synopsys.com> wrote:

> Hi Jason,
>
> Thanks for the reply.
>
> I had managed to get both physical address and virtual address of the
> memory address through the request
>
> object like this.
>
> req->getPaddr();
>
> req->getVaddr();
>
> But I would like to extract the base and offset component of the virtual
> address as separate entities. Is that also possible?
>
>
>
> Thanks,
>
> Sindhuja
>
>
>
> *From:* Jason Lowe-Power <ja...@lowepower.com>
> *Sent:* Monday, May 9, 2022 1:34 PM
> *To:* The gem5 Users mailing list <gem5-users@gem5.org>
> *Subject:* [gem5-users] Re: virtual address -> base + offset
>
>
>
> Hi Sindhuja,
>
>
>
> The WholeTranslationState object should have all of the virtual and
> physical address information. In fact, the Request object (a member of the
> Packet) should also have both virtual and physical addresses.
>
>
>
> Cheers,
>
> Jason
>
>
>
> On Mon, May 9, 2022 at 10:23 AM Sindhuja Gopalakrishnan Elango <
> sindhuja.gopalakrishnanela...@synopsys.com> wrote:
>
> Hi,
>
> Is it possible to get the base and offset components of the virtual memory
> address in the CPU model?
>
> Appreciate your comments.
>
>
>
> Thanks,
>
> Sindhuja
>
>
>
>
>
>
>
> _______________________________________________
> gem5-users mailing list -- gem5-users@gem5.org
> To unsubscribe send an email to gem5-users-le...@gem5.org
>
> _______________________________________________
> gem5-users mailing list -- gem5-users@gem5.org
> To unsubscribe send an email to gem5-users-le...@gem5.org
>
_______________________________________________
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org

Reply via email to