CN100385391C - Hardware implementing method for embedded real-time precise abnormal mechanism - Google Patents
Hardware implementing method for embedded real-time precise abnormal mechanism Download PDFInfo
- Publication number
- CN100385391C CN100385391C CNB200610042865XA CN200610042865A CN100385391C CN 100385391 C CN100385391 C CN 100385391C CN B200610042865X A CNB200610042865X A CN B200610042865XA CN 200610042865 A CN200610042865 A CN 200610042865A CN 100385391 C CN100385391 C CN 100385391C
- Authority
- CN
- China
- Prior art keywords
- level
- processor
- abnormal
- stage
- exception
- Prior art date
- Legal status (The legal status 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 status listed.)
- Expired - Fee Related
Links
Images
Landscapes
- Advance Control (AREA)
Abstract
The present invention discloses a hardware implementing method for an embedded real-time precise abnormal mechanism, which comprises the following steps: a distributed structure is adopted, and an instruction extracting stage, a decoding stage, an execution stage, a memory access stage and a write-back stage are all provided with abnormal checking logic for checking the abnormal type generated in the pipeline stage in the current clock cycle; the checked highest abnormal relative information generated by the pipeline stage in the current clock cycle is transferred to centralized abnormal arbitration logic, and a mirror register is added in each architectural register of a pipeline of an embedded processor; when the response of the processor is abnormal, the architectural resisters are stored in the mirror registers corresponding to the architectural registers; when the response of the processor returns abnormally, the values of the mirror registers are recovered in the corresponding architectural registers, and the processor is switched to a normal program process after completing an abnormal response once. As a distributed abnormal processing method based on the mirror registers is adopted, the speed of the real-time processing of the embedded processor is increased.
Description
Technical field
The present invention relates to a kind of hardware implementation method of embedded real-time precise abnormal mechanism.
Background technology
In embedded pipeline processor design, the realization of real-time precise abnormal mechanism is very crucial to the influence of processor performance.In the processor course of work, response abnormality means the change of processor instruction execution flow process and processor state.For the Embedded Real-Time processor, rapid saving processor standing state and enter the embodiment that exception handling procedure is exactly its real-time how.As shown in table 1, for pipeline processor, all might take place unusually in each level of streamline, and in the same clock period, have a plurality of pipelining-stages and produce unusual.Therefore the efficient of precise abnormal realization mechanism directly influences the performance of flush bonding processor.
Table 1 streamline is at different levels contingent unusual
Pipelining-stage | Exception Type |
Get and refer to level | External interrupt, instruction storage is unusual |
Decode stage | External interrupt, illegal instruction exceptions, floating-point exception etc. |
Execution level | External interrupt, arithmetical operation is unusual, and trap is unusual etc. |
The memory access level | External interrupt, alignment is unusual, and data storage is unusual |
Write back level | Outside unusual etc. |
With reference to Fig. 4, document " PowerPC750 RISC Microprocessor User ' s manual (www.ibm.com) " has been introduced the precise abnormal realization mechanism of the PowerPC750 processor of IBM Corporation.This processor is made up of hardware and software two parts unusual complete processing once.When the processor response abnormality, at first hardware is preserved the program counter register and the machine status register(MSR) of current processor, begins the execute exception service subprogram according to Exception Type then.In the middle of the execute exception service subprogram, at first preserve whole states of current processor by software, comprise 32 general-purpose registers, some specified registers etc.After preservation finishes, carry out the core of interrupt service subroutine.After the core was finished, whole states of the processor of having been preserved by software rejuvenation switched to normal program circuit.Clearly, the state that software is preserved and recovery is handled is realized by carrying out access instruction.But because the difference of intrinsic response speed between current processor and the storer, the efficient that processor is carried out access instruction is very low.For the processor of PowerPC architecture, show by benchmark, when hitting Cache, on average need 10-20 clock period when carrying out an access instruction.If when not hitting cache, on average need 30-40 clock period.Adopt software that the scene of processor is preserved and when recovering,, when carrying out access instruction, can not hit Cache because change has taken place program circuit.Need a cost hundreds of clock period in order between normal state and anomalous mode, to switch.Therefore adopt the method for software to preserve processor state and can reduce processor, be unfavorable for the application of processor in real-time system unusual response speed.
Summary of the invention
In order to overcome the prior art processor deficiency low to unusual response speed, the invention provides a kind of hardware implementation method of embedded real-time precise abnormal mechanism, improved processor to unusual response speed.
The technical solution adopted for the present invention to solve the technical problems is: a kind of hardware implementation method of embedded real-time precise abnormal mechanism, it is characterized in that, and comprise the steps:
1) adopts distributed frame, refer to level, decode stage, execution level, memory access level and write back level an abnormal logic detection all is set getting of flush bonding processor streamline, detect and get finger level, decode stage, execution level, memory access level described in the present clock period and write back the Exception Type that level produces, and the highest unusual relevant information of priority of getting finger level, decode stage, execution level, memory access level and writing back the level generation to detected this cycle of centralized exception arbitration logical delivery;
2) each architecture register to the flush bonding processor streamline increases a mirror registers;
3) during the processor response abnormality, the value of architecture register is saved in the mirror registers corresponding with it, loads exception vector, the execute exception service subprogram;
4) when from described unusual service subprogram, returning, the value of mirror registers is returned in the architecture register corresponding with it, processor is finished an exception response, switches to normal program circuit.
The invention has the beneficial effects as follows that the distributed abnormality eliminating method owing to having adopted based on mirror registers behind the flush bonding processor response abnormality, can switch to the exception handler state from normal handling device state in a clock period.After abnormality processing is finished, can be in a clock period from the abnormality processing recovering state to normal condition.Compare with prior art " between normal state and anomalous mode, switch and need a cost hundreds of clock period ", improved the speed of flush bonding processor aspect processing in real time greatly.
The present invention is further described below in conjunction with drawings and Examples.
Description of drawings
Fig. 1 is the hardware implementation method process flow diagram of embedded real-time precise abnormal mechanism of the present invention
Fig. 2 is a distributed frame synoptic diagram in the hardware implementation method of embedded real-time precise abnormal mechanism of the present invention
Fig. 3 is a mirror registers structural representation in the hardware implementation method of embedded real-time precise abnormal mechanism of the present invention
Fig. 4 is the precise abnormal implementation method process flow diagram of document PowerPC750 processor in the background technology
Embodiment
With reference to Fig. 1~3, the streamline of flush bonding processor is divided into 5 grades, is respectively to get to refer to level decode stage, execution level, memory access level and write back level.Adopt distributed frame, an abnormal logic detection all is set in each level of streamline.This logic be responsible for detecting this grade all Exception Types that can judge, the centralized exception arbitration logic of co-current flow waterline reports the detected priority of this grade present clock period the highest Exception Type.Centralized exception arbitration logic is unusual at different pipelining-stage reports, priority according to the exception response of architectural definition is carried out centralized arbitration, judge the highest unusual of the priority of present clock period inner treater response, this structure is assigned to each flowing water section of streamline with abnormal logic detection, realizes the fast detecting to a unusual clock period.
In the pipeline processor design, each architecture register has been increased a mirror registers, when the processor response abnormality, hardware is saved in architecture register in the mirror registers corresponding with it like this.When returning unusually, hardware returns to the value of mirror registers in the architecture register corresponding with it.
Behind the processor response abnormality, the processor scene was saved in architecture register in its corresponding mirror registers a clock period.Interrupt service subroutine includes only the real kernel program relevant with Interrupt Process.When returning unusually, hardware returned to data in the architecture register in a clock period from mirror registers, and abnormality processing is finished.Distributed abnormality detection structure has been accelerated unusual response speed simultaneously.
This implementation method is compared with existing method, has avoided preserving the memory access time-delay that the processor scene is produced by the method for software.Unusual service subprogram includes only and is somebody's turn to do unusual relevant kernel program.Processor is responsible for preserving and recovering by hardware because of caused on-the-spot the switching fully of exception response.This method can be finished the switching at processor scene in a clock period, with processor processing when unusual because the on-the-spot performance loss that switching caused has dropped to minimumly, accelerated flush bonding processor to unusual real-time response ability.
The present invention has finished the exception response mechanism of this processor in the flush bonding processor " dragon rises R2 " that our design is finished.This flush bonding processor operation Vxworks operating system, unusual and personal computer carries out data interaction by serial ports.By the test of Vxworks operating system, adopt the exception handling of this method design to compare with exception handling based on software, the abnormality processing performance of processor has improved 10 times.
Claims (1)
1. the hardware implementation method of an embedded real-time precise abnormal mechanism is characterized in that, comprises the steps:
1) adopts distributed frame, refer to level, decode stage, execution level, memory access level and write back level an abnormal logic detection all is set getting of flush bonding processor streamline, detect and get finger level, decode stage, execution level, memory access level described in the present clock period and write back the Exception Type that level produces, and the highest unusual relevant information of priority of getting finger level, decode stage, execution level, memory access level and writing back the level generation to detected this cycle of centralized exception arbitration logical delivery;
2) each architecture register to the flush bonding processor streamline increases a mirror registers;
3) during the processor response abnormality, the value of architecture register is saved in the mirror registers corresponding with it, loads exception vector, the execute exception service subprogram;
4) when from described unusual service subprogram, returning, the value of mirror registers is returned in the architecture register corresponding with it, processor is finished an exception response, switches to normal program circuit.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CNB200610042865XA CN100385391C (en) | 2006-05-25 | 2006-05-25 | Hardware implementing method for embedded real-time precise abnormal mechanism |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CNB200610042865XA CN100385391C (en) | 2006-05-25 | 2006-05-25 | Hardware implementing method for embedded real-time precise abnormal mechanism |
Publications (2)
Publication Number | Publication Date |
---|---|
CN1866200A CN1866200A (en) | 2006-11-22 |
CN100385391C true CN100385391C (en) | 2008-04-30 |
Family
ID=37425228
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CNB200610042865XA Expired - Fee Related CN100385391C (en) | 2006-05-25 | 2006-05-25 | Hardware implementing method for embedded real-time precise abnormal mechanism |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN100385391C (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104461468B (en) * | 2014-10-27 | 2017-10-20 | 杭州中天微系统有限公司 | The precise abnormal maintaining method and device being rapidly completed based on processor instruction |
CN109284176B (en) * | 2017-07-20 | 2020-11-03 | 龙芯中科技术有限公司 | Interrupt response method, device and computer readable storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US4903264A (en) * | 1988-04-18 | 1990-02-20 | Motorola, Inc. | Method and apparatus for handling out of order exceptions in a pipelined data unit |
US6216222B1 (en) * | 1998-05-14 | 2001-04-10 | Arm Limited | Handling exceptions in a pipelined data processing apparatus |
US6393555B1 (en) * | 1999-08-05 | 2002-05-21 | Advanced Micro Devices, Inc. | Rapid execution of FCMOV following FCOMI by storing comparison result in temporary register in floating point unit |
CN1410886A (en) * | 2001-09-27 | 2003-04-16 | 中国科学院计算技术研究所 | Treatment method of realizing access accuracy exception in command pipeline |
-
2006
- 2006-05-25 CN CNB200610042865XA patent/CN100385391C/en not_active Expired - Fee Related
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US4903264A (en) * | 1988-04-18 | 1990-02-20 | Motorola, Inc. | Method and apparatus for handling out of order exceptions in a pipelined data unit |
US6216222B1 (en) * | 1998-05-14 | 2001-04-10 | Arm Limited | Handling exceptions in a pipelined data processing apparatus |
US6393555B1 (en) * | 1999-08-05 | 2002-05-21 | Advanced Micro Devices, Inc. | Rapid execution of FCMOV following FCOMI by storing comparison result in temporary register in floating point unit |
CN1410886A (en) * | 2001-09-27 | 2003-04-16 | 中国科学院计算技术研究所 | Treatment method of realizing access accuracy exception in command pipeline |
Also Published As
Publication number | Publication date |
---|---|
CN1866200A (en) | 2006-11-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102112966B (en) | Apparatus and methods for speculative interrupt vector prefetching | |
KR101513953B1 (en) | Methods and apparatus to predict non-execution of conditional non-branching instructions | |
US8352713B2 (en) | Debug circuit comparing processor instruction set operating mode | |
CN100498693C (en) | Conditional instruction execution via emissary instruction for condition evaluation | |
US20110167244A1 (en) | Early instruction text based operand store compare reject avoidance | |
US8255726B2 (en) | Zero indication forwarding for floating point unit power reduction | |
US5862371A (en) | Method and system for instruction trace reconstruction utilizing performance monitor outputs and bus monitoring | |
TW201224749A (en) | Last branch record indicators for transactional memory | |
CN101809542A (en) | System and method for monitoring debug events | |
CN104156197A (en) | Microprocessor and method for operating microprocessor | |
US12020033B2 (en) | Apparatus and method for hardware-based memoization of function calls to reduce instruction execution | |
US20050172107A1 (en) | Replay instruction morphing | |
CN100451951C (en) | 5+3 levels pipeline structure and method in RISC CPU | |
CN100385391C (en) | Hardware implementing method for embedded real-time precise abnormal mechanism | |
Jones et al. | Evaluating the effects of compiler optimisations on AVF | |
Kranitis et al. | Optimal periodic testing of intermittent faults in embedded pipelined processor applications | |
US7496899B2 (en) | Preventing loss of traced information in a data processing apparatus | |
US8082467B2 (en) | Triggering workaround capabilities based on events active in a processor pipeline | |
EP3646171A1 (en) | Branch prediction for fixed direction branch instructions | |
US7200773B2 (en) | Reproducing errors via inhibit switches | |
Wagner et al. | Using field-repairable control logic to correct design errors in microprocessors | |
CN117043612A (en) | Method, system and apparatus for accurate last branch record event logging | |
US12072378B2 (en) | Debug state machine triggered extended performance monitor counter | |
CN101158891B (en) | Apparatus and method for checking floating point stack overflow on non-CISC processor | |
US8484007B2 (en) | Method and apparatus of handling instruction rejects, partial rejects, stalls and branch wrong in a simulation model |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
C17 | Cessation of patent right | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20080430 Termination date: 20110525 |