Download URSIM Reference Manual Abstract
Transcript
first sets memory-unit-related fields of the instance: in memunit to 1, limbo to 0, and kill to 0. It then adds this instruction to the unified memory unit queue MemQueue. If this instance does not have any outstanding address dependences (i.e., addrdep is clear, as discussed in Chapter 7), it is sent on to the address generation unit by calling function CalculateAddress. 8.2 Address generation Source files: Processor/memunit.hh, Processor/memunit.cc, Processor/exec.cc Header files: Processor/memunit.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 vaddr and finish addr fields of the instance are filled by 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 length 2 . GetAddr also marks serialization exceptions for stores of the floating-point status register (STFSR, STXFSR). Next, function TLB V2P is called to translate the virtual address to a physical address. Accessing TLB happens after address generation in real hardware, we put this function here just to mark the exceptions of TLB misses. However, we do simulate the TLB timing model after address generation, ensuring the accuracy of TLB simulator. 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 Chapter 7. 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 3). 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 2 For some operations, the minimum alignment requirement specified in the ISA is smaller than the actual length of data transferred. However, we simulate a processor that traps and emulates instructions that are not aligned on a boundary equal to their length, as these seem more appropriate for high-performance implementation. That is, the possibility of having multiple cache line accesses and multiple page faults for a single instruction seems to be an undesirably difficult problem. 70