trap.isa (3996:e19c36743441) trap.isa (7741:340b6f01d69b)
1// Copyright (c) 2006-2007 The Regents of The University of Michigan
2// All rights reserved.
3//
4// Redistribution and use in source and binary forms, with or without
5// modification, are permitted provided that the following conditions are
6// met: redistributions of source code must retain the above copyright
7// notice, this list of conditions and the following disclaimer;
8// redistributions in binary form must reproduce the above copyright

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

50 std::string generateDisassembly(Addr pc,
51 const SymbolTable *symtab) const;
52
53 int trapNum;
54 };
55}};
56
57output decoder {{
1// Copyright (c) 2006-2007 The Regents of The University of Michigan
2// All rights reserved.
3//
4// Redistribution and use in source and binary forms, with or without
5// modification, are permitted provided that the following conditions are
6// met: redistributions of source code must retain the above copyright
7// notice, this list of conditions and the following disclaimer;
8// redistributions in binary form must reproduce the above copyright

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

50 std::string generateDisassembly(Addr pc,
51 const SymbolTable *symtab) const;
52
53 int trapNum;
54 };
55}};
56
57output decoder {{
58 std::string Trap::generateDisassembly(Addr pc,
59 const SymbolTable *symtab) const
58 std::string
59 Trap::generateDisassembly(Addr pc, const SymbolTable *symtab) const
60 {
61 std::stringstream response;
62
63 printMnemonic(response, mnemonic);
64 ccprintf(response, " ");
65 printReg(response, _srcRegIdx[0]);
66 ccprintf(response, ", 0x%x", trapNum);
67 ccprintf(response, ", or ");
68 printReg(response, _srcRegIdx[1]);
69 return response.str();
70 }
71}};
72
73def template TrapExecute {{
60 {
61 std::stringstream response;
62
63 printMnemonic(response, mnemonic);
64 ccprintf(response, " ");
65 printReg(response, _srcRegIdx[0]);
66 ccprintf(response, ", 0x%x", trapNum);
67 ccprintf(response, ", or ");
68 printReg(response, _srcRegIdx[1]);
69 return response.str();
70 }
71}};
72
73def template TrapExecute {{
74 Fault %(class_name)s::execute(%(CPU_exec_context)s *xc,
74 Fault
75 %(class_name)s::execute(%(CPU_exec_context)s *xc,
75 Trace::InstRecord *traceData) const
76 {
77 Fault fault = NoFault;
78 %(op_decl)s;
79 %(op_rd)s;
80 %(code)s
81 return fault;
82 }
83}};
84
85def template FpUnimplExecute {{
76 Trace::InstRecord *traceData) const
77 {
78 Fault fault = NoFault;
79 %(op_decl)s;
80 %(op_rd)s;
81 %(code)s
82 return fault;
83 }
84}};
85
86def template FpUnimplExecute {{
86 Fault %(class_name)s::execute(%(CPU_exec_context)s *xc,
87 Fault
88 %(class_name)s::execute(%(CPU_exec_context)s *xc,
87 Trace::InstRecord *traceData) const
88 {
89 Fault fault = NoFault;
90 %(op_decl)s;
91 %(op_rd)s;
92 %(code)s
93 %(op_wb)s;
94 return fault;

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

108 {
109 protected:
110 FpUnimpl(const char *mnem,
111 ExtMachInst _machInst, OpClass __opClass)
112 : SparcStaticInst(mnem, _machInst, __opClass)
113 {
114 }
115
89 Trace::InstRecord *traceData) const
90 {
91 Fault fault = NoFault;
92 %(op_decl)s;
93 %(op_rd)s;
94 %(code)s
95 %(op_wb)s;
96 return fault;

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

110 {
111 protected:
112 FpUnimpl(const char *mnem,
113 ExtMachInst _machInst, OpClass __opClass)
114 : SparcStaticInst(mnem, _machInst, __opClass)
115 {
116 }
117
116 std::string generateDisassembly(Addr pc,
117 const SymbolTable *symtab) const
118 std::string
119 generateDisassembly(Addr pc, const SymbolTable *symtab) const
118 {
119 return mnemonic;
120 }
121 };
122}};
123
124def format FpUnimpl(*flags) {{
125 fpunimpl_code = '''
126 Fsr = insertBits(Fsr, 16, 14, 3);
127 fault = new FpExceptionOther;
128 '''
129 iop = InstObjParams(name, Name, 'FpUnimpl', fpunimpl_code, flags)
130 header_output = BasicDeclare.subst(iop)
131 decoder_output = BasicConstructor.subst(iop)
132 decode_block = BasicDecode.subst(iop)
133 exec_output = FpUnimplExecute.subst(iop)
134}};
120 {
121 return mnemonic;
122 }
123 };
124}};
125
126def format FpUnimpl(*flags) {{
127 fpunimpl_code = '''
128 Fsr = insertBits(Fsr, 16, 14, 3);
129 fault = new FpExceptionOther;
130 '''
131 iop = InstObjParams(name, Name, 'FpUnimpl', fpunimpl_code, flags)
132 header_output = BasicDeclare.subst(iop)
133 decoder_output = BasicConstructor.subst(iop)
134 decode_block = BasicDecode.subst(iop)
135 exec_output = FpUnimplExecute.subst(iop)
136}};