next up previous contents
Next: Issuing instructions to the Up: Processor Memory Unit Previous: Adding new instructions to

Address generation

Source files: src/Processor/memunit.cc, src/Processor/pipestages.cc, src/Processor/exec.cc

Header files: incl/Processor/memory.h

The CalculateAddress function is the first function called when an instruction in the memory unit no longer has address dependences. In this function, the addr and finish_addr fields of the instance are filled in using the GetAddr function. Additionally, the instance will be marked with a bus error (misalignment exception) if it is not aligned to an address boundary corresponding with its lengthgif. GetAddr also marks serialization exceptions for stores of the floating-point status register (STFSR, STXFSR).

Next, the GenerateAddress function is called. If an address generation unit is free, the issue function sends this instruction to an address generation unit. Otherwise, the instruction is added to a queue of instructions stalling on an address generation unit. The instruction will be revived when a unit frees up, just as described in Section 10.

After the instruction has passed through the address generation unit, the Disambiguate function is called. In this function, the addr_ready field of the instance is set, indicating to the memory issue stage that this instruction may be ready to issue. No additional processing occurs for loads. However, address generation for a store may allow the processor to detect violations of the uniprocessor constraints discussed above. In particular, the processor can determine if a load that occurred later in program order than the given store was allowed to issue to the memory system and thereby obtain an incorrect value. This situation can arise based on the policy chosen with the ``-L'' command-line option (described in Chapter 4). Loads that have obtained values in this fashion are marked with the limbo field. If this store has an address that conflicts with any of the later limbo loads, the load is either forced to reissue (if ``-L1'' was used) or is marked with an exception (if ``-L2'' or the default policy was specified). On the other hand, if this store is the last prior store with an ambiguous address and does not conflict with a given load, that load is allowed to have its limbo field cleared and possibly leave the memory unit as a result. The memory unit must also check all loads that have issued to the memory hierarchy but not yet completed; if any of these loads has an address that conflicts with the newly disambiguated store, it must be forced to reissue.


next up previous contents
Next: Issuing instructions to the Up: Processor Memory Unit Previous: Adding new instructions to

Vijay Sadananda Pai
Thu Aug 7 14:18:56 CDT 1997