Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
97
Добавлен:
01.03.2016
Размер:
921.07 Кб
Скачать

Pipelined execution

PM0044

 

 

5.4.2Optimize pipeline example – execution from RAM

In the example shown in Table 8, the RAM is accessed through an 8-bit bus. As a result, 12 cycles are required to fill the 96-bit pre-fetch buffer. Every 4 cycles, one word is loaded and stored in Fx. The decoding of the first word instruction can start only when the Fx word is filled. This occurs for example till the 4th cycle, and the first instruction (NEG A) can be decoded only at the 5th cycle.

In case of read/write access to the RAM, the fetch is stalled. This occurs during the 6th cycle since RAM address 10 is read during the decode stage of XOR A, $10.

Table 8.

Optimize pipeline example – execution from RAM

 

 

 

 

 

 

 

 

 

 

 

 

Instruction

cyclesDecode

cyclesExecute

lgth

 

 

 

 

 

 

 

 

 

 

Cycle

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Add.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0xC000

 

NEG A

1

1

1

1_1

D

D

D

D

E

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

F

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0xC001

 

XOR A,

1

1

2

 

1_2

1_3

 

 

D

E

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

$10

 

 

 

 

F

F

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0xC003

 

LD A, #20

1

1

2

 

 

 

1_4

2_1

 

D

D

D

D

E

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

F

F

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0xC005

 

SUB

1

1

3

 

 

 

 

 

FS

2_2

2_3

2_4

 

D

E

 

 

 

 

 

 

 

 

 

 

 

A,$1000

 

 

 

 

 

 

 

 

 

F

F

F

 

 

 

 

 

 

 

 

 

 

 

 

0xC008

 

INC A

1

1

1

 

 

 

 

 

 

 

 

 

3_1

 

D

D

D

D

E

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

F

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0xC009

 

LD XL, A

1

1

1

 

 

 

 

 

 

 

 

 

 

FS

3_2

 

 

 

D

E

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

F

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0xC00A

 

SRL A

1

1

1

 

 

 

 

 

 

 

 

 

 

 

 

3_3

 

 

 

D

E

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

F

 

 

 

 

 

 

 

 

0xC00B

 

SWAP A

1

1

1

 

 

 

 

 

 

 

 

 

 

 

 

 

3_4

 

 

 

D

E

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

F

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0xC00C

 

SLA $15

1

1

2

 

 

 

 

 

 

 

 

 

 

 

 

 

 

1_1

1_2

 

 

D

E

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

F

F

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0xC00E

 

CP

1

1

2

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

1_3

1_4

 

D

E

 

 

A,#$FE

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

F

F

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Table 9.

Legend

 

 

Symbol/Color

Definition

 

 

 

 

F

Fetch

 

 

 

 

FS

Fetch stalled

 

 

 

 

D

Decode

 

 

 

 

D

Decode stalled

 

 

 

 

E

Execute

 

 

 

26/162

Doc ID 13590 Rev 3

Соседние файлы в папке Минимум документации STM8