diff -r f681719e2e99 -r aede609c2ff0 src/arch/SConscript --- a/src/arch/SConscript Thu May 10 18:04:29 2012 -0500 +++ b/src/arch/SConscript Tue May 15 05:44:20 2012 -0700 @@ -44,6 +44,7 @@ # List of headers to generate isa_switch_hdrs = Split(''' + decoder.hh interrupts.hh isa.hh isa_traits.hh diff -r f681719e2e99 -r aede609c2ff0 src/arch/alpha/decoder.hh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/arch/alpha/decoder.hh Tue May 15 05:44:20 2012 -0700 @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2012 Google + * 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: Gabe Black + */ + +#ifndef __ARCH_ALPHA_DECODER_HH__ +#define __ARCH_ALPHA_DECODER_HH__ + +#include "arch/generic/decoder.hh" + +namespace AlphaISA +{ + +class Decoder : public GenericISA::Decoder +{}; + +} // namespace AlphaISA + +#endif // __ARCH_ALPHA_DECODER_HH__ diff -r f681719e2e99 -r aede609c2ff0 src/arch/alpha/remote_gdb.cc --- a/src/arch/alpha/remote_gdb.cc Thu May 10 18:04:29 2012 -0500 +++ b/src/arch/alpha/remote_gdb.cc Tue May 15 05:44:20 2012 -0700 @@ -122,6 +122,7 @@ #include +#include "arch/alpha/decoder.hh" #include "arch/alpha/kgdb.h" #include "arch/alpha/regredir.hh" #include "arch/alpha/remote_gdb.hh" @@ -131,7 +132,6 @@ #include "base/remote_gdb.hh" #include "base/socket.hh" #include "base/trace.hh" -#include "cpu/decode.hh" #include "cpu/static_inst.hh" #include "cpu/thread_context.hh" #include "debug/GDBAcc.hh" diff -r f681719e2e99 -r aede609c2ff0 src/arch/arm/decoder.hh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/arch/arm/decoder.hh Tue May 15 05:44:20 2012 -0700 @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2012 Google + * 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: Gabe Black + */ + +#ifndef __ARCH_ARM_DECODER_HH__ +#define __ARCH_ARM_DECODER_HH__ + +#include "arch/generic/decoder.hh" + +namespace ArmISA +{ + +class Decoder : public GenericISA::Decoder +{}; + +} // namespace ArmISA + +#endif // __ARCH_ARM_DECODER_HH__ diff -r f681719e2e99 -r aede609c2ff0 src/arch/arm/remote_gdb.cc --- a/src/arch/arm/remote_gdb.cc Thu May 10 18:04:29 2012 -0500 +++ b/src/arch/arm/remote_gdb.cc Tue May 15 05:44:20 2012 -0700 @@ -134,6 +134,7 @@ #include +#include "arch/arm/decoder.hh" #include "arch/arm/pagetable.hh" #include "arch/arm/registers.hh" #include "arch/arm/remote_gdb.hh" @@ -143,7 +144,6 @@ #include "base/remote_gdb.hh" #include "base/socket.hh" #include "base/trace.hh" -#include "cpu/decode.hh" #include "cpu/static_inst.hh" #include "cpu/thread_context.hh" #include "cpu/thread_state.hh" diff -r f681719e2e99 -r aede609c2ff0 src/arch/generic/SConscript --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/arch/generic/SConscript Tue May 15 05:44:20 2012 -0700 @@ -0,0 +1,31 @@ +# Copyright (c) 2012 Google +# 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: Gabe Black + +Import('*') + +Source('decoder.cc') diff -r f681719e2e99 -r aede609c2ff0 src/arch/generic/decoder.hh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/arch/generic/decoder.hh Tue May 15 05:44:20 2012 -0700 @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2011-2012 Google + * 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: Gabe Black + */ + +#ifndef __ARCH_GENERIC_DECODER_HH__ +#define __ARCH_GENERIC_DECODER_HH__ + +#include "arch/isa_traits.hh" +#include "arch/types.hh" +#include "config/the_isa.hh" +#include "cpu/decode_cache.hh" +#include "cpu/static_inst.hh" + +namespace GenericISA +{ + +/// The decoder class. This class doesn't do much of anything now, but in the +/// future it will be redefinable per ISA and allow more interesting behavior. +class Decoder +{ + protected: + /// A cache of decoded instruction objects. + static DecodeCache defaultCache; + + public: + /// Decode a machine instruction. + /// @param mach_inst The binary instruction to decode. + /// @retval A pointer to the corresponding StaticInst object. + StaticInstPtr + decode(TheISA::ExtMachInst mach_inst, Addr addr) + { + return defaultCache.decode(mach_inst, addr); + } +}; + +} // namespace GenericISA + +#endif // __ARCH_GENERIC_DECODER_HH__ diff -r f681719e2e99 -r aede609c2ff0 src/arch/generic/decoder.cc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/arch/generic/decoder.cc Tue May 15 05:44:20 2012 -0700 @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2011 Google + * 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: Gabe Black + */ + +#include "arch/generic/decoder.hh" + +namespace GenericISA +{ + +DecodeCache Decoder::defaultCache; + +} diff -r f681719e2e99 -r aede609c2ff0 src/arch/mips/decoder.hh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/arch/mips/decoder.hh Tue May 15 05:44:20 2012 -0700 @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2012 Google + * 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: Gabe Black + */ + +#ifndef __ARCH_MIPS_DECODER_HH__ +#define __ARCH_MIPS_DECODER_HH__ + +#include "arch/generic/decoder.hh" + +namespace MipsISA +{ + +class Decoder : public GenericISA::Decoder +{}; + +} // namespace MipsISA + +#endif // __ARCH_MIPS_DECODER_HH__ diff -r f681719e2e99 -r aede609c2ff0 src/arch/mips/remote_gdb.cc --- a/src/arch/mips/remote_gdb.cc Thu May 10 18:04:29 2012 -0500 +++ b/src/arch/mips/remote_gdb.cc Tue May 15 05:44:20 2012 -0700 @@ -135,9 +135,9 @@ #include +#include "arch/mips/decoder.hh" #include "arch/mips/remote_gdb.hh" #include "arch/mips/vtophys.hh" -#include "cpu/decode.hh" #include "cpu/thread_state.hh" #include "debug/GDBAcc.hh" #include "debug/GDBMisc.hh" diff -r f681719e2e99 -r aede609c2ff0 src/arch/power/decoder.hh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/arch/power/decoder.hh Tue May 15 05:44:20 2012 -0700 @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2012 Google + * 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: Gabe Black + */ + +#ifndef __ARCH_POWER_DECODER_HH__ +#define __ARCH_POWER_DECODER_HH__ + +#include "arch/generic/decoder.hh" + +namespace PowerISA +{ + +class Decoder : public GenericISA::Decoder +{}; + +} // namespace PowerISA + +#endif // __ARCH_POWER_DECODER_HH__ diff -r f681719e2e99 -r aede609c2ff0 src/arch/sparc/decoder.hh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/arch/sparc/decoder.hh Tue May 15 05:44:20 2012 -0700 @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2012 Google + * 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: Gabe Black + */ + +#ifndef __ARCH_SPARC_DECODER_HH__ +#define __ARCH_SPARC_DECODER_HH__ + +#include "arch/generic/decoder.hh" + +namespace SparcISA +{ + +class Decoder : public GenericISA::Decoder +{}; + +} // namespace SparcISA + +#endif // __ARCH_SPARC_DECODER_HH__ diff -r f681719e2e99 -r aede609c2ff0 src/arch/x86/decoder.hh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/arch/x86/decoder.hh Tue May 15 05:44:20 2012 -0700 @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2012 Google + * 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: Gabe Black + */ + +#ifndef __ARCH_X86_DECODER_HH__ +#define __ARCH_X86_DECODER_HH__ + +#include "arch/generic/decoder.hh" + +namespace X86ISA +{ + +class Decoder : public GenericISA::Decoder +{}; + +} // namespace X86ISA + +#endif // __ARCH_X86_DECODER_HH__ diff -r f681719e2e99 -r aede609c2ff0 src/cpu/SConscript --- a/src/cpu/SConscript Thu May 10 18:04:29 2012 -0500 +++ b/src/cpu/SConscript Tue May 15 05:44:20 2012 -0700 @@ -108,7 +108,6 @@ Source('activity.cc') Source('base.cc') Source('cpuevent.cc') -Source('decode.cc') Source('exetrace.cc') Source('func_unit.cc') Source('inteltrace.cc') diff -r f681719e2e99 -r aede609c2ff0 src/cpu/checker/thread_context.hh --- a/src/cpu/checker/thread_context.hh Thu May 10 18:04:29 2012 -0500 +++ b/src/cpu/checker/thread_context.hh Tue May 15 05:44:20 2012 -0700 @@ -55,6 +55,7 @@ namespace Kernel { class Statistics; }; + class Decoder; }; /** @@ -117,7 +118,7 @@ return checkerCPU; } - Decoder *getDecoderPtr() { return actualTC->getDecoderPtr(); } + TheISA::Decoder *getDecoderPtr() { return actualTC->getDecoderPtr(); } System *getSystemPtr() { return actualTC->getSystemPtr(); } diff -r f681719e2e99 -r aede609c2ff0 src/cpu/decode.hh --- a/src/cpu/decode.hh Thu May 10 18:04:29 2012 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2011 Google - * 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: Gabe Black - */ - -#ifndef __CPU_DECODE_HH__ -#define __CPU_DECODE_HH__ - -#include "arch/isa_traits.hh" -#include "arch/types.hh" -#include "config/the_isa.hh" -#include "cpu/decode_cache.hh" -#include "cpu/static_inst.hh" - -/// The decoder class. This class doesn't do much of anything now, but in the -/// future it will be redefinable per ISA and allow more interesting behavior. -class Decoder -{ - protected: - /// A cache of decoded instruction objects. - static DecodeCache cache; - - public: - /// Decode a machine instruction. - /// @param mach_inst The binary instruction to decode. - /// @retval A pointer to the corresponding StaticInst object. - StaticInstPtr - decode(TheISA::ExtMachInst mach_inst, Addr addr) - { - return cache.decode(mach_inst, addr); - } -}; - -#endif // __CPU_DECODE_HH__ diff -r f681719e2e99 -r aede609c2ff0 src/cpu/decode.cc --- a/src/cpu/decode.cc Thu May 10 18:04:29 2012 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2011 Google - * 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: Gabe Black - */ - -#include "cpu/decode.hh" - -DecodeCache Decoder::cache; diff -r f681719e2e99 -r aede609c2ff0 src/cpu/inorder/cpu.hh --- a/src/cpu/inorder/cpu.hh Thu May 10 18:04:29 2012 -0500 +++ b/src/cpu/inorder/cpu.hh Tue May 15 05:44:20 2012 -0700 @@ -342,7 +342,7 @@ TheISA::TLB *getITBPtr(); TheISA::TLB *getDTBPtr(); - Decoder *getDecoderPtr(); + TheISA::Decoder *getDecoderPtr(); /** Accessor Type for the SkedCache */ typedef uint32_t SkedID; diff -r f681719e2e99 -r aede609c2ff0 src/cpu/inorder/cpu.cc --- a/src/cpu/inorder/cpu.cc Thu May 10 18:04:29 2012 -0500 +++ b/src/cpu/inorder/cpu.cc Tue May 15 05:44:20 2012 -0700 @@ -1772,7 +1772,7 @@ return resPool->getDataUnit()->tlb(); } -Decoder * +TheISA::Decoder * InOrderCPU::getDecoderPtr() { return &resPool->getInstUnit()->decoder; diff -r f681719e2e99 -r aede609c2ff0 src/cpu/inorder/resources/fetch_unit.hh --- a/src/cpu/inorder/resources/fetch_unit.hh Thu May 10 18:04:29 2012 -0500 +++ b/src/cpu/inorder/resources/fetch_unit.hh Tue May 15 05:44:20 2012 -0700 @@ -36,10 +36,10 @@ #include #include +#include "arch/decoder.hh" #include "arch/predecoder.hh" #include "arch/tlb.hh" #include "config/the_isa.hh" -#include "cpu/decode.hh" #include "cpu/inorder/resources/cache_unit.hh" #include "cpu/inorder/inorder_dyn_inst.hh" #include "cpu/inorder/pipeline_traits.hh" @@ -89,7 +89,7 @@ void trap(Fault fault, ThreadID tid, DynInstPtr inst); - Decoder decoder; + TheISA::Decoder decoder; private: void squashCacheRequest(CacheReqPtr req_ptr); diff -r f681719e2e99 -r aede609c2ff0 src/cpu/inorder/thread_context.hh --- a/src/cpu/inorder/thread_context.hh Thu May 10 18:04:29 2012 -0500 +++ b/src/cpu/inorder/thread_context.hh Tue May 15 05:44:20 2012 -0700 @@ -83,7 +83,7 @@ */ CheckerCPU *getCheckerCpuPtr() { return NULL; } - Decoder *getDecoderPtr() { return cpu->getDecoderPtr(); } + TheISA::Decoder *getDecoderPtr() { return cpu->getDecoderPtr(); } System *getSystemPtr() { return cpu->system; } diff -r f681719e2e99 -r aede609c2ff0 src/cpu/legiontrace.cc --- a/src/cpu/legiontrace.cc Thu May 10 18:04:29 2012 -0500 +++ b/src/cpu/legiontrace.cc Tue May 15 05:44:20 2012 -0700 @@ -42,13 +42,13 @@ #include #include +#include "arch/sparc/decoder.hh" #include "arch/sparc/predecoder.hh" #include "arch/sparc/registers.hh" #include "arch/sparc/utility.hh" #include "arch/tlb.hh" #include "base/socket.hh" #include "cpu/base.hh" -#include "cpu/decode.hh" #include "cpu/legiontrace.hh" #include "cpu/static_inst.hh" #include "cpu/thread_context.hh" diff -r f681719e2e99 -r aede609c2ff0 src/cpu/o3/fetch.hh --- a/src/cpu/o3/fetch.hh Thu May 10 18:04:29 2012 -0500 +++ b/src/cpu/o3/fetch.hh Tue May 15 05:44:20 2012 -0700 @@ -44,11 +44,11 @@ #ifndef __CPU_O3_FETCH_HH__ #define __CPU_O3_FETCH_HH__ +#include "arch/decoder.hh" #include "arch/predecoder.hh" #include "arch/utility.hh" #include "base/statistics.hh" #include "config/the_isa.hh" -#include "cpu/decode.hh" #include "cpu/pc_event.hh" #include "cpu/timebuf.hh" #include "cpu/translation.hh" @@ -340,7 +340,7 @@ } /** The decoder. */ - Decoder decoder; + TheISA::Decoder decoder; private: DynInstPtr buildInst(ThreadID tid, StaticInstPtr staticInst, diff -r f681719e2e99 -r aede609c2ff0 src/cpu/o3/thread_context.hh --- a/src/cpu/o3/thread_context.hh Thu May 10 18:04:29 2012 -0500 +++ b/src/cpu/o3/thread_context.hh Tue May 15 05:44:20 2012 -0700 @@ -85,7 +85,7 @@ CheckerCPU *getCheckerCpuPtr() { return NULL; } - Decoder *getDecoderPtr() { return &cpu->fetch.decoder; } + TheISA::Decoder *getDecoderPtr() { return &cpu->fetch.decoder; } /** Returns a pointer to this CPU. */ virtual BaseCPU *getCpuPtr() { return cpu; } diff -r f681719e2e99 -r aede609c2ff0 src/cpu/simple/base.hh --- a/src/cpu/simple/base.hh Thu May 10 18:04:29 2012 -0500 +++ b/src/cpu/simple/base.hh Tue May 15 05:44:20 2012 -0700 @@ -45,12 +45,12 @@ #ifndef __CPU_SIMPLE_BASE_HH__ #define __CPU_SIMPLE_BASE_HH__ +#include "arch/decoder.hh" #include "arch/predecoder.hh" #include "base/statistics.hh" #include "config/the_isa.hh" #include "cpu/base.hh" #include "cpu/checker/cpu.hh" -#include "cpu/decode.hh" #include "cpu/pc_event.hh" #include "cpu/simple_thread.hh" #include "cpu/static_inst.hh" diff -r f681719e2e99 -r aede609c2ff0 src/cpu/simple_thread.hh --- a/src/cpu/simple_thread.hh Thu May 10 18:04:29 2012 -0500 +++ b/src/cpu/simple_thread.hh Tue May 15 05:44:20 2012 -0700 @@ -44,6 +44,7 @@ #ifndef __CPU_SIMPLE_THREAD_HH__ #define __CPU_SIMPLE_THREAD_HH__ +#include "arch/decoder.hh" #include "arch/isa.hh" #include "arch/isa_traits.hh" #include "arch/registers.hh" @@ -51,7 +52,6 @@ #include "arch/types.hh" #include "base/types.hh" #include "config/the_isa.hh" -#include "cpu/decode.hh" #include "cpu/thread_context.hh" #include "cpu/thread_state.hh" #include "debug/FloatRegs.hh" @@ -128,7 +128,7 @@ TheISA::TLB *itb; TheISA::TLB *dtb; - Decoder decoder; + TheISA::Decoder decoder; // constructor: initialize SimpleThread from given process structure // FS @@ -199,7 +199,7 @@ CheckerCPU *getCheckerCpuPtr() { return NULL; } - Decoder *getDecoderPtr() { return &decoder; } + TheISA::Decoder *getDecoderPtr() { return &decoder; } System *getSystemPtr() { return system; } diff -r f681719e2e99 -r aede609c2ff0 src/cpu/thread_context.hh --- a/src/cpu/thread_context.hh Thu May 10 18:04:29 2012 -0500 +++ b/src/cpu/thread_context.hh Tue May 15 05:44:20 2012 -0700 @@ -55,12 +55,12 @@ // DTB pointers. namespace TheISA { + class Decoder; class TLB; } class BaseCPU; class CheckerCPU; class Checkpoint; -class Decoder; class EndQuiesceEvent; class SETranslatingPortProxy; class FSTranslatingPortProxy; @@ -135,7 +135,7 @@ virtual CheckerCPU *getCheckerCpuPtr() = 0; - virtual Decoder *getDecoderPtr() = 0; + virtual TheISA::Decoder *getDecoderPtr() = 0; virtual System *getSystemPtr() = 0; @@ -306,7 +306,7 @@ CheckerCPU *getCheckerCpuPtr() { return actualTC->getCheckerCpuPtr(); } - Decoder *getDecoderPtr() { return actualTC->getDecoderPtr(); } + TheISA::Decoder *getDecoderPtr() { return actualTC->getDecoderPtr(); } System *getSystemPtr() { return actualTC->getSystemPtr(); }