A method, apparatus, device and medium for instruction testing

By judging the port status by the instruction and saving the instruction to be tested to static random access memory, the CPU can directly read and test it, which solves the problem of long instruction testing time and achieves efficiency improvement and cost saving.

CN115269004BActive Publication Date: 2026-11-17CCORE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210923414.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-02
Publication Date
2026-11-17
Estimated Expiration
2042-08-02

AI Technical Summary

Technical Problem

In existing technologies, the instruction testing process is time-consuming, leading to increased resource costs and greater debugging difficulties.

Method used

By judging the port status by the instruction, the local test control unit obtains the instruction to be tested and saves it to static random access memory. The CPU directly reads and tests the instruction in memory.

Benefits of technology

It improved the efficiency of instruction testing and saved resource costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115269004B_ABST
    Figure CN115269004B_ABST
Patent Text Reader

Abstract

This application discloses an instruction testing method, apparatus, device, and medium, relating to the field of integrated circuit design and application. The method includes: determining the status of a local instruction fetch port; the instruction fetch port status includes an on state and a off state; if the instruction fetch port status is on, then using a local test control unit to fetch the instruction to be tested, and sending and storing the instruction to be tested in a local static random access memory (SRAM); and using a local CPU to read and test the instruction to be tested from the SRAM. Through the above technical solution of this application, the efficiency of instruction testing can be effectively increased, and resource costs can be saved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of integrated circuit design and application, and in particular to an instruction testing method, apparatus, device and medium. Background Technology

[0002] Currently, in existing technologies, the CPU first needs to issue a read command, which then passes through the peripheral interface module to reach the chip port and read the external storage. This process is slow and time-consuming. After reading the data from the external storage, a write command is executed to write the data into the SRAM. The CPU's read / write command execution process takes many clock cycles, resulting in a very long time. Debugging is difficult, and this process is charged by time, further increasing costs.

[0003] As can be seen from the above, how to increase the efficiency of instruction testing and save resource costs during the instruction testing process is a problem that needs to be solved in this field. Summary of the Invention

[0004] In view of this, the purpose of this invention is to provide an instruction testing method, apparatus, device, and medium that can effectively increase the efficiency of instruction testing and save resource costs. The specific solution is as follows:

[0005] Firstly, this application discloses an instruction testing method, including:

[0006] Determine the local command acquisition port status; the command acquisition port status includes open and closed states;

[0007] If the instruction acquisition port is in an open state, the local test control unit is used to acquire the instruction to be tested, and the instruction to be tested is sent and saved to the local static random access memory.

[0008] The local CPU is used to read and test the instruction to be tested from the static random access memory.

[0009] Optionally, before determining the local command to obtain the port status, the method further includes:

[0010] Establish a connection between the local device and a preset third-party storage device so that the local test control unit can obtain the test instructions containing the address in the preset third-party storage device.

[0011] Optionally, before sending and saving the instruction to be tested to local static random access memory, the method further includes:

[0012] All address information carried in the instruction to be tested is identified, and the status of the address information is detected.

[0013] Optionally, after detecting the status of the address information, the method further includes:

[0014] If the address information is in a start state, the instruction to be tested is sent and saved to the local static random access memory; if the address information is in a stop state, the sending of the instruction to be tested is stopped.

[0015] Optionally, the step of using the local CPU to read and test the instruction to be tested from the static random access memory includes:

[0016] The local CPU is used to read the instruction to be tested from the static random access memory to obtain the reading result;

[0017] The target test program is determined based on the reading results, and then the target test program is executed.

[0018] Optionally, after determining the port status using a local command, the method further includes:

[0019] If the port status obtained by the instruction is closed, then a connection is established between the CPU and the preset interface;

[0020] The CPU determines the instruction to be tested sending request and sends the instruction to be tested sending request to a preset third-party storage device, so that the preset third-party storage device, after receiving the instruction to be tested sending request, sends and saves the instruction to be tested to its local static random access memory.

[0021] Secondly, this application discloses an instruction testing device, comprising:

[0022] The port status determination module is used to determine the port status obtained by local commands; the port status obtained by the commands includes open and closed states.

[0023] The instruction acquisition module is used to acquire the instruction to be tested using the local test control unit if the instruction acquisition port is in the open state, and send and save the instruction to be tested to the local static random access memory.

[0024] The instruction testing module is used to read and test the instruction to be tested from the static random access memory using the local CPU.

[0025] Optionally, the port status determination module is further configured to: if the port status of the instruction acquisition is closed, establish a connection between the CPU and the preset interface; use the CPU to determine the instruction to be tested sending request, and send the instruction to be tested sending request to the preset third-party storage device, so that the preset third-party storage device, after receiving the instruction to be tested sending request, sends and saves the instruction to be tested to its local static random access memory.

