Interaction method and related device

By introducing input and output processors and shared storage space into the processor architecture, using the second processor core to process peripheral access requests and data transmission requests, the problem of excessive resource usage during the interaction between the processor and the peripheral is solved, and the problem of excessive resource usage is improved. Processor performance and reduced power consumption.

CN119066020APending Publication Date: 2024-12-03PHYTIUM TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411075680.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-06
Publication Date
2024-12-03

AI Technical Summary

Technical Problem

The interaction process between the processor and the peripherals consumes a lot of resources, resulting in a degradation in processor performance and increased latency.

Method used

Introduce an input and output processor as an intermediate medium, and respond to the access request and data transmission request of the processor core through the second processor core, reduce resource occupation of the first processor core, and realize communication between processor cores through shared storage space. .

Benefits of technology

Reduces resource consumption of processor cores during interaction with peripherals, avoids the problems of performance degradation and increased latency, while simplifying the processor architecture, reducing hardware requirements and operating power consumption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119066020A_ABST
    Figure CN119066020A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an interaction method, and the method comprises the steps: transmitting an access request for a target peripheral and / or a data transmission request initiated by a peripheral controller to a second processor core for execution, therefore, the specific access operation for the target peripheral and / or the carrying operation of the to-be-uploaded data can be executed by the second processor core, so that the disturbance of the specific access operation for the target peripheral and / or the carrying operation of the to-be-uploaded data on the first processor core is reduced; reduction of resources consumed in the interaction process of the first processor core and the peripheral is facilitated, and therefore the problems that the performance of the main core is reduced and delay is increased possibly due to the fact that a large number of resources are consumed in the interaction process of the first processor core and the peripheral are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present specification relates to the field of communication technology, specifically, to processor access technology under the field of communication technology, and more specifically, to an interaction method and related devices. Background Art

[0002] A processor (System-on-a-Chip, SOC) is a highly integrated integrated circuit. For a processor, peripherals refer to external devices connected to the processor to expand its functions. As the types of peripherals continue to increase, the interaction between the processor and peripherals may occupy a large amount of processor resources, which may lead to problems such as reduced processor performance and increased latency. Summary of the invention

[0003] The embodiments of this specification provide an interaction method and related devices to achieve the purpose of improving the performance of the main core and reducing latency.

[0004] To achieve the above technical objectives, the embodiments of this specification provide the following technical solutions:

[0005] In a first aspect, an embodiment of the present specification provides an interaction method, the interaction method is applied to a processor architecture, the processor architecture includes a first processor, an input-output processor, and at least one peripheral controller; the input-output processor serves as an intermediate medium when the first processor interacts with the at least one peripheral controller; the first processor includes a first processor core, and the input-output processor includes a second processor core; the interaction method includes:

[0006] In response to an access request for a target peripheral device sent by the first processor core, the second processor core accesses a peripheral controller corresponding to the target peripheral device according to the access request, so that the peripheral controller returns an execution result corresponding to the access request, and returns the execution result corresponding to the access request to the first processor core;

[0007] and / or

[0008] The second processor core responds to the data transmission request initiated by the peripheral controller, obtains the data to be uploaded by the peripheral controller, and sends a notification message to the first processor core, wherein the notification message is used to notify the first processor core to obtain the data to be uploaded; the data transmission request is triggered by the peripheral controller when it is necessary to upload data to the first processor core.

[0009] The interaction method provided in the embodiments of the present specification is implemented based on a processor architecture including an input-output processor and a first processor, wherein the first processor includes a first processor core, which can be used to run user applications and can be referred to as a main core, and the second processor core in the input-output processor is used to respond to an access request for a target peripheral sent by the first processor core, access a peripheral controller corresponding to the target peripheral according to the access request, so that the peripheral controller returns an execution result corresponding to the access request, and returns the execution result corresponding to the access request to the first processor core, and / or the second processor core can respond to a data transmission request initiated by the peripheral controller, obtain the data to be uploaded of the peripheral controller, and send a notification message to the first processor core to notify the first processor core to obtain the data to be uploaded. In this way, through the interaction method, the access request for the target peripheral device and / or the data transmission request initiated by the peripheral controller is handed over to the second processor core for execution, so that the specific access operation for the target peripheral device and / or the handling operation of the data to be uploaded can be executed by the second processor core, thereby reducing the disturbance of the specific access operation for the target peripheral device and / or the handling operation of the data to be uploaded to the first processor core, which is beneficial to reducing the resources consumed by the first processor core in the process of interaction with the peripheral device, thereby avoiding the problem of a large amount of resources consumed in the process of interaction between the first processor core and the peripheral device, which may cause the main core performance to decline and the delay to increase.

[0010] In one embodiment, the access request for the target peripheral device includes: an access request for a first type of peripheral device, and / or a low-speed access request for a second type of peripheral device, the first type of peripheral device includes a low-speed peripheral device, and the low-speed peripheral device is used to characterize that the rate of the low-speed peripheral device when communicating with the second processor core is less than a preset threshold;

[0011] The second category of peripherals includes high-speed peripheral devices, and the high-speed peripheral devices are used to characterize that when the high-speed peripheral device responds to a low-speed access request, the rate at which the high-speed peripheral device communicates with the second processor core is less than the preset threshold, and when the high-speed peripheral device responds to a high-speed access request, the rate at which the high-speed peripheral device communicates with the second processor core is greater than or equal to the preset threshold.

[0012] In this embodiment, at least one of the access request for the first category peripheral and the low-speed access request for the second category peripheral is used as the access request for the target peripheral and is handed over to the second processor core for specific execution. This is because the access request for the first category peripheral and the low-speed access request for the second category peripheral have lower requirements for the data transmission rate during the interaction process. Therefore, at least one of the access request for the first category peripheral and the low-speed access request for the second category peripheral is handed over to the second processor core for execution as the access request for the target peripheral. Even if an input / output processor is added as an intermediate medium between the first processor core and the target peripheral, the data transmission rate requirement of the access request for the target peripheral can still be met. By handing over the access request for the first category peripheral and the low-speed access request for the second category peripheral to the second processor core for execution, the resource occupation of the access request for the target peripheral on the first processor core can be reduced, which is beneficial to releasing the performance of the first processor core.

[0013] In one embodiment, the first type of peripherals includes: at least one of a universal asynchronous receiver / transmitter (UART) device, an integrated circuit bus (I2C) device, and a serial peripheral interface (SPI) device;

[0014] The second category of peripherals includes: at least one of a universal serial bus (USB) device, a high-speed serial computer expansion bus standard (PCIe) device, an Ethernet controller, a graphics processing unit, a cache controller, and a dynamic random access memory controller.

[0015] It is understandable that the data transmission rate requirements for high-speed access requests for the second category of peripherals are usually high. Therefore, the high-speed access requests for the second category of peripherals can be handed over to the first processor core for execution, reducing the intermediate media when the first processor core interacts with the second category of peripherals, which is conducive to ensuring the normal execution of high-speed access requests for the second category of peripherals. At the same time, the access requests for the second category of peripherals may also include low-speed access requests for the second category of peripherals. For example, access requests for status check requests for the second category of peripherals may not have high requirements for data transmission rates. Therefore, the low-speed access requests for the second category of peripherals can be handed over to the second processor core for execution, further reducing the resource occupation of the first processor core by the access requests for the peripherals.

[0016] In one embodiment, the input-output processor further includes a memory connected to the second processor core, wherein the memory connected to the second processor core is provided with a shared storage space accessible to both the first processor core and the second processor core, and the shared storage space is used to implement communication between the first processor core and the second processor core; the second processor core responding to an access request for a target peripheral sent by the first processor core, accessing a peripheral controller corresponding to the target peripheral according to the access request, so that the peripheral controller returns an execution result corresponding to the access request, includes:

[0017] The second processor core stores an access request for the target peripheral in a shared storage space of the memory connected to the second processor core in response to the first processor core, reads the access request for the target peripheral from the shared storage space, and accesses a peripheral controller corresponding to the target peripheral according to the access request, so that the peripheral controller returns an execution result corresponding to the access request.

