ÿþT o m a s u l o s s c h e m e
T h e a l g o r i t h m b a s e d o n t h e i d e a o f r e s e r v a t i o n s t a t i o n
T h e r e s e r v a t i o n s t a t i o n f e t c h e s a n d b u f f e r s a n o p e r a n d
a s s o o n a s i t i s a v a i l a b l e , e l i m i n a t i n g t h e n e e d t o g e t t h e
o p e r a n d f r o m a r e g i s t e r .
T h e u s e o f r e s e r v a t i o n s t a t i o n l e a d s t o t w o i m p o r t a n t
p r o p e r t i e s :
F i r s t , h a z a r d d e t e c t i o n a n d e x e c u t i o n c o n t r o l a r e d i s t r i b u t e d
t h e i n f o r m a t i o n h e l d i n t h e r e s e r v a t i o n s t a t i o n a t e a c h
f u n c t i o n a l u n i t d e t e r m i n e w h e n a n i n s t r u c t i o n c a n b e g i n
e x e c u t i o n a t t h a t u n i t ,
S e c o n d , r e s u l t s a r e p a s s e d d i r e c t l y t o f u n c t i o n a l u n i t s f r o m t h e
r e s e r v a t i o n s t a t i o n s w h e r e t h e y a r e b u f f e r e d ( b y p a s s i n g ) .
1
1
T h e b a s i c s t r u c t u r e o f a M I P S f l o a t i n g - p o i n t u n i t
2
2
T h r e e s t e p s o f i n s t r u c t i o n e x e c u t i o n
I s s u e g e t i n s t r u c t i o n f r o m t h e h e a d o f t h e i n s t r u c t i o n
q u e u e ( F I F O ) , i f t h e r e i s a m a t c h i n g r e s e r v a t i o n s t a t i o n t h a t
i s e m p t y , i s s u e t h e i n s t r u c t i o n t o t h e s t a t i o n w i t h t h e
o p e r a n d v a l u e , i f t h e y a r e c u r r e n t l y i n t h e r e g i s t e r ( t h i s
s t e p r e n a m e s r e g i s t e r s , e l i m i n a t i n g W A W a n d W A W ) .
E x e c u t e I f o n e o r m o r e o f t h e o p e r a n d s i s n o t y e t
a v a i l a b l e , m o n i t o r t h e c o m m o n d a t a b u s w h i l e w a i t i n g f o r i t
t o b e c o m p u t e d . W h e n a n o p e r a n d b e c o m e s a v a i l a b l e , i t i s
p l a c e d i n t o t h e c o r r e s p o n d i n g r e s e r v a t i o n s t a t i o n . W h e n
a l l o p e r a n d s a r e a v a i l a b l e , t h e o p e r a t i o n i s c a n b e
e x e c u t e d ( R A W h a z a r d a v o i d e d ) .
W r i t e r e s u l t w h e n t h e r e s u l t i s a v a i l a b l e , w r i t e i t o n t h e
C D B ( C o m m o n D a t a B u s ) a n d f r o m t h e r e i n t o t h e r e g i s t e r s
a n d i n t o a n y r e s e r v a t i o n s t a t i o n w a i t i n g f o r t h i s r e s u l t .
S t o r e s a l s o w r i t e d a t a t o m e m o r y . W h e n b o t h t h e a d d r e s s
a n d d a t a v a l u e a r e a v a i l a b l e , t h e y s e n t t o t h e m e m o r y u n i t
a n d t h e s t o r e i s c o m p l e t e s .
3
3
D a t a s t o r e d i n r e s e r v a t i o n s t a t i o n
O p t h e o p e r a t i o n t o p e r f o r m o n s o u r c e o p e r a n d s S 1 a n d S 2 ,
Q j , Q k a v a l u e o f z e r o i n d i c a t e s t h a t t h e s o u r c e o p e r a n d i s
a l r e a d y a v a i l a b l e i n V j o r V k , o r i s u n n e c e s s a r y ,
V j , V k t h e v a l u e o f s o u r c e o p e r a n d s , o n l y o n e o f t h e V f i e l d o r
t h e Q f i e l d i s v a l i d f o r e a c h o p e r a n d , f o r l o a d s , t h e V k f i e l d i s u s e d
t o h o l d t h e o f f s e t f i e l d ,
A u s e d t o h o l d i n f o r m a t i o n f o r t h e m e m o r y a d d r e s s c a l c u l a t i o n
( l o a d a n d s t o r e ) , i n i t i a l l y , t h e i n t e r m e d i a t e f i e l d i s s t o r e d , a f t e r
a d d r e s s c a l c u l a t i o n , t h e e f f e c t i v e a d d r e s s ,
B u s y i n d i c a t e s t h a t t h i s r e s e r v a t i o n s t a t i o n a n d i t s
a c c o m p a n y i n g f u n c t i o n a l u n i t i s o c c u p i e d ,
T h e n u m b e r o f r e s e r v a t i o n s t a t i o n t h a t c o n t a i n s t h e o p e r a t i o n
w h o s e r e s u l t s h o u l d b e s t o r e d i n t h e r e g i s t e r i s s a v e i n r e g i s t e r Q i
f i e l d ,
4
4
H o w i t w o r k s ?
L e t s c o n s i d e r t h e f o l l o w i n g e x a m p l e
L . D F 6 , 3 4 ( R 2 )
L . D F 2 , 4 5 ( R 3 )
M U L . D F 0 , F 2 , F 4
S U B . D F 8 , F 2 , F 6
D I V . D F 1 0 , F 0 , F 6
W A R
A D D . D F 6 , F 8 , F 2
A s s u m e t h e f o l l o w i n g l a t e n c i e s : l o a d 1 , a d d t w o , m u l t i p l y
1 0 , d i v i d e 4 0 c l o c k c y c l e s .
5
5
E x e c u t i o n S t a t u s w h e n f i r s t l o a d h a s c o m p l e t e d
I n s t r u c t i o n s t a t u s
I n s t r u c t i o n
I s s u e E x e c u t e W r i t e R e s u l t
v v v
L . D F 6 , 3 4 ( R 2 )
v v
L . D F 2 , 4 5 ( R 3 )
M U L . D F 0 , F 2 , F 4
S U B . D F 8 , F 2 , F 6
D I V . D F 1 0 , F 0 , F 6
A D D . D F 6 , F 8 , F 2
6
6
T h e S t a t e o f R e s e r v a t i o n s t a t i o n s
N a m e
B u s y O p V j V k Q j Q k A
N o
L o a d 1
4 5 + R e g s [ R 3 ]
Y e s L o a d
L o a d 2
M e m [ 3 4 + R e g s
Y e s S U B L o a d 2
A d d 1
[ R 2 ] ]
Y e s A D D A d d 1 L o a d 2
A d d 2
Y e s
A d d 3
R e g s [ F 4 ]
Y e s M U L L o a d 2
M u l t 1
M e m [ 3 4 + R e g s
Y e s D I V M u l t 1
M u l t 2
[ R 2 ] ]
R e g i s t e r s s t a t u s
F i e l d F 0 F 2 F 4 F 6 F 8 F 1 0 & & .
M u l t 1 L o a d 2 A d d 2 A d d 1 M u l t 2
Q i
7
7
A d v a n t a g e s o f T o m a s u l o s s c h e m e
" T h e d i s t r i b u t i o n o f t h e h a z a r d d e t e c t i o n l o g i c i f
m u l t i p l e i n s t r u c t i o n s a r e w a i t i n g o n a s i n g l e
r e s u l t , a n d e a c h i n s t r u c t i o n a l r e a d y h a s i t s o t h e r
o p e r a n d , t h e n t h e i n s t r u c t i o n c a n b e r e l e a s e d
s i m u l t a n e o u s l y b y t h e b r o a d c a s t o n t h e C D B
( C o m m o n D a t a B u s ) .
" T h e e l i m i n a t i o n o f s t a l l s f o r W A W a n d W A R
h a z a r d s b y r e n a m i n g r e g i s t e r s u s i n g r e s e r v a t i o n
s t a t i o n , a n d b y t h e p r o c e s s o f s t o r i n g o p e r a n d s
i n t o t h e r e s e r v a t i o n s t a t i o n a s s o o n a s t h e y a r e
a v a i l a b l e
8
8
E x e c u t i o n s t a t u s w h e n m u l t i p l e i s r e a d y t o
w r i t e i t s r e s u l t
I n s t r u c t i o n s t a t u s
I n s t r u c t i o n
I s s u e E x e c u t e W r i t e R e s u l t
v v v
L . D F 6 , 3 4 ( R 2 )
v v v
L . D F 2 , 4 5 ( R 3 )
v v
M U L . D F 0 , F 2 , F 4
v v v
S U B . D F 8 , F 2 , F 6
v
D I V . D F 1 0 , F 0 , F 6
v v v
A D D . D F 6 , F 8 , F 2
9
9
T h e S t a t e o f R e s e r v a t i o n s t a t i o n s
N a m e
B u s y O p V j V k Q j Q k A
N o
L o a d 1
N o
L o a d 2
N o
A d d 1
N o
A d d 2
N o
A d d 3
M e m [ 4 5 + R e g s R e g s [ F 4 ]
Y e s M U L
M u l t 1
[ R 3 ] ]
M e m [ 3 4 + R e g s
Y e s D I V M u l t 1
M u l t 2
[ R 2 ] ]
R e g i s t e r s s t a t u s
F i e l d F 0 F 2 F 4 F 6 F 8 F 1 0 &
M u l t 1 M u l t 2
Q i
1 0
1 0
A l o o p b a s e d e x a m p l e
L e t s c o n s i d e r t h e f o l l o w i n g e x a m p l e
L o o p : L . D F 0 , 0 ( R 1 )
M U L F 4 , F 0 , F 2
S . D F 4 , 0 ( R 1 )
D A D D U I R 1 , R 1 , - 8
B N E R 1 , R 2 , L o o p
L e t s a s s u m e t h a t w e p r e d i c t t h a t b r a n c h e s a r e t a k e n , t h e n
u s i n g r e s e r v a t i o n s t a t i o n w i l l a l l o w m u l t i p l e e x e c u t i o n o f
a b o v e l o o p t o p r o c e e d a t o n c e
1 1
1 1
A l l i n s t r u c t i o n s o f t w o s u c c e s s i v e i t e r a t i o n s a r e i s s u e d
I n s t r u c t i o n s t a t u s
I n s t r u c t i o n
F r o m I s s u e E x e c u t e W r i t e R e s u l t
i t e r a t i o n
1 v v
L . D F 0 , 0 ( R 1 )
1 v
M U L . D F 4 , F 0 , F 2
1 v
S . D F 4 , 0 ( R 1 )
2 v v
L . D F 0 , 0 ( R 1 )
2 v
M U L . D F 4 , F 0 , F 2
2 v
S . D F 4 , 0 ( R 1 )
1 2
1 2
T w o a c t i v e i t e r a t i o n s o f t h e l o o p w i t h n o
i n s t r u c t i o n y e t c o m p l e t e d
N a m e
B u s y O p V j V k Q j Q k A
L o a d 1 y e s L o a d R e g s [ R 1 ] + 0
L o a d 2 y e s L o a d R e g s [ R 1 ] - 8
A d d 1 n o
A d d 2 N o
A d d 3 N o
R e g s [ R 2 ]
M u l t 1 Y e s M U L L o a d 1
R e g s [ R 2 ]
M u l t 2 Y e s M U L L o a d 2
M u l t 1
S t o r e 1 Y e s S t o r e R e g s [ R 1 ] + 0
M u l t 2
S t o r e 2 Y e s S t o r e R e g s [ R 1 ] - 8
R e g i s t e r s s t a t u s
F i e l d
F 0 F 2 F 4 F 6 F 8 F 1 0 &
Q i l o a d 2 m u l t 2
1 3
1 3
Wyszukiwarka
Podobne podstrony:
IB wyk9Wyk9 termwyk9wyk9więcej podobnych podstron