[0026] Thirdly, this application discloses an electronic device, including:

[0027] Memory, used to store computer programs;

[0028] A processor for executing the computer program to implement the aforementioned instruction testing method.

[0029] Fourthly, this application discloses a computer storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the steps of the aforementioned disclosed instruction testing method.

[0030] As can be seen, this application provides an instruction testing method, including determining the status of a local instruction fetch port; the instruction fetch port status includes an on state and a off state; if the instruction fetch port status is on, the local test control unit acquires the instruction to be tested, sends the instruction to be tested, and saves it to the local static random access memory; the local CPU reads and tests the instruction to be tested from the static random access memory. This application, by determining the instruction fetch port status, acquiring the instruction to be tested, and storing it in the static random access memory, allows the CPU to directly read and test the instruction to be tested from the static random access memory, thereby effectively increasing the efficiency of instruction testing and saving resource costs. Attached Figure Description

[0031] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0032] Figure 1 This is a flowchart of an instruction testing method disclosed in this application;

[0033] Figure 2 This is a flowchart of an instruction testing method disclosed in this application;

[0034] Figure 3This is a flowchart of a specific instruction testing method disclosed in this application;

[0035] Figure 4 This is a schematic diagram of the structure of an instruction testing device disclosed in this application;

[0036] Figure 5 This application provides a structural diagram of an electronic device. Detailed Implementation

[0037] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0038] Currently, in existing technologies, the CPU first needs to issue a read instruction, which then passes through the peripheral interface module to reach the chip port and read the external storage. This process is slow and time-consuming. After reading the data from the external storage, a write instruction is executed to write the data into the SRAM. The CPU's read / write instruction execution process takes many clock cycles, resulting in a very long time. Debugging is difficult, and this process is charged by time, further increasing costs. Therefore, improving the efficiency of instruction testing and saving resource costs is a problem that needs to be solved in this field.

[0039] See Figure 1 As shown, this embodiment of the invention discloses an instruction testing method, which may specifically include:

[0040] Step S11: Determine the local command acquisition port status; the command acquisition port status includes open and closed states.

[0041] In this embodiment, before determining the status of the local instruction acquisition port, the method further includes: establishing a connection between the local device and a preset third-party storage device, so as to use the local test control unit to acquire the test instruction containing the address in the preset third-party storage device.

[0042] Step S12: If the instruction acquisition port is in the open state, the local test control unit is used to acquire the instruction to be tested, and the instruction to be tested is sent and saved to the local static random access memory.

[0043] In this embodiment, if the instruction acquisition port is in an open state, the local test control unit acquires the instruction to be tested, then determines all the address information carried in the instruction to be tested, and detects the state of the address information. If the state of the address information is in a start state, the instruction to be tested is sent and saved to the local static random access memory. If the state of the address information is in a stop state, the sending of the instruction to be tested is stopped.

[0044] Step S13: Use the local CPU to read and test the instruction to be tested in the static random access memory.

[0045] Understandably, this application first needs to establish a connection between the chip and a preset third-party storage device, and then determine the status of the local instruction acquisition port. If the instruction acquisition port is in an open state, it means that the instruction to be tested containing the address in the preset third-party storage device can be sent to the chip's TCU (Test Control Unit). Then, the chip's SRAM (Static Random-Access Memory) acquires and saves the instruction to be tested in the TCU, and the chip's CPU (Central Processing Unit) can directly test the instruction to be tested in the SRAM.

[0046] In this embodiment, the status of the local instruction acquisition port is determined; the instruction acquisition port status includes an open state and a closed state; if the instruction acquisition port status is open, the local test control unit acquires the instruction to be tested, sends the instruction to be tested, and saves it to the local static random access memory; the local CPU reads and tests the instruction to be tested from the static random access memory. This application, by determining the instruction acquisition port status, then acquiring the instruction to be tested, and storing it in the static random access memory, allows the CPU to directly read and test the instruction to be tested from the static random access memory, thereby effectively increasing the efficiency of instruction testing and saving resource costs.

[0047] See Figure 2 As shown, this embodiment of the invention discloses an instruction testing method, which may specifically include:

[0048] Step S21: Determine the status of the local command acquisition port; the status of the command acquisition port includes an open state and a closed state.

[0049] In this embodiment, after determining the local instruction acquisition port status, the method further includes: if the instruction acquisition port status is closed, establishing a connection between the CPU and a preset interface; using the CPU to determine the instruction to be tested sending request, and sending the instruction to be tested sending request to a preset third-party storage device, so that after the preset third-party storage device receives the instruction to be tested sending request, it sends and saves the instruction to be tested to the local static random access memory.

