|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecthicosim.control.Engine
public class Engine
This class is the interface between the front- and backend and is used by clients(such as commandProcessor) to call methods in the backend.
Constructor Summary | |
---|---|
Engine()
Setup processorConfiguration, processor and memory and the utils. |
Method Summary | |
---|---|
void |
addListener(iListenerFrontend listener)
|
void |
addPlugin(IPlugin newPlugin)
|
void |
checkNumerativeFlagAndDisplay(char regFlag,
int value)
This method checks the Numerative flags and displays the registervalues on the gui depending on the flags. |
void |
checkNumerativeFlagAndDisplayAll()
This method is used to display All registers in the new setted Numerative |
void |
deleteAllBr()
This method delete all breakpoints |
void |
deleteBreakpointAtDisascodeline(int index)
|
void |
deleteBreakpointAtSourcecodeline(int index)
|
boolean |
delWatchPoint(int adr)
|
java.lang.String |
disas()
|
void |
displayBreakpointAtDisascodeline(int index)
|
void |
displayBreakpointAtSourcecodeline(int index)
|
void |
displayConsole(java.lang.String message,
boolean error)
This method is used by backend to show messages(like next instruction to execute) in the GUI Konsole or in the commandline. |
void |
displayCpuConfiguration(java.util.HashMap<java.lang.String,java.lang.String> config)
This method is used to display the changed configuration in the GUI. |
void |
displayInstructionPointer(int ip)
|
void |
displayScalarRegChanges(java.lang.Object valOfA,
java.lang.Object valOfX,
java.lang.Object valOfY)
|
void |
displaySingleVecValue(int i,
int j,
java.lang.Object value)
|
void |
displayStatusRegister(int carry,
boolean zero)
display status register content |
void |
displayVectorRegChanges(int[][] vRegs)
|
java.lang.String |
execute(java.lang.String cmd)
execute an external process. |
void |
focusAtCommandline()
|
java.lang.String |
getAboutMessage()
|
int |
getAddressOfLabel(java.lang.String label)
|
java.util.HashSet<java.lang.Integer> |
getAllWatchPoints()
|
java.util.Vector<java.lang.Integer> |
getBreakpoints()
|
java.lang.String |
getConfig()
String representation of all processor configuration. |
java.util.HashMap<java.lang.String,java.lang.String> |
getCPUConfiguration()
|
int |
getIP()
Get current program counter. |
Labels |
getLabels()
String representation of all labels. |
iListenerFrontend |
getListener()
|
Memory |
getMemory()
|
int |
getMemoryContentAt(int address)
|
Processor |
getProcessor()
|
ProcessorConfig |
getProcessorConfiguration()
|
java.lang.String |
getRegs()
String representation of all registers. |
java.lang.String |
getSourceCodeLines()
|
java.lang.String |
getSourceCodePATH()
|
Sourcefile |
getSourcefile()
|
void |
highlightDisascodeline(int index)
|
void |
highlightSourcecodeline(int index)
|
void |
interrupt()
|
boolean |
isObjectFileLoaded()
|
boolean |
isProcessorRunning()
|
boolean |
isWatchPoint(int adr)
|
java.lang.String |
loadObjectFile(java.lang.String PATH)
This method uses the memoryReference to load the objectfile. |
java.lang.String |
readSourcefile(java.lang.String PATH)
|
void |
reset()
|
void |
resetMemory()
|
void |
run()
|
java.lang.String |
setBreakpoint(java.lang.String paramBreak,
boolean deletebr)
This method interprets the parameter to the setBreakpoint-command and returns an InfoString or throws an Exception if this fails. |
java.lang.String |
setConfiguration(java.lang.String paramsConfig)
This method sets the given Configuration Parameter. |
void |
setJTableVectorCpuRegisterOverviewSize(int rows,
int columns)
|
void |
setMemory(int address,
int value)
|
void |
setNumerative(char numerative)
This method is used by GUI to set a flag to know in which Numerative the value of registers should be displayed. |
void |
setProcessorRunning(boolean running)
This method is used to know if the processor is running or not. |
java.lang.String |
setRegister(java.lang.String paramSetR)
This method is used to set the value of a register. |
boolean |
setWatchPoint(int adr)
|
void |
step(boolean run)
This method makes executes one single instruction. |
void |
writeToSourcefile(java.lang.String PATH,
java.lang.String text)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Engine()
Method Detail |
---|
public Processor getProcessor()
public Memory getMemory()
public iListenerFrontend getListener()
public void focusAtCommandline()
public void addListener(iListenerFrontend listener) throws java.lang.Exception
java.lang.Exception
public void displayConsole(java.lang.String message, boolean error)
message
- - String - the message to display.error
- - boolean - if the message is an errorMessage or not.public void setJTableVectorCpuRegisterOverviewSize(int rows, int columns)
public void displayInstructionPointer(int ip)
public void displayScalarRegChanges(java.lang.Object valOfA, java.lang.Object valOfX, java.lang.Object valOfY)
public void displayVectorRegChanges(int[][] vRegs)
public void displaySingleVecValue(int i, int j, java.lang.Object value)
public void displayStatusRegister(int carry, boolean zero)
public void displayCpuConfiguration(java.util.HashMap<java.lang.String,java.lang.String> config)
public java.util.HashMap<java.lang.String,java.lang.String> getCPUConfiguration()
public void displayBreakpointAtSourcecodeline(int index)
public void displayBreakpointAtDisascodeline(int index)
public void deleteBreakpointAtSourcecodeline(int index)
public void deleteBreakpointAtDisascodeline(int index)
public void highlightSourcecodeline(int index)
public void highlightDisascodeline(int index)
public void addPlugin(IPlugin newPlugin)
public java.lang.String loadObjectFile(java.lang.String PATH) throws java.lang.Exception
PATH
- - PATH to the objectFile
java.lang.Exception
public void setProcessorRunning(boolean running)
public boolean isProcessorRunning()
public void reset() throws java.lang.Exception
java.lang.Exception
public void resetMemory() throws java.lang.Exception
java.lang.Exception
public void run() throws java.lang.Exception
java.lang.Exception
public void step(boolean run) throws java.lang.Exception
run
- - if client wants to execute just one instruction, run has to be false.
This also shows the disassembly output of executed instruction.
Else it can be used to run in a loop.
java.lang.Exception
public void interrupt() throws java.lang.Exception
java.lang.Exception
public boolean isObjectFileLoaded()
public boolean setWatchPoint(int adr)
public boolean isWatchPoint(int adr)
public boolean delWatchPoint(int adr)
public java.util.HashSet<java.lang.Integer> getAllWatchPoints()
public void deleteAllBr()
public java.util.Vector<java.lang.Integer> getBreakpoints()
public java.lang.String setBreakpoint(java.lang.String paramBreak, boolean deletebr) throws java.lang.Exception
paramBreak
- - parameter to set breakpoint command (decimal, 0xhex, label/+offset)
java.lang.Exception
public int getAddressOfLabel(java.lang.String label) throws java.lang.Exception
java.lang.Exception
public java.lang.String getRegs() throws java.lang.Exception
java.lang.Exception
public int getIP()
public Labels getLabels() throws java.lang.Exception
java.lang.Exception
public java.lang.String getConfig() throws java.lang.Exception
java.lang.Exception
public java.lang.String getAboutMessage()
public java.lang.String readSourcefile(java.lang.String PATH) throws java.lang.Exception
java.lang.Exception
public java.lang.String getSourceCodeLines() throws java.lang.Exception
java.lang.Exception
public java.lang.String getSourceCodePATH() throws java.lang.Exception
java.lang.Exception
public Sourcefile getSourcefile()
public void writeToSourcefile(java.lang.String PATH, java.lang.String text) throws java.lang.Exception
java.lang.Exception
public int getMemoryContentAt(int address) throws java.lang.Exception
java.lang.Exception
public void setMemory(int address, int value) throws java.lang.Exception
java.lang.Exception
public ProcessorConfig getProcessorConfiguration() throws java.lang.Exception
java.lang.Exception
public java.lang.String setConfiguration(java.lang.String paramsConfig) throws java.lang.Exception
java.lang.Exception
public java.lang.String disas() throws java.lang.Exception
java.lang.Exception
public java.lang.String execute(java.lang.String cmd) throws java.lang.Exception
java.lang.Exception
public void setNumerative(char numerative) throws java.lang.Exception
numerative
- - 'd' = decimal; 'b' = binary; 'h' = hexadecimal else throw Exception
java.lang.Exception
public void checkNumerativeFlagAndDisplayAll()
public void checkNumerativeFlagAndDisplay(char regFlag, int value)
regFlag
- - to know which reg should be updatedvalue
- public java.lang.String setRegister(java.lang.String paramSetR) throws java.lang.Exception
paramSetR
-
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |