![Digital Equipment Alpha 21164PC Hardware Reference Manual Download Page 63](http://html.mh-extra.com/html/digital-equipment/alpha-21164pc/alpha-21164pc_hardware-reference-manual_2498508063.webp)
29 September 1997 – Subject To Change
Internal Architecture
2–33
Write Buffer and the WMB Instruction
A load instruction that is issued one cycle after a store instruction in the pipeline cre-
ates a conflict if both access exactly the same memory location. This occurs because
the store instruction has not yet updated the location when the load instruction reads
it. This conflict is handled by forcing the load instruction to replay trap. The IDU
flushes the pipeline and restarts execution from the load instruction. By the time the
load instruction arrives at the Dcache the second time, the conflicting store instruc-
tion has written the Dcache and the load instruction is executed normally.
Software should not load data immediately after storing it. The replay trap that is
incurred “costs” seven cycles. The best solution is to schedule the load instruction to
issue three cycles after the store. No issue stalls or replay traps will occur in that
case. If the load instruction is scheduled to issue two cycles after the store instruc-
tion, it will be issue-stalled for one cycle. This is not an optimal solution, but is pre-
ferred over incurring a replay trap on the load instruction.
For each store instruction, a search of the MAF is done to detect load-before-store
hazards. If a store instruction is executed, and a load of the same address is present in
the MAF, two things happen:
1.
Bits are set in each conflicting MAF entry to prevent its fill from being placed in
the Dcache when it arrives, and to prevent subsequent load instructions from
merging with that MAF entry.
2.
Conflict bits are set with the store instruction in the write buffer to prevent the
store instruction from being issued until all conflicting load instructions have
been issued to the CBU.
Conflict checking is done at the 32-byte block granularity. This ensures proper
results from the load instructions and prevents incorrect data from being cached in
the Dcache.
A check is performed for each new store against store instructions in the write buffer
that have already been sent to the CBU but have not been completed. Section 2.7
describes this process.
2.7 Write Buffer and the WMB Instruction
The following sections describe the write buffer and the WMB instruction.