summaryrefslogtreecommitdiff
path: root/src/arch/x86/isa/macroop.isa
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2007-08-26 20:39:55 -0700
committerGabe Black <gblack@eecs.umich.edu>2007-08-26 20:39:55 -0700
commit8b738f7f125a90b482aa7b3637cd5c49d78701fe (patch)
treec22d112c303a7097b6f11ea1943cacb4553b5d66 /src/arch/x86/isa/macroop.isa
parent03880cf828d747a68c013c05003a51266ef9a512 (diff)
downloadgem5-8b738f7f125a90b482aa7b3637cd5c49d78701fe.tar.xz
X86: Make the microassembler accept lines which are just labels.
The labels on these lines will be associated with whatever the next microop is. --HG-- extra : convert_revision : 80c260e48ec1c16e6325061608e37c95a0610cfa
Diffstat (limited to 'src/arch/x86/isa/macroop.isa')
-rw-r--r--src/arch/x86/isa/macroop.isa14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/arch/x86/isa/macroop.isa b/src/arch/x86/isa/macroop.isa
index 4675b9d56..fdfea6136 100644
--- a/src/arch/x86/isa/macroop.isa
+++ b/src/arch/x86/isa/macroop.isa
@@ -126,6 +126,8 @@ def template MacroDeclare {{
*/
class %(class_name)s : public %(base_class)s
{
+ private:
+ %(declareLabels)s
public:
// Constructor.
%(class_name)s(ExtMachInst machInst, X86ISA::EmulEnv env);
@@ -151,6 +153,9 @@ def template MacroConstructor {{
let {{
from micro_asm import Combinational_Macroop, Rom_Macroop
class X86Macroop(Combinational_Macroop):
+ def add_microop(self, microop):
+ microop.micropc = len(self.microops)
+ self.microops.append(microop)
def setAdjustEnv(self, val):
self.adjust_env = val
def __init__(self, name):
@@ -166,7 +171,14 @@ let {{
def getDeclaration(self):
#FIXME This first parameter should be the mnemonic. I need to
#write some code which pulls that out
- iop = InstObjParams(self.name, self.name, "Macroop", {"code" : ""})
+ declareLabels = ""
+ for (label, microop) in self.labels.items():
+ declareLabels += "const static uint64_t label_%s = %d;\n" \
+ % (label, microop.micropc)
+ iop = InstObjParams(self.name, self.name, "Macroop",
+ {"code" : "",
+ "declareLabels" : declareLabels
+ })
return MacroDeclare.subst(iop);
def getDefinition(self):
#FIXME This first parameter should be the mnemonic. I need to