[go: up one dir, main page]

WO2017202083A1 - Microcode debugging method and single board - Google Patents

Microcode debugging method and single board Download PDF

Info

Publication number
WO2017202083A1
WO2017202083A1 PCT/CN2017/074452 CN2017074452W WO2017202083A1 WO 2017202083 A1 WO2017202083 A1 WO 2017202083A1 CN 2017074452 W CN2017074452 W CN 2017074452W WO 2017202083 A1 WO2017202083 A1 WO 2017202083A1
Authority
WO
WIPO (PCT)
Prior art keywords
debugging
instruction
microcode
breakpoint
debug
Prior art date
Application number
PCT/CN2017/074452
Other languages
French (fr)
Chinese (zh)
Inventor
姜海明
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2017202083A1 publication Critical patent/WO2017202083A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Prevention of errors by analysis, debugging or testing of software
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Prevention of errors by analysis, debugging or testing of software
    • G06F11/362Debugging of software
    • G06F11/3648Debugging of software using additional hardware

Definitions

  • the present invention relates to the field of communications technologies, and in particular, to a microcode debugging method, a single board, and a computer storage medium.
  • the core unit of the NP Network Processor
  • the micro-engine resides in the micro-code for processing the message data.
  • the microcode execution is triggered. If you need to debug the microcode, you usually set the hardware breakpoint in the microcode, and then let the microcode instruction step by step. Then, the context content of the message after the single-step execution is read, and the context content of the message is modified, and the context content of the message includes the register resource information of the context of the message and the content of the message.
  • the network port of the computer 1 is directly connected to the network port of the board 2, and the IDE (Integrated Development Environment) program is run on the computer 1.
  • the IDE is an application provided to the user for the program development environment, which typically includes a code editor, compiler, debugger, and graphical user interface tools.
  • debugging of many programs requires the use of an IDE environment.
  • the embodiment of the present invention is intended to provide a microcode debugging method for solving the technical problem of an IDE environment supporting the microcode on a computer when debugging the microcode in the prior art.
  • An embodiment of the present invention provides a microcode debugging method, including:
  • the present invention provides a board, including a network processor and a memory, the network processor including a micro engine;
  • the micro engine is configured to, when executing a breakpoint instruction, control the microcode to enter a debugging state, and invoke a pre-stored debugging program on the board;
  • the micro engine is further configured to debug the microcode on the board according to the debugging program.
  • the microcode debugging method and the board provided by the embodiment of the invention when executing the breakpoint instruction, enable the microcode to enter the debugging state, and call the pre-stored debugging program on the board to debug the microcode on the board.
  • the debugging program since the debugging program is stored on the board in advance, in the subsequent debugging process, the debugging program is not required to be sent to the board through the IDE, so it is not required to be on the computer.
  • Running the IDE program simplifies the debugging process of the microcode, and since the computer is no longer required to support the operation of the IDE program, the requirements for the device to be debugged are also reduced, thereby improving the user experience.
  • FIG. 1 is a schematic diagram of debugging a single board microcode in the prior art
  • FIG. 2 is a schematic flowchart of a microcode debugging method according to Embodiment 1 of the present invention
  • FIG. 3 is a schematic structural diagram of a microcode debugging apparatus according to Embodiment 2 of the present invention.
  • FIG. 4 is a schematic diagram of a first structure of an instruction debugging module according to Embodiment 2 of the present invention.
  • FIG. 5 is a schematic diagram of a second structure of an instruction debugging module according to Embodiment 2 of the present invention.
  • FIG. 6 is a schematic diagram of a third structure of an instruction debugging module according to Embodiment 2 of the present invention.
  • FIG. 7 is another schematic structural diagram of a microcode debugging apparatus according to Embodiment 2 of the present invention.
  • FIG. 8 is a schematic structural diagram of a single board according to Embodiment 3 of the present invention.
  • FIG. 9 is a schematic flowchart of a method for debugging a micro-board of a third board according to an embodiment of the present invention.
  • the driver software can be run on the CPU, and the CPU is provided with a debug network port for receiving the debugger.
  • the driver software running on the CPU will host an agent client that connects to the IDE of the computer through a Socket (socket) and receives messages sent by the IDE.
  • the IDE encapsulates the control commands to be sent to the microcode into messages, which are sent to the agent via the Socket.
  • the Agent program parses the message sent by the IDE and performs corresponding operations on the micro engine through the CPU interface of the NP. This method requires the micro-engine to have a dedicated DEBUG (debug) module, the DEBUG module is used to access the micro-engine internal registers and header storage space and other resources.
  • DEBUG debug
  • the embodiment of the present invention provides a microcode debugging method, in which a debugging program stored on a calling board is called in advance, and when debugging is required, a debugging program pre-stored on the board is called for debugging, thereby It is not necessary to be debugged by the IDE, which simplifies the debugging of the debugging program and direct debugging processing, and improves the debugging efficiency.
  • Embodiment 1 is a diagrammatic representation of Embodiment 1:
  • This embodiment provides a microcode debugging method. Referring to FIG. 2, the method includes:
  • the microengine in addition to the microcode, has a section of code dedicated to debugging, which is the debugger.
  • the debugger is called when the microengine in the network processor executes a breakpoint instruction.
  • the debugger includes a variety of code that can implement a certain function, including setting a breakpoint (Set Breakpoint), reading registers (Registers) or message content (Packet memory), modifying registers or message content, and stepping through (Single Step), Run (Continue), etc.
  • the debugger can execute the corresponding code according to the debug instructions input by the user and then implement the corresponding functions.
  • the debugging instructions are sent to the CPU through the computer and then stored in the first storage space.
  • the first storage space can be set to a SRAM (Static Random Access Memory) on the network processor and set outside the network processor. SRAM or DRAM (Dynamic Random-Access Memory) set outside the network processor.
  • the user can input various debugging commands through the CLI (command-line interface).
  • the CLI refers to an interface that can input executable instructions at the user prompt. It usually does not support the mouse.
  • the user inputs commands through the keyboard and receives the CPU.
  • the CLI instruction is stored after the instruction.
  • the micro engine goes from the first storage space
  • the debug command is read, and the debugger is controlled to implement the function desired by the user according to the debug command.
  • the manner of debugging the microcode on the board according to the read debugging instruction includes the following:
  • the first type when reading the information storage instruction, stores the debugging information into the second storage space, and the debugging information includes the register resource of the message context and the content of the message.
  • the debug information here includes the register resource information of the message context, for example, the register identifier of the register of the message context.
  • the second storage space may be an SRAM disposed on a network processor, an SRAM disposed outside the network processor, or a DRAM disposed outside the network processor.
  • the first storage space and the second storage space may be different storage addresses belonging to the same memory, or may belong to different memories.
  • the CPU may be notified by the interrupt, so that the CPU can read the debugging information in the second storage space in a first time and further display it to the user.
  • the debugging information needs to be modified, that is, the register resource of the message context and the content of the message need to be modified, and the result of the modification is modified. If it does not match the user's expectations, it indicates that there is a problem with the microcode instruction. If it matches the user's expectations, it can be determined that the microcode instruction has no problem.
  • the breakpoint end instruction includes two types, one is Used to control the direct exit of the debug state, for example, the user enters Continue as a debug command in the CLI interface.
  • the other is a single-step execution instruction, which is used to write the previously stored original microcode instruction back to the previous current breakpoint instruction, and the next sentence of the line
  • the original microcode instruction is replaced with a breakpoint instruction and the original microcode instruction is stored, and then the debug instruction is issued to notify the debug state, trigger a new breakpoint, and re-enter the debug state from the new breakpoint.
  • the user If the user is currently debugging the microcode instruction on line 37 and then wants to perform a single step, the user can enter "Single Step" via the CLI.
  • the microengine can first replace the 37-line breakpoint instruction with the stored original microcode instruction, then replace the 38-line original microcode instruction with a breakpoint instruction, and save the 38-line original microcode instruction at 38th. After the instruction of the line is debugged, the original microcode instruction is written back.
  • the breakpoint command is set in the preset position according to the breakpoint setting instruction.
  • a breakpoint instruction Therefore, from the body, setting the breakpoint command must be before debugging.
  • a breakpoint instruction can also be set during the debugging process, but the breakpoint instruction set at this time is used for the next debugging, and the microengine is executed again when it is executed to other positions of the microcode. status.
  • the other location mentioned here is the location reserved by the user, and the user can determine the location of the breakpoint instruction by specifying the line number.
  • a method for setting a breakpoint instruction is provided: replacing the original microcode instruction at the breakpoint to a breakpoint instruction. Since the breakpoint instruction needs to be restored to the original microcode instruction after the debugging at the breakpoint instruction ends, the original microcode instruction needs to be saved while replacing the original microcode instruction with the breakpoint instruction.
  • a partial code of a debugger is provided below for reference by those skilled in the art, as follows:
  • Case 1 Store (SRAM.rsp, info), the read debugging information is stored in the RSP space;
  • the debugger is mainly used to read the debug instruction from the cmd space in the SRAM, and then execute the corresponding program according to the read debug instruction, for example, when the instruction is read from the cmd space.
  • the program of Case 1 is executed, and the read debug information is stored in the RSP space of the SRAM, and the debug information includes the register resource of the message context and the content of the message.
  • the read command is "2”
  • the debug information is modified.
  • the debug command is "3"
  • the debug is exited, and the microengine continues to execute the microcode normally.
  • the debug instructions are not required to be stored in the cmd space. Similarly, it is not required to store debug information in the RSP space of the SRAM.
  • the debugging information is read by the CPU and displayed to the user through the display device, and the debugging instruction is used to indicate which code the debugger in the network processor should execute. Therefore, the reason why the debug instructions and debug information are stored separately is to allow the CPU and the micro engine to determine which information to read.
  • the CPU can read the debugging information instead of the debugging instruction and let the micro engine read the correct debugging instruction instead of the debugging information, even if the debugging instruction and the debugging information are not stored separately. It doesn't matter. For example, all debug information is prefixed to distinguish it from debug instructions without a prefix. In this case, the CPU reads the information with the specific prefix as a debug when reading the information. Information, and the micro engine only reads information without the prefix as a debug command.
  • the debugging program since the debugging program is stored on the board in advance, in the subsequent debugging process, the debugging program is not required to be sent to the board through the IDE.
  • the need to run the IDE program on the computer simplifies the debugging process of the microcode, and since the computer is no longer required to support the operation of the IDE program, the requirements for the device to be debugged are also reduced, thereby improving the user experience.
  • Embodiment 2 is a diagrammatic representation of Embodiment 1:
  • the embodiment provides a microcode debugging device.
  • the microcode debugging method provided in the first embodiment can be run on the microcode debugging device. Please refer to FIG. 3:
  • the microcode debugging device 30 includes a program invocation module 301 and an instruction debugging module 302.
  • the program invocation module 301 is configured to call a pre-stored debugger on the board when the breakpoint instruction is executed.
  • the microengine in addition to the microcode, has a section of code dedicated to debugging, which is the debugger.
  • the program call module 301 will call the debugger.
  • the instruction debugging module 302 is configured to debug the microcode on the board according to the debugging program.
  • the debugger includes a variety of code that can implement a function, including setting breakpoints, reading registers or message contents, modifying registers or message contents, stepping through, running, and so on.
  • the debugger can execute the corresponding code according to the debug instructions input by the user and then implement the corresponding functions.
  • the instruction debugging module 302 is further configured to receive a debugging instruction input by the user before debugging the microcode on the board according to the debugging program.
  • the debugging instructions are sent to the CPU through the computer and then stored in the first storage space.
  • the first storage space may be an SRAM disposed on the network processor, an SRAM disposed outside the network processor, or a DRAM disposed outside the network processor. .
  • the user can input various debugging instructions through the CLI.
  • the CLI refers to an interface that can input executable instructions at the user prompt. It usually does not support the mouse.
  • the user inputs commands through the keyboard, and the CPU stores the CLI instructions after receiving the instructions.
  • the micro engine After the CPU stores the debug instruction to the first storage space, the micro engine reads the debug instruction from the first storage space, and the instruction debug module 302 controls the debug program to implement the function desired by the user according to the debug instruction.
  • the instruction debug module 302 includes a first debug module 3021.
  • the first debugging module 3021 is configured to store the debugging information to the second storage space when the information storage instruction is read, where the debugging information includes a register resource of the message context and a message content.
  • the second storage space may be an SRAM disposed on a network processor, an SRAM disposed outside the network processor, or a DRAM disposed outside the network processor.
  • the first storage space and the second storage space may be different storage addresses belonging to the same memory, or may belong to different memories.
  • the CPU may be notified by the interrupt, so that the CPU can read the debugging information in the second storage space in a first time and further display it to the user.
  • the instruction debug module 302 includes a second debug module 3022.
  • the second debugging module 3022 is configured to modify the debugging information when the information modification instruction is read.
  • the debugging information needs to be modified, that is, the register resource of the message context and the content of the message need to be modified, and the result of the modification is modified. If it does not match the user's expectations, it indicates that there is a problem with the microcode instruction. If it matches the user's expectations, it can be determined that the microcode instruction has no problem.
  • the instruction debugging module 302 shown in FIG. 6 includes a third debugging module 3023 for controlling the current breakpoint instruction to exit the debugging state when reading the breakpoint end instruction.
  • the breakpoint end instruction includes two types, one is for controlling to directly exit the debug state, for example, the user inputs Continue as a debug command in the CLI interface. Another one The single-step execution instruction is used to write the previously stored original microcode instruction back to the previous current breakpoint instruction, replace the original microcode instruction of the next sentence of the line with a breakpoint instruction and store the original micro Code instruction. Then issue a debug command to notify the debug state, trigger a new breakpoint, and re-enter the debug state from the new breakpoint. If the user is currently debugging the microcode instruction on line 37 and then wants to perform a single step, the user can enter "Single Step" via the CLI.
  • the microengine can first replace the 37-line breakpoint instruction with the stored original microcode instruction, then replace the 38-line original microcode instruction with a breakpoint instruction, and save the 38-line original microcode instruction at 38th. After the instruction of the line is debugged, the original microcode instruction is written back.
  • instruction debug module can include the first, second, third, and fourth debug modules described above.
  • the microcode debugging apparatus 30 further includes a breakpoint setting module 300 configured to be configured to be pre-stored in the instruction debugging module 302. Before the program, set a breakpoint command at the preset position according to the breakpoint setting command. Before debugging a piece of microcode, the breakpoint setting module 300 must first set at least one breakpoint instruction. At the same time, since the debugging process is triggered by the breakpoint instruction, it must be guaranteed before each entry into the debug state. There is at least one breakpoint instruction in the debug code. Therefore, in the body, the breakpoint setting module 300 sets the breakpoint instruction must be before debugging.
  • the breakpoint setting module 300 is configured to also set a breakpoint instruction, but only the breakpoint instruction set by the breakpoint setting module 300 is used for the next debugging, which is The microengine enters the debug state again when it executes to other locations in the microcode.
  • the other location mentioned here is the location reserved by the user, and the user can determine the location of the breakpoint instruction by specifying the line number.
  • the breakpoint setting module 300 is provided with a setting method of a breakpoint instruction: the original microcode instruction at the breakpoint needs to be replaced with a breakpoint instruction. Since the breakpoint instruction needs to be restored to the original microcode instruction after the debugging at the breakpoint instruction ends, the original microcode instruction needs to be saved while replacing the original microcode instruction with the breakpoint instruction.
  • a partial code of a debugger is provided below for reference by those skilled in the art, as follows:
  • Case 1 Store (SRAM.rsp, info), the read debugging information is stored in the RSP space;
  • the debugger is mainly used to read the debug instruction from the cmd space in the SRAM, and then execute the corresponding program according to the read debug instruction, for example, when the instruction is read from the cmd space.
  • the program of Case 1 is executed, and the read debug information is stored in the RSP space of the SRAM, and the debug information includes the register resource of the message context and the content of the message.
  • the read command is "2”
  • the debug information is modified.
  • the debug command is "3"
  • the debug is exited, and the microengine continues to execute the microcode normally.
  • the above example stores the debug instructions in the cmd space of the SRAM and stores the debug information in the RSP space of the SRAM, it can be understood that in the actual application process, the debug instructions are not required to be stored in the cmd space. Internally, the same is not required to store debug information in the RSP space of the SRAM.
  • the debugging information is read by the CPU and displayed to the user through the display device, and the debugging instruction is used to indicate which code the debugger in the network processor should execute. Therefore, the reason why the debug instructions and debug information are stored separately is to allow the CPU and the micro engine to determine which information to read.
  • the micro engine reads the correct tone. Trying instructions instead of debugging information, it doesn't matter if the debug instructions are not stored separately from the debug information. For example, all debug information is prefixed to distinguish it from debug instructions without a prefix. In this case, the CPU reads the information with the specific prefix as a debug when reading the information. Information, and the micro engine only reads information without the prefix as a debug command.
  • Embodiment 3 is a diagrammatic representation of Embodiment 3
  • This embodiment provides a board that includes a network processor and a memory.
  • a micro-engine in the network processor.
  • the micro-engine stores the micro-code. If a breakpoint is set in the micro-code, when the micro-engine is configured to execute the breakpoint instruction, it will enter the debug state.
  • the stored debugger debugs the microcode in the microengine.
  • the debugger can also reside in the microengine like the microcode. After reading the debug command, the debugger is used to debug the microcode in the microengine according to the debug command.
  • the board 80 includes a network processor 801 and a memory 802.
  • the memory 802 may be disposed on the network processor 801, or may be configured with a network processor 801 on the board 80.
  • the board 80 further includes a central processing unit 803.
  • the central processing unit 803 is connected to the network processor 801 via PCI-E.
  • the user can send a debugging instruction from the computer to the central processing unit 803 through the CLI interface, and the central processing unit 803 can store the debugging instruction in the first storage space of the memory 802, and the micro engine 8011 can be from the first
  • the debug instructions are read in the storage space and debugged according to the debug instructions by the debugger.
  • the micro engine 8011 may store the debug information to the second storage space of the memory 802 and notify the central processor 803 to enable the central processor 803 to access the second storage space.
  • the debug information is read and displayed to the user through the display device.
  • the debug information includes a register resource of the message context and a message content.
  • the micro engine stores the debugging information into the RSP space of the memory.
  • the debug information includes the contents of the register and the packet header.
  • S902 The micro engine triggers an interrupt to notify the central processing unit
  • the central processor reads the debugging information from the RSP space of the memory.
  • the information read by the central processing unit can be displayed to the user through a computer connected to the board, allowing the user to obtain debugging information, and then issuing debugging instructions from the CLI interface according to the debugging information.
  • the central processor stores the debugging instruction in a cmd space of the memory.
  • debugging instructions which can be used to set breakpoints, read registers or message contents, modify registers or message contents, single-step execution, and run.
  • breakpoint instruction is set in the above scheme during the debugging process, that is, after entering the debug state, those skilled in the art should understand that the debug process is triggered by the breakpoint instruction, so each time the debug state is entered. It must also be ensured that at least one breakpoint instruction exists in the debugged code. So, in general, setting breakpoint instructions must be before debugging.
  • the breakpoint instruction set during the debugging process is used for the next debugging, and the microengine enters the debugging state again when it executes to other positions of the microcode.
  • the other location mentioned here is the location reserved by the user, and the user can determine the location of the breakpoint instruction by specifying the line number.
  • the way to set the breakpoint instruction in this embodiment is to replace the original microcode instruction at the breakpoint to be a breakpoint instruction. Since the breakpoint instruction needs to be restored to the original microcode instruction after the debugging at the breakpoint instruction ends, the original microcode instruction needs to be saved while replacing the original microcode instruction with the breakpoint instruction.
  • the microengine reads the debugging instruction from the cmd space of the memory.
  • the micro engine After the micro engine reads the debug instruction, it can control the debugger to execute the corresponding code. Now the user wants the function. For example, setting a breakpoint, reading a register or message content, or modifying a register or message content.
  • the debugger that pre-stores the microcode on the board provided in this embodiment enters the debug state when the microengine executes the breakpoint instruction, and invokes the debugger to debug the microcode on the board.
  • debugging the microcode on the board provided by the present invention since the board itself has a debugging program, there is no need to send a debugging program through the IDE, so there is no need to run the IDE program on the computer, which simplifies the debugging of the microcode. The process, and because the computer is no longer required to support the operation of the IDE program, it also reduces the requirements for the device to be debugged, thereby improving the user experience.
  • modules or steps of the present invention can be implemented by a general-purpose computing device, which can be concentrated on a single computing device or distributed over a network composed of multiple computing devices.
  • they may be implemented by program code executable by the computing device such that they may be stored in a storage medium (ROM/RAM, diskette, optical disk) by a computing device, and in some cases
  • the steps shown or described may be performed in an order different than that herein, or they may be separately fabricated into individual integrated circuit modules, or a plurality of the modules or steps may be implemented as a single integrated circuit module. Therefore, the invention is not limited to any particular combination of hardware and software.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

Provided are a microcode debugging method and a single board. In the microcode debugging method, when a breakpoint instruction is executed, a microcode on a single board is debugged by invoking a debugging program stored in advance on the single board. In the microcode debugging method provided in the present invention, since a debugging program is stored in advance on a single board, in a subsequent debugging process, there is no need to issue the debugging program to the single board again via an IDE.

Description

微码调试方法及单板Microcode debugging method and board 技术领域Technical field
本发明涉及通信技术领域,尤其涉及一种微码调试方法、单板和计算机存储介质。The present invention relates to the field of communications technologies, and in particular, to a microcode debugging method, a single board, and a computer storage medium.
背景技术Background technique
现今网络发展速度惊人,网络流量的增长及新业务的出现,需要网络设备具有线速和灵活的处理能力。网络处理器凭借其高速处理的优点及灵活的可编程性,已成为当今网络中数据处理的有效工具。Today's network development is amazing, network traffic growth and the emergence of new services require network equipment to have wire-speed and flexible processing capabilities. With its high-speed processing advantages and flexible programmability, network processors have become an effective tool for data processing in today's networks.
NP(Network Processor,网络处理器)的核心单元是微引擎,微引擎中驻留有用于对报文数据进行处理的微码。当报文进入微引擎后,就触发微码执行。如果需要对微码进行调试,一般都是在微码中设置硬件断点,然后让微码指令单步执行。然后读取单步执行后的报文上下文内容,对报文上下文内容进行修改等,其中报文上下文内容包括该报文上下文的寄存器资源信息及报文内容。The core unit of the NP (Network Processor) is the micro-engine, and the micro-engine resides in the micro-code for processing the message data. When the message enters the microengine, the microcode execution is triggered. If you need to debug the microcode, you usually set the hardware breakpoint in the microcode, and then let the microcode instruction step by step. Then, the context content of the message after the single-step execution is read, and the context content of the message is modified, and the context content of the message includes the register resource information of the context of the message and the content of the message.
为了对微码进行调试,目前,比较通用的方案如图1所示,电脑1的网口与单板2的网口直连,电脑1上运行IDE(Integrated Development Environment,集成开发环境)程序。IDE是提供给用户用于程序开发环境的应用程序,其一般包括代码编辑器、编译器、调试器和图形用户界面工具。目前许多程序的调试都需要使用与之配套的IDE环境才行。In order to debug the microcode, at present, the general scheme is as shown in FIG. 1. The network port of the computer 1 is directly connected to the network port of the board 2, and the IDE (Integrated Development Environment) program is run on the computer 1. The IDE is an application provided to the user for the program development environment, which typically includes a code editor, compiler, debugger, and graphical user interface tools. At present, debugging of many programs requires the use of an IDE environment.
然而在具体应用时发现,现有技术对微码的调试非常复杂。 However, it has been found in the specific application that the debugging of the microcode in the prior art is very complicated.
发明内容Summary of the invention
本发明实施例期望提供一种微码调试方法,用于解决现有技术中对微码进行调试的时候必须在电脑上运行与该微码配套的IDE环境的技术问题。The embodiment of the present invention is intended to provide a microcode debugging method for solving the technical problem of an IDE environment supporting the microcode on a computer when debugging the microcode in the prior art.
本发明实施例提供一种微码调试方法,包括:An embodiment of the present invention provides a microcode debugging method, including:
当执行到断点指令时,调用单板上预先存储的调试程序;When the breakpoint instruction is executed, the pre-stored debugger on the board is called;
根据所述调试程序对所述单板上的微码进行调试。Debugging the microcode on the board according to the debugging program.
本发明提供一种单板,包括网络处理器和存储器,所述网络处理器包括微引擎;The present invention provides a board, including a network processor and a memory, the network processor including a micro engine;
所述微引擎,配置为当执行到断点指令时,控制微码进入调试状态,调用单板上预先存储的调试程序;The micro engine is configured to, when executing a breakpoint instruction, control the microcode to enter a debugging state, and invoke a pre-stored debugging program on the board;
所述微引擎,还配置为根据所述调试程序对所述单板上的微码进行调试。The micro engine is further configured to debug the microcode on the board according to the debugging program.
本发明实施例提供的一种微码调试方法及单板,当执行到断点指令时,使微码进入调试状态,调用单板上预先存储的调试程序对单板上的微码进行调试。在本发明提供的微码调试方法中,由于预先将调试程序存储到单板上,因此,在后续的调试过程中,不需要再通过IDE向单板下发调试程序,所以不需要在电脑上运行IDE程序,简化了微码的调试过程,而且由于不再要求电脑必须支持IDE程序的运行,所以也降低了对进行调试的设备的要求,进而提高了用户体验。The microcode debugging method and the board provided by the embodiment of the invention, when executing the breakpoint instruction, enable the microcode to enter the debugging state, and call the pre-stored debugging program on the board to debug the microcode on the board. In the microcode debugging method provided by the present invention, since the debugging program is stored on the board in advance, in the subsequent debugging process, the debugging program is not required to be sent to the board through the IDE, so it is not required to be on the computer. Running the IDE program simplifies the debugging process of the microcode, and since the computer is no longer required to support the operation of the IDE program, the requirements for the device to be debugged are also reduced, thereby improving the user experience.
附图说明DRAWINGS
图1为现有技术中的单板微码调试示意图;1 is a schematic diagram of debugging a single board microcode in the prior art;
图2为本发明实施例一提供的微码调试方法的一种流程示意图;2 is a schematic flowchart of a microcode debugging method according to Embodiment 1 of the present invention;
图3为本发明实施例二提供的微码调试装置的一种结构示意图; 3 is a schematic structural diagram of a microcode debugging apparatus according to Embodiment 2 of the present invention;
图4为本发明实施例二中指令调试模块的第一种结构示意图;4 is a schematic diagram of a first structure of an instruction debugging module according to Embodiment 2 of the present invention;
图5为本发明实施例二中指令调试模块的第二种结构示意图;FIG. 5 is a schematic diagram of a second structure of an instruction debugging module according to Embodiment 2 of the present invention; FIG.
图6为本发明实施例二中指令调试模块的第三种结构示意图;6 is a schematic diagram of a third structure of an instruction debugging module according to Embodiment 2 of the present invention;
图7为本发明实施例二提供的微码调试装置的另一种结构示意图;FIG. 7 is another schematic structural diagram of a microcode debugging apparatus according to Embodiment 2 of the present invention; FIG.
图8为本发明实施例三提供的单板结构示意图;FIG. 8 is a schematic structural diagram of a single board according to Embodiment 3 of the present invention; FIG.
图9为本发明实施例三单板微码调试方法的流程示意图。FIG. 9 is a schematic flowchart of a method for debugging a micro-board of a third board according to an embodiment of the present invention.
具体实施方式detailed description
研究发现,如图1所示的单板2上有NP和CPU两大核心芯片,其中NP中的微引擎里面存放着微码。CPU上能够运行驱动软件,而且CPU设置有用于接收调试程序的调试网口。CPU运行的驱动软件会驻留一个agent(代理)客户端,该客户端通过Socket(套接字)和电脑的IDE相连,接收IDE发送过来的消息。IDE会将要发送给微码的控制命令封装成消息,通过Socket发送给agent程序。Agent程序解析IDE发送过来的消息,通过NP的CPU接口对微引擎进行相应操作。这种方式要求微引擎需要有专门的DEBUG(调试)模块,DEBUG模块用来访问微引擎内部的寄存器及包头存储空间等资源。The study found that the single board 2 shown in Figure 1 has two core chips, NP and CPU, and the micro-engine in the NP stores microcode. The driver software can be run on the CPU, and the CPU is provided with a debug network port for receiving the debugger. The driver software running on the CPU will host an agent client that connects to the IDE of the computer through a Socket (socket) and receives messages sent by the IDE. The IDE encapsulates the control commands to be sent to the microcode into messages, which are sent to the agent via the Socket. The Agent program parses the message sent by the IDE and performs corresponding operations on the micro engine through the CPU interface of the NP. This method requires the micro-engine to have a dedicated DEBUG (debug) module, the DEBUG module is used to access the micro-engine internal registers and header storage space and other resources.
上述现有的调试方案中,由于调试微码的调试程序必须由IDE下发至单板所以导致进行微码调试工作的时候必须要使用电脑运行IDE程序,这样的话,就导致微码调试的调试程序下发的路径长,经过的中间节点多,导致调试过程复杂且效率低下。在发现此技术问题之后,本发明实施例提供一种微码调试方法,事先在调用单板上存储的调试程序,当需要调试时,调用单板上预先存储的调试程序进行调试即可,从而不用由IDE来进行调试,简化调试程序的下发和直接的调试处理,提升调试效率。下面通过具体实施方式结合附图对本发明作进一步详细说明,应当理解,以下所说明的优选实施例仅用于说明和解释本发明,并不用于限定本发明。 In the above-mentioned existing debugging scheme, since the debugging program for debugging the microcode must be sent to the board by the IDE, it is necessary to use the computer to run the IDE program when the microcode debugging work is performed, so that the debugging of the microcode debugging is caused. The path sent by the program is long, and there are many intermediate nodes passing through, which makes the debugging process complicated and inefficient. After the technical problem is discovered, the embodiment of the present invention provides a microcode debugging method, in which a debugging program stored on a calling board is called in advance, and when debugging is required, a debugging program pre-stored on the board is called for debugging, thereby It is not necessary to be debugged by the IDE, which simplifies the debugging of the debugging program and direct debugging processing, and improves the debugging efficiency. The present invention will be further described in detail with reference to the accompanying drawings, in which: FIG.
实施例一:Embodiment 1:
本实施例提供一种微码调试方法,请参考图2,该方法包括:This embodiment provides a microcode debugging method. Referring to FIG. 2, the method includes:
S201、当执行到断点指令时,调用单板上预先存储的调试程序。S201. When executing the breakpoint instruction, the debugger stored in advance on the board is called.
在本实施例中,微引擎中除了微码以外,还有一段专门用于调试的代码段,该段代码就是调试程序。当网络处理器中的微引擎执行到断点指令后,会调用该调试程序。In this embodiment, in addition to the microcode, the microengine has a section of code dedicated to debugging, which is the debugger. The debugger is called when the microengine in the network processor executes a breakpoint instruction.
S202、根据调试程序对单板上的微码进行调试。S202. Debug the microcode on the board according to the debugging program.
调试程序中包括多种能够实现某种功能的代码,这些功能包括设置断点(Set Breakpoint),读取寄存器(Registers)或报文内容(Packet memory),修改寄存器或报文内容,单步执行(Single Step),运行(Continue)等。调试程序可以根据用户输入的调试指令执行相应的代码然后实现对应的功能。The debugger includes a variety of code that can implement a certain function, including setting a breakpoint (Set Breakpoint), reading registers (Registers) or message content (Packet memory), modifying registers or message content, and stepping through (Single Step), Run (Continue), etc. The debugger can execute the corresponding code according to the debug instructions input by the user and then implement the corresponding functions.
本实施例中,在根据调试程序对单板上的微码进行调试之前还需要接收用户输入的调试指令。调试指令通过电脑下发至CPU然后存储到第一存储空间中,第一存储空间可以为设置在网络处理器上SRAM(Static Random Access Memory,静态随机存取存储器)、设置在网络处理器之外的SRAM或设置在网络处理器之外的DRAM(Dynamic Random-Access Memory,动态随机存储器)。In this embodiment, it is necessary to receive a debugging instruction input by the user before debugging the microcode on the board according to the debugging program. The debugging instructions are sent to the CPU through the computer and then stored in the first storage space. The first storage space can be set to a SRAM (Static Random Access Memory) on the network processor and set outside the network processor. SRAM or DRAM (Dynamic Random-Access Memory) set outside the network processor.
用户可以通过CLI(command-line interface,命令行界面)输入各种调试指令,CLI是指可在用户提示符下键入可执行指令的界面,它通常不支持鼠标,用户通过键盘输入指令,CPU接收到指令后对CLI指令进行存储。The user can input various debugging commands through the CLI (command-line interface). The CLI refers to an interface that can input executable instructions at the user prompt. It usually does not support the mouse. The user inputs commands through the keyboard and receives the CPU. The CLI instruction is stored after the instruction.
可以理解的是,在一些特定的情景下,对单板上的微码进行调试时,也可以不需要用户输入指令,例如,当执行到断点指令时,自动运行调试程序中的代码对微码进行调试。It can be understood that, in some specific scenarios, when debugging the microcode on the board, the user may not need to input an instruction, for example, when executing the instruction to the breakpoint, the code in the debugger is automatically run. Code for debugging.
当CPU将调试指令存储到第一存储空间之后,微引擎从第一存储空间 读取调试指令,控制调试程序根据调试指令实现用户期望的功能。When the CPU stores the debug instructions to the first storage space, the micro engine goes from the first storage space The debug command is read, and the debugger is controlled to implement the function desired by the user according to the debug command.
在本实施例中,根据读取到的调试指令对单板上的微码进行调试的方式包括这样几种:In this embodiment, the manner of debugging the microcode on the board according to the read debugging instruction includes the following:
第一种,读取到信息存储指令时,将调试信息存储至第二存储空间,调试信息包括报文上下文的寄存器资源及报文内容。这里的调试信息包括的是报文上下文的寄存器资源信息,例如,报文上下文的寄存器的寄存器标识等。The first type, when reading the information storage instruction, stores the debugging information into the second storage space, and the debugging information includes the register resource of the message context and the content of the message. The debug information here includes the register resource information of the message context, for example, the register identifier of the register of the message context.
和第一存储空间一样,第二存储空间可以为设置在网络处理器上SRAM、设置在网络处理器之外的SRAM或者是设置在网络处理器之外的DRAM。第一存储空间和第二存储空间可以是属于同一个存储器的不同存储地址,也可以属于不同的存储器。当将调试信息存储至第二存储空间后,还可以通过中断通知CPU,使CPU可以在第一时间内对第二存储空间中的调试信息进行读取,并进一步显示给用户。Like the first storage space, the second storage space may be an SRAM disposed on a network processor, an SRAM disposed outside the network processor, or a DRAM disposed outside the network processor. The first storage space and the second storage space may be different storage addresses belonging to the same memory, or may belong to different memories. After the debugging information is stored in the second storage space, the CPU may be notified by the interrupt, so that the CPU can read the debugging information in the second storage space in a first time and further display it to the user.
第二种,读取到信息修改指令时,对调试信息进行修改。Second, when the information modification instruction is read, the debugging information is modified.
由于微码本身的作用就是对报文进行处理,所以为了测试微码程序的正确性,还需要对调试信息进行修改,即需要对报文上下文的寄存器资源及报文内容进行修改,修改的结果如果与用户的预期不符,则说明该微码指令存在问题,如果与用户的预期相符,则可以确定该微码指令没有问题。Since the function of the microcode itself is to process the message, in order to test the correctness of the microcode program, the debugging information needs to be modified, that is, the register resource of the message context and the content of the message need to be modified, and the result of the modification is modified. If it does not match the user's expectations, it indicates that there is a problem with the microcode instruction. If it matches the user's expectations, it can be determined that the microcode instruction has no problem.
第三种,读取到断点结束指令时,退出对当前断点指令对应的原始微码指令的调试。Third, when reading the breakpoint end instruction, the debugging of the original microcode instruction corresponding to the current breakpoint instruction is exited.
退出对当前断点指令对应的原始微码指令的调试,即是让当前断点指令对应的原始微码指令退出调试状态,在本实施例中,断点结束指令包括两种类型,一种是用于控制直接退出调试状态,例如用户在CLI界面中输入Continue作为调试指令。另外一种是单步执行指令,单步执行指令用于将之前存储的原始微码指令回写到之前当前断点指令处,将该行下一句的 原始微码指令替换成断点指令并存储原始微码指令,然后下达调试指令通知退出调试状态,并触发新的断点,重新从新的断点进入调试状态。如果用户当前正在调试第37行的微码指令,然后其希望进行单步执行,则用户可以通过CLI输入“Single Step”。微引擎可以先用存储的原始微码指令替换37行的断点指令,然后将38行的原始微码指令替换成断点指令,同时对38行的原始微码指令进行保存,以便在第38行的指令调试结束后,回写原始微码指令。The debugging of the original microcode instruction corresponding to the current breakpoint instruction is exited, that is, the original microcode instruction corresponding to the current breakpoint instruction is exited from the debugging state. In this embodiment, the breakpoint end instruction includes two types, one is Used to control the direct exit of the debug state, for example, the user enters Continue as a debug command in the CLI interface. The other is a single-step execution instruction, which is used to write the previously stored original microcode instruction back to the previous current breakpoint instruction, and the next sentence of the line The original microcode instruction is replaced with a breakpoint instruction and the original microcode instruction is stored, and then the debug instruction is issued to notify the debug state, trigger a new breakpoint, and re-enter the debug state from the new breakpoint. If the user is currently debugging the microcode instruction on line 37 and then wants to perform a single step, the user can enter "Single Step" via the CLI. The microengine can first replace the 37-line breakpoint instruction with the stored original microcode instruction, then replace the 38-line original microcode instruction with a breakpoint instruction, and save the 38-line original microcode instruction at 38th. After the instruction of the line is debugged, the original microcode instruction is written back.
值得注意的是,在调用单板上预先存储的调试程序之前还包括根据断点设置指令在预设位置设置断点指令。在对一段微码进行调试之前,必须要先设置至少一个断点指令,同时,由于调试过程是由断点指令触发的,所以,在每一次进入调试状态之前也必须保证被调试代码中存在至少一个断点指令。所以,从体来说,设置断点指令必定在进行调试之前。但实际上,在本实施例中,在调试过程中也可以设置断点指令,只是此时设置的断点指令是供下一次调试使用,是使微引擎执行到微码其他位置时再次进入调试状态。这里所说的其他位置为用户预定的位置,用户可以通过指定行号的方式确定断点指令的位置。本实施例中提供一种断点指令的设置方式:将需要设置断点处的原始微码指令替换成断点指令。由于断点指令处的调试结束后,还需要将断点指令恢复为原始微码指令,所以,将原始微码指令替换为断点指令的同时还需要保存原始微码指令。It is worth noting that before the debug program pre-stored on the board is called, the breakpoint command is set in the preset position according to the breakpoint setting instruction. Before debugging a piece of microcode, you must first set at least one breakpoint instruction. At the same time, since the debugging process is triggered by a breakpoint instruction, you must ensure that at least the debugged code exists before entering the debug state each time. A breakpoint instruction. Therefore, from the body, setting the breakpoint command must be before debugging. In fact, in this embodiment, a breakpoint instruction can also be set during the debugging process, but the breakpoint instruction set at this time is used for the next debugging, and the microengine is executed again when it is executed to other positions of the microcode. status. The other location mentioned here is the location reserved by the user, and the user can determine the location of the breakpoint instruction by specifying the line number. In this embodiment, a method for setting a breakpoint instruction is provided: replacing the original microcode instruction at the breakpoint to a breakpoint instruction. Since the breakpoint instruction needs to be restored to the original microcode instruction after the debugging at the breakpoint instruction ends, the original microcode instruction needs to be saved while replacing the original microcode instruction with the breakpoint instruction.
下面提供一个调试程序的部分代码供本领域技术人员进行参考,如下所示:A partial code of a debugger is provided below for reference by those skilled in the art, as follows:
Loop{Loop{
cmd=Read(SRAM.cmd);Cmd=Read(SRAM.cmd);
switch(cmd)Switch(cmd)
{{
Case 1:Store(SRAM.rsp,info),读取调试信息存储到RSP空间; Case 1: Store (SRAM.rsp, info), the read debugging information is stored in the RSP space;
Case 2:修改调试信息;Case 2: Modify the debugging information;
Case 3:继续执行,exit;Case 3: continue execution, exit;
}}
}}
从上述代码段中可以看出,调试程序主要用于从SRAM中的cmd空间内读取调试指令,然后根据读取到的调试指令执行相应的程序,例如,当从cmd空间读取到的指令为“1”时,执行Case 1的程序,读取调试信息存储到SRAM的RSP空间,调试信息包括报文上下文的寄存器资源及报文内容等。当读取到的指令为“2”时,对调试信息进行修改。同样的,当调试指令为“3”时,则退出调试,使微引擎继续正常执行微码。As can be seen from the above code segment, the debugger is mainly used to read the debug instruction from the cmd space in the SRAM, and then execute the corresponding program according to the read debug instruction, for example, when the instruction is read from the cmd space. When it is "1", the program of Case 1 is executed, and the read debug information is stored in the RSP space of the SRAM, and the debug information includes the register resource of the message context and the content of the message. When the read command is "2", the debug information is modified. Similarly, when the debug command is "3", the debug is exited, and the microengine continues to execute the microcode normally.
虽然上述示例中是将调试指令存储在SRAM的cmd空间内,将调试信息存储到SRAM的RSP空间,但可以理解的是,在实际应用过程中,并不要求调试指令一定要存储在cmd空间内,同样的,也并不要求要将调试信息存储到SRAM的RSP空间中。Although the above example stores the debug instructions in the cmd space of the SRAM and stores the debug information in the RSP space of the SRAM, it can be understood that in the actual application process, the debug instructions are not required to be stored in the cmd space. Similarly, it is not required to store debug information in the RSP space of the SRAM.
实际调试过程中,调试信息是供CPU读取并通过显示设备显示给用户的,而调试指令是用于指示网络处理器中的调试程序该执行何种代码的。所以,之所以要将调试指令与调试信息分开存储,是为了让CPU和微引擎能够确定自己该读取哪些信息。但是本领域技术人员应当明白的是,只要确保能够让CPU读取到调试信息而非调试指令,让微引擎读取到正确的调试指令而非调试信息,那么即使调试指令与调试信息不分开存储也没有关系。例如,为所有的调试信息都加上相应的前缀,以便和没有添加前缀的调试指令区分开来,在这种情况下,CPU读取信息的时候就读取带有该特定前缀的信息作为调试信息,而微引擎仅读取没有该前缀的信息作为调试指令即可。During the actual debugging process, the debugging information is read by the CPU and displayed to the user through the display device, and the debugging instruction is used to indicate which code the debugger in the network processor should execute. Therefore, the reason why the debug instructions and debug information are stored separately is to allow the CPU and the micro engine to determine which information to read. However, those skilled in the art should understand that as long as the CPU can read the debugging information instead of the debugging instruction and let the micro engine read the correct debugging instruction instead of the debugging information, even if the debugging instruction and the debugging information are not stored separately. It doesn't matter. For example, all debug information is prefixed to distinguish it from debug instructions without a prefix. In this case, the CPU reads the information with the specific prefix as a debug when reading the information. Information, and the micro engine only reads information without the prefix as a debug command.
在本发明提供的微码调试方法中,由于预先将调试程序存储到单板上,因此,在后续的调试过程中,不需要再通过IDE向单板下发调试程序,所 以不需要在电脑上运行IDE程序,简化了微码的调试过程,而且由于不再要求电脑必须支持IDE程序的运行,所以也降低了对进行调试的设备的要求,进而提高了用户体验。In the microcode debugging method provided by the present invention, since the debugging program is stored on the board in advance, in the subsequent debugging process, the debugging program is not required to be sent to the board through the IDE. The need to run the IDE program on the computer simplifies the debugging process of the microcode, and since the computer is no longer required to support the operation of the IDE program, the requirements for the device to be debugged are also reduced, thereby improving the user experience.
实施例二:Embodiment 2:
本实施例提供一种微码调试装置,实施例一提供的微码调试方法可以在该微码调试装置运行,请参考图3:The embodiment provides a microcode debugging device. The microcode debugging method provided in the first embodiment can be run on the microcode debugging device. Please refer to FIG. 3:
微码调试装置30包括程序调用模块301和指令调试模块302。The microcode debugging device 30 includes a program invocation module 301 and an instruction debugging module 302.
程序调用模块301配置为当执行到断点指令时,调用单板上预先存储的调试程序。The program invocation module 301 is configured to call a pre-stored debugger on the board when the breakpoint instruction is executed.
在本实施例中,微引擎中除了微码以外,还有一段专门用于调试的代码段,该段代码就是调试程序。当网络处理器中的微引擎执行到断点指令后,程序调用模块301会会调用该调试程序。In this embodiment, in addition to the microcode, the microengine has a section of code dedicated to debugging, which is the debugger. When the microengine in the network processor executes the breakpoint instruction, the program call module 301 will call the debugger.
指令调试模块302配置为根据调试程序对单板上的微码进行调试。The instruction debugging module 302 is configured to debug the microcode on the board according to the debugging program.
调试程序中包括多种能够实现某种功能的代码,这些功能包括设置断点,读取寄存器或报文内容,修改寄存器或报文内容,单步执行,运行等。调试程序可以根据用户输入的调试指令执行相应的代码然后实现对应的功能。The debugger includes a variety of code that can implement a function, including setting breakpoints, reading registers or message contents, modifying registers or message contents, stepping through, running, and so on. The debugger can execute the corresponding code according to the debug instructions input by the user and then implement the corresponding functions.
在本实施例中,指令调试模块302还配置为根据调试程序对单板上的微码进行调试之前还需要接收用户输入的调试指令。调试指令通过电脑下发至CPU然后存储到第一存储空间中,第一存储空间可以为设置在网络处理器上SRAM、设置在网络处理器之外的SRAM或设置在网络处理器之外的DRAM。In this embodiment, the instruction debugging module 302 is further configured to receive a debugging instruction input by the user before debugging the microcode on the board according to the debugging program. The debugging instructions are sent to the CPU through the computer and then stored in the first storage space. The first storage space may be an SRAM disposed on the network processor, an SRAM disposed outside the network processor, or a DRAM disposed outside the network processor. .
用户可以通过CLI输入各种调试指令,CLI是指可在用户提示符下键入可执行指令的界面,它通常不支持鼠标,用户通过键盘输入指令,CPU接收到指令后对CLI指令进行存储。 The user can input various debugging instructions through the CLI. The CLI refers to an interface that can input executable instructions at the user prompt. It usually does not support the mouse. The user inputs commands through the keyboard, and the CPU stores the CLI instructions after receiving the instructions.
可以理解的是,在一些特定的情景下,对单板上的微码进行调试时,也可以不需要用户输入指令,例如,当执行到断点指令时,使微码自动进入调试状态,自动运行调试程序中的代码对微码进行调试。It can be understood that, in some specific scenarios, when debugging the microcode on the board, the user does not need to input an instruction, for example, when the breakpoint instruction is executed, the microcode is automatically entered into the debugging state, automatically. Run the code in the debugger to debug the microcode.
当CPU将调试指令存储到第一存储空间之后,微引擎从第一存储空间读取调试指令,指令调试模块302控制调试程序根据调试指令实现用户期望的功能。After the CPU stores the debug instruction to the first storage space, the micro engine reads the debug instruction from the first storage space, and the instruction debug module 302 controls the debug program to implement the function desired by the user according to the debug instruction.
如图4所示,指令调试模块302包括第一调试模块3021。第一调试模块3021用于当读取到信息存储指令时,将调试信息存储至第二存储空间,调试信息包括报文上下文的寄存器资源及报文内容。As shown in FIG. 4, the instruction debug module 302 includes a first debug module 3021. The first debugging module 3021 is configured to store the debugging information to the second storage space when the information storage instruction is read, where the debugging information includes a register resource of the message context and a message content.
和第一存储空间一样,第二存储空间可以为设置在网络处理器上SRAM、设置在网络处理器之外的SRAM或者是设置在网络处理器之外的DRAM。第一存储空间和第二存储空间可以是属于同一个存储器的不同存储地址,也可以属于不同的存储器。当将调试信息存储至第二存储空间后,还可以通过中断通知CPU,使CPU可以在第一时间内对第二存储空间中的调试信息进行读取,并进一步显示给用户。Like the first storage space, the second storage space may be an SRAM disposed on a network processor, an SRAM disposed outside the network processor, or a DRAM disposed outside the network processor. The first storage space and the second storage space may be different storage addresses belonging to the same memory, or may belong to different memories. After the debugging information is stored in the second storage space, the CPU may be notified by the interrupt, so that the CPU can read the debugging information in the second storage space in a first time and further display it to the user.
如图5,指令调试模块302包括第二调试模块3022。第二调试模块3022用于读取到信息修改指令时,对调试信息进行修改。As shown in FIG. 5, the instruction debug module 302 includes a second debug module 3022. The second debugging module 3022 is configured to modify the debugging information when the information modification instruction is read.
由于微码本身的作用就是对报文进行处理,所以为了测试微码程序的正确性,还需要对调试信息进行修改,即需要对报文上下文的寄存器资源及报文内容进行修改,修改的结果如果与用户的预期不符,则说明该微码指令存在问题,如果与用户的预期相符,则可以确定该微码指令没有问题。Since the function of the microcode itself is to process the message, in order to test the correctness of the microcode program, the debugging information needs to be modified, that is, the register resource of the message context and the content of the message need to be modified, and the result of the modification is modified. If it does not match the user's expectations, it indicates that there is a problem with the microcode instruction. If it matches the user's expectations, it can be determined that the microcode instruction has no problem.
图6所示出的指令调试模块302包括第三调试模块3023,用于读取到断点结束指令时,控制当前断点指令退出调试状态。The instruction debugging module 302 shown in FIG. 6 includes a third debugging module 3023 for controlling the current breakpoint instruction to exit the debugging state when reading the breakpoint end instruction.
在本实施例中,断点结束指令包括两种类型,一种是用于控制直接退出调试状态,例如用户在CLI界面中输入Continue作为调试指令。另外一 种是单步执行指令,单步执行指令用于将之前存储的原始微码指令回写到之前当前断点指令处,将该行下一句的原始微码指令替换成断点指令并存储原始微码指令。然后下达调试指令通知退出调试状态,并触发新的断点,重新从新的断点进入调试状态。如果用户当前正在调试第37行的微码指令,然后其希望进行单步执行,则用户可以通过CLI输入“Single Step”。微引擎可以先用存储的原始微码指令替换37行的断点指令,然后将38行的原始微码指令替换成断点指令,同时对38行的原始微码指令进行保存,以便在第38行的指令调试结束后,回写原始微码指令。In this embodiment, the breakpoint end instruction includes two types, one is for controlling to directly exit the debug state, for example, the user inputs Continue as a debug command in the CLI interface. Another one The single-step execution instruction is used to write the previously stored original microcode instruction back to the previous current breakpoint instruction, replace the original microcode instruction of the next sentence of the line with a breakpoint instruction and store the original micro Code instruction. Then issue a debug command to notify the debug state, trigger a new breakpoint, and re-enter the debug state from the new breakpoint. If the user is currently debugging the microcode instruction on line 37 and then wants to perform a single step, the user can enter "Single Step" via the CLI. The microengine can first replace the 37-line breakpoint instruction with the stored original microcode instruction, then replace the 38-line original microcode instruction with a breakpoint instruction, and save the 38-line original microcode instruction at 38th. After the instruction of the line is debugged, the original microcode instruction is written back.
本领域技术人员应当明白的是,指令调试模块可以同时包括上述第一、第二、第三以及第四调试模块。It should be understood by those skilled in the art that the instruction debug module can include the first, second, third, and fourth debug modules described above.
在本实施例提供的一种示例当中,如图7所示,微码调试装置30还包括断点设置模块300,断点设置模块300配置为在指令调试模块302调用单板上预先存储的调试程序之前,根据断点设置指令在预设位置设置断点指令。在对一段微码进行调试之前,断点设置模块300必须要先设置至少一个断点指令,同时,由于调试过程是由断点指令触发的,所以,在每一次进入调试状态之前也必须保证被调试代码中存在至少一个断点指令。所以,从体来说,断点设置模块300设置断点指令必定在进行调试之前。但实际上,在本实施例中,在调试过程中断点设置模块300,配置为也可以设置断点指令,只是此时断点设置模块300设置的断点指令是供下一次调试使用,是使微引擎执行到微码其他位置时再次进入调试状态。这里所说的其他位置为用户预定的位置,用户可以通过指定行号的方式确定断点指令的位置。本实施例中为断点设置模块300提供一种断点指令的设置方式:将需要设置断点处的原始微码指令替换成断点指令。由于断点指令处的调试结束后,还需要将断点指令恢复为原始微码指令,所以,将原始微码指令替换为断点指令的同时还需要保存原始微码指令。 In an example provided in this embodiment, as shown in FIG. 7, the microcode debugging apparatus 30 further includes a breakpoint setting module 300 configured to be configured to be pre-stored in the instruction debugging module 302. Before the program, set a breakpoint command at the preset position according to the breakpoint setting command. Before debugging a piece of microcode, the breakpoint setting module 300 must first set at least one breakpoint instruction. At the same time, since the debugging process is triggered by the breakpoint instruction, it must be guaranteed before each entry into the debug state. There is at least one breakpoint instruction in the debug code. Therefore, in the body, the breakpoint setting module 300 sets the breakpoint instruction must be before debugging. However, in the embodiment, in the debugging process interruption point setting module 300, it is configured to also set a breakpoint instruction, but only the breakpoint instruction set by the breakpoint setting module 300 is used for the next debugging, which is The microengine enters the debug state again when it executes to other locations in the microcode. The other location mentioned here is the location reserved by the user, and the user can determine the location of the breakpoint instruction by specifying the line number. In this embodiment, the breakpoint setting module 300 is provided with a setting method of a breakpoint instruction: the original microcode instruction at the breakpoint needs to be replaced with a breakpoint instruction. Since the breakpoint instruction needs to be restored to the original microcode instruction after the debugging at the breakpoint instruction ends, the original microcode instruction needs to be saved while replacing the original microcode instruction with the breakpoint instruction.
下面提供一个调试程序的部分代码供本领域技术人员进行参考,如下所示:A partial code of a debugger is provided below for reference by those skilled in the art, as follows:
Loop{Loop{
cmd=Read(SRAM.cmd);Cmd=Read(SRAM.cmd);
switch(cmd)Switch(cmd)
{{
Case 1:Store(SRAM.rsp,info),读取调试信息存储到RSP空间;Case 1: Store (SRAM.rsp, info), the read debugging information is stored in the RSP space;
Case 2:修改调试信息;Case 2: Modify the debugging information;
Case 3:继续执行,exit;Case 3: continue execution, exit;
}}
}}
从上述代码段中可以看出,调试程序主要用于从SRAM中的cmd空间内读取调试指令,然后根据读取到的调试指令执行相应的程序,例如,当从cmd空间读取到的指令为“1”时,执行Case 1的程序,读取调试信息存储到SRAM的RSP空间,调试信息包括报文上下文的寄存器资源及报文内容等。当读取到的指令为“2”时,对调试信息进行修改。同样的,当调试指令为“3”时,则退出调试,使微引擎继续正常执行微码。As can be seen from the above code segment, the debugger is mainly used to read the debug instruction from the cmd space in the SRAM, and then execute the corresponding program according to the read debug instruction, for example, when the instruction is read from the cmd space. When it is "1", the program of Case 1 is executed, and the read debug information is stored in the RSP space of the SRAM, and the debug information includes the register resource of the message context and the content of the message. When the read command is "2", the debug information is modified. Similarly, when the debug command is "3", the debug is exited, and the microengine continues to execute the microcode normally.
虽然上述示例中是将调试指令存储在SRAM的cmd空间内,并将调试信息存储到SRAM的RSP空间,但可以理解的是,在实际应用过程中,并不要求调试指令一定要存储在cmd空间内,同样的,也并不要求要将调试信息存储到SRAM的RSP空间中。Although the above example stores the debug instructions in the cmd space of the SRAM and stores the debug information in the RSP space of the SRAM, it can be understood that in the actual application process, the debug instructions are not required to be stored in the cmd space. Internally, the same is not required to store debug information in the RSP space of the SRAM.
实际调试过程中,调试信息是供CPU读取并通过显示设备显示给用户的,而调试指令是用于指示网络处理器中的调试程序该执行何种代码的。所以,之所以要将调试指令与调试信息分开存储,是为了让CPU和微引擎能够确定自己该读取哪些信息。但是本领域技术人员应当明白的是,只要确保能够让CPU读取到调试信息而非调试指令,让微引擎读取到正确的调 试指令而非调试信息,那么即使调试指令与调试信息不分开存储也没有关系。例如,为所有的调试信息都加上相应的前缀,以便和没有添加前缀的调试指令区分开来,在这种情况下,CPU读取信息的时候就读取带有该特定前缀的信息作为调试信息,而微引擎仅读取没有该前缀的信息作为调试指令即可。During the actual debugging process, the debugging information is read by the CPU and displayed to the user through the display device, and the debugging instruction is used to indicate which code the debugger in the network processor should execute. Therefore, the reason why the debug instructions and debug information are stored separately is to allow the CPU and the micro engine to determine which information to read. However, those skilled in the art should understand that as long as it is ensured that the CPU can read the debug information instead of the debug command, the micro engine reads the correct tone. Trying instructions instead of debugging information, it doesn't matter if the debug instructions are not stored separately from the debug information. For example, all debug information is prefixed to distinguish it from debug instructions without a prefix. In this case, the CPU reads the information with the specific prefix as a debug when reading the information. Information, and the micro engine only reads information without the prefix as a debug command.
实施例三:Embodiment 3:
本实施例提供一种单板,该单板包括网络处理器和存储器。网络处理器中有微引擎,微引擎中存储有微码,如果在这些微码中设置断点后,当微引擎,配置为执行到断点指令时就会进入调试状态,调用单板上预先存储的调试程序对微引擎中的微码进行调试。调试程序也可以和微码一样驻留在微引擎当中。当读取到调试指令后,根据调试指令,利用调试程序对微引擎中的微码进行调试。This embodiment provides a board that includes a network processor and a memory. There is a micro-engine in the network processor. The micro-engine stores the micro-code. If a breakpoint is set in the micro-code, when the micro-engine is configured to execute the breakpoint instruction, it will enter the debug state. The stored debugger debugs the microcode in the microengine. The debugger can also reside in the microengine like the microcode. After reading the debug command, the debugger is used to debug the microcode in the microengine according to the debug command.
如图8所示,在本实施例的一种示例中,单板80包括网络处理器801和存储器802,存储器802可以设置在网络处理器801上,也可以设置单板80上网络处理器801之外的地方,优选地,该单板80还包括中央处理器803。中央处理器803通过PCI-E连接网络处理器801。As shown in FIG. 8, in an example of the embodiment, the board 80 includes a network processor 801 and a memory 802. The memory 802 may be disposed on the network processor 801, or may be configured with a network processor 801 on the board 80. In addition to the location, preferably, the board 80 further includes a central processing unit 803. The central processing unit 803 is connected to the network processor 801 via PCI-E.
当进入调试状态之后,用户可以通过CLI界面从电脑下发调试指令给中央处理器803,中央处理器803可以将该调试指令存储在存储器802的第一存储空间中,微引擎8011可以从第一存储空间中读取调试指令并利用调试程序根据调试指令进行调试。After entering the debugging state, the user can send a debugging instruction from the computer to the central processing unit 803 through the CLI interface, and the central processing unit 803 can store the debugging instruction in the first storage space of the memory 802, and the micro engine 8011 can be from the first The debug instructions are read in the storage space and debugged according to the debug instructions by the debugger.
如果微引擎8011读取到的调试指令是信息存储指令,则微引擎8011可以将调试信息存储至存储器802的第二存储空间并通知中央处理器803,让中央处理器803能够从第二存储空间中读取调试信息并通过显示设备向用户进行显示。在本实施例中,调试信息包括报文上下文的寄存器资源及报文内容。 If the debug command read by the microengine 8011 is an information store command, the micro engine 8011 may store the debug information to the second storage space of the memory 802 and notify the central processor 803 to enable the central processor 803 to access the second storage space. The debug information is read and displayed to the user through the display device. In this embodiment, the debug information includes a register resource of the message context and a message content.
下面结合图9对本实施例中单板上的微码调试过程进行说明:The microcode debugging process on the board in this embodiment is described below with reference to FIG. 9:
当网络处理器801中微引擎8011执行到断点指令之后,就会进入调试状态。When the micro-engine 8011 in the network processor 801 executes the breakpoint instruction, it enters the debug state.
S901、微引擎将调试信息存储到存储器的RSP空间;S901. The micro engine stores the debugging information into the RSP space of the memory.
调试信息包括寄存器中的内容和报文包头等。The debug information includes the contents of the register and the packet header.
S902、微引擎触发中断,通知中央处理器;S902: The micro engine triggers an interrupt to notify the central processing unit;
S903、中央处理器从存储器的RSP空间读取调试信息;S903. The central processor reads the debugging information from the RSP space of the memory.
中央处理器读取的信息可以通过与单板相连的电脑显示给用户,让用户获取调试信息,然后根据调试信息从CLI界面上发出调试指令。The information read by the central processing unit can be displayed to the user through a computer connected to the board, allowing the user to obtain debugging information, and then issuing debugging instructions from the CLI interface according to the debugging information.
S904、中央处理器将调试指令存储到存储器的cmd空间;S904. The central processor stores the debugging instruction in a cmd space of the memory.
调试指令有多种,可以分别用于实现设置断点,读取寄存器或报文内容,修改寄存器或报文内容,单步执行,运行等。There are several kinds of debugging instructions, which can be used to set breakpoints, read registers or message contents, modify registers or message contents, single-step execution, and run.
虽然上面的方案中设置断点指令是在调试过程中,也就是进入调试状态之后,但是本领域技术人员应当理解的是,调试过程是由断点指令触发的,所以,在每一次进入调试状态之前也必须保证被调试代码中存在至少一个断点指令。所以,总体来说,设置断点指令必定在进行调试之前。在上述方案中,在调试过程中设置的断点指令是供下一次调试使用,是使微引擎执行到微码其他位置时再次进入调试状态。这里所说的其他位置为用户预定的位置,用户可以通过指定行号的方式确定断点指令的位置。本实施例中设置断点指令的方式为:将需要设置断点处的原始微码指令替换成断点指令。由于断点指令处的调试结束后,还需要将断点指令恢复为原始微码指令,所以,将原始微码指令替换为断点指令的同时还需要保存原始微码指令。Although the breakpoint instruction is set in the above scheme during the debugging process, that is, after entering the debug state, those skilled in the art should understand that the debug process is triggered by the breakpoint instruction, so each time the debug state is entered. It must also be ensured that at least one breakpoint instruction exists in the debugged code. So, in general, setting breakpoint instructions must be before debugging. In the above scheme, the breakpoint instruction set during the debugging process is used for the next debugging, and the microengine enters the debugging state again when it executes to other positions of the microcode. The other location mentioned here is the location reserved by the user, and the user can determine the location of the breakpoint instruction by specifying the line number. The way to set the breakpoint instruction in this embodiment is to replace the original microcode instruction at the breakpoint to be a breakpoint instruction. Since the breakpoint instruction needs to be restored to the original microcode instruction after the debugging at the breakpoint instruction ends, the original microcode instruction needs to be saved while replacing the original microcode instruction with the breakpoint instruction.
S905、微引擎从存储器的cmd空间读取调试指令。S905. The microengine reads the debugging instruction from the cmd space of the memory.
微引擎读取到调试指令之后,可以控制调试程序执行对应的代码,实 现用户想要的功能。例如设置断点、读取寄存器或报文内容或修改寄存器或报文内容等。After the micro engine reads the debug instruction, it can control the debugger to execute the corresponding code. Now the user wants the function. For example, setting a breakpoint, reading a register or message content, or modifying a register or message content.
在本实施例提供的单板预先存储对其上的微码进行调试的调试程序当微引擎执行到断点指令时进入调试状态,调用该调试程序对单板上的微码进行调试。对本发明提供的单板上的微码进行调试时,由于单板自身已经有了调试程序,所以不需要通过IDE下发调试程序,所以不需要在电脑上运行IDE程序,简化了微码的调试过程,而且由于不再要求电脑必须支持IDE程序的运行,所以也降低了对进行调试的设备的要求,进而提高了用户体验。The debugger that pre-stores the microcode on the board provided in this embodiment enters the debug state when the microengine executes the breakpoint instruction, and invokes the debugger to debug the microcode on the board. When debugging the microcode on the board provided by the present invention, since the board itself has a debugging program, there is no need to send a debugging program through the IDE, so there is no need to run the IDE program on the computer, which simplifies the debugging of the microcode. The process, and because the computer is no longer required to support the operation of the IDE program, it also reduces the requirements for the device to be debugged, thereby improving the user experience.
显然,本领域的技术人员应该明白,上述本发明的各模块或各步骤可以用通用的计算装置来实现,它们可以集中在单个的计算装置上,或者分布在多个计算装置所组成的网络上,可选地,它们可以用计算装置可执行的程序代码来实现,从而,可以将它们存储在存储介质(ROM/RAM、磁碟、光盘)中由计算装置来执行,并且在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤,或者将它们分别制作成各个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。所以,本发明不限制于任何特定的硬件和软件结合。Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general-purpose computing device, which can be concentrated on a single computing device or distributed over a network composed of multiple computing devices. Alternatively, they may be implemented by program code executable by the computing device such that they may be stored in a storage medium (ROM/RAM, diskette, optical disk) by a computing device, and in some cases The steps shown or described may be performed in an order different than that herein, or they may be separately fabricated into individual integrated circuit modules, or a plurality of the modules or steps may be implemented as a single integrated circuit module. Therefore, the invention is not limited to any particular combination of hardware and software.
以上内容是结合具体的实施方式对本发明所作的进一步详细说明,不能认定本发明的具体实施只局限于这些说明。凡按照本发明原理所作的修改,都应当理解为落入本发明的保护范围。 The above is a further detailed description of the present invention in connection with the specific embodiments, and the specific embodiments of the present invention are not limited to the description. Modifications made in accordance with the principles of the invention are understood to fall within the scope of the invention.

