WO2011137833A1 - 一种网络处理器和网络处理器所存程序的诊断方法 - Google Patents

一种网络处理器和网络处理器所存程序的诊断方法 Download PDF

Info

Publication number
WO2011137833A1
WO2011137833A1 PCT/CN2011/074798 CN2011074798W WO2011137833A1 WO 2011137833 A1 WO2011137833 A1 WO 2011137833A1 CN 2011074798 W CN2011074798 W CN 2011074798W WO 2011137833 A1 WO2011137833 A1 WO 2011137833A1
Authority
WO
WIPO (PCT)
Prior art keywords
register
network processor
value
thread execution
record
Prior art date
Application number
PCT/CN2011/074798
Other languages
English (en)
French (fr)
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 华为技术有限公司
Priority to PCT/CN2011/074798 priority Critical patent/WO2011137833A1/zh
Priority to CN2011800006055A priority patent/CN102216909A/zh
Publication of WO2011137833A1 publication Critical patent/WO2011137833A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/3648Software debugging using additional hardware
    • G06F11/3656Software debugging using additional hardware using a specific debug interface

Definitions

  • the present invention relates to a diagnostic method for a program stored in a network processor and a network processor, and more particularly to a network processor capable of recording operational data in a multi-threaded execution unit and a diagnostic method stored in a network processor.
  • the network processor is a processor specially used for network data processing.
  • the application object is mainly network products such as switches and routers, and is mostly used for processing packets in the network; it has remarkable features such as fast speed and strong pertinence.
  • the network processor processes the data according to the program stored therein, and is important for the diagnosis and debugging of the network processor during the development and actual operation of the program.
  • a network processor-based debugging device is connected to a network processor; the network processor includes at least two thread execution units; the thread execution unit includes a plurality of registers, and the register includes a program pointer register and data. register.
  • the message processing is done by a thread execution unit in the network processor.
  • the debugging execution unit controls the thread execution unit to gradually run the program stored in the network processor, and sends the data in the program pointer register and the data register to the debugging device, after the debugging software The data is displayed.
  • the worker locates the location where the program is run by debugging the data in the program pointer register displayed on the device, and determines whether the program stored in the thread execution unit has an error by using the data in the data register.
  • Embodiments of the present invention provide a network processor and a diagnostic method for a program stored in the network processor, which can simultaneously record values of registers in a plurality of thread execution units, output the value of the register to a debugging device for diagnosis, and reduce the network.
  • the time of service interruption in the processor and the time of program diagnostics stored in the network processor shorten the development cycle of the network processor.
  • a network processor includes at least two thread execution units; each thread execution unit is provided with at least two registers; the network processor further includes at least two record read/write units, the record read/write units and the The thread execution unit corresponds to, and is connected to the register in the corresponding thread execution unit through the auxiliary data line; the record read/write unit is connected to the master control CPU;
  • Each of the record reading and writing units is configured to record the value of each register in the corresponding thread execution unit, and control the record read/write unit to output the value of the recorded register through the master control C P U;
  • the auxiliary data line is configured to output a value of a register in a thread execution unit to a corresponding record reading and writing unit;
  • the total control C P U is used for controlling the value of each register in the thread execution unit corresponding to each record reading and writing unit record or outputting the value of the register recorded in each record reading and writing unit;
  • the register is configured to store data generated during a running process of a program stored in the network processor.
  • a method for diagnosing a program stored in a network processor the network processor being connected to a debugging device and comprising at least two thread execution units and at least two record reading and writing units corresponding to the thread execution unit, each thread
  • the execution unit is provided with at least two registers; the method includes:
  • the main control CPU controls each record reading and writing unit to be The value of the recorded register is output to the debugging device;
  • the program requiring diagnosis is diagnosed based on the value of the register.
  • a method for diagnosing a program stored in a network processor and a network processor provides a simultaneous recording and recording unit by setting a record reading and writing unit for each thread execution unit without interrupting the thread execution unit operation.
  • the thread executes the value of the register in the unit, and outputs the value of the register to the debugging device for diagnosis, which reduces the time of the service interruption in the network processor and the time of the program diagnosis in the network processor, and shortens the development cycle of the network processor.
  • FIG. 1 is a schematic structural diagram of a network processor according to an embodiment of the present invention.
  • FIG. 2 is a schematic structural diagram of a network processor thread execution unit and a record read/write unit according to an embodiment of the present invention
  • FIG. 3 is a flow chart of a method for diagnosing a program stored in a network processor according to an embodiment of the present invention
  • FIG. 4 is a flow chart of setting condition storage of a diagnostic method stored in a network processor according to an embodiment of the present invention.
  • a network processor includes at least two thread execution units; each thread execution unit is provided with at least two registers for storing data generated during a program run by the network processor;
  • the network processor further includes at least two record read/write units corresponding to the thread execution unit, and the record read/write units are connected to registers in the corresponding thread execution unit through the auxiliary data lines; Control CPU connection;
  • Each of the record reading and writing units is configured to record the value of each register in the corresponding thread execution unit, and control the record read/write unit to output the value of the recorded register through the master control C P U;
  • the auxiliary data line is configured to output the value of the register in the thread execution unit to the pair The record reading and writing unit;
  • the total control C P U is used to control the value of each register in the thread execution unit corresponding to each record read/write unit record or to output the value of the register recorded in each record read/write unit.
  • the record reading and writing unit includes a read/write control module and a storage module; the read/write control module and the storage module are respectively connected to the auxiliary data line; the read/write control module is respectively connected with the storage module and the total control CPU connection;
  • the read/write control module is configured to control the storage module to record the value of the register in the thread execution unit or control the storage module to output the value of the stored register.
  • the read/write control module further includes a storage condition controller; the storage condition controller is respectively connected to the total control CPU and the storage module;
  • the storage condition controller is configured to determine whether the value of the register transmitted on the auxiliary data line meets the storage condition, and control the storage module to record the value of the register that meets the storage condition.
  • the master control C P U includes C P U in the network processor or C P U outside the network processor. While the network processor is running, the thread execution unit runs programs stored in the network processor, such as programs for processing messages received by the network processor. During the running of the program, the data during the execution of the thread execution unit is stored in the corresponding register, for example, the target address of the message is stored in a certain register.
  • the value of the register during the execution of the thread execution unit is copied to the record read/write unit, and stored in the record read/write unit.
  • the storage module After the thread execution unit finishes running, if it is necessary to diagnose the program stored in the network processor, the value of the register stored in the storage module needs to be analyzed. At this time, the value of the register stored in the storage module is output to the debugging device connected to the network processor through the master control CPU, and the user stores the value in the network processor according to the value of the register displayed on the debug device. The program is diagnosed and debugged.
  • the storage start value may be set in the storage condition controller by the master control CPU, and the storage start value may be set to the value of the register in the thread execution unit. Auxiliary number
  • the storage condition controller judges the value of the register corresponding to the set storage start value, and when the set storage start value is the same as the value of the corresponding register, the conditional storage controller sends the record.
  • the signal stores the value of the register in the thread execution unit that satisfies the condition, and better realizes the storage of the program running data.
  • the present invention further provides a method for diagnosing a program stored in a network processor. As shown in FIG. 3, the method includes:
  • Step 300 Run a program stored in the network processor that needs to be debugged.
  • the program stored in the network processor needs to be diagnosed, the user starts the network processor to enable the network processor to operate normally, and the network processor receives the message sent by the message sending source and passes through the network processor.
  • the program stored in the processing of the message For example, the network processor stores a program for forwarding a message. At this time, the network processor needs to connect the message sending terminal and the message receiving terminal. After the forwarding program is run, the network processor will receive the message sent by the message sending terminal, and forward the message to the text receiving terminal located at the target address through the corresponding port.
  • the text may be a video file, where the video address includes a target address, a source IP address (a protocol interconnected between the networks), and video data, and a video is sent when the packet sending source sends the video packet. It is divided into multiple video packets for transmission. For example, when a video is sent, it consists of video packet 1 and video packet 2.
  • the network processor allocates the video message 1 to the thread execution unit 1 for processing, and the video message 2 is allocated to the thread execution unit 2 for processing, for example, the processing, including the rationality of the message. Detection, that is, detecting whether the message exists Error, whether the source IP address is authorized for message transmission. After the processing is completed, the video is forwarded to the corresponding destination address, for example, 1.1.1.1. Throughout the process, the value of the register changes continuously as the program runs.
  • Step 3 01 Each record reading and writing unit in the network processor records the value of each register of the thread execution unit corresponding to the program running process.
  • the auxiliary data line copies the value of the register in the thread execution unit and is received by the record reading and writing unit. If the user wants to obtain the values of all the registers in the network processor that need to be diagnosed during the running of the program, it is not necessary to set the storage startup value in the storage condition controller. At this time, the storage module in the recording and reading unit stores the storage. The value of all registers during the program run. Because in the network processor, a corresponding record reading and writing unit is set for each thread execution unit, so that in the case that the program that needs to be diagnosed in the network processor runs once, all of the multiple thread execution units are obtained at the same time. The value of the register avoids the situation where the diagnosis of the value of the register in one thread execution unit cannot be found when multiple thread execution units work together.
  • multiple thread execution units work together, for example, two threads execute units, and simultaneously process different videos of a video, and two videos in the process of sending video, namely video message 1 and video message. 2.
  • the thread execution unit 1 processes the video message 1
  • the thread execution unit 2 processes the video message 2.
  • the memory module in the record read/write unit corresponding to the two thread execution units stores the values of all registers in the processing of video message 1 and video message 2.
  • Step 3 02 After the program runs, the total control CPU controls each record reading and writing unit to output the value of the recorded register to the debugging device.
  • the user After the thread execution unit finishes processing the message, the user sends an output instruction to the storage module in the record read/write unit through the master control CPU, and the record read/write unit outputs the values of all the registers recorded in the storage module.
  • the values of all the registers stored in the storage module of the recording and reading unit are output to the debugging device connected to the network processor, and the debugging device is The debugging software parses the value of the register and displays it on the debugging device. rF.
  • Step 3 0 After the program that needs to be diagnosed in the network processor finishes running, diagnose the program that needs to be diagnosed according to the value of the register.
  • the program running in the thread execution unit can be located according to the value of the program pointer register, and can be displayed when running to this step, corresponding to other registers. Value.
  • the network processor has a sequence disorder when forwarding the video message.
  • this can be diagnosed, for example, based on the program pointer register.
  • the value of the register in the thread execution unit is copied on the auxiliary data line, the value of the register is copied to the record read/write unit according to the clock signal in the network processor. Because the video message 1 arrives at the network processor first according to the transmission sequence of the video message 1 and the video message 2, the processing time of the video message 1 is earlier than the video message 2.
  • the value of the register is also displayed according to the timing.
  • the debug device displays both the value of all registers in thread execution unit 1 and thread execution unit 2, including the program pointer register.
  • the user diagnoses the program by analyzing the values of the program pointer registers of thread execution unit 1 and thread execution unit 2 to determine if the program stored in the network processor has an error. For example, during program execution, common resources in the network processor are used. When a common resource is occupied by thread execution unit 2, thread execution unit 1 cannot be used.
  • the thread execution unit 1 performs other processing, which causes the processing speed of the video message 1 processed by the thread execution unit 1 to be slower than the processing speed of the video message 2 processed by the thread execution unit 2, thereby The time that the video message 1 is sent to the target terminal is later than the video message 2, causing the video resolution to drop.
  • the processing flow of the video message 1 and the video message 2 are compared, and the position where the program has a problem can be determined, and the diagnosis is completed.
  • Example 2 When the program that needs to be diagnosed in the network processor runs, there may be a large number of register values. If the values of all the registers are analyzed, the workload at the time of diagnosis is increased, so that the record reading and writing unit stores the user's required The value of the register can be used to record the value of the register required by the user by setting the storage start value.
  • the step 301 as shown in FIG. 4, further includes:
  • Step 400 Set a storage startup value in a storage condition controller of the record reading and writing unit.
  • the storage start value is set for the storage condition controller of the record read/write unit, and the storage start value is stored in the storage condition controller by the master control CPU, for example, the register 1 is used to store the target address, and the storage can be set.
  • the startup value is the value in register 1 equal to 1.1.1.1.
  • the network processor starts, the thread execution unit runs a program that needs to be diagnosed, and the network processor receives the message sent by the message sending terminal.
  • the network processor searches for and determines the network processor port through which the destination address to which the packet needs to be sent is sent by the program running in the thread execution unit.
  • Step 401 Determine whether the value of the register transmitted on the auxiliary data line is the same as the storage start value.
  • the value of the register in the thread execution unit is copied through the auxiliary data line, and after the storage condition controller receives the value of the register, according to the set storage start value, the corresponding register is The value is judged, for example, whether or not the value of the register 1 for storing the target address is equal to the storage start value 1.1.1.1.
  • Step 402 If the value of the register transmitted on the auxiliary data line is the same as the storage start value, the storage condition controller of the record read/write unit sends a record instruction to the storage module of the record read/write unit.
  • the storage condition controller of the read/write unit determines that the value of the register 1 is equal to the set storage start value.
  • the storage condition controller will send a record instruction to the storage module of the record read-write unit, so that the record read-write unit starts Record the value of the register transmitted on the auxiliary data line.
  • the value of this register is recorded in the memory module of the record reading and writing unit, that is, the value of the register in the process of processing the message sent to the address 1.1.1.1. .
  • the storage module records the value of the register transmitted on the auxiliary data line according to the recording instruction.
  • the storage module After receiving the recording instruction, the storage module records the value of the register transmitted on the auxiliary data line according to the recording instruction.
  • the debugging device After the program runs, if the user needs to diagnose the program stored in the network processor, the debugging device sends a read command to the network processor, and after receiving the data read command, the network processor reads according to the data.
  • the instruction fetches the values of all the registers stored in the storage module to the corresponding debugging device, and then displays them through the debugging software for display and analysis.
  • a method for diagnosing a program stored in a network processor and a network processor provides a simultaneous recording and recording unit by setting a record reading and writing unit for each thread execution unit without interrupting the thread execution unit operation.
  • the thread executes the value of the register in the unit, and outputs the value of the register to the debugging device for diagnosis, which reduces the time of the service interruption in the network processor and the time of the program diagnosis in the network processor, and shortens the development cycle of the network processor.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本发明公开了一种网络处理器和网络处理器所存程序的调试方法,属于数字通信领域,为解决现有技术中无法同时对多个线程执行单元中程序的运行数据进行记录,需要多次重复运行程序,从而延长了网络处理器的开发周期的问题而设计。一种网络处理器,包括至少两个线程执行单元;每个线程执行单元至少设置有两个寄存器,该网络处理器还包括至少两个记录读写单元,该等记录读写单元与所述线程执行单元一一对应并通过辅助数据线与寄存器连接;该等记录读写单元与总控CPU连接;每一记录读写单元用于在总控CPU的控制下对所对应的线程执行单元中各寄存器的值进行记录,并通过总控CPU控制记录读写单元将所记录的寄存器的值输出。

Description

一种网络处理器和网络处理器所存程序的诊断方法 技术领域
本发明涉及一种网络处理器和网络处理器所存程序的诊断方 法, 尤其是指一种可记录多线程执行单元中的运行数据的网络处理 器和网络处理器所存程序的诊断方法。
背景技术
网络处理器是专门用于网络数据处理的处理器, 应用对象主要 是交换机, 路由器等网络产品, 多用于网络中报文的处理; 它具有 速度快、 针对性强等显著特点。 网络处理器根据其中所存储的程序 对数据进行处理, 在该程序的开发及实际运行过程中, 对网络处理 器的诊断和调试很重要。
现有技术中, 基于网络处理器的调试设备与网络处理器连接; 该网络处理器, 包括至少两个线程执行单元; 该线程执行单元, 包 括多个寄存器, 所述寄存器包括程序指针寄存器和数据寄存器。
报文处理过程由网络处理器中的线程执行单元完成。 当需要对 报文处理的过程进行诊断时, 由调试设备控制线程执行单元逐步运 行网络处理器中所存储的程序, 并将程序指针寄存器和数据寄存器 中的数据发送给调试设备, 经过调试软件对数据进行显示。 工作人 员通过调试设备上所显示的程序指针寄存器中的数据对程序所运行 的位置进行定位, 并通过数据寄存器中的数据判断线程执行单元中 所存储的程序是否存在错误。
在上述过程中, 因为线程执行单元中的程序需要逐步的运行和 记录, 此时需要中断此线程执行单元中所运行的程序。 当只对一个 线程执行单元进行处理时, 其他线程执行单元中的程序继续运行, 如果两个线程执行单元之间相互协同工作, 无法同时将两个线程执 行单元中寄存器的数据输出到调试设备, 需要重复的进行诊断过程, 从而增加了诊断的时间, 延长了网络处理器的开发周期。 发明内容
本发明实施例提供了一种网络处理器和该网络处理器所存程序 的诊断方法,能够同时记录多个线程执行单元中寄存器的值, 将该寄 存器的值输出到调试设备进行诊断, 减少了网络处理器中业务中断 的时间和网络处理器中所存程序诊断的时间, 缩短了网络处理器的 开发周期。
一种网络处理器, 包括至少两个线程执行单元; 每个线程执行 单元至少设置有两个寄存器; 该网络处理器, 还包括至少两个记录 读写单元, 该等记录读写单元与所述线程执行单元 对应, 并通 过辅助数据线与对应线程执行单元中的寄存器连接; 该等记录读写 单元与总控 C P U连接;
每一所述记录读写单元, 用于对所对应的线程执行单元中各寄 存器的值进行记录, 并通过总控 C P U控制记录读写单元将所记录的 寄存器的值输出;
所述辅助数据线, 用于将线程执行单元中寄存器的值输出到对 应的记录读写单元;
所述总控 C P U , 用于控制各记录读写单元记录所对应的线程执 行单元中各寄存器的值或输出各记录读写单元中所记录的寄存器的 值;
所述寄存器, 用于存储网络处理器所存程序运行过程中产生的 数据。
一种网络处理器所存程序的诊断方法, 所述网络处理器与调试 设备连接并且包括至少两个线程执行单元和至少两个与所述线程执 行单元——对应的记录读写单元, 每个线程执行单元至少设置有两 个寄存器; 所述方法包括:
运行网络处理器中所存储的需要进行调试的程序; 元的各寄存器的值;
所述程序运行结束后, 通过总控 C P U控制各记录读写单元将所 记录的寄存器的值输出到调试设备;
根据所述寄存器的值对需要进行诊断的程序进行诊断。
本发明实施例提供的一种网络处理器和网络处理器所存程序的 诊断方法, 通过为每一个线程执行单元设置一记录读写单元, 在不 中断线程执行单元运行的情况下, 实现同时记录多个线程执行单元 中寄存器的值, 将该寄存器的值输出到调试设备进行诊断, 减少了 网络处理器中业务中断的时间和网络处理器中所存程序诊断的时 间, 缩短了网络处理器的开发周期。
附图说明
图 1 为本发明实施例一种网络处理器的结构示意图;
图 2 为本发明实施例一种网络处理器线程执行单元和记录读写 单元的结构示意图;
图 3为本发明实施例一种网络处理器所存程序的诊断方法的流 程图;
图 4 为本发明实施例一种网络处理器所存程序的诊断方法设置 条件存储的流程图。
具体实施方式
下面结合附图对本发明实施例一种网络处理器和网络处理器所 存程序的诊断方法进行详细描述。
一种网络处理器, 如图 1 所示, 包括至少两个线程执行单元; 每个线程执行单元至少设置有两个寄存器, 该寄存器用于存储网络 处理器所存程序运行过程中产生的数据; 该网络处理器, 还包括至 少两个与所述线程执行单元 对应的记录读写单元, 该等记录读 写单元通过辅助数据线与对应线程执行单元中的寄存器连接; 该等 记录读写单元与总控 C P U连接;
每一所述记录读写单元, 用于对所对应的线程执行单元中各寄 存器的值进行记录, 并通过总控 C P U控制记录读写单元将所记录的 寄存器的值输出;
所述辅助数据线, 用于将线程执行单元中寄存器的值输出到对 应的记录读写单元;
所述总控 C P U , 用于控制各记录读写单元记录所对应的线程执 行单元中各寄存器的值或输出各记录读写单元中所记录的寄存器的 值。
所述记录读写单元, 如图 2 所示, 包括读写控制模块、 存储模 块; 该读写控制模块和存储模块分别与辅助数据线连接; 所述读写 控制模块分别与存储模块和总控 C P U连接;
所述读写控制模块, 用于控制存储模块记录线程执行单元中寄 存器的值或控制存储模块将所存储的寄存器的值输出。
所述读写控制模块, 还包括存储条件控制器; 该存储条件控制 器分别与总控 C P U和存储模块连接;
所述存储条件控制器, 用于判断辅助数据线上所传输的寄存器 的值是否符合存储条件, 并控制存储模块记录符合存储条件的寄存 器的值。
所述总控 C P U ,包括网络处理器内的 C P U或网络处理器外的 C P U。 网络处理器运行时, 线程执行单元会运行网络处理器中所存储 的程序, 例如用于对网络处理器接收到的报文进行处理的程序。 在 该程序运行过程中, 线程执行单元运行过程中的数据存储到对应的 寄存器中, 例如报文的目标地址会存储在一确定寄存器中。
本发明实施例中, 通过为每一个线程执行单元设置一记录读写 单元, 并通过辅助数据线, 对线程执行单元运行过程中寄存器的值 复制给记录读写单元, 并存储到记录读写单元中的存储模块中。 当 线程执行单元运行结束后, 如需要对网络处理器中所存储的程序进 行诊断, 则需要对所述存储模块中所存储的寄存器的值进行分析。 此时, 通过总控 C P U 将存储模块中所存储的寄存器的值输出到与网 络处理器所连接的调试设备中进行显示, 用户根据调试设备上所显 示的寄存器的值对网络处理器中所存储的程序进行诊断和调试。
进一步的, 可通过总控 C P U 在存储条件控制器中设置存储启动 值, 该存储启动值可设置为线程执行单元中寄存器的值。 当辅助数 据线传输寄存器的值时, 存储条件控制器对所设置的存储启动值所 对应的寄存器的值进行判断, 当所设置的存储启动值与所对应的寄 存器的值相同时, 条件存储控制器发送记录信号, 对满足条件的线 程执行单元中寄存器的值进行存储, 更好的实现程序运行数据的存 储。
实施例 1
与上述一种网络处理器相对应, 本发明还提供了一种网络处理 器所存程序的诊断方法, 如图 3所示, 包括:
步骤 300、 运行网络处理器中所存储的需要进行调试的程序。 当需要对网络处理器中所存储的程序进行诊断时, 用户启动网 络处理器, 使该网络处理器正常运行, 该网络处理器接收到报文发 送源所发送的报文, 并通过网络处理器中所存储的程序对该报文进 行处理。 例如, 网络处理器中存储有转发报文的程序, 此时, 网络 处理器需要连接报文发送终端与报文接收终端。 在该转发程序运行 后, 网络处理器将会接收到报文发送终端所发送的报文, 并将报文 通过对应的端口转发到位于目标地址的 文接收终端。 所述 文可 为视频 文, 该视频 文包括目 标地址、 源 I P 地址 ( I n t e r ne t P r o t o c o l 网络之间互连的协议) 和视频数据, 在报文发送源发送视 频报文时, 一段视频, 会分为多个视频报文进行发送, 例如一段视 频在发送时, 由视频报文 1和视频报文 2组成。
在该程序运行时, 为加快转发的速度, 可能由多个线程执行单 元同时处理视频 文 1 和视频 4艮文 2 , 例如由两个线程执行单元分 别处理视频 4艮文 1 和视频才艮文 2。 当这两个视频 文从网络处理器 发送到目标地址时, 如果两个视频数据报文的接收顺序被打乱, 则 会造成视频清晰度下降的问题。 为避免该问题, 需要按照视频报文 到达该网络处理器的顺序以先入先出的方式进行发送。
网络处理器接收到该视频报文时, 将视频报文 1 分配给线程执 行单元 1 进行处理, 视频报文 2分配给线程执行单元 2进行处理, 例如所述处理, 包括对报文的合理性检测, 即检测该报文是否存在 错误, 源 I P地址是否得到报文发送许可。 处理完成后, 需要将该视 频才艮文转发到所对应的目标地址, 例如 1 . 1 . 1 . 1。 在整个处理过程 中, 寄存器的值会随着程序的运行不断的变化。
步骤 3 01、 网络处理器中的每一记录读写单元记录所述程序运 行过程中所对应的线程执行单元的各寄存器的值。
在网络处理器中需要诊断的程序运行过程中, 辅助数据线会对 线程执行单元中寄存器的值进行复制, 并由记录读写单元进行接收。 如果用户希望得到网络处理器中需要诊断的程序运行过程中的所有 寄存器的值, 则不需要在存储条件控制器中设置存储启动值, 此时, 记录读写单元中的存储模块会存储所述程序运行过程中所有寄存器 的值。 因为在网络处理器中, 为每个线程执行单元都设置了对应的 记录读写单元, 故可实现在网络处理器中需要诊断的程序运行一次 的情况下, 同时获得多个线程执行单元中所有寄存器的值, 避免了 当多个线程执行单元协同工作时, 只对一个线程执行单元中的寄存 器的值进行诊断无法发现问题的情况。
当多个线程执行单元协同工作时, 例如由两个线程执行单元, 同时处理一段视频的不同视频 4艮文, 发送视频过程中的两个视频才艮 文, 即视频报文 1和视频报文 2。 例如线程执行单元 1对视频报文 1 进行处理, 线程执行单元 2 对视频报文 2 进行处理。 两个线程执行 单元所对应的记录读写单元中的存储模块会存储视频报文 1 和视频 报文 2处理过程中所有寄存器的值。
步骤 3 02、 所述程序运行结束后, 通过总控 CPU控制各记录读 写单元将所记录的寄存器的值输出到调试设备。
当线程执行单元对报文处理完成后, 用户通过总控 CPU向记录 读写单元中的存储模块发送输出指令, 则记录读写单元将记录于存 储模块中的所有寄存器的值进行输出。 此时, 为对网络处理器中需 要诊断的程序进行诊断, 则会将记录读写单元的存储模块中所存储 的所有寄存器的值输出到与网络处理器连接的调试设备, 通过调试 设备中的调试软件对寄存器的值进行解析, 在该调试设备上进行显 rF 。
步骤 3 0 3、 在网络处理器中需要诊断的程序运行结束后, 根据 所述寄存器的值对需要进行诊断的程序进行诊断。
在通过调试设备对网络处理器中需要诊断的程序进行诊断时, 根据程序指针寄存器的值可以对线程执行单元中所运行的程序进行 定位, 并可显示运行到该步骤时, 其他寄存器中所对应的值。
当在目标地址 1 . 1 . 1 . 1 所对应的终端上, 观察到视频出现清晰 度下降的情况, 则可能存在网络处理器转发视频报文时出现顺序错 乱的情况。 此时, 根据调试设备上所接收到的所有寄存器的值, 例 如可根据程序指针寄存器对该情况进行诊断。 因在辅助数据线对线 程执行单元中寄存器的值进行复制时, 会根据网络处理器中的时钟 信号对该寄存器的值复制给记录读写单元。 因为在视频报文 1 和视 频报文 2 的传输过程中, 根据视频报文的传输顺序, 视频报文 1 会 先到达网络处理器, 所以视频报文 1 的处理时间早于视频报文 2。
在调试设备上显示后, 寄存器的值也会根据时序进行显示, 通 过调试设备同时显示线程执行单元 1 和线程执行单元 2 中所有寄存 器的值, 其中包括程序指针寄存器。 用户通过分析线程执行单元 1 和线程执行单元 2 的程序指针寄存器的值对程序进行诊断, 确定网 络处理器中所存储的程序是否出现错误。 例如, 在程序执行的过程 中, 会使用到网络处理器中的公共资源, 当一个公共资源被线程执 行单元 2 占用时, 则会导致线程执行单元 1 无法使用。 此时, 线程 执行单元 1 会采取其他方式进行处理, 便会造成线程执行单元 1 所 处理的视频报文 1 的处理速度慢于线程执行单元 2 所处理的视频报 文 2 的处理速度, 从而使视频报文 1 发送到目标终端的时间晚于视 频报文 2,造成视频清晰度下降的问题。
根据线程执行单元 1 和线程执行单元 2 的程序指针寄存器的值 对视频报文 1 和视频报文 2 的处理流程进行对比, 可确定程序出现 问题的位置, 完成诊断。
实施例 2 在网络处理器中需要诊断的程序运行时, 可能存在大量的寄存 器的值, 如果对所有的寄存器的值进行分析, 则会增加诊断时的工 作量, 为使记录读写单元存储用户所需要的寄存器的值, 则可以通 过设置存储启动值,来记录用户所需要的寄存器的值,所述步骤 301, 如图 4所示, 还包括:
步骤 400、 在记录读写单元的存储条件控制器中设置存储启动 值。
通过调试设备, 为记录读写单元的存储条件控制器设置存储启 动值, 并通过总控 CPU 将该存储启动值存储到存储条件控制器中, 例如寄存器 1 用于存储目标地址, 则可设置存储启动值为寄存器 1 中的值等于 1.1.1.1。
网络处理器启动, 线程执行单元运行所需要诊断的程序, 网络 处理器接收到报文发送终端所发送的报文。 网络处理器为实现报文 转发, 则通过线程执行单元中所运行的程序对报文需要发送到的目 标地址所应经过的网络处理器端口进行查找, 并确定。
步骤 401、 判断所述辅助数据线上所传输的寄存器的值是否与 存储启动值相同。
在所述程序运行的过程中, 通过辅助数据线将线程执行单元中 寄存器的值进行复制, 存储条件控制器接收到所述寄存器的值后, 根据所设置的存储启动值对所对应的寄存器的值进行判断, 例如, 判断用 于存储目 标地址的寄存器 1 的值是否等于存储启动值 1.1.1.1。
步骤 402、 如果所述辅助数据线上所传输的寄存器的值与存储 启动值相同, 则记录读写单元的存储条件控制器向该记录读写单元 的存储模块发送记录指令。
当 线程执行单元中用 于存储目 标地址的寄存器 1 的值为 1.1.1.1 时, 通过记录读写单元的存储条件控制器的判断, 确定寄 存器 1 的值与所设置的存储启动值相等, 此时所述存储条件控制器 将向记录读写单元的存储模块发送记录指令, 使记录读写单元开始 记录辅助数据线上所传输的寄存器的值, 该寄存器的值记录于记录 读写单元的存储模块中, 即记录对发送到地址 1 . 1 . 1 . 1 的报文处理 过程中的寄存器的值。
步骤 4 0 3、 该存储模块根据所述记录指令记录辅助数据线上所 传输的寄存器的值。
存储模块接收到记录指令后, 根据所述记录指令对辅助数据线 上所传输的寄存器的值进行记录。
程序运行完成后, 如用户需要对该网络处理器中所存储的程序 进行诊断, 则通过调试设备向网络处理器发送读取指令, 网络处理 器接收到数据读取指令后, 根据所述数据读取指令将存储模块中所 存储的所有寄存器的值输出到对应的调试设备上, 通过调试软件解 析后进行显示, 供用户进行分析和诊断。
本发明实施例提供的一种网络处理器和网络处理器所存程序的 诊断方法, 通过为每一个线程执行单元设置一记录读写单元, 在不 中断线程执行单元运行的情况下, 实现同时记录多个线程执行单元 中寄存器的值, 将该寄存器的值输出到调试设备进行诊断, 减少了 网络处理器中业务中断的时间和网络处理器中所存程序诊断的时 间, 缩短了网络处理器的开发周期。
以上所述, 仅为本发明的具体实施方式, 但本发明的保护范围并不局 限于此, 任何熟悉本技术领域的技术人员在本发明揭露的技术范围内, 可 轻易想到变化或替换, 都应涵盖在本发明的保护范围之内。 因此, 本发明 的保护范围应所述以权利要求的保护范围为准。

Claims

权 利 要 求 书
1、 一种网络处理器, 包括至少两个线程执行单元; 每个线程执 行单元至少设置有两个寄存器, 其特征在于, 还包括至少两个记录读 写单元, 该等记录读写单元与所述线程执行单元——对应, 并通过辅 助数据线与对应线程执行单元中的寄存器连接; 该等记录读写单元与 总控 C PU连接;
每一所述记录读写单元, 用于对所对应的线程执行单元中各寄存 器的值进行记录, 并通过总控 C P U控制记录读写单元将所记录的寄存 器的值输出;
所述辅助数据线, 用于将线程执行单元中寄存器的值输出到对应 的记录读写单元;
所述总控 C PU , 用于控制各记录读写单元记录所对应的线程执行 单元中各寄存器的值或输出各记录读写单元中所记录的寄存器的值; 据。
2、 根据权利要求 1 所述的一种网络处理器, 其特征在于, 所述 记录读写单元, 包括读写控制模块、 存储模块; 该读写控制模块和存 储模块分别与辅助数据线连接; 所述读写控制模块分别与存储模块和 总控 C PU连接;
所述读写控制模块, 用于控制存储模块记录线程执行单元中寄存 器的值或控制存储模块将所存储的寄存器的值输出。
3、 根据权利要求 2所述的一种网络处理器, 其特征在于, 所述 读写控制模块, 还包括存储条件控制器; 该存储条件控制器分别与总 控 CP U和存储模块连接;
所述存储条件控制器,用于判断辅助数据线上所传输的寄存器的 值是否符合存储条件, 并控制存储模块记录符合存储条件的寄存器的 值。
4、 根据权利要求 2所述的一种网络处理器, 其特征在于, 所述 总控 C P U , 包括网络处理器内的 C P U或网络处理器外的 CP U。
5、 一种网络处理器所存程序的诊断方法, 所述网络处理器与调 试设备连接并且包括至少两个线程执行单元, 每个线程执行单元至少 设置有两个寄存器, 其特征在于, 所述网络处理器还包括至少两个记 录读写单元,所述记录读写单元与所述线程执行单元——对应,并通 过辅助数据线与对应线程执行单元中的寄存器, 所述方法包括:
运行网络处理器中所存储的需要进行调试的程序; 元的各寄存器的值;
所述程序运行结束后,通过总控 CPU控制各记录读写单元将所记 录的寄存器的值输出到调试设备;
根据所述寄存器的值对需要进行诊断的程序进行诊断。
6、根据权利要求 5所述的一种网络处理器所存程序的诊断方法, 其特征在于, 所述各记录读写单元记录所述程序运行过程中所对应线 程执行单元的各寄存器的值, 还包括:
在记录读写单元的存储条件控制器中设置存储启动值;
判断所述辅助数据线上所传输的寄存器的值是否与存储启动值 相同;
如果所述辅助数据线上所传输的寄存器的值与存储启动值相同, 则记录读写单元的存储条件控制器向该记录读写单元的存储模块发 送记录指令;
该存储模块根据所述记录指令记录辅助数据线上所传输的寄存 器的值。
PCT/CN2011/074798 2011-05-27 2011-05-27 一种网络处理器和网络处理器所存程序的诊断方法 WO2011137833A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2011/074798 WO2011137833A1 (zh) 2011-05-27 2011-05-27 一种网络处理器和网络处理器所存程序的诊断方法
CN2011800006055A CN102216909A (zh) 2011-05-27 2011-05-27 一种网络处理器和网络处理器所存程序的诊断方法

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2011/074798 WO2011137833A1 (zh) 2011-05-27 2011-05-27 一种网络处理器和网络处理器所存程序的诊断方法

