Hello Vlad,

I don't think you can dynamically cast a Message pointer (MsgPtr) to
RubyRequestType. Do you mean a RequestMsg pointer or a RubyRequest pointer?

If you used dynamic_cast in NetworkInterface.cc to cast a MsgPtr to a
RequestMsg pointer, you should be able to call the getType function. (The
function is defined in RequestMsg.hh.) But this function may not return the
information you want. Depending on the protocol you are using, different
fields are copied to a RequestMsg (which will eventually reach the network
interface). The sm files corresponding to the protocol define which fields
are copied. You will have to check the protocol you are using.
For example, in src/mem/ruby/protocol/Garnet_standalone-cache.sm, the
address, requestor, destination and message size are copied to the
RequestMsg (out_msg). But the type is set to "CoherenceRequestType:MSG".

Chia


On Sat, Mar 2, 2024 at 2:30 AM Vladimir Milicevic via gem5-users <
gem5-users@gem5.org> wrote:

> My goal is to extract and print specific information (e.g., request type)
> from the Messages passing through the Garnet NetworkInterface instances.
> Within NetworkInterface::wakeup(), I’ve been able to print the messages by
> using:
>
> DPRINTF(RubyNetwork, "Message: %s\n", *(msg_ptr.get()));
>
>
> In FS sims, I’m able to get messages printed such as:
>
> Message: [RequestMsg: addr = [0xb9a3cfc0, line 0xb9a3cfc0] Type = GETS
> AccessMode = Supervisor Requestor = L1Cache-1 Destination = [NetDest (20)
>  - 0 0  - 0 1  -  - 0 0  - 0 0  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
> ] MessageSize = Control DataBlk = [ 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0
> 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0
> 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0
> 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 ] Len = 0
> Dirty = 0 Prefetch = No ]
>
>
> Now here’s where I run into trouble. I’d like access to each individual
> field of the request Message, instead of printing it as output. I’ve tried
> dynamically casting to RubyRequestType and accessing the getType() method,
> but this does not work:
>
> Is there a better way to access the message attributes and enums within
> the garnet network from Ruby/SLICC code?
>
> Thanks in advance,
> Vlad
> _______________________________________________
> 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