KR100244210B1 - Method for design of microprocessor with multi-stage pipeline type - Google Patents

Method for design of microprocessor with multi-stage pipeline type Download PDF

Info

Publication number
KR100244210B1
KR100244210B1 KR1019970005418A KR19970005418A KR100244210B1 KR 100244210 B1 KR100244210 B1 KR 100244210B1 KR 1019970005418 A KR1019970005418 A KR 1019970005418A KR 19970005418 A KR19970005418 A KR 19970005418A KR 100244210 B1 KR100244210 B1 KR 100244210B1
Authority
KR
South Korea
Prior art keywords
stage
instruction
code
pipeline
execution
Prior art date
Application number
KR1019970005418A
Other languages
Korean (ko)
Other versions
KR19980068685A (en
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 KR1019970005418A priority Critical patent/KR100244210B1/en
Publication of KR19980068685A publication Critical patent/KR19980068685A/en
Application granted granted Critical
Publication of KR100244210B1 publication Critical patent/KR100244210B1/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/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/544Buffers; Shared memory; Pipes
    • 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/22Microcontrol or microprogram arrangements
    • G06F9/26Address formation of the next micro-instruction ; Microprogram storage or retrieval arrangements
    • G06F9/262Arrangements for next microinstruction selection
    • G06F9/268Microinstruction selection not based on processing results, e.g. interrupt, patch, first cycle store, diagnostic programs

Abstract

멀티-스테이지 파이프라인 구를 갖는 마이크로 프로세서 디자인방법은 스페셜 명령을 수행하는 파이프라인에 대해서 그 수행이 기본 스테이지만으로 사용하는 명령으로 구성되도록 어셈블러/컴파일러(assembler/compiler)차원에서 여러개의 명령으로 나누어 처리할 수 있도록 하는 것이다. 이와 같은 작업을 수행하기 위해서는 특수명령에 해당하는 명령어를 기본 스테이지 만으로 구성되는 OP-CODE로 나누어 컴파일하는 단계: 현재 수행하고 있는 명령이 수페셜 명령의 일부라는 것을 구별하기 위해 상기 스테이터스 비트를 부여하는 단계; 하드웨어 측면에서는 상기 명령이 수행되는 도중 인터럽트나 익셉션 발생시 상기 스테이터스 비트가 부여된 단계에 대해서는 계속적으로 그 연산을 수행하고 그 연산이 완료되면 인터럽트나 익셉션동작을 행하는 단계로 이루어져 진다. 따라서 기본 스테이지 만을 사용하는 것에 의해 컨트롤 로직이 간단해져 게이트 사이즈를 현저하게 줄일 수 있으며, 크리티컬 패스가 줄어들므로 인한 고 속의 프로세서를 디자인 할 수 있도록 한 것이다.The microprocessor design method with multi-stage pipelined phrases is divided into multiple instructions at the assembler / compiler level so that the execution of the special instructions is composed of instructions that use only the basic stage. To do it. In order to perform such an operation, a step of compiling a command corresponding to a special instruction into an OP-CODE consisting of only a basic stage is performed. The status bit is assigned to distinguish that the current instruction is part of a special instruction. step; On the hardware side, the operation is performed continuously for the step in which the status bit is given when an interrupt or exception occurs while the instruction is executed, and when the operation is completed, an interrupt or exception operation is performed. Therefore, by using only the basic stage, the control logic is simplified to significantly reduce the gate size, and the critical path is reduced, allowing the design of high speed processors.

Description

멀티-스테이지 파이프라인 구조를 갖는 마이크로 프로세서 디자인방법{Method for design of microprocessor with multi-stage pipeline type}Method for design of microprocessor with multi-stage pipeline type}

본 발명은 멀티-스테이지 파이프라인(Multi-Stage Pipeline)구조를 갖는 마이크로 프로세서 디자인(Microprocessor Design)방법에 관한 것으로서, 특히 파이프라인의 기본 진행룰(rule)을 벗어나는 명령(instruction)에 대하여 기본 진행룰 만으로 명령을 수행할 수 있도록 명령을 나누어 처리하는 멀티-스테이지 파이프라인구조를 갖는 마이크로 프로세서 디자인방법에 관한 것이다.The present invention relates to a method of designing a microprocessor having a multi-stage pipeline structure. In particular, the present invention relates to a basic progress rule for an instruction that deviates from the basic rule of a pipeline. The present invention relates to a microprocessor design method having a multi-stage pipeline structure that divides and processes an instruction so that the instruction can be executed by itself.

먼저, 상기 파이프라인에 대하여 살펴보면, 일반적인 PC 등의 마이크로 프로세서에서 한 명령어의 실행이 끝나기 전에 다른 명령어의 동작을 수행하여 마이크로 프로세서의 처리속도를 향상시키도록 한 방법을 의미한다.First, referring to the pipeline, a method of improving the processing speed of a microprocessor by performing an operation of another instruction before execution of one instruction in a microprocessor such as a general PC is completed.

즉, 명령의 수행을 여러개의 독립적인 단계를 나누고, 여러개의 명령이 단계별로 동시에 수행된다.In other words, the execution of the command is divided into several independent steps, and several commands are executed simultaneously in steps.

예를 들어, 어떤 일 명령을 해독하여 그 명령을 수행하면서 그 다음에 수행될 명령을 미리 가져오는 것도 일종의 파이프라인이라 볼 수 잇다.For example, it is a kind of pipeline to decode a command and execute the command while prefetching the next command to be executed.

상기 파이프라인은 그 단계의 수 만큼 속도향상을 기대할 수 있으나, 명령의 수행단계를 세분화 하는데는 한계가 있기 때문에 많이 늘릴 수는 없는 문제점이 있다.The pipeline can be expected to improve speed by the number of stages, but there is a problem in that the pipeline cannot be increased much because there is a limit in subdividing the execution stage of the instruction.

또한, 상기 스테이지란 파이프라인에 있어서 명령에 대한 병렬수행이 가능하도록 처리하는 일의 단계를 의미하는 것으로서, 파이프라인의 스테이지는 명령의 종류에 따라서 3-스테이지, 4-스테이지, 5-스테이지로 구분된다.In addition, the stage refers to a step of processing to allow parallel execution of instructions in the pipeline, and stages of the pipeline are divided into three stages, four stages, and five stages according to types of instructions. do.

여기서, 스페셜 명령은 제외된 것이다.Here, the special command is excluded.

상기 3-스테이지는 IF(Instruction Fetch), ID(Instruction Decoder), EX(Instruction Execution)로 구분되고, 4-스테이지는 상기 IF, ID, EX, MA(Memory Access)로 구분된다.The three-stage is divided into Instruction Fetch (IF), Instruction Decoder (ID), and Instruction Execution (EX), and the four-stage is divided into the IF, ID, EX, and Memory Access (MA).

그리고, 5-스테이지는 상기 IF, ID, EX, MA, WB(Write Back)으로 파이프라인 룰을 분류할 수 있는 것이다.The 5-stage can classify pipeline rules into the IF, ID, EX, MA, and WB (Write Back).

여기서, 상기 IF-스테이지는 컴퓨터의 CPU가 기억장치 즉, 메모리에 저장되어 잇는 기계어 명령(OP-CODE)이나 자료를 수행시키기 위해 CPU내로 자료를 가져오는 스테이지이고, ID-스테이지는 상기 IF스테이지에서 가져온 자료를 정해진 규칙에 따라 디코딩하는 스테이지이다.Here, the IF-stage is a stage where the CPU of the computer brings data into the CPU to execute an OP-CODE or data stored in a memory, that is, a memory, and the ID-stage is in the IF stage. It is a stage that decodes imported data according to predetermined rules.

