Storage test device and test method
By simulating the call stack of the storage device, recording and reproducing the program file call relationship during firmware runtime, the problem of difficulty in locating the cause of the fault when the firmware runs in the storage device is running errors, and efficient and accurate fault location and debugging are achieved.
Patent Information
- Application Number
- CN202510026064.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-08
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2045-01-08
AI Technical Summary
When a storage device's firmware runs error, it is difficult to efficiently and accurately locate the real location and cause of the error, and repeated debugging is time-consuming and labor-intensive.
Provides a storage test device and a test method. By simulating the call stack of the storage device, using the on-site sample retention module, pile driving module and call association module, record and reproduce the program file call relationship during firmware runtime, and establish a call stack network to locate the cause of failure.
It realizes efficient and accurate identification of the causes of firmware failure of storage devices without affecting the site, reducing debugging time and resource consumption, and improving storage performance.
Smart Images

Figure CN119446237B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of storage testing, and in particular to a storage testing device and a testing method. Background Art
[0002] Firmware is a program written into an Erasable Programmable Read-Only Memory (EPROM) or an Electrically Erasable Programmable Read-Only Memory (EEPROM). By testing the firmware, you can implement various functions in the storage system, such as reading and writing, garbage collection, and data backup and reconstruction. The storage firmware corresponding to various functions is different. Even the storage firmware used by different storage systems with the same function is different. And with the update of the firmware, the complexity and unknown nature of the firmware of the storage system will also increase. Therefore, when processing the read and write process and various complex processes, when the firmware of the storage device runs wrong, it is difficult to locate the real location and cause of the error, and repeated debugging is also time-consuming and laborious. For storage performance considerations, the log files in the storage device are complex, which not only drags down the storage performance of the storage device, but also takes time and effort to locate the cause of the error based on the complex log files, and it is difficult to accurately determine the cause of the error. Summary of the invention
[0003] The object of the present invention is to provide a storage testing device and a testing method, which can simulate the call stack of the storage device and find out the cause of the firmware failure of the storage device efficiently, accurately and with low resource occupation without affecting the site.
[0004] In order to solve the above technical problems, the present invention is achieved through the following technical solutions:
[0005] The present invention provides a storage test device, including a test machine, and the test machine includes:
[0006] An on-site sample retention module, when an error occurs in the operation of the storage firmware, the on-site sample retention module terminates the operation process of the storage firmware, wherein the program file called when the on-site sample retention module is started is a primary program file;
[0007] a piling module, which starts and records information of a currently called program file when the first-level program file and the superior associated program of the first-level program are run, wherein the currently called program file is a second-level program file, and information of a plurality of the second-level program files is stored in the form of a circular array, wherein when the storage firmware is rerun, when the second-level program file and the superior associated file of the second-level program file are run, the piling module is started and a new second-level program file is obtained; and
[0008] A call association module is provided, wherein the call association module establishes and outputs a call stack network, wherein the call stack network includes all the secondary program files and the call relationships between the plurality of secondary program files.
[0009] In one embodiment of the present invention, the storage test device includes a host, the host is electrically connected to a tester, wherein the host includes:
[0010] a firmware input module, the firmware input module inputs the storage firmware, the on-site sample firmware and the pile driving firmware into the test machine; and
[0011] The file query module is electrically connected to the test machine, and the file query module outputs the program file association network of the storage firmware, wherein the program file association network includes the upper-level association file of the first-level program file and the upper-level association file of the second-level program file.
[0012] In one embodiment of the present invention, in the circular array, a single data includes the serial number of the program file and the row number of the program file in the storage firmware.
[0013] In an embodiment of the present invention, in the circular array, the information of the secondary program files is arranged in sequence according to the time when they were written into the circular array.
[0014] In one embodiment of the present invention, the circular array has an upper limit value for the number of data. When the number of data in the circular array reaches the upper limit value for the number of data, the information of the oldest secondary program file is overwritten by the information of the latest secondary program file.
[0015] In one embodiment of the present invention, the testing machine includes a cache module, and the storage data types in the cache module include the call stack network, the file name dictionary table and the circular array, wherein the file name dictionary table stores the mapping relationship between the name of the program file and the number of the program file, and the number of mapping relationships in the file name dictionary table is greater than or equal to the upper limit value of the number of data in the circular array.
[0016] In one embodiment of the present invention, the piling module includes a dictionary maintenance unit. When the piling module is started, if the file name of the secondary program file is not recorded in the file name dictionary table, the dictionary maintenance unit adds a file number to the secondary program file and outputs the mapping relationship between the file of the secondary program file and the file number to the file name dictionary table.
[0017] In one embodiment of the present invention, the file number added by the dictionary maintenance unit is any unused file number or the file number that is most recently covered in the circular array.
[0018] In one embodiment of the present invention, the test machine includes a flash memory chip, and the types of storage data in the flash memory chip include storage data from the cache module, program files of multiple firmware, and status information of the storage firmware.
[0019] The present invention provides a storage test method, comprising the following steps:
[0020] Get storage firmware;
[0021] Setting a field sample retention firmware, and writing the field sample retention firmware into the storage firmware;
[0022] Running the storage firmware, and setting the program file called when triggering the on-site sample retention firmware as a first-level program file;
[0023] Setting a pile driving firmware, and writing the pile driving firmware into the storage firmware, querying the superior associated file of the first-level program file, and setting the first-level program file and the superior associated file of the first-level program file as the calling point of the pile driving firmware;
[0024] Re-run the storage firmware, and when running to the piling firmware, record the program file information currently called, and set the currently called program file as a secondary program file;
[0025] Setting the secondary program file and the upper-level associated file of the secondary program file as the calling point of the piling firmware; and
[0026] The secondary program files are acquired cyclically, and a call stack network of the storage firmware is established according to the calling relationship of the plurality of secondary program files.
[0027] As described above, the present invention provides a storage test device and a test method, which can retain the on-site situation of the firmware error when a problem occurs in the operation of the storage firmware, and automatically restore the program file call stack before the firmware error, providing conditions for R&D personnel to study the occurrence of errors and solve problems. In addition, the storage test device and the test method provided by the present invention have high test efficiency, can be separated from complex log files, and find the cause of the firmware failure of the storage device with relatively small storage resources, and the solution of the present invention has little impact on the performance of the storage device, and has the ability of the product to automatically complete fault detection.
[0028] Of course, any product implementing the present invention does not necessarily need to achieve all of the advantages described above at the same time. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for describing the embodiments are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0030] Figure 1 It is a schematic diagram of the structure of a storage test device in one embodiment of the present invention.
[0031] Figure 2 Schematic diagram of the structure of a host in one embodiment of the present invention.
[0032] Figure 3 Schematic diagram of the association of program files in one embodiment of the present invention.
[0033] Figure 4 Schematic diagram of the structure of a main controller in one embodiment of the present invention.
[0034] Figure 5 It is a structural schematic diagram of an on-site sample retention module in one embodiment of the present invention.
[0035] Figure 6 It is a structural schematic diagram of a pile driving module in one embodiment of the present invention.
[0036] Figure 7 The present invention is a flow chart of a storage test method in one embodiment of the present invention.
[0037] In the figure: 100, storage test equipment; 200, host; 210, firmware entry module; 220, file query module; 300, test machine; 400, debugging machine; 500, main controller; 510, clock module; 520, on-site sample retention module; 521, condition judgment unit; 522, termination unit; 523, continue running unit; 530, pile driving module; 531, dictionary maintenance unit; 532, array update unit; 540, call association module; 550, cache module; 600, flash memory chip. DETAILED DESCRIPTION
[0038] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0039] The storage test device 100 provided by the present invention is used to test the test firmware of the storage device. The storage device uses NAND flash memory as the storage medium. In this embodiment, the storage device is set as a test machine. The test machine may be an embedded Multi Media Card (eMMC) or a universal flash memory (Universal Flash Storage, UFS), and the test machine may be a digital device loaded with an embedded memory or a universal flash memory. The test machine has storage firmware. The present invention does not limit the source of the storage firmware, nor does it limit the storage location of the storage firmware. In this embodiment, the storage firmware is stored in the memory of the test machine, for example, wherein the memory may be a read-only memory (ROM). The present invention does not limit the content of the storage firmware, nor does it limit the application process of the storage firmware. Specifically, the storage firmware can be called when the test machine executes any process, such as the read and write process of the storage device or the garbage collection process of the storage device. Of course, the arbitrary process described in the present invention is not limited to the process used to realize conventional storage functions, but can also be a process for storage functions specially customized by the manufacturer. When the tested machine runs the storage firmware, the storage firmware cannot be run due to various reasons or logical errors of the storage firmware. The present invention can determine the reason why the storage firmware cannot be run.
[0040] It should be noted that the machine to be tested is electrically connected to the host computer, and the host computer issues instructions and data. The present invention does not limit the type of the host computer. The host computer stores a feedback duration threshold. When the storage firmware is running, the host computer issues instructions to the machine to be tested. After the machine to be tested completes the instruction, the machine to be tested feeds back a signal or data of the completion of the instruction to the host computer, so that the host computer knows that the machine to be tested has completed the instruction, and can send new instructions or data to the machine to be tested. In the present invention, if the duration of the feedback signal from the machine to be tested to the host computer exceeds the feedback duration threshold, the host computer determines that the operation of the storage firmware is wrong.
[0041] See also Figure 1 As shown, the present invention provides a storage test device 100. The storage test device 100 includes a host 200, a test machine 300 and a debugger 400. The test machine 300 includes a main controller 500 and a flash memory chip 600. In this embodiment, the test machine 300 is a storage device of the same model as the machine to be tested. The host 200 is electrically connected to the main controller 500 to send instructions or data to the test machine 300. The debugger 400 is electrically connected to the flash memory chip 600 to read data from the flash memory chip 600. In this embodiment, the electrical connection between the host 200 and the main controller 500, and the electrical connection between the debugger 400 and the flash memory chip 600, can be an interface connection. In this embodiment, the host 200 and the debugger 400 can be electrically connected to the test machine 300 through the same interface. Specifically, after the host 200 completes the task, it switches to the debugger 400 to be electrically connected to the test machine 300. In another embodiment of the present invention, the host 200 and the debugging machine 400 can be electrically connected to the testing machine 300 through different interfaces. Specifically, after the host 200 completes the task, the connection between the host 200 and the testing machine 300 is maintained, and the debugging machine 400 is used to continue to complete the storage testing method.
[0042] See also Figures 1 to 3As shown, in one embodiment of the present invention, the host 200 includes a firmware entry module 210 and a file query module 220. The firmware entry module 210 is used to enter the firmware into the test machine 300. Specifically, the firmware entry module 210 is used to enter the storage firmware, the on-site sample firmware and the pile firmware into the main controller 500. The main controller 500 includes a memory area. The memory area can be a read-only memory (ROM). In this embodiment, the storage firmware, the on-site sample firmware and the pile firmware can be recorded in the memory area, and can also be recorded in the flash memory chip 600. The main controller 500 also includes a processor, wherein the processor can be a reduced instruction system computer (RISC), and specifically can be an ARM processor. The processor executes the storage firmware, the on-site sample firmware and the pile firmware to implement the storage test method provided by the present invention.
[0043] See also Figures 1 to 3 As shown, in one embodiment of the present invention, the file query module 220 queries the relevance of the design code in the firmware in the coding environment. The relevance of the design code in the firmware is fixed and has been determined when the firmware is designed. Figure 3 As shown, taking the test function F_test as an example, there are three program files associated with the test function F_test, and the three program files are specifically a1\c\line_a1, b1\c\line_b1, and c1\c\line_c1. This association is reflected in that when the firmware is running, a1\c\line_a1, b1\c\line_b1, and c1\c\line_c1 all have the permission to call the test function F_test. Similarly, the superior associated files of a1\c\line_a1 include a2\c\line_a2 and b2\c\line_b2. The superior associated files of b1\c\line_b1 include d2\c\line_d2 and c2\c\line_c2. The superior associated files of c1\c\line_c1 include b2\c\line_b2 and e2\c\line_e2. In the permissions allowed by the firmware, when the firmware is running, when the program file a1\c\line_a1 is called, a2\c\line_a2 and / or b2\c\line_b2 may be called before the program file a1\c\line_a1. Similarly, when the test function F_test is called, a1\c\line_a1, b1\c\line_b1 and c1\c\line_c1 may be called before this. It should be noted that in the present invention, the association means that the upper-level file has the permission to call the lower-level file, and it does not mean that this upper-level file will definitely call the lower-level file. In a computer, the calling relationship of the firmware program files is extremely complex. The calling relationship provided by the present invention is very complex. Figure 3 The multiple program files in the figure are only used as schematic diagrams. In this embodiment, the relevance of the program files can be queried through the IDE coding software.
[0044] See also Figure 1 , Figure 2 , Figure 4 and Figure 5 As shown, in one embodiment of the present invention, the main controller 500 includes a clock module 510, an on-site sample retention module 520, a pile driving module 530, a call association module 540 and a cache module 550. The clock module 510 provides a control timing signal for the firmware operation to allocate the execution time of each operation. The on-site sample retention module 520 retains the firmware operation site when a problem occurs in the storage firmware operation. The pile driving module 530 runs the pile driving firmware and records the file information currently called by the test machine 300. The call association module 540 establishes the program file call relationship when the storage firmware is running and forms a call stack network. The cache module 550 is used to temporarily store test data and call stack networks. When the refresh condition is met, the data in the cache module 550 is transferred to the flash memory chip 600. In this embodiment, the cache module 550 can be a static random access memory (SRAM),
[0045] See also Figure 1 , Figure 2 , Figure 4 and Figure 5As shown, in one embodiment of the present invention, the on-site sample retention module 520 includes a condition judgment unit 521, a suspension unit 522 and a continuing operation unit 523. The condition judgment unit 521 stores the conditions for triggering the operation of the on-site sample retention firmware, and the conditions for triggering the operation of the on-site sample retention firmware are stored in the main controller 500 in the form of program statements. In the present invention, the conditions for triggering the operation of the on-site sample retention firmware are set by the designer, and can also be directly set as the error triggering conditions of the storage firmware. In this embodiment, the error problems of the storage firmware operation are graded, and the problems of the storage firmware operation include information error info, log error log, warning error warning, and fault problem error. The information error info refers to the information level error recorded when the firmware is running. The log error log refers to the firmware error, and the error log file is generated. The warning error warning refers to an error problem that does not affect the firmware operation but has risks. The fault problem error refers to a fault error that causes the firmware to run and report an error and cannot continue to run. The program statement of the condition judgment unit 521 is, for example, an if statement, and specifically can be if condition=1. The condition represents the condition for starting the abort unit 522, and is also the condition for triggering the running of the on-site sample retention firmware. The statement if condition=1 indicates that the condition for triggering the running of the on-site sample retention firmware has been met, and the abort unit 522 is started.
[0046] See also Figure 1 , Figure 2 , Figure 4 and Figure 5 As shown, in one embodiment of the present invention, when a problem occurs in the operation of the storage firmware, the termination unit 522 calls the termination program statement to suspend the operation of the storage firmware. In this embodiment, when the termination program statement is executed, the storage firmware is stopped from continuing to run. In another embodiment of the present invention, when the termination program statement is executed, the subsequent program firmware is suspended, and after suspending for a preset time, the subsequent program can be selectively continued to run. The termination program statement includes, for example, assert() and while(). When assert() is executed, the processor suspends the execution of any firmware program, thereby completing the on-site sample retention. When while() is executed, the processor loops and executes the preset program statement, thereby completing the on-site sample retention. In the present invention, the preset time for the firmware to suspend operation when the termination program statement is executed can be adjusted according to different error problems. For example, the more serious the error problem is, the longer the preset time for the firmware to suspend operation. In this embodiment, the continuing operation unit 523 can count the time for the storage firmware to suspend operation, and when the preset time is reached, the continuing operation unit 523 continues to run the storage firmware.
[0047] See also Figure 1 , Figure 2 , Figure 4 and Figure 6 As shown, in one embodiment of the present invention, a circular array is stored in the pile driving module 530, and multiple groups of file data are stored in the circular array. The present invention does not limit the number of groups of file data in the circular array. In this embodiment, in a group of file data, the circular array includes the digital number of the calling file and the line number of the calling file. In this embodiment, the number of file numbers corresponds to the number of file data groups that can be stored in the circular array. For example, if 5 groups of file data are stored in the circular array, the number of file numbers is 5, and the file numbers are, for example, 00, 01, 02, 03 and 04. Wherein the file number is no longer changed after being determined, and the file name corresponding to the file number can be changed during the test process. Wherein the initial file name corresponding to the file digital number is set by the designer. For example, the file name corresponding to the array number 02 is set to b2\c\line_b2. During the use of the pile driving module 530, the file name corresponding to the array number 02 can also be adjusted to a2\c\line_a2. In this embodiment, the initial file name corresponding to the file digital number is a program file with a higher probability of error. In this embodiment, the stubbing module 530 includes a dictionary maintenance unit 531 and an array update unit 532. The dictionary maintenance unit 531 is used to maintain a file name dictionary table. The file name dictionary table stores a mapping relationship between a file name and a file number. The file name dictionary table can be stored in the cache module 550. The array update unit 532 is used to maintain file data in a circular array.
[0048] See also Figure 1 , Figure 2 , Figure 4 and Figure 6 As shown, in one embodiment of the present invention, the file data in the circular array includes the file name and line number of the important process location when the firmware is running. In this embodiment, the important process location when the firmware is running is stored as the call position of the array update unit 532, and the call position can be determined by the test method provided by the present invention. In this embodiment, the file number can occupy, for example, 3 bits, and the maximum saved line number of the file line number is 0x1FFF. Each time the piling module 530 stores a set of file data, it takes up 2 bytes of storage space. Using a circular array record, when the file data in the circular array exceeds the capacity of the circular array, the oldest file data is overwritten with the new file data, and the file data in the circular array is always kept as the latest entered file data. The overwritten file data can be first transferred to the flash memory chip 600.
[0049] See also Figures 1 to 4 , Figure 6As shown, in one embodiment of the present invention, the call association module 540 is used to associate the file data in the circular array. In this embodiment, the adjacent file data are associated according to the time when the file data in the circular array is generated. Among them, the newly generated file data is the upper-level file, and the older generated file data is the lower-level file. For example, the upper-level file of the test function F_test is a1\c\line_a1, the upper-level file of a1\c\line_a1 is a2\c\line_a2, and the upper-level file of a2\c\line_a2 is a3\c\line_a3. Then the call association module 540 generates a call stack network of a1\c\line_a1, a2\c\line_a2, and a3\c\line_a3.
[0050] See also Figures 1 to 7 As shown, the storage test method includes steps S100 to S600.
[0051] Step S100: recording the storage firmware of the machine under test into the testing machine, and running the storage firmware in the testing machine.
[0052] Step S200, setting the on-site sample retention firmware and adding the on-site sample retention firmware to the storage firmware, setting the triggering conditions of the on-site sample retention firmware, and using the program file used when triggering the on-site sample retention firmware as the primary program file.
[0053] Step S300, setting the piling firmware and writing the piling firmware into the storage firmware, querying the superior associated file of the first-level program file, and setting the first-level program file and the superior associated file of the first-level program file as the calling point of the piling firmware.
[0054] Step S400, re-run the storage firmware, when running to the piling firmware, record the program file information currently called, and set the currently called program file as a secondary program file.
[0055] Step S500: Set the secondary program file and the upper-level associated file of the secondary program file as the calling point of the piling firmware.
[0056] Step S600, looping to obtain the secondary program file, and establishing a call stack network when the storage firmware fails according to the calling relationship between the primary program file and the secondary program file.
[0057] See also Figures 1 to 7As shown, in one embodiment of the present invention, in step S100, the storage firmware of the machine to be tested is entered into the test machine 300, and the storage firmware is run in the test machine 300. The storage firmware is the test object of the present invention, and the storage firmware can be a program that has not been tested, or a program that is found to have a bug after running. In this embodiment, the storage firmware is entered into the test machine 300 through the firmware entry module 210. Specifically, the storage firmware can be entered into the flash memory chip 600, or it can be entered into the memory area. Part of the program statements in the on-site sample firmware can be the storage firmware itself, and the on-site sample firmware can also be entered into the test machine 300 through the firmware entry module 210. Part of the program statements that come with it are, for example, abort statements and conditional judgment statements. The piling firmware is entered into the test machine 300 through the firmware entry module 210. In the present invention, the execution position of the on-site sample firmware is not limited. When the piling firmware is entered, the piling firmware is entered into the corresponding program file according to the test method set by the present invention. For example, when the piling firmware is entered into the first-level program file.
[0058] See also Figure 1 , Figure 2 and Figure 5 , Figure 7As shown, in one embodiment of the present invention, in step S200, the triggering condition of the on-site sample firmware is set by the designer. Specifically, when information error info, log error log, warning error warning, fault problem error and other problems occur during the operation of the storage firmware, the on-site sample firmware is run. The on-site sample firmware includes a conditional judgment statement, an abort statement and an operation control statement. The conditional judgment statement is, for example, an if statement, and specifically can be if condition=1 or if condition=0. For example, when if condition=1, the original program statement of the storage firmware is suspended, and the abort statement of the on-site sample firmware is executed. It should be noted that adding the on-site sample firmware to the storage firmware means that the on-site sample firmware can be triggered to run when the storage firmware is running, and it does not mean that the running process of the on-site sample firmware will definitely occur when the original program statement of the storage firmware is running. The operation control statement is used to start the continued operation of the storage firmware or stop the operation of the storage firmware according to the preset operation conditions after the abort statement is executed. In this embodiment, the on-site sample firmware includes at least one abort statement. Here, an abort statement refers to a program statement that can execute a complete abort process, which can be reflected in one line or multiple lines. For example, when the abort statement is while(), the storage firmware executes while() in an infinite loop when an error occurs. When the trigger condition for the on-site sample firmware operation is met, the program file being called by the test machine 300 is a first-level program file. The on-site sample firmware operation preserves the firmware operation failure site. In this embodiment, during the process of the storage firmware operation, a feedback signal will be continuously sent to the host 200, so that the host 200 can continue to send the next instruction or data. When the feedback signal times out, the host 200 believes that there is a problem with the storage firmware operation, and the file query module 220 obtains the parent associated file of the first-level program file through the code query software.
[0059] See also Figure 1 , Figure 4 , Figure 6 and Figure 7 As shown, in one embodiment of the present invention, in step S300, the piling firmware is entered into the primary program file and the superior associated file of the primary program file through the firmware entry module 210. In step S400, when the storage firmware is re-run, the primary program file and the superior associated file of the primary program file are called again, and the piling firmware will be executed to record the information of the current program file. Specifically, the piling firmware records the file number and the line number of the program statement of the currently running program file in a circular array. The circular array can be stored in the cache module 550 or in the flash memory chip 600. The program file whose information is recorded in the circular array is a secondary program file.
[0060] See also Figure 1 , Figure 4 , Figure 6 and Figure 7 As shown, in one embodiment of the present invention, in step S400, it should be noted that, in this embodiment, the annular array has an upper limit value for the number of data, and in the annular array, when recording the information of the secondary program file, the information of the secondary program file is arranged in sequence according to the time of writing into the annular array. When the number of data in the annular array reaches the upper limit value for the number of data, the information of the oldest secondary program file is overwritten with the information of the latest secondary program file. For example, if the annular array can store 5 groups of data, the upper limit value for the number of data is 5. When writing the 6th group of data, the 6th group of data is used to overwrite the oldest group of data among the 5 groups of data.
[0061] See also Figure 1 , Figure 4 , Figure 6 and Figure 7As shown, in one embodiment of the present invention, in step S400, in the step of writing data into the circular array, the file name dictionary table is synchronously updated and maintained. The file name dictionary table stores the mapping relationship between the name of the program file and the number of the program file, and the number of mapping relationships in the file name dictionary table is the same as the upper limit of the number of data in the circular array. In the present invention, when writing a program file that is not recorded in the file name dictionary table, the mapping relationship in the file name dictionary table is first updated. In this embodiment, in the step of updating the mapping relationship in the file name dictionary table, the file number is fixed and unchanged. When updating the file name dictionary table, the file number added by the dictionary maintenance unit 531 is any unused file number or the latest overwritten file number in the circular array. For example, a1\c\line_a1 is a file name that is not recorded in the file name dictionary table. And the program file information corresponding to a1\c\line_a1 is to be updated to the circular array. If five groups of data can be stored in the circular array, the file numbers are fixed to 00, 01, 02, 03, and 04, among which the two file numbers 00 and 01 have been used, that is, the two file numbers 00 and 01 have corresponding file names. When updating the file name dictionary table, a1\c\line_a1 can be mapped to any file number among 02, 03, and 04, and the corresponding mapping relationship can be recorded in the file name dictionary table. For example, a1\c\line_a1,02 is updated to the file name dictionary table. If five groups of data can be stored in the circular array, the file numbers are fixed to 00, 01, 02, 03, and 04, of which 00, 01, 02, 03, and 04 are all used. When writing the sixth group of data, the program file information corresponding to the file number 00 is the oldest information, so the sixth group of data is used to overwrite the program file information corresponding to the file number 00. For example, when writing the information of a1\c\line_a1, the latest file number to be overwritten is 00, then a1\c\line_a1,00 is associated and recorded in the file name dictionary table.
[0062] See also Figure 1 , Figure 4 , Figure 6 and Figure 7As shown, in one embodiment of the present invention, in step S400, the data in the circular array is flushed to the flash memory chip 600. In this embodiment, the data can be flushed to the flash memory chip 600 once each time the program file information is recorded. In another embodiment of the present invention, the data can also be flushed to the flash memory chip 600 once each time the program file information is updated multiple times. In other embodiments of the present invention, the data in the cache module 550 can also be transferred to the flash memory chip 600 when an error occurs in the operation of the storage firmware. The flushing frequency can be set by the designer. In the present invention, while the program file information in the circular array is transferred to the flash memory chip 600, the state information of the storage firmware is also synchronously transferred to the flash memory chip 600. In this embodiment, the state information of the storage firmware includes the SVN code of the current storage firmware version, the current operating state or power management information of the test machine 300, the log storage address, the host instruction, etc. The SVN code of the current storage firmware version is the code submission number. When the test machine is an embedded Multi Media Card (eMMC), the current operation state of the test machine 300 can be a transaction operation state, a data storage state, a data backup state, a prg file storage state, a database idle state, etc. The host instruction includes a breakpoint enable instruction and an instruction fetch cycle instruction. The firmware parses the host instruction to obtain the index or operation code of the host instruction and the parameters in the host instruction. The parameters in the host instruction are, for example, a logical address, the size of the read and write data, etc.
[0063] See also Figure 1 , Figure 4 , Figure 6 and Figure 7 As shown, in one embodiment of the present invention, in step S500 and in step S600, after the secondary program file is obtained for the first time, the superior associated file of the secondary program file is queried, and the piling firmware is added to the secondary program file and the superior associated file of the secondary program file. Then the storage firmware is run, the secondary program file is obtained for the second time, and the superior associated file of the new secondary program file is queried. And so on, the secondary program files are continuously obtained. Thus, all the secondary program files before the primary program file is run are obtained, and a call stack network is established when the storage firmware fails. Among them, when the secondary program file does not have a superior associated file or the superior associated file is related to the host instruction, it can be considered that all the secondary program files have been obtained at present. The call association module 540 can update the call stack network while the circular array is updated.
[0064] The embodiments of the present invention disclosed above are only used to help illustrate the present invention. The embodiments do not describe all the details in detail, nor do they limit the invention to the specific embodiments described. Obviously, many modifications and changes can be made according to the content of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the present invention, so that those skilled in the art can understand and use the present invention well. The present invention is limited only by the claims and their full scope and equivalents.
Claims
1. A storage test device, characterized in that: A test machine is included, and the test machine includes: An on-site sample retention module, when an error occurs in the operation of the storage firmware, the on-site sample retention module runs the on-site sample retention firmware and terminates the operation process of the storage firmware, wherein the program file called when the on-site sample retention module is started is a first-level program file; a piling module, which runs piling firmware when running the first-level program file and the superior associated program of the first-level program, starts and records information of the currently called program file, wherein the currently called program file is a second-level program file, and information of multiple second-level program files is stored in the form of a circular array, wherein when the storage firmware is re-run, and when the second-level program file and the superior associated file of the second-level program file are run, the piling module is started again and a new second-level program file is obtained; and A call association module is provided, wherein the call association module establishes and outputs a call stack network, wherein the call stack network includes all the secondary program files and the call relationships between the plurality of secondary program files.
2. A storage test device according to claim 1, characterized in that: The storage test device includes a host, the host is electrically connected to a tester, wherein the host includes: a firmware input module, the firmware input module inputs the storage firmware, the on-site sample firmware and the pile driving firmware into the test machine; and The file query module is electrically connected to the test machine, and the file query module outputs the program file association network of the storage firmware, wherein the program file association network includes the upper-level association file of the first-level program file and the upper-level association file of the second-level program file.
3. A storage test device according to claim 1, characterized in that: In the circular array, a single data includes the number of a program file and the row number where the program file is located in the storage firmware.
4. A storage test device according to claim 1, characterized in that: In the circular array, the information of the secondary program files is arranged in sequence according to the time when they were written into the circular array.
5. The storage test device according to claim 1, characterized in that: The circular array has an upper limit value for the number of data. When the number of data in the circular array reaches the upper limit value for the number of data, the information of the oldest secondary program file is overwritten by the information of the latest secondary program file.
6. A storage test device according to claim 5, characterized in that: The testing machine includes a cache module, the storage data types in the cache module include the call stack network and the circular array, and also includes a file name dictionary table, wherein the file name dictionary table stores the mapping relationship between the name of the program file and the number of the program file, and the number of mapping relationships in the file name dictionary table is greater than or equal to the upper limit value of the number of data in the circular array.
7. A storage test device according to claim 6, characterized in that: The piling module includes a dictionary maintenance unit. When the piling module is started, if the file name of the secondary program file is not recorded in the file name dictionary table, the dictionary maintenance unit adds a file number to the secondary program file and outputs the mapping relationship between the file of the secondary program file and the file number to the file name dictionary table.
8. The storage test device according to claim 7, characterized in that: The file number added by the dictionary maintenance unit is any unused file number or the file number that is most recently covered in the circular array.
9. The storage test device according to claim 6, characterized in that: The test machine includes a flash memory chip, and the types of storage data in the flash memory chip include storage data from the cache module, program files of multiple firmwares, and status information of the storage firmware.
10. A storage test method, characterized in that: The following steps are involved: Get storage firmware; Setting a field sample retention firmware, and writing the field sample retention firmware into the storage firmware; Running the storage firmware, and setting the program file called when triggering the on-site sample retention firmware as a first-level program file; Setting a pile driving firmware, and writing the pile driving firmware into the storage firmware, querying the superior associated file of the first-level program file, and setting the first-level program file and the superior associated file of the first-level program file as the calling point of the pile driving firmware; Re-run the storage firmware, and when running to the piling firmware, record the program file information currently called, and set the currently called program file as a secondary program file; Setting the secondary program file and the superior associated file of the secondary program file as the calling point of the piling firmware; as well as The secondary program files are acquired cyclically, and a call stack network of the storage firmware is established according to the calling relationship of the plurality of secondary program files.
Citation Information
Patent Citations
Application compatibility testing method, terminal device and medium
CN109240936A
Fault site backtracking method based on firmware emulation, and device and readable storage medium
WO2024055611A1