Method, device and storage medium for embedded processor to carry out rapid data communication

文档序号:1577238 发布日期:2020-01-31 浏览:19次 中文

阅读说明:本技术 内嵌处理器进行快速数据通信的方法、装置及存储介质 (Method, device and storage medium for embedded processor to carry out rapid data communication ) 是由 贾复山 张继存 于 2019-10-23 设计创作,主要内容包括:本发明提供一种内嵌处理器进行快速数据通信的方法、装置及存储介质,所述方法包括:将内存储器分割为地址连续,且顺序编址的多个片上存储单元;配置连接于内存储器的内存接口控制器,内存接口控制器包括多个内存接口控制单元;配置分别连接于内存接口控制器的片上处理器和DMA控制器,DMA控制器包括与内存接口控制单元一一对应设置的多个请求分配单元;配置连接于DMA控制器的专用功能模块,专用功能模块包括多个数据采集单元和多个数据接收单元;当片上处理器以及DMA控制器发生读写请求时,通过内存接口控制单元匹配对应的片上存储单元以读写内存储器中数据,并将读出的数据返回给原请求模块。本发明可以提供并发的数据处理能力,提高了数据处理带宽。(The invention provides a method, a device and a storage medium for embedded processors to carry out rapid data communication, wherein the method comprises the steps of dividing an internal storage into a plurality of on-chip storage units with continuous addresses and addressing in sequence, configuring an internal storage interface controller connected with the internal storage, wherein the internal storage interface controller comprises a plurality of internal storage interface control units, configuring an on-chip processor and a DMA controller which are respectively connected with the internal storage interface controller, wherein the DMA controller comprises a plurality of request distribution units arranged corresponding to the internal storage interface control units , configuring a special function module connected with the DMA controller, wherein the special function module comprises a plurality of data acquisition units and a plurality of data receiving units, and when the on-chip processor and the DMA controller generate read-write requests, the corresponding on-chip storage units are matched through the internal storage interface control units to read and write data in the internal storage and return the read data to an original request module.)

A method for rapid data communication by an embedded processor, of the type , the method comprising:

the internal memory is divided into a plurality of on-chip memory units with continuous addresses and addressed sequentially, and the read-write operation between different on-chip memory units is independent and can be carried out simultaneously;

configuring a memory interface controller connected to a memory, wherein the memory interface controller comprises a plurality of memory interface control units, each memory interface control unit corresponds to at least on-chip storage units, each on-chip storage unit only corresponds to memory interface control units;

configuring an on-chip processor and a DMA controller which are respectively connected with a memory interface controller, wherein the DMA controller comprises a plurality of request distribution units which are arranged corresponding to the memory interface control unit , the address corresponding to the request information processed by each request distribution unit is matched with the address field of the on-chip processor, and the address corresponding to the request information processed by each request distribution unit is matched with the address of an on-chip storage unit corresponding to the memory interface control unit;

the special function module is configured and connected with the DMA controller, the special function module comprises a plurality of data acquisition units and a plurality of data receiving units, the on-chip processor is used for configuring the address range of the memory corresponding to the special function unit, and each special function module is respectively connected with each request distribution unit;

when the on-chip processor generates a read-write request to the internal memory, the internal memory interface control unit is matched with the corresponding on-chip storage unit to read and write data in the internal memory and return the read data to the original request module, and/or when the special function module generates a read-write request to the internal memory through the DMA controller, the DMA controller is butted with the internal memory interface controller according to the requested address and the internal memory interface control unit is matched with the corresponding on-chip storage unit to read and write data in the internal memory and return the read data to the original request module.

2. The method for fast data communication by embedded processor as claimed in claim 1, wherein when the dedicated function module makes read and write request to the memory through the DMA controller, the method further comprises: and analyzing the request information to obtain the address carried by the request information, and matching according to the analyzed address to obtain a request distribution unit matched with the request information.

3. The method for performing fast data communication by using an embedded processor as claimed in claim 2, wherein when the dedicated function module generates a read/write request to the memory through the DMA controller, the method specifically comprises parsing the request information to obtain an address carried by the request information, querying every request allocation units according to the parsed address, and determining whether the address carried by the parsed request belongs to an address range scheduled by the current request allocation unit, if so, the current request allocation unit responds to the parsed request, and specifically responds to the request information on the corresponding on-chip storage unit through a memory interface control unit connected with the current request allocation unit.

