资源简介
国外大学实现的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)
- jsp模拟酷狗官网源码(附数据库)
- Html5模拟android上拉/下拉刷新需要的
- Android 模拟器 Genymotion 安装配置与 A
- 网上超市购物结算功能模拟 java实现
- 用Java实现的一个模拟的银行系统
- JSP银行模拟转账系统
- Java设计模式刘伟书本中模拟考试答案
- javaSe模拟电子商务系统
- 《Java设计模式》刘伟 课后习题及模拟
- 十字路口交通灯模拟仿真
- 模拟手机通信录管理系统JAVA
- HTTP服务端接口模拟工具-HttpServerMock
- 基于AutoCAD的FLAC3D断层模拟快速建模方
- genymotion-3.1.0.dmg
- JAVA 网上超市购物结算功能模拟 福州
- Java模拟操作系统实验之四种进程调度
- 通话记录模拟生成程序
- 一个辅助打卡的模拟软件
- JavaGUI+JDBC模拟ATM项目
- SQLite Demo——学生信息管理系统andro
- 模拟登录教务系统 抓取课表和成绩
- 模拟登录教务系统 抓取课表和成绩
- android studio模拟器运行所需软件Intel
- java股票交易模拟系统
- Java Socket 模拟 Ftp Server/Client
- j2ee实验-模拟传感器的Web程序-servlet
- 安卓2.3系统java模拟器直装版
- SMPP网关模拟器系统
- 页面置换算法 操作系统作业 java模拟
评论
共有 条评论