Embedded testing method, device and system

Through the information monitoring module monitoring and storing the program address value of the memory accessed by the controller chip processing function unit, the existing software dynamic white box testing is solved, and the existing software dynamic white box testing is realized, which improves the testing and production efficiency.

CN119201750BActive Publication Date: 2025-04-04SHENZHEN KANGAO XINGYE TECHNOLOGY CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411684063.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-22
Publication Date
2025-04-04
Estimated Expiration
2044-11-22

AI Technical Summary

Technical Problem

The existing software dynamic white box testing methods are inefficient, difficult to test, and may cause program errors due to adding code.

Method used

The program address value of the processing function unit accesses the memory through the information monitoring module and stores it in the storage unit or outputs. There is no need to add code to the program, and it works independently of the processing function unit.

Benefits of technology

The purpose of dynamic white box testing is achieved, testing efficiency, R&D efficiency and production efficiency are improved, and program complexity and error problems caused by code insertion methods are avoided.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119201750B_ABST
    Figure CN119201750B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, device and system for embedded testing, including: monitoring the program address value of a processing function unit accessing a memory through an information monitoring module, wherein the information monitoring module is a hardware unit arranged outside the processing function unit; storing the program address value in a storage unit and / or outputting the program address value. The present invention adopts a real-time monitoring method, storing or outputting the program address value of the monitoring processing function unit accessing a memory, so as to achieve the purpose of software testing of the corresponding program.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to an embedded testing method, device and system, and in particular to a controller chip and an embedded testing method, device and system thereof. Background Art

[0002] With the development of chip technology, more and more functional modules are integrated into the chip, the amount of computing data of the controller chip is getting larger and larger, and the number of programs that the controller chip needs to run is also getting larger and larger, which may be hundreds of thousands or even millions. The following requirements exist: It is necessary to achieve the purpose of dynamic white box testing of embedded software (hereinafter referred to as software dynamic white box testing).

[0003] In the existing software dynamic white box testing process, a method of adding code stubs in the program (hereinafter referred to as the code stub method) is used to implement software dynamic white box testing. The inventors found that the existing technology has the following deficiencies: 1. Inserting stubs in the program requires occupying the processor running resources in the controller chip, and it takes longer to run the same functional code as before, which may introduce other unexpected situations, increase the difficulty of testing and have low efficiency; 2. Inserting stubs in the program requires adding code. These additional codes make the program itself longer, and the previous program address changes. Calling these program absolute addresses in the program will cause unexpected situations, which increases the difficulty of testing; 3. In the existing software testing, program black box testing, prototype testing and software dynamic white box testing cannot be performed at the same time, and the testing efficiency is not high. Summary of the invention

[0004] In order to solve the problems of low efficiency, high testing difficulty and possible program errors caused by adding code in existing software dynamic white box testing, the present application provides a method, device and system for embedded testing. The method is as follows:

[0005] Monitoring the program address value of the processing function unit accessing the memory through the information monitoring module, the information monitoring module is a hardware unit arranged outside the processing function unit;

[0006] The program address value is stored in a storage unit and / or the program address value is output.

[0007] Further, before storing the program address value in the storage unit and / or outputting the program address value, the method further includes: determining whether the program address value has been stored in the storage unit;

[0008] If the program address value is already stored in the storage unit, the program ends;

[0009] If the program address value is not stored in the storage unit, the program address value is stored in the storage unit and / or the program address value is output.

[0010] Furthermore, the processing function unit includes one of the following:

[0011] processor;

[0012] A processing unit inside a processor.

[0013] Furthermore, monitoring the program address value of the processing function unit accessing the memory is achieved by monitoring the program address on the chip bus.

[0014] An embedded testing device, comprising:

[0015] An information monitoring module, the information monitoring module is used to monitor the program address value of the processing function unit accessing the memory, and the information monitoring module is a hardware unit arranged outside the processing function unit;

[0016] The processing module is used to store the program address value in a storage unit and / or output the program address value.

[0017] Furthermore, it also includes:

[0018] A comparison module, the comparison module is used to determine whether the program address value has been stored in the storage unit before storing the program address value in the storage unit and / or outputting the program address value,

[0019] If the program address value is already stored in the storage unit, the program ends;

[0020] If the program address value is not stored in the storage unit, the program address value is stored in the storage unit and / or the program address value is output.

[0021] Furthermore, the processing function unit includes one of the following:

[0022] processor;

