mem: Make the requests carried by packets const
Review Request #2497 - Created Nov. 16, 2014 and submitted
| Information | |
|---|---|
| Andreas Hansson | |
| gem5 | |
| default | |
| Reviewers | |
| Default | |
Changeset 10570:c19d57302758 --------------------------- mem: Make the requests carried by packets const This adds a basic level of sanity checking to the packet by ensuring that a request is not modified once the packet is created. The only issue that had to be worked around is the relaying of software-prefetches in the cache. The specific situation is now solved by first copying the request, and then creating a new packet accordingly.
Posted (Nov. 20, 2014, 9:42 a.m.)
-
src/mem/cache/cache_impl.hh (Diff revision 1) -
Why do we need the allocate() call? Since we know what the request is, can we not perform the allocation in the constructor itself?
Posted (Nov. 20, 2014, 9:45 a.m.)
-
src/mem/cache/cache_impl.hh (Diff revision 1) -
Someone has to allocate storage for the packet, and we either do that using "static" pointers where the packet carries a pointer around, but is not responsible for the ownership, or "dynamic" where the ownership lies with the packet itself. We cannot allocate the space in the constructor as the "static" data does not rely on it.
Posted (Nov. 29, 2014, 1:12 p.m.)
-
src/mem/cache/cache_impl.hh (Diff revision 1) -
Is one vs. two spaces after periods in the gem5 style guide? :)
-
src/mem/cache/cache_impl.hh (Diff revision 1) -
This part seems kind of ad hoc... why is it that src/dest need to be copied but nothing else? I believe it's true, it just seems arbitrary with nothing else to go on here. Also seems like we should have confidence that the packet is created cleanly (the last 4 asserts seem like overkill).
Review request changed
Updated (Nov. 30, 2014, 1:19 a.m.)
Description: |
|
|||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Diff: |
Revision 2 (+20 -42) |
Ship It!
