Test method, device and equipment of storage device, storage medium and program product
By acquiring and adjusting the functional test templates and code files of the storage device, the problems of high complexity and low efficiency of the storage device testing in the prior art are solved, and efficient automated testing of the storage device is realized.
Patent Information
- Application Number
- CN202311144114.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-05
- Publication Date
- 2025-03-07
AI Technical Summary
The prior art has high test complexity and low efficiency when a large number of storage devices are tested in the test chip.
By obtaining the storage attribute information and functional test templates of the storage device, adjusting the templates to generate adaptive functional test files, and using the functional code files to simulate the storage function for testing.
This reduces the complexity of storage device testing, improves testing efficiency, and realizes automated batch testing of multiple storage devices.
Smart Images

Figure CN119580806A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a storage device testing method, a storage device testing device, a computer device, a computer-readable storage medium, and a computer program product. Background Art
[0002] Before the chip is officially put into mass production, the functions of each functional module in the chip need to be tested. After the functions of each functional module in the test chip are completely correct, the chip can be officially put into mass production. The storage device (also called a memory wrapper) is a functional module in the chip. At present, the test method for the storage function of the storage device in the chip is: for each storage device in the chip, a corresponding functional test file is manually generated, and the storage function of each storage device is tested through the functional test file corresponding to each storage device. When such a test method contains a large number of storage devices in the chip, it will lead to high test complexity of the storage device in the chip and low test efficiency of the storage device in the chip. Summary of the invention
[0003] The embodiments of the present application provide a storage device testing method, device and equipment, storage medium, and program product, which can reduce the testing complexity of the storage device in the chip and improve the testing efficiency of the storage device in the chip.
[0004] On the one hand, an embodiment of the present application provides a method for testing a storage device, the method for testing a storage device comprising:
[0005] Acquire storage attribute information of a target storage device in a chip, and acquire a functional test template adapted to the target storage device; the target storage device is used to store operation data of the chip;
[0006] According to the storage attribute information of the target storage device, a functional test template adapted to the target storage device is adjusted to obtain a functional test file corresponding to the target storage device;
[0007] Acquire a function code file of a target storage device, where the function code file of the target storage device is used to simulate a storage function of the target storage device;
[0008] The storage function of the target storage device is tested according to the function test file of the target storage device and the function code file of the target storage device.
[0009] Accordingly, an embodiment of the present application provides a storage device testing device, the storage device testing device comprising:
[0010] An acquisition unit, used to acquire storage attribute information of a target storage device in the chip, and to acquire a functional test template adapted to the target storage device; the target storage device is used to store the operation data of the chip;
[0011] A processing unit, configured to adjust a functional test template adapted to the target storage device according to storage attribute information of the target storage device, and obtain a functional test file corresponding to the target storage device;
[0012] The acquisition unit is further used to acquire a function code file of the target storage device, where the function code file of the target storage device is used to simulate the storage function of the target storage device;
[0013] The processing unit is also used to test the storage function of the target storage device according to the function test file of the target storage device and the function code file of the target storage device.
[0014] In one implementation, the functional test template includes a test environment template and a test stimulus template; the functional test file of the target storage device includes a test environment file obtained by adjusting the test environment template according to storage attribute information of the target storage device, and a test stimulus file obtained by adjusting the test stimulus template according to storage attribute information of the target storage device;
[0015] Among them, the test environment file is used to simulate the hardware environment to ensure the normal operation of the target storage device, the test stimulus file refers to the input signal of the function code file of the target storage device, and the test stimulus file is used to simulate the storage scenario of the target storage device.
[0016] In one implementation, the processing unit is used to perform the following steps when testing the storage function of the target storage device according to the function test file of the target storage device and the function code file of the target storage device:
[0017] Running the function code file of the target storage device in the hardware environment simulated by the test environment file;
[0018] Based on the hardware environment simulated by the test environment file, the test stimulus file is input into the function code file of the target storage device to obtain the output test result;
[0019] The output test results are analyzed from different dimensions to obtain storage function test results of the target storage device in different dimensions.
[0020] In one implementation, the storage function of the target storage device to be tested includes N types, each type corresponds to a respective test environment file and a test stimulus file, any type of the N types is represented as an i-th type, N is a positive integer, and i is a positive integer less than or equal to N;
[0021] The processing unit is used to execute the following steps when running the function code file of the target storage device under the hardware environment simulated by the test environment file: running the function code file of the target storage device under the hardware environment simulated by the test environment file corresponding to the i-th type of storage function;
[0022] A processing unit is used to input the test stimulus file into the function code file of the target storage device based on the hardware environment simulated by the test environment file to obtain the output test result, including: based on the hardware environment simulated by the test environment file corresponding to the i-th type of storage function, input the test stimulus file corresponding to the i-th type of storage function into the function code file of the target storage device to obtain the output test result of the i-th type.
[0023] In one implementation, the storage attribute information of the target storage device includes interface information, and the interface information is used to indicate the number of interfaces that the target storage device is allowed to use when reading and writing operation data; the acquisition unit is used to acquire a functional test template adapted to the target storage device, and is specifically used to perform the following steps:
[0024] According to the number of interfaces indicated by the interface information, a function test template corresponding to the number of interfaces indicated by the interface information is obtained from a function test template library; the function test template library includes different function test templates corresponding to different numbers of interfaces;
[0025] The function test template corresponding to the number of interfaces indicated by the interface information is determined as the function test template adapted to the target storage device.
[0026] In one implementation, the functional test template adapted to the target storage device includes parameters of parameter values to be configured; the processing unit is used to adjust the functional test template adapted to the target storage device according to the storage attribute information of the target storage device, and when the functional test file corresponding to the target storage device is obtained, it is specifically used to perform at least one of the following:
[0027] The storage attribute information of the target storage device is used as the parameter value of the parameter, and is added to the functional test template adapted to the target storage device to obtain a functional test file corresponding to the target storage device;
[0028] According to the parameterization requirements of the functional test template corresponding to the target storage device, the storage attribute information of the target storage device is converted into information that meets the parameterization requirements, and then added as the parameter value of the parameter to the functional test template adapted to the target storage device to obtain the functional test file corresponding to the target storage device.
[0029] In one implementation, the chip includes one or more storage devices, and the target storage device is any storage device in the chip; the acquisition unit is used to acquire storage attribute information of the target storage device in the chip, specifically to perform the following steps:
[0030] Obtaining an attribute configuration file; the attribute configuration file includes a storage path of a function code file of each storage device in the chip, the storage path of the function code file of each storage device includes a file name of the function code file of each storage device, and the file name of the function code file of each storage device is named according to the storage attribute information of each storage device;
[0031] The storage attribute information of the target storage device is read from the storage path of the function code file of the target storage device in the attribute configuration file.
[0032] In one implementation, the chip includes one or more storage devices, and the target storage device is any storage device in the chip; the acquisition unit is used to acquire storage attribute information of the target storage device in the chip, specifically to perform the following steps:
[0033] Acquire an attribute mapping table; the attribute mapping table associates and stores the file names of the function code files of each storage device in the chip with the storage attribute information;
[0034] In the attribute mapping table, storage attribute information stored in association with the file name of the function code file of the target storage device is obtained, and the storage attribute information stored in association with the file name of the function code file of the target storage device is determined as the storage attribute information of the target storage device.
[0035] In one implementation, the acquisition unit is further configured to perform the following steps:
[0036] Obtaining a public library file required to be called by a function code file of a target storage device;
[0037] The processing unit is further configured to perform the following steps:
[0038] The public library file to be called by the function code file of the target storage device is configured as a library file adapted to the target storage device, so that the library file adapted to the target storage device is called during the operation of the function code file of the target storage device.
[0039] In one implementation, the storage attribute information of the target storage device includes at least one of the following: interface information, data storage capability information, parity bit information, bit enable information, and data read delay information.
[0040] Accordingly, an embodiment of the present application provides a computer device, the computer device comprising:
[0041] a processor suitable for implementing a computer program;
[0042] A computer-readable storage medium stores a computer program, and the computer program is suitable for being loaded by a processor and executing the above-mentioned storage device testing method.
[0043] Accordingly, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is read and executed by a processor of a computer device, the computer device executes the above-mentioned storage device testing method.
[0044] Accordingly, an embodiment of the present application provides a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the above-mentioned storage device testing method.
[0045] In the embodiment of the present application, a functional test template adapted to the storage device can be adjusted according to the storage attribute information of the storage device in the chip to obtain a functional test file corresponding to the storage device. Then, the storage function of the storage device can be tested according to the functional test file corresponding to the storage device. It is not difficult to see that the embodiment of the present application can automatically generate a functional test file for the storage device for testing according to the storage attribute information of the storage device, which can reduce the testing complexity of the storage device in the chip and improve the testing efficiency of the storage device in the chip. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0047] Figure 1 It is a schematic diagram of the testing principle of the storage function of a storage device provided in an embodiment of the present application;
[0048] Figure 2 is a schematic diagram of the architecture of a storage device test system provided in an embodiment of the present application;
[0049] Figure 3 It is a flowchart of a storage device testing method provided in an embodiment of the present application;
[0050] Figure 4 It is a schematic diagram of a process of obtaining a functional test template adapted to a storage device provided in an embodiment of the present application;
[0051] Figure 5 It is a schematic diagram of an adjustment process of a functional test template provided in an embodiment of the present application;
[0052] Figure 6 is a flow chart of another storage device testing method provided in an embodiment of the present application;
[0053] Figure 7 is a schematic diagram of a storage function test result under a simulation dimension provided in an embodiment of the present application;
[0054] Figure 8 is a schematic diagram of a storage function test result under another simulation dimension provided in an embodiment of the present application;
[0055] Fig. 9 is a schematic diagram of a storage function test result under a waveform dimension provided in an embodiment of the present application;
[0056] Fig.10 is a schematic diagram of a regression result provided in an embodiment of the present application;
[0057] Fig.11 is a schematic diagram of a test example of a storage device provided in an embodiment of the present application;
[0058] Fig.12 is a structural schematic diagram of a storage device testing device provided in an embodiment of the present application;
[0059] Fig.13 It is a structural diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0060] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0061] In order to more clearly understand the technical solutions provided by the embodiments of the present application, the key terms involved in the embodiments of the present application are first introduced here.
[0062] (1) The embodiments of the present application relate to chips. Chips are a general term for semiconductor component products. In electronics, chips are a way to miniaturize circuits and are often manufactured on the surface of semiconductor wafers. Chips can be used for data operations. The embodiments of the present application do not limit the type of chip. For example, the chip can be an artificial intelligence chip (AI chip) in the field of artificial intelligence (AI). The artificial intelligence chip can be used to perform data operations on relevant data involved in the field of artificial intelligence.
[0063] Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science, which attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines so that machines have the functions of perception, reasoning and decision-making. Artificial intelligence technology is a comprehensive discipline that covers a wide range of fields, including both hardware-level technology and software-level technology; artificial intelligence software technology mainly includes computer vision technology, speech processing technology, natural language processing technology, machine learning / deep learning, autonomous driving, smart transportation and other major directions; artificial intelligence hardware technology generally includes sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics and other technologies.
[0064] (2) Embodiments of the present application relate to a storage device. A storage device refers to a functional module in a chip that has a storage function. For example, the storage device may be a memory wrapper in a chip. The storage device may be used to connect and encapsulate a memory device outside the chip (for example, HBM (High Bandwidth Memory), etc.) with a logic circuit inside the chip. The storage device may be used to store the operation data of the chip. Specifically, the operation data may include at least one of the following: data required for chip operation and the operation result of the chip. The chip may specifically perform data operation through the logic circuit inside the chip. The data required for the chip (specifically the logic circuit inside the chip) operation may be written into the storage device. The internal circuit may read the data required for the operation from the storage device to perform data operation. The operation result of the internal circuit on the data may be written into the storage device. The memory outside the chip may read the operation result of the internal circuit from the storage device.
[0065] The storage function of the storage device can be understood as a data read and write function, which refers to the ability to ensure that the operation data stored in the storage device will not be erroneous. It can be further understood as the ability to ensure that the operation data written to the storage address of the storage device is consistent with the operation data read from the storage address. If the operation data written to the storage address of the storage device is consistent with the operation data read from the storage address, it can be said that the storage function of the storage device is correct. If the operation data written to the storage address of the storage device is inconsistent with the operation data read from the storage address, it can be said that the storage function of the storage device is incorrect.
[0066] (3) The present application embodiment involves testing the storage function of a storage device. In order to ensure the correctness of the storage function of the designed storage device, the storage function of the storage device can be tested before the chip is officially put into mass production. The principle of testing the storage function of the storage device is as follows: Figure 1 As shown, based on Figure 1 The testing principle of the storage function of a storage device can be roughly described as follows: a function code file of the storage device can be written in a hardware description language, and the function code file of the storage device can be used to simulate the storage function of the storage device; a function test file of the storage device can be generated; then, the storage function of the storage device can be tested based on the function test file of the storage device and the function code file of the storage device.
[0067] Among them, the hardware description language can also be called a digital hardware language, which is a language for describing the hardware behavior, structure, and data flow of an electronic system. Using this language, the designer of a digital circuit system can describe its own design ideas layer by layer from top to bottom (from abstract to concrete), using a series of hierarchical modules to represent extremely complex digital systems. The embodiment of the present application does not limit the type of hardware description language used to write the functional code file of the storage device. For example, the hardware description language used in the embodiment of the present application may be Verilog (a hardware description language).
[0068] The chip may include one or more storage devices. Currently, when testing the storage function of the storage device, it is necessary to manually generate a separate functional test file for each storage device. When the number of storage devices contained in the chip is large, such a testing method will result in a higher test complexity for the storage device. Based on this, an embodiment of the present application proposes a test method for a storage device. In the test method for the storage device, a given functional test template can be automatically adjusted according to the storage attribute information of the storage device. In other words, a functional test file of the storage device can be automatically generated, so that the storage device can be tested according to the functional test file of the storage device. Based on the generation process of the automated functional test file, the embodiment of the present application can effectively reduce the test complexity of the storage device and improve the test efficiency of the storage device.
[0069] A test system for a storage device is introduced below with reference to the accompanying drawings. The test system for a storage device can be used to implement a test method for a storage device.
[0070] like Figure 2 As shown, the test system of the storage device may include a test request device 201 and a test response device 202. The embodiment of the present application does not limit the communication connection method between the test request device 201 and the test response device 202. For example, a direct communication connection may be established between the test request device 201 and the test response device 202 by means of wired communication, or an indirect communication connection may be established between the test request device 201 and the test response device 202 by means of wireless communication.
[0071] The test request device 201 may be a terminal, and the test response device 202 may be a terminal or a server. The terminal mentioned in the embodiment of the present application may include any of the following: a smart phone, a tablet computer, a laptop computer, a desktop computer, an intelligent voice interaction device, a smart watch, a vehicle terminal, a smart home appliance, and an aircraft, etc., but is not limited thereto. The server mentioned in the embodiment of the present application may be a separate physical server, or a server cluster or a distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms, etc., and the embodiment of the present application does not limit this.
[0072] In the storage device test system composed of the test request device 201 and the test response device 202, the test process of the storage function of the storage device can be roughly described as follows:
[0073] A test client may be run in the test request device 201, and the tester may submit a test request for the storage device through the test client. Specifically, the method in which the tester submits the test request for the storage device through the test client may include: the tester may upload the storage path of the function code file of each storage device of the chip, the storage attribute information of each storage device in the chip, and the test execution script file in the test request interface provided by the test client, and then click the test submission button in the test request interface (for example, Figure 2 The test request for the storage device may carry the storage path of the function code file of each storage device in the chip, the storage attribute information of each storage device in the chip, and the test execution script file. The test request for the storage device may be submitted to the test response device 202 through the test request device 201. Optionally, the tester may also submit the test request for the storage device by inputting instructions in the test request device 201. Specifically, the tester may upload the storage address of the function code file of each storage device in the chip, the storage attribute information of each storage device in the chip, and the test execution script file by inputting instructions in the test request device 201. Then, the test request for the storage device may be submitted by inputting instructions. The test request for the storage device may be submitted to the test response device 202 through the test request device 201.
[0074] Corresponding to the way that the tester submits the test request of the storage device through the test client in the test request device 201, the test response device 202 can be understood as the background of the test client; corresponding to the way that the tester submits the test request of the storage device by inputting instructions in the test request device 201, the test response device 202 can be understood as the response execution device of the input instruction. Different types of functional test templates can be stored in the test response device 202. After receiving the test request of the storage device submitted by the test request device 201, the test response device 202 can run the test execution script file for each storage device. The test execution script file can be used to obtain the functional test template adapted to the storage device, and the functional test template adapted to the storage device can be adjusted according to the storage attribute information of the storage device to obtain the functional test file corresponding to the storage device, and the storage function of the target storage device can be tested according to the functional test file of the target storage device and the functional code file of the target storage device. The test response device 202 can also output the storage function test result of the storage device to the test request device 201.
[0075] After receiving the storage function test results of the storage device output by the test response device 202, the test request device 201 can display the storage function test results of the storage device to the tester from different dimensions in a visual form in the test result display interface of the test client (for example, compilation results, simulation results, waveform results, and regression results, etc.), thereby helping the tester to analyze the correctness of the storage function of the storage device from different dimensions.
[0076] It should be noted that Figure 2 The test system of the storage device shown is described by taking the test request device 201 and the test response device 202 integrated into different devices as an example, for example, the test request device 201 is a terminal, and the test response device 202 is another terminal, or the test request device 201 is a terminal, and the test response device 202 is a server. The test request device 201 and the test response device 202 in the test system of the storage device can also be integrated into the same device, for example, the test request device 201 and the test response device 202 are both integrated into the terminal, which is not limited in the embodiments of the present application.
[0077] Understandably, Figure 2 The test system of the storage device shown is intended to more clearly illustrate the technical solution of the embodiment of the present application, and does not constitute a limitation on the technical solution provided by the embodiment of the present application. A person of ordinary skill in the art can appreciate that with the evolution of the system architecture and the emergence of new business scenarios, the technical solution provided by the embodiment of the present application is also applicable to similar technical problems.
[0078] The following is a detailed description of the storage device testing method provided in the embodiments of the present application in conjunction with the accompanying drawings.
[0079] The present application provides a storage device testing method, which involves the process of obtaining storage attribute information of the storage device, the process of obtaining a function code file of the storage device, and the process of adjusting a function test template. The storage device testing method is executed by a computer device, which may be, for example, Figure 2 The test response device 202 in the test system of the storage device shown, or may be Figure 2 The test request device 201 and the test response device 202 in the test system of the storage device shown in FIG. Figure 3 As shown, the test method of the storage device may include but is not limited to the following steps S301 to S304:
[0080] S301, obtaining storage attribute information of a target storage device in a chip, and obtaining a functional test template adapted to the target storage device; the target storage device is used to store the operation data of the chip.
[0081] The chip may include one or more storage devices. The embodiment of the present application does not limit the number of storage devices included in the chip. The embodiment of the present application takes any storage device included in the chip (any storage device can be represented as a target storage device) as an example to introduce the process of obtaining the storage attribute information of the target storage device, the process of obtaining the function code file of the target storage device, the process of adjusting the function test template adapted to the target storage device, and the process of testing the storage function of the target storage device. The storage device in the chip can be used to store the operation data of the chip, that is, the target storage device can be used to store the operation data of the chip.
[0082] In step S301, the storage attribute information of the target storage device refers to information related to the storage capacity of the target storage device, and the storage attribute information of the target storage device may include but is not limited to at least one of the following: interface information, data storage capacity information, parity bit information, bit enable information, and data read delay information.
[0083] The interface information can be used to indicate the number of interfaces that the target storage device is allowed to use when reading and writing operation data; for example, the target storage device is only allowed to use one interface when reading and writing operation data, which can be understood as the target storage device shares one interface when reading and writing operation data, and the process of reading operation data and the process of writing operation data cannot be parallel. In this case, the number of interfaces indicated by the interface information is 1; for another example, the target storage device is allowed to use two interfaces when reading and writing operation data, which can be understood as the target storage device uses different interfaces when reading and writing operation data, respectively, and the process of reading operation data and the process of writing operation data can be parallel. In this case, the number of interfaces indicated by the interface information is 2.
[0084] The data storage capacity information can be used to indicate the amount of data that the target storage device is allowed to store. The data storage capacity information may include depth information and width information. The depth information can be used to indicate the maximum amount of data that the target storage device can store, and the width information can be used to indicate the maximum volume of each data that the target storage device can store. For example, the depth information of the target storage device is 2048 and the width information is 256, which means that the target storage device can store a maximum of 2048 data, and each data is at most 256 bits.
[0085] Parity bit information can be used to indicate the number of bits required to calculate a parity bit. For example, if the parity bit information is 8, it can indicate that a parity bit is calculated for every 8 bits of data. Bit enable information can be used to indicate the number of bits corresponding to a bit enable bit. For example, if the bit enable information is 8, it can indicate that every 8 bits of data corresponds to a bit enable bit. If the bit enable bit is 1, it can indicate that the 8 bits of data corresponding to the bit enable bit are valid and need to be read and written. If the bit enable bit is 0, it can indicate that the 8 bits of data corresponding to the bit enable bit are invalid and do not need to be read or written. Data read delay information can be used to indicate the time required to read the operation data in the target storage device. For example, if the data read delay information is 1, it can indicate that the time required to read the operation data in the target storage device is 1 clock cycle.
[0086] The method for obtaining the storage attribute information of the target storage device may include any of the following: first, the storage attribute information of the target storage device may be obtained from the file name of the function code file of the target storage device; second, the storage attribute information of the target storage device may be obtained from an attribute mapping table used to store the storage attribute information of the storage device. The following introduces the two methods for obtaining the storage attribute information of the target storage device respectively:
[0087] The first method is to obtain the storage attribute information of the target storage device from the file name of the function code file of the target storage device. Specifically, an attribute configuration file can be obtained, and the attribute configuration file may include the storage path of the function code file of each storage device in the chip, and the storage path of the function code file of each storage device may include the file name of the function code file of each storage device, and the file name of the function code file of each storage device may be named according to the storage attribute information of each storage device; thus, the storage attribute information of the target storage device can be read from the storage path of the function code file of the target storage device in the attribute configuration file, and specifically, the file name of the function code file of the target storage device can be read from the storage path of the function code file of the target storage device in the attribute configuration file, and then the storage attribute information of the target storage device can be read from the file name of the function code file of the target storage device.
[0088] For example, the storage path of the function code file of the target storage device in the property configuration file is "PROJ ECT_HOME / tianzhu_fe / trunk / import / lib / frontend / mem_wrapper / broadcom / tcsp / tcsp_ppe_ram_1rw_d1024w256_pe8_bw8_rl1.v". In this storage path, the file name of the function code file of the target storage device is "tcsp_ppe_ram_1rw_d1024w256_pe8_bw8_rl1.v". In this file name, "1rw" represents the interface information of the target storage device, indicating that the target storage device is only allowed to use one interface when reading and writing operation data. If the target storage device is allowed to use two interfaces when reading and writing operation data, the interface information can be expressed as "1r1w"; "d1024w256" represents the data storage capacity information of the target storage device, "d1024" indicates that the depth information is 1024, and "w256" indicates that the width information is 256, indicating that the target storage device can store up to 1024 data, and each data is a maximum of 256 bits; "pe8" represents the parity bit information, indicating that a parity bit is calculated for every 8 bits of data; "bw8" represents the bit enable information, indicating that every 8 bits of data corresponds to a bit enable bit; "rl1" represents the data read delay information, indicating that the time required to read the operation data in the target storage device is 1 clock cycle.
[0089] exist Figure 2 In the illustrated embodiment, the tester can upload the storage attribute information of each storage device in the chip in the test request interface provided by the test client. Corresponding to the first acquisition method, the tester can specifically upload the attribute configuration file in the test request interface provided by the test client, and the storage attribute information of each storage device in the chip can be read from the attribute configuration file. In this way, the function code file of the storage device is named based on the storage attribute information of the storage device, and the storage attribute information of the storage device can be quickly obtained from the file name of the function code file of the storage device, and the association relationship between the read storage attribute information and the storage device is naturally established through the file name of the function code file of the storage device.
[0090] The second method is to obtain the storage attribute information of the target storage device from an attribute mapping table used to store the storage attribute information of the storage device. Specifically, the attribute mapping table can be obtained, and the file name and storage attribute information of each storage device in the chip can be stored in association with each other; in the attribute mapping table, the storage attribute information stored in association with the file name of the function code file of the target storage device can be obtained, and the storage attribute information stored in association with the file name of the function code file of the target storage device can be determined as the storage attribute information of the target storage device.
[0091] exist Figure 2 In the illustrated embodiment, the tester can upload the storage attribute information of each storage device in the chip in the test request interface provided by the test client. Corresponding to the second acquisition method, the tester can specifically upload the attribute mapping table in the test request interface provided by the test client, and the storage attribute information of each storage device in the chip can be read from the attribute mapping table. In this way, based on the association between the file name of the function file code of the storage device and the storage attribute information, the storage attribute information of the storage device can be quickly obtained from the attribute mapping table based on the file name of the function code file of the storage device.
[0092] In step S301, it is also necessary to obtain a functional test template that is compatible with the target storage device. Specifically, the process of obtaining a functional test template that is compatible with the target storage device may include: the functional test template is related to the number of interfaces, the test response device may provide a functional test template library, the functional test template library may include different functional test templates corresponding to different numbers of interfaces, and according to the number of interfaces indicated by the interface information of the target storage device, a functional test template corresponding to the number of interfaces indicated by the interface information of the target storage device may be obtained from the functional test template library, and the functional test template corresponding to the number of interfaces indicated by the interface information of the target storage device may be determined as a functional test template that is compatible with the target storage device. Figure 4 For example, the functional test template library may include functional test templates corresponding to a single interface (i.e., the storage device is only allowed to use one interface when reading and writing computing data) and functional test templates corresponding to dual interfaces (i.e., the storage device is allowed to use two interfaces when reading and writing computing data); if the interface information of the target storage device indicates that the target storage device is allowed to use one interface when reading and writing computing data, then the functional test template adapted to the target storage device is the functional test template corresponding to the single interface.
[0093] S302, adjusting a functional test template adapted to the target storage device according to storage attribute information of the target storage device to obtain a functional test file corresponding to the target storage device.
[0094] After obtaining the storage attribute information of the target storage device and the functional test template adapted to the target storage device, the functional test template adapted to the target storage device can be adjusted according to the storage attribute information of the target storage device to obtain the functional test file corresponding to the target storage device. It can be understood that the functional test template is a common test template for each storage device in the chip. For each storage device, the common test template needs to be adjusted based on the storage attribute information of each storage device to adjust it to a functional test file unique to each storage device, so as to test each storage device. Figure 5 As shown, the process of adjusting the functional test template adapted to the target storage device can be understood as a parameterization process. The functional test template adapted to the target storage device may include parameters of parameter values to be configured. Parameterization refers to using the storage attribute information of the target storage device directly or indirectly as the parameter value of the parameter in the functional test template adapted to the target storage device.
[0095] Specifically, the process of adjusting the functional test template adapted to the target storage device according to the storage attribute information of the target storage device to obtain a functional test file corresponding to the target storage device may include at least one of the following: the storage attribute information of the target storage device can be added as the parameter value of the parameter to the functional test template adapted to the target storage device to obtain the functional test file corresponding to the target storage device, which corresponds to the situation where the storage attribute information of the target storage device is directly used as the parameter value of the parameter in the functional test template adapted to the target storage device; according to the parameterization requirements of the functional test template corresponding to the target storage device, the storage attribute information of the target storage device is converted into information that meets the parameterization requirements, and then added as the parameter value of the parameter to the functional test template adapted to the target storage device to obtain the functional test file corresponding to the target storage device, which corresponds to the situation where the storage attribute information of the target storage device is indirectly used as the parameter value of the parameter in the functional test template adapted to the target storage device.
[0096] S303, obtaining a function code file of the target storage device, where the function code file of the target storage device is used to simulate the storage function of the target storage device.
[0097] The embodiment of the present application simulates the storage function of the storage device by writing the function code file of the storage device. The function code file of the storage device can be used to simulate the storage function of the storage device. Therefore, in order to test the storage function of the target storage device, it is necessary to obtain the function code file of the target storage device used to simulate the storage function of the target storage device. Specifically, the method for obtaining the function code file of the target storage device may include: obtaining a function configuration file, which may include the storage path of the function code file of each storage device in the chip, and obtaining the storage path of the function code file of the target storage device in the function configuration file, so that the function code file of the target storage device can be obtained according to the storage path of the function code file of the target storage device.
[0098] Optionally, the function configuration file may also include the storage path of the common library files that need to be called by the function code files of each storage device in the chip. The common library files that need to be called can be obtained according to the storage path of the common library files that need to be called. These common library files are required for the operation of the function code files of the storage devices.
[0099] S304: Test the storage function of the target storage device according to the function test file of the target storage device and the function code file of the target storage device.
[0100] After adjusting the function test template adapted to the target storage device according to the storage attribute information of the target storage device, obtaining the function test file corresponding to the target storage device, and obtaining the function test file of the target storage device, the storage function of the target storage device can be tested according to the function test file of the target storage device and the function code file of the target storage device. Further, the storage function of each storage device in the chip can be tested according to the process of testing the storage function of the target storage device introduced in the above steps S301 to S304.
[0101] In the embodiment of the present application, the functional test template adapted to the storage device can be adjusted according to the storage attribute information of the storage device in the chip to obtain the functional test file corresponding to the storage device, and then the storage function of the storage device can be tested according to the functional test file corresponding to the storage device; it is not difficult to see that the embodiment of the present application can automatically generate a functional test file for the storage device according to the storage attribute information of the storage device for testing, which can reduce the test complexity of the storage device in the chip and improve the test efficiency of the storage device in the chip. For a chip containing a large number of storage devices, the automated test of different storage devices in the chip (specifically, storage devices with different storage attribute information) can be completed at one time, thereby improving the test efficiency of the storage device in the chip.
[0102] The present application provides a storage device testing method, which involves a storage function testing process and storage function test results of the storage device. The storage device testing method is executed by a computer device, which may be, for example, Figure 2 The test system of the storage device shown is an integrated device of the test request device 201 and the test response device 202.
[0103] like Figure 6 As shown, the test method of the storage device may include but is not limited to the following steps S601 to S606:
[0104] S601, obtaining storage attribute information of a target storage device in a chip, and obtaining a functional test template adapted to the target storage device; the target storage device is used to store the operation data of the chip.
[0105] In the embodiment of the present application, the execution process of step S601 is the same as Figure 3 The execution process of step S301 in the embodiment shown is the same, and the execution process of step S601 can be specifically referred to in Figure 3 The specific description of step S301 in the illustrated embodiment will not be repeated here.
[0106] S602, adjusting the functional test template adapted to the target storage device according to the storage attribute information of the target storage device to obtain a functional test file corresponding to the target storage device, wherein the functional test file corresponding to the target storage device includes a test environment file and a test stimulus file.
[0107] In the embodiment of the present application, the execution process of step S602 is the same as Figure 3 The execution process of step S302 in the embodiment shown is the same, and the execution process of step S602 can be specifically referred to in Figure 3 The specific description of step S302 in the illustrated embodiment will not be repeated here.
[0108] exist Figure 3On the basis of step S302 in the illustrated embodiment, the functional test template adapted to the target storage device may include a test environment template and a test stimulus template; the functional test file of the target storage device may include a test environment file obtained by adjusting the test environment template according to the storage attribute information of the target storage device, and a test stimulus file obtained by adjusting the test stimulus template according to the storage attribute information of the target storage device. Wherein: the test stimulus file refers to the input signal of the function code file of the target storage device, and the test stimulus file can be used to simulate the storage scenario of the target storage device. For example, the test stimulus file requires the function code file of the target storage device to write the operation data to a storage address, and read the written operation data from the storage address after a period of time. The test environment file can be used to simulate the hardware environment that ensures that the target storage device can work normally. The simulated hardware environment here may include at least one of the following: a test stimulus hardware environment and a test result processing hardware environment; the test stimulus hardware environment can input the test stimulus file into the functional test file of the target storage device according to the timing required by the target storage device, and the test result processing hardware environment can be used to compare the test result output by the functional test file of the target storage device with the expected result.
[0109] In more detail, the storage function of the target storage device to be tested may be of one or more types, each type may correspond to its own test environment file and test stimulus file, and the storage function of the target storage device under each type may be tested according to the test environment file and test stimulus file corresponding to each type. For example, the types of storage functions of the target storage device to be tested may include at least one of the following: a storage function of a continuous storage address, a storage function of a random address, a storage function based on a backdoor function, a storage function of insertion error detection, and a storage function of a parity bit. Among them, testing the storage function of a continuous storage address may refer to testing the correctness of the storage function when the storage address is continuous; testing the storage function of a random address may refer to testing the correctness of the storage function when the storage address is random; testing the storage function based on a backdoor function may refer to testing the correctness of data reading and writing based on a backdoor function; testing the storage function of insertion error detection may refer to testing whether the error-written operation data can give error feedback; testing the storage function of a parity bit refers to testing whether the calculation of the parity bit during the data reading and writing process is correct.
[0110] S603, obtaining a function code file of the target storage device, where the function code file of the target storage device is used to simulate the storage function of the target storage device.
[0111] In the embodiment of the present application, the execution process of step S603 is the same as Figure 3The execution process of step S303 in the embodiment shown is the same, and the execution process of step S602 can be specifically referred to in Figure 3 The specific description of step S303 in the illustrated embodiment will not be repeated here.
[0112] S604, running the function code file of the target storage device under the hardware environment simulated by the test environment file.
[0113] According to the storage attribute information of the target storage device, the functional test template adapted to the target storage device is adjusted to obtain the functional test file corresponding to the target storage device. After obtaining the functional code file of the target storage device, the functional code file of the target storage device can be run in the hardware environment simulated by the test environment file.
[0114] As described above, the function code file of the target storage device needs to call a public library file, but the public library file cannot be called directly. It is necessary to configure the public library file that the function code file of the target storage device needs to call as a library file that is compatible with the target storage device before calling. Specifically, the function configuration file may include the storage path of the public library file that the function code file of each storage device in the chip needs to call, and the public library file that the function code file of the target storage device needs to call can be obtained according to the storage path of the public library file that the function code file of the target storage device needs to call. The public library file that the function code file of the target storage device needs to call can be configured as a library file that is compatible with the target storage device, so as to call the library file that is compatible with the target storage device during the operation of the function code file of the target storage device. In this way, there is no need to separately configure the public library file that the function code file of each storage device needs to call, but it is configured when the storage function of each storage device is tested. Compared with the method of separately configuring the public library file called by the function code file of each storage device, this on-demand configuration method can save the storage resources occupied by the configured public library file.
[0115] Furthermore, when the storage function of the target storage device to be tested may exist in one or more types, the storage function of the target storage device under each type may be tested respectively. For ease of understanding, the types of storage functions of the target storage device to be tested may be represented as N, that is, the storage function of the target storage device to be tested may include N types, any type of the N types may be represented as the i-th type, N is a positive integer, and i is a positive integer less than or equal to N; when testing the storage function of the target storage device under the i-th type, the function code file of the target storage device may be run under the hardware environment simulated by the test environment file corresponding to the i-th type of storage function.
[0116] S605, based on the hardware environment simulated by the test environment file, input the test stimulus file into the function code file of the target storage device to obtain the output test result.
[0117] After running the function code file of the target storage device in the hardware environment simulated by the test environment file, the test stimulus file can be input into the function code file of the target storage device based on the hardware environment simulated by the test environment file to obtain the output test result. Specifically, based on the test stimulus hardware environment simulated by the test environment file, the test stimulus file can be input into the function test file of the target storage device in accordance with the timing required by the target storage device to obtain the output test result.
[0118] Furthermore, when the storage function of the target storage device to be tested may be of one or more types, the storage function of the target storage device under each type may be tested respectively. For ease of understanding, the types of storage functions of the target storage device to be tested may be represented as N, that is, the storage function of the target storage device to be tested may include N types, and any type of the N types may be represented as the i-th type; when testing the storage function of the target storage device under the i-th type, the test stimulus file corresponding to the i-th type of storage function may be input into the function code file of the target storage device based on the hardware environment simulated by the test environment file corresponding to the i-th type of storage function, and the i-th type of test result may be output.
[0119] S606, analyzing the output test results from different dimensions to obtain storage function test results of the target storage device in different dimensions.
[0120] In the hardware environment simulated by the test environment file, the test stimulus file is input into the function code file of the target storage device, and after the output test results are obtained, the output test results can be analyzed from different dimensions to obtain the storage function test results of the target storage device in different dimensions. Specifically, the dimension can include at least one of the following: simulation dimension and waveform dimension. Among them:
[0121] The storage function test results of the target storage device under the simulation dimension (also referred to as simulation results) can be used to show the operation data written to the storage address (i.e., the expected result) and the operation data read from the storage address (i.e., the test result) after the test stimulus file is input into the function code file of the target storage device; if the operation data written to the storage address (i.e., the expected result) and the operation data read from the storage address (i.e., the test result) are consistent, it can be said that the storage function test of the target storage device has passed; if the operation data written to the storage address (i.e., the expected result) and the operation data read from the storage address (i.e., the test result) are inconsistent, it can be said that the storage function test of the target storage device has failed.
[0122] Furthermore, when the storage functions of the target storage device to be tested include N types, the simulation results of the target storage device under each type can be analyzed. If the storage functions of the target storage device under each type are tested and passed, it can be considered that the storage function test of the target storage device has passed. If the storage function test of the target storage device under a certain type fails, it can be considered that the storage function test of the target storage device has failed. Figure 7 The storage function test result under the simulation dimension after testing the storage function of the continuous storage address of the target storage device is shown. "boundary_rw" represents the storage function of the continuous storage address of the target storage device, and one piece of data represents a data read and write. For example, in the data "ram compare pass 478750000: addr=00, rm_data=operation data 1, dut_data=operation data 2", "478750000" and the like represent the test time, "ram compare pass" represents that the storage function test of the corresponding type has passed, "addr=00" represents that the storage address is 00, "rm_data=operation data 1" represents that the operation data written is operation data 1, and "dut_data=operation data 1" represents that the operation data read is operation data 1; it can be seen that Figure 7 The storage addresses are continuous. Figure 8 The storage function test results of the random storage address of the target storage device are shown in the simulation dimension. "memory_rw_random" represents the storage function of the random storage address of the target storage device. The content of each data is Figure 7 Similarly, it can be seen that Figure 8 In other words, the storage function test results of the target storage device under the simulation dimension can intuitively show the tester which type of storage function of the target storage device has problems, at which test time and at which address the operation data written is inconsistent with the operation data read.
[0123] The storage function test result of the target storage device in the waveform dimension (also referred to as the waveform result) can be used to show the detailed data of the storage address in the target storage device read and written in each clock cycle after the test stimulus file is input into the function code file of the target storage device. Fig. 9 The storage function test results under the waveform dimension shown in the figure, "Clk" indicates that the operation data is written or read to the storage address in the target storage device in each clock cycle; "We_n_a" indicates whether the operation data is written to the storage address; "Addr_a" indicates the specific storage address written; "Din_a" indicates the specific operation data written; "Rd_n_b" indicates whether the operation data is read from the storage address; "Addr_b" indicates the specific storage address of the read operation data; "Dout_b" indicates the specific operation data read. It can be seen that the storage function test results under the waveform dimension record the detailed content of the read and write data. If the test fails, the storage function test results under the waveform dimension can be used for rapid debugging.
[0124] The above storage function test results are the storage function test results of any storage device in the chip. In addition, the embodiment of the present application can also perform regression analysis on the storage function test results of each storage device in the chip to obtain regression analysis test results (also referred to as regression results). The regression analysis can be used to analyze the number of storage devices tested in the chip, the number of storage devices that passed the storage function test, the number of storage devices that failed the storage function test, and the test pass rate of the storage devices in the chip. Fig.10 As shown, "TOTAL" indicates the total number of storage devices tested in the chip, which is 370; "PASS" indicates the number of storage devices that passed the storage function test, which is 365; "ERROR" indicates the number of storage devices that failed the storage function test, which is 5; "EXECUTED PASSING RATE" indicates the test pass rate of the storage devices in the chip, which is 98.64%. The regression analysis test results can also show the storage devices that passed the storage function test and the storage devices that failed the storage function test. It can be seen that the tester can view the overall test situation and the overall test pass rate of each storage device in the chip through the regression analysis results.
[0125] In addition to displaying the storage function test results, the embodiment of the present application can also display the compilation results of the function code files of each storage device. Taking the target storage device as an example, the compilation results of the target storage device can clearly display all the compilation macros and called library files. If there is a compilation error, it can also accurately display the file and specific line number to which the error belongs. In other words, the tester can view the compilation status of the function code files of each storage device through the compilation results, so as to timely discover the error and make timely adjustments when the compilation error occurs.
[0126] In the embodiment of the present application, the functional test template adapted to the storage device can be adjusted according to the storage attribute information of the storage device in the chip to obtain the functional test file corresponding to the storage device, and then the storage function of the storage device can be tested according to the functional test file corresponding to the storage device; it is not difficult to see that the embodiment of the present application can automatically generate a functional test file for the storage device according to the storage attribute information of the storage device for testing, which can reduce the test complexity of the storage device in the chip and improve the test efficiency of the storage device in the chip. For a chip containing a large number of storage devices, the automated batch test of different storage devices in the chip (specifically, storage devices with different storage attribute information) can be completed at one time, which can not only improve the test efficiency of the storage device in the chip, but also, the errors found during the test process can be modified at one time, avoiding the repeated discovery of the same error when manually testing the storage device in the chip. In addition, the embodiment of the present application can output diversified and different dimensional storage function test results (for example, simulation results, waveform results, compilation results and regression results) to the tester, which is conducive to helping the tester to analyze and understand more comprehensively, and can quickly perform test debugging when a test error occurs, thereby improving the overall test effect.
[0127] based on Figure 3-Figure 10 The test method of the storage device described below is combined with Fig.11 , introduces the test example of the storage device in the chip.
[0128] like Fig.11As shown, the tester can input the attribute configuration file (tb.f), the function configuration file (memory_wrapper.f) and the test execution script file (run_test.py) through the test client. Among them, the attribute configuration file may include the storage path of the function code file of each storage device in the chip, and the storage path of the function code file of each storage device may include the file name of the function code file of each storage device, and the file name of the function code file of each storage device may be named according to the storage attribute information of each storage device. The function configuration file may include the storage path of the function code file of each storage device in the chip, and the storage path of the common library file that the function code file of each storage device in the chip needs to call.
[0129] For each storage device in the chip, the test response device (i.e., the background of the test client) can read the storage attribute information of the storage device from the attribute configuration file; the test response device (i.e., the background of the test client) can obtain the storage path of the function code file of the storage device and the storage path of the public library file that the function code file of the storage device needs to call from the function configuration file, and then, the function code file of the storage device and the public library file that the function code file of the storage device needs to call can be obtained from the corresponding storage path.
[0130] The test response device (i.e., the background of the test client) can adjust the functional test template adapted to the storage device according to the storage attribute information of the storage device by executing the test execution script file, and obtain the functional test file (including the test environment file and the test stimulus file) corresponding to the storage device; the test response device can also configure the public library file to be called by the function code file of the storage device as a library file adapted to the storage device by executing the test execution script file, so as to facilitate the calling of the function code file of the storage device at runtime; then, the test response device can test the storage function of the storage device based on the function test file of the storage device and the function code file of the storage device.
[0131] The test client can output storage function test results of different dimensions to the tester, such as simulation results, waveform results, regression results, and compilation results.
[0132] It should be noted that in Fig.11 In the test instance shown, the attribute configuration file input by the tester can be replaced by an attribute mapping table, which can associate the file names and storage attribute information of each storage device in the chip. The test response device (i.e., the background of the test client) can obtain the storage attribute information of the storage device from the attribute configuration file, and can also obtain the storage attribute information of the storage device from the attribute mapping table.
[0133] The method of the embodiment of the present application is described in detail above. In order to facilitate better implementation of the above scheme of the embodiment of the present application, the device of the embodiment of the present application is provided below accordingly.
[0134] See also Fig.12 , Fig.12 is a schematic diagram of a storage device test device provided in an embodiment of the present application. The storage device test device may be provided in a computer device provided in an embodiment of the present application. The computer device may be, for example, Figure 2 The test response device in the test system of the storage device shown, or it may be Figure 2 The test request device and the test response device in the test system of the storage device are integrated. Fig.12 The storage device test device shown may be a computer program (including program code) running in a computer device, and the storage device test device may be used to execute Figure 3 or Figure 6 Some or all of the steps in the method embodiment shown. Fig.12 , the storage device testing device may include the following units:
[0135] The acquisition unit 1201 is used to acquire storage attribute information of a target storage device in the chip and to acquire a functional test template adapted to the target storage device; the target storage device is used to store the operation data of the chip;
[0136] The processing unit 1202 is used to adjust the function test template adapted to the target storage device according to the storage attribute information of the target storage device to obtain a function test file corresponding to the target storage device;
[0137] The acquisition unit 1201 is further used to acquire a function code file of a target storage device, where the function code file of the target storage device is used to simulate a storage function of the target storage device;
[0138] The processing unit 1202 is further configured to test the storage function of the target storage device according to the function test file of the target storage device and the function code file of the target storage device.
[0139] In one implementation, the functional test template includes a test environment template and a test stimulus template; the functional test file of the target storage device includes a test environment file obtained by adjusting the test environment template according to storage attribute information of the target storage device, and a test stimulus file obtained by adjusting the test stimulus template according to storage attribute information of the target storage device;
[0140] Among them, the test environment file is used to simulate the hardware environment to ensure the normal operation of the target storage device, the test stimulus file refers to the input signal of the function code file of the target storage device, and the test stimulus file is used to simulate the storage scenario of the target storage device.
[0141] In one implementation, the processing unit 1202 is used to perform the following steps when testing the storage function of the target storage device according to the function test file of the target storage device and the function code file of the target storage device:
[0142] Running the function code file of the target storage device in the hardware environment simulated by the test environment file;
[0143] Based on the hardware environment simulated by the test environment file, the test stimulus file is input into the function code file of the target storage device to obtain the output test result;
[0144] The output test results are analyzed from different dimensions to obtain storage function test results of the target storage device in different dimensions.
[0145] In one implementation, the storage function of the target storage device to be tested includes N types, each type corresponds to a respective test environment file and a test stimulus file, any type of the N types is represented as an i-th type, N is a positive integer, and i is a positive integer less than or equal to N;
[0146] The processing unit 1202 is used to execute the following steps when running the function code file of the target storage device under the hardware environment simulated by the test environment file: running the function code file of the target storage device under the hardware environment simulated by the test environment file corresponding to the i-th type of storage function;
[0147] Processing unit 1202 is used to input the test stimulus file into the function code file of the target storage device based on the hardware environment simulated by the test environment file to obtain the output test result, including: based on the hardware environment simulated by the test environment file corresponding to the i-th type of storage function, input the test stimulus file corresponding to the i-th type of storage function into the function code file of the target storage device to obtain the output test result of the i-th type.
[0148] In one implementation, the storage attribute information of the target storage device includes interface information, and the interface information is used to indicate the number of interfaces that the target storage device is allowed to use when reading and writing operation data; the acquisition unit 1201 is used to acquire a functional test template adapted to the target storage device, and is specifically used to perform the following steps:
[0149] According to the number of interfaces indicated by the interface information, a function test template corresponding to the number of interfaces indicated by the interface information is obtained from a function test template library; the function test template library includes different function test templates corresponding to different numbers of interfaces;
[0150] The function test template corresponding to the number of interfaces indicated by the interface information is determined as the function test template adapted to the target storage device.
[0151] In one implementation, the functional test template adapted to the target storage device includes parameters of parameter values to be configured; the processing unit 1202 is used to adjust the functional test template adapted to the target storage device according to the storage attribute information of the target storage device, and when obtaining the functional test file corresponding to the target storage device, specifically to perform at least one of the following:
[0152] The storage attribute information of the target storage device is used as the parameter value of the parameter, and is added to the functional test template adapted to the target storage device to obtain a functional test file corresponding to the target storage device;
[0153] According to the parameterization requirements of the functional test template corresponding to the target storage device, the storage attribute information of the target storage device is converted into information that meets the parameterization requirements, and then added as the parameter value of the parameter to the functional test template adapted to the target storage device to obtain the functional test file corresponding to the target storage device.
[0154] In one implementation, the chip includes one or more storage devices, and the target storage device is any storage device in the chip; the acquisition unit 1201 is used to acquire storage attribute information of the target storage device in the chip, specifically to perform the following steps:
[0155] Obtaining an attribute configuration file; the attribute configuration file includes a storage path of a function code file of each storage device in the chip, the storage path of the function code file of each storage device includes a file name of the function code file of each storage device, and the file name of the function code file of each storage device is named according to the storage attribute information of each storage device;
[0156] The storage attribute information of the target storage device is read from the storage path of the function code file of the target storage device in the attribute configuration file.
[0157] In one implementation, the chip includes one or more storage devices, and the target storage device is any storage device in the chip; the acquisition unit 1201 is used to acquire storage attribute information of the target storage device in the chip, specifically to perform the following steps:
[0158] Acquire an attribute mapping table; the attribute mapping table associates and stores the file names of the function code files of each storage device in the chip with the storage attribute information;
[0159] In the attribute mapping table, storage attribute information stored in association with the file name of the function code file of the target storage device is obtained, and the storage attribute information stored in association with the file name of the function code file of the target storage device is determined as the storage attribute information of the target storage device.
[0160] In one implementation, the acquiring unit 1201 is further configured to perform the following steps:
[0161] Obtaining a public library file required to be called by a function code file of a target storage device;
[0162] The processing unit 1202 is further configured to perform the following steps:
[0163] The public library file to be called by the function code file of the target storage device is configured as a library file adapted to the target storage device, so that the library file adapted to the target storage device is called during the operation of the function code file of the target storage device.
[0164] In one implementation, the storage attribute information of the target storage device includes at least one of the following: interface information, data storage capability information, parity bit information, bit enable information, and data read delay information.
[0165] According to another embodiment of the present application, Fig.12 The various units in the test device of the storage device shown can be separately or all combined into one or several other units to constitute, or one (some) of the units can also be split into multiple smaller units in function to constitute, which can achieve the same operation without affecting the realization of the technical effects of the embodiments of the present application. The above-mentioned units are divided based on logical functions. In practical applications, the function of one unit can also be realized by multiple units, or the functions of multiple units can be realized by one unit. In other embodiments of the present application, the test device of the storage device may also include other units. In practical applications, these functions can also be implemented with the assistance of other units, and can be implemented by the collaboration of multiple units.
[0166] According to another embodiment of the present application, the program can be executed by running on a general computing device such as a computer including a central processing unit (CPU), a random access memory medium (RAM), a read-only memory medium (ROM), and other processing elements and storage elements. Figure 3 or Figure 6 A computer program (including program code) for each step involved in part or all of the method shown in the figure is used to construct a computer program (including program code) for each step involved in part or all of the method shown in the figure. Fig.12The computer program may be recorded on a computer-readable storage medium, loaded into the computing device through the computer-readable storage medium, and run therein.
[0167] In the embodiment of the present application, a functional test template adapted to the storage device can be adjusted according to the storage attribute information of the storage device in the chip to obtain a functional test file corresponding to the storage device. Then, the storage function of the storage device can be tested according to the functional test file corresponding to the storage device. It is not difficult to see that the embodiment of the present application can automatically generate a functional test file for the storage device for testing according to the storage attribute information of the storage device, which can reduce the testing complexity of the storage device in the chip and improve the testing efficiency of the storage device in the chip.
[0168] Based on the above method and device embodiments, the present application embodiment provides a computer device. Fig.13 , Fig.13 It is a structural diagram of a computer device provided in an embodiment of the present application. Fig.13 The computer device shown includes at least a processor 1301, an input interface 1302, an output interface 1303, and a computer-readable storage medium 1304. The processor 1301, the input interface 1302, the output interface 1303, and the computer-readable storage medium 1304 may be connected via a bus or other means.
[0169] The computer-readable storage medium 1304 may be stored in a memory of a computer device. The computer-readable storage medium 1304 is used to store a computer program. The computer program includes computer instructions. The processor 1301 is used to execute the program instructions stored in the computer-readable storage medium 1304. The processor 1301 (or CPU (Central Processing Unit)) is the computing core and control core of the computer device, which is suitable for implementing one or more computer instructions, and is specifically suitable for loading and executing one or more computer instructions to implement a corresponding method flow or a corresponding function.
[0170] The embodiment of the present application also provides a computer-readable storage medium (Memory), which is a memory device in a computer device for storing programs and data. It is understandable that the computer-readable storage medium here can include both built-in storage media in the computer device and, of course, extended storage media supported by the computer device. The computer-readable storage medium provides a storage space that stores the operating system of the computer device. In addition, one or more computer instructions suitable for being loaded and executed by the processor are also stored in the storage space. These computer instructions can be one or more computer programs (including program codes). It should be noted that the computer-readable storage medium here can be a high-speed RAM memory, or a non-volatile memory (Non-VolatileMemory), such as at least one disk storage; optionally, it can also be at least one computer-readable storage medium located away from the aforementioned processor.
[0171] The computer device may be, for example, Figure 2 The test response device in the test system of the storage device shown, or it may be Figure 2 The integrated device of the test request device and the test response device in the test system of the storage device shown in the figure. The processor 1301 can load and execute one or more computer instructions stored in the computer readable storage medium 1304 to implement the above-mentioned Figure 3 or Figure 6 In a specific implementation, the computer instructions in the computer-readable storage medium 1304 are loaded by the processor 1301 and execute the following steps:
[0172] Acquire storage attribute information of a target storage device in a chip, and acquire a functional test template adapted to the target storage device; the target storage device is used to store operation data of the chip;
[0173] According to the storage attribute information of the target storage device, a functional test template adapted to the target storage device is adjusted to obtain a functional test file corresponding to the target storage device;
[0174] Acquire a function code file of a target storage device, where the function code file of the target storage device is used to simulate a storage function of the target storage device;
[0175] The storage function of the target storage device is tested according to the function test file of the target storage device and the function code file of the target storage device.
[0176] In one implementation, the functional test template includes a test environment template and a test stimulus template; the functional test file of the target storage device includes a test environment file obtained by adjusting the test environment template according to storage attribute information of the target storage device, and a test stimulus file obtained by adjusting the test stimulus template according to storage attribute information of the target storage device;
[0177] Among them, the test environment file is used to simulate the hardware environment to ensure the normal operation of the target storage device, the test stimulus file refers to the input signal of the function code file of the target storage device, and the test stimulus file is used to simulate the storage scenario of the target storage device.
[0178] In one implementation, the computer instructions in the computer-readable storage medium 1304 are loaded and executed by the processor 1301 to test the storage function of the target storage device according to the function test file of the target storage device and the function code file of the target storage device, and are specifically used to perform the following steps:
[0179] Running the function code file of the target storage device in the hardware environment simulated by the test environment file;
[0180] Based on the hardware environment simulated by the test environment file, the test stimulus file is input into the function code file of the target storage device to obtain the output test result;
[0181] The output test results are analyzed from different dimensions to obtain storage function test results of the target storage device in different dimensions.
[0182] In one implementation, the storage function of the target storage device to be tested includes N types, each type corresponds to a respective test environment file and a test stimulus file, any type of the N types is represented as an i-th type, N is a positive integer, and i is a positive integer less than or equal to N;
[0183] The computer instructions in the computer-readable storage medium 1304 are loaded and executed by the processor 1301. When the function code file of the target storage device is run under the hardware environment simulated by the test environment file, the computer instructions are specifically used to perform the following steps: run the function code file of the target storage device under the hardware environment simulated by the test environment file corresponding to the i-th type of storage function;
[0184] The computer instructions in the computer-readable storage medium 1304 are loaded and executed by the processor 1301 based on the hardware environment simulated by the test environment file, and the test stimulus file is input into the function code file of the target storage device to obtain the output test results, including: based on the hardware environment simulated by the test environment file corresponding to the i-th type of storage function, the test stimulus file corresponding to the i-th type of storage function is input into the function code file of the target storage device to obtain the output test result of the i-th type.
[0185] In one implementation, the storage attribute information of the target storage device includes interface information, and the interface information is used to indicate the number of interfaces that the target storage device is allowed to use when reading and writing operation data; when the computer instructions in the computer-readable storage medium 1304 are loaded and executed by the processor 1301 to obtain a functional test template adapted to the target storage device, they are specifically used to perform the following steps:
[0186] According to the number of interfaces indicated by the interface information, a function test template corresponding to the number of interfaces indicated by the interface information is obtained from a function test template library; the function test template library includes different function test templates corresponding to different numbers of interfaces;
[0187] The function test template corresponding to the number of interfaces indicated by the interface information is determined as the function test template adapted to the target storage device.
[0188] In one implementation, the functional test template adapted to the target storage device includes parameters of parameter values to be configured; the computer instructions in the computer-readable storage medium 1304 are loaded and executed by the processor 1301 to adjust the functional test template adapted to the target storage device according to the storage attribute information of the target storage device, and obtain the functional test file corresponding to the target storage device, which is specifically used to perform at least one of the following:
[0189] The storage attribute information of the target storage device is used as the parameter value of the parameter, and is added to the functional test template adapted to the target storage device to obtain a functional test file corresponding to the target storage device;
[0190] According to the parameterization requirements of the functional test template corresponding to the target storage device, the storage attribute information of the target storage device is converted into information that meets the parameterization requirements, and then added as the parameter value of the parameter to the functional test template adapted to the target storage device to obtain the functional test file corresponding to the target storage device.
[0191] In one implementation, the chip includes one or more storage devices, and the target storage device is any storage device in the chip; when the computer instructions in the computer-readable storage medium 1304 are loaded and executed by the processor 1301 to obtain the storage attribute information of the target storage device in the chip, they are specifically used to perform the following steps:
[0192] Obtaining an attribute configuration file; the attribute configuration file includes a storage path of a function code file of each storage device in the chip, the storage path of the function code file of each storage device includes a file name of the function code file of each storage device, and the file name of the function code file of each storage device is named according to the storage attribute information of each storage device;
[0193] The storage attribute information of the target storage device is read from the storage path of the function code file of the target storage device in the attribute configuration file.
[0194] In one implementation, the chip includes one or more storage devices, and the target storage device is any storage device in the chip; when the computer instructions in the computer-readable storage medium 1304 are loaded and executed by the processor 1301 to obtain the storage attribute information of the target storage device in the chip, they are specifically used to perform the following steps:
[0195] Acquire an attribute mapping table; the attribute mapping table associates and stores the file names of the function code files of each storage device in the chip with the storage attribute information;
[0196] In the attribute mapping table, storage attribute information stored in association with the file name of the function code file of the target storage device is obtained, and the storage attribute information stored in association with the file name of the function code file of the target storage device is determined as the storage attribute information of the target storage device.
[0197] In one implementation, the computer instructions in the computer readable storage medium 1304 are loaded by the processor 1301 and are further used to perform the following steps:
[0198] Obtaining a public library file required to be called by a function code file of a target storage device;
[0199] The public library file to be called by the function code file of the target storage device is configured as a library file adapted to the target storage device, so that the library file adapted to the target storage device is called during the operation of the function code file of the target storage device.
[0200] In one implementation, the storage attribute information of the target storage device includes at least one of the following: interface information, data storage capability information, parity bit information, bit enable information, and data read delay information.
[0201] In the embodiment of the present application, a functional test template adapted to the storage device can be adjusted according to the storage attribute information of the storage device in the chip to obtain a functional test file corresponding to the storage device. Then, the storage function of the storage device can be tested according to the functional test file corresponding to the storage device. It is not difficult to see that the embodiment of the present application can automatically generate a functional test file for the storage device for testing according to the storage attribute information of the storage device, which can reduce the testing complexity of the storage device in the chip and improve the testing efficiency of the storage device in the chip.
[0202] According to one aspect of the present application, a computer program product or a computer program is provided, the computer program product or the computer program comprising computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the storage device test method provided in the above-mentioned various optional manners.
[0203] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method for testing a storage device, characterized in that: include: Acquire storage attribute information of a target storage device in a chip, and acquire a functional test template adapted to the target storage device; The target storage device is used to store the operation data of the chip; According to the storage attribute information of the target storage device, a functional test template adapted to the target storage device is adjusted to obtain a functional test file corresponding to the target storage device; Acquire a function code file of the target storage device, where the function code file of the target storage device is used to simulate a storage function of the target storage device; The storage function of the target storage device is tested according to the function test file of the target storage device and the function code file of the target storage device.
2. The method according to claim 1, characterized in that The functional test template includes a test environment template and a test stimulus template; the functional test file of the target storage device includes a test environment file obtained by adjusting the test environment template according to the storage attribute information of the target storage device, and a test stimulus file obtained by adjusting the test stimulus template according to the storage attribute information of the target storage device; Among them, the test environment file is used to simulate the hardware environment to ensure the normal operation of the target storage device, the test stimulus file refers to the input signal of the function code file of the target storage device, and the test stimulus file is used to simulate the storage scenario of the target storage device.
3. The method according to claim 2, characterized in that The step of testing the storage function of the target storage device according to the function test file of the target storage device and the function code file of the target storage device comprises: Running the function code file of the target storage device under the hardware environment simulated by the test environment file; Based on the hardware environment simulated by the test environment file, the test stimulus file is input into the function code file of the target storage device to obtain an output test result; The output test results are analyzed from different dimensions to obtain storage function test results of the target storage device in different dimensions.
4. The method according to claim 3, characterized in that The storage function of the target storage device to be tested includes N types, each type corresponds to a respective test environment file and a test stimulus file, any type of the N types is represented as the i-th type, N is a positive integer, and i is a positive integer less than or equal to N; The step of running the function code file of the target storage device under the hardware environment simulated by the test environment file comprises: running the function code file of the target storage device under the hardware environment simulated by the test environment file corresponding to the i-th type of storage function; The hardware environment simulated based on the test environment file, the test stimulus file is input into the function code file of the target storage device, and the output test result is obtained, including: based on the hardware environment simulated by the test environment file corresponding to the i-th type of storage function, the test stimulus file corresponding to the i-th type of storage function is input into the function code file of the target storage device, and the output test result of the i-th type is obtained.
5. The method according to claim 1, characterized in that The storage attribute information of the target storage device includes interface information, and the interface information is used to indicate the number of interfaces that the target storage device is allowed to use when reading and writing the operation data; The obtaining of a functional test template adapted to the target storage device includes: According to the number of interfaces indicated by the interface information, obtaining a functional test template corresponding to the number of interfaces indicated by the interface information in a functional test template library; the functional test template library includes different functional test templates corresponding to different numbers of interfaces; The functional test template corresponding to the number of interfaces indicated by the interface information is used to determine a functional test template that is compatible with the target storage device.
6. The method according to claim 1, characterized in that The functional test template adapted to the target storage device includes parameters of parameter values to be configured; the functional test template adapted to the target storage device is adjusted according to the storage attribute information of the target storage device to obtain a functional test file corresponding to the target storage device, including at least one of the following: Using the storage attribute information of the target storage device as the parameter value of the parameter, adding it to a functional test template adapted to the target storage device, to obtain a functional test file corresponding to the target storage device; According to the parameterization requirements of the functional test template corresponding to the target storage device, the storage attribute information of the target storage device is converted into information that meets the parameterization requirements, and then added as the parameter value of the parameter to the functional test template adapted to the target storage device to obtain the functional test file corresponding to the target storage device.
7. The method according to claim 1, characterized in that The chip includes one or more storage devices, and the target storage device is any storage device in the chip; and obtaining storage attribute information of the target storage device in the chip includes: Obtaining an attribute configuration file; the attribute configuration file includes a storage path of a function code file of each storage device in the chip, the storage path of the function code file of each storage device includes a file name of the function code file of each storage device, and the file name of the function code file of each storage device is named according to storage attribute information of each storage device; The storage attribute information of the target storage device is read from the storage path of the function code file of the target storage device in the attribute configuration file.
8. The method according to claim 1, characterized in that The chip includes one or more storage devices, and the target storage device is any storage device in the chip; and obtaining storage attribute information of the target storage device in the chip includes: Acquire an attribute mapping table; the attribute mapping table stores the file names of the function code files of each storage device in the chip in association with the storage attribute information; In the attribute mapping table, storage attribute information stored in association with the file name of the function code file of the target storage device is obtained, and the storage attribute information stored in association with the file name of the function code file of the target storage device is determined as the storage attribute information of the target storage device.
9. The method according to claim 1, characterized in that The method further comprises: Acquire a public library file to be called by a function code file of the target storage device; The public library file to be called by the function code file of the target storage device is configured as a library file adapted to the target storage device, so as to call the library file adapted to the target storage device during the operation of the function code file of the target storage device.
10. The method according to any one of claims 1 to 9, characterized in that: The storage attribute information of the target storage device includes at least one of the following: interface information, data storage capability information, parity bit information, bit enable information, and data read delay information.
11. A storage device testing device, characterized in that: include: An acquisition unit, used to acquire storage attribute information of a target storage device in the chip, and to acquire a functional test template adapted to the target storage device; The target storage device is used to store the operation data of the chip; A processing unit, configured to adjust a functional test template adapted to the target storage device according to storage attribute information of the target storage device, and obtain a functional test file corresponding to the target storage device; The acquisition unit is further used to acquire a function code file of the target storage device, where the function code file of the target storage device is used to simulate the storage function of the target storage device; The processing unit is further used to test the storage function of the target storage device according to the function test file of the target storage device and the function code file of the target storage device.
12. A computer device, characterized in that: The computer device comprises: a processor suitable for implementing a computer program; A computer-readable storage medium storing a computer program, wherein the computer-readable storage medium stores a computer program, wherein the computer program is suitable for being loaded by the processor and executing the storage device testing method according to any one of claims 1 to 10.
13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is suitable for being loaded by a processor and executing the storage device testing method according to any one of claims 1 to 10.
14. A computer program product, characterized in that The computer program product comprises computer instructions, and when the computer instructions are executed by a processor, the method for testing the storage device according to any one of claims 1 to 10 is implemented.