A multi-protocol port multiplexing control method

Through the multi-protocol port multiplexing control method, the processor data is converted into the target protocol format and sent according to the protocol tag, which solves the problem of the impact of different protocol transmission rates, achieves high-speed communication efficiency and reduces processor storage pressure.

CN118381837BActive Publication Date: 2024-09-10HANGZHOU SEMISTRON MICROELECTRONICS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410805030.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-21
Publication Date
2024-09-10
Estimated Expiration
2044-06-21

AI Technical Summary

Technical Problem

The different data transmission rates of different communication protocols on the chip lead to data transmission delays, high processor storage pressure, and low communication efficiency.

Method used

Through the multi-protocol port multiplexing control method, the processor data is received and whether there is a protocol tag, and a conversion plan is generated based on the current communication protocol and protocol tag. The processor data is sent in a format that conforms to the target protocol, avoiding the impact of different protocols and improving communication. efficiency.

Benefits of technology

Realize peripheral communication of different protocols under high-speed data transmission, reduce processor storage pressure, and improve communication efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118381837B
    Figure CN118381837B
Patent Text Reader

Abstract

The present application belongs to the field of signal transmission technology, and discloses a multi-protocol port multiplexing control method, which includes: receiving processor data and current communication protocol of a processor; wherein the current communication protocol is the communication protocol with the fastest transmission rate in the processor; judging whether the processor data has a protocol tag; if not, sending the processor data to the target peripheral circuit using the current communication protocol; if so, generating a conversion scheme according to the current communication protocol and the communication protocol corresponding to the protocol tag; processing the processor data based on the conversion scheme to make it conform to the communication protocol corresponding to the protocol tag; sending the processed processor data to the peripheral circuit corresponding to the protocol tag. The present application can realize communication with peripherals of different protocols under high-speed data transmission, improve communication efficiency, and alleviate processor storage pressure.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of signal transmission, and in particular to a multi-protocol port multiplexing control method. Background Art

[0002] In the field of electronic technology, especially in the microelectronics and semiconductor industries, with the rapid advancement of integrated circuit (IC) technology, the chip package size continues to decrease, while the functional requirements are increasing. This trend has led to a high emphasis on the input and output (IO) resources on the chip, because these resources are physically limited by the package size. As an important means of communication with the outside world, the limited number of general-purpose input and output (GPIO) ports has become a key challenge in designing efficient and compact circuits.

[0003] Although some existing chips support multiple data transmission protocols such as I2C (Inter-Integrated Circuit) and SPI (Serial Peripheral Interface), in order to avoid adding a large number of IO ports, the chip will only set the number of ports for the protocol that requires the most data ports; for example, when a chip supports I2C, SPI-3 and SPI-4 protocols at the same time, since I2C only requires 2 ports to transmit data, SPI-3 protocol requires 3 ports to transmit data, and SPI-4 requires 4 ports, the chip's data port will be set according to the SPI-4 with the most demand, that is, 4 ports will be set to achieve data port multiplexing, but because different communication protocols have different transmission rates, in the case of data port multiplexing, data of different protocols can only be transmitted in queue, resulting in high-speed transmission data being affected by the previous low-speed data and delayed transmission, high processor storage pressure, and low communication efficiency. Summary of the invention

[0004] The present application provides a multi-protocol port multiplexing control method, which can realize communication with peripherals of different protocols under high-speed data transmission, improve communication efficiency, and alleviate processor storage pressure.

[0005] In a first aspect, an embodiment of the present application provides a multi-protocol port multiplexing control method, including:

[0006] receiving processor data and a current communication protocol of the processor;

[0007] Among them, the current communication protocol is the communication protocol with the fastest transmission rate in the processor;

[0008] Determine whether the processor data has a protocol tag;

[0009] If not present, the processor data is sent to the target peripheral circuit using the current communication protocol;

[0010] If it exists, a conversion scheme is generated according to the current communication protocol and the communication protocol corresponding to the protocol tag;

[0011] Processing the processor data based on the conversion scheme to make it conform to the communication protocol corresponding to the protocol tag;

