|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.mythsim.core.MythSim
The CPU Simulator.
Field Summary | |
static int |
A_BUS
Bus: ALU (Arithmetic Logic Unit) Input A Bus. |
static int |
A_SEL
Control Signal: Places the value in register n(0-7) on the a_bus. |
static int |
A_SEL_SET
|
static int |
ADDRESS
Control Signal: (not used) . |
static int |
ADDRESS_FALSE
Control Signal: . |
static int |
ADDRESS_FALSE_SET
|
static int |
ADDRESS_SET
|
static int |
ADDRESS_TRUE
Control Signal:. |
static int |
ADDRESS_TRUE_SET
|
static int |
ALU_ADD
ALU Operation: ADD. |
static int |
ALU_ADDA
ALU Operation: ADDA. |
static int |
ALU_AND
ALU Operation: AND. |
static int |
ALU_BUS
Bus: ALU (Arithmetic Logic Unit) Output Bus. |
static int |
ALU_NOT
ALU Operation: NOT. |
static int |
ALU_OR
ALU Operation: OR. |
static int |
ALU_SEL
Control Signal: Sets the ALU operation. |
static int |
ALU_SEL_SET
|
static int |
ALU_SUB
ALU Operation: SUB. |
static int |
ALU_SUBA
ALU Operation: SUBA. |
static int |
ALU_XOR
ALU Operation: XOR. |
static String[] |
aluFuncs
|
static int |
B_BUS
Bus: ALU (Arithmetic Logic Unit) Input B Bus. |
static int |
B_SEL
Control Signal: Places the value in register n(0-7) on the b_bus. |
static int |
B_SEL_SET
|
static int |
C_IN
Control Signal: Sets the c_in to 1 for use by ALU operations. |
static int |
C_IN_SET
|
static int |
C_OUT
Status Signal: Carry bit from the ALU. |
static int |
CLOCK
The system clock. |
static int |
COND
Control Signal: Select the argument for the if statement. |
static int |
COND_C_OUT
Cond Option: Uses carry bit from the alu_bus. |
static int |
COND_M7
Cond Option: Uses most significant bit from alu_bus. |
static int |
COND_SET
|
static int |
COND_V
Cond Option: Uses overflow bit from ALU. |
static int |
COND_WAIT
Cond Option: Uses wait signal from Main Memory. |
static int |
CONTROL_WORD_END
|
static int |
CONTROL_WORD_LENGTH
|
static int |
CONTROL_WORD_START
|
static int |
CURRENT_ADDRESS
|
static int |
INDEX_SEL
Control Signal: Add the opcode to the next address. |
static int |
INDEX_SEL_SET
|
static int |
INVALID_FILES_MODE
|
static int |
IR_0
Register: Instruction Register 0. |
static int |
IR_1
Register: Instruction Register 1. |
static int |
IR0_SEL
Control Signal: Sets Instruction Register 0 (ir_0). |
static int |
IR0_SEL_SET
|
static int |
IR1_SEL
Control Signal: Sets Instruction Register 1 (ir_1). |
static int |
IR1_SEL_SET
|
static int |
LENGTH
|
static int |
LOCKED
|
static int |
M_7
Status Signal: Most significant bit from alu_bus. |
static int |
MAIN_MEMORY
|
static int |
MAR
Register: Memory Address Register. |
static int |
MAR_SEL
Control Signal: Sets Memory Address Register (MDR). |
static int |
MAR_SEL_SET
|
static int |
MDR
Register: Memory Data Register. |
static int |
MDR_SEL
Control Signal: Sets Memory Data Register (MAR). |
static int |
MDR_SEL_SET
|
static int |
MEMORY_BUS
Bus: Memory Bus. |
protected int |
mode
|
static int |
NO_FILES_MODE
|
static String[] |
opcodeTags
|
static int |
R_0
Register: 0. |
static int |
R_1
Register: 1. |
static int |
R_2
Register: 2. |
static int |
R_3
Register: 3. |
static int |
R_4
Register: 4. |
static int |
R_5
Register: 5. |
static int |
R_6
Register: 6. |
static int |
R_7
Register: 7. |
static int |
R0_WRITE
Control Signal: Stores the result_bus value into r_0. |
static int |
R0_WRITE_SET
|
static int |
R1_WRITE
Control Signal: Stores the result_bus value into r_1. |
static int |
R1_WRITE_SET
|
static int |
R2_WRITE
Control Signal: Stores the result_bus value into r_2. |
static int |
R2_WRITE_SET
|
static int |
R3_WRITE
Control Signal: Stores the result_bus value into r_3. |
static int |
R3_WRITE_SET
|
static int |
R4_WRITE
Control Signal: Stores the result_bus value into r_4. |
static int |
R4_WRITE_SET
|
static int |
R5_WRITE
Control Signal: Stores the result_bus value into r_5. |
static int |
R5_WRITE_SET
|
static int |
R6_WRITE
Control Signal: Stores the result_bus value into r_6. |
static int |
R6_WRITE_SET
|
static int |
R7_WRITE
Control Signal: Stores the result_bus value into r_7. |
static int |
R7_WRITE_SET
|
static int |
READ
Control Signal: Read from memory. |
static int |
READ_SET
|
static int |
RESULT_ALU
Result Option: Place the alu_bus value on the result_bus. |
static int |
RESULT_BUS
Bus: Result Bus. |
static int |
RESULT_IR_CONST4
Result Option: Place the ir_const4 value on the result_bus. |
static int |
RESULT_IR_CONST8
Result Option: Place the ir_const8 value on the result_bus. |
static int |
RESULT_MDR
Result Option: Place the MDR value on the result_bus. |
static int |
RESULT_SEL
Control Signal: Selects value for result_bus. |
static int |
RESULT_SEL_SET
|
static int |
RI_SEL
Control Signal: Stores result_bus value in the register defined in ir_ri. |
static int |
RI_SEL_SET
|
static int |
RJ_SEL
Control Signal: Places the value in register defined by ir_rj on the a_bus. |
static int |
RJ_SEL_SET
|
static int |
RK_SEL
Control Signal: Places the value in register defined by ir_rk on the a_bus. |
static int |
RK_SEL_SET
|
static int |
STATUS_ARRAY_LENGTH
|
static int |
V
Status Signal: Overflow. |
static int |
VA_SEL_BUS
Virtual Bus: Places the value in register n(0-7) on the a_bus. |
static int |
VALID_FILES_MODE
|
static int |
VB_SEL_BUS
Virtual Bus: Places the value in register n(0-7) on the b_bus. |
static String |
version_title
The curent name and version number. |
static int |
VR0_WRITE_BUS
Virtual Control Signal: Stores the result_bus value into r_0. |
static int |
VR1_WRITE_BUS
Virtual Control Signal: Stores the result_bus value into r_1. |
static int |
VR2_WRITE_BUS
Virtual Control Signal: Stores the result_bus value into r_2. |
static int |
VR3_WRITE_BUS
Virtual Control Signal: Stores the result_bus value into r_3. |
static int |
WAIT
Status Signal: Wait. |
static int |
WRITE
Control Signal: Write to memory. |
static int |
WRITE_BUS
Bus: Write Bus. |
static int |
WRITE_SET
|
Constructor Summary | |
MythSim()
Creates a MythSim simulator. |
Method Summary | |
static boolean |
AND(boolean a,
boolean b)
|
static int |
and(int x,
int y)
|
static int |
bit2int(boolean[] a)
|
void |
boot()
Boots comptuer. |
static int |
carry(int x,
int y)
|
static int |
carry(int alu_sel,
int a_bus,
int b_bus,
int c_in)
|
static int[] |
empty()
|
static int |
fix(int x)
|
static String |
funcName(int i)
|
Object[][] |
getMemory()
|
File |
getMemoryFile()
|
String |
getMemoryFileName()
|
String |
getMemoryFilePath()
|
String |
getMemorySource()
|
File |
getMicrocodeFile()
|
String |
getMicrocodeFileName()
|
String |
getMicrocodeFilePath()
|
String |
getMicrocodeSource()
|
int[] |
getPreviousStatus()
|
int |
getRegA()
|
int |
getRegB()
|
int[] |
getStatus()
|
int |
getStatus(int index)
|
Object[][] |
getUcode()
|
Object[][] |
getUstore()
|
static boolean[] |
int2bit(int a)
|
void |
last()
Steps backward to last opcode. |
static int |
lownibble(int a)
|
static int |
m7(int a)
|
static String |
name(int i)
|
void |
next()
Steps forward to next opcode. |
static int |
normal(int a)
|
static int |
normal2tc(int a)
|
static boolean |
NOT(boolean a)
|
static int |
not(int x)
|
static int |
opcode(int a)
|
static boolean |
OR(boolean a,
boolean b)
|
static int |
or(int x,
int y)
|
static int |
overflow(int x)
|
void |
parse()
Parse ucode and mem files. |
static int |
ri(int a)
|
static int |
rj(int a)
|
static int |
rk(int a)
|
void |
run()
Runs comptuer. |
void |
setFileMemory(File file)
Sets the Memory File |
void |
setFileMicrocode(File file)
Sets the Microcode File |
void |
step()
Step One Clock Cycle |
void |
step(int a)
Step forward N time to next opcode |
static int |
tc2normal(int a)
|
boolean |
ucodeZero()
|
static boolean |
XOR(boolean a,
boolean b)
|
static int |
xor(int x,
int y)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String version_title
public static final int R_0
Location in the status array for the value in Register 0.
public static final int R_1
Location in the status array for the value in Register 1.
public static final int R_2
Location in the status array for the value in Register 2.
public static final int R_3
Location in the status array for the value in Register 3.
public static final int R_4
Location in the status array for the value in Register 4.
public static final int R_5
Location in the status array for the value in Register 5.
public static final int R_6
Location in the status array for the value in Register 6.
public static final int R_7
Location in the status array for the value in Register 7.
public static final int IR_0
Location in the status array for the value in Instruction Register 0.
public static final int IR_1
Location in the status array for the value in Instruction Register 1.
public static final int MDR
Location in the status array for the value in Memory Data Register.
public static final int MAR
Location in the status array for the value in Memory Address Register.
public static final int ALU_BUS
Location in the status array for the value in alu_bus. Register.
public static final int A_BUS
Location in the status array for the value in a_bus. Register.
public static final int B_BUS
Location in the status array for the value in b_bus. Register.
public static final int RESULT_BUS
Location in the status array for the value in result_bus. Register.
public static final int WRITE_BUS
Location in the status array for the value in write_bus. Register.
public static final int MEMORY_BUS
Location in the status array for the value in mem_bus. Register.
public static final int R0_WRITE
Stores the index of this control signal.
public static final int R1_WRITE
Stores the index of this control signal.
public static final int R2_WRITE
Stores the index of this control signal.
public static final int R3_WRITE
Stores the index of this control signal.
public static final int R4_WRITE
Stores the index of this control signal.
public static final int R5_WRITE
Stores the index of this control signal.
public static final int R6_WRITE
Stores the index of this control signal.
public static final int R7_WRITE
Stores the index of this control signal.
public static final int A_SEL
Stores the index of this control signal.
public static final int B_SEL
Stores the index of this control signal.
public static final int RI_SEL
Stores the index of this control signal.
public static final int RJ_SEL
Stores the index of this control signal.
public static final int RK_SEL
Stores the index of this control signal.
public static final int C_IN
Stores the status array index of this control signal.
public static final int ALU_SEL
Stores the status array index of this control signal.
ALU_NOT
,
ALU_OR
,
ALU_AND
,
ALU_XOR
,
ALU_ADD
,
ALU_SUB
,
ALU_ADDA
,
ALU_SUBA
,
Constant Field Valuespublic static final int MDR_SEL
Stores the status array index of this control signal.
MDR
,
Constant Field Valuespublic static final int MAR_SEL
Stores the status array index of this control signal.
MAR
,
Constant Field Valuespublic static final int RESULT_SEL
Stores the status array index of this control signal.
RESULT_ALU
,
RESULT_MDR
,
RESULT_IR_CONST4
,
RESULT_IR_CONST8
,
Constant Field Valuespublic static final int IR0_SEL
Stores the status array index of this control signal.
IR_0
,
Constant Field Valuespublic static final int IR1_SEL
Wires: 1
Values: 0 to 1
Stores the status array index of this control signal.
IR_1
,
Constant Field Valuespublic static final int READ
Wires: 1
Values: 0 to 1
Stores the status array index of this control signal.
public static final int WRITE
Wires: 1
Values: 0 to 1
Stores the status array index of this control signal.
public static final int INDEX_SEL
Wires: 1
Values: 0 to 1
Stores the status array index of this control signal.
public static final int COND
Wires: 2
Values: 0 to 3
Stores the status array index of this control signal.
COND_M7
,
COND_C_OUT
,
COND_V
,
COND_WAIT
,
Constant Field Valuespublic static final int ADDRESS_TRUE
Stores the status array index of this control signal.
public static final int ADDRESS_FALSE
Stores the status array index of this control signal.
public static final int ADDRESS
Use CURRENT_ADDESS
public static final int R0_WRITE_SET
public static final int R1_WRITE_SET
public static final int R2_WRITE_SET
public static final int R3_WRITE_SET
public static final int R4_WRITE_SET
public static final int R5_WRITE_SET
public static final int R6_WRITE_SET
public static final int R7_WRITE_SET
public static final int A_SEL_SET
public static final int B_SEL_SET
public static final int RI_SEL_SET
public static final int RJ_SEL_SET
public static final int RK_SEL_SET
public static final int C_IN_SET
public static final int ALU_SEL_SET
public static final int MDR_SEL_SET
public static final int MAR_SEL_SET
public static final int RESULT_SEL_SET
public static final int IR0_SEL_SET
public static final int IR1_SEL_SET
public static final int READ_SET
public static final int WRITE_SET
public static final int INDEX_SEL_SET
public static final int COND_SET
public static final int ADDRESS_TRUE_SET
public static final int ADDRESS_FALSE_SET
public static final int ADDRESS_SET
public static final int C_OUT
Stores the status array index of this status signal.
public static final int M_7
Stores the status array index of this status signal.
public static final int V
Stores the status array index of this status signal.
public static final int WAIT
Stores the status array index of this status signal.
public static final int CURRENT_ADDRESS
public static final int CLOCK
public static final int LOCKED
public static final int VA_SEL_BUS
Wires: 3
Values: 0 to 7
Stores the status array index of this control signal.
public static final int VB_SEL_BUS
Wires: 3
Values: 0 to 7
Stores the status array index of this control signal.
public static final int VR0_WRITE_BUS
Wires: 1
Values: 0 or 1
Stores the status array index of this control signal.
public static final int VR1_WRITE_BUS
Wires: 1
Values: 0 or 1
Stores the status array index of this control signal.
public static final int VR2_WRITE_BUS
Wires: 1
Values: 0 or 1
Stores the status array index of this control signal.
public static final int VR3_WRITE_BUS
Wires: 1
Values: 0 or 1
Stores the status array index of this control signal.
public static final int STATUS_ARRAY_LENGTH
public static final int MAIN_MEMORY
public static final int LENGTH
public static final int CONTROL_WORD_START
public static final int CONTROL_WORD_END
public static final int CONTROL_WORD_LENGTH
public static final int NO_FILES_MODE
public static final int INVALID_FILES_MODE
public static final int VALID_FILES_MODE
protected int mode
public static final String[] aluFuncs
public static final int ALU_NOT
NOT(a_bus) => alu_bus
ALU_SEL
,
Constant Field Valuespublic static final int ALU_OR
OR(a_bus,b_bus) => alu_bus
ALU_SEL
,
Constant Field Valuespublic static final int ALU_AND
AND(a_bus,b_bus) => alu_bus
ALU_SEL
,
Constant Field Valuespublic static final int ALU_XOR
XOR(a_bus,b_bus) => alu_bus
ALU_SEL
,
Constant Field Valuespublic static final int ALU_ADD
a_bus + b_bus + c_in => alu_bus
ALU_SEL
,
Constant Field Valuespublic static final int ALU_SUB
a_bus + NOT(b_bus) + c_in => alu_bus
ALU_SEL
,
Constant Field Valuespublic static final int ALU_ADDA
a_bus + c_in => alu_bus
ALU_SEL
,
Constant Field Valuespublic static final int ALU_SUBA
a_bus - 1 + c_in => alu_bus
ALU_SEL
,
Constant Field Valuespublic static final int RESULT_ALU
RESULT_SEL
,
Constant Field Valuespublic static final int RESULT_MDR
RESULT_SEL
,
Constant Field Valuespublic static final int RESULT_IR_CONST4
RESULT_SEL
,
Constant Field Valuespublic static final int RESULT_IR_CONST8
RESULT_SEL
,
Constant Field Valuespublic static final int COND_M7
COND
,
Constant Field Valuespublic static final int COND_C_OUT
COND
,
C_OUT
,
Constant Field Valuespublic static final int COND_V
COND
,
Constant Field Valuespublic static final int COND_WAIT
COND
,
Constant Field Valuespublic static String[] opcodeTags
Constructor Detail |
public MythSim()
Method Detail |
public void setFileMicrocode(File file) throws FileNotFoundException
FileNotFoundException
public void setFileMemory(File file) throws FileNotFoundException
FileNotFoundException
public String getMemorySource()
public String getMicrocodeSource()
public File getMemoryFile()
public File getMicrocodeFile()
public String getMemoryFilePath()
public String getMicrocodeFilePath()
public String getMemoryFileName()
public String getMicrocodeFileName()
public int[] getStatus()
public int[] getPreviousStatus()
public int getStatus(int index)
public static String name(int i)
public static String funcName(int i)
public boolean ucodeZero()
public int getRegA()
public int getRegB()
public void parse() throws Exception
Exception
public void step(int a) throws MythError
MythError
public void next() throws MythError
MythError
public void last() throws MythError
MythError
public void run() throws MythError
MythError
public void boot() throws MythError
MythError
public void step() throws MythError
MythError
public static boolean NOT(boolean a)
public static boolean AND(boolean a, boolean b)
public static boolean OR(boolean a, boolean b)
public static boolean XOR(boolean a, boolean b)
public static boolean[] int2bit(int a)
public static int bit2int(boolean[] a)
public static int tc2normal(int a)
public static int normal2tc(int a)
public static int ri(int a)
public static int rj(int a)
public static int rk(int a)
public static int opcode(int a)
public static int lownibble(int a)
public static int m7(int a)
public static int normal(int a)
public static int not(int x)
public static int or(int x, int y)
public static int and(int x, int y)
public static int xor(int x, int y)
public static int overflow(int x)
public static int fix(int x)
public static int carry(int x, int y)
public static int carry(int alu_sel, int a_bus, int b_bus, int c_in)
public static int[] empty()
public Object[][] getUstore()
public Object[][] getUcode()
public Object[][] getMemory()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |