I need to use a loop because I have to evaluate each value in an array. If an
element is equal to a certain value, I need to send a message to the NetDest
associated with the element. That means there may be cases where I need to send
no message and other cases where I need to send multiple messages.
I am taking a look at NetDest and it seems to be a vector. I am assuming that
allows you to specify multiple destinations with one message. If that is the
case, then I assume that I can actually implement the while loop in C++ and
return a NetDest to send the message. Would that be correct?
- Alex
________________________________
From: Malek Musleh <[email protected]>
To: Alex Tomala <[email protected]>
Sent: Saturday, November 2, 2013 5:03:59 PM
Subject: Re: [gem5-users] Does SLICC support loops
I think you need to look at the problem your asking differently. Why do you
need to use a loop?
In the example you provided, your using the while loop to return/get a
list/number of caches to which the message should be sent to. Since the info
that you need is essentially the Destination Set, your external c++ function
could just return a NetDest.
NetDest mydest := getTotalNumDestination()
Essentially that example would be similar to a broadcast() which is already
done in the NetDest class. Look at simics+gems implementation of broadcast
protocols to get a better understanding.
Malek
On Sat, Nov 2, 2013 at 4:53 PM, Alex Tomala <[email protected]> wrote:
In that case, how could I implement loops while still having the capability to
send messages to other caches inside of those loops? Is there any way to do it
with C++?
>
>
>- Alex
>
>
>
>________________________________
> From: Malek Musleh <[email protected]>
>To: Alex Tomala <[email protected]>; gem5 users mailing list
><[email protected]>
>Sent: Saturday, November 2, 2013 4:22:28 PM
>Subject: Re: [gem5-users] Does SLICC support loops
>
>
>
>Hi Alex,
>
>
>SLICC does not support loops for reasons that can be read in the SLICC README
>file:
>
>
>src/mem/slicc/README
>
>
>
>Question: How comes there is no "for" loop statement in slicc?
>Answer: Been there, done that. That is easy to add, first of all. But unbound
>loop make slicc eventually un-synthesizable. We want to avoid that. If you want
>to loop through a bounded array do something, make the action done in a
>external interface in RubySlicc_Util.h. Inside, you just pass the vector as
>parameter to the external interface to achieve the same effects.
>
>
>Another bad thing of using loop statement like for is that we can not determine
>how many buffer space to allocate before the transition. With a vector, if it
>easy to understand we can always allocate the worst case number of hardware
>resources.
>
>
>As I have suggested to you in a previous question, you *could* modify SLICC to
>handle additional things (e.g. parameters, loops, etc) but in my experience it
>has been far easier to do any such hacking/interfacing through an external
>object (as this Q/A from the README also suggests).
>
>
>Malek
>
>
>
>
>
>On Sat, Nov 2, 2013 at 4:14 PM, Alex Tomala <[email protected]> wrote:
>
>Hello,
>>
>>
>>I am making a new cache coherence protocol in Gem5. In one of my actions, I
>>require using a while loop to send messages to other caches depending on
>>certain circumstances. I am wondering if there is a while loop in SLICC or if
>>I need to do something else. My code would look something like this:
>>
>>
>>while (x < totalNum()){ //pretend totalNum() is a C++ function that returns
>>the number of cache
>>if (fulfills certain conditions){
>> enqueue(replyChild_out, ParentReplyType, latency=issue_latency) {
>> out_msg.Address := address;
>> out_msg.Type := ParentReplyType:PYS;
>> out_msg.Sender := machineID;
>> out_msg.Destination.add(in_msg.Requestor);
>> }
>>}
>>}
>>
>>
>>I don't know if this is possible or not.
>>
>>
>>Best regards,
>>
>>
>>Alex Tomala
>>_______________________________________________
>>gem5-users mailing list
>>[email protected]
>>http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
>>
>
>
>_______________________________________________
gem5-users mailing list
[email protected]
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users