Πίσω

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


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


Το παράδειγμα που ακολουθεί αναφέρεται σε εξαρτήσεις δεδομένων.
Δίνεται ο παρακάτω κώδικας.

.data
.word 2,0,100
.text
main: lw r1,$DATA(r0)
lw r4,$DATA +4(r0)
lw r2,$DATA +8(r0)
loop: add r4,r4,r2
sw $DATA(r0),r4
subi r1,r1,#1
bnez r1,loop
trap #0

Εξαρτήσεις δεδομένων μεταξύ του add και sw μέσω του r4 και του subi και bnez μέρω του r1.

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

0x1000:100
intOset:000
intOset:100

0x1000:200
intOset:000
intOset:100


Παρατηρήσεις:
Τα δεδομένα φορτώνονται στη θέση $DATA (αρχική τιμή 0χ1000).


Ανάλυση:

Αναφορά σε: Εξαρτήσεις δεδομένων


Total:
  20 Cycle(s) executed.
  ID executed by 12 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 (15.00% of all Cycles), thereof:
  LD stalls: 1 (33.00% of RAW stalls)
  Branch/Jump stalls: 2 (66.67% of RAW stalls)
  Floating point stalls: 0 (00.00% of RAW stalls)
  WAW stalls: 0 (00.00% of all Cycles)
  Structural stalls: 0 (00.00% of all Cycles)
  Control stalls: 1 (5.00% of all Cycles)
  Trap stalls: 3 (15.00% of all Cycles)
  Total: 7 Stall(s) (35.00% of all Cycles)

Conditional Branches:
  Total: 2 (16.67% of all Instructions), thereof:
  taken: 1 (50.00% of all cond. Branches)
  not taken: 1 (50.00% of all cond. Branches)

Load- / Store-Instructions:
  Total: 5 (41.67% of all Instructions), thereof:
  Loads: 3 (60.00% of Load-/Store-Instructions)
  Stores: 2 (40.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 (8.33% of all Instructions)

Τα στατιστικά αυτά είναι καθοριστικά για την καλύτερη κατανόηση της σωλήνωσης και θα αποτελέσουν πρότυπο για τις επόμενες αναλύσεις.

Αναφορά σε: Εξαρτήσεις δεδομένων