[0023] A processing unit inside a processor.

[0024] Furthermore, monitoring the program address value of the processing function unit accessing the memory is achieved by monitoring the program address on the chip bus.

[0025] A system for embedded testing, comprising any of the embedded testing devices described above, the system for embedded testing also comprising embedded software, a processing function unit, a memory, a storage unit and a terminal, the embedded software being in the memory, the embedded testing device being used to monitor the program address value of the processing function unit accessing the memory, storing the program address value of the memory in the storage unit, reading the program address value of the memory through the terminal, or outputting the program address value of the memory to the terminal.

[0026] The method of the present application uses an information monitoring module (a dedicated hardware unit set outside the processing function unit) to monitor the program address value of the processing function unit accessing the memory, and stores the program address value in the storage unit and / or outputs the program address value, without adding code to the program and occupying additional processing function unit operation resources. The information monitoring module works independently of the processing function unit; the information monitoring module and the processing function unit work in parallel.

[0027] Dynamic white box testing in software testing (abbreviation for embedded software testing, the same below) mainly tests and determines the executed programs, that is, determines the instructions executed by the processing function unit in the program. These instructions correspond to the program addresses corresponding to the instructions executed by the processing function unit. Therefore, the present application monitors, stores and / or outputs the program address value of the processing function unit accessing the memory through the information monitoring module, thereby achieving the purpose of dynamic white box testing.

[0028] Compared with the code instrumentation method used in existing dynamic white box testing, this application uses an information monitoring module to detect from the outside, which brings at least the following beneficial effects:

[0029] 1. Using the existing code plugging method requires adding additional code, which requires additional processing function unit running resources, so that the time for each task processing of the program will be longer after adding the additional code, just like the processor processing speed has slowed down; the addition of these codes may also cause some problems and conflicts with the existing program, causing the program to run abnormally. However, this application does not need to change the source program, and uses an information monitoring module (hardware unit) set outside the processing function unit, that is, an information monitoring module independent of the source program is used to monitor the source program. Compared with the existing code plugging method, the time for each task processing of the program does not change, and the processor processing speed does not change.

[0030] 2. At the same time, the use of the existing code stub method requires the addition of additional code. After the addition of these codes, the code length has changed, and the storage addresses of some programs have changed from before. When there is a situation in the program where the absolute addresses of these programs are accessed, the program cannot run normally. In order to ensure the normal operation of the program after adding the additional code, the program after adding these codes needs to be further adjusted, which will further increase the complexity of the program and the possibility of errors. However, the present application monitors the source program by setting a hardware unit outside the processing function unit, that is, using other units (that is, hardware) independent of the source program, without changing the source program, and the storage or output will not be affected by the detection. It can completely avoid the program complexity caused by the existing code stub method, and also avoid the program error problem caused by the existing code stub method.

[0031] 3. Since there is no need to modify the program, the present application can also be used to perform software dynamic white box testing simultaneously in program black box testing and prototype testing. Compared with existing testing methods, it further greatly improves testing efficiency, R&D efficiency and production efficiency.

[0032] The existing code stub method is based on the combination of software testing and embedded software design (hereinafter referred to as "software design"). The method of this application is a method that combines chip design and application (hardware design), software testing and software design. Based on the previous software testing and software design, this application innovatively introduces the hardware unit monitoring method, which greatly improves the testing efficiency, R&D efficiency and production efficiency under the same effect. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] The drawings constituting a part of the present application are used to provide a further understanding of the present application. The illustrative embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0034] Figure 1 is a flow chart of an embodiment of the method of the present application;

[0035] Figure 2 is a flow chart of another embodiment of the method of the present application;

[0036] Figure 3 is a data storage schematic diagram of an embodiment of the method of the present application;

[0037] Figure 4 It is a structural framework diagram of an embodiment of the device of the present application;

[0038] Figure 5 is another structural framework diagram of an embodiment of the device of the present application;

[0039] Figure 6 It is a structural framework diagram of an embodiment of the system of the present application. DETAILED DESCRIPTION

[0040] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0041] It should be noted that, unless otherwise specified, all technical and scientific terms used in this application have the same meanings as commonly understood by ordinary technicians in the technical field to which this application belongs.

[0042] In the present application, unless otherwise specified, the directional words used, such as "up, down, top, bottom", usually refer to the directions shown in the drawings, or to the components themselves in the vertical, perpendicular or gravity directions; similarly, for ease of understanding and description, "inside and outside" refer to the inside and outside relative to the outline of each component itself, but the above-mentioned directional words are not used to limit the present application.