Claims (11)

  1. 一种微码调试方法,包括:A microcode debugging method, including:
    当执行到断点指令时,调用单板上预先存储的调试程序;When the breakpoint instruction is executed, the pre-stored debugger on the board is called;
    根据所述调试程序对所述单板上的微码进行调试。Debugging the microcode on the board according to the debugging program.
  2. 如权利要求1所述的微码调试方法,其中,还包括:The microcode debugging method according to claim 1, further comprising:
    接收用户输入的调试指令并存储到第一存储空间;Receiving a debugging instruction input by a user and storing it in the first storage space;
    所述根据所述调试程序对所述单板上的微码进行调试包括:The debugging the microcode on the board according to the debugging program includes:
    从所述第一存储空间读取所述调试指令,利用所述调试程序根据所述调试指令进行调试。Reading the debug instruction from the first storage space, and performing debugging according to the debug instruction by using the debug program.
  3. 如权利要求1所述的微码调试方法,其中,所述调用单板上预先存储的调试程序之前还包括:根据断点设置指令在预设位置设置断点指令。The microcode debugging method according to claim 1, wherein the calling the pre-stored debugging program on the board further comprises: setting a breakpoint instruction at the preset position according to the breakpoint setting instruction.
  4. 如权利要求3所述的微码调试方法,其中,所述根据断点设置指令在预设位置设置断点指令包括:将需要设置断点处的原始微码指令替换为断点指令并保存所述原始微码指令。The microcode debugging method according to claim 3, wherein the setting of the breakpoint instruction at the preset position according to the breakpoint setting instruction comprises: replacing the original microcode instruction at the breakpoint to be set as a breakpoint instruction and saving the The original microcode instruction.
  5. 如权利要求1至4任一项所述的微码调试方法,其中,所述根据所述调试程序对所述单板上的微码进行调试的方式包括:The microcode debugging method according to any one of claims 1 to 4, wherein the manner of debugging the microcode on the board according to the debugging program comprises:
    读取到信息存储指令时,将调试信息存储至第二存储空间,所述调试信息包括报文上下文的寄存器资源信息及报文内容;When the information storage instruction is read, the debugging information is stored in the second storage space, where the debugging information includes the register resource information of the message context and the content of the message;
    或,or,
    读取到信息修改指令时,对所述调试信息进行修改;Modifying the debugging information when the information modification instruction is read;
    或,or,
    读取到断点结束指令时,退出对当前断点指令对应的原始微码指令的调试。When the breakpoint end instruction is read, the debugging of the original microcode instruction corresponding to the current breakpoint instruction is exited.
  6. 如权利要求5所述的微码调试方法,其中,所述将调试信息存 储至第二存储空间后,所述方法还包括:通知中央处理器读取调试信息。The microcode debugging method according to claim 5, wherein said debugging information is stored After being stored in the second storage space, the method further includes: notifying the central processor to read the debugging information.
  7. 如权利要求5所述的微码调试方法,其中,所述退出对当前断点指令对应的原始微码指令的调试包括:将当前断点指令替换为所述断点指令对应的原始微码指令。The microcode debugging method according to claim 5, wherein the debugging of the original microcode instruction corresponding to the current breakpoint instruction comprises: replacing the current breakpoint instruction with the original microcode instruction corresponding to the breakpoint instruction .
  8. 一种单板,包括网络处理器和存储器,所述网络处理器包括微引擎;A single board includes a network processor and a memory, and the network processor includes a micro engine;
    所述微引擎,配置为当执行到断点指令时,调用单板上预先存储的调试程序;The micro engine is configured to invoke a pre-stored debugging program on the board when executing the breakpoint instruction;
    所述微引擎,还配置为根据所述调试程序对所述单板上的微码进行调试。The micro engine is further configured to debug the microcode on the board according to the debugging program.
  9. 如权利要求8所述的单板,其中,还包括中央处理器,所述中央处理器,配置为接收到用户输入的调试指令后,将所述调试指令存储到所述存储器的第一存储空间;所述微引擎,还配置为从所述第一存储空间中读取所述调试指令,并利用所述调试程序根据所述调试指令进行调试。The board of claim 8, further comprising a central processing unit, the central processor configured to, after receiving the debug instruction input by the user, store the debug instruction into the first storage space of the memory The microengine is further configured to read the debug instruction from the first storage space, and perform debugging according to the debug instruction by using the debugger.
  10. 如权利要求9所述的单板,其中,当所述微引擎读取到信息存储指令后,将调试信息存储至第二存储空间并通知所述中央处理器,所述调试信息包括报文上下文的寄存器资源信息及报文内容。The board of claim 9, wherein after the micro engine reads the information storage instruction, the debugging information is stored to the second storage space and the central processor is notified, the debugging information including the message context Register resource information and message content.
  11. 如权利要求7至10任一项所述的单板,其中,所述存储器为设置在所述网络处理器上静态随机存储器、设置在所述网络处理器之外的静态随机存储器或设置在所述网络处理器之外的动态随机存取存储器中的任意一种。 The board according to any one of claims 7 to 10, wherein the memory is a static random access memory provided on the network processor, a static random access memory disposed outside the network processor, or disposed in the Any of the dynamic random access memories other than the network processor.
