trap.isa (2632:1bb2f91485ea) trap.isa (2686:f0d591379ac3)
1// -*- mode:c++ -*-
2
1////////////////////////////////////////////////////////////////////
2//
3// Trap instructions
4//
5
6output header {{
7 /**
8 * Base class for integer operations.

--- 9 unchanged lines hidden (view full) ---

18
19 std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const;
20 };
21}};
22
23output decoder {{
24 std::string Trap::generateDisassembly(Addr pc, const SymbolTable *symtab) const
25 {
3////////////////////////////////////////////////////////////////////
4//
5// Trap instructions
6//
7
8output header {{
9 /**
10 * Base class for integer operations.

--- 9 unchanged lines hidden (view full) ---

20
21 std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const;
22 };
23}};
24
25output decoder {{
26 std::string Trap::generateDisassembly(Addr pc, const SymbolTable *symtab) const
27 {
26 return "Disassembly of integer instruction\n";
28 return "Disassembly of trap instruction\n";
27 }
28}};
29
30def template TrapExecute {{
29 }
30}};
31
32def template TrapExecute {{
33 //Edit This Template When Traps Are Implemented
31 Fault %(class_name)s::execute(%(CPU_exec_context)s *xc, Trace::InstRecord *traceData) const
32 {
34 Fault %(class_name)s::execute(%(CPU_exec_context)s *xc, Trace::InstRecord *traceData) const
35 {
33 //Call into the trap handler with the appropriate fault
34 return No_Fault;
35 }
36
37 //Write the resulting state to the execution context
38 %(op_wb)s;
39
36 //Write the resulting state to the execution context
37 %(op_wb)s;
38
39 //Call into the trap handler with the appropriate fault
40 return No_Fault;
41 }
42}};
43
40 return No_Fault;
41 }
42}};
43
44// Primary format for integer operate instructions:
45def format Trap(code, *flags) {{
44def format Trap(code, *flags) {{
46 code = 'bool cond;\n' + code;
45 code = 'panic(\"'
46 code += 'Trap Exception Handler Is Currently Not Implemented.'
47 code += '\");'
47 iop = InstObjParams(name, Name, 'MipsStaticInst', CodeBlock(code), flags)
48 header_output = BasicDeclare.subst(iop)
49 decoder_output = BasicConstructor.subst(iop)
50 decode_block = BasicDecode.subst(iop)
51 exec_output = BasicExecute.subst(iop)
52}};
48 iop = InstObjParams(name, Name, 'MipsStaticInst', CodeBlock(code), flags)
49 header_output = BasicDeclare.subst(iop)
50 decoder_output = BasicConstructor.subst(iop)
51 decode_block = BasicDecode.subst(iop)
52 exec_output = BasicExecute.subst(iop)
53}};