isa multiple data transfer (3a)€¦ · 2019-08-21 · multiple data transfer 3 young won lim...
TRANSCRIPT
Young Won Lim8/21/19
ISA Multiple Data Transfer (3A)
Young Won Lim8/21/19
Copyright (c) 2014 - 2019 Young W. Lim.
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".
Please send corrections (or suggestions) to [email protected].
This document was produced by using LibreOffice.
ISA (3A)Multiple Data Transfer
3 Young Won Lim8/21/19
Based on
ARM System-on-Chip Architecture, 2nd ed, Steve Furber
ISA (3A)Multiple Data Transfer
4 Young Won Lim8/21/19
Ascending / Descending Stack
FullAscending Stack
EmptyAscending Stack
FullDescending Stack
EmptyDescending Stack
STMFALDMFA
STMFDLDMFD
STMEALDMEA
STMEDLDMED
ISA (3A)Multiple Data Transfer
5 Young Won Lim8/21/19
Ascending Stack – Store / Load
r8
High
Low
FullAscending Stack
r1r0
r8’ High
Low
3 PUSH operations STM
3 POP operations LDM
r8
High
Low
EmptyAscending Stack 3 PUSH
operations STMr4r1r0
r8’ High
Low3 POP operations LDM
r4
ISA (3A)Multiple Data Transfer
6 Young Won Lim8/21/19
Descending Stack – Store / Load
r8
High
Low
r4r1r0r8’
High
Low
FullDescending Stack 3 PUSH
operations STM
3 POP operations LDM
r8
High
Low
r4r1r0
r8’
High
Low
EmptyDescending Stack 3 PUSH
operations STM
3 POP operations LDM
ISA (3A)Multiple Data Transfer
7 Young Won Lim8/21/19
Ascending / Descending Stack & Increment / Decrement
FullAscending
EmptyAscending
FullDescending
EmptyDescending
Increment Before ST
Decrement After LD
Increment After ST
Decrement Before LD
Decrement Before ST
Increment After LD
Decrement After ST
Increment Before LD
STMFALDMFA
STMFDLDMFD
STMEALDMEA
STMEDLDMED
next - vacant
current - occupied
current - vacant
previous - occupied
next - vacant
current - occupied
current - vacant
previous - occupied
ISA (3A)Multiple Data Transfer
8 Young Won Lim8/21/19
Ascending stack – Increment / Decrement
r8
High
Low
FullAscending Stack
r1r0
r8’
Low
3 PUSH operations STM
3 POP operations LDM
Increment Before ST
Decrement After LD
r4
r8
High
Low
EmptyAscending Stack 3 PUSH
operations STMr4r1
r8’ High
Low3 POP operations LDM
Increment After ST
Decrement Before LD
r0
ISA (3A)Multiple Data Transfer
9 Young Won Lim8/21/19
Descending Stack – Increment / Decrement
r8
High
Low
r4r1r0r8’
High
FullDescending Stack 3 PUSH
operations STM
3 POP operations LDM
Decrement Before ST
Increment After LD
r8
High
Low
r1r0
r8’
High
Low
EmptyDescending Stack
r4
3 PUSH operations STM
3 POP operations LDM
Decrement After ST
Increment Before LD
ISA (3A)Multiple Data Transfer
10 Young Won Lim8/21/19
Stack and Block Copy Views
FullAscending
EmptyAscending
FullDescending
EmptyDescending
STMFALDMFA
STMFDLDMFD
STMEALDMEA
STMEDLDMED
next - vacant
current - occupied
current - vacant
previous - occupied
next - vacant
current - occupied
current - vacant
previous - occupied
STMIBLDMDA
STMIALDMDB
STMDBLDMIA
STMDALDMIB
Stack View Block Copy View
ISA (3A)Multiple Data Transfer
11 Young Won Lim8/21/19
Ascending Stack – Equivalent Operations
r8
High
Low
FullAscending Stack
r1r0
r8’
Low
r4
r8
High
Low
EmptyAscending Stack
r4r1
r8’ High
Low
r0
STMFA
LDMDA
STMEA
LDMDB
STMIB
STMIA
LDMFA
LDMEA
ISA (3A)Multiple Data Transfer
12 Young Won Lim8/21/19
Descending Stack – Equivalent Operations
r8
High
Low
r4r1r0r8’
High
FullDescending Stack STMFD
LDMIA
r8
High
Low
r1r0
r8’
High
Low
EmptyDescending Stack
r4
STMED
LDMIB
STMDB
STMDA
LDMFD
LDMED
ISA (3A)Multiple Data Transfer
13 Young Won Lim8/21/19
Stack and Block Copy Views
STMFA LDMED
STMFD
STMEA LDMFD
STMED
STMIB LDMIB
STMIA LDMIA
STMDB
STMDALDMFA
LDMEA
LDMDA
LDMDB
Full Empty Full Empty
Ascending Descending
After
Before
After
Before
Decrement
Increment
ISA (3A)Multiple Data Transfer
14 Young Won Lim8/21/19
(Empty / Full) and (Before / After)
STM Empty A/D
empty
LDM Full A/D
occupied
STM AfterI/D
Inc / dec later
LDM BeforeI/D
Inc / dec before
Ascend
Descend
Inc
Dec□ = □ =
STM Full A/D
occupied
STM Before I/D
Inc / dec before
LDM Empty A/D
empty
LDM AfterI/D
Inc / dec later
ISA (3A)Multiple Data Transfer
15 Young Won Lim8/21/19
(F_ / E_) and (_B / _A) reasoning
If the stack top is full then inc / dec the stack pointerbefore storing a new element
If the stack top is full then inc / dec the stack pointerafter getting an element
STMF□ STM□B
LDMF□ LDM□A
Ascend
Descend
Inc
Dec□ = □ =
If the stack top is empty then inc / dec the stack pointer after storing a new element
STME□ STM□A
If the stack top is empty then inc / dec the stack pointer before getting an element
LDME□ LDM□B
ISA (3A)Multiple Data Transfer
16 Young Won Lim8/21/19
(Ascend / Descend) and (Increment / Decrement)
STM DescendF/E
PUSH
LDM AscendF/E
POP
STM AscendF/E
PUSH
LDM DescendF/E
POP
STM Dec B/A
the same direction
LDM Inc B/A
the opposite direction
STM Inc B/A
the same direction
LDM Dec B/A
the opposite direction
Full
Empty
Before
After□ = □ =
ISA (3A)Multiple Data Transfer
17 Young Won Lim8/21/19
(_A / _D) and (I_ / D_) reasoning
To push onto the ascending stack
To push onto the descending stack
To pop from the ascending stack
To popfrom the descending stack
Increment the stack top pointer
Decrement the stack top pointer
Decrement the stack top pointer
Increment the stack top pointer
STM□A STMI□
STM□D STMD□
LDM□A LDMD□
LDM□D LDMI□
Full
Empty
Before
After□ = □ =
ISA (3A)Multiple Data Transfer
18 Young Won Lim8/21/19
STM / LDM Equivalence Summary
Ascend Inc
Descend Dec
Ascend Inc
Descend Dec
STM
LDM
STM
LDM
PUSH
PUSH
POP
POP
the same direction
the same direction
the opposite direction
the opposite direction
Full Before
Full Before
occupied Inc / dec before
occupied Inc / dec before
Empty Afterempty Inc / dec later
Empty Afterempty Inc / dec later
ISA (3A)Multiple Data Transfer
19 Young Won Lim8/21/19
Stack View – (STM,LDM) x (F,E) x (A,D)
newly stored
STMFA
newly stored
LDMFD
STMFD
FULL
FULL
FULL
Ascend
Descend
Descend
newly retrieved
LDMFA
FULL Ascend
newly stored
STMEA
newly retrieved
newly stored
LDMED
STMED
EMPTY
EMPTY
EMPTY
Ascend
Descend
Descend
newly retrieved
LDMEA
EMPTY Ascend
newly retrieved
ISA (3A)Multiple Data Transfer
20 Young Won Lim8/21/19
Block Copy View – (STM,LDM) x (I, D) x (B,A)
newly stored
newly stored
newly retrieved
LDMDB
STMIB
STMIA
newly retrieved
newly retrieved
newly stored
LDMIA
LDMIB
STMDA
INC
INC
INC
DEC
INC
DEC
Before
After
After
Before
Before
After
newly stored
STMDBDEC Before
LDMDADEC After
newly retrieved
ISA (3A)Multiple Data Transfer
21 Young Won Lim8/21/19
Block copy view Stack view
Ascending
LDMED
Descending
Ascending
LDMFD
Descending
STMIB
LDMIB
STMIA
LDMIA
STMDB
STMDA
LDMFA
LDMEA
LDMDA
LDMDB
STMFA
STMFD
STMEA
STMED
Full
Full
Empty
Empty
Descending
Ascending
Descending
Ascending
Empty
Empty
Full
Full
PUSH
PUSH
PUSH
PUSH
POP
POP
POP
POP
Inc Before ST
Dec Before ST
Inc After ST
Dec After ST
Inc Before LD
Dec Before LD
Inc After LD
Dec Before LD
ISA (3A)Multiple Data Transfer
22 Young Won Lim8/21/19
Stack view Block copy view
Ascending
LDMED
Descending
Ascending
LDMFD
Descending
STMIB
LDMIB
STMIA
LDMIA
STMDB
STMDA
LDMFA
LDMEA
LDMDA
LDMDB
STMFA
STMFD
STMEA
STMED
Full
Full
Empty
Empty
Descending
Ascending
Descending
Ascending
Empty
Empty
Full
Full
PUSH
PUSH
PUSH
PUSH
POP
POP
POP
POP
Inc Before ST
Dec Before ST
Inc After ST
Dec After ST
Inc Before LD
Dec Before LD
Inc After LD
Dec Before LD
ISA (3A)Multiple Data Transfer
23 Young Won Lim8/21/19
STM Equivalent Operations – (I,D) x (B,A)
IncreasingAfter ST
DecreasingAfter ST
EmptyAscending
IA = EA
DA = ED
EmptyDescending
STM
STM
IncreasingBefore ST
DecreasingBefore ST
FullAscending
IB = FA
DB = FD
FullDescending
STM
STM
ISA (3A)Multiple Data Transfer
24 Young Won Lim8/21/19
LDM Equivalent Operations – (I,D) x (B,A)
IncreasingAfter LD IA =
FD
FullDescendingLDM
IncreasingBefore LD IB =
ED
EmptyDescendingLDM
DecreasingAfter LD DA =
FA
FullAscendingLDM
DecreasingBefore LD DB =
EA
EmptyAscendingLDM
ISA (3A)Multiple Data Transfer
25 Young Won Lim8/21/19
(STM, LDM) x (I, D) x (B, A) orders
Ascending Stack PUSH Descending Stack PUSH
Ascending Stack POP
STMIA
STMEA
STMDB
LDMDB
STMFD
LDMEA
Descending Stack POP
LDMIA
LDMFD
STMIB
STMFA
LDMIB
LDMED
STMDA
LDMDA
STMED
LDMFA
decrement First
Load First
Increment First
Load First
Store First
decrement First
Increment First
Store First
ISA (3A)Multiple Data Transfer
26 Young Won Lim8/21/19
(STM, LDM) x (F, E) x (A, D) orders
Empty Top PUSH
STMIA STMDA
STMEA STMED
Empty Top POP
LDMIBLDMDB
LDMEDLDMEA
Full Top PUSH
Full Top POP
STMDB
LDMDA
STMIB
LDMIA
STMFD
LDMFA
STMFA
LDMFD
Increment First
decrement First
Load First
Load First
Store First
Store First
decrement First
Increment First
ISA (3A)Multiple Data Transfer
27 Young Won Lim8/21/19
(STM, LDM) x (I, D) x (B, A) orders
D B
F D
decrement before
full descending
E A
D B
empty ascending
decrement before
I B
F A
increment before
full ascending
STMSTM
STM
LDM
STM
LDM
Ascending Stack PUSH Descending Stack PUSH
Ascending Stack POP
I B
E D
increment before
empty descending
LDMLDM
Descending Stack POP
I A
E A
increment after
empty ascending
I A
F D
increment after
full descending
D A
E D
decrement after
empty descending
F A
D Adecrement after
full ascending
ISA (3A)Multiple Data Transfer
28 Young Won Lim8/21/19
(STM, LDM) x (E, F) x (A, D) orders
D A
E D
D B
F D
decrement after decrement before
empty descending full descending
E A F A
D AD Bdecrement after
empty ascending full ascending
decrement before
I A
E A
increment after
empty ascending
STMSTM
STM
LDM
STM
LDM
Empty Top PUSH Full Top PUSH
Full Top POP
I B
E D
increment before
empty descending
LDMLDM
Empty Top POP
I B
F A
increment before
full ascending
I A
F D
increment after
full descending
ISA (3A)Multiple Data Transfer
29 Young Won Lim8/21/19
STM in the same direction : (Inc – Asc), (Dec – Dsc)
I A
E A
D A
E D
increment after
decrement after
empty ascending
empty descending
I B
F A
D B
F D
increment before
full ascending
decrement before
full descending
FULL EMPTY
Descending
Ascending
ISA (3A)Multiple Data Transfer
30 Young Won Lim8/21/19
LDM in the opposite direction : (Inc – Dsc), (Dec – Asc)
F A
D A
decrement after
full ascending
I A
F D
increment after
full descending
FULL
Ascending
Descending
E A
D B
empty ascending
decrement before
I B
E D
increment before
empty descending
EMPTY
ISA (3A)Multiple Data Transfer
31 Young Won Lim8/21/19
Equivalence – (STM, LDM) x (I, D) x (B, A)
STMIA
STMEA
STMDB
LDMDB
STMFD
LDMEA
LDMIA
LDMFD
STMIB
STMFA
LDMIB
LDMED
STMDA
LDMDA
STMED
LDMFA
Store First
Increment First
decrement First
Store First
Load First
Increment First
decrement First
Load First
ISA (3A)Multiple Data Transfer
32 Young Won Lim8/21/19
Equivalence – (STM, LDM) x (F, E) x (A, D)
STMIA
STMEA
STMDB
LDMDB
STMFD
LDMEA
STMIB
STMFA
STMDA
LDMDA
STMED
LDMFA
LDMIB
LDMED
LDMIA
LDMFD
Store First
Increment First
decrement First
Store First
Load First
Increment First
decrement First
Load First
ISA (3A)Multiple Data Transfer
33 Young Won Lim8/21/19
Stack view – (STM, LDM) x (I, D) x (B, A)
STMIA
STMEA
STMDB
LDMDB
STMFD
LDMEA
LDMIA
LDMFD
STMIB
STMFA
LDMIB
LDMED
STMDA
LDMDA
STMED
LDMFA
Ascending Descending
Descending Ascending
FULL EMPTY
FULLEMPTY
FULL
EMPTY
EMPTY
FULL
ISA (3A)Multiple Data Transfer
34 Young Won Lim8/21/19
Stack view – (STM, LDM) x (F, E) x (A, D)
STMIA
STMEA
STMDB
LDMDB
STMFD
LDMEA
STMIB
STMFA
STMDA
LDMDA
STMED
LDMFA
Ascending Descending
Ascending Descending
LDMIB
LDMED
LDMIA
LDMFD
FULL EMPTY
FULL EMPTY
FULL
FULL
EMPTY
EMPTY
ISA (3A)Multiple Data Transfer
35 Young Won Lim8/21/19
Equivalent & Complementary Relations – (I,D) x(B, A)
STMIB STMFA
LDMIB LDMED
STMIA
LDMIA
STMEA
LDMFD
STMDB
LDMDB
STMFD
LDMEA
STMDA
LDMDA
STMED
LDMFA
equivalent
equivalent
equivalent
equivalent
equivalent
equivalent
equivalent
equivalent
com
plem
ent
com
plem
ent
com
plem
ent
com
plem
ent
ISA (3A)Multiple Data Transfer
36 Young Won Lim8/21/19
Equivalent & Complementary Relations – (F,E) x (A,D)
STM I B STMFA STM I A STMEA
STMDB
LDMDB
STMFD
LDMEA
STMDA
LDMDA
STMED
LDMFA
LDM I B LDMEDLDM I A LDMFD
equivalent
equivalent
equivalent
equivalent
equivalent
equivalent
equivalent
equivalent
com
plem
ent
com
plem
ent
com
plem
ent
com
plem
ent
ISA (3A)Multiple Data Transfer
37 Young Won Lim8/21/19
References
[1] ftp://ftp.geoinfo.tuwien.ac.at/navratil/HaskellTutorial.pdf[2] https://www.umiacs.umd.edu/~hal/docs/daume02yaht.pdf