KR20080000944A - Processor with pipelined architecture and control method thereof - Google Patents

Processor with pipelined architecture and control method thereof Download PDF

Info

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
Application number
KR1020060058868A
Other languages
Korean (ko)
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 KR1020060058868A priority Critical patent/KR20080000944A/en
Publication of KR20080000944A publication Critical patent/KR20080000944A/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/38Concurrent 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

A processor having a pipelined architecture and a control method thereof are provided to correct a branch command error owing to program cache miss even if an interruption tree is not found in a pipeline processor, secure a maximum operation frequency of the processor and reduce a chip area by deleting the interruption tree for managing the cache miss. A processor(160) fetches a command with a plurality of sequential processing stages(162-170). A program counter(140) outputs an address for the command fetched by the processor. A cache(130) receives a part of a program to be performed in the processor from a main memory(110), stores the received program, provides the command included in the program corresponding to the address to the processor by receiving the address from the program counter, and outputs a standby signal if the command corresponding to the received address is not found. A stall buffer stores a target address of the next branch command based on the standby signal and provides the target address to the program counter. The stall buffer has a space for storing the target address of the next branch command as much as the number of branch slots.

Description

파이프라인 구조를 갖는 프로세서 및 그 제어방법{PROCESSOR WITH PIPELINED ARCHITECTURE AND CONTROL METHOD THEREOF}PROCESSOR WITH PIPELINED ARCHITECTURE AND CONTROL METHOD THEREOF}

도 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 processor 120 is connected to an external memory 110 that stores information to be processed by the processor 160, and includes a cache 130, a program counter 140, a stop signal generator 150, and a processor 160. Consists of

캐쉬부(130)는 프로세서(120)의 코어와 동일하거나 비슷한 동작주파수를 가지게 설계된 작은 메모리영역으로, 프로세서(120)의 성능을 향상시키는 역할을 하며, 프로그램카운터부(140)는 명령어 페치를 수행할 명령어의 어드레스를 저장하고 있다. The cache unit 130 is a small memory area designed to have an operating frequency that is the same as or similar to that of the core of the processor 120. The cache unit 130 improves the performance of the processor 120, and the program counter 140 performs instruction fetch. Stores the address of the command to be executed.

프로그램카운터부(140)의 어드레스를 캐쉬부(130)에 요청하면 캐쉬부(130)는 해당 어드레스의 명령어를 처리부(160)에 전달하고, 처리부(160)는 입력받은 명령어를 명령어디코더스테이지(164)에서 해석하여 이를 적절한 제어신호로 변경한다.When the address of the program counter unit 140 is requested to the cache unit 130, the cache unit 130 transmits the command of the corresponding address to the processing unit 160, and the processing unit 160 transmits the received command to the command decoder stage 164. ) And change it to the appropriate control signal.

