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

Pipelined execution

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

PM0044

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Table 4.

Example with conventional number of cycles

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Address

Instruction

Decode

Execute

lgth

 

 

 

 

 

Time (cycle)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

cycles

cycles

1

2

3

4

5

6

7

8

9

10

11

12

 

13

14

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0xC000

LDW X, [$50.w]

4

3

3

 

D

E

E

E

E

 

 

 

 

 

 

 

 

 

 

 

 

 

 

F1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0xC003

ADDW X, #20

3

3

3

 

D

D

D

D

E

E

E

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

F2

 

 

 

 

 

 

 

 

 

 

 

 

 

0xC006

LD A, [$30].w

3

3

3

 

F3

 

 

D

D

D

D

E

E

E

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0xC009

….

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Table 5.

Legend

 

 

Symbol/Color

Definition

 

 

 

 

F

Fetch

 

 

 

 

D

Decode stalled

 

 

 

 

D

Decode

 

 

 

 

E

Execute

 

 

 

5.4.1Optimized pipeline example – execution from Flash Program memory

In the example shown in Table 6, the code is stored in the Flash Program memory (32-bit bus). As a result, 3 cycles are needed to fill the 96-bit prefetch buffer. At each cycle, one word is loaded and stored in F1, F2 and F3. The next fetch operation can start only when all the instructions contained in one of the Fx word are decoded. In fact, at cycle 9, the last instruction contained in F3 (SWAP A) is decoded, and a fetch operation can start to fill F3 word.

24/162

Doc ID 13590 Rev 3

PM0044

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Pipelined execution

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Table 6.

 

Optimized pipeline example - execution from Flash

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Add.

Instruction

Decod.

Exec.

lgth

 

 

 

 

 

 

Cycle

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

cycles

cycles

1

2

3

4

5

6

7

 

8

 

9

10

11

12

13

14

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0xC000

 

NEG A

1

1

1

 

D

E

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0xC001

XOR A, $10

1

1

2

F1

 

D

E

 

 

 

 

 

 

 

 

 

 

 

 

0xC003

LD A, #20

1

1

2

 

F2

 

D

E

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0xC005

SUB A,$1000

1

1

3

 

 

 

D

E

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0xC008

 

INC A

1

1

1

 

 

 

 

 

D

E

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0xC009

 

LD XL, A

1

1

1

 

 

F3

 

 

 

D

 

E

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0xC00A

 

SRL A

1

1

1

 

 

 

 

 

 

 

D

 

E

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0xC00B

 

SWAP A

1

1

1

 

 

 

 

 

 

 

 

 

 

D

E

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0xC00C

 

SLA $15

1

1

2

 

 

 

F1

 

 

 

 

 

 

 

D

E

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0xC00E

CP A,#$FE

1

1

2

 

 

 

 

 

 

 

 

 

 

 

D

E

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0xC010

MOV $100, #11

1

1

4

 

 

 

 

F2

 

 

 

 

 

 

 

 

D

E

 

0xC014

MOV $101, #22

1

1

4

 

 

 

 

 

 

 

 

 

F3

 

 

 

D

E

 

 

Table 7.

Legend

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Symbol/Color

 

 

 

 

 

 

 

Definition

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

F

 

 

 

 

 

 

 

 

 

Fetch

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

D

 

 

 

 

 

 

 

 

Decode

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

E

 

 

 

 

 

 

 

 

Execute

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Doc ID 13590 Rev 3

25/162

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