Method and device for preventing processor from being stuck during memory access of target program

By screening and protecting the memory address that causes the processor to get stuck, the problem of stuck due to hardware problems during memory access is solved, and the effect of saving time and labor costs is achieved.

CN119045891APending Publication Date: 2024-11-29SHANDONG YUNHAI GUOCHUANG CLOUD COMPUTING EQUIP IND INNOVATION CENT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411038171.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-31
Publication Date
2024-11-29

AI Technical Summary

Technical Problem

In the prior art, processors are prone to being stuck due to hardware problems during memory access, resulting in high troubleshooting time and labor costs, and it is difficult to quickly avoid memory access errors caused by hardware problems.

Method used

By setting the access order and operation of preset memory addresses, the memory addresses stuck in the processor caused by hardware problems are screened out, and protected in the underlying code of the target program to avoid accessing the problematic memory addresses and ensure that the processor is no longer stuck die.

Benefits of technology

It effectively avoids memory access errors caused by hardware problems, saves time and labor costs, and improves the stability and efficiency of program execution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119045891A_ABST
    Figure CN119045891A_ABST
Patent Text Reader

Abstract

The invention provides a method and device for preventing a processor from being jammed during memory access of a target program, and the method comprises the steps: carrying out memory access on memory addresses according to a preset memory operation and a preset access sequence of the memory addresses, and screening a problem memory address which causes the processor to be jammed due to a hardware problem; and protecting the problem memory address in the bottom layer code of the target program, so that the execution process of the target program cannot access the problem memory address. According to the method and the device for preventing the processor from being stuck during memory access of the target program provided by the invention, memory access errors caused by hardware problems during program execution are avoided, troubleshooting processing aiming at the memory access errors caused by the hardware problems is avoided, and the time cost and the labor cost are saved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method and device for preventing a processor from being stuck when a target program performs memory access. Background Art

[0002] With the increase of computer memory capacity and the improvement of data processing requirements, the demand for reading large-scale data is also increasing. Generally speaking, the phenomenon of processor jamming caused by accessing memory addresses inside the chip is fatal, which will cause great trouble to module testing and application execution, etc. It often takes several weeks to troubleshoot, wasting a lot of time and energy. Summary of the invention

[0003] The present invention provides a method and device for preventing a processor from being stuck when a target program accesses memory, so as to solve the defect in the prior art that troubleshooting a processor stuck causes time and manpower consumption, thereby avoiding memory access errors caused by hardware problems during program execution, avoiding troubleshooting of memory access errors caused by hardware problems, and saving time and manpower costs.

[0004] The present invention provides a method for preventing a processor from being stuck when a target program performs memory access, comprising the following steps: performing memory access to the memory addresses according to a preset memory operation in a preset memory address access sequence, screening problematic memory addresses that cause the processor to be stuck due to hardware problems; protecting the problematic memory addresses in the underlying code of the target program, so that the execution process of the target program avoids accessing the problematic memory addresses.

[0005] According to a method for preventing a processor from being stuck when a target program performs memory access, the method of screening a problem memory address that causes a processor to be stuck due to a hardware problem comprises: in response to a memory access to the memory address according to a preset memory operation, if the bus of the processor is able to receive a memory access response signal, then determining that the memory address is a normal memory address; in response to a memory access to the memory address according to a preset memory operation, if the bus of the processor does not receive the memory access response signal, then determining that the memory address is the problem memory address.

[0006] According to a method for preventing a processor from getting stuck when a target program performs memory access, the method comprises: in response to performing a memory access to the memory address according to a preset memory operation, the bus of the processor receives a memory access response signal within a preset time, and then determining that the memory address is a normal memory address.

[0007] According to a method for preventing a processor from getting stuck when a target program performs memory access, the method comprises: in response to performing a memory access to the memory address according to a preset memory operation, if the bus of the processor does not receive the memory access response signal within the preset time, then determining that the memory address is the problem memory address.

