add regspec_decode which takes readmode arg and returns read/write
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 1 Dec 2021 12:06:46 +0000 (12:06 +0000)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 1 Dec 2021 13:43:59 +0000 (13:43 +0000)
as appropriate

src/openpower/decoder/power_regspec_map.py

index c9b1c074411606bda85a380647cb4e7577f088c1..4a738557f5d44194b08949eb52ffd8e6e5185528 100644 (file)
@@ -198,3 +198,9 @@ def regspec_decode_write(e, regfile, name):
 
     assert False, "regspec not found %s %s" % (regfile, name)
 
+
+def regspec_decode(readmode, e, regfile, name):
+    if readmode:
+        return regspec_decode_read(e, regfile, name)
+    return regspec_decode_write(e, regfile, name)
+