Background technology
Along with development of computer, also be greatly improved for the demand of the speed of the data processing of electronic equipment internal, the data forwarding process chip also in response to and give birth to.Please refer to Fig. 1, Figure 1 shows that the schematic diagram of data forwarding process chip of the prior art.The data forwarding process chip 10 of prior art comprises an inter-process module 2, message input FIFO4 (First In First Out, fifo queue), reach message output FIFO6, wherein, described message input FIFO4 is used for receiving and data cached message from upstream chip, and its data in buffer message is progressively sent to described inter-process module 2; Described inter-process module 2 is from message input FIFO4 receiving data packets, and the data message forwarding after handling and will handling is exported FIFO6 to message; Described message output FIFO6 receives and data cached message from described inter-process module 2, and its data in buffer message is progressively sent to downstream chip.
But in the process of data forwarding chip 10 deal with data, if inter-process module 2 breaks down, inter-process module 2 can't initiatively report, and CPU management also can't be found fault soon.When having only the link down of working as data processing,, could confirm whether be that the inter-process module breaks down by the manual analysis location.The process of this detection can expend a large amount of time, has increased the maintenance cost of system.
Therefore, be necessary to provide a kind of detection system and method for data forwarding chip, whether fault has taken place in the inter-process module to detect easily.
Summary of the invention
The invention discloses a kind of detection system of data handling system.Described detection system comprises judge module, timer and state reflection module.Wherein, described judge module is used to detect the message input FIFO of described data handling system and the state of message output FIFO, when message input FIFO reach capacity and message output FIFO when empty, described judge module sends starting command to described timer; Described timer is used for picking up counting after receiving described starting command, and when the timing of described timer reached preset threshold value, described timer sends to described state reflection module confirmed order; If the unsaturated or described message output of described message input FIFO FIFO is not empty, then described judge module sends to described timer and ceases and desist order, with timing and the zero clearing that stops described timer; Described state reflection module reports mistake after receiving described affirmation order, break down with the inter-process module of indicating described data handling system.
The embodiment of the invention also discloses a kind of detection method of data handling system, it comprises: judge whether message input FIFO is full and judges whether message output FIFO is empty, wherein, if input FIFO is empty for full and message output FIFO, the device timing then picks up counting; If described message input FIFO is not empty for full or message output FIFO, then stop current ongoing timer timing, and with the timer zero clearing; Whether the timing of judging timer reaches threshold value, if the timing of described timer reaches threshold value, then reports mistake, breaks down with the inter-process module of indicating described data handling system.
The detection system of the data handling system that the embodiment of the invention provided and search method are come the state of the inter-process module of judgment data treatment system by the state of detection messages input FIFO4 and message output FIFO6, simple to operate, and can finish voluntarily by system, need not human intervention, be convenient in time find the fault of inter-process module, improved the stability of system.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the invention, the technical scheme in the embodiment of the invention is clearly and completely described, obviously, described embodiment only is the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, those of ordinary skills belong to the scope of protection of the invention not making the every other embodiment that is obtained under the creative work prerequisite.
Please refer to Fig. 2, be depicted as the schematic diagram of the detection system of the data handling system that the embodiment of the invention provides.The detection system 200 of described data handling system comprises: judge module 220, timer 240 and state reflection module 260.
Described judge module 220 is used for the state of detection messages input FIFO4 and message output FIFO6, and according to the state of described message input FIFO4 and message output FIFO6, sends control command to described timer 240.Wherein, when described message input FIFO4 reaches capacity state and described message output FIFO6 for empty the time, described judge module 220 sends starting command to described timer 240, so that timer 240 picks up counting; When described message input FIFO4 does not reach capacity state or described message output FIFO6 for empty the time, described judge module 220 sends to described timer 240 and ceases and desist order, so that described timer 240 stops timing and zero clearing.
Be provided with a threshold value in the described timer 240, when timer 240 starts and timing when having reached described threshold value, described timer 240 sends one to state reflection module 260 and confirms order.Described state reflection module 260 receives after timer 240 sends the order of accepting one's fate really, confirms that then the data handling system of chip to be measured makes a mistake, and carries out mistake and report.Described threshold value can be according to the frequency of the transfer of data of the upstream and downstream chip of chip to be measured, and the data processing efficiency of the inter-process module 2 of chip to be measured is provided with, with the delay of removing the transfer of data that normal data handling procedure the brought influence for testing result.
Understandablely be, after timer 240 had started and picked up counting, judge module 220 can no longer send starting command, or timer 240 ignores and fall the starting command that judge module 220 sends subsequently, and kept time status always.And if only if timer 240 receives cease and desist order after, timer 240 just stops timing and zero clearing.
As from the foregoing, whether the embodiment of the invention is to come the inter-process module of judgment data treatment system to make a mistake by the state of judging message input FIFO4 and message output FIFO6.Concrete, in the system of whole data processing, cause the reason that data path interrupts to have three kinds: first kind is that the link of upstream and downstream chip breaks down; Second kind is that downstream chip can't receive data and produce back-pressure; The third is the internal fault of data handling system to be tested.Because first kind be not that fault causes, so the embodiment of the invention forecloses it, and second kind belong to a kind of normal protection mechanism, therefore also will get rid of when carrying out fault detect.To sum up, judge at first whether message input FIFO4 reaches capacity,, can judge that the inter-process module of the data handling system of generation test can receive and issue data as long as message input FIFO4 does not reach capacity.If message input FIFO4 reaches capacity, to judge then whether message output FIFO6 is empty, if message output FIFO6 is not sky then can thinks that message output FIFO6 can receive data from the inter-process module, the inter-process module is normal, and why message input FIFO4 reaches capacity then is because downstream chip has produced back-pressure.If message input FIFO4 has reached saturated, and message output FIFO6 be empty, and the duration of this process surpassed default time threshold, illustrate that then message output FIFO6 can't be from inter-process module reception data, fault has taken place in the inter-process module.
Understandable is that the detection system of the data handling system that the embodiment of the invention provided and the functional module of chip to be measured can be integrated in on the chip piece, also can be divided in different chips or the device.
The detection system of the data handling system that the embodiment of the invention provided is come the state of the inter-process module of judgment data treatment system by the state of detection messages input FIFO4 and message output FIFO6, simple to operate, and can finish voluntarily by system, need not human intervention, be convenient in time find the fault of inter-process module, improved the stability of system.
Please refer to Fig. 3, Figure 3 shows that the schematic flow sheet of detection method of the data handling system of the embodiment of the invention.
The detection method of the data handling system of the embodiment of the invention comprises:
Step 301, judge whether message input FIFO is full, if, execution in step 302; Otherwise execution in step 306;
Step 302, judge whether message output FIFO is empty, if, execution in step 303; Otherwise execution in step 306;
Step 303, startup timer;
Whether step 304, the timing time of judging timer reach a default time threshold, if then execution in step 305; Otherwise re-execute step 301;
Step 305, report mistake;
Step 306, timer zero clearing, execution in step 301 then;
Understandablely be item can judge that the inter-process module may fault take place and the device timing that picks up counting as long as satisfy step 301 and step 302 simultaneously, so the execution sequence of the content described in step 301 and the step 302 to exchange.
The detection method of the data handling system that the embodiment of the invention provided is come the state of the inter-process module of judgment data treatment system by the state of detection messages input FIFO4 and message output FIFO6, simple to operate, and can finish voluntarily by system, need not human intervention, be convenient in time find the fault of inter-process module, improved the stability of system.
One of ordinary skill in the art will appreciate that: all or part of step that realizes said method embodiment can be finished by the relevant hardware of program command, aforesaid program can be stored in the computer read/write memory medium, this program is carried out the step that comprises said method embodiment when carrying out; And aforesaid storage medium comprises: various media that can be program code stored such as ROM, RAM, magnetic disc or CD.
More than disclosed only be several specific embodiment of the present invention, still, the present invention is not limited thereto, any those skilled in the art can think variation all should fall into protection scope of the present invention.