From: Gabe Black Date: Wed, 8 Nov 2006 13:19:52 +0000 (-0500) Subject: Merge zeep.eecs.umich.edu:/home/gblack/m5/newmem X-Git-Tag: m5_2.0_beta2~53^2~13 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b82fa633bb9a9bf72b724dcf202985f37ab1d8b8;p=gem5.git Merge zeep.eecs.umich.edu:/home/gblack/m5/newmem into zeep.eecs.umich.edu:/home/gblack/m5/newmemmemops src/arch/sparc/faults.hh: Hand merged. --HG-- extra : convert_revision : 1bcefe47fa98e878a0dfbcfa5869b5b171927911 --- b82fa633bb9a9bf72b724dcf202985f37ab1d8b8 diff --cc src/arch/sparc/faults.hh index b25b7706e,22f83c1e5..677f8e77e --- a/src/arch/sparc/faults.hh +++ b/src/arch/sparc/faults.hh @@@ -118,504 -113,120 +113,124 @@@ static inline Fault genAlignmentFault( return new MemAddressNotAligned; } - class PowerOnReset : public SparcFault -class PowerOnReset : public SparcFault {}; ++class PowerOnReset : public SparcFault +{ - private: - static FaultName _name; - static TrapType _trapType; - static FaultPriority _priority; - static FaultStat _count; - public: - FaultName name() {return _name;} - TrapType trapType() {return _trapType;} - FaultPriority priority() {return _priority;} - FaultStat & countStat() {return _count;} + void invoke(ThreadContext * tc); +}; - class WatchDogReset : public SparcFault - { - private: - static FaultName _name; - static TrapType _trapType; - static FaultPriority _priority; - static FaultStat _count; - public: - FaultName name() {return _name;} - TrapType trapType() {return _trapType;} - FaultPriority priority() {return _priority;} - FaultStat & countStat() {return _count;} - }; + class WatchDogReset : public SparcFault {}; - class ExternallyInitiatedReset : public SparcFault - { - private: - static FaultName _name; - static TrapType _trapType; - static FaultPriority _priority; - static FaultStat _count; - public: - FaultName name() {return _name;} - TrapType trapType() {return _trapType;} - FaultPriority priority() {return _priority;} - FaultStat & countStat() {return _count;} - }; + class ExternallyInitiatedReset : public SparcFault {}; - class SoftwareInitiatedReset : public SparcFault - { - private: - static FaultName _name; - static TrapType _trapType; - static FaultPriority _priority; - static FaultStat _count; - public: - FaultName name() {return _name;} - TrapType trapType() {return _trapType;} - FaultPriority priority() {return _priority;} - FaultStat & countStat() {return _count;} - }; + class SoftwareInitiatedReset : public SparcFault {}; - class REDStateException : public SparcFault - { - private: - static FaultName _name; - static TrapType _trapType; - static FaultPriority _priority; - static FaultStat _count; - public: - FaultName name() {return _name;} - TrapType trapType() {return _trapType;} - FaultPriority priority() {return _priority;} - FaultStat & countStat() {return _count;} - }; + class REDStateException : public SparcFault {}; - class InstructionAccessException : public SparcFault - { - private: - static FaultName _name; - static TrapType _trapType; - static FaultPriority _priority; - static FaultStat _count; - public: - FaultName name() {return _name;} - TrapType trapType() {return _trapType;} - FaultPriority priority() {return _priority;} - FaultStat & countStat() {return _count;} - }; + class InstructionAccessException : public SparcFault {}; - class InstructionAccessMMUMiss : public SparcFault - { - private: - static FaultName _name; - static TrapType _trapType; - static FaultPriority _priority; - static FaultStat _count; - public: - FaultName name() {return _name;} - TrapType trapType() {return _trapType;} - FaultPriority priority() {return _priority;} - FaultStat & countStat() {return _count;} - }; + class InstructionAccessMMUMiss : public SparcFault {}; - class InstructionAccessError : public SparcFault - { - private: - static FaultName _name; - static TrapType _trapType; - static FaultPriority _priority; - static FaultStat _count; - public: - FaultName name() {return _name;} - TrapType trapType() {return _trapType;} - FaultPriority priority() {return _priority;} - FaultStat & countStat() {return _count;} - }; + class InstructionAccessError : public SparcFault {}; - class IllegalInstruction : public SparcFault - { - private: - static FaultName _name; - static TrapType _trapType; - static FaultPriority _priority; - static FaultStat _count; - public: - FaultName name() {return _name;} - TrapType trapType() {return _trapType;} - FaultPriority priority() {return _priority;} - FaultStat & countStat() {return _count;} - }; + class IllegalInstruction : public SparcFault {}; - class PrivilegedOpcode : public SparcFault - { - private: - static FaultName _name; - static TrapType _trapType; - static FaultPriority _priority; - static FaultStat _count; - public: - FaultName name() {return _name;} - TrapType trapType() {return _trapType;} - FaultPriority priority() {return _priority;} - FaultStat & countStat() {return _count;} - }; + class PrivilegedOpcode : public SparcFault {}; - class UnimplementedLDD : public SparcFault - { - private: - static FaultName _name; - static TrapType _trapType; - static FaultPriority _priority; - static FaultStat _count; - public: - FaultName name() {return _name;} - TrapType trapType() {return _trapType;} - FaultPriority priority() {return _priority;} - FaultStat & countStat() {return _count;} - }; + class UnimplementedLDD : public SparcFault {}; - class UnimplementedSTD : public SparcFault - { - private: - static FaultName _name; - static TrapType _trapType; - static FaultPriority _priority; - static FaultStat _count; - public: - FaultName name() {return _name;} - TrapType trapType() {return _trapType;} - FaultPriority priority() {return _priority;} - FaultStat & countStat() {return _count;} - }; + class UnimplementedSTD : public SparcFault {}; - class FpDisabled : public SparcFault - { - private: - static FaultName _name; - static TrapType _trapType; - static FaultPriority _priority; - static FaultStat _count; - public: - FaultName name() {return _name;} - TrapType trapType() {return _trapType;} - FaultPriority priority() {return _priority;} - FaultStat & countStat() {return _count;} - }; + class FpDisabled : public SparcFault {}; - class FpExceptionIEEE754 : public SparcFault - { - private: - static FaultName _name; - static TrapType _trapType; - static FaultPriority _priority; - static FaultStat _count; - public: - FaultName name() {return _name;} - TrapType trapType() {return _trapType;} - FaultPriority priority() {return _priority;} - FaultStat & countStat() {return _count;} - }; + class FpExceptionIEEE754 : public SparcFault {}; - class FpExceptionOther : public SparcFault - { - private: - static FaultName _name; - static TrapType _trapType; - static FaultPriority _priority; - static FaultStat _count; - public: - FaultName name() {return _name;} - TrapType trapType() {return _trapType;} - FaultPriority priority() {return _priority;} - FaultStat & countStat() {return _count;} - }; + class FpExceptionOther : public SparcFault {}; - class TagOverflow : public SparcFault - { - private: - static FaultName _name; - static TrapType _trapType; - static FaultPriority _priority; - static FaultStat _count; - public: - FaultName name() {return _name;} - TrapType trapType() {return _trapType;} - FaultPriority priority() {return _priority;} - FaultStat & countStat() {return _count;} - }; + class TagOverflow : public SparcFault {}; - class DivisionByZero : public SparcFault - { - private: - static FaultName _name; - static TrapType _trapType; - static FaultPriority _priority; - static FaultStat _count; - public: - FaultName name() {return _name;} - TrapType trapType() {return _trapType;} - FaultPriority priority() {return _priority;} - FaultStat & countStat() {return _count;} - }; + class DivisionByZero : public SparcFault {}; - class DataAccessException : public SparcFault - { - private: - static FaultName _name; - static TrapType _trapType; - static FaultPriority _priority; - static FaultStat _count; - public: - FaultName name() {return _name;} - TrapType trapType() {return _trapType;} - FaultPriority priority() {return _priority;} - FaultStat & countStat() {return _count;} - }; + class DataAccessException : public SparcFault {}; - class DataAccessMMUMiss : public SparcFault - { - private: - static FaultName _name; - static TrapType _trapType; - static FaultPriority _priority; - static FaultStat _count; - public: - FaultName name() {return _name;} - TrapType trapType() {return _trapType;} - FaultPriority priority() {return _priority;} - FaultStat & countStat() {return _count;} - }; + class DataAccessMMUMiss : public SparcFault {}; - class DataAccessError : public SparcFault - { - private: - static FaultName _name; - static TrapType _trapType; - static FaultPriority _priority; - static FaultStat _count; - public: - FaultName name() {return _name;} - TrapType trapType() {return _trapType;} - FaultPriority priority() {return _priority;} - FaultStat & countStat() {return _count;} - }; + class DataAccessError : public SparcFault {}; - class DataAccessProtection : public SparcFault - { - private: - static FaultName _name; - static TrapType _trapType; - static FaultPriority _priority; - static FaultStat _count; - public: - FaultName name() {return _name;} - TrapType trapType() {return _trapType;} - FaultPriority priority() {return _priority;} - FaultStat & countStat() {return _count;} - }; + class DataAccessProtection : public SparcFault {}; - class LDDFMemAddressNotAligned : public SparcFault - { - private: - static FaultName _name; - static TrapType _trapType; - static FaultPriority _priority; - static FaultStat _count; - public: - FaultName name() {return _name;} - TrapType trapType() {return _trapType;} - FaultPriority priority() {return _priority;} - FaultStat & countStat() {return _count;} - }; + class LDDFMemAddressNotAligned : public SparcFault {}; - class STDFMemAddressNotAligned : public SparcFault - { - private: - static FaultName _name; - static TrapType _trapType; - static FaultPriority _priority; - static FaultStat _count; - public: - FaultName name() {return _name;} - TrapType trapType() {return _trapType;} - FaultPriority priority() {return _priority;} - FaultStat & countStat() {return _count;} - }; + class STDFMemAddressNotAligned : public SparcFault {}; - class PrivilegedAction : public SparcFault - { - private: - static FaultName _name; - static TrapType _trapType; - static FaultPriority _priority; - static FaultStat _count; - public: - FaultName name() {return _name;} - TrapType trapType() {return _trapType;} - FaultPriority priority() {return _priority;} - FaultStat & countStat() {return _count;} - }; + class PrivilegedAction : public SparcFault {}; - class LDQFMemAddressNotAligned : public SparcFault - { - private: - static FaultName _name; - static TrapType _trapType; - static FaultPriority _priority; - static FaultStat _count; - public: - FaultName name() {return _name;} - TrapType trapType() {return _trapType;} - FaultPriority priority() {return _priority;} - FaultStat & countStat() {return _count;} - }; + class LDQFMemAddressNotAligned : public SparcFault {}; - class STQFMemAddressNotAligned : public SparcFault - { - private: - static FaultName _name; - static TrapType _trapType; - static FaultPriority _priority; - static FaultStat _count; - public: - FaultName name() {return _name;} - TrapType trapType() {return _trapType;} - FaultPriority priority() {return _priority;} - FaultStat & countStat() {return _count;} - }; + class STQFMemAddressNotAligned : public SparcFault {}; - class AsyncDataError : public SparcFault - { - private: - static FaultName _name; - static TrapType _trapType; - static FaultPriority _priority; - static FaultStat _count; - public: - FaultName name() {return _name;} - TrapType trapType() {return _trapType;} - FaultPriority priority() {return _priority;} - FaultStat & countStat() {return _count;} - }; + class AsyncDataError : public SparcFault {}; - class CleanWindow : public SparcFault - { - private: - static FaultName _name; - static TrapType _trapType; - static FaultPriority _priority; - static FaultStat _count; - public: - FaultName name() {return _name;} - TrapType trapType() {return _trapType;} - FaultPriority priority() {return _priority;} - FaultStat & countStat() {return _count;} - }; + class CleanWindow : public SparcFault {}; - class EnumeratedFault : public SparcFault + template + class EnumeratedFault : public SparcFault { protected: uint32_t _n; - virtual TrapType baseTrapType() = 0; public: - EnumeratedFault(uint32_t n) : SparcFault() {_n = n;} - TrapType trapType() {return baseTrapType() + _n;} + EnumeratedFault(uint32_t n) : SparcFault(), _n(n) {} + TrapType trapType() {return SparcFault::trapType() + _n;} }; - class InterruptLevelN : public EnumeratedFault + class InterruptLevelN : public EnumeratedFault { - private: - static FaultName _name; - static TrapType _baseTrapType; - static FaultStat _count; - TrapType baseTrapType() {return _baseTrapType;} public: - InterruptLevelN(uint32_t n) : EnumeratedFault(n) {;} - FaultName name() {return _name;} + InterruptLevelN(uint32_t n) : + EnumeratedFault(n) {;} FaultPriority priority() {return 32 - _n;} - FaultStat & countStat() {return _count;} }; - class SpillNNormal : public EnumeratedFault + class SpillNNormal : public EnumeratedFault { - private: - static FaultName _name; - static TrapType _baseTrapType; - static FaultPriority _priority; - static FaultStat _count; - TrapType baseTrapType() {return _baseTrapType;} public: - SpillNNormal(uint32_t n) : EnumeratedFault(n) {;} - FaultName name() {return _name;} - FaultPriority priority() {return _priority;} - FaultStat & countStat() {return _count;} + SpillNNormal(uint32_t n) : + EnumeratedFault(n) {;} + //These need to be handled specially to enable spill traps in SE +#if !FULL_SYSTEM void invoke(ThreadContext * tc); +#endif }; - class SpillNOther : public EnumeratedFault + class SpillNOther : public EnumeratedFault { - private: - static FaultName _name; - static TrapType _baseTrapType; - static FaultPriority _priority; - static FaultStat _count; - TrapType baseTrapType() {return _baseTrapType;} public: - SpillNOther(uint32_t n) : EnumeratedFault(n) {;} - FaultName name() {return _name;} - FaultPriority priority() {return _priority;} - FaultStat & countStat() {return _count;} + SpillNOther(uint32_t n) : + EnumeratedFault(n) {;} }; - class FillNNormal : public EnumeratedFault + class FillNNormal : public EnumeratedFault { - private: - static FaultName _name; - static TrapType _baseTrapType; - static FaultPriority _priority; - static FaultStat _count; - TrapType baseTrapType() {return _baseTrapType;} public: - FillNNormal(uint32_t n) : EnumeratedFault(n) {;} - FaultName name() {return _name;} - FaultPriority priority() {return _priority;} - FaultStat & countStat() {return _count;} + FillNNormal(uint32_t n) : + EnumeratedFault(n) {;} + //These need to be handled specially to enable fill traps in SE +#if !FULL_SYSTEM void invoke(ThreadContext * tc); +#endif }; - class FillNOther : public EnumeratedFault + class FillNOther : public EnumeratedFault { - private: - static FaultName _name; - static TrapType _baseTrapType; - static FaultPriority _priority; - static FaultStat _count; - TrapType baseTrapType() {return _baseTrapType;} public: - FillNOther(uint32_t n) : EnumeratedFault(n) {;} - FaultName name() {return _name;} - FaultPriority priority() {return _priority;} - FaultStat & countStat() {return _count;} + FillNOther(uint32_t n) : + EnumeratedFault(n) {;} }; - class TrapInstruction : public EnumeratedFault + class TrapInstruction : public EnumeratedFault { -- private: - static FaultName _name; - static TrapType _baseTrapType; - static FaultPriority _priority; - static FaultStat _count; - TrapType baseTrapType() {return _baseTrapType;} - uint64_t syscall_num; public: - TrapInstruction(int32_t n) : EnumeratedFault(n) {;} - FaultName name() {return _name;} - FaultPriority priority() {return _priority;} - FaultStat & countStat() {return _count;} + TrapInstruction(uint32_t n, uint64_t syscall) : + EnumeratedFault(n), syscall_num(syscall) {;} -#if !FULL_SYSTEM - void invoke(ThreadContext * tc); -#endif };