impl.hh revision 3760
16019Shines@cs.fsu.edu/*
210037SARM gem5 Developers * Copyright (c) 2004-2005 The Regents of The University of Michigan
310037SARM gem5 Developers * All rights reserved.
410037SARM gem5 Developers *
510037SARM gem5 Developers * Redistribution and use in source and binary forms, with or without
610037SARM gem5 Developers * modification, are permitted provided that the following conditions are
710037SARM gem5 Developers * met: redistributions of source code must retain the above copyright
810037SARM gem5 Developers * notice, this list of conditions and the following disclaimer;
910037SARM gem5 Developers * redistributions in binary form must reproduce the above copyright
1010037SARM gem5 Developers * notice, this list of conditions and the following disclaimer in the
1110037SARM gem5 Developers * documentation and/or other materials provided with the distribution;
1210037SARM gem5 Developers * neither the name of the copyright holders nor the names of its
1310037SARM gem5 Developers * contributors may be used to endorse or promote products derived from
146019Shines@cs.fsu.edu * this software without specific prior written permission.
156019Shines@cs.fsu.edu *
166019Shines@cs.fsu.edu * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
176019Shines@cs.fsu.edu * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
186019Shines@cs.fsu.edu * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
196019Shines@cs.fsu.edu * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
206019Shines@cs.fsu.edu * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
216019Shines@cs.fsu.edu * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
226019Shines@cs.fsu.edu * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
236019Shines@cs.fsu.edu * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
246019Shines@cs.fsu.edu * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
256019Shines@cs.fsu.edu * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
266019Shines@cs.fsu.edu * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
276019Shines@cs.fsu.edu *
286019Shines@cs.fsu.edu * Authors: Gabe Black
296019Shines@cs.fsu.edu */
306019Shines@cs.fsu.edu
316019Shines@cs.fsu.edu#ifndef __CPU_O3_SPARC_IMPL_HH__
326019Shines@cs.fsu.edu#define __CPU_O3_SPARC_IMPL_HH__
336019Shines@cs.fsu.edu
346019Shines@cs.fsu.edu#include "arch/sparc/isa_traits.hh"
356019Shines@cs.fsu.edu
366019Shines@cs.fsu.edu#include "cpu/o3/sparc/params.hh"
376019Shines@cs.fsu.edu#include "cpu/o3/cpu_policy.hh"
386019Shines@cs.fsu.edu
396019Shines@cs.fsu.edu
406019Shines@cs.fsu.edu// Forward declarations.
416019Shines@cs.fsu.edutemplate <class Impl>
426019Shines@cs.fsu.educlass SparcDynInst;
436019Shines@cs.fsu.edu
446019Shines@cs.fsu.edutemplate <class Impl>
456019Shines@cs.fsu.educlass SparcO3CPU;
4610037SARM gem5 Developers
4710037SARM gem5 Developers/** Implementation specific struct that defines several key types to the
486019Shines@cs.fsu.edu *  CPU, the stages within the CPU, the time buffers, and the DynInst.
496019Shines@cs.fsu.edu *  The struct defines the ISA, the CPU policy, the specific DynInst, the
5010037SARM gem5 Developers *  specific O3CPU, and all of the structs from the time buffers to do
5110037SARM gem5 Developers *  communication.
5210037SARM gem5 Developers *  This is one of the key things that must be defined for each hardware
5310037SARM gem5 Developers *  specific CPU implementation.
5410037SARM gem5 Developers */
5510037SARM gem5 Developersstruct SparcSimpleImpl
5610037SARM gem5 Developers{
5710037SARM gem5 Developers    /** The type of MachInst. */
5810037SARM gem5 Developers    typedef TheISA::MachInst MachInst;
5910037SARM gem5 Developers
6010037SARM gem5 Developers    /** The CPU policy to be used, which defines all of the CPU stages. */
6110037SARM gem5 Developers    typedef SimpleCPUPolicy<SparcSimpleImpl> CPUPol;
6210037SARM gem5 Developers
6310037SARM gem5 Developers    /** The DynInst type to be used. */
6410037SARM gem5 Developers    typedef SparcDynInst<SparcSimpleImpl> DynInst;
6510037SARM gem5 Developers
6610037SARM gem5 Developers    /** The refcounted DynInst pointer to be used.  In most cases this is
676019Shines@cs.fsu.edu     *  what should be used, and not DynInst *.
6810037SARM gem5 Developers     */
696019Shines@cs.fsu.edu    typedef RefCountingPtr<DynInst> DynInstPtr;
706019Shines@cs.fsu.edu
7110037SARM gem5 Developers    /** The O3CPU type to be used. */
7210037SARM gem5 Developers    typedef SparcO3CPU<SparcSimpleImpl> O3CPU;
736019Shines@cs.fsu.edu
748216Ssaidi@eecs.umich.edu    /** Same typedef, but for CPUType.  BaseDynInst may not always use
756233Sgblack@eecs.umich.edu     * an O3 CPU, so it's clearer to call it CPUType instead in that
769552Sandreas.hansson@arm.com     * case.
779552Sandreas.hansson@arm.com     */
786019Shines@cs.fsu.edu    typedef O3CPU CPUType;
796233Sgblack@eecs.umich.edu
806233Sgblack@eecs.umich.edu    /** The Params to be passed to each stage. */
816233Sgblack@eecs.umich.edu    typedef SparcSimpleParams Params;
8210037SARM gem5 Developers
8310037SARM gem5 Developers    enum {
846019Shines@cs.fsu.edu      MaxWidth = 8,
8510037SARM gem5 Developers      MaxThreads = 4
8610037SARM gem5 Developers    };
8710037SARM gem5 Developers};
8810037SARM gem5 Developers
8910037SARM gem5 Developers/** The O3Impl to be used. */
9010037SARM gem5 Developerstypedef SparcSimpleImpl O3CPUImpl;
916232Sgblack@eecs.umich.edu
9210037SARM gem5 Developers#endif // __CPU_O3_SPARC_IMPL_HH__
9310037SARM gem5 Developers