CROSS-REFERENCE TO RELATED APPLICATIONS/INCORPORATION BY REFERENCEThis application makes reference to, claims priority to, and claims the benefit of U.S. Provisional Application Ser. No. 60/590,664 filed Jul. 23, 2004.
The above stated application is hereby incorporated herein by reference in its entirety.
FIELD OF THE INVENTIONCertain embodiments of the invention relate to data protection. More specifically, certain embodiments of the invention relate to a method and system for blocking data in scan registers from being shifted out of a device.
BACKGROUND OF THE INVENTIONScan mode is a mode where all scan chain flip-flops in a chip may be tested using the test methodology known in the art as boundary scan. A chip may alternately be known as an integrated circuit, integrated circuit chip, integrated circuit device, or device, which comprises a plurality of flip flops arranged in a scan chain. Scan mode may exist on all the flip-flops in an entire chip which may be configured in very long chains or which may be arranged into smaller segments. Scan mode may be utilized for factory testing. The flip-flops may be connected in a daisy chain configuration and during scan testing, designated bit patterns of logic 0's and logic 1s may be shifted through the daisy-chained flip-flops. A control circuit may be utilized to clock data that has been shifted into the daisy-chained flip-flops in order to shift the clocked data by one flip-flop. The resulting shifted data may then be shifted back out and compared with the data that was shifted in order to determine whether there are any stuck bits, broken links, open circuits, shorts, and/or other defects.
In certain instances, important information such as security keys may be stored in the flip-flops of a chip when the chip is functioning in normal operating mode. Whenever this happens, all the data in the flip-flop may be shifted out of the scan chain in order to capture all of the states of the flip-flops. These states of the flip-flops may include information pertaining to all of the keys. Accordingly, with knowledge of the internals of the chip, one skilled in the art may be able to assemble all this information and decipher the keys in order to compromise data integrity.
In set-top boxes that have conditional access systems, for example, a hacker may halt the normal operation of the chip and enter scan mode, which is utilized to test the flip-flops. Once access is gained to the flip-flop during scan mode, the data in the flip-flops may be acquired by shifting out the contents of at least a portion of the flip-flops that have secure information stored therein. Accordingly, access to scan mode should be prevented during operation to ensure integrity of data such as security keys that are stored in the flip-flops of a chip.
Further limitations and disadvantages of conventional and traditional approaches will become apparent to one of skill in the art, through comparison of such systems with some aspects of the present invention as set forth in the remainder of the present application with reference to the drawings.
BRIEF SUMMARY OF THE INVENTIONCertain embodiments of the invention may be found in a method and system for blocking data in scan registers from being shifted out of a device. Aspects of the method for preventing data intrusion in an integrated circuit may comprise generating a device reset signal prior to entering scan mode. The method may further comprise detecting an attempt to enter scan mode. In one aspect of the invention, the device reset signal may be an internal reset signal. Notwithstanding, a subsequent device reset signal may be generated after entering scan mode. The subsequent device reset signal may be an internal pulse signal. Stored data in the integrated circuit may be cleared after generating a subsequent device reset signal.
The method may comprise extending an external reset signal to generate an internal pulse signal after entering scan mode, and receiving the external reset signal and an external scan mode signal. A scan testmode signal may be generated by latching an external scan mode signal based upon the device reset signal. A scan testmode delay signal may be generated based upon a delayed version of the scan testmode signal. An internal pulse signal may be generated based upon the scan testmode signal and the scan testmode delay signal. The method may further comprise generating the internal pulse signal as a logical XNOR sum of the scan testmode signal and the scan testmode delay signal.
Aspects of a system for blocking data in scan registers from being shifted out of a device may comprise circuitry that prevents data intrusion in an integrated circuit by generating a device reset signal prior to entering scan mode. The system may further comprise circuitry that may be adapted to detect an attempt to enter scan mode. In one aspect of the invention, the device reset signal may be an internal reset signal. Circuitry may be provided for generating a subsequent device reset signal after entering scan mode. The subsequent device reset signal may be an internal pulse signal. Circuitry may be adapted to clear stored data in the integrated circuit after generating the subsequent device reset signal.
The system may comprise circuitry that extends an external reset signal to generate an internal pulse signal after entering scan mode. The system may further comprise circuitry that receives the external reset signal and an external scan mode signal. A scan testmode signal may be generated by latching an external scan mode signal based upon the device reset signal. Circuitry may be provided to generate a scan testmode delay signal based upon a delayed version of the scan testmode signal. An internal pulse signal may be generated by circuitry based upon the scan testmode signal and the scan testmode delay signal. The system may further comprise circuitry that generates the internal pulse signal as a logical XNOR sum of the scan testmode signal and the scan testmode delay signal.
These and other advantages, aspects and novel features of the present invention, as well as details of an illustrated embodiment thereof, will be more fully understood from the following description and drawings.
BRIEF DESCRIPTION OF SEVERAL VIEWS OF THE DRAWINGSFIG. 1 is a block diagram of an exemplary system for blocking data in scan registers from being shifted out of a device, in accordance with an embodiment of the invention.
FIG. 2 is a block diagram illustrating the reset conditioning stage ofFIG. 1, for example, in accordance with an embodiment of the invention.
FIG. 3 is a block diagram illustrating circuitry for the reset generation stage ofFIG. 1, for example, in accordance with an embodiment of the invention.
FIG. 4 is a block diagram illustrating circuitry for pulse generation, in accordance with an embodiment of the invention.
FIG. 5 is a block diagram illustrating circuitry for reset synchronization, in accordance with an embodiment of the invention.
FIG. 6 is a diagram illustrating a timing diagram of signals in the exemplary system ofFIG. 1, for example, in accordance with an embodiment of the invention.
FIG. 7 is a flow chart illustrating exemplary steps in the operation of an exemplary system, in accordance with an embodiment of the invention.
DETAILED DESCRIPTION OF THE INVENTIONCertain embodiments of the invention may be found in a method and system for blocking data in scan registers from being shifted out of a device. In an embodiment of the invention, whenever an attempt is made to activate or enter scan mode, a chip-wide reset is generated to the flip-flops throughout the chip. The chip-wide reset may be an asynchronous reset event. Notwithstanding, when a reset is issued to the flip-flops within the chip, all the data in the flip-flops gets cleared. Accordingly, if scan mode is entered after the reset is issued, then the keys or data related to the keys will no longer be present in the flip-flops. Since scan mode is not intended to be utilized outside of factory testing, clearing of the flip-flops prior to entering scan mode does not adversely affect operation of the chip. In addition to clearing all the flip-flops prior to entering scan mode, another aspect of the invention ensures that scan mode cannot be entered until after a reset is issued. As a result, entering scan mode ensures that all the flip-flops in the chip are cleared in order to guarantee that security key or key related data handled by the chip is not compromised.
FIG. 1 is a block diagram of an exemplary system for blocking data in scan registers from being shifted out of a device, in accordance with an embodiment of the invention. Referring toFIG. 1, the exemplary system comprises anintegrated circuit100, which in turn comprises areset conditioning stage102, areset generation stage104, and areset synchronization stage106. An external reset (extrst) signal108 is coupled to an input to thereset conditioning stage102 as is a clock1 (clock_1) signal110 and a test enable (test_en)signal112. Theinternal reset signal114 is an output from thereset conditioning stage102. Thereset generation stage104 may be adapted to receive as an input, theinternal reset signal114 and a scan mode (scan_mode)signal116. Outputs from the reset generation stage are an asynchronous reset (async_reset) signal118 and a scan testmode (scan_testmode) signal120. The reset synchronization stage receives as inputs the asynchronous reset (async_reset) signal118 and scan testmode (scan_testmode) signal120 and a clock2 (clock_2)signal122. The chip flip flop reset (chip_flip_flop_reset) signal124 is the output from the reset synchronization stage.
FIG. 2 is a block diagram illustrating the reset conditioning stage ofFIG. 1, for example, in accordance with an embodiment of the invention. Referring toFIG. 2, the reset conditioning stage comprisesdeglitching flip flops202 and204, a logical ORgate206, and amultiplexer208. The external reset (extrst) signal210 signal is provided as an input of theflip flop202. Theclock signal211 is coupled to bothflip flops202 and204. The test enable (test_en) signal212 is provided as an input to themultiplexer208. The output signal generated by themultiplexer208 is theinternal reset signal216. Anintermediate signal214 is provided as an output of the logical ORgate206.
Flip flops202 and204 may be adapted to perform a deglitching function on the external reset (extrst) signal210 by filtering transient glitches in the external reset (extrst)signal210.Flip flop202 may generate a signal which is delayed in time by, for example, one period of theclock signal211 from the external reset (extrst)signal210.Flip flop204 may generate a signal which is delayed in time by, for example, two periods of theclock signal211 from the external reset (extrst)signal210. The external reset (extrst) signal210, along with outputs fromflip flops202 and204 may be provided as inputs to the logical ORgate206. Theflip flops202 and204 may be configured to filter transient glitches which may occur in the external reset (extrst)signal210. A signal level in the external reset (extrst) signal210 that is latched intoflip flop202 may be presented in theintermediate signal214 through, for example, 2 additional periods of theclock signal210. The test enable (test_en) signal212 may control themultiplexer208. When the test enable (test_en) signal is asserted to a logical high state, themultiplexer208 may couple the external reset (extrst) signal210 to theinternal reset signal216, which is the output from themultiplexer208. When the test enable (test_en) signal is deasserted, for example, to a low state, themultiplexer208 may couple theintermediate signal214 to theinternal reset signal216, which is the output from themultiplexer208.
FIG. 3 is a block diagram illustrating circuitry for the reset generation stage ofFIG. 1, for example, in accordance with an embodiment of the invention. Referring toFIG. 3 the reset generation stage comprises apulse generation block302, and a logical ANDgate304. Theinternal reset signal306 may be provided as an input to the logical ANDgate304 and to an input to thepulse generator block302. The scan mode (scan_mode) signal308 may be provided as an input to thepulse generator block302. The pulse generatorblock generator block302 may be adapted to generate a scan_testmode (scan_testmode) signal310, and aninternal pulse312. Theinternal pulse312 may be coupled to an input to the logical ANDgate304. The logical ANDgate304 may generate an asynchronous reset (async_reset)signal314. Thepulse generator block302 may utilize theinternal reset signal306 and the scan mode (scan_mode) signal308 to generate theinternal pulse312 and the scan testmode (scan_testmode) signal310. The logical ANDgate304 may adapt a logical AND product of theinternal reset signal306 and theinternal pulse312 to generate the asynchronous reset (async_reset)signal314.
FIG. 4 is a block diagram illustrating circuitry for pulse generation, in accordance with an embodiment of the invention. Referring toFIG. 4 the pulse generation block comprises alatch402, atime delay element404, which may be implemented utilizing a plurality of buffers, and alogical XNOR gate406. Theinternal reset signal408 may be provided as an input to thelatch402. The scan mode (scan_mode) signal410 may also be provided as an input to thelatch402. The scan testmode (scan_testmode) signal412 may be generated from an output of thelatch402. The scan testmode (scan_testmode) signal412 may also be provided as an input to thedelay element404. The output from thetime delay element404 is the scan testmode delay (scan_testmode_delay)signal414. The scan testmode (scan_testmode) signal412 may be provides as an input to thelogical XNOR gate406. The scan testmode delay (scan_testmode_delay) signals may also be provided as an input to thelogical XNOR gate406. The output from thelogical XNOR gate406 may be utilized as aninternal pulse signal416.
When theinternal reset408 signal is deasserted at the input of thelatch402, the scan mode (scan_mode) signal410 present at the input of thelatch402 may be utilized to generate the scan testmode (scan_testmode)signal412. Thetime delay element404 may generate a scan testmode delay (scan_testmode_delay) signal414 which may represent a recreation of the scan testmode (scan_testmode) signal that has been delayed by a determined amount of time. Thelogical XNOR gate406 may generate aninternal pulse signal416 based upon adapting a logical XNOR sum of the scan testmode (scan_testmode) signal412 and the scan testmode delay (scan_testmode_delay)signal414. The amount of time delay which is introduced by thetime delay element404 may create an interval of time during which the logic level of the scan testmode (scan_testmode) signal412 may differ from the logic level of the scan testmode delay (scan_testmode_delay) signal414 at the inputs of thelogical XNOR gate406. During that interval, the output from the logical XNOR gate may be deasserted. When the logic level of the scan testmode (scan_testmode) signal412 does not differ from the logic level of the scan testmode delay (scan_testmode_delay) signal414, the output from the logical XNOR gate may be asserted. Thus, in the time domain, theinternal pulse signal416 may represent a pulse at the deasserted logic level whose width is based upon the amount of delay, which is introduced by thetime delay element404. There may be no such minimum pulse width constraint on theinternal reset signal408.
FIG. 5 is a block diagram illustrating circuitry for reset synchronization in accordance with an embodiment of the invention. Referring toFIG. 5 the reset synchronization stage may comprise synchronizingflip flops502 and504, and amultiplexer506. The asynchronous reset (async_reset) signal508 may be an input to flipflop502. The clock2 (clock_2) signal509 may be provided as an input to flipflops502 and504. The asynchronous reset (async_reset) signal508 may also be provided as an input to themultiplexer506. The scan testmode (scan_testmode) signal510 may be provided as an input to themultiplexer506. The output fromflip flop504 may be provided as to an input of themultiplexer506. The chip flip flop reset (chip_flip_flop_reset) signal512 may be generated as an output from themultiplexer506.
Theflip flops502 and504 may perform a clock synchronization of the reset signal to the clock domains of the flip flops on the chip. The flip flops may achieve this by latching inputs synchronously with the clock2 (clock_2)signal509. Theflip flops502 and504 may also be adapted to extend or stretch the length of the reset signal in accordance with timing needs on the chip. In this regard, the length of the reset signal pulse is extended to ensure that all the flip-flops are reset chip-wide. The output fromflip flop502 may reflect the asynchronous reset (async_reset) signal508 delayed by a period of time of one cycle of the clock2 (clock_2)signal509. The output fromflip flop504 may reflect the asynchronous reset (async_reset) signal508 delayed by a period of time of two cycles of the clock2 (clock_2)509 clock. The scan testmode (scan_testmode) signal510 may control themultiplexer506. When the scan testmode (scan_testmode) signal510 is asserted the multiplexer may couple the asynchronous reset (async_reset) signal508 to the chip flip flop reset (chip_flip_flop_reset) signal512 which is output from themultiplexer506. When the scan testmode (scan_testmode) signal510 is deasserted the multiplexer may be adapted to couple the output fromflip flop504 to the chip flip flop reset (chip_flip_flop_reset) signal512 which may be generated as an output from themultiplexer506. The chip flip flop reset (chip_flip_flop_reset) signal512 may be the signal which effects the reset of flip flops on a chip.
In operation the test enable (test_en) signal112 inFIG. 1 is asserted during scan mode. This may ensure that the external reset (extrst) signal (108 inFIG. 1) is coupled to the internal reset signal (114 inFIG. 1), bypassing the deglitching flip flops in the reset conditioning stage (102 inFIG. 1). Entry into scan mode may comprise asserting the scan mode signal. However, scan mode may not be initiated until the external reset (extrst) signal is deasserted with the scan mode signal asserted. The external reset signal should reset data contained in flip flops in the chip but if the external reset signal is deasserted for too short of a period of time, there may be instances when all the flip flops may fail to reset completely and data may still be left stored in the flip flops. But the external reset signal, which may be deasserted for too short of a period of time to reset the flip flops, may be long enough to adapt the chip to scan mode. Entry into scan mode with data stored in flip flops may enable data to be shifted out of the chip and captured in an external system, and thereby posing a potential data security breach. The pulse generator block may generate a subsequent internal reset signal, which may ensure that all the flip flops on the chip are reset before entering scan mode.
FIG. 6 is a diagram illustrating a timing diagram of signals in the exemplary system ofFIG. 1, for example, in accordance with an embodiment of the invention.FIG. 6 shows signal levels for a plurality of signals versus time. Referring toFIG. 6, there are shown exemplary timing waveforms for the external reset (extrst) signal602, theinternal reset signal604, the scan mode (scan_mode) signal605, the scan testmode (scan_testmode) signal606, the scan testmode delay (scan_testmode_delay) signal608, theinternal pulse610, the asynchronous reset (async_reset) signal612, and the chip flip flop reset (chip_flip_flop_reset)signal614. In an illustrative embodiment of the invention, it may be assumed that the test enable (test_en) signal (112 inFIG. 1) is asserted, the external reset (extrst) signal (108 inFIG. 1) is asserted prior to time=t1, and the scan mode (scan_mode) signal (116 inFIG. 1) has been deasserted for a period of time which is long, in comparison to the delay time inserted by the time delay element (404 inFIG. 1), but is asserted at time=t1. Notwithstanding, the invention is not limited in this regard.
At time time=t1, the external reset (extrst) signal602 is deasserted. In response, theinternal reset signal604 may also be deasserted. Deassertion of theinternal reset signal604 may latch the scan mode (scan_mode) signal605 which is shown inFIG. 6 as being asserted at time=t1. The scan testmode delay (scan_testmode_delay)608 signal may still indicate the previous, unasserted, level of the scan mode (scan_mode)signal605. Thus, theinternal pulse signal610 may be deasserted. The asynchronous reset (async_reset) signal612 may also be deasserted. The chip_flip_flop_reset (chip_flip_flop_reset) signal614 may also be deasserted. The assertion of the scan testmode (scan_testmode) signal may couple the asynchronous reset (async_reset) signal612 to the chip flip flop reset (chip_flip_flop_reset)signal614. Therefore, the reset preceding entry into scan mode may be an asynchronous reset.
At a subsequent time=t2, the external reset (extrst) signal602 may be asserted. The internal reset signal may also be asserted at time=t2. However, the signal level of the chip flip flop reset (chip_flip_flop_reset) signal614 may be unaffected. This may be due to the fact that theinternal pulse signal610 may still be deasserted.
At a subsequent time=t3, the scan testmode delay (scan_testmode_delay) signal608 may be asserted. In this case, the time delay inserted by the time delay element (404 inFIG. 4) may approximately equal t3-t1. At this time, theinternal pulse signal610 may be asserted. The asynchronous reset (async_reset) signal612 may be asserted as well. In concert with the asynchronous reset (async_reset) signal612, the chip flip flop reset (chip_flip_flop_reset) signal614 may be asserted. Assertion of the chip flip flop reset (chip_flip_flop_reset) signal614 may end the attempt to reset flip flops on the chip.
The exemplary timing waveforms shown inFIG. 6 illustrate that the pulse generation stage (104 inFIG. 1) may enforce a minimum length of time for the deassertion of the chip flip flop resetsignal124 inFIG. 1, which was shown to be approximately t3-t1. This minimum length of time may be independent of the length of time that an external reset (extrst) signal was deasserted. This may ensure that the resetting of flip flops before entry into scan mode independent of the method by which an external reset signal is applied.
FIG. 7 is a flow chart illustrating exemplary steps in the operation of an exemplary system, in accordance with an embodiment of the invention. Referring toFIG. 7, instep702 an internal_reset signal may be received. Instep704, the scan_mode signal may be latched. Instep706, the scan_mode_delay signal may be generated. Instep708, the logical XNOR of the scan_mode and scan_mode_delay signals may be adapted. Instep710, the internal_pulse signal may be generated. Instep712, the logical AND of the internal_reset and internal_pulse signals may be adapted. Instep714, the chip_flip_flop_reset signal may be generated.
Since the scan chain flip-flops in a device may contain sensitive information such as security keys during normal operation this information should not be allowed to be shifted out or extracted from the device. The invention provides a method and system for preventing data from being shifted out or extracted from the device in scan mode. Accordingly, various aspects of the invention clears all data in the flip-flops prior to entering scan mode. Accordingly, when the device is configured in scan mode, the logic which controls this function may be set by issuing a chip reset. This results in chip-wide reset that clears all the flip-flops of any data they may contain. The invention also provides circuitry that issues a second stage of chip reset anytime scan mode is entered. This additional reset may provide a method to clear all of the data in instances where the flip-flops may not have been completely cleared via the previous reset.
It should be recognized that the invention is not limited to the scan mode operation. Accordingly, the device may be reset to clear all data from the device when any mode is changed. For example, whenever a device enters a supervisory mode, for example, all the data in the flip-flops in the scan chain may be cleared via a reset.
Accordingly, the present invention may be realized in hardware, software, or a combination of hardware and software. The present invention may be realized in a centralized fashion in at least one computer system, or in a distributed fashion where different elements are spread across several interconnected computer systems. Any kind of computer system or other apparatus adapted for carrying out the methods described herein is suited. A typical combination of hardware and software may be a general-purpose computer system with a computer program that, when being loaded and executed, controls the computer system such that it carries out the methods described herein.
While the present invention has been described with reference to certain embodiments, it will be understood by those skilled in the art that various changes may be made and equivalents may be substituted without departing from the scope of the present invention. In addition, many modifications may be made to adapt a particular situation or material to the teachings of the present invention without departing from its scope. Therefore, it is intended that the present invention not be limited to the particular embodiment disclosed, but that the present invention will include all embodiments falling within the scope of the appended claims.