KR100292460B1 - Method for executing conditional branch command and command executing device using the same - Google Patents
Method for executing conditional branch command and command executing device using the same Download PDFInfo
- Publication number
- KR100292460B1 KR100292460B1 KR1019970040742A KR19970040742A KR100292460B1 KR 100292460 B1 KR100292460 B1 KR 100292460B1 KR 1019970040742 A KR1019970040742 A KR 1019970040742A KR 19970040742 A KR19970040742 A KR 19970040742A KR 100292460 B1 KR100292460 B1 KR 100292460B1
- Authority
- KR
- South Korea
- Prior art keywords
- command
- conditional branch
- signal
- branch instruction
- instruction
- Prior art date
Links
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/30003—Arrangements for executing specific machine instructions
- G06F9/30007—Arrangements for executing specific machine instructions to perform operations on data operands
- G06F9/30029—Logical and Boolean instructions, e.g. XOR, NOT
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/38—Information transfer, e.g. on bus
- G06F13/40—Bus structure
- G06F13/4063—Device-to-bus coupling
-
- 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/22—Microcontrol or microprogram arrangements
- G06F9/26—Address formation of the next micro-instruction ; Microprogram storage or retrieval arrangements
- G06F9/262—Arrangements for next microinstruction selection
- G06F9/268—Microinstruction selection not based on processing results, e.g. interrupt, patch, first cycle store, diagnostic programs
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Hardware Design (AREA)
- Advance Control (AREA)
- Executing Machine-Instructions (AREA)
Abstract
Description
본 발명은 마이크로 프로세서에 관한 것으로, 특히 조건부 분기 명령을 빠르게 수행하도록 하는 콘디셔널 브랜치 명령수행 방법 및 이를 이용한 명령수행 장치에 관한 것이다.BACKGROUND OF THE
디지털 신호를 고속으로 처리하기 위해서 마이크로 프로세서에는 디지털 신호 처리기(Digital Signal Processor ; 이하 "DSP"라 함)가 마련되어 있다. DSP의 명령 중 특히 브랜치 관련 명령어는 고속의 처리속도를 필요로 한다. 종래의 DSP를 첨부한 도 1 내지 도 6을 참조하여 설명하기로 한다.In order to process digital signals at high speed, the microprocessor is provided with a digital signal processor (hereinafter referred to as "DSP"). Branch instructions, especially branch instructions, require high throughput. It will be described with reference to Figures 1 to 6 attached to the conventional DSP.
도 1은 통상의 디지털 신호 처리장치(DSP)를 나타내는 개략적인 블록도를 도시한다.1 shows a schematic block diagram showing a conventional digital signal processing apparatus (DSP).
통상의 디지털 신호 처리장치는 2 개의 분리된 메모리 버스(Memory Bus) 구조를 갖는 하버드 타입(Havard Type) 구조를 갖는다.Conventional digital signal processing apparatuses have a Harvard Type structure having two separate Memory Bus structures.
종래의 DSP는 프로그램 어드레스 및 프로그램 데이터 버스(101,102)와 데이터 어드레스 및 데이터 버스(601,602)를 경유하여 접속된 프로그램 어드레싱부(200), 연산 처리부(300) 및 승산부(400)로 이루어진 중앙 연산 처리부(10), 보조연산 처리부(500), 디코딩부(700), 프로그램 메모리 및 데이터 메모리(100, 600)를 구비한다.The conventional DSP is a central processing unit consisting of a
이 외에도 종래의 DSP는 외부 장치와의 통신을 위한 주변 장치(예를 들면, 타이머, 시리얼 입/출력 장치, 메모리 관리 장치 등)이 추가된다.In addition, the conventional DSP adds a peripheral device (eg, a timer, a serial input / output device, a memory management device, etc.) for communication with an external device.
프로그램 데이터 버스(102)는 프로그램 메모리(100)로부터 명령 코드와 즉치 오퍼랜드(Immediate Operand)를 프로그램 어드레싱부(200), 연산 처리부(300), 승산부(400), 메모리 어드레싱부(500), 디코딩부(700)에 공급한다.The
데이터 버스(601)는 연산 처리부(300) 및 승산부(400)로 이루어진 중앙 연산처리부(10), 보조 연산 처리부(500)와 데이터 메모리(600)에 접속된다.The data bus 601 is connected to the central
연산 처리부(300)는 32 비트 연산 처리 장치(ALU ; 304)와 누산기(Accumulator ; 305)를 이용하여 2의 보수 산술 연산과 불 연산(Boolean Operation)을 실행한다.The
이를 위하여, 연산 처리부(300)는 입력되는 오퍼랜드(피연산자)를 2의 보수 연산하는 연산 처리 장치(304)와, 연산 처리 장치(304)의 입력단에 접속되어 연산 처리 장치(304)에 입력되는 데이터를 레프트 시프트함으로서 프리스케일링(Prescaling)하는 프리 스케일러(301)와, 연산 처리 장치(304)의 출력단에 접속되어 연산 처리 장치(304)의 처리 결과를 저장하고 연산 처리 장치(304)에 저장된 내용을 공급하는 누산기(305)와, 누산기(305)의 출력단에 접속되어 입력되는 데이터를 레프트 시프트함으로서 스케일링하는 포스트 스케일러(306)를 구비한다.To this end, the
연산 처리부(300)의 제1 입력 데이터는 데이터 메모리(600)에서 데이터 버스(601)를 경유하여 공급되거나, 즉치 오퍼랜드(Immediate Operand)를 위하여 프로그램 메모리(100)에서 프로그램 데이터 버스(102)를 경유하여 공급되거나, 승산부(400)의 출력단에서 공급된다.The first input data of the
그리고 연산 처리부(300)의 제2 입력 데이터는 누산기(305)의 출력 또는 ZAIR 명령을 위한 테스트/제어 비트(308)로서 공급된다.The second input data of the
프리 스케일러(301)는 스케일링 시프터(Scaling Shifter)로서 프로그램 데이터 버스(102)로부터 공급되는 명령에 의해 프로그램된 0~16 범위로 레프트-시프팅을 수행하는 것에 의해, 데이터 버스(601)로부터 16 bit 데이터를 공급받아 32 bit 의 데이터로 스케일링하여 연산 처리 장치(304)에 공급한다. 이 때, 연산 처리 장치(304)에 공급되는 프리 스케일러(301)의 출력신호 중 최하위 비트들(Least Significant Bits ; LSBs)은 "0"으로 채워지고, 최상위 비트들(Most Significant Bits ; MSBs)은 상태 레지스터 ST1의 부호 확장 모드 비트(SXM)에 의해 "0"으로 채워지거나 선택적으로 부호 확장된다.The
누산기(305)는 연산처리 장치(304)의 출력 신호를 저장하고, 연산 처리 장치(304)에 제1 노드(N1)를 경유하여 저장된 데이터를 제2 입력 데이터로서 공급한다. 이 데이터는 32 bit 길이로 고차 워드(31~16 bits)와 저차 워드(15~0 bits)로 나뉘어져 있다. 누산기(305)의 고차 및 저차 워드(0~31 bits)는 포스트 스케일러(306)에서 스케일링되어져 데이터 버스(306)를 경유하여 데이터 메모리(600)에 공급된다.The
승산부(400)는 프리 스케일러(301)와 질렬 접속된 일시 레지스터(Temporary Register ; 401)와, 일시 레지스터(401)에 접속된 승산기(402)와, 승산기(402)에 접속된 처리 결과 레지스터(403)를 구비한다.The
일시 레지스터(401)는 승산기(402)의 한 오퍼랜드를 저장하기 위한 16 bit 레지스터다. 승산부(400)의 입력 데이터는 데이터 버스(601)를 경유하여 데이터 메모리(600)로부터 공급되거나, MAC/MACD 명령 수행을 위하여 프로그램 데이터 버스(102)를 경유하여 프로그램 메모리(100)로부터 공급되거나, MPYK 명령 워드로부터 즉치 데이터가 공급된다.The
승산기(402)는 16× 16 bit의 병렬 승산기로, 16× 16 bits로 2의 보수 승산을 수행하며, 그 처리 결과를 처리 결과 레지스터(403)에 저장한다. 처리 결과 레지스터(403)는 32 bit 레지스터로서 SPH/SPL 명령에 의해 각각 고차 및 저차 워드를 억세스할 수 있다.
포스트 스케일러(404)는 처리 결과 레지스터(403)로부터 승산기(402)의 출력결과 데이터를 레프트 시프트함으로서 스케일링하여 연산 처리 장치(304)에 공급한다.The
프로그램 어드레싱부(200)는 인터럽트 발생시 점프(jump)할 인터럽트 벡터(Interrupt Vector ; 202)를 선택적으로 로드(Load)할 수 있도록 하는 프로그램 카운터(205)와, 프로그램 카운터(205)에 접속되어 인터럽트나 서브루틴의 호출 기간동안 프로그램 카운터(205)의 내용을 저장하기 위한 8레벨 하드웨어 스택(206)을 구비한다.The
프로그램 카운터(205)는 프로그램 메모리(100)를 프로그램 어드레스 버스(101)를 경유하여 어드레스하거나 스택(206)에 푸쉬한다. 이 때, 스택 포인터(Stack Pointer)는 스택의 최상위가 되는 다음 장소를 가리키도록 자동적으로 증가한다.The program counter 205 addresses the program memory 100 via the program address bus 101 or pushes it onto the
보조 연산 처리부(500)는 보조 레지스터 포인터(501)와, 보조 레지스터 포인터(501)에 접속된 보조 레지스터(AR ; 502)와, 보조 레지스터(AR ; 502)에 접속되어 간접 어드레스를 계산하기 위해 입력되는 신호를 연산처리하는 보조 연산 처리장치(ARAU ; 503)와, 데이터 메모리 페이지 포인터(504) 및 데이터 메모리 어드레스 버스 (DMA : 505)를 구비한다.The auxiliary
데이터 메모리(600)는 데이터 어드레스 버스(602)에 의해 어드레스되어지고, 프로그램 버스(101,102)와 데이터 버스(601,602)는 연산 처리 수행을 위하여 싱글 사이클로 온-칩 데이터 메모리(On-Chip Data Memory ; 600)와 내부 프로그램 메모리(100)로부터의 데이터를 중앙 연산 처리부(10), 보조 연산 처리부(500)에 공급한다. 데이터 어드레스 맵은 16 bit 어드레스 버스에 기인한 64K 워드(Word) 어드레스와 글로발 메모리 인터페이스에 의한 32K 워드 어드레스를 추가함으로서 총 96K 메모리 스페이스까지 확장 될 수 있다.The data memory 600 is addressed by the
프로그램 메모리(100)는 64K 메모리 스페이스를 갖는다. 데이터 메모리 어드레싱 방법은 직접 어드레싱(예를 들면, ADD 010h), 보조 레지스터 파일에 의한 간접 어드레싱(예를 들면 Add *+), 오퍼랜드에 의한 즉치 어드레싱(Immediate Addressing) 모드를 이용한 방법이 있다.The program memory 100 has a 64K memory space. Data memory addressing methods include direct addressing (e.g., ADD 010h), indirect addressing (e.g., Add * +) by an auxiliary register file, and immediate addressing (Immediate addressing) mode by an operand.
직접 메모리 어드레싱 모드에서, 9 bit 데이터 메모리 페이지 포인터(504)는 데이터 메모리(600)를 512개의 페이지(1 page=128 Word)로 나누어 그 중 하나를 가리키며 데이터 버스(601) 또는 프로그램 데이터 버스(102)로부터 데이터를 공급받는다. 데이터 메모리 어드레스 버스(이하 "DMA"라 함 ; 505)는 프로그램 데이터버스로부터 받은 명령의 하위 7 bit를 취하며 페이지 내의 원하는 워드를 가리킨다. 따라서, 데이터 어드레스 버스 (602)는 9 bit 데이터 메모리 페이지 포인터(504)와 7 bit DMA(505)의 16 bit 어드레스로 형성된다.In the direct memory addressing mode, the 9 bit data
간접 어드레싱 모드에서, 보조 레지스터 포인터(501)에 의해 선택된 16 bit 보조 레지스터(AR ; 502)가 데이터 메모리(600)를 어드레스하며 16 bit 보조 레지스터(502)의 저장된 오퍼랜드는 보조 연산 처리 장치(ARAU ; 503)에 공급되어 연산 되어 진다. 8개의 보조 레지스터(ARO~AR7 ;502)가 데이터 메모리(600)의 간접 어드레싱이나 일시 데이터 저장을 위해 사용된다.In the indirect addressing mode, the 16 bit auxiliary register (AR) 502 selected by the
보조 레지스터(502)와 보조 레지스터 포인터(ARP ; 501)는 데이터 버스(601)를 경유하여 데이터 메모리(600), 누산기(305), 처리 결과 레지스터(403), 또는 명령 코드 내의 즉치 오퍼랜드로부터 데이터를 공급받으며, 보조 레지스터(502)의 내용은 보조 연산 처리 장치(503)에 의해 연사처리되어 데이터 어드레스 버스(602)를 경유하여 데이터 메모리(600)에 저장되고, 데이터 메모리(600)에 저장된 데이터는 선택적으로 중앙 연산 처리부(10)에 데이터 버스(601)를 경유하여 로드된다.Auxiliary register 502 and auxiliary register pointer (ARP) 501 transfer data from data memory 600,
보조 레지스터(502)의 파일은 보조 연산 처리 장치(503)에 연결되어 있어 데이터 메모리(600)가 어드레싱 되는 동안 자동적으로 인덱스 되어 지며, 그 기능은 아래와 같다.The file of the auxiliary register 502 is connected to the auxiliary
간접 어드레싱 산술 연산은 연산처리는 미수행(예를 들면, ADD *), AR(ARP)+1→ AR(ARP)(예를 들면, ADD *+), AR(ARP)-1→ AR(ARP)(예를 들면, ADD *-), AR(ARP)→ ARO(예를 들면, ADD *0+), AR(ARP)→ ARO(ARP)(예를 들면, ADD *0-), AR(ARP)+rc(ARO)→ AR(ARP)(예를 들면, ADD *BRO+), AR(ARP)-rc(ARP)→ AR(ARP)(예를 들면, ADD *BRO-) 등으로 수행한다. 여기서 rc(ARO)는 리버스 캐리(rc) 전파(Propagation)를 가지고 ARO를 연산(+,-)하는 비트-리버스드 어드레싱 모드(bit reversed addressing mode)를 말한다.Indirect addressing arithmetic operations are not performed (for example, ADD *), AR (ARP) + 1 → AR (ARP) (for example ADD * +), AR (ARP) -1-AR (ARP). ) (E.g. ADD *-), AR (ARP)-> ARO (e.g. ADD * 0 +), AR (ARP)-> ARO (ARP) (e.g. ADD * 0-), AR ( ARP) + rc (ARO)-> AR (ARP) (e.g., ADD * BRO +), AR (ARP) -rc (ARP)-> AR (ARP) (e.g., ADD * BRO-). . Here, rc (ARO) refers to a bit reversed addressing mode for calculating (+,-) ARO with reverse carry propagation.
보조 연산 처리 장치(503)는 다른 연산 처리 장치와 병렬로 어드레스 처리에 사용될 뿐만 아니라, 데이터 메모리(600)에 보조 레지스터 파일이 직접 연결되어 통신할 수 있기 때문에 일반적인 목적의 연산 처리를 수행할 수도 있다. 그리고 BANZ 명령은 보조 레지스터(502)를 루프 카운터로 사용할 수 있게 한다.The auxiliary
보조 연산 처리 장치(503)는 메모리를 효율적으로 이용하기 위하여 데이터와 프로그램 플럭 이동(Move) 및 데이터 이동 등의 기능을 제공한다. BLKD 명령은 데이터 메모리(600) 내의 블록들을 이동시키고, BLKP 명령은 프로그램 메모리(100) 내의 블록들을 데이터 메모리(600)로 이동시킨다. 이러한 명령들을 반복 명령(RPT,RPTK)과 함께 실행한다면 효율적으로 온-칩 또는 오프-칩 메모리로부터 반복 카운터(800)를 셋팅시키며, 반복 명령들을 반복적으로 실행시키는데 사용된다. 데이터 이동(Move) 명령 DMOV는 온-칩 메모리(On-Chip RAM)내의 현재 어드레스된 데이터 메모리(600)로부터 한 워드를 다음의 고차 위치(Next higher location)에 복사시킬 수 있는 명령으로서, 콘볼루션(Convolution)이나 데이터 필터링 같은 Z-1지연 연산 알고리즘을 효율적으로 수행시킨다.The auxiliary
테이블 재생/기록 명령(Table Read/Write ; TBLR/TBLW)은 프로그램 메모리(100)와 데이터 메모리(600) 사이의 워드 전달을 가능하게 하는 명령으로, TBLR은 프로그램 메모리(100)에서 데이터 메모리(600)로 워드를 재생하고, ATBLW는 데이터 메모리(100)로부터 데이터를 로드하여 프로그램 메모리(100)에 기록한다.The table read / write command (TBLR / TBLW) is a command that enables word transfer between the program memory 100 and the data memory 600, and the TBLR is a data memory 600 in the program memory 100. ), And ATBLW loads data from the data memory 100 and writes it to the program memory 100.
대형 동적 범위(Large Dynamic Range)를 요구하는 많은 응용 프로그램에서는 부동 소숫점 연산을 수행한다. 정규화 명령(Normalization Instruction)은 누산기(305) 내에 포함된 고정 소숫점 수를 레프트 시프트(Left-shift)함으로서 정규화 기능을 실현한다.Many applications that require large dynamic range perform floating point operations. The normalization instruction implements a normalization function by left-shifting a fixed point number included in the
연산 처리부(300) 및 승산부(400)로 이루어진 중앙 연산 처리부(10)는 프로그램 데이터 버스(102)와 데이터 버스(601)에 접속된 16 bit 프리 스케일러(301), 32 bit 연산 처리 장치(304), 16× 16 bit 병렬 승산기(402), 16× 16 bit 병렬 승산기(402)의 출력단에 접속된 처리 결과 레지스터(403), 처리 결과 레지스터(403)의 출력단에 접속된 포스트 스케일러(404)와, 32 bit 연산 처리 장치(304)의 출력단에 접속된 누산기(305)와, 누산기(305)의 출력단에 접속된 포스트 스케일러(306)를 구비한다.The
프리 스케일러(301)와 포스트 스케일러(306,404)는 시프터로서 뉴메리컬 스케일링(Numerical Scaling), 비트 추출(bit extraction), 확장 정밀 연산(Extended-Precision Arithmetic), 오버 플로우 방지 기능을 위해 사용된다.The
4 경우 시프트 모드 PM(405)은 처리 결과 레지스터(403) 값 을 아래의 표1에서와 같은 4경우의 모드로 시프트 시키는데 사용된다.The four case
4 경우 시프트 모드 PM(405)에 명시된 레프트 시프트는 소수 부분 연산(Fractional Arithmetic)을 구현하거나, 소수적(Fractional Product)을 정상화시킬 때 사용되며, 라이트 시프트(Right Shift)는 오버 플로우 없이 128회까지 연속적인 승산/누적 동작의 실행을 가능하게 한다. 4 경우 시프트 모드 PM(405)의 라이트 시프트는 부호 확장 모드(SXM ; 303) 상태에 관계없이 항상 부호 확장된다.In
그리고 프로그램 카운터(205), 하드웨어 스택(206), 외부 리셋 신호(RS), 인터럽트 제어 회로(202,203,204), 상태 레지스터, 반복 카운터(800)에 의해서도 시스템 제어가 수행된다.System control is also performed by the program counter 205, the
프로그램 카운터(205)는 온 칩 또는 오프 칩(On-Chip or Off-Chip) 프로그램 메모리(100)를 어드레스하는데, 프로그램 어드레스 버스(101)에 의해 프로그램 메모리(100)를 어드레스하면 프로그램 데이터 버스(102)를 통해 명령이 디코더(700) 내의 명령 레지스터(IR)에 로드(Load)된다. 명령 레지스터(IR)가 로드될 때, 프로그램 카운터(205)는 다음 명령 펫치(Fetch)를 시작할 준비를 하고 있다. 디코더(700)는 명령을 실행하기 위해서 필요한 다양한 제어 출력 신호를 발생한다.The program counter 205 addresses an on-chip or off-chip program memory 100. When the program memory 100 is addressed by the program address bus 101, the program data bus 102 ) Is loaded into the instruction register IR in the
이를 위하여, 디코더(700)는 4단계 파이프라인 동작을 하는데, 명령 파이프라인은 명령 실행 기간에 일어나는 버스(Bus) 동작과 관계가 있다.To this end, the
명령어 페치, 디코드, 오퍼랜드 페치, 실행의 4단계 파이프라인은 브랜치(Branch)등과 같은 파이프라인을 브로큰(Broken)하는 경우를 제외하고는 인비져블하며, 각 단계의 동작은 독립적이다. 그리하여 어떤 주어진 사이클(Cycle)에서 1~4 개의 다른 명령들이 활성화(Active)될 수 있다.The four-stage pipeline of instruction fetch, decode, operand fetch, and execution is invisible except when the pipeline is broken, such as a branch. The operation of each stage is independent. Thus, one to four other instructions can be activated in any given cycle.
아래의 첨부한 표2는 4단계 파이프 라인의 동작을 나타낸 것이다.Table 2 below shows the operation of the four-stage pipeline.
리셋신호(RS)는 최상위 우선 순위를 갖는 인터럽트인 넌 마스커블 외부 인터럽트(Non-maskable External Interrupt)로서 프로세서 실행을 강제하고 중단시켜 프로그램 카운터(205)를 "0(zero)"로 셋팅시키며 여러 레지스터들 및 상태 비트에 영향을 준다. 그러므로 파워-온시에 시스템의 정상 동작을 위해서는 최소 10 클럭 사이클 동안 리셋 신호의 논리 값을 로우(low)로 유지시켜야 한다.The reset signal RS is a non-maskable external interrupt, which is an interrupt having the highest priority, forcing and interrupting processor execution to set the program counter 205 to "zero", and to register various registers. And status bits. Therefore, for normal operation of the system at power-on, the logic value of the reset signal should be kept low for at least 10 clock cycles.
프로세서 실행은 로케이션0(Location0)에서 시작하며 통상 그 위치에는 시스템 초기화 루틴으로 연결되도록 브랜치 명령이 들어 있다.Processor execution begins at
프로세서에 리셋 신호가 공급되었을 때, 프로세서는 아래와 같은 동작이 순차적으로 수행된다. 프로그램 카운터 PC=000h, 상태 레지스터 ST0=0E00h, 상태 레지스터 ST1=0770h, 글로벌 메모리 레지스터 GREG=00h, 반복 카운터 RPTC=00h, 인터럽트 플렉 레지스터 IFR=00h, 인터럽트 마스크 레지스터 IMR=00h, 데이터 버스는 고임피던스 상태, 타임 레지스터에 로드될 피리어드 레지스터 PRD=OFFFFh, 타임 레지스터 TIM=OFFFFh, 기타 주변 장치를 초기화시킨다.When the reset signal is supplied to the processor, the processor sequentially performs the following operations. Program counter PC = 000h, status register ST0 = 0E00h, status register ST1 = 0770h, global memory register GREG = 00h, repeat counter RPTC = 00h, interrupt flex register IFR = 00h, interrupt mask register IMR = 00h, data bus has high impedance Initialize status, period register PRD = OFFFFh, time register TIM = OFFFFh, and other peripherals to be loaded into the time register.
프로세서 내부에는 2 개의 상태 레지스터 즉, 제1 상태 레지스터 ST0과 제2 상태 레지스터 ST1이 있어 내부의 상태를 나타내며 그 내용은 첨부한 도 2에 도시한 바와 같다.There are two status registers inside the processor, namely, a first status register ST0 and a second status register ST1, which represent internal states, and the contents thereof are as shown in FIG.
제1 및 제2 상태 레지스터 ST0, ST1에 있어서, "ARP"는 보조 레지스터의 포인터, "OV"는 오버 플로우 플랙, "OVM"은 오버 플로우 모드, "INTM"은 인터럽트 마스크 플랙, "DP"는 데이터 페이지 포인터, "APB"는 보조 레지스터 포인터 버퍼, "CNFO"는 콘피규레이션(Configuration ; 구성) 플랙, "TC"는 테스트 비트 플랙, "SXM"은 부호 확장 모드, "C"는 캐리 비트(Carry bit), "HM"은 홀드 모드 비트, "FSM"은 프레임 동기 모드 비트, "XF"는 외부 플렉 핀(Pin) 상태 비트, "FO"는 포맷 비트 이 때, 포맷 비트 F0="0"이면 직렬 포트 레지스터(Serial port register)는 16 bit 레지스터로 구성된다. "TXM"은 전송 모드 비트, "PM"은 4 경우 시프트 모드로 경우에 따른 동작은 표1에 기재한 바와 같다.In the first and second status registers ST0 and ST1, "ARP" is a pointer to an auxiliary register, "OV" is overflow flag, "OVM" is overflow mode, "INTM" is interrupt mask flag, and "DP" is Data page pointer, "APB" is the auxiliary register pointer buffer, "CNFO" is the Configuration flag, "TC" is the test bit flag, "SXM" is the sign extension mode, "C" is the carry bit ( Carry bit), "HM" is hold mode bit, "FSM" is frame sync mode bit, "XF" is external flex pin status bit, "FO" is format bit, format bit F0 = "0" If so, the serial port register consists of a 16 bit register. "TXM" is a transmission mode bit, "PM" is a shift mode in four cases, and the operation according to the case is shown in Table 1.
반복 카운터(800)는 반복 명령(RPT,RPTK)에 의해서 로드될 수 있는 8 bit 카운터로서, 어떤 수 N이 로드되었을 때 다음 명령이 반복적으로 수행되는 명령이면 N+1번 실행시킨다.The repetition counter 800 is an 8-bit counter that can be loaded by the repetition instructions RPT and RPTK. When the number N is loaded, the repetition counter 800 executes N + 1 times if the next instruction is repeatedly executed.
유휴 명령(Idle instruction)이 실행되었을 때나 제2 상태 레지스터 ST1에서 홀드 모드 비트 HM=1이고, 홀드 인터럽트 핀(Hold Interrupt Pin)의 논리 값이 로우(low)를 유지할 때, 프로세서는 파워 다운 모드(Power Down Mode)상태로 전환된다. 파워 다운 모드에서는 파워 소비가 정상적으로 동작시 소비되는 양보다 현저히 적은 양이 소비된다. 파워 다운 모드시에 프로세서 내부의 내용은 변하지 않고 유지되며, 어떤 인터럽트가 입력되었을 때 비로서 파워 다운 모드 상태가 해제되며 프로세서는 정상 동작을 계속한다.When an idle instruction is executed or when the hold mode bit HM = 1 in the second status register ST1 and the logic value of the hold interrupt pin remains low, the processor enters the power down mode ( Power Down Mode). In power-down mode, power consumption is consumed significantly less than that normally consumed. The contents of the processor remain unchanged in power down mode, and when any interrupt is input, the power down mode is released and the processor continues to operate normally.
프로세서에는 외부 장치가 프로세서를 인터럽트하기 위하여 사용되는 3 개의 제1 내지 제3 외부 마스커블 인터럽트(INT0 내지 INT2)와, 3 개의 내부 인터럽트(RINT,XINTM,TINT)와, 1 개의 소프트웨어 인터럽트(TRAP)가 마련되어 있다.The processor includes three first to third external maskable interrupts (INT0 to INT2), three internal interrupts (RINT, XINTM, and TINT), and one software interrupt (TRAP) used by an external device to interrupt the processor. Is provided.
표3에는 이들 인터럽트들의 벡터 위치, 우선도(Priority), 인터럽트 마스크 레지스터의 내용을 나타내고, 도 3에는 인터럽트 마스크 레지스터(IMR)의 내용을 나타낸다.Table 3 shows the vector position, priority, and contents of the interrupt mask register of these interrupts, and FIG. 3 shows the contents of the interrupt mask register (IMR).
각 인터럽트 어드레스는 통상적으로 그 어드레스 스페이스(Address Space)를 가지는데 이것은 그 위치에 브랜치 명령(Branch Instruction)이 올 수 있도록 배려한 것이다.Each interrupt address typically has its own address space, which allows for branch instructions to be placed at that location.
도 1에 도시된 종래의 DSP에 있어서, 누산기(305)에 저장되는 값을 보고 브랜치(Branch)하는 처리 수순을 설명하면 아래와 같다.In the conventional DSP shown in FIG. 1, a processing procedure of viewing and branching a value stored in the
프로그램 카운터(205)에서 프로그램 메모리(100)로 어드레스를 공급하고 "ADD"라는 데이터 메모리(600)의 값과 누산기(305)의 값을 더해서 다시 누산기(305)에 저장하는 명령어 코드를 읽어 왔다면, 디코더(700)에서 명령어 코드를 해석하여 각 하위 블록에 제어 신호를 발생시킨다. 데이터 메모리(600)를 통해서 로드한 데이터를 연산 처리 장치(304)에서 처리하여 그 결과를 누산기(305)에 저장한다. 만약, 그 다음에 연속되는 명령이 누산기(305)의 값을 참조하는 브랜치(Branch) 명령이라면, 브랜치 명령어 코드가 디코더(700)에 들어 왔더라도 파이프라인 구조상 누산기(305)에 새로운 값이 들어올 때까지 1 사이클(Cycle)을 기다려야 한다.If the program counter 205 reads the instruction code for supplying the address to the program memory 100 and adding the value of the data memory 600 called "ADD" and the value of the
표2를 참조하면, 명령어 펫치(Instruction fetch)는 명령어를 프로그램 메모리(100)로부터 읽어오는 사이클(Cycle)이고, 디코딩(Decording)은 읽어온 명령어 코드를 분석하여 제어신호를 발생시키는 사이클(Cycle)이다. 그리고 오퍼랜드 펫치(Operand fetch)는 데이터/프로그램 메모리(600,100)로부터 처리할 데이터를 읽어오는 사이클이고, 실행(Execution)은 데이터를 처리하는 사이클이다. 각 사이클은 클럭에 동기되어 있기 때문에 실행을 마친 결과는 실행 사이클 다음 클럭에 동기되어 누산기(305) 등에 저장되게 된다.Referring to Table 2, an instruction fetch is a cycle of reading an instruction from the program memory 100, and decoding is a cycle of generating a control signal by analyzing the read instruction code. to be. The operand fetch is a cycle of reading data to be processed from the data / program memories 600 and 100, and the execution is a cycle of processing data. Since each cycle is synchronized with the clock, the result of execution is stored in the
도 4 및 도 5는 종래의 4단계 파이프라인에서 조건부 분기 타이밍도를 도시한다.4 and 5 show conditional branch timing diagrams in a conventional four stage pipeline.
도 4 및 도 5를 참조하면, ADD 명령을 수행한 결과가 새로운 누산기 값으로 저장이 된다. ADD 명령 다음에 조건부 펫치(CB) 명령과 브렌치 할 번지인 lk(Long Immediate)가 연속되어 들어 온다면, CB 명령은 새로운 누산기 값이 저장 될 때까지 무조건 3사이클을 기다린다. 그리고 누산기 값을 보고 분기(Branch)할 것인지, 아닌지를 결정한 다음 lk를 프로그램 카운터(205)에 로드하는 제어신호를 다음 사이클에서 발생시키고서 다음 사이클에 분기할 주소가 프로그램 카운터(205)에 로드되면서 성공적으로 분기를 할 수 있다. 이 때, 만약 조건이 맞지 않으면(False) 도 5에서와 같이 CB 다음에 들어온 SACL이라는 명령을 이어서 수행하게 된다.4 and 5, the result of executing the ADD command is stored as a new accumulator value. If the ADD instruction is followed by a conditional fetch (CB) instruction followed by a branch address lk (Long Immediate), the CB instruction unconditionally waits three cycles until a new accumulator value is stored. After determining whether to branch or not based on the accumulator value, a control signal for loading lk to the program counter 205 is generated in the next cycle, and the address to branch to the next cycle is loaded into the program counter 205. You can branch successfully. At this time, if the condition is not satisfied (False), as shown in FIG.
이러한 방식은 프로그램 카운터(205)를 제어하는 제어신호가 디코딩 단계 다름 클럭에 동기되어 오퍼랜드 펫치 사이클에서 나오기 때문에, 구조적으로 새로운 누산기 값이 나올 때까지 기다리고 그 결과를 보고 다음 사이클에서 프로그램 카운터(205)에 분기할 번지를 실어야 할지, 프로그램 카운터 값을 "1"증가 시켜야 할지를 결정하는 프로그램 카운터 제어신호가 조건(Condition) 다음에 나오게 된다.This approach waits until a structurally new accumulator value comes out because the control signal controlling the program counter 205 comes out of the operand fetch cycle in synchronization with the clock of the decoding phase and then the program counter 205 in the next cycle. The program counter control signal, which decides whether to carry a branch address or to increase the program counter value by "1", follows the condition.
결국, 4단계 파이프라인 구조상에서 누산기 값을 참조하는 조건부 분기(Conditional branch)를 수행하는데 조건이 맞으면 5 사이클, 조건이 맞지 않으면 3 사이클이 필요하다.As a result, a conditional branch that references an accumulator value in a four-stage pipeline structure requires five cycles if conditions are met and three cycles if conditions are not met.
도 6은 종래의 4단계 파이프라인 구조에서 조건부 분기 명령을 실행하기 위해서 필요한 제어신호를 만들어 내는 상태도를 나타낸다.6 is a state diagram for generating a control signal required to execute a conditional branch instruction in a conventional four-stage pipeline structure.
초기 상태는 S1이고 이 때, 디코딩한 명령이 조건부 분기였다면 S2를 거쳐서 S3까지 진행된다. S3에서 누산기 조건을 보고 참(True)이면 S4, S5를 거치면서 분기할 번지를 프로그램 카운터(205)에 싣도록 하는 제어신호를 만들어 주면서 분기 명령을 실행한다.The initial state is S1, and if the decoded instruction was a conditional branch, it proceeds through S2 to S3. In S3, if the accumulator condition is true, the branch instruction is executed while making a control signal to load the address to branch to the program counter 205 through S4 and S5.
만약 누산기 조건이 거짓(False)이면 S3에서 S1으로 돌아가 연속되는 다음 명령을 수행하게 된다. 스테이트 머신(State Machine)을 사용하여 제어신호를 만들어내는 경우 종래의 방법으로는 조건부 브랜치를 하는데 총 5개의 스테이트(State)가 필요하고 조건부 분기 관련 프로그램 논리 배열(Program Logic Array ; 이하 "PLA"라 함) 코드도 S1, S2, S3(True), S3(False), S4, S5의 6항(Term)이 필요하다. 이처럼 4단계 파이프라인에서 조건부 분기를 할 때는 전 명령어가 누산기 값에 영향을 주는 명령이라면 조건부 분기 명령은 프로그램 카운터(205)에 새로운 값이 실릴 때까지 불필요한 1사이클을 더 기다려야 한다.If the accumulator condition is False, it returns from S3 to S1 and executes the next consecutive command. In case of generating a control signal using a state machine, a conventional method requires a total of five states for conditional branching and a conditional branch related program logic array (PLA). The code also needs 6 terms (S1, S2, S3 (True), S3 (False), S4, S5). As such, when the conditional branching is performed in the four-stage pipeline, if the whole instruction is an instruction that affects the accumulator value, the conditional branch instruction must wait one more cycle until the new value is loaded in the program counter 205.
따라서, 본 발명의 목적은 조건부 분기 명령을 빠르게 수행하도록 하는 콘디셔널 브랜치 명령수행 방법 및 이를 이용한 명령수행 장치를 제공하는데 있다.Accordingly, an object of the present invention is to provide a conditional branch instruction execution method and a command execution apparatus using the same to quickly perform a conditional branch instruction.
제1도는 종래의 디지털 신호 처리장치(DSP)를 나타내는 개략적인 블록도.1 is a schematic block diagram showing a conventional digital signal processing apparatus (DSP).
제2도는 종래의 디지털 신호 처리장치(DSP)에서 프로세서에 실장된 제1 상태레지스터 STO와 제2 상태 레지스터 ST1의 내용을 나타내는 도면.2 is a diagram showing the contents of a first state register STO and a second state register ST1 mounted in a processor in a conventional digital signal processing apparatus (DSP).
제3도는 종래의 디지털 신호 처리장치(DSP)에서 인터럽트 마스크 레지스터의 내용을 나타내는 도면.3 is a diagram showing the contents of an interrupt mask register in a conventional digital signal processing apparatus (DSP).
제4도는 종래의 디지털 신호 처리장치(DSP)에서 4단계 파이프라인에서 조건을 만족하는 경우 조건부 분기 타이밍도.4 is a conditional branch timing diagram when a condition is satisfied in a four-stage pipeline in a conventional digital signal processing apparatus (DSP).
제5도는 종래의 디지털 신호 처리장치(DSP)에서 4단계 파이프라인에서 조건을 만족하지 않는 경우 조건부 분기 타이밍도.5 is a conditional branch timing diagram when a condition is not satisfied in a four-stage pipeline in a conventional digital signal processing apparatus (DSP).
제6도는 종래의 디지털 신호 처리장치(DSP)에서 4단계 파이프라인 구조의 분기 상태도.6 is a branched state diagram of a four-stage pipeline structure in a conventional digital signal processing apparatus (DSP).
제7도는 본 발명의 실시예에 따른 콘디셔널 브랜치 명령수행 방법 및 이를 이용한 명령수행 장치에서 4단계 파이프라인의 조건부 분기에서 조건을 만족하는 경우의 타이밍도.7 is a timing diagram when a conditional branch of a four-stage pipeline is satisfied in a conditional branch instruction execution method and an instruction execution apparatus using the same according to an embodiment of the present invention.
제8도는 본 발명의 실시예에 따른 콘디셔널 브랜치 명령수행 방법 및 이를 이용한 명령수행 장치에서 4단계 파이프라인의 조건부 분기에서 조건을 만족하지 않는 경우의 타이밍도.8 is a timing diagram when a conditional branch of a four-stage pipeline is not satisfied in a conditional branch instruction execution method and an instruction execution apparatus using the same according to an embodiment of the present invention.
제9도는 본 발명의 실시예에 따른 콘디셔널 브랜치 명령수행 방법 및 이를 이용한 명령수행 장치에서 4단계 파이프라인의 조건부 분기의 상세 타이밍도.9 is a detailed timing diagram of a conditional branch of a four-stage pipeline in a conditional branch instruction execution method and an instruction execution apparatus using the same according to an embodiment of the present invention.
제10도는 본 발명의 실시예에 따른 콘디셔널 브랜치 명령수행 장치의 개략적인 블록도.10 is a schematic block diagram of a conditional branch instruction execution apparatus according to an embodiment of the present invention.
제11도는 본 발명의 실시예에 따른 콘디셔널 브랜치 명령수행 방법 및 이를 이용한 명령수행 장치에서 조건부 분기의 상태도.11 is a state diagram of a conditional branch in a conditional branch instruction execution method and an instruction execution apparatus using the same according to an embodiment of the present invention.
〈도면의 주요부분에 대한 부호의 설명〉<Explanation of symbols for main parts of drawing>
2 : 프로그램 논리 배열(PLA) 4 : 유한 스테이트 머신(FSM)2: Program Logical Array (PLA) 4: Finite State Machine (FSM)
6,14 : 플립/플롭 8,12,16 : 멀티 플렉서6,14 flip /
10 : 중앙 연산 처리부 100 : 프로그램 메모리10: central processing unit 100: program memory
101 : 프로그램 어드레스 메모리 102 : 프로그램 데이터 메모리101: program address memory 102: program data memory
200 : 프로그램 어드레싱부 201,603 : CNF200: program addressing unit 201,603: CNF
202 : 인터럽트 벡터 203 : 인터럽트 마스크 플랙202: interrupt vector 203: interrupt mask flag
204 : 인터럽트 마스크 레지스터 205 : 크로그램 카운터204: interrupt mask register 205: chromagram counter
206 : 하드웨어 스택 300 : 연산 처리부206: hardware stack 300: arithmetic processing unit
301,306,404 : 스케일러 302 : 오버 플로우 모드301 306 404 Scaler 302 overflow mode
303 : 부호 확장 모드 304,503 : 연산 처리 장치303: sign extension mode 304,503: arithmetic processing unit
305 : 누산기 308 : 테스트/제어 비트305: Accumulator 308: Test / Control Bits
400 : 승산부 401 : 일시 레지스터400: multiplier 401: date and time register
402 : 승산기 403 : 처리 결과 레지스터402: Multiplier 403: Processing Result Register
405 : 4 경우 시프트 모드 500 : 보조 연산 처리부405: shift mode in case of 500 500: auxiliary operation processing unit
501 : 보조 레지스터 포인터 502 : 보조 레지스터501: auxiliary register pointer 502: auxiliary register
504 : 데이터 메모리 페이지 포인터 505 : 데이터 메모리 어드레스 버스504: data memory page pointer 505: data memory address bus
600 : 데이터 메모리 601 : 데이터 버스600: data memory 601: data bus
602 : 데이터 어드레스 버스602: data address bus
상기 목적을 달성하기 위하여, 본 발명의 콘디셔널 브랜치 명령수행 방법은 선택적으로 조건을 만족하는 경우만 제어를 분기하는 조건부 분기 명령을 공급하는 단계와; 조건부 명령이 디코딩되어 그에 따른 제어신호가 발생하는 제1 사이클, 분기할 번지 값을 로드하여 한 번 딜레이하는 제2 사이클 및 분기할 번지 값이 프로그램 카운터에 로드되게 하는 제3 사이클 및 분기할 번지 값에서 읽어 온 명령을 디코드하여 실행하는 제4 사이클을 포함하여 분기 명령에 대하여 조건을 만족하는 경우에 4 사이클의 기간으로 분기가 실행되는 단계와, 조건부 분기 명령에 뒤이어 임의의 명령이 공급되면 분기 명령을 실행하는 동안 임의의 명령이 실행되지 않도록 하는 제어신호로 치환되는 단계를 포함한다.In order to achieve the above object, the conditional branch instruction execution method of the present invention comprises the steps of: supplying a conditional branch instruction that branches control only if the condition is optionally met; The first cycle in which the conditional instruction is decoded to generate a control signal, the second cycle of loading the delayed address value, and the third cycle of causing the delayed address value to be loaded into the program counter and the branched address value to be loaded. A branch is executed in a period of four cycles when the condition is satisfied for the branch instruction including a fourth cycle of decoding and executing the instruction read from the branch instruction, and the branch instruction if any instruction is supplied following the conditional branch instruction. And substituting a control signal for preventing any command from being executed while executing the operation.
본 발명의 콘디셔널 브랜치 명령수행 방법은 선택적으로 조건을 만족하는 경우만 제어를 분기하는 조건부 분기 명령을 공급하는 단계와; 조건부 분기 명령의 조건을 만족하지 않는 경우에 강제로 프로그램 카운터의 증가분을 "1"씩 증가시켜 조건부 분기 명령에 이어서 공급되는 임의의 명령을 디코드하여 실행시킴으로써 임의의 명령을 2 사이클의 기간으로 실행하는 단계를 포함한다.A conditional branch instruction execution method of the present invention comprises the steps of: supplying a conditional branch instruction that branches to control only if the condition is optionally met; When the condition of the conditional branch instruction is not satisfied, the program counter is incremented by "1" to decode and execute any instruction supplied following the conditional branch instruction to execute the arbitrary instruction in a period of two cycles. Steps.
본 발명의 콘디셔널 브랜치 명령수행 장치는 명령을 공급하면 명령 공급수단과, 명령 공급수단에 접속되어 공급되는 명령의 종류에 따라 제어신호를 발생하는 신호 발생수단과, 신호 발생수단에 접속되어 선택적으로 제어신호가 실행되지 않도록 하는 제1 절환수단과, 제1 절환수단에 접속되어 제1 절환수단의 출력신호를 지연시키는 지연수단과; 지연수단에 접속되어 선택적으로 지연수단으로부터의 신호를 선택적으로 절환하는 제2 절환수단과, 신호 발생수단에 접속되어 명령 조건에 따라 새로운 상태로 분기하도록 하는 분기 제어 수단과, 신호 발생수단과 분기 제어 수단에 공통 접속되어 분기 제어 수단으로부터의 신호를 선택적으로 지연시켜 상기 신호 발생수단과 분기 제어 수단에 공급하는 제2 지연수단을 구비한다.The conditional branch instruction execution device of the present invention is connected to a command supply means, a signal generation means for generating a control signal according to the type of command supplied and connected to the command supply means, and selectively connected to the signal generation means. First switching means for preventing a control signal from being executed, delay means for delaying an output signal of the first switching means connected to the first switching means; Second switching means connected to the delay means for selectively switching signals from the delay means, branch control means connected to the signal generating means for branching to a new state according to command conditions, signal generating means and branch control And second delay means, commonly connected to the means, for selectively delaying a signal from the branch control means and supplying the signal to the signal generating means and the branch control means.
상기 목적 외에 본 발명의 다른 목적 및 특징들은 첨부도면을 참조한 실시예에 대한 설명을 통하여 명백하게 드러나게 될 것이다.Other objects and features of the present invention in addition to the above objects will become apparent from the description of the embodiments with reference to the accompanying drawings.
이하, 도 7 내지 도 11을 참조하여 본 발명의 바람직한 실시예에 대하여 설명하기로 한다.Hereinafter, exemplary embodiments of the present invention will be described with reference to FIGS. 7 to 11.
도 7 및 도 8은 본 발명의 실시예에 따른 콘디셔널 브랜치 명령수행 방법 및 이를 이용한 명령수행 장치에서 4단계 파이프 라인의 조건부 분기(Conditional Branch) 명령을 수행하는 타이밍도를 도시한다.7 and 8 illustrate a method of executing a conditional branch instruction according to an embodiment of the present invention, and a timing diagram of performing a conditional branch instruction of a four-stage pipeline in an instruction execution apparatus using the same.
도 7 내지 도 8에 있어서, 통상의 DSP를 도시한 도 1을 결부하여 설명하기로 한다.7 to 8, a description will be given with reference to Fig. 1 showing a conventional DSP.
도 7 및 도 8을 참조하면, 본 발명의 콘디셔널 브랜치 명령수행 방법 및 이를 이용한 명령수행 장치에서 4단계 파이프 라인의 조건부 분기 명령은 분기 조건(Branch Condition)을 결정하는 사이클에서 만약 조건을 만족하면 현재 사이클에서 프로그램 카운터(205)에 번지(lk)를 싣는 명령을 발생시켜 다음 사이클에서 성공적으로 분기가 일어나면서 4사이클로 조건부 분기를 할 수 있다.7 and 8, in the conditional branch instruction execution method and the instruction execution apparatus using the same according to the present invention, if the conditional branch instruction of the four-stage pipeline is satisfied in the cycle of determining the branch condition, The instruction to load the address lk to the program counter 205 in the current cycle can be issued and the branch can be conditionally branched into four cycles with successful branching in the next cycle.
만약 조건을 만족하지 못하면 조건부 분기 명령에 이어지는 명령들을 차례로 실행시킨다.If the condition is not met, the instructions following the conditional branch instruction are executed in order.
도 9는 도 7 및 도 8의 조건부 분기 명령 실행을 DSP의 동작 상태에 따라 상세히 도시한 타이밍도이다.FIG. 9 is a timing diagram illustrating in detail the conditional branch instruction execution of FIGS. 7 and 8 according to an operation state of a DSP.
도 9를 참조하면, 신호의 흐름에 따라 각 스테이지(Stage)는 클럭의 1 사이클씩 구분하여 나타낸다.Referring to FIG. 9, each stage is represented by one cycle of a clock according to a signal flow.
도 9a는 조건부 분기를 만족할 때의 경우를 나타내고, 도 5b는 조건부 분기를 만족하지 않을 때의 경우를 나타낸다.9A shows the case when the conditional branch is satisfied, and FIG. 5B shows the case when the conditional branch is not satisfied.
제1 스테이지(Stage0)에서 프로그램 메모리(100)로부터 읽어 온 명령은 프로그램 데이터 버스(102)를 통해 제2 스테이지(Stage1)에서 디코더(700) 내의 명령 레지스터(IR)에 로드(Load)된다.(제1 단계 ; S1) PLA는 이 명령을 디코딩하기 시작하면서 출력된 PLA out이 클럭에 동기되어 제3 스테이지(Stage2) 동안 데이터 메모리(600)로부터 처리한 데이터를 읽어 오도록 하는 제어신호를 발생한다.(제2 단계 ; S2)The instruction read from the program memory 100 in the first stage Stage0 is loaded into the instruction register IR in the
제2 단계(S2)에서 공급된 제어신호 중 연산 처리 장치(304)로 공급되는 신호를 1 사이클 딜레이하여 제4 스테이지(Stage3)에서 연산을 수행한 다음 그 결과를 제5 스테이지(Stage4)에서 누산기(305)에 저장시킨다.(제3 단계 ; S3)Of the control signals supplied in the second step S2, the signal supplied to the arithmetic processing unit 304 is delayed by one cycle to perform the calculation in the fourth stage Stage3, and the result is accumulated in the fifth stage Stage4. 305. (3rd step; S3)
제2 스테이지(Stage1)에서 읽어 온 명령이 조건부 분기 명령이면, 제4 단계(S4)에서 조건부 분기 명령(Conditional Branch ; 이하 "CB"라 함)이 명령 레지스터(IR)에 실린다. CB가 PLA에서 디코딩되어 그에 따른 제어신호가 다음 사이클에 실리고(제5 단계 ; S5), 제3 스테이지(Stage2)에서 프로그램 버스에 실린 브렌치할 번지인 lk(Long Immediate) 값이 제4 스테이지(Stage3)에서 immdp라는 레지스터에 실린다.If the instruction read from the second stage Stage1 is a conditional branch instruction, a conditional branch instruction (hereinafter referred to as "CB") is loaded into the instruction register IR in the fourth step S4. The CB is decoded in the PLA so that a control signal according to it is carried out in the next cycle (S5; S5), and the lk (Long Immediate) value, which is the address to branch on the program bus in the third stage (Stage2), is the fourth stage (Stage3). ) Is placed in a register called immdp.
제4 스테이지(Stage3)에서, CB에 대한 PLA의 출력(PLA out)은 제6 단계(S6)에서 프로그램 카운터(205)에 데이터 버스(DB)에 실린 값을 로드(Load)하라는 제어신호를 발생시킨다. 제7 단계(S7)에서, immdp에 실린 분기한 번지 lk를 한 번 딜레이한 후 제8 단계(S8)에서 lk를 데이터 버스(DB)에 싣는다.In the fourth stage (Stage3), the output PLA of the CB to the CB generates a control signal for loading the value loaded on the data bus DB to the program counter 205 in the sixth step S6. Let's do it. In the seventh step S7, the branched address lk loaded in immdp is delayed once, and then in the eighth step S8, lk is loaded on the data bus DB.
제4 스테이지(Stage3)에서 누산기(304)를 참조하는 여러 조건들이 맞으면 제6 단계(S6)에서 준비된 데이터 버스(DB)에 실린 lk를 프로그램 카운터(205)에 저장하라는 명령에 따라 제9 단계(S9)에서 프로그램 카운터(205)에 분기할 번지인 lk가 실리게 된다.If the various conditions refer to the accumulator 304 in the fourth stage (Stage3) is met, the ninth step according to the instruction to store the lk carried on the data bus DB prepared in the sixth step (S6) to the program counter (205) In S9), the address lk which is to branch to the program counter 205 is loaded.
제10 단계(S10)에서, lk 번지에서 읽어 온 명령 코드는 제11 단계(S11)에서 디코딩되면서 실행된다.In a tenth step S10, the command code read from the lk address is executed while being decoded in the eleventh step S11.
이 때, 제12 단계(S12)에서 SACL 명령이 명령 레지스터(IR)에 실려서 디코딩되어 제5 스테이지(Stage4)에서 SACL 명령에 대한 PLA의 출력(PLA out)이 발생한다. 제13 단계(S13)에서, SACL 명령은 NOP(No Operation ; 수행 않음) 제어 코드로 치환되어 SACL과 그에 뒤이은 MAR 명령은 수행되지 않는다.At this time, in the twelfth step S12, the SACL command is loaded into the command register IR to be decoded to generate an output PLA of PLA for the SACL command in the fifth stage Stage4. In a thirteenth step S13, the SACL command is replaced with a NOP control code so that the SACL and the subsequent MAR command are not executed.
만약, 제5 스테이지(Stage4)에서 분기 조건을 만족시키지 않으면 제6 단계(S6)에서 발생한 제어신호인 "PC load from DB(데이터 버스의 값을 프로그램 카운터에 로드하도록 하는 제어신호)"가 "PC normal increase(프로그램 카운터의 정상적인 증가)"로 치환되고, 제12 단계(S12)에서 디코딩된 SACL 명령에 대한 PLA의 출력(PLA out)이 정상적으로 다음 사이클에서 제어신호로 사용될 수 있게 된다.If the branch condition is not satisfied in the fifth stage (Stage4), the "PC load from DB (control signal for loading the value of the data bus to the program counter)" control signal generated in the sixth step S6 is "PC". normal increase of the program counter ", and the PLA output of the PLA for the SACL instruction decoded in the twelfth step S12 can be normally used as a control signal in the next cycle.
도 10은 도 7 내지 도 9에서 설명한 4단계 파이프 라인의 구조를 구현한 본 발명의 콘디셔널 브랜치 명령수행 장치를 도시한다. 그리고 본 발명의 콘디셔널 브랜치 명령수행 방법 및 이를 이용한 명령의 조건부 분기 상태도는 도 11에 도시한다.FIG. 10 illustrates a conditional branch instruction execution device of the present invention implementing the structure of the four-stage pipeline described with reference to FIGS. 7 to 9. 11 shows a conditional branch instruction execution method and conditional branch state diagram of an instruction using the same.
도 10을 참조하면, 본 발명의 콘디셔널 브랜치 명령수행 장치는 명령 코드와 상태(Status)를 공급받아 여러 가지 명령어 타입들과 각 서브 블록에서 사용할 제어신호를 생성하는 PLA(2)와, PLA(2)에 접속되어 PLA(2)로부터 명령어와 현재의 상태(Status)신호를 공급받아 다음 스테이트(State)를 결정하는 유한 스테이트 머신(Finite State Machine ; 이하 "FSM"이라 함, 4)과, FSM(4)에 접속되어 FSM(4)의 출력신호를 클럭신호의 논리 값에 따라 지연시켜 상태(Status)신호를 PLA(2)와 FSM(4)에 피드백하여 공급하는 플립/플롭(6)을 구비한다.Referring to FIG. 10, the conditional branch instruction execution apparatus of the present invention receives a command code and a status and includes a PLA (2) for generating various command types and a control signal for use in each sub block, and a PLA ( 2) a finite state machine (hereinafter referred to as "FSM", 4), which receives a command and a current status signal from the PLA (2) and determines the next state. A flip / flop (6) connected to (4) to delay the output signal of the FSM (4) according to the logic value of the clock signal to feed back the status signal to the PLA (2) and the FSM (4). Equipped.
그리고 본 발명의 콘디셔널 브랜치 명령수행 장치는 PLA(2)에 접속되어 PLA(2)에서 발생하는 제어신호를 바로 사용할 것인가 또는 조건부 분기(Conditional Branch)의 조건이 만족되면, 노 오퍼레이션 제어 코드(No operation control code)로 치환할 것인가를 결정하는 제1 및 제2 멀티 플렉서(8,16)와, 제2 멀티 플렉서(16)의 출력단에 접속되어 제2 멀티 플렉서(16)의 출력신호를 클럭신호에 따라 딜레이시키는 제2 플립/플롭(14)과, 제2 플립/플롭(14)에 접속되어 조건부 분기 명령이 들어 왔을 때 조건이 맞지 않으면 프로그램 카운터를 "1" 증가시키는 명령을 출력하고, 조건이 만족하면 PLA(2)의 출력신호(PLAout)를 1 사이클 딜레이시킨 제어신호를 출력하는 제3 멀티 플렉서(12)를 구비한다.The conditional branch instruction execution device of the present invention is connected to the PLA (2) and immediately use the control signal generated from the PLA (2) or if the condition of the conditional branch (Conditional Branch) is satisfied, no operation control code (No an output signal of the
다음은 조건부 분기를 실행하는데 필요한 간략화된 PLA(2)의 소스(Source)를 나타낸다.The following shows the source of the
제1 스테이트(S1), opbc → type1, nobrtype, immdpfrompb, noimmdtodb, pcnormal -------------------- (SS1)First state (S1), opbc → type1, nobrtype, immdpfrompb, noimmdtodb, pcnormal -------------------- (SS1)
제2 스테이트(S2), opbc → type1, brtype1, instfrompb, immd16todb, pcfromdb -------------------- (SS2)Second state (S2), opbc → type1, brtype1, instfrompb, immd16todb, pcfromdb -------------------- (SS2)
도 10의 조건부 분기 상태도를 간략화한 FSM 소스는 아래와 같다.The simplified FSM source of the conditional branch state diagram of FIG. 10 is as follows.
type1, 제1 스테이트(S1) → 제2 스테이트(S2) -------- (SS3)type1, first state (S1) → second state (S2) -------- (SS3)
type1, 제2 스테이트(S2) → 제1 스테이트(S1) -------- (SS4)type1, second state (S2) → first state (S1) -------- (SS4)
PLA(2) 및 FSM(4)의 소스 (SS1),(SS2),(SS3),(SS4)에 있어서, "→"를 기준으로 좌측은 입력코드이고 우측은 출력코드를 나타낸다.In the sources (SS1), (SS2), (SS3), and (SS4) of the
디코딩 구간에서, PLA(2)에 공급되는 명령이 bc이면 (SS1)에서 type1, nobrtype, noimmdtodb, pcnormal 이라는 제어코드를 생성하여 PLAout으로 출력한다. 이 때, type1을 제외한 제어신호들은 하위 블록을 제어하거나 제2 플립/플롭(14)에서 1 사이클 딜레이된 후에 하위블럭을 제어하는 신호로 공급된다.In the decoding section, if the command supplied to the PLA (2) is bc (SS1) generates a control code of type1, nobrtype, noimmdtodb, pcnormal to output to PLAout. At this time, the control signals except for type1 are supplied as signals for controlling the lower block or after the one cycle delay in the second flip /
현재, 스테이트가 제1 스테이트(S1)이고 type1이었다면 FSM(4)의 출력 스테이트는 도 11에서의 상태도와 같이 FSM(4) 출력 FSMout은 제2 스테이트(S2)가 출력된다. 이 때 immdpfrompb라는 제어신호는 프로그램 버스에 실려 있는 값(lk)을 immdp라는 레지스터로 실으면서 명령 레지스터(IR)에 동시에 lk를 싣지 말도록 하는 명령코드이다.At present, if the state is the first state S1 and type1, the output state of the
따라서, 도 8에서와 같이, 명령 레지스터(IR)에는 2 사이클 동안 CB 코드가 실리게 된다. 이 때, 제2 스테이트(S2)이고 명령이 CB이면 PLA(2)는 (SS2)와 같은 제어신호를 발생한다. 이 단계가 도 9의 제4 스테이지(Stage3)에 해당된다. 이 단계에서의 제어신호는 분기할 어드레스 값인 lk를 프로그램 카운터에 싣도록하는 pcfromdb가 나오게 된다. (SS2)에서 나온 출력 값들 중 brtype이라는 제어 신호를 도 9에서 제5 스테이지(Stage4)에서 딜레이시켜서 보고 누산기의 조건을 확인한 다음 조건이 맞으면 조건만족(meetcond)이라는 제어신호를 활성화(Active)시킨다.Accordingly, as shown in FIG. 8, the CB code is loaded in the instruction register IR for two cycles. At this time, if the second state (S2) and the command is CB, PLA (2) generates a control signal such as (SS2). This step corresponds to the fourth stage Stage3 of FIG. 9. The control signal in this step comes out of pcfromdb which causes the program counter to load lk, which is an address value to branch to. Among the output values obtained from (SS2), a control signal called brtype is delayed in the fifth stage (Stage4) in FIG. 9 to confirm the condition of the accumulator, and when the condition is met, the control signal called metcond is activated.
meetcond 신호가 제1 내지 제3 멀티 플렉서(8,16,12)의 제어 신호로 공급되어 입력을 선택하게 한다.The meetcond signal is supplied to the control signals of the first to
도 9에서 제5 스테이지(Stage4)의 제어코드는 meetcond 신호를 보고 meetcond가 "1"이면 제1 및 제2 멀티 플렉서(8,16)에서 제1 입력신호(IN1)가 출력된다.In FIG. 9, when the control code of the fifth stage Stage4 sees the meetcond signal and the meetcond is “1”, the first input signal IN1 is output from the first and
제1 입력신호(IN1)에서 나오는 제어신호들은 type1, nobrtype, instnoload, noimmdtodb, pcnormal로 도 9의 제5 스테이지(Stage4)에서 나오는 SACL의 PLA(2)의 출력(PLAout)을 치환하게 되면서 제6 스테이지(Stage5)에서 프로그램 카운터의 정상상태 증가(PC+1)만을 제외하고는 모든 제어 신호들은 노 오퍼레이션(No operation)으로 바꿔진다.The control signals from the first input signal IN1 replace the output PLAout of the
따라서, 도 9에서 SACL 명령을 디코딩해서 나온 제5 스테이지(Stage4) PLAout은 사라지게 된다.Accordingly, the fifth stage Stage4 PLAout resulting from decoding the SACL instruction in FIG. 9 disappears.
meetcond 신호를 1 사이클 딜레이한 신호가 meetcondd이다. 이 신호가 활성화(Active)되면 도 9의 제1 및 제2 멀티 플렉서(8,16)의 출력을 제2 입력신호(IN2)로 설정시킨다. 제2 입력신호(IN2)들은 type1, nobrtype, instfrompb, noimmdtodb, pfcnormal로 도 9에서 제6 스테이지(Stage5)에서 다음 사이클(제7 스테이지 ; Stage6)에서 명령 레지스터(IR)에 실어 주면서 정상적인 파이프라인을 회복시켜준다.The meetcondd signal is one cycle delayed from the meetcond signal. When this signal is activated, the outputs of the first and
pfcnormal 제어신호는 프로그램 카운터(PC)를 "1"증가시킨다. 만일 도 9에서 제5 스테이지(Stage4)에서 분기 조건을 만족시키지 못하면 meetcond="0"으로 되면서 비활성화(Inactive)된다.The pfcnormal control signal increments the program counter "1". In FIG. 9, if the branch condition is not satisfied in the fifth stage (Stage4), meetcond = "0" is inactive.
이 때, 도 9의 제1 및 제2 멀티 플렉서(8,12)는 정상적으로 PLA(2)의 제1 출력신호(PLAoutp1)와 제2 출력신호(PLAoutp2)가 출력되고, 제3 멀티 플렉서(12)는 정상상태의 프로그램 카운터 증가(PC+1)를 출력하게 된다.At this time, the first and
따라서, 조건부 분기를 실행할 때 2번째 사이클에서 나오는 제어신호인 pcfromdb는 제3 멀티플렉서(12)에 의해 정상상태의 프로그램 카운터 증가(PC+1)로 바뀌면서 조건부 펫치(CB)에 이어 들어온 명령을 수행하게 된다.Therefore, when executing the conditional branch, pcfromdb, the control signal from the second cycle, is changed by the
상술한 바와 같이, 본 발명의 콘디셔널 브랜치 명령수행 방법 및 이를 이용한 명령수행 장치는 조건부 분기 명령을 빠르게 수행할 수 있다.As described above, the conditional branch instruction execution method and the instruction execution apparatus using the same of the present invention can quickly perform a conditional branch instruction.
이상 설명한 내용을 통해 당업자라면 본 발명의 기술사상을 일탈하지 아니하는 범위에서 다양한 변경 및 수정이 가능함을 알 수 있을 것이다. 따라서, 본 발명의 기술적 범위는 명세서의 상세한 설명에 기재된 내용으로 한정되는 것이 아니라 특허 청구의 범위에 의해 정하여 져야만 할 것이다.Those skilled in the art will appreciate that various changes and modifications can be made without departing from the technical spirit of the present invention. Therefore, the technical scope of the present invention should not be limited to the contents described in the detailed description of the specification but should be defined by the claims.
Claims (11)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
KR1019970040742A KR100292460B1 (en) | 1997-08-25 | 1997-08-25 | Method for executing conditional branch command and command executing device using the same |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
KR1019970040742A KR100292460B1 (en) | 1997-08-25 | 1997-08-25 | Method for executing conditional branch command and command executing device using the same |
Publications (2)
Publication Number | Publication Date |
---|---|
KR19990017727A KR19990017727A (en) | 1999-03-15 |
KR100292460B1 true KR100292460B1 (en) | 2001-09-17 |
Family
ID=37526290
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
KR1019970040742A KR100292460B1 (en) | 1997-08-25 | 1997-08-25 | Method for executing conditional branch command and command executing device using the same |
Country Status (1)
Country | Link |
---|---|
KR (1) | KR100292460B1 (en) |
-
1997
- 1997-08-25 KR KR1019970040742A patent/KR100292460B1/en not_active IP Right Cessation
Also Published As
Publication number | Publication date |
---|---|
KR19990017727A (en) | 1999-03-15 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US4399507A (en) | Instruction address stack in the data memory of an instruction-pipelined processor | |
US7174355B2 (en) | Random number generator with selectable dual random bit string engines | |
US8612726B2 (en) | Multi-cycle programmable processor with FSM implemented controller selectively altering functional units datapaths based on instruction type | |
US20070110239A1 (en) | Microprocessor including random number generator supporting operating system-independent multitasking operation | |
US7971040B2 (en) | Method and device for saving and restoring a set of registers of a microprocessor in an interruptible manner | |
KR19980069764A (en) | Instruction Scheduling Method and Processor Using Single Cycle Microinstruction | |
CA2142407A1 (en) | Re-configurable application specific device | |
US7139785B2 (en) | Apparatus and method for reducing sequential bit correlation in a random number generator | |
US4323964A (en) | CPU Employing micro programmable control for use in a data processing system | |
US5974498A (en) | Loading page register with page value in branch instruction for as fast access to memory extension as in-page access | |
US5410721A (en) | System and method for incrementing a program counter | |
US6986028B2 (en) | Repeat block with zero cycle overhead nesting | |
US20060179287A1 (en) | Apparatus for controlling multi-word stack operations in digital data processors | |
US5734927A (en) | System having registers for receiving data, registers for transmitting data, both at a different clock rate, and control circuitry for shifting the different clock rates | |
EP1450250B1 (en) | Random number generator with selectable dual random bit string engines | |
JPS63155336A (en) | Data processor | |
JP3479385B2 (en) | Information processing device | |
US7047396B1 (en) | Fixed length memory to memory arithmetic and architecture for a communications embedded processor system | |
US4896264A (en) | Microprocess with selective cache memory | |
KR100292460B1 (en) | Method for executing conditional branch command and command executing device using the same | |
JP2004038327A (en) | Data processor | |
KR100298552B1 (en) | Command decoding device | |
KR100240108B1 (en) | Execution method of branch instruction of digital signal processor | |
KR20080049727A (en) | Processor array with separate serial module | |
KR19990017121A (en) | Conditional branch instruction execution method of digital signal processor |
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: 20051201 Year of fee payment: 6 |
|
LAPS | Lapse due to unpaid annual fee |