FPGA chip with protected JTAG interface
By introducing a control logic block and a detection logic block into the FPGA chip, using the enable pin of the JTAG interface to interact with the external control unit, monitoring and preventing unauthorized access, the problem of insufficient protection measures for the JTAG interface of the FPGA chip in the existing technology is solved. Improved system security and maintenance convenience.
Patent Information
- Application Number
- CN202210406590.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2021-09-23
- Filing Date
- 2022-04-18
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2042-04-18
Smart Images

Figure CN115905077B_ABST
Abstract
Description
Background Art
[0001] The present disclosure generally relates to a field programmable gate array (FPGA) chip. More specifically, the present disclosure relates to a system and method for protecting a test and control interface of an FPGA chip to prevent unauthorized access to the FPGA chip. Summary of the invention
[0002] In one embodiment, an FPGA chip mounted on a printed circuit board (PCB) is provided. The FPGA chip may include: a joint test action group (JTAG) interface, including a plurality of input / output pins and an enable pin; and a control logic block coupled to the enable pin of the JTAG interface. The control logic block may receive a control signal from an off-chip control unit, and control the logic value of the enable pin based on the received control signal, thereby facilitating the off-chip control unit to lock or unlock the JTAG interface. The FPGA chip may also include a detection logic block for detecting unauthorized access to the FPGA chip. The input of the detection logic is coupled to the enable pin, and a conductive trace coupling the input of the detection logic block and the enable pin is located on an inner layer of the PCB.
[0003] In another embodiment, a method for protecting a field programmable gate array (FPGA) chip mounted on a printed circuit board (PCB) includes: configuring the FPGA chip to include a control logic block and a detection logic block; coupling the output of the control logic block to an enable pin of a joint test action group (JTAG) interface of the FPGA chip to allow the control logic block to receive a control signal from an off-chip control unit and control the logic value of the enable pin based on the received control signal, thereby facilitating the off-chip control unit to lock or unlock the JTAG interface; and coupling the input of the detection logic block to the enable pin to detect unauthorized access to the FPGA chip, wherein a conductive trace coupling the input of the detection logic block and the enable pin is located on an inner layer of the PCB. BRIEF DESCRIPTION OF THE DRAWINGS
[0004] Figure 1 A system architecture for implementing Joint Test Action Group (JTAG) protection according to one aspect of the present application is illustrated.
[0005] Figure 2A A block diagram of enable signal detection logic according to one aspect of the present application is illustrated.
[0006] Figure 2B A truth table of the enable signal detection logic 200 according to one aspect of the present application is illustrated.
[0007] Figure 3A A block diagram of JTAG signal detection logic according to one aspect of the present application is illustrated.
[0008] Figure 3B A truth table of the JTAG signal detection logic 300 according to one aspect of the present application is illustrated.
[0009] Figure 4A A block diagram of control logic according to one aspect of the present application is illustrated.
[0010] Figure 4B A truth table of the control logic 400 according to one aspect of the present application is illustrated.
[0011] Figure 5 A schematic diagram of a PCB trace according to one aspect of the present application is illustrated.
[0012] Figure 6 A flow chart illustrating a process for unlocking a JTAG interface of an FPGA according to one aspect of the present application is provided.
[0013] Figure 7 A flow chart illustrating a process for detecting intrusions to a JTAG interface according to one aspect of the present application is provided.
[0014] Figure 8 A computer system is illustrated that facilitates runtime control of a JTAG interface of an FPGA device according to one aspect of the present application.
[0015] In the drawings, like reference numerals refer to like drawing elements. DETAILED DESCRIPTION
[0016] The following description is presented to enable any person skilled in the art to make and use examples, and is provided in the context of a specific application and its requirements. Various modifications to the disclosed examples will be apparent to those skilled in the art, and the general principles defined herein may be applied to other examples without departing from the spirit and scope of the present disclosure. Therefore, the scope of the present disclosure is not limited to the embodiments shown, but should be given the widest scope consistent with the principles and features disclosed herein.
[0017] Network switching devices (such as switches and routers) typically use FPGA devices as system controllers for various functions, such as power management, inter-chip and peripheral communications, etc. During the development and manufacturing test phases, the digital design logic inside the FPGA chip can be tested using the Joint Test Action Group (JTAG) technology. More specifically, the FPGA chip can be equipped with a JTAG interface (which can have two, four or five pins, depending on the JTAG version). In order to prevent unauthorized access to the FPGA (such as tempering the FPGA flash memory), the JTAG interface should be protected. In current practice, the JTAG connector is physically removed from the printed circuit board (PCB) where the FPGA is installed, thereby preventing anyone from accessing the FPGA. However, this may cause maintenance problems for ordinary users. Users will have to ship defective units back to the manufacturer instead of visiting on site to perform testing and debugging. Without implementing the next level of protection on top of JTAG, the entire system may be vulnerable to attack and may be abused by hackers.
[0018] The present disclosure provides a solution to the problem of protecting the JTAG interface without physically removing the JTAG header from the PCB. According to one aspect, the FPGA chip to be protected can be programmed to include a control logic block and a detection logic block. The control logic block can output a control signal via an I / O pin on the FPGA. This I / O pin can be electrically coupled to an enable pin (i.e., JTAGEN) of the JTAG interface. In other words, the output of the control logic block can enable or disable the JTAG interface. The control logic block can receive input from an external device of the FPGA, such as a switch central processing unit (CPU), thereby allowing the control software running on the CPU to enable / disable the JTAG interface. The detection logic block can monitor the activity on the JTAG pin, including JTAGEN and a clock pin (i.e., TCK). Abnormal activity (e.g., an unexpected enable signal or clock signal) can trigger the detection logic block to send an alarm signal to the control logic block. Upon receiving the alarm signal, the control logic block can disable the JTAG interface, thereby preventing unauthorized access to the FPGA.
[0019] Figure 1 The system architecture for implementing JTAG protection according to one aspect of the present application is illustrated. More specifically, Figure 1 FIG. 1 shows a partial view of a switch PCB 100. The switch PCB 100 may include an FPGA chip 102, a switch CPU 120, and peripheral devices 122. Other switch components (such as switch ports) are not shown. Figure 1 Shown in.
[0020] FPGA chip 102 can be used as a controller for a switch and can be used to control peripheral devices 122 (such as a power supply). FPGA chip 102 can include various functional blocks, including JTAG interface 104, enable signal detection (EN_DET) logic block 106, JTAG signal detection (JTAG_DET) logic block 108, control logic block 112, flash memory 114 and flash memory controller 116.
[0021] JTAG interface 104 may be a standard FPGA feature to allow developers to program and debug FPGA chip 102. Figure 1 In the example shown, the JTAG interface 104 can be coupled to five connector pins of the FPGA chip 102 to facilitate the input / output of JTAG signals, including a test mode select (TMS) signal, a test clock (TCK) signal, a test data input (TDI) signal, a test data output (TDO) signal, and a JTAG enable (JTAGEN) signal. More specifically, the logic value of the JTAGEN pin 132 can lock / unlock the JTAG interface 104 and place the other four JTAG pins (i.e., TMS, TCK, TDI, and TDO) in two different (dedicated or shared) modes. In one example, when JTAGEN is high (or logic "1"), the JTAG interface 104 is unlocked and the JTAG pins are placed in dedicated mode. When the JTAG interface 104 is unlocked, access to the flash memory 114 (e.g., via the signal trace 110) is permitted, and device programming or other JTAG-related functions are available. When JTAGEN is low (or logic "0"), JTAG interface 104 is locked and the JTAG pins are placed in a shared mode, allowing them to be used as general purpose I / O (GPIO) pins. With JTAG interface 104 locked, access to flash memory 114 is blocked.
[0022] Figure 1 It is shown that the JTAG pin 132 can be electrically coupled (e.g., via a conductive trace on the PCB 100) to another I / O pin 134 of the FPGA chip 102. Therefore, the JTAG interface 104 can be enabled or disabled by setting the voltage or logic value of the I / O pin 134. According to one aspect, the I / O pin 134 can be coupled to a control logic block 112, which interacts with the switch CPU 120. This allows the control software running in the switch CPU 120 to send a signal to the control logic block 112, causing the control logic block 112 to output a control signal on the I / O pin 134. In other words, the control software running in the CPU 120 can enable or disable the JTAG interface 104 via the control logic block 112, thereby providing board-level protection for the JTAG interface 104.
[0023] In addition to enabling / disabling the JTAG interface 104, the control logic block 112 may also send control signals to the flash controller 116 and the peripheral device 122. For example, when an intrusion is detected, the control logic block 112 may send a power-off signal to the peripheral device 122, or the control logic block 112 may send an erase memory signal to the flash controller 116, instructing the flash controller 116 to erase the contents of the flash memory 114.
[0024] Figure 1 It is also shown that in addition to interacting with the switch CPU 120, the control logic block 112 can also receive inputs from detection logic, including an enable signal detection logic block 106 and a JTAG signal detection logic block 108. These detection logic blocks can be configured to perform chip-level detection to detect intrusions into the system in the event that the board-level protection provided by the control logic fails. More specifically, the enable signal detection logic block 106 can monitor the voltage level on the JTAGEN pin 132 to detect unexpected JTAGEN signals. This can be accomplished by electrically coupling the JTAGEN pin 132 to an FPGA I / O pin 136 (e.g., via a conductive trace on the switch PCB 100), which is then coupled to the enable signal detection logic block 106. In this way, signal changes on the JTAGEN pin 132 can be sent to the enable signal detection logic block 106 via the I / O pin 136. When an unexpected change on the JTAGEN pin 132 is detected, indicating an unauthorized attempt to unlock the JTAG interface 104, the enable signal detection logic block 106 can send an alarm signal to the control logic block 112. The JTAG signal detection logic block 108 can monitor the JTAG signal line (e.g., the TCK signal line). Any abnormality in the JTAG signal line may cause the JTAG signal detection logic block 108 to send an alarm signal to the control logic 112. In one example, the JTAG signal detection logic block 108 can monitor the TCK line. More specifically, the JTAG signal detection logic block 108 can be configured to detect rising and falling edges on the TCK signal line. When unexpected rising and falling edges are detected, the JTAG signal detection logic block 108 can send an alarm signal to the control logic 112. Directly monitoring the JTAG signal line may be useful in the case where a hacker interferes with the JTAGEN signal (e.g., forces it to be "1") and controls the JTAG signal line.
[0025] Figure 2A FIG. 1 is a block diagram of an enable signal detection logic according to one aspect of the present application. Figure 2AIn FIG. 2 , the enable signal detection logic 200 may include a filter 202, flip-flops 204 and 206, and AND gates 208 and 210. The input of the enable signal detection logic 200 may be a monitored JTAGEN signal, and the clock signal may be an FPGA clock.
[0026] Filter 202 may be responsible for filtering out metastable noise. Flip-flops 204 and 206 are arranged so that there is a delay of a clock cycle between the output of flip-flop 204 and the output of flip-flop 206. The output of flip-flop 204 and the inverted output of flip-flop 206 are then sent to AND gate 208. If the JTAGEN signal switches from logic "0" to logic "1" during the clock cycle, AND gate 208 outputs logic "1"; otherwise, AND gate 208 outputs logic "0". It should be noted that the transition from logic "0" to logic "1" means that JTAGEN transitions from a "locked" state to an "unlocked" state. Unless expected, this transition may indicate an intrusion. AND gate 210 allows the access protection bit to override the detection of a "0" to "1" transition. When the access protection bit is set to "0", meaning that JTAG access protection is not activated, AND gate 210 will always output "0", regardless of whether a "0" to "1" transition is detected on the JTAGEN signal. On the other hand, when the access protection bit is set to "1", meaning that JTAG access protection is activated, AND gate 210 will output "1" in response to a "0" to "1" transition being detected on the JTAGEN signal. The logic "1" output of AND gate 210 generates an alert signal to be sent to the control logic.
[0027] Figure 2B The truth table of the enable signal detection logic 200 according to one aspect of the present application is illustrated. The first column of table 220 shows the possible transitions of the JTAGEN signal; the second column shows the output of the AND gate 208; the third column shows the value of the access protection bit ("0" and "1" indicate the unlocked and locked states of the JTAG interface, respectively); and the fourth column shows the output of the AND gate 210, which is also the output of the enable signal detection logic 200. Table 200 also includes a fifth column showing the expected output of the enable signal detection logic 200 and a sixth column showing the detection results. Note that the expected output of the enable signal detection logic 200 should always be "0", assuming that the JTAG interface is not locked or there is no intrusion. However, when an intrusion is detected on a locked JTAG interface, as indicated by row 222, there is a mismatch between the expected output and the actual output. Therefore, an alarm signal is generated and sent to the control logic. In one example, the logic "1" output of the AND gate 210 sets the alarm bit in the register array in the control logic.
[0028] Figure 3AFIG. 3 is a block diagram of a JTAG signal detection logic according to one aspect of the present application. In this example, the input of the JTAG signal detection logic 300 may be a monitored TCK signal, and the clock signal may be an FPGA clock. Figure 3A In FIG. 3 , the JTAG signal detection logic 300 may include a filter 302 , a delay logic 304 , a rising edge detection logic 306 , a falling edge detection logic 308 , and an AND gate 310 .
[0029] Filter 302 may be responsible for removing metastable noise or glitches. Delay logic 304 may include flip-flops 312 and 314, which are similar to flip-flops 204 and 206 and may sample the TCK signal at the rate of the FPGA clock. Note that the FPGA clock is typically much faster than TCK, so any changes in the TCK signal may be accurately sampled.
[0030] The rising edge detection logic 306 may include an AND gate 316 and a rising edge register 318. The AND gate 316 and the rising edge register 318 are configured such that whenever there is a rising edge (i.e., a "0" to "1" transition) on the TCK signal, the rising edge register 318 is set to store a bit value of "1". For example, a transition from "0" to "1" may trigger the enabling of the register 318. The falling edge detection logic 308 may include an AND gate 320 and a falling edge register 322. The AND gate 320 and the falling edge register 322 are configured such that whenever there is a falling edge (i.e., a "1" to "0" transition) on the TCK signal, the falling edge register 322 is set to store a bit value of "1". For example, a transition from "1" to "0" may trigger the enabling of the register 322.
[0031] AND gate 310 has three inputs, including the bit value of rising edge register 320, the bit value of falling edge register 326, and the bit value of access protection bit. As previously discussed, when the access protection bit is set to "0", the JTAG interface is in non-protected mode, and AND gate 310 will always output "0", regardless of the value of the register. In this case, no alarm will be generated. When the access protection bit is set to "1", the JTAG interface is in protected mode, and when both registers store bit "1", AND gate 310 can output bit "1". In other words, when the rising edge and the falling edge are detected on the TCK signal, an alarm will be generated.
[0032] Figure 3A Also shown is an optional reset input 324, which may be used to reset registers 318 and 322. After an alarm has been generated, a reset signal may be generated and sent to registers 318 and 322 in order to detect subsequent intrusions.
[0033] Figure 3BA truth table of JTAG signal detection logic 300 according to one aspect of the present application is illustrated. The first column of table 340 shows possible transitions of the TCK signal; and the second column shows the bit values of the rising edge register (i.e., register 318). Table 340 shows that when a transition from "0" to "1" of the TCK signal is detected, the rising edge register stores a bit "1". The third column of table 340 shows the bit values of the falling edge register (i.e., register 322); the fourth column shows the value of the access protection bit; and the fifth column shows the output of the AND gate 310. Table 340 shows that when a transition from "1" to "0" of the TCK signal is detected, the falling edge register stores a bit "1". As shown in rows 342 and 344, when both registers store a bit "1" and the access protection bit is set to "1", the output of the AND gate 310 is set to "1", indicating that a pulse is detected on the TCK signal.
[0034] Note that under normal circumstances, when the JTAG interface is locked or protected, no activity should be observed on the JTAG signal lines. Therefore, the pulses on the TCK signal line are most likely the result of someone injecting a clock signal into the JTAG interface and attempting to access the FPGA memory via the JTAG interface. For ease of illustration, the case where the access protection bit is set to "0" is not shown. Figure 3B As previously discussed, when the access protection bit is set to "0", no alarm will be generated regardless of the value of the rising edge and falling edge registers. Note that the access protection bit defaults to logic "1" in the official FPGA image to ensure that the JTAG interface is always in a "locked" state after offline programming in a manufacturing environment.
[0035] Figure 4A The block diagram of the control logic according to one aspect of the present application is illustrated. The control logic 400 may include a CPU interface 402, a JTAG status register array 404, a user key register 406, a comparator 408, and a flash memory 410 storing an invalid bit 412 and an access key 414. The control logic 400 may also include a multiplexer 416, a NAND gate 418, and a timer 420.
[0036] The control software running in the switch CPU or the CPU of the control node can interact with the control logic 400 via the control CPU interface 402. In this example, the CPU interface 402 may include a wishbone arbiter that allows the CPU to write or read from the JTAG status register array 404 and write to the user key register 406. The JTAG status register array 404 stores status information, including lock / unlock status, alarms, actions to be taken in the event of an intrusion, etc. A detailed description of the JTAG status register array 404 will be provided later. When a user attempts to unlock the JTAG interface, the control software may write an access key to the user key register 406 via the CPU interface 402.
[0037] Flash memory 410 stores an invalid bit 412 and an access key 414 generated by a vendor. More specifically, invalid bit 412 and access key 414 are stored in flash memory 410 when the FPGA is programmed offline in a production line. The initial logic value of invalid bit 412 is always "0" and can only be flipped from "0" to "1". Comparator 408 compares the access key written to user key register 406 with the access key 414 stored in flash memory 410. If they are not the same, an incorrect key is written to user key register 406, which means that a break-in attempt has occurred. According to one aspect, upon determining that an incorrect key is written to user key register 406, comparator 408 can generate an alarm (e.g., by setting the alarm_access_key bit in JTAG status register array 404). The output of comparator 408 can also be used to determine the output of multiplexer 416. According to one aspect, when the keys match (or when the access key written to the user key register 406 is the correct key), the multiplexer 416 outputs a logic value of "0"; otherwise, the multiplexer 416 outputs a logic value of "1". The output of the multiplexer 416 can be inverted and sent to the NAND gate 418 together with the access protection bit. The output of the NAND 418 is the output of the control logic 400 and can be coupled to the JTAGEN pin via an external conductive trace. In other words, when the access protection bit is "1" and the output of the multiplexer 416 is "0" (indicating a matching key), the logic value "1" is sent to the JTAGEN pin, thereby unlocking the JTAG interface. In this way, software running in the CPU can dynamically unlock the JTAG interface (for example, by writing the access key to the user key register 406). On the other hand, if the output of the multiplexer 416 is "1" (indicating that the wrong key is used), the logic value "0" is sent to the JTAGEN pin and the JTAG interface will remain locked.
[0038] In addition to accessing the key, invalid bit 412 can provide another level of protection. More specifically, when an incorrect key is detected, invalid bit 412 can flip from its default value of "0" to "1". Invalid bit 412 can be configured to select the output of multiplexer 416, so that when the invalid bit is "1", multiplexer 416 can only output a logic value of "1", which in turn can lock the JTAG interface.
[0039] Furthermore, when the JTAG interface is unlocked (e.g., by typing in the correct access key), a countdown timer 420 may be started. The initial value of the countdown timer may be determined based on the maximum amount of time the JTAG interface is allowed to remain unlocked. This value may be configurable depending on the application. In one example, the JTAG interface may be allowed to remain unlocked for several minutes to allow its operator to perform various testing or debugging operations. When the timer 420 expires, the invalid bit 412 flips from "0" to "1", thereby preventing access to the JTAG interface. It should be noted that since the invalid bit 412 can only flip from "0" to "1", once flipped, the JTAG interface will be locked throughout the power cycle. Resetting the invalid bit to unlock the JTAG interface can be accomplished by reconfiguring the FPGA (e.g., by software).
[0040] Figure 4B 4 shows a truth table of control logic 400 according to one aspect of the present application. The first column of table 440 is the bit value of the alarm access key register. Figure 4A As shown, when an incorrect access key is detected, this bit is set to "1". The second column of table 440 is the value of invalid bit 412, and the third column indicates whether timer 420 has timed out. Table 440 shows that when timer 420 times out, invalid bit 412 is set to "1". The fourth column of table 440 shows the value of the access protection bit, the fifth column indicates whether the access key is valid, and the last column is the output of the control logic (i.e., JTAGEN signal). When the access protection bit is "0", the JTAG interface is not protected, the JTAGEN signal is "1", and all other bits are "don't care". The default value of the access protection bit is "1". Table 440 also shows that when in protection mode (i.e., the access protection bit is set to "1"), the JTAG interface can only be unlocked when the correct access key is entered (i.e., the alert access key bit is "0" and the access key valid bit is "1"), as shown in row 442 of table 440.
[0041] Return to Figure 4A, the JTAG status register array 404 may include a plurality of registers, including a set bit array 422, an alarm bit array 424, and an action bit array 426. The set bit array 422 may include a write and read (WR) register storing an access protection bit and a read-only register storing an access key valid bit. As previously discussed, when the access protection bit is set to "0", the JTAG interface is unlocked or unprotected; and when the access protection bit is set to "1", the JTAG interface is locked or protected. The default value of the access protection bit is set to "1". The access key valid bit is set based on the output of the multiplexer 416. When the correct key is entered and the invalid bit 412 is "0", the access key valid bit is set to "1"; and when the wrong key is entered or the invalid bit 412 is "1", the access key valid bit is set to "0".
[0042] The alarm bit array 424 stores various alarm bits generated by detection logic such as the enable signal detection logic and the JTAG signal detection logic. As previously discussed, when the detection logic detects an intrusion on the enable pin or the JTAG signal line, the detection logic can generate an alarm by setting the corresponding alarm bit in the alarm bit array 424. The alarm bit array 424 can include three read and clear registers, including an alarm JTAGEN register, an alarm TCK register, and an alarm access key register, each of which stores an alarm bit. In response to detecting an unexpected switch of the JTAGEN signal, the bit stored in the alarm JTAGEN register can be set by the enable signal detection logic. In response to detecting an unexpected pulse on the TCK signal line, the bit stored in the alarm TCK register can be set by the JTAG signal detection logic. The bit stored in the alarm access key register can be set by the control logic 400. More specifically, when the comparator 408 determines that the access key written to the user key register 406 does not match the access key 414 stored in the flash memory 410, the bit stored in the alarm access key register is set to "1", indicating that an incorrect access key is detected.
[0043] The action bit array 426 includes a plurality of read-only registers, which respectively store action bits indicating whether the corresponding action should be executed in the case of an intrusion. According to one aspect, the action bit array 426 may include an action warning log register, an action peripheral shutdown register, an action flash erase register, and an action shutdown register. Depending on the system security level, the FPGA may be configured so that a specific action will be executed when an intrusion is detected. The action may generally be performed by the control logic 400. For example, if the system security level is low, the bit stored in the action warning log register may be set to "1", which means that the control logic 400 will report the intrusion event to the CPU. When the CPU reads the action register, it will record the event and notify the user (e.g., via control software). If the system security level is medium, the bit stored in the action peripheral shutdown register may be set to "1", which means that the control logic 400 may send a control signal to the peripheral device to shut down these devices. If the system security level is high, the bit stored in the action flash erase register and / or the action shutdown register may be set to "1", which means that the control logic 400 may send a control signal to the flash memory to erase the contents of the flash memory and / or power off the FPGA. It is important to note that, although brutal, the last two actions (i.e., the memory erase action and the FPGA power off action) may be the last line of defense to prevent the leakage of critical information during an intrusion.
[0044] The control logic allows the user to dynamically lock / unlock the JTAG interface. For example, if debugging is required, the user can unlock the JTAG interface using the control software running on the CPU (e.g., by typing a command including an access key). In response to the user command, the CPU sends the access key to the control logic, which compares the access key typed by the user with the access key stored in the FPGA flash memory. If the key is the correct key, the control logic can output a JTAGEN signal to the JTAGEN pin (e.g., output logic "0"), thereby unlocking the JTAG interface. A countdown timer is also triggered to allow a limited amount of access time to the JTAG interface. In addition, the control software can also read various alarm registers to determine whether an intrusion has been detected (e.g., if a hacker controls the JTAGEN signal or the JTAG signal line). In response to an alarm bit set in one of the alarm registers, the control software can send a command to the control logic, instructing the control logic to output a JTAGEN signal to lock the JTAG interface. For example, in response to detecting a set alarm bit, the control software can send a signal to the control logic to flip the invalid bit, thereby effectively locking the JTAG interface. In response to detecting alarm(s), the control software may also read the action register to determine which action to take (eg, a reporting action, a peripheral shutdown action, an erase memory action, or an FPGA power-off action).
[0045] In addition to including functional blocks (such as control logic blocks and various detection logic blocks) inside the FPGA chip, the PCB should also be designed in such a way that further security enhancements are provided. For example, although the JTAG interface can be locked by software via the JTAGEN pin, the system may still be compromised when an intruder has physical access to the PCB where the FPGA chip is mounted. By including security features in the PCB, the system can be protected even if an intruder has physical access to the PCB. According to one aspect, the PCB can be designed to prevent an intruder from tampering with the detection logic. For example, the connection between the enable signal detection logic and the JTAGEN pin can be routed in an inner layer of the PCB, or the two pins (such as 10G pins) can be directly connected. Figure 1 In this way, the intruder is unaware of the monitoring of the JTAGEN signal. When the intruder attempts to unlock the JTAG interface by setting the logic value of the JTAGEN pin to "1", the enable signal detection logic can detect this unauthorized change and generate an alarm to cause the control logic to issue a control signal to lock the JTAG interface (for example, by flipping the invalid bit).
[0046] Figure 5 Schematic diagram of PCB traces according to one aspect of the present application is illustrated. PCB 500 may include FPGA 502, which includes multiple I / O pins to connect to various internal functional blocks. Figure 5 In the embodiment, FPGA 502 may include JTAGEN pin 504, JTAGEN control pin 506, and JTAGEN detection pin 508. JTAGEN pin 504 may be similar to Figure 1 JTAGEN pin 132 is shown and is coupled to the JTAG interface; JTAGEN control pin 506 can be similar to Figure 1 I / O pin 134 shown and coupled to control logic; and JTAGEN detection pin 508 can be similar to Figure 1 The I / O pin 136 is shown and is coupled to the enable signal detection logic. For ease of illustration, the JTAG interface, control logic and enable signal detection logic are not shown in FIG. Figure 5 Shown in.
[0047] Figure 5Conductive trace 510 external to FPGA 502 is shown coupling JTAGEN pin 504 and JTAGEN control pin 506. More specifically, conductive trace 510 can be on the top layer of PCB 500 and can include detachable resistor 512. In one example, detachable resistor 512 can be a 0 ohm resistor. During the development phase of FPGA 502, detachable resistor 512 can be removed, causing conductive trace 510 to be opened. In this case, the internal control logic no longer controls the JTAGEN signal. When the product is ready to be shipped to the customer, detachable resistor 512 can be soldered on, allowing the internal control logic to control the JTAGEN signal.
[0048] Figure 5 Also shown is a conductive trace 514 external to FPGA 502 that couples JTAGEN pin 504 and JTAGEN detect pin 508. More specifically, conductive trace 514 is shown using a dashed line to indicate that the trace is in an inner layer of PCB 500, making it "hidden" from an intruder. As previously discussed, this can prevent an intruder from tampering with the signal path to prevent detection of an intrusion.
[0049] Figure 6 A flow chart illustrating a process for unlocking a JTAG interface of an FPGA according to one aspect of the present application is provided. In this example, the FPGA is part of a switch and can be used as a controller for various functions of the switch. The official FPGA image sets the access protection bit to its default value of "1" and sets the access key valid bit to its default value of "0". In this way, when the FPGA is configured using the official image, it is always in a locked state.
[0050] At a customer site, during runtime, a user may enter a command in a user interface of a control application that controls the FPGA (operation 602). The control application may run in the switch CPU, or may run in a separate computer that communicates with the switch CPU. According to one aspect, entering the user command may include entering an access key. The access key may be sent to control logic in the FPGA (operation 604). The control logic may compare the key entered by the user with an access key stored in an FPGA memory (e.g., flash memory) (operation 606), and determine whether the key entered by the user matches the stored key (operation 608).
[0051] If the key entered by the user matches the stored key, the control logic sends an unlock signal to the JTAG interface (e.g., by sending a logic "1" to the JTAGEN pin) to unlock the JTAG interface (operation 610), and starts a timer (operation 612). If the key entered by the user does not match the stored key, the control logic sends a lock signal to the JTAG interface (e.g., by sending a logic "0" to the JTAGEN pin), causing the JTAG interface to remain locked (operation 614). The control logic also monitors the timer (operation 616), and once the timer expires, the control logic sends a lock signal to the JTAG interface (e.g., by sending a logic "0" to the JTAGEN pin) to lock the previously unlocked JTAG interface (operation 614).
[0052] Figure 7 A flow chart illustrating a process for detecting an intrusion to a JTAG interface according to one aspect of the present application is provided. During operation, a control application controlling an FPGA may read the values of a plurality of alarm registers via a CPU interface on the FPGA (operation 702). The control application may run in the switch CPU, or may run in a separate computer that communicates with the switch CPU. According to one aspect, the control application may run in the background. The control application may determine whether the JTAGEN alarm bit is set (i.e., whether an intrusion occurs on the JTAGEN signal line) (operation 704). An unexpected transition from "1" to "0" on the JTAGEN signal line typically means that an intrusion is occurring. If the JTAGEN alarm bit is not set, the control application may determine whether the alarm bit corresponding to the JTAG signal line (e.g., the TCK line) is set (operation 706). An unexpected pulse detected on the TCK line or a different JTAG signal line may also indicate an intrusion. If the JTAG signal alarm bit is not set, the control application may determine whether the wrong key alarm bit is set (operation 708). This may be because the user entered the wrong access key. If no alarm bit is set, the control application continues to read the alarm register (operation 702).
[0053] If any alarm bit is set, the control application can send a signal to the FPGA control logic, which in response sends a control signal to lock the JTAG interface (operation 710). The control application also reads the action register (operation 712). If the action warning log register is set, the control application records the detected intrusion event (e.g., records the alarm type, time, etc.) and sends a notification to the user (operation 714). If the action peripheral shutdown register is set, the control application sends a control signal to the FPGA control logic, which in turn sends a control signal to shut down the peripheral device (operation 716). If the action flash erase register is set, the control application can send a control signal to the FPGA control logic, instructing the control logic to erase the contents of the FPGA internal flash memory (operation 718). If the action shutdown register is set, the control application can send a control signal to the FPGA control logic, instructing the control logic to power off the FPGA (operation 720). It should be noted that one or more action bits can be set, which means that one or more actions can be performed in response to the alarm bits set and read by the control application. For example, in response to detecting the set alarm bit, the control application can record the event and instruct the control logic to shut down the periphery. Alternatively, in response to detecting a set alarm bit, the control application may log the event and instruct the control logic to erase the flash memory.
[0054] Figure 8 A computer system that facilitates runtime control of a JTAG interface of an FPGA device according to one aspect of the present application is illustrated. The computer system 800 includes a processor 802, a memory 804, and a storage device 806. In addition, the computer system 800 can be coupled to peripheral input / output (I / O) user devices 810, such as a display device 812, a keyboard 814, and a pointing device 816. The storage device 806 can store an operating system 818, a JTAG interface control system 820, and data 840. According to one aspect, the computer system 800 can be part of a network switch.
[0055] The JTAG interface control system 820 may include instructions that, when executed by the computer system 800, may cause the computer system 800 or the processor 802 to perform the methods and / or processes described in the present disclosure. Specifically, the JTAG interface control system 820 may include instructions for providing a user interface to allow a user to enter commands (user interface instructions 822), instructions for transmitting an access key entered by a user to the FPGA (access key transmission instructions 824), instructions for reading an alarm register (alarm register read instructions 826), instructions for transmitting a control signal to lock and unlock the JTAG interface (JTAG interface control signal transmission instructions 828), instructions for reading an action register (action register read instructions 830), and instructions for transmitting a control signal to perform various actions in response to detecting an intrusion (action control signal transmission instructions 832). The data 840 may include an FPGA image file 842.
[0056] In general, the present disclosure provides a system and method for dynamically controlling a JTAG interface of a programmable logic device (PLD) during runtime. In the present disclosure, an FPGA chip with a JTAG interface is used in various examples. The same solution can be used for other devices that use the JTAG interface for development, testing, and debugging purposes. More specifically, the PLD can be configured to include an internal control logic block and at least one internal detection logic block. The output of the control logic block can be coupled to an enable pin of the JTAG interface via an external conductive trace, thereby allowing an external control unit (such as a CPU communicating with the PLD) to enable / disable the JTAG interface via the control logic block. According to one aspect, in order to enable or unlock the JTAG interface, a user needs to enter an access key via an external control unit. The access key can be compared with a key stored in the PLD. A matching key may cause the control logic to send an unlock signal to the JTAG pin to unlock / enable the JTAG interface, while an unmatched key may cause the control logic to generate an alarm. In addition to controlling the enabling of the JTAG interface, the internal detection logic block can also detect unauthorized access to the FPGA via the JTAG interface. The internal detection logic block may include a sub-block for detecting unexpected transitions of the JTAGEN signal and a sub-block for detecting unexpected pulses on the JTAG signal line. Once an intrusion is detected, an alarm may be generated, and the control logic may be configured to lock the JTAG interface and perform various predetermined actions. These actions are pre-configured when the PLD is configured. Depending on the security level requirements of the PLD, the actions may range from simply logging and reporting the intrusion to erasing internal memory and / or shutting down the PLD. The disclosed solution may be implemented at a reduced cost with minor changes to hardware, firmware, and software. The solution may protect the JTAG interface from unauthorized access during runtime, and greatly improves the security robustness of systems (e.g., network switching platforms) that use PLDs as system controllers.
[0057] One aspect of the present application provides a field programmable gate array (FPGA) chip mounted on a printed circuit board (PCB). The FPGA chip may include: a joint test action group (JTAG) interface, including a plurality of input / output (I / O) pins and an enable pin; and a control logic block coupled to the enable pin of the JTAG interface. The control logic block may receive a control signal from an off-chip control unit, and control the logic value of the enable pin based on the received control signal, thereby facilitating the off-chip control unit to lock or unlock the JTAG interface. The FPGA chip may also include a detection logic block to detect unauthorized access to the FPGA chip. The input of the detection logic is coupled to the enable pin, and a conductive trace coupling the input of the detection logic block and the enable pin is located on an inner layer of the PCB.
[0058] In a variation of this aspect, the FPGA chip may further include a second detection logic block, the input of which is coupled to at least one I / O pin of the JTAG interface, thereby facilitating detection of an abnormal signal on the at least one I / O pin.
[0059] In yet another variation, the at least one I / O pin may include a test block (TCK) pin, and the second detection logic block may be configured to generate an alarm signal in response to detecting an unexpected pulse on the TCK pin.
[0060] In a variation of this aspect, the detection logic block may be configured to generate an alarm signal in response to detecting an unexpected transition on the enable pin.
[0061] In a variation of this aspect, the off-chip control unit may be a central processing unit (CPU), and the control signal may include an access key.
[0062] In another variation, the control logic block may also include: a comparator configured to compare an access key included in the control signal with an access key stored in a memory within the FPGA chip; and a logic gate configured to: in response to the comparator determining that the access key included in the control signal matches the access key stored in the memory, output an unlock signal to the enable pin to unlock the JTAG interface; and in response to the comparator determining that the access key included in the control signal does not match the access key stored in the memory, output a lock signal to the enable pin to lock the JTAG interface.
[0063] In yet another variation, the control logic may further include a timer. The timer may be initiated in response to the comparator determining that the access key included in the control signal matches the access key stored in the memory, and the logic gate may be configured to output a lock signal to the enable pin to lock the JTAG interface in response to expiration of the timer.
[0064] In a variation of this aspect, the output and enable pins of the control logic block may be coupled via conductive traces located on a top layer of the PCB, and the conductive traces may include detachable resistors to allow the control logic block to be decoupled from the FPGA chip during development of the FPGA chip.
[0065] In a variation of this aspect, the control logic block may be configured to perform one or more actions in response to the detection logic block detecting unauthorized access to the FPGA chip.
[0066] In variations of this aspect, one or more actions may include: logging and reporting unauthorized access; sending a control signal to shut down one or more peripheral devices coupled to the FPGA chip; erasing the internal memory of the FPGA chip; and powering off the FPGA chip.
[0067] The methods and processes described in the detailed description section may be implemented as code and / or data, which may be stored in the above-mentioned computer-readable storage medium. When a computer system reads and executes the code and / or data stored on the computer-readable storage medium, the computer system executes the methods and processes implemented as data structures and codes and stored in the computer-readable storage medium.
[0068] In addition, the above methods and processes may be included in hardware modules or devices. Hardware modules or devices may include, but are not limited to, application specific integrated circuit (ASIC) chips, field programmable gate arrays (FPGAs), dedicated or shared processors that execute a specific software module or a piece of code at a specific time, and other programmable logic devices now known or later developed. When the hardware modules or devices are activated, they execute the methods and processes included therein.
[0069] The foregoing descriptions are presented for purposes of illustration and description only. They are not intended to be exhaustive or to limit the scope of the present disclosure to the disclosed forms. Therefore, many modifications and variations will be apparent to those skilled in the art.
Claims
1. A field programmable gate array (FPGA) chip mounted on a printed circuit board (PCB), comprising: Joint Test Action Group JTAG interface, including multiple input / output I / O pins and enable pin; a control logic block coupled to the enable pin of the JTAG interface, wherein the control logic block is used to receive a control signal from an off-chip control unit and control a logic value of the enable pin based on the received control signal, thereby facilitating the off-chip control unit to lock or unlock the JTAG interface; as well as a detection logic block to detect unauthorized access to the FPGA chip, wherein an input to the detection logic is coupled to the enable pin, and wherein a conductive trace coupling the input of the detection logic block and the enable pin is located on an inner layer of the PCB; Wherein the output of the control logic block and the enable pin are coupled via a conductive trace located on a top layer of the PCB, and wherein the conductive trace includes a detachable resistor to allow the control logic block to be decoupled from the FPGA chip during development of the FPGA chip.
2. The FPGA chip according to claim 1 further includes a second detection logic block, wherein the input of the second detection logic block is coupled to at least one I / O pin of the JTAG interface, thereby facilitating the detection of abnormal signals on the at least one I / O pin.
3. The FPGA chip according to claim 2, wherein the at least one I / O pin includes a test clock TCK pin, and wherein the second detection logic block is configured to generate an alarm signal in response to detecting an unexpected pulse on the TCK pin. 4 . The FPGA chip of claim 1 , wherein the detection logic block is configured to generate an alarm signal in response to detecting an unexpected transition on the enable pin. 5 . The FPGA chip according to claim 1 , wherein the off-chip control unit is a central processing unit (CPU), and wherein the control signal includes an access key.
6. The FPGA chip according to claim 5, wherein the control logic block further comprises: a comparator configured to compare the access key included in the control signal with an access key stored in a memory within the FPGA chip; as well as Logic gates, configured as: outputting an unlock signal to the enable pin to unlock the JTAG interface in response to the comparator determining that the access key included in the control signal matches the access key stored in the memory; as well as In response to the comparator determining that the access key included in the control signal does not match the access key stored in the memory, a lock signal is output to the enable pin to lock the JTAG interface.
7. The FPGA chip according to claim 6, wherein the control logic further comprises a timer, wherein the timer is initiated in response to the comparator determining that the access key included in the control signal matches the access key stored in the memory, and wherein the logic gate is configured to output a lock signal to the enable pin to lock the JTAG interface in response to expiration of the timer.
8. The FPGA chip according to claim 1, wherein the control logic block is configured to perform one or more actions in response to the detection logic block detecting unauthorized access to the FPGA chip.
9. The FPGA chip according to claim 8, wherein the one or more actions include: Record and report such unauthorized access; Sending a control signal to shut down one or more peripheral devices coupled to the FPGA chip; Erasing the internal memory of the FPGA chip; as well as Power off the FPGA chip.
10. A method for protecting a field programmable gate array (FPGA) chip mounted on a printed circuit board (PCB), comprising: The FPGA chip is configured to include a control logic block and a detection logic block; Coupling the output of the control logic block to the enable pin of the joint test action group JTAG interface of the FPGA chip to allow the control logic block to receive a control signal from an off-chip control unit and control the logic value of the enable pin based on the received control signal, thereby facilitating the off-chip control unit to lock or unlock the JTAG interface; as well as coupling an input of the detection logic block to the enable pin to detect unauthorized access to the FPGA chip, wherein a conductive trace coupling the input of the detection logic block and the enable pin is located on an inner layer of the PCB; Wherein the output of the control logic block and the enable pin are coupled via a conductive trace located on a top layer of the PCB, wherein the conductive trace includes a detachable resistor, and wherein the method further includes separating the resistor during development of the FPGA chip to decouple the control logic block from the FPGA chip.
11. The method according to claim 10, further comprising: configuring a second detection logic block; as well as An input of the second detection logic block is coupled to at least one I / O pin of the JTAG interface, thereby facilitating detection of an abnormal signal on the at least one I / O pin.
12. The method of claim 11, wherein the at least one I / O pin comprises a test clock TCK pin, and wherein the method further comprises generating an alarm signal in response to the second detection logic block detecting an unexpected pulse on the TCK pin.
13. The method of claim 10, further comprising generating an alarm signal in response to the detection logic block detecting an unexpected transition on the enable pin.
14. The method of claim 10, wherein the off-chip control unit is a central processing unit (CPU), and wherein receiving the control signal comprises receiving an access key.
15. The method according to claim 14, further comprising: Compare the access key included in the control signal with the access key stored in the memory within the FPGA chip, in response to determining that the access key included in the control signal matches the access key stored in the memory, sending an unlock signal to the enable pin to unlock the JTAG interface; as well as In response to determining that the access key included in the control signal does not match the access key stored in the memory, an alarm signal is generated.
16. The method according to claim 15, further comprising: In response to determining that the access key included in the control signal matches the access key stored in the memory, starting a timer; as well as In response to expiration of the timer, a lock signal is sent to the enable pin to lock the JTAG interface.
17. The method of claim 10, further comprising performing one or more actions in response to the detection logic block detecting unauthorized access to the FPGA chip.
18. The method of claim 17, wherein the one or more actions include: Record and report such unauthorized access; Sending a control signal to shut down one or more peripheral devices coupled to the FPGA chip; Erasing the internal memory of the FPGA chip; and Power off the FPGA chip.