[0008] According to a method for preventing a processor from being stuck when a target program performs memory access, the method of screening a problem memory address where the processor is stuck due to a hardware problem comprises: in response to a process being stuck after a memory access is performed on the memory address according to a preset memory operation, further determining whether an abnormal interruption occurs; if it is determined that an abnormal interruption occurs, continuing to execute a next instruction, the next instruction being used to perform a memory access on the next memory address according to the preset memory operation; if it is determined that no abnormal interruption occurs, determining that the memory address is the problem memory address.

[0009] According to a method for preventing a processor from being stuck when a target program performs memory access provided by the present invention, the continuing to execute the next instruction includes: jumping out of an interrupt processing function and continuing to execute the next instruction.

[0010] According to a method for preventing a processor from being stuck when a target program performs memory access, the present invention provides a method for preventing a processor from being stuck when a target program performs memory access. After determining that the memory address is the problem memory address, the method further includes: protecting the problem memory address in the currently executed code to prohibit access, re-executing the access sequence according to a preset memory address, performing memory access to the memory address according to a preset memory operation, and screening the problem memory address that causes the processor to be stuck due to a hardware problem.

[0011] According to a method for preventing a processor from being stuck when a target program performs memory access provided by the present invention, the preset memory operation is a memory read operation or a memory write operation.

[0012] According to a method for preventing a processor from being stuck when a target program performs memory access provided by the present invention, the processor is a single-core processor or a multi-core processor.

[0013] The present invention also provides a device for preventing a processor from being stuck when a target program performs memory access, comprising the following modules: a screening module, for performing memory access to the memory address according to a preset memory operation in accordance with a preset memory address access order, and screening the problematic memory address that causes the processor to be stuck due to a hardware problem; a processing module, for protecting the problematic memory address in the underlying code of the target program, so that the execution process of the target program avoids accessing the problematic memory address.

[0014] The present invention also provides a processor core chip, which runs any of the above-mentioned methods for preventing the processor from being stuck when the target program performs memory access.

[0015] The present invention also provides a processor, which includes the processor core chip.

[0016] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method for preventing the processor from being stuck when the target program accesses memory as described in any one of the above methods is implemented.

[0017] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any of the above-described methods for preventing a processor from being stuck when a target program performs memory access.

[0018] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the method for preventing the processor from being stuck when a target program performs memory access as described in any of the above methods is implemented.

[0019] The method and device for preventing a processor from being stuck when a target program performs memory access provided by the present invention perform memory access to memory addresses according to preset memory operations in a preset memory address access order, screen problematic memory addresses that cause the processor to be stuck due to hardware problems, and protect the problematic memory addresses in the underlying code of the target program, so that the execution process of the target program cannot access the problematic memory addresses, thereby avoiding memory access errors caused by hardware problems during program execution, avoiding troubleshooting of memory access errors caused by hardware problems, and saving time and labor costs. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0021] Figure 1 It is a flow chart of a method provided by the present invention for preventing a processor from being stuck when a target program performs memory access.

[0022] Figure 2 It is a structural schematic diagram of a device provided by the present invention for preventing a processor from being stuck when a target program performs memory access.

[0023] Figure 3 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0024] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are 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.

[0025] First, the relevant knowledge of the present invention is introduced.

[0026] Regarding the phenomenon of exceptions when reading and traversing memory addresses, take the A55 processor as an example. The exception level is represented by ELx, where x is a number between 0 and 3. For example, the lowest level of exception is called EL0, and the levels from low to high are EL0, EL1, EL2, and EL3. Most application code runs at EL0, the operating system runs at EL1, the hypervisor runs at EL2, and EL3 is reserved for underlying firmware and security code. The A type of the Arm architecture implements a virtual memory system, in which the memory management unit (MMU) allows software to assign attributes to regions of memory. These attributes include read / write permissions, which can be configured to allow different access rights for privileged access and non-privileged access. Non-privileged access rights are executed when the processor is at EL0. Privileged access rights are executed at EL1, EL2, and EL3.

[0027] Memory accesses occurring at EL0 are checked against non-privileged access permissions. In contrast, accesses at EL1, EL2, and EL3 are checked against privileged access permissions. Since this memory permission configuration uses the MMU's translation tables, these tables need to be programmed with this privilege in mind. The MMU's configuration is stored in system registers, and the ability to access these registers is also controlled by the current exception level.

