Is the problem you are facing in the gem5 code or your guest-code running
in the simulation?

This looks to be a problem in the guest-code. You're calling pointer++
twice, which should, naturally, increment the address by 8. Based on this
information, I do not know why the first incrementation fails to print the
correct address.

--
Dr. Bobby R. Bruce
Room 2235,
Kemper Hall, UC Davis
Davis,
CA, 95616

web: https://www.bobbybruce.net


On Tue, Jun 16, 2020 at 3:26 PM Muhammad Aamir via gem5-users <
gem5-users@gem5.org> wrote:

> Hi everyone,
>
> I have made a system that includes a scratchpad memory(using the class
> Simple Memory as SPM) at the same level as a level 2 cache. The problem
> that am facing is that I can read and write to it in increments of 8 rather
> than 4 for type int, i.e. Pointer++ gives wrong value at an address work
> while Pointer = Pointer + 2 gives me the correct data of a location.
>
> (Pointer++ doesnot cause the address to be incremented unless I call it
> two times)
>
> Would someone kindly guide me as to why this is the case and a
> possible solution. One reason(which is possibly wrong) that I may have, is
> that I cannot use the SimpleMemory class directly, and I have to derive
> another class from it to use it?
>
>
> Attach is a screenshot, when i store an array in the Scratchpad memory. As
> you can see the address is not being incremented for every ++
>
>
> https://drive.google.com/file/d/11arSjlXx1veBTwdmwANl3VhZqLjbIyuh/view?usp=sharing
>
>
> Any help would be highly appreciated.
>
> Thanks
> _______________________________________________
> gem5-users mailing list -- gem5-users@gem5.org
> To unsubscribe send an email to gem5-users-le...@gem5.org
> %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
_______________________________________________
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to