diff options
Diffstat (limited to 'src/python/m5/params.py')
-rw-r--r-- | src/python/m5/params.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/python/m5/params.py b/src/python/m5/params.py index b7fa60782..3dcbecd2f 100644 --- a/src/python/m5/params.py +++ b/src/python/m5/params.py @@ -1363,6 +1363,10 @@ class PortRef(object): def ini_str(self): return str(self.peer) + # for config.json + def get_config_as_dict(self): + return {'role' : self.role, 'peer' : str(self.peer)} + def __getattr__(self, attr): if attr == 'peerObj': # shorthand for proxies @@ -1480,6 +1484,11 @@ class VectorPortRef(object): def ini_str(self): return ' '.join([el.ini_str() for el in self.elements]) + # for config.json + def get_config_as_dict(self): + return {'role' : self.role, + 'peer' : [el.ini_str() for el in self.elements]} + def __getitem__(self, key): if not isinstance(key, int): raise TypeError, "VectorPort index must be integer" |