[0028] The Armv8-A architecture has many groups of registers with similar functions, whose names differ only by the exception level of the suffix. These registers are independent of each other, encoded differently in the instruction set, and implemented separately in hardware. For example, the following registers configure the MMU for different translation stages. Although the names are similar, each has its own access semantics: •SCTLR_EL1 – registers applicable to EL0 and EL1 levels; •SCTLR_EL2 – registers applicable to EL2 level; •SCTLR_EL3 – registers applicable to EL3 level; An exception interrupt is a program that causes the currently executing program to be blocked, and the current state is changed to execute the program that handles the exception. In the Armv8-A architecture, an interrupt is an externally generated exception. Exceptions are generally divided into two categories: synchronous exceptions and asynchronous exceptions.

[0029] Synchronous exception: An exception caused by or related to the current instruction, which means that synchronous exceptions are synchronous with the execution flow. Synchronous exceptions are usually caused by attempting to execute an invalid instruction, or an instruction that is not allowed or prohibited by the current exception level; it can also be caused by memory access, which may be the result of an unaligned address or because the MMU permission check failed. Because this error is synchronous, the exception can be received before attempting to access the memory. Memory access can also generate asynchronous exceptions. The Armv8-A architecture has a series of exception generation instructions: SVC, HVC, and SMC. These instructions are different from simple invalid instructions because they target different exception levels and are handled differently when prioritizing exceptions. These instructions are used to implement the system call interface to allow less privileged code to request services from more privileged code.

[0030] Asynchronous exceptions: Some types of exceptions are generated externally and are therefore not synchronized with the current instruction stream. This means that it is not possible to guarantee exactly when an asynchronous exception will be received. The Armv8-A architecture only requires that it occur within a limited time. Asynchronous exceptions can also be temporarily masked. This means that an asynchronous exception can remain pending before the exception is accepted. These asynchronous exception types include physical interrupts and virtual interrupts. Physical interrupts are divided into SError (System Error), IRQ, FIQ, and virtual interrupts are divided into vSError (Virtual System Error), vIRQ (Virtual IRQ), and vFIQ (Virtual FIQ). Physical interrupts are generated in response to signals generated externally to the processor. Virtual interrupts can be generated externally or by software executing at EL2. IRQ and FIQ are used to generate peripheral interrupts, have independent routing control, and are often used to implement secure and unsecure interrupts. SError is an exception type generated by the memory system in response to an erroneous memory access. The typical use of SError is an external, asynchronous abort, for example, a memory access passes all MMU checks, but an error occurs on the memory bus. This error may be reported asynchronously because the issued instruction has ended. SError interrupts can also be caused by parity or error correction code (ECC) checks on some RAM, such as the parity codes in built-in cache.

[0031] When handling an exception, the current state must be saved in order to return. The processor will automatically save the exception return address and the current PSTATE (performance state of the processor). The data of the general register must be saved by the software. The processor will update the current PSTATE to the PSTATE defined for the corresponding exception type in the architecture, and then jump from the vector table to the corresponding exception handler (for asynchronous message processing). The PSTATE corresponding to the exception is stored in the system register SPSR_ELx, where ELx is the number of the exception level brought in. The exception return address is stored in ELR_ELx.

[0032] Software can initiate an exception return by executing the ERET instruction in AArch64 (AArc64 is a 64-bit version of the ARM architecture, which is part of the ARMv8 architecture and is designed to provide higher performance and larger address space while maintaining compatibility with the 32-bit ARM architecture). This will cause the exception level to be returned according to the value of SPSR_ELx. SPSR_ELx contains the target level to return to and the execution state to return to. The execution state specified in SPSR_ELx must match any of the configurations in SCR_EL3.RW or HCR_EL2.RW, otherwise it will be illegal. When the ERET instruction is executed, the state will be restored from SPSR_ELx and the program counter will be updated to the value in ELR_ELx. These two updates will be performed atomically and indivisibly so that the processor will not be left in an undefined state.

