A Method, Device, Equipment, and Medium for Controlling the Levels of CPLD Input and Output Pins

By receiving external control instructions sent by the computer, determining the target control unit, and changing the CPLD input and output pin level, the problem of cumbersome CPLD debugging process and inability to control the physical IO level in real time in the prior art is solved, and powerful level control capabilities are achieved.

CN115421417BActive Publication Date: 2025-06-13INSPUR BUSINESS MACHINE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211048231.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-30
Publication Date
2025-06-13
Estimated Expiration
2042-08-30

AI Technical Summary

Technical Problem

During the CPLD debugging process of existing servers, the method of changing the output level of the physical IO is complicated and complicated, and it is impossible to achieve real-time level changes, and it is impossible to control the level of the input IO, resulting in incomplete debugging capabilities.

Method used

Receive external control instructions sent by the computer through preset communication methods, determine the target control unit, and change the CPLD input and output pin level based on the instruction to achieve high immediacy level control.

Benefits of technology

Simplifies the CPLD debugging process, realizes rapid changes to all physical IO PIN pin levels, has strong instant debugging capabilities, and supports control of input and output IO levels.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115421417B_ABST
    Figure CN115421417B_ABST
Patent Text Reader

Abstract

The present application discloses a method, device, equipment, and medium for changing the levels of CPLD input and output pins, which relates to the technical field of server communication and includes: receiving an external control instruction sent by a computer through a preset communication method and starting the operation of changing the pin levels; determining a corresponding target control unit for controlling the change of the CPLD input and output pin levels based on the external control instruction; and using the target control unit and based on the level change method in the external control instruction to change the levels of the CPLD input and output pins. By adding an intermediate control unit between the physical I / O of the CPLD and its corresponding core signal, the CPLD debugging for controlling the physical I / O level is realized. By receiving the external control instruction to control the pin levels in real time, the debugging requirement of instantaneously changing the physical I / O levels is met. By using the set target control unit to control the levels of both the CPLD input signal pins and the CPLD output signal pins, the situation of only controlling the output level pins is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of server communication, and particularly to a method, device, equipment, and medium for controlling the levels of CPLD input and output pins. Background Art

[0002] CPLD (Complex Programmable Logic Device) is a commonly used chip on the main board. CPLD uses programming technologies such as CMOS EPROM, EEPROM, flash memory, and SRAM to form a programmable logic device with high density, high speed, and low power consumption. It has a large number of physical I / O ports with controllable level states for server main board signal control. Each physical I / O has a number composed of a letter and a number. During the debugging process of the server main board, it is necessary to frequently change the output levels of multiple physical I / O PINs of the CPLD to modify the main board control signal. In the existing CPLD debugging process of servers, the method of changing the physical I / O output level is to change the physical I / O output level that needs to be changed in the CPLD source code, compile a new FW file, shut down the server main board, then re-burn the new FW, and then restart the server and other series of operations. The new burned FW is used to adjust the physical I / O output level and performance. Moreover, the following problems will occur. First, it involves source code changes and re-burning of the chip FW, and the steps are cumbersome and complex, resulting in cumbersome operations. Second, the cumbersome steps make it impossible to achieve immediate use. The change of the physical I / O output level is not straightforward, which is not conducive to the debugging requirements of changing the physical I / O level, resulting in poor instantaneity. Through this method, only the level change of the output I / O can be achieved, and the level of the input I / O cannot be controlled, making the debugging ability incomplete and unable to directly control the input I / O ports.

[0003] In summary, how to achieve strong instantaneity and quickly change the levels of all physical I / O PINs of the CPLD is a technical problem to be solved in this field. Summary of the Invention

[0004] In view of this, the purpose of the present invention is to provide a method, device, equipment, and medium for controlling the levels of CPLD input and output pins, which can achieve strong instantaneity and quickly change the levels of all physical I / O PINs of the CPLD. The specific solutions are as follows:

[0005] In the first aspect, the present application discloses a method for changing the levels of CPLD input and output pins, including:

[0006] Receiving an external control instruction sent by a computer through a preset communication method and starting the pin level change operation;

[0007] Determine a corresponding target control unit for controlling the level change of the CPLD input / output pins based on the external control instruction;

[0008] Use the target control unit and change the level of the CPLD input / output pins based on the level change method in the external control instruction.

[0009] Optionally, receiving the external control instruction sent by the computer through a preset communication method includes:

[0010] Receive the external control instruction sent by the computer through any one of the serial communication method, I2C communication method, and BMC communication method.

[0011] Optionally, determining a corresponding target control unit for controlling the level change of the CPLD input / output pins based on the external control instruction includes:

[0012] Mask the input signal of the target control unit so that the target control unit receives the external control instruction sent by the communication control module, and then use the external control instruction to control the target control unit.

[0013] Optionally, determining a corresponding target control unit for controlling the level change of the CPLD input / output pins based on the external control instruction includes:

[0014] Determine the target control unit from the control units based on the control unit number;

[0015] Change the level signal input to the target control unit according to the level change instruction, so that the target control unit changes the level of the CPLD input / output pins corresponding to the target control unit based on the level signal and the corresponding relationship.

[0016] Optionally, before determining the target control unit from the control units based on the control unit number, it further includes:

[0017] Construct the corresponding relationship between the control unit number and the CPLD input / output pins.

[0018] Optionally, changing the level signal input to the target control unit according to the level change instruction, so that the target control unit changes the level of the CPLD input / output pins corresponding to the target control unit based on the level signal and the corresponding relationship, includes:

[0019] Pull up and / or pull down the level signal input to the target control unit according to the pull-up selection instruction and / or pull-down selection instruction, so that the target control unit changes the level of the CPLD input / output pins corresponding to the target control unit based on the pulled-up and / or pulled-down level signal and the corresponding relationship.

[0020] Optionally, the receiving of the external control instruction sent by the computer through the preset communication method includes:

[0021] Receiving the control unit number and the level change instruction sent by the computer through the preset communication method.

[0022] In a second aspect, the present application discloses a device for changing the level of CPLD input / output pins, including:

[0023] An instruction receiving module, configured to receive an external control instruction sent by a computer through a preset communication method and initiate a pin level change operation;

[0024] A unit determination module, configured to determine a corresponding target control unit for controlling the level change of the CPLD input / output pins based on the external control instruction;

[0025] A level change module, configured to use the target control unit and change the level of the CPLD input / output pins based on the level change method in the external control instruction.

[0026] In a third aspect, the present application discloses an electronic device, including:

[0027] A memory, configured to store a computer program;

[0028] A processor, configured to execute the computer program to implement the steps of the CPLD input / output pin level control method disclosed above.

[0029] In a fourth aspect, the present application discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the steps of the CPLD input / output pin level control method disclosed above are implemented.

[0030] It can be seen that the present application discloses a method for changing the levels of CPLD input and output pins, including: receiving an external control instruction sent by a computer through a preset communication method and starting the pin level change operation; determining a corresponding target control unit for controlling the level change of the CPLD input and output pins based on the external control instruction; and using the target control unit and based on the level change method in the external control instruction to change the levels of the CPLD input and output pins. It can be seen that a target control unit is preset in the present application to receive an external control instruction for controlling it, so as to control the corresponding CPLD output pins or CPLD input pins through the target control unit to perform level control. It can be seen that based on the preset communication method for control, an intermediate control unit is added between the physical I / O of the CPLD and the corresponding kernel code signal to realize the CPLD debugging for controlling the physical I / O level, avoiding the need to modify the source code and re-burn the chip FW every time the I / O pin level needs to be adjusted, avoiding cumbersome operation steps, and at the same time, the level of the pin is controlled in real time by receiving the external control instruction to meet the debugging requirements for instantaneously changing the physical I / O level, and the levels of both the CPLD input level pins and the CPLD output level pins are controlled by the set target control unit, avoiding only controlling the output level pins. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only the embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained according to the provided drawings.

[0032] Figure 1 It is a flowchart of a method for changing the levels of CPLD input and output pins disclosed in the present application;

[0033] Figure 2 It is a schematic diagram of a principle for controlling and changing the levels of CPLD input and output pins disclosed in the present application;

[0034] Figure 3 It is a flowchart of a specific method for changing the levels of CPLD input and output pins disclosed in the present application;

[0035] Figure 4 It is a diagram of an input signal control module disclosed in the present application;

[0036] Figure 5 It is a diagram of an output signal control module disclosed in the present application;

[0037] Figure 6Schematic diagram of the structure of a CPLD input / output pin level change device disclosed in this application;

[0038] Figure 7 Structural diagram of an electronic device disclosed in this application. Detailed implementation manners

[0039] Next, the technical solutions in the embodiments of this application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of this application. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

