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/mips/decoder.hh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/arch/mips') diff --git a/src/arch/mips/decoder.hh b/src/arch/mips/decoder.hh index a3a68ad07..59e040658 100644 --- a/src/arch/mips/decoder.hh +++ b/src/arch/mips/decoder.hh @@ -40,6 +40,7 @@ namespace MipsISA { +class ISA; class Decoder { protected: @@ -48,7 +49,7 @@ class Decoder bool instDone; public: - Decoder() : instDone(false) + Decoder(ISA* isa = nullptr) : instDone(false) {} void -- cgit v1.2.3