# US 2016/0259647 A1 · Instruction fetch device and instruction fetching method

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2016/0259647 A1
- Document ID: US20160259647A1
- Status: Published application
- Kind: A1
- Application number: 14/668,160
- Filed: 2015-03-25
- Published: 2016-09-08
- Earliest claimed: 2015-03-03
- Assignees: Advanced Digital Chips Inc.
- Applicants: Advanced Digital Chips Inc.
- Inventors: Sang Wan Kim; Young Ho Cha; Kwan Young Kim; Byung Gueon Min
- Web page: https://patentgrep.com/patent/US20160259647A1

## CPC

- G06F 9/3806: {using address prediction, e.g. return stack, branch history buffer}
- G06F 9/32: Address formation of the next instruction, e.g. by incrementing the instruction counter (G06F9/38 takes precedence)
- G06F 9/321: {Program or instruction counter, e.g. incrementing}
- G06F 9/355: Indexed addressing
- G06F 9/3557: {using program counter as base address}
- G06F 9/3814: {Implementation provisions of instruction buffers, e.g. prefetch buffer; banks}
- G06F 9/3802: {Instruction prefetching}
- G06F 9/3804: {for branches, e.g. hedging, branch folding}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Provided is an instruction fetch device including a plurality of PC buffers which store addresses of next to-be-executed instructions in respective branches; a plurality of instruction buffers which store to-be-executed instructions and indexes of the PC buffers associated with the respective instructions among the PC buffers; and a fetch unit which fetches the to-be-executed instructions one by one from a program memory to sequentially store the fetched to-be-executed instructions in the instruction buffers and represents the next to-be-executed instruction in a current branch by using the PC buffer hiving one index among the PC buffers before branch prediction is hit, wherein the number of the PC buffers is less than the number of the instruction buffers.

## Claims

### Claim 1

An instruction fetch device comprising:
a plurality of PC buffers which store addresses of next to-be-executed instructions in respective branches;
a plurality of instruction buffers which store to-be-executed instructions and indexes of the PC buffers associated with the respective instructions among the PC buffers; and
a fetch unit which fetches the to-be-executed instructions one by one from a program memory to sequentially store the fetched to-be-executed instructions in the instruction buffers and represents the next to-be-executed instruction in a current branch by using the PC buffer having one index among the PC buffers before branch prediction is hit,
wherein the number of the PC buffers is less than the number of the instruction buffers.

### Claim 2 (depends on 1)

The instruction fetch device according to claim 1, wherein before the branch prediction is hit, if there is an execution-completed instruction among the instructions in the instruction buffers, every time there is the execution-completed instruction, the fetch unit represents the address of the next to-be-executed instruction by the PC buffer having the one index by increasing an address of the instruction in the PC buffer having the one index by a size of the respective instructions.

### Claim 3 (depends on 1)

The instruction fetch device according to claim 1, wherein if the branch prediction is hit, the fetch unit represents the address of the next to-be-executed instruction in the current branch by using the PC buffer having the other index following the one index.

### Claim 4 (depends on 1)

The instruction fetch device according to claim 1, wherein each of the PC buffers includes a fourth field which stores the address of the instruction which is distinguished by the index and is next to be executed in each branch and a fifth field which stores a user bit representing whether or not the PC buffer is in use.

### Claim 5 (depends on 1)

The instruction fetch device according to claim 1, wherein each of the instruction buffers includes a first field which stores the to-be-executed instructions, a second field which stores the index of the PC buffer associated with the instructions in the first field, and a third field which represents validity of the instruction in the first field.

### Claim 6 (depends on 1)

The instruction fetch device according to claim 1, wherein if at least one of the PC buffers and the instruction buffers is full, the fetch unit stops fetching the to-be-executed instruction from the program memory until the PC buffers and the instruction buffers are not full as the instruction in at least one of the instruction buffers is executed.

### Claim 7 (depends on 6)

The instruction fetch device according to claim 6, wherein if the execution of one of the instructions in the Instruction buffers is completed, the fetch unit disables a valid bit of a current instruction buffer storing the execution-completed instruction and determines whether or not an index of the PC buffer of a next instruction buffer storing a next instruction of the execution-completed instruction is changed.

### Claim 8 (depends on 7)

The instruction fetch device according to claim 7, wherein if it is determined that the index of the PC buffer of the next instruction buffer is changed, the fetch unit represents use completion of the current PC buffer designated by the current instruction buffer and represents the next to-be-executed instruction in the current branch using a next PC buffer designated by the next instruction buffer.

### Claim 9

An instruction fetching method using a plurality of PC buffers which store addresses of next to-be-executed instructions in respective branches by one fetch processor and a plurality of instruction buffers which store to-be-executed instructions and indexes of the PC buffers associated with the respective instructions among the PC buffers, the number of the instruction buffers being larger than the number of the PC buffers, comprising:
fetching the to-be-executed instructions one by one from a program memory if the PC buffers and the instruction buffers are not full; and
representing a next to-be-executed instruction in a current branch by using one PC buffer designated by one index among the PC buffers if branch prediction is not hit.

### Claim 10 (depends on 9)

The instruction fetching method according to claim 9, wherein the fetching includes, if at least one of the PC buffers and the instruction buffers is full, stopping fetching the to-be-executed instruction from the program memory until the PC buffers and the instruction buffers are not full as the instruction in at least one of the instruction buffers is executed.

### Claim 11 (depends on 10)

The instruction fetching method according to claim 10, further comprising:
if the execution of one of the instructions in the Instruction buffers is completed, disabling a valid bit of a current instruction buffer storing the execution-completed instruction; and
determining whether or not the index of the PC buffer of a next instruction buffer storing a next instruction of the execution-completed instruction is changed.

### Claim 12 (depends on 11)

The instruction fetching method according to claim 11, wherein the determining includes:
if it is determined that the index of the PC buffer of the next instruction buffer is changed, representing use completion of a current PC buffer designated by the current instruction buffer; and
representing the next to-be-executed instruction in the current branch by using a next PC buffer designated by the next instruction buffer.

### Claim 13 (depends on 9)

The instruction fetching method according to claim 9, wherein the representing includes:
if there is an execution-completed instruction among the instructions in the instruction buffers, every time there is the execution-completed instruction, representing the address of the next to-be-executed instruction by the PC buffer having the one index by increasing an address of the instruction in the PC buffer having the one index by a size of the respective instruction.
