ruby: Expose MessageBuffers as SimObjects
Review Request #2845 - Created May 25, 2015 and submitted
| Information | |
|---|---|
| Joel Hestness | |
| gem5 | |
| default | |
| Reviewers | |
| Default | |
Changeset 10936:85b34fa1e87a --------------------------- ruby: Expose MessageBuffers as SimObjects Expose MessageBuffers from SLICC controllers as SimObjects that can be manipulated in Python. This patch has numerous benefits: 1) First and foremost, it exposes MessageBuffers as SimObjects that can be manipulated in Python code. This allows parameters to be set and checked in Python code to avoid obfuscating parameters within protocol files. Further, now as SimObjects, MessageBuffer parameters are printed to config output files as a way to track parameters across simulations (e.g. buffer sizes) 2) Cleans up special-case code for responseFromMemory buffers, and aligns their instantiation and use with mandatoryQueue buffers. These two special buffers are the only MessageBuffers that are exposed to components outside of SLICC controllers, and they're both slave ends of these buffers. They should be exposed outside of SLICC in the same way, and this patch does it. 3) Distinguishes buffer-specific parameters from buffer-to-network parameters. Specifically, buffer size, randomization, ordering, recycle latency, and ports are all specific to a MessageBuffer, while the virtual network ID and type are intrinsics of how the buffer is connected to network ports. The former are specified in the Python object, while the latter are specified in the controller *.sm files. Unlike buffer-specific parameters, which may need to change depending on the simulated system structure, buffer-to-network parameters can be specified statically for most or all different simulated systems.
Regression tests with all Ruby protocols. Protocol file changes are in
separate patch (http://reviews.gem5.org/r/2844/) to keep this one slim.
I went through both the patches. Unlikely that I am going to agree
these changes since we are dropping the functionality of connecting buffers
in python.
-
src/mem/ruby/network/simple/SimpleNetwork.cc (Diff revision 1) -
This is not right.
-
src/mem/ruby/network/simple/Switch.cc (Diff revision 1) -
This is not right either.
-
src/mem/ruby/slicc_interface/AbstractController.cc (Diff revision 1) -
Don't you need to set the receiver and the ordering property?
-
src/mem/ruby/slicc_interface/AbstractController.cc (Diff revision 1) -
Do we not need to functionally write to the memory?
I just have two questions so far on this patch.
- What does Nilay mean that the "we are dropping the functionality of connecting buffers in python"? It wasn't too long ago when we added that functionality rather than doing it in the controller constructors. Why is that functionality going away and how was that decision determined?
- Joel was it your intention to post this patch without moving the MessageBuffers created within the network (not the endpoints) to python? Was that to get early feedback before doing the possibly harder job of dealing with those other MessageBuffers? Were you hoping that Mark Wilkening to pick this patch up and add that support?
Thanks
-
src/mem/ruby/network/simple/SimpleNetwork.cc (Diff revision 1) -
I believe Nilay's concern is that you are instantiating a SimObject in the C++ code. I could be wrong, but I believe all other SimObjects are instantiated by swig via the python configuration files. I believe the expected implementation would be to create all these MessageBuffers in the Network/Switch .py files.
Description: |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Diff: |
Revision 2 (+105 -74) |
Change Summary:
Addressed initial reviews:
1) Moved MessageBuffer parameters out to Python object
2) Reverted MessageBuffer port connecting code
3) Connect SimpleNetwork MessageBuffers in Python
Description: |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Diff: |
Revision 3 (+181 -154) |
This patch looks very good to me. Small thing, you might want to consider renaming m_buffers_to_free; the name is not really applicable now.
Change Summary:
Minor: variable naming
Any further comments?
Description: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Diff: |
Revision 4 (+193 -166) |
-
configs/ruby/Ruby.py (Diff revision 4) -
Overall, can this code be moved into the Switch and Liny .py files rather than have it here in Ruby.py?
Also can we avoid setting the recycle_latency variable and just specify the default in the MessageBuffer.py file?
Finally, please correct me if I'm wrong, but I believe that all message buffers within the network have always been ordered, correct? If so, this patch maintains that same functionality, which is great. It would be good to add a comment pointing that out.
-
src/mem/ruby/network/MessageBuffer.py (Diff revision 4) -
Why is a default recycle latency not set?
Why is this "Parent.recycle_latency"? Does both swtiches and controllers define a recycle latency? It doesn't appear so with this patch. I'm a bit confused how this actually works. I do not believe switches will ever use recycles, so it doesn't make much sense to define this default in the switch parent. Also many protocols avoid using recycles. Those protocols should not need to specify a recycle latency either.
-
configs/ruby/Ruby.py (Diff revision 4) -
Splitting Brad's comments for easier tracking: "Overall, can this code be moved into the Switch and Liny .py files rather than have it here in Ruby.py?"
-
configs/ruby/Ruby.py (Diff revision 4) -
Splitting Brad's comments for easier tracking: "Finally, please correct me if I'm wrong, but I believe that all message buffers within the network have always been ordered, correct? If so, this patch maintains that same functionality, which is great. It would be good to add a comment pointing that out."
-
configs/ruby/Ruby.py (Diff revision 4) -
Splitting Brad's comments for easier tracking: "Also can we avoid setting the recycle_latency variable and just specify the default in the MessageBuffer.py file?"
-
src/mem/ruby/network/simple/SimpleNetwork.py (Diff revision 4) -
Just change this name from buffers to int_link_buffers or interface_buffers.
I just want to make it clear this is not a list of all buffers in the network. Rather it is just those buffers not part of a Switch.
Please post a snippet of the config.ini file generated after this patch is applied.
-
src/mem/ruby/network/MessageBuffer.hh (Diff revision 4) -
Drop these two functions and the m_description variable. The name of the message buffer should be enough information.
-
src/mem/ruby/network/MessageBuffer.py (Diff revision 4) -
Mention that 0 means infinite buffer size.
Joel, your intention with this patch is to completely replace patches http://reviews.gem5.org/r/2801/ and http://reviews.gem5.org/r/2814/, correct?
Hopefully we can resolve the last couple of issues on this patch and you can check it in soon. I'd like to add the finite buffer configs on top of it, as well as simple way to fallback on infinite buffers, similar to the kill switch added by 2801.
Thanks
Description: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Diff: |
Revision 5 (+198 -185) |
Description: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Diff: |
Revision 6 (+199 -185) |
-
src/mem/ruby/SConscript (Diff revision 6) -
The flag RubyQueue is in use in MessageBuffer.cc. I think we should not add this one.
-
src/mem/ruby/network/MessageBuffer.hh (Diff revision 6) -
const
-
src/mem/ruby/network/MessageBuffer.hh (Diff revision 6) -
const
-
src/mem/ruby/network/MessageBuffer.hh (Diff revision 6) -
const since we are removing the set function.
-
src/mem/ruby/network/MessageBuffer.cc (Diff revision 6) -
Let's mark these members are const and have them initialized using initializer list.
-
src/mem/ruby/network/MessageBuffer.py (Diff revision 6) -
2015 Mark D. Hill and David A. Wood
-
src/mem/ruby/network/simple/SimpleNetwork.py (Diff revision 6) -
I read Brad's comment on this function. I think the original choice was right. I don't see why we want to compile this into the binary. If configs/ruby/Ruby.py is becoming a problem, we should just split that file.
-
src/mem/slicc/ast/ObjDeclAST.py (Diff revision 6) -
Do we need this code?
-
src/python/swig/pyobject.cc (Diff revision 6) -
Can you confirm that these checks on name1 and name2 are still required?
Thanks Joel. This looks great to me! Can you please check this in after we check in our patches on 7/31. We have discarded patches http://reviews.gem5.org/r/2801 and http://reviews.gem5.org/r/2814. We will build off of this patch instead.