[0043] It should be pointed out that in each embodiment of the present application, each corresponding functional unit is modularized only for the convenience of explanation. In fact, these functional units can also be distributed in various functional modules of the chip, and then complete the corresponding functions together.

[0044] First of all, it should be noted that in each embodiment of the present application, the terms involved are explained as follows:

[0045] Processor: It is the abbreviation of processor core. As the computing and control core of the controller chip, it is the final execution unit of information processing, data processing, and program running. It is an important component of the controller chip, such as RISC-V core CPU, ARM's M3, or other DSP cores, etc. The processor in this application is not a separate CPU like INTEL Pentium in a traditional PC computer.

[0046] MCU: A general term for a microcontroller chip, which includes a processor and other related functional modules (such as program memory, data memory, PWM module, UART, etc.).

[0047] MPU: Microprocessor chip, a processor used in embedded systems, different from the CPU used in PCs.

[0048] Controller: The abbreviation of controller chip and embedded controller chip, including: MCU, DSP and MPU.

[0049] Chip: Also known as integrated circuit (IC). It refers to a small silicon chip containing an integrated circuit, which is often part of a computer or other electronic device. The chip in this application is an embedded controller chip.

[0050] Embedded software: It is the operating system and application software embedded in the hardware. Generally speaking, in the system, the program is a specific embodiment of embedded software.

[0051] Embedded system: includes one of the following: embedded hardware, embedded hardware includes chips; embedded software.

[0052] Embedded: is the abbreviation of embedded system.

[0053] Instruction: A code that tells the processor to do something. A program is a collection of instructions grouped together to perform a specific function; in particular, individual instructions are also part of a program.

[0054] Address: includes program address and data address.

[0055] Program address: refers to the actual address of the program in storage when it is scheduled to run by the processor. The address of the instruction accessed by the processor can be called the instruction address or the program address.

[0056] Functional module: A unit in a chip that performs a specific function and can be directly or indirectly accessed or updated by a processor at a specific time; also known as peripherals, peripheral modules, peripheral functional modules, etc. Generally, in a chip, functional modules include but are not limited to storage (e.g. ROM, OTP, FLASH, SRAM, SDRAM, etc.), TIMER, GPIO module, PWM module, etc. In particular, in a multi-processor chip, at a specific time, some processors can also be accessed or updated by other processors as functional modules.

[0057] Module address: The address where the content of a functional module is accessed or updated as data by the processor.

[0058] Data includes but is not limited to: content stored in a data storage device during a program, or content that can be queried, updated, etc. by a processor.

[0059] Data address: The address corresponding to the processor's operations such as querying and updating data. In particular, programs and data can be stored in the memory (including but not limited to ROM, OTP, FLASH, SRAM, SDRAM, etc.). In addition to the address of the instruction corresponding to the software running at a specific moment as the program address, the addresses of other instructions can be used as both program addresses and data addresses.

[0060] Memory: A functional module that can store programs and data, including but not limited to ROM, OTP, FLASH, SRAM, SDRAM, etc.

[0061] Terminal: short for smart terminal, a device with input and output and information processing capabilities; including but not limited to: PCs, mobile phones, tablets, embedded devices, etc.

[0062] Information: refers to the objects transmitted and processed by audio, messages, and communication systems, and generally refers to all content disseminated by human society. For chips, information can also be the values ​​of one or more registers on the chip, the values ​​of one or more combinational circuits, the values ​​of one or more memories, or a combination of the above.

[0063] Access, including processor query and update actions on the module (i.e., read and write).

[0064] Manipulate data, including the processor's query and set actions on data.

[0065] Print: A commonly used embedded term, which refers to outputting information through external interfaces such as UART, USB, etc. on the chip.

[0066] Stub: It is to insert a piece of our custom code into the code. The purpose of stub: Since the code we insert will be compiled into the executable file together, when the processor executes the custom code we insert during operation, we can record and / or output any information we want to know, etc.

[0067] Code stubbing, also known as program stubbing, was first proposed by Professor JC Huang. It inserts some probes (also known as "detectors", which are essentially code segments for information collection, which can be assignment statements or function calls for collecting coverage information) into the program on the basis of ensuring the original logical integrity of the program under test. The probes are executed and throw out characteristic data of the program running. By analyzing these data, the control flow and data flow information of the program can be obtained, and then dynamic information such as logic coverage can be obtained, thereby achieving the testing purpose.