그리고, EX-스테이지는 상기 ID-스테이지에서의 디코딩 규칙에 따라 어드레스(Address)를 계산하고 데이터 오포레이션(Data Operation)동작을 수행하는 스테이지이고, 상기 MA-스테이지는 메모리에서 데이터를 억세스하는 것으로서, 메모리 억세스를 포함하는 명령에 의해서 만들어지는 스테이지이며, WB-스테이지는 레지스터에 상기 메모리 억세스 데이터의 결과를 쓰기위한 스테이지이다.The EX stage is a stage for calculating an address and performing a data operation operation according to a decoding rule of the ID stage, and the MA stage accesses data from a memory. A stage created by an instruction that includes memory access, and a WB-stage, is a stage for writing the result of the memory access data to a register.

이때, 상기 WB-스테이지는 메모리 로드(memory load)를 포함하는 명령에 의해서 만들어지는 스테이지이다.In this case, the WB-stage is a stage produced by an instruction including a memory load.

현재, 보통 기계어에서 연산을 가리키는 부분의 코드 즉, OP-CODE(Operation Code)를 구성할 때 기본적인 파이프라인 룰이 깨지는 명령 즉, 스페셜 명령이라도 그대로 마이크로 프로세서의 디코더에 입력하여 주므로서, 파이프라인의 컨트롤로직이 복잡해 지고, 임시의 데이터를 저장하기 위한 레지스터를 추가하게 됨으로서 프로세서 디자인시 케이트 사이즈가 커지게 되는 것이다.Currently, even when the code of a part of an ordinary machine language indicating an operation, that is, an OP-CODE (Operation Code), the basic pipeline rule is broken, that is, a special command is input to the decoder of the microprocessor as it is. The complexity of control logic and the addition of registers to store temporary data increases the size of the gates in processor design.

그리고, 상기 컨트롤 로직의 복잡화에 따라 크리티컬 패스(Critical path)가 길어져서 고속의 프로세서를 디자인하는데 제약사항의 하나로 작용되어 왔다.In addition, as the complexity of the control logic increases, the critical path has been extended, which has been one of constraints in designing a high speed processor.

여기서, 하나의 일예를 살펴보면, 히타찌(Hitachi)에서 나온 SH3 마이크로 프로세서는 5-스테이지(IF, ID, EX, MA, WB)를 기본 파이프라인으로 갖는 프로세서로서, 그 기본구조를 도 1에 도시하였다.Here, looking at one example, the SH3 microprocessor from Hitachi is a processor having a five-stage (IF, ID, EX, MA, WB) as the basic pipeline, the basic structure is shown in FIG. .

도 1은 일반적인 5-스테이지를 갖는 파이프라인의 기본구조를 나타낸 도면이다.1 is a view showing the basic structure of a pipeline having a typical five-stage.

여기서, 명령(Instruction)은 데이터 트랜스퍼(Data Transfer), 연산(Arothmetic), 로직(Logic), 시프트(Shift), 시스템 컨트롤(System Control)명령으로 구성되어 있다.Here, the instruction is composed of data transfer, arithmetic, logic, shift, and system control instructions.

대부분의 명령은 기본 파이프라인의 룰을 벗어나지 않도록 설계를 할 수 있으나, AND.B, OR.B..., TRAPA, Multiply Instruction, RTE, INTERRUPT 혹은 익셉션(Exception)시의 명령은 도 1에 도시된 기본 파이브라인 플로우에 위배되는 명령이다.Most of the instructions can be designed so as not to deviate from the basic pipeline rules, but the instructions in AND.B, OR.B ..., TRAPA, Multiply Instruction, RTE, INTERRUPT or exception are shown in FIG. Command violates the default Pibrain flow.

그것들에 대한 파이프라인의 진행과정을 도 2를 참조하여 살펴보기로 한다.The progress of the pipeline for them will be described with reference to FIG. 2.

도 2a는 종래 기술에 따른 5-스테이지를 갖는 파이프라인에 있어서, AND.B명령에 대한 파이프라인 수행방법을 나타낸 도면이고, 도 2b는 TRAPA명령, 도 2c는 Multiply명령, 도 2d는 RTE명령에 대한 파이프라인 수행방법을 나타낸 도면이다.FIG. 2A is a diagram illustrating a pipeline performing method for an AND.B instruction in a pipeline having a five-stage according to the prior art, FIG. 2B is a TRAPA instruction, FIG. 2C is a multiply instruction, and FIG. 2D is an RTE instruction. A diagram illustrating a pipeline execution method for the present invention.

도 2a에 도시된 AND.B명령을 수행하는 방법을 살펴보면, 우선 상기 AND.B명령을 메모리에 저장된 AND.B에 대한 OP-CODE를 프로세서로 IF-스테이지에서 페치한다.Referring to the method of performing the AND.B instruction illustrated in FIG. 2A, first, an OP-CODE for an AND.B stored in a memory is fetched from the IF stage to the processor.

상기 OP-CODE를 페치한 후, 페치된 OP-CODE를 프로세서내의 디코더로 입력하여 디코딩 규칙에 따라 ID-스테이지에서 디코딩하게 된다.After fetching the OP-CODE, the fetched OP-CODE is input to a decoder in the processor to decode in the ID-stage according to the decoding rule.

이때, 상기 디코딩되는 동시에 다른 명령을 IF2-스테이지에서 페치하게 되는 것이다.At this time, another decode is simultaneously fetched from the IF2-stage.

상기 디코딩된 AND.B명령을 외부로 나가는 어드레스를 EX1-스테이지에서 계산하고, 외부 메모리에 저장된 데이터를 MA-스테이지에서 리드하며, AND 오퍼레리션을 EX2-스테이지에서 수행한다.The address leaving the decoded AND.B instruction to the outside is calculated at the EX 1- stage, the data stored in the external memory is read at the MA-stage, and the AND operation is performed at the EX 2 -stage.

그리고, 그 결과를 MA2-스테이지에서 다시 외부 메모리에 저장하게 하는 것이다.The result is then stored back in external memory at the MA 2 stage.

이때, 상기 EX1-스테이지 수행과 동시에 상기 IF2-스테이지에서 페치해온 다른 명령의 OP-CODE를 디코딩하고, 상기 MA1-스테이지 동작과 EX2-스테이지동작을 하는 동안 즉, 2 스테이지 사이클 동안은 다른 명령에 대한 EX2-스테이지 동작을 스톨(Stall)시키고 상기 MA2-스테이지동작의 수행과 동시에 EX2-스테이지 동작을 수행하는 것이다.At this time, while the EX 1 stage is performed, the OP-CODE of another instruction fetched from the IF2 stage is decoded, and during the MA 1 stage operation and the EX 2 stage operation, that is, during the two stage cycle, Stall the EX2-stage operation for the instruction and perform the EX2-stage operation simultaneously with the MA 2 -stage operation.

그리고. 또다른 명령을 수행하는 방법 역시 상기와 같은 방법으로 반복하게 되는 것이다.And. Another way to perform the command is to repeat in the same way as above.

AND.B명령을 수행하게 되는데는 도 2a에 도시된 바와 같이 3 AND.B 수행사이클이 소요된다. 여기서, 상기 수행사이클이란 AND.B명령의 EX-스테이지와 다음 명령의 EX-스테이지사이의 스테이지 수를 의미한다.The AND.B instruction takes 3 AND.B execution cycles as shown in FIG. 2A. Here, the execution cycle means the number of stages between the EX-stage of the AND.B instruction and the EX-stage of the next instruction.

