Managing Context Pointers
The Fetch module is the entity that changes contexts
- A change to a new context is made when a branch prediction is done (lastctx = lastctx + 1)
- Recall that Branches will be resolved IN PROGRAM ORDER. This means that a resolved branch will always be for context “firstctx + 1”.
- If a branch is mispredicted, then wipe out ALL speculative contexts by setting “lastctx = firstctx”
Each VHDL Module (CRS, DRR, Fetch, etc) could manage their own context pointers, or the context pointers within the fetch module could be sent to the other models.