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!


---------- Forwarded message ----------
From: Tushar Krishna <tus...@csail.mit.edu>
Date: Thu, Jan 5, 2012 at 9:09 AM
Subject: Re: Network Message and Memory Message
To: Krishna <krishna2...@gmail.com>


Hi Krishna,
My answers are inline.

cheers,
Tushar


On 1/5/2012 9:19 AM, Krishna wrote:

> Hi Tushar,
>
> We are trying to implement an SDRAM aware router that re-orders
> packets based on their row address and bank address so as to minimize
> time.
>
> In order to implement this, we are modifying the code in
> Swallocator_d.cc where the packets are re-ordered as per priority. To
> determine the priority we need the row address and bank address. So we
> tried to implement the logic similar to the below function
>
>
> void
> MemoryControl::enqueue(const MsgPtr&  message, int latency)
> {
>     Time current_time = g_eventQueue_ptr->getTime();
>     Time arrival_time = current_time + latency;
>     const MemoryMsg* memMess = safe_cast<const MemoryMsg*>(message.get());
>     physical_address_t addr = memMess->getAddress().**getAddress();
>     MemoryRequestType type = memMess->getType();
>     bool is_mem_read = (type == MemoryRequestType_MEMORY_READ)**;
>     MemoryNode thisReq(arrival_time, message, addr, is_mem_read,
> !is_mem_read);
>     enqueueMemRef(thisReq);
> }
>
> Here the value returned by message.get() is type-casted into MemoryMsg
> and later this is used to retrieve address and type of request.
>
Your approach is absolutely correct.


 We tried to implement similar logic in Swallocator_d.cc. Here the
> virtual channel buffers have flits.
>
>     flit_d *t_flit = m_input_unit[inport]->**getTopFlit(invc);
>     MsgPtr msg_ptr = flit_d->get_msg_ptr();
>
Shouldn't it be  MsgPtr msg_ptr = t_flit->get_msg_ptr(); ?

 const MemoryMsg* memMess = safe_cast<const MemoryMsg*>(message.get());
>
Shouldn't it be msg_ptr.get() ?

     const NetworkMessage* memMess = safe_cast<const
> NetworkMessage*>(msg_ptr.get()**);
>
> Here the code in bold line throws an assertion error, but is being
> successfully type-casted into Network Message.
>
Didn't see anything in bold but I assume you meant the MemoryMsg* line ...
Try fixing the two things I mentioned and see if it works. It should.

 Please let us know if it is possible to retrieve address and type of
> request from Network Message or any other possible way to extract the
> address and memory request type information from flit.
>
> To summarize, we are trying to schedule input requests at a router
> according to certain prioritizing criteria and store it in output port
> buffers. But our prioritizing criteria needs to know certain
> information from the flit (which is address and memory request type).
> Please let us know if there is any way to get this information.
>
>
> Thank You.
>
>
>
_______________________________________________
gem5-users mailing list
gem5-users@gem5.org
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users

Reply via email to