Gabe Black has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/49707 )

Change subject: arch: Stop using TheISA:: in the ISA parser.
......................................................................

arch: Stop using TheISA:: in the ISA parser.

The ISA description provides us with a namespace to use, so we can use
that instead of TheISA.

Change-Id: If1a13c39a09ab22c7cab1138220fa0162fc2effa
---
M src/arch/isa_parser/operand_types.py
1 file changed, 10 insertions(+), 12 deletions(-)



diff --git a/src/arch/isa_parser/operand_types.py b/src/arch/isa_parser/operand_types.py
index 14fa332..51fc5d1 100755
--- a/src/arch/isa_parser/operand_types.py
+++ b/src/arch/isa_parser/operand_types.py
@@ -76,6 +76,7 @@
         }''' % (self.dflt_ctype, self.base_name, code)

     def __init__(self, parser, full_name, ext, is_src, is_dest):
+        self.parser = parser
         self.full_name = full_name
         self.ext = ext
         self.is_src = is_src
@@ -311,7 +312,6 @@
     def __init__(self, parser, full_name, ext, is_src, is_dest):
         Operand.__init__(self, parser, full_name, ext, is_src, is_dest)
         self.elemExt = None
-        self.parser = parser

     def isReg(self):
         return 1
@@ -379,8 +379,8 @@
             rindex = '%d' % self.dest_reg_idx

         c_readw = f'\t\tauto &tmp_d{rindex} = \n' \
-                  f'\t\t    *(TheISA::VecRegContainer *)xc->{func}(\n' \
-                  f'\t\t    this, {rindex});\n'
+ f'\t\t *({self.parser.namespace}::VecRegContainer *)\n' \
+                  f'\t\t    xc->{func}(this, {rindex});\n'
         if self.elemExt:
c_readw += '\t\tauto %s = tmp_d%s.as<%s>();\n' % (self.base_name,
                         rindex, self.parser.operandTypeMap[self.elemExt])
@@ -421,7 +421,8 @@
         if self.is_dest and self.is_src:
             name += '_merger'

-        c_read = f'\t\tTheISA::VecRegContainer tmp_s{rindex};\n' \
+        c_read = f'\t\t{self.parser.namespace}::VecRegContainer ' \
+                 f'\t\t        tmp_s{rindex};\n' \
                  f'\t\txc->{func}(this, {rindex}, &tmp_s{rindex});\n'
         # If the parser has detected that elements are being access, create
         # the appropriate view
@@ -498,10 +499,6 @@
 class VecPredRegOperand(Operand):
     reg_class = 'VecPredRegClass'

-    def __init__(self, parser, full_name, ext, is_src, is_dest):
-        Operand.__init__(self, parser, full_name, ext, is_src, is_dest)
-        self.parser = parser
-
     def isReg(self):
         return 1

@@ -534,7 +531,8 @@
         else:
             rindex = '%d' % self.src_reg_idx

-        c_read =  f'\t\tTheISA::VecPredRegContainer tmp_s{rindex}; ' \
+        c_read =  f'\t\t{self.parser.namespace}::VecPredRegContainer ' \
+                  f'\t\t        tmp_s{rindex}; ' \
                   f'xc->{func}(this, {rindex}, &tmp_s{rindex});\n'
         if self.ext:
             c_read += f'\t\tauto {self.base_name} = ' \
@@ -553,8 +551,8 @@
             rindex = '%d' % self.dest_reg_idx

         c_readw = f'\t\tauto &tmp_d{rindex} = \n' \
- f'\t\t *(TheISA::VecPredRegContainer *)xc->{func}(\n' \
-                  f'\t\t    this, {rindex});\n'
+                  f'\t\t    *({self.parser.namespace}::' \
+                  f'VecPredRegContainer *)xc->{func}(this, {rindex});\n'
         if self.ext:
             c_readw += '\t\tauto %s = tmp_d%s.as<%s>();\n' % (
                     self.base_name, rindex,
@@ -748,7 +746,7 @@
             return 'xc->pcState(%s);\n' % self.base_name

     def makeDecl(self):
-        ctype = 'TheISA::PCState'
+        ctype = f'{self.parser.namespace}::PCState'
         if self.isPCPart():
             ctype = self.ctype
         # Note that initializations in the declarations are solely

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/49707
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: If1a13c39a09ab22c7cab1138220fa0162fc2effa
Gerrit-Change-Number: 49707
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to