Hi Ciro,

Could you tell me where can i find the file that does an ifetch for 
AtomicsimpleCPU in gem5?

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>()

Thanks

________________________________
From: Ciro Santilli <[email protected]>
Sent: Wednesday, August 12, 2020 7:18 AM
To: gem5 users mailing list <[email protected]>
Cc: Ahmed, Md Rubel <[email protected]>; ABD ALRHMAN ABO ALKHEEL 
<[email protected]>
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
<[email protected]> 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 <[email protected]>
> Sent: Wednesday, August 12, 2020 12:44 AM
> To: gem5 users mailing list <[email protected]>
> Cc: Ahmed, Md Rubel <[email protected]>
> 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 <[email protected]>
> Sent: Tuesday, August 11, 2020 6:32 PM
> To: gem5 users mailing list <[email protected]>; gem5-users 
> <[email protected]>
> Cc: ABD ALRHMAN ABO ALKHEEL <[email protected]>
> 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 -- [email protected]
> To unsubscribe send an email to [email protected]
> %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
_______________________________________________
gem5-users mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to