diff options
author | Geoffrey Blake <geoffrey.blake@arm.com> | 2011-05-23 10:40:21 -0500 |
---|---|---|
committer | Geoffrey Blake <geoffrey.blake@arm.com> | 2011-05-23 10:40:21 -0500 |
commit | d0b0a555151232566550c837f9d4d061bf3d4686 (patch) | |
tree | 39cfcae9744fa0c707b5335acee6bde1d9f8986c /src | |
parent | c223b887fe6e40bc044f0bd8e032b5ab0a366c9d (diff) | |
download | gem5-d0b0a555151232566550c837f9d4d061bf3d4686.tar.xz |
O3: Fix offset calculation into storeQueue buffer for store->load forwarding
Calculation of offset to copy from storeQueue[idx].data structure for load to
store forwarding fixed to be difference in bytes between store and load virtual
addresses. Previous method would induce bug where a load would index into
buffer at the wrong location.
Diffstat (limited to 'src')
-rw-r--r-- | src/cpu/o3/lsq_unit.hh | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cpu/o3/lsq_unit.hh b/src/cpu/o3/lsq_unit.hh index 8e311d275..d83dc868f 100644 --- a/src/cpu/o3/lsq_unit.hh +++ b/src/cpu/o3/lsq_unit.hh @@ -616,7 +616,7 @@ LSQUnit<Impl>::read(Request *req, Request *sreqLow, Request *sreqHigh, // If the store's data has all of the data needed, we can forward. if ((store_has_lower_limit && store_has_upper_limit)) { // Get shift amount for offset into the store's data. - int shift_amt = req->getVaddr() & (store_size - 1); + int shift_amt = req->getVaddr() - storeQueue[store_idx].inst->effAddr; memcpy(data, storeQueue[store_idx].data + shift_amt, req->getSize()); |