PCT/CN2017/074452 2016-05-25 2017-02-22 Microcode debugging method and single board WO2017202083A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610356506.5A CN107436842A (en) 2016-05-25 2016-05-25 A kind of microcode adjustment method and veneer
CN201610356506.5 2016-05-25

Publications (1)

Publication Number Publication Date
WO2017202083A1 true WO2017202083A1 (en) 2017-11-30

Family

ID=60412056

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/074452 WO2017202083A1 (en) 2016-05-25 2017-02-22 Microcode debugging method and single board

Country Status (2)

Country Link
CN (1) CN107436842A (en)
WO (1) WO2017202083A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020186518A1 (en) * 2019-03-21 2020-09-24 Hangzhou Fabu Technology Co. Ltd Method and apparatus for debugging, and system on chip
CN112994963A (en) * 2019-12-13 2021-06-18 深圳市中兴微电子技术有限公司 Processing method and device

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108388510B (en) * 2018-02-09 2021-09-24 福建升腾资讯有限公司 Method for controlling debugging information output through storage configuration and computer equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1577630A (en) * 2003-07-30 2005-02-09 因芬尼昂技术股份公司 Semiconductor circuit and method for testing, monitoring and application-near setting of a semiconductor circuit
CN101286116A (en) * 2007-07-24 2008-10-15 威盛电子股份有限公司 Apparatus and method for performing real-time microcode patching
CN101855614A (en) * 2007-07-18 2010-10-06 先进微装置公司 Have the hierarchy type microcode store more than core processor
CN104778116A (en) * 2014-01-09 2015-07-15 深圳市中兴微电子技术有限公司 Multibreak software debugging device and method

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6691308B1 (en) * 1999-12-30 2004-02-10 Stmicroelectronics, Inc. Method and apparatus for changing microcode to be executed in a processor
CN1155176C (en) * 2001-06-21 2004-06-23 华为技术有限公司 Microcode test method and device for network processor
CN100511179C (en) * 2007-09-27 2009-07-08 上海大学 Enhancement type microprocessor piece on-chip dynamic state tracking method with special function register breakpoints
CN101778015A (en) * 2010-01-07 2010-07-14 中兴通讯股份有限公司 Micro-code test method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1577630A (en) * 2003-07-30 2005-02-09 因芬尼昂技术股份公司 Semiconductor circuit and method for testing, monitoring and application-near setting of a semiconductor circuit
CN101855614A (en) * 2007-07-18 2010-10-06 先进微装置公司 Have the hierarchy type microcode store more than core processor
CN101286116A (en) * 2007-07-24 2008-10-15 威盛电子股份有限公司 Apparatus and method for performing real-time microcode patching
CN104778116A (en) * 2014-01-09 2015-07-15 深圳市中兴微电子技术有限公司 Multibreak software debugging device and method

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020186518A1 (en) * 2019-03-21 2020-09-24 Hangzhou Fabu Technology Co. Ltd Method and apparatus for debugging, and system on chip
US11403206B2 (en) 2019-03-21 2022-08-02 Hangzhou Fabu Technology Co., Ltd. Method and apparatus for debugging, and system on chip
CN112994963A (en) * 2019-12-13 2021-06-18 深圳市中兴微电子技术有限公司 Processing method and device