4. The embedded processor of claim 1, wherein the method further comprises pre-configuring priority levels and/or processing weights of the request information, and sequentially processing each request information according to the priority levels and/or the processing weights of the request information when a plurality of request information is received by any interface control unit and/or any request distribution unit at the same time, wherein each request information is sequentially processed from high to low in priority level, and/or each request information is circularly scheduled according to the processing weights.

5. The method for fast data communication by an embedded processor as claimed in claim 1, wherein after confirming that the on-chip memory has completed the instruction carried by the request message through the DMA controller, the method further comprises: updating the state flag information of the local register and generating an interrupt signal, and sending the interrupt signal to the on-chip processor.

6. The method of claim 5, wherein the instructions carried by the completed request message include completing data operations for at least descriptors.

7. The method for fast data communication by an embedded processor as claimed in claim 5, further comprising: and setting a time-out mechanism, and triggering and updating the state mark information of the local register and generating an interrupt signal by using the time-out mechanism when the DMA controller confirms that the data processing is not completed enough within the preset time.

8. The method of claim 1, further comprising configuring an ECC logic unit at the entry of each on-chip memory unit;

if the width of write data contained in the write operation executed by the ECC logic unit is equal to the storage width of the on-chip storage unit, directly calculating an ECC check code according to an ECC algorithm, and writing the ECC check code and the original write data into the corresponding on-chip storage unit;

if the width of the write data contained in the executed write operation is smaller than the storage width of the on-chip storage unit, reading the original data from the corresponding on-chip storage unit, after modifying part of the data needing to be updated, calculating an ECC check code according to the updated whole data, and writing the ECC check code and the modified data back to the on-chip storage unit;

if the read operation is executed, automatically detecting whether the read data has errors according to an error detection algorithm, and recording the error state into a corresponding register.

An apparatus for fast data communication with an embedded processor of the type , the apparatus comprising:

the internal memory is divided into a plurality of on-chip memory units with continuous addresses and addressed sequentially, and the read-write operations among different on-chip memory units are independent and can be performed simultaneously;

the memory interface controller is connected with the memory and comprises a plurality of memory interface control units, wherein each memory interface control unit corresponds to at least on-chip storage units, and each on-chip storage unit only corresponds to memory interface control units;

the DMA controller comprises a plurality of request distribution units which are arranged corresponding to the memory interface control unit , the address corresponding to the request information processed by each request distribution unit is matched with the address field of the on-chip processor, and the address corresponding to the request information processed by each request distribution unit is matched with the address of the on-chip storage unit corresponding to the memory interface control unit;

the special function module is connected with the DMA controller and comprises a plurality of data acquisition units and a plurality of data receiving units, the on-chip processor is used for configuring the address range of the memory corresponding to the special function unit, and each special function module is respectively connected with each request distribution unit;

when the on-chip processor generates a read-write request to the internal memory, the internal memory interface control unit is matched with the corresponding on-chip storage unit to read and write data in the internal memory and return the read data to the original request module, and/or when the special function module generates a read-write request to the internal memory through the DMA controller, the DMA controller is butted with the internal memory interface controller according to the requested address and the internal memory interface control unit is matched with the corresponding on-chip storage unit to read and write data in the internal memory and return the read data to the original request module.

A computer-readable storage medium , having a computer program stored thereon, wherein the computer program, when being executed by a processor, implements the steps of a method for fast data communication by an embedded processor as claimed in any of claims 1-8 .

Technical Field

The invention belongs to the technical field of integrated circuit design, and mainly relates to a method, a device and a storage medium for embedded processors to carry out rapid data communication.

Background

In the design of a chip (SoC) with an embedded processor (CPU), except the CPU, other parts are mostly special functional unit logics; the CPU is responsible for functions such as general data processing, configuration of chip operation and the like, but the processing capacity of the CPU for large data volume is insufficient; the special functional unit can realize large data volume and rapid data processing in a hardware mode; therefore, there is inevitably a need for data communication (interaction) between the CPU and the dedicated functional unit, and as the supported functions become more complex, the amount of data to be interacted with also becomes more and more.

In a traditional design scheme, data communication between a special functional unit and a processor is completed through active read-write operation of the processor; specifically, the special function unit writes data to be interacted into an internal data buffer, and the processor collects the data through ordinary read operation and writes the data into a memory of the processor; when the processor needs to send data to the special function unit, the processor directly writes data into a data buffer in the special function unit and then informs the special function unit; in the above implementation scheme, all data processing must be participated in by the processor, which greatly increases the burden of the processor, greatly affects other operations of the processor when the data volume is large, and even cannot meet the requirements of practical application.

Based on the defects of the above schemes, more new technologies emerge, and there are the following two main implementation schemes.

As shown in FIG. 1, in the embodiment, a DMA (Direct Memory Access) processing mode is adopted to realize data interaction, DMA controllers (abbreviation of Direct Memory Access) are added between a processor and a special function unit, the processor is only responsible for configuring the DMA controllers, specific data moving operation is completed by the DMA controllers, and the burden of the processor is greatly reduced during interaction of large data volume.

In the implementation process of the scheme 1, the processor does not need to read and write data from the special function unit any more, only the DMA controller needs to be configured, and the specific data transfer operation is completed by the DMA controller; correspondingly, the processor in the technical realization does not need the read-write operation of a large amount of data, and the burden of the processor can be greatly reduced; however, because the DMA controller and the processor share the system bus during the implementation of scheme 1, the DMA operation inevitably occupies the data transmission bandwidth of the system bus, which results in low processing efficiency of the whole system, especially when there is a large amount of data in the DMA operation, and the effect is more obvious.

As shown in fig. 2, the implementation scheme of scheme 2 is implemented by using a mechanism of shared memory. In this embodiment, because the processor is embedded, there must be some memory space for the processor on the chip; the special function units share the memory space, and can realize the data receiving and transmitting operation of the processor. Specifically, a shared memory space which can be read and written by both the processor and the special function unit is arranged on the chip, when the processor sends data to the special function unit, the data is written into the shared memory space firstly, and a memory state flag bit is added for marking the state of the data in the current memory, so that the judgment is conveniently carried out when the special function unit reads corresponding data; then informing the special function unit to read the data from the designated position through an interrupt or status flag register; conversely, a similar operation is performed when the dedicated functional unit sends data to the processor.

However, in the scheme, each data collecting and sending module in the special function unit needs to be provided with a logic interface connected with the shared memory, and a memory state flag bit needs to be added in the shared memory to indicate the state of the current data information, so that the complexity of the design of the shared memory connection interface is in direct proportion to the number of the interfaces, the design is more complex, steps are carried out, the increased state flag bit in the shared memory occupies the memory space, so that the effective storage space is reduced, particularly, when a plurality of data receiving and sending modules are arranged in the special function unit, and the amount of data to be received and sent is larger, the increased logic is more complex, and the processor needs to determine the state of more data in the current storage space according to the memory state flag bit, so that the additional logic consumption is introduced, and the data efficiency is reduced.

Disclosure of Invention

To solve the above technical problem, the present invention provides a method and apparatus for embedded processors to perform fast data communication.

To achieve of the above objects, embodiments of the present invention provide a method for rapid data communication of embedded processors, the method comprising:

the internal memory is divided into a plurality of on-chip memory units with continuous addresses and addressed sequentially, and the read-write operation between different on-chip memory units is independent and can be carried out simultaneously;

configuring a memory interface controller connected to a memory, wherein the memory interface controller comprises a plurality of memory interface control units, each memory interface control unit corresponds to at least on-chip storage units, each on-chip storage unit only corresponds to memory interface control units;

configuring an on-chip processor and a DMA controller which are respectively connected with a memory interface controller, wherein the DMA controller comprises a plurality of request distribution units which are arranged corresponding to the memory interface control unit , the address corresponding to the request information processed by each request distribution unit is matched with the address field of the on-chip processor, and the address corresponding to the request information processed by each request distribution unit is matched with the address of an on-chip storage unit corresponding to the memory interface control unit;

the special function module is configured and connected with the DMA controller, the special function module comprises a plurality of data acquisition units and a plurality of data receiving units, the on-chip processor is used for configuring the address range of the memory corresponding to the special function unit, and each special function module is respectively connected with each request distribution unit;

