Πίσω

Παράδειγμα 6:


ΔΡΑΣΤΗΡΙΟΤΗΤΑ

Δίνεται ο παρακάτω βρόχος. (Αγνοήστε προσωρινά τις πρώτες πέντε γραμμές που προηγούνται του βρόχου αυτού.)
.data
.word 0,0, ;0,2;2,0;-1,-2
.text
main: lw r2,$DATA(r0)
lw r3,$DATA +4(r0)
L: add r1,r2,r3
beqz r1,skipnext
subi r2,r2,#1
bnez r2,L
add r5,r3,r3
skipnext: addi r7,r1,#8
trap #0


Ανάλυση:



σσΤο παράδειγμα συμπεριφέρεται διαφορετικά για διαφορετικές τιμές εισόδου δεδομένων ( (0,0),(0,2),(2,0),(-1,-2) ), εστιάζοντας στις εξαρτήσεις ελέγχου μεταξύ των εντολών διακλάδωσης.




Περιπτώσεις:
0x1000:0
intOset:0

0x1000:0
intOset:2

0x1000:2
intOset:0

0x1000:-1
intOset:-2

Total:
  13 Cycle(s) executed.
  ID executed by 6 Instruction(s).
  2 Instruction(s) currently in Pipeline.

Harware configuration:
  Memory size: 32768 Bytes
  faddEX-Stages: 1,required Cycles:2
  fmulEX-Stages: 1,required Cycles:5
  fdivEX-Stages: 1,required Cycles:19
Forwarding enabled.

Stalls:
  RAW stalls: 3 (23.08% of all Cycles), thereof:
  LD stalls: 1 (33.33% of RAW stalls)
  Branch/Jump stalls: 1 (33.33% of RAW stalls)
  Floating point stalls: 1 (33.33% of RAW stalls)
  WAW stalls: 0 (00.00% of all Cycles)
  Structural stalls: 0 (00.00% of all Cycles)
  Control stalls: 1 (7.69% of all Cycles)
  Trap stalls: 3 (23.08% of all Cycles)
  Total: 7 Stall(s) (53.85% of all Cycles)

Conditional Branches:
  Total: 1 (16.67% of all Instructions), thereof:
  taken: 1 (100.00% of all cond. Branches)
  not taken: 0 (0.00% of all cond. Branches)

Load- / Store-Instructions:
  Total: 2 (33.33% of all Instructions), thereof:
  Loads: 2 (100.00% of Load-/Store-Instructions)
  Stores: 0 (0.00% of Load-/Store-Instructions)

Floating point stage instructions:
  Total: 0 (0.00% of all Instructions), thereof:
  Additions: 0 (0.00% of Floating point stage inst.)
  Multiplications: 0 (0.00% of Floating point stage inst.)
  Divisions: 0 (0.00% of Floating point stage inst.)

Traps:
  Traps:1 (16.67% of all Instructions)

Στην περίπτωση αυτή:



Total:
  27 Cycle(s) executed.
  ID executed by 14 Instruction(s).
  2 Instruction(s) currently in Pipeline.

Harware configuration:
  Memory size: 32768 Bytes
  faddEX-Stages: 1,required Cycles:2
  fmulEX-Stages: 1,required Cycles:5
  fdivEX-Stages: 1,required Cycles:19
Forwarding enabled.

Stalls:
  RAW stalls: 7 (25.92% of all Cycles), thereof:
  LD stalls: 1 (14.28% of RAW stalls)
  Branch/Jump stalls: 5 (71.43% of RAW stalls)
  Floating point stalls: 1 (14.28% of RAW stalls)
  WAW stalls: 0 (00.00% of all Cycles)
  Structural stalls: 0 (00.00% of all Cycles)
  Control stalls: 3 (11.11% of all Cycles)
  Trap stalls: 3 (11.11% of all Cycles)
  Total: 13 Stall(s) (48.15% of all Cycles)

Conditional Branches:
  Total: 5 (35.71% of all Instructions), thereof:
  TRUE-> taken: 3 (60.00% of all cond. Branches)
  FALSE-> not taken: 2 (40.00% of all cond. Branches)

