The present invention is directed to data processors, and more particularly to an asynchronous system reset of a data processor.
A common form of volatile memory is random access memory (RAM). A processor may be a micro-controller unit (MCU) or a microprocessor, for example, and the processing system may have one or more processor cores, peripherals such as input/output devices (I/Os) and non-volatile memory for programs. A processor also includes a reset controller for setting the registers, flip-flops, gates and other elements of the processing system to a defined condition or logical state that is independent of any errors or meta-stable events. Reset is performed when power is switched ON or restored, referred to as power-on reset. Reset is also typically performed when an error condition hampers reliable processing and when error recovery mechanisms, like retry or abort, fail.
The reset controller may assert a reset signal on a reset bus to trigger reset synchronously or asynchronously with a system clock. Synchronous system resets include software resets and watchdog resets. Asynchronous resets occur without synchronization with the system clock when an asynchronous reset signal is asserted on a reset input pin, or in the presence of disturbances (‘glitches’) to the system clock. Asynchronous system resets may cause immediate asynchronous change in volatile memory input signals or clock signals, which can result in meta-stability at interfaces with and in the volatile memory, causing write data errors and corruption of the memory data.
Volatile memory data could be protected from corruption by resets if all resets were asserted synchronously. However, deriving a synchronous system reset operation from assertion of an asynchronous reset signal is complicated. For example, it is difficult to ensure proper timing of the synchronous system reset operation throughout the processing system and the synchronous system reset operation involves many changes in program and application libraries. Therefore, it would be advantageous to ensure that memory data is not corrupted during an asynchronous system reset.
The present invention is illustrated by way of example and is not limited by embodiments thereof shown in the accompanying figures, in which like references indicate similar elements. Elements in the figures are illustrated for simplicity and clarity and have not necessarily been drawn to scale.
The data processor 100 also includes a reset controller 106 for controlling reset of the processing system 102, and a RAM controller 108 for controlling access to the RAM module 104 including writing data to the RAM module 104. The operation of the processing system 102 and of the RAM controller 108 is synchronized by system clock signals CLOCK. The reset controller 106 asserts a reset signal to trigger reset. The processor 100 uses complementary logic for reset signals so that assertion of the reset signal corresponds to the voltage of a complementary reset signal RST_B on a reset bus 110 being set to low.
The reset controller 106 asserts the reset signal RST_B to trigger reset synchronously with the system clock signal CLOCK, or asynchronously, or when power supply voltage is initially applied or is restored in a power-on reset. Synchronous system resets include software resets and watchdog resets. Asynchronous resets occur when an asynchronous complementary reset signal ASYNC_RST_B is asserted on a reset input pin 112 without synchronization with the system clock signal CLOCK, or in the presence of disturbances (glitches) to the system clock signal CLOCK. The reset controller 106 asserts the reset signal RST_B on the reset bus 110 immediately when it receives a reset request on the pin 112, for a reset in the relevant domain of the processing system 102. The assertion of the reset signal RST_B resets the elements of the processing system 102 to a defined state, in this example by the reset signal applied to reset inputs of the elements of the processing system forcing the output Q of the elements to de-assert.
The RAM controller 108 provides control signals RAM_CS_B on a line 116 input to the RAM module 104 for RAM write operations of the output signals of the processing system 102. The RAM controller 108 also provides control signals WRITE_ENABLE and data signals WRITE_DATA and WRITE_ADDRESS (not shown in
Since the signals RAM_CS_B, WRITE_ENABLE, WRITE_DATA and WRITE_ADDRESS applied to the input of the RAM module 104 are normally synchronized with the system clock signals CLOCK but the asynchronous reset signals ASYNC_RST_B are not, reset may occur while a write operation is occurring, with a consequent risk of corruption of the data stored in the RAM module 104, as illustrated in
Also, as illustrated in
The data processor 400 also includes a reset controller 402 for controlling reset of the processing system 102 and a volatile memory controller 108 for controlling access to the RAM 104 including writing data to the RAM 104. The operations of the processing system 102 and of the volatile memory controller 108 are synchronized by system clock signals CLOCK. The reset controller 402 responds to an asynchronous reset signal ASYNC_RST_B to inhibit write operations of the volatile memory controller 108 to the RAM 104 and to delay reset of the processing system 102 until the write operations are inhibited.
In more detail, the reset controller 402 asserts a complementary reset signal GLOBAL_RESET_B on a reset bus 404 to trigger reset synchronously with the system clock signal CLOCK, or asynchronously, or when power supply voltage is initially applied or is restored in a power-on reset in response to assertion of a power-on reset signal POR_B on a pin 406. The reset controller 402 triggers reset in the relevant domain of the processing system 102. Synchronous system resets include software resets and watchdog resets, for example. Assertion of the complementary asynchronous reset signal ASYNC_RST_B on the reset input pin 112 occurs without synchronization with the system clock, or in the presence of disturbances or glitches to the system clock.
The reset controller 402 asserts a reset signal to trigger reset. In this example, complementary logic is used for reset of the elements of the processing system 102 so that assertion of the reset signal corresponds to the voltage of the complementary reset signal GLOBAL_RST_B on the reset bus 404 being set to low. However it will be appreciated that assertion of a signal instead of a complementary signal and high instead of low voltage values are possible if the logic circuits are suitably adapted.
The reset controller 402 responds to the assertion of a power-on reset signal (low voltage of the complementary power-on reset signal POR_B) to reset the processing system 102 during a power-on reset period defined by a number of the system clock signals CLOCK. In this example, the data processor 400 includes a six-stage binary counter that counts the system clock signals CLOCK to extend the power-on reset period so that sixty-four valid system clock signals CLOCK occur before the end of the power-on reset, leaving time for the clock to stabilize after the power supply is switched ON or restored.
The reset controller 402 responds to an asynchronous reset signal to reset the processing system 102 after an asynchronous reset delay defined by a number of the system clock signals CLOCK. In this example, the asynchronous reset delay is defined by assertion of a signal (voltage low) at an output 408 of a chain 410 of four flip-flops whose input receives the complementary asynchronous reset signal ASYNC_RST_B, the flip-flops of the chain 410 being clocked by the system clock signals CLOCK, so that the changes of the signal at the output 408 are delayed by four cycles of the system clock signals CLOCK relative to the complementary asynchronous reset signal ASYNC_RST_B. The signal at the output 408 of the chain 410 is applied to a ‘1’ input of a multiplexer 412, whose inverse ‘0’ input receives the complementary asynchronous reset signal ASYNC_RST_B from the pin 112 directly.
The reset controller 402 includes a clock signal monitor 414. The reset controller 402 responds to an asynchronous reset signal ASYNC_RST_B to reset the processing system 102 without the asynchronous reset delay if the clock signal monitor 414 does not indicate presence of valid system clock signals CLOCK. The clock signal monitor 414 includes an internal clock generator (not shown) and indicates presence of the system clock signals CLOCK in response to edges of the system clock signal occurring within a delay defined by a number of internal clock signals from the internal clock generator. In this example, the reset controller 402 includes an AND gate 415 that receives the output of the multiplexer 412 on one input and the complementary power-on reset signal POR_B on another input. The output of the AND gate 415 is applied to the reset bus 404 so that the complementary reset signal GLOBAL_RST_B is asserted (voltage low), to reset the processing system 102 if either of the inputs of the AND gate 415 is asserted. Accordingly, the output of the AND gate 415 is asserted, immediately a power-on reset is requested, or if the output of the delay chain 410 is asserted after timing the delay of an asynchronous reset request, or if the complementary asynchronous reset signal ASYNC_RST_B is asserted and the clock monitor 414 does not detect valid system clock signals CLOCK. The clock monitor 414 asserts a signal CLOCK_PRESENT at the multiplexer 412 unless no valid clock signals CLOCK are detected, in which case the multiplexer 412 passes the complementary asynchronous reset signal ASYNC_RST_B to its output as the complementary reset signal GLOBAL_RST_B. The output of the AND gate 415 is only de-asserted (voltage high), to leave the processing system 102 functioning, if both the inputs of the AND gate 415 are de-asserted. Immediate reset of the processing system 102 in response to a power-on reset request or absence of valid system clock signals is acceptable, since no valid data or system clock signals for write operations into the RAM module 104 are available and it prevents use of the system clock signal before it is stable.
The reset controller 402 responds to an asynchronous reset signal ASYNC_RST_B by synchronously inhibiting write operations of the volatile memory controller 108 into the volatile memory module 104 after an inhibit delay defined by a number of the system clock signals CLOCK. In this example, the inhibit delay is defined by assertion of an inhibit signal SAFE_STATE_RAM_B (voltage low) at an output 416 of a chain 418 of two flip-flops whose input receives the complementary asynchronous reset signal ASYNC_RST_B, the flip-flops of the chain 418 being clocked by the system clock signals CLOCK. In this example, the changes of the signal at the output 416 are delayed by two cycles of the system clock signals CLOCK relative to the complementary asynchronous reset signal ASYNC_RST_B. The inhibit delay allows the inhibit operation to occur synchronously, provided valid system clock signals CLOCK are present.
In response to the assertion of the complementary power-on reset signal POR_B, the reset controller 402 resets the reset delay elements timing delay of reset of said processing system during the power-on reset period in response to an asynchronous reset signal. In this example, the reset delay elements are the flip-flops of the chain 410. In response to the assertion of the complementary power-on reset signal POR_B, the reset controller 402 also resets during the power-on reset period the inhibit delay elements timing delay of inhibit of write operations of the volatile memory controller into the volatile memory module. In this example, the inhibit delay elements are the flip-flops of the chain 418.
The volatile memory controller 108 provides control signals RAM_CS_B on a line 116 for volatile memory write operations of the output signals of the processing system 102. The volatile memory controller 108 also provides control signals WRITE_ENABLE and data signals WRITE_DATA and WRITE_ADDRESS (not shown in
If no power-on reset request is asserted at 604, the method detects at 612 whether a synchronous reset request is asserted. If a synchronous reset request is asserted at 612, reset of the processing system is asserted at 614, in this example after a brief delay of one system clock cycle, to ensure any write operation in the volatile memory module is completed first. The reset then ends at 610 and normal operation of the data processor starts.
If no synchronous reset request is asserted at 612, the method detects at 616 whether an asynchronous reset request is asserted. If at 616 an asynchronous reset request is asserted, the method checks at 618 whether valid system clock signals are present. If valid system clock signals are present at 618, at 620 the method times inhibit and reset delays, the inhibit delay being shorter than the reset delay. In this example, the inhibit delay lasts two cycles of the system clock and the reset delay lasts four cycles of the system clock from assertion of the asynchronous reset request at 616. At the end of the inhibit delay, at 622 the method inhibits writing operations into the volatile memory module. Subsequently, at the end of the reset delay, delayed reset of the processing system is asserted at 624. The reset then ends at 610 and normal operation of the data processor starts.
If valid system clock signals are not present at 618, a reset of the processing system is asserted immediately at 626. The reset then ends at 610 and normal operation of the data processor starts. If at 616 no asynchronous reset request is asserted, normal operation of the data processor continues without reset.
The invention may be implemented using portions of processor code for performing steps of a method according to the invention when run on a programmable apparatus, such as a computer system or enabling a programmable apparatus to perform functions of a device or system according to the invention.
A computer program is a list of instructions such as a particular application program and/or an operating system in processor code. The computer program may for instance include one or more of: a subroutine, a function, a procedure, an object method, an object implementation, an executable application, an applet, a servlet, a source code, an object code, a shared library/dynamic load library and/or other sequence of instructions designed for execution on a computer system.
The computer program may be stored internally on computer readable storage medium or transmitted to the computer system via a computer readable transmission medium. All or some of the computer program may be provided on computer readable media permanently, removably or remotely coupled to an information processing system. The computer readable media may include, for example and without limitation, any number of the following: magnetic storage media including disk and tape storage media; optical storage media such as compact disk media (e.g., CD-ROM, CD-R, etc.) and digital video disk storage media; nonvolatile memory storage media including semiconductor-based memory units such as FLASH memory, EEPROM, EPROM, ROM; ferromagnetic digital memories; MRAM; volatile storage media including registers, buffers or caches, main memory, RAM, etc.; and data transmission media including computer networks, point-to-point telecommunication equipment, and carrier wave transmission media, just to name a few.
In the foregoing specification, the invention has been described with reference to specific examples of embodiments of the invention. It will, however, be evident that various modifications and changes may be made therein without departing from the broader spirit and scope of the invention as set forth in the appended claims.
The connections as discussed herein may be any type of connection suitable to transfer signals from or to the respective nodes, units or devices, for example via intermediate devices. Accordingly, unless implied or stated otherwise, the connections may be direct connections or indirect connections. The connections may be illustrated or described in reference to being a single connection, a plurality of connections, unidirectional connections, or bidirectional connections. However, different embodiments may vary the implementation of the connections. For example, separate unidirectional connections may be used rather than bidirectional connections and vice versa. Also, a plurality of connections may be replaced with a single connection that transfers multiple signals serially or in a time multiplexed manner. Likewise, single connections carrying multiple signals may be separated out into various different connections carrying subsets of these signals. Therefore, many options exist for transferring signals.
Each signal described herein may be designed as positive or negative logic. In the case of a negative logic signal, the signal is active low where the logically true state corresponds to a logic level zero. In the case of a positive logic signal, the signal is active high where the logically true state corresponds to a logic level one. Note that any of the signals described herein can be designed as either negative or positive logic signals. Therefore, in alternate embodiments, those signals described as positive logic signals may be implemented as negative logic signals, and those signals described as negative logic signals may be implemented as positive logic signals.
The terms “assert” or “set” and “negate” (or “de-assert” or “clear”) are used herein when referring to the rendering of a signal, status bit, or similar apparatus into its logically true or logically false state, respectively. If the logically true state is a logic level one, the logically false state is a logic level zero. And if the logically true state is a logic level zero, the logically false state is a logic level one.
Those skilled in the art will recognize that the boundaries between logic blocks are merely illustrative and that alternative embodiments may merge logic blocks or circuit elements or impose an alternate decomposition of functionality upon various logic blocks or circuit elements. Thus, it is to be understood that the architectures depicted herein are merely exemplary, and that in fact many other architectures can be implemented which achieve the same functionality. Similarly, any arrangement of components to achieve the same functionality is effectively “associated” such that the desired functionality is achieved. Hence, any two components combined to achieve a particular functionality can be seen as “associated with” each other such that the desired functionality is achieved, irrespective of architectures or intermediate components. Likewise, any two components so associated can also be viewed as being “operably connected,” or “operably coupled,” to each other to achieve the desired functionality.
Furthermore, those skilled in the art will recognize that boundaries between the above described operations merely illustrative. The multiple operations may be combined into a single operation, a single operation may be distributed in additional operations and operations may be executed at least partially overlapping in time. Moreover, alternative embodiments may include multiple instances of a particular operation, and the order of operations may be altered in various other embodiments.
Also for example, in one embodiment, the illustrated examples may be implemented as circuitry located on a single integrated circuit or within a same device. The examples, or portions thereof, may implemented as soft or code representations of physical circuitry or of logical representations convertible into physical circuitry, such as in a hardware description language of any appropriate type.
Also, the invention is not limited to physical devices or units implemented in non-programmable hardware but can also be applied in programmable devices or units able to perform the desired device functions by operating in accordance with suitable program code, such as mainframes, minicomputers, servers, workstations, personal computers, notepads, personal digital assistants, electronic games, automotive and other embedded systems, cell phones and various other wireless devices, commonly denoted in this application as ‘computer systems’.
In the claims, the word ‘comprising’ or ‘having’ does not exclude the presence of other elements or steps then those listed in a claim. Furthermore, the terms “a” or “an,” as used herein, are defined as one or more than one. Also, the use of introductory phrases such as “at least one” and “one or more” in the claims should not be construed to imply that the introduction of another claim element by the indefinite articles “a” or “an” limits any particular claim containing such introduced claim element to inventions containing only one such element, even when the same claim includes the introductory phrases “one or more” or “at least one” and indefinite articles such as “a” or “an.” The same holds true for the use of definite articles. Unless stated otherwise, terms such as “first” and “second” are used to arbitrarily distinguish between the elements such terms describe. Thus, these terms are not necessarily intended to indicate temporal or other prioritization of such elements. The fact that certain measures are recited in mutually different claims does not indicate that a combination of these measures cannot be used to advantage.