Also Published As

Publication number Publication date
CN107436842A (en) 2017-12-05

Similar Documents

Publication Publication Date Title
US8561033B2 (en) Selective branch-triggered trace generation apparatus and method
CN113722020B (en) Interface calling method, device and computer readable storage medium
US8136097B2 (en) Thread debugging device, thread debugging method and information storage medium
US20050034104A1 (en) Method for multi-language debugging
US20090293073A1 (en) Automating asynchronous programming in single threaded systems
CN101482845B (en) Method and system for calling instant debugger
JP2004516549A (en) Single step processing
US11704139B2 (en) Service processing method and apparatus, electronic device, and storage medium
CN106802785B (en) A kind of stack analysis method and device
CN111782525B (en) Java method remote debugging method and device
WO2017202083A1 (en) Microcode debugging method and single board
WO2016095570A1 (en) Debugging method and apparatus for embedded system, and storage medium
US10691581B1 (en) Distributed software debugging system
US9639343B2 (en) Method for altering execution of a program, debugger, and computer-readable medium
CN108614697B (en) Background Dex compiling control method and device
US8117574B2 (en) Implementing a serialization construct within an environment of parallel data flow graphs
TW200903338A (en) Transactional debugger for a transactional memory system
CN111274144B (en) Unit testing method and system based on network file system operation word interface
CN106126425A (en) Function traversal method based on Android automated test frame and system
CN111045730B (en) A hardware fast interrupt processing system and method for RISC-V architecture
CN113127329B (en) Script debugging method, device and computer storage medium
WO2020073200A1 (en) Program debugging method and system
CN117931623A (en) Semiconductor parameter testing method and system based on interpreted high-level language
WO2022194090A1 (en) Multi-language hybrid debugging method and apparatus
CN115905020A (en) Application testing method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17801937

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 17801937

Country of ref document: EP

Kind code of ref document: A1