debug.isa (7087:fb8d5786ff30) debug.isa (7620:3d8a23caa1ef)
1// Copyright (c) 2008 The Hewlett-Packard Development Company
2// All rights reserved.
3//
4// The license below extends only to copyright in the software and shall
5// not be construed as granting a license to any other intellectual
6// property including but not limited to intellectual property relating
7// to a hardware implementation of the functionality of the software
8// licensed hereunder. You may use the software subject to the license

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

45 class MicroDebugBase : public X86ISA::X86MicroopBase
46 {
47 protected:
48 std::string message;
49 uint8_t cc;
50
51 public:
52 MicroDebugBase(ExtMachInst _machInst, const char * mnem,
1// Copyright (c) 2008 The Hewlett-Packard Development Company
2// All rights reserved.
3//
4// The license below extends only to copyright in the software and shall
5// not be construed as granting a license to any other intellectual
6// property including but not limited to intellectual property relating
7// to a hardware implementation of the functionality of the software
8// licensed hereunder. You may use the software subject to the license

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

45 class MicroDebugBase : public X86ISA::X86MicroopBase
46 {
47 protected:
48 std::string message;
49 uint8_t cc;
50
51 public:
52 MicroDebugBase(ExtMachInst _machInst, const char * mnem,
53 const char * instMnem,
54 bool isMicro, bool isDelayed, bool isFirst, bool isLast,
53 const char * instMnem, uint64_t setFlags,
55 std::string _message, uint8_t _cc);
56
57 MicroDebugBase(ExtMachInst _machInst, const char * mnem,
58 const char * instMnem, std::string _message, uint8_t _cc);
59
60 std::string generateDisassembly(Addr pc,
61 const SymbolTable *symtab) const;
62 };
63}};
64
65def template MicroDebugDeclare {{
66 class %(class_name)s : public %(base_class)s
67 {
68 private:
69 void buildMe();
70 public:
71 %(class_name)s(ExtMachInst _machInst, const char * instMnem,
54 std::string _message, uint8_t _cc);
55
56 MicroDebugBase(ExtMachInst _machInst, const char * mnem,
57 const char * instMnem, std::string _message, uint8_t _cc);
58
59 std::string generateDisassembly(Addr pc,
60 const SymbolTable *symtab) const;
61 };
62}};
63
64def template MicroDebugDeclare {{
65 class %(class_name)s : public %(base_class)s
66 {
67 private:
68 void buildMe();
69 public:
70 %(class_name)s(ExtMachInst _machInst, const char * instMnem,
72 bool isMicro, bool isDelayed, bool isFirst, bool isLast,
73 std::string _message, uint8_t _cc);
71 uint64_t setFlags, std::string _message, uint8_t _cc);
74
75 %(class_name)s(ExtMachInst _machInst, const char * instMnem,
76 std::string _message, uint8_t _cc);
77
78 %(BasicExecDeclare)s
79 };
80}};
81

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

91 return NoFault;
92 }
93}};
94
95output decoder {{
96 inline MicroDebugBase::MicroDebugBase(
97 ExtMachInst machInst, const char * mnem, const char * instMnem,
98 std::string _message, uint8_t _cc) :
72
73 %(class_name)s(ExtMachInst _machInst, const char * instMnem,
74 std::string _message, uint8_t _cc);
75
76 %(BasicExecDeclare)s
77 };
78}};
79

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