이러한 상기한 바와 같은 파이프라인 수행과정을 가지는 명령은 AND.B 뿐 아니라 OR.B, TST.B, XOR.B, TAS.B 등이 있다.Instructions having such a pipeline execution process include OR.B, TST.B, XOR.B, and TAS.B as well as AND.B.

이어, 도 2b의 TRAPA명령에 대한 파이프라인 수행방법을 살펴보기로한다.Next, a pipeline execution method for the TRAPA command of FIG. 2B will be described.

먼저, 우선 상기 TRAPA명령을 메모리에 저장된 TRAPA명령에 대한 OP-CODE를 IF1-스테이지에서 프로세서로 페치한다.First, the TRAPA instruction fetches the OP-CODE for the TRAPA instruction stored in the memory from the IF1-stage to the processor.

상기 OP-CODE를 페치한 후, 페치된 OP-CODE를 프로세서내의 디코더로 입력하여 디코딩 규칙에 따라 ID1-스테이지에서 디코딩하게 된다.After fetching the OP-CODE, the fetched OP-CODE is input to the decoder in the processor to decode in the ID1-stage according to the decoding rule.

그리고, 프로세서 내의 프로그램 카운터(Program Counter:PC)의 데이터를 SPC 레지스터에 임시로 저장시키고, 프로세서내의 스테이터스 레지스터(Status Register)에 저장된 데이터를 SSR 레지스터에 임시로 저장시키는 것이다.The data of the program counter (PC) in the processor is temporarily stored in the SPC register, and the data stored in the status register of the processor is temporarily stored in the SSR register.

또한, 프리벌리지 모드(priviledged mode)로 되어 다음의 익셉션 발생을 금지시키는 동시에 상기 프로그램 카운터에 익셉션 서비스 루틴(exception service routine)의 시작어드레스를 저장시켜 익셉션 서비스 루틴을 시작하는 것이다.In addition, it is in the preserved mode to prevent the occurrence of the next exception and simultaneously starts the exception service routine by storing a start address of an exception service routine in the program counter.

여기서, 상기 TRAPA명령을 수행하는데는 6 TRAPA 수행사이클이 소요된다. 여기서, 상기 수행사이클이란 TRAPA명령의 EX-스테이지와 다음 명령의 EX-스테이지사이의 스테이지 수를 의미한다.Here, 6 TRAPA execution cycles are required to execute the TRAPA command. Here, the execution cycle means the number of stages between the EX-stage of the TRAPA instruction and the EX-stage of the next instruction.

상기한 바와 같은 파이프라인 수행과정을 갖는 명령은 TRAPA뿐만 아니라 INTERRUPT, EXEPTION등이 있다.Instructions having a pipeline execution process as described above include not only TRAPA but also INTERRUPT and EXEPTION.

이어, 도 2c의 Multiply명령에 대한 파이프라인 수행방법을 살펴보면, 먼저 우선 상기 Multiply명령을 메모리에 저장된 Multiply명령에 대한 OP-CODE를 IF1-스테이지에서 페치한다.Next, referring to the pipeline execution method for the multiply command of FIG. 2C, first, the OPp CODE for the multiply command stored in the memory is fetched from the IF1-stage.

상기 OP-CODE를 페치한 후, 페치된 OP-CODE를 프로세서내의 디코더로 입력하여 디코딩 규칙에 따라 ID1-스테이지에서 디코딩하게 된다.After fetching the OP-CODE, the fetched OP-CODE is input to the decoder in the processor to decode in the ID1-stage according to the decoding rule.

이때, 상기 ID1-스테이지에서 디코딩을 수행함과 동시에 다른 명령에 대한 OP-CODE를 페치한다.At this time, the decoding is performed on the ID1-stage and an OP-CODE for another command is fetched.

그리고, 수행하고자 하는 데이터를 리드하기 위한 어드레스를 EX1-스테이지에서 계산하고, 상기 계산된 어드레스값에 따라 MA1,MA2-스테이지에서 메모리에저장된 데이터를 리드한 후, 이후 3개의 mm-스테이지(mm1, mm2, mm3)에서 그 리드된 데이터를 멀티플라잉(Multipling)하여 그 결과를 프로세서내의 멀티플라이어의 전용 레지스터에 저장하는 것이다.Then, the address for reading the data to be performed is calculated in the EX1-stage, and the data stored in the memory is read in the MA 1 and MA 2 -stages according to the calculated address value, and then three mm-stages ( Multiplying the data read in mm1, mm2, and mm3) and storing the result in a dedicated register of the multiplier in the processor.

한편, 상기 EX1-스테이지에서 어드레스를 계산함과 동시에 상기 IF2-스테이지에서 페치된 다른 명령에 대한 OP-CODE를 디코딩 하는 것이다.Meanwhile, the address is calculated in the EX1-stage and the OP-CODE for another instruction fetched in the IF2-stage is decoded.

그리고, 상기 MA1-스테이지 동작을 하는 동안 즉, 1 스테이지 사이클 동안은 다른 명령에 대한 EX2-스테이지 동작을 스톨(Stall)시키고 상기 MA2-스테이지동작의 수행과 동시에 EX2-스테이지 동작을 수행하는 것이다.During the MA 1 -stage operation, that is, during one stage cycle, the EX2-stage operation is stalled for another instruction and the EX2-stage operation is performed simultaneously with the execution of the MA 2 -stage operation. .

이때, 상기 Multiply명령을 수행하게 되는데는 도 2c에 도시된 바와 같이 2 Multiply 수행사이클이 소요된다.At this time, it takes 2 multiply cycles to perform the multiply command as shown in Figure 2c.

이러한 상기한 바와 같은 파이프라인 수행과정을 가지는 명령은 TRAPA뿐만 아니라 Interrupt, Exception등이 있다.Instructions having a pipeline execution process as described above include TRAPA, Interrupt, Exception, and the like.

그리고, 도 2d에 도시된 RTE명령의 파이프라인 수행방법을 살펴보면, 먼저 우선 상기 RTE명령을 메모리에 저장된 RTE명령에 대한 OP-CODE를 IF1-스테이지에서 페치한다.In addition, referring to the pipeline execution method of the RTE instruction illustrated in FIG. 2D, first, an OP-CODE for the RTE instruction stored in the memory is fetched from the IF1-stage.

상기 OP-CODE를 페치한 후, 페치된 OP-CODE를 프로세서내의 디코더로 입력하여 디코딩 규칙에 따라 ID1-스테이지에서 디코딩하게 된다.After fetching the OP-CODE, the fetched OP-CODE is input to the decoder in the processor to decode in the ID1-stage according to the decoding rule.

이때, 상기 ID1-스테이지에서 디코딩을 수행함과 동시에 다른 명령에 대한 OP-CODE를 IF2-스테이지에서 페치한다.At this time, while decoding is performed on the ID1-stage, OP-CODE for another instruction is fetched from the IF2-stage.

그리고, 레지스터에 저장된 데이터를 스테이터스 레지스터에 저장하고 다른 레지스터에 저장된 데이터값을 프로그램 카운터에 조장한 후 프로그램 카운터에 의한 어드레스로 부터 프로그램을 수행하는 것이다.Then, the data stored in the register is stored in the status register, the data value stored in the other register is promoted to the program counter, and the program is executed from the address by the program counter.

여기서, 상기 EX2-스테이지 동작을 하는 동안 즉, 2 스테이지 사이클 동안은 다른 명령에 대한 EX2-스테이지 동작을 스톨(Stall)시키는 것이다.In this case, during the EX 2 -stage operation, that is, during two stage cycles, the EX 2 -stage operation for another instruction is stalled.

