Gabe Black has uploaded this change for review. (
https://gem5-review.googlesource.com/c/public/gem5/+/56670 )
Change subject: arch-x86: Move the statically declared microcode ROM.
......................................................................
arch-x86: Move the statically declared microcode ROM.
Move it out of the decoder and into the microcode_rom.hh file. This will
make it less messy to have it dynamically constructed from smaller
parts.
Change-Id: I4f574053e31254f0b0a9b7406568ed2269362d3c
---
M src/arch/x86/SConscript
M src/arch/x86/decoder.cc
M src/arch/x86/decoder.hh
A src/arch/x86/microcode_rom.cc
M src/arch/x86/microcode_rom.hh
5 files changed, 52 insertions(+), 11 deletions(-)
diff --git a/src/arch/x86/SConscript b/src/arch/x86/SConscript
index 7e24b38..5c80532 100644
--- a/src/arch/x86/SConscript
+++ b/src/arch/x86/SConscript
@@ -52,6 +52,7 @@
Source('insts/static_inst.cc', tags='x86 isa')
Source('interrupts.cc', tags='x86 isa')
Source('isa.cc', tags='x86 isa')
+Source('microcode_rom.cc', tags='x86 isa')
Source('nativetrace.cc', tags='x86 isa')
Source('pagetable.cc', tags='x86 isa')
Source('pagetable_walker.cc', tags='x86 isa')
diff --git a/src/arch/x86/decoder.cc b/src/arch/x86/decoder.cc
index ef87ff3..d1262f0 100644
--- a/src/arch/x86/decoder.cc
+++ b/src/arch/x86/decoder.cc
@@ -41,8 +41,6 @@
namespace X86ISA
{
-X86ISAInst::MicrocodeRom Decoder::microcodeRom;
-
Decoder::State
Decoder::doResetState()
{
@@ -739,7 +737,7 @@
StaticInstPtr
Decoder::fetchRomMicroop(MicroPC micropc, StaticInstPtr curMacroop)
{
- return microcodeRom.fetchMicroop(micropc, curMacroop);
+ return X86ISAInst::microcodeRom.fetchMicroop(micropc, curMacroop);
}
} // namespace X86ISA
diff --git a/src/arch/x86/decoder.hh b/src/arch/x86/decoder.hh
index 29415ef..f3dd870 100644
--- a/src/arch/x86/decoder.hh
+++ b/src/arch/x86/decoder.hh
@@ -71,8 +71,6 @@
static ByteTable ImmediateTypeThreeByte0F38;
static ByteTable ImmediateTypeThreeByte0F3A;
- static X86ISAInst::MicrocodeRom microcodeRom;
-
protected:
using MachInst = uint64_t;
diff --git a/src/arch/x86/microcode_rom.cc b/src/arch/x86/microcode_rom.cc
new file mode 100644
index 0000000..e505e31
--- /dev/null
+++ b/src/arch/x86/microcode_rom.cc
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2022 Google, Inc
+ *
+ * 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.
+ */
+
+#include "arch/x86/microcode_rom.hh"
+
+namespace gem5::X86ISAInst
+{
+
+MicrocodeRom microcodeRom;
+
+} // namespace gem5::X86ISAInst
diff --git a/src/arch/x86/microcode_rom.hh b/src/arch/x86/microcode_rom.hh
index 34115d9..4dd559e 100644
--- a/src/arch/x86/microcode_rom.hh
+++ b/src/arch/x86/microcode_rom.hh
@@ -78,13 +78,9 @@
}
};
+extern MicrocodeRom microcodeRom;
+
} // namespace X86ISAInst
-
-namespace X86ISA
-{
-
-
-} // namespace X86ISA
} // namespace gem5
#endif // __ARCH_X86_MICROCODE_ROM_HH__
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/56670
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I4f574053e31254f0b0a9b7406568ed2269362d3c
Gerrit-Change-Number: 56670
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black <gabe.bl...@gmail.com>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s