[0033] In Armv8-A, the vector table is a normal memory area containing instructions. The processor stores the base address of the table in system registers, and each exception type defines an offset from this base address. Each privileged exception level has its own vector table, with the base address defined by VBAR_ELx (Vector Base Address Register). The value of the VBAR register is undefined after reset, and the register must be configured before enabling interrupts.

[0034] Combine the following Figure 1-Figure 3 The present invention describes a method and device for preventing a processor from being stuck when a target program performs memory access.

[0035] Figure 1 FIG. 1 is a flow chart of a method for preventing a processor from being stuck when a target program performs memory access provided by the present invention. Figure 1 As shown, the method includes the following: Step S1, according to a preset memory address access sequence, memory access is performed on the memory address according to a preset memory operation, and the problematic memory address where the processor is stuck due to a hardware problem is screened; The method for preventing a processor from being stuck when a target program performs memory access provided by the present invention is run on a processor, wherein the processor may be a central processing unit (CPU) or a graphics processing unit (GPU).

[0036] As computer storage space continues to expand, a large number of chip peripherals are needed due to the growing trend of processing big data. However, during the execution of a program, the program may stagnate, that is, the process is stuck. There are usually two reasons for the process to be stuck: 1. If the processor's bus cannot receive a response signal, the processor may stop working. This is caused by hardware reasons. 2. If an abnormal interrupt occurs, the processor will enter an abnormal state and suspend the current execution program to handle the event, which will cause the currently executing code to be blocked until the abnormal end. In general, the abnormal interrupt cannot jump out of the exception by itself, causing the process to be stuck. Among them, the processor bus is such as the AXI (Advanced eXtensible Interface) bus of the A55 processor.

[0037] The first reason for the process being stuck as mentioned above will also cause the processor to be stuck. The phenomenon of the processor being stuck due to accessing the memory address inside the chip is fatal, which will cause great trouble to the module testing and application execution, etc., and often takes several weeks to check, wasting a lot of time and energy. Therefore, in the method for preventing the processor from being stuck when the target program performs memory access provided by the present invention, firstly, according to the preset memory address access order, the memory address of the memory is sequentially accessed according to the preset memory operation, and by traversing and accessing all memory addresses in advance, the problem memory address that causes the processor to be stuck due to hardware problems is pre-screened.

[0038] Step S2: Protect the problematic memory address in the underlying code of the target program so that the execution process of the target program avoids access to the problematic memory address.

[0039] After traversing the memory addresses and screening out the problematic memory addresses that cause the processor to freeze due to hardware problems, the problematic memory addresses are protected in the underlying code of the target program so that the execution process of the target program cannot access the problematic memory addresses. The target program can be a test program or an application program.

[0040] The purpose of the present invention is to pre-detect the addresses where the processor is stuck due to hardware when accessing the memory, and to protect these addresses in software to avoid the phenomenon of the processor being stuck during the use of the chip. The present invention is applicable to any processor that accesses the memory. The specific operation method is to perform a preset memory operation on all memory addresses, and screen out the addresses where the processor is stuck due to hardware problems, which is generally caused by the hardware not replying to the response signal. Then the detected problematic addresses are protected in the underlying code so that other operations cannot access these addresses.

[0041] Pre-testing the access to memory addresses will identify and protect the addresses that cause the processor to get stuck in advance, thus avoiding unknown problems caused by this during program execution. This provides preliminary protection for the smooth execution of the program and avoids the misunderstanding of troubleshooting bugs (defects), saving manpower and time. It is a relatively simple and necessary memory detection method.

[0042] The method for preventing a processor from being stuck when a target program performs memory access provided by the present invention performs memory access to memory addresses according to preset memory operations in a preset memory address access order, screens problematic memory addresses that cause the processor to be stuck due to hardware problems, and protects the problematic memory addresses in the underlying code of the target program, so that the execution process of the target program cannot access the problematic memory addresses, thereby avoiding memory access errors caused by hardware problems during program execution, avoiding troubleshooting of memory access errors caused by hardware problems, and saving time and labor costs.