[0012] The processed processor data is sent to the peripheral circuit corresponding to the protocol tag.

[0013] Furthermore, if the current communication protocol is SPI_4WIRE and the communication protocol corresponding to the protocol tag is I2C, the conversion scheme includes: merging the chip select signal and the clock signal in the processor data to obtain an I2C clock signal; and adjusting the I2C clock signal according to the polarity and phase of the current communication protocol.

[0014] Furthermore, the above-mentioned adjusting the I2C clock signal according to the polarity and phase of the current communication protocol includes:

[0015] If the polarity is 1 and the phase is 0, the I2C clock signal is inverted.

[0016] Furthermore, the method also includes:

[0017] Receiving peripheral data from any peripheral circuit other than the target peripheral circuit;

[0018] Get the protocol type of the peripheral circuit that sends peripheral data;

[0019] Generate a conversion plan based on the protocol type and the current communication protocol;

[0020] Processing peripheral data based on the conversion scheme to make it conform to the current communication protocol;

[0021] Send the processed peripheral data to the processor.

[0022] Furthermore, the method also includes:

[0023] Receive peripheral data sent by multiple peripheral circuits and put them into corresponding caches;

[0024] Arbitrate the data of each peripheral device and obtain the sending queue;

[0025] Convert each peripheral data into the data format corresponding to the current communication protocol and then put it into the off-chip memory;

[0026] Send the peripheral data to the processor one by one in the order of the send queue.

[0027] Furthermore, the above-mentioned arbitration of each peripheral data to obtain a sending queue includes:

[0028] Analyze the data type of each peripheral data;

[0029] Obtain a preset priority list; sort the peripheral data according to the priority order of each data type in the preset priority list to obtain a sending queue.

[0030] Furthermore, the method also includes:

[0031] The count value of the peripheral circuit corresponding to the peripheral data at the end of the sending queue is increased by 1;

[0032] Before arbitration, it is determined whether there is a peripheral circuit corresponding to a count value greater than a preset count threshold; if so, the peripheral data sent by the peripheral circuit corresponding to the count value greater than the preset count threshold is placed at the top of the sending queue, and the count value is cleared.

[0033] Furthermore, the method also includes:

[0034] Obtain the remaining capacity of the cache corresponding to each peripheral circuit;

[0035] Determining whether there is a cache remaining capacity lower than a first preset capacity threshold;

[0036] If so, a backlog warning is sent to the peripheral circuit corresponding to the remaining capacity of the cache;

[0037] The backlog warning is used to stop the peripheral circuit from sending peripheral data.

[0038] Furthermore, the method also includes:

[0039] Obtain the remaining capacity of the cache corresponding to each peripheral circuit;

[0040] Determining whether there is a cache remaining capacity lower than a first preset capacity threshold;

[0041] If so, a backlog warning is sent to the peripheral circuit corresponding to the remaining capacity of the cache;

[0042] The backlog warning is used to stop the peripheral circuit from sending peripheral data.

[0043] Furthermore, the method also includes:

[0044] Obtaining the off-chip remaining capacity of the off-chip memory;

[0045] Determining whether the remaining capacity outside the chip is lower than a second preset capacity threshold;

[0046] If so, a pileup warning is sent to each peripheral circuit.

[0047] Furthermore, the method also includes:

[0048] Packet and time slicing rules for receive processors;

[0049] Unpack the data packet according to the time slicing rule to obtain multiple processor data with protocol tags;

[0050] Convert the data of each processor to make it conform to the communication protocol corresponding to the protocol tag;

[0051] The data of each processor is sent to the peripheral circuit corresponding to its protocol tag.

[0052] Furthermore, the method also includes:

[0053] Receive the general instruction of the processor; convert the general instruction according to the communication protocol of each peripheral circuit, obtain the general instructions of multiple different communication protocols, and send them to the peripheral circuits corresponding to the communication protocols respectively.

[0054] In a second aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of a multi-protocol port multiplexing control method as in any of the above embodiments.

[0055] In summary, compared with the prior art, the technical solution provided in the embodiment of the present application has at least the following beneficial effects:

