dcache: Fix bugs in pipelined operation
authorPaul Mackerras <paulus@ozlabs.org>
Sun, 17 Jan 2021 21:55:56 +0000 (08:55 +1100)
committerPaul Mackerras <paulus@ozlabs.org>
Tue, 19 Jan 2021 01:16:34 +0000 (12:16 +1100)
commitf636bb7c3999d9326a2bd1c6131fc128be2cae24
treefe5681b93fd15dde8691aaa58e3b1eadd3227ec1
parentacb3d2d7455dfb9b1813f406f45cb314fba2e34e
dcache: Fix bugs in pipelined operation

This fixes two bugs which show up when multiple operations are in
flight in the dcache, and adds a 'hold' input which will be needed
when loadstore1 is pipelined.

The first bug is that dcache needs to sample the data for a store on
the cycle after the store request comes in even if the store request
is held up because of a previous request (e.g. if the previous request
is a load miss or a dcbz).

The second bug is that a load request coming in for a cache line being
refilled needs to be handled immediately in the case where it is for
the row whose data arrives on the same cycle.  If it is not, then it
will be handled as a separate cache miss and the cache line will be
refilled again into a different way, leading to two ways both being
valid for the same tag.  This can lead to data corruption, in the
scenario where subsequent writes go to one of the ways and then that
way gets displaced but the other way doesn't.  This bug could in
principle show up even without having multiple operations in flight in
the dcache.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
common.vhdl
dcache.vhdl
loadstore1.vhdl