[0040] CPLD is a commonly used chip on the main board. CPLD adopts programming technologies such as CMOS EPROM, EEPROM, flash memory, and SRAM, thus constituting a programmable logic device with high density, high speed, and low power consumption. It has a large number of physical I / O ports with controllable level states for server main board signal control. Each physical I / O has a number composed of a letter and a number. During the debugging process of the server main board, it is necessary to frequently change the output levels of multiple physical I / O PINs of the CPLD to modify the main board control signal. In the existing CPLD debugging process of servers, the method of changing the physical I / O output level is to change the physical I / O output level that needs to be changed in the CPLD source code, compile a new FW file, shut down the server main board, then re-burn the new FW, and then restart the server and other series of operations. Use the newly burned FW to adjust the physical I / O output level and performance. Moreover, the following problems will occur. First, it involves source code changes and re-burning of the chip FW, and the steps are cumbersome and complex, resulting in cumbersome operations; second, the cumbersome steps make it impossible to achieve immediate use. The change of the physical I / O output level is very indirect, which is not conducive to the debugging requirements of changing the physical I / O level, resulting in poor immediacy; in this way, only the change of the output IO level can be achieved, and the level of the input IO cannot be controlled, making the debugging ability incomplete and unable to directly control the input IO ports.

[0041] Therefore, this application provides a CPLD input / output pin level change solution, which can achieve strong immediacy and can quickly change the levels of all physical I / O PINs of the CPLD.

[0042] Referring to Figure 1 As shown, an embodiment of the present invention discloses a method for changing the CPLD input / output pin level, including:

[0043] Step S11: Receive an external control instruction sent by a computer through a preset communication method and start the pin level change operation.

[0044] In this embodiment, an external control instruction sent by a computer is received through any one of the serial communication method, the I2C communication method, and the BMC communication method. It can be understood that first, an external control instruction for the level regulation of a certain pin sent by the computer is received through a preset communication method, and then, through methods such as a serial port line, an I2C bus, and a BMC line connecting the inside of the server and the external computer, a pin level adjustment instruction from the external computer is received. It should be noted that when the communication module does not receive the serial port command of the external computer, all subsequent control units to be controlled do not process the signal, and the signal input to the control unit is directly output, that is, the operation of changing the pin level is not started, and the physical IO ports of the CPLD still execute corresponding operations according to the pre-burned program instructions; when an external control instruction is received, the operation of changing the pin level for this time is immediately started. Among them, the serial interface is abbreviated as the serial port, also known as the serial communication interface or the serial communication interface, usually referring to the COM interface, which is an extended interface using the serial communication method. The serial interface means that data is transmitted sequentially bit by bit. Its characteristics are that the communication line is simple, and only a pair of transmission lines can achieve two-way communication. For example, the telephone line can be directly used as the transmission line, thus greatly reducing the cost, especially suitable for long-distance communication, but the transmission speed is slower; the I2C bus supports any IC production process. For example: NMOS, CMOS, bipolar. The two-wire serial data and serial clock lines transmit information between the devices connected to the bus. Each device has a unique address identification, whether it is an MCU microcontroller, an LCD driver, a memory, or a keyboard interface, and can all be used as a transmitter or a receiver. The LCD driver is just a receiver, while the memory can both receive and send data. In addition to transmitters and receivers, a device can also be regarded as a host or a slave when performing data transmission. The host is the device that initializes the data transmission of the bus and generates the clock signal allowing transmission. At this time, any addressed device is considered a slave.

[0045] In this embodiment, after the operation of changing the pin level is started, it further includes: shielding the input signal of the target control unit, so that the target control unit receives the external control instruction sent by the communication control module, and then controls the target control unit by using the external control instruction. It can be understood that when the operation of changing the pin level is started, the input signal of the current internal target control unit is immediately shielded. The input signal of the current target control unit is the program pre-burned by the server FW, rather than the input signal newly generated based on the current server debugging. Therefore, it is necessary to shield the original input signal, not execute the original input signal, nor perform corresponding operations such as transmission processing on the original input signal, so as to realize controlling the target control unit through the external control instruction, and then using the target control unit to adjust the signals of the input and output pins of the CPLD.

[0046] Step S12: Determine a corresponding target control unit for controlling the level change of the CPLD input / output pins based on the external control instruction.

[0047] In this embodiment, to determine the corresponding target control unit based on the external control instruction sent by the computer, it should be noted that first, a code layer that can change the level of the IO is added on the basis of the original CPLD code, and the original code package is nested. Then, two control modules for controlling the input IO and output IO are added in this code layer. A serial communication module is added to the original code to receive external instructions and transmit control information to the two modules. In addition, a certain number of control units are arranged in the input IO control module, where the number of control units is the same as the number of pins of the CPLD external physical input IO; a certain number of control units are arranged in the output IO control module, where the number of control units is the same as the number of pins of the CPLD external physical output IO; then, based on the external control instruction, the target control unit is determined from all the control units corresponding to the input pins or output pins for adjusting the level.

