yuk. break id_regs.py being a generic tool by skipping csr ops
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sun, 30 Sep 2018 03:25:28 +0000 (04:25 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sun, 30 Sep 2018 03:25:28 +0000 (04:25 +0100)
trying to use c preprocessor macros to skip CSRs in sv from being
parallelised is too painful, and is necessary to do.  a parallel CSR
read/write does not make sense

id_regs.py

index 6b8a678c14ad5d544b4f73a553f65eb0afa3ca82..0a990043d926fc65a402a013c25faff743e47048 100644 (file)
@@ -52,7 +52,12 @@ allfloats = floatpatterns + cfloatpatterns
 floatmask = (1<<len(allfloats)-1)
 allints = intpatterns + cintpatterns[2:]
 
+skip = '#define USING_NOREGS\n' \
+       '#define REGS_PATTERN 0x0\n'
 def find_registers(fname):
+    # HACK! macro-skipping csr* instructions too painful
+    if 'csr' in fname:
+        return skip
     res = []
     isintfloat = 0x0 + floatmask << len(allints)
     with open(fname) as f:
@@ -88,8 +93,7 @@ def find_registers(fname):
                 isintfloat &= ~(1 << (idx+len(allints)))
             res.append('#define USING_REG_%s' % p)
     if not res:
-        return '#define USING_NOREGS\n' \
-               '#define REGS_PATTERN 0x0\n'
+        return skip
     res.append('#define REGS_PATTERN 0x%x' % isintfloat)
     return '\n'.join(res)