diff options
Diffstat (limited to 'src/arch/arm/isa/templates/misc.isa')
-rw-r--r-- | src/arch/arm/isa/templates/misc.isa | 83 |
1 files changed, 82 insertions, 1 deletions
diff --git a/src/arch/arm/isa/templates/misc.isa b/src/arch/arm/isa/templates/misc.isa index 0a23ba5d3..639ff3aca 100644 --- a/src/arch/arm/isa/templates/misc.isa +++ b/src/arch/arm/isa/templates/misc.isa @@ -1,6 +1,6 @@ // -*- mode:c++ -*- -// Copyright (c) 2010-2013 ARM Limited +// Copyright (c) 2010-2013,2017 ARM Limited // All rights reserved // // The license below extends only to copyright in the software and shall @@ -614,3 +614,84 @@ def template RegImmRegShiftOpConstructor {{ } }}; +def template MiscRegRegImmMemOpDeclare {{ + class %(class_name)s : public %(base_class)s + { + protected: + public: + // Constructor + %(class_name)s(ExtMachInst machInst, + MiscRegIndex _dest, IntRegIndex _op1, + uint64_t _imm); + Fault execute(ExecContext *, Trace::InstRecord *) const; + Fault initiateAcc(ExecContext *, Trace::InstRecord *) const; + Fault completeAcc(PacketPtr, ExecContext *, Trace::InstRecord *) const; + }; +}}; + +def template Mcr15Execute {{ + Fault %(class_name)s::execute(ExecContext *xc, + Trace::InstRecord *traceData) const + { + Addr EA; + Fault fault = NoFault; + + %(op_decl)s; + %(op_rd)s; + %(ea_code)s; + + if (%(predicate_test)s) { + if (fault == NoFault) { + %(memacc_code)s; + } + + if (fault == NoFault) { + Addr size = 64; + EA &= ~(size - 1); + fault = xc->writeMem(NULL, size, EA, memAccessFlags, NULL); + } + } else { + xc->setPredicate(false); + } + + return fault; + } +}}; + +def template Mcr15InitiateAcc {{ + Fault %(class_name)s::initiateAcc(ExecContext *xc, + Trace::InstRecord *traceData) const + { + Addr EA; + Fault fault = NoFault; + + %(op_decl)s; + %(op_rd)s; + %(ea_code)s; + + if (%(predicate_test)s) { + if (fault == NoFault) { + %(memacc_code)s; + } + + if (fault == NoFault) { + Addr size = 64; + EA &= ~(size - 1); + fault = xc->writeMem(NULL, size, EA, memAccessFlags, NULL); + } + } else { + xc->setPredicate(false); + } + + return fault; + } +}}; + +def template Mcr15CompleteAcc {{ + Fault %(class_name)s::completeAcc(PacketPtr pkt, + ExecContext *xc, + Trace::InstRecord *traceData) const + { + return NoFault; + } +}}; |