91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 21KB
    文件類型: .zip
    金幣: 1
    下載: 0 次
    發(fā)布日期: 2021-06-03
  • 語言: Java
  • 標(biāo)簽: MIPS??模擬??

資源簡介

國外大學(xué)實現(xiàn)的MIPS模擬器,使用Java編寫。國外大學(xué)實現(xiàn)的MIPS模擬器,使用Java編寫。國外大學(xué)實現(xiàn)的MIPS模擬器,使用Java編寫。國外大學(xué)實現(xiàn)的MIPS模擬器,使用Java編寫。國外大學(xué)實現(xiàn)的MIPS模擬器,使用Java編寫。國外大學(xué)實現(xiàn)的MIPS模擬器,使用Java編寫。

資源截圖

代碼片段和文件信息

import?java.util.*;
import?java.lang.*;
import?java.awt.*;

/**
?*?Decode?handles?the?operation?for?the?decode?stage?of?pipelined?execution.
?*/
class?Decode?extends?Stage?{
/**
?*?holds?the?Rd?of?the?last?three?instruction?to?detect?hazards
?*/
????private?Vector?hazardList;
????/**
?*?placeholder?for?an?instruction?that?is?stalled.
?*/
????private?Instruction?instructionSave;
????/**
?*?saves?the?program?counter?for?an?instruction?that?is?stalled.
?*/
????private?int?savePC;
????/**
?*?indicates?that?a?stall?has?been?issued.
?*/
????public?boolean?isStall;
????/**
?*?indicates?that?a?stall?has?been?detected.
?*/
????public?boolean?stallflag;
????/**
?*?indicates?whether?branches?are?assumed?taken?(not?used).
?*/
????public?boolean?assumeBranchTaken;
????/**
?*?indicates?whether?a?branch?instruction?was?taken?on?its?last?execution.
?*/
????public?boolean?branchPrediction;
????/**
?*?indicates?whether?forwarding?is?used.
?*/
????public?boolean?forwarding;
????/**
?*?table?used?to?predict?branches?(unused).
?*/
????public?Vector?branchTable;?

????/**
?*?initialzes?the?fields?of?the?object
?*/
????public?Decode()?{
???????super();
???????instructionSave?=?new?Instruction(“NOP“);
???????isStall?=?false;
???????assumeBranchTaken?=?true;???//?assume?branches?always?taken?(when?prediction?disabled)
???????hazardList?=?new?Vector(3);
???????branchTable?=?new?Vector();
???????hazardList.addElement(new?Integer(0));
???????hazardList.addElement(new?Integer(0));
???????hazardList.addElement(new?Integer(0));
????}

????/**
?*?process?the?current?instruction.??Implements?the?functionality?of?the?decode?stage?of?a?pipeline.
?*?Uses?a?vector?of?instructions?each?of?the?other?pipeline?stages?the?register?file?and?the
?*?ListBoxes?object.
?*?@see?Instruction
?*?@see?Fetch
?*?@see?Execute
?*?@see?Memory
?*?@see?WriteBack
?*?@see?MemoryType
?*?@see?Listboxes
?*/
????public?void?step(Vector?Instructions?MemoryType?regFile?
?????????????????????Memory?myMemory?WriteBack?myWriteBack
?????????????????????Fetch?myFetch?Execute?myExecute?ListBoxes?lb)?{

?????????String?str;

????????//?if?last?instruction?was?stalled?recall?stalled?instruction

????????if?(PC==Instructions.size())
???????????PC?=?-9;??//?this?is?actually?a?NOP?received?from?Fetch

????????if?(isStall?==?true)?{?????????????????????????????
????????????myInstruction?=?instructionSave;???
????????????PC?=?savePC;
????????}
????????
????????//--Check?for?RAW?hazards?in?pipeline;?ignore?NOP?instructions-----

????????//?check?RAW?hazard?for?rs

????????stallflag?=?false;
????????if?(?(?(?(myExecute.myInstruction.opcode?!=?0)?&&?
???????????????(myExecute.myInstruction.flush?==?false)?&&
???????????????(myInstruction.rs==
????????????????((Integer)?hazardList.elementAt(0)?).intValue()?))?||??
??????????????(?(myMemory.myInstruction.opcode?!=?0)?&&?
???????????????(myMem

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????10904??2000-08-11?10:11??Decode.java
?????文件????????6595??2000-08-11?10:11??Execute.java
?????文件????????1819??2000-08-11?10:11??Fetch.java
?????文件???????10524??2000-08-11?10:12??GUI.java
?????文件????????2602??2000-08-11?10:12??Help.java
?????文件????????9895??2000-08-11?10:12??Instruction.java
?????文件????????4451??2000-08-11?10:12??ListBoxes.java
?????文件????????2737??2000-08-11?10:12??Memory.java
?????文件????????1168??2000-08-11?10:13??MemoryType.java
?????文件????????4202??2000-08-11?10:13??Simulator.java
?????文件?????????843??2000-08-11?10:13??Stage.java
?????文件????????5679??2000-08-11?10:13??Stages.java
?????文件????????2578??2000-08-11?10:13??UI.java
?????文件????????3772??2000-08-11?10:13??WriteBack.java
?????文件????????7187??2000-09-07?12:08??mips.html

評論

共有 條評論