[0050] Step S22: If the instruction acquisition port is in the open state, the local test control unit is used to acquire the instruction to be tested, and the instruction to be tested is sent and saved to the local static random access memory.

[0051] Step S23: Use the local CPU to read the instruction to be tested from the static random access memory to obtain the reading result, then determine the target test program based on the reading result, and execute the target test program.

[0052] In this embodiment, the status of the local instruction acquisition port is determined; the instruction acquisition port status includes an open state and a closed state. If the instruction acquisition port status is open, the local test control unit acquires the instruction to be tested, sends the instruction to be tested, and saves it to the local static random access memory (SRAM). The local CPU reads the instruction to be tested from the SRAM to obtain the read result, then determines the target test program based on the read result, and executes the target test program. This application, by determining the instruction acquisition port status, acquiring the instruction to be tested, and storing it in SRAM, allows the CPU to directly read and test the instruction to be tested from the SRAM, thereby effectively increasing the efficiency of instruction testing and saving resource costs.

[0053] For example, such as Figure 3As shown, in existing technologies, the CPU first needs to issue a read instruction, which then passes through the peripheral interface module to reach the chip port and read the external storage. This process is slow and time-consuming. After reading the data from the external storage, a write instruction is executed to write the data into the SRAM. The CPU's read / write instruction execution process takes many clock cycles, resulting in a very long time. Debugging is difficult, and this process is charged by time, increasing costs. This application, however, first establishes a connection between the chip and a pre-defined third-party storage device. Then, it determines the status of the local instruction acquisition port. If the instruction acquisition port is open, it means that the instruction to be tested, containing the address in the pre-defined third-party storage device, can be sent to the chip's TCU. The chip's SRAM then acquires and stores the instruction to be tested from the TCU, and the chip's CPU can directly test the instruction to be tested in the SRAM, thereby increasing the efficiency of instruction testing and saving resource costs.

[0054] See Figure 4 As shown, an embodiment of the present invention discloses an instruction testing device, which may specifically include:

[0055] The port status determination module 11 is used to determine the port status obtained by local commands; the port status obtained by commands includes an open state and a closed state.

[0056] The instruction acquisition module 12 is used to acquire the instruction to be tested using the local test control unit if the instruction acquisition port is in the open state, and send and save the instruction to be tested to the local static random access memory.

[0057] The instruction testing module 13 is used to read and test the instruction to be tested from the static random access memory using the local CPU.

[0058] In this embodiment, the status of the local instruction acquisition port is determined; the instruction acquisition port status includes an open state and a closed state; if the instruction acquisition port status is open, the local test control unit acquires the instruction to be tested, sends the instruction to be tested, and saves it to the local static random access memory; the local CPU reads and tests the instruction to be tested from the static random access memory. This application, by determining the instruction acquisition port status, then acquiring the instruction to be tested, and storing it in the static random access memory, allows the CPU to directly read and test the instruction to be tested from the static random access memory, thereby effectively increasing the efficiency of instruction testing and saving resource costs.

[0059] In some specific embodiments, the port status determination module 11 may specifically include:

[0060] The connection establishment module is used to establish a connection between the local device and a preset third-party storage device, so as to obtain the test instructions containing the address of the preset third-party storage device using the local test control unit.

[0061] In some specific embodiments, the instruction acquisition module 12 may specifically include:

[0062] The detection module is used to determine all address information carried in the instruction to be tested and to detect the status of the address information.

[0063] In some specific embodiments, the instruction acquisition module 12 may specifically include:

[0064] The test instruction storage module is used to send and store the test instruction in the local static random access memory if the address information is in the start state, and to stop sending the test instruction if the address information is in the stop state.

[0065] In some specific embodiments, the instruction testing module 13 may specifically include:

[0066] The read result determination module is used to read the instruction to be tested from the static random access memory using the local CPU to obtain the read result;

[0067] The target test program determination module is used to determine the target test program based on the reading result and execute the target test program.

[0068] In some specific embodiments, the port status determination module may specifically include:

[0069] A connection module is used to establish a connection between the CPU and a preset interface if the port status obtained by the instruction is closed.

[0070] The request sending module is used to determine the test instruction sending request using the CPU and send the test instruction sending request to a preset third-party storage device, so that the preset third-party storage device, after receiving the test instruction sending request, sends and saves the test instruction to its local static random access memory.

[0071] Figure 5This is a schematic diagram of an electronic device provided in an embodiment of this application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 stores a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the instruction testing method for execution by the electronic device disclosed in any of the foregoing embodiments.

[0072] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and is not specifically limited here; the input / output interface 25 is used to acquire external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.

[0073] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk or optical disk, etc. The resources stored on it include operating system 221, computer program 222 and data 223, etc., and the storage method can be temporary storage or permanent storage.

[0074] The operating system 221 manages and controls the various hardware devices on the electronic device 20 and the computer program 222 to enable the processor 21 to perform operations and processing on the data 223 in the memory 22. The operating system 221 can be Windows, Unix, Linux, etc. The computer program 222, in addition to including a computer program capable of performing the instruction testing method executed by the electronic device 20 as disclosed in any of the foregoing embodiments, may further include computer programs capable of performing other specific tasks. The data 223 may include data received by the instruction testing device from external devices, as well as data collected by its own input / output interface 25.

[0075] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.

[0076] Furthermore, embodiments of this application also disclose a computer-readable storage medium storing a computer program, which, when loaded and executed by a processor, implements the instruction testing method steps disclosed in any of the foregoing embodiments.

[0077] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0078] The foregoing has provided a detailed description of the instruction testing method, apparatus, device, and storage medium provided by the present invention. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. A method for testing instructions, characterized in that, include: Determine the local command to obtain the port status; The instruction retrieves the port status, including open and closed states. If the instruction acquisition port is in an open state, the local test control unit is used to acquire the instruction to be tested, and the instruction to be tested is sent and saved to the local static random access memory. The local CPU is used to read and test the instruction to be tested from the static random access memory; Before determining the status of the local instruction acquisition port, the process also includes: establishing a connection between the local device and a preset third-party storage device so as to use the local test control unit to acquire the instruction to be tested containing the address in the preset third-party storage device; Before sending and saving the instruction to be tested to the local static random access memory, the process also includes: determining all the address information carried in the instruction to be tested and detecting the status of the address information; After detecting the status of the address information, the process also includes: if the address information is in the start state, the instruction to be tested is sent and saved to the local static random access memory; if the address information is in the stop state, the sending of the instruction to be tested is stopped. The test involves reading and testing the instruction to be tested from the static random access memory using the local CPU, including: reading the instruction to be tested from the static random access memory using the local CPU to obtain the reading result; determining the target test program based on the reading result; and executing the target test program. After determining the local instruction acquisition port status, the process also includes: if the instruction acquisition port status is closed, establishing a connection between the CPU and a preset interface; using the CPU to determine the instruction to be tested sending request, and sending the instruction to be tested sending request to a preset third-party storage device, so that the preset third-party storage device, after receiving the instruction to be tested sending request, sends and saves the instruction to be tested to the local static random access memory.

2. An instruction testing device, characterized in that, include: The port status determination module is used to determine the port status obtained by local commands. The command retrieves the port status, including whether it is open or closed. The instruction acquisition module is used to acquire the instruction to be tested using the local test control unit if the instruction acquisition port is in the open state, and send and save the instruction to be tested to the local static random access memory. The instruction testing module is used to read and test the instruction to be tested from the static random access memory using the local CPU. Before determining the status of the local instruction acquisition port, the process also includes: establishing a connection between the local device and a preset third-party storage device so as to use the local test control unit to acquire the instruction to be tested containing the address in the preset third-party storage device; Before sending and saving the instruction to be tested to the local static random access memory, the process also includes: determining all the address information carried in the instruction to be tested and detecting the status of the address information; After detecting the status of the address information, the process also includes: if the address information is in the start state, the instruction to be tested is sent and saved to the local static random access memory; if the address information is in the stop state, the sending of the instruction to be tested is stopped. The test involves reading and testing the instruction to be tested from the static random access memory using the local CPU, including: reading the instruction to be tested from the static random access memory using the local CPU to obtain the reading result; determining the target test program based on the reading result; and executing the target test program. After determining the local instruction acquisition port status, the process also includes: if the instruction acquisition port status is closed, establishing a connection between the CPU and a preset interface; using the CPU to determine the instruction to be tested sending request, and sending the instruction to be tested sending request to a preset third-party storage device, so that the preset third-party storage device, after receiving the instruction to be tested sending request, sends and saves the instruction to be tested to the local static random access memory.

3. The instruction testing device according to claim 2, characterized in that, The port status determination module is further used to establish a connection between the CPU and the preset interface if the port status is closed; use the CPU to determine the instruction to be tested sending request, and send the instruction to be tested sending request to the preset third-party storage device, so that the preset third-party storage device, after receiving the instruction to be tested sending request, sends and saves the instruction to be tested to its local static random access memory.

4. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the instruction testing method as described in claim 1.

5. A computer-readable storage medium, characterized in that, Used to store computer programs; wherein, when the computer program is executed by a processor, it implements the instruction testing method as described in claim 1.

Citation Information

Patent Citations

  • Method and apparatus for transmitting memory pre-fetch commands on a bus

    CN101048762A

  • Improvement in data collection of data processing apparatus from peripherals thereof

    CN1136849A