이때, 상기 RTE명령을 수행하게 되는데는 도 2c에 도시된 바와 같이 3 RTE 수행사이클이 소요된다. 여기서, 상기 수행사이클이란 RTE명령의 EX1-스테이지와 다음 명령의 EX2-스테이지사이의 스테이지 수를 의미한다.At this time, the RTE instruction takes 3 RTE execution cycles as shown in FIG. 2C. Here, the execution cycle means the number of stages between the EX 1 stage of the RTE instruction and the EX 2 stage of the next instruction.

상술한 방법들을 요약하여 보면, 아래와 같은 룰을 가지게 된다.In summary, the above-described methods have the following rules.

AND.B, OR.B, TST.B, XOR.B, TAS.B명령의 경우 수행 스테이지 순서는 IF ID EX1MA1EX2MA2의 순으로 진행되고 TRAPA, INTERRUPT, EXCEPTION명령의 경우 수행 스테이지순서는 IF ID EX1EX2EX3EX4의 순으로 진행된다.Execution for AND.B, OR.B, TST.B, XOR.B, and TAS.B Instructions The sequence is executed in the order of IF ID EX 1 MA 1 EX 2 MA 2 and in the case of TRAPA, INTERRUPT, EXCEPTION The stage sequence proceeds in the order of IF ID EX 1 EX 2 EX 3 EX 4 .

또한, MULTIPLY 명령의 경우 수행 스테이지 순서는 IF ID EX MA1MA2mm mm mm의 순으로 진행되고 RTE명령의 경우 수행스테이지 순서는 IF ID EX1EX2의 순으로 진행된다.In addition, in the case of the MULTIPLY instruction, the execution stage sequence is performed in the order of IF ID EX MA 1 MA 2 mm mm, and in the case of the RTE instruction, the execution stage sequence is performed in the order of IF ID EX 1 EX 2 .

위의 명령진행을 맞추도록 프로세서를 만들다 보면, AND.B의 경우 기본적인 파이프라인 플로우에 따라 MA까지 진행을 하다가 다시 앞의 스테이지인 EX2로 가야 한다.If we build the processor to meet the above instructions, AND.B will have to go through the basic pipeline flow to the MA and back to the previous stage, EX 2 .

따라서, 그 명령을 따르는 다음 명령에 대해서는 도 2a에 도시된 바와 같이 2-스테이지 동안은 스톨시킨 후 진행을 시켜야 하는 것이다.Therefore, the next command following the command is to proceed after stalling for two-stage as shown in FIG. 2A.

또한, TRAPA, INTERRUPT, EXCEPTION 명령의 경우 도 2b에서와 같이 파이프라인이 진행되므로 ID-스테이지에서 디코딩된 정보를 마지막 EX-스테이지가 끝날 때까지 가지고 있어야 하며, 마찬가지로 그것을 따른 다음의 명령을 스톨시켜야 하는 것이다.In addition, in the case of the TRAPA, INTERRUPT, and EXCEPTION commands, the pipeline proceeds as shown in FIG. 2B. Therefore, the information decoded in the ID-stage must be retained until the end of the last EX-stage. Similarly, the next command must be stalled. will be.

그리고, Multiply의 경우에도 MA-스테이지가 2개 있으므로 도 2c와 같이 다음 명령에 대한 EX-스테이지 수행을 1 사이클 스톨시켜야한다.In addition, since there are two MA-stages in the case of multiply, as shown in FIG.

또한, RTE의 경우도 마찬가지로 도 2d에 도시된 바와 같이 1사이클 스톨을 피할 수 없는 것이다.In addition, in the case of RTE, as shown in FIG. 2D, one cycle stall is inevitable.

여기서, 또 다른 프로세서 즉, ARM 프로세서의 경우를 살펴보면 LOAD, STORE, BRANCH명령의 경우 3-스테이지의 기본 파이프라인을 깨트림으로서, 상기와 같이 다음 명령에 대한 EX-스테이지 수행시 일정 사이클 동안 스톨 시켜야 하는 것이다.Here, in the case of another processor, that is, an ARM processor, if the LOAD, STORE, and BRANCH instructions break the basic pipeline of the three-stage, they must be stalled for a certain cycle when performing the EX-stage for the next instruction. It is.

또한, 멀티-스테이지를 기본 파이프라인으로 갖는 프로세서에서 OP-CODE의 구성이 기본 파이프라인 플로우를 깨트리는 것이 있는한 언제나 발생될 수 있는 것이다.In addition, in a processor with a multi-stage as the primary pipeline, the configuration of the OP-CODE can always occur as long as it breaks the basic pipeline flow.

종래 기술에 따른 프로세서에서의 파이프라인 다자인방법은 상술한 바와 같이 스페셜 명령을 수행할 경우 기본 파이프라인 룰이 깨지는 문제점으로 인해 각 스테이지의 컨트롤이 복잡해지는 문제점이 있다.The pipeline design method in the processor according to the related art has a problem in that the control of each stage is complicated due to a problem in that the basic pipeline rule is broken when a special instruction is executed as described above.

또한, 상기 컨트롤이 복잡해짐에 따라 프로세서내의 게이트수가 증가되어 칩자체가 커지는 문점이 발생하고, 이에 따른 파우어의 소비가 증가되는 문제점이 있다.In addition, as the control becomes more complex, a problem arises in that the number of gates in the processor is increased and the chip itself is increased, thereby increasing power consumption.

따라서, 본 발명은 상기한 종래 기술에 따른 제반 문제점을 해결하기 위하여 안출된 것으로서, 본 발명의 목적은 스페셜 명령을 수행하는 파이프라인에 대해서 그 수행이 기본 스테이지만으로 사용하는 명령으로 구성되도록 어셈블러/컴파일러(assembler/compiler)차원에서 여러개의 명령으로 나누어 처리하도록 한 멀티-스테이지 파이프라인 구조를 갖는 마이크로 프로세서 디자인방법을 제공함에 있다.Accordingly, the present invention has been made to solve the above-described problems according to the prior art, the object of the present invention is to assembler / compiler so that the execution is composed of instructions that use only the basic stage for the pipeline for performing a special instruction The present invention provides a microprocessor design method having a multi-stage pipeline structure that divides and processes a plurality of instructions in a (assembler / compiler) dimension.

도 1은 일반적인 5-스테이지를 갖는 파이프라인의 구조를 나타낸 도면1 shows a structure of a pipeline having a typical five-stage.

도 2a 내지 도 2d는 종래 기술에 따른 각 스페셜 명령시 파이프라인 수행방법을 나타낸 도면2a to 2d is a view showing a pipeline performing method for each special command according to the prior art

도 3a 내지 도 3d는 본 발명에 따른 각 스페셜 명령시 파이프라인 수행방법을 나타낸 도면3A to 3D are diagrams illustrating a pipeline performing method for each special instruction according to the present invention.

도 4는 본 발명에 따른 멀티-스테이지 파이프라인 구조를 갖는 마이크로 프로세서 디자인 방법을 나타낸 동작 플로우챠트4 is an operational flowchart illustrating a microprocessor design method having a multi-stage pipeline structure according to the present invention.

