13744:c375fb19c372 |
01-Mar-2019 |
Gabe Black <gabeblack@google.com> |
util, tlm: Fix a memory error in the SCMasterPort class.
In the b_transport method of the SCMasterPort class, there is a check which determines whether the packet being sent to gem5 should be deleted once the call to sendAtomic returns. This was deleting the packet if extension was *not* nullptr.
This check should delete the packet if the extension *is* nullptr. The reasoning is that the extension will equal nullptr if there was no gem5 packet in an extension and a new one needed to be allocated. If there was an extension, ie if extension is not nullptr, then that's where the packet came from which therefore doesn't belong to us. In that case, we need to leave it alone and let its owner clean it up.
With the check reversed, this method will either leak allocated packets it should delete, or delete packets it shouldn't that someone else will likely try to use later.
Change-Id: I61578d910be6e5085b9fc0ddaa82468b1ac68578 Reviewed-on: https://gem5-review.googlesource.com/c/16949 Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Maintainer: Gabe Black <gabeblack@google.com> |
12183:a097b7c2d9b6 |
17-Aug-2017 |
Matthias Jung <jungma@eit.uni-kl.de> |
tlm: Don't set SystemC time resolution
Some simulators already set the time resolution of SystemC. By coupling gem5 by means of SystemC with an other tool this can lead to problems: When the resolution is set twice the simulation will not work. Therefore, the line is changed to an assertion that checks if the time resolution of the SystemC simulation is set to gem5's value of 1ps.
Change-Id: I8aafab9dd593eb4697a3c7f69ce181fd9cdd05c4 Reviewed-on: https://gem5-review.googlesource.com/4520 Reviewed-by: Paul Rosenfeld <prosenfeld@micron.com> Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Maintainer: Jason Lowe-Power <jason@lowepower.com> |