[0056] A multi-protocol port multiplexing control method provided in an embodiment of the present application performs protocol conversion on processor data using the current communication protocol through protocol tags, and then sends them to peripheral circuits of corresponding protocols respectively. It can communicate with peripherals of different protocols under high-speed data transmission, avoid mutual influence of processor data of different protocols due to different transmission rates, thereby improving communication efficiency and alleviating processor storage pressure. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] Figure 1 A flowchart of a multi-protocol port multiplexing control method is provided for an exemplary embodiment of the present application.

[0058] Figure 2 A connection diagram of a multi-protocol port multiplexing control circuit provided for an exemplary embodiment of the present application.

[0059] Figure 3 A structural diagram of a multi-protocol port multiplexing control circuit provided for an exemplary embodiment of the present application. DETAILED DESCRIPTION

[0060] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments.

[0061] Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making any creative work shall fall within the scope of protection of this application.

[0062] See also Figure 1 , the embodiment of the present application provides a multi-protocol port multiplexing control method, specifically including:

[0063] Step S11, receiving processor data and a current communication protocol of the processor; wherein the current communication protocol is the communication protocol with the fastest transmission rate in the processor. For example, when the communication protocols supported by the processor include I2C, SPI_3WIRE and SPI_4WIRE, the current communication protocol is SPI_4WIRE with the fastest transmission rate.

[0064] Step S12, determining whether the processor data has a protocol tag.

[0065] Specifically, when the processor data is not sent to the target peripheral circuit using the current communication protocol, there will be a protocol tag to specify which communication protocol the peripheral circuit uses. For example, if the current communication protocol is SPI-4 and the processor data is to be sent to a peripheral circuit using SP-I3, there will be a SPI-3 protocol tag in the processor data.

[0066] Step S13: If not, the processor data is sent to the target peripheral circuit using the current communication protocol.

[0067] Step S14: if it exists, a conversion scheme is generated according to the current communication protocol and the communication protocol corresponding to the protocol tag.

[0068] Step S15, processing the processor data based on the conversion scheme to make it conform to the communication protocol corresponding to the protocol tag.

[0069] Step S16, sending the processed processor data to the peripheral circuit corresponding to the protocol tag.

[0070] The above-mentioned embodiment provides a multi-protocol port multiplexing control method, which performs protocol conversion on processor data using the current communication protocol through protocol tags, and then sends them to the peripheral circuits of the corresponding protocols respectively. It can communicate with peripherals of different protocols under high-speed data transmission, avoid the processor data of different protocols affecting each other due to different transmission rates, thereby improving communication efficiency and alleviating processor storage pressure.

[0071] In some embodiments, if the current communication protocol is SPI_4WIRE and the communication protocol corresponding to the protocol tag is I2C, the conversion scheme includes: merging the chip select signal and the clock signal in the processor data to obtain an I2C clock signal; adjusting the I2C clock signal according to the polarity and phase of the current communication protocol.

[0072] Specifically, when the processor data of SPI-4 is to be converted into data that complies with the I2C protocol, it is first necessary to denoise it to improve the robustness of the data and reduce the data transmission rate to adapt to the transmission rate of I2C; secondly, because I2C uses a clock signal to synchronize communication, and SPI requires two clock signals, one is the data clock (SCLK) and the other is the chip select signal, so when converting, the chip select signal of SPI needs to be merged into the clock signal: when the enable signal specified in the chip select signal is at a low level, the chip select signal is inverted and ORed with the clock signal; when the enable signal specified in the chip select signal is at a high level, the chip select signal and the clock signal are directly ORed to obtain the I2C clock signal.

[0073] Finally, because I2C starts with the falling edge of SCLK (clock signal), is sampled at a high level, and ends with the rising edge, the converted I2C clock signal needs to be adjusted accordingly.

[0074]

[0075] As shown in the table above, the known SPI protocol is composed of four SPI working modes through the combination of polarity and phase. This application determines the clock sampling mode according to the SPI-4 working mode adopted by the peripheral circuit:

[0076] When the CPOL of the SPI protocol is 1 and the CPHA is 0, it means that the clock signal level is high when idle, and the falling edge sampling starts at the second edge of the clock. At this time, the I2C clock signal needs to be flipped.

