aboutsummaryrefslogtreecommitdiff
path: root/qtmips_machine/instruction.h
diff options
context:
space:
mode:
authorPavel Pisa <pisa@cmp.felk.cvut.cz>2019-02-06 23:17:47 +0100
committerPavel Pisa <pisa@cmp.felk.cvut.cz>2019-02-06 23:17:47 +0100
commitb232bb867c1ac8cb7369190e8cd4f9f7af425cd1 (patch)
treeb02e07497de7ddf4c70fa335a06c23040559e5d7 /qtmips_machine/instruction.h
parent9634200c1041eca1c7ac0ce25d79bb8d961530f6 (diff)
downloadqtmips-b232bb867c1ac8cb7369190e8cd4f9f7af425cd1.tar.gz
qtmips-b232bb867c1ac8cb7369190e8cd4f9f7af425cd1.tar.bz2
qtmips-b232bb867c1ac8cb7369190e8cd4f9f7af425cd1.zip
Implemented base for exception handling.
Memory stage is chosen to be exception commit stage. Instructions flow postponed and stages holding following instructions are cleaned. Processing of syscall at decode stage as jump to the handler would be better solution in real hardware but for future emulated syscalls it is better to reach consistent state of registers. Memory access caused exceptions would require cleanup even in real hardware. Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
Diffstat (limited to 'qtmips_machine/instruction.h')
-rw-r--r--qtmips_machine/instruction.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/qtmips_machine/instruction.h b/qtmips_machine/instruction.h
index a8779f5..b26d9ac 100644
--- a/qtmips_machine/instruction.h
+++ b/qtmips_machine/instruction.h
@@ -67,6 +67,7 @@ enum InstructionFlags {
IMF_JUMP = 1L<<19,
IMF_BJ_NOT = 1L<<20,
IMF_BGTZ_BLEZ = 1L<<21,
+ IMF_EXCEPTION = 1L<<22,
};
class Instruction {
@@ -98,6 +99,7 @@ public:
enum InstructionFlags flags() const;
enum AluOp alu_op() const;
enum AccessControl mem_ctl() const;
+ enum ExceptionCause encoded_exception() const;
void flags_alu_op_mem_ctl(enum InstructionFlags &flags,
enum AluOp &alu_op, enum AccessControl &mem_ctl) const;