JTAG (Joint Test Action Group) switching method, equipment and product based on programmable logic device
The JTAG switching method based on programmable logic devices solves the problems of structural complexity and low applicability of the JTAG switching method in the existing technology, realizes efficient and flexible signal transmission and response of the equipment, and reduces hardware cost and design complexity.
Patent Information
- Application Number
- CN202510896134.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-30
- Publication Date
- 2025-10-28
AI Technical Summary
In the existing technology, JTAG switching methods have problems such as complex system structure, long design time, and low applicability of switching circuits. Especially when multiple devices need to be switched, the hardware cost is high and the design is complicated.
A JTAG switching method based on programmable logic devices is adopted. By obtaining the JTAG switching signal of the upstream device and responding to the in-place signal of the downstream device, centralized management and signal transmission are achieved, reducing the demand for independent switching circuits and improving the scalability and applicability of the equipment.
The structure of JTAG switching is simplified, the applicability and reliability of JTAG switching are improved, and signals can be accurately and efficiently transmitted and responded between different devices, reducing hardware costs and design complexity.
Smart Images

Figure CN120849339A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of integrated circuit technology, and in particular to a JTAG switching method, device and product based on programmable logic devices. Background Technology
[0002] Joint Test Action Group (JTAG) switching allows for flexible switching between different test modes or functional modes, meeting the development and debugging needs of complex circuit systems. JTAG switching can improve the maintainability and testability of circuit systems and effectively reduce development costs.
[0003] In related technologies, JTAG switching is achieved by building a switching circuit in the hardware circuit. This method uses a multiplexer (MUX) switching chip and a level conversion chip, and implements the JTAG switching function through a baseboard management controller (BMC) or programmable logic device. When there are multiple devices that need to perform JTAG switching, multiple switching circuits need to be built, which has problems such as complex system structure, long design time, and low applicability of switching circuits.
[0004] Therefore, there is an urgent need for a JTAG switching scheme based on programmable logic devices that is both applicable and simple in structure. Summary of the Invention
[0005] This application provides a JTAG switching method, device, and product based on programmable logic devices, which aims to simplify the structure of JTAG switching and improve the applicability of JTAG switching.
[0006] In a first aspect, this application provides a JTAG switching method based on a programmable logic device, applied to a programmable logic device, comprising:
[0007] Acquire the JTAG switching signal transmitted from the upstream device;
[0008] Responding to JTAG switching signals, it acquires the presence signal of downstream devices;
[0009] Based on the presence signal, a JTAG signal corresponding to the JTAG switching signal is sent to the downstream device to enable the downstream device to respond to the JTAG signal and realize JTAG switching.
[0010] In one possible implementation, when there are multiple downstream devices, a JTAG signal corresponding to the JTAG switching signal is sent to the downstream devices based on the presence signal, including:
[0011] Based on the presence signal, the downstream device that is communicatively connected to the programmable logic device among multiple downstream devices is identified as the first downstream device;
[0012] Send the JTAG signal corresponding to the JTAG switching signal to the first downstream device; so that the first downstream device responds to the JTAG signal, realizes JTAG switching, and transmits the JTAG signal corresponding to the JTAG switching signal to other downstream devices.
[0013] In one possible implementation, the JTAG signal corresponding to the JTAG switching signal is used to instruct the first downstream device to execute the JTAG action corresponding to the JTAG signal, and / or to instruct the first downstream device to transmit the JTAG signal corresponding to the JTAG switching signal to other downstream devices.
[0014] In one possible implementation, the upstream device includes at least a management system and / or debugging tools.
[0015] Secondly, this application provides a JTAG switching method based on a programmable logic device, applied to downstream devices, including:
[0016] Send an in-situ signal to the programmable logic device;
[0017] Receive JTAG signals; JTAG signals are sent by the programmable logic device after it receives the JTAG switching signal from the upstream device and obtains the presence signal in response to the JTAG switching signal.
[0018] It responds to JTAG signals to enable JTAG switching.
[0019] In one possible implementation, when the downstream device is communicatively connected to the programmable logic device, receiving a JTAG signal includes: receiving a JTAG signal sent by the programmable logic device;
[0020] When the first downstream device is in a communication connection with other downstream devices, receiving a JTAG signal includes: other downstream devices receiving a JTAG signal sent by the first downstream device; wherein, the first downstream device is the first downstream device in the chain connection; and other downstream devices are at least one downstream device in the chain connection other than the first downstream device.
[0021] In one possible implementation, the JTAG signal is used to instruct a downstream device to execute a JTAG action corresponding to a JTAG signal, and / or to instruct a downstream device to transmit a JTAG switching signal corresponding to another downstream device.
[0022] Thirdly, this application provides a JTAG switching device based on a programmable logic device, applied to a programmable logic device, comprising:
[0023] The acquisition module is used to acquire JTAG switching signals transmitted by upstream devices.
[0024] The processing module is used to respond to JTAG switching signals and obtain the presence signal of downstream devices.
[0025] The control module is used to send the JTAG signal corresponding to the JTAG switching signal to the downstream device based on the presence signal, so that the downstream device responds to the JTAG signal and realizes JTAG switching.
[0026] In one possible implementation, when there are multiple downstream devices, the control module is specifically used for:
[0027] Based on the presence signal, the downstream device that is communicatively connected to the programmable logic device among multiple downstream devices is identified as the first downstream device; a JTAG signal corresponding to the JTAG switching signal is sent to the first downstream device; so that the first downstream device responds to the JTAG signal, realizes JTAG switching, and transmits the JTAG signal corresponding to the JTAG signal to other downstream devices.
[0028] In one possible implementation, the JTAG signal corresponding to the JTAG switching signal is used to instruct the first downstream device to execute the JTAG action corresponding to the JTAG signal, and / or to instruct the first downstream device to transmit the JTAG signal corresponding to the JTAG switching signal to other downstream devices.
[0029] In one possible implementation, the upstream device includes at least a management system and / or debugging tools.
[0030] Fourthly, this application provides a JTAG switching device based on a programmable logic device, applied to downstream equipment, including:
[0031] The transmitting module is used to send an in-situ signal to the programmable logic device.
[0032] The receiving module is used to receive JTAG signals; the JTAG signal is sent by the programmable logic device after it obtains the JTAG switching signal transmitted by the upstream device and obtains the presence signal in response to the JTAG switching signal.
[0033] The control module is used to respond to JTAG signals and implement JTAG switching.
[0034] In one possible implementation, when the downstream device is communicatively connected to the programmable logic device, receiving a JTAG signal includes: receiving a JTAG signal sent by the programmable logic device;
[0035] When a downstream device communicates with a first downstream device, receiving JTAG signals includes:
[0036] Other downstream devices receive JTAG signals sent by the first downstream device; wherein, the first downstream device is the first downstream device in the chain connection; other downstream devices are at least one downstream device in the chain connection other than the first downstream device.
[0037] In one possible implementation, the JTAG signal is used to instruct a downstream device to execute a JTAG action corresponding to a JTAG signal, and / or to instruct a downstream device to transmit a JTAG switching signal corresponding to another downstream device.
[0038] Fifthly, this application provides an electronic device, including: a memory and a processor;
[0039] The memory stores the instructions that the computer executes;
[0040] The processor executes computer execution instructions stored in memory, causing the processor to perform the first aspect and / or various possible implementations of the first aspect as described above, and causing the processor to perform the second aspect and / or various possible implementations of the second aspect as described above.
[0041] In a sixth aspect, this application provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the first aspect and / or various possible implementations of the first aspect, and to cause the processor to perform the second aspect and / or various possible implementations of the second aspect.
[0042] In a seventh aspect, this application provides a computer program product, including a computer program that, when executed by a processor, implements the first aspect and / or various possible implementations of the first aspect as described above, and causes the processor to execute the second aspect and / or various possible implementations of the second aspect as described above.
[0043] The JTAG switching method, device, and product based on programmable logic devices (PLDs) provided in this application acquire JTAG switching signals transmitted from upstream devices via PLDs; respond to JTAG switching signals and acquire presence signals from downstream devices; and enable centralized management of JTAG switching signals, reducing the need for independent switching circuits and lowering the structural complexity of the JTAG switching method. Based on the presence signal, the corresponding JTAG signal is sent to the downstream device, enabling the downstream device to respond to the JTAG signal and perform JTAG switching. This effectively controls the JTAG switching of downstream devices and improves the scalability of the device. Furthermore, PLDs have good applicability, allowing for flexible expansion to multiple downstream devices, and enabling accurate and efficient transmission and response of JTAG switching signals between different upstream and downstream devices, thus improving the reliability and applicability of the PLD-based JTAG switching method. Attached Figure Description
[0044] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0045] Figure 1 This is a schematic diagram of the structure of a JTAG switching device based on a switching circuit provided in the prior art;
[0046] Figure 2 A flowchart illustrating the JTAG switching method based on programmable logic devices provided in this application embodiment. Figure 1 ;
[0047] Figure 3 A flowchart illustrating the JTAG switching method based on programmable logic devices provided in this application embodiment. Figure 2 ;
[0048] Figure 4 A schematic diagram of the structure of the JTAG switching method based on a programmable logic device provided in this application embodiment;
[0049] Figure 5 A schematic diagram of the structure of a JTAG switching device based on a programmable logic device provided in this application embodiment. Figure 1 ;
[0050] Figure 6 A schematic diagram of the structure of a JTAG switching device based on a programmable logic device provided in this application embodiment. Figure 2 ;
[0051] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.
[0052] The accompanying drawings have illustrated specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to specific embodiments. Detailed Implementation
[0053] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0054] Figure 1This is a schematic diagram of a JTAG switching device based on a switching circuit in the prior art. Figure 1 As shown, the JTAG handover scenario based on the switching circuit includes: upstream device 11, MUX chip 12, level conversion chip 13, and downstream device 14, wherein:
[0055] Communication between upstream device 11 and downstream device 14 is achieved through MUX chip 12 and level conversion chip 13, ensuring that JTAG switching signals can be transmitted between upstream device 11 and downstream device 14. JTAG switching signals are signals that switch control between different JTAG devices, typically including Test Data In (TDI), Test Data Out (TDO), Test Clock (TCK), Test Mode Select (TMS), and Test Reset (TRST). Specifically, TDI is part of the JTAG interface used to input data to the downstream device; TCK is the clock signal of the JTAG interface used to synchronize data transmission; TMS is the state selection signal of the JTAG interface used to control the state machine of the Test Access Port (TAP) controller; TRST is the reset signal of the JTAG interface used to reset the TAP controller to its initial state; and TDO is used to output data from the downstream device.
[0056] When multiple upstream devices exist, the source of the JTAG handover signal can be identified by adding a corresponding device identifier to the JTAG handover signal or by transmitting the JTAG handover signal through the corresponding channel. The MUX chip 12 locates the specific upstream device as the source of the JTAG handover signal by obtaining the device identifier contained in the JTAG handover signal or the channel used by the JTAG handover signal during transmission.
[0057] For example, upstream device 11 includes BMC 111 and debugging tool 112. BMC 111 can communicate with MUX chip 12 and transmit BMC_TDI, BMC_TCK, BMC_TMS, and BMC_TRST to MUX chip 12. At the same time, MUX chip 12 can transmit BMC_TDO to BMC 111. Among them, BMC_TDI, BMC_TDO, BMC_TCK, BMC_TMS, and BMC_TRST correspond to TDI, TDO, TCK, TMS, and TRST in JTAG signals, respectively.
[0058] The debugging tool 112 can communicate with the MUX chip 12, transmitting DEBUG_TDI, DEBUG_TCK, DEBUG_TMS, and DEBUG_TRST to the MUX chip 12; simultaneously, the MUX chip 12 can transmit DEBUG_TDO to the debugging tool 112. Here, DEBUG_TDI, DEBUG_TDO, DEBUG_TCK, DEBUG_TMS, and DEBUG_TRST correspond to TDI, TDO, TCK, TMS, and TRST in the JTAG signals, respectively.
[0059] The main function of the level conversion chip 13 is to adapt the voltage levels between the upstream device 11 and the downstream device 14. If the voltage levels between the upstream device 11 and the downstream device 14 are different, when the upstream device 11 transmits information to the downstream device 14, the level conversion chip 13 converts the TDI_0, TCK_0, TMS_0, and TRST_0 sent by the MUX 12 into the corresponding voltage levels of the downstream device 14, obtaining TDI corresponding to TDI_0, TCK corresponding to TCK_0, TMS corresponding to TMS_0, and TRST corresponding to TRST_0; and then transmits TDI, TCK, TMS, and TRST to the downstream device 14. When the downstream device 14 transmits information to the upstream device 11, the level conversion chip 13 converts the TDO sent by the downstream device 14 into the corresponding voltage level of the MUX chip 12, obtaining TDO_0; and then transmits TDO_0 to the MUX chip 12.
[0060] For example, when the upstream device 11 has a power supply voltage of P3V3 and the downstream device 14 has a power supply voltage of P1V8, when the upstream device 11 transmits information to the downstream device 14, the level conversion chip 13 converts the P3V3 level information sent by the upstream device 11 into the P1V8 level; when the downstream device 14 transmits information to the upstream device 11, the level conversion chip 13 converts the P1V8 level information sent by the downstream device 14 into the P3V3 level, ensuring that information can be transmitted correctly and effectively between the upstream device 11 and the downstream device 14.
[0061] In related technologies, JTAG switching is achieved by building a switching circuit in the hardware circuit. This method uses a MUX switching chip and a level conversion chip, and implements the JTAG switching function through a BMC or programmable logic device. However, this method has the following problems: ① The designed switching circuit requires multiple checks, resulting in high R&D costs and high hardware coupling; ② The switching circuit requires additional chips, leading to high hardware costs; ③ When multiple devices require JTAG switching, multiple switching circuits need to be built, resulting in time-consuming design. In summary, the method of achieving JTAG switching by building a switching circuit in the hardware circuit suffers from complex system structure, long design time, and low applicability of the switching circuit.
[0062] The JTAG switching method based on a programmable logic device (PLD) provided in this application acquires the JTAG switching signal transmitted by the upstream device through the PLD; responds to the JTAG switching signal and acquires the presence signal of the downstream device; it enables centralized management of the JTAG switching signal, reducing the need for independent switching circuits and lowering the structural complexity of the JTAG switching method. Based on the presence signal, it sends the corresponding JTAG signal to the downstream device; enabling the downstream device to respond to the JTAG signal and realize JTAG switching, effectively controlling the behavior of the downstream device and improving the device's scalability. The PLD has good applicability, enabling accurate and efficient transmission and response of JTAG switching signals between different upstream and downstream devices, improving the reliability and applicability of the JTAG switching method.
[0063] The following specific embodiments describe in detail the technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0064] Figure 2 A flowchart illustrating the JTAG switching method based on programmable logic devices provided in this application embodiment. Figure 1 .like Figure 2 As shown, the JTAG switching method based on programmable logic devices is applied to programmable logic devices. The method includes:
[0065] S201. Obtain the JTAG switching signal transmitted by the upstream device.
[0066] The programmable logic device receives JTAG switching signals transmitted from upstream devices via the JTAG interface. JTAG switching signals are used to switch control between different JTAG devices.
[0067] For example, a programmable logic device (PLD) configures a JTAG interface to establish a communication channel between the PLD and an upstream device. The PLD monitors the signals in the communication channel to obtain JTAG switching signals from the upstream device. The PLD identifies the switching signal through the TDI in the JTAG switching signal and synchronizes data transmission on TDI and TDO through the TCK signal.
[0068] For example, when the upstream device is a debugging tool, the programmable logic device (PLD) establishes a communication channel with the debugging tool for information transmission. The PLD monitors the signal lines in the communication channel. When the debugging tool sends a JTAG switching signal through the TDI signal line in the communication channel, the PLD receives and acquires the JTAG switching signal transmitted by the upstream device.
[0069] S202, respond to the JTAG switching signal and obtain the presence signal of the downstream device.
[0070] Upon receiving a JTAG switching signal, the programmable logic device (PLD) responds by sending a request to the downstream device via the communication channel to obtain the downstream device's presence signal. The PLD obtains the downstream device's presence signal sent via the TDO line in the communication channel.
[0071] S203. Based on the presence signal, send the JTAG signal corresponding to the JTAG switching signal to the downstream device so that the downstream device responds to the JTAG signal and realizes JTAG switching.
[0072] The programmable logic device (PLD) detects the status of downstream devices based on the presence signal and determines which downstream device needs to send a JTAG switching signal. It then sends the corresponding JTAG signal to the downstream device. The downstream device responds to the JTAG signal, completing the JTAG switching. JTAG signals typically include TDI, TDO, TCK, TMS, and TRST.
[0073] The JTAG switching method based on programmable logic devices (PLDs) provided in this application is applied to PLDs. It acquires JTAG switching signals transmitted from upstream devices via the PLD; responds to the JTAG switching signals and acquires the presence signals of downstream devices; it enables centralized management of JTAG switching signals, reducing the need for independent switching circuits and lowering structural complexity. Based on the presence signals, it sends JTAG signals corresponding to the JTAG switching signals to downstream devices, enabling downstream devices to respond to the JTAG signals and achieve JTAG switching. This effectively controls the behavior of downstream devices and improves device scalability. PLDs have good applicability; using PLDs for JTAG switching allows for easy addition or removal of downstream devices as needed without large-scale system redesign or adjustment. Simultaneously, it enables accurate and efficient transmission and response of JTAG switching signals between different upstream and downstream devices, improving the reliability and applicability of the JTAG switching method.
[0074] In one possible implementation, when there are multiple downstream devices, step 203 may further include:
[0075] Step 1: Based on the presence signal, determine the downstream device that is connected to the programmable logic device among multiple downstream devices as the first downstream device.
[0076] The programmable logic device (PLD) obtains the connection methods between multiple downstream devices and the PLD based on the presence signals. Based on these connection methods, it identifies the downstream device that directly establishes a communication connection with the PLD as the first downstream device.
[0077] Optionally, the programmable logic device and multiple downstream devices are connected in a daisy chain. For example, assuming there are three downstream devices, they are named Device A, Device B, and Device C to distinguish them. Based on the presence signal, it is determined that the output of the programmable logic device is directly connected to the input of Device A, the output of Device A is directly connected to the input of Device B, the output of Device B is directly connected to the input of Device C, and the output of Device C is directly connected to the input of the programmable logic device. Therefore, Device A, which is directly connected to the input of the programmable logic device, is the first downstream device.
[0078] Step 2: Send the JTAG signal corresponding to the JTAG switching signal to the first downstream device; so that the first downstream device responds to the JTAG signal, realizes the JTAG switching, and transmits the JTAG signal corresponding to the JTAG switching signal to other downstream devices.
[0079] The programmable logic device sends a JTAG signal corresponding to the JTAG switching signal to the first downstream device, instructing the corresponding downstream device to perform the corresponding operation. When the JTAG signal instructs the first downstream device to perform a JTAG switch, the first downstream device responds to the JTAG signal, performs the corresponding JTAG switching operation, realizes the JTAG switch for the first downstream device, and transmits the JTAG signal corresponding to the JTAG switching signal to other downstream devices. When the JTAG signal instructs other downstream devices to perform a JTAG switch, the first downstream device responds to the JTAG signal, transmits the JTAG signal corresponding to the JTAG switching signal to the corresponding other downstream devices, and the other downstream devices respond to the JTAG signal, realizing the JTAG switch.
[0080] In one possible implementation, the JTAG signal corresponding to the JTAG switching signal is used to instruct the first downstream device to execute the JTAG action corresponding to the JTAG signal, and / or to instruct the first downstream device to transmit the JTAG signal corresponding to the JTAG switching signal to other downstream devices.
[0081] JTAG action refers to the action taken by a downstream device in response to a JTAG signal after receiving the JTAG switching signal.
[0082] The JTAG signal corresponding to the JTAG switching signal is used to control the execution of the corresponding JTAG action on the specified downstream device, and / or to control the transmission of specific JTAG switching information by the specified downstream device.
[0083] For example, assume there are three downstream devices: device A, device B, and device C. The output of the programmable logic device (PLD) is directly connected to the input of device A; the output of device A is directly connected to the input of device B; the output of device B is directly connected to the input of device C; and the output of device C is directly connected to the input of the PLD. In one example, when the JTAG signal corresponding to the JTAG switching signal is used to instruct the first downstream device to execute the JTAG action, device A, as the first downstream device, receives the JTAG signal corresponding to the JTAG switching signal and executes the JTAG action, thus achieving JTAG switching. In another example, when the JTAG signal corresponding to the JTAG switching signal is used to instruct the first downstream device to transmit the JTAG signal corresponding to the JTAG switching signal to other downstream devices, device A, as the first downstream device, receives the JTAG signal corresponding to the JTAG switching signal and responds to the JTAG signal by transmitting the JTAG signal corresponding to the JTAG switching signal to device B. Device B receives the JTAG signal corresponding to the JTAG switching signal transmitted by Device A, and responds to the JTAG signal to realize JTAG switching.
[0084] In one possible implementation, the upstream device includes at least a management system and / or debugging tools.
[0085] The management system is a component that sends JTAG signals to manage system resources. Optionally, the management system can be a Central Processing Unit (CPU) or a BMC. Debugging tools are tools used to test and debug electronic devices. Upstream devices may also include components for managing JTAG switching, in addition to the management system and debugging tools. For example, the component managing JTAG switching can be any of a JTAG converter, development board, emulator, and JTAG switching chip.
[0086] Figure 3 A flowchart illustrating the JTAG switching method based on programmable logic devices provided in this application embodiment. Figure 2 A JTAG switching method based on programmable logic devices is applied to downstream devices.
[0087] like Figure 3 As shown, the method includes:
[0088] S301, Send an in-situ signal to the programmable logic device.
[0089] After the downstream device starts up and enters the ready state, it generates an in-place signal and sends it to the programmable logic device. The in-place signal is used to indicate the status of the downstream device.
[0090] Optionally, when a downstream device receives a request from a programmable logic device to obtain an in-situ signal from the programmable logic device, the downstream device sends an in-situ signal to the programmable logic device.
[0091] S302, Receive JTAG signal; The JTAG signal is sent by the programmable logic device after it receives the JTAG switching signal transmitted by the upstream device and obtains the presence signal in response to the JTAG switching signal.
[0092] After receiving the JTAG switching signal from the upstream device, the programmable logic device (PLD) detects the presence signal of the downstream device. The PLD generates a JTAG signal based on the JTAG switching signal and the presence signal. The PLD then sends the JTAG signal to the downstream device.
[0093] Downstream devices receive JTAG signals sent by programmable logic devices.
[0094] S303 responds to JTAG signals to perform JTAG switching.
[0095] Downstream devices respond to JTAG signals, parse the JTAG signals, and determine the target downstream device from which JTAG handover needs to be performed. The target downstream device receives the corresponding JTAG signal and responds to the target downstream device's JTAG handover operation, thus completing the JTAG handover.
[0096] The JTAG switching method based on a programmable logic device provided in this application is applied to downstream devices. It involves sending an in-situ signal to the programmable logic device; receiving a JTAG signal (the JTAG signal is sent by the programmable logic device after receiving a JTAG switching signal from an upstream device and in response to the in-situ signal); and performing JTAG switching in response to the JTAG signal. This provides a highly efficient, reliable, and flexible JTAG switching method for downstream devices. Furthermore, the downstream device performs automated JTAG switching upon receiving the JTAG signal, reducing manual intervention and improving the efficiency of JTAG switching.
[0097] In one possible implementation, when there is only one downstream device, receiving a JTAG signal when the downstream device is communicatively connected to the programmable logic device includes receiving a JTAG signal sent by the programmable logic device. Specifically, the downstream device can establish a communication connection with the programmable logic device through a JTAG interface and receive JTAG signals sent by the programmable logic device through the JTAG interface.
[0098] In one possible implementation, when there are multiple downstream devices, these devices are connected in a daisy-chain configuration. The downstream device communicating with the programmable logic device (PLD) is designated as the first downstream device, and the other downstream devices are communicatively connected to the first downstream device. In this implementation, the step of receiving a JTAG signal may include: other downstream devices receiving a JTAG signal sent by the first downstream device. That is, when the first downstream device receives a JTAG signal sent by the PLD, it responds by transmitting the JTAG signal to the other downstream devices.
[0099] For example, if there are 5 downstream devices, assuming they are device A, device B, device C, device D, and device E, and these devices are linked sequentially, device A is the first downstream device. In the linked connection, the other downstream devices besides device A include device B, device C, device D, and device E. These other downstream devices can be one or more of devices B, C, D, and E. In one example, when the other downstream device is device C, device A and device C exchange information through device B, and device C receives JTAG signals sent by device A through device B. In another example, when the other downstream device is device E, device A and device E exchange information through devices B, C, and D, and device E receives JTAG signals sent by device A through devices B, C, and D.
[0100] In one possible implementation, the JTAG signal is used to instruct a downstream device to execute a JTAG action corresponding to a JTAG signal, and / or to instruct a downstream device to transmit a JTAG switching signal corresponding to another downstream device.
[0101] When there are multiple downstream devices, the target downstream device that needs to perform JTAG handover operation is determined based on the JTAG signal, and the non-target downstream device that does not need to perform JTAG handover operation is determined.
[0102] When a downstream device receives a JTAG signal, the JTAG signal is used to instruct the downstream device to execute the corresponding JTAG action. At this time, the downstream device can respond to the JTAG signal to determine the JTAG action that needs to be performed.
[0103] When a non-target downstream device receives a JTAG signal, the JTAG signal is used to instruct the downstream device to transmit the JTAG signal corresponding to the JTAG switching signal to other downstream devices. At this time, the non-downstream device can respond to the JTAG signal and transmit the JTAG signal to other downstream devices connected to the current non-target downstream device.
[0104] For ease of understanding, this application uses the JTAG switching method between BMC111 in upstream device 11 and downstream device 14 as an example to provide a detailed description of the scenario diagram of the JTAG switching method based on programmable logic devices.
[0105] Figure 4 This application provides a schematic diagram of the structure of a JTAG switching method based on a programmable logic device. (See attached diagram.) Figure 4 As shown in Figure A, the specific application scenarios of this application include: upstream device 11, programmable logic device 15, and downstream device 14, wherein:
[0106] Optionally, there can be multiple upstream devices 11. For example, when there are multiple upstream devices 11, each upstream device 11 includes: one BMC device, and / or multiple debugging tools. For example, when there are four upstream devices 11, each upstream device 11 includes: one BMC device, and / or three debugging tools.
[0107] Optionally, when there are multiple upstream devices 11, multiple upstream devices can control multiple downstream devices. For example, if there are 5 upstream devices and 4 downstream devices, any one of the 5 upstream devices can control any one of the 4 downstream devices.
[0108] Optionally, when there are multiple downstream devices, the upstream device can send a JTAG switching signal to all of the multiple downstream devices; the upstream device can also send a JTAG switching signal to one or more of the multiple downstream devices.
[0109] For ease of understanding, the process of JTAG switching is described in detail using the example of BMC111 communicating with programmable logic device 15 to transmit JTAG switching signals. Those skilled in the art should understand that when the upstream device 11 is of a different type of processor, the process of communicating with programmable logic device 15 to transmit JTAG switching signals is similar to the process of BMC111 communicating with programmable logic device 15 to transmit JTAG switching signals.
[0110] When there are two upstream devices 11, the upstream device 11 includes a BMC 111 and a debugging tool 112.
[0111] BMC111 can communicate with programmable logic device 15 and transmit any one of the following signals to programmable logic device 15: BMC_TDO, BMC_TDI, BMC_TCK, BMC_TMS, and BMC_TRST. Simultaneously, programmable logic device 15 can transmit TDO_0 to BMC111.
[0112] Optionally, the BMC111 can transmit Control_gpio to the programmable logic device 15. The BMC111 uses Control_gpio to switch JTAG connections. The BMC111 and programmable logic device 15 transmit Control_gpio signals via GPIO (General Purpose Input / Output) pins. Optionally, when the number of downstream devices 14 is small, the BMC111 can control the programmable logic device via GPIO pins. For example, when the number of downstream devices 14 is less than two, the BMC111 controls the programmable logic device via GPIO pins.
[0113] The BMC controls the CPLD by writing specific values to its registers. By changing the register values, the BMC111 can control the programmable logic device 15 to perform different operations. When the BMC111 needs to manage multiple downstream devices 14, it communicates with them via JTAG switching signals. The BMC111 can choose to send its JTAG switching signals to downstream devices through register settings, or it can choose to pass-through the JTAG switching signals of other upstream devices to downstream devices.
[0114] Optionally, when there are multiple upstream devices, the upstream devices can directly communicate with the programmable logic device 15 to transmit JTAG switching signals. Alternatively, the upstream devices can be configured by other upstream devices through register settings to send the JTAG switching signals of the upstream devices to the downstream devices.
[0115] For example, assuming that downstream device 14 includes device A, device B and device C, and upstream device includes device D and BMC111, BMC111 can send the JTAG switching signal of device D in the upstream device to device A and send the JTAG switching signal of BMC111 to device B through register settings.
[0116] Optionally, the BMC111 controls multiple downstream devices 14 through registers. For example, if there are 5 downstream devices 14 and the register defines a 3-bit data width, the BMC111 controls the first downstream device 14 through 3'b000; controls the second downstream device 14 through 3'b001; controls the third downstream device 14 through 3'b010; controls the fourth downstream device 14 through 3'b011, and so on, so that the BMC111 can control multiple downstream devices 14 through registers.
[0117] When the BMC111 controls multiple downstream devices through registers, it offers at least the following advantages: ① The BMC controls registers via code through the I2C communication protocol between the BMC and the programmable logic device (PLD), eliminating the need to pull additional GPIOs (General Purpose Input / Output) from the BMC to the PLD, significantly reducing the number of GPIO pins required and saving valuable hardware resources. ② When controlling PLDs via GPIO pins, additional GPIO pins require the use of GPIO expansion chips. The BMC111's register-based control of multiple downstream devices avoids this, reducing additional hardware costs. ③ The BMC111's register-based control of multiple downstream devices allows for flexible decision-making regarding whether to send its own JTAG switching signals or those of other upstream devices, improving flexibility and scalability. It also reduces the likelihood of signal conflicts and the number of GPIO pins used, lowering costs and improving the efficiency and stability of JTAG switching.
[0118] The debugging tool 112 can communicate with the programmable logic device 15 and transmit any one of the following signals to the programmable logic device 15: DEBUG_TDO, DEBUG_TDI, DEBUG_TCK, DEBUG_TMS, and DEBUG_TRST. Simultaneously, the programmable logic device 15 can transmit DEBUG_TDO to the debugging tool.
[0119] Specifically, in Figure 1 In the corresponding embodiments, the contents and information transmitted by BMC_TDO, BMC_TDI, BMC_TCK, BMC_TMS, BMC_TRST, TDO_0, DEBUG_TDO, DEBUG_TDI, DEBUG_TCK, DEBUG_TMS, and DEBUG_TRST during JTAG handover have been described in detail. Those skilled in the art can refer to... Figure 1 The content of the corresponding embodiments will not be repeated here.
[0120] The programmable logic device 15 acts as an intermediary, converting the JTAG switching signal of the upstream device 11 and transmitting it to the downstream device 14. This includes converting the levels of TDI_0, TCK_0, TMS_0 and TRST_0 in the upstream device 11 and transmitting them to the downstream device 14; and converting the level of TDO_0 in the downstream device 14 and transmitting it to the upstream device 11.
[0121] Optionally, there can be multiple downstream devices 14. The number of downstream devices 14 can be set according to the actual operational needs. When there are multiple downstream devices, they are connected to the upstream devices in a daisy-chain configuration via programmable logic devices. In the daisy-chain, each downstream device connects sequentially to the JTAG port of the next downstream device through its JTAG port, forming a linear chain. The linear chain includes a head downstream device at the beginning and a tail downstream device at the end. The head downstream device connects to the upstream device via programmable logic devices to directly receive information from the upstream device and transmit information to other downstream devices. The tail downstream device connects to the upstream device via programmable logic devices to directly send information to the upstream device.
[0122] Figure 4 In the JTAG switching signals, TDI_0, TDI_1, and TDI_n correspond to TDI; TDO_0, TDO_1, and TDO_n correspond to TDO; TCK_0, TCK_1, and TCK_n correspond to TCK; TMS_0, TMS_1, and TMS_n correspond to TMS; and TRST_0, TRST_1, and TRST_n correspond to TRST.
[0123] For ease of understanding, this application provides detailed illustrations of scenarios involving 1, 2, and n downstream devices, respectively, to illustrate the JTAG switching method based on programmable logic devices. Here, n can be any positive integer greater than or equal to 1. Those skilled in the art should understand that the numbers of 1 and 2 downstream devices mentioned herein are exemplary and intended only to aid understanding, and should not be construed as a limitation on the number of downstream devices.
[0124] like Figure 4 As shown in Figure A, when there is only one downstream device, it includes downstream device 14. Downstream device 14 establishes a communication connection between upstream device 11 and downstream device 14 through programmable logic device 15. Downstream device 14 receives TDI_0, TCK_0, TMS_0, and TRST_0 from the JTAG switching signal sent by upstream device 11 after level conversion by programmable logic device 15. Programmable logic device 15 then performs level conversion on the information sent by downstream device 14 via TDO_0 and transmits it to upstream device 11.
[0125] like Figure 4As shown in Figure B, when there is only one downstream device, the downstream devices include: downstream device 14-1 and downstream device 14-2. Downstream devices 14-1 and 14-2 establish a communication connection with upstream device 11 through programmable logic device 15. Downstream devices 14-1 and 14-2 are linked, establishing a communication connection between downstream device 14-1 (TDO_0) and downstream device 14-2 (TDI_1). Downstream device 14-1 receives TDI_0, TCK_0, TMS_0, and TRST_0 from the JT1G switching signal sent by upstream device 11 after level conversion by programmable logic device 15. Downstream device 14-2 receives TCK_1, TMS_1, and TRST_1 from the JT1G switching signal sent by upstream device 11 after level conversion by programmable logic device 15. Programmable logic device 15 transmits the information sent by downstream device 14-2 through TDO_1 to upstream device 11 after level conversion.
[0126] like Figure 4 As shown in Figure C, when there are n downstream devices, the downstream devices include: downstream device 14-1, downstream device 14-2, ..., downstream device 14-n. The n downstream devices establish communication connections with the upstream device 11 through a programmable logic device 15. The n downstream devices are linked together in a chain. Each downstream device from 14-2 to 14-n establishes a communication connection with the previous downstream device in the chain, through the TDO communication channel of the previous downstream device and the TDI communication channel of each downstream device. Downstream device 14-1 receives the JT1G switching signal sent by the upstream device 11 from the programmable logic device 15, and obtains TDI_0, TCK_0, TMS_0, and TRST_0 after level conversion. The programmable logic device 15 receives the information sent by downstream device 14-2 through TDO_n-1, and transmits the information to the upstream device 11 after level conversion.
[0127] Figure 5 A schematic diagram of the structure of a JTAG switching device based on a programmable logic device provided in this application embodiment. Figure 1 .like Figure 5 As shown, the JTAG switching device 50 based on a programmable logic device provided in this embodiment is applied to a programmable logic device and includes:
[0128] The acquisition module 501 is used to acquire the JTAG switching signal transmitted by the upstream device.
[0129] The processing module 502 is used to respond to the JTAG switching signal and obtain the presence signal of the downstream device.
[0130] The control module 503 is used to send a JTAG signal corresponding to the JTAG switching signal to the downstream device according to the presence signal, so that the downstream device responds to the JTAG signal and realizes JTAG switching.
[0131] In one possible implementation, when there are multiple downstream devices, the control module 503 is specifically configured to: determine, based on the presence signal, identify the downstream device that is communicatively connected to the programmable logic device as the first downstream device; send a JTAG signal corresponding to the JTAG switching signal to the first downstream device; enable the first downstream device to respond to the JTAG signal, realize JTAG switching, and transmit the JTAG signal corresponding to the JTAG switching signal to other downstream devices.
[0132] In one possible implementation, the JTAG signal corresponding to the JTAG switching signal is used to instruct the first downstream device to execute the JTAG action corresponding to the JTAG signal, and / or to instruct the first downstream device to transmit the JTAG signal corresponding to the JTAG switching signal to other downstream devices.
[0133] In one possible implementation, the upstream device includes at least a management system and / or debugging tools.
[0134] Figure 6 A schematic diagram of the structure of a JTAG switching device based on a programmable logic device provided in this application embodiment. Figure 2 .like Figure 6 As shown, the JTAG switching device 60 based on a programmable logic device provided in this embodiment is applied to downstream devices and includes:
[0135] The transmitting module 601 is used to transmit an in-situ signal to the programmable logic device;
[0136] The receiving module 602 is used to receive JTAG signals; the JTAG signal is sent by the programmable logic device after it obtains the JTAG switching signal transmitted by the upstream device and obtains the presence signal in response to the JTAG switching signal.
[0137] The control module 603 is used to respond to JTAG signals and implement JTAG switching.
[0138] In one possible implementation, when a downstream device is communicatively connected to a programmable logic device, receiving a JTAG signal includes: receiving a JTAG signal sent by the programmable logic device; when a first downstream device is communicatively connected to other downstream devices, receiving a JTAG signal includes: the other downstream devices receiving a JTAG signal sent by the first downstream device; wherein, the first downstream device is the first downstream device in the chain connection; the other downstream devices are at least one downstream device in the chain connection other than the first downstream device.
[0139] In one possible implementation, the JTAG signal is used to instruct a downstream device to execute a JTAG action corresponding to a JTAG signal, and / or to instruct a downstream device to transmit a JTAG switching signal corresponding to another downstream device.
[0140] The JTAG switching device based on a programmable logic device provided in this embodiment can execute the method provided in the above method embodiment. Its implementation principle and technical effect are similar, and will not be described in detail here.
[0141] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 7 As shown, the electronic device 70 provided in this embodiment includes at least one processor 701 and a memory 702. Optionally, the device 70 further includes a communication component 703. The processor 701, memory 702, and communication component 703 are connected via a bus 704.
[0142] In a specific implementation, at least one processor 701 executes computer execution instructions stored in memory 702, causing at least one processor 701 to perform the above-described method.
[0143] The specific implementation process of processor 701 can be found in the above method embodiments, and its implementation principle and technical effect are similar. It will not be repeated here.
[0144] In the above embodiments, it should be understood that the processor can be a CPU, or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor.
[0145] The memory may include random access memory (RAM) and may also include non-volatile memory (NVM), such as at least one disk storage device.
[0146] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings of this application are not limited to a single bus or a single type of bus.
[0147] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.
[0148] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed, implement any of the methods described above.
[0149] The aforementioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random-Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The readable storage medium can be any available medium accessible to a general-purpose or special-purpose computer.
[0150] An exemplary readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can reside in an application-specific integrated circuit (ASIC). Alternatively, the processor and the readable storage medium can exist as discrete components in the device.
[0151] The division of units is merely a logical functional division; in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.
[0152] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0153] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0154] If a function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0155] Those skilled in the art will appreciate that all or part of the steps in the above-described method embodiments can be implemented using hardware associated with program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.
[0156] Finally, it should be noted that other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This invention is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not disclosed herein, and is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of the invention is limited only by the appended claims.
Claims
1. A JTAG switching method based on a programmable logic device, applied to a programmable logic device, characterized in that, The method includes: Acquire JTAG signals transmitted from upstream devices; In response to the JTAG switching signal, the presence signal of the downstream device is obtained; Based on the presence signal, a JTAG signal corresponding to the JTAG switching signal is sent to the downstream device to enable the downstream device to respond to the JTAG signal and perform JTAG switching.
2. The method according to claim 1, characterized in that, When there are multiple downstream devices, the step of sending the JTAG signal corresponding to the JTAG switching signal to the downstream devices based on the presence signal includes: Based on the in-situ signal, the downstream device that is communicatively connected to the programmable logic device among a plurality of downstream devices is identified as the first downstream device; Send the JTAG signal corresponding to the JTAG switching signal to the first downstream device; so that the first downstream device responds to the JTAG signal, realizes JTAG switching, and transmits the JTAG signal corresponding to the JTAG switching signal to other downstream devices.
3. The solution according to claim 2, characterized in that, The JTAG signal corresponding to the JTAG switching signal is used to instruct the first downstream device to execute the JTAG signal corresponding to the JTAG action, and / or to instruct the first downstream device to transmit the JTAG signal corresponding to the JTAG switching signal to other downstream devices.
4. The method according to any one of claims 1-3, characterized in that, The upstream equipment includes at least a management system and / or debugging tools.
5. A JTAG switching method based on a programmable logic device, applied to downstream equipment, characterized in that, The method includes: Send an in-situ signal to the programmable logic device; Receive JTAG signal; the JTAG signal is sent by the programmable logic device after it receives the JTAG switching signal transmitted by the upstream device and obtains the presence signal in response to the JTAG switching signal. In response to the JTAG signal, JTAG switching is performed.
6. The method according to claim 5, characterized in that, When the downstream device is communicatively connected to the programmable logic device, receiving the JTAG signal includes: receiving the JTAG signal sent by the programmable logic device; When the first downstream device is in communicative connection with other downstream devices, receiving JTAG signals includes: The other downstream devices receive the JTAG signal sent by the first downstream device; wherein, the first downstream device is the first downstream device in the chain connection; the other downstream devices are at least one downstream device in the chain connection other than the first downstream device.
7. The method according to claim 5 or 6, characterized in that, The JTAG signal is used to instruct the downstream device to execute the JTAG signal corresponding to the JTAG action, and / or to instruct the downstream device to transmit the JTAG signal corresponding to the JTAG switching signal to other downstream devices.
8. A JTAG switching device based on a programmable logic device, characterized in that, Applied to programmable logic devices, including: The acquisition module is used to acquire JTAG switching signals transmitted by upstream devices. The processing module is used to respond to the JTAG switching signal and obtain the presence signal of the downstream device. The control module is configured to send a JTAG signal corresponding to the JTAG switching signal to the downstream device based on the presence signal, so that the downstream device responds to the JTAG signal and realizes JTAG switching.
9. A JTAG switching device based on a programmable logic device, characterized in that, Applied to downstream equipment, including: The transmitting module is used to transmit an in-situ signal to the programmable logic device; A receiving module is used to receive JTAG signals; the JTAG signals are sent by the programmable logic device after it obtains a JTAG switching signal transmitted by an upstream device and obtains the presence signal in response to the JTAG switching signal. The control module is used to respond to the JTAG signal and implement JTAG switching.
10. An electronic device, characterized in that, include: Memory, processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory, causing the processor to perform the method as described in any one of claims 1-7.
11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed, are used to implement the method as described in any one of claims 1-7.
12. A computer program product, characterized in that, Includes a computer program, which, when executed, implements the method described in any one of claims 1-7.