1. Field of the Invention
This invention relates to the field of data processing systems. More particularly, this invention relates to the provision of reset signals within data processing systems.
2. Description of the Prior Art
It is known to provide data processing systems with reset signals which, when asserted, trigger the data processing system to perform a reset operation. Reset operations typically reinitialise the data processing system and place it into a known state/configuration. When first powered on, a data processing system normally starts from this reset configuration and then initialises itself to the point where it is ready to start useful processing (i.e. a power-on reset). A reset signal may also be asserted during ongoing use, such as on occurrence of an error signal indicating that the system has departed from proper operation when the use of the reset signal can return the system to a known state. It is also known to provide systems with functional circuitry (for executing a stream of program instructions) and diagnostic circuitry for performing debug/diagnostic operations on the functional circuitry. The functional circuitry and the diagnostic circuitry may have separate reset signals.
The initialisation or reinitialisation performed as part of a reset operation is typically extensive and can take many hundreds or thousands of processing cycles. Various state parameters within the data processing system need to be set to known values in order to place the system into a determined overall state from which normal processing can start. Examples of the state parameters which may require resetting are valid flags within a cache memory and memory management unit (or memory protection unit). Upon occurrence of a reset, a cache memory, a memory management unit (or a memory protection unit) may contain data values but these may be erroneous, or at least vary, and so cause the system not to be in a known state. Accordingly, the reset processing must go through the cache memory, memory management unit or (memory protection unit) writing all the valid flags to indicate that the data is invalid. A consequence of this processing typically required upon occurrence of a reset is that the latency associated with the time between the reset signal being asserted and the time at which the system is ready to continue processing is large.
A further use of reset is to place the system into a known configuration such that predictable processing can thereafter be performed. As an example, a data processing system may include a branch prediction mechanism. The current state of the branch prediction mechanism can have a significant impact upon how quickly a given sequence of program instructions will execute. If the branch prediction mechanism contains correct predictions, then the sequence may execute rapidly. Conversely, if the branch prediction mechanism does not contain data allowing it to make correct predictions, then execution of the same sequence of processing instructions may take considerably longer. This can be a significant problem when seeking to benchmark the behaviour of a data processing system, investigate bugs within a data processing system or provide highly consistent behaviour, such as in safety critical systems.
Viewed from one aspect the present invention provides apparatus for processing data comprising:
a processor responsive to a stream of program instructions to execute processing operations in a sequence corresponding to a program flow, said processor having a plurality of state parameters of non-diagnostic circuitry within said processor;
a reset circuit responsive to a reset signal to trigger a reset operation, said reset operation resetting said plurality of state parameters of said processor and forcing a change of said program flow; and
at least one partial reset circuit responsive to a partial reset signal to trigger a partial reset operation, said partial reset operation resetting a proper subset of said plurality of state parameters of said processor and permitting a continuation of said program flow.
The present technique recognises that while a standard reset operation is useful in data processing systems, it has an associated disadvantageously long latency associated with its operation and is illsuited to use in many situations in which it is desired to place the system into a known state before continuing processing. Thus, in addition to the normal reset operation which resets a plurality of state parameters (but not necessarily every state parameter of the processor) and forces a change of program flow, e.g. triggers processing to follow a reset vector, the present technique additionally provides for at least one additional partial reset signal which triggers a partial reset operation that resets a proper subset of the plurality of data parameters (relating to non-diagnostic circuitry within the processor, e.g. not state parameters of a breakpoint/watchpoint unit or a tracing unit) that are reset by the full reset signal and which permits a continuation of the program flow, i.e. does not alter the program flow from that which would otherwise take place (the same sequence of program instructions will be executed although the timing may alter). It will be appreciated that some diagnostic circuitry can alter the non-diagnostic state and such embodiments are encompassed.
The partial reset signal may be generated in a number of ways. As examples, the partial reset signal may be generated as an external signal and/or under hardware control. The partial reset signal may also be generated in response to a program instruction executed by the apparatus, e.g. a partial reset instruction may be added to the instruction set which triggers generation of the partial reset signal, or the partial reset signal may be generated in response to a received diagnostic control signal, e.g. a debug signal or pattern of debug signals may trigger the debug system to generate a partial reset.
While the proper subset of the plurality of state parameters which are reset by the partial reset operation may vary and be distributed throughout the apparatus, it is more usual within an apparatus comprising a plurality of functional circuit blocks to arrange the proper subset such that it serves to reset one or more of the plurality of functional circuit blocks, while other of the functional circuit blocks are not reset and continue to hold their state values. These other functional circuit blocks which are not reset by the partial reset operation may instead, if required, be reset by software instructions if they are accessible using the programming model of the apparatus.
The technique of providing partial reset operations is particularly useful in the context of an apparatus containing a plurality of processors and in which the pluralities of processors may operate in either a locked mode or a split mode. In the locked mode of operation each of the processors separately and during a corresponding processing cycle executes a common processing operation to generate respective processing results such that these processing results may be compared by comparison circuitry to identify incorrect operation. This is useful in providing a high resistance to errors. In the split mode of operation, each of the plurality of processors may separately and during the same processing cycle execute a different processing operation to generate respective different processing results, i.e. each processor may follow its own program flow.
Within the context of such systems synchronisation circuitry may be provided to generate a partial reset signal for each of the processors upon switching from the split modes to the locked mode such that a proper subset of the plurality of state parameters is reset to common values before processing operations in the locked mode commence. Thus, each of the processors may be placed into the same state before locked mode operation commences while not incurring the large latency overhead associated with a full reset. The partial reset operation may reset only those state parameters necessary to achieve proper locked operation, or at least those which are not otherwise accessible to software and so capable of being placed into a known state by execution of an appropriate normalising sequence of program instructions.
The switching between the split mode and the locked mode may take place via a quiescent mode in which execution of processing operations is halted awaiting receipt of a wake-up signal. Thus, each of the processors may be normalised (i.e. through use of the partial reset signal and/or any normalising software) and then placed into the quiescent mode waiting for the remainder of the processors to also be ready to start the locked mode of operation. Thus, when the synchronisation circuitry detects that each of the processors is within the quiescent mode then they may be subject to a wake-up signal asserted to trigger the plurality of processors to together enter the locked mode of operation.
It is possible for the system to contain multiple clock domains and multiple power domains with the different functional blocks split between these in differing ways. In some embodiments the processor which is subject to the normal full reset signal and the partial reset signal may be within a single clock domain.
The plurality of state parameters which are subject to reset, at least within the proper subset of the plurality of state parameters, are micro-architectural parameters that are not part of a programming model of the processor. Thus, these micro-architectural parameters are not able to be placed into a known condition by the execution of software in a convenient manner.
It will be appreciated that the effect of the partial reset can vary and in particular which functional units are subject to the partial reset can vary between different implementations of the present technique. Examples of functional blocks which are not reset by the partial reset include a register bank, a cache memory, and a memory control unit (such as a memory management unit or a memory protection unit).
In a similar way, the functional units which are reset by the partial reset operation can vary. Examples of functional units which are reset by the partial reset operation include branch prediction circuitry, a processing pipeline (i.e. pipeline state such as interlocks, forwarding paths etc), a hard-error cache memory, a prefetch unit and/or a call return stack.
Viewed from another aspect the present invention provides apparatus for processing data comprising:
processor means responsive to a stream of program instructions for executing processing operations in a sequence corresponding to a program flow, said processor means having a plurality of state parameters of non-diagnostic circuitry within said processor;
reset means responsive to a reset signal for triggering a reset operation, said reset operation resetting said plurality of state parameters of said processor and forcing a change of said program flow; and
at least one partial reset means responsive to a partial reset signal for triggering a partial reset operation, said partial reset operation resetting a proper subset of said plurality of state parameters of said processor and permitting a continuation of said program flow.
Viewed from a further aspect the present invention provides a method of processing data, said method comprising the steps of:
in response to a stream of program instructions, executing with a processor processing operations in a sequence corresponding to a program flow, said processor having a plurality of state parameters of non-diagnostic circuitry within said processor;
in response to a reset signal, triggering a reset operation, said reset operation resetting said plurality of state parameters of said processor and forcing a change of said program flow; and
in response to a partial reset signal, triggering a partial reset operation, said partial reset operation resetting a proper subset of said plurality of state parameters of said processor and permitting a continuation of said program flow.
The above, and other objects, features and advantages of this invention will be apparent from the following detailed description of illustrative embodiments which is to be read in connection with the accompanying drawings.
The first processor 4 and the second processor 6 are within the same clock domain 10 and are subject to a reset signal received from outside of the integrated circuit 2 which serves to fully reset both the first processor 4 and the second processor 6. This reset signal received on reset signal line 12 places state parameters of the first processor 4 and the second processor 6 into known values and redirects program flow to a predetermined reset vector such that a reset processing routine can commence execution. This reset processing routine will typically initialise many other aspects of the first processor 4 and the second processor 6 before these are ready to be released for ongoing processing, e.g. cache memories may be invalidated, state accessible via the programming model set up or at least invalidated etc.
Also illustrated in
The synchronisation circuitry 8 serves to control generation and use of a partial reset signal that is applied to each of the first processor 4 and the second processor 6. The synchronisation circuitry 8 may be responsive to an externally received signal or execution of a predetermined program instruction to initiate a move between a split mode of operation and a locked mode of operation. Before the lock mode of operation can be entered the first processor 4 and the second processor 6 are placed into the same configuration, including state parameters which are not accessible in the programming model. The partial reset signal is applied to each of the first processor 4 and the second processor 6 and serves to set these state parameters, which are not accessible via the programming model and which are a proper subset of the full state of parameters which are reset by the reset signal on reset signal line 12, into a predetermined state. The synchronisation circuitry 8 is itself reset by the reset signal r on reset signal line 12 but is not reset by the partial reset signal pr as the synchronisation circuitry 8 generates this signal and controls the switching of the processors 4, 6 into the locked mode via quiescent states and a wake-up event. The wake-up role of the synchronisation circuitry 8 means it must remain active through the partial reset of other circuit elements.
The sequence of operations upon moving between the split mode of operation and the locked mode of operation is that each of the first processor 4 and the second processor 6 executes a sequence of normalising program instructions which place parameter values accessible in the programming model to a known state and then triggers entry into a quiescent mode of operation in which the processor stops executing instructions and waits for a wake-up signal to be received. When the wake-up signal is received, the processing recommences and there is no redirection of program flow, e.g. the program counter value is not changed and both of the first processor 4 and the second processor 6 start executing from the same point where they were respectively “parked” upon entry into the quiescent mode.
The synchronisation circuitry 8 is responsive to signals from each of the first processor 4 and the second processor 6 indicating that they have entered the quiescent mode. When both the first processor 4 and the second processor 6 are in the quiescent mode, then the synchronisation circuitry 8 generates a partial reset signal directed to the first processor 4 and the second processor 6 which serves to reset a proper subset of the plurality of state parameters which are reset by a full reset into known states. After the partial reset operation has completed, then the synchronisation circuitry 8 generates a wake-up signal which triggers each of the first processor 4 and the second processor 6 to start execution in the locked mode of operation, although they may have one or more clock cycles offset in their operations they will in corresponding processing cycles execute the same processing operations on the same data values to generate the same results if there are no errors within the system.
It will be appreciated that in this example embodiment the partial reset signals and the wake-up signals have been separately illustrated. It will be possible for these to be combined into a single signal to which the respective first processor 4 and the second processor 6 respond by initiating the partial reset operation followed by commencing processing in the locked mode of operation.
It will be further appreciated that while the example illustrated in
Also, provided within the processor 4 are a cache memory 40, a hard error cache 42 and a memory management unit 44 together with a tightly coupled memory 46. The cache memory 40 stores data and instruction values which are supplied to the processing core 22. The hard error cache 42 stores corrected values which have had hard errors identified in them within the values stored within the off-processor memory system, such that the corrected versions of these data values or instructions are supplied directly from the hard error cache 42 when they are reused rather than being refetched in erroneous form from the memory system and subject to error correction. The memory management unit 44 stores page table values for controlling access to the memory, such as mappings between virtual and physical memory, protection attributes and the like. The tightly coupled memory 46 stores a block of data values, such as providing a scratch pad memory for high speed local use by the processing core 22.
Within the processor 4 there is provided reset circuitry 48 and partial reset circuitry 50. The reset circuitry 48 is responsive to a reset signal to reset the full plurality of state parameters which are subject to reset within the processor 4. The reset circuitry 48 is not reset by the partial reset signal pr. This reset signal r is shown as an input to each of the functional units within the processor 4 which is subject to this full reset. In a similar way, the partial reset circuitry 50 is responsive to a received partial reset signal to forward a partial reset pr to those functional units which are subject to this partial reset of operations. It will be seen that the functional units which are subject to the partial reset are a proper subset of the functional units in the whole of the processor 4 and accordingly the state parameters which are subject to partial reset are a proper subset of the state parameters which are subject to the full reset operation. In this example embodiment the register bank 24, the cache memory 40 and the memory management unit are subject to neither the full reset or the partial reset and are instead initialised under software control by execution of normalising program instructions prior to entry into the quiescent mode. The multiplier 26, the shifter 28 and the adder 30 are subject to a full reset under control of the reset signal r, but are not reset by the partial reset signal pr. In some embodiments the multiplier 26, the shifter 28 and the adder 30 may be reset under control of both the reset signal r and the partial reset signal pr to assist normalization when entering a lock-step mode of execution of processors 4 and 6.
Step 70 determines whether all of the processors are now in the quiescent mode. If any of the processors are not yet in the quiescent mode, then processing returns to step 66. If all of the processors are in the quiescent mode, then processing proceeds to step 72 where the synchronisation circuitry 8 generates a wake-up signal for all of the processors to switch the processors from the quiescent mode to the locked mode at which they start executing program instructions in a lock-step fashion.
In the above described embodiment the partial reset signal has been used to assist the switch into a locked mode of operation of a system-on-chip containing multiple processors. The partial reset signal may also be used in other circumstances. For example, the partial reset signal could be useful in benchmarking or security applications. In a system containing branch history circuitry and/or branch prediction circuitry, then a partial reset signal may be used to reset this circuitry into a predetermined state before running a benchmark. In this way, more reliable comparisons may be made between different occasions upon which the benchmark is nm. If the branch history or branch prediction circuitry is not in a known state when a benchmark is run, then the variable state of this circuitry may have a considerable impact upon the speed and manner of operation of the system during the benchmarking. This normalizing before benchmarking can also apply to other circuit elements/state such as data history buffers, translation lookaside buffers etc. Furthermore, the branch history and branch prediction mechanisms may contain sensitive information regarding the past behavior of a system which it may be desirable to remove when executing a secure state. Thus, when switching between a secure mode of operation and non-secure mode of operation it may be desirable to issue a partial reset signal to the branch history and/or branch prediction mechanisms within a system in order that no information regarding the past behavior of the system in the secure mode may leak into the non-secure mode via these mechanisms. The partial reset can also be applied to all secure/sensitive state. The present techniques thus provide apparatus and methods for improved benchmarking as well as improved systems which offer both secure modes of operation and non-secure modes of operation (e.g. the TrustZone enabled processors designed by ARM Limited of Cambridge, England).
Although illustrative embodiments of the invention have been described in detail herein with reference to the accompanying drawings, it is to be understood that the invention is not limited to those precise embodiments, and that various changes and modifications can be effected therein by one skilled in the art without departing from the scope and spirit of the invention as defined by the appended claims.