A data verification method, device and related equipment
By providing two data verification modes in SOC, the problem of efficiency and cost of SOC reading external memory data is solved, and efficient and low-cost data verification is achieved.
Patent Information
- Application Number
- CN202410834266.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-26
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2044-06-26
AI Technical Summary
In the prior art, system-only chips (SOCs) have problems with efficiency and cost when reading external memory data. The online ECC verification method reduces access efficiency, while the side-side ECC verification method is relatively costly.
Provide a data verification method. The SOC includes a verification module and a memory. Data verification is performed through two modes: the first mode obtains data and verification code from one memory, and the second mode obtains data and verification from two memory respectively. The code verification uses data verification rules to verify, supports flexible verification methods, and reduces dependence on external memory.
Improves data reading and verification efficiency, reduces costs, and only needs to be connected to one memory, which enhances the flexibility and reliability of data verification.
Smart Images

Figure CN118394564B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a data verification method, device and related equipment. Background Art
[0002] When reading data from an external memory, the system on chip (SOC) must support verification of the data in the external memory.
[0003] How to improve the efficiency of SOC reading data in external memory and the verification efficiency is one of the problems that need to be solved. Summary of the invention
[0004] The present disclosure provides a data verification method, device, electronic device and storage medium to at least solve the above technical problems existing in the prior art.
[0005] In a first aspect, an embodiment of the present disclosure provides a data verification method, the method is applied to a SOC, the SOC includes a verification module and a first memory; the system-level chip is connected to a second memory; the method includes:
[0006] In response to the first instruction, if the verification module adopts the first mode, the verification module obtains the first data from the first memory and obtains the second data from the second memory; if the verification module adopts the second mode, the verification module obtains the first data and the second data from the second memory; the first data is a verification code required to verify the second data;
[0007] Using a data verification rule, the second data is verified based on the first data to obtain a data verification result.
[0008] In a second aspect, an embodiment of the present disclosure provides a data verification device, the device is applied to a SOC, the system-on-chip includes a verification module and a first memory; the system-on-chip is connected to a second memory; the device includes:
[0009] The verification module is configured to respond to the first instruction, if the verification module adopts the first mode, obtain the first data from the first memory, and obtain the second data from the second memory; if the verification module adopts the second mode, obtain the first data and the second data from the second memory; the first data is a verification code required to verify the second data;
[0010] The verification module is further used to apply a data verification rule to perform data verification on the second data based on the first data to obtain a data verification result.
[0011] In a third aspect, an embodiment of the present disclosure provides an electronic device, comprising: at least one processor; and a memory connected to the at least one processor in communication; wherein:
[0012] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute any of the data verification methods described above.
[0013] In a fourth aspect, an embodiment of the present disclosure provides a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable a computer to execute any one of the data verification methods described.
[0014] The data verification method, device, electronic device and storage medium provided by the embodiment of the present disclosure are applied to SOC, the SOC includes a verification module and a first memory; the SOC is connected to a second memory; the method includes: in response to a first instruction, if the verification module adopts a first mode, the verification module obtains the first data from the first memory and obtains the second data from the second memory; if the verification module adopts a second mode, the verification module obtains the first data and the second data from the second memory; the first data is the verification code required to verify the second data; the data verification rule is used to perform data verification on the second data based on the first data to obtain a data verification result. In this way, two verification methods are supported, and data can be obtained from the first memory and the second memory respectively, or only from the second memory, and the verification method is more flexible; if the first mode is adopted, the first memory is used as a memory for storing the verification code, while improving the data reading efficiency and data verification efficiency, only one external memory is required, which also reduces the cost.
[0015] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 A schematic diagram of an online ECC verification method provided by an embodiment of the present disclosure;
[0017] Figure 2 A schematic diagram of a sideband ECC checking method provided by an embodiment of the present disclosure;
[0018] Figure 3 A flowchart of a data verification method provided by an embodiment of the present disclosure;
[0019] Figure 4A schematic diagram of the structure of a verification module provided in an embodiment of the present disclosure;
[0020] Figure 5 A schematic diagram of the structure of another verification module provided in an embodiment of the present disclosure;
[0021] Figure 6 A schematic diagram of the structure of a verification module in a first mode provided by an embodiment of the present disclosure;
[0022] Figure 7 A schematic diagram of the structure of a verification module in the second mode provided by an embodiment of the present disclosure;
[0023] Figure 8 A schematic diagram of the structure of a data verification device provided in an embodiment of the present disclosure;
[0024] Fig. 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0025] In order to make the purpose, features, and advantages of the present disclosure more obvious and easy to understand, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present disclosure.
[0026] Before further describing the embodiments of the present disclosure in detail, the nouns and terms involved in the embodiments of the present disclosure are described. The nouns and terms involved in the embodiments of the present disclosure are subject to the following interpretations.
[0027] Automotive chips have very high requirements for reliability. Automotive chips can use system-on-chip (SOC). The SOC needs to support error detection and correction (ECC) of data stored in external memory (i.e., memory connected to the SOC but not belonging to the SOC). The external memory can use Flash. Flash is a non-volatile memory that can still save data after power failure. Flash usually stores software programs and configuration data that the SOC needs to execute.
[0028] ECC is a coding technology used to detect and correct errors in data transmission. Common ECC methods include: single error corrected and double error detected (SECDED), Hamming Code, BCH Code (Bose-Chaudhuri-Hocquenghem Code), etc. For example, if SECDED is used, 64-bit data corresponds to 8-bit ECC code. When 1 bit of data between 64-bit data and 8-bit ECC code is wrong, the error can be corrected and an error interrupt of corrected error is generated; when 2 bits or more of data are wrong, an error interrupt of unecorrected error is generated.
[0029] SOC can be a packaged semiconductor device, which may include a wafer (Die), or multiple identical or different wafers, or a chip designed and manufactured using chiplet technology.
[0030] In the related art, two verification methods are provided: inline ECC (inline ECC) and sideband ECC (sideband ECC).
[0031] like Figure 1 As shown in the figure, the online ECC check method is: store the data and the corresponding ECC code (ECC code) in different address areas of the same external memory. If the SOC writes data to the external memory, it needs to send two write operations to write the data and the ECC code to the external memory respectively; if the SOC reads data from the external memory, it needs to send two read operations to read the data and the ECC code respectively, and then perform ECC check.
[0032] like Figure 2 As shown in the figure, the sideband ECC check method is: put the data and the corresponding ECC code into two memories respectively, such as the ECC code is stored in memory A and the data is stored in memory B; if the SOC needs to read the external memory, it needs to read the data memory at the same time (such as Figure 2 Memory B) and ECC code memory (such as Figure 2 Memory A in the SOC); if the SOC needs to write to the external memory, it needs to write to the data memory at the same time (such as Figure 2 Memory B) and ECC code memory (such as Figure 2 Memory A in the.
[0033] The above two methods have their own advantages and disadvantages:
[0034] The online ECC verification method only needs to connect to an external memory, which requires fewer pin resources and has cost advantages; but it also has disadvantages: after turning on the online ECC verification mode, the efficiency of accessing the external memory is reduced.
[0035] The sideband ECC checking method requires the SOC to connect to two external memories, which is costly, but it has the advantage of higher memory access efficiency.
[0036] In summary, a more efficient and low-cost data verification method needs to be provided.
[0037] Based on this, an embodiment of the present disclosure provides a data verification method, which is applied to a SOC, wherein the SOC includes a verification module and a first memory; the SOC is connected to a second memory; the method includes: in response to a first instruction, if the verification module adopts a first mode, the verification module obtains first data from the first memory and obtains second data from the second memory; if the verification module adopts a second mode, the verification module obtains the first data and the second data from the second memory; the first data is a verification code required to verify the second data; using a data verification rule, the second data is verified based on the first data to obtain a data verification result.
[0038] Figure 3 A flowchart of a data verification method provided by an embodiment of the present disclosure; Figure 3 As shown, the data verification method is applied to a system-on-chip (SOC), the system-on-chip includes a verification module and a first memory; the system-on-chip is connected to a second memory; the method includes:
[0039] Step 301: In response to a first instruction, if the verification module adopts a first mode, the verification module obtains first data from the first memory and obtains second data from the second memory; if the verification module adopts a second mode, the verification module obtains the first data and the second data from the second memory;
[0040] Wherein, the first data is a verification code required to verify the second data;
[0041] Step 302: Use data verification rules to perform data verification on the second data based on the first data to obtain a data verification result.
[0042] In some embodiments, the system-on-chip includes a verification module and a first memory;
[0043] The verification module is used to perform data verification using data verification rules; the verification module can use ECC verification, such as SECDED verification method, etc.; the verification module can also use other verification algorithms, such as CRC verification, etc. There is no limitation on the specific method used by the verification module. The method provided by the embodiment of the present disclosure can be applied to any method that requires data verification after reading data and / or verification code.
[0044] The first memory is a memory inside the system-on-chip, and may also be referred to as a system memory; the verification module may directly perform read and / or write operations on the first memory via a data bus of the system-on-chip.
[0045] In some embodiments, the system-level chip is connected to a second memory, that is, the second memory is not a memory inside the system-level chip, but an external memory connected to the system-level chip, and therefore, can also be called an external memory.
[0046] The external memory can be used to store software program instructions and configuration data that the system-level chip needs to execute, etc. The external memory needs to be non-volatile, that is, the data can still be saved after power failure, and the external memory can be Flash.
[0047] In some embodiments, the second data is data to be verified, and the second data may be data to be read by the system-level chip. The first data is a verification code required by the verification method to verify the second data. After obtaining the first data and the second data, the first data may be used to verify the second data.
[0048] It should be noted that the verification not only includes verifying whether the data is correct, but also includes error correction of the data. In one example, the verification algorithm adopted by the verification module is the ECC algorithm, and the first data is an ECC code (ECC code); if there is an error in the data within a certain bit range (such as 1 bit), the error correction operation can be performed on the verified second data based on the ECC verification method, and an error interrupt and status of the corrected error can be generated, that is, data verification and error correction are performed; if the data exceeds a certain bit range, only an error interrupt and status of the uncorrected error can be generated, that is, only data verification is performed. In each embodiment of the present disclosure, it should be understood that the data verification actually includes at least the operation of verifying whether there is an error in the second data, and / or the operation of correcting the data error if an error occurs.
[0049] In some embodiments, the system-on-chip further includes: a first processor; if the verification module adopts the first mode, the method further includes:
[0050] During the booting process of the system-on-chip, the first processor obtains a first data set from the second memory and sends the first data set to the first memory; the first data set includes at least one first data.
[0051] Specifically, the verification module has two modes;
[0052] The first mode is also called the parallel mode: the verification module is connected to two memories; here, the connection represents the relationship of reading data, that is, in actual application, the verification module can read data and verification codes from the two memories respectively;
[0053] The second mode is also called the serial mode: the verification mode is connected to a memory, that is, in actual application, the verification module reads data and verification codes from a memory in sequence.
[0054] Specifically, in order to enable the verification module to directly read the first data from the first memory, the embodiment of the present disclosure provides a method of pre-acquiring the first data set from the second memory and then storing it in the first memory. In this way, in actual application, the verification module can read data from the two memories respectively.
[0055] Specifically, in a system-on-chip, Master and Slave are usually used to describe the relationship between two devices or components in a bus architecture or a communication protocol.
[0056] Master: A host, master device or master component is the main manager of a control bus or communication protocol. It is usually responsible for initiating data acquisition requests, controlling data flow, and managing other slave devices or slave components. In a system-level chip, the Master is usually a processor or other core component that controls other peripherals or slave devices in the system.
[0057] Slave: A slave, slave device or slave component is a device or component controlled by a Master. The Slave receives commands or requests from the Master and performs corresponding operations accordingly. In a system-level chip, the Slave can be an external memory, sensor, interface controller, etc., which communicates with the master device such as the processor or other core components through a bus or communication protocol.
[0058] In general, the relationship between Master and Slave is a master-slave structure, where the Master controls and manages the behavior of the Slave, thereby achieving coordination and data exchange between various components in the system-level chip.
[0059] Here, the first processor is a Master in the system-level chip, which may be a processor (CPU, Central Processing Unit);
[0060] Correspondingly, the verification module, the first memory, etc. are slaves in the system-level chip.
[0061] In addition, although the second memory does not belong to the SOC, it is actually controlled by the first processor, so the second memory can also be a slave. In order to control the second memory, the SOC can also include a control module connected to the second memory, and the control module can also be a slave.
[0062] In some embodiments, the verification module obtains the first data from the first memory and obtains the second data from the second memory, including:
[0063] When the verification module determines that the data read address in the first instruction belongs to a preset data address range, first data is obtained from the first memory based on the data read address, and second data is obtained from the second memory;
[0064] If the verification module adopts the first mode, the method further includes:
[0065] The verification module determines that the data reading address in the first instruction does not belong to a preset data address range, and obtains second data from the second memory based on the data reading address;
[0066] The second data is sent to the first processor of the system-on-chip.
[0067] Specifically, the first instruction is a request for the first processor to access the external memory protected by verification, that is, to read data from the second memory;
[0068] If the verification module adopts the first mode, the verification module uses the system memory (i.e., the first memory) inside the system-level chip; in response to the received first instruction, the verification module simultaneously accesses the external memory (i.e., the second memory) storing the data and the system memory (i.e., the first memory) storing the verification code. In this way, the verification module can quickly and efficiently obtain the required data and the verification code corresponding to the data.
[0069] Specifically, the first instruction includes a data reading address corresponding to the data to be read;
[0070] The verification module stores a preset data address range, which is a pre-configured address range protected by verification. If the data reading address belongs to the preset data address range, a request for reading the verification code can be determined based on the data reading address, and the request for reading the verification code can include the address of the verification code corresponding to the data to be read. Here, the address for reading the verification code can be determined based on the data reading address based on a preset rule, and the preset rule can be used to indicate the corresponding relationship between the data address and the verification code address within the data address range.
[0071] In actual application, the verification module determines whether the data reading address belongs to the preset data address range. If the data reading address belongs to the preset data address range, the second data is obtained from the second memory based on the data reading address of the first instruction, and the first data is obtained from the first memory based on the request to read the verification code.
[0072] Considering that the second memory not only stores program instructions but also stores some static data, these static data do not need to be verified and protected. Therefore, this part of the static data can be directly retrieved and sent to the host of the SOC. Based on this, the embodiment of the present disclosure also provides a method for accessing the above static data, namely:
[0073] If the data read address does not belong to the preset data address range, second data is obtained from the second memory based on the data read address; and the second data is sent to the first processor of the system-on-chip.
[0074] In some embodiments, the method further comprises:
[0075] The verification module determines to adopt the first mode or the second mode based on the configuration information.
[0076] Specifically, the verification module may have at least one register, and the at least one register is used to perform relevant configuration in advance.
[0077] For example, the first register provides a mode configuration, and the modes include a first mode and a second mode; the first register also provides a mode setting function, that is, the user can choose to use the first mode or the second mode.
[0078] The second register provides verification-related configurations. For example, the adopted verification method, the preset data reading range protected by the verification, the storage location of the verification code required for the verification, etc. can all be configured in the second register.
[0079] It should be noted that the first register and the second register can be combined into one register or two registers to achieve the above functions, and there is no limitation on the number of registers used and the division of register functions.
[0080] In some embodiments, the system-on-chip further includes: a control module; the control module is connected to the second memory;
[0081] The first processor obtains a first data set from the second memory, and sends the first data set to the first memory, including:
[0082] The first processor transparently transmits the second instruction to the control module through the verification module;
[0083] The control module obtains a first data set from the second memory according to the second instruction, and transparently transmits the first data set to the first processor through the verification module;
[0084] The first processor sends the first data set to the first memory.
[0085] Specifically, the verification module may have two working states, one is a transparent transmission state, and the other is a verification state, and the verification state may specifically adopt the first mode or the second mode.
[0086] Specifically, when the first processor is powered on, the verification module is in a transparent transmission state, that is, the second instruction of the first processor can be transparently transmitted to the control module, and the control module is used to access and control the second memory; after the control module obtains the first data set from the second memory based on the second instruction, the first data set is transparently transmitted to the first processor through the verification module.
[0087] After the first processor is powered on, the preparation work is completed, and the verification module is switched to the verification state, and the verification work is performed in the first mode or the second mode.
[0088] The verification module may have a state adjustment bit, recorded as bypass mode; when the first processor is powered on, bypass mode=1, that is, the verification module is in a transparent transmission state, used for transparent transmission of data and / or instructions; after the first processor completes the preparation work, bypass mode=0, that is, the verification module performs the verification work.
[0089] In some embodiments, the system-on-chip further includes: a second processor and a control module; the control module is connected to the second memory;
[0090] The first processor obtains a first data set from the second memory, and sends the first data set to the first memory, including:
[0091] The second processor generates a third instruction based on the address information sent by the first processor, and transparently transmits the third instruction to the control module through the verification module;
[0092] The control module obtains the first data set from the second memory according to the third instruction, and transparently transmits the first data set to the second processor through the verification module;
[0093] The second processor sends the first data set to the first memory.
[0094] Specifically, the control module is a controller of the second memory, and the control and access to the second memory can be achieved through the control module, including: sending data to the second memory, obtaining data from the second memory, etc.
[0095] Here, in order to reduce the burden on the first processor, a method for data transfer through the second processor is provided, that is, the second processor obtains the first data set from the second memory and sends it to the first memory, thereby reducing the burden on the first processor and improving the startup speed of the system-level chip.
[0096] Specifically, the system-on-chip has one or more processors, such as the first processor and the second processor.
[0097] In one example, the first processor is a CPU, and the second processor is a direct memory access (DMA) controller.
[0098] The first processor (such as a CPU) can send address information of data to be moved to the second processor (such as a DMA controller), and the second processor generates a third instruction based on the address information, and transparently transmits the third instruction to the control module through the verification module; the control module obtains a first data set from the second memory according to the third instruction, and transparently transmits the first data set to the second processor through the verification module; the second processor sends the obtained first data set to the first memory for storage.
[0099] In some embodiments, the system-on-chip further includes: a first processor and a control module; the control module is connected to the second memory;
[0100] The responding to the first instruction comprises:
[0101] The verification module responds to a first instruction sent by the first processor;
[0102] The applying the data verification rule to perform data verification on the second data based on the first data to obtain a data verification result includes:
[0103] The verification module uses a data verification rule to perform data verification on the second data based on the first data to obtain a data verification result;
[0104] The verification module sends the data verification result to the first processor.
[0105] Specifically, the first instruction is generated by the first processor and sent to the verification module. After receiving the first instruction, the verification module uses a preset data verification rule to perform data verification on the second data based on the acquired first data to obtain a data verification result; and sends the data verification result to the first processor. The data verification result may include at least one of the following:
[0106] The verified second data;
[0107] The second data after checking and error correction, and the error interrupt and status of the corrected error; this is the case where the second data has a correctable error;
[0108] The second data, and the error interrupt and status of the uncorrected error; this is the case where there is an error in the second data and the error exceeds a certain bit range (ie, cannot be corrected).
[0109] In some embodiments, the data verification method is applied to a system-on-chip (SOC), which refers to integrating multiple hardware components on a single chip, such as a CPU, a DMA controller, a graphics processing unit (GPU), etc., to realize a complete computing system.
[0110] Hardware resources such as CPU, DMA controller, GPU, etc. are configured into multiple sets of different hardware components, called hardware domains, and each operating system runs independently in each hardware domain. Each hardware domain works independently to prevent mutual interference or influence, thereby improving the reliability, stability and anti-interference ability of SOC.
[0111] Inter-core communication is the communication method between different hardware domains within the SOC, including asynchronous message passing through the mailbox mechanism and data sharing across hardware domains through the shared memory mechanism.
[0112] Mailbox is a mechanism or data structure used for communication between different processing cores. It can be used to pass messages and trigger events between different processors, cores or hardware modules. Mailbox can be regarded as a shared, bidirectional communication interface, which contains one or more registers for storing messages or control information. The sender can write messages to the registers of Mailbox, and the receiver can read these messages and process them accordingly. That is, the sender can control the receiver or instruct the receiver to perform corresponding operations by writing messages or control information in the registers of Mailbox.
[0113] In semiconductor chips, Mailbox is often used for communication between processors, such as between multi-core processors, SOCs, or multiple independent functional modules. Through the Mailbox mechanism, different processing units can work together, share data, synchronize operations, and trigger events, thereby achieving more efficient system collaboration and resource sharing.
[0114] It should be noted that the implementation of Mailbox may vary depending on the chip architecture, communication protocol or design requirements, but in general, it exists to achieve reliable and efficient communication and data exchange between processing units.
[0115] In some embodiments, the first processor, the second processor, the verification module, the control module, the first memory, etc. can be IP / IP cores in a SOC respectively.
[0116] IP, also known as IP core (Intellectual Property Core), refers to the mature design of a circuit module with independent functions in a chip. This circuit module design can be applied to other chip design projects that contain this circuit module, thereby reducing the design workload, shortening the design cycle, and improving the success rate of chip design. IP core can also be understood as an intermediate component of chip design.
[0117] In some embodiments, the SOC may be a multi-core heterogeneous chip.
[0118] Multi-core heterogeneity refers to a chip architecture design that integrates multiple processing cores (cores) and at least two of these cores are different in structure, function or performance. Some tasks may be more suitable for high-performance general-purpose processor cores, while other tasks may require more specialized processor cores to improve efficiency. Multi-core heterogeneity can better balance factors such as performance, power consumption and cost, and provide more flexible and efficient solutions.
[0119] A multi-core heterogeneous chip refers to a chip that integrates two or more processor cores in a single chip. Each processor core can act as an independent processor and independently run the instructions stored in the memory corresponding to the processor core.
[0120] In some embodiments, the first processor, the second processor, the verification module, the control module, and the first memory may belong to a multi-purpose domain (MP) in the SOC, or may belong to different multi-purpose domains.
[0121] The first processor, the second processor, the verification module, the control module, and the first memory may belong to one application domain or different application domains.
[0122] The first processor, the second processor, the verification module, the control module, and the first memory may belong to a safety domain in the SOC, or may belong to different safety domains.
[0123] A hardware domain is a set of hardware that may include hardware resources such as processor cores, interrupt controllers, clock controllers, and memory. The number of processor cores in a hardware set may be one or more. One hardware domain runs one operating system, and different hardware domains may run different operating systems.
[0124] Application domain: refers to one or more hardware domains, which means that the hardware domain has strong computing performance and can support application programs with high computing performance requirements.
[0125] Security domain: is one or more hardware domains, including at least one of the following characteristics: having a high functional safety architecture, running an operating system that meets high functional safety requirements, and processing tasks that require high functional safety.
[0126] The multifunctional domain is one or more hardware domains, which are configured with processor components with certain processing capabilities and specific hardware components that respond to various different requirements, such as a first processor and a second processor, for processing various types of tasks.
[0127] The multi-core heterogeneous chip in the disclosed embodiment can be applied to transportation equipment, including but not limited to balancing vehicles, cars, buses, subways, trains, airplanes, etc.
[0128] To implement the data verification method, the present disclosure specifically provides a verification module, such as Figure 4 As shown, the verification module includes:
[0129] The read command unit (Read command process) is used to receive and respond to the host (Master) command to read the external memory. The host can be a CPU, DMA controller, etc. in the system-level chip.
[0130] A code request generator is used to generate a request to read a check code (such as an ECC code). Specifically, when the data address to be read from the external memory is within a pre-configured data address range protected by the check code, a request to read the check code is generated.
[0131] The first arbiter (Arbiter_1) is used to arbitrate the requests for read data and check code according to the mode (first mode or second mode) configured by the user, generate and send the command to read data on AR_m0, and generate and send the command to read check code on AR_m1.
[0132] The second arbiter (Arbiter_2) is used to distinguish the data returned on the R_m0 and R_m1 channels into data and check codes according to the mode configured by the user (the first mode or the second mode) and the channel identifier (rid) of the R_m0 channel in the second mode. It should be noted that for the second mode, a certain bit of the channel identifier (arid) of the AR_m0 channel can be selected as the flag bit of the command to read the data and check codes. Accordingly, the data and check codes are distinguished by the corresponding bits of the channel identifiers (rid) of the R_m0 and R_m1 channels.
[0133] The code buffer is used to cache the check code. Generally speaking, the size of the cache exceeds the number of check codes corresponding to the maximum data bus burst transmission length supported by the controller of the external memory.
[0134] The data verification unit (Data verification) is used to use a preset verification method to verify the data and the check code; for example, the SECDED verification method and the CRC verification method are used.
[0135] In the embodiment of the present disclosure, the data bus adopts an AXI (Advanced eXtensible Interface, a bus protocol) bus, and the channels for reading commands and reading data of the AXI bus are separated from each other. Figure 4 In the figure, AR represents the read command channel and R represents the read data channel.
[0136] AR_s0: represents the bus channel that receives the host (such as CPU, DMA controller, etc.) to read the external memory command.
[0137] R_s0: represents the bus channel that returns the ECC-checked read data to the host.
[0138] AR_m0: A flash controller (such as the control module) connected to an external memory (such as the second memory mentioned above). If it is the second mode, the verification module sends commands for reading data and verification codes through this interface (first sends a command for reading the verification code, then sends a command for reading data). If it is the first mode, the verification module sends a command for reading data through this interface.
[0139] R_m0: A storage controller connected to an external memory. If it is the second mode, the verification module receives data and verification code through this interface; if it is the first mode, the verification module receives data through this interface.
[0140] AR_m1: Connects to the system memory (such as the first memory) through the data bus, and sends a command to read the verification code through this interface in the first mode.
[0141] R_m1: Connect to the system memory through the data bus, and receive the check code through this interface in the first mode.
[0142] The verification module may also include a register, such as Figure 5 As shown, the register (RAG control) can be connected to the first arbitrator, the second arbitrator, the code request generator, etc. respectively.
[0143] The register may be configured with at least the following information:
[0144] data_start_addr: specifies the starting address of the data to be checked (such as data to be ECC checked) in the external memory (such as the second memory);
[0145] data_end_addr: specifies the end address of the data to be verified in the external memory; here, the configured data_start_addr and data_end_addr are equivalent to the starting position and ending position of the preset data address range. From data_start_addr to data_end_addr, the data needs to be verified.
[0146] code_start_addr: specifies the starting address where the check code (such as ECC code) is stored. In the second mode, this address is set to an address within the address range of the external memory (such as the second memory); in the first mode, this address is set to an address within the address range of the system memory (such as the first memory).
[0147] code_end_addr: specifies the end address where the check code (such as ECC code) is stored. This address can be automatically calculated based on data_start_addr and data_end_addr, and does not need to be specified separately. For example, in the SECDED check method, 64-bit data corresponds to 8-bit ECC code, that is, the relationship between data and ECC code is 8:1. Therefore, based on data_start_addr, data_end_addr, code_start_addr, and the 8:1 relationship between data and ECC code, code_end_addr can be calculated.
[0148] Figure 6 A schematic diagram of a structure of a verification module in a first mode provided by an embodiment of the present disclosure; Figure 6 , explaining the workflow of the verification module.
[0149] The data that needs to be ECC checked and the ECC code are written in advance to the designated addresses of the external memory of the SOC.
[0150] Each time the SOC is powered on again, the ECC code in the external memory is moved to the specified address inside the system memory; the address information in the register in the verification module is set, and the address information includes: data_start_addr, data_end_addr, code_start_addr. Specifically, it can be determined whether the verification module adopts the first mode or the second mode; if the first mode is adopted, the ECC code in the external memory is moved to the specified address inside the system memory; and the address information in the register in the verification module is set. In this way, in the first mode, the system memory inside the SOC can be used to store the ECC code. When the verification module receives a command from the host to access the ECC-protected external memory, it simultaneously accesses the external memory storing the data and the system memory inside the SOC storing the ECC code.
[0151] After receiving the command from the host to read the data from the external memory, the verification module determines whether the read data address is between data_start_addr and data_end_addr; if the data address is between data_start_addr and data_end_addr, the following first operation is performed; if the data address is not between data_start_addr and data_end_addr, the following second operation is performed;
[0152] The first operation includes: the verification module calculates the address of the ECC code according to the data address, and the verification module sends a command to read the data and a command to read the ECC code to the storage controller and the system memory inside the SOC in parallel; after receiving the data and the ECC code, the verification module performs ECC verification using a preset verification method;
[0153] For example, an enhanced error detection and correction (Improved Error Correction Code) method is used, specifically the SECDED verification method;
[0154] If there is no error in the detection, the verification module sends the original data to the host;
[0155] If a 1-bit error is detected, the check module sends the corrected data to the host and generates a correctable error interrupt and status;
[0156] If 2 bits or more errors are detected, the check module sends the original data to the host and generates an uncorrectable error interrupt and status.
[0157] The second operation includes: the verification module sends a command to read data to the storage controller inside the SOC; and the verification module directly returns the data to the host after receiving the data.
[0158] Figure 6 In the context of data bus, bus fabric also refers to the data bus, which implements the chip-level bus architecture, the connection between servers and storage devices, and the communication between network devices.
[0159] In the embodiment of the present disclosure, the host may be a device such as a CPU, a DMA controller, etc. that can actively initiate a data transmission request.
[0160] Figure 7 A schematic diagram of a structure of a verification module in the second mode provided by an embodiment of the present disclosure; Figure 7 , explaining the workflow of the verification module.
[0161] The data that needs to be ECC checked and the ECC code are written in advance to the designated addresses of the external memory of the SOC.
[0162] Each time the SOC is powered on again, the address information in the register in the verification module is set; the address information includes: data_start_addr, data_end_addr, code_start_addr. Specifically, it is determined whether the verification module adopts the first mode or the second mode. If the second mode is adopted, only the address information in the register in the verification module is set; the operation of moving the ECC code in the external memory to the specified address in the system memory is not performed.
[0163] After receiving the command from the host to read the data from the external memory, the verification module determines whether the read data address is between data_start_addr and data_end_addr; if the data address is between data_start_addr and data_end_addr, the following third operation is performed; if the data address is not between data_start_addr and data_end_addr, the following fourth operation is performed;
[0164] The third operation includes: the verification module calculates the address of the ECC code according to the data address, and the verification module serially sends a command to read the data and a command to read the ECC code to the storage controller inside the SOC; after the verification module receives the data and the ECC code, the ECC verification is performed;
[0165] If there is no error in the detection, the verification module sends the original data to the host;
[0166] If a 1-bit error is detected, the check module sends the corrected data to the host and generates a correctable error interrupt and status;
[0167] If 2 bits or more errors are detected, the check module sends the original data to the host and generates an uncorrectable error interrupt and status.
[0168] The fourth operation includes: the verification module sends a command to read data to the storage controller inside the SOC, and the verification module directly returns the data to the host after receiving the data.
[0169] In the embodiment of the present disclosure, the host may be a device such as a CPU, a DMA controller, etc. that can actively initiate a data transmission request.
[0170] in addition, Figure 6 and Figure 7 In the example, s0 includes AR_s0 and R_s0, m0 includes AR_m0 and R_m0, and m1 includes AR_m1 and R_m1.
[0171] Figure 8 A schematic diagram of the structure of a data verification device provided in an embodiment of the present disclosure; Figure 8 As shown, the device is applied to a system-level chip, and the device includes a verification module and a first memory; the system-level chip is connected to a second memory; the device includes:
[0172] The verification module is configured to respond to the first instruction, if the verification module adopts the first mode, obtain the first data from the first memory, and obtain the second data from the second memory; if the verification module adopts the second mode, obtain the first data and the second data from the second memory; the first data is a verification code required to verify the second data;
[0173] The verification module is further used to apply a data verification rule to perform data verification on the second data based on the first data to obtain a data verification result.
[0174] In some embodiments, the apparatus further comprises: a first processor;
[0175] If the verification module adopts the first mode, during the startup of the system-level chip, the first processor is used to obtain a first data set from the second memory and send the first data set to the first memory; the first data set includes at least one first data.
[0176] In some embodiments, the verification module is used to obtain first data from the first memory and second data from the second memory based on the data read address when determining that the data read address in the first instruction belongs to a preset data address range;
[0177] If the verification module adopts the first mode, the verification module is further used to determine that the data reading address in the first instruction does not belong to the preset data address range, and obtain the second data from the second memory based on the data reading address;
[0178] The second data is sent to the first processor of the system-on-chip.
[0179] In some embodiments, the verification module is further used to determine whether to adopt the first mode or the second mode based on configuration information.
[0180] In some embodiments, the device further comprises: a control module; the control module is connected to the second memory;
[0181] The first processor is used to transparently transmit the second instruction to the control module through the verification module;
[0182] The control module is configured to obtain a first data set from the second memory according to the second instruction, and transparently transmit the first data set to the first processor through the verification module;
[0183] The first processor is configured to send the first data set to the first memory.
[0184] In some embodiments, the device further comprises: a second processor and a control module; the control module is connected to the second memory;
[0185] The second processor is used to generate a third instruction based on the address information sent by the first processor, and transparently transmit the third instruction to the control module through the verification module;
[0186] The control module is configured to obtain a first data set from the second memory according to the third instruction, and transparently transmit the first data set to the second processor through the verification module;
[0187] The second processor is configured to send the first data set to the first memory.
[0188] In some embodiments, the device further comprises: a first processor and a control module; the control module is connected to the second memory;
[0189] The verification module is used to respond to a first instruction sent by the first processor;
[0190] The verification module is used to perform data verification on the second data based on the first data using a data verification rule to obtain a data verification result;
[0191] The data verification result is sent to the first processor.
[0192] The specific working process of the device can refer to the relevant description in the aforementioned method embodiment, which will not be repeated here.
[0193] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
[0194] Fig. 9 A schematic diagram of the structure of an electronic device provided for an embodiment of the present disclosure. Device 900 is intended to represent various forms of digital computers, such as controllers, laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0195] The device 900 is connected to a second storage.
[0196] like Fig. 9As shown, the device 900 includes a computing unit 901, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 902 or a computer program loaded from a storage unit 908 into a random access memory (RAM) 903. In the RAM 903, various programs and data required for the operation of the device 900 can also be stored. The computing unit 901, the ROM 902, and the RAM 903 are connected to each other via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.
[0197] A number of components in the device 900 are connected to the I / O interface 905, including: an input unit 906, such as a keyboard, a mouse, etc.; an output unit 907, such as various types of displays, speakers, etc.; a storage unit 908, such as a disk, an optical disk, etc.; and a communication unit 909, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 909 allows the device 900 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0198] The computing unit 901 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 901 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 901 performs the various methods and processes described above, such as a data verification method. For example, in some embodiments, the data verification method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 908. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 900 via the ROM 902 and / or the communication unit 909. When the computer program is loaded into the RAM 903 and executed by the computing unit 901, one or more steps of the data verification method described above may be performed. Alternatively, in other embodiments, the computing unit 901 may be configured to perform the data verification method in any other appropriate manner (e.g., by means of firmware).
[0199] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0200] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0201] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0202] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0203] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0204] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0205] In the above description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it can be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0206] Unless otherwise defined, all technical and scientific terms used in this disclosure have the same meaning as those commonly understood by those skilled in the art to which this disclosure belongs. The terms used in this disclosure are only for the purpose of describing the embodiments of this disclosure and are not intended to limit this disclosure.
[0207] It should be understood that in the various embodiments of the present disclosure, the size of the serial number of each implementation process does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present disclosure.
[0208] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of the present disclosure, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0209] The above is only a specific embodiment of the present disclosure, but the protection scope of the present disclosure is not limited thereto. Any person skilled in the art who is familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present disclosure, which should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.
Claims
1. A data verification method, characterized in that: The method is applied to a system-on-chip (SOC), wherein the system-on-chip comprises a verification module and a first memory; The system-level chip is connected to a second memory; the method comprises: In response to the first instruction, if the verification module adopts the first mode, the verification module obtains the first data from the first memory and obtains the second data from the second memory; if the verification module adopts the second mode, the verification module obtains the first data and the second data from the second memory; the first data is a verification code required to verify the second data; Using a data verification rule, performing data verification on the second data based on the first data to obtain a data verification result; The verification module obtains first data from the first memory and obtains second data from the second memory, including: When the verification module determines that the data read address in the first instruction belongs to a preset data address range, first data is obtained from the first memory based on the data read address, and second data is obtained from the second memory; If the verification module adopts the first mode, the method further includes: The verification module determines that the data read address in the first instruction does not belong to a preset data address range, obtains second data from the second memory based on the data read address; and sends the second data to the first processor of the system-level chip.
2. The method according to claim 1, characterized in that The system-on-chip further includes: a first processor; if the verification module adopts the first mode, the method further includes: During the booting process of the system-on-chip, the first processor obtains a first data set from the second memory and sends the first data set to the first memory; the first data set includes at least one first data.
3. The method according to claim 1, characterized in that The method further comprises: The verification module determines to adopt the first mode or the second mode based on the configuration information.
4. The method according to claim 2, characterized in that: The system-level chip further includes: a control module; the control module is connected to the second memory; The first processor obtains a first data set from the second memory, and sends the first data set to the first memory, including: The first processor transparently transmits the second instruction to the control module through the verification module; The control module obtains a first data set from the second memory according to the second instruction, and transparently transmits the first data set to the first processor through the verification module; The first processor sends the first data set to the first memory.
5. The method according to claim 2, characterized in that: The system-level chip also includes: a second processor and a control module; the control module is connected to the second memory; The first processor obtains a first data set from the second memory, and sends the first data set to the first memory, including: The second processor generates a third instruction based on the address information sent by the first processor, and transparently transmits the third instruction to the control module through the verification module; The control module obtains the first data set from the second memory according to the third instruction, and transparently transmits the first data set to the second processor through the verification module; The second processor sends the first data set to the first memory.
6. The method according to claim 1, characterized in that The system-level chip also includes: a first processor and a control module; the control module is connected to the second memory; The responding to the first instruction comprises: The verification module responds to a first instruction sent by the first processor; The applying the data verification rule to perform data verification on the second data based on the first data to obtain a data verification result includes: The verification module uses a data verification rule to perform data verification on the second data based on the first data to obtain a data verification result; The verification module sends the data verification result to the first processor.
7. A data verification device, characterized in that: The device is applied to a system-on-chip (SOC), and the system-on-chip includes a verification module and a first memory; The system-level chip is connected to a second memory; the device comprises: The verification module is configured to respond to the first instruction, if the verification module adopts the first mode, obtain the first data from the first memory, and obtain the second data from the second memory; if the verification module adopts the second mode, obtain the first data and the second data from the second memory; the first data is a verification code required to verify the second data; The verification module is further used to apply a data verification rule to perform data verification on the second data based on the first data to obtain a data verification result; The verification module is configured to obtain first data from the first memory and second data from the second memory based on the data reading address when determining that the data reading address in the first instruction belongs to a preset data address range; If the verification module adopts the first mode, the verification module is also used to determine that the data reading address in the first instruction does not belong to the preset data address range, obtain second data from the second memory based on the data reading address; and send the second data to the first processor of the system-level chip.
8. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 6.
9. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to make a computer execute the method according to any one of claims 1 to 6.
