On Sat, Aug 15, 2020 at 9:54 PM ABD ALRHMAN ABO ALKHEEL
<abdkeel...@hotmail.com> wrote:
>
> Hi Ciro,
>
> Could you tell me where can i find the file that does an ifetch for 
> AtomicsimpleCPU in gem5?
>

https://github.com/gem5/gem5/blob/fa70478413e4650d0058cbfe81fd5ce362101994/src/cpu/simple/atomic.cc#L673
up to sendFetch below (find Atomic file source and grep :-) ) Some
notes also under:
https://cirosantilli.com/linux-kernel-module-cheat/#gem5-packet-vs-request


> Also, How to print the data from the packet (I assumed the loaded data is 
> stored in the pkt).
> should I use
> pkt->getRaw<uint8_t>()
> or
> pkt->getLE<uint8_t>()
> or
> pkt->getBE<uint8_t>()
> or
> pkt->setData<uint8_t>()
> or
> pkt->writeData<uint8_t>()
>

Have a look at the source under Eclipse :-) all of those get the
packet data with small variations, but it is raw binary.

To see it as hex you need to convert binary to ASCII hex first. I want
to push a simple patch for this in the near future, but you can do it
manually easily too for now:
https://stackoverflow.com/a/27173017/895245

> Thanks
>



> ________________________________
> From: Ciro Santilli <ciro.santi...@gmail.com>
> Sent: Wednesday, August 12, 2020 7:18 AM
> To: gem5 users mailing list <gem5-users@gem5.org>
> Cc: Ahmed, Md Rubel <mdrubelah...@usf.edu>; ABD ALRHMAN ABO ALKHEEL 
> <abdkeel...@hotmail.com>
> Subject: Re: [gem5-users] Re: Memory Addresses in Gem5
>
> I recommend that you have a look at the source of how AtomicSimpleCPU
> does an ifetch under Eclipse. It should be easy to understand
> everything quickly from there.
>
> The Packet address is physical (which notably what caches and DRAM
> work on), just have a look at the constructor of packet:
>
>     Packet(const RequestPtr &_req, MemCmd _cmd)
>         :  cmd(_cmd), id((PacketId)_req.get()), req(_req),
>            data(nullptr), addr(0), _isSecure(false), size(0),
>            _qosValue(0), headerDelay(0), snoopDelay(0),
>            payloadDelay(0), senderState(NULL)
>     {
>         if (req->hasPaddr()) {
>             addr = req->getPaddr();
>
> So you have to do translation before. Translation sets the physical
> address on the Request, which contains both _paddr and _vaddr fields.
>
> Another option is to have a look at how some of the memory tests are doing it.
>
> On Wed, Aug 12, 2020 at 1:55 AM ABD ALRHMAN ABO ALKHEEL via gem5-users
> <gem5-users@gem5.org> wrote:
> >
> > Hi,
> >
> > Thank you for your email.
> >
> > Do you have any idea how to construct a packet with a request to read from 
> > the memory address? For instance, let us assume that the address that I 
> > want to read the data from it is (0x2345),  I want to read the 256 bytes of 
> > this address (0x2300-0x23ff)? I want to do that for debugging like this 
> > https://www.gem5.org/_pages/static/scripts/part2/memoryobject/simple_memobj.cc.
> >
> > Any help would be appreciated.
> >
> > Thanks
> >
> > ________________________________
> > From: Ahmed, Md Rubel via gem5-users <gem5-users@gem5.org>
> > Sent: Wednesday, August 12, 2020 12:44 AM
> > To: gem5 users mailing list <gem5-users@gem5.org>
> > Cc: Ahmed, Md Rubel <mdrubelah...@usf.edu>
> > Subject: [gem5-users] Re: Memory Addresses in Gem5
> >
> > Hi,
> >
> > pkt->getAddr()  returns memory address. pkt->print() also returns block 
> > address and offset.
> >
> > Thanks
> > ________________________________
> > From: ABD ALRHMAN ABO ALKHEEL via gem5-users <gem5-users@gem5.org>
> > Sent: Tuesday, August 11, 2020 6:32 PM
> > To: gem5 users mailing list <gem5-users@gem5.org>; gem5-users 
> > <gem5-users-boun...@gem5.org>
> > Cc: ABD ALRHMAN ABO ALKHEEL <abdkeel...@hotmail.com>
> > Subject: [gem5-users] Memory Addresses in Gem5
> >
> > Hi All,
> >
> > Does the packet in gem5 have the memory address? for example, does this 
> > pkt->getAddr() return the memory address or not? If so, is that address 
> > physical or virtual?
> >
> > Thanks
> >
> > [EXTERNAL EMAIL] DO NOT CLICK links or attachments unless you recognize the 
> > sender and know the content is safe.
> >
> > _______________________________________________
> > 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