그러나 캐쉬부(130)는 전체 프로그램의 일부분만을 저장하고 있기 때문에 프로세서(120)가 요구하는 어드레스의 명령어를 가지고 있지 않은 경우가 발생한다. 이런 경우를 캐쉬미스라고 부르며 캐쉬부(130)는 외부메모리(110)에서 해당하는 명령어를 가져오게 되나, 외부메모리(110)는 속도가 느리기 때문에 프로세서(120)의 처리부(160)는 캐쉬부(130)가 명령어를 기다리는 동안에 동작을 잠시 멈추고 있어야 한다.However, since the cache unit 130 stores only a part of the entire program, there is a case where the processor 120 does not have an instruction of an address required. Such a case is called a cache miss, and the cache unit 130 obtains a corresponding instruction from the external memory 110, but since the external memory 110 is slow, the processing unit 160 of the processor 120 is a cache unit ( The operation must be paused while 130 is waiting for a command.

즉, 파이프라인 구조에는 하나의 명령어의 동작이 완전히 끝나기 전에 다른 명령어가 수행을 시작하기 때문에 캐쉬미스가 발생하면 잘못된 처리를 하게 된다. 이를 방지하기 위해 정지신호발생부(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 stop signal generator 150 outputs a stop signal to the processor 160 to stop the progress of each stage of the processor 160.

이러한 종래의 정지신호는 프로세서(120)의 모든 파이프라인레지스터(미도시됨)를 구동해야 하므로, 정지신호를 전달하는 경로가 프로세서(120)의 동작주파수를 결정하는 임계지연에 많은 영향을 주게 되고 많은 영역의 실리콘 면적을 차지하게 된다. Since the conventional stop signal must drive all pipeline registers (not shown) of the processor 120, the path for transmitting the stop signal has a great influence on the threshold delay that determines the operating frequency of the processor 120. It will occupy a large area of silicon.

본 발명은 상기 문제점을 해결하기 위한 것으로서, 파이프라인의 동작을 정지시키고 않고 캐쉬미스에 대응할 수 있는 프로세서 및 그의 제어방법을 제공하는 것을 목적으로 한다. 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 processor 220 according to the present invention is connected to an external memory 210 that stores information to be processed by the processor 260, and includes a cache unit 230, a program counter unit 240, a stall buffer 250, and a processor unit ( 260).

캐쉬부(230)는 프로세서(220)의 처리부(260)에 제공될 명령어를 저장하고 있으며, 프로그램카운터부(240)는 명령어 페치를 수행할 명령어의 어드레스를 저장하고 있다. 프로그램카운터부(240)의 어드레스를 캐쉬부(230)에 요청하면 캐쉬부(240)는 해당 어드레스의 명령어를 처리부(260)에 전달한다.The cache unit 230 stores instructions to be provided to the processing unit 260 of the processor 220, and the program counter unit 240 stores addresses of instructions to be fetched. When the address of the program counter 240 is requested to the cache 230, the cache 240 transmits an instruction of the corresponding address to the processor 260.

처리부(260)는 명령어페치스테이지(262), 명령어디코더스테이지(264), 어드레스발생기스테이지(266), 실행스테이지(268) 및 라이트백스테이지(270)의 5개의 스테이지를 갖는다. The processing unit 260 has five stages: an instruction fetch stage 262, an instruction decoder stage 264, an address generator stage 266, an execution stage 268, and a writeback stage 270.

명령어페치스테이지(262)는 명령어를 페치하기 위한 것으로, 페치하려는 명령어가 캐쉬부(230)에 존재하면 캐쉬히트를 발생시키고, 명령어가 존재하지 않으면 캐쉬미스를 발생시킨다.The instruction fetch stage 262 is for fetching an instruction. If the instruction to be fetched exists in the cache unit 230, a cache hit is generated, and if the instruction does not exist, the cache miss is generated.

명령어디코더스테이지(264)는 명령어를 해석하여 내부 레지스터 등의 리소스에서 데이터를 가져오고, 어드레스발생기스테이지(266)는 데이터 캐쉬에 접근하기 위한 어드레스를 계산하고 브랜치의 조건을 판단하여 프로그램카운터부(240)를 업데이트시킨다.The instruction decoder stage 264 interprets the instructions to obtain data from a resource such as an internal register, and the address generator stage 266 calculates an address for accessing the data cache and determines a condition of a branch to determine the program counter unit 240. ).

실행스테이지(268)는 리소스를 실제로 연산하여 결과를 얻는 것으로, 예를 들면 2개의 수를 가산하거나 승산하는 지정된 동작을 실행하고, 라이트백스테이지(270)는 연산결과나 캐쉬부에서 읽은 값을 내부 레지스터에 라이트한다.The execution stage 268 actually calculates a resource to obtain a result. For example, the execution stage 268 executes a specified operation of adding or multiplying two numbers, and the writeback stage 270 internally stores the operation result or the value read from the cache unit. Write to register.

도 2에서는 5개의 스테이지를 갖는 처리부(260)을 도시하고 있지만, 본 발명은 처리부(260)의 스테이지 개수에 의해 제한되는 것은 아니다. Although FIG. 2 shows a processor 260 having five stages, the present invention is not limited by the number of stages of the processor 260.

캐쉬부(230)는 명령어페치스테이지(262)에서 발생된 캐쉬미스에 대응하는 신호를 프로그램카운터부(240)와 스톨버퍼(250)에 제공한다. 여기에서 캐쉬부(230)는 단순히 프로그램을 저장하는 장소만이 아니라 이와 관련된 제어신호를 발생하고 관리하는 영역을 포함한다.The cache unit 230 provides a signal corresponding to the cache miss generated by the instruction fetch stage 262 to the program counter unit 240 and the stall buffer 250. Here, the cache unit 230 includes not only a place for storing a program but also an area for generating and managing control signals related thereto.

스톨버퍼(250)는 브랜치 슬롯내에서 캐쉬미스가 발생해도 정상적인 브랜치 명령어 수행이 가능하도록 하기 위한 것으로, 브랜치 슬롯만큼의 엔트리를 가지고 있고 각각의 엔트리는 캐쉬히트가 발생하면 가져와야 할 프로그램의 어드레스가 저장된다.The stall buffer 250 is for executing a normal branch instruction even if a cache miss occurs in a branch slot. The stall buffer has an entry corresponding to a branch slot, and each entry stores an address of a program to be obtained when a cache hit occurs. do.

도 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 program counter unit 240 is Ox80, the cache unit 230 obtains an instruction at the Ox80 address and inputs it to the IF stage 262, and each of the other instructions has an ID stage 264. ), AG stage 266, EX stage 268 and WB stage 270, respectively.