[0048] Step S13: Use the target control unit to change the level of the CPLD input / output pins based on the level change method in the external control instruction.

[0049] In this embodiment, after the target control unit is determined, the level signal of the corresponding pin is adjusted by controlling the target control unit and based on the external control instruction, so as to change the level signal of the current input / output pin in a timely manner according to the current level signal requirement. Refer to Figure 2As shown, first, connect between the server motherboard and the external computer through a serial cable, so that the server can receive external control instructions in a timely manner through the serial cable. Then, based on the original code of the CPLD, add another layer of code to implement the code for changing the level of input and output pins. Set up a serial communication module for information interaction between the CPLD and the external computer. Based on the serial communication to receive control instructions, the serial communication module is used to analyze whether the current external control instruction is to control the input pin level or the output pin level after receiving the external control instruction. Since corresponding control modules are additionally set for the input pins and output pins respectively in the newly added CPLD code. For example, the pins controlled by control module 1 are INPUT1, INPUT2, INPUT3, INPUT4, INPUT5, INPUT6, and the pins controlled by control module 2 are OUTPUT1, OUTPUT2, OUTPUT3, OUTPUT4, OUTPUT5, OUTPUT6. Therefore, it is necessary to judge the external control instruction to determine whether the currently input external control instruction is for regulating the input pins or the output pins.

[0050] It can be seen that the present application discloses a method for changing the levels of CPLD input and output pins, including: receiving external control instructions sent by a computer through a preset communication method and starting the pin level change operation; determining a corresponding target control unit for controlling the CPLD input and output pin level changes based on the external control instructions; using the target control unit and based on the level change method in the external control instructions to change the CPLD input and output pin levels. It can be seen that a target control unit is preset in the present application to receive external control instructions for control, so as to control the corresponding CPLD output pins or CPLD input pins to change the levels through the target control unit. Thus, based on the preset communication method for control, an intermediate control unit is added between the physical I / O of the CPLD and the corresponding kernel code signal to achieve CPLD debugging for controlling the physical I / O level, avoiding the need to modify the source code and re-burn the chip FW every time the I / O pin level needs to be regulated, avoiding cumbersome operation steps. At the same time, the level of the pins is controlled in real time by receiving external control instructions, meeting the debugging requirements for instantaneously changing the physical I / O level, and controlling the levels of both the CPLD input level pins and the CPLD output level pins through the set target control unit, avoiding only controlling the output level pins.

[0051] Referring to Figure 3 As shown, the embodiment of the present invention discloses a specific method for changing the levels of CPLD input and output pins. Compared with the previous embodiment, this embodiment further explains and optimizes the technical solution. Specifically:

[0052] Step S21: Receive the control unit number and the level change instruction sent by the computer through a preset communication method, and initiate the pin level change operation.

[0053] In this embodiment, receiving the control unit number and the level change instruction sent by the computer through a preset communication method, it can be understood that the external control instruction contains the control unit number and the level change instruction. For example, when receiving an instruction to adjust the level of input pin 3 to a low level through serial communication, the pin level change operation is initiated. When no level instruction for adjusting any input pin is received through serial communication, the level operation of the pins controlled by the originally burned program is maintained, and no additional adjustment is made to the level of any pin.

[0054] Step S22: Determine the target control unit from the control units based on the control unit number; change the level signal input to the target control unit according to the level change instruction.

[0055] In this embodiment, the level signal input to the target control unit is pulled up and / or pulled down according to the pull-up selection instruction and / or the pull-down selection instruction, so that the target control unit changes the level of the CPLD input / output pins corresponding to the target control unit based on the pulled-up and / or pulled-down level signals and the corresponding relationship. It can be understood that when the serial communication module receives a serial port command from an external computer to control the level of a specific signal, the corresponding control unit is controlled, the input signal of the control unit is shielded, and according to the serial port command information, the output signal of the control unit is pulled up or pulled down.

