diff options
author | Gabe Black <gblack@eecs.umich.edu> | 2008-10-12 17:48:44 -0700 |
---|---|---|
committer | Gabe Black <gblack@eecs.umich.edu> | 2008-10-12 17:48:44 -0700 |
commit | e5f80924671bf0cfaf02c51f4b98d529631733f1 (patch) | |
tree | 1bdc1b3d0178e4648bbde6f4de378a20d295d027 /src/arch/x86/isa/microops/base.isa | |
parent | c9ea0b73492bf116c836c54199898f29d9664bc0 (diff) | |
download | gem5-e5f80924671bf0cfaf02c51f4b98d529631733f1.tar.xz |
X86: Make X86's microcode ROM actually do something.
Diffstat (limited to 'src/arch/x86/isa/microops/base.isa')
-rw-r--r-- | src/arch/x86/isa/microops/base.isa | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/arch/x86/isa/microops/base.isa b/src/arch/x86/isa/microops/base.isa index 75658a26c..994e997d8 100644 --- a/src/arch/x86/isa/microops/base.isa +++ b/src/arch/x86/isa/microops/base.isa @@ -69,6 +69,28 @@ let {{ let {{ class X86Microop(object): + + generatorNameTemplate = "generate_%s_%d" + + generatorTemplate = ''' + StaticInstPtr + ''' + generatorNameTemplate + '''(StaticInstPtr curMacroop) + { + static const char * mnemonic = romMnemonic; + static const ExtMachInst dummyExtMachInst; + static const EmulEnv dummyEmulEnv(0, 0, 1, 1, 1); + + Macroop * macroop = dynamic_cast<Macroop *>(curMacroop.get()); + const ExtMachInst &machInst = + macroop ? macroop->getExtMachInst() : dummyExtMachInst; + const EmulEnv &env = + macroop ? macroop->getEmulEnv() : dummyEmulEnv; + // env may not be used in the microop's constructor. + RegIndex reg = env.reg; + reg = reg; + return %s; + } + ''' def __init__(self, name): self.name = name @@ -91,4 +113,12 @@ let {{ def getAllocator(self, mnemonic, *microFlags): return 'new %s(machInst, %s)' % \ (self.className, mnemonic, self.microFlagsText(microFlags)) + + def getGeneratorDef(self, micropc): + return self.generatorTemplate % \ + (self.className, micropc, \ + self.getAllocator(True, False, False, False)) + + def getGenerator(self, micropc): + return self.generatorNameTemplate % (self.className, micropc) }}; |