[0018] In this embodiment, a method for ensuring normal communication between a first processor core and a second processor core is provided. Specifically, a second memory is set in the input-output processor, and a shared memory space is set in the second memory. The first processor core can store access requests for target peripherals in the shared memory space, so that the second memory core reads the access requests for the target peripherals from the shared memory space and accesses the corresponding peripheral controller, thereby realizing communication with the first processor core and execution of the access requests for the target peripherals. After the second processor core obtains the execution result returned by the peripheral controller, the execution result can also be written into the shared memory space, so that the first processor core reads the execution result from the shared memory space, thereby realizing information transmission from the second processor core to the first processor core. In this embodiment, communication between the first processor core and the second processor core is realized through the shared memory space, without requiring the first processor core and the second processor core to have direct communication capabilities, which is conducive to expanding the applicability of the interaction method.

[0019] In one embodiment, the input-output processor further includes a first register and a second register, the first register is used to store a first pointer, the second register is used to store a second pointer, when the count values ​​of the first pointer and the second pointer are different, it indicates that there is an access request to be processed in the shared memory space; the first count value of the first pointer is updated when the second processor core writes the access request into the shared memory space;

[0020] The storing, by the second processor core in response to the first processor core, the access request for the target peripheral device in the shared memory space of the second memory comprises:

[0021] polling the first pointer and the second pointer by the second processor core, and when the first count value is different from the second count value of the second pointer, querying and reading the access request in the shared storage space;

[0022] After accessing the peripheral controller corresponding to the target peripheral according to the access request, the method further includes:

[0023] A second count value of the second pointer is updated so that the second count value is the same as the first count value.

[0024] In this embodiment, whether the count values ​​of the first pointer and the second pointer are the same is used to indicate whether there is an access request from the target peripheral device that needs to be processed in the shared storage space. The second processor core polls to determine whether the access request for the target peripheral device is written into the shared storage space. The second processor does not need to handle interrupts, thus avoiding the context switching overhead required for handling interrupts.

[0025] In one embodiment, the input-output processor further includes a first register, a second register and an interrupt trigger module, the first register is used to store a first pointer, the second register is used to store a second pointer, when the count values ​​of the first pointer and the second pointer are different, it indicates that the access request exists in the shared storage space; the first count value of the first pointer is updated when the second processor core writes the access request into the shared storage space, and the interrupt trigger module includes at least one of a controller and a third register;

[0026] The storing, by the second processor core in response to the first processor core, the access request for the target peripheral device in the shared memory space of the second memory comprises:

[0027] In response to the interrupt information, querying and reading the access request in the shared memory space by the second processor core;

[0028] The interrupt information includes an interrupt generated when the controller detects that a first count value of the first pointer is different from a second count value of the second pointer;

[0029] or

[0030] The interrupt information includes an interrupt generated when the third register is triggered, and the third register is triggered when the second processor core writes the access request into the shared memory space.

[0031] In this embodiment, the interrupt trigger module triggers an interrupt message to inform the second processor core that a new access request needs to be processed. The second processor core does not need to continuously access the count values ​​of the first pointer and the second pointer through polling, which helps to reduce the resource consumption of the second processor core in knowing whether there is an access request to be processed.

[0032] In one embodiment, the first pointer and the second pointer are both used to point to a ring buffer.

[0033] In this embodiment, by designing a ring buffer with a fixed memory area size, and making the first pointer and the second pointer point to the ring buffer, data overflow that may be caused when the count values ​​of the first pointer and the second pointer are updated is avoided. Specifically, the size of the memory area defined by the ring buffer will not increase as data is written, which limits the upper limit of storage and prevents overflow caused by unlimited growth. In addition, when the first pointer or the second pointer reaches the end of the buffer, it will not stop or overflow, but will loop back to the beginning of the buffer to continue writing, forming a circular motion. In this way, even if the ring buffer is full, it will not affect the update of the count value of the first pointer or the second pointer.

[0034] In a second aspect, an embodiment of the present specification provides an interaction method, the interaction method is applied to a processor architecture, the processor architecture includes a first processor, an input-output processor, and at least one peripheral controller; the input-output processor serves as an intermediate medium when the first processor interacts with the at least one peripheral controller; the first processor includes a first processor core, and the input-output processor includes a second processor core; the interaction method includes:

[0035] The access request for the target peripheral device is transmitted to the second processor core through the first processor core, and the access request for the target peripheral device is used to instruct the second processor core to respond to the access request, access the peripheral controller corresponding to the target peripheral device according to the access request, so that the peripheral controller returns the execution result corresponding to the access request, and returns the execution result corresponding to the access request to the first processor core;

[0036] and / or

[0037] In response to a notification message transmitted by the second processor core, the data to be uploaded is obtained; the notification message is sent by the second processor core in response to a data transmission request initiated by the peripheral controller, the data to be uploaded by the peripheral controller is obtained, and the notification message is reported; the data transmission request is triggered by the peripheral controller when it is necessary to upload data to the first processor core.

[0038] In one embodiment, the input-output processor further includes a memory connected to the second processor core, a first register, and a second register, the memory is provided with a shared storage space accessible to both the first processor core and the second processor core, the shared storage space is used to implement communication between the first processor core and the second processor core, the first register is used to store a first pointer, the second register is used to store a second pointer, and the transmitting of an access request for a target peripheral to the second processor core through the first processor core includes:

[0039] The first processor core encapsulates an access request for a target peripheral device into a message in a preset format, writes the message into a shared storage space of the memory, and updates a first count value of the first pointer in the first register. When the count values ​​of the first pointer and the second pointer are different, it indicates that there is an access request to be processed in the shared storage space.

[0040] In a third aspect, an embodiment of the present specification further provides a processor architecture, including an input-output processor, a first processor, and at least one peripheral controller; the input-output processor serves as an intermediate medium when the first processor interacts with the at least one peripheral controller; the first processor includes a first processor core, and the input-output processor includes a second processor core; wherein,

[0041] The first processor core is configured to: transmit an access request for a target peripheral device to the second processor core, and / or, in response to a notification message transmitted by the second processor core, obtain data to be uploaded;

[0042] The second processor core is configured to: in response to the access request, access the peripheral controller corresponding to the target peripheral according to the access request, so that the peripheral controller returns the execution result corresponding to the access request, and returns the execution result corresponding to the access request to the first processor core, and / or, in response to a data transmission request initiated by the peripheral controller, obtain the data to be uploaded by the peripheral controller, and send a notification message to the first processor core; the data transmission request is triggered by the peripheral controller when it is necessary to upload data to the first processor core.

[0043] In a fourth aspect, an embodiment of the present specification further provides a computing device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the interaction method as described above when executing the computer program.

[0044] In a fifth aspect, an embodiment of the present specification further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the interaction method as described above is implemented.

[0045] In a sixth aspect, an embodiment of the present specification provides a computer program product or a computer program, wherein the computer program product includes a computer program, and the computer program is stored in a computer-readable storage medium; the processor of the computer device reads the computer program from the computer-readable storage medium, and the processor implements the steps of the above-mentioned interaction method when executing the computer program.

[0046] It can be seen from the above technical scheme that the interaction method provided in the embodiment of this specification is implemented based on a processor architecture including an input-output processor and a first processor, wherein the first processor includes a first processor core, the first processor core can be used to run user applications, and can be called a main core, and the second processor core in the input-output processor is used to respond to an access request for a target peripheral sent by the first processor core, access the peripheral controller corresponding to the target peripheral according to the access request, so that the peripheral controller returns the execution result corresponding to the access request, and returns the execution result corresponding to the access request to the first processor core, and / or, the second processor core can respond to a data transmission request initiated by the peripheral controller, obtain the data to be uploaded of the peripheral controller, and send a notification message to the first processor core to notify the first processor core to obtain the data to be uploaded. In this way, through the interaction method, the access request for the target peripheral device and / or the data transmission request initiated by the peripheral controller is handed over to the second processor core for execution, so that the specific access operation for the target peripheral device and / or the handling operation of the data to be uploaded can be executed by the second processor core, thereby reducing the disturbance of the specific access operation for the target peripheral device and / or the handling operation of the data to be uploaded to the first processor core, which is beneficial to reducing the resources consumed by the first processor core in the process of interaction with the peripheral device, thereby avoiding the problem of a large amount of resources consumed in the process of interaction between the first processor core and the peripheral device, which may cause the main core performance to decline and the delay to increase.

