X86: Implement the cda microop which checks if an address is legal to write to.
authorGabe Black <gblack@eecs.umich.edu>
Mon, 22 Oct 2007 21:30:56 +0000 (14:30 -0700)
committerGabe Black <gblack@eecs.umich.edu>
Mon, 22 Oct 2007 21:30:56 +0000 (14:30 -0700)
--HG--
extra : convert_revision : afe20649180dd59ad0702b98f7293be6c9226359

src/arch/x86/isa/microops/ldstop.isa

index c9ace47905f3d64eff828285a874677e764c175c..61adde8d1b2324d384bc136aeed44d4a3c044b5b 100644 (file)
@@ -445,5 +445,27 @@ let {{
             self.mnemonic = "lea"
 
     microopClasses["lea"] = LeaOp
+
+
+    iop = InstObjParams("cda", "Cda", 'X86ISA::LdStOp',
+            {"code": '''
+            Addr paddr;
+            fault = xc->translateDataWriteAddr(EA, paddr,
+                dataSize, (1 << segment));
+            ''',
+            "ea_code": calculateEA})
+    header_output += MicroLeaDeclare.subst(iop)
+    decoder_output += MicroLdStOpConstructor.subst(iop)
+    exec_output += MicroLeaExecute.subst(iop)
+
+    class CdaOp(LdStOp):
+        def __init__(self, segment, addr, disp = 0,
+                dataSize="env.dataSize", addressSize="env.addressSize"):
+            super(CdaOp, self).__init__("NUM_INTREGS", segment,
+                    addr, disp, dataSize, addressSize)
+            self.className = "Cda"
+            self.mnemonic = "cda"
+
+    microopClasses["cda"] = CdaOp
 }};