From d3d159749a0a6c3b69a9181fab8db34b6ba0f7a1 Mon Sep 17 00:00:00 2001 From: Rekai Gonzalez Alberquilla Date: Fri, 9 Oct 2015 14:50:54 -0500 Subject: isa: Add parameter to pick different decoder inside ISA The decoder is responsible for splitting instructions in micro operations (uops). Given that different micro architectures may split operations differently, this patch allows to specify which micro architecture each isa implements, so different cores in the system can split instructions differently, also decoupling uop splitting (microArch) from ISA (Arch). This is done making the decodification calls templates that receive a type 'DecoderFlavour' that maps the name of the operation to the class that implements it. This way there is only one selection point (converting the command line enum to the appropriate DecodeFeatures object). In addition, there is no explicit code replication: template instantiation hides that, and the compiler should be able to resolve a number of things at compile-time. --- src/arch/arm/decoder.hh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/arch/arm/decoder.hh') diff --git a/src/arch/arm/decoder.hh b/src/arch/arm/decoder.hh index 757b6d683..f8748ab5e 100644 --- a/src/arch/arm/decoder.hh +++ b/src/arch/arm/decoder.hh @@ -50,10 +50,12 @@ #include "arch/generic/decode_cache.hh" #include "base/types.hh" #include "cpu/static_inst.hh" +#include "enums/DecoderFlavour.hh" namespace ArmISA { +class ISA; class Decoder { protected: @@ -70,6 +72,8 @@ class Decoder int fpscrLen; int fpscrStride; + Enums::DecoderFlavour decoderFlavour; + /// A cache of decoded instruction objects. static GenericISA::BasicDecodeCache defaultCache; @@ -86,7 +90,7 @@ class Decoder void consumeBytes(int numBytes); public: // Decoder API - Decoder(); + Decoder(ISA* isa = nullptr); /** Reset the decoders internal state. */ void reset(); -- cgit v1.2.3