The control hardware used for dispatching instruction from the reservation stations is described in this post. For gaining the background on this topic you can refer here. As discussed previously, the control hardware is divided into three different parts for making the implementation a bit easier. We will now go through each of them, in detail, to understand their complete working.
The Allocating Unit
After the instructions are decoded, they are sent to the reservation station. This transfer of instruction from the Decode stage to the Reservation station is facilitated by the Allocating Unit. It performs the following actions:
- Read if any valid instructions are coming form decode.
- Keep a track of empty entries in the reservation station(s).
- In case of Distributed Reservation Station, the unit also has to decide to which station it has to transfer a particular instruction.
Implementing (1) and (3) is simple and just involves reading the validity bit and instruction type entry (respectively) of the incoming instruction. This is then proceeded by taking the relevant action. Keeping a track of empty entries is a not so simple task (however everything is simple once you know how to do it :P) and can be done by various methods. One of which is to have a circular queue to keep the list of free entries. Every time an instruction is dispatched to be executed, the tag corresponding to it is added to this queue; and whenever a new instruction arises an entry is popped out of the queue.
This whole system can be visualized as:
Bottom pointer tracks the free entries in the Queue. Whenever a new instruction enters, the bottom pointer is increased by one. Top pointer is increased by one whenever an instruction is dispatched by the dispatching unit.
The Dispatch Unit
This unit checks if there are any valid and ready instructions present in the reservation station and then forwards them to the execute stage. Similar to the allocating unit, a queue of ready instructions is managed in order to ease the work. The dispatch unit can be visualized as:
Update Unit
Update unit handles the broadcasts received from the execute and alters the corresponding entries in the reservation station. It also modifies the Ready Instruction Tag Queue accordingly. The structure of the update unit can visualized as:
Comments
Post a Comment