[0047] In addition, the second processor core may be a processor core for processing peripheral accesses, so a processor core with a relatively simple architecture may be used as the second processor core, which helps reduce hardware requirements and operating power consumption for the second processor core. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] In order to more clearly illustrate the embodiments of this specification or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of this specification. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0049] Figure 1 A schematic diagram of a processor architecture provided for an implementation of this specification;

[0050] Figure 2 A schematic diagram of another processor architecture provided for an embodiment of this specification;

[0051] Figure 3 A flowchart of an interactive method provided for an implementation of this specification;

[0052] Figure 4 A flowchart of another interactive method provided for an embodiment of this specification;

[0053] Figure 5 is the number of operations required by the first processor core AP when executing various commands to access peripherals in the related art;

[0054] Figure 6 The number of operations required by the first processor core AP when executing various commands to access peripherals in the interactive method provided in the embodiment of this specification;

[0055] Figure 7 A schematic diagram of the structure of a computing device provided for an embodiment of this specification. DETAILED DESCRIPTION

[0056] Unless otherwise defined, the technical terms or scientific terms used in the embodiments of this specification shall have the common meanings understood by persons with ordinary skills in the field to which this specification belongs. The words "first", "second" and similar words used in the embodiments of this specification do not indicate any order, quantity or importance, but are only used to avoid confusion of constituent elements.

[0057] Unless the context requires otherwise, throughout the specification, "plurality" means "at least two", and "including" is interpreted as an open, inclusive meaning, that is, "including, but not limited to". In the description of the specification, the terms "one embodiment", "some embodiments", "exemplary embodiments", "examples", "specific examples" or "some examples" are intended to indicate that a particular feature, structure, material or characteristic associated with the embodiment or example is included in at least one embodiment or example of the specification. The schematic representation of the above terms does not necessarily refer to the same embodiment or example.

[0058] The technical solutions in the embodiments of this specification will be described below in conjunction with the drawings in the embodiments of this specification. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this specification.

[0059] Overview

[0060] As processor performance improves and functions continue to increase, the complexity of processor architecture is also increasing. In related technologies, a multi-core processor architecture refers to a processor architecture that includes two or more processor cores. In a multi-core processor, these processor cores can independently execute different instructions to meet the needs of processing different tasks at the same time, significantly improving the computer's parallel processing capabilities and efficiency; these processor cores can also collaboratively execute the same instruction, based on the performance of multiple processor cores to collaboratively complete complex calculations and other tasks with high performance requirements. Multi-core processor architecture can effectively solve the limitations of single-core processors in improving performance.

[0061] In order to give full play to the advantages of each processor core in the multi-core processor architecture, the embodiments of this specification provide an innovative processor architecture. Figure 1 , the processor architecture includes:

[0062] The first processor 100 and the input output processor (IOP) 110 , in some implementations, the processor architecture may further include at least one peripheral controller 120 .

[0063] The first processor 100 is communicatively connected to the input / output processor 110 via an on-chip network 130 , and the input / output processor 110 is respectively connected to at least one peripheral controller 120 .

[0064] The on-chip network 130 is a communication network between various components within the entire processor architecture, and is used to provide communication links between various components within the processor architecture. Various types of buses, bus interfaces, etc. can be integrated in the on-chip network 130 to meet the communication requirements between the input and output processor 110 and various processor architecture components such as the first processor 100, the second processor, and the first memory 150 based on any type of bus.

[0065] Specifically, the input / output processor 110 includes at least one dedicated second processor core 111 , and the second processor core 111 can serve as an intermediate medium when the first processor 100 interacts with at least one peripheral controller 120 .

[0066] The above-mentioned first processor 100 is an application processor (AP) in the processor architecture, which may include a first processor core 101. The first processor core 101 can be used as an application processor core in the processor architecture. The application processor core is the operation and control center of the entire processor architecture and is used to execute instructions and operations.

[0067] At the same time, the application processor core can also be used to start and control other processor cores in the processor architecture, such as the second processor core 111 in the input-output processor 110. For example, before the second processor core 111 in the input-output processor 110 is started, the processor core of the first processor 100 copies the firmware program stored in the memory to the SRAM of the input-output processor 110, so that the second processor core 111 in the input-output processor 110 can load the firmware program from the SRAM to start running.

[0068] At least one peripheral controller 120 in the above-mentioned processor architecture may include any external device connected to the processor architecture or a controller corresponding to an external device interface, such as a UART (Universal Asynchronous Receiver / Transmitter) controller, an I2C (Inter-Integrated Circuit, serial communication bus) controller, an SPI (Serial Peripheral Interface, serial peripheral interface) controller, an SD (Secure Digital, SD card) controller, a GMAC controller (Gigabit Media Access Controller, Gigabit Media Access Controller), and the like. The peripheral controller may be used to control the peripheral according to the instructions or data sent by the input and output processor. In practical applications, the processor architecture may integrate different peripheral controllers according to actual functional requirements. These peripheral controllers may support the same protocol or different protocols. The specific selection and implementation of the peripheral controller may refer to the actual requirements of the processor architecture and the implementation of related technologies, and this specification does not specifically limit this. Each peripheral controller may directly interact with the input and output processor for data. In some embodiments, the above-mentioned peripheral controller 120 may include a controller for a low-speed peripheral. In this embodiment, the low-speed peripheral controller 120 is connected to the first processor 100 through the input-output processor 110. The low-speed peripheral controller is connected to the input-output processor 110, and the input-output processor 110 performs communication interaction with the low-speed peripherals, without the need for the first processor core to specifically execute access requests for the low-speed peripherals, which is conducive to releasing at least part of the resources of the first processor core.

[0069] As for the high-speed peripheral controller in the processor architecture, it can be directly connected to the first processor 100, so that the first processor 100 can execute access requests for high-speed peripherals, and high-speed peripherals usually interact with the first processor 100 for relatively more important services, so that the first processor 100 and the high-speed peripherals are directly connected and can ensure the smooth execution of high-speed services. However, in some embodiments, the high-speed peripheral controller can also be connected to the second processor core 111, and the first processor core 101 can hand over some access requests for the high-speed peripheral controller to the second processor core 111 for execution, so as to further reduce the computing pressure of the first processor core 101 when the peripherals are accessed. Optionally, the first processor core 101 can delegate low-speed access requests to the high-speed peripheral controller to the second processor core 111 for execution. The low-speed access requests to the high-speed peripheral controller have relatively low requirements for data transmission rate, etc., and the performance of the second processor core 111 can meet the access requirements. Therefore, the low-speed access requests to the high-speed peripheral controller are delegated to the second processor core 111 for execution. While meeting the access requirements, the computing pressure on the first processor core 101 is reduced, which is beneficial to releasing the performance of the first processor core 101.

[0070] The input-output processor 110 can be integrated into the processor architecture to share the pressure of the first processor and serve as an intermediate medium for data exchange between the first processor and the peripheral controller, so that the first processor can access each peripheral controller through the input-output processor, thereby realizing control of the peripherals connected to the peripheral controller. The input-output processor 110 includes at least one second processor core 111 for executing data communication operations between the first processor 100 and the peripheral controller 120.

[0071] In one embodiment of the present specification, the above-mentioned second processor core 111 may specifically include a RISC-V (Reduced Instruction Set Computer-Five, a fifth-generation reduced instruction set computer) core, that is, a processor core of the RISC-V instruction architecture, which can complete instruction access to modules with low real-time requirements such as low-speed peripherals.

[0072] Based on the above-mentioned input / output processor 110 and the second processor core 111 therein, the input / output processor 110 serves as a communication medium between the first processor 100 and each peripheral controller 120. The first processor 100 only needs to be connected to the input / output processor 110, and the input / output processor 110 is connected to each peripheral controller 120 respectively. In this way, there is no need for the first processor 100 to establish a communication link with each peripheral controller 120 separately.