[0068] Code instrumentation method: Use code instrumentation method.

[0069] Insertion printing: A common term in embedded systems, it refers to the method of adding additional code to the program to output relevant information, which is generally used for testing and debugging; these additional codes will increase the processor load and may also affect the normal operation of the embedded system.

[0070] Embedded testing: It is the abbreviation of embedded system testing, including embedded software and its system testing; generally, embedded testing mainly focuses on the testing of embedded software. The embedded testing in this application refers to the testing of such embedded software or the system containing such embedded software. Embedded testing includes embedded white box testing and embedded black box testing.

[0071] Black box testing is to test whether each function can be used normally.

[0072] White box testing: White box testing is also called structural testing, transparent box testing, logic-driven testing or code-based testing. There are two types of white box testing: static and dynamic. Static testing refers to analyzing and checking programs and documents manually or with other tools without running the program.

[0073] Embedded white box testing: includes embedded software static white box testing and embedded software dynamic white box testing.

[0074] Embedded software static white box testing: refers to analyzing and checking embedded programs and documents manually or with other tools without running the embedded program.

[0075] Embedded software dynamic white box testing: referred to as software dynamic white box testing, dynamic white box testing or white box testing, referred to as software dynamic white box testing in this application, is an embedded software testing method that combines the characteristics of dynamic testing and white box testing. Dynamic testing focuses on the running status of the program, while white box testing focuses on checking the internal structure and logic of the code. Dynamic white box testing includes: logic coverage testing (including: statement coverage testing, decision coverage testing, condition coverage testing, decision / condition coverage testing, condition combination coverage testing and path coverage testing, etc.), basic path coverage testing, function coverage testing, loop path testing, program stub testing, etc.

[0076] A controller chip includes a processor, and the processor includes the instruction "jump"; the internal program address of the chip corresponds to: 0~0x1fff; the internal data address of the chip corresponds to 0x2000~0x2fff; the internal peripheral address of the chip corresponds to 0x3000~0x3fff, and the address 0x3100 is the IO output data register address. The "jump" instruction corresponds to the first 5 bits of binary code "11100" in the 32-bit instruction target code, and we regard these two as equivalent. In addition, the "jump 0x1000" instruction refers to the instruction of "jump to address 0x1000", and the corresponding binary code in the 32-bit instruction target code is "1110 0000 0000 0000 00010000 0000 0000", and we regard these two as equivalent. Please refer to Figure 3 As shown, the program memory with the program address value "0xa00" stores the instruction "jump 0x1000"; and the data memory with the data address value "0x2100" stores the data value "0xff00".

[0077] See also Figure 1 Shown is a flowchart of a specific embodiment of an embedded testing method of the present application.

[0078] S100, monitoring a program address value of a processing function unit accessing a memory through an information monitoring module, wherein the information monitoring module is a hardware unit disposed outside the processing function unit.

[0079] The memory is a unit for storing programs, including but not limited to program memory FLASH, ROM, OTP, SRAM, and other units with program storage functions.

[0080] The program address value is the address value of a specific instruction. Figure 3As shown, for example: the address "0xa00" of the instruction "jump 0x1000" is the program address value.

[0081] Monitoring the program address value of the processing function unit accessing the memory can work when the processing function unit is in a normal working state, that is, the processing function unit is not in a debugging state, or the processing function unit is not in an interrupt state, or the processing function unit is not in an abnormal state, etc. Monitoring the program address value of the processing function unit accessing the memory works independently of the processing function unit. Monitoring the program address value of the processing function unit accessing the memory does not occupy the operating resources of the processing function unit. Monitoring the program address value of the processing function unit accessing the memory works in parallel with the processing function unit.

[0082] The processing functional unit includes one of the following:

[0083] processor;

[0084] A processing unit inside a processor.

[0085] The processing function unit can be located inside the processor as a part of the processor, or it can be a complete processor.

[0086] Monitoring the program address value of the processing function unit accessing the memory is achieved by monitoring the program address on the chip bus.

[0087] Monitoring the program address value of the memory accessed by the processing function unit includes at least one of the following situations:

[0088] monitoring the program address value received by the processing functional unit;

[0089] Monitor the program address value issued by the processing functional unit.

[0090] monitoring the program address value received by the memory;

