✅ Перевірена відповідь на це питання доступна нижче. Наші рішення, перевірені спільнотою, допомагають краще зрозуміти матеріал.
This type of hazard may occur when two adjacent instructions (i) and (j) save the result of their execution to the same resource (register, memory cell) and the time of the execution of the earlier instruction (i) is longer than the time of the execution instruction (j). It may cause an erroneous result of executing this sequence of instructions to be written into the resource. The typical way to remove such a dependency is to delay the completion of the execution instruction (j) until the execution of the instruction (i) is completed. To illustrate this problem, the following code will be used:
;WinMIPS64 WAW hazard example .dataA: .double 15.0B: .double 5.0C: .double 4.4D: .double 1.0E: .double 3.14.0res: .double 0.0 .textmain: l.d f2,A(r0) l.d f3,B(r0) l.d f4,C(r0) l.d f5,D(r0) l.d f6,E(r0) nop mul.d f6,f2,f4 sub.d f6,f2,f3 add.d f3,f6,f4
s.d f3,res(r0) halt
Note très importante ! Avant d’exécuter ce programme, assurez-vous que le mécanisme de transfert de données est désactivé . Si le transfert de données est activé, le matériel MIPS ne peut pas détecter, signaler et prévenir les risques liés aux courants d’arrêt automatiques (WAW).
Exécutez le programme d'exemple. Analysez le diagramme du cycle d'horloge et trouvez l'instruction qui provoque le blocage WAW.
Indiquez l'instruction qui a causé le risque de WAW.