[0043] According to a method for preventing a processor from being stuck when a target program performs memory access, the method of screening a problem memory address that causes a processor to be stuck due to a hardware problem comprises: in response to a memory access to the memory address according to a preset memory operation, if the bus of the processor is able to receive a memory access response signal, then determining that the memory address is a normal memory address; in response to a memory access to the memory address according to a preset memory operation, if the bus of the processor does not receive the memory access response signal, then determining that the memory address is the problem memory address.

[0044] For each memory address, after the memory address is accessed according to the preset memory operation, if the processor bus can receive the memory access response signal, the memory address is determined to be a normal memory address, that is, the memory address can be accessed normally. If the processor bus does not receive the memory access response signal after the memory address is accessed according to the preset memory operation, it means that a hardware problem has occurred and the memory cannot be accessed, and the memory address is determined to be a problem memory address.

[0045] The method for preventing the processor from getting stuck when the target program performs memory access provided by the present invention determines that the memory address is a normal memory address if the processor's bus can receive a memory access response signal after a memory access is performed on the memory address according to a preset memory operation, and determines that the memory address is a problem memory address if the processor's bus does not receive a memory access response signal after a memory access is performed on the memory address according to the preset memory operation, thereby achieving accurate determination of the problem memory address.

[0046] According to a method for preventing a processor from getting stuck when a target program performs memory access, the method comprises: in response to performing a memory access to the memory address according to a preset memory operation, the bus of the processor receives a memory access response signal within a preset time, and then determining that the memory address is a normal memory address.

[0047] Since the signal interaction of memory access requires a certain amount of time, a preset time can be set. After the memory address is accessed according to the preset memory operation, if the processor bus receives the memory access response signal within the preset time, the memory address is determined to be a normal memory address. This preset time can be reasonably set according to the time of the memory feedback response signal to improve the accuracy of the judgment and avoid unnecessary waiting and resource consumption.

[0048] The method provided by the present invention for preventing a processor from being stuck when a target program performs memory access determines that the memory address is a normal memory address when a processor bus receives a memory access response signal within a preset time after performing a memory access to a memory address according to a preset memory operation, thereby improving the accuracy of judging a normal memory address.

[0049] According to a method for preventing a processor from getting stuck when a target program performs memory access, the method comprises: in response to performing a memory access to the memory address according to a preset memory operation, if the bus of the processor does not receive the memory access response signal within the preset time, then determining that the memory address is the problem memory address.

[0050] Since the signal interaction of memory access requires a certain amount of time, a preset time can be set. After the memory address is accessed according to the preset memory operation, if the processor bus does not receive the memory access response signal within the preset time, the memory address is determined to be a problematic memory address. This preset time can be reasonably set according to the time of the memory feedback response signal to improve the accuracy of the judgment and avoid unnecessary waiting and resource consumption.

[0051] The method provided by the present invention for preventing the processor from getting stuck when the target program performs memory access determines that the memory address is a problem memory address if the processor bus does not receive a memory access response signal within a preset time after performing a memory access to the memory address according to a preset memory operation, thereby improving the accuracy of the problem memory address judgment.

[0052] According to a method for preventing a processor from being stuck when a target program performs memory access, the method of screening a problem memory address where the processor is stuck due to a hardware problem comprises: in response to a process being stuck after a memory access is performed on the memory address according to a preset memory operation, further determining whether an abnormal interruption occurs; if it is determined that an abnormal interruption occurs, continuing to execute a next instruction, the next instruction being used to perform a memory access on the next memory address according to the preset memory operation; if it is determined that no abnormal interruption occurs, determining that the memory address is the problem memory address.

[0053] The process may be stuck because the memory cannot be accessed due to hardware reasons, or an abnormal interruption is caused by accessing a memory address that is not allowed to be accessed set in the software. When screening the problem memory address that causes the processor to be stuck due to hardware problems, if it is found that the process is stuck after the memory address is accessed according to the preset memory operation, it is further determined whether an abnormal interruption occurs. For example, it can be determined whether an abnormal interruption occurs by whether the program enters the interrupt processing function. If it is determined that an abnormal interruption occurs, the next instruction is continued to be executed to access the next memory address. That is, since the abnormal interruption will not cause the processor to be stuck, the abnormal interruption is ignored and the next memory address is continued to be accessed. If after the process is stuck, it is determined that no abnormal interruption has occurred, it is determined that the memory cannot be accessed due to hardware problems, and the memory address currently accessed is determined to be the problem memory address.

[0054] The method for preventing the processor from being stuck when the target program performs memory access provided by the present invention further determines whether an abnormal interruption occurs in response to a process being stuck after a memory access is performed on a memory address according to a preset memory operation; if it is determined that an abnormal interruption occurs, the next instruction is continued to be executed, and the next instruction is used to access the next memory address; if it is determined that no abnormal interruption occurs, the memory address is determined to be a problem memory address, thereby achieving accurate determination of the problem memory address.

[0055] According to a method for preventing a processor from being stuck when a target program performs memory access provided by the present invention, the continuing to execute the next instruction includes: jumping out of an interrupt processing function and continuing to execute the next instruction.

[0056] If it is determined that an abnormal interrupt occurs, the next instruction for accessing the next memory address is continued to be executed. The interrupt processing function can be processed so that after entering the interrupt processing function, the interrupt processing function is jumped out and the next instruction is continued to be executed. For example, the loop processing operation of the interrupt processing function is ended.

[0057] The method provided by the present invention for preventing a processor from being stuck when a target program performs memory access ensures smooth troubleshooting of a problematic memory address by jumping out of an interrupt processing function and continuing to execute the next instruction.

[0058] According to a method for preventing a processor from being stuck when a target program performs memory access, the present invention provides a method for preventing a processor from being stuck when a target program performs memory access. After determining that the memory address is the problem memory address, the method further includes: protecting the problem memory address in the currently executed code to prohibit access, re-executing the access sequence according to a preset memory address, performing memory access to the memory address according to a preset memory operation, and screening the problem memory address that causes the processor to be stuck due to a hardware problem.

[0059] According to the preset memory address access order and the preset memory operation, the memory address is accessed to screen the problem memory address caused by the processor being stuck due to hardware problems. Among them, it can be determined whether the memory is inaccessible due to hardware problems by directly judging whether the processor bus receives the memory access response signal, thereby determining whether the memory address is a problem memory address. Alternatively, after the process is stuck, the abnormal interrupt is skipped and the problem memory address is gradually checked and determined.

[0060] Since the inability to access the problematic memory address is caused by hardware reasons, the program cannot continue to execute. In order to further pre-access and check the subsequent memory addresses, it is necessary to protect the currently checked problematic memory address in the currently running code. Then, after the program is re-run, the problematic memory address will no longer be accessed, ensuring that the program can be executed and continue to check whether other memory addresses are problematic memory addresses.

[0061] Therefore, after determining that the memory address is the problem memory address, the problem memory address is protected in the currently executed code to prohibit access, and the access sequence of the preset memory address is re-executed, and the memory address is accessed according to the preset memory operation, and the steps of screening the problem memory address that causes the processor to be stuck due to hardware problems are performed, thereby achieving a comprehensive check of the memory address.

[0062] The method for preventing the processor from being stuck when the target program performs memory access provided by the present invention protects the problem memory address in the currently executed code to prohibit access after determining that the memory address is a problem memory address, re-executes the access sequence of the preset memory address, performs memory access to the memory address according to the preset memory operation, and screens the problem memory address that causes the processor to be stuck due to hardware problems, thereby ensuring a comprehensive investigation of the memory address.

[0063] According to a method for preventing a processor from being stuck when a target program performs memory access provided by the present invention, the preset memory operation is a memory read operation or a memory write operation.

[0064] The memory address can be accessed based on the read memory operation or the write memory operation. However, since the write operation will change the storage content of the memory address, it is recommended to use the read operation to access the memory address.

[0065] As a testing technology, the present invention has no complicated codes and only needs to perform read and write operations on the set addresses. The operation is simple and saves manpower and time in stages such as modular testing.

[0066] The method for preventing a processor from being stuck when a target program performs memory access provided by the present invention improves flexibility by accessing a memory address based on a memory read operation or a memory write operation.

[0067] According to a method for preventing a processor from being stuck when a target program performs memory access provided by the present invention, the processor is a single-core processor or a multi-core processor.

[0068] In the method for preventing the processor from being stuck when the target program performs memory access provided by the present invention, the processor can be a single-core processor or a multi-core processor. For a single-core processor, the program for executing the method for preventing the processor from being stuck when the target program performs memory access provided by the present invention can be run on the core chip (processor core) of the processor. For a multi-core processor, since the result is the same regardless of which core is used for memory access, the program for executing the method for preventing the processor from being stuck when the target program performs memory access provided by the present invention can be run on any core chip of the multi-core processor.

[0069] The present invention has no limitation on the processor type, and its main purpose is to identify all addresses where the processor is stuck due to the hardware not replying to the response signal, and to protect such addresses so that subsequent modular testing and other operations will not cause unknown errors.

[0070] The method for preventing a processor from being stuck when a target program performs memory access provided by the present invention can be applicable to a single-core processor or a multi-core processor.

[0071] The following is a description of the device for preventing the processor from getting stuck when the target program accesses memory provided by the present invention. The device for preventing the processor from getting stuck when the target program accesses memory described below and the method for preventing the processor from getting stuck when the target program accesses memory described above can be referenced to each other.

[0072] Figure 2 Schematic diagram of the structure of the device provided by the present invention for preventing the processor from being stuck when the target program performs memory access. Figure 2 As shown, the device includes a screening module 10 and a processing module 20, wherein: the screening module 10 is used to: perform memory access to the memory address according to a preset memory operation in accordance with a preset memory address access order, and screen the problematic memory address that causes the processor to be stuck due to hardware problems; the processing module 20 is used to: protect the problematic memory address in the underlying code of the target program so that the execution process of the target program avoids accessing the problematic memory address.

[0073] The device for preventing the processor from being stuck when the target program performs memory access provided by the present invention performs memory access to the memory address according to a preset memory operation in accordance with a preset memory address access order, screens the problematic memory addresses that cause the processor to be stuck due to hardware problems, and protects the problematic memory addresses in the underlying code of the target program, so that the execution process of the target program cannot access the problematic memory addresses, thereby avoiding memory access errors caused by hardware problems during program execution, avoiding troubleshooting of memory access errors caused by hardware problems, and saving time and labor costs.

[0074] The present invention also provides a processor chip for running any of the methods provided in the above embodiments for preventing the processor from being stuck when a target program performs memory access.

[0075] The present invention also provides a processor, comprising the processor chip described in the above embodiment.

[0076] Figure 3 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 3 As shown, the electronic device may include: a processor 310, a communication interface 320, a memory 330 and a communication bus 340, wherein the processor 310, the communication interface 320 and the memory 330 communicate with each other through the communication bus 340. The processor 310 may call the logic instructions in the memory 330 to execute a method for preventing the processor from being stuck when the target program performs memory access, the method comprising: performing memory access to the memory address according to a preset memory operation in a preset memory address access sequence, screening the problem memory address that causes the processor to be stuck due to hardware problems; protecting the problem memory address in the underlying code of the target program, so that the execution process of the target program avoids access to the problem memory address.

[0077] In addition, the logic instructions in the above-mentioned memory 330 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0078] On the other hand, the present invention also provides a computer program product, which includes a computer program, and the computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the method provided by the above-mentioned methods to prevent the processor from getting stuck when the target program accesses memory. The method includes: according to a preset memory address access order and according to preset memory operations, memory access is performed on the memory address to screen for problem memory addresses that cause the processor to get stuck due to hardware problems; the problem memory addresses are protected in the underlying code of the target program so that the execution process of the target program avoids accessing the problem memory addresses.

[0079] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, it is implemented to execute the method provided by the above-mentioned methods to prevent the processor from getting stuck when the target program accesses memory. The method includes: according to a preset memory address access order and according to a preset memory operation, memory access is performed on the memory address to screen for problem memory addresses that cause the processor to get stuck due to hardware problems; the problem memory addresses are protected in the underlying code of the target program so that the execution process of the target program avoids accessing the problem memory addresses.