Publications (1)

Publication Number Publication Date
WO2011137833A1 true WO2011137833A1 (zh) 2011-11-10

Family

ID=44746729

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2011/074798 WO2011137833A1 (zh) 2011-05-27 2011-05-27 一种网络处理器和网络处理器所存程序的诊断方法

Country Status (2)

Country Link
CN (1) CN102216909A (zh)
WO (1) WO2011137833A1 (zh)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103200048B (zh) * 2013-04-02 2018-07-13 中兴通讯股份有限公司 一种网络处理器异常检测方法、装置及网络处理设备
CN106452807B (zh) * 2015-08-04 2020-12-29 深圳市中兴微电子技术有限公司 一种网络处理器及报文处理数据的获取方法
CN107395381A (zh) * 2016-05-16 2017-11-24 中兴通讯股份有限公司 一种报文处理方法、装置及系统
CN111324382B (zh) * 2018-12-13 2023-03-03 华为技术有限公司 指令处理方法和芯片
CN109614340A (zh) * 2018-12-28 2019-04-12 北京微播视界科技有限公司 应用程序的开发调试方法、装置、电子设备及存储介质
CN112579334B (zh) * 2020-12-08 2023-04-25 海光信息技术股份有限公司 基于以太网的面向处理器的信号记录方法及装置

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1627696A (zh) * 2003-12-12 2005-06-15 华为技术有限公司 一种网络处理器转发故障的诊断方法
CN1642112A (zh) * 2004-01-14 2005-07-20 国际商业机器公司 使用网络处理器和并行模式检测引擎检测侵入
KR100554681B1 (ko) * 2003-12-04 2006-02-24 한국전자통신연구원 피.디.에이를 이용한 치매환자의 돌보미 시스템 및 이를이용한 진료방법
US20070061808A1 (en) * 2005-09-15 2007-03-15 Sanjay Kumar Scheduler for a network processor
CN101667974A (zh) * 2009-10-12 2010-03-10 中兴通讯股份有限公司 一种实现分层服务质量的方法及网络处理器

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100407701C (zh) * 2005-06-25 2008-07-30 华为技术有限公司 一种网络处理器
CN100563178C (zh) * 2005-10-26 2009-11-25 华为技术有限公司 网络处理器以及监控网络处理器的方法
CN101976217B (zh) * 2010-10-29 2014-06-04 中兴通讯股份有限公司 网络处理器异常检测方法及系统

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100554681B1 (ko) * 2003-12-04 2006-02-24 한국전자통신연구원 피.디.에이를 이용한 치매환자의 돌보미 시스템 및 이를이용한 진료방법
CN1627696A (zh) * 2003-12-12 2005-06-15 华为技术有限公司 一种网络处理器转发故障的诊断方法
CN1642112A (zh) * 2004-01-14 2005-07-20 国际商业机器公司 使用网络处理器和并行模式检测引擎检测侵入
US20070061808A1 (en) * 2005-09-15 2007-03-15 Sanjay Kumar Scheduler for a network processor
CN101667974A (zh) * 2009-10-12 2010-03-10 中兴通讯股份有限公司 一种实现分层服务质量的方法及网络处理器