본 발명에 따른 멀티-스테이지 파이프라인 구조를 갖는 마이크로 프로세서 디자인방법의 특징은 마이크로 프로세서 디자인방법에 있어서, 특수명령에 해당하는 명령어를 파이프라인 처리의 기본 스테이지만으로 구성되는 OP코드로 나누어 컴파일하는 단계, 현재 수행할 명령이 특수 명령의 일부라는 것을 구별하기 위해 상기 명령어에 대해 스테이트비트를 부여하는 단계, 상기 명령이 수행되는 도중 인터럽트나 익셉션 발생시 상기 스테이터스 비트가 부여된 단계에 대해서는 계속적으로 그 연산을 수행하고 연산이 완료되면 인터럽트나 익셉션 동작을 수행하는 단계를 구비하여 이루어짐을 특징으로 한다.A microprocessor design method having a multi-stage pipeline structure according to the present invention is characterized in that, in the microprocessor design method, a step of compiling an instruction corresponding to a special instruction into an OP code consisting of only basic stages of pipeline processing, Assigning a state bit to the instruction to distinguish that the instruction to be executed is part of a special instruction, and continuously performing the operation on the step where the status bit is given when an interrupt or exception occurs while the instruction is being executed And performing an interrupt or exception operation when the operation is completed.

이하, 본 발명에 따른 멀티-스테이지 파이프라인 구조를 갖는 마이크로 프로세서 디자인방법에 대하여 설명하기로 한다.Hereinafter, a method for designing a microprocessor having a multi-stage pipeline structure according to the present invention will be described.

도 3은 각 스페셜 명령시 파이프라인 수행방법을 나타낸 도면으로서, 도 3a는 AND.B명령시, 도 3b는 TRAPA명령시, 도 3c는 Multiply명령시, 도 3d는 RTE명령시 파이프라인 수행과정을 나타낸 도면이다.3 is a diagram illustrating a pipeline execution method for each special instruction, in which FIG. 3A illustrates an AND.B instruction, FIG. 3B illustrates a TRAPA instruction, FIG. 3C illustrates a multiply instruction, and FIG. 3D illustrates a pipeline performing procedure. The figure shown.

먼저, 도 3a에 도시된 AND.B명령시 파이프라인 수행방법을 살펴보기로 하자.First, a method of performing a pipeline in the AND.B instruction illustrated in FIG. 3A will be described.

우선, AND.B명령의 수행을 나누어 처리할 수 있도록 단계에 따라 메모리에 각각의 OP-CODE를 컴파일한다.First, each OP-CODE is compiled into the memory according to the steps so that the execution of the AND.B instruction can be divided and processed.

여기서, AND.B명령은 두 개의 명령으로 나누어질 수 있다.Here, the AND.B instruction may be divided into two instructions.

상기 AND.B명령을 메모리에 저장된 AND.B에 대한 제 1 OP-CODE를 프로세서로 IF1-스테이지에서 페치한다.The AND.B instruction fetches the first OP-CODE for AND.B stored in memory to the processor at IF 1 -stage.

상기 제 1 OP-CODE를 페치한 후, 페치된 제 1 OP-CODE를 프로세서내의 디코더로 입력하여 디코딩 규칙에 따라 ID1-스테이지에서 디코딩하게 된다.After fetching the first OP-CODE, the fetched first OP-CODE is input to a decoder in the processor to decode in the ID 1 -stage according to a decoding rule.

이때, 상기 디코딩되는 동시에 상기 AND.B명령에 대한 제 2 OP-CODE를 IF2-스테이지에서 페치하게 되는 것이다.At this time, the second OP-CODE for the AND.B instruction is simultaneously fetched from the IF 2 stage.

상기 디코딩된 제 1 OP-CODE를 외부로 출력할도록 즉, 일 메모리에 저장할 수 있도록 메모리의 어드레스를 EX1-스테이지에서 계산하고, 외부의 다른 메모리에 저장된 데이터를 MA1-스테이지에서 리드하는 것이다.The memory address is calculated in the EX 1- stage to output the decoded first OP-CODE to the outside, that is, stored in one memory, and the data stored in the other external memory is read from the MA 1 -stage. .

여기서, 상기 EX1-스테이지에서 메모리의 어드레스를 계산함과 동시에 상기 IF2-스테이지에서 폐치된 제 2 OP-CODE를 디코더로 입력하여 ID2-스테이지에서 디코딩하고, EX2-스테이지에서 AND.B명령에 대한 AND계산후 MA2-스테이지에서 상기 계산된 데이터를 메모리에 라이트하는 것이다.Here, the address of the memory is calculated at the EX 1 stage, and the second OP-CODE closed at the IF 2 stage is input to the decoder to decode at the ID 2 stage and AND.B at the EX 2 stage. After the AND calculation for the instruction, the calculated data is written to memory in the MA 2 -stage.

이때, 상기 MA1-스테이지동안 ID2-스테이지와 EX2-스테이지사이에는 1사이클 동안 스톨이 발생된다.At this time, a stall is generated for one cycle between the ID 2 stage and the EX 2 stage during the MA 1 stage.

이 스톨은 AND.B 명령의 특성상 메모리에서 읽어온 데이터로 AND연산을 수행에 따른 데이터 해저드(Data Hazard)에 의한 1 사이클 스톨이 발생되는 것이다.This stall is caused by a one-cycle stall by the data hazard caused by performing an AND operation on the data read from the memory due to the characteristic of the AND.B instruction.

이 AND.B명령을 수행할시, 상술한 바와 같이 그 수행단계를 두단계로 구분하여 수행하는데 이 두 단계에는 스페셜 명령을 수행하기 위한 스테이터스 비트"1"이 컴파일러에 의해 부여되어 있다.When the AND.B instruction is executed, the execution step is divided into two steps as described above, in which the status bit " 1 " for executing the special instruction is given by the compiler.

즉, 상기 두 단계가 수행되는 도중에 인터럽트나 익셉션이 발생시에도 수행동작을 중단하지 않고 상기 스테이터스 비트가 부여된 단계만큼은 그 명령(AND.B) 동작을 수행하도록 하고 그 이후의 동작에서 인터럽트 및 익셉션을 수행할 수 있다.That is, even when an interrupt or an exception occurs while the two steps are being performed, the instruction (AND.B) operation is performed for the step given the status bit without interrupting the execution operation, and the interrupt and exception are performed in subsequent operations. Can be done.

여기서, 도 3a에 도시된 바와 같이 AND.B명령의 수행사이클은 도 2a에 도시된 바와 같이 3 AND.B 사이클이 소요된다.Here, the cycle of performing the AND.B instruction as shown in FIG. 3A takes 3 AND.B cycles as shown in FIG. 2A.

그리고, 이 명령을 SH7708의 현존하는 OP-CODE만을 사용하더라도 8개의 명령이 필요하고 8사이클로 나누어서 수행가능하다.And even if this command uses only the existing OP-CODE of SH7708, 8 commands are needed and can be divided into 8 cycles.

예를 들면, 위의 SH7708의 AND.B의 경우 AND.B #imm, @(R0,GBR)이 있다고 하자.For example, suppose that AND.B of SH7708 above has AND.B #imm, @ (R 0 , GBR).

이것의 수행과정은 도 2a와 같이 (R0+GBR)번지의 데이터??를 읽어서 #imm값과 AND연산을 한 후, 그 연산결과를 다시 (R0+GBR)번지로 라이트하는 동작이다.This operation is performed by reading the data of (R 0 + GBR) address and ANDing with the #imm value as shown in FIG. 2A, and then writing the operation result back to (R 0 + GBR) address.

따라서, 위의명령은 SH3 7708의 OP-CODE만을 사용하여 나누어 준다면 아래의 순서와 같다.Therefore, if the above command is divided using only the OP-CODE of SH3 7708, it is as follows.

1. STC GBR,R31.STC GBR, R3

2. MOV.W @(R0,R3), R22.MOV.W @ (R0, R3), R2

3. MOV R0, R43.MOV R0, R4

4. MOV R2,R04.MOV R2, R0

5. AND #imm,R05.AND # imm, R0

6. MOV R0, R26.MOV R0, R2

7. MOV R0, R27.MOV R0, R2

8. MOV.W R2,@(R0+R3)로 나눌 수 있다.8. MOV.W can be divided into R2, @ (R0 + R3).

상기의 과정이 아주 복잡하게 보이지만 상기의 것은 SH3 7708의 OP-CODE만을 사용했을 때의 과정이다.The above procedure seems very complicated, but the above is only when using the OP code of the SH3 7708.

그러나, SH7708의 현존하는 OP-CODE만을 사용하게 되면 5수행사이클이 증가하나 기본 파이프라인 구조에 맞는 하드웨어를 구성하여 OP-CODE를 잘 구성하므로서, 실제로는 메모리 리드, AND연산, 메모리 라이트의 기본연산만으로 구성이 가능하다.However, using only the existing OP-CODE of SH7708 increases 5 performance cycles, but the hardware is properly configured to fit the basic pipeline structure, so that the OP-CODE is well constructed, and in fact, the basic operation of memory lead, AND operation, and memory write. Only configuration is possible.

즉, 도 2a와 같이 되었던 파이프라인 구성을 도 3a와 같이 두 개의 연산으로 나누어 줌으로써 같은 사이클스를 소요하면서 도 1에 도시된 기본 파이프라인 플로우에 위배되지 않는 구조로 바꿀수 있는 것이다.In other words, by dividing the pipeline configuration as shown in FIG. 2A into two operations as shown in FIG. 3A, the same cycles may be used and the structure may be changed without violating the basic pipeline flow shown in FIG. 1.

도 3b는 스페셜 명령 즉, TRAPA 명령에 대한 파이프라인 수행방법을 나타낸 도면이다.3B is a diagram illustrating a pipeline execution method for a special command, that is, a TRAPA command.

우선, TRAPA명령의 수행을 나누어 처리할 수 있도록 단계에 따라 메모리에 각각의 OP-CODE를 나누어 컴파일한다.First, each OP-CODE is divided and compiled into memory so that the execution of the TRAPA instruction can be divided and processed.

여기서, TRAPA명령은 4개의 명령으로 나누어질 수 있다.Here, the TRAPA command may be divided into four commands.

먼저, 메모리에 저장된 TRAPA명령에 대한 제 1 명령 즉, 제 1 OP-CODE를 프로세서로 IF1-스테이지에서 페치한다.First, the first instruction for the TRAPA instruction stored in the memory, that is, the first OP-CODE, is fetched from the IF 1 stage to the processor.

상기 제 1 OP-CODE를 페치한 후, 페치된 제 1 OP-CODE를 프로세서내의 디코더로 입력하여 디코딩 규칙에 따라 ID1-스테이지에서 디코딩하게 된다.After fetching the first OP-CODE, the fetched first OP-CODE is input to a decoder in the processor to decode in the ID 1 -stage according to a decoding rule.

이때, 상기 디코딩되는 동시에 상기 TRAPA명령에 대한 제 2 OP-CODE를 IF2-스테이지에서 페치하게 되는 것이다.At this time, the second OP-CODE for the TRAPA command is simultaneously fetched from the IF 2 stage.

EX1-스테이지에서 프로그램 카운터(PC)의 데이터를 일 레지스터에 일시 저장하고, MA1-스테이지에서 #imm(immediate)를 메모리에 라이트한다.On the EX 1 stage, the data of the program counter (PC) is temporarily stored in one register, and #imm (immediate) is written to the memory on the MA 1 stage.

이때, 상기 EX1-스테이지의 동작과 동시에 페치된 제 2 OP-CODE 를 디코더로 입력하여 ID2-스테이지에서 디코딩을 수행한다.At this time, the second OP-CODE fetched at the same time as the operation of the EX 1 stage is input to the decoder to perform decoding on the ID 2 stage.

디코딩후, EX2-스테이지에서 스테이터스 레지스터에 저장된 데이터를 일 레지스터에 라이트한다.After decoding, the data stored in the status register at the EX 2 stage is written to one register.

그리고, 상기 ID2-스테이지에서의 디코딩 동작과 동시에 IF3-스테이지에서는 제 3명령 즉, TRAPA명령수행에 대한 제 3 OP-CODE를 페치하고, 상기 EX2-스테이지 수행과 동시에 상기 페치된 제 3 OP-CODE를 디코딩하는 것이다.In addition, at the same time as the decoding operation in the ID 2 stage, the IF 3 stage fetches a third OP-CODE for executing a third instruction, that is, a TRAPA instruction, and simultaneously fetches the third OP-CODE for performing the EX 2 stage. It is to decode the OP-CODE.

디코딩후, EX3-스테이지에서는 상기 스테이터스 레지스터에 특정값을 라이트한다.After decoding, the EX 3 stage writes a specific value to the status register.

한편, 상기 ID3-스테이지에서 의 디코딩동작과 동시에 IF4- 스테이지에서는 제 4 명령 즉, TRAPA명령에 대한 제 4 OP-CODE를 페치하고, 상기 EX3-스테이지 수행과 동시에 상기 페치한 제 4 OP-CODE를 ID4-스테이지에서 디코딩하며, 디코딩후 EX4-스테이지에서 VBR+h'100으로 점프(jump)하는 연산을 수행하여 TRAPA명령의 파이프라인의 동작을 완료하는 것이다.Meanwhile, at the same time as the decoding operation in the ID 3- stage, in the IF 4 -stage, the fourth OP-CODE for the fourth instruction, that is, the TRAPA instruction, is fetched, and the fourth OP is fetched at the same time as the execution of the EX 3- stage. It decodes the code at the ID 4 stage, and jumps to VBR + h'100 at the EX 4 stage after decoding to complete the operation of the pipeline of the TRAPA instruction.

이때, 상기 TRAPA명령이 아닌 다른 명령에 대한 파이프라인의 수행은 상기 TRAPA명령의 파이프라인 수행이 완료된 후 이루어지는 것이다.In this case, the execution of the pipeline for commands other than the TRAPA command is performed after the pipeline execution of the TRAPA command is completed.

여기서, 상기 TRAPA명령에 대한 파이프라인 수행시, 상술한 바와 같이 그 수행단계를 4단계로 나누어 수행하는데 이 4단계 각각에는 스페셜 명령을 수행하기 위한 스테이터스 비트"1"이 컴파일러에 의해 부여되어 잇다.In this case, when the pipeline is executed for the TRAPA instruction, the execution stage is divided into four stages as described above. Each of the four stages is provided with a status bit "1" for executing a special instruction.

즉, 상기 4단계가 수행되는 도중에 인터럽트나 익셉션이 발생시에도 수행동작을 중단하지 않고 상기 스테이터스 비트가 부여된 단계에서는 명령(TRAPA) 동작을 수행하도록 하고 그 이후의 동작에서 인터럽트 및 익셉션을 수행할 수 있다.That is, even when an interrupt or an exception occurs while step 4 is performed, the step (TRAPA) operation can be performed in the step where the status bit is given and the interrupt and exception can be performed in the subsequent operation. have.

여기서, 도 3b에 도시된 바와 같이 TRAPA명령의 수행사이클은 도 2b에 도시된 바와 같이 6 TRAPA 수행사이클이 소요된다.Here, as shown in FIG. 3B, the cycle of executing the TRAPA instruction takes 6 TRAPA execution cycles as shown in FIG. 2B.

