资源简介
国外大学实现的MIPS模拟器,使用Java编写。国外大学实现的MIPS模拟器,使用Java编写。国外大学实现的MIPS模拟器,使用Java编写。国外大学实现的MIPS模拟器,使用Java编写。国外大学实现的MIPS模拟器,使用Java编写。国外大学实现的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
相关资源
- Java模拟拼图小游戏
- javafx实现模拟电梯升降
- Java操作系统课设之模拟进程管理系统
- 模拟xp设置时间日期属性界面的JAVA程
- Java Socket 编程模拟Ftp
- java 模拟进程调度
- java模拟风扇
- GBN网络协议模拟测试
- java项目实践之模拟电梯系统Java源码
- 银行排队模拟程序 Java课程设计 源代
- java页面置换算法的模拟实现
- 进程调度模拟-java图像界面
- 模拟CSMA/CD的过程
- 基于javaf808协议网关模拟器
- 基于赤字轮询的mm3队列模拟java代码
- JAVA 模拟时钟实验报告
- Java 实现的ATM模拟系统
- 模拟仿真“生产者-消费者”问题的解
- Java 电梯模拟程序 很逼真的电梯模拟
- httpclient 模拟登陆代码和jar包
- 课程设计模拟幸运52游戏java实现
- 模拟退火Java实现
- 一个模拟Windows的画图程序 java版
- 操作系统的模拟实现
- 操作系统课程设计——“生产者消费
- Tomasulo算法Java模拟器
- Android系统模拟触摸按键
- 操作系统进程状态模拟
- java,Eclipse,ATM自动柜台模拟系统
- MIPS反编译器与模拟器使用JAVA
评论
共有 条评论