python: Fix cxx_ini_parse for ScopedEnum
authorNikos Nikoleris <nikos.nikoleris@arm.com>
Fri, 7 Jun 2019 12:37:56 +0000 (13:37 +0100)
committerNikos Nikoleris <nikos.nikoleris@arm.com>
Mon, 10 Jun 2019 17:36:55 +0000 (17:36 +0000)
Change-Id: I69534bbbc16b2d24a65fa1dee4926f213c3618ef
Signed-off-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/19152
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/python/m5/params.py

index c1c6ca94717cbd9659b4347fd384207f032a5652..da1304d9c658f13e2d6f0560e050efaf21b98f10 100644 (file)
@@ -1485,7 +1485,9 @@ class Enum(ParamValue):
         for elem_name in cls.map.keys():
             code('} else if (%s == "%s") {' % (src, elem_name))
             code.indent()
-            code('%s = Enums::%s;' % (dest, elem_name))
+            name = cls.__name__ if cls.enum_name is None else cls.enum_name
+            code('%s = %s::%s;' % (dest, name if cls.is_class else 'Enums',
+                                   elem_name))
             code('%s true;' % ret)
             code.dedent()
         code('} else {')