[0091] Monitor the program address values ​​issued by the memory.

[0092] Monitoring the program address value of the processing function unit accessing the memory also includes: directly or indirectly obtaining the "program address value of the processing function unit accessing the memory"; directly or indirectly obtaining indirect information equivalent to the "program address value of the processing function unit accessing the memory".

[0093] While monitoring the program address value of the processing functional unit accessing the memory, it also determines the instruction content accessed at this moment, queries and / or modifies related variables (variables in registers and memory); this enables complex testing in dynamic white box testing (for example: conditional coverage testing, etc.).

[0094] S200, storing the program address value in a storage unit and / or outputting the program address value.

[0095] Output refers to the direct or indirect output of information through the bus, Bluetooth, UART, USB and other interfaces on the chip or module.

[0096] The program address value is stored in a storage unit and / or the program address value is outputted by a processing module, and the processing module is a hardware unit arranged outside the processing function unit. The program address value is stored in a storage unit and / or the program address value is outputted can work when the processing function unit is in a normal working state, that is: the processing function unit is not in a debugging state, or the processing function unit is not in an interrupt state, or the processing function unit is not in an abnormal state, etc. The program address value is stored in a storage unit and / or the program address value is outputted independently of the processing function unit. The program address value is stored in a storage unit and / or the program address value is outputted without occupying the operating resources of the processing function unit. The program address value is stored in a storage unit and / or the program address value is outputted and works in parallel with the processing function unit. Of course, the program address value can also be stored in a storage unit and / or the program address value is outputted when the processing function unit is in an abnormal working state.

[0097] The time for storing the program address value in the storage unit and / or outputting the program address value can be the moment of "monitoring the program address value of the processing functional unit accessing the memory" or any moment after "monitoring the program address value of the processing functional unit accessing the memory" occurs.

[0098] The storage unit includes at least one of the following two situations:

[0099] Internal storage unit;

[0100] External storage unit.

[0101] Internal storage units refer to units with storage functions inside the chip, including registers, FIFO, SRAM, FLASH, etc.

[0102] An external storage unit refers to a unit with storage function outside the chip, including: FLASH, SRAM, U disk, SD card, hard disk and other units with storage function outside the external chip.

[0103] Storing or transmitting indirect information equivalent to or containing the "program address value of the processing function unit accessing the memory" through other operations, or in conjunction with software, interrupts, or other external programmable devices, all fall under "storing the program address value in a storage unit and / or outputting the program address value".

[0104] The method of the present application also includes: a method that is implicitly or implicitly includes the operations of S100 and S200; a method that is indirectly implemented, equivalent to or can be converted into the operations of S100 and S200.

[0105] like Figure 3 As shown, although there may be many "jump 0x1000" instructions in the program, in this embodiment, the program address value "0xa00" of the processing function unit accessing the memory is detected and stored. We read this information (program address value "0xa00") from the storage unit, so that we can know that the program executes the instruction with the program address value "0xa00" (instruction "jump 0x1000"), achieving the purpose of statement coverage test in software dynamic white box testing.

[0106] The method of the present application uses an information monitoring module to monitor the program address value of the processing function unit accessing the memory, and stores the program address value in the storage unit and / or outputs the program address value, without adding code to the program and occupying additional operating resources of the processing function unit. The information monitoring module works independently of the processing function unit; the information monitoring module and the processing function unit work in parallel.

[0107] Dynamic white box testing in software testing requires testing and judging the executed programs, that is, judging the instructions executed by the processing functional units in the program; these instructions correspond to the program addresses corresponding to the instructions executed by the processing functional units; therefore, the present application can judge the executed programs by monitoring, storing and / or outputting the program address values ​​of the processing functional units accessing the memory, thereby achieving the purpose of dynamic white box testing.

[0108] Using the existing code stubbing method requires adding additional code, which requires additional processing function unit running resources; adding these codes may cause some problems and conflicts with existing programs. For example, the original program needs 200 clock cycles to run one task cycle. After adding these codes, it becomes 220 clock cycles for one task cycle, which makes the program task cycle run longer after adding the additional code, just like the processor processing speed is slower; this is equivalent to: a 20Mhz processor used to output a pulse every 10us, and after code stubbing, it becomes 11us to output a pulse, which will cause the program to run abnormally. However, the present application does not need to modify the source program, and uses an information monitoring module (hardware unit) set outside the processing function unit, that is, uses an information monitoring module independent of the source program to monitor the source program. Compared with the existing code stubbing method, the program runs without changing each task cycle, the processor processing speed does not change, and no new problems and conflicts are introduced.

[0109] At the same time, the use of the existing code stub method requires the addition of additional code. After adding these codes, the code length changes, and some program storage addresses change from before. When there is a situation in the program that accesses the absolute addresses of these programs, the program will not run normally. For example: in a program with a remote upgrade function, a program with an absolute storage address in the program is updated using remote communication technology; the address of the program to be upgraded is 0x500~0x800, and the use of the existing code stub method requires the addition of additional code, and its program address becomes 0x510~0x810; in this way, the program cannot run normally after upgrading the original program at 0x500~0x800. In order to ensure the normal operation of the program after adding the additional code, the program after adding these codes needs to be further adjusted, which will further increase the complexity of the program and the possibility of errors. The present application, however, uses an information monitoring module (hardware unit) that is set outside the processing function unit, that is, uses an information monitoring module that is independent of the source program to monitor the source program. There is no need to modify the source program, and the storage or output will not be affected by the detection. The program complication caused by the existing code insertion method can be completely avoided, and the program error problem caused by the existing code insertion method can also be avoided.

[0110] Since there is no need to modify the program, the present application can also be used to perform dynamic white box testing of the software simultaneously during black box testing and prototype testing. Compared with existing testing methods (the existing testing methods cannot be tested simultaneously with black box testing and prototype testing because the program may change due to program modification), the testing efficiency, R&D efficiency and production efficiency are further greatly improved.

[0111] See also Figure 2 FIG. 1 is a flowchart of another specific embodiment of an embedded testing method of the present application.

[0112] S100, monitoring a program address value of a processing function unit accessing a memory through an information monitoring module, wherein the information monitoring module is a hardware unit disposed outside the processing function unit.

[0113] S110, determining whether a program address value has been stored in the storage unit;

[0114] If the program address value is already stored in the storage unit, the program ends;

[0115] If the program address value is not stored in the storage unit, proceed to S200.

[0116] Determining whether the program address value has been stored in the storage unit includes determining whether the program address value has been stored in the storage unit inside or outside the chip.

[0117] S200, storing the program address value in a storage unit and / or outputting the program address value.

[0118] Storing or transmitting indirect information equivalent to or containing the "program address value of the processing function unit accessing the memory" through other operations, or in conjunction with software, interrupts, or other external programmable devices, all fall under "storing the program address value in a storage unit and / or outputting the program address value".

[0119] like Figure 3 As shown, although the "jump0x1000" instruction with a program address value of "0xa00" may be executed many times in the program, in this embodiment, we only store it once, which saves storage space. We read this information (program address value "0xa00") from the storage unit, so that we can know that the program has executed the instruction with a program address value of "0xa00" (instruction "jump 0x1000"), achieving the purpose of statement coverage testing in software dynamic white box testing, while saving storage space.

[0120] See also Figure 4 and Figure 5 FIG. 1 is a structural framework diagram of a specific embodiment of an embedded test device of the present application.

[0121] exist Figure 5 In the embodiment, device 1#, device 2#, device 3#, ... device n# are all the same embedded test devices, that is, the embedded test devices in the present application are all arranged outside the processor and can work normally. The embedded test devices can be arranged separately or in other hardware. The embedded test devices can be arranged in different positions according to the needs of the structure. Figure 5 The device numbers are only used to distinguish the different locations of the device settings for embedded tests.

[0122] An embedded testing device, comprising:

[0123] The information monitoring module M100 is used to monitor the program address value of the processing function unit accessing the memory. The information monitoring module is a hardware unit arranged outside the processing function unit.

[0124] The processing functional unit includes one of the following:

[0125] processor;

[0126] A processing unit inside a processor.

[0127] The processing function unit can be located inside the processor as a part of the processor, or it can be a complete processor.

[0128] like Figure 5 As shown, the device can be located inside the processor as a part of the processor; or can be outside the processor as a complete module.

[0129] Monitoring the program address value of the processing function unit accessing the memory is achieved by monitoring the program address on the chip bus.

[0130] Monitoring the program address value of the memory accessed by the processing function unit includes at least one of the following situations:

[0131] monitoring the program address value received by the processing functional unit;

[0132] Monitor the program address value issued by the processing functional unit.

[0133] monitoring the program address value received by the memory;

[0134] Monitor the program address values ​​issued by the memory.

[0135] The system further includes a comparison module M110, which is used to determine whether the program address value has been stored in the storage unit.

[0136] If the comparison module determines that the program address value has been stored in the storage unit, the program ends;

[0137] If the comparison module determines that the program address value is not stored in the storage unit, the processing module M200 stores the program address value in the storage unit and / or outputs the program address value.

[0138] The processing module M200 is a hardware unit disposed outside the processing function unit.

[0139] In this embodiment, the program address value is stored in the storage unit and / or the program address value is output for analysis through the information monitoring module and the processing module, so as to achieve the purpose of dynamic white box testing in software testing. Because the present application does not need to add code to the program, it greatly improves the testing efficiency, R&D efficiency and production efficiency compared with the existing testing methods.

[0140] Figure 6 It is a structural framework diagram of an embedded test system provided in another embodiment of the present application.

[0141] Figure 6 The device in is the embedded test device in this application. The embedded test device is set in the chip. Of course, it can also be set in other hardware or set separately, as long as it is set outside the processor and can work normally.

[0142] An embedded test system, comprising the embedded test device described in any one of the above specific embodiments, the embedded test system also includes embedded software, a processing function unit, a memory, a storage unit and a terminal, the embedded software is in the memory, Figure 6 Other modules in the embedded test device include storage units. The embedded test device is used to monitor the program address value of the memory accessed by the processing function unit, store the program address value of the memory in the storage unit, read the program address value of the memory through the terminal, or output the program address value of the memory to the terminal. We obtain the program address values ​​of these memories, so that we can know that the program executes the instructions of the program address value of the memory, and achieve the purpose of dynamic white box testing of software.

[0143] Obviously, the embodiments described above are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this application.

[0144] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present application. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprise" and / or "include" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.

[0145] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein.

[0146] The above are only preferred embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A method for embedded testing, characterized in that: include: When the processing function unit is in a normal working state, the program address value of the processing function unit accessing the memory is monitored by an information monitoring module, wherein the information monitoring module is a hardware unit arranged outside the processing function unit, and the normal working state includes that the processing function unit is not in a debugging state, the processing function unit is not in an interrupt state, or the processing function unit is not in an abnormal state; Determining whether the program address value has been stored in the storage unit; If the program address value has been stored in the storage unit, the program ends; If the program address value is not stored in the storage unit, the program address value is stored in the storage unit and / or outputted by the processing module, and the storage unit stores the program address value only once, and the program address value is stored in the storage unit and / or outputted independently of the processing function unit; The processing function unit is a processor, and the processing module is a hardware unit arranged outside the processing function unit.

2. The embedded testing method according to claim 1, characterized in that: The monitoring processing function unit accesses the program address value of the memory by monitoring the program address on the chip bus.

3. An embedded testing device, characterized in that: include: an information monitoring module, when the processing function unit is in a normal working state, the information monitoring module is used to monitor the program address value of the processing function unit accessing the memory, the information monitoring module is a hardware unit arranged outside the processing function unit, the normal working state includes that the processing function unit is not in a debugging state, the processing function unit is not in an interrupt state, or the processing function unit is not in an abnormal state; a comparison module, the comparison module being used to determine whether the program address value has been stored in the storage unit before storing the program address value in the storage unit and / or outputting the program address value; If the program address value has been stored in the storage unit, the program ends; a processing module, wherein if the program address value is not stored in the storage unit, the processing module is used to store the program address value in the storage unit and / or output the program address value, and the storage unit stores the program address value only once, and storing the program address value in the storage unit and / or outputting the program address value is independent of the processing function unit; The processing function unit is a processor, and the processing module is a hardware unit arranged outside the processing function unit.

4. The embedded testing device according to claim 3, characterized in that: The monitoring processing function unit accesses the program address value of the memory by monitoring the program address on the chip bus.

5. An embedded testing system, characterized in that: The embedded testing device comprises the embedded testing device as claimed in any one of claims 3 to 4, wherein the embedded testing system further comprises embedded software, a processing function unit, a memory, a storage unit and a terminal, wherein the embedded software is in the memory, and the embedded testing device is used to monitor the program address value of the processing function unit accessing the memory, store the program address value of the memory in the storage unit, read out the program address value of the memory through the terminal, or output the program address value of the memory to the terminal.

Citation Information

Patent Citations

  • Chip dynamic tracing method of microprocessor

    CN1912849A