summaryrefslogtreecommitdiffstats
path: root/zpu/sw/simulator/com/zylin/zpu/simulator/Sim.java
diff options
context:
space:
mode:
Diffstat (limited to 'zpu/sw/simulator/com/zylin/zpu/simulator/Sim.java')
-rw-r--r--zpu/sw/simulator/com/zylin/zpu/simulator/Sim.java62
1 files changed, 62 insertions, 0 deletions
diff --git a/zpu/sw/simulator/com/zylin/zpu/simulator/Sim.java b/zpu/sw/simulator/com/zylin/zpu/simulator/Sim.java
new file mode 100644
index 0000000..21450f7
--- /dev/null
+++ b/zpu/sw/simulator/com/zylin/zpu/simulator/Sim.java
@@ -0,0 +1,62 @@
+
+package com.zylin.zpu.simulator;
+
+import com.zylin.zpu.simulator.exceptions.CPUException;
+import com.zylin.zpu.simulator.exceptions.MemoryAccessException;
+
+public interface Sim
+{
+/**
+ * halts the CPU.
+ */
+ void suspend();
+ void writeByte(int i, int val) throws CPUException;
+ /**
+ * synchronous method that returns when simulator enters the halt state.
+ **/
+ void cont();
+ /**
+ * synchronous method that returns when simulator finishes step or otherwise enters
+ * the halt state.
+ **/
+ void step();
+
+ int getReg(int i) throws CPUException;
+
+ int getREGNUM();
+ int readByte(int addr) throws CPUException;
+
+ /**
+ * @param sp The sp to set.
+ * @throws CPUException
+ */
+ void setSp(int sp) throws CPUException;
+
+ /**
+ * @return Returns the sp.
+ */
+ int getSp();
+
+ /**
+ * @param pc The pc to set.
+ * @throws MemoryAccessException
+ */
+ void setPc(int pc) throws MemoryAccessException;
+
+ /**
+ * @return Returns the pc.
+ */
+ int getPc();
+
+ void enableAccessWatchPoint(int address, int length) throws CPUException;
+
+ void disableAccessWatchPoint(int address, int length) throws CPUException;
+
+ int cpuReadLong(int i) throws CPUException;
+
+ void cpuWriteLong(int i, int retval) throws MemoryAccessException;
+
+ int getArg(int num) throws CPUException;
+ void sessionStarted();
+
+}
OpenPOWER on IntegriCloud