FIFO read-write control circuit, chip, electronic device and data transmission method
By setting multiple write and read data interfaces in the FIFO read-write control circuit and selecting the target interface for data operations, the problem of mismatch between data bit width and cache width is solved, hardware cost is reduced and processing speed is improved.
Patent Information
- Application Number
- CN202010725508.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-07-24
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2040-07-24
AI Technical Summary
When the existing FIFO read-write control circuit processes data, due to the mismatch between the data bit width and the cache width, additional data splicing and segmentation circuits are required, resulting in increased hardware costs and wasted processing time.
Design a FIFO read and write control circuit. By setting up multiple write data interfaces and read data interfaces, and selecting the target interface for data read and write operations, it avoids the use of data splicing and segmentation circuits and directly processes data.
Reduces hardware costs, increases data processing speed, and reduces processing time.
Smart Images

Figure CN111783167B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of data cache, and more specifically, to a FIFO read-write control circuit, chip, electronic device and data transmission method. Background Art
[0002] With the development of science and technology, the application of first in first out (FIFO) technology is becoming more and more widespread. At present, the width of the data cache of the FIFO read-write control circuit is fixed. When the data is read and written by the FIFO read-write control circuit, if the data bit width is greater than the width of the data cache of the FIFO read-write control circuit, it is necessary to add a data splicing circuit and a data segmentation circuit to participate in the processing, resulting in an increase in hardware cost and processing time. Summary of the invention
[0003] In view of the above problems, the present application proposes a FIFO read-write control circuit, chip, electronic device and data transmission method to solve the above problems.
[0004] In the first aspect, an embodiment of the present application provides a FIFO read and write control circuit, comprising: a FIFO cache unit, wherein the FIFO cache unit is provided with multiple write data interfaces and multiple read data interfaces; a write data control unit, wherein the write data control unit is connected to the FIFO cache unit, and is used to select at least one write data interface from the multiple write data interfaces as a target write data interface, and perform write data operations through the target write data interface; a read data control unit, wherein the read data control unit is connected to the FIFO cache unit, and is used to select at least one read data interface from the multiple read data interfaces as a target read data interface, and perform read data operations through the target read data interface.
[0005] Optionally, the write data control unit is provided with a first write data volume interface, and the write data control unit receives a first write data volume signal through the first write data volume interface, and selects a write data interface corresponding to the quantity indicated by the first write data volume signal from the multiple write data interfaces as the target write data interface based on the first write data volume signal.
[0006] Optionally, the write data control unit is provided with a second write data volume interface, and the write data control unit receives a second write data volume signal through the second write data volume interface, and selects, according to the second write data volume signal, a write data interface corresponding to the quantity indicated by the second write data volume signal from the multiple write data interfaces in sequence according to the numbering order of the multiple write data interfaces as the target write data interface.
[0007] Optionally, the write data control unit is provided with a write data total amount interface, and the write data control unit obtains the total amount of written data from the FIFO cache unit through the write data total amount interface.
[0008] Optionally, the read data control unit is provided with a first read data amount interface, and the read data control unit receives a first read data amount signal through the first read data amount interface, and selects a read data interface corresponding to the quantity indicated by the first read data amount signal from the multiple read data interfaces as the target read data interface based on the first read data amount signal.
[0009] Optionally, the read data control unit is provided with a second read data volume interface, and the read data control unit receives a second read data volume signal through the second read data volume interface, and selects, according to the second read data volume signal, a read data interface corresponding to the quantity indicated by the second read data volume signal from the multiple read data interfaces in sequence according to the numbering order of the multiple read data interfaces as the target read data interface.
[0010] Optionally, the read data control unit is provided with a read data total amount interface, and the read data control unit obtains the total amount of data that has been read out from the FIFO cache unit through the read data total amount interface.
[0011] In the second aspect, an embodiment of the present application provides a chip, including a security engine and the above-mentioned FIFO read and write control circuit, the security engine includes multiple encryption and decryption circuits, the multiple encryption and decryption circuits are respectively connected to the FIFO read and write control circuit, and the FIFO read and write control circuit is used to provide data input for the multiple encryption and decryption circuits.
[0012] In a third aspect, an embodiment of the present application provides an electronic device, including a device body and the above-mentioned chip, wherein the chip is disposed in the device body.
[0013] In a fourth aspect, an embodiment of the present application provides a data transmission method, which is applied to the above-mentioned chip, and the method includes: obtaining business data to be transmitted; writing the business data to be transmitted into the FIFO cache unit through the target write data interface to obtain original data; determining a target encryption and decryption circuit from the multiple encryption and decryption circuits, and encrypting the original data through the target encryption and decryption circuit to obtain encrypted data; reading the encrypted data from the FIFO cache unit through the target read data interface, and transmitting the encrypted data.
[0014] The FIFO read-write control circuit, chip, electronic device and data transmission method provided by the embodiments of the present application include: a FIFO cache unit, which is provided with multiple write data interfaces and multiple read data interfaces, a write data control unit, which is connected to the FIFO cache unit and is used to select at least one write data interface from the multiple write data interfaces as the target write data interface, and perform write data operations through the target write data interface; a read data control unit, which is connected to the FIFO cache unit and is used to select at least one read data interface from the multiple read data interfaces as the target read data interface, and perform read data operations through the target read data interface. Therefore, by setting multiple write data interfaces and multiple read data interfaces and selecting a certain number of data interfaces for data reading and writing, the hardware cost of the FIFO read-write control circuit for data processing can be reduced, and the data processing speed can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without paying any creative work.
[0016] Figure 1 A schematic diagram of an existing FIFO read-write control circuit is shown;
[0017] Figure 2 A schematic diagram showing the data flow of the existing upstream security engine;
[0018] Figure 3 A schematic diagram showing the data flow of the existing downlink security engine;
[0019] Figure 4 A module block diagram of a FIFO read-write control circuit provided by an embodiment of the present application is shown;
[0020] Figure 5 A schematic diagram of a FIFO read-write control circuit provided by another embodiment of the present application is shown;
[0021] Figure 6 A schematic diagram of a FIFO read-write control circuit provided in yet another embodiment of the present application is shown;
[0022] Figure 7 A schematic diagram of a FIFO read-write control circuit provided by another embodiment of the present application is shown;
[0023] Figure 8 A module block diagram of a FIFO read-write control circuit provided in yet another embodiment of the present application is shown;
[0024] Fig. 9 The module block diagram of the chip provided by the embodiment of the present application is shown;
[0025] Fig.10 A schematic diagram showing a data flow of a security engine of an uplink path provided by an embodiment of the present application;
[0026] Fig.11 A schematic diagram showing a data flow of a security engine of a downlink path provided by an embodiment of the present application;
[0027] Fig.12 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application is shown;
[0028] Fig.13 A flow chart of a data transmission method provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0029] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.
[0030] In mobile communications, in order to ensure the secure transmission of information and prevent leakage, designers will encrypt and decrypt the received and sent data and protect their integrity in the security engine of the packet data convergence protocol (PDCP) layer of the protocol stack. Considering the flexibility of use and the possibility of the encryption and decryption algorithm being cracked, there are usually multiple parallel optional encryption and decryption circuits when the security engine is implemented, for example, encryption and decryption circuits based on the SNOW-3G encryption and decryption algorithm (SNOW-3G stream cipher, SNOW-3G), encryption and decryption circuits based on the Zu Chongzhi algorithm (ZUC stream cipher, ZUC), encryption and decryption circuits based on the advanced encryption standard (AES), etc.
[0031] There are multiple encryption and decryption circuits in the security engine. In order to save valuable hardware resources on the chip, a common FIFO read-write control circuit is usually placed on the top layer of the security engine. The FIFO read-write control circuit selectively provides data input for different encryption and decryption circuits. In the current technical solution, the width of the data cache of the FIFO read-write control circuit is fixed, and the structure is as follows: Figure 1 shown.
[0032] In the upstream path of the security engine, since the width of the data cache of the FIFO read / write control circuit does not match the width of the encryption / protection module, there is a data splicing circuit after the read data cache, and similarly there is a data segmentation circuit before the write data cache, such as Figure 2 shown.
[0033] Similarly, since the difference between the downstream path structure and the upstream path structure of the security engine is only in the integrity calculation, similarly, a data splicing circuit is also required after the read data cache and a data segmentation circuit is required before the write data cache, such as Figure 3 shown.
[0034] After research, the inventor found that the current FIFO read-write control circuit has defects in both time dimension and space dimension. First of all, from a spatial perspective, due to the need for additional data splicing circuits and data segmentation circuits, the design puts forward the demand for more register implementation numbers, which is also equivalent to an increase in implementation costs. Secondly, from a time perspective, since the data splicing circuit requires multiple cycles to complete the acquisition of the amount of data required by the encryption and decryption circuit from the read data cache, rather than a one-time read, it wastes time compared to reading all the required data at one time. Similarly, in the process of writing the data cache, the data segmentation circuit does not match the data bit width of the data cache of the FIFO read-write control circuit, and it also takes multiple cycles to write the data calculated by the encryption and decryption circuit in one cycle into the write data cache. Therefore, the current FIFO read-write control circuit causes an increase in hardware cost and processing time.
[0035] In view of the above problems, the inventor has discovered after long-term research and proposed the FIFO read-write control circuit, chip, electronic device and data transmission method provided in the embodiment of the present application. By setting multiple write data interfaces and multiple read data interfaces and selecting a certain number of data interfaces for data reading and writing, the hardware cost of the FIFO read-write control circuit for data processing can be reduced and the data processing speed can be improved. Among them, the specific structure of the FIFO read-write control circuit proposed in this embodiment is described in detail in the subsequent embodiments.
[0036] See also Figure 4 , Figure 4 FIG. 1 shows a block diagram of a FIFO read / write control circuit according to an embodiment of the present application. Figure 4As shown, an embodiment of the present application provides a FIFO read-write control circuit 10, which includes a FIFO cache unit (FIFO Memory (SRAM)) 100, a write data control unit (Write Control) 200 and a read data control unit (Read Control) 300, wherein the write data control unit 200 is connected to the FIFO cache unit 100 for controlling the data writing of the FIFO cache unit 100, and the read data control unit 300 is connected to the FIFO cache unit 100 for controlling the data reading of the FIFO cache unit 100.
[0037] In some embodiments, the FIFO cache unit 100 and the write data control unit 200 can be connected by wire, for example, by a data line, and the FIFO cache unit 100 and the write data control unit 200 can also be connected by wireless, for example, by a communication module, which is not limited here. In some embodiments, the FIFO cache unit 100 and the read data control unit 300 can be connected by wire, for example, by a data line, and the FIFO cache unit 100 and the read data control unit 300 can also be connected by wireless, for example, by a communication module, which is not limited here.
[0038] See also Figure 5 , Figure 5 FIG. 2 shows a schematic diagram of a FIFO read / write control circuit provided by another embodiment of the present application. Figure 5 As shown, the FIFO buffer unit 100 is provided with a plurality of write data interfaces wdata and a plurality of read data interfaces rdata, wherein the plurality of write data interfaces may include wdata_0, wdata_1, wdata_2, wdata_3, ..., wdata_N ( Figure 5 Taking the multiple write data interfaces including wdata_0, wdata_1, wdata_2, wdata_3 as an example), the multiple read data interfaces may include rdata_0, rdata_1, rdata_2, rdata_3...rdata_N ( Figure 5 Take multiple read data interfaces including rdata_0, rdata_1, rdata_2, and rdata_3 as an example).
[0039] In some embodiments, the number of write data interfaces wdata set in the FIFO cache unit 100 and the number of read data interfaces rdata set can be the same. For example, the FIFO cache unit 100 is provided with 4 write data interfaces wdata, wherein the 4 write data interfaces wdata are respectively: wdata_0, wdata_1, wdata_2, wdata_3, and the FIFO cache unit 100 is provided with 4 read data interfaces rdata, wherein the 4 read data interfaces rdata are respectively: rdata_0, rdata_1, rdata_2, rdata_3. In some embodiments, the number of write data interfaces wdata and the number of read data interfaces rdata set in the FIFO cache unit 100 may be different. For example, the FIFO cache unit 100 is provided with 4 write data interfaces wdata, wherein the 4 write data interfaces wdata are respectively: wdata_0, wdata_1, wdata_2, wdata_3, and the FIFO cache unit 100 is provided with 3 read data interfaces rdata, wherein the 3 read data interfaces rdata are respectively: rdata_0, rdata_1, rdata_2.
[0040] In some embodiments, the write data control unit 200 can select at least one write data interface wdata from multiple write data interfaces wdata as the target write data interface, and perform a write data operation through the target write data interface. As a way, assuming that the multiple write data interfaces wdata include wdata_0, wdata_1, wdata_2, and wdata_3, then the write data control unit 200 can select at least one write data interface wdata from wdata_0, wdata_1, wdata_2, and wdata_3 as the target write data interface, and perform a write data operation through the target write data interface. For example, wdata_0 and wdata_1 are selected as the target write data interfaces, and a write data operation is performed through wdata_0 and wdata_1; for another example, wdata_0, wdata_1, and wdata_2 are selected as the target write data interfaces, and a write data operation is performed through wdata_0, wdata_1, and wdata_2, etc., which is not limited here.
[0041] In some embodiments, the read data control unit 300 can select at least one read data interface rdata from a plurality of read data interfaces rdata as a target read data interface, and perform a read data operation through the target read data interface. As a way, assuming that the plurality of read data interfaces rdata include rdata_0, rdata_1, rdata_2, and rdata_3, then the read data control unit 300 can select at least one read data interface rdata from rdata_0, rdata_1, rdata_2, and rdata_3 as a target read data interface, and perform a read data operation through the target read data interface. For example, rdata_0 and rdata_1 are selected as the target read data interfaces, and a read data operation is performed through rdata_0 and rdata_1; for another example, rdata_0, rdata_1, and rdata_2 are selected as the target read data interfaces, and a read data operation is performed through rdata_0, rdata_1, and rdata_2, etc., which are not limited here.
[0042] In some embodiments, the number of target write data interfaces selected from multiple write data interfaces wdata and the number of target read data interfaces selected from multiple read data interfaces rdata may be the same. For example, the multiple write data interfaces wdata are respectively: wdata_0, wdata_1, wdata_2, wdata_3, and wdata_0 and wdata_1 are selected from wdata_0, wdata_1, wdata_2, wdata_3 as the target write data interfaces, and the multiple read data interfaces rdata are respectively: rdata_0, rdata_1, rdata_2, rdata_3, and rdata_0 and rdata_1 are selected as the target read data interfaces, then the number of target write data interfaces is the same as the number of target read data interfaces. In some embodiments, the number of target write data interfaces selected from multiple write data interfaces wdata and the number of target read data interfaces selected from multiple read data interfaces rdata may be different. For example, the multiple write data interfaces wdata are respectively: wdata_0, wdata_1, wdata_2, wdata_3, and wdata_0, wdata_1 and wdata_2 are selected from wdata_0, wdata_1, wdata_2, wdata_3 as the target write data interfaces, and the multiple read data interfaces rdata are respectively: rdata_0, rdata_1, rdata_2, rdata_3, and rdata_0 and rdata_1 are selected as the target read data interfaces, then the number of target write data interfaces is different from the number of target read data interfaces.
[0043] Therefore, the FIFO read-write control circuit 10 provided in the embodiment of the present application sets multiple write data interfaces wdata and multiple read data interfaces rdata, and selects a target write data interface from the multiple write data interfaces wdata to perform write data operations, and selects a target read data interface from the multiple read data interfaces rdata to perform read data operations. Therefore, for data with different data bit widths, the data can be written into the FIFO cache unit 100 at one time by selecting the target write data interface, and the data can be read out of the FIFO cache unit 100 at one time by selecting the target read data interface. This can reduce the hardware cost of the FIFO read-write control circuit 10 for data processing and improve the data processing speed.
[0044] See also Figure 6 , Figure 6 FIG. 2 shows a schematic diagram of a FIFO read / write control circuit provided by another embodiment of the present application. Figure 6 As shown, the write data control unit 200 is provided with a first write data volume interface wnum1. The write data control unit 200 can receive a first write data volume signal through the first write data volume interface wnum1, and select a write data interface wdata corresponding to the number indicated by the first write data volume signal from a plurality of write data interfaces wdata according to the first write data volume signal as a target write data interface for performing a write data operation. Therefore, in this embodiment, through the first data volume interface wnum1, a channel for interaction between the electronic device including the FIFO read-write control circuit 10 and the user can be provided. Accordingly, the user can input the first write data volume signal to the FIFO read-write control circuit 10 through the electronic device with the first write data volume interface wnum1, and the FIFO read-write control circuit 10 determines the target write data interface from the plurality of write data interfaces wdata in response to the first write data volume signal.
[0045] In some embodiments, the write data control unit 200 can indicate that several groups of write data interfaces wdata are valid during the write data operation (winc=1) by setting the first data volume interface wnum1, wherein the valid write data interface wdata can be regarded as the target write data interface. Wherein, winc can be used as a write valid signal of the FIFO read / write control circuit 10. In the case of winc=1, if wnum1=0, it can be determined that the valid write data interface wdata is 1 group, for example, it can be determined that wdata_1 is valid; if wnum1=1, it can be determined that the valid write data interface wdata is 2 groups, for example, it can be determined that wdata_1 and wdata_2 are valid; if wnum1=2, it can be determined that the valid write data interface wdata is 3 groups, for example, it can be determined that wdata_1, wdata_2 and wdata_3 are valid; if wnum1=3, it can be determined that the valid write data interface wdata is 4 groups, for example, it can be determined that wdata_0, wdata_1, wdata_2 and wdata_3 are valid, etc., which are not limited here.
[0046] Please continue reading Figure 6 ,like Figure 6 As shown, the read data control unit 300 is provided with a first read data volume interface rnum1. The read data control unit 300 can receive a first read data volume signal through the first read data volume interface rnum1, and select a read data interface rdata corresponding to the number indicated by the first read data volume signal from a plurality of read data interfaces rdata according to the first read data volume signal as a target read data interface for performing a read data operation. Therefore, in this embodiment, through the first data volume interface rnum1, a channel for interaction between the electronic device including the FIFO read-write control circuit 10 and the user can be provided. Accordingly, the user can input the first read data volume signal to the FIFO read-write control circuit 10 through the electronic device through the first read data volume interface rnum1, and the FIFO read-write control circuit 10 determines the target read data interface from the plurality of read data interfaces rdata in response to the first read data volume signal.
[0047] In some embodiments, the read data control unit 300 can indicate how many groups of read data interfaces rdata are valid during the read data operation (rinc=1) by setting the first data volume interface rnum1, wherein the valid read data interface rdata can be regarded as the target read data interface. Wherein, rinc can be used as a read valid signal of the FIFO read / write control circuit 10. In the case of rinc=1, if rnum1=0, it can be determined that the valid read data interface rdata is 1 group, for example, it can be determined that rdata_1 is valid; if rnum1=1, it can be determined that the valid read data interface rdata is 2 groups, for example, it can be determined that rdata_1 and rdata_2 are valid; if rnum1=2, it can be determined that the valid read data interface rdata is 3 groups, for example, it can be determined that rdata_1, rdata_2 and rdata_3 are valid; if rnum1=3, it can be determined that the valid read data interface rdata is 4 groups, for example, it can be determined that rdata_0, rdata_1, rdata_2 and rdata_3 are valid, etc., which are not limited here.
[0048] See also Figure 7 , Figure 7 FIG. 2 shows a schematic diagram of a FIFO read / write control circuit provided by another embodiment of the present application. Figure 7 As shown, the write data control unit 200 is provided with a second write data volume interface wnum2. The write data control unit 200 can receive a second write data volume signal through the second write data volume interface wnum2, and select a write data interface wdata corresponding to the number indicated by the second write data volume signal from a plurality of write data interfaces wdata in sequence according to the numbering order of the plurality of write data interfaces wdata, as a target write data interface for performing a write data operation. Therefore, in this embodiment, through the second data volume interface wnum2, a channel for interaction between the electronic device including the FIFO read-write control circuit 10 and the user can be provided. Accordingly, the user can input the second write data volume signal to the FIFO read-write control circuit 10 through the electronic device through the second write data volume interface wnum2, and the FIFO read-write control circuit 10 selects and determines the target write data interface from a plurality of write data interfaces wdata in sequence according to the numbering order of the plurality of write data interfaces wdata in response to the second write data volume signal.
[0049] In some embodiments, the write data control unit 200 can indicate how many groups of write data interfaces wdata are valid during the write data operation (winc=1), and indicate the specific valid write data interface wdata, wherein the valid write data interface wdata can be regarded as the target write data interface. Wherein, winc can be used as a write valid signal of the FIFO read / write control circuit 10. In the case of winc=1, assuming that the target write data interface wdata is selected in the order of numbering from small to large, then, if wnum2=0, wdata_0 is valid; if wnum2=1, wdata_0 and wdata_1 are valid; if wnum2=2, wdata_0, wdata_1 and wdata_2 are valid; if wnum2=3, wdata_0, wdata_1, wdata_2 and wdata_3 are valid, etc., which are not limited here. When winc=1, assuming that the target write data interface is selected in descending order of numbering, then if wnum2=0, wdata_3 is valid; if wnum2=1, wdata_3 and wdata_2 are valid; if wnum2=2, wdata_3, wdata_2 and wdata_1 are valid; if wnum2=3, wdata_3, wdata_2, wdata_1 and wdata_0 are valid, etc., without limitation here.
[0050] Please continue reading Figure 7 ,like Figure 7 As shown, the read data control unit 300 is provided with a second read data volume interface rnum2. The read data control unit 300 can receive a second read data volume signal through the second read data volume interface rnum2, and select a read data interface rdata corresponding to the number indicated by the second read data volume signal from a plurality of read data interfaces rdata in sequence according to the numbering order of the plurality of read data interfaces rdata as a target read data interface for performing a read data operation. Therefore, in this embodiment, through the second data volume interface rnum2, a channel for interaction between the electronic device including the FIFO read-write control circuit 10 and the user can be provided. Accordingly, the user can input the second read data volume signal to the FIFO read-read control circuit 10 through the electronic device through the second read data volume interface rnum2, and the FIFO read-read control circuit 10 selects and determines the target read data interface from the plurality of read data interfaces rdata in sequence according to the numbering order of the plurality of read data interfaces rdata in response to the second read data volume signal.
[0051] In some embodiments, the read data control unit 300 can indicate how many groups of read data interfaces rdata are valid during the read data operation (rinc=1), and indicate the specific valid read data interface rdata, wherein the valid read data interface radata can be regarded as the target read data interface. Rinc can be used as the read valid signal of the FIFO. In the case of rinc=1, assuming that the target read data interface rdata is selected in the order of numbering from small to large, then if rnum2=0, rdata_0 is valid; if rnum2=1, rdata_0 and rdata_1 are valid; if rnum2=2, rdata_0, rdata_1 and rdata_2 are valid; if rnum2=3, rdata_0, rdata_1, rdata_2 and rdata_3 are valid, etc., which are not limited here. When rinc=1, assuming that the target read data interface rdata is selected in descending order of the numbering sequence, then, if rnum2=0, rdata_3 is valid; if rnum2=1, rdata_3 and rdata_2 are valid; if rnum2=2, rdata_3, rdata_2 and rdata_1 are valid; if rnum2=3, rdata_3, rdata_2, rdata_1 and rdata_0 are valid, etc., without limitation here.
[0052] See also Figure 8 , Figure 8 FIG. 2 shows a schematic diagram of a FIFO read / write control circuit provided by yet another embodiment of the present application. Figure 8 As shown, the write data control unit 200 is provided with a write data total amount interface wcnt, and the write data control unit 200 can obtain the total amount of written data from the FIFO cache unit 100 through the write data total amount interface wcnt. Wherein, assuming that the FIFO cache unit 100 includes 8 units of capacity, and the total amount of written data obtained through the write data total amount interface wcnt is 7 units of capacity, it can be determined that the data capacity written to the FIFO cache unit 100 again does not exceed one unit of capacity. Therefore, in this embodiment, through the write data total amount interface wcnt, a monitoring channel for the total amount of data written into the FIFO cache unit 100 can be provided for the electronic device including the FIFO read-write control circuit 10, and accordingly, the user can determine the data capacity written into the FIFO cache unit 100 through the electronic device through the write data total amount interface wcnt.
[0053] In some embodiments, in order to avoid overflow of data written into the FIFO cache unit 100, in addition to the full signal (wfull), the present embodiment also adds a total data write interface wcnt, and the electronic device including the FIFO read / write control circuit 10 can judge the time of writing data and the amount of single data write through the feedback of the total data write interface wcnt. For example, the FIFO cache unit 100 can store 4 units of capacity. If there are already 4 units of data in the FIFO cache unit 100, the full signal is valid; if there are only 3 units of data in the FIFO cache unit 100, the full signal is invalid, but at this time, the total data write interface wcnt can be used to see how much data is in the FIFO cache unit 100. In this case, the total data write interface wcnt=3.
[0054] Please refer to Figure 8 ,like Figure 8 As shown, the read data control unit 300 is provided with a read data total amount interface rcnt, and the read data control unit 200 can obtain the total amount of data that has been read from the FIFO buffer unit 100 through the read data total amount interface rcnt. Wherein, assuming that the FIFO buffer unit 100 includes 8 units of capacity, and the total amount of data that has been read obtained through the read data total amount interface rcnt is 7 units of capacity, it can be determined that the data capacity of the FIFO buffer unit 100 read again does not exceed one unit of capacity. Therefore, in this embodiment, through the read data total amount interface rcnt, a monitoring channel for the total amount of data in the FIFO buffer unit 100 that has been read can be provided for the electronic device including the FIFO read-write control circuit 10, and accordingly, the user can determine the data capacity of the FIFO buffer unit 100 read out through the electronic device through the read data total amount interface rcnt.
[0055] In some implementations, in order to avoid underflow of the data read into the FIFO buffer unit 100, in addition to the read empty signal (rempty), the present implementation also adds a read data total interface rcnt, and the electronic device including the FIFO read-write control circuit 10 can judge the time of reading data and the single read data amount through the feedback of the read data total interface rcnt. For example, if the FIFO buffer unit 100 stores 4 units of data and has read out 4 units of data, the read empty signal is valid; if the FIFO buffer unit 100 stores 4 units of data and has read out 3 units of data, the read empty signal is invalid, but at this time, the read data total interface rcnt can be used to see how much data is in the FIFO buffer unit 100. In this case, the read data total interface rcnt = 3.
[0056] Please refer to Figure 5-Figure 8Among them, the FIFO read and write control circuit 10 also includes: a write clock valid interface wclken, a write address interface waddr, a read address interface raddr, a write enable interface winc, a read enable interface rinc, a write pointer interface wptr, a read pointer interface rptr, a clock interface clock, a reset interface rstn, etc., which are not repeated here.
[0057] Therefore, the FIFO read / write control circuit 10 provided in the embodiment of the present application also effectively monitors and controls the configuration of the effective write data interface by setting the first write data volume interface, the second write data volume interface and / or the total write data volume interface, thereby improving the accuracy and effectiveness of the write data. At the same time, the configuration of the effective read data interface is effectively monitored and controlled by setting the first read data volume interface, the second read data volume interface and / or the total read data volume interface, thereby improving the accuracy and effectiveness of the read data.
[0058] See also Fig. 9 , Fig. 9 FIG. 1 shows a module block diagram of a chip provided in an embodiment of the present application. Fig. 9 As shown, an embodiment of the present application provides a chip 20, wherein the chip 20 includes a security engine 21 and a FIFO read-write control circuit 10, the security engine 21 includes a plurality of encryption and decryption circuits 211, the plurality of encryption and decryption circuits 211 are respectively connected to the FIFO read-write control circuit 10, and the FIFO read-write control circuit 10 is used to provide data input for the plurality of encryption and decryption circuits. In which, from a macroscopic point of view, in the uplink path of PDCP, the FIFO read-write control circuit 10 can obtain data from the electronic device (UE), and input the data into the plurality of encryption and decryption circuits 211 in the security engine 21 for encryption processing and then transmit it to the base station (NodeB), and in the downlink path of PDCP, the FIFO read-write control circuit 10 can obtain data from the base station, and input the data into the plurality of encryption and decryption circuits 211 in the security engine 21 for encryption processing and then transmit it to the electronic device. From a microscopic perspective, in the uplink path of PDCP, the FIFO read-write control circuit 10 can obtain data from the internet protocol (IP) layer, and input it into multiple encryption and decryption circuits 211 in the security engine 21 for encryption processing before transmitting it to the radio link control protocol (RLC) layer. In the downlink path of PDCP, the FIFO read-write control circuit 10 can obtain data from the RLC layer, and input it into multiple encryption and decryption circuits 211 in the security engine 21 for encryption processing before transmitting it to the IP layer.
[0059] See also Fig.10 , Fig.10 FIG. 1 is a schematic diagram showing a security engine data flow of an upstream path provided by an embodiment of the present application. Fig.10As shown, after using the FIFO read-write control circuit 10, the data splicing circuit and the data segmentation circuit of the security engine in the upstream path can be removed, thereby reducing the processing time and reducing the usage area of the FPCP security engine.
[0060] See also Fig.11 , Fig.11 FIG. 1 is a schematic diagram showing a security engine data flow of a downlink path provided by an embodiment of the present application. Fig.11 As shown, after using the FIFO read-write control circuit 10, the data splicing circuit and the data segmentation circuit of the security engine in the downstream path can be removed, thereby reducing the processing time and reducing the usage area of the FPCP security engine.
[0061] In some embodiments, a 32-bit data read and write data cache is used in the chip, and a 32-bit ZUC encryption and decryption algorithm and a 128-bit AES encryption and decryption algorithm are implemented at the same time. At present, in order to obtain 128 bits of data, the AES encryption and decryption algorithm needs to read the data cache 4 times in one calculation, and input the data into the data splicing circuit. The chip 20 provided in this embodiment removes the data splicing circuit at the same time. In contrast, the chip 20 only adds a limited combination control logic, and removes the data splicing circuit composed of 128-bit registers. After using the chip 20, the number of reads of the data cache is reduced, and the number of inversions of its internal registers is reduced, which also reduces the dynamic power consumption of this part of the circuit. Similarly, for the write data cache 10 side, after using the chip 20, 128-bit wide data can be written into the write FIFO cache unit 100 at one time, and the 128-bit data segmentation circuit is removed, which produces optimization effects in terms of time, space and power consumption.
[0062] See also Fig.12 , Fig.12 FIG. 1 is a schematic diagram showing the structure of an electronic device provided in an embodiment of the present application. Fig.12 As shown, an embodiment of the present application provides an electronic device 30 , wherein the electronic device 30 includes a device body 31 and a chip 20 , and the chip 20 is disposed in the device body 30 .
[0063] Please refer to Fig.13 , Fig.13 The schematic diagram of the data transmission method provided by the embodiment of the present application is shown. The method is applied to the above chip 20. Fig.13 The data transmission method may include the following steps:
[0064] Step S110: Acquire the service data to be transmitted.
[0065] In this embodiment, the data to be transmitted may be data that needs to be sent and received through the DPCP security engine.
[0066] Step S120: writing the service data to be transmitted into the FIFO buffer unit through the target write data interface to obtain original data.
[0067] In some embodiments, after receiving the business data to be transmitted, the chip can write the business data to be transmitted into the FIFO cache unit through a target write data interface selected from multiple write data interfaces, and use the business data to be transmitted written into the FIFO cache unit as the original data.
[0068] Step S130: determining a target encryption and decryption circuit from the multiple encryption and decryption circuits, and encrypting the original data by using the target encryption and decryption circuit to obtain encrypted data.
[0069] In some embodiments, the plurality of encryption and decryption circuits may include a SNOW-3G circuit, a ZUC circuit, and an AES circuit. Accordingly, an encryption and decryption circuit may be selected from the SNOW-3G circuit, the ZUC circuit, and the AES circuit as a target encryption and decryption circuit, and the original data may be encrypted by the target encryption and decryption circuit to obtain encrypted data. For example, assuming that the AES circuit is selected as the target encryption and decryption circuit, the original data may be encrypted by the AES circuit to obtain encrypted data.
[0070] Step S140: reading the encrypted data from the FIFO buffer unit through the target read data interface, and transmitting the encrypted data.
[0071] In some implementations, after acquiring the original data, the chip can read the encrypted data from the FIFO cache unit through a target read data interface selected from a plurality of read data interfaces, and transmit the encrypted data through an uplink channel or a downlink channel.
[0072] The data transmission method provided in the embodiment of the present application obtains business data to be transmitted, writes the business data to be transmitted into a FIFO cache unit through a target write data interface, obtains original data, determines a target encryption and decryption circuit from multiple encryption and decryption circuits, encrypts the original data through the target encryption and decryption circuit, obtains encrypted data, reads the encrypted data from the FIFO cache unit through a target read data interface, and transmits the encrypted data, thereby encrypting and decrypting the data to be transmitted through a chip having multiple write data interfaces and multiple read data interfaces, thereby improving the data processing speed.
[0073] To summarize, the FIFO read-write control circuit, chip, electronic device and data transmission method provided in the embodiments of the present application include: a FIFO cache unit, which is provided with multiple write data interfaces and multiple read data interfaces, a write data control unit, which is connected to the FIFO cache unit, and is used to select at least one write data interface from multiple write data interfaces as the target write data interface, and perform write data operations through the target write data interface, and a read data control unit, which is connected to the FIFO cache unit, and is used to select at least one read data interface from multiple read data interfaces as the target read data interface, and perform read data operations through the target read data interface, so that by setting multiple write data interfaces and multiple read data interfaces, and selecting a certain number of data interfaces from them for data reading and writing, the hardware cost of the FIFO read-write control circuit for data processing can be reduced, and the data processing speed can be improved.
[0074] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A FIFO read-write control circuit, characterized in that: include: A FIFO buffer unit, wherein the FIFO buffer unit is provided with a plurality of write data interfaces and a plurality of read data interfaces; a write data control unit, the write data control unit being connected to the FIFO buffer unit and configured to select at least one write data interface from the plurality of write data interfaces as a target write data interface, and to perform a write data operation through the target write data interface; the write data control unit being provided with a first write data volume interface, the write data control unit receiving a first write data volume signal through the first write data volume interface, and selecting, according to the first write data volume signal, a write data interface corresponding to the volume indicated by the first write data volume signal from the plurality of write data interfaces as the target write data interface; A read data control unit, the read data control unit is connected to the FIFO cache unit, and is used to select at least one read data interface from the multiple read data interfaces as a target read data interface, and perform a read data operation through the target read data interface; the read data control unit is provided with a first read data volume interface, the read data control unit receives a first read data volume signal through the first read data volume interface, and selects a read data interface corresponding to the quantity indicated by the first read data volume signal from the multiple read data interfaces as the target read data interface according to the first read data volume signal.
2. The FIFO read-write control circuit according to claim 1, characterized in that: The write data control unit is provided with a second write data amount interface, and the write data control unit receives a second write data amount signal through the second write data amount interface, and selects, according to the second write data amount signal, a write data interface corresponding to the number indicated by the second write data amount signal from the multiple write data interfaces in sequence according to the numbering order of the multiple write data interfaces as the target write data interface.
3. The FIFO read-write control circuit according to claim 1, characterized in that: The write data control unit is provided with a write data total amount interface, and the write data control unit obtains the total amount of written data from the FIFO buffer unit through the write data total amount interface.
4. The FIFO read-write control circuit according to any one of claims 1 to 3, characterized in that: The read data control unit is provided with a second read data amount interface. The read data control unit receives a second read data amount signal through the second read data amount interface, and selects, according to the second read data amount signal, a read data interface corresponding to the number indicated by the second read data amount signal from the multiple read data interfaces in sequence according to the numbering order of the multiple read data interfaces as the target read data interface.
5. The FIFO read-write control circuit according to any one of claims 1 to 3, characterized in that: The read data control unit is provided with a read data total amount interface, and the read data control unit obtains the total amount of data that has been read out from the FIFO buffer unit through the read data total amount interface.
6. A chip, characterized in that: It comprises a security engine and a FIFO read-write control circuit as described in any one of claims 1-5, wherein the security engine comprises a plurality of encryption and decryption circuits, wherein the plurality of encryption and decryption circuits are respectively connected to the FIFO read-write control circuit, and the FIFO read-write control circuit is used to provide data input for the plurality of encryption and decryption circuits.
7. An electronic device, characterized in that: The device comprises a device body and a chip as claimed in claim 6, wherein the chip is arranged in the device body.
8. A data transmission method, characterized in that: Applied to the chip according to claim 6, the method comprises: Obtaining business data to be transmitted; Writing the service data to be transmitted into the FIFO buffer unit through the target write data interface to obtain original data; Determine a target encryption / decryption circuit from the plurality of encryption / decryption circuits, and encrypt the original data by using the target encryption / decryption circuit to obtain encrypted data; The encrypted data is read out from the FIFO buffer unit through the target read data interface, and the encrypted data is transmitted.