when the on-chip processor generates a read-write request to the internal memory, the internal memory interface control unit is matched with the corresponding on-chip storage unit to read and write data in the internal memory and return the read data to the original request module, and/or when the special function module generates a read-write request to the internal memory through the DMA controller, the DMA controller is butted with the internal memory interface controller according to the requested address and the internal memory interface control unit is matched with the corresponding on-chip storage unit to read and write data in the internal memory and return the read data to the original request module.

As a further improvement of the embodiment of the present invention, when the dedicated function module makes a read/write request to the memory through the DMA controller, the method further includes parsing the request information to obtain an address carried by the request information, and performing matching according to the parsed address to obtain a request allocation unit matched with the request information.

As a further improvement of the embodiment of the present invention, when a dedicated function module makes a read-write request to a memory through a DMA controller, the method specifically includes parsing request information to obtain an address carried by the request information, querying every request allocation unit according to the parsed address, determining whether the address carried by the parsed request belongs to an address range scheduled by a current request allocation unit, if so, responding to the parsed request by the current request allocation unit, and specifically responding to the request information on a corresponding on-chip storage unit through a memory interface control unit connected to the current request allocation unit.

As a further improvement of the embodiment of the invention, the method further comprises the steps of pre-configuring the priority level and/or processing weight of the request information, and when any interface control unit and/or any request distribution unit simultaneously receives a plurality of request information, sequentially processing each request information according to the priority level and/or processing weight of the request information, wherein each request information is sequentially processed from high to low in priority level, and/or each request information is circularly scheduled according to the processing weight.

As a further improvement of the embodiment of the present invention, after the DMA controller confirms that the on-chip memory has completed the instruction carried by the request message, the method further includes updating the status flag information of the local register and generating an interrupt signal, and sending the interrupt signal to the on-chip processor.

As a further improvement of the embodiment of the present invention, the instructions carried by the completed request message include completing a data operation of at least descriptors.

As a further improvement of the embodiment of the present invention, the method further includes setting a timeout mechanism that triggers updating of the state flag information of the local registers and generation of an interrupt signal when the DMA controller recognizes that sufficient data processing has not been completed within a predetermined time.

As a further improvement of the embodiment of the invention, the method further includes configuring ECC logic cells at the entrances to each on-chip memory cells;

if the width of write data contained in the write operation executed by the ECC logic unit is equal to the storage width of the on-chip storage unit, directly calculating an ECC check code according to an ECC algorithm, and writing the ECC check code and the original write data into the corresponding on-chip storage unit;

if the width of the write data contained in the executed write operation is smaller than the storage width of the on-chip storage unit, reading the original data from the corresponding on-chip storage unit, after modifying part of the data needing to be updated, calculating an ECC check code according to the updated whole data, and writing the ECC check code and the modified data back to the on-chip storage unit;

if the read operation is executed, automatically detecting whether the read data has errors according to an error detection algorithm, and recording the error state into a corresponding register.

To achieve of the above objects, embodiments of the present invention provide a device for fast data communication with embedded processors, the device comprising:

the internal memory is divided into a plurality of on-chip memory units with continuous addresses and addressed sequentially, and the read-write operations among different on-chip memory units are independent and can be performed simultaneously;

the memory interface controller is connected with the memory and comprises a plurality of memory interface control units, wherein each memory interface control unit corresponds to at least on-chip storage units, and each on-chip storage unit only corresponds to memory interface control units;

the DMA controller comprises a plurality of request distribution units which are arranged corresponding to the memory interface control unit , the address corresponding to the request information processed by each request distribution unit is matched with the address field of the on-chip processor, and the address corresponding to the request information processed by each request distribution unit is matched with the address of the on-chip storage unit corresponding to the memory interface control unit;

the special function module is connected with the DMA controller and comprises a plurality of data acquisition units and a plurality of data receiving units, the on-chip processor is used for configuring the address range of the memory corresponding to the special function unit, and each special function module is respectively connected with each request distribution unit;

when the on-chip processor generates a read-write request to the internal memory, the internal memory interface control unit is matched with the corresponding on-chip storage unit to read and write data in the internal memory and return the read data to the original request module, and/or when the special function module generates a read-write request to the internal memory through the DMA controller, the DMA controller is butted with the internal memory interface controller according to the requested address and the internal memory interface control unit is matched with the corresponding on-chip storage unit to read and write data in the internal memory and return the read data to the original request module.

To achieve of the above objects, the embodiment of the present invention provides computer readable storage media, on which a computer program is stored, which when executed by a processor, implements the steps of the method for fast data communication with an embedded processor as described above.

Compared with the prior art, the invention has the beneficial effects that: the method, the device and the storage medium for the embedded processor to carry out rapid data communication can provide concurrent data processing capacity and improve data processing bandwidth by dividing the memory in the system into a plurality of on-chip storage units; meanwhile, the data receiving and transmitting processing is finished by the DMA controller, and the on-chip processor only participates in a small amount, so that the burden of the on-chip processor is reduced.

Drawings

Fig. 1 and fig. 2 are schematic frame structures of apparatuses for performing fast data communication by using an embedded processor according to different embodiments of the background art of the present invention;

FIG. 3 is a block diagram of a framework of an apparatus for fast data communication with an embedded processor according to an embodiment ;

fig. 4 is a flow chart illustrating a method for fast data communication by an embedded processor according to an embodiment of the present invention.

Detailed Description

The present invention will be described in detail below with reference to specific embodiments shown in the drawings. These embodiments are not intended to limit the present invention, and structural, methodological, or functional changes made by those skilled in the art according to these embodiments are included in the scope of the present invention.

As shown in fig. 3, the apparatus for performing fast data communication by an embedded processor according to an embodiment of the present invention includes an internal memory 10, the internal memory 10 is divided into a plurality of on-chip storage units 11 with consecutive addresses and addressed sequentially, the read/write operations between different on-chip storage units 11 are independent and can be performed simultaneously, an internal memory interface controller 20 connected to the internal memory 10, the internal memory interface controller 20 includes a plurality of internal memory interface control units 21, each internal memory interface control unit 21 corresponds to at least on-chip storage units 11, each on-chip storage unit 11 corresponds to internal memory interface control units 21, an on-chip processor 30 and a DMA controller 40 respectively connected to the internal memory interface controller 20, the DMA controller 40 includes a plurality of request allocation units 41 corresponding to an on-chip storage unit 3870, each request allocation unit 41 processes request information, the corresponding address of the request information matches the address of the on-chip processor 30, and each request allocation unit 41 processes the request information, the request information corresponding to the on-chip processor 30, and the internal memory interface controller 40 is connected to the internal memory interface controller 40, and the internal memory interface controller 20, and the internal memory interface controller 40 reads and returns the read/write request data through the dedicated data acquisition control unit 50, and the internal memory interface controller 20, and the internal memory interface controller 40, the internal memory interface controller 40 is configured to receive the read/write request data, and the read/write data acquisition module 50, and the data acquisition module 50, the internal memory interface controller 40.

Referring to fig. 4, an implementation of the present invention provides a method for embedded processors to perform fast data communication, in which the above-mentioned apparatus is incorporated and the modules and units in the apparatus are described in detail.

In a specific embodiment of the present invention, the method comprises:

s1, dividing the internal memory into a plurality of on-chip memory units with continuous addresses and addressing in sequence, wherein the read-write operation between different on-chip memory units is independent and can be carried out simultaneously;

s2, configuring a memory interface controller connected to a memory, wherein the memory interface controller comprises a plurality of memory interface control units, each memory interface control unit corresponds to at least on-chip storage units, and each on-chip storage unit only corresponds to memory interface control units;

s3, configuring an on-chip processor and a DMA controller respectively connected to the memory interface controller, wherein the DMA controller comprises a plurality of request distribution units corresponding to the memory interface control unit , the address corresponding to the request information processed by each request distribution unit is matched with the address field of the on-chip processor, and the address corresponding to the request information processed by each request distribution unit is matched with the address of the on-chip storage unit corresponding to the memory interface control unit;

s4, configuring a special function module connected to the DMA controller, wherein the special function module comprises a plurality of data acquisition units and a plurality of data receiving units, the on-chip processor is used for configuring the address range of the memory corresponding to the special function unit, and each special function module is respectively connected to each request distribution unit;

and S5, when the on-chip processor generates read-write request to the internal memory, the corresponding on-chip memory unit is matched through the memory interface control unit to read and write the data in the internal memory, and the read data is returned to the original request module, and/or when the special function module generates read-write request to the internal memory through the DMA controller, the DMA controller is butted with the memory interface controller according to the requested address, the corresponding on-chip memory unit is matched through the memory interface control unit to read and write the data in the internal memory, and the read data is returned to the original request module.

It should be noted that, the invention designs the memory interface controller and the special DMA controller between the on-chip processor and the on-chip special function module, to realize the fast and high-efficient data communication between the on-chip special function module and the on-chip processor; the reference numerals S1 to S5 are merely for convenience of description, and in practical applications, the sequence of the reference numerals S1 to S4 may be adjusted simultaneously or sequentially, and the arrangement of the sequence does not affect the output result of the data.

In step S1, the memory is divided into a plurality of on-chip memory units, each of which is connected to -only memory interface control unit, so that the read-write operations between the on-chip memory units are independent and can be performed simultaneously.

For step S2, the memory interface control unit is responsible for receiving requests for reading and writing the memory from the on-chip processor and the DMA controller, reading and writing data in the memory according to the requested address, and returning the read data to the original request module, the data amount of the configured memory interface control unit can be specifically set according to the needs, the set amount is usually less than or equal to the number of the on-chip storage units, that is, each memory interface control unit can operate at least on-chip storage units, for example, when the number of the memory interface control unit is the same as that of the on-chip storage units, configures , and when the number of the on-chip storage units is greater than that of the memory interface control unit, configures , and simultaneously configures the redundant on-chip storage units to the same memory interface control unit or to multiple on-chip storage units.

In step S3, a data acquisition unit in the DMA controller is responsible for collecting data to be sent, and transfers the data to a corresponding memory interface control unit according to an address specified by a processor on chip to send the data, steps later, the memory interface control unit searches for a corresponding on-chip storage unit and writes the data, and simultaneously, the DMA controller writes read data from the on-chip storage unit to the specified data receiving unit according to the configuration of the processor on chip.

As for step S5, for the specific operation flow of data, in practical application, the request information comes from the on-chip processor or the DMA controller, and the memory interface controller firstly allocates the read/write request for the internal memory from the on-chip processor and the DMA controller to the memory interface control unit corresponding to the specified on-chip storage unit; after receiving the read-write requests, if the read requests are read requests, the memory interface control unit needs to return the read data according to a request source (an on-chip processor or a DMA controller); and if the write-once operation is carried out, writing the requested data into the corresponding on-chip storage unit.

It should be noted that, for the memory interface control unit and the request distribution unit, it is possible that the requests received by the memory interface control unit and the request distribution unit may affect each other for multiple services at the same time , and in a preferred embodiment of the present invention, the method further includes setting an appropriate arbitration rule for each type of request information, specifically, in this implementation manner, pre-configuring the priority level and/or the processing weight of the request information, and when any interface control unit and/or any request distribution unit receives multiple request information at the same time, sequentially processing each request information according to the priority level and/or the processing weight of the request information, wherein each request information is sequentially processed from high to low in priority level, and/or each request information is circularly scheduled according to the processing weight.

In a specific embodiment of the invention, in a data interaction process, when a special function module generates a read-write request corresponding to a memory through a DMA controller, the method further comprises the steps of analyzing the request information to obtain an address carried by the request information, and matching according to the analyzed address to obtain a request distribution unit matched with the request information, preferably, in the specific embodiment of , when the special function module generates the read-write request corresponding to the memory through the DMA controller, the method specifically comprises the steps of analyzing the request information to obtain the address carried by the request information, inquiring every request distribution unit according to the analyzed address, judging whether the address carried by the analysis request belongs to an address range scheduled by a current request distribution unit, and if so, responding to the analysis request by the current request distribution unit, and specifically responding to the request information on a corresponding on-chip storage unit through a memory interface control unit connected with the current request distribution unit.

