isa_traits.hh revision 9057
16691Stjones1@inf.ed.ac.uk/*
26691Stjones1@inf.ed.ac.uk * Copyright (c) 2003-2005 The Regents of The University of Michigan
36691Stjones1@inf.ed.ac.uk * Copyright (c) 2007-2008 The Florida State University
46691Stjones1@inf.ed.ac.uk * Copyright (c) 2009 The University of Edinburgh
56691Stjones1@inf.ed.ac.uk * All rights reserved.
66691Stjones1@inf.ed.ac.uk *
76691Stjones1@inf.ed.ac.uk * Redistribution and use in source and binary forms, with or without
86691Stjones1@inf.ed.ac.uk * modification, are permitted provided that the following conditions are
96691Stjones1@inf.ed.ac.uk * met: redistributions of source code must retain the above copyright
106691Stjones1@inf.ed.ac.uk * notice, this list of conditions and the following disclaimer;
116691Stjones1@inf.ed.ac.uk * redistributions in binary form must reproduce the above copyright
126691Stjones1@inf.ed.ac.uk * notice, this list of conditions and the following disclaimer in the
136691Stjones1@inf.ed.ac.uk * documentation and/or other materials provided with the distribution;
146691Stjones1@inf.ed.ac.uk * neither the name of the copyright holders nor the names of its
156691Stjones1@inf.ed.ac.uk * contributors may be used to endorse or promote products derived from
166691Stjones1@inf.ed.ac.uk * this software without specific prior written permission.
176691Stjones1@inf.ed.ac.uk *
186691Stjones1@inf.ed.ac.uk * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
196691Stjones1@inf.ed.ac.uk * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
206691Stjones1@inf.ed.ac.uk * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
216691Stjones1@inf.ed.ac.uk * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
226691Stjones1@inf.ed.ac.uk * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
236691Stjones1@inf.ed.ac.uk * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
246691Stjones1@inf.ed.ac.uk * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
256691Stjones1@inf.ed.ac.uk * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
266691Stjones1@inf.ed.ac.uk * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
276691Stjones1@inf.ed.ac.uk * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
286691Stjones1@inf.ed.ac.uk * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
296691Stjones1@inf.ed.ac.uk *
306691Stjones1@inf.ed.ac.uk * Authors: Timothy M. Jones
316691Stjones1@inf.ed.ac.uk *          Gabe Black
326691Stjones1@inf.ed.ac.uk *          Stephen Hines
336691Stjones1@inf.ed.ac.uk */
346691Stjones1@inf.ed.ac.uk
356691Stjones1@inf.ed.ac.uk#ifndef __ARCH_POWER_ISA_TRAITS_HH__
366691Stjones1@inf.ed.ac.uk#define __ARCH_POWER_ISA_TRAITS_HH__
376691Stjones1@inf.ed.ac.uk
386691Stjones1@inf.ed.ac.uk#include "arch/power/types.hh"
396691Stjones1@inf.ed.ac.uk#include "base/types.hh"
408542Sgblack@eecs.umich.edu#include "cpu/static_inst_fwd.hh"
416691Stjones1@inf.ed.ac.uk
427811Ssteve.reinhardt@amd.comnamespace BigEndianGuest {}
436691Stjones1@inf.ed.ac.uk
446691Stjones1@inf.ed.ac.uknamespace PowerISA
456691Stjones1@inf.ed.ac.uk{
466691Stjones1@inf.ed.ac.uk
476691Stjones1@inf.ed.ac.ukusing namespace BigEndianGuest;
486691Stjones1@inf.ed.ac.uk
496691Stjones1@inf.ed.ac.ukStaticInstPtr decodeInst(ExtMachInst);
506691Stjones1@inf.ed.ac.uk
516691Stjones1@inf.ed.ac.uk// POWER DOES NOT have a delay slot
526691Stjones1@inf.ed.ac.uk#define ISA_HAS_DELAY_SLOT 0
536691Stjones1@inf.ed.ac.uk
546691Stjones1@inf.ed.ac.ukconst Addr PageShift = 12;
556691Stjones1@inf.ed.ac.ukconst Addr PageBytes = ULL(1) << PageShift;
566691Stjones1@inf.ed.ac.ukconst Addr Page_Mask = ~(PageBytes - 1);
576691Stjones1@inf.ed.ac.ukconst Addr PageOffset = PageBytes - 1;
586691Stjones1@inf.ed.ac.uk
596691Stjones1@inf.ed.ac.ukconst Addr PteShift = 3;
606691Stjones1@inf.ed.ac.ukconst Addr NPtePageShift = PageShift - PteShift;
616691Stjones1@inf.ed.ac.ukconst Addr NPtePage = ULL(1) << NPtePageShift;
626691Stjones1@inf.ed.ac.ukconst Addr PteMask = NPtePage - 1;
636691Stjones1@inf.ed.ac.uk
646691Stjones1@inf.ed.ac.ukconst int LogVMPageSize = 12;  // 4K bytes
656691Stjones1@inf.ed.ac.ukconst int VMPageSize = (1 << LogVMPageSize);
666691Stjones1@inf.ed.ac.uk
676691Stjones1@inf.ed.ac.ukconst int MachineBytes = 4;
686691Stjones1@inf.ed.ac.uk
699057SAli.Saidi@ARM.com// This is ori 0, 0, 0
709057SAli.Saidi@ARM.comconst ExtMachInst NoopMachInst = 0x60000000;
716691Stjones1@inf.ed.ac.uk
726974Stjones1@inf.ed.ac.uk// Memory accesses can be unaligned
736974Stjones1@inf.ed.ac.ukconst bool HasUnalignedMemAcc = true;
746974Stjones1@inf.ed.ac.uk
757811Ssteve.reinhardt@amd.com} // namespace PowerISA
766691Stjones1@inf.ed.ac.uk
776691Stjones1@inf.ed.ac.uk#endif // __ARCH_POWER_ISA_TRAITS_HH__
78