[0056] In this embodiment, before determining the target control unit from the control units based on the control unit number, it further includes: constructing the corresponding relationship between the control unit number and the CPLD input / output pins. It can be understood that since an intermediate control unit with available serial port control is preset between each physical IO and the corresponding kernel code signal, each control unit has its own unique number, and this number is the same as the physical pin name of the input or output signal controlled by this module, so as to facilitate positioning and controlling the level change of a single signal. Refer to Figure 4As shown, in the input signal control module, set the correspondence between the A1 control unit and INPUT1(A1); set the correspondence between the A2 control unit and INPUT1(A2); set the correspondence between the A4 control unit and INPUT1(A4); set the correspondence between the B3 control unit and INPUT1(B3); set the correspondence between the C4 unit and INPUT1(C4). After setting the above correspondences, when the serial communication module determines that the A4 control unit is the target control unit, the A4 control unit immediately determines the internal signal whose level pin needs to be adjusted to INPUT3. Correspondingly, after receiving the control signal of INPUT1, the corresponding control unit immediately adjusts the signal input into the CPLD. Refer to Figure 5 As shown, in the output signal control module, set the correspondence between the A1 control unit and OUTPUT1(A1); set the correspondence between the A2 control unit and OUTPUT1(A2); set the correspondence between the A4 control unit and OUTPUT1(A4); set the correspondence between the B3 control unit and OUTPUT1(B3); set the correspondence between the C4 unit and OUTPUT1(C4). After setting the above correspondences, when the serial communication module determines that the A1 control unit is the target control unit, the A1 control unit immediately determines the external signal whose pin needs to be adjusted to INPUT1.

[0057] Step S23: The target control unit changes the levels of the CPLD input / output pins corresponding to the target control unit based on the level signal and the correspondence.

[0058] In this embodiment, after determining the target control unit, the levels of the CPLD input / output pins corresponding to the target control unit are changed according to the level signal in the external control instruction. For example, when it is determined that the target control unit is the B3 control unit, based on the correspondence between the B3 control unit and OUTPUT3, when the level signal in the external control instruction is pulled low, then the B3 control unit immediately adjusts the level of OUTPUT3 to a pulled-low level signal, realizing the control of the voltage signal of the input or output physical pin.

[0059] Thus, in this embodiment, by pre-setting the correspondence between the physical pins and the control units, and in the form of numbers, it is convenient for the serial communication unit to directly determine the target control unit, so that the target control unit can easily obtain the corresponding physical pin information based on the correspondence with the physical pins, and then adjust it according to the level adjustment instruction of the physical pin in the external control instruction, avoiding the realization of one-time control directly by burning the program. This application can achieve multiple corresponding adjustments of the levels of the physical input / output pins by inputting external control instructions multiple times, saving time and improving the debugging efficiency of the server motherboard.

[0060] Referring to Figure 6 as shown, an embodiment of the present invention discloses a device for changing the level of CPLD input / output pins, including:

[0061] An instruction receiving module 11, configured to receive an external control instruction sent by a computer through a preset communication method and initiate a pin level change operation;

[0062] A unit determining module 12, configured to determine a corresponding target control unit for controlling the level change of the CPLD input / output pins based on the external control instruction;

[0063] A level changing module 13, configured to use the target control unit and change the level of the CPLD input / output pins based on the level change method in the external control instruction.

[0064] The instruction receiving module 11 is configured to receive external control instructions sent by a computer through any one of serial communication mode, I2C communication mode, and BMC communication mode. It can be understood that first, external control instructions for the level regulation of a certain pin sent by the computer are received through a preset communication mode, and then, through methods such as a serial port line, I2C bus, and BMC line that connect the inside of the server to the external computer, pin level adjustment instructions from the external computer are received. It should be noted that when the communication module does not receive the serial port command of the external computer, all subsequent control units to be controlled do not process the signal, and the signal input to the control unit is directly output, that is, the operation of changing the pin level is not started, and the physical IO ports of the CPLD still execute corresponding operations according to the pre-burned program instructions; when an external control instruction is received, the operation of changing the pin level of this time is immediately started. Among them, the serial interface is abbreviated as the serial port, also known as the serial communication interface or serial communication interface, usually referring to the COM interface, which is an extended interface using serial communication mode. The serial interface means that data is transmitted sequentially bit by bit. Its characteristics are that the communication line is simple, and only a pair of transmission lines can achieve two-way communication. For example, the telephone line can be directly used as the transmission line, thus greatly reducing the cost, especially suitable for long-distance communication, but the transmission speed is slower; the I2C bus supports any IC production process, for example: NMOS, CMOS, bipolar. The two-wire serial data and serial clock lines transmit information between the devices connected to the bus. Each device has a unique address identification, whether it is an MCU microcontroller, LCD driver, memory, or keyboard interface, and can all be used as a transmitter or receiver. The LCD driver is just a receiver, and the memory can both receive and send data. In addition to transmitters and receivers, devices can also be regarded as masters or slaves when performing data transmission. The master is the device that initializes the data transmission of the bus and generates the clock signal allowing transmission. At this time, any addressed device is considered a slave. After the operation of changing the pin level is started, it further includes: shielding the input signal of the target control unit so that the target control unit receives the external control instruction sent by the communication control module, and then using the external control instruction to control the target control unit. It can be understood that after the operation of changing the pin level is started, the input signal of the current internal target control unit is immediately shielded. The input signal of the current target control unit is the program pre-burned by the server FW, rather than the input signal newly generated based on the current server debugging. Therefore, it is necessary to shield the original input signal, not execute the original input signal, nor perform corresponding operations such as transmission processing on the original input signal, so as to achieve controlling the target control unit through the external control instruction, and then using the target control unit to adjust the signals of the input and output pins of the CPLD.