도 3c는 스페셜 명령 즉, Multiply 명령에 대한 파이프라인 수행방법을 나타낸 도면이다.3C is a diagram illustrating a pipeline execution method for a special command, that is, a multiply command.

우선, Multiply명령의 수행을 나누어 처리할 수 있도록 단계에 따라 메모리에 각각의 OP-CODE를 나누어 컴파일한다.First, divide and compile each OP-CODE in memory according to the steps so that multiply instruction can be divided and processed.

여기서, Multiply명령은 3개의 명령으로 나누어질 수 있다.Here, the multiply command may be divided into three commands.

먼저, 메모리에 저장된 Multiply명령에 대한 제 1 명령 즉, 제 1 OP-CODE를 프로세서로 IF1-스테이지에서 페치한다.First, the first instruction for the multiply instruction stored in the memory, that is, the first OP-CODE, is fetched from the IF 1 stage to the processor.

상기 제 1 OP-CODE를 페치한 후, 페치된 제 1 OP-CODE를 프로세서내의 디코더로 입력하여 디코딩 규칙에 따라 ID1-스테이지에서 디코딩하게 된다.After fetching the first OP-CODE, the fetched first OP-CODE is input to a decoder in the processor to decode in the ID 1 -stage according to a decoding rule.

이때, 상기 디코딩되는 동시에 상기 Multiply명령에 대한 제 2 OP-CODE를 IF2-스테이지에서 페치하게 되는 것이다.At this time, the second OP-CODE for the multiply command is simultaneously fetched from the IF 2 stage.

EX1-스테이지에서 프로세서 외부에 구성된 멀티플라이어(multiplier)에 오퍼랜드(operrand)를 준다.EX 1 Gives an operand to a multiplier configured outside the processor on the stage.

이때, 상기 EX1-스테이의 동작과 동시에 ID2-스테이지에서는 상기 IF2-스테이지에서 페치해온 제 2 OP-CODE를 디코딩한다.At this time, at the same time as the operation of the EX 1 -stay, the ID 2 -stage decodes the second OP-CODE fetched from the IF 2 -stage.

상기 EX1-스테이지의 수행후 MA1-스테이지에서는 메모리에 라이트한다.After the execution of the EX 1 stage, the MA 1 stage is written to the memory.

이때, 상기 MA1-스테이지 수행과 동시에 EX2-스테이지에서는 멀티플라이어에 다른 오퍼랜드를 주고, MA2-스테이지에서 메모리에 라이팅하는 동작을 수행하는 것이다.At this time, the MA 1 stage is performed at the same time, the EX 2 stage gives another operand to the multiplier, and writes to the memory in the MA 2 stage.

한편, 상기 ID2-스테이지 동작수행과 동시에 Multiply명령에 대한 제 3 OP-CODE를 페치하고, EX-2-스테이지 동작과 동시에 상기 IF3-스테이지에서 페치해온 제 3 OP-CODE를 디코딩하는 것이다.Meanwhile, the third OP-CODE for the multiply instruction is fetched at the same time as the ID 2 -stage operation is performed, and the third OP-CODE fetched at the IF 3 -stage is simultaneously decoded at the same time as the EX -2 -stage operation.

이후, 외부의 멀티플라이어에서 멀티플라이 연산을 수행하게 되는 것이다.After that, the multiplier operation is performed by an external multiplier.

이때, 상기 Multiply명령이 아닌 다른 명령에 대한 파이프라인의 수행은 상기 ID3-스테이지에서 디코딩을 수행과 동시에 다른 명령의 OP-CODE를 페치해와서 파이프라인 동작을 수행하는 것이다.At this time, the performance of the pipeline for the instruction other than the multiply instruction is to perform the pipeline operation by fetching the OP-CODE of another instruction at the same time as decoding is performed in the ID 3 stage.

여기서, 상기 Multiply명령에 대한 파이프라인 수행시, 상술한 바와 같이 그 수행단계를 3단계로 나누어 수행하는데 이 3단계 각각에는 스페셜 명령을 수행하기 위한 스테이터스 비트"1"이 컴파일러에 의해 부여되어 있다.In this case, when the pipeline is executed for the multiply instruction, the execution step is divided into three steps as described above. Each of the three steps is provided with a status bit "1" for executing a special command.

즉, 상기 4단계가 수행되는 도중에 인터럽트나 익셉션이 발생시에도 수행동작을 중단하지 않고 상기 스테이터스 비트가 부여된 단계에서는 명령(Multiply) 동작을 수행하도록 하고 그 이후의 동작에서 인터럽트 및 익셉션을 수행할 수 있다.That is, even when an interrupt or an exception occurs while the four steps are performed, the step of applying the status bit may perform a multiply operation and may perform an interrupt and exception in subsequent operations. have.

여기서, 도 3c에 도시된 바와 같이 Multiply명령의 수행사이클은 도 2c에 도시된 Multiply명령의 수행사이클보다 1 사이클이 더 소용됐으나 멀티플라이어에 오퍼랜드를 주면서 Multiply연산을 수행하게 하면 같은 사이클이 소용되게 되는 것이다.In this case, as shown in FIG. 3C, one cycle is used more than the execution cycle of the Multiply instruction shown in FIG. 2C, but the same cycle is used when the multiply operation is performed while giving an operand to the multiplier. will be.

그리고, 도 3d는 스페셜 명령 즉, RTE 명령에 대한 파이프라인 수행방법을 나타낸 도면이다.3D illustrates a pipeline execution method for a special instruction, that is, an RTE instruction.

여기서, 상기 RTE명령은 2개의 명령으로 나누어져 수행되고 그에 따라 스테이터스 비트역시 2개의 명령에만 부여되는 것이다.In this case, the RTE instruction is divided into two instructions and thus the status bit is also given to only two instructions.

또한, 그 수행사이클 역시 도 2d와 같이 3사이클이 소요된다.In addition, the performance cycle also takes three cycles as shown in FIG.

그리고, 상술한 명령 이외의 경우에도 상술한 방법과 같이 그 연산이 수행되는 것이다.In addition to the above-described command, the operation is performed in the same manner as described above.

본 발명에서 상술한 데이터 해저드나 MA/IF스테이지 충돌에 의한 스톨의 경우에는 어떠한 구조에서도 피할 수 없는 것이므로 본 발명에서도 똑같이 적용되는 것이다.Stalls due to data hazards and MA / IF stage collisions described above in the present invention are inevitable in any structure, and thus the same applies to the present invention.

그리고, 인터럽트, 익셉션과 같은 상황이 발생했을 때는 현재 수행하던 명령을 끝내고 해야하는 경우와 그렇지 않은 경우가 있으므로 스페셜 명령에서 인터럽트 또는 익셉션이 걸렸을 때를 위하여 현 재 수행하고있는 명령이 스페셜 명령이의 일부분이라는 것을 알려주기 위한 스테이터스 비트가 OP-CODE상에 부여된다.And, when an interruption or exception occurs, it may be necessary to finish the current command or not. Therefore, when the interrupt or exception occurs in the special command, the current command is part of the special command. A status bit is given on the OP-CODE to indicate that.

즉, 현존의 프로그램과 동일하게 동작될 수 있도록 스페셜 명령을 위한 스테이터스 비트가 "1"로 세팅(Setting)되어 있는 명령에서는 그 명령수행중에 인터럽트나 익셉션이 수행되지 못하도록 구성하는 것이다.In other words, in the instruction in which the status bit for the special instruction is set to '1' so that the operation can be performed in the same way as the existing program, the interrupt or exception is not executed during the instruction execution.

