From: Gabe Black Date: Mon, 13 Oct 2008 00:52:51 +0000 (-0700) Subject: X86: Create a handy way to access labels from the ROM in microcode. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=cefb768131b1d0582c5cbe83feaa97060dfe15af;p=gem5.git X86: Create a handy way to access labels from the ROM in microcode. --- diff --git a/src/arch/x86/isa/microasm.isa b/src/arch/x86/isa/microasm.isa index 9a5019f10..d7b008145 100644 --- a/src/arch/x86/isa/microasm.isa +++ b/src/arch/x86/isa/microasm.isa @@ -183,6 +183,11 @@ let {{ assembler.symbols["label"] = labeler + def rom_labeler(labelStr): + return "romMicroPC(RomLabels::extern_label_%s)" % labelStr + + assembler.symbols["rom_label"] = rom_labeler + def stack_index(index): return "(NUM_FLOATREGS + (((%s) + 8) %% 8))" % index diff --git a/src/arch/x86/isa/microops/base.isa b/src/arch/x86/isa/microops/base.isa index 994e997d8..057d237ad 100644 --- a/src/arch/x86/isa/microops/base.isa +++ b/src/arch/x86/isa/microops/base.isa @@ -88,6 +88,7 @@ let {{ // env may not be used in the microop's constructor. RegIndex reg = env.reg; reg = reg; + using namespace RomLabels; return %s; } ''' diff --git a/src/arch/x86/isa/rom.isa b/src/arch/x86/isa/rom.isa index 7d3eb8670..59b280056 100644 --- a/src/arch/x86/isa/rom.isa +++ b/src/arch/x86/isa/rom.isa @@ -55,9 +55,6 @@ let {{ def getDeclaration(self): declareLabels = "namespace RomLabels {\n" - for (label, microop) in self.labels.items(): - declareLabels += "const static uint64_t label_%s = %d;\n" \ - % (label, microop.micropc) for (label, microop) in self.externs.items(): declareLabels += \ "const static MicroPC extern_label_%s = %d;\n" \