[0073] At the same time, the second processor core 111 in the input-output processor 110 serves as an intermediate medium when the first processor 100 interacts with each peripheral controller 120. When the first processor 100 needs to access any target peripheral controller among the peripheral controllers, it only needs to send an access request for the target peripheral controller to the input-output processor 110. The second processor core 111 in the input-output processor 110 executes access to the target peripheral controller according to the access request sent by the first processor 100, and feeds back the access result to the first processor 100. In the above process, the first processor 100 only needs to send an access request for the target peripheral controller to the input-output processor 110. At this time, the first processor 100 can execute other operations without performing subsequent interactive operations with the target peripheral controller. Instead, the input-output processor 110 executes the actual access to the peripheral controller and feeds back the access result to the first processor 100. It can be seen that the above process greatly reduces the resource consumption when the first processor 100 interacts with the peripheral controller.

[0074] Furthermore, since the first processor 100 can delegate at least part of the interactive operations with the peripheral controller to the second processor core 111 for execution, the number of drivers for the peripheral controller installed in the first processor 100 can be reduced, and the operations of upgrading or updating the peripheral controller drivers can also be reduced, thereby further reducing the burden on the first processor 100 and reducing resource consumption.

[0075] In some optional embodiments, reference Figure 2 The processor architecture may further include a security processor 140 connected to the first processor 100 and connected to other parts of the processor architecture via an on-chip network 130 .

[0076] The security level of the security processor 140 may be higher than the security level of the first processor 100. Based on the high security level of the security processor 140, programs with high security level requirements may be run on the security processor 140, and a security measurement service module may be mounted in the security processor 140 to perform security measurement on other modules.

[0077] The security processor 140 can be used to perform security control on the processor architecture, for example, to actively perform security measurements on each module of the processor architecture or to perform security measurements on the corresponding modules in response to security measurement requests from each module, and to control at least some modules to operate when safety is confirmed through security measurements.

[0078] Still reference Figure 2Optionally, the input / output processor 110 may further include a second memory 112, a register array 113, a timer 114, a watchdog 115, a direct memory access 116, and a trusted domain controller 118. The second memory 112 may be used to store the target firmware corresponding to the second processor core, so that the second processor core can start and run based on the target firmware stored in the second memory 112 during operation. In addition, the second memory 112 may also provide a shared storage space, and both the first processor core 101 and the second processor core 111 have access rights to the shared storage space. The shared storage space may be used as an inter-core channel during the communication between the first processor core 101 and the second processor core 111, so as to meet the communication requirements between the first processor core 101 and the second processor core 111.

[0079] The register array 113 may be composed of a plurality of registers corresponding to different functions, such as a register for triggering an interrupt signal, a register for recording the data read and write status, a register for recording the number of data written, a register for recording the number of data read, a register for configuring the aforementioned inter-core channel capacity, and a register for recording the number of inter-core channels, etc. Of course, registers corresponding to other functions may also be set based on actual application requirements, which are not exhaustively listed in this specification. In addition, the register array 113 may also cooperate with the second memory 112 to construct an inter-core channel for realizing data exchange between the first processor core 101 and the second processor core 111. In one possible implementation, a shared storage space of a certain capacity in the second memory 112 and two registers of the register array can be used to cooperate in realizing data interaction between the first processor core 101 and the second processor core 111, wherein one of the registers is used to trigger an interrupt to the first processor core 101, so that the first processor core 101 responds to the interrupt to access the information stored in the second processor core 111 in the shared storage space, thereby realizing information transfer from the second processor core 111 to the first processor core 101, and the other register is used to trigger an interrupt to the second processor core 111, so that the second processor core 111 responds to the interrupt to access the information stored in the first processor core 101 in the shared storage space, thereby realizing information transfer from the first processor core 101 to the second processor core 111.

[0080] The role of the network interconnect 117 is similar to that of the on-chip network 130, and is also used as a data interaction path to realize data interaction between any two or more functional modules mounted on the network interconnect 117. For example, the data sent from the first processor core 101 to the second processor core 111 is sent to the shared memory space, the instructions of the second processor core 111 are transmitted to the second memory 112, and the instructions issued by the second processor core 111 are transmitted to the watchdog 115, the timer 114 and the peripheral controller 120, etc.

[0081] The role of the trusted domain controller 118 may include filtering requests issued by the first processor core 101. For example, in some embodiments, the trusted domain controller 118 may also filter requests issued by the first processor 100 according to the security attributes of the peripheral controller 120 after the second processor core 111 is started, so that the first processor core 101 can access the secure peripheral controller 120 by issuing a secure request; when the first processor core 101 requests to access the secure peripheral controller 120 by issuing an unsecure request, the request will be filtered by the trusted domain controller 118.

[0082] The watchdog 115 may include a timer chip, whose functions may include monitoring whether the second processor core 111 is operating normally. If the second processor core 111 is operating abnormally, it may exceed a predetermined time without returning a heartbeat signal to the watchdog 111, and the watchdog 115 may time out. When the watchdog 115 times out, the watchdog 115 will reset the second processor core 111 to restore it to normal and restart operation.

[0083] The timer (Timer) 114 can be used for timing inside the input / output processor 110, and can also be used for reporting interrupts at a fixed time.

[0084] Understandably, Figure 2 As an example of a processor architecture only, in some embodiments, the processor architecture may include Figure 2 Some or all of the modules shown may even include Figure 2 Other modules other than the modules shown in the figure, similarly, the modules in the input and output processor 110 may also be compared Figure 2 The modules shown are more or less. The connection relationship and position between the modules can also be adaptively adjusted, for example, in Figure 2 In the illustrated embodiment, the peripheral controller 120 is disposed outside the input-output processor 110, and establishes a connection relationship with other modules of the input-output processor 110 through the interface of the input-output processor 110 and the network interconnection 117. In other embodiments, the peripheral controller 120 may also be integrated inside the input-output processor 110, that is, the peripheral controller 120 is encapsulated inside the input-output processor 110, so that the privatization of the peripheral controller 120 is realized, and the input-output processor 110 does not need to describe the relevant information of the peripheral controller to a third party during operation, which is conducive to improving the security of the input-output processor 110. This specification does not limit this, and it depends on the actual situation.

[0085] In the related art, multiple processor cores in a multi-core processor usually follow the principle of sharing and collaboration to process multiple identical or different tasks in parallel. There is no clear division between the types of tasks processed by the multiple processor cores. In the scenario of heterogeneous multi-core (i.e., at least one of the type, architecture, and performance of at least two processor cores in the multi-core processor is different), it is impossible to bring into play the inherent advantages of each processor core, and it is also impossible to release the performance of the main core in the application processor, and it is impossible to bring into play the performance advantages of the main core. For example, in the peripheral access task, the main core will take up a lot of computing resources to process access requests of various peripherals, resulting in a decrease in the processing performance of the main core for other tasks. At the same time, the main core processes access requests of low-speed peripherals and access requests of high-speed peripherals, which will cause the access requests of low-speed peripherals to occupy too many computing resources of the main core, affecting the processing performance of the main core for access requests of high-speed peripherals, and may even cause the loss of access data of high-speed peripherals. In order to solve this problem, the inventors proposed Figure 1 and Figure 2 On the basis of the processor architecture shown, the access request of the main core (i.e., the first processor core) to at least part of the peripherals is handed over to the second processor core in the input and output processor for processing, and / or the data transmission request initiated by the peripheral controller is handed over to the second processor core for processing. In this way, through the interaction method, the access request for the target peripheral and / or the data transmission request initiated by the peripheral controller are handed over to the second processor core for execution, so that the specific access operation for the target peripheral and / or the handling operation of the data to be uploaded can be performed by the second processor core, reducing the disturbance of the specific access operation for the target peripheral and / or the handling operation of the data to be uploaded to the first processor core, which is conducive to reducing the resources consumed by the first processor core in the process of interaction with the peripherals, thereby avoiding the problem that a large amount of resources are consumed in the process of interaction between the first processor core and the peripherals, which may cause the main core performance to decline and delay to increase. In addition, the second processor core can be a processor core for processing peripheral access, so that a processor core with a relatively simple architecture can be used as the second processor core, which is conducive to reducing the hardware requirements and operating power consumption of the second processor core.

[0086] Furthermore, on this basis, access requests for different peripherals can be processed differently. For example, access requests for low-speed peripherals can be handed over to the second processor core for execution, while access requests for high-speed peripherals can still be handed over to the first processor core for execution, so as to reduce the resource occupation of the first processor core by peripheral access tasks while ensuring the data transmission rate requirements for access requests for different types of peripherals. In addition, access requests for high-speed peripherals can be further divided into low-speed access requests for high-speed peripherals and high-speed access requests for high-speed peripherals. High-speed access requests for high-speed peripherals with higher data transmission rate requirements are handed over to the first processor core for execution, so as to further reduce the resource occupation of the first processor core by peripheral access tasks on the basis of ensuring the normal processing of high-speed access requests for high-speed peripherals.