[0077] When CPOL of the SPI protocol is 1 and CPHA is 1, it means that the clock signal level is high when idle, and rising edge sampling starts at the first edge of the clock. At this time, the I2C clock signal needs to be flipped.

[0078] When the CPOL of the SPI protocol is 0 and the CPHA is 1, it means that the clock signal level in idle state is a logic low level, and the falling edge sampling is performed on the second edge of the clock. At this time, there is no need to adjust the I2C clock signal.

[0079] When CPOL of the SPI protocol is 0 and CPHA is 0, it means that the clock signal level in idle state is a logic level. Rising edge sampling starts at the first edge of the clock, and a high level needs to be added before the start bit of the I2C clock signal.

[0080] Furthermore, the method also includes:

[0081] Step S21, receiving peripheral data of any peripheral circuit except the target peripheral circuit.

[0082] Step S22, obtaining the protocol type of the peripheral circuit that sends the peripheral data.

[0083] Step S23, generating a conversion solution according to the protocol type and the current communication protocol.

[0084] Specifically, the conversion scheme generation process here is the same as the conversion process of the above-mentioned processor data, except that when the I2C protocol data is to be converted into SP1-4, there is no need to add random noise to the data, but a chip select signal with a high level enable signal must be generated, and the I2C clock signal must be adjusted in the opposite way to the above process.

[0085] Step S24, processing the peripheral data based on the conversion scheme to make it conform to the current communication protocol.

[0086] Step S25, sending the processed peripheral data to the processor.

[0087] During the specific implementation process, the peripheral circuits of each protocol will also send peripheral data to the processor; for example, after the peripheral circuit of the I2C protocol receives the temperature request of the processor, if there is no port multiplexing control method of the present application, it will directly send the current temperature value to the processor in the form of a low-speed I2C. At this time, if there is a problem with the peripheral circuit of the SPI-3 and alarm data needs to be sent to the processor, it will have to wait for the low-speed I2C protocol data to be sent first, thereby affecting communication efficiency.

[0088] The above embodiment converts the received peripheral data that is not in the current communication protocol into the form of the current communication protocol and sends it to the processor, which greatly improves the transmission rate of the peripheral data and further improves the communication efficiency.

[0089] In some embodiments, the method further comprises:

[0090] Step S31, receiving peripheral data sent by multiple peripheral circuits and putting them into corresponding caches.

[0091] Step S32, arbitrate the data of each peripheral device to obtain a sending queue.

[0092] Specifically, the data types of each peripheral device data can be parsed; a preset priority list can be obtained; and each peripheral device data can be sorted according to the priority order of each data type in the preset priority list to obtain a sending queue.

[0093] For example, in the preset priority list, alarm data is the first priority, fault data is the second priority, status request data is the third priority, variable update data is the fourth priority..., then the peripheral data is sorted according to the priority level to which the data type belongs; if there are two or more peripheral data of the same data type, they are sorted according to random rules to ensure the fairness of the sending queue generation process.

[0094] Step S33, converting the data of each peripheral device into a data format corresponding to the current communication protocol and then putting it into the off-chip memory.

[0095] Step S34, sending each peripheral device data to the processor one by one in the order of the sending queue.

[0096] Specifically, each peripheral data is first stored in the corresponding cache for arbitration. After the arbitration obtains the sending queue, each peripheral data is converted into the data format corresponding to the current communication protocol, and the first peripheral data in the sending queue is sent to the processor, and the remaining peripheral data is transferred from the cache to the DDR and waits to be sent.

[0097] The above embodiment implements arbitration processing when multiple peripheral device data are received at the same time, and further improves the communication efficiency of the present application and the fairness of data transmission while avoiding conflicts in the transmission of multiple peripheral device data.

[0098] In some embodiments, the method further comprises:

[0099] The count value of the peripheral circuit corresponding to the peripheral data at the end of the transmission queue is increased by 1.

[0100] Before arbitration, it is determined whether there is a peripheral circuit corresponding to a count value greater than a preset count threshold; if so, the peripheral data sent by the peripheral circuit corresponding to the count value greater than the preset count threshold is placed at the top of the sending queue, and the count value is cleared.

[0101] Specifically, the present application sets the count value to avoid long-term delays in the transmission of peripheral data of individual peripheral circuits; in the specific implementation process, there may be some peripheral circuits with relatively fixed functions, that is, the peripheral data they send all belong to data types ranked lower in the preset priority list, resulting in being placed at the end of the transmission queue many times; therefore, the present application uses the count value to identify these peripheral circuits that may have long-term delays in sending data because of their ordinary and fixed functions, and periodically advances their transmission order through a preset count threshold; the remaining peripheral data continues to be sorted according to the preset priority list.

[0102] The above embodiment further improves the fairness of data transmission through the design of the counting value and the preset technical threshold.

[0103] In some embodiments, the method further comprises:

[0104] Step S41, obtaining the remaining capacity of the cache corresponding to each peripheral circuit.

[0105] Step S42, determining whether there is a cache remaining capacity that is lower than a first preset capacity threshold.

[0106] Step S43: If yes, a backlog warning is sent to the peripheral circuit corresponding to the remaining capacity of the cache.

[0107] The backlog warning is used to stop the peripheral circuit from sending peripheral data; the first preset capacity threshold may be 30%.

[0108] Specifically, two thresholds can be set in the first preset capacity threshold: 40% and 20%. When the remaining capacity of the cache is lower than 40%, a delay warning is sent to instruct the corresponding cached peripheral circuit to reduce the peripheral data sent. When it is lower than 20%, an accumulation warning is sent.

[0109] Preferably, after sending the delay warning or the accumulation warning, the cache whose remaining capacity is lower than the first preset capacity threshold can be detected in real time, and after monitoring that the remaining capacity is greater than 60%, the sent delay warning or the accumulation warning can be cancelled.

[0110] Furthermore, the method also includes:

[0111] Step S51, obtaining the off-chip remaining capacity of the off-chip memory.

[0112] Step S52, determining whether the off-chip remaining capacity is lower than a second preset capacity threshold.

[0113] Step S53: If yes, a pile-up warning is sent to each peripheral circuit.

[0114] Among them, the second preset capacity threshold can be set to 40%, or two thresholds can be set as the first preset capacity threshold: 50% and 30%. When the remaining capacity outside the chip is lower than 50%, a deferred warning is sent to each peripheral circuit. When it is lower than 30%, an accumulation warning is sent to each peripheral circuit. When it is higher than 60%, the deferred warning or accumulation warning is cancelled.

[0115] The above embodiment can avoid the problem of peripheral data packet loss caused by the full capacity of the cache or the off-chip memory by performing real-time detection on the remaining capacity of the cache and the off-chip memory.

[0116] In some embodiments, the method further comprises:

[0117] Step S61, receiving a data packet and a time slicing rule from a processor.

[0118] Step S62, unpacking the data packet according to the time slicing rule to obtain a plurality of processor data with protocol tags.

[0119] Step S63, converting the data of each processor to make it conform to the communication protocol corresponding to the protocol tag it carries.

[0120] Step S64, sending each processor data to the peripheral circuit corresponding to its protocol tag.

[0121] Specifically, when multiple processor data are received simultaneously and the protocol tags carried therein are different from each other, the formats of the processor data need to be converted according to the protocol tags therein and sent to the peripheral circuit corresponding to the protocol tag.

[0122] Furthermore, the method also includes:

[0123] Receive the general instruction of the processor; convert the general instruction according to the communication protocol of each peripheral circuit, obtain the general instructions of multiple different communication protocols, and send them to the peripheral circuits corresponding to the communication protocols respectively.

[0124] Among them, the general instructions are data sent to all peripheral circuits, so they are directly converted into the format according to the communication protocol of each peripheral circuit and sent to each peripheral circuit. The present application can also perform the remaining capacity threshold judgment and warning feedback on the processor cache that caches the processor data as the above cache and off-chip memory.

[0125] The above embodiment realizes the synchronous transmission of data of multiple processors, further improving the communication efficiency of the present application.

[0126] See also Figure 2An embodiment of the present application provides a multi-protocol port multiplexing control circuit, hereinafter referred to as a protocol selection circuit; the protocol selection circuit is connected to a processor and multiple peripheral circuits respectively.

[0127] The processor is connected to the protocol selection circuit through a data transmission interface, and is used to convert the communication protocol used by the peripheral circuit into a protocol tag when sending processor data to any peripheral circuit except the target peripheral circuit, and put the protocol tag into the processor data and send it to the protocol selection circuit with the current communication protocol.

[0128] The protocol selection circuit is also used to convert the processor data into a data format of a communication protocol corresponding to the protocol tag after receiving the processor data with the protocol tag, and send it to the peripheral circuit corresponding to the protocol tag.

[0129] In the above embodiment, when the processor sends data to a peripheral circuit, if the communication protocol used by the peripheral circuit is not the current communication protocol with a high transmission rate configured by the processor, a protocol tag can be added to enable the protocol selection circuit to convert the protocol and send it smoothly to the corresponding peripheral circuit.

[0130] Furthermore, the protocol selection circuit is also used to convert the peripheral data into a data format of the current communication protocol after receiving the peripheral data of any peripheral circuit other than the target peripheral circuit, and send it to the processor.

[0131] See also Figure 3 In some embodiments, the protocol selection circuit is also connected to an off-chip memory, and the protocol selection circuit includes a logic control module and a plurality of caches connected to each peripheral circuit in a one-to-one correspondence.

[0132] The logic control module is used to receive peripheral data from multiple peripheral circuits and put them into corresponding caches; and, arbitrate each peripheral data to obtain a sending queue; and, convert the format of each peripheral data and put it into an off-chip memory; and, send each peripheral data in the off-chip memory to the processor one by one according to the sending queue.

[0133] Among them, the off-chip memory is Figure 2 DDR in the cache is Figure 2 buf1, buf2, etc.

[0134] Specifically, the protocol selection circuit will first store the peripheral data received simultaneously into the corresponding cache for arbitration. After the arbitration obtains the sending queue, it will convert the peripheral data into the data format corresponding to the current communication protocol, and send the first peripheral data in the sending queue to the processor. The remaining peripheral data will be transferred from the cache to the DDR for waiting.

[0135] Furthermore, the processor is also used to put the protocol tag of each peripheral circuit into the corresponding processor data, and merge the processor data with different protocol tags into a data packet based on the time slicing rule.

[0136] The protocol selection circuit is also used to receive data packets and time slicing rules sent by the processor, and unpack the data packets according to the time slicing rules to obtain multiple processor data with protocol tags; and, convert the format of each processor data according to its protocol tag and send it to the peripheral circuit corresponding to its protocol tag.

[0137] Specifically, when the processor sends multiple processor data to different peripheral circuits at the same time, the time slicing method based on the Python language is used to package the data of each processor. The time slicing rule will explain how long it takes to read the data packet at a certain rate to obtain the data as the processor data with the protocol marked as I2C / SPI3 / SPI4, so that the protocol selection circuit can simultaneously obtain multiple processor data with different protocol marks, convert them according to the protocol mark, and send them to the corresponding peripheral circuit.

[0138] For the specific definition of the protocol selection circuit provided in this embodiment, please refer to the above embodiment of a multi-protocol port multiplexing control method, which will not be repeated here.

[0139] The embodiment of the present application provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of a multi-protocol port multiplexing control method as in any of the above embodiments are implemented. Wherein, the computer-readable storage medium refers to a carrier for storing data, which may include but is not limited to a floppy disk, an optical disk, a hard disk, a flash memory, a USB flash drive and / or a memory stick (Memory Stick), etc., and the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The working process, working details and technical effects of the computer-readable storage medium provided in this embodiment can be found in the above embodiment of a multi-protocol port multiplexing control method, which will not be repeated here.