In a preferred embodiment of the present invention, after the DMA controller confirms that the on-chip memory has completed the instruction carried by the request message, the method further includes: updating the state flag information of the local register and generating an interrupt signal, and sending the interrupt signal to the on-chip processor. For example: when the DMA controller confirms that the data is written into the appointed on-chip memory by the memory interface control unit, the state mark information of the local register is updated and an interrupt signal is generated so as to inform the on-chip processor that the current data processing is finished.

In general, each data usually has a corresponding descriptor, and when the descriptor operation is completed, the data processing is considered to be completed, so in the preferred embodiment of the present invention, the instruction carried by the completed request information is set to complete the data operation of at least descriptors, that is, according to the specific needs, the configuration mode of descriptors can ensure that the transmission state of the data is timely notified to the on-chip processor after the data operation of or more descriptors is completed, and the configuration mode of multiple descriptors can ensure that the on-chip processor is not frequently interrupted to ensure the normal processing of other applications, and the two configuration modes can be respectively used in two different situations of small data amount and large data amount.

In a preferred embodiment , to ensure the temporary interruption of data transmission, the method further includes setting a timeout mechanism, and triggering the updating of the status flag information of the local register and the generation of the interrupt signal by the timeout mechanism when the DMA controller confirms that sufficient data processing has not been completed within a predetermined time.

In addition, in the preferred embodiment of the invention, the ECC configuration is carried out on the system to realize the optional function of the ECC, the ECC is the abbreviation of Error Checking and Correction, Chinese translation is the Error code detection and Correction, concretely, the method also comprises the steps of configuring an ECC logic unit at an entrance of each on-chip storage unit, if the width of write data contained in the write operation executed by the ECC logic unit is equal to the storage width of the on-chip storage unit, directly calculating an ECC check code according to the ECC algorithm, writing the ECC check code and original write data into the corresponding on-chip storage unit, if the width of write data contained in the executed write operation is smaller than the storage width of the on-chip storage unit, reading the original data from the corresponding on-chip storage unit, modifying partial data needing to be updated, calculating the ECC check code according to the updated whole data, writing the ECC check code and the modified data into the on-chip storage unit, and if the read operation is executed, automatically detecting whether the read data has errors or not according to the Error detection algorithm, and recording the Error state into a corresponding register.

In the specific application of the invention, when the memory interface controller is configured to support the ECC function, the ECC logic unit can be enabled in the corresponding memory interface controller, and the ECC logic unit is divided into two operations of reading and writing for processing.

However, if the write data width included in the executed write operation is smaller than the storage width of the on-chip storage unit, it means that the current write operation only needs to update part of the data at the specified address in the internal memory, at this time, in order to ensure that the write operation does not affect the original data, a read-modify-write operation needs to be executed, that is, the original data is read from the corresponding on-chip storage unit, after the part of the data that needs to be updated is modified, an ECC check code is calculated according to the entire updated data, and the ECC check code and the modified data are written back to the on-chip storage unit.

Referring to fig. 3, in a specific example of the present invention, an internal memory is continuously divided into 4 on-chip memory units according to addresses, in the example, the 4 on-chip memory units are respectively represented by an on-chip memory unit 1, an on-chip memory unit 2, an on-chip memory unit 3, and an on-chip memory unit 4, and accordingly, an on-chip processor may configure address segments of each on-chip memory unit, in the example, the address segments corresponding to the 4 on-chip memory units are respectively 0x0000 to 0x3FFF, 0x4000 to 0x7FFF, 0x8000 to 0 xfbfff, and 0xC000 to 0 xfffff.

The number of the configured memory interface control units is equal to the number of the on-chip storage units, the two are correspondingly configured and connected, and the 4 memory interface control units are respectively represented by MEM Mux1, MEM Mux2, MEM Mux3 and MEM Mux 4.

The number of the configuration request allocation units is equal to the number of the memory interface control units, and the two units are configured and connected correspondingly, where the 4 request allocation units are represented by DMA Mux1, DMA Mux2, DMA Mux3, and DMA Mux4, respectively, where it needs to be described here that an address corresponding to request information processed by each request allocation unit is determined to match with an address segment configured by an on-chip processor for each on-chip storage unit, and meanwhile, the 4 request allocation units are connected to each unit in the dedicated function module, in this specific example, the dedicated function module is described by taking two data acquisition units and two data receiving units as an example, which are respectively a data acquisition unit 1 and a data acquisition unit 2, and a data receiving unit 1 and a data receiving unit 2.