89 return NoFault;
90 }
91}};
92
93output decoder {{
94 inline MicroDebugBase::MicroDebugBase(
95 ExtMachInst machInst, const char * mnem, const char * instMnem,
96 std::string _message, uint8_t _cc) :
99 X86MicroopBase(machInst, mnem, instMnem,
100 false, false, false, false, No_OpClass),
97 X86MicroopBase(machInst, mnem, instMnem, 0, No_OpClass),
101 message(_message), cc(_cc)
102 {
103 }
104
105 inline MicroDebugBase::MicroDebugBase(
106 ExtMachInst machInst, const char * mnem, const char * instMnem,
98 message(_message), cc(_cc)
99 {
100 }
101
102 inline MicroDebugBase::MicroDebugBase(
103 ExtMachInst machInst, const char * mnem, const char * instMnem,
107 bool isMicro, bool isDelayed, bool isFirst, bool isLast,
108 std::string _message, uint8_t _cc) :
104 uint64_t setFlags, std::string _message, uint8_t _cc) :
109 X86MicroopBase(machInst, mnem, instMnem,
105 X86MicroopBase(machInst, mnem, instMnem,
110 isMicro, isDelayed, isFirst, isLast, No_OpClass),
106 setFlags, No_OpClass),
111 message(_message), cc(_cc)
112 {
113 }
114}};
115
116def template MicroDebugConstructor {{
117
118 inline void %(class_name)s::buildMe()

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

124 ExtMachInst machInst, const char * instMnem,
125 std::string _message, uint8_t _cc) :
126 %(base_class)s(machInst, "%(func)s", instMnem, _message, _cc)
127 {
128 buildMe();
129 }
130
131 inline %(class_name)s::%(class_name)s(
107 message(_message), cc(_cc)
108 {
109 }
110}};
111
112def template MicroDebugConstructor {{
113
114 inline void %(class_name)s::buildMe()

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

120 ExtMachInst machInst, const char * instMnem,
121 std::string _message, uint8_t _cc) :
122 %(base_class)s(machInst, "%(func)s", instMnem, _message, _cc)
123 {
124 buildMe();
125 }
126
127 inline %(class_name)s::%(class_name)s(
132 ExtMachInst machInst, const char * instMnem,
133 bool isMicro, bool isDelayed, bool isFirst, bool isLast,
128 ExtMachInst machInst, const char * instMnem, uint64_t setFlags,
134 std::string _message, uint8_t _cc) :
135 %(base_class)s(machInst, "%(func)s", instMnem,
129 std::string _message, uint8_t _cc) :
130 %(base_class)s(machInst, "%(func)s", instMnem,
136 isMicro, isDelayed, isFirst, isLast, _message, _cc)
131 setFlags, _message, _cc)
137 {
138 buildMe();
139 }
140}};
141
142output decoder {{
143 std::string MicroDebugBase::generateDisassembly(Addr pc,
144 const SymbolTable *symtab) const

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

159 if flags:
160 if not isinstance(flags, (list, tuple)):
161 raise Exception, "flags must be a list or tuple of flags"
162 self.cond = " | ".join(flags)
163 self.className += "Flags"
164 else:
165 self.cond = "0"
166
132 {
133 buildMe();
134 }
135}};
136
137output decoder {{
138 std::string MicroDebugBase::generateDisassembly(Addr pc,
139 const SymbolTable *symtab) const

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

154 if flags:
155 if not isinstance(flags, (list, tuple)):
156 raise Exception, "flags must be a list or tuple of flags"
157 self.cond = " | ".join(flags)
158 self.className += "Flags"
159 else:
160 self.cond = "0"
161
167 def getAllocator(self, *microFlags):
168 allocator = '''new %(class_name)s(machInst, macrocodeBlock
162 def getAllocator(self, microFlags):
163 allocator = '''new %(class_name)s(machInst, macrocodeBlock,
169 %(flags)s, "%(message)s", %(cc)s)''' % {
170 "class_name" : self.className,
171 "flags" : self.microFlagsText(microFlags),
172 "message" : self.message,
173 "cc" : self.cond}
174 return allocator
175
176 exec_output = ""

--- 35 unchanged lines hidden ---
164 %(flags)s, "%(message)s", %(cc)s)''' % {
165 "class_name" : self.className,
166 "flags" : self.microFlagsText(microFlags),
167 "message" : self.message,
168 "cc" : self.cond}
169 return allocator
170
171 exec_output = ""

--- 35 unchanged lines hidden ---