[0140] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in the present application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0141] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0142] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. A multi-protocol port multiplexing control method, characterized in that: include: receiving processor data and a current communication protocol of the processor; Wherein, the current communication protocol is the communication protocol with the fastest transmission rate in the processor; Determining whether the processor data has a protocol tag; If not, sending the processor data to the target peripheral circuit using the current communication protocol; If so, generating a conversion scheme according to the current communication protocol and the communication protocol corresponding to the protocol tag; Processing the processor data based on the conversion scheme to make it conform to the communication protocol corresponding to the protocol tag; Sending the processed processor data to the peripheral circuit corresponding to the protocol tag; receiving a data packet and a time slicing rule from the processor; Unpacking the data packet according to the time slicing rule to obtain a plurality of processor data with protocol tags; Converting the processor data to conform to the communication protocol corresponding to the protocol tag; Each processor data is sent to the peripheral circuit corresponding to its protocol tag.

2. The multi-protocol port multiplexing control method according to claim 1, characterized in that: If the current communication protocol is SPI_4WIRE and the communication protocol corresponding to the protocol tag is I2C, the conversion scheme includes: Combining the chip select signal and the clock signal in the processor data to obtain an I2C clock signal; The I2C clock signal is adjusted according to the polarity and phase of the current communication protocol.

3. The multi-protocol port multiplexing control method according to claim 2, characterized in that: The adjusting the I2C clock signal according to the polarity and phase of the current communication protocol includes: If the polarity is 1 and the phase is 0, the I2C clock signal is flipped.

4. The multi-protocol port multiplexing control method according to claim 1, characterized in that: Also includes: Receiving peripheral data of any of the peripheral circuits except the target peripheral circuit; Acquire a protocol type of the peripheral circuit that sends the peripheral data; Generate a conversion scheme according to the protocol type and the current communication protocol; Processing the peripheral device data based on the conversion scheme to make it conform to the current communication protocol; The processed peripheral data is sent to the processor.

5. The multi-protocol port multiplexing control method according to claim 4, characterized in that: Also includes: Receiving the peripheral device data sent by the plurality of peripheral device circuits and putting the peripheral device data into a corresponding cache; Arbitrating the data of each peripheral device to obtain a sending queue; Convert each of the peripheral data into a data format corresponding to the current communication protocol and then store it into an off-chip memory; The peripheral data are sent to the processor one by one in the order of the sending queue.

6. The multi-protocol port multiplexing control method according to claim 5, characterized in that: The arbitrating the peripheral data to obtain a sending queue includes: Analyze the data type of each peripheral data; Obtain a preset priority list; sort the peripheral device data according to the priority order of each data type in the preset priority list to obtain the sending queue.

7. The multi-protocol port multiplexing control method according to claim 5, characterized in that: Also includes: Add 1 to the count value of the peripheral circuit corresponding to the peripheral data at the end of the sending queue; Before arbitration, determining whether a count value corresponding to the peripheral circuit is greater than a preset count threshold; If yes, the peripheral data sent by the peripheral circuit corresponding to the count value being greater than the preset count threshold is taken as the first of the sending queue, and the count value is cleared.

8. The multi-protocol port multiplexing control method according to claim 5, characterized in that: Also includes: Obtaining the remaining capacity of the cache corresponding to each of the peripheral circuits; Determining whether there is a remaining capacity of the cache that is lower than a first preset capacity threshold; If yes, sending a backlog warning to the peripheral circuit corresponding to the remaining capacity of the cache; The accumulation warning is used to cause the peripheral circuit to stop sending the peripheral data.

9. The multi-protocol port multiplexing control method according to claim 8, characterized in that: Also includes: Obtaining the off-chip remaining capacity of the off-chip memory; Determining whether the off-chip remaining capacity is lower than a second preset capacity threshold; If so, the accumulation warning is sent to each of the peripheral circuits.

10. The multi-protocol port multiplexing control method according to claim 1, characterized in that: Also includes: receiving a general instruction of the processor; The general instructions are converted according to the communication protocols of the peripheral circuits to obtain the general instructions of multiple different communication protocols, and are sent to the peripheral circuits corresponding to the communication protocols respectively.

11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the multi-protocol port multiplexing control method according to any one of claims 1 to 10 are implemented.