If the Message* is not a MemoryMsg*, then safe cast will fail.

--
Nilay


On Wed, 26 Sep 2012, Tushar Krishna wrote:

Hi Tejasi,
I tried it too and yeah it fails, not sure why...
The same code works in src/mem/ruby/system/RubyMemoryControl.cc
A cast into NetworkMessage has been done in places like RoutingUnit_d but that 
won't give you the message type.
You'll have to dig in and see why the cast fails…

- Tushar

On Sep 26, 2012, at 2:17 AM, tejasi pimpalkhute wrote:

Hi Tushar,

I had resumed working on this again, so was going through your emails(please 
see email below). I am still getting this error:

gem5.debug: build/ALPHA_SE_MOESI_hammer/base/cast.hh:49: T safe_cast(U) [with T 
= const MemoryMsg*, U = Message*]: Assertion `ret' failed.
Program aborted at cycle 10
Aborted

My code looks like this in SWallocator.cc file(I have included all the 
necessary files) in the arbitrate_outports() function:

flit_d *t_flit = m_input_unit[inport]->peekTopFlit(invc);

MsgPtr msg_ptr = t_flit->get_msg_ptr();

const MemoryMsg* memMess = safe_cast<const MemoryMsg*>(msg_ptr.get());

physical_address_t addr = memMess->getAddress().getAddress();
MemoryRequestType type = memMess->getType();

However, the typecast fails. Could you please let me know what could be the 
problem here? I just want to extract the information from the flit if it is a 
memory message or network message and if it is memory message, I want to know 
its physical address and memory request type (e.g. read/write, etc). Can you 
please suggest the correct way of getting this information from the flit?

I appreciate your guidance.

Thanks!

_______________________________________________
gem5-users mailing list
gem5-users@gem5.org
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users

Reply via email to