Also Published As

Publication number Publication date
CN102216909A (zh) 2011-10-12

Similar Documents

Publication Publication Date Title
US9952963B2 (en) System on chip and corresponding monitoring method
US8572299B2 (en) Hardware accelerator module and method for setting up same
WO2011137833A1 (zh) 一种网络处理器和网络处理器所存程序的诊断方法
EP2434404B1 (en) Method and arrangement for streaming data profiling
US8527812B2 (en) Information processing device
WO2015176408A1 (zh) 中断处理方法及中断控制器
US20100030927A1 (en) General purpose hardware acceleration via deirect memory access
US10896001B1 (en) Notifications in integrated circuits
US8832664B2 (en) Method and apparatus for interconnect tracing and monitoring in a system on chip
WO2023207571A1 (zh) 一种数据传输方法及装置
US6789258B1 (en) System and method for performing a synchronization operation for multiple devices in a computer system
US8880956B2 (en) Facilitating processing in a communications environment using stop signaling
JP2006164185A (ja) デバッグ装置
JP2008507020A (ja) マイクロプロセッサ出力ポート、及び、そこから提供された命令の制御
US8468394B2 (en) Method of tracing selected activities within a data processing system by tagging selected items and tracing the tagged items
US7711885B2 (en) Bus control apparatus and bus control method
US10956248B1 (en) Configurable reporting for device conditions
US7305512B2 (en) Programme-controlled unit with crossbar employing a diagnostic port
JP2005107757A (ja) プログラムの暴走検出方法およびプログラムの暴走検出装置
JP5268841B2 (ja) 情報処理装置
US20110093863A1 (en) Context switching in a data processing apparatus
JP2011150645A (ja) 情報処理装置
JP6365043B2 (ja) 観測回路
JP5467172B1 (ja) 情報処理システム、および情報処理方法
WO2012149720A1 (zh) 一种芯片状态监控方法、装置以及芯片

Legal Events

Date Code Title Description
WWE Wipo information: entry into national phase

Ref document number: 201180000605.5

Country of ref document: CN

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

Ref document number: 11777252

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 11777252

Country of ref document: EP

Kind code of ref document: A1