[0087] Based on the above concept, an interaction method is provided in the embodiment of the present specification. The interaction method provided in the embodiment of the present specification will be exemplarily described below in conjunction with the accompanying drawings.

[0088] Exemplary Methods

[0089] To be applied to Figure 1 and Figure 2 Taking the second processor core 111 in the processor architecture of as an example, an embodiment of the present specification provides an interaction method, wherein the processor architecture includes a first processor 100, an input-output processor 110, and at least one peripheral controller 120; the input-output processor 110 serves as an intermediate medium when the first processor 100 interacts with the at least one peripheral controller 120; the first processor 100 includes a first processor core 101, and the input-output processor 110 includes a second processor core 111; Figure 3 As shown, the interaction method includes:

[0090] S301: In response to an access request for a target peripheral sent by the first processor core 101, the second processor core 111 accesses a peripheral controller 120 corresponding to the target peripheral according to the access request, so that the peripheral controller 120 returns an execution result corresponding to the access request, and returns the execution result corresponding to the access request to the first processor core 101;

[0091] and / or

[0092] The second processor core 111 responds to the data transmission request initiated by the peripheral controller 120, obtains the data to be uploaded by the peripheral controller 120, and sends a notification message to the first processor core 101, wherein the notification message is used to notify the first processor core 101 to obtain the data to be uploaded; the data transmission request is triggered by the peripheral controller 120 when it is necessary to upload data to the first processor core 101.

[0093] When it is necessary to access the target peripheral device, the first processor core 101 sends an access request for the target peripheral device to the input-output processor 110. In some embodiments, the input-output processor 110 can perform a legitimacy check on the access request for the target peripheral device, and filter the access request for the target peripheral device through the trusted domain controller. For example, a consistency check can be performed based on the security attributes of the access request, the security attributes of the target shared space allocated to the target peripheral device, and the security attributes of the register group corresponding to the target shared space. Only when the consistency check passes, the trusted domain controller will write the access request for the target peripheral device into the shared storage space of the second memory 112 in the input-output processor 110, so that the second processor core 111 responds to the access request for the target peripheral device, accesses the peripheral controller 120 corresponding to the target peripheral device according to the access request, and enables the peripheral controller 120 to return the execution result corresponding to the access request. After receiving the execution result corresponding to the access request returned by the peripheral controller 120, the second processor core 111 returns it to the first processor core 101.

[0094] When there is data to be uploaded in the peripheral device that needs to be uploaded to the first processor core 101, the peripheral controller can trigger a data transmission request and send the data transmission request to the second processor core 111. The second processor core 111 responds to the data transmission request, obtains the data to be uploaded from the peripheral controller, and realizes the transportation of the data to be uploaded. In some embodiments, after the second processor core 111 obtains the data to be uploaded, it stores the data to be uploaded in a shared storage space set in the input and output processor. Both the first processor core and the second processor core can access the shared storage space. The shared storage space is used to realize the communication between the first processor core and the second processor core. In this way, after receiving the notification message sent by the second processor core 111, the first processor core can read the data to be uploaded from the shared storage space. In the whole process, the first processor core does not need to carry the data to be uploaded, which is conducive to reducing the burden on the first processor core.

[0095] In this way, through the interaction method, the access request for the target peripheral device and / or the data transmission request initiated by the peripheral controller is handed over to the second processor core for execution, so that the specific access operation for the target peripheral device and / or the handling operation of the data to be uploaded can be executed by the second processor core, reducing the disturbance of the specific access operation for the target peripheral device and / or the handling operation of the data to be uploaded to the first processor core, which is conducive to reducing the resources consumed by the first processor core in the process of interaction with the peripheral device, thereby avoiding the problem that the main core performance is reduced and the delay is increased due to the large amount of resources consumed in the process of interaction between the first processor core and the peripheral device. In addition, the second processor core 111 can be a processor core for processing peripheral access, so that a processor core with a relatively simple architecture can be used as the second processor core 111, which is conducive to reducing the hardware requirements and operating power consumption of the second processor core 111.

[0096] In order to ensure the data transmission rate requirement of the high-speed peripheral device during the access process, in one embodiment, the access request for the target peripheral device includes: an access request for a first type of peripheral device, and / or a low-speed access request for a second type of peripheral device, the first type of peripheral device includes a low-speed peripheral device, and the low-speed peripheral device is used to indicate that the rate of the low-speed peripheral device when communicating with the second processor core 111 is less than a preset threshold;

[0097] The second category of peripherals includes high-speed peripheral devices, and the high-speed peripheral devices are used to characterize that when the high-speed peripheral device responds to a low-speed access request, the rate at which the high-speed peripheral device communicates with the second processor core 111 is less than the preset threshold, and when the high-speed peripheral device responds to a high-speed access request, the rate at which the high-speed peripheral device communicates with the second processor core 111 is greater than or equal to the preset threshold.

[0098] In this embodiment, at least one of the access request for the first category peripheral and the low-speed access request for the second category peripheral is used as the access request for the target peripheral and is handed over to the second processor core 111 for specific execution. This is because the access request for the first category peripheral and the low-speed access request for the second category peripheral have lower requirements for the data transmission rate during the interaction process. Therefore, at least one of the access request for the first category peripheral and the low-speed access request for the second category peripheral is handed over to the second processor core 111 for execution as the access request for the target peripheral. Even if an input / output processor is added as an intermediate medium between the first processor core and the target peripheral, the data transmission rate requirement of the access request for the target peripheral can still be met. By handing over the access request for the first category peripheral and the low-speed access request for the second category peripheral to the second processor core for execution, the resource occupation of the access request for the target peripheral on the first processor core 101 can be reduced, which is beneficial to releasing the performance of the first processor core 101. Optionally, the high-speed access request for the high-speed peripheral device in the second category of peripherals can still be executed by the first processor core 101 to ensure the high-speed access request for the high-speed peripheral device for the data transmission rate requirement. The preset threshold can be determined based on actual conditions (such as the software and hardware level of the peripheral access technology, etc.), and this specification does not limit this.

[0099] In an optional embodiment, the first type of peripherals includes: at least one of a universal asynchronous receiver / transmitter (UART) device, an integrated circuit bus (I2C) device, and a serial peripheral interface (SPI) device;

[0100] The second category of peripherals includes: at least one of a Universal Serial Bus (USB) device, a high-speed serial computer expansion bus standard PCIe (Peripheral Component Interconnect Express) device, an Ethernet controller, a graphics processing unit, a cache controller, and a dynamic random access memory controller.

[0101] It is understandable that the data transmission rate requirement for high-speed access requests for the second type of peripherals is usually high, therefore, the high-speed access requests for the second type of peripherals can be handed over to the first processor core 101 for execution, reducing the intermediate media when the first processor core interacts with the second type of peripherals, and ensuring the normal execution of the high-speed access requests for the second type of peripherals. At the same time, the access requests for the second type of peripherals may also include low-speed access requests for the second type of peripherals, such as access requests for status check requests for the second type of peripherals, which may not have high requirements for data transmission rate, therefore, the low-speed access requests for the second type of peripherals can be handed over to the second processor core 111 for execution, further reducing the resource occupation of the first processor core 101 by the access requests for the peripherals.

[0102] In one embodiment of the present specification, a feasible method for communication between a first processor core 101 and a second processor core 111 is provided. Specifically, the input-output processor 110 further includes a memory connected to the second processor core 111 (for example, the second memory 112 mentioned above), and the memory connected to the second processor core 111 is provided with a shared storage space accessible to both the first processor core 101 and the second processor core 111, and the shared storage space is used to implement communication between the first processor core 101 and the second processor core 111; the second processor core 111 responds to an access request for a target peripheral sent by the first processor core 101, and accesses a peripheral controller 120 corresponding to the target peripheral according to the access request, so that the peripheral controller 120 returns an execution result corresponding to the access request, including:

[0103] In response to the first processor core 101, the second processor core 111 stores the access request for the target peripheral in the shared storage space of the memory connected to the second processor core 111, reads the access request for the target peripheral from the shared storage space, and accesses the peripheral controller 120 corresponding to the target peripheral according to the access request, so that the peripheral controller 120 returns the execution result corresponding to the access request.

[0104] In this embodiment, a method for ensuring normal communication between the first processor core 101 and the second processor core 111 is provided. Specifically, a second memory 112 is set in the input and output processor 110, and a shared storage space is set in the second memory 112. The first processor core 101 can store the access request for the target peripheral in the shared storage space, so that the second memory 112 core reads the access request for the target peripheral from the shared storage space and accesses the corresponding peripheral controller 120, and realizes the communication with the first processor core 101 and the execution of the access request for the target peripheral. After the second processor core 111 obtains the execution result returned by the peripheral controller 120, the execution result can also be written into the shared storage space, so that the first processor core 101 reads the execution result from the shared storage space, and realizes the information transmission from the second processor core 111 to the first processor core 101. In this embodiment, the communication between the first processor core 101 and the second processor core 111 is realized through the shared storage space, and there is no need to require the first processor core 101 and the second processor core 111 to have direct communication capabilities, which is conducive to expanding the applicability of the interaction method.

[0105] In an optional embodiment, a method for a first processor core 101 and a second processor core 111 to communicate based on a shared memory space is provided. Specifically, the input-output processor 110 further includes a first register and a second register, the first register is used to store a first pointer, and the second register is used to store a second pointer. When the count values ​​of the first pointer and the second pointer are different, it indicates that there is an access request to be processed in the shared memory space; the first count value of the first pointer is updated when the second processor core 111 writes the access request into the shared memory space;

[0106] The storing, by the second processor core 111 in response to the first processor core 101, the access request for the target peripheral device in the shared storage space of the memory connected to the second processor core 111 comprises:

[0107] polling the first pointer and the second pointer by the second processor core 111, and when the first count value is different from the second count value of the second pointer, querying and reading the access request in the shared storage space;

[0108] After accessing the peripheral controller 120 corresponding to the target peripheral according to the access request, the method further includes:

[0109] A second count value of the second pointer is updated so that the second count value is the same as the first count value.

[0110] In this embodiment, whether the count values ​​of the first pointer and the second pointer are the same is used to indicate whether there is an access request from the target peripheral device that needs to be processed in the shared storage space. The second processor core 111 polls to determine whether the access request for the target peripheral device is written into the shared storage space. The second processor does not need to handle interrupts, thus avoiding the context switching overhead required to handle interrupts.

[0111] In another embodiment, the input-output processor 110 further includes a first register, a second register and an interrupt trigger module, the first register is used to store a first pointer, the second register is used to store a second pointer, when the count values ​​of the first pointer and the second pointer are different, it indicates that the access request exists in the shared memory space; the first count value of the first pointer is updated when the second processor core 111 writes the access request into the shared memory space, and the interrupt trigger module includes at least one of a controller and a third register;

[0112] The storing, by the second processor core 111 in response to the first processor core 101, the access request for the target peripheral device in the shared storage space of the memory connected to the second processor core 111 comprises:

[0113] In response to the interrupt information, querying and reading the access request in the shared storage space by the second processor core 111;

[0114] The interrupt information includes an interrupt generated when the controller detects that a first count value of the first pointer is different from a second count value of the second pointer;

[0115] or

[0116] The interrupt information includes an interrupt generated when the third register is triggered, and the third register is triggered when the second processor core 111 writes the access request into the shared memory space.

[0117] In this embodiment, the interrupt trigger module triggers an interrupt message to inform the second processor core 111 that a new access request needs to be processed. The second processor core 111 does not need to continuously access the count values ​​of the first pointer and the second pointer through polling, which helps to reduce the resource consumption of the second processor core 111 in knowing whether there is an access request to be processed.

[0118] The triggering methods of the interrupt message include: controller triggering or third register triggering. The controller can be a controller set in the input-output processor 110 for detecting the interrupt message. The third register can be a register in the register array 113 in the input-output register set for sending the interrupt message. The first register, the second register and the third register can be used as a register group, which corresponds to the target peripheral.

[0119] In an optional implementation manner, in order to avoid data overflow in the count value of the register pointer, the first pointer and the second pointer are both used to point to a ring buffer.

[0120] In this embodiment, by designing a ring buffer with a fixed memory area size, and making the first pointer and the second pointer point to the ring buffer, data overflow that may be caused when the count values ​​of the first pointer and the second pointer are updated is avoided. Specifically, the size of the memory area defined by the ring buffer will not increase as data is written, which limits the upper limit of storage and prevents overflow caused by unlimited growth. In addition, when the first pointer or the second pointer reaches the end of the buffer, it will not stop or overflow, but will loop back to the beginning of the buffer to continue writing, forming a circular motion. In this way, even if the ring buffer is full, it will not affect the update of the count value of the first pointer or the second pointer.

[0121] To be applied to Figure 2 Taking the first processor core 101 shown in the figure as an example, the embodiment of this specification also provides an interaction method, such as Figure 4 As shown, including:

[0122] S401: The access request for the target peripheral device is passed to the second processor core 111 through the first processor core 101, and the access request for the target peripheral device is used to instruct the second processor core 111 to respond to the access request, access the peripheral controller 120 corresponding to the target peripheral device according to the access request, so that the peripheral controller 120 returns the execution result corresponding to the access request, and returns the execution result corresponding to the access request to the first processor core 101.

[0123] Optionally, in one embodiment, the input-output processor 110 further includes a memory, a first register, and a second register connected to the second processor core 111, the memory is provided with a shared storage space accessible to both the first processor core 101 and the second processor core 111, the shared storage space is used to implement communication between the first processor core 101 and the second processor core 111, the first register is used to store a first pointer, and the second register is used to store a second pointer, and the transmitting of an access request for a target peripheral to the second processor core 111 through the first processor core 101 includes:

[0124] The first processor core 101 encapsulates an access request for a target peripheral device into a message in a preset format, writes the message into a shared storage space of the memory, and updates a first count value of the first pointer in the first register. When the count values ​​of the first pointer and the second pointer are different, it indicates that there is an access request to be processed in the shared storage space.

[0125] For specific limitations on the interaction method applied to the first processor core 101, reference may be made to the relevant limitations above, and this specification will not elaborate on them here.

[0126] In one embodiment, the interaction method provided in the embodiment of this specification is compared with the interaction method in the related art in which all peripheral access requests are executed by the first processor core 101.

[0127] The number of operations of the first processor core 101 (AP) required to execute various commands when accessing the target peripheral device is used as a comparison parameter. The number of operations of the first processor core 101 required to execute various commands in the related art is referred to as Figure 5 When executing various commands based on the interactive method provided in the embodiment of this specification, the operation times of the first processor core 101 refer to Figure 6 By comparison, it can be found that in the interaction method provided in the implementation mode of this specification, the first processor core 101 can execute and send various commands to the input and output processor 110, and the remaining operations can be performed by the input and output processor 110, thereby greatly reducing the number of operations that the first processor core 101 needs to perform when accessing peripherals.

[0128] Figure 5 and Figure 6 The commands in are the commands that need to be executed when accessing peripherals. Specifically, the probe command refers to an initialization process in which the system detects and registers the audio device or driver.

[0129] The playback_volume command is a command to control the playback volume level.

[0130] The capture_volume command is used to control the recording (capture) volume level.

[0131] The mute command is used to mute or unmute audio playback or recording.

[0132] The dai_fmt command is used to set the digital audio interface format, which is used to specify the data bit alignment, clock polarity, etc.

[0133] The bias_prepare command is used to prepare the bias circuitry of an audio device so that it is ready for audio processing.

[0134] The bias_standby command puts the audio device into standby mode, where the bias voltage is set to a moderate level to reduce power consumption but still allow fast wakeup.

[0135] The bias_off command is used to turn off the bias voltage of the audio device.

[0136] The hw_params command is used to set the hardware parameters of the audio device, such as sampling rate, bit depth, number of channels, etc.

[0137] The adc_enable command is used to enable the analog-to-digital converter (ADC), which is typically used to capture (record) audio signals.

[0138] The dac_enable command is used to enable the digital-to-analog converter (DAC) for playing audio signals.

