KR20080000944A - Processor with pipelined architecture and control method thereof - Google Patents
Processor with pipelined architecture and control method thereof Download PDFInfo
- Publication number
- KR20080000944A KR20080000944A KR1020060058868A KR20060058868A KR20080000944A KR 20080000944 A KR20080000944 A KR 20080000944A KR 1020060058868 A KR1020060058868 A KR 1020060058868A KR 20060058868 A KR20060058868 A KR 20060058868A KR 20080000944 A KR20080000944 A KR 20080000944A
- Authority
- KR
- South Korea
- Prior art keywords
- address
- processor
- instruction
- unit
- program
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 12
- 239000003795 chemical substances by application Substances 0.000 description 7
- 238000010586 diagram Methods 0.000 description 4
- 230000010365 information processing Effects 0.000 description 1
- 229910052710 silicon Inorganic materials 0.000 description 1
- 239000010703 silicon Substances 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/30—Arrangements for executing machine instructions, e.g. instruction decode
- G06F9/38—Concurrent instruction execution, e.g. pipeline or look ahead
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Advance Control (AREA)
- Memory System Of A Hierarchy Structure (AREA)
Abstract
Description
도 1은 종래의 파이프라인 프로세서에 대한 개략적인 블록도이고,1 is a schematic block diagram of a conventional pipeline processor,
도 2는 본 발명에 따른 파이프라인 프로세서에 대한 개략적인 블록도이고,2 is a schematic block diagram of a pipeline processor according to the present invention;
도 3은 본 발명에 따른 파이프라인 프로세서에서 캐쉬히트가 발생한 경우의 처리부의 명령어 순서도이고,3 is a flow chart of instructions of a processor when a cache hit occurs in a pipeline processor according to the present invention;
도 4는 본 발명에 따른 파이프라인 프로세서에서 캐쉬미스가 발생한 경우의 처리부의 명령어 순서도이고,4 is a flow chart of instructions of a processor when a cache miss occurs in a pipeline processor according to the present invention;
도 5는 본 발명에 따른 파이프라인 프로세서의 제어방법을 표시하는 흐름도이다.5 is a flowchart showing a control method of a pipeline processor according to the present invention.
* 도면의 주요 부분에 대한 부호의 설명 *Explanation of symbols on the main parts of the drawings
210 : 외부메모리 220 : 프로세서210: external memory 220: processor
230 : 캐쉬부 240 : 프로그램카운터부230: cache unit 240: program counter unit
250 : 스톨버퍼 260 : 처리부250: stall buffer 260: processing unit
262 : 명령어페치스테이지 264 : 명령어디코더스테이지262: instruction fetch stage 264: instruction decoder stage
266 : 어드레스발생기스테이지 268 : 실행스테이지266: address generator stage 268: execution stage
270 : 라이트백스테이지 270: Lightback Stage
본 발명은 프로세서 및 그 제어방법에 관한 것으로 더욱 상세하게는, 파이프라인의 동작을 정지시키고 않고 캐쉬미스에 대응할 수 있는 프로세서 및 그의 제어방법에 관한 것이다.The present invention relates to a processor and a control method thereof, and more particularly, to a processor and a control method thereof that can cope with the cache miss without stopping the operation of the pipeline.
최근의 프로세서는 성능 향상을 위해 파이프라인(pipeline) 구조를 많이 사용하고 있다. 파이프라인 구조는 명령어 처리 과정을 다수의 스테이지(stage)로 나누고, 한 사이클 동안 다수개의 명령어를 각각 다른 스테이지에서 병렬 처리함으로써 사이클 당 정보처리를 극대화하는 구조이다.Modern processors use many pipeline structures to improve performance. The pipeline structure divides the instruction processing process into a plurality of stages and maximizes the information processing per cycle by parallel processing a plurality of instructions in different stages during one cycle.
이러한 파이프라인을 종래의 파이프라인 프로세서에 대한 개략적인 블록도가 도 1에 도시하고 있다.Such a pipeline is shown in FIG. 1 as a schematic block diagram of a conventional pipeline processor.
프로세서(120)는 처리부(160)에서 처리할 정보를 저장하는 외부메모리(110)와 연결되며, 캐쉬부(130), 프로그램카운터부(140), 정지신호발생부(150) 및 처리부(160)로 구성되어 있다.The
캐쉬부(130)는 프로세서(120)의 코어와 동일하거나 비슷한 동작주파수를 가지게 설계된 작은 메모리영역으로, 프로세서(120)의 성능을 향상시키는 역할을 하며, 프로그램카운터부(140)는 명령어 페치를 수행할 명령어의 어드레스를 저장하고 있다. The
프로그램카운터부(140)의 어드레스를 캐쉬부(130)에 요청하면 캐쉬부(130)는 해당 어드레스의 명령어를 처리부(160)에 전달하고, 처리부(160)는 입력받은 명령어를 명령어디코더스테이지(164)에서 해석하여 이를 적절한 제어신호로 변경한다.When the address of the
그러나 캐쉬부(130)는 전체 프로그램의 일부분만을 저장하고 있기 때문에 프로세서(120)가 요구하는 어드레스의 명령어를 가지고 있지 않은 경우가 발생한다. 이런 경우를 캐쉬미스라고 부르며 캐쉬부(130)는 외부메모리(110)에서 해당하는 명령어를 가져오게 되나, 외부메모리(110)는 속도가 느리기 때문에 프로세서(120)의 처리부(160)는 캐쉬부(130)가 명령어를 기다리는 동안에 동작을 잠시 멈추고 있어야 한다.However, since the
즉, 파이프라인 구조에는 하나의 명령어의 동작이 완전히 끝나기 전에 다른 명령어가 수행을 시작하기 때문에 캐쉬미스가 발생하면 잘못된 처리를 하게 된다. 이를 방지하기 위해 정지신호발생부(150)는 처리부(160)에 정지신호를 출력하여 처리부(160)의 각 스테이지 진행을 정지시킨다.In other words, in a pipeline structure, when an instruction is executed before another instruction is completely finished, a mismatch occurs when a cache miss occurs. To prevent this, the
이러한 종래의 정지신호는 프로세서(120)의 모든 파이프라인레지스터(미도시됨)를 구동해야 하므로, 정지신호를 전달하는 경로가 프로세서(120)의 동작주파수를 결정하는 임계지연에 많은 영향을 주게 되고 많은 영역의 실리콘 면적을 차지하게 된다. Since the conventional stop signal must drive all pipeline registers (not shown) of the
본 발명은 상기 문제점을 해결하기 위한 것으로서, 파이프라인의 동작을 정지시키고 않고 캐쉬미스에 대응할 수 있는 프로세서 및 그의 제어방법을 제공하는 것을 목적으로 한다. SUMMARY OF THE INVENTION The present invention has been made to solve the above problems, and an object of the present invention is to provide a processor and a control method thereof that can cope with a cache miss without stopping the operation of the pipeline.
상기 목적을 달성하기 위하여, 본 발명은, 프로세서에 있어서, 다수의 순차적 처리 스테이지를 가지고 명령어 페치를 수행하는 처리부와, 상기 처리부가 페치를 수행할 명령어에 관한 어드레스를 출력하는 프로그램카운터부와, 소정의 메인메모리로부터 상기 처리부에서 수행할 프로그램을 부분적으로 수령하여 저장하고, 상기 프로그램카운부로부터 어드레스를 수령하여 해당 어드레스에 대응하는 상기 프로그램 중의 명령어를 상기 처리부에 제공하며, 상기 수령한 어드레스에 대응하는 명령어를 가지고 있지 아니한 경우 대기신호를 출력하는 캐쉬부와, 상기 대기신호에 기초하여 다음에 수행될 브랜치 명령어의 목표 어드레스를 저장하였다가 상기 프로그램카운터부에 제공하는 스톨버퍼를 제공한다. In order to achieve the above object, the present invention provides a processor comprising: a processor for performing an instruction fetch with a plurality of sequential processing stages, a program counter unit for outputting an address relating to an instruction for which the processor is to fetch, and Partially receive and store a program to be executed in the processing unit from the main memory of the controller, receive an address from the program counter and provide an instruction in the program corresponding to the address to the processing unit, and correspond to the received address A cache unit for outputting a wait signal when not having a command, and a stall buffer for storing a target address of a branch instruction to be executed next based on the wait signal and providing the program to the program counter unit.
상기 스톨버퍼는 상기 다음에 수행될 브랜치 명령어의 목표 어드레스에 대하여 저장할 수 있는 공간을 브랜치 슬롯의 개수만큼 갖는 것이 바람직하다.Preferably, the stall buffer has a space that can be stored for the target address of the branch instruction to be executed next to the number of branch slots.
한편, 본 발명은, 다수의 순차적 처리 스테이지를 가지고 명령어 페치를 수행하는 처리부와, 소정의 메인메모리로부터 상기 처리부에서 수행할 프로그램을 부분적으로 수령하여 저장하는 캐쉬부를 갖는 프로세서의 제어방법에 있어서, 상기 캐쉬부에 프로그램카운터부의 어드레스의 명령어를 요청하는 단계와, 상기 캐쉬부의 어드레스에 요청된 명령어가 없으면 다수의 스테이지로 이루어진 처리부에 있는 명령어를 한 스테이지 진행시키고 상기 처리부의 첫 번째 스테이지에 특정값을 입력하는 단계와, 상기 처리부의 상기 한 스테이지 진행된 명령어에 브랜치 명령어가 있으면 목표 어드레스를 스톨버퍼에 저장하는 단계에 의해서도 상기 목적을 달성할 수 있다.Meanwhile, the present invention provides a control method of a processor having a processor configured to perform instruction fetch with a plurality of sequential processing stages, and a cache configured to partially receive and store a program to be executed in the processor from a predetermined main memory. Requesting an instruction of an address of a program counter of a cache unit, and if there is no instruction requested of an address of the cache unit, advances a command of a processor consisting of a plurality of stages by one stage and inputs a specific value to the first stage of the processor; And the step of storing a target address in a stall buffer if a branch instruction exists in the one-stage advanced instruction of the processing unit.
상기 스톨버퍼에 목표 어드레스가 저장된 후에 상기 캐쉬부의 어드레스에 요청된 명령어가 있으면, 상기 스톨버퍼에 저장된 목표 어드레스를 상기 프로그램카운터부에 업데이트시키는 단계를 더 포함하는 것이 바람직하다. After the target address is stored in the stall buffer, it is preferable to further include updating the target counter stored in the stall buffer to the program counter if there is an instruction requested for the cache address.
이하, 첨부된 도면을 참조하여 본 발명의 바람직한 실시예에 관하여 상세히 설명한다. Hereinafter, exemplary embodiments of the present invention will be described in detail with reference to the accompanying drawings.
본 발명에 따른 파이프라인 프로세서에 대한 개략적인 블록도가 도 2에 도시되어 있다. 본 발명에 따른 프로세서(220)는 처리부(260)에서 처리할 정보를 저장하는 외부메모리(210)와 연결되며, 캐쉬부(230), 프로그램카운터부(240), 스톨버퍼(250) 및 처리부(260)로 구성되어 있다.A schematic block diagram for a pipeline processor according to the present invention is shown in FIG. The
캐쉬부(230)는 프로세서(220)의 처리부(260)에 제공될 명령어를 저장하고 있으며, 프로그램카운터부(240)는 명령어 페치를 수행할 명령어의 어드레스를 저장하고 있다. 프로그램카운터부(240)의 어드레스를 캐쉬부(230)에 요청하면 캐쉬부(240)는 해당 어드레스의 명령어를 처리부(260)에 전달한다.The
처리부(260)는 명령어페치스테이지(262), 명령어디코더스테이지(264), 어드레스발생기스테이지(266), 실행스테이지(268) 및 라이트백스테이지(270)의 5개의 스테이지를 갖는다. The
명령어페치스테이지(262)는 명령어를 페치하기 위한 것으로, 페치하려는 명령어가 캐쉬부(230)에 존재하면 캐쉬히트를 발생시키고, 명령어가 존재하지 않으면 캐쉬미스를 발생시킨다.The
명령어디코더스테이지(264)는 명령어를 해석하여 내부 레지스터 등의 리소스에서 데이터를 가져오고, 어드레스발생기스테이지(266)는 데이터 캐쉬에 접근하기 위한 어드레스를 계산하고 브랜치의 조건을 판단하여 프로그램카운터부(240)를 업데이트시킨다.The
실행스테이지(268)는 리소스를 실제로 연산하여 결과를 얻는 것으로, 예를 들면 2개의 수를 가산하거나 승산하는 지정된 동작을 실행하고, 라이트백스테이지(270)는 연산결과나 캐쉬부에서 읽은 값을 내부 레지스터에 라이트한다.The
도 2에서는 5개의 스테이지를 갖는 처리부(260)을 도시하고 있지만, 본 발명은 처리부(260)의 스테이지 개수에 의해 제한되는 것은 아니다. Although FIG. 2 shows a
캐쉬부(230)는 명령어페치스테이지(262)에서 발생된 캐쉬미스에 대응하는 신호를 프로그램카운터부(240)와 스톨버퍼(250)에 제공한다. 여기에서 캐쉬부(230)는 단순히 프로그램을 저장하는 장소만이 아니라 이와 관련된 제어신호를 발생하고 관리하는 영역을 포함한다.The
스톨버퍼(250)는 브랜치 슬롯내에서 캐쉬미스가 발생해도 정상적인 브랜치 명령어 수행이 가능하도록 하기 위한 것으로, 브랜치 슬롯만큼의 엔트리를 가지고 있고 각각의 엔트리는 캐쉬히트가 발생하면 가져와야 할 프로그램의 어드레스가 저장된다.The
도 3은 캐쉬히트가 발생한 경우에 파이프라인에서 진행되는 명령어의 처리순서를 보여준다.3 shows a processing sequence of instructions that are processed in a pipeline when a cache hit occurs.
(a)에서는 프로그램카운터부(240)의 현재 프로그램카운터 어드레스가 Ox80이 므로 캐쉬부(230)에서 Ox80 어드레스에 있는 명령어를 가져와서 IF스테이지(262)에 입력시키며, 다른 명령어들이 각각 ID스테이지(264), AG스테이지(266), EX스테이지(268) 및 WB스테이지(270)에서 각각 수행된다. In (a), since the current program counter address of the
(b)에서는 프로그램카운터부(240)의 현재 프로그램카운터 어드레스가 Ox81이므로 캐쉬부(230)에서 Ox81 어드레스에 있는 명령어를 가져와서 IF스테이지(262)에 입력시킨다. 그리고 브랜치 명령어가 AG스테이지(266)에 입력되었기 때문에 프로그램카운터부(240)의 다음 프로그램카운터 어드레스는 브랜치 명령어가 가리키는 Ox200 어드레스가 된다. 따라서 (c)에서는 프로그램카운터부(240)의 현재 프로그램카운터 Ox200 어드레스에 있는 명령어가 IF스테이지(262)에 입력된다. 이 경우에는 AG스테이지(266)에서 브랜치 명령어가 프로그램카운터부(240)를 업데이트했기 때문에 브랜치 명령어 뒤에 오는 2개의 명령어는 무조건 수행되게 된다. 브랜치 명령어 뒤에 있어도 파이프라인으로 인해 수행되는 부분을 브랜치 슬롯이라고 한다. In (b), since the current program counter address of the
도 4는 본 발명에 따른 파이프라인 프로세서에서 캐쉬미스가 발생한 경우의 처리부의 명령어 진행을 보여준다. 4 is a flowchart illustrating instructions of a processor when a cache miss occurs in a pipeline processor according to the present invention.
(a)에서는 프로그램카운터부(240)의 현재 프로그램카운터 어드레스가 Ox79이므로 캐쉬부(230)에서 Ox79 어드레스에 있는 명령어를 가져와서 IF스테이지(262)에 입력시키며, 다른 명령어들이 각각 ID스테이지(264), AG스테이지(266), EX스테이지(268) 및 WB스테이지(270)에서 각각 수행된다. In (a), since the current program counter address of the
(b)에서는 프로그램카운터부(240)의 현재 프로그램카운터 어드레스 Ox80의 명령어에서 캐쉬미스가 발생한 상태를 표시하고 있다. 캐쉬미스이기 때문에 캐쉬 부(230)의 대기신호로 인하여 프로그램카운터부(240)는 그대로 유지된다. 처리부(260)는 IF스테이지(262)에 NOP를 삽입하고, 스톨버퍼(250)의 첫 번째 엔트리에 Ox80 명령어 다음에 수행되어야 할 Ox81 명령어의 주소를 저장한다. In (b), a state in which a cash miss occurs in the current program counter address Ox80 of the
(c)에서 AG스테이지(266)에 브랜치 명령이 입력된다. 캐쉬미스가 아니면 AG스테이지(266)에서 바로 프로그램카운터부(240)의 프로그램카운터 어드레스가 브랜치 목표 어드레스인 Ox200으로 업데이트되지만, 캐쉬미스이기 때문에 캐쉬부(230)의 대기신호로 인하여 프로그램카운터부(240)의 프로그램카운터 어드레스가 업데이트되지 않는다. 이 경우 브랜치 명령어는 브랜치 목표 어드레스를 스톨버퍼(250)의 두 번째 엔트리에 기록된다. In (c), the branch instruction is input to the
그 후에 (e)에서와 같이 캐쉬히트가 발생하여 프로그램카운터부(240)의 현재 프로그램카운터 어드레스 Ox80 명령어가 수행되면 스톨버퍼(250)에 저장된 프로그램카운터 어드레스들에 의해 프로그램카운터부(240)가 바뀌어 정상적인 동작을 수행한다.Thereafter, as shown in (e), when the cache hit occurs and the current program counter address Ox80 command of the
본 발명에 따른 파이프라인 프로세서의 제어방법을 표시하는 흐름도가 도 5에 도시되어 있다.5 is a flowchart illustrating a control method of a pipeline processor according to the present invention.
프로세서에 전원이 공급되면 프로세서의 프로그램카운부(240)와 스톨버퍼(250)를 초기화한다(S502). 캐쉬부(230)에 프로그램카운부(240)의 프로그램카운터 어드레스의 명령어를 요청한다.When power is supplied to the processor, the
캐쉬부(230)에 요청한 명령어가 없으면(S506), 처리부(260)의 명령어를 한 스테이지 전진시키고, IF스테이지(262)에 NOP를 입력한다(S508). 처리부(260)의 AG 스테이지(266)에 브랜치 명령어가 있으면 목표 어드레스를 스톨버퍼(250)에 저장하고, 스톨버퍼(250)에 저장된 목표 어드레스가 유효하다는 신호를 프로그램카운터부(240)에 공급한다(S510). If there is no instruction requested by the cache unit 230 (S506), the instruction of the
캐쉬부(230)에 프로그램카운터부(240)에 유지된 어드레스의 명령어를 재요청한다(S512). 캐쉬히트가 발생하면(S506) 처리부(260)에 있는 명령어를 한 스테이지 전진시키고, 명령어를 캐쉬부(230)에서 가져온다(S520). The
그리고 스톨버퍼(250)에 저장된 목표어드레스가 유효하다는 신호가 프로그램카운터부(240)에 공급되면(S522), 프로그램카운터부(240)의 프로그램카운터 어드레스를 스톨버퍼(250)에 저장된 어드레스로 변경하고, 스톨버퍼(250)에 저장된 어드레스를 클리어한다(S524).When the signal indicating that the target address stored in the
처리부(260)에 종료 명령어가 존재하면(S526), 처리부(260)의 처리를 종료시키고. 그렇지 않으면 처리부(260)에 브랜치가 존재하는지의 여부를 판단하여(S528), 브랜치이면 프로그램카운터부(240)의 프로그램카운터 어드레스를 목표 어드레스로 변경하고(S530), 브랜치가 아니면 프로그램카운터부(240)의 프로그램카운터 어드레스를 명령어의 크기만큼 증가시킨다(S532).If an end instruction exists in the processing unit 260 (S526), the processing of the
상기한 바와 같이, 본 발명에 의하면, 파이프라인 프로세서에 정지 트리가 없어도 프로그램 캐시미스에 의한 브랜치 명령어의 오류를 수정할 수 있다. As described above, according to the present invention, it is possible to correct an error of a branch instruction caused by a program cache miss even if there is no stop tree in the pipeline processor.
또한, 본 발명에 의하면, 캐쉬미스에 대응하기 위한 정지 트리를 삭제함으로서 프로세서의 최대 동작주파수를 더욱 높게 확보할 수 있고, 칩 면적도 줄어들게 된다.In addition, according to the present invention, the maximum operating frequency of the processor can be secured higher by deleting the stop tree corresponding to the cache miss, and the chip area is reduced.
Claims (4)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
KR1020060058868A KR20080000944A (en) | 2006-06-28 | 2006-06-28 | Processor with pipelined architecture and control method thereof |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
KR1020060058868A KR20080000944A (en) | 2006-06-28 | 2006-06-28 | Processor with pipelined architecture and control method thereof |
Publications (1)
Publication Number | Publication Date |
---|---|
KR20080000944A true KR20080000944A (en) | 2008-01-03 |
Family
ID=39213046
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
KR1020060058868A KR20080000944A (en) | 2006-06-28 | 2006-06-28 | Processor with pipelined architecture and control method thereof |
Country Status (1)
Country | Link |
---|---|
KR (1) | KR20080000944A (en) |
-
2006
- 2006-06-28 KR KR1020060058868A patent/KR20080000944A/en not_active Application Discontinuation
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP5722396B2 (en) | Method and apparatus for emulating branch prediction behavior of explicit subroutine calls | |
US7444501B2 (en) | Methods and apparatus for recognizing a subroutine call | |
JP2009536770A (en) | Branch address cache based on block | |
JP2006520964A5 (en) | ||
JP2015133126A (en) | Method and system for accelerating procedure return sequences | |
US8707014B2 (en) | Arithmetic processing unit and control method for cache hit check instruction execution | |
US8909907B2 (en) | Reducing branch prediction latency using a branch target buffer with a most recently used column prediction | |
US7346737B2 (en) | Cache system having branch target address cache | |
US20040225866A1 (en) | Branch prediction in a data processing system | |
US20050027921A1 (en) | Information processing apparatus capable of prefetching instructions | |
JP5209390B2 (en) | Information processing apparatus and instruction fetch control method | |
US20220156079A1 (en) | Pipeline computer system and instruction processing method | |
JP5696210B2 (en) | Processor and instruction processing method thereof | |
KR20080000944A (en) | Processor with pipelined architecture and control method thereof | |
CN113568663A (en) | Code prefetch instruction | |
JP4728877B2 (en) | Microprocessor and pipeline control method | |
US7343481B2 (en) | Branch prediction in a data processing system utilizing a cache of previous static predictions | |
KR100300875B1 (en) | How to deal with cache misses | |
JP2007041999A (en) | Data processor | |
JP2001034474A (en) | Data processor and data processing method | |
WO2008038373A1 (en) | Processor for increasing the branching prediction speed | |
JPH05257686A (en) | Instruction cache circuit | |
JPS63221427A (en) | Information processor for branch estimation | |
JPH07334363A (en) | Information processor |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
WITN | Withdrawal due to no request for examination |