mem: Added support for Null data packet
Review Request #399 - Created Jan. 6, 2011 and submitted
| Information | |
|---|---|
| Brad Beckmann | |
| gem5 | |
| Reviewers | |
| Default | |
| ali, gblack, nate, stever | |
mem: Added support for Null data packet The packet now identifies whether static or dynamic data has been allocated and is used by Ruby to determine whehter to copy the data pointer into the ruby request. Ruby does not currently support array data.
Posted (Jan. 6, 2011, 10:17 p.m.)
-
src/mem/packet.hh (Diff revision 1) -
Review board seems to be flagging some whitespace you have at the end of this line. The idea of this function seems fine but its name is a little awkward. How about hasData()?
Posted (Jan. 9, 2011, 10:34 a.m.)
I'm not sure this change does what you think it does. those flags only mean that the packet has data storage allocated, it doesn't say anything about the validity of that data. I can't think of a good reason why someone external would need to know that the packet has data allocated. If that is what you're going for, then it should have a name that makes it clear that this just means storage, nothing about the protocol and a good doxygen comment.
Review request changed
Updated (Jan. 10, 2011, 12:44 a.m.)
Summary: |
|
||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Description: |
|
||||||||||||||||||
Diff: |
Revision 2 (+6) |
Posted (Jan. 10, 2011, 12:52 a.m.)
Brad, are you sure correct file go uploaded? I see html tags in the file.
Review request changed
Updated (Jan. 10, 2011, 3:42 a.m.)
Diff: |
Revision 3 (+6) |
|---|
Posted (Jan. 10, 2011, 5:16 a.m.)
Sorry I haven't plowed through all the other review requests, but where is this used in Ruby? What happens if the packet doesn't have data? Would it make sense to combine the patches that use this function with this patch? (My thought is probably so.)
Posted (Jan. 10, 2011, 5:54 a.m.)
-
src/mem/packet.hh (Diff revision 3) -
You need spaces around |.
Posted (Jan. 10, 2011, 7:45 a.m.)
-
src/mem/packet.hh (Diff revision 3) -
I'd still prefer hasDataAllocated() or something
Review request changed
Updated (Jan. 10, 2011, 7:59 a.m.)
Summary: |
|
|||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Description: |
|
|||||||||||||||||||||
Diff: |
Revision 4 (+20 -5) |
Posted (Jan. 10, 2011, 8:11 a.m.)
-
src/mem/ruby/system/RubyPort.cc (Diff revision 4) -
I suggest changing Packet::getPtr() to take an optional flag like this: getPtr(bool null_ok = false) { assert(null_ok || flags.isSet(STATIC_DATA|DYNAMIC_DATA)); return (T*)data; } (assuming that data really is null when those flags are clear), then changing this section to just call getPtr<uint8_t>(true) (you might not even need the ruby_data temp anymore, I'm not sure), and you won't even need the method that you can't find a good name for :-)
Obviates the need for a different patch I had in my own queue, and more general. Thanks Brad.