Load- / Store-Instructions:
  Total: 2 (14.28% of all Instructions), thereof:
  Loads: 2 (100.00% of Load-/Store-Instructions)
  Stores: 0 (0.00% of Load-/Store-Instructions)

Floating point stage instructions:
  Total: 0 (0.00% of all Instructions), thereof:
  Additions: 0 (0.00% of Floating point stage inst.)
  Multiplications: 0 (0.00% of Floating point stage inst.)
  Divisions: 0 (0.00% of Floating point stage inst.)

Traps:
  Traps:1 (7.14% of all Instructions)

Στην περίπτωση αυτή:



Total:
  23 Cycle(s) executed.
  ID executed by 13 Instruction(s).
  2 Instruction(s) currently in Pipeline.

Harware configuration:
  Memory size: 32768 Bytes
  faddEX-Stages: 1,required Cycles:2
  fmulEX-Stages: 1,required Cycles:5
  fdivEX-Stages: 1,required Cycles:19
Forwarding enabled.

Stalls:
  RAW stalls: 6 (26.10% of all Cycles), thereof:
  LD stalls: 1 (16.67% of RAW stalls)
  Branch/Jump stalls: 4 (66.67% of RAW stalls)
  Floating point stalls: 1 (16.67% of RAW stalls)
  WAW stalls: 0 (00.00% of all Cycles)
  Structural stalls: 0 (00.00% of all Cycles)
  Control stalls: 1 (4.35% of all Cycles)
  Trap stalls: 3 (13.04% of all Cycles)
  Total: 10 Stall(s) (43.48% of all Cycles)

Conditional Branches:
  Total: 4 (30.77% of all Instructions), thereof:
  taken: 1 (25.00% of all cond. Branches)
  not taken: 3 (75.00% of all cond. Branches)

Load- / Store-Instructions:
  Total: 2 (15.38% of all Instructions), thereof:
  Loads: 2 (100.00% of Load-/Store-Instructions)
  Stores: 0 (0.00% of Load-/Store-Instructions)

Floating point stage instructions:
  Total: 0 (0.00% of all Instructions), thereof:
  Additions: 0 (0.00% of Floating point stage inst.)
  Multiplications: 0 (0.00% of Floating point stage inst.)
  Divisions: 0 (0.00% of Floating point stage inst.)

Traps:
  Traps:1 (7.69% of all Instructions)

Στην περίπτωση αυτή:



Total:
  400 Cycle(s) executed.
  ID executed by 299 Instruction(s).
  4 Instruction(s) currently in Pipeline.

Harware configuration:
  Memory size: 32768 Bytes
  faddEX-Stages: 1,required Cycles:2
  fmulEX-Stages: 1,required Cycles:5
  fdivEX-Stages: 1,required Cycles:19
Forwarding enabled.

Stalls:
  RAW stalls: 115 (28.75% of all Cycles), thereof:
  LD stalls: 1 (0.87% of RAW stalls)
  Branch/Jump stalls: 113 (98.26% of RAW stalls)
  Floating point stalls: 1 (0.87% of RAW stalls)
  WAW stalls: 0 (00.00% of all Cycles)
  Structural stalls: 0 (00.00% of all Cycles)
  Control stalls: 56 (14.00% of all Cycles)
  Trap stalls: 0 (0.00% of all Cycles)
  Total: 171 Stall(s) (42.75% of all Cycles)

Conditional Branches:
  Total: 113 (49.34% of all Instructions), thereof:
  taken: 56 (49.56% of all cond. Branches)
  not taken: 57 (50.44% of all cond. Branches)

Load- / Store-Instructions:
  Total: 2 (0.87% of all Instructions), thereof:
  Loads: 2 (100.00% of Load-/Store-Instructions)
  Stores: 0 (0.00% of Load-/Store-Instructions)

Floating point stage instructions:
  Total: 0 (0.00% of all Instructions), thereof:
  Additions: 0 (0.00% of Floating point stage inst.)
  Multiplications: 0 (0.00% of Floating point stage inst.)
  Divisions: 0 (0.00% of Floating point stage inst.)

Traps:
  Traps: 0 (0.00% of all Instructions)

Στην περίπτωση αυτή: