diff options
Diffstat (limited to 'src/arch/sparc')
-rw-r--r-- | src/arch/sparc/isa/decoder.isa | 6 | ||||
-rw-r--r-- | src/arch/sparc/isa/formats/branch.isa | 5 | ||||
-rw-r--r-- | src/arch/sparc/isa/formats/mem/basicmem.isa | 6 | ||||
-rw-r--r-- | src/arch/sparc/isa/formats/mem/swap.isa | 2 | ||||
-rw-r--r-- | src/arch/sparc/isa/formats/mem/util.isa | 26 | ||||
-rw-r--r-- | src/arch/sparc/mt.hh | 71 | ||||
-rw-r--r-- | src/arch/sparc/registers.hh | 2 |
7 files changed, 114 insertions, 4 deletions
diff --git a/src/arch/sparc/isa/decoder.isa b/src/arch/sparc/isa/decoder.isa index 5ca015a8f..d15d1eb2b 100644 --- a/src/arch/sparc/isa/decoder.isa +++ b/src/arch/sparc/isa/decoder.isa @@ -141,7 +141,7 @@ decode OP default Unknown::unknown() IntReg midVal; R15 = midVal = (Pstate<3:> ? (PC)<31:0> : PC); NNPC = midVal + disp; - }}); + }},None, None, IsIndirectControl, IsCall); 0x2: decode OP3 { format IntOp { 0x00: add({{Rd = Rs1.sdw + Rs2_or_imm13;}}); @@ -1005,7 +1005,7 @@ decode OP default Unknown::unknown() Rd = PC; NNPC = target; } - }}); + }}, IsUncondControl, IsIndirectControl); 0x39: Branch::return({{ Addr target = Rs1 + Rs2_or_imm13; if (fault == NoFault) { @@ -1025,7 +1025,7 @@ decode OP default Unknown::unknown() Canrestore = Canrestore - 1; } } - }}); + }}, IsUncondControl, IsIndirectControl, IsReturn); 0x3A: decode CC { 0x0: Trap::tcci({{ diff --git a/src/arch/sparc/isa/formats/branch.isa b/src/arch/sparc/isa/formats/branch.isa index bf2d9a748..014c0d486 100644 --- a/src/arch/sparc/isa/formats/branch.isa +++ b/src/arch/sparc/isa/formats/branch.isa @@ -262,6 +262,9 @@ def format Branch(code, *opt_flags) {{ let {{ def doBranch(name, Name, base, cond, code, annul_code, fail, annul_fail, opt_flags): + if "IsIndirectControl" not in opt_flags: + opt_flags += ('IsDirectControl', ) + iop = InstObjParams(name, Name, base, {"code": code, "fail": fail, @@ -289,12 +292,14 @@ let {{ return (header_output, decoder_output, exec_output, decode_block) def doCondBranch(name, Name, base, cond, code, opt_flags): + opt_flags += ('IsCondControl', ) return doBranch(name, Name, base, cond, code, code, 'NNPC = NNPC; NPC = NPC;\n', 'NNPC = NPC + 8; NPC = NPC + 4;\n', opt_flags) def doUncondBranch(name, Name, base, code, annul_code, opt_flags): + opt_flags += ('IsUncondControl', ) return doBranch(name, Name, base, "true", code, annul_code, ";", ";", opt_flags) diff --git a/src/arch/sparc/isa/formats/mem/basicmem.isa b/src/arch/sparc/isa/formats/mem/basicmem.isa index c7bb3e435..5dcb955e3 100644 --- a/src/arch/sparc/isa/formats/mem/basicmem.isa +++ b/src/arch/sparc/isa/formats/mem/basicmem.isa @@ -1,3 +1,5 @@ +// -*- mode:c++ -*- + // Copyright (c) 2006-2007 The Regents of The University of Michigan // All rights reserved. // @@ -45,6 +47,8 @@ def template MemDeclare {{ %(BasicExecDeclare)s + %(EACompDeclare)s + %(InitiateAccDeclare)s %(CompleteAccDeclare)s @@ -69,6 +73,8 @@ let {{ exec_output = doDualSplitExecute(code, postacc_code, addrCalcReg, addrCalcImm, execute, faultCode, name, name + "Imm", Name, Name + "Imm", asi, opt_flags) + exec_output += EACompExecute.subst(iop); + exec_output += EACompExecute.subst(iop_imm); return (header_output, decoder_output, exec_output, decode_block) }}; diff --git a/src/arch/sparc/isa/formats/mem/swap.isa b/src/arch/sparc/isa/formats/mem/swap.isa index 1ab82da59..99bbf3a68 100644 --- a/src/arch/sparc/isa/formats/mem/swap.isa +++ b/src/arch/sparc/isa/formats/mem/swap.isa @@ -163,7 +163,7 @@ let {{ "EA_trunc" : TruncateEA} exec_output = doSplitExecute(execute, name, Name, mem_flags, ["IsStoreConditional"], microParams); - return (header_output, decoder_output, exec_output, decode_block) + return (header_output, decoder_output, exec_output + EACompExecute.subst(iop), decode_block) }}; diff --git a/src/arch/sparc/isa/formats/mem/util.isa b/src/arch/sparc/isa/formats/mem/util.isa index ca673566b..aaa04b4bf 100644 --- a/src/arch/sparc/isa/formats/mem/util.isa +++ b/src/arch/sparc/isa/formats/mem/util.isa @@ -260,6 +260,32 @@ def template StoreCompleteAcc {{ } }}; +def template EACompExecute {{ + Fault + %(class_name)s::eaComp(%(CPU_exec_context)s *xc, + Trace::InstRecord *traceData) const + { + Addr EA; + Fault fault = NoFault; + %(op_decl)s; + %(op_rd)s; + %(ea_code)s; + %(fault_check)s; + + // NOTE: Trace Data is written using execute or completeAcc templates + if (fault == NoFault) { + %(EA_trunc)s + xc->setEA(EA); + } + + return fault; + } +}}; + +def template EACompDeclare {{ + Fault eaComp(%(CPU_exec_context)s *, Trace::InstRecord *) const; +}}; + // This delcares the initiateAcc function in memory operations def template InitiateAccDeclare {{ Fault initiateAcc(%(CPU_exec_context)s *, Trace::InstRecord *) const; diff --git a/src/arch/sparc/mt.hh b/src/arch/sparc/mt.hh new file mode 100644 index 000000000..8b3d97aad --- /dev/null +++ b/src/arch/sparc/mt.hh @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2011 The Regents of The University of Michigan + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer; + * redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution; + * neither the name of the copyright holders nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: Korey Sewell + * + */ + +#ifndef __ARCH_SPARC_MT_HH__ +#define __ARCH_SPARC_MT_HH__ + +/** + * @file + * + * ISA-specific helper functions for multithreaded execution. + */ + +#include <iostream> + +#include "arch/isa_traits.hh" +#include "base/bitfield.hh" +#include "base/misc.hh" +#include "base/trace.hh" +using namespace std; + +namespace SparcISA +{ + +template <class TC> +inline unsigned +getVirtProcNum(TC *tc) +{ + fatal("Sparc is not setup for multithreaded ISA extensions"); + return 0; +} + + +template <class TC> +inline unsigned +getTargetThread(TC *tc) +{ + fatal("Sparc is not setup for multithreaded ISA extensions"); + return 0; +} + +} // namespace SparcISA + +#endif diff --git a/src/arch/sparc/registers.hh b/src/arch/sparc/registers.hh index bb0f2bb89..f4305dc1a 100644 --- a/src/arch/sparc/registers.hh +++ b/src/arch/sparc/registers.hh @@ -77,6 +77,8 @@ const int SyscallPseudoReturnReg = 9; const int NumIntArchRegs = 32; const int NumIntRegs = (MaxGL + 1) * 8 + NWindows * 16 + NumMicroIntRegs; +const int TotalNumRegs = NumIntRegs + NumFloatRegs + NumMiscRegs; + } // namespace SparcISA #endif |