mem.isa (5745:6b0f8306704b) mem.isa (6179:83693f4b79fd)
1// -*- mode:c++ -*-
2
3// Copyright (c) 2003-2005 The Regents of The University of Michigan
4// All rights reserved.
5//
6// Redistribution and use in source and binary forms, with or without
7// modification, are permitted provided that the following conditions are
8// met: redistributions of source code must retain the above copyright

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

60
61 std::string
62 generateDisassembly(Addr pc, const SymbolTable *symtab) const;
63
64 public:
65
66 const StaticInstPtr &eaCompInst() const { return eaCompPtr; }
67 const StaticInstPtr &memAccInst() const { return memAccPtr; }
1// -*- mode:c++ -*-
2
3// Copyright (c) 2003-2005 The Regents of The University of Michigan
4// All rights reserved.
5//
6// Redistribution and use in source and binary forms, with or without
7// modification, are permitted provided that the following conditions are
8// met: redistributions of source code must retain the above copyright

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

60
61 std::string
62 generateDisassembly(Addr pc, const SymbolTable *symtab) const;
63
64 public:
65
66 const StaticInstPtr &eaCompInst() const { return eaCompPtr; }
67 const StaticInstPtr &memAccInst() const { return memAccPtr; }
68
69 Request::Flags memAccFlags() { return memAccessFlags; }
68 };
69
70 /**
71 * Base class for memory-format instructions using a 32-bit
72 * displacement (i.e. most of them).
73 */
74 class MemoryDisp32 : public Memory
75 {

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

171 /// Constructor.
172 %(class_name)s(ExtMachInst machInst);
173
174 %(BasicExecDeclare)s
175
176 %(InitiateAccDeclare)s
177
178 %(CompleteAccDeclare)s
70 };
71
72 /**
73 * Base class for memory-format instructions using a 32-bit
74 * displacement (i.e. most of them).
75 */
76 class MemoryDisp32 : public Memory
77 {

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

173 /// Constructor.
174 %(class_name)s(ExtMachInst machInst);
175
176 %(BasicExecDeclare)s
177
178 %(InitiateAccDeclare)s
179
180 %(CompleteAccDeclare)s
181
182 %(MemAccSizeDeclare)s
179 };
180}};
181
182
183def template InitiateAccDeclare {{
184 Fault initiateAcc(%(CPU_exec_context)s *, Trace::InstRecord *) const;
185}};
186
187
188def template CompleteAccDeclare {{
189 Fault completeAcc(PacketPtr, %(CPU_exec_context)s *,
190 Trace::InstRecord *) const;
191}};
192
183 };
184}};
185
186
187def template InitiateAccDeclare {{
188 Fault initiateAcc(%(CPU_exec_context)s *, Trace::InstRecord *) const;
189}};
190
191
192def template CompleteAccDeclare {{
193 Fault completeAcc(PacketPtr, %(CPU_exec_context)s *,
194 Trace::InstRecord *) const;
195}};
196
197def template MemAccSizeDeclare {{
198 int memAccSize(%(CPU_exec_context)s *xc);
199}};
193
200
201def template MiscMemAccSize {{
202 int %(class_name)s::memAccSize(%(CPU_exec_context)s *xc)
203 {
204 panic("Misc instruction does not support split access method!");
205 return 0;
206 }
207}};
208
209def template LoadStoreMemAccSize {{
210 int %(class_name)s::memAccSize(%(CPU_exec_context)s *xc)
211 {
212 // Return the memory access size in bytes
213 return (%(mem_acc_size)d / 8);
214 }
215}};
216
194def template EACompConstructor {{
195 /** TODO: change op_class to AddrGenOp or something (requires
196 * creating new member of OpClass enum in op_class.hh, updating
197 * config files, etc.). */
198 inline %(class_name)s::EAComp::EAComp(ExtMachInst machInst)
199 : %(base_class)s("%(mnemonic)s (EAComp)", machInst, IntAluOp)
200 {
201 %(constructor)s;

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

615 Trace::InstRecord *traceData) const
616 {
617 warn("Misc instruction does not support split access method!");
618
619 return NoFault;
620 }
621}};
622
217def template EACompConstructor {{
218 /** TODO: change op_class to AddrGenOp or something (requires
219 * creating new member of OpClass enum in op_class.hh, updating
220 * config files, etc.). */
221 inline %(class_name)s::EAComp::EAComp(ExtMachInst machInst)
222 : %(base_class)s("%(mnemonic)s (EAComp)", machInst, IntAluOp)
223 {
224 %(constructor)s;

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

638 Trace::InstRecord *traceData) const
639 {
640 warn("Misc instruction does not support split access method!");
641
642 return NoFault;
643 }
644}};
645
646def template MiscMemAccSize {{
647 int %(class_name)s::memAccSize(%(CPU_exec_context)s *xc)
648 {
649 panic("Misc instruction does not support split access method!");
650 return 0;
651 }
652}};
653
623// load instructions use Ra as dest, so check for
624// Ra == 31 to detect nops
625def template LoadNopCheckDecode {{
626 {
627 AlphaStaticInst *i = new %(class_name)s(machInst);
628 if (RA == 31) {
629 i = makeNop(i);
630 }

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

688 # corresponding Store template..
689 StoreCondInitiateAcc = StoreInitiateAcc
690
691 memAccExecTemplate = eval(exec_template_base + 'MemAccExecute')
692 fullExecTemplate = eval(exec_template_base + 'Execute')
693 initiateAccTemplate = eval(exec_template_base + 'InitiateAcc')
694 completeAccTemplate = eval(exec_template_base + 'CompleteAcc')
695
654// load instructions use Ra as dest, so check for
655// Ra == 31 to detect nops
656def template LoadNopCheckDecode {{
657 {
658 AlphaStaticInst *i = new %(class_name)s(machInst);
659 if (RA == 31) {
660 i = makeNop(i);
661 }

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

719 # corresponding Store template..
720 StoreCondInitiateAcc = StoreInitiateAcc
721
722 memAccExecTemplate = eval(exec_template_base + 'MemAccExecute')
723 fullExecTemplate = eval(exec_template_base + 'Execute')
724 initiateAccTemplate = eval(exec_template_base + 'InitiateAcc')
725 completeAccTemplate = eval(exec_template_base + 'CompleteAcc')
726
727 if (exec_template_base == 'Load' or exec_template_base == 'Store'):
728 memAccSizeTemplate = eval('LoadStoreMemAccSize')
729 else:
730 memAccSizeTemplate = eval('MiscMemAccSize')
731
696 # (header_output, decoder_output, decode_block, exec_output)
697 return (LoadStoreDeclare.subst(iop),
698 EACompConstructor.subst(ea_iop)
699 + MemAccConstructor.subst(memacc_iop)
700 + LoadStoreConstructor.subst(iop),
701 decode_template.subst(iop),
702 EACompExecute.subst(ea_iop)
703 + memAccExecTemplate.subst(memacc_iop)
704 + fullExecTemplate.subst(iop)
705 + initiateAccTemplate.subst(iop)
732 # (header_output, decoder_output, decode_block, exec_output)
733 return (LoadStoreDeclare.subst(iop),
734 EACompConstructor.subst(ea_iop)
735 + MemAccConstructor.subst(memacc_iop)
736 + LoadStoreConstructor.subst(iop),
737 decode_template.subst(iop),
738 EACompExecute.subst(ea_iop)
739 + memAccExecTemplate.subst(memacc_iop)
740 + fullExecTemplate.subst(iop)
741 + initiateAccTemplate.subst(iop)
706 + completeAccTemplate.subst(iop))
742 + completeAccTemplate.subst(iop)
743 + memAccSizeTemplate.subst(memacc_iop))
707}};
708
709def format LoadOrNop(memacc_code, ea_code = {{ EA = Rb + disp; }},
710 mem_flags = [], inst_flags = []) {{
711 (header_output, decoder_output, decode_block, exec_output) = \
712 LoadStoreBase(name, Name, ea_code, memacc_code, mem_flags, inst_flags,
713 decode_template = LoadNopCheckDecode,
714 exec_template_base = 'Load')

--- 60 unchanged lines hidden ---
744}};
745
746def format LoadOrNop(memacc_code, ea_code = {{ EA = Rb + disp; }},
747 mem_flags = [], inst_flags = []) {{
748 (header_output, decoder_output, decode_block, exec_output) = \
749 LoadStoreBase(name, Name, ea_code, memacc_code, mem_flags, inst_flags,
750 decode_template = LoadNopCheckDecode,
751 exec_template_base = 'Load')

--- 60 unchanged lines hidden ---