In the data interaction process, the on-chip processor configures address fields corresponding to data acquisition units and data receiving units, when any data acquisition unit and/or data receiving unit receives request information, the request information is sent to the DMA controller, each request distribution unit DMA Mux in the DMA controller can receive the request information, the address range of which request distribution units the request information is matched with is judged according to the address contained in the request information, if the request information is matched with a specific request distribution unit, the request unit schedules the current request information, if the request information is not matched, the request information does not correspond to the request information, for example, when the address information contained in the current request information is located in the address fields of 0x 0000-0 x3FFF, the request is processed by the DMAMux1, otherwise, the DMA Mux1 does not respond to the request information.

, if there are multiple request messages to be processed in DMA Mux1, the multiple requests are processed according to the arbitration rules, under , the priority of the requests to be processed urgently is higher, and when the multiple requests have the same priority, the requests can be scheduled circularly according to the weights, which is not described in , and the arbitration rules are set to ensure that the actual application requirements can be met and the logic design is simple as the final goal.

, after receiving the data operation request from the DMA controller, the memory interface controller allocates the data operation request to the corresponding memory interface control unit for processing according to the address, and at the same time, the data operation request of the on-chip processor is sent to the corresponding memory interface control unit for processing according to the address, if the data processed by the DMA Mux1 is sent to the on-chip processing unit MEMMUx1, and the address contained in the request information of the on-chip processor is also 0x 0000-0 x3FFF, the request will and sent to the memory interface control unit MEM Mux1 for receiving and processing, at this time, the data from the on-chip processor and the request allocation unit will be selected by the same sampling arbitration rule, and then processed in sequence, the finally selected request will operate the data in the on-chip storage unit 1 in the step, the write operation will directly write the data into the on-chip storage unit 1, and the read operation will read the data corresponding to the address from the on-chip storage unit 1 and return to the on-chip processor or the DMA controller.

The invention can be used for the fast and efficient data interactive processing between the embedded on-chip processor and the on-chip special functional units, and can set the number of system memory partitions, namely the number of the on-chip functional units and the number of the request allocation units in the DMA controller, based on the balance of performance and design complexity; it should be noted that, on the premise of ensuring that the performance meets the requirement, the smaller the number of the above units, the simpler the logic implementation; correspondingly, based on the implementation scheme of the invention, the on-chip processor is only responsible for processing a small amount of control information (such as DMA and interrupt), and the specific data transceiving process is autonomously realized by logic on the chip; meanwhile, the effect of high-efficiency data processing can be achieved due to the flexible division mode of the system memory and the arbitration mode of the data receiving and sending requests.

In summary, the method, the device and the storage medium for the embedded processor to perform fast data communication can provide concurrent data processing capability and improve data processing bandwidth by dividing the memory in the system into a plurality of on-chip storage units, meanwhile, data transceiving processing is completed by the DMA controller, the on-chip processor only participates in a small amount, the burden of the on-chip processor is reduced, the data transceiving processing is selected by two-stage arbitration, the arbitration priority principle can be flexibly set, the requirement of the overall system performance is met by simpler logic, and in addition, the invention also enables upper and lower modules to support the ECC data protection function by setting a flexible and controllable ECC logic unit without modifying logic.

The above-described system embodiments are merely illustrative, wherein the modules described as separate components may or may not be physically separate, and the components shown as modules are logical modules, which may be located in modules in the chip logic, or may be distributed across multiple data processing modules within the chip.

The present application may be used in numerous general purpose or application specific chip designs. For example: switch chips, router chips, server chips, and the like.

It should be understood that although the present description refers to embodiments, not every embodiment contains independent technical solutions, and this description is only for clarity, and those skilled in the art should make the description as a whole, and the technical solutions in the embodiments can be combined appropriately to form other embodiments understood by those skilled in the art.

The -series detailed description set forth above is merely a specific description of possible embodiments of the invention and is not intended to limit the scope of the invention, which is intended to include within its scope equivalent embodiments or modifications that do not depart from the technical spirit of the invention.

15页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种基于OTG口的数据传输方法和装置

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!