[0139] The inmux_sel command is a command for selecting an input multiplexer, and is used to select different audio input sources.

[0140] The inmux_enable command is used to enable the input multiplexer, allowing the signal of the selected audio input source to pass through.

[0141] In addition, in another embodiment, taking the peripheral access operation of the SPI device reading 256 bytes of data as an example, the comparison of the time occupied by the first processor core 101 by executing the above operation in the related technology (non-IOP mode) and the interactive method provided in the embodiment of this specification (IOP mode) can be referred to the following Table 1:

[0142] Table 1 Comparison of the time taken by the first processor core 101 to execute peripheral access operations in IOP mode and non-IOP mode

[0143]

[0144]

[0145] By comparing Table 1, it can be found that when executing the same peripheral access operation, the interaction method provided in the implementation mode of this specification can save more than 10190% of the time of the first processor core compared with the related art.

[0146] In another embodiment of the present specification, the power consumption of the interaction method (IOP mode) provided in the embodiment of the present specification and the interaction method (AP mode) in the related art are compared.

[0147] Specifically, the average power consumption of the first processor core 101 in the 2000MHz video playback scenario is: 76.1mW (milliwatts), and the average power consumption of the input and output processor 110 in the 300MHz video playback scenario is: 9.1mW (about 12% of 76.1mW). It can be found from the following Table 2 that the converted comprehensive power consumption of the SPI device data reading operation implemented in the IOP mode is only about 21% (1.994 / 9.439) of the AP mode power consumption, that is, the interaction method provided in the implementation mode of this specification can greatly save power consumption compared with the interaction method in the related art.

[0148] Table 2: Power consumption comparison between IOP mode and AP mode

[0149]

[0150]

[0151] Exemplary Devices

[0152] In an exemplary embodiment of the present specification, an interaction device is further provided. The interaction device is applied to a processor architecture, wherein the processor architecture includes a first processor 100, an input-output processor 110, and at least one peripheral controller 120; the input-output processor 110 serves as an intermediate medium when the first processor 100 interacts with the at least one peripheral controller 120; the first processor 100 includes a first processor core 101, and the input-output processor 110 includes a second processor core 111; the interaction device includes:

[0153] a peripheral access module, configured to respond to an access request for a target peripheral sent by the first processor core 101 through the second processor core 111, access the peripheral controller 120 corresponding to the target peripheral according to the access request, so that the peripheral controller 120 returns an execution result corresponding to the access request, and returns the execution result corresponding to the access request to the first processor core 101;

[0154] and / or

[0155] The second processor core 111 responds to the data transmission request initiated by the peripheral controller 120, obtains the data to be uploaded by the peripheral controller 120, and sends a notification message to the first processor core 101, wherein the notification message is used to notify the first processor core 101 to obtain the data to be uploaded; the data transmission request is triggered by the peripheral controller 120 when it is necessary to upload data to the first processor core 101.

[0156] In an exemplary embodiment of the present specification, an interaction device is further provided. The interaction device is applied to a processor architecture, wherein the processor architecture includes a first processor 100, an input-output processor 110, and at least one peripheral controller 120; the input-output processor 110 serves as an intermediate medium when the first processor 100 interacts with the at least one peripheral controller 120; the first processor 100 includes a first processor core 101, and the input-output processor 110 includes a second processor core 111; the interaction device includes:

[0157] a request transfer module, used to transfer an access request for a target peripheral device to the second processor core 111 through the first processor core 101, wherein the access request for the target peripheral device is used to instruct the second processor core 111 to respond to the access request, access the peripheral controller 120 corresponding to the target peripheral device according to the access request, so that the peripheral controller 120 returns an execution result corresponding to the access request, and returns the execution result corresponding to the access request to the first processor core 101;

[0158] and / or

[0159] In response to a notification message transmitted by the second processor core, the data to be uploaded is obtained; the notification message is sent by the second processor core in response to a data transmission request initiated by the peripheral controller, the data to be uploaded by the peripheral controller is obtained, and the notification message is reported; the data transmission request is triggered by the peripheral controller when it is necessary to upload data to the first processor core.

[0160] For the specific definition of the interactive device, please refer to the definition of the interactive method above, which will not be repeated here. Each module in the above interactive device can be implemented in whole or in part by software, hardware and a combination thereof. The above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0161] Exemplary processor architecture and computing device

[0162] Another embodiment of the present specification further proposes a processor architecture, including an input-output processor 110, a first processor 100 and at least one peripheral controller 120; the input-output processor 110 serves as an intermediate medium when the first processor 100 interacts with the at least one peripheral controller 120; the first processor 100 includes a first processor core 101, and the input-output processor 110 includes a second processor core 111; wherein,

[0163] The first processor core 101 is configured to: transmit an access request for a target peripheral device to the second processor core 111, and / or, in response to a notification message transmitted by the second processor core 111, obtain data to be uploaded;

[0164] The second processor core 111 is configured to: respond to the access request, access the peripheral controller 120 corresponding to the target peripheral according to the access request, so that the peripheral controller 120 returns the execution result corresponding to the access request, and returns the execution result corresponding to the access request to the first processor core 101, and / or, respond to a data transmission request initiated by the peripheral controller, obtain the data to be uploaded by the peripheral controller, and send a notification message to the first processor core; the data transmission request is triggered by the peripheral controller when it is necessary to upload data to the first processor core.

[0165] For the relevant limitations of each module of the processor architecture, please refer to the relevant description above, and this specification will not go into details here.

[0166] Another embodiment of this specification also provides a computing device, see Figure 7 As shown, an exemplary embodiment of the present specification also provides a computing device, including: a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the interaction method according to various embodiments of the present specification described in the above embodiments of the present specification are executed.

[0167] The internal structure of the computing device can be as follows Figure 7 As shown, the computing device includes a processor, a memory, a network interface and an input device connected through a system bus. Among them, the processor of the computing device is used to provide computing and control capabilities. The memory of the computing device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computing device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, the steps of the interaction method according to various embodiments of the present specification described in the above embodiments of the present specification are performed.

[0168] The processor may include a main processor and may also include a baseband chip, a modem, etc.

[0169] The memory stores a program for executing the technical solution of the present invention, and may also store an operating system and other key services. Specifically, the program may include a program code, and the program code includes computer operation instructions. More specifically, the memory may include a read-only memory (ROM), other types of static storage devices that can store static information and instructions, a random access memory (RAM), other types of dynamic storage devices that can store information and instructions, a disk storage, a flash, and the like.

[0170] The processor may be a general-purpose processor, such as a general-purpose central processing unit (CPU), a microprocessor, etc., or an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of the program of the scheme of the present invention. It may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component.

[0171] The input device may include a device for receiving data and information input by a user, such as a keyboard, a mouse, a camera, a scanner, a light pen, a voice input device, a touch screen, a pedometer, or a gravity sensor.

[0172] Output devices may include means that allow information to be output to a user, such as display screens, printers, speakers, etc.

[0173] The communication interface may include using any transceiver or the like to communicate with other devices or communication networks, such as Ethernet, Radio Access Network (RAN), Wireless Local Area Network (WLAN), etc.

[0174] The processor executes the program stored in the memory and calls other devices, which can be used to implement each step of any interaction method provided in the above embodiments of this specification.

[0175] The computing device may also include a display component and a voice component. The display component may be a liquid crystal display or an electronic ink display. The input device of the computing device may be a touch layer covered on the display component, or a button, trackball or touchpad provided on the housing of the computing device, or an external keyboard, touchpad or mouse.

[0176] Those skilled in the art will understand that Figure 7The structure shown in the figure is only a block diagram of a part of the structure related to the scheme of this specification, and does not constitute a limitation on the computing device to which the scheme of this specification is applied. The specific computing device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.

[0177] Exemplary computer program products and storage media

[0178] In addition to the above-mentioned methods and devices, the interaction method provided in the embodiments of this specification may also be a computer program product, which includes computer program instructions, which, when executed by a processor, enable the processor to execute the steps of the interaction method according to various embodiments of this specification described in the above "Exemplary Method" section of this specification.

[0179] The computer program product may be implemented in hardware, software or a combination thereof. In one optional embodiment, the computer program product is implemented as a computer storage medium. In another optional embodiment, the computer program product is implemented as a software product, such as a software development kit (SDK).