상기의 구조를 사용했을 때는 컴파일/어셈블러(Compiler/Assembler)에 부담이 되며, 프로그램을 기계어로 컴파일했을 때 코드의 길이가 길어진다.Using the above structure is a burden on the compiler / assembler, and when the program is compiled in machine language, the code length becomes longer.

왜냐하면, 기본 명령의 수행 단계별로 그 구조로 나누기 때문이며 또한, 인터럽트나 익셉션이 걸렸을 때 현재 수행하고 있는 명령이 하나의 명령이 나누어진 것인지 아닌지를 판별하기 위한 스테이터스 비트가 op-code상에 들어가게 되기 때문이다.This is because it divides the structure into the steps of executing basic instructions, and when the interrupt or exception occurs, a status bit is entered in the op-code to determine whether the instruction being executed is divided into one instruction or not. to be.

상술한 본 발명에 대해 도 4를 참조하여 간단히 요약하면, 먼저 일 명령에 대한 op-code를 수행 단계별로 각각의 명령으로 나누어 컴파일한다(S101).Briefly summarizing the present invention described above with reference to FIG. 4, first, an op-code for one command is divided into respective commands for each execution step (S101).

그리고, 현재 수행하고 있는 명령이 스페셜 명령의일부라는 것을 구별하기 위해, 상기 일 명령에 대해 나누어 수행되는 단계별로 스테이터스 비트를 부여하고(S102) 상기 명령이 수행되는 도중 인터럽트나 익셉션 발생시 상기 스테이터스 비트가 부여된 단계에 대해서는 계속적으로 그 연산을 수행하고 그 연산이 완료되면 인터럽트나 익셉션동작을 행하는 것이다(S103).In order to distinguish that the instruction currently being executed is a part of a special instruction, a status bit is given to each stage to be divided for the one instruction (S102), and when the interrupt or exception occurs while the instruction is executed, the status bit is added. For the given step, the operation is continuously performed, and when the operation is completed, an interrupt or exception operation is performed (S103).

프로세서의 디자인시 스페셜 명령이 들어왔을 경우에 필요한 임시 저장 레지스터를 만들 필요가 없으며, 그에 따른 컨트롤 로직이 필요없게 되는 것이다.In the design of the processor, there is no need to create the temporary storage registers needed for special instructions, and there is no need for control logic.

따라서, 본 발명에 따른 멀티-스테이지 파이프라인 구조를 갖는 마이크로 프로세서 디자인방법은 게이트 사이즈가 현저하게 줄일 수있으며, 컨트롤로직이 간단해 지는 것에 따른 크리티컬 패스가 줄어들므로 인한 고 속의 프로세서를 디자인 할 수 있는 이점이 있다.Therefore, the method for designing a microprocessor having a multi-stage pipeline structure according to the present invention can significantly reduce the gate size and reduce the critical path due to the simplified control logic, thereby enabling the design of a high speed processor. There is an advantage.

Claims (1)

마이크로 프로세서 디자인방법에 있어서,In the microprocessor design method, 특수명령에 해당하는 명령어를 파이프라인 처리의 기본 스테이지만으로 구성되는 OP코드로 나누어 컴파일 하는 단계,Compile the instructions corresponding to the special instructions into OP codes consisting only of the basic stage of the pipeline processing, 현재 수행할 명령이 특수 명령의 일부라는 것을 구별하기 위해 상기 명령어에 대해 스테이터스 비트를 부여하는 단계,Giving a status bit to the instruction to distinguish that the instruction to be executed is part of a special instruction, 상기 명령이 수행되는 도중 인터럽트나 익셉션 발생시 상기 스테이터스 비트가 부여된 단계에 대해서는 계속적으로 그 연산을 수행하고 연산이 완료되면 인터럽트나 익셉션 동작을 수행하는 단계를 구비하여 이루어짐을 특징으로 하는 멀티-스테이지 파이프라인 구조를 갖는 마이크로 프로세서 디자인 방법.Multi-stage pipe comprising the step of continuously performing the operation for the step given the status bit when the interrupt or exception occurs while the instruction is executed, and performing the interrupt or exception operation when the operation is completed. Microprocessor design method with line structure.
KR1019970005418A 1997-02-22 1997-02-22 Method for design of microprocessor with multi-stage pipeline type KR100244210B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1019970005418A KR100244210B1 (en) 1997-02-22 1997-02-22 Method for design of microprocessor with multi-stage pipeline type

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1019970005418A KR100244210B1 (en) 1997-02-22 1997-02-22 Method for design of microprocessor with multi-stage pipeline type

Publications (2)

Publication Number Publication Date
KR19980068685A KR19980068685A (en) 1998-10-26
KR100244210B1 true KR100244210B1 (en) 2000-08-01

Family

ID=19497690

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1019970005418A KR100244210B1 (en) 1997-02-22 1997-02-22 Method for design of microprocessor with multi-stage pipeline type

Country Status (1)

Country Link
KR (1) KR100244210B1 (en)

Also Published As

Publication number Publication date
KR19980068685A (en) 1998-10-26

Similar Documents

Publication Publication Date Title
KR100208889B1 (en) Parallel processing device amd parallel processing method
US6889318B1 (en) Instruction fusion for digital signal processor
KR950003552B1 (en) Programmable controller
US5822602A (en) Pipelined processor for executing repeated string instructions by halting dispatch after comparision to pipeline capacity
US5604878A (en) Method and apparatus for avoiding writeback conflicts between execution units sharing a common writeback path
JPH0628185A (en) Computer apparatus for parallel execution of two computer instructions
US20070156391A1 (en) Host computer system emulating target system lagacy software and providing for incorporating more powerful application program elements into the flow of the legacy software
CN108780395B (en) Vector prediction instruction
JP2620511B2 (en) Data processor
US5416913A (en) Method and apparatus for dependency checking in a multi-pipelined microprocessor
US5761467A (en) System for committing execution results when branch conditions coincide with predetermined commit conditions specified in the instruction field
US6023751A (en) Computer system and method for evaluating predicates and Boolean expressions
JP4134179B2 (en) Software dynamic prediction method and apparatus
KR20040086462A (en) Methods and apparatus for multi-processing execution of computer instructions
US7010676B2 (en) Last iteration loop branch prediction upon counter threshold and resolution upon counter one
US7356673B2 (en) System and method including distributed instruction buffers for storing frequently executed instructions in predecoded form
US7415601B2 (en) Method and apparatus for elimination of prolog and epilog instructions in a vector processor using data validity tags and sink counters
EP1190305B1 (en) Method and apparatus for jump delay slot control in a pipelined processor
KR100244210B1 (en) Method for design of microprocessor with multi-stage pipeline type
KR20010007093A (en) Hardware device for executing programmable instructions based upon micro-instructions
EP0806723A2 (en) Method and apparatus for handling multiple precise events in a pipelined digital processor
KR20160108754A (en) Method for processing unconditional branch instruction in processor with pipeline
KR102379886B1 (en) Vector instruction processing
US20060168431A1 (en) Method and apparatus for jump delay slot control in a pipelined processor
US9135006B1 (en) Early execution of conditional branch instruction with pc operand at which point target is fetched

Legal Events

Date Code Title Description
A201 Request for examination
E902 Notification of reason for refusal
E701 Decision to grant or registration of patent right
GRNT Written decision to grant
FPAY Annual fee payment

Payment date: 20060911

Year of fee payment: 8

LAPS Lapse due to unpaid annual fee