(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 program counter 240 is Ox81, the cache unit 230 obtains an instruction at the Ox81 address and inputs it to the IF stage 262. Since the branch instruction is input to the AG stage 266, the next program counter address of the program counter unit 240 becomes the Ox200 address indicated by the branch instruction. Therefore, in (c), the command at the current program counter Ox200 address of the program counter unit 240 is input to the IF stage 262. In this case, since the branch instruction in the AG stage 266 has updated the program counter unit 240, the two instructions following the branch instruction are unconditionally executed. The part that is performed by the pipeline even after the branch instruction is called a branch slot.

도 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 program counter unit 240 is Ox79, the cache unit 230 obtains an instruction at the Ox79 address and inputs it to the IF stage 262, and each of the other instructions is an ID stage 264. , AG stage 266, EX stage 268 and WB stage 270, respectively.

(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 program counter unit 240 is displayed. Since the cache misses, the program counter 240 is maintained as it is due to the wait signal of the cache 230. The processor 260 inserts a NOP into the IF stage 262 and stores the address of the Ox81 instruction to be performed after the Ox80 instruction in the first entry of the stall buffer 250.

(c)에서 AG스테이지(266)에 브랜치 명령이 입력된다. 캐쉬미스가 아니면 AG스테이지(266)에서 바로 프로그램카운터부(240)의 프로그램카운터 어드레스가 브랜치 목표 어드레스인 Ox200으로 업데이트되지만, 캐쉬미스이기 때문에 캐쉬부(230)의 대기신호로 인하여 프로그램카운터부(240)의 프로그램카운터 어드레스가 업데이트되지 않는다. 이 경우 브랜치 명령어는 브랜치 목표 어드레스를 스톨버퍼(250)의 두 번째 엔트리에 기록된다. In (c), the branch instruction is input to the AG stage 266. If it is not the cache miss, the program counter address of the program counter unit 240 is immediately updated to the branch target address Ox200 at the AG stage 266. However, the program counter unit 240 is caused by the wait signal of the cache unit 230 because it is a cache miss. Program counter address is not updated. In this case, the branch instruction writes the branch target address to the second entry of the stall buffer 250.

그 후에 (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 program counter unit 240 is executed, the program counter unit 240 is changed by the program counter addresses stored in the stall buffer 250. Perform normal operation.

본 발명에 따른 파이프라인 프로세서의 제어방법을 표시하는 흐름도가 도 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 program counting unit 240 and the stall buffer 250 of the processor are initialized (S502). The cache unit 230 requests an instruction of a program counter address of the program counter 240.

캐쉬부(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 processing unit 260 is advanced one stage, and NOP is input to the IF stage 262 (S508). If a branch instruction exists in the AG stage 266 of the processing unit 260, the target address is stored in the stall buffer 250, and a signal indicating that the target address stored in the stall buffer 250 is valid is supplied to the program counter unit 240. (S510).

캐쉬부(230)에 프로그램카운터부(240)에 유지된 어드레스의 명령어를 재요청한다(S512). 캐쉬히트가 발생하면(S506) 처리부(260)에 있는 명령어를 한 스테이지 전진시키고, 명령어를 캐쉬부(230)에서 가져온다(S520). The cache unit 230 re-requests the command of the address held in the program counter unit 240 (S512). If a cache hit occurs (S506), the instruction in the processor 260 advances one stage, and the instruction is taken from the cache 230 (S520).

그리고 스톨버퍼(250)에 저장된 목표어드레스가 유효하다는 신호가 프로그램카운터부(240)에 공급되면(S522), 프로그램카운터부(240)의 프로그램카운터 어드레스를 스톨버퍼(250)에 저장된 어드레스로 변경하고, 스톨버퍼(250)에 저장된 어드레스를 클리어한다(S524).When the signal indicating that the target address stored in the stall buffer 250 is valid is supplied to the program counter unit 240 (S522), the program counter address of the program counter unit 240 is changed to the address stored in the stall buffer 250. In step S524, the address stored in the stall buffer 250 is cleared.

처리부(260)에 종료 명령어가 존재하면(S526), 처리부(260)의 처리를 종료시키고. 그렇지 않으면 처리부(260)에 브랜치가 존재하는지의 여부를 판단하여(S528), 브랜치이면 프로그램카운터부(240)의 프로그램카운터 어드레스를 목표 어드레스로 변경하고(S530), 브랜치가 아니면 프로그램카운터부(240)의 프로그램카운터 어드레스를 명령어의 크기만큼 증가시킨다(S532).If an end instruction exists in the processing unit 260 (S526), the processing of the processing unit 260 ends. Otherwise, it is determined whether a branch exists in the processing unit 260 (S528), and if it is a branch, the program counter address of the program counter unit 240 is changed to a target address (S530), and if it is not a branch, the program counter unit 240 Increase the program counter address by the size of the instruction (S532).

상기한 바와 같이, 본 발명에 의하면, 파이프라인 프로세서에 정지 트리가 없어도 프로그램 캐시미스에 의한 브랜치 명령어의 오류를 수정할 수 있다. 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)

프로세서에 있어서,In the processor, 다수의 순차적 처리 스테이지를 가지고 명령어 페치를 수행하는 처리부와;A processor configured to perform instruction fetch with a plurality of sequential processing stages; 상기 처리부가 페치를 수행할 명령어에 관한 어드레스를 출력하는 프로그램카운터부와;A program counter unit for outputting an address relating to an instruction to be fetched by the processor; 소정의 메인메모리로부터 상기 처리부에서 수행할 프로그램을 부분적으로 수령하여 저장하고, 상기 프로그램카운부로부터 어드레스를 수령하여 해당 어드레스에 대응하는 상기 프로그램 중의 명령어를 상기 처리부에 제공하며, 상기 수령한 어드레스에 대응하는 명령어를 가지고 있지 아니한 경우 대기신호를 출력하는 캐쉬부와;Partially receive and store a program to be executed in the processing unit from a predetermined main memory, receive an address from the program counting unit, 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 the terminal does not have a command to perform the command; 상기 대기신호에 기초하여 다음에 수행될 브랜치 명령어의 목표 어드레스를 저장하였다가 상기 프로그램카운터부에 제공하는 스톨버퍼를 포함하는 것을 특징으로 하는 프로세서. And a stall buffer storing a target address of a branch instruction to be executed next based on the wait signal and providing the target address to the program counter unit. 제1항에 있어서,The method of claim 1, 상기 스톨버퍼는 상기 다음에 수행될 브랜치 명령어의 목표 어드레스에 대하여 저장할 수 있는 공간을 브랜치 슬롯의 개수만큼 갖는 것을 특징으로 하는 프로세서. 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. 다수의 순차적 처리 스테이지를 가지고 명령어 페치를 수행하는 처리부와, 소정의 메인메모리로부터 상기 처리부에서 수행할 프로그램을 부분적으로 수령하여 저장하는 캐쉬부를 갖는 프로세서의 제어방법에 있어서,In the control method of the processor having a processing unit for performing instruction fetch with a plurality of sequential processing stages, and a cache unit for receiving and storing a program to be executed in the processing unit from a predetermined main memory, 상기 캐쉬부에 프로그램카운터부의 어드레스의 명령어를 요청하는 단계와;Requesting an instruction of an address of a program counter unit to the cache unit; 상기 캐쉬부의 어드레스에 요청된 명령어가 없으면 다수의 스테이지로 이루어진 처리부에 있는 명령어를 한 스테이지 진행시키고 상기 처리부의 첫 번째 스테이지에 특정값을 입력하는 단계와;If there is no instruction requested in the address of the cache unit, moving the instruction in the processing unit comprising a plurality of stages by one stage and inputting a specific value into the first stage of the processing unit; 상기 처리부의 상기 한 스테이지 진행된 명령어에 브랜치 명령어가 있으면 목표 어드레스를 스톨버퍼에 저장하는 단계를 포함하는 것을 특징으로 하는 프로세서의 제어방법. And storing a target address in a stall buffer when a branch instruction is present in the one-stage advanced instruction of the processing unit. 제3항에 있어서,The method of claim 3, 상기 스톨버퍼에 목표 어드레스가 저장된 후에 상기 캐쉬부의 어드레스에 요청된 명령어가 있으면, 상기 스톨버퍼에 저장된 목표 어드레스를 상기 프로그램카운터부에 업데이트시키는 단계를 더 포함하는 특징으로 하는 프로세서의 제어방법. And updating the target address stored in the stall buffer to the program counter if there is an instruction requested in the cache address after the target address is stored in the stall buffer.
KR1020060058868A 2006-06-28 2006-06-28 Processor with pipelined architecture and control method thereof KR20080000944A (en)

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)

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