[0180] The computer program product may be written in any combination of one or more programming languages ​​to write program code for performing the operations of the embodiments of the present specification, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.

[0181] In addition, an embodiment of the present specification also provides a computer-readable storage medium on which a computer program is stored, and the computer program is executed by a processor to execute the steps of the interactive method according to various embodiments of the present specification described in the above "Exemplary Method" section of the present specification.

[0182] 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 this specification 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).

[0183] 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.

[0184] The above-mentioned embodiments only express several implementation methods of this specification, and the descriptions are relatively specific and detailed, but they cannot be understood as limiting the scope of the solutions provided by the embodiments of this specification. It should be pointed out that for ordinary technicians in this field, several modifications and improvements can be made without departing from the concept of this specification, which all belong to the protection scope of this specification. Therefore, the protection scope of the patent of this specification shall be based on the attached claims.

Claims

1. An interactive method, characterized in that: The interaction method is applied to a processor architecture, the processor architecture comprising a first processor, an input-output processor and at least one peripheral controller; the input-output processor serves as an intermediate medium when the first processor interacts with the at least one peripheral controller; The first processor includes a first processor core, and the input-output processor includes a second processor core; The interaction method comprises: In response to an access request for a target peripheral device sent by the first processor core, the second processor core accesses a peripheral controller corresponding to the target peripheral device according to the access request, so that the peripheral controller returns an execution result corresponding to the access request, and returns the execution result corresponding to the access request to the first processor core; and / or The second processor core responds to the data transmission request initiated by the peripheral controller, obtains the data to be uploaded by the peripheral controller, and sends a notification message to the first processor core, wherein the notification message is used to notify the first processor core to obtain the data to be uploaded; the data transmission request is triggered by the peripheral controller when it is necessary to upload data to the first processor core.

2. The method according to claim 1, characterized in that The access request for the target peripheral device includes: an access request for a first type of peripheral device, and / or a low-speed access request for a second type of peripheral device, the first type of peripheral device includes a low-speed peripheral device, and the low-speed peripheral device is used to indicate that the rate of the low-speed peripheral device when communicating with the second processor core is less than a preset threshold; The second category of peripherals includes high-speed peripheral devices, and the high-speed peripheral devices are used to characterize that when the high-speed peripheral device responds to a low-speed access request, the rate at which the high-speed peripheral device communicates with the second processor core is less than the preset threshold, and when the high-speed peripheral device responds to a high-speed access request, the rate at which the high-speed peripheral device communicates with the second processor core is greater than or equal to the preset threshold.

3. The method according to claim 2, characterized in that The first type of peripherals includes: at least one of a universal asynchronous receiver / transmitter (UART) device, an integrated circuit bus (I2C) device, and a serial peripheral interface (SPI) device; The second category of peripherals includes: at least one of a universal serial bus (USB) device, a high-speed serial computer expansion bus standard (PCIe) device, an Ethernet controller, a graphics processing unit, a cache controller, and a dynamic random access memory controller.

4. The method according to claim 1, characterized in that: The input-output processor further includes a memory connected to the second processor core, wherein the memory connected to the second processor core is provided with a shared storage space accessible to both the first processor core and the second processor core, and the shared storage space is used to implement communication between the first processor core and the second processor core; The step of responding, by the second processor core, to an access request for a target peripheral sent by the first processor core, and accessing a peripheral controller corresponding to the target peripheral according to the access request so that the peripheral controller returns an execution result corresponding to the access request includes: The second processor core stores an access request for the target peripheral in a shared storage space of the memory connected to the second processor core in response to the first processor core, reads the access request for the target peripheral from the shared storage space, and accesses a peripheral controller corresponding to the target peripheral according to the access request, so that the peripheral controller returns an execution result corresponding to the access request.

5. The method according to claim 4, characterized in that The input-output processor further includes a first register and a second register, the first register is used to store a first pointer, the second register is used to store a second pointer, when the count values ​​of the first pointer and the second pointer are different, it indicates that there is an access request to be processed in the shared memory space; the first count value of the first pointer is updated when the second processor core writes the access request into the shared memory space; The storing, by the second processor core in response to the first processor core, the access request for the target peripheral device in the shared storage space of the memory connected to the second processor core comprises: polling the first pointer and the second pointer by the second processor core, and when the first count value is different from the second count value of the second pointer, querying and reading the access request in the shared storage space; After accessing the peripheral controller corresponding to the target peripheral according to the access request, the method further includes: A second count value of the second pointer is updated so that the second count value is the same as the first count value.

6. The method according to claim 4, characterized in that The input-output processor further includes a first register, a second register and an interrupt triggering module, wherein the first register is used to store a first pointer, and the second register is used to store a second pointer, and when the count values ​​of the first pointer and the second pointer are different, it indicates that the access request exists in the shared storage space; the first count value of the first pointer is updated when the second processor core writes the access request into the shared storage space, and the interrupt triggering module includes at least one of a controller and a third register; The storing, by the second processor core in response to the first processor core, the access request for the target peripheral device in the shared storage space of the memory connected to the second processor core comprises: In response to the interrupt information, querying and reading the access request in the shared memory space by the second processor core; The interrupt information includes an interrupt generated when the controller detects that a first count value of the first pointer is different from a second count value of the second pointer; or The interrupt information includes an interrupt generated when the third register is triggered, and the third register is triggered when the second processor core writes the access request into the shared memory space.

7. The method according to claim 5 or 6, characterized in that: The first pointer and the second pointer are both used to point to a ring buffer.

8. An interactive method, characterized in that: The interaction method is applied to a processor architecture, the processor architecture comprising a first processor, an input-output processor and at least one peripheral controller; the input-output processor serves as an intermediate medium when the first processor interacts with the at least one peripheral controller; The first processor includes a first processor core, and the input-output processor includes a second processor core; The interaction method comprises: The access request for the target peripheral device is transmitted to the second processor core through the first processor core, and the access request for the target peripheral device is used to instruct the second processor core to respond to the access request, access the peripheral controller corresponding to the target peripheral device according to the access request, so that the peripheral controller returns the execution result corresponding to the access request, and returns the execution result corresponding to the access request to the first processor core; and / or In response to a notification message transmitted by the second processor core, the data to be uploaded is obtained; the notification message is sent by the second processor core in response to a data transmission request initiated by the peripheral controller, the data to be uploaded by the peripheral controller is obtained, and the notification message is reported; the data transmission request is triggered by the peripheral controller when it is necessary to upload data to the first processor core.

9. The method according to claim 8, characterized in that The input-output processor further includes a memory connected to the second processor core, a first register, and a second register, wherein the memory is provided with a shared storage space accessible to both the first processor core and the second processor core, the shared storage space is used to implement communication between the first processor core and the second processor core, the first register is used to store a first pointer, and the second register is used to store a second pointer, and the transmitting of an access request for a target peripheral to the second processor core through the first processor core includes: The first processor core encapsulates an access request for a target peripheral device into a message in a preset format, writes the message into a shared storage space of the memory, and updates a first count value of the first pointer in the first register. When the count values ​​of the first pointer and the second pointer are different, it indicates that there is an access request to be processed in the shared storage space.

10. A processor architecture, characterized in that: The device comprises an input-output processor, a first processor and at least one peripheral controller; the input-output processor serves as an intermediate medium when the first processor interacts with the at least one peripheral controller; the first processor comprises a first processor core, and the input-output processor comprises a second processor core; wherein, The first processor core is configured to: transmit an access request for a target peripheral device to the second processor core, and / or, in response to a notification message transmitted by the second processor core, obtain data to be uploaded; The second processor core is configured to: in response to the access request, access the peripheral controller corresponding to the target peripheral according to the access request, so that the peripheral controller returns the execution result corresponding to the access request, and returns the execution result corresponding to the access request to the first processor core, and / or, in response to a data transmission request initiated by the peripheral controller, obtain the data to be uploaded by the peripheral controller, and send a notification message to the first processor core; the data transmission request is triggered by the peripheral controller when it is necessary to upload data to the first processor core.

11. A computing device, characterized in that: The invention comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the interactive method according to any one of claims 1 to 9 when executing the computer program.

12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the interactive method according to any one of claims 1 to 9 is implemented.