[0080] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0081] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0082] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for preventing a processor from being stuck when a target program accesses memory, characterized in that: include: According to a preset memory address access sequence, memory access is performed on the memory address according to a preset memory operation, and the problematic memory address where the processor is stuck due to a hardware problem is screened; The problematic memory address is protected in the underlying code of the target program so that the execution process of the target program avoids access to the problematic memory address.

2. The method for preventing a processor from being stuck when a target program performs memory access according to claim 1, characterized in that: The screening of problematic memory addresses that cause the processor to freeze due to hardware problems includes: In response to a memory access to the memory address according to a preset memory operation, the bus of the processor is able to receive a memory access response signal, then determining that the memory address is a normal memory address; In response to the processor bus not receiving the memory access response signal after the memory address is accessed according to a preset memory operation, the memory address is determined to be the problematic memory address.

3. The method for preventing a processor from being stuck when a target program performs memory access according to claim 2, characterized in that: In response to performing a memory access to the memory address according to a preset memory operation, the bus of the processor receives a memory access response signal, and then determines that the memory address is a normal memory address, including: In response to performing a memory access to the memory address according to a preset memory operation, if the bus of the processor receives a memory access response signal within a preset time, the memory address is determined to be a normal memory address.

4. The method for preventing a processor from being stuck when a target program performs memory access according to claim 3, characterized in that: In response to the memory access being performed on the memory address according to the preset memory operation, if the bus of the processor does not receive the memory access response signal, determining that the memory address is the problematic memory address includes: In response to the memory access being performed on the memory address according to a preset memory operation, if the bus of the processor does not receive the memory access response signal within the preset time, the memory address is determined to be the problematic memory address.

5. The method for preventing a processor from being stuck when a target program performs memory access according to claim 1, characterized in that: The screening of problematic memory addresses that cause the processor to freeze due to hardware problems includes: In response to a process being stuck after a memory access is performed on the memory address according to a preset memory operation, further determining whether an abnormal interruption occurs; If it is determined that an abnormal interruption occurs, continue to execute a next instruction, wherein the next instruction is used to perform a memory access to a next memory address according to the preset memory operation; If it is determined that no abnormal interruption occurs, the memory address is determined to be the problematic memory address.

6. The method for preventing a processor from being stuck when a target program performs memory access according to claim 5, characterized in that: The step of continuing to execute the next instruction includes: Jump out of the interrupt handling function and continue executing the next instruction.

7. The method for preventing a processor from being stuck when a target program performs memory access according to claim 2 or 5, characterized in that: After determining that the memory address is the problematic memory address, the method further includes: The problematic memory address is protected in the currently executed code to prohibit access, the access sequence of the preset memory address is re-executed, the memory address is accessed according to the preset memory operation, and the problematic memory address that causes the processor to be stuck due to hardware problems is screened.

8. The method for preventing a processor from being stuck when a target program performs memory access according to claim 1, characterized in that: The preset memory operation is a memory read operation or a memory write operation.

9. The method for preventing a processor from being stuck when a target program performs memory access according to claim 1, characterized in that: The processor is a single-core processor or a multi-core processor.

10. A device for preventing a processor from being stuck when a target program accesses memory, characterized in that: include: A screening module is used to: perform memory access to the memory addresses according to a preset memory operation in a preset memory address access sequence, and screen the problematic memory addresses where the processor is stuck due to hardware problems; The processing module is used to protect the problematic memory address in the underlying code of the target program so that the execution process of the target program avoids access to the problematic memory address.

11. A processor core chip, characterized in that: The processor core chip runs the method for preventing the processor from getting stuck when the target program accesses memory as described in any one of claims 1 to 9.

12. A processor, characterized in that: The processor includes the processor core chip.

13. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the method for preventing the processor from being stuck when the target program accesses memory as described in any one of claims 1 to 9 is implemented.

14. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for preventing the processor from being stuck when the target program performs memory access as described in any one of claims 1 to 9 is implemented.

15. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the method for preventing the processor from being stuck when the target program performs memory access as described in any one of claims 1 to 9 is implemented.