[0065] The unit determination module 12 is used to raise and / or lower the level signal input by the target control unit according to the raise selection instruction and / or the lower selection instruction, so that the target control unit changes the level of the CPLD input / output pins corresponding to the target control unit based on the raised and / or lowered level signals and the corresponding relationship. It can be understood that when the serial communication module receives a serial port command from an external computer to control the level of a specific signal, it controls the corresponding control unit, shields the input signal of the control unit, and raises or lowers the output signal of the control unit according to the serial port command information. Before determining the target control unit from the control units based on the control unit number, it further includes: constructing the corresponding relationship between the control unit number and the CPLD input / output pins. It can be understood that since an intermediate control unit with available serial port control is preset between each physical IO and the corresponding kernel code signal, each control unit has its own unique number, and this number is the same as the physical pin name of the input or output signal controlled by this module, so as to facilitate positioning and controlling the level change of a single signal. Refer to Figure 4 As shown, in the input signal control module, set the corresponding relationship between control unit A1 and INPUT1(A1); set the corresponding relationship between control unit A2 and INPUT1(A2); set the corresponding relationship between control unit A4 and INPUT1(A4); set the corresponding relationship between control unit B3 and INPUT1(B3); set the corresponding relationship between unit C4 and INPUT1(C4). After setting the above corresponding relationships, when the serial communication module determines that control unit A4 is the target control unit, control unit A4 immediately determines that the internal signal whose level pin needs to be adjusted is INPUT3. Correspondingly, when receiving the control signal of INPUT1, the corresponding control unit immediately adjusts the signal input into the CPLD. Refer to Figure 5 As shown, in the output signal control module, set the corresponding relationship between control unit A1 and OUTPUT1(A1); set the corresponding relationship between control unit A2 and OUTPUT1(A2); set the corresponding relationship between control unit A4 and OUTPUT1(A4); set the corresponding relationship between control unit B3 and OUTPUT1(B3); set the corresponding relationship between unit C4 and OUTPUT1(C4). After setting the above corresponding relationships, when the serial communication module determines that control unit A1 is the target control unit, control unit A1 immediately determines that the external signal whose level needs to be adjusted is INPUT1.

[0066] The level change module 13 is used to, after determining the target control unit, adjust the level signal of the corresponding pin by controlling the target control unit and based on the external control instruction, so as to change the level signal of the current input / output pin in a timely manner according to the current level signal requirement. Refer toFigure 2 As shown, first, connect between the server motherboard and the external computer through a serial cable, so that the server can receive external control instructions in a timely manner through the serial cable. Then, on the basis of the original CPLD code, add another layer of code to implement the code for changing the level of input and output pins. Set up a serial communication module for information interaction between the CPLD and the external computer. Based on the serial communication to receive control instructions, the serial communication module is used to analyze whether the current external control instruction is for controlling the input pin level or the output pin level after receiving the external control instruction. Since corresponding control modules are additionally set for the input pins and output pins respectively in the newly added CPLD code. For example, the pins controlled by control module 1 are INPUT1, INPUT2, INPUT3, INPUT4, INPUT5, INPUT6, and the pins controlled by control module 2 are OUTPUT1, OUTPUT2, OUTPUT3, OUTPUT4, OUTPUT5, OUTPUT6. Therefore, it is necessary to judge the external control instruction to determine whether the currently input external control instruction is for regulating the input pins or the output pins.

[0067] It can be seen that the present application discloses a method for changing the levels of CPLD input and output pins, including: receiving external control instructions sent by a computer through a preset communication method and starting the pin level change operation; determining a corresponding target control unit for controlling the CPLD input and output pin level changes based on the external control instructions; using the target control unit and based on the level change method in the external control instructions to change the CPLD input and output pin levels. It can be seen that a target control unit is preset in the present application to receive external control instructions for controlling it, so as to control the corresponding CPLD output pins or CPLD input pins to perform level control through the target control unit. Thus, based on the preset communication method for control, an intermediate control unit is added between the physical I / O of the CPLD and the corresponding kernel code signal to realize the CPLD debugging for controlling the physical I / O level. Avoiding the need to modify the source code and re-burn the chip FW every time the I / O pin level needs to be regulated, avoiding cumbersome operation steps. At the same time, by receiving external control instructions to control the pin levels in real time, it meets the debugging requirements for instantaneously changing the physical I / O levels. And by setting the target control unit to control the levels of both the CPLD input level pins and the CPLD output level pins, it avoids only controlling the output level pins.

[0068] In some specific embodiments, the instruction receiving module 11 may specifically include:

[0069] A communication mode determination unit, configured to receive an external control instruction sent by a computer through any one of a serial communication mode, an I2C communication mode, and a BMC communication mode.

[0070] In some specific embodiments, the instruction receiving module 11 may specifically include:

[0071] Mask the input signal of the target control unit, so that the target control unit receives the external control instruction sent by the communication control module, and then uses the external control instruction to control the target control unit.

[0072] In some specific embodiments, the unit determination module 12 may specifically include:

[0073] A signal change sub-module, configured to determine a target control unit from the control units based on the control unit number; change the level signal input to the target control unit according to a level change instruction, so that the target control unit changes the level of the CPLD input / output pins corresponding to the target control unit based on the level signal and the corresponding relationship.

[0074] In some specific embodiments, the CPLD input / output pin level change device may specifically include:

[0075] A relationship construction unit, configured to construct a corresponding relationship between the control unit number and the CPLD input / output pins.

[0076] In some specific embodiments, the signal change sub-module may specifically include:

[0077] A level change unit, configured to raise and / or lower the level signal input to the target control unit according to a raise selection instruction and / or a lower selection instruction, so that the target control unit changes the level of the CPLD input / output pins corresponding to the target control unit based on the raised and / or lowered level signal and the corresponding relationship.

[0078] In some specific embodiments, the instruction receiving module 11 may specifically include:

[0079] An instruction receiving unit, configured to receive the control unit number and the level change instruction sent by the computer through a preset communication mode.

[0080] Furthermore, an embodiment of the present application also discloses an electronic device, Figure 7 It is a structural diagram of an electronic device 20 shown according to an exemplary embodiment, and the content in the figure should not be regarded as any limitation to the scope of use of the present application.

[0081] Figure 7Schematic diagram of the structure of an electronic device 20 provided by an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. Among them, the memory 22 is used to store a computer program, and the computer program is loaded and executed by the processor 21 to implement the relevant steps in the CPLD input / output pin level change method disclosed in any of the foregoing embodiments. Additionally, the electronic device 20 in this embodiment may specifically be an electronic computer.

[0082] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of the present application, and specific limitations are not imposed here; the input / output interface 25 is used to obtain external input data or output data to the outside, and its specific interface type can be selected according to specific application requirements, and no specific limitations are made here.

[0083] Among them, the processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 21 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), or PLA (Programmable Logic Array). The processor 21 may also include a main processor and a coprocessor. The main processor is a processor used to process data in the wake state, also known as the CPU (Central Processing Unit); the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, the processor 21 may be integrated with a GPU (Graphics Processing Unit), and the GPU is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 21 may further include an AI (Artificial Intelligence) processor, and the AI processor is used to process computational operations related to machine learning.

[0084] In addition, the memory 22, as a carrier for resource storage, may be a read-only memory, a random access memory, a disk, or an optical disc, etc., and the resources stored thereon may include an operating system 221, a computer program 222, etc., and the storage method may be temporary storage or permanent storage.

[0085] Among them, the operating system 221 is used to manage and control each hardware device on the electronic device 20 and the computer program 222, so as to implement the operation and processing of the massive data 223 in the memory 22 by the processor 21. It can be Windows Server, Netware, Unix, Linux, etc. In addition to the computer program that can be used to complete the CPLD input / output pin level change method executed by the electronic device 20 disclosed in any of the foregoing embodiments, the computer program 222 may further include computer programs that can be used to complete other specific tasks. The data 223 may include not only the data transmitted by external devices received by the electronic device, but also the data collected by its own input / output interface 25, etc.

[0086] Furthermore, the present application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the CPLD input / output pin level change method disclosed above is implemented. For the specific steps of this method, reference may be made to the corresponding content disclosed in the foregoing embodiments, and details will not be repeated here.

[0087] In this specification, the various embodiments are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. For the same or similar parts among the various embodiments, reference can be made to each other. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple. For the relevant parts, reference can be made to the description in the method section.

[0088] Those skilled in the art can further realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed in this article can be implemented by electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application. The steps of the methods or algorithms described in combination with the embodiments disclosed in this article can be directly implemented by hardware, software modules executed by a processor, or a combination of the two. The software module can be placed in a random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, register, hard disk, removable disk, CD-ROM, or any other form of storage medium well-known in the technical field.

[0089] Finally, it should also be noted that in this text, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, such that a process, method, article or device comprising a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, method, article or device comprising the element.

[0090] The above has introduced in detail a method, apparatus, device, and medium for changing the levels of CPLD input and output pins provided by the present invention. Specific examples are used in this text to elaborate on the principle and implementation manner of the present invention. The description of the above embodiments is only used to help understand the method and its core idea of the present invention; at the same time, for those of ordinary skill in the art, according to the idea of the present invention, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to the present invention.

Claims

1. A method for changing the level of CPLD input / output pins, characterized in that, it includes: Receiving an external control instruction sent by a computer through a preset communication method to initiate the pin level change operation; Determining a corresponding target control unit for controlling the CPLD input / output pin level change based on the external control instruction; Using the target control unit and based on the level change method in the external control instruction to change the CPLD input / output pin level; The determining a corresponding target control unit for controlling the CPLD input / output pin level change based on the external control instruction includes: Masking the input signal of the target control unit so that the target control unit receives the external control instruction sent by the communication control module, and then using the external control instruction to control the target control unit.

2. The method for changing the level of CPLD input / output pins according to claim 1, characterized in that, The receiving an external control instruction sent by a computer through a preset communication method includes: Receiving an external control instruction sent by a computer through any one of serial communication method, I2C communication method, and BMC communication method.

3. The method for changing the level of CPLD input / output pins according to claim 1, characterized in that, The determining a corresponding target control unit for controlling the CPLD input / output pin level change based on the external control instruction includes: Determining the target control unit from the control units based on the control unit number; Changing the level signal input to the target control unit according to the level change instruction so that the target control unit changes the CPLD input / output pin level corresponding to the target control unit based on the level signal and the corresponding relationship.

4. The method for changing the level of CPLD input / output pins according to claim 3, characterized in that, Before determining the target control unit from the control units based on the control unit number, it further includes: Constructing the corresponding relationship between the control unit number and the CPLD input / output pins.

5. The method for changing the level of CPLD input / output pins according to claim 3, characterized in that, The changing the level signal input to the target control unit according to the level change instruction so that the target control unit changes the CPLD input / output pin level corresponding to the target control unit based on the level signal and the corresponding relationship includes: Pulling up and / or pulling down the level signal input to the target control unit according to the pull-up selection instruction and / or pull-down selection instruction so that the target control unit changes the CPLD input / output pin level corresponding to the target control unit based on the pulled-up and / or pulled-down level signal and the corresponding relationship.

6. The method for changing the level of CPLD input / output pins according to any one of claims 1 to 5, characterized in that, The receiving an external control instruction sent by a computer through a preset communication method includes: Receiving the control unit number and the level change instruction sent by a computer through a preset communication method.

7. A device for changing the level of CPLD input / output pins, It is characterized in that including: An instruction receiving module, configured to receive an external control instruction sent by a computer through a preset communication method and initiate a pin level change operation; A unit determination module, configured to determine a corresponding target control unit for controlling the level change of the CPLD input / output pins based on the external control instruction; A level change module, configured to use the target control unit and change the level of the CPLD input / output pins based on the level change method in the external control instruction; The instruction receiving module includes: Mask the input signal of the target control unit so that the target control unit receives the external control instruction sent by the communication control module, and then uses the external control instruction to control the target control unit.

8. An electronic device It is characterized in that including: A memory, configured to store a computer program; A processor, configured to execute the computer program to implement the steps of the CPLD input / output pin level control method according to any one of claims 1 to 6.

9. A computer-readable storage medium It is characterized in that for storing a computer program; wherein, when the computer program is executed by a processor, the steps of the CPLD input / output pin level control method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Output / input module

    CN114598316A